ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::EGPhotonCleaningWrapper Class Reference

#include <EGPhotonCleaningWrapper.h>

Inheritance diagram for DerivationFramework::EGPhotonCleaningWrapper:
Collaboration diagram for DerivationFramework::EGPhotonCleaningWrapper:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Attributes

SG::ReadHandleKey< xAOD::EgammaContainerm_containerName
SG::ReadHandleKey< xAOD::EgammaContainerm_fudgedContainerName
SG::WriteDecorHandleKey< xAOD::EgammaContainerm_decoratorPass { this, "decoratorPass", m_containerName, "", "" }
SG::WriteDecorHandleKey< xAOD::EgammaContainerm_decoratorPassDelayed { this, "decoratorPassDelayed", m_containerName, "", "" }

Detailed Description

Definition at line 22 of file EGPhotonCleaningWrapper.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::EGPhotonCleaningWrapper::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 27 of file EGPhotonCleaningWrapper.cxx.

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{
41 };
42 SG::WriteDecorHandle<xAOD::EgammaContainer, char> decoratorPassDelayed{
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() ?
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}
SG::ReadHandleKey< xAOD::EgammaContainer > m_containerName
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPassDelayed
SG::ReadHandleKey< xAOD::EgammaContainer > m_fudgedContainerName
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPass
bool passOQqualityDelayed(const xAOD::Photon &ph)
Helpers to ease the implementation of the pass Quality requirements.
bool passOQquality(const xAOD::Photon &ph)
Helper to ease the implemmantation of the pass Quality requirements.
const IParticle * getOriginalObject(const IParticle &copy)
This function can be used to conveniently get a pointer back to the original object from which a copy...
Photon_v1 Photon
Definition of the current "egamma version".

◆ initialize()

StatusCode DerivationFramework::EGPhotonCleaningWrapper::initialize ( )
finaloverridevirtual

Definition at line 15 of file EGPhotonCleaningWrapper.cxx.

16{
17 ATH_CHECK(m_containerName.initialize());
19
20 ATH_CHECK(m_decoratorPass.initialize());
22
23 return StatusCode::SUCCESS;
24}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_containerName

SG::ReadHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonCleaningWrapper::m_containerName
private
Initial value:
{ this,
"ContainerName",
"",
"Input" }

Definition at line 32 of file EGPhotonCleaningWrapper.h.

32 { this,
33 "ContainerName",
34 "",
35 "Input" };

◆ m_decoratorPass

SG::WriteDecorHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonCleaningWrapper::m_decoratorPass { this, "decoratorPass", m_containerName, "", "" }
private

Definition at line 41 of file EGPhotonCleaningWrapper.h.

41{ this, "decoratorPass", m_containerName, "", "" };

◆ m_decoratorPassDelayed

SG::WriteDecorHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonCleaningWrapper::m_decoratorPassDelayed { this, "decoratorPassDelayed", m_containerName, "", "" }
private

Definition at line 43 of file EGPhotonCleaningWrapper.h.

43{ this, "decoratorPassDelayed", m_containerName, "", "" };

◆ m_fudgedContainerName

SG::ReadHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonCleaningWrapper::m_fudgedContainerName
private
Initial value:
{ this,
"FudgedContainerName", "", "Input with fudge factors applied" }

Definition at line 36 of file EGPhotonCleaningWrapper.h.

36 { this,
37 "FudgedContainerName", "", "Input with fudge factors applied" };

The documentation for this class was generated from the following files: