ATLAS Offline Software
Loading...
Searching...
No Matches
HLTHeavyIonMonAlg.cxx
Go to the documentation of this file.
1/*
2Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "HLTHeavyIonMonAlg.h"
6
10
11HLTHeavyIonMonAlg::HLTHeavyIonMonAlg(const std::string& name, ISvcLocator* pSvcLocator)
12 : AthMonitorAlgorithm(name, pSvcLocator) {}
13
15 // for monitorSumEt:
16 ATH_CHECK(m_lvl1EnergySumROIKey.initialize());
17 ATH_CHECK(m_jFexSumETRoIKey.initialize());
18 ATH_CHECK(m_HIEventShapeKey.initialize());
19
21}
22
23StatusCode HLTHeavyIonMonAlg::fillHistograms(const EventContext& context) const {
24 ATH_CHECK(monitorSumEt(context));
25
26 return StatusCode::SUCCESS;
27}
28
29StatusCode HLTHeavyIonMonAlg::monitorSumEt(const EventContext& context) const {
30 // Legacy L1 stuff – left for HLT developer reprocessings
31 float lvl1_sumET = 0.f;
32 auto lvl1EnergySumHandle = SG::makeHandle(m_lvl1EnergySumROIKey, context);
33 ATH_MSG_DEBUG("LVL1 EnergySum handle: " << lvl1EnergySumHandle.isValid());
34 if (lvl1EnergySumHandle.isValid()) { lvl1_sumET = 1e-3 * lvl1EnergySumHandle->energyT(); /* MeV -> GeV */ }
35
36 auto jFexSumETHandle = SG::makeHandle(m_jFexSumETRoIKey, context);
37 ATH_MSG_DEBUG("jFeX EnergySum handle: " << jFexSumETHandle.isValid());
38 if (not jFexSumETHandle.isValid()) {
39 ATH_MSG_DEBUG("Could not retrieve jFexSumETHandle");
40 return StatusCode::SUCCESS;
41 }
42
43 auto HIEventShapeHandle = SG::makeHandle(m_HIEventShapeKey, context);
44 ATH_MSG_DEBUG("HI event shape handle: " << HIEventShapeHandle.isValid());
45 if (not HIEventShapeHandle.isValid()) {
46 ATH_MSG_DEBUG("Could not retrieve HIEventShapeHandle");
47 return StatusCode::SUCCESS;
48 }
49
50 // Calculate total and forward TE from jFEX
51 float sum_jTE = 0.f;
52 float sum_fwdA_jTE = 0.f;
53 float sum_fwdC_jTE = 0.f;
54
55 for (const xAOD::jFexSumETRoI* jFexRoI : *jFexSumETHandle) {
56 sum_jTE += jFexRoI->Et_lower() + jFexRoI->Et_upper();
57 if (jFexRoI->jFexNumber() == 0) { sum_fwdC_jTE += jFexRoI->Et_upper(); }
58 if (jFexRoI->jFexNumber() == 5) { sum_fwdA_jTE += jFexRoI->Et_upper(); }
59 }
60 sum_jTE *= 0.001; // MeV -> GeV
61 sum_fwdA_jTE *= 0.001;
62 sum_fwdC_jTE *= 0.001;
63
64 // Calculate FCal ET from HIEventShape
65 float totalFCalEtSideA = 0.;
66 float totalFCalEtSideC = 0.;
67 for (const xAOD::HIEventShape* es : *HIEventShapeHandle) {
68 const int layer = es->layer();
69 if (layer < 21 or layer > 23) { continue; }
70
71 const float et = es->et();
72 if (std::abs(et) < 0.1) { continue; }
73
74 const float eta = 0.5 * (es->etaMin() + es->etaMax());
75 if (eta > 0.) {
76 totalFCalEtSideA += et;
77 } else {
78 totalFCalEtSideC += et;
79 }
80 }
81 totalFCalEtSideA *= 0.001; // MeV -> GeV
82 totalFCalEtSideC *= 0.001;
83
84 auto sum_L1TE = Monitored::Scalar("sum_L1TE", lvl1_sumET);
85 auto sum_L1jTE = Monitored::Scalar("sum_L1jTE", sum_jTE);
86 auto sum_L1FWDAjTE = Monitored::Scalar("sum_L1FWDAjTE", sum_fwdA_jTE);
87 auto sum_L1FWDCjTE = Monitored::Scalar("sum_L1FWDCjTE", sum_fwdC_jTE);
88 auto sum_FCalAEt = Monitored::Scalar("sum_FCalAEt", totalFCalEtSideA);
89 auto sum_FCalCEt = Monitored::Scalar("sum_FCalCEt", totalFCalEtSideC);
90
91 const auto& trigDecTool = getTrigDecisionTool();
92 for (const auto& chain : m_triggerListMon) {
93 if (not trigDecTool->isPassed(chain, TrigDefs::requireDecision)) { continue; }
94
95 fill(chain + "_sumEt", sum_L1TE, sum_L1jTE, sum_L1FWDAjTE, sum_L1FWDCjTE, sum_FCalAEt, sum_FCalCEt);
96 }
97
98 return StatusCode::SUCCESS;
99}
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
virtual StatusCode initialize() override
initialize
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode fillHistograms(const EventContext &context) const override
adds event to the monitoring histograms
virtual StatusCode initialize() override
initialize
Gaudi::Property< std::vector< std::string > > m_triggerListMon
StatusCode monitorSumEt(const EventContext &context) const
SG::ReadHandleKey< xAOD::EnergySumRoI > m_lvl1EnergySumROIKey
SG::ReadHandleKey< xAOD::jFexSumETRoIContainer > m_jFexSumETRoIKey
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_HIEventShapeKey
HLTHeavyIonMonAlg(const std::string &name, ISvcLocator *pSvcLocator)
Declare a monitored scalar variable.
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.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
jFexSumETRoI_v1 jFexSumETRoI
Define the latest version of the jFexSumETJetRoI class.
HIEventShape_v2 HIEventShape
Definition of the latest event info version.
Extra patterns decribing particle interation process.