subroutine hec_dig_evt c c find the signal peak using digital filtering method c implicit none c include'hec_par.inc' ! shared parameters include'hec_adc.inc' ! adc values include'hec_datacard.inc' !datacard values include'hec_dig.inc' ! digital filtering common include'hec_dig_sys.inc' ! digital filtering system common include'hec_geo.inc' ! geometry correspondence tables include'hec_ped.inc' ! pedestal vaules include'hec_tdc.inc' c c local variables c integer ic, i_t, i_t0, i_t_dig real signal(mx_dig_nslice), signal_max, time_of_max c c initialize variables c call vzero(adc_dig_ic, i_adc_dim*2) call vzero(signal, mx_dig_nslice) c c calculate weights for each timeslice, for each channel, for this event c also obtain the time phases and the time slice shifts c call hec_dig_calc_weights c c apply weights and make fit. Pass in array containing 5 time slices c to fit on (this array numbers the slices 1->5) c do ic = 1, i_adc_used i_t_dig = 0 if (t0_dig .gt. 0) then ! force first time slice to be used i_t0 = t0_dig else ! normal operation i_t0 = dig_slice_1 + dig_slice_shift(ic) endif do i_t = i_t0, i_t0 + dig_nslice - 1 i_t_dig = i_t_dig + 1 signal(i_t_dig) = real(i_adc_ic_t(ic, i_t)) - adc_ped(ic) enddo c call hec_dig_fit(ic, signal, signal_max, time_of_max) c c fill hec_dig common block c adc_dig_ic(ic,1) = signal_max adc_dig_ic(ic,2) = time_of_max enddo c end