ATLAS Offline Software
Loading...
Searching...
No Matches
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
19namespace CP
20{
21
22 StatusCode PhotonEfficiencyCorrectionAlg ::
23 initialize ()
24 {
25 if (m_scaleFactorDecoration.empty())
26 {
27 ANA_MSG_ERROR ("no scale factor decoration name set");
28 return StatusCode::FAILURE;
29 }
30
36 ANA_CHECK (m_systematicsList.initialize());
37 ANA_CHECK (m_outOfValidity.initialize());
38
39 return StatusCode::SUCCESS;
40 }
41
42
43
44 StatusCode PhotonEfficiencyCorrectionAlg ::
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 {
54 if (m_preselection.getBool (*photon, sys))
55 {
56 double sf = 0;
58 m_scaleFactorDecoration.set (*photon, sf, sys);
59 } else {
61 }
62 }
63 }
64 return StatusCode::SUCCESS;
65 }
66}
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
#define ANA_CHECK(EXP)
check whether the given expression was successful
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
SysReadHandle< xAOD::PhotonContainer > m_photonHandle
the photon collection we run on
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
SysListHandle m_systematicsList
the systematics list we run
ToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_efficiencyCorrectionTool
the smearing tool
SysReadSelectionHandle m_preselection
the preselection we apply to our input
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the photon scale factor
Select isolated Photons, Electrons and Muons.
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Photon_v1 Photon
Definition of the current "egamma version".