ATLAS Offline Software
L1CaloLegacyEDMMonitorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 L1CaloLegacyEDMMonitorAlgorithm::L1CaloLegacyEDMMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
8  : AthMonitorAlgorithm(name,pSvcLocator)
9 {
10 }
11 
13 
14  ATH_MSG_DEBUG("L1CaloLegacyEDMMonitorAlgorith::initialize");
15  ATH_MSG_DEBUG("Package Name "<< m_packageName);
16  ATH_MSG_DEBUG("EmTauRoIContainer"<< m_l1TauRoIKey);
17  ATH_MSG_DEBUG("JetRoIContainer"<<m_l1JetRoIKey);
18  ATH_MSG_DEBUG("EnergySumRoI"<<m_l1EnergySumRoIKey);
19 
20  // we initialise all the containers that we need
21  ATH_CHECK(m_l1TauRoIKey.initialize());
22  ATH_CHECK(m_l1JetRoIKey.initialize());
23  ATH_CHECK(m_l1EnergySumRoIKey.initialize());
24 
26 }
27 
29 
30  ATH_MSG_DEBUG("L1CaloLegacyEDMMonitorAlgorithm::fillHistograms");
31 
32  std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> variables;
33 
35  if(!EmTauRoIs.isValid()){
36  ATH_MSG_ERROR("No EM Tau container found in storegate "<< m_l1TauRoIKey);
37  return StatusCode::SUCCESS;
38  }
39 
41  if(!JetRoIs.isValid()){
42  ATH_MSG_ERROR("No Jet container found in storegate "<< m_l1JetRoIKey);
43  return StatusCode::SUCCESS;
44  }
45 
47  if(!EnergyRoIs.isValid()){
48  ATH_MSG_ERROR("No EnergySum container found in storegate "<< m_l1EnergySumRoIKey);
49  return StatusCode::SUCCESS;
50  }
51 
52  auto LVL1EmTauRoIs_eta = Monitored::Scalar<float>("LVL1EmTauRoIs_eta",0.);
53  auto LVL1EmTauRoIs_phi = Monitored::Scalar<float>("LVL1EmTauRoIs_phi",0.);
54  auto LVL1EmTauRoIs_core = Monitored::Scalar<float>("LVL1EmTauRoIs_core",0.);
55  auto LVL1EmTauRoIs_emClus = Monitored::Scalar<float>("LVL1EmTauRoIs_emClus",0.);
56  auto LVL1EmTauRoIs_tauClus = Monitored::Scalar<float>("LVL1EmTauRoIs_tauClus",0.);
57  auto LVL1EmTauRoIs_hadIsol = Monitored::Scalar<float>("LVL1EmTauRoIs_hadIsol",0.);
58  auto LVL1EmTauRoIs_emIsol = Monitored::Scalar<float>("LVL1EmTauRoIs_emIsol",0.);
59  auto LVL1EmTauRoIs_hadCore = Monitored::Scalar<float>("LVL1EmTauRoIs_hadCore" ,0.);
60  auto LVL1EmTauRoIs_thrPattern = Monitored::Scalar<float>("LVL1EmTauRoIs_thrPattern" ,0.);
61 
62  auto LVL1JetRoIs_eta = Monitored::Scalar<float>("LVL1JetRoIs_eta" ,0.);
63  auto LVL1JetRoIs_phi = Monitored::Scalar<float>("LVL1JetRoIs_phi" ,0.);
64  auto LVL1JetRoIs_et4x4 = Monitored::Scalar<float>("LVL1JetRoIs_et4x4" ,0.);
65  auto LVL1JetRoIs_et8x8 = Monitored::Scalar<float>("LVL1JetRoIs_et8x8" ,0.);
66 
67  auto LVL1EnergySumRoI_energyT = Monitored::Scalar<float>("LVL1EnergySumRoI_energyT" ,0.);
68  auto LVL1EnergySumRoI_energyX = Monitored::Scalar<float>("LVL1EnergySumRoI_energyX" ,0.);
69  auto LVL1EnergySumRoI_energyY = Monitored::Scalar<float>("LVL1EnergySumRoI_energyY" ,0.);
70 
71  for (auto roi : *EmTauRoIs) {
72 
73  ATH_MSG_DEBUG("isTauRoI:" << " eta: " << roi->eta() << " phi: " << roi->phi() );
74 
75  LVL1EmTauRoIs_eta = roi->eta();
76  fill(m_packageName,LVL1EmTauRoIs_eta);
77 
78  LVL1EmTauRoIs_phi = roi->phi();
79  fill(m_packageName, LVL1EmTauRoIs_phi);
80 
81  LVL1EmTauRoIs_core = roi->core()/1000.;
82  fill(m_packageName,LVL1EmTauRoIs_core);
83  LVL1EmTauRoIs_emClus = roi->emClus()/1000.;
84  fill(m_packageName,LVL1EmTauRoIs_emClus);
85  LVL1EmTauRoIs_tauClus= roi->tauClus()/1000.;
86  fill(m_packageName,LVL1EmTauRoIs_tauClus);
87  LVL1EmTauRoIs_hadIsol= roi->hadIsol()/1000.;
88  fill(m_packageName,LVL1EmTauRoIs_hadIsol);
89  LVL1EmTauRoIs_emIsol= roi->emIsol()/1000.;
90  fill(m_packageName,LVL1EmTauRoIs_emIsol);
91  LVL1EmTauRoIs_hadCore=roi->hadCore()/1000.;
92  fill(m_packageName,LVL1EmTauRoIs_hadCore);
93  LVL1EmTauRoIs_thrPattern=roi->thrPattern();
94  fill(m_packageName,LVL1EmTauRoIs_thrPattern);
95  }
96 
97  for (auto roi : *JetRoIs) {
98 
99  ATH_MSG_DEBUG("isTauRoI:" << " eta: " << roi->eta() << " phi: " << roi->phi() );
100 
101  LVL1JetRoIs_eta = roi->eta();
102  fill(m_packageName,LVL1JetRoIs_eta);
103  LVL1JetRoIs_phi = roi->phi();
104  fill(m_packageName,LVL1JetRoIs_phi);
105  LVL1JetRoIs_et4x4 = roi->et4x4()/1000.;
106  fill(m_packageName,LVL1JetRoIs_et4x4);
107  LVL1JetRoIs_et8x8 = roi->et8x8()/1000.;
108  fill(m_packageName,LVL1JetRoIs_et8x8);
109  }
110 
111  const xAOD::EnergySumRoI* Energyroi = EnergyRoIs.cptr();
112  LVL1EnergySumRoI_energyT = Energyroi->energyT()/1000.;
113  fill(m_packageName,LVL1EnergySumRoI_energyT);
114  LVL1EnergySumRoI_energyX = Energyroi->energyX()/1000.;
115  fill(m_packageName,LVL1EnergySumRoI_energyX);
116  LVL1EnergySumRoI_energyY = Energyroi->energyY()/1000.;
117  fill(m_packageName,LVL1EnergySumRoI_energyY);
118 
119  auto run = Monitored::Scalar<int>("run",GetEventInfo(ctx)->runNumber());
120  variables.push_back(run);
121 
122 
124  variables.clear();
125  return StatusCode::SUCCESS;
126 }
127 
128 
L1CaloLegacyEDMMonitorAlgorithm.h
L1CaloLegacyEDMMonitorAlgorithm::m_l1JetRoIKey
SG::ReadHandleKey< xAOD::JetRoIContainer > m_l1JetRoIKey
Definition: L1CaloLegacyEDMMonitorAlgorithm.h:26
L1CaloLegacyEDMMonitorAlgorithm::m_packageName
StringProperty m_packageName
Definition: L1CaloLegacyEDMMonitorAlgorithm.h:24
checkCoolLatestUpdate.variables
variables
Definition: checkCoolLatestUpdate.py:13
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
L1CaloLegacyEDMMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: L1CaloLegacyEDMMonitorAlgorithm.cxx:28
xAOD::EnergySumRoI_v2::energyT
float energyT() const
The deposited total transverse energy.
L1CaloLegacyEDMMonitorAlgorithm::m_l1TauRoIKey
SG::ReadHandleKey< xAOD::EmTauRoIContainer > m_l1TauRoIKey
Definition: L1CaloLegacyEDMMonitorAlgorithm.h:25
xAOD::EnergySumRoI_v2::energyY
float energyY() const
The total energy deposited in the Y direction.
L1CaloLegacyEDMMonitorAlgorithm::L1CaloLegacyEDMMonitorAlgorithm
L1CaloLegacyEDMMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: L1CaloLegacyEDMMonitorAlgorithm.cxx:7
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
L1CaloLegacyEDMMonitorAlgorithm::m_l1EnergySumRoIKey
SG::ReadHandleKey< xAOD::EnergySumRoI > m_l1EnergySumRoIKey
Definition: L1CaloLegacyEDMMonitorAlgorithm.h:27
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
run
Definition: run.py:1
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
xAOD::EnergySumRoI_v2::energyX
float energyX() const
The total energy deposited in the X direction.
AthMonitorAlgorithm::GetEventInfo
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
Definition: AthMonitorAlgorithm.cxx:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
L1CaloLegacyEDMMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: L1CaloLegacyEDMMonitorAlgorithm.cxx:12
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
xAOD::EnergySumRoI_v2
Class describing a LVL1 energy-sum "RoI".
Definition: EnergySumRoI_v2.h:35