ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EgammaAnalysisAlgorithms
Root
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
13
#include <
EgammaAnalysisAlgorithms/PhotonEfficiencyCorrectionAlg.h
>
14
15
//
16
// method implementations
17
//
18
19
namespace
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
31
ANA_CHECK
(
m_efficiencyCorrectionTool
.retrieve());
32
ANA_CHECK
(
m_photonHandle
.initialize (
m_systematicsList
));
33
ANA_CHECK
(
m_preselection
.initialize (
m_systematicsList
,
m_photonHandle
,
SG::AllowEmpty
));
34
ANA_CHECK
(
m_scaleFactorDecoration
.initialize(
m_systematicsList
,
m_photonHandle
));
35
ANA_CHECK
(
m_systematicsList
.addSystematics (*
m_efficiencyCorrectionTool
));
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 (
const
EventContext& ctx)
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, ctx));
52
for
(
const
xAOD::Photon
*
photon
: *photons)
53
{
54
if
(
m_preselection
.getBool (*
photon
, sys))
55
{
56
double
sf = 0;
57
ANA_CHECK_CORRECTION
(
m_outOfValidity
, *
photon
,
m_efficiencyCorrectionTool
->getEfficiencyScaleFactor (*
photon
, sf));
58
m_scaleFactorDecoration
.set (*
photon
, sf, sys);
59
}
else
{
60
m_scaleFactorDecoration
.set (*
photon
,
invalidScaleFactor
(), sys);
61
}
62
}
63
}
64
return
StatusCode::SUCCESS;
65
}
66
}
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
ANA_CHECK_CORRECTION
#define ANA_CHECK_CORRECTION(helper, object, expr)
a helper check macro to work with OutOfValidityHelper
Definition
OutOfValidityHelper.h:132
PhotonEfficiencyCorrectionAlg.h
CP::PhotonEfficiencyCorrectionAlg::m_photonHandle
SysReadHandle< xAOD::PhotonContainer > m_photonHandle
the photon collection we run on
Definition
PhotonEfficiencyCorrectionAlg.h:44
CP::PhotonEfficiencyCorrectionAlg::m_outOfValidity
OutOfValidityHelper m_outOfValidity
the helper for OutOfValidity results
Definition
PhotonEfficiencyCorrectionAlg.h:54
CP::PhotonEfficiencyCorrectionAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
PhotonEfficiencyCorrectionAlg.h:40
CP::PhotonEfficiencyCorrectionAlg::m_efficiencyCorrectionTool
ToolHandle< IAsgPhotonEfficiencyCorrectionTool > m_efficiencyCorrectionTool
the smearing tool
Definition
PhotonEfficiencyCorrectionAlg.h:36
CP::PhotonEfficiencyCorrectionAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
PhotonEfficiencyCorrectionAlg.h:49
CP::PhotonEfficiencyCorrectionAlg::m_scaleFactorDecoration
SysWriteDecorHandle< float > m_scaleFactorDecoration
the decoration for the photon scale factor
Definition
PhotonEfficiencyCorrectionAlg.h:58
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::invalidScaleFactor
constexpr float invalidScaleFactor()
the decoration value to use if there is no valid scale factor decoration
Definition
SysWriteDecorHandle.h:31
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
xAOD::PhotonContainer
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/PhotonContainer.h:17
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
xAOD::photon
@ photon
Definition
TrackingPrimitives.h:200
Generated on
for ATLAS Offline Software by
1.17.0