ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
Root
NJetDecoratorAlg.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
6
//
7
// includes
8
//
9
#include "
AsgAnalysisAlgorithms/NJetDecoratorAlg.h
"
10
11
//
12
// method implementations
13
//
14
15
namespace
CP
16
{
17
18
StatusCode NJetDecoratorAlg ::
19
initialize ()
20
{
21
ANA_CHECK
(
m_eventInfoHandle
.initialize(
m_systematicsList
));
22
ANA_CHECK
(
m_jetsHandle
.initialize(
m_systematicsList
));
23
ANA_CHECK
(
m_jetSelection
.initialize(
m_systematicsList
,
m_jetsHandle
,
SG::AllowEmpty
));
24
ANA_CHECK
(
m_Njet_decor
.initialize(
m_systematicsList
,
m_eventInfoHandle
));
25
ANA_CHECK
(
m_systematicsList
.initialize());
26
return
StatusCode::SUCCESS;
27
}
28
29
30
31
StatusCode NJetDecoratorAlg ::
32
execute (
const
EventContext& ctx)
33
{
34
// Take care of the weight (which is the only thing depending on systematics)
35
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector())
36
{
37
const
xAOD::EventInfo
* systEvtInfo =
nullptr
;
38
ANA_CHECK
(
m_eventInfoHandle
.retrieve(systEvtInfo, sys, ctx));
39
const
xAOD::JetContainer
*jets =
nullptr
;
40
ANA_CHECK
(
m_jetsHandle
.retrieve(jets, sys, ctx));
41
42
int
jet_n = 0;
43
for
(
const
xAOD::Jet
*
jet
: *jets)
44
{
45
if
(
m_jetSelection
.getBool(*
jet
, sys)){
46
jet_n++;
47
}
48
}
49
m_Njet_decor
.set(*systEvtInfo, jet_n, sys);
50
};
51
return
StatusCode::SUCCESS;
52
}
53
}
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
NJetDecoratorAlg.h
CP::NJetDecoratorAlg::m_Njet_decor
CP::SysWriteDecorHandle< int > m_Njet_decor
Definition
NJetDecoratorAlg.h:47
CP::NJetDecoratorAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
NJetDecoratorAlg.h:37
CP::NJetDecoratorAlg::m_jetSelection
CP::SysReadSelectionHandle m_jetSelection
Definition
NJetDecoratorAlg.h:45
CP::NJetDecoratorAlg::m_jetsHandle
CP::SysReadHandle< xAOD::JetContainer > m_jetsHandle
Definition
NJetDecoratorAlg.h:43
CP::NJetDecoratorAlg::m_eventInfoHandle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the name of the event info object
Definition
NJetDecoratorAlg.h:40
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::EventInfo
EventInfo_v1 EventInfo
Definition of the latest event info version.
Definition
IEventInfoCnvTool.h:16
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0