Skip to content
Snippets Groups Projects
Commit 42c20ade authored by Lorenzo Sanfilippo's avatar Lorenzo Sanfilippo Committed by Petar Bokan
Browse files

Muctpidq

Muctpidq
parent f16da08a
2 merge requests!708052024-04-23: merge of 24.0 into main,!70652Muctpidq
......@@ -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
......@@ -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
......@@ -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
#############
......
......@@ -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
#############
......
......@@ -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
#############
......
/*
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
/*
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
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment