#include #include using namespace RAT::DU; using namespace std; ClassImp( RAT::DU::DataQualityBits ) void DataQualityBits::BeginOfRun() { fBitMap["run_type"] = RunType; fBitMap["mc_flag"] = MCFlag; fBitMap["trigger"] = Trigger; fBitMap["run_length"] = RunLength; fBitMap["general_coverage"] = GeneralCoverage; fBitMap["crate_coverage"] = CrateCoverage; fBitMap["panel_coverage"] = PanelCoverage; fBitMap["run_header"] = RunHeader; fBitMap["delta_t_comparison"] = DeltaTComparison; fBitMap["clock_forward"] = ClockForward; fBitMap["event_separation"] = EventSeparation; fBitMap["retriggers"] = Retriggers; fBitMap["event_rate"] = EventRate; fBitMap["pulse_delay"] = PulseDelay; fBitMap["max_nhit"] = MaxNhit; fBitMap["avg_nhit"] = AvgNhit; fBitMap["fibre"] = Fibre; fBitMap["peak_number"] = PeakNumber; fBitMap["peak_amplitude"] = PeakAmplitude; fBitMap["prompt_time"] = PromptTime; fBitMap["peak_time"] = PeakTime; fBitMap["n100l_trigger_rate"] = N100LTriggerRate; fBitMap["esumh_trigger_rate"] = ESumHTriggerRate; fBitMap["lbTimeCheck"] = lbTimeCheck; fBitMap["lbPosCheck"] = lbPosCheck; fBitMap["lbqhsLowCheck"] = lbqhsLowCheck; fBitMap["lbqhsHighCheck"] = lbqhsHighCheck; fBitMap["lbNHitCheck"] = lbNHitCheck; fBitMap["lbNZeroCheck"] = lbNZeroCheck; fBitMap["lbFullOccupancyMeanCheck"] = lbFullOccupancyMeanCheck; fBitMap["lbFullOccupancySpreadCheck"] = lbFullOccupancySpreadCheck; fBitMap["lbPromptOccupancyMeanCheck"] = lbPromptOccupancyMeanCheck; fBitMap["lbPromptOccupancySpreadCheck"] = lbPromptOccupancySpreadCheck; fBitMap["lbOccupancyRatioMeanCheckCentralRun"] = lbOccupancyRatioMeanCheckCentralRun; fBitMap["lbOccupancyRatioSpreadCheckCentralRun"] = lbOccupancyRatioSpreadCheckCentralRun; fBitMap["lbOccupancyRatioMeanCheckPreviousRun"] = lbOccupancyRatioMeanCheckPreviousRun; fBitMap["lbOccupancyRatioSpreadCheckPreviousRun"] = lbOccupancyRatioSpreadCheckPreviousRun; fBitMap["lbPMTMeanTimeCheck"] = lbPMTMeanTimeCheck; fBitMap["lbPMTTimeErrorCheck"] = lbPMTTimeErrorCheck; fBitMap["10Mhz_UT_comparrison"] = UT10MhzClockCheck; fBitMap["smellieCorrectFibre"] = smellieCorrectFibre; fBitMap["smellieIntensityCheck"] = smellieIntensityCheck; fBitMap["smellieFrequencyCheck"] = smellieFrequencyCheck; fBitMap["smellieNumberOfEventsCheck"] = smellieNumberOfEventsCheck; fBitMap["n16NumberOfEventsCheck"] = n16NumberOfEventsCheck; fBitMap["n16MeanNHitCheck"] = n16MeanNHitCheck; fBitMap["n16NHitSpreadCheck"] = n16NHitSpreadCheck; fBitMap["n16FitPositionCheck"] = n16FitPositionCheck; fBitMap["triggerProcBitFlipGTID"] = triggerProcBitFlipGTID; fBitMap["triggerProcMissingGTID"] = triggerProcMissingGTID; for( map::iterator iter = fBitMap.begin(); iter != fBitMap.end(); ++iter ) fInverseBitMap[iter->second] = iter->first; } string DataQualityBits::GetBitName( const size_t index ) const { Log::Assert( fInverseBitMap.count( index ) > 0, "DataQualityBits::GetBitName: Index '" + ::to_string( index ) + "' is invalid." ); return fInverseBitMap.at( index ); } size_t DataQualityBits::GetBitIndex( const std::string& name ) const { Log::Assert( fBitMap.count( name ) > 0, "DataQualityBits::GetBitIndex: Name '" + name + "' is invalid." ); return fBitMap.at( name ); } map::iterator DataQualityBits::GetMapBegin() { return fBitMap.begin(); } map::iterator DataQualityBits::GetMapLast() { map::iterator it = fBitMap.end(); return --it; } map::iterator DataQualityBits::GetMapEnd() { return fBitMap.end(); } map::iterator DataQualityBits::GetInverseMapBegin() { return fInverseBitMap.begin(); } map::iterator DataQualityBits::GetInverseMapLast() { map::iterator it = fInverseBitMap.end(); return --it; } map::iterator DataQualityBits::GetInverseMapEnd() { return fInverseBitMap.end(); } void DataQualityBits::DumpNames() { info << "DataQualityBits::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; }