#include #include using namespace RAT::DU; using namespace std; ClassImp( RAT::DU::DataCleaningBits ) void DataCleaningBits::BeginOfRun() { fBitMap["prescalecut"] = PrescaleCut; fBitMap["zerozerocut"] = ZeroZeroCut; fBitMap["crateisotropy"] = CrateIsotropy; fBitMap["ftscut"] = FTSCut; fBitMap["flashergeocut"] = FlasherGeoCut; fBitMap["itctimespreadcut"] = ITCTimeSpreadCut; fBitMap["junkcut"] = JunkCut; fBitMap["muontag"] = MuonTag; fBitMap["neckcut"] = NeckCut; fBitMap["owlcut"] = OwlCut; fBitMap["qcluster"] = QClusterCut; fBitMap["qvnhit"] = QvNhit; fBitMap["qvt"] = QvTCut; fBitMap["ringoffire"] = RingOfFire; fBitMap["tpmuonfollowercut-short"] = TwoPassMuonFollowerCutShort; fBitMap["tpmuonfollowercut"] = TwoPassMuonFollowerCutShort; // Short-cut bit fBitMap["tpmuonfollowercut-long"] = TwoPassMuonFollowerCutLong; fBitMap["caencut"] = CAENCut; fBitMap["nothingcut"] = NothingCut; fBitMap["nhitcut"] = NhitCut; fBitMap["thresholdflashercut"] = ThresholdFlasherCut; fBitMap["pollingcut"] = PollingCut; fBitMap["retriggercut"] = RetriggerCut; fBitMap["tpburstcut"] = TPBurstCut; fBitMap["firstevent"] = FirstEventFlag; fBitMap["missedmuonfollower"] = MissedMuonFollowerCut; fBitMap["missingcaendata"] = MissingCaenData; fBitMap["pedcut"] = PedCut; fBitMap["atmospheric"] = AtmosphericCut; fBitMap["waterblindlow0"] = WaterBlindLow0; fBitMap["waterblindlow1"] = WaterBlindLow1; fBitMap["waterblindlow2"] = WaterBlindLow2; fBitMap["waterblindlow3"] = WaterBlindLow3; fBitMap["waterblindlow4"] = WaterBlindLow4; fBitMap["waterblindlow5"] = WaterBlindLow5; fBitMap["waterblindlow6"] = WaterBlindLow6; fBitMap["waterblindlow7"] = WaterBlindLow7; fBitMap["waterblindlow8"] = WaterBlindLow8; fBitMap["waterblindlow9"] = WaterBlindLow9; fBitMap["waterblindhigh0"] = WaterBlindHigh0; fBitMap["waterblindhigh1"] = WaterBlindHigh1; fBitMap["waterblindhigh2"] = WaterBlindHigh2; fBitMap["waterblindhigh3"] = WaterBlindHigh3; fBitMap["waterblindhigh4"] = WaterBlindHigh4; fBitMap["waterblindhigh5"] = WaterBlindHigh5; fBitMap["waterblindhigh6"] = WaterBlindHigh6; fBitMap["waterblindhigh7"] = WaterBlindHigh7; fBitMap["waterblindhigh8"] = WaterBlindHigh8; fBitMap["waterblindhigh9"] = WaterBlindHigh9; for( map::iterator iter = fBitMap.begin(); iter != fBitMap.end(); ++iter ) fInverseBitMap[iter->second] = iter->first; } string DataCleaningBits::GetBitName( const size_t index ) const { Log::Assert( fInverseBitMap.count( index ) > 0, "DataCleaningBits::GetBitName: Index '" + ::to_string( index ) + "' is invalid." ); return fInverseBitMap.at( index ); } size_t DataCleaningBits::GetBitIndex( const std::string& name ) const { Log::Assert( fBitMap.count( name ) > 0, "DataCleaningBits::GetBitIndex: Name '" + name + "' is invalid." ); return fBitMap.at( name ); } map::iterator DataCleaningBits::GetMapBegin() { return fBitMap.begin(); } map::iterator DataCleaningBits::GetMapLast() { map::iterator it = fBitMap.end(); return --it; } map::iterator DataCleaningBits::GetMapEnd() { return fBitMap.end(); } map::iterator DataCleaningBits::GetInverseMapBegin() { return fInverseBitMap.begin(); } map::iterator DataCleaningBits::GetInverseMapLast() { map::iterator it = fInverseBitMap.end(); return --it; } map::iterator DataCleaningBits::GetInverseMapEnd() { return fInverseBitMap.end(); } void DataCleaningBits::DumpNames() { info << "DataCleaningBits::Dump: Bit index and name." << newline; for( map::iterator iTer = fInverseBitMap.begin(); iTer != fInverseBitMap.end(); ++iTer ) info << dformat("%3d : %s", iTer->first, iTer->second.c_str() ) << newline; }