subroutine hec_search_evt c c general signal searching routine c c general output in hec_search.inc c c this package can in principle accommodate many different c searching algorithms, including a user defined algorithm c c the first argument of the datacard search is the algorithm c number. c currently implemented: c c Number < 0: c the search package is not used at all and the c hec_search.inc common is reset to a negative c search outcome, that is the common is not to be c used: c hec_s_chan(ic) = .false. c hec_s_result(ic, i_t) = 0 c hec_s_im(ic) = 0 c hec_s_hit = .false. c hence hec_s_cells = 0 c hec_s_count = 0 c c Number 0: c dummy signal search that leaves a positive search for c all channels: c hec_s_chan(ic) = .true. c hec_s_result(ic, i_t) = real(i_adc_ic_t(ic, i_t)) c hec_s_im(ic) = 0 c hec_s_hit = .true. c hence hec_s_cells = i_adc_used c hec_s_count = total number of events c c Number 1: c standard signal search algorithm (D. Striegel). c only physics trigger events are treated by this algorithm c Let the datacard search have the following parameters: c 2= i_t1 c 3= i_t2 c 4= ntc c 5= i_cutflag c 6= cut c for each channel the standard algorithm searches for c the maximum adc in the timeslice range [i_t1, i_t2] c Case i_cutflag = 0: c the time distribution is compared to a valid pulse shape. c the comparison uses ntc timeslices (only the values c 3, 5 and 7 are implemented). c Case i_cutflag = 1: c if this maximum is above the value cut*rms, where rms c is the channel's pedestal rms, then c the time distribution is compared to a valid pulse shape. c the comparison uses ntc timeslices (only the values c 3, 5 and 7 are implemented). c variables specific to this algorithm are in c hec_search_1_sys.inc c c Number >=2: c user signal search algorithm. c the user can provide a routine user_search.f that, c given an event, fills the common hec_search_inc c following a user defined algorithm c the default user algorithm is the dummy algorithm c c From work by D. Striegel c implicit none c include'hec_par.inc' !shared parameters include'hec_datacard.inc' !datacard common include'hec_evth.inc' !event header include'hec_geo.inc' !geometry correspondence tables include'hec_search.inc' !search c integer ic c c only treat data with multiple time slices c negative search is implied (hec_search_ini) c if (irunpd .lt. 4) return c c before the first event, reset global pass quantities c if (i_event .le. 1) then call vzero (hec_s_count, i_adc_dim) endif c c call the selected searching algorithm c if (hec_s_dk .eq. 0) then call hec_search_0 elseif (hec_s_dk .eq. 1) then call hec_search_1 else call user_search endif c c see if there is at least one channel with valid signal c count the number of channels with valid signal c hec_s_hit = .false. hec_s_cells = 0 do ic = 1, i_adc_used if (hec_s_chan(ic)) then hec_s_hit = .true. hec_s_cells = hec_s_cells + 1 hec_s_count(ic) = hec_s_count(ic) + 1 endif enddo c end