ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkEGamma
src
EGPhotonCleaningWrapper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// Author: Giovanni Marchiori (giovanni.marchiori@cern.ch)
6
7
#include "
DerivationFrameworkEGamma/EGPhotonCleaningWrapper.h
"
8
#include "
xAODEgamma/Photon.h
"
9
#include <
EgammaAnalysisHelpers/PhotonHelpers.h
>
10
#include "
xAODBase/IParticleHelpers.h
"
11
12
namespace
DerivationFramework
{
13
14
StatusCode
15
EGPhotonCleaningWrapper::initialize
()
16
{
17
ATH_CHECK
(
m_containerName
.initialize());
18
ATH_CHECK
(
m_fudgedContainerName
.initialize(!
m_fudgedContainerName
.empty()));
19
20
ATH_CHECK
(
m_decoratorPass
.initialize());
21
ATH_CHECK
(
m_decoratorPassDelayed
.initialize());
22
23
return
StatusCode::SUCCESS;
24
}
25
26
StatusCode
27
EGPhotonCleaningWrapper::addBranches
(
const
EventContext& ctx)
const
28
{
29
30
SG::ReadHandle<xAOD::EgammaContainer>
particles;
31
if
(!
m_fudgedContainerName
.empty()){
32
SG::ReadHandle<xAOD::EgammaContainer>
fudged{
m_fudgedContainerName
, ctx };
33
particles = std::move(fudged);
34
}
else
{
35
SG::ReadHandle<xAOD::EgammaContainer>
photons{
m_containerName
, ctx };
36
particles = std::move(photons);
37
}
38
39
SG::WriteDecorHandle<xAOD::EgammaContainer, char>
decoratorPass{
40
m_decoratorPass
, ctx
41
};
42
SG::WriteDecorHandle<xAOD::EgammaContainer, char>
decoratorPassDelayed{
43
m_decoratorPassDelayed
, ctx
44
};
45
46
// Write mask for each element and record to SG for subsequent selection
47
for
(
const
auto
&
egamma
: *particles) {
48
// decorate the original object
49
const
xAOD::IParticle
* original =
m_fudgedContainerName
.empty() ?
50
egamma
:
xAOD::getOriginalObject
(*
egamma
);
51
const
xAOD::Photon
* gCopy =
static_cast<
const
xAOD::Photon
*
>
(
egamma
);
52
decoratorPass(*original) =
53
static_cast<
int
>
(
PhotonHelpers::passOQquality
(*gCopy));
54
decoratorPassDelayed(*original) =
55
static_cast<
int
>
(
PhotonHelpers::passOQqualityDelayed
(*gCopy));
56
}
57
return
StatusCode::SUCCESS;
58
}
59
}
// end namespace DerivationFramework
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
EGPhotonCleaningWrapper.h
Photon.h
IParticleHelpers.h
PhotonHelpers.h
DerivationFramework::EGPhotonCleaningWrapper::m_containerName
SG::ReadHandleKey< xAOD::EgammaContainer > m_containerName
Definition
EGPhotonCleaningWrapper.h:32
DerivationFramework::EGPhotonCleaningWrapper::m_decoratorPassDelayed
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPassDelayed
Definition
EGPhotonCleaningWrapper.h:43
DerivationFramework::EGPhotonCleaningWrapper::m_fudgedContainerName
SG::ReadHandleKey< xAOD::EgammaContainer > m_fudgedContainerName
Definition
EGPhotonCleaningWrapper.h:36
DerivationFramework::EGPhotonCleaningWrapper::initialize
virtual StatusCode initialize() override final
Definition
EGPhotonCleaningWrapper.cxx:15
DerivationFramework::EGPhotonCleaningWrapper::m_decoratorPass
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPass
Definition
EGPhotonCleaningWrapper.h:41
DerivationFramework::EGPhotonCleaningWrapper::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition
EGPhotonCleaningWrapper.cxx:27
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
egamma
elec/gamma data class.
Definition
egamma.h:59
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PhotonHelpers::passOQqualityDelayed
bool passOQqualityDelayed(const xAOD::Photon &ph)
Helpers to ease the implementation of the pass Quality requirements.
Definition
PhotonHelpers.cxx:29
PhotonHelpers::passOQquality
bool passOQquality(const xAOD::Photon &ph)
Helper to ease the implemmantation of the pass Quality requirements.
Definition
PhotonHelpers.cxx:12
xAOD::getOriginalObject
const IParticle * getOriginalObject(const IParticle ©)
This function can be used to conveniently get a pointer back to the original object from which a copy...
Definition
IParticleHelpers.cxx:140
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