Skip to content
Snippets Groups Projects
Commit b630d415 authored by Cdaq Account's avatar Cdaq Account
Browse files

Add fCosmicFlag to Hodoscope class

The fCosmicFlag is used in EstimateFocalPlaneTime
The start time for the drift chamber is determined as an average
of the focal plane times for each hodo plane. Need to account for
the TOF from the hodoscope to the focal plane (z=0). For cosmic
data need to add this TOF to the corrected scintillator time, while
usually one needs to subtract this TOF. Add a flag as parameter to
switch between these modes.
parent 84fdaea8
No related branches found
No related tags found
No related merge requests found
...@@ -312,6 +312,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) ...@@ -312,6 +312,7 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
} }
DBRequest list[]={ DBRequest list[]={
{"cosmicflag", &fCosmicFlag, kInt},
{"start_time_center", &fStartTimeCenter, kDouble}, {"start_time_center", &fStartTimeCenter, kDouble},
{"start_time_slop", &fStartTimeSlop, kDouble}, {"start_time_slop", &fStartTimeSlop, kDouble},
{"scin_tdc_to_time", &fScinTdcToTime, kDouble}, {"scin_tdc_to_time", &fScinTdcToTime, kDouble},
...@@ -348,11 +349,13 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) ...@@ -348,11 +349,13 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
fTofTolerance = 3.0; fTofTolerance = 3.0;
fNCerNPE = 2.0; fNCerNPE = 2.0;
fNormETot = 0.7; fNormETot = 0.7;
fCosmicFlag=0;
// Gets added to each reference time corrected raw TDC value // Gets added to each reference time corrected raw TDC value
// to make sure valid range is all positive. // to make sure valid range is all positive.
gHcParms->LoadParmValues((DBRequest*)&list,prefix); gHcParms->LoadParmValues((DBRequest*)&list,prefix);
if (fCosmicFlag==1) cout << " setup for cosmics in TOF"<< endl;
cout << " cosmic flag = " << fCosmicFlag << endl;
if(fDumpTOF) { if(fDumpTOF) {
fDumpOut.open(fTOFDumpFile.c_str()); fDumpOut.open(fTOFDumpFile.c_str());
if(fDumpOut.is_open()) { if(fDumpOut.is_open()) {
...@@ -718,9 +721,16 @@ void THcHodoscope::EstimateFocalPlaneTime( void ) ...@@ -718,9 +721,16 @@ void THcHodoscope::EstimateFocalPlaneTime( void )
// Both tubes fired // Both tubes fired
Int_t index=hit->GetPaddleNumber()-1; Int_t index=hit->GetPaddleNumber()-1;
// Need to put this in a multihit histo // Need to put this in a multihit histo
Double_t fptime = hit->GetScinCorrectedTime() Double_t fptime;
if(fCosmicFlag==1) {
fptime = hit->GetScinCorrectedTime()
+ (fPlanes[ip]->GetZpos()+(index%2)*fPlanes[ip]->GetDzpos())
/ (29.979 * fBetaNominal);
}else{
fptime = hit->GetScinCorrectedTime()
- (fPlanes[ip]->GetZpos()+(index%2)*fPlanes[ip]->GetDzpos()) - (fPlanes[ip]->GetZpos()+(index%2)*fPlanes[ip]->GetDzpos())
/ (29.979 * fBetaNominal); / (29.979 * fBetaNominal);
}
if(TMath::Abs(fptime-fStartTimeCenter)<=fStartTimeSlop) { if(TMath::Abs(fptime-fStartTimeCenter)<=fStartTimeSlop) {
Ngood_hits_plane++; Ngood_hits_plane++;
Plane_fptime_sum+=fptime; Plane_fptime_sum+=fptime;
...@@ -741,9 +751,11 @@ void THcHodoscope::EstimateFocalPlaneTime( void ) ...@@ -741,9 +751,11 @@ void THcHodoscope::EstimateFocalPlaneTime( void )
if(fNfptimes>0) { if(fNfptimes>0) {
fStartTime = fpTimeSum/fNfptimes; fStartTime = fpTimeSum/fNfptimes;
fGoodStartTime=kTRUE; fGoodStartTime=kTRUE;
fFPTimeAll = fStartTime ;
} else { } else {
fStartTime = fStartTimeCenter; fStartTime = fStartTimeCenter;
fGoodStartTime=kFALSE; fGoodStartTime=kFALSE;
fFPTimeAll = fStartTime ;
} }
if((goodplanetime[0]||goodplanetime[1]) if((goodplanetime[0]||goodplanetime[1])
&&(goodplanetime[2]||goodplanetime[3])) { &&(goodplanetime[2]||goodplanetime[3])) {
......
...@@ -142,6 +142,7 @@ protected: ...@@ -142,6 +142,7 @@ protected:
UInt_t fMaxScinPerPlane,fMaxHodoScin; // max number of scin/plane; product of the first two UInt_t fMaxScinPerPlane,fMaxHodoScin; // max number of scin/plane; product of the first two
Double_t fStartTimeCenter, fStartTimeSlop, fScinTdcToTime; Double_t fStartTimeCenter, fStartTimeSlop, fScinTdcToTime;
Double_t fTofTolerance; Double_t fTofTolerance;
Int_t fCosmicFlag; //
Double_t fPathLengthCentral; Double_t fPathLengthCentral;
Double_t fScinTdcMin, fScinTdcMax; // min and max TDC values Double_t fScinTdcMin, fScinTdcMax; // min and max TDC values
char** fPlaneNames; char** fPlaneNames;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment