ATLAS Offline Software
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 
15 namespace CP
16 {
17 
19  initialize ()
20  {
26  return StatusCode::SUCCESS;
27  }
28 
29 
30 
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;
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 }
CP::SysWriteDecorHandle::set
void set(const SG::AuxElement &object, const T &value, const CP::SystematicSet &sys) const
set the object decoration for the given systematic
defineDB.jets
jets
Definition: JetTagCalibration/share/defineDB.py:24
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:324
CP::SysReadHandle::retrieve
::StatusCode retrieve(const T *&object, const CP::SystematicSet &sys) const
retrieve the object for the given name
NJetDecoratorAlg.h
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP::NJetDecoratorAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: NJetDecoratorAlg.h:39
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:25
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::NJetDecoratorAlg::m_jetsHandle
CP::SysReadHandle< xAOD::JetContainer > m_jetsHandle
Definition: NJetDecoratorAlg.h:45
CP::NJetDecoratorAlg::m_Njet_decor
CP::SysWriteDecorHandle< int > m_Njet_decor
Definition: NJetDecoratorAlg.h:49
CP::NJetDecoratorAlg::m_eventInfoHandle
CP::SysReadHandle< xAOD::EventInfo > m_eventInfoHandle
the name of the event info object
Definition: NJetDecoratorAlg.h:42
CP::SysReadHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
CP::SysListHandle::initialize
::StatusCode initialize()
intialize this property
Definition: SysListHandle.cxx:69
CP::SysReadSelectionHandle::getBool
bool getBool(const SG::AuxElement &element, const CP::SystematicSet &sys) const
get the selection as a bool
CP::NJetDecoratorAlg::execute
StatusCode execute() override
Definition: NJetDecoratorAlg.cxx:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::SysWriteDecorHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize this handle
DataVector
Derived DataVector<T>.
Definition: DataVector.h:795
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
CP::NJetDecoratorAlg::m_jetSelection
CP::SysReadSelectionHandle m_jetSelection
Definition: NJetDecoratorAlg.h:47
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
CP::NJetDecoratorAlg::initialize
StatusCode initialize() override
Definition: NJetDecoratorAlg.cxx:19
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:27