diff --git a/src/THcTrigDet.cxx b/src/THcTrigDet.cxx index 8c94610080d7a81ddec42637ab706763b71b3b44..a6e5291e146f5e70432f93cc922b73a5b4a43319 100644 --- a/src/THcTrigDet.cxx +++ b/src/THcTrigDet.cxx @@ -218,8 +218,12 @@ void THcTrigDet::Clear(Option_t* opt) { Int_t THcTrigDet::Decode(const THaEvData& evData) { // Decode raw data for this event. - Bool_t present = kTRUE; // Suppress reference time warnings - if(fPresentP) { // if this spectrometer not part of trigger + Bool_t present = kTRUE; // Don't suppress reference time warnings + if(HaveIgnoreList()) { + if(IsIgnoreType(evData.GetEvType())) { + present = kFALSE; + } + } else if(fPresentP) { // if this spectrometer not part of trigger present = *fPresentP; } Int_t numHits = DecodeToHitList(evData, !present); @@ -445,6 +449,26 @@ void THcTrigDet::SetSpectName( const char* name) fSpectName = name; } +void THcTrigDet::AddEvtType(int evtype) { + eventtypes.push_back(evtype); +} + +void THcTrigDet::SetEvtType(int evtype) { + eventtypes.clear(); + AddEvtType(evtype); +} + +Bool_t THcTrigDet::IsIgnoreType(Int_t evtype) const +{ + for (UInt_t i=0; i < eventtypes.size(); i++) { + if (evtype == eventtypes[i]) return kTRUE; + } + return kFALSE; +} +Bool_t THcTrigDet::HaveIgnoreList() const +{ + return( (eventtypes.size()>0) ? kTRUE : kFALSE); +} ClassImp(THcTrigDet) diff --git a/src/THcTrigDet.h b/src/THcTrigDet.h index b6144f264f6000e70fb5f319ddef4c276ca9666a..e05b6e52a5ffdb9a29f05b5a9695077eb5a52e10 100644 --- a/src/THcTrigDet.h +++ b/src/THcTrigDet.h @@ -27,6 +27,10 @@ class THcTrigDet : public THaDetector, public THcHitList { Int_t Decode(const THaEvData& evData); virtual void SetSpectName( const char* name); + virtual void AddEvtType(int evtype); + virtual void SetEvtType(int evtype); + virtual Bool_t IsIgnoreType(Int_t evtype) const; + virtual Bool_t HaveIgnoreList() const; protected: void Setup(const char* name, const char* description); @@ -65,6 +69,7 @@ class THcTrigDet : public THaDetector, public THcHitList { Int_t fAdcMultiplicity[fMaxAdcChannels]; TString fSpectName; + std::vector<Int_t> eventtypes; Bool_t* fPresentP; private: