ATLAS Offline Software
Loading...
Searching...
No Matches
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
8#include "xAODEgamma/Photon.h"
11
12namespace DerivationFramework {
13
16{
17 ATH_CHECK(m_containerName.initialize());
19
20 ATH_CHECK(m_decoratorPass.initialize());
22
23 return StatusCode::SUCCESS;
24}
25
26StatusCode
27EGPhotonCleaningWrapper::addBranches(const EventContext& ctx) const
28{
29
31 if(!m_fudgedContainerName.empty()){
33 particles = std::move(fudged);
34 } else {
36 particles = std::move(photons);
37 }
38
41 };
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}
59} // end namespace DerivationFramework
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::EgammaContainer > m_containerName
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPassDelayed
SG::ReadHandleKey< xAOD::EgammaContainer > m_fudgedContainerName
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPass
virtual StatusCode addBranches(const EventContext &ctx) const override final
Handle class for adding a decoration to an object.
elec/gamma data class.
Definition egamma.h:59
Class providing the definition of the 4-vector interface.
THE reconstruction tool.
::StatusCode StatusCode
StatusCode definition for legacy code.
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".