From e2c0eb6fcecac8b39f09676b6e488267f63317e9 Mon Sep 17 00:00:00 2001 From: "Stephen A. Wood" <saw@jlab.org> Date: Tue, 5 Dec 2017 10:59:35 -0500 Subject: [PATCH] Suppress missing ref time messages when ref time not expected Each detector object will check the global variable X.present each event. If X.present is false, it indicates that the parent spectrometer object determineted that this spectrometer is not in this event, and therefor reference times are not expected. If X.present is false, then the reference time warning messages will be suppressed. --- src/THcAerogel.cxx | 11 ++++++++++- src/THcAerogel.h | 1 + src/THcCherenkov.cxx | 11 ++++++++++- src/THcCherenkov.h | 1 + src/THcDC.cxx | 14 ++++++++++++-- src/THcDC.h | 4 ++++ src/THcHodoscope.cxx | 13 ++++++++++--- src/THcHodoscope.h | 1 + src/THcShower.cxx | 11 ++++++++++- src/THcShower.h | 1 + 10 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/THcAerogel.cxx b/src/THcAerogel.cxx index 94746cf..3fa912a 100644 --- a/src/THcAerogel.cxx +++ b/src/THcAerogel.cxx @@ -191,6 +191,11 @@ THaAnalysisObject::EStatus THcAerogel::Init( const TDatime& date ) if( (status = THaNonTrackingDetector::Init( date )) ) return fStatus=status; + fPresentP = 0; + THaVar* vpresent = gHaVars->Find(Form("%s.present",GetApparatus()->GetName())); + if(vpresent) { + fPresentP = (Bool_t *) vpresent->GetValuePointer(); + } return fStatus = kOK; } @@ -565,7 +570,11 @@ void THcAerogel::Clear(Option_t* opt) Int_t THcAerogel::Decode( const THaEvData& evdata ) { // Get the Hall C style hitlist (fRawHitList) for this event - fNhits = DecodeToHitList(evdata); + Bool_t present = kTRUE; // Suppress reference time warnings + if(fPresentP) { // if this spectrometer not part of trigger + present = *fPresentP; + } + fNhits = DecodeToHitList(evdata, !present); if (fSixGevData) { if(gHaCuts->Result("Pedestal_event")) { diff --git a/src/THcAerogel.h b/src/THcAerogel.h index 99ec464..6fb8e40 100644 --- a/src/THcAerogel.h +++ b/src/THcAerogel.h @@ -40,6 +40,7 @@ class THcAerogel : public THaNonTrackingDetector, public THcHitList { // Event information Int_t fNhits; + Bool_t* fPresentP; // 12 GeV variables // Vector/TClonesArray length parameters diff --git a/src/THcCherenkov.cxx b/src/THcCherenkov.cxx index 503d9cf..27d081d 100644 --- a/src/THcCherenkov.cxx +++ b/src/THcCherenkov.cxx @@ -152,6 +152,11 @@ THaAnalysisObject::EStatus THcCherenkov::Init( const TDatime& date ) if((status = THaNonTrackingDetector::Init( date ))) return fStatus=status; + fPresentP = 0; + THaVar* vpresent = gHaVars->Find(Form("%s.present",GetApparatus()->GetName())); + if(vpresent) { + fPresentP = (Bool_t *) vpresent->GetValuePointer(); + } return fStatus = kOK; } @@ -340,7 +345,11 @@ void THcCherenkov::Clear(Option_t* opt) Int_t THcCherenkov::Decode( const THaEvData& evdata ) { // Get the Hall C style hitlist (fRawHitList) for this event - fNhits = DecodeToHitList(evdata); + Bool_t present = kTRUE; // Suppress reference time warnings + if(fPresentP) { // if this spectrometer not part of trigger + present = *fPresentP; + } + fNhits = DecodeToHitList(evdata, !present); if(gHaCuts->Result("Pedestal_event")) { AccumulatePedestals(fRawHitList); diff --git a/src/THcCherenkov.h b/src/THcCherenkov.h index 86b6973..0c83a6c 100644 --- a/src/THcCherenkov.h +++ b/src/THcCherenkov.h @@ -43,6 +43,7 @@ class THcCherenkov : public THaNonTrackingDetector, public THcHitList { THcCherenkov(); // for ROOT I/O protected: + Bool_t* fPresentP; Int_t fAnalyzePedestals; Int_t fDebugAdc; Double_t* fWidth; diff --git a/src/THcDC.cxx b/src/THcDC.cxx index dcb5dad..9a7b91a 100644 --- a/src/THcDC.cxx +++ b/src/THcDC.cxx @@ -246,7 +246,12 @@ THaAnalysisObject::EStatus THcDC::Init( const TDatime& date ) // { &fLTNhit, &fLANhit, fLT, fLT_c, fLA, fLA_p, fLA_c, fLOff, fLPed, fLGain } // }; // memcpy( fDataDest, tmp, NDEST*sizeof(DataDest) ); - + + fPresentP = 0; + THaVar* vpresent = gHaVars->Find(Form("%s.present",GetApparatus()->GetName())); + if(vpresent) { + fPresentP = (Bool_t *) vpresent->GetValuePointer(); + } return fStatus = kOK; } @@ -502,7 +507,12 @@ Int_t THcDC::Decode( const THaEvData& evdata ) Int_t num_event = evdata.GetEvNum(); if (fdebugprintrawdc ||fdebugprintdecodeddc || fdebuglinkstubs || fdebugtrackprint) cout << " event num = " << num_event << endl; // Get the Hall C style hitlist (fRawHitList) for this event - fNhits = DecodeToHitList(evdata); + + Bool_t present = kTRUE; // Suppress reference time warnings + if(fPresentP) { // if this spectrometer not part of trigger + present = *fPresentP; + } + fNhits = DecodeToHitList(evdata, !present); if(!gHaCuts->Result("Pedestal_event")) { // Let each plane get its hits diff --git a/src/THcDC.h b/src/THcDC.h index 5331381..867306d 100644 --- a/src/THcDC.h +++ b/src/THcDC.h @@ -175,6 +175,10 @@ protected: Int_t* fNChamHits; Int_t* fPlaneEvents; + // Pointer to global var indicating whether this spectrometer is triggered + // for this event. + Bool_t* fPresentP; + // Useful derived quantities // double tan_angle, sin_angle, cos_angle; diff --git a/src/THcHodoscope.cxx b/src/THcHodoscope.cxx index 630ef0f..5236fac 100644 --- a/src/THcHodoscope.cxx +++ b/src/THcHodoscope.cxx @@ -197,8 +197,11 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) fScinHitPaddle.push_back(std::vector<Int_t>(fNPaddle[ip], 0)); } - - + fPresentP = 0; + THaVar* vpresent = gHaVars->Find(Form("%s.present",GetApparatus()->GetName())); + if(vpresent) { + fPresentP = (Bool_t *) vpresent->GetValuePointer(); + } return fStatus = kOK; } @@ -590,7 +593,11 @@ Int_t THcHodoscope::Decode( const THaEvData& evdata ) */ ClearEvent(); // Get the Hall C style hitlist (fRawHitList) for this event - fNHits = DecodeToHitList(evdata); + Bool_t present = kTRUE; // Suppress reference time warnings + if(fPresentP) { // if this spectrometer not part of trigger + present = *fPresentP; + } + fNHits = DecodeToHitList(evdata, !present); // // GN: print event number so we can cross-check with engine diff --git a/src/THcHodoscope.h b/src/THcHodoscope.h index b85c7a3..d7beb82 100644 --- a/src/THcHodoscope.h +++ b/src/THcHodoscope.h @@ -132,6 +132,7 @@ protected: Double_t fStartTime; Double_t fFPTimeAll; Int_t fNfptimes; + Bool_t* fPresentP; Double_t fBeta; diff --git a/src/THcShower.cxx b/src/THcShower.cxx index 89304b3..c3c6564 100644 --- a/src/THcShower.cxx +++ b/src/THcShower.cxx @@ -177,6 +177,11 @@ THaAnalysisObject::EStatus THcShower::Init( const TDatime& date ) // << GetName() << endl; // cout << "---------------------------------------------------------------\n"; + fPresentP = 0; + THaVar* vpresent = gHaVars->Find(Form("%s.present",GetApparatus()->GetName())); + if(vpresent) { + fPresentP = (Bool_t *) vpresent->GetValuePointer(); + } return fStatus = kOK; } @@ -626,7 +631,11 @@ Int_t THcShower::Decode( const THaEvData& evdata ) Clear(); // Get the Hall C style hitlist (fRawHitList) for this event - Int_t nhits = DecodeToHitList(evdata); + Bool_t present = kTRUE; // Suppress reference time warnings + if(fPresentP) { // if this spectrometer not part of trigger + present = *fPresentP; + } + Int_t nhits = DecodeToHitList(evdata, !present); fEvent = evdata.GetEvNum(); diff --git a/src/THcShower.h b/src/THcShower.h index 05813db..3a0adea 100644 --- a/src/THcShower.h +++ b/src/THcShower.h @@ -145,6 +145,7 @@ public: protected: + Bool_t* fPresentP; Int_t fEvent; Int_t fADCMode; // != 0 if using FADC // 1 == Use the pulse int - pulse ped -- GitLab