ATLAS Offline Software
Loading...
Searching...
No Matches
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
7L1CaloLegacyEDMMonitorAlgorithm::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
28StatusCode L1CaloLegacyEDMMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
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
123 fill(m_packageName,variables);
124 variables.clear();
125 return StatusCode::SUCCESS;
126}
127
128
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
virtual StatusCode initialize() override
initialize
SG::ReadHandle< xAOD::EventInfo > GetEventInfo(const EventContext &) const
Return a ReadHandle for an EventInfo object (get run/event numbers, etc.)
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
SG::ReadHandleKey< xAOD::EmTauRoIContainer > m_l1TauRoIKey
L1CaloLegacyEDMMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< xAOD::JetRoIContainer > m_l1JetRoIKey
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
virtual StatusCode initialize() override
initialize
SG::ReadHandleKey< xAOD::EnergySumRoI > m_l1EnergySumRoIKey
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
float energyT() const
The deposited total transverse energy.
float energyX() const
The total energy deposited in the X direction.
float energyY() const
The total energy deposited in the Y direction.
Definition run.py:1
EnergySumRoI_v2 EnergySumRoI
void fill(H5::Group &out_file, size_t iterations)