ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigMinBiasMonitoring
src
FwdAFPJetMonitoringAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
FwdAFPJetMonitoringAlg.h
"
6
7
#include <
AthenaBaseComps/AthMsgStreamMacros.h
>
8
#include <
AthenaMonitoringKernel/MonitoredCollection.h
>
9
#include "
TrigDecisionTool/TrigDecisionTool.h
"
10
11
#include <algorithm>
12
13
#include "
Utils.h
"
14
15
FwdAFPJetMonitoringAlg::FwdAFPJetMonitoringAlg
(
const
std::string& name, ISvcLocator* pSvcLocator)
16
:
AthMonitorAlgorithm
(name, pSvcLocator) {}
17
18
StatusCode
FwdAFPJetMonitoringAlg::initialize
() {
19
ATH_CHECK
(
m_jetKey
.initialize());
20
21
return
AthMonitorAlgorithm::initialize
();
22
}
23
24
StatusCode
FwdAFPJetMonitoringAlg::fillHistograms
(
const
EventContext& context)
const
{
25
using namespace
Monitored
;
26
27
const
auto
& trigDecTool =
getTrigDecisionTool
();
28
SG::ReadHandle<xAOD::JetContainer>
jetsHandle(
m_jetKey
, context);
29
30
ATH_MSG_DEBUG
(
"Using: "
<<
m_jetKey
.key() <<
", handle state: "
<< jetsHandle.
isValid
());
31
if
(not jetsHandle.
isValid
()) {
32
return
StatusCode::SUCCESS;
33
}
34
35
for
(
const
auto
& chain :
m_chains
) {
36
ATH_MSG_DEBUG
(
"Chain: "
<< chain <<
" - Checking..."
);
37
if
(not trigDecTool->isPassed(chain,
TrigDefs::requireDecision
)) {
38
ATH_MSG_DEBUG
(
"Chain: "
<< chain <<
" - Failed"
);
39
continue
;
40
}
41
ATH_MSG_DEBUG
(
"Chain: "
<< chain <<
" - Passed"
);
42
43
auto
jetPt =
Collection
(
"jetPt"
, *jetsHandle, [](
const
auto
&
jet
) {
return
jet
->pt() * 1.e-3; });
44
auto
jetEta =
Collection
(
"jetEta"
, *jetsHandle, &
xAOD::Jet::eta
);
45
auto
jetPhi =
Collection
(
"jetPhi"
, *jetsHandle, &
xAOD::Jet::phi
);
46
47
const
auto
leadingJet =
Utils::findLeadingJet
(jetsHandle);
48
if
(leadingJet ==
nullptr
) {
49
fill
(chain +
"_"
+
m_jetKey
.key(), jetPt, jetEta, jetPhi);
50
continue
;
51
}
52
53
auto
leadingJetPt =
Scalar
(
"leadingJetPt"
, leadingJet->pt() * 1.e-3);
54
auto
leadingJetEta =
Scalar
(
"leadingJetEta"
, leadingJet->eta());
55
auto
leadingJetPhi =
Scalar
(
"leadingJetPhi"
, leadingJet->phi());
56
57
fill
(chain +
"_"
+
m_jetKey
.key(), jetPt, jetEta, jetPhi, leadingJetPt, leadingJetEta, leadingJetPhi);
58
}
59
60
return
StatusCode::SUCCESS;
61
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
FwdAFPJetMonitoringAlg.h
MonitoredCollection.h
TrigDecisionTool.h
Utils.h
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition
AthMonitorAlgorithm.cxx:22
AthMonitorAlgorithm::getTrigDecisionTool
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
Definition
AthMonitorAlgorithm.cxx:203
AthMonitorAlgorithm::AthMonitorAlgorithm
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthMonitorAlgorithm.cxx:8
FwdAFPJetMonitoringAlg::m_chains
Gaudi::Property< std::vector< std::string > > m_chains
Definition
FwdAFPJetMonitoringAlg.h:24
FwdAFPJetMonitoringAlg::initialize
virtual StatusCode initialize() override
initialize
Definition
FwdAFPJetMonitoringAlg.cxx:18
FwdAFPJetMonitoringAlg::FwdAFPJetMonitoringAlg
FwdAFPJetMonitoringAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FwdAFPJetMonitoringAlg.cxx:15
FwdAFPJetMonitoringAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &context) const override
adds event to the monitoring histograms
Definition
FwdAFPJetMonitoringAlg.cxx:24
FwdAFPJetMonitoringAlg::m_jetKey
Gaudi::Property< SG::ReadHandleKey< xAOD::JetContainer > > m_jetKey
Definition
FwdAFPJetMonitoringAlg.h:25
Monitored::Scalar
Declare a monitored scalar variable.
Definition
MonitoredScalar.h:34
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::Jet_v1::phi
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition
Jet_v1.cxx:54
xAOD::Jet_v1::eta
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition
Jet_v1.cxx:49
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.
Definition
AthMonitorAlgorithm.cxx:99
Monitored
Generic monitoring tool for athena components.
Definition
GenericMonitoringTool.h:28
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition
MonitoredCollection.h:38
TrigDefs::requireDecision
static const unsigned int requireDecision
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:25
Utils::findLeadingJet
const xAOD::Jet * findLeadingJet(SG::ReadHandle< xAOD::JetContainer > &container)
Find leading jet.
Definition
Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/Utils.cxx:26
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0