////////////////////////////////////////////////////////////////////// /// \class DataQualityBits /// /// \brief Hold data quality bit mnemonics /// /// \author P G Jones /// \contact A R Back - DQ functionality /// \contact F Di Lodovico - Head of WG /// \contact J Waterfield - TELLIE DQ /// /// REVISION HISTORY:\n /// 2014-04-17 : P Jones - New file, copies DataCleaning.\n /// 2014-12-02 : A Back - Added methods to return map iterator.\n /// /// /// \details This holds mnemonics for the data quality cut bits /// ////////////////////////////////////////////////////////////////////// // #ifndef __RAT_DU_DataQualityBits__ #define __RAT_DU_DataQualityBits__ #include #include #include #include namespace RAT { namespace DU { class DataQualityBits : public TObject { public: enum Bit { RunType = 1, MCFlag=2, Trigger=3, RunLength=4, GeneralCoverage=5, CrateCoverage=6, PanelCoverage=7, RunHeader=8, DeltaTComparison=9, ClockForward=10, EventSeparation=11, Retriggers=12, EventRate=13, PulseSeparation=14, MaxNhit=15, AvgNhit=16, Fibre=17, PeakNumber=18, PeakAmplitude=19, PromptTime=20, PeakTime=21, N100LTriggerRate=22, ESumHTriggerRate=23, lbTimeCheck=24, lbPosCheck=25, lbqhsLowCheck=26, lbqhsPeakCheck=27, lbqhsHighCheck=28, lbNHitCheck=29, lbNZeroCheck=30, lbFullOccupancyMeanCheck=31, lbFullOccupancySpreadCheck=32, lbOccupancyRatioMeanCheckCentralRun=33, lbOccupancyRatioSpreadCheckCentralRun=34, lbOccupancyRatioMeanCheckPreviousRun=35, lbOccupancyRatioSpreadCheckPreviousRun=36,lbPromptOccupancyMeanCheck=37, lbPromptOccupancySpreadCheck=38,lbPMTMeanTimeCheck=39,lbPMTTimeErrorCheck=40, UT10MhzClockCheck=41, smellieCorrectFibre=42,smellieIntensityCheck=43,smellieFrequencyCheck=44,smellieNumberOfEventsCheck=45, n16NumberOfEventsCheck=46, n16MeanNHitCheck=47, n16NHitSpreadCheck=48, n16FitPositionCheck=49, triggerProcBitFlipGTID=50, triggerProcMissingGTID=51}; /// Intialise the class, sets up the bit maps 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 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 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( DataQualityBits, 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