subroutine hec_tdc_evt c c process the raw tdc time c improved by A. Minaenko, Nov 00 c implicit none c include'hec_par.inc' !shared parameters include'hec_datacard.inc' !datacard values include'hec_geo.inc' ! geometry correspondence tables include'hec_runh.inc' !run header values include'hec_tdc.inc' !tdc values include'hec_trig.inc' ! event trigger c integer tdc_raw_min_c c c reset some variables from hec_tdc.inc c only tdc_ns is used in the dig package c tdc_ns = 0. tdc_raw_shift = 0 tdc_br_point = 0 tdc_dubious = .false. c c from April 1998 onwards c the wrap around constant depends on the daq trigger type c if (irunpd .ge. 7) then if (trig_wac_c .or. trig_wac_epi .or. trig_wac_mu) then if (trig_wac_c) then tdc_br_point = tdc_wac_c elseif (trig_wac_epi) then tdc_br_point = tdc_wac_epi else tdc_br_point = tdc_wac_mu endif tdc_raw_min_c = tdc_wac_reference - nint(25./tdc_raw_to_ns) tdc_raw_shift = 2*(tdc_br_point - tdc_wac_reference) + + tdc_raw_min_c else tdc_br_point = 9999 tdc_raw_shift = 0 endif if ((iabs(tdc_raw-tdc_br_point)) .le. tdc_guard_region) then tdc_dubious = .true. endif tdc_ns = (tdc_raw - tdc_raw_shift) * tdc_raw_to_ns if (tdc_raw .gt. tdc_br_point) tdc_ns = tdc_ns - 25. c c October 1997 c elseif (irunpd .eq. 6) then tdc_ns = tdc_raw * tdc_raw_to_ns if (tdc_ns .gt. tdc_ns_shift) then tdc_ns = tdc_ns - 25. endif endif c end