ATLAS Offline Software
Loading...
Searching...
No Matches
L1TopoOnlineMonitor.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef L1TOPOONLINEMONITORING_L1TopoOnlineMonitor_h
6#define L1TOPOONLINEMONITORING_L1TopoOnlineMonitor_h
7
8// Trigger includes
14#include "TrigConfData/L1Menu.h"
15
16
17// Athena includes
22
23#include "GaudiKernel/LockedHandle.h"
24
25// System includes
26#include <bitset>
27#include <optional>
28
37
39public:
40 L1TopoOnlineMonitor(const std::string& name, ISvcLocator* svcLoc);
41
42 // ------------------------- AthReentrantAlgorithm methods -------------------
43 virtual StatusCode initialize() override;
44 virtual StatusCode start() override;
45 virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
46
47private:
48 // ------------------------- Private types and constants ---------------------
50 static constexpr size_t s_nTopoCTPOutputs{128};
51
53 struct DecisionBits {
54 std::optional<std::bitset<s_nTopoCTPOutputs>> triggerBits;
55 std::optional<std::bitset<s_nTopoCTPOutputs>> overflowBits;
56 std::optional<std::bitset<s_nTopoCTPOutputs>> triggerBitsSim;
57 std::optional<std::bitset<s_nTopoCTPOutputs>> overflowBitsSim;
58 std::optional<std::bitset<s_nTopoCTPOutputs>> ambiguityBitsSim;
59 std::optional<std::bitset<s_nTopoCTPOutputs>> triggerBitsCtp;
61 static std::bitset<s_nTopoCTPOutputs>& createBits(std::optional<std::bitset<s_nTopoCTPOutputs>>& opt) {
62 opt = std::bitset<s_nTopoCTPOutputs>{};
63 return opt.value();
64 }
65 };
66
67 std::vector<std::string> m_TopoAlgTriggerNames;
68 std::vector<bool> m_TopoAlgTriggerNotVetoed;
69 std::vector<std::string> m_TopoMultTriggerNames;
70 std::vector<bool> m_TopoMultTriggerNotVetoed;
71
72 std::unique_ptr<float[]> m_rateHdwNotSim;
73 std::unique_ptr<float[]> m_rateSimNotHdw;
74 std::unique_ptr<float[]> m_rateHdwAndSim;
75 std::unique_ptr<float[]> m_rateHdwSim;
76 std::unique_ptr<float[]> m_countHdwNotSim;
77 std::unique_ptr<float[]> m_countSimNotHdw;
78 std::unique_ptr<float[]> m_countHdwSim;
79 std::unique_ptr<float[]> m_countHdw;
80 std::unique_ptr<float[]> m_countSim;
81 std::unique_ptr<float[]> m_countAny;
82 std::unique_ptr<float[]> m_overflow_rateHdwNotSim;
83 std::unique_ptr<float[]> m_overflow_rateSimNotHdw;
84 std::unique_ptr<float[]> m_overflow_rateHdwAndSim;
85 std::unique_ptr<float[]> m_overflow_rateHdwSim;
86 std::unique_ptr<float[]> m_overflow_countHdwNotSim;
87 std::unique_ptr<float[]> m_overflow_countSimNotHdw;
88 std::unique_ptr<float[]> m_overflow_countHdwSim;
89 std::unique_ptr<float[]> m_overflow_countHdw;
90 std::unique_ptr<float[]> m_overflow_countSim;
91 std::unique_ptr<float[]> m_overflow_countAny;
92
93 std::unique_ptr<float[]> m_currentHdwBit;
94 std::unique_ptr<float[]> m_currentSimBit;
95
96 std::vector<unsigned> m_ctpIds;
97
98 std::vector<std::vector<std::pair<unsigned,unsigned>>> m_startbit;
99
100 //RateVars m_rateVars{};
101 // ------------------------- Properties and handles --------------------------
102 ToolHandle<GenericMonitoringTool> m_monTool {
103 this, "MonTool", "" ,
104 "Monitoring tool to create online histograms"};
106 this, "ErrorFlagsKey", "L1TopoErrorFlags",
107 "Key of the output TrigCompositeContainer with L1Topo error flags"};
108 Gaudi::Property<bool> m_doSimMon {
109 this, "doSimMon", true, "Enable L1Topo simulation decision monitoring"};
110 Gaudi::Property<bool> m_doHwMonCTP {
111 this, "doHwMonCTP", true, "Enable L1Topo HW readout from CTP"};
112 Gaudi::Property<bool> m_doHwMon {
113 this, "doHwMon", true, "Enable L1Topo HW readout from RAW"};
114 Gaudi::Property<bool> m_doHwErrorMon {
115 this, "doHwErrorMon", false, "Enable L1Topo HW Error monitoring"};
116 Gaudi::Property<bool> m_doComp {
117 this, "doComp", true, "Enable L1Topo HW/Sim comparison"};
118 Gaudi::Property<bool> m_doMultComp {
119 this, "doMultComp", false, "Enable L1Topo Multiplicity HW/Sim comparison"};
120 Gaudi::Property<bool> m_forceCTPasHdw {
121 this, "forceCTPasHdw", false, "Force to CTP monitoring as primary in Sim/Hdw comparison"};
122 Gaudi::Property<std::vector<std::string>> m_AlgorithmVetoList {
123 this, "AlgorithmVetoList", {}, "List of L1Topo algorithm items Vetoed for monitoring in L1CaloDQ package due to known Sim/Hdw mismatches"};
124 Gaudi::Property<std::vector<std::string>> m_MultiplicityVetoList {
125 this, "MultiplicityVetoList", {}, "List of multiplicity items Vetoed for monitoring in L1CaloDQ package due to known Sim/Hdw mismatches"};
126
127 ServiceHandle<StoreGateSvc> m_detStore { this, "DetectorStore", "StoreGateSvc/DetectorStore", "Detector store to get the menu" };
128
129
131 this, "L1_TopoKey", "L1_TopoSimResults", "l1topo EDM"};
132
134 this, "L1_TopoRawDataKey", "L1_Phase1L1TopoRAWData", "l1topo Raw Data"};
135
136
138 this, "CTPRDOLocation", LVL1CTP::DEFAULT_RDOOutputLocation,
139 "Key of the CTP RDO object"};
140
141 // ------------------------- Private methods ---------------------------------
142
144 StatusCode doSimMon(DecisionBits& decisionBits, std::vector<std::vector<unsigned>> &multWeights, const EventContext& ctx) const;
145
147 StatusCode doHwMonCTP(DecisionBits& decisionBits, const EventContext& ctx) const;
148
150 StatusCode doHwMon(DecisionBits& decisionBits, std::vector<std::vector<unsigned>> &multWeights, const EventContext& ctx) const;
151
153 StatusCode doComp(DecisionBits& decisionBits, const EventContext& ctx) const;
154
156 StatusCode doMultComp(std::vector<std::vector<unsigned>> &multWeightsSim, std::vector<std::vector<unsigned>> &multWeightsHdw, const EventContext& ctx) const;
157
159 std::vector<unsigned> getCtpIds(const TrigConf::L1Menu& l1menu);
160
161 std::vector<std::vector<std::pair<unsigned,unsigned>>> getStartBits(const TrigConf::L1Menu& l1menu);
162
163 // Define and set all error flags to false (Now only TrivialFlag set to true)
164 void resetFlags(xAOD::TrigComposite& errorFlags) const;
165
166};
167
168#endif // L1TOPOONLINEMONITORING_L1TopoOnlineMonitor_h
Header file to be included by clients of the Monitored infrastructure.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_errorFlagsKey
Gaudi::Property< bool > m_doHwMonCTP
std::unique_ptr< float[]> m_countHdwNotSim
std::vector< std::string > m_TopoAlgTriggerNames
std::vector< std::string > m_TopoMultTriggerNames
std::unique_ptr< float[]> m_overflow_countSimNotHdw
std::unique_ptr< float[]> m_countHdwSim
ServiceHandle< StoreGateSvc > m_detStore
StatusCode doComp(DecisionBits &decisionBits, const EventContext &ctx) const
Compare hardware and simulation.
std::unique_ptr< float[]> m_currentHdwBit
std::vector< std::vector< std::pair< unsigned, unsigned > > > getStartBits(const TrigConf::L1Menu &l1menu)
std::vector< unsigned > getCtpIds(const TrigConf::L1Menu &l1menu)
Get CTP ids from menu.
Gaudi::Property< bool > m_doMultComp
std::vector< bool > m_TopoAlgTriggerNotVetoed
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
ToolHandle< GenericMonitoringTool > m_monTool
StatusCode doHwMon(DecisionBits &decisionBits, std::vector< std::vector< unsigned > > &multWeights, const EventContext &ctx) const
Monitor the Hw bits from RAW data.
std::vector< std::vector< std::pair< unsigned, unsigned > > > m_startbit
std::unique_ptr< float[]> m_overflow_rateSimNotHdw
std::unique_ptr< float[]> m_rateSimNotHdw
void resetFlags(xAOD::TrigComposite &errorFlags) const
StatusCode doHwMonCTP(DecisionBits &decisionBits, const EventContext &ctx) const
Monitor the Hw bits from CTP.
std::vector< bool > m_TopoMultTriggerNotVetoed
static constexpr size_t s_nTopoCTPOutputs
Number of CTP outputs, used for histogram ranges and loops.
std::unique_ptr< float[]> m_countSimNotHdw
Gaudi::Property< bool > m_doSimMon
std::unique_ptr< float[]> m_countHdw
Gaudi::Property< bool > m_doHwMon
Gaudi::Property< std::vector< std::string > > m_AlgorithmVetoList
std::unique_ptr< float[]> m_rateHdwAndSim
std::unique_ptr< float[]> m_overflow_countHdw
std::unique_ptr< float[]> m_rateHdwNotSim
std::unique_ptr< float[]> m_countAny
L1TopoOnlineMonitor(const std::string &name, ISvcLocator *svcLoc)
std::unique_ptr< float[]> m_currentSimBit
Gaudi::Property< bool > m_forceCTPasHdw
std::unique_ptr< float[]> m_overflow_countSim
std::unique_ptr< float[]> m_overflow_rateHdwAndSim
std::vector< unsigned > m_ctpIds
std::unique_ptr< float[]> m_overflow_rateHdwSim
SG::ReadHandleKey< xAOD::L1TopoRawDataContainer > m_l1topoRawDataKey
std::unique_ptr< float[]> m_overflow_rateHdwNotSim
std::unique_ptr< float[]> m_countSim
Gaudi::Property< std::vector< std::string > > m_MultiplicityVetoList
SG::ReadHandleKey< CTP_RDO > m_ctpRdoKey
virtual StatusCode initialize() override
initialize
virtual StatusCode start() override
std::unique_ptr< float[]> m_overflow_countHdwNotSim
SG::ReadHandleKey< xAOD::L1TopoSimResultsContainer > m_l1topoKey
Gaudi::Property< bool > m_doComp
StatusCode doSimMon(DecisionBits &decisionBits, std::vector< std::vector< unsigned > > &multWeights, const EventContext &ctx) const
Monitor the simulated bits.
std::unique_ptr< float[]> m_rateHdwSim
std::unique_ptr< float[]> m_overflow_countAny
std::unique_ptr< float[]> m_overflow_countHdwSim
StatusCode doMultComp(std::vector< std::vector< unsigned > > &multWeightsSim, std::vector< std::vector< unsigned > > &multWeightsHdw, const EventContext &ctx) const
Compare hardware and simulation for the multiplicity algorithms.
Gaudi::Property< bool > m_doHwErrorMon
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
L1 menu configuration.
Definition L1Menu.h:28
static const std::string DEFAULT_RDOOutputLocation
location of CTP RDO output in StoreGate
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
Helper structure holding decision bitsets, passed between the monitoring methods.
static std::bitset< s_nTopoCTPOutputs > & createBits(std::optional< std::bitset< s_nTopoCTPOutputs > > &opt)
Helper method to create a new bitset and get a reference to it.
std::optional< std::bitset< s_nTopoCTPOutputs > > triggerBits
std::optional< std::bitset< s_nTopoCTPOutputs > > ambiguityBitsSim
std::optional< std::bitset< s_nTopoCTPOutputs > > overflowBitsSim
std::optional< std::bitset< s_nTopoCTPOutputs > > triggerBitsSim
std::optional< std::bitset< s_nTopoCTPOutputs > > overflowBits
std::optional< std::bitset< s_nTopoCTPOutputs > > triggerBitsCtp