////////////////////////////////////////////////////////////////////// /// \class DataCleaningBits /// /// \brief Hold data cleaning bit mnemonics /// /// \author Richie Bonventre /// /// REVISION HISTORY:\n /// 31 Jul 2013 : Richie Bonventre --- First version.\n /// 2014-04-04 : P Jones - Move to Data Utility from src/calib/cleaning, /// change functionality slightly.\n /// 2015-05-17 : J Walker - Added iterator functions.\n /// /// /// \details This holds mnemonics for the data cleaning cut bits /// ////////////////////////////////////////////////////////////////////// // #ifndef __RAT_DU_DataCleaningBits__ #define __RAT_DU_DataCleaningBits__ #include #include #include #include namespace RAT { namespace DU { class DataCleaningBits : public TObject { public: enum Bit { PrescaleCut=0, ZeroZeroCut=1, CrateIsotropy=2, FTSCut=3, FlasherGeoCut=4, ITCTimeSpreadCut=5, JunkCut=6, MuonTag=7, NeckCut=8, OwlCut=9, QClusterCut=10, QvNhit=11, QvTCut=12, RingOfFire=13, TwoPassMuonFollowerCutShort=14, TwoPassMuonFollowerCutLong=15, CAENCut=16, NothingCut=17, NhitCut=18, ThresholdFlasherCut=39, PollingCut=40, RetriggerCut=41, FirstEventFlag=42, TPBurstCut=43, MissedMuonFollowerCut=44, MissingCaenData=45, PedCut=46, AtmosphericCut=47, EmptyCrate=48, MissedCountBurstCut=49, WaterBlindLow0=19, WaterBlindLow1=20, WaterBlindLow2=21, WaterBlindLow3=22, WaterBlindLow4=23, WaterBlindLow5=24, WaterBlindLow6=25, WaterBlindLow7=26, WaterBlindLow8=27, WaterBlindLow9=28, WaterBlindHigh0=29, WaterBlindHigh1=30, WaterBlindHigh2=31, WaterBlindHigh3=32, WaterBlindHigh4=33, WaterBlindHigh5=34, WaterBlindHigh6=35, WaterBlindHigh7=36, WaterBlindHigh8=37, WaterBlindHigh9=38, NeutronTag=50 }; /// Intialise the class, sets up the bit maps void BeginOfRun(); /// Get the name of the data cleaning bit at index /// /// @param[in] index of the bit /// @return name of the bit /// @throws out_of_range if index is not valid std::string GetBitName( const size_t index ) const; /// Get the bit index from the name /// /// @param[in] name of the bit /// @return index of the bit /// @throws out_of_range if index is not valid size_t GetBitIndex( const std::string& name ) const; /// Returns an iterator over the map, positioned at the beginning /// /// @return iterator at fBitMap.begin() std::map::iterator GetMapBegin(); /// Returns an iterator over the map, positioned at the map's last element /// /// @return iterator at fBitMap.end() decremented by 1 std::map::iterator GetMapLast(); /// Returns an iterator over the map, positioned at the end /// /// @return iterator at fBitMap.end() std::map::iterator GetMapEnd(); /// Returns an iterator over the inverse map, positioned at the beginning /// /// @return iterator at fInverseBitMap.begin() std::map::iterator GetInverseMapBegin(); /// Returns an iterator over the inverse map, positioned at the map's last element /// /// @return iterator at fInverseBitMap.end() decremented by 1 std::map::iterator GetInverseMapLast(); /// Returns an iterator over the inverse map, positioned at the end /// /// @return iterator at fInverseBitMap.end() std::map::iterator GetInverseMapEnd(); /// Outputs a list of the names and bit indices to the screen void DumpNames(); // This ROOT macro adds dictionary methods to this class. // The number is 0 as this class is never, and should never be written to disc. // It assumes this class has no virtual methods, use ClassDef if change this. ClassDefNV( DataCleaningBits, 0 ); private: std::map fBitMap; ///< Mapping between bit name and bit position std::map fInverseBitMap; ///< Opposite mapping, bit position to bit name }; } // ::DU } // namespace RAT #endif