JeffersonLab / hcana

Hall C++ Analyzer
7 stars 118 forks source link

Modify THcCoinTime and THcTrigDet #412

Closed MarkKJones closed 5 years ago

MarkKJones commented 5 years ago

1) THcTrigDet a) Modify code to use string vector fTrigNames to identify which of the trigger detector TDC signals to use for coincidence timing. This replaces the hard-coded names. The integer array fTrigId[4] keeps track of the array ID in the overall fTDcNames vector that goes with the fTrigNames[4] b) The fTrigNames must be in order of SHMS ROC1, HMS ROC1, SHMS ROC2 and HMS ROC2. c) Default names are "pTRIG1_ROC1","pTRIG4_ROC1","pTRIG1_ROC2","pTRIG4_ROC2" The parameter is t_coin_trigNames For example: t_coin_trigNames="pTRIG1_ROC1 pTRIG4_ROC1 pTRIG1_ROC2 pTRIG4_ROC2" This parameter is read-in and then split into a string vector fTrigNames. d) In HcTrigDet::ReadDatabase , all members of fTrigID array are set to -1 then a loop over all Tdc in the trigger detector looks for match between fTdcNames amd fTrigNames to set fTrigId. If match not found the fTrigId = -1. e) In THcTrigDet.h made new method Get_CT_TrigTime(Int_t ii) to be used in in THcCoinTime to get the 4 trigger times: SHMS ROC1 (ii=0), HMS ROC1 (ii=1), SHMS ROC2 (ii=2) and HMS ROC2 (ii=3). If fTrigId[ii]=-1 then it returns 0 otherwise returns fTdcTime[fTrigID[ii]].

2) THcCoinTime a) Previously used the raw trigger times and had a hard-coded 0.1 ns/channel conversion. Now use the trigger times which already are in ns using the ns/channel conversion set in the TrigDet. b) Now use the new TrigDet method Get_CT_TrigTime(ii) to get the trigger times for SHMS ROC1, HMS ROC1, SHMS ROC2 and HMS ROC2.