ATLAS Offline Software
MistimedStreamMonitorAlgorithm.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef TRIGT1CALOMONITORING_MISTIMEDSTREAMMONITORALGORITHM
7 #define TRIGT1CALOMONITORING_MISTIMEDSTREAMMONITORALGORITHM
8 
12 #include "StoreGate/ReadHandle.h"
13 
22 
27 #include "xAODTrigger/eFexEMRoI.h"
29 #include "xAODTrigger/eFexTauRoI.h"
30 
43 #include "xAODTrigger/jFexTauRoI.h"
44 
45 #include "xAODTrigger/gFexJetRoI.h"
47 
48 #include <TH2.h>
49 
50 // Trigger include(s):
52 
53 
55 public: MistimedStreamMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
57  virtual StatusCode initialize() override;
58  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
59 
61  struct MonitorTT {
62  const xAOD::TriggerTower* tower = nullptr;
63  double phiScaled = 0;
64  double phi1d = 0;
65  };
66 
68  struct MonitorCPM {
69  const xAOD::CPMTower* tower = nullptr;
70  std::vector<double> phiScaled;
71  double etaScaled = 0;
72  double phi1d = 0;
73  };
74 
76  struct MonitorJE {
77  const xAOD::JetElement* element = nullptr;
78  std::vector<double> phiScaled;
79  std::vector<double> etaScaled;
80  double phi1d = 0;
81  };
82 
83 
84 private:
85 
86  StringProperty m_packageName{this,"PackageName","MistimedStreamMonitor","group name for histogramming"};
87 
88  bool pulseQuality(const std::vector<uint16_t>& ttPulse, int peakSlice) const;
89 
90 
91  // TrigDecisionTool
92  PublicToolHandle< Trig::TrigDecisionTool > m_trigDec{this, "TriggerDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", ""};
93 
96 
98 
100 
101  SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEMContainerKey{this,"eFexEMContainer","L1_eEMxRoI","SG key of the input eFex RoI container"};
102  SG::ReadHandleKey<xAOD::eFexTauRoIContainer> m_eFexTauContainerKey{this,"eFexTauContainer","L1_eTauxRoI","SG key of the input eFex Tau RoI container"};
103  SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEMOutContainerKey{this,"eFexEMOutContainer","L1_eEMxRoIOutOfTime","SG key of the input eFex RoI container"};
104 
105  // container keys for jFex
106  SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jFexLRJetContainerKey {this,"jFexLRJetRoIContainer","L1_jFexLRJetRoI","SG key of the input jFex LR Jet Roi container"};
107  SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jFexSRJetContainerKey {this,"jFexSRJetRoIContainer","L1_jFexSRJetRoI","SG key of the input jFex SR Jet Roi container"};
108  SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jFexTauContainerKey {this,"jFexTauRoIContainer" ,"L1_jFexTauRoI" ,"SG key of the input jFex Tau Roi container"};
109 
110  SG::ReadHandleKey<xAOD::jFexTowerContainer> m_jFexDataTowerKey {this, "jFexDataTower","L1_jFexDataTowers","SG key of the input jFex Tower container"};
111  SG::ReadHandleKey<xAOD::jFexTowerContainer> m_EmulTowerKey {this, "InputEmulatedTowers", "L1_jFexEmulatedTowers", "SG key of the emulated jFex Tower container"};
112 
113  // Define read handles for gFex
114  SG::ReadHandleKeyArray<xAOD::gFexJetRoIContainer> m_gFexJetTobKeyList{this,"gFexJetTobKeyList",{"L1_gFexLRJetRoI", "L1_gFexSRJetRoI"},"Array of gFEX jet ReadHandleKeys to fill histograms for"};
115 
116  ToolHandle<LVL1::IL1TriggerTowerToolRun3> m_ttTool{this,"L1TriggerTowerToolRun3", "LVL1::L1TriggerTowerToolRun3/L1TriggerTowerToolRun3", "L1TriggerTowerToolRun3"};
117 
118  // Properties
119  Gaudi::Property<double> m_phiScaleTT{this, "phiScaleTT", 32./M_PI, "Scale factor to convert trigger tower phi to integer binning"};
120 
121  // L1Calo Conditions
122  SG::ReadCondHandleKey<L1CaloRunParametersContainer> m_runParametersContainer{ this, "InputKeyRunParameters", "L1CaloRunParametersContainer"};
123  SG::ReadCondHandleKey<L1CaloReadoutConfigContainerJSON> m_readoutConfigContainerJSON{ this, "InputKeyReadoutConfig", "L1CaloReadoutConfigContainerJSON"};
124 
127  std::vector<MonitorTT> &vecMonTT) const;
128 
129 
130  StatusCode fillPPMEtaPhi( MonitorTT &monTT,
131  const std::string& groupName,
132  const std::string& weightName,
133  double weight) const;
134 
136  std::vector<MonitorCPM> &vecMonCPM) const;
137 
139  std::vector<MonitorJE> &vecMonJE) const;
140 
141  //Control maximum number of histograms per job
142  Gaudi::Property<int> m_maxEvents{this,"MaxEvents",15};
143 
144  // Event number counter
145  mutable std::atomic<int> m_eventCounter{0};
146  // count number of error events per lumiblock across threads for each type of error
147  mutable std::mutex m_mutex{};
148  mutable std::map<uint32_t, int> m_event_counter ATLAS_THREAD_SAFE;
149 
150  // Bin Names for CutFlow
151  enum cutFlow {
163  };
164 
165 };
166 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MistimedStreamMonitorAlgorithm::m_maxEvents
Gaudi::Property< int > m_maxEvents
Definition: MistimedStreamMonitorAlgorithm.h:142
jFexTowerContainer.h
eFexTowerContainer.h
MistimedStreamMonitorAlgorithm::badpeakTT
@ badpeakTT
Definition: MistimedStreamMonitorAlgorithm.h:156
MistimedStreamMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: MistimedStreamMonitorAlgorithm.cxx:55
MistimedStreamMonitorAlgorithm::MistimedStreamMonitorAlgorithm
MistimedStreamMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MistimedStreamMonitorAlgorithm.cxx:12
MistimedStreamMonitorAlgorithm::m_mutex
std::mutex m_mutex
Definition: MistimedStreamMonitorAlgorithm.h:147
MistimedStreamMonitorAlgorithm::m_ttTool
ToolHandle< LVL1::IL1TriggerTowerToolRun3 > m_ttTool
Definition: MistimedStreamMonitorAlgorithm.h:116
MistimedStreamMonitorAlgorithm::MonitorJE::element
const xAOD::JetElement * element
Definition: MistimedStreamMonitorAlgorithm.h:77
jFexLRJetRoI.h
MistimedStreamMonitorAlgorithm::m_eFexTauContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:102
MistimedStreamMonitorAlgorithm::MonitorJE::etaScaled
std::vector< double > etaScaled
Definition: MistimedStreamMonitorAlgorithm.h:79
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
MistimedStreamMonitorAlgorithm::EtaPhiOverlap
@ EtaPhiOverlap
Definition: MistimedStreamMonitorAlgorithm.h:162
xAOD::JetElement_v2
Description of JetElement_v2.
Definition: JetElement_v2.h:26
RunTileMonitoring.groupName
groupName
Definition: RunTileMonitoring.py:158
MistimedStreamMonitorAlgorithm::~MistimedStreamMonitorAlgorithm
virtual ~MistimedStreamMonitorAlgorithm()=default
eFexTauRoIContainer.h
TriggerTowerContainer.h
MistimedStreamMonitorAlgorithm::lateTT
@ lateTT
Definition: MistimedStreamMonitorAlgorithm.h:159
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CPMTowerContainer.h
MistimedStreamMonitorAlgorithm::m_runParametersContainer
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainer
Definition: MistimedStreamMonitorAlgorithm.h:122
MistimedStreamMonitorAlgorithm::TTEMLayer
@ TTEMLayer
Definition: MistimedStreamMonitorAlgorithm.h:161
MistimedStreamMonitorAlgorithm::cutFlow
cutFlow
Definition: MistimedStreamMonitorAlgorithm.h:151
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
TrigDecisionTool.h
jFexLRJetRoIAuxContainer.h
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
MistimedStreamMonitorAlgorithm::m_eFexEMContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:101
jFexTauRoIContainer.h
MistimedStreamMonitorAlgorithm::m_gFexJetTobKeyList
SG::ReadHandleKeyArray< xAOD::gFexJetRoIContainer > m_gFexJetTobKeyList
Definition: MistimedStreamMonitorAlgorithm.h:114
jFexTauRoIAuxContainer.h
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:200
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
JetElementContainer.h
MistimedStreamMonitorAlgorithm
Definition: MistimedStreamMonitorAlgorithm.py:1
MistimedStreamMonitorAlgorithm::badCentralTT
@ badCentralTT
Definition: MistimedStreamMonitorAlgorithm.h:157
jFexLRJetRoIContainer.h
MistimedStreamMonitorAlgorithm::MonitorTT
Struct to contain PPM trigger tower info.
Definition: MistimedStreamMonitorAlgorithm.h:61
MistimedStreamMonitorAlgorithm::MonitorTT::phi1d
double phi1d
phi for 2d maps with integer bins (taking into account granularity in eta)
Definition: MistimedStreamMonitorAlgorithm.h:64
jFexSRJetRoI.h
MistimedStreamMonitorAlgorithm::MonitorCPM::tower
const xAOD::CPMTower * tower
Definition: MistimedStreamMonitorAlgorithm.h:69
gFexJetRoIContainer.h
MistimedStreamMonitorAlgorithm::MonitorCPM::phi1d
double phi1d
phi for 2d maps with integer bins (taking into account granularity in eta)
Definition: MistimedStreamMonitorAlgorithm.h:72
MistimedStreamMonitorAlgorithm::fillPPMEtaPhi
StatusCode fillPPMEtaPhi(MonitorTT &monTT, const std::string &groupName, const std::string &weightName, double weight) const
Definition: MistimedStreamMonitorAlgorithm.cxx:1062
MistimedStreamMonitorAlgorithm::All
@ All
Definition: MistimedStreamMonitorAlgorithm.h:152
MistimedStreamMonitorAlgorithm::L1_Trigger
@ L1_Trigger
Definition: MistimedStreamMonitorAlgorithm.h:155
jFexTower.h
jFexSRJetRoIContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthMonitorAlgorithm.h
L1CaloRunParametersContainer.h
xAOD::TriggerTower_v2
Description of TriggerTower_v2.
Definition: TriggerTower_v2.h:49
MistimedStreamMonitorAlgorithm::m_xAODTriggerTowerContainerName
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_xAODTriggerTowerContainerName
container keys including steering parameter and description
Definition: MistimedStreamMonitorAlgorithm.h:95
MistimedStreamMonitorAlgorithm::makeTowerJE
StatusCode makeTowerJE(const xAOD::JetElement *je, std::vector< MonitorJE > &vecMonJE) const
Definition: MistimedStreamMonitorAlgorithm.cxx:999
MistimedStreamMonitorAlgorithm::MonitorTT::tower
const xAOD::TriggerTower * tower
Definition: MistimedStreamMonitorAlgorithm.h:62
IL1TriggerTowerToolRun3.h
eFexTowerAuxContainer.h
MistimedStreamMonitorAlgorithm::badLateTT
@ badLateTT
Definition: MistimedStreamMonitorAlgorithm.h:158
LVL1::TrigT1CaloDefs::CPMTowerLocation
static const std::string CPMTowerLocation
Definition: TrigT1CaloDefs.h:38
MistimedStreamMonitorAlgorithm::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: MistimedStreamMonitorAlgorithm.h:92
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
MistimedStreamMonitorAlgorithm::m_packageName
StringProperty m_packageName
Definition: MistimedStreamMonitorAlgorithm.h:86
MistimedStreamMonitorAlgorithm::m_eventCounter
std::atomic< int > m_eventCounter
Definition: MistimedStreamMonitorAlgorithm.h:145
MistimedStreamMonitorAlgorithm::MonitorJE::phi1d
double phi1d
Definition: MistimedStreamMonitorAlgorithm.h:80
LVL1::TrigT1CaloDefs::JetElementLocation
static const std::string JetElementLocation
Definition: TrigT1CaloDefs.h:39
MistimedStreamMonitorAlgorithm::m_jFexSRJetContainerKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jFexSRJetContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:107
MistimedStreamMonitorAlgorithm::MonitorJE::phiScaled
std::vector< double > phiScaled
Definition: MistimedStreamMonitorAlgorithm.h:78
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MistimedStreamMonitorAlgorithm::m_jetElementLocation
SG::ReadHandleKey< xAOD::JetElementContainer > m_jetElementLocation
Definition: MistimedStreamMonitorAlgorithm.h:99
MistimedStreamMonitorAlgorithm::m_EmulTowerKey
SG::ReadHandleKey< xAOD::jFexTowerContainer > m_EmulTowerKey
Definition: MistimedStreamMonitorAlgorithm.h:111
MistimedStreamMonitorAlgorithm::pulseQuality
bool pulseQuality(const std::vector< uint16_t > &ttPulse, int peakSlice) const
Definition: MistimedStreamMonitorAlgorithm.cxx:1109
gFexJetRoI.h
MistimedStreamMonitorAlgorithm::makeTowerCPM
StatusCode makeTowerCPM(const xAOD::CPMTower *cpm, std::vector< MonitorCPM > &vecMonCPM) const
Definition: MistimedStreamMonitorAlgorithm.cxx:951
CaloCellContainer.h
LVL1::TrigT1CaloDefs::xAODTriggerTowerLocation
static const std::string xAODTriggerTowerLocation
Definition: TrigT1CaloDefs.h:36
TrigT1CaloDefs.h
eFexTauRoI.h
MistimedStreamMonitorAlgorithm::m_jFexDataTowerKey
SG::ReadHandleKey< xAOD::jFexTowerContainer > m_jFexDataTowerKey
Definition: MistimedStreamMonitorAlgorithm.h:110
eFexTower.h
MistimedStreamMonitorAlgorithm::InTime
@ InTime
Definition: MistimedStreamMonitorAlgorithm.h:160
SG::ReadCondHandleKey< L1CaloRunParametersContainer >
MistimedStreamMonitorAlgorithm::MonitorCPM::etaScaled
double etaScaled
Definition: MistimedStreamMonitorAlgorithm.h:71
MistimedStreamMonitorAlgorithm::MonitorCPM
Struct to contain CPM tower info.
Definition: MistimedStreamMonitorAlgorithm.h:68
MistimedStreamMonitorAlgorithm::m_eFexEMOutContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMOutContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:103
MistimedStreamMonitorAlgorithm::MonitorTT::phiScaled
double phiScaled
Definition: MistimedStreamMonitorAlgorithm.h:63
MistimedStreamMonitorAlgorithm::HLT_mistimemonj400
@ HLT_mistimemonj400
Definition: MistimedStreamMonitorAlgorithm.h:154
L1CaloReadoutConfigContainerJSON.h
MistimedStreamMonitorAlgorithm::MonitorJE
Struct to contain JE info.
Definition: MistimedStreamMonitorAlgorithm.h:76
jFexTauRoI.h
jFexTowerAuxContainer.h
MistimedStreamMonitorAlgorithm::m_jFexTauContainerKey
SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jFexTauContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:108
MistimedStreamMonitorAlgorithm::ATLAS_THREAD_SAFE
std::map< uint32_t, int > m_event_counter ATLAS_THREAD_SAFE
Definition: MistimedStreamMonitorAlgorithm.h:148
eFexEMRoI.h
MistimedStreamMonitorAlgorithm::m_jFexLRJetContainerKey
SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jFexLRJetContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:106
MistimedStreamMonitorAlgorithm::m_cpmTowerLocation
SG::ReadHandleKey< xAOD::CPMTowerContainer > m_cpmTowerLocation
Definition: MistimedStreamMonitorAlgorithm.h:97
ReadHandle.h
Handle class for reading from StoreGate.
MistimedStreamMonitorAlgorithm::MonitorCPM::phiScaled
std::vector< double > phiScaled
Definition: MistimedStreamMonitorAlgorithm.h:70
MistimedStreamMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: MistimedStreamMonitorAlgorithm.cxx:17
TileDCSDataPlotter.tt
tt
Definition: TileDCSDataPlotter.py:874
MistimedStreamMonitorAlgorithm::m_phiScaleTT
Gaudi::Property< double > m_phiScaleTT
Definition: MistimedStreamMonitorAlgorithm.h:119
MistimedStreamMonitorAlgorithm::makeTowerPPM
StatusCode makeTowerPPM(const xAOD::TriggerTower *tt, std::vector< MonitorTT > &vecMonTT) const
Helper functions.
Definition: MistimedStreamMonitorAlgorithm.cxx:931
jFexSRJetRoIAuxContainer.h
MistimedStreamMonitorAlgorithm::m_readoutConfigContainerJSON
SG::ReadCondHandleKey< L1CaloReadoutConfigContainerJSON > m_readoutConfigContainerJSON
Definition: MistimedStreamMonitorAlgorithm.h:123
eFexEMRoIContainer.h
MistimedStreamMonitorAlgorithm::UnsuitableReadout
@ UnsuitableReadout
Definition: MistimedStreamMonitorAlgorithm.h:153
xAOD::CPMTower_v2
Description of CPMTower_v2.
Definition: CPMTower_v2.h:26