#ifndef _sdet_StationTriggerInfo_h_ #define _sdet_StationTriggerInfo_h_ #include namespace sdet { class StationTriggerInfo { public: StationTriggerInfo() : fPLDBits(0), fIsT2Threshold(false), fStart(0), fLatch(0), fStop(0) { } StationTriggerInfo(const int pld, const bool t2th, const int start, const int latch, const int stop) : fPLDBits(pld), fIsT2Threshold(t2th), fStart(start), fLatch(latch), fStop(stop) { } int GetPLDBits() const { return fPLDBits; } void SetPLDBits(const int bits) { fPLDBits = bits; } bool IsT1() const { return fPLDBits & (sevt::StationTriggerData::ePLDLatchThreshold | sevt::StationTriggerData::ePLDLatchTOTA | sevt::StationTriggerData::ePLDLatchTOTB | sevt::StationTriggerData::ePLDLatchTOTC); } bool IsT1Threshold() const { return (fPLDBits & sevt::StationTriggerData::ePLDLatchThreshold) && !IsTimeOverThreshold() && !IsTimeOverThresholdDeconvoluted() && !IsMultiplicityOfPositiveSteps(); } bool IsTimeOverThreshold() const { return fPLDBits & (sevt::StationTriggerData::ePLDLatchTOTA | sevt::StationTriggerData::ePLDTOTA); } bool IsTimeOverThresholdDeconvoluted() const { return fPLDBits & (sevt::StationTriggerData::ePLDLatchTOTB | sevt::StationTriggerData::ePLDTOTB) && !IsTimeOverThreshold(); } bool IsMultiplicityOfPositiveSteps() const { return fPLDBits & (sevt::StationTriggerData::ePLDLatchTOTC | sevt::StationTriggerData::ePLDTOTC) && !IsTimeOverThreshold(); } bool IsT2() const { return IsTimeOverThreshold() || IsTimeOverThresholdDeconvoluted() || IsMultiplicityOfPositiveSteps() || IsT2Threshold(); } bool IsT2Threshold() const { return fIsT2Threshold; } void SetIsT2Threshold(const bool isT2Th) { fIsT2Threshold = isT2Th; } sevt::StationTriggerData::Algorithm GetTrigger() const { if (IsTimeOverThreshold()) return sevt::StationTriggerData::eTimeOverThreshold; else if (IsTimeOverThresholdDeconvoluted()) return sevt::StationTriggerData::eTimeOverThresholdDeconvoluted; else if (IsMultiplicityOfPositiveSteps()) return sevt::StationTriggerData::eMultiplicityOfPositiveSteps; else if (IsT2Threshold()) return sevt::StationTriggerData::eT2Threshold; else if (IsT1Threshold()) return sevt::StationTriggerData::eT1Threshold; else return sevt::StationTriggerData::eNone; } /// First bin of trace int GetStart() const { return fStart; } void SetStart(const int start) { fStart = start; } int GetLatch() const { return fLatch; } void SetLatch(const int latch) { fLatch = latch; } /// Last+1 bin of trace int GetStop() const { return fStop; } void SetStop(const int stop) { fStop = stop; } void SetStartLatchStop(const int start, const int latch, const int stop) { fStart = start; fLatch = latch; fStop = stop; } private: int fPLDBits; bool fIsT2Threshold; int fStart; int fLatch; int fStop; }; } #endif