ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
EgammaAnalysisAlgorithms
Root
PhotonOriginCorrectionAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
//
8
// includes
9
//
10
11
#include <
AsgDataHandles/ReadHandle.h
>
12
#include <
EgammaAnalysisAlgorithms/PhotonOriginCorrectionAlg.h
>
13
14
#include "
egammaUtils/egPhotonWrtPoint.h
"
15
//
16
// method implementations
17
//
18
19
namespace
CP
{
20
StatusCode PhotonOriginCorrectionAlg ::initialize() {
21
ANA_CHECK
(
m_PhotonHandle
.initialize(
m_systematicsList
));
22
ANA_CHECK
(
m_preselection
.initialize(
m_systematicsList
,
m_PhotonHandle
,
23
SG::AllowEmpty
));
24
25
// We do not have systematics in principle from this operation
26
ANA_CHECK
(
m_systematicsList
.initialize());
27
ANA_CHECK
(
m_primVertices
.initialize());
28
return
StatusCode::SUCCESS;
29
}
30
31
StatusCode PhotonOriginCorrectionAlg ::execute(
const
EventContext &ctx)
const
{
32
33
// If we can not rely on Event Cleaning or something
34
// else having run before for the PHYSLITE.
35
// We have to see if we have a PriVtx.
36
SG::ReadHandle<xAOD::VertexContainer>
vertices(
m_primVertices
, ctx);
37
const
xAOD::Vertex
* primary =
nullptr
;
38
for
(
const
xAOD::Vertex
* vtx : *vertices) {
39
if
(vtx->vertexType() ==
xAOD::VxType::PriVtx
) {
40
primary = vtx;
41
break
;
42
}
43
}
44
if
(!primary) {
45
ATH_MSG_WARNING
(
"Could not find a Primary vertex"
);
46
}
47
48
for
(
const
auto
& sys :
m_systematicsList
.systematicsVector()) {
49
50
xAOD::PhotonContainer
* photons =
nullptr
;
51
52
ANA_CHECK
(
m_PhotonHandle
.getCopy(photons, sys, ctx));
53
54
// Actually here we rely on the egamma preselection
55
// to have run. Otherwise there is high danger
56
// or garbage for the LarEM "gap" region.
57
// It seems to be the case for PHYSLITE
58
for
(
xAOD::Photon
* ph : *photons) {
59
if
(
m_preselection
.getBool(*ph, sys) && primary) {
60
// We have a primary vertex so we should be able
61
// to correct the Photon Origin from (0,0,0)
62
// to (0,0,z)
63
photonWrtPoint::correctForZ
(*ph, primary->z());
64
}
65
}
66
}
67
return
StatusCode::SUCCESS;
68
}
69
}
// namespace CP
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x,...)
Definition
AthMsgStreamMacros.h:46
ReadHandle.h
Handle class for reading from StoreGate.
ANA_CHECK
#define ANA_CHECK(EXP)
check whether the given expression was successful
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:325
PhotonOriginCorrectionAlg.h
CP::PhotonOriginCorrectionAlg::m_PhotonHandle
SysCopyHandle< xAOD::PhotonContainer > m_PhotonHandle
the egamma collection we run on
Definition
PhotonOriginCorrectionAlg.h:38
CP::PhotonOriginCorrectionAlg::m_preselection
SysReadSelectionHandle m_preselection
the preselection we apply to our input
Definition
PhotonOriginCorrectionAlg.h:47
CP::PhotonOriginCorrectionAlg::m_systematicsList
SysListHandle m_systematicsList
the systematics list we run
Definition
PhotonOriginCorrectionAlg.h:43
CP::PhotonOriginCorrectionAlg::m_primVertices
SG::ReadHandleKey< xAOD::VertexContainer > m_primVertices
the vertices to loop over to select the Primary
Definition
PhotonOriginCorrectionAlg.h:51
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
egPhotonWrtPoint.h
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:29
photonWrtPoint::correctForZ
void correctForZ(xAOD::Egamma &ph, double z)
Function to modify in place the kinematics of a photon wrt (0,0,z0).
Definition
egPhotonWrtPoint.cxx:23
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition
TrackingPrimitives.h:590
xAOD::PhotonContainer
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/PhotonContainer.h:17
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition
Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
Generated on
for ATLAS Offline Software by
1.17.0