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):
53 #include "TrigT1Result/CTP_RDO.h"
55 
56 
58 public: MistimedStreamMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator );
60  virtual StatusCode initialize() override;
61  virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
62 
64  struct MonitorTT {
65  const xAOD::TriggerTower* tower = nullptr;
66  double phiScaled = 0;
67  double phi1d = 0;
68  };
69 
71  struct MonitorCPM {
72  const xAOD::CPMTower* tower = nullptr;
73  std::vector<double> phiScaled;
74  double etaScaled = 0;
75  double phi1d = 0;
76  };
77 
79  struct MonitorJE {
80  const xAOD::JetElement* element = nullptr;
81  std::vector<double> phiScaled;
82  std::vector<double> etaScaled;
83  double phi1d = 0;
84  };
85 
86 
87 private:
88 
89  StringProperty m_packageName{this,"PackageName","MistimedStreamMonitor","group name for histogramming"};
90 
91  bool pulseQuality(const std::vector<uint16_t>& ttPulse, int peakSlice) const;
92 
93 
94  // TrigDecisionTool
95  PublicToolHandle< Trig::TrigDecisionTool > m_trigDec{this, "TriggerDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool", ""};
96 
97  SG::ReadHandleKey<CTP_RDO> m_ctpRdoReadKey {this, "CTPRDOReadKey", LVL1CTP::DEFAULT_RDOOutputLocation,"Read handle key to CTP_RDO for conversion to ByteStream"};
98 
101 
103 
105 
106  SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEMContainerKey{this,"eFexEMContainer","L1_eEMxRoI","SG key of the input eFex RoI container"};
107  SG::ReadHandleKey<xAOD::eFexTauRoIContainer> m_eFexTauContainerKey{this,"eFexTauContainer","L1_eTauxRoI","SG key of the input eFex Tau RoI container"};
108  SG::ReadHandleKey<xAOD::eFexEMRoIContainer> m_eFexEMOutContainerKey{this,"eFexEMOutContainer","L1_eEMxRoIOutOfTime","SG key of the input eFex RoI container"};
109 
110  // container keys for jFex
111  SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jFexLRJetContainerKey {this,"jFexLRJetRoIContainer","L1_jFexLRJetRoI","SG key of the input jFex LR Jet Roi container"};
112  SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jFexSRJetContainerKey {this,"jFexSRJetRoIContainer","L1_jFexSRJetRoI","SG key of the input jFex SR Jet Roi container"};
113  SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jFexTauContainerKey {this,"jFexTauRoIContainer" ,"L1_jFexTauRoI" ,"SG key of the input jFex Tau Roi container"};
114 
115  SG::ReadHandleKey<xAOD::jFexTowerContainer> m_jFexDataTowerKey {this, "jFexDataTower","L1_jFexDataTowers","SG key of the input jFex Tower container"};
116  SG::ReadHandleKey<xAOD::jFexTowerContainer> m_EmulTowerKey {this, "InputEmulatedTowers", "L1_jFexEmulatedTowers", "SG key of the emulated jFex Tower container"};
117 
118  // Define read handles for gFex
119  SG::ReadHandleKeyArray<xAOD::gFexJetRoIContainer> m_gFexJetTobKeyList{this,"gFexJetTobKeyList",{"L1_gFexLRJetRoI", "L1_gFexSRJetRoI"},"Array of gFEX jet ReadHandleKeys to fill histograms for"};
120 
121  ToolHandle<LVL1::IL1TriggerTowerToolRun3> m_ttTool{this,"L1TriggerTowerToolRun3", "LVL1::L1TriggerTowerToolRun3/L1TriggerTowerToolRun3", "L1TriggerTowerToolRun3"};
122 
123  // Properties
124  Gaudi::Property<double> m_phiScaleTT{this, "phiScaleTT", 32./M_PI, "Scale factor to convert trigger tower phi to integer binning"};
125  Gaudi::Property<bool> m_uselegacy{this, "UseLegacy", false, "Use legacy system" };
126  Gaudi::Property<bool> m_usephaseI{this, "UsePhase1", false, "Use phaseI system" };
127 
128  // L1Calo Conditions
129  SG::ReadCondHandleKey<L1CaloRunParametersContainer> m_runParametersContainer{ this, "InputKeyRunParameters", "L1CaloRunParametersContainer"};
130  SG::ReadCondHandleKey<L1CaloReadoutConfigContainerJSON> m_readoutConfigContainerJSON{ this, "InputKeyReadoutConfig", "L1CaloReadoutConfigContainerJSON"};
131 
134  std::vector<MonitorTT> &vecMonTT) const;
135 
136 
137  StatusCode fillPPMEtaPhi( MonitorTT &monTT,
138  const std::string& groupName,
139  const std::string& weightName,
140  double weight) const;
141 
143  std::vector<MonitorCPM> &vecMonCPM) const;
144 
146  std::vector<MonitorJE> &vecMonJE) const;
147 
148  //Control maximum number of histograms per job
149  Gaudi::Property<int> m_maxEvents{this,"MaxEvents",15};
150 
151  // Event number counter
152  mutable std::atomic<int> m_eventCounter{0};
153  // count number of error events per lumiblock across threads for each type of error
154  mutable std::mutex m_mutex{};
155  mutable std::map<uint32_t, int> m_event_counter ATLAS_THREAD_SAFE;
156 
157  // Bin Names for CutFlow
158  enum cutFlow {
170  };
171 
172 };
173 #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:149
jFexTowerContainer.h
CTP_Decoder.h
eFexTowerContainer.h
MistimedStreamMonitorAlgorithm::badpeakTT
@ badpeakTT
Definition: MistimedStreamMonitorAlgorithm.h:163
MistimedStreamMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: MistimedStreamMonitorAlgorithm.cxx:56
MistimedStreamMonitorAlgorithm::MistimedStreamMonitorAlgorithm
MistimedStreamMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MistimedStreamMonitorAlgorithm.cxx:12
MistimedStreamMonitorAlgorithm::m_mutex
std::mutex m_mutex
Definition: MistimedStreamMonitorAlgorithm.h:154
MistimedStreamMonitorAlgorithm::m_ttTool
ToolHandle< LVL1::IL1TriggerTowerToolRun3 > m_ttTool
Definition: MistimedStreamMonitorAlgorithm.h:121
MistimedStreamMonitorAlgorithm::MonitorJE::element
const xAOD::JetElement * element
Definition: MistimedStreamMonitorAlgorithm.h:80
jFexLRJetRoI.h
MistimedStreamMonitorAlgorithm::m_eFexTauContainerKey
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_eFexTauContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:107
MistimedStreamMonitorAlgorithm::MonitorJE::etaScaled
std::vector< double > etaScaled
Definition: MistimedStreamMonitorAlgorithm.h:82
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
MistimedStreamMonitorAlgorithm::EtaPhiOverlap
@ EtaPhiOverlap
Definition: MistimedStreamMonitorAlgorithm.h:169
MistimedStreamMonitorAlgorithm::m_uselegacy
Gaudi::Property< bool > m_uselegacy
Definition: MistimedStreamMonitorAlgorithm.h:125
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:166
M_PI
#define M_PI
Definition: ActiveFraction.h:11
CPMTowerContainer.h
MistimedStreamMonitorAlgorithm::m_runParametersContainer
SG::ReadCondHandleKey< L1CaloRunParametersContainer > m_runParametersContainer
Definition: MistimedStreamMonitorAlgorithm.h:129
MistimedStreamMonitorAlgorithm::TTEMLayer
@ TTEMLayer
Definition: MistimedStreamMonitorAlgorithm.h:168
MistimedStreamMonitorAlgorithm::cutFlow
cutFlow
Definition: MistimedStreamMonitorAlgorithm.h:158
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
TrigDecisionTool.h
jFexLRJetRoIAuxContainer.h
MistimedStreamMonitorAlgorithm::m_usephaseI
Gaudi::Property< bool > m_usephaseI
Definition: MistimedStreamMonitorAlgorithm.h:126
SG::ReadHandleKey< CTP_RDO >
MistimedStreamMonitorAlgorithm::m_eFexEMContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:106
jFexTauRoIContainer.h
MistimedStreamMonitorAlgorithm::m_gFexJetTobKeyList
SG::ReadHandleKeyArray< xAOD::gFexJetRoIContainer > m_gFexJetTobKeyList
Definition: MistimedStreamMonitorAlgorithm.h:119
jFexTauRoIAuxContainer.h
TrigT1StoreGateKeys.h
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
JetElementContainer.h
MistimedStreamMonitorAlgorithm
Definition: MistimedStreamMonitorAlgorithm.py:1
MistimedStreamMonitorAlgorithm::badCentralTT
@ badCentralTT
Definition: MistimedStreamMonitorAlgorithm.h:164
jFexLRJetRoIContainer.h
MistimedStreamMonitorAlgorithm::MonitorTT
Struct to contain PPM trigger tower info.
Definition: MistimedStreamMonitorAlgorithm.h:64
MistimedStreamMonitorAlgorithm::MonitorTT::phi1d
double phi1d
phi for 2d maps with integer bins (taking into account granularity in eta)
Definition: MistimedStreamMonitorAlgorithm.h:67
jFexSRJetRoI.h
MistimedStreamMonitorAlgorithm::MonitorCPM::tower
const xAOD::CPMTower * tower
Definition: MistimedStreamMonitorAlgorithm.h:72
gFexJetRoIContainer.h
MistimedStreamMonitorAlgorithm::MonitorCPM::phi1d
double phi1d
phi for 2d maps with integer bins (taking into account granularity in eta)
Definition: MistimedStreamMonitorAlgorithm.h:75
MistimedStreamMonitorAlgorithm::fillPPMEtaPhi
StatusCode fillPPMEtaPhi(MonitorTT &monTT, const std::string &groupName, const std::string &weightName, double weight) const
Definition: MistimedStreamMonitorAlgorithm.cxx:1092
MistimedStreamMonitorAlgorithm::All
@ All
Definition: MistimedStreamMonitorAlgorithm.h:159
MistimedStreamMonitorAlgorithm::L1_Trigger
@ L1_Trigger
Definition: MistimedStreamMonitorAlgorithm.h:162
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:100
MistimedStreamMonitorAlgorithm::makeTowerJE
StatusCode makeTowerJE(const xAOD::JetElement *je, std::vector< MonitorJE > &vecMonJE) const
Definition: MistimedStreamMonitorAlgorithm.cxx:1029
MistimedStreamMonitorAlgorithm::MonitorTT::tower
const xAOD::TriggerTower * tower
Definition: MistimedStreamMonitorAlgorithm.h:65
IL1TriggerTowerToolRun3.h
eFexTowerAuxContainer.h
MistimedStreamMonitorAlgorithm::badLateTT
@ badLateTT
Definition: MistimedStreamMonitorAlgorithm.h:165
LVL1::TrigT1CaloDefs::CPMTowerLocation
static const std::string CPMTowerLocation
Definition: TrigT1CaloDefs.h:38
MistimedStreamMonitorAlgorithm::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: MistimedStreamMonitorAlgorithm.h:95
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
MistimedStreamMonitorAlgorithm::m_packageName
StringProperty m_packageName
Definition: MistimedStreamMonitorAlgorithm.h:89
MistimedStreamMonitorAlgorithm::m_eventCounter
std::atomic< int > m_eventCounter
Definition: MistimedStreamMonitorAlgorithm.h:152
MistimedStreamMonitorAlgorithm::MonitorJE::phi1d
double phi1d
Definition: MistimedStreamMonitorAlgorithm.h:83
MistimedStreamMonitorAlgorithm::m_ctpRdoReadKey
SG::ReadHandleKey< CTP_RDO > m_ctpRdoReadKey
Definition: MistimedStreamMonitorAlgorithm.h:97
LVL1::TrigT1CaloDefs::JetElementLocation
static const std::string JetElementLocation
Definition: TrigT1CaloDefs.h:39
MistimedStreamMonitorAlgorithm::m_jFexSRJetContainerKey
SG::ReadHandleKey< xAOD::jFexSRJetRoIContainer > m_jFexSRJetContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:112
MistimedStreamMonitorAlgorithm::MonitorJE::phiScaled
std::vector< double > phiScaled
Definition: MistimedStreamMonitorAlgorithm.h:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MistimedStreamMonitorAlgorithm::m_jetElementLocation
SG::ReadHandleKey< xAOD::JetElementContainer > m_jetElementLocation
Definition: MistimedStreamMonitorAlgorithm.h:104
MistimedStreamMonitorAlgorithm::m_EmulTowerKey
SG::ReadHandleKey< xAOD::jFexTowerContainer > m_EmulTowerKey
Definition: MistimedStreamMonitorAlgorithm.h:116
MistimedStreamMonitorAlgorithm::pulseQuality
bool pulseQuality(const std::vector< uint16_t > &ttPulse, int peakSlice) const
Definition: MistimedStreamMonitorAlgorithm.cxx:1139
gFexJetRoI.h
MistimedStreamMonitorAlgorithm::makeTowerCPM
StatusCode makeTowerCPM(const xAOD::CPMTower *cpm, std::vector< MonitorCPM > &vecMonCPM) const
Definition: MistimedStreamMonitorAlgorithm.cxx:981
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:115
eFexTower.h
MistimedStreamMonitorAlgorithm::InTime
@ InTime
Definition: MistimedStreamMonitorAlgorithm.h:167
SG::ReadCondHandleKey< L1CaloRunParametersContainer >
CTP_RDO.h
MistimedStreamMonitorAlgorithm::MonitorCPM::etaScaled
double etaScaled
Definition: MistimedStreamMonitorAlgorithm.h:74
MistimedStreamMonitorAlgorithm::MonitorCPM
Struct to contain CPM tower info.
Definition: MistimedStreamMonitorAlgorithm.h:71
MistimedStreamMonitorAlgorithm::m_eFexEMOutContainerKey
SG::ReadHandleKey< xAOD::eFexEMRoIContainer > m_eFexEMOutContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:108
MistimedStreamMonitorAlgorithm::MonitorTT::phiScaled
double phiScaled
Definition: MistimedStreamMonitorAlgorithm.h:66
MistimedStreamMonitorAlgorithm::HLT_mistimemonj400
@ HLT_mistimemonj400
Definition: MistimedStreamMonitorAlgorithm.h:161
L1CaloReadoutConfigContainerJSON.h
MistimedStreamMonitorAlgorithm::MonitorJE
Struct to contain JE info.
Definition: MistimedStreamMonitorAlgorithm.h:79
jFexTauRoI.h
jFexTowerAuxContainer.h
MistimedStreamMonitorAlgorithm::m_jFexTauContainerKey
SG::ReadHandleKey< xAOD::jFexTauRoIContainer > m_jFexTauContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:113
MistimedStreamMonitorAlgorithm::ATLAS_THREAD_SAFE
std::map< uint32_t, int > m_event_counter ATLAS_THREAD_SAFE
Definition: MistimedStreamMonitorAlgorithm.h:155
eFexEMRoI.h
MistimedStreamMonitorAlgorithm::m_jFexLRJetContainerKey
SG::ReadHandleKey< xAOD::jFexLRJetRoIContainer > m_jFexLRJetContainerKey
Definition: MistimedStreamMonitorAlgorithm.h:111
MistimedStreamMonitorAlgorithm::m_cpmTowerLocation
SG::ReadHandleKey< xAOD::CPMTowerContainer > m_cpmTowerLocation
Definition: MistimedStreamMonitorAlgorithm.h:102
ReadHandle.h
Handle class for reading from StoreGate.
MistimedStreamMonitorAlgorithm::MonitorCPM::phiScaled
std::vector< double > phiScaled
Definition: MistimedStreamMonitorAlgorithm.h:73
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:124
MistimedStreamMonitorAlgorithm::makeTowerPPM
StatusCode makeTowerPPM(const xAOD::TriggerTower *tt, std::vector< MonitorTT > &vecMonTT) const
Helper functions.
Definition: MistimedStreamMonitorAlgorithm.cxx:961
jFexSRJetRoIAuxContainer.h
MistimedStreamMonitorAlgorithm::m_readoutConfigContainerJSON
SG::ReadCondHandleKey< L1CaloReadoutConfigContainerJSON > m_readoutConfigContainerJSON
Definition: MistimedStreamMonitorAlgorithm.h:130
eFexEMRoIContainer.h
MistimedStreamMonitorAlgorithm::UnsuitableReadout
@ UnsuitableReadout
Definition: MistimedStreamMonitorAlgorithm.h:160
xAOD::CPMTower_v2
Description of CPMTower_v2.
Definition: CPMTower_v2.h:26