ATLAS Offline Software
Loading...
Searching...
No Matches
EGPhotonBDTToolDecorator.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
10#include "xAODEgamma/Photon.h"
12
13namespace DerivationFramework {
14
17{
18 ATH_CHECK(m_observableTool.retrieve());
19
20 ATH_CHECK(m_ContainerName.initialize());
22
23 ATH_CHECK(m_decoratorScore.initialize());
24
25 return StatusCode::SUCCESS;
26}
27
28StatusCode
29EGPhotonBDTToolDecorator::addBranches(const EventContext& ctx) const
30{
31 // retrieve container
33 if(!m_fudgedContainerName.empty()){
35 particles = std::move(fudged);
36 } else {
38 particles = std::move(photons);
39 }
40
41 // Decorators
44 };
45
46 for (const auto& photon : *particles) {
47 // compute the BDT score with the fudged photon
48 const float score = m_observableTool->evaluate(photon);
49
50 // decorate the original object
51 const xAOD::IParticle* original = m_fudgedContainerName.empty() ?
52 photon : xAOD::getOriginalObject(*photon);
53 decoratorScore(*original) = score;
54 }
55
56 return StatusCode::SUCCESS;
57}
58}
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::ReadHandleKey< xAOD::EgammaContainer > m_fudgedContainerName
SG::ReadHandleKey< xAOD::EgammaContainer > m_ContainerName
ToolHandle< IPhotonObservableTool > m_observableTool
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorScore
Handle class for adding a decoration to an object.
Class providing the definition of the 4-vector interface.
THE reconstruction tool.
::StatusCode StatusCode
StatusCode definition for legacy code.
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...