ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigMinBiasMonitoring
src
FwdAFPJetEffMonitoringAlg.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 "
FwdAFPJetEffMonitoringAlg.h
"
6
7
#include <
AthenaBaseComps/AthMsgStreamMacros.h
>
8
#include <
AthenaMonitoringKernel/MonitoredCollection.h
>
9
#include "
TrigDecisionTool/TrigDecisionTool.h
"
10
11
#include <algorithm>
12
#include <iterator>
13
14
#include "
Utils.h
"
15
16
FwdAFPJetEffMonitoringAlg::FwdAFPJetEffMonitoringAlg
(
const
std::string& name, ISvcLocator* pSvcLocator)
17
:
AthMonitorAlgorithm
(name, pSvcLocator) {}
18
19
StatusCode
FwdAFPJetEffMonitoringAlg::initialize
() {
20
ATH_CHECK
(
m_jetKey
.initialize());
21
22
return
AthMonitorAlgorithm::initialize
();
23
}
24
25
StatusCode
FwdAFPJetEffMonitoringAlg::fillHistograms
(
const
EventContext& context)
const
{
26
using namespace
Monitored
;
27
28
const
auto
& trigDecTool =
getTrigDecisionTool
();
29
SG::ReadHandle<xAOD::JetContainer>
jetsHandle(
m_jetKey
, context);
30
31
ATH_MSG_DEBUG
(
"Using: "
<<
m_jetKey
.key() <<
", handle state: "
<< jetsHandle.
isValid
());
32
if
(not jetsHandle.
isValid
()) {
33
return
StatusCode::SUCCESS;
34
}
35
36
auto
passedL1 = [](
unsigned
int
bits) {
return
(bits &
TrigDefs::L1_isPassedBeforePrescale
) != 0; };
37
auto
passedHLT = [](
unsigned
int
bits) {
return
(bits &
TrigDefs::EF_passedRaw
) != 0; };
38
auto
activeHLT = [](
unsigned
int
bits) {
return
(bits &
TrigDefs::EF_prescaled
) == 0; };
39
auto
isL1 = [](
const
std::string& name) {
return
name.compare(0, 3,
"L1_"
) == 0; };
40
auto
isHLT = [](
const
std::string& name) {
return
name.compare(0, 4,
"HLT_"
) == 0; };
41
42
for
(
size_t
index
= 0;
index
<
m_references
.size(); ++
index
) {
43
const
auto
& trig =
m_chains
[
index
];
44
const
auto
&
ref
=
m_references
[
index
];
45
46
ATH_MSG_VERBOSE
(
"Check: "
<< trig <<
" vs "
<<
ref
<<
"..."
);
47
48
if
(trigDecTool->isPassed(
ref
,
TrigDefs::requireDecision
)) {
49
ATH_MSG_VERBOSE
(
"Reference: "
<<
ref
<<
" - Passed!"
);
50
51
const
unsigned
int
passBits = trigDecTool->isPassedBits(trig);
52
const
bool
wasRun = isL1(trig) or (isHLT(trig) and activeHLT(passBits));
53
54
if
(wasRun) {
55
const
auto
decision = (isL1(trig) and passedL1(passBits)) or (isHLT(trig) and passedHLT(passBits));
56
ATH_MSG_DEBUG
(
"Chain "
<< trig <<
" vs "
<<
ref
<<
" - "
<< (decision ?
"Passed!"
:
"Failed!"
));
57
58
auto
leadingJet =
Utils::findLeadingJet
(jetsHandle);
59
auto
leadingJetPt =
Scalar<float>
(
"leadingJetPt"
, leadingJet ? leadingJet->pt() * 1e-3 : -1);
60
auto
effPassed =
Scalar<int>
(
"effPassed"
, decision);
61
fill
(trig +
"_"
+
ref
, effPassed, leadingJetPt);
62
}
63
}
64
}
65
66
return
StatusCode::SUCCESS;
67
}
ref
const std::regex ref(r_ef)
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthMsgStreamMacros.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
FwdAFPJetEffMonitoringAlg.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
FwdAFPJetEffMonitoringAlg::initialize
virtual StatusCode initialize() override
initialize
Definition
FwdAFPJetEffMonitoringAlg.cxx:19
FwdAFPJetEffMonitoringAlg::m_jetKey
Gaudi::Property< SG::ReadHandleKey< xAOD::JetContainer > > m_jetKey
Definition
FwdAFPJetEffMonitoringAlg.h:26
FwdAFPJetEffMonitoringAlg::m_chains
Gaudi::Property< std::vector< std::string > > m_chains
Definition
FwdAFPJetEffMonitoringAlg.h:24
FwdAFPJetEffMonitoringAlg::FwdAFPJetEffMonitoringAlg
FwdAFPJetEffMonitoringAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
FwdAFPJetEffMonitoringAlg.cxx:16
FwdAFPJetEffMonitoringAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &context) const override
adds event to the monitoring histograms
Definition
FwdAFPJetEffMonitoringAlg.cxx:25
FwdAFPJetEffMonitoringAlg::m_references
Gaudi::Property< std::vector< std::string > > m_references
Definition
FwdAFPJetEffMonitoringAlg.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?
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
TrigDefs::L1_isPassedBeforePrescale
static const unsigned int L1_isPassedBeforePrescale
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:58
TrigDefs::requireDecision
static const unsigned int requireDecision
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:25
TrigDefs::EF_prescaled
static const unsigned int EF_prescaled
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:49
TrigDefs::EF_passedRaw
static const unsigned int EF_passedRaw
Definition
TrigEvent/TrigDecisionInterface/TrigDecisionInterface/Conditions.h:47
Utils::findLeadingJet
const xAOD::Jet * findLeadingJet(SG::ReadHandle< xAOD::JetContainer > &container)
Find leading jet.
Definition
Trigger/TrigMonitoring/TrigMinBiasMonitoring/src/Utils.cxx:26
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0