ATLAS Offline Software
PhotonEfficiencyCorrectionAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 
9 //
10 // includes
11 //
12 
14 
15 //
16 // method implementations
17 //
18 
19 namespace CP
20 {
21 
23  initialize ()
24  {
26  {
27  ANA_MSG_ERROR ("no scale factor decoration name set");
28  return StatusCode::FAILURE;
29  }
30 
38 
39  return StatusCode::SUCCESS;
40  }
41 
42 
43 
45  execute ()
46  {
47  for (const auto& sys : m_systematicsList.systematicsVector())
48  {
49  ANA_CHECK (m_efficiencyCorrectionTool->applySystematicVariation (sys));
50  const xAOD::PhotonContainer *photons = nullptr;
51  ANA_CHECK (m_photonHandle.retrieve (photons, sys));
52  for (const xAOD::Photon *photon : *photons)
53  {
55  {
56  double sf = 0;
59  } else {
61  }
62  }
63  }
64  return StatusCode::SUCCESS;
65  }
66 }
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
CP::PhotonEfficiencyCorrectionAlg::execute
StatusCode execute() override
Definition: PhotonEfficiencyCorrectionAlg.cxx:45
CP::PhotonEfficiencyCorrectionAlg::initialize
StatusCode initialize() override
Definition: PhotonEfficiencyCorrectionAlg.cxx:23
CP::PhotonEfficiencyCorrectionAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition: PhotonEfficiencyCorrectionAlg.h:49
CP::SysListHandle::addSystematics
StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting)
register a set of affecting variables for the current algorithm (usually obtained from an CP::ISystem...
Definition: SysListHandle.cxx:48
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
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
CP::SysListHandle::systematicsVector
const std::vector< CP::SystematicSet > & systematicsVector() const
the list of systematics to loop over
Definition: SysListHandle.cxx:96
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
CP::invalidScaleFactor
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
Definition: SysWriteDecorHandle.h:31
PhotonEfficiencyCorrectionAlg.h
CP::SysReadHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle)
initialize this handle
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
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
CP::PhotonEfficiencyCorrectionAlg::m_scaleFactorDecoration
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the photon scale factor
Definition: PhotonEfficiencyCorrectionAlg.h:58
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ANA_CHECK_CORRECTION
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
Definition: OutOfValidityHelper.h:132
CP::PhotonEfficiencyCorrectionAlg::m_efficiencyCorrectionTool
ToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_efficiencyCorrectionTool
the smearing tool
Definition: PhotonEfficiencyCorrectionAlg.h:36
CP::PhotonEfficiencyCorrectionAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition: PhotonEfficiencyCorrectionAlg.h:40
CP::SysWriteDecorHandle::empty
virtual bool empty() const noexcept override
whether we have a name configured
CP::OutOfValidityHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityHelper.cxx:25
xAOD::photon
@ photon
Definition: TrackingPrimitives.h:199
xAOD::Photon_v1
Definition: Photon_v1.h:37
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
CP::PhotonEfficiencyCorrectionAlg::m_photonHandle
SysReadHandle< xAOD::PhotonContainer > m_photonHandle
the photon collection we run on
Definition: PhotonEfficiencyCorrectionAlg.h:44
CP::SysReadSelectionHandle::initialize
StatusCode initialize(SysListHandle &sysListHandle, const ISysHandleBase &objectHandle)
initialize the accessor
Definition: SysReadSelectionHandle.cxx:34
SG::AllowEmpty
@ AllowEmpty
Definition: StoreGate/StoreGate/VarHandleKey.h:30
CP::PhotonEfficiencyCorrectionAlg::m_outOfValidity
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Definition: PhotonEfficiencyCorrectionAlg.h:54