diff --git a/DataQuality/DataQualityConfigurations/config/CTP/collisions_minutes10.config b/DataQuality/DataQualityConfigurations/config/CTP/collisions_minutes10.config index 8ec9f9673203c4cb2acbff20940dea18c8c0d0e4..557481bd562492fe20004e8b02ec21d3d4411723 100644 --- a/DataQuality/DataQualityConfigurations/config/CTP/collisions_minutes10.config +++ b/DataQuality/DataQualityConfigurations/config/CTP/collisions_minutes10.config @@ -58,14 +58,17 @@ dir CT { dir CTP { output = CentralTrigger/CTP hist errorSummaryCTP { - display = LogY,AxisRange(1e-12,10,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(1e-12,10,"Y") + algorithm = errorSummary_Entries } hist errorSummaryPerLumiBlockCTP { - display = SetPalette(1) + display = SetPalette(1) + algorithm = errorSummary_Entries } hist deltaBcid { - display = LogY + display = LogY + algorithm = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData + description = Difference between CTP and ROD BCID. Red when at least one bin other than the one centered in zero has value above threshold. } hist triggerType { } @@ -74,22 +77,24 @@ dir CT { hist timeUntilLBEnd { } hist timeSinceL1A { - display = LogY + display = LogY } hist turnCounterTimeError { - display = LogY + display = LogY } hist pitBC { - display = SetPalette(1) + display = SetPalette(1) } hist pitFirstBC { - display = SetPalette(1) + display = SetPalette(1) } hist tav { } hist ctpStatus1 { + algorithm = errorSummary_Entries } hist ctpStatus2 { + algorithm = errorSummary_Entries } hist turnCounterTimeErrorVsLb { } @@ -382,6 +387,20 @@ algorithm MUCTPI_Kolmogorov { MinStat = 20 } +algorithm check_CTP_AllBinsAreEmptyExceptZero { + libname = libdqm_algorithm.so + name = CTP_AllBinsAreEmptyExceptZero +} + +compositeAlgorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + libnames = libdqm_algorithms.so + subalgs = CTP_AllBinsAreEmptyExceptZero,GatherData +} + +algorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + name = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData +} + ############# # Thresholds ############# @@ -398,4 +417,4 @@ thresholds MUCTPI_KolmogorovThr { warning = 0.45 error = 0.5 } -} +} \ No newline at end of file diff --git a/DataQuality/DataQualityConfigurations/config/CTP/collisions_run.config b/DataQuality/DataQualityConfigurations/config/CTP/collisions_run.config index 23040196b82321b6f4581384609806d9debf1a5b..8e83591f8e4d98f4c2a4b195d39623eb55975e42 100644 --- a/DataQuality/DataQualityConfigurations/config/CTP/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/CTP/collisions_run.config @@ -58,14 +58,17 @@ dir CT { dir CTP { output = CentralTrigger/CTP hist errorSummaryCTP { - display = LogY,AxisRange(1e-12,10,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(1e-12,10,"Y") + algorithm = errorSummary_Entries } hist errorSummaryPerLumiBlockCTP { - display = SetPalette(1) + display = SetPalette(1) + algorithm = errorSummary_Entries } hist deltaBcid { - display = LogY + display = LogY + algorithm = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData + description = Difference between CTP and ROD BCID. Red when at least one bin other than the one centered in zero has value above threshold. } hist triggerType { } @@ -74,22 +77,24 @@ dir CT { hist timeUntilLBEnd { } hist timeSinceL1A { - display = LogY + display = LogY } hist turnCounterTimeError { - display = LogY + display = LogY } hist pitBC { - display = SetPalette(1) + display = SetPalette(1) } hist pitFirstBC { - display = SetPalette(1) + display = SetPalette(1) } hist tav { } hist ctpStatus1 { + algorithm = errorSummary_Entries } hist ctpStatus2 { + algorithm = errorSummary_Entries } hist turnCounterTimeErrorVsLb { } @@ -385,6 +390,20 @@ algorithm MUCTPI_Kolmogorov { MinStat = 20 } +algorithm check_CTP_AllBinsAreEmptyExceptZero { + libname = libdqm_algorithm.so + name = CTP_AllBinsAreEmptyExceptZero +} + +compositeAlgorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + libnames = libdqm_algorithms.so + subalgs = CTP_AllBinsAreEmptyExceptZero,GatherData +} + +algorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + name = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData +} + ############# # Thresholds ############# @@ -401,4 +420,4 @@ thresholds MUCTPI_KolmogorovThr { warning = 0.45 error = 0.5 } -} +} \ No newline at end of file diff --git a/DataQuality/DataQualityConfigurations/config/CTP/cosmics_minutes10.config b/DataQuality/DataQualityConfigurations/config/CTP/cosmics_minutes10.config index 8ec9f9673203c4cb2acbff20940dea18c8c0d0e4..b948f5302763c6649e4ba3f4342d9534a695663d 100644 --- a/DataQuality/DataQualityConfigurations/config/CTP/cosmics_minutes10.config +++ b/DataQuality/DataQualityConfigurations/config/CTP/cosmics_minutes10.config @@ -58,14 +58,17 @@ dir CT { dir CTP { output = CentralTrigger/CTP hist errorSummaryCTP { - display = LogY,AxisRange(1e-12,10,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(1e-12,10,"Y") + algorithm = errorSummary_Entries } hist errorSummaryPerLumiBlockCTP { - display = SetPalette(1) + display = SetPalette(1) + algorithm = errorSummary_Entries } hist deltaBcid { - display = LogY + display = LogY + algorithm = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData + description = Difference between CTP and ROD BCID. Red when at least one bin other than the one centered in zero has value above threshold. } hist triggerType { } @@ -382,6 +385,20 @@ algorithm MUCTPI_Kolmogorov { MinStat = 20 } +algorithm check_CTP_AllBinsAreEmptyExceptZero { + libname = libdqm_algorithm.so + name = CTP_AllBinsAreEmptyExceptZero +} + +compositeAlgorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + libnames = libdqm_algorithms.so + subalgs = CTP_AllBinsAreEmptyExceptZero,GatherData +} + +algorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + name = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData +} + ############# # Thresholds ############# diff --git a/DataQuality/DataQualityConfigurations/config/CTP/cosmics_run.config b/DataQuality/DataQualityConfigurations/config/CTP/cosmics_run.config index 1a3c24afc05f854db6c9f40d935b085314e51a10..cb3a006ed315b965a18213b7223f04fec2eefec0 100644 --- a/DataQuality/DataQualityConfigurations/config/CTP/cosmics_run.config +++ b/DataQuality/DataQualityConfigurations/config/CTP/cosmics_run.config @@ -50,22 +50,25 @@ dir CT { output = CentralTrigger/ErrorSummary hist errorPerLumiBlock { - display = LogY,AxisRange(0.1,1e+11,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(0.1,1e+11,"Y") + algorithm = errorSummary_Entries } hist incompleteFragmentType { } dir CTP { output = CentralTrigger/CTP hist errorSummaryCTP { - display = LogY,AxisRange(1e-12,10,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(1e-12,10,"Y") + algorithm = errorSummary_Entries } hist errorSummaryPerLumiBlockCTP { - display = SetPalette(1) + display = SetPalette(1) + algorithm = errorSummary_Entries } hist deltaBcid { - display = LogY + display = LogY + algorithm = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData + description = Difference between CTP and ROD BCID. Red when at least one bin other than the one centered in zero has value above threshold. } hist triggerType { } @@ -74,16 +77,16 @@ dir CT { hist timeUntilLBEnd { } hist timeSinceL1A { - display = LogY + display = LogY } hist turnCounterTimeError { - display = LogY + display = LogY } hist pitBC { - display = SetPalette(1) + display = SetPalette(1) } hist pitFirstBC { - display = SetPalette(1) + display = SetPalette(1) } hist tav { } @@ -385,6 +388,20 @@ algorithm MUCTPI_Kolmogorov { MinStat = 20 } +algorithm check_CTP_AllBinsAreEmptyExceptZero { + libname = libdqm_algorithm.so + name = CTP_AllBinsAreEmptyExceptZero +} + +compositeAlgorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + libnames = libdqm_algorithms.so + subalgs = CTP_AllBinsAreEmptyExceptZero,GatherData +} + +algorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + name = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData +} + ############# # Thresholds ############# diff --git a/DataQuality/DataQualityConfigurations/config/CTP/heavyions_run.config b/DataQuality/DataQualityConfigurations/config/CTP/heavyions_run.config index 9a5e5ee874834f0d233e0e9b7624f81629f0517a..e0a3e9d4999d0aac110a56602ed2b11bd074af3d 100644 --- a/DataQuality/DataQualityConfigurations/config/CTP/heavyions_run.config +++ b/DataQuality/DataQualityConfigurations/config/CTP/heavyions_run.config @@ -50,22 +50,25 @@ dir CT { output = CentralTrigger/ErrorSummary hist errorPerLumiBlock { - display = LogY,AxisRange(0.1,1e+11,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(0.1,1e+11,"Y") + algorithm = errorSummary_Entries } hist incompleteFragmentType { } dir CTP { output = CentralTrigger/CTP hist errorSummaryCTP { - display = LogY,AxisRange(1e-12,10,"Y") - algorithm = errorSummary_Entries + display = LogY,AxisRange(1e-12,10,"Y") + algorithm = errorSummary_Entries } hist errorSummaryPerLumiBlockCTP { - display = SetPalette(1) + display = SetPalette(1) + algorithm = errorSummary_Entries } hist deltaBcid { - display = LogY + display = LogY + algorithm = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData + description = Difference between CTP and ROD BCID. Red when at least one bin other than the one centered in zero has value above threshold. } hist triggerType { } @@ -74,16 +77,16 @@ dir CT { hist timeUntilLBEnd { } hist timeSinceL1A { - display = LogY + display = LogY } hist turnCounterTimeError { - display = LogY + display = LogY } hist pitBC { - display = SetPalette(1) + display = SetPalette(1) } hist pitFirstBC { - display = SetPalette(1) + display = SetPalette(1) } hist tav { } @@ -385,6 +388,20 @@ algorithm MUCTPI_Kolmogorov { MinStat = 20 } +algorithm check_CTP_AllBinsAreEmptyExceptZero { + libname = libdqm_algorithm.so + name = CTP_AllBinsAreEmptyExceptZero +} + +compositeAlgorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + libnames = libdqm_algorithms.so + subalgs = CTP_AllBinsAreEmptyExceptZero,GatherData +} + +algorithm CTP_AllBinsAreEmptyExceptZero&CTP_GatherData { + name = CTP_AllBinsAreEmptyExceptZero&CTP_GatherData +} + ############# # Thresholds ############# diff --git a/DataQuality/dqm_algorithms/dqm_algorithms/CTP_AllBinsAreEmptyExceptZero.h b/DataQuality/dqm_algorithms/dqm_algorithms/CTP_AllBinsAreEmptyExceptZero.h new file mode 100644 index 0000000000000000000000000000000000000000..93e8ec6b9e7111e3b8f74a7f42e70c3f69dcf7ca --- /dev/null +++ b/DataQuality/dqm_algorithms/dqm_algorithms/CTP_AllBinsAreEmptyExceptZero.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef DQM_ALGORITHMS_CTP_ALLBINSAREEMPTYEXCEPTZERO_H +#define DQM_ALGORITHMS_CTP_ALLBINSAREEMPTYEXCEPTZERO_H + +#include <string> +#include "TObject.h" +#include "dqm_core/Algorithm.h" + + +namespace dqm_algorithms { + +class CTP_AllBinsAreEmptyExceptZero : public dqm_core::Algorithm { +public: + + CTP_AllBinsAreEmptyExceptZero(); + virtual ~CTP_AllBinsAreEmptyExceptZero() = default; + + virtual dqm_core::Algorithm* clone() override; + virtual dqm_core::Result* execute( const std::string& name, const TObject& data, const dqm_core::AlgorithmConfig& config ) override; + using dqm_core::Algorithm::printDescription; + virtual void printDescription(std::ostream& out); + +private: + std::string m_name; +}; + +} //namespace dqm_algorithms + +#endif // DQM_ALGORITHMS_CTP_ALLBINSAREEMPTYEXCEPTZERO_H diff --git a/DataQuality/dqm_algorithms/src/CTP_AllBinsAreEmptyExceptZero.cxx b/DataQuality/dqm_algorithms/src/CTP_AllBinsAreEmptyExceptZero.cxx new file mode 100644 index 0000000000000000000000000000000000000000..0a5eabf35ea64c1f7b84615b9401e049fa3d0349 --- /dev/null +++ b/DataQuality/dqm_algorithms/src/CTP_AllBinsAreEmptyExceptZero.cxx @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration +*/ + +#include "dqm_algorithms/CTP_AllBinsAreEmptyExceptZero.h" + +#include <cmath> +#include <iostream> +#include <map> +#include <vector> +#include <string> + +#include <TClass.h> +#include <TH1.h> +#include <TH2.h> + +#include "dqm_core/exceptions.h" +#include "dqm_core/AlgorithmConfig.h" +#include "dqm_core/AlgorithmManager.h" +#include "dqm_core/Result.h" +#include "dqm_algorithms/tools/AlgorithmHelper.h" +#include "ers/ers.h" + + +static dqm_algorithms::CTP_AllBinsAreEmptyExceptZero staticInstance; + + +namespace dqm_algorithms { + +// ********************************************************************* +// Public Methods +// ********************************************************************* + +CTP_AllBinsAreEmptyExceptZero::CTP_AllBinsAreEmptyExceptZero() + : m_name("CTP_AllBinsAreEmptyExceptZero") +{ + dqm_core::AlgorithmManager::instance().registerAlgorithm( m_name, this ); +} + +dqm_core::Algorithm* +CTP_AllBinsAreEmptyExceptZero::clone() +{ + return new CTP_AllBinsAreEmptyExceptZero(*this); +} + + +dqm_core::Result* +CTP_AllBinsAreEmptyExceptZero::execute( const std::string& name, const TObject& object, const dqm_core::AlgorithmConfig& config) +{ + using namespace std; + + const TH1 *hist; + + if(object.IsA()->InheritsFrom( "TH1" )) { + hist = static_cast<const TH1*>( &object ); + if (hist->GetDimension() > 1 ){ + throw dqm_core::BadConfig( ERS_HERE, name, "dimension > 1 " ); + } + } else { + throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH1" ); + } + + //Get Parameters and Thresholds + double threshold = 0; + + try { + threshold = dqm_algorithms::tools::GetFirstFromMap("threshold", config.getParameters(), 0); + } + catch ( dqm_core::Exception & ex ) { + throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex ); + } + + //Algo + dqm_core::Result* result = new dqm_core::Result(); + std::map<std::string,double> tags; //defined in https://gitlab.cern.ch/atlas-tdaq-software/dqm_core/-/blob/master/dqm_core/Result.h + + //assume all good, until find a bad one + result->status_ = dqm_core::Result::Green; + int nbinsx = hist->GetXaxis()->GetNbins(); + int badBins = 0; + + for(int iBin = 1; iBin <= nbinsx-1; ++iBin) //foreach bin of the projection (0=underflow) + { + // If bin content is nonzero, and 0 does not lie in between bin edges + if( hist->GetBinContent(iBin) > threshold && hist->GetBinLowEdge(iBin) * hist->GetBinLowEdge(iBin+1) > 0 ) + { + result->status_ = dqm_core::Result::Red; + ++ badBins; + } + } + tags["# Bad bins"] = badBins; + + //set the result tags + result->tags_ = tags; + + // Return the result + return result; +} + + +void +CTP_AllBinsAreEmptyExceptZero::printDescription(std::ostream& out){ + std::string message; + message += "\n"; + message += "Algorithm: \"" + m_name + "\"\n"; + message += "Description: Check that the only non-empty bin is the one centered in zero.\n"; + out << message; +} + +} // namespace dqm_algorithms diff --git a/Trigger/TrigT1/TrigT1CTMonitoring/python/CTPMonitoringConfig.py b/Trigger/TrigT1/TrigT1CTMonitoring/python/CTPMonitoringConfig.py index c59f7adabcd13fe0231114ced50c9b1b3e18515a..78ca3ad38518cc9caff7cf589f53474aa445a0fd 100644 --- a/Trigger/TrigT1/TrigT1CTMonitoring/python/CTPMonitoringConfig.py +++ b/Trigger/TrigT1/TrigT1CTMonitoring/python/CTPMonitoringConfig.py @@ -55,3 +55,51 @@ def CTPMonitoringConfig(flags): info('CTPMonitoringConfig: requested: result.merge(BSMonitoringConfig(flags))') info('after results_merge CTPMonitoringConfig') return result + +if __name__=='__main__': + from AthenaConfiguration.AllConfigFlags import initConfigFlags + from AthenaConfiguration.MainServicesConfig import MainServicesCfg + + flags = initConfigFlags() + from AthenaConfiguration.TestDefaults import defaultGeometryTags + flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3 + flags.Scheduler.CheckDependencies = True + flags.Scheduler.ShowDataDeps = True + flags.Scheduler.ShowDataFlow = True + flags.Scheduler.ShowControlFlow = True + flags.Scheduler.EnableVerboseViews = True + flags.Detector.GeometryZDC=False + flags.Detector.GeometryAFP=False + flags.Detector.GeometryALFA=False + flags.Detector.GeometryLucid=False + flags.Detector.GeometryMDT=False + flags.Detector.GeometryMM=False + flags.Detector.GeometryMuon=False + flags.Trigger.decodeHLT=False + flags.Trigger.enableL1MuonPhase1=False + flags.Trigger.L1.doMuon=True + flags.Trigger.L1.doCalo=False + flags.Trigger.L1.doTopo=True + flags.Trigger.L1.doCTP=True + flags.Reco.EnableCombinedMuon=True + #flags.Reco.EnableTrigger = False + # This does not work in this context + # run = flags.GeoModel.Run + # The EDM Version should be auto configured, but is not working at the moment, so is set by hand + + flags.Output.AODFileName="AOD.pool.root" + flags.Output.HISTFileName="HIST.root" + flags.Output.doWriteAOD=True + + flags.fillFromArgs() + flags.lock() + # Next line is for debugging +# flags.dump() + + acc=MainServicesCfg(flags) + acc.merge( CTPMonitoringConfig(flags) ) + + status = acc.run() + if status.isFailure(): + import sys + sys.exit(-1)