subroutine hec_tdc_ini c c set the tdc wrap around constants for this run c improved by A. Minaenko, Nov 00 c updated Jun 01 M.L. c implicit none c include'hec_par.inc' ! parameter common include'hec_datacard.inc' ! datacard values include'hec_runh.inc' ! run header include'hec_tdc.inc' ! tdc value c c set conversion constant c the number found September 1999 by Leonid, directly from hardware is c 0.01782 ns/tdc. But, Andrei and Michel find that this value does not c correspond to the best value to use offline, which is 0.01816 ns/tdc. c tdc_raw_to_ns = 0.01816 c c reset some variables c tdc_ns = 0. tdc_raw_shift = 0 c c for various run periods, set the tdc parameters c if (irunpd .eq. 15) then ! aug01 c start with last aug00 values tdc_guard_region = 10 tdc_wac_reference = 1324 tdc_wac_c = 1324 tdc_wac_epi = 1324 ! not measured! tdc_wac_mu = 1324 ! not measured! c elseif (irunpd .eq. 14) then ! jul01 c start with last aug00 values tdc_guard_region = 10 tdc_wac_reference = 1548 tdc_wac_c = 1548 tdc_wac_epi = 1548 tdc_wac_mu = 1548 c elseif (irunpd .eq. 13) then ! aug00 tdc_guard_region = 10 tdc_wac_reference = 1414 c Only trig_wac_c was used for pions and electrons during this run if (run_no .lt. 10368) then tdc_wac_c = 1414 tdc_wac_epi = 1416 ! not checked tdc_wac_mu = 1410 ! not checked else tdc_wac_c = 1530 tdc_wac_epi = 1530 ! not checked tdc_wac_mu = 1530 ! not checked endif c else if (irunpd .eq. 12) then ! jun00 c start with end of August 99 defaults tdc_guard_region = 10 tdc_wac_reference = 1424 tdc_wac_c = 1424 tdc_wac_epi = 1416 tdc_wac_mu = 1410 c else if (irunpd .eq. 11) then ! feb00 c start with end of August 99 defaults tdc_guard_region = 10 tdc_wac_reference = 1424 tdc_wac_c = 1424 tdc_wac_epi = 1416 tdc_wac_mu = 1410 c else if (irunpd .eq. 10) then ! aug99 c for August 1999, the tdc correction changes for run 8896 tdc_guard_region = 10 tdc_wac_reference = 1424 if (run_no .lt. 8896) then tdc_wac_c = 1424 tdc_wac_epi = 2104 tdc_wac_mu = 2310 else tdc_wac_c = 1424 tdc_wac_epi = 1416 tdc_wac_mu = 1410 endif c elseif (irunpd .eq. 9) then ! jun99 c for June 1999, the tdc correction is run independent tdc_guard_region = 10 tdc_wac_reference = 1424 tdc_wac_c = 1424 tdc_wac_epi = 2104 tdc_wac_mu = 2310 c elseif (irunpd .eq. 8) then ! aug98 c for August 1998, the tdc corrections changes for run 7871 c this is preliminary tdc_guard_region = 10 tdc_wac_reference = 1424 if (run_no .lt. 7871) then tdc_wac_c = 1560 tdc_wac_epi = 1660 else tdc_wac_c = 1424 tdc_wac_epi = 2104 endif tdc_wac_mu = 2320 c elseif (irunpd .eq. 7) then ! apr98 c for April 1998, we believe the tdc corrections are run independent c this is preliminary tdc_wac_reference = 1660 if (run_no .le. 7177) then tdc_wac_c = 1910 ! this constant really unknown for this part tdc_wac_epi = 1910 ! true value tdc_wac_mu = 1910 ! this constant really unknown for this part tdc_guard_region = 20 else tdc_wac_c = 1560 tdc_wac_epi = 1660 tdc_wac_mu = 1884 tdc_guard_region = 10 endif c elseif (irunpd .eq. 6) then ! oct97 tdc_ns_shift = 34.5 else print *,' ' print *,' *** hec_tdc_ini: period ',irunpd,' is not initialized' print *,' ' stop endif c c print the values used c if (irunpd .ge. 7) then print *,' ' print *, ' *** tdc wrap around constants used for run number ', + run_no, ' are' print *, ' wac_c = ', tdc_wac_c print *, ' wac_epi = ', tdc_wac_epi print *, ' wac_mu = ', tdc_wac_mu endif c end