ATLAS Offline Software
Loading...
Searching...
No Matches
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//
10
11//
12// method implementations
13//
14
15namespace CP
16{
17
18 StatusCode NJetDecoratorAlg ::
19 initialize ()
20 {
25 ANA_CHECK (m_systematicsList.initialize());
26 return StatusCode::SUCCESS;
27 }
28
29
30
31 StatusCode NJetDecoratorAlg ::
32 execute ()
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));
39 const xAOD::JetContainer *jets = nullptr;
40 ANA_CHECK(m_jetsHandle.retrieve(jets, sys));
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}
#define ANA_CHECK(EXP)
check whether the given expression was successful
CP::SysWriteDecorHandle< int > m_Njet_decor
SysListHandle m_systematicsList
the systematics list we run
CP::SysReadSelectionHandle m_jetSelection
CP::SysReadHandle< xAOD::JetContainer > m_jetsHandle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the name of the event info object
Select isolated Photons, Electrons and Muons.
Jet_v1 Jet
Definition of the current "jet version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
JetContainer_v1 JetContainer
Definition of the current "jet container version".