/////////////////////////////////////////////////////////////////////////////// /// \class RAT::DU::TrigBits /// /// \brief Hold data quality bit mnemonics /// /// \author P G Jones /// \author Josh Klein -- contact person /// /// REVISION HISTORY:\n /// 2014-05-20 : P Jones - New file.\n /// /// \details This holds mnemonics for the SNO+ trigger bits, and can return /// the bit index by trigger name or a bit mask by trigger names. /// /////////////////////////////////////////////////////////////////////////////// #ifndef __RAT_DU_TrigBits__ #define __RAT_DU_TrigBits__ #include #include #include namespace RAT { namespace DU { class TrigBits : public TObject { public: enum{ N100Low=0, N100Med=1, N100High=2, N20=3, N20LB=4, ESLow=5, ESHigh=6, OWLN=7, OWLESLow=8, OWLESHigh=9, PulseGT=10, Prescale=11, Pedestal=12, Pong=13, Sync=14, EXTASY=15, EXT2=16, EXT3=17, EXT4=18, EXT5=19, EXT6=20, EXT7=21, EXT8PulseAsy=22, SPRaw=23, NCD=24, SoftGT=25, MissTrig=26 }; /// Intialise the class, sets up the bit maps static void BeginOfRun(); /// Get the name of the data quality bit at index /// /// @param[in] index of the bit /// @return name of the bit /// @throws out_of_range if index is not valid static std::string GetBitName( const size_t index ); /// 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 static size_t GetBitIndex( const std::string& name ); /// Get a mask corresponding to the bits in names /// /// @param[in] names of the bits comma separated /// @return the corresponding mask static unsigned int GetMask( const std::string& names ); /// Outputs a list of the names and bit indices to the screen static void DumpNames(); ClassDefNV( TrigBits, 0 ); private: static std::map fsBitMap; ///< Mapping between bit name and bit position static std::map fsInverseBitMap; ///< Opposite mapping, bit position to bit name }; } // ::DU } // namespace RAT #endif