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

#include <EGPhotonBDTToolWrapper.h>

Inheritance diagram for DerivationFramework::EGPhotonBDTToolWrapper:
Collaboration diagram for DerivationFramework::EGPhotonBDTToolWrapper:

Public Member Functions

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

Private Attributes

ToolHandle< IAsgEGammaIsEMSelectorm_selectorTool {this, "PhotonBDTSelectionTool", "", "Selector tool",}
SG::ReadHandleKey< xAOD::EgammaContainerm_ContainerName { this, "ContainerName", "", "Input" }
SG::ReadHandleKey< xAOD::EgammaContainerm_fudgedContainerName { this, "FudgedContainerName", "", "Input with fudge factors applied" }
SG::WriteDecorHandleKey< xAOD::EgammaContainerm_decoratorPass
SG::WriteDecorHandleKey< xAOD::EgammaContainerm_decoratorIsEM
Gaudi::Property< std::string > m_cut { this, "CutType", "", "cut type" }

Detailed Description

Definition at line 24 of file EGPhotonBDTToolWrapper.h.

Member Function Documentation

◆ addBranches()

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

Definition at line 30 of file EGPhotonBDTToolWrapper.cxx.

31{
32 // retrieve container
33 SG::ReadHandle<xAOD::EgammaContainer> particles;
34 if(!m_fudgedContainerName.empty()){
35 SG::ReadHandle<xAOD::EgammaContainer> fudged{ m_fudgedContainerName, ctx };
36 particles = std::move(fudged);
37 } else {
38 SG::ReadHandle<xAOD::EgammaContainer> photons{ m_ContainerName, ctx };
39 particles = std::move(photons);
40 }
41
42 // Decorators
43 SG::WriteDecorHandle<xAOD::EgammaContainer, char> decoratorPass{
45 };
46 SG::WriteDecorHandle<xAOD::EgammaContainer, unsigned int> decoratorIsEM{
48 };
49
50 for (const auto& photon : *particles) {
51 // compute the output of the selector with the fudged photon
52 asg::AcceptData theAccept(m_selectorTool->accept(ctx, photon));
53 // compute the is EM word
54 unsigned int isEM = 0;
55 ATH_CHECK(m_selectorTool->execute(ctx, photon, isEM));
56
57 // decorate the original object
58 const xAOD::IParticle* original = m_fudgedContainerName.empty() ?
60 if (m_cut.empty()) {
61 decoratorPass(*original) = static_cast<bool>(theAccept) ? 1 : 0;
62 } else {
63 decoratorPass(*original) = theAccept.getCutResult(m_cut) ? 1 : 0;
64 }
65 decoratorIsEM(*original) = isEM;
66 }
67
68 return StatusCode::SUCCESS;
69}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorPass
SG::ReadHandleKey< xAOD::EgammaContainer > m_ContainerName
ToolHandle< IAsgEGammaIsEMSelector > m_selectorTool
SG::WriteDecorHandleKey< xAOD::EgammaContainer > m_decoratorIsEM
SG::ReadHandleKey< xAOD::EgammaContainer > m_fudgedContainerName
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...

◆ initialize()

StatusCode DerivationFramework::EGPhotonBDTToolWrapper::initialize ( )
finaloverridevirtual

Definition at line 16 of file EGPhotonBDTToolWrapper.cxx.

17{
18 ATH_CHECK(m_selectorTool.retrieve());
19
20 ATH_CHECK(m_ContainerName.initialize());
22
23 ATH_CHECK(m_decoratorPass.initialize());
24 ATH_CHECK(m_decoratorIsEM.initialize());
25
26 return StatusCode::SUCCESS;
27}

Member Data Documentation

◆ m_ContainerName

SG::ReadHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonBDTToolWrapper::m_ContainerName { this, "ContainerName", "", "Input" }
private

Definition at line 37 of file EGPhotonBDTToolWrapper.h.

37{ this, "ContainerName", "", "Input" };

◆ m_cut

Gaudi::Property<std::string> DerivationFramework::EGPhotonBDTToolWrapper::m_cut { this, "CutType", "", "cut type" }
private

Definition at line 47 of file EGPhotonBDTToolWrapper.h.

47{ this, "CutType", "", "cut type" };

◆ m_decoratorIsEM

SG::WriteDecorHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonBDTToolWrapper::m_decoratorIsEM
private
Initial value:
{ this,
"decoratorIsEM", m_ContainerName, "", "" }

Definition at line 45 of file EGPhotonBDTToolWrapper.h.

45 { this,
46 "decoratorIsEM", m_ContainerName, "", "" };

◆ m_decoratorPass

SG::WriteDecorHandleKey<xAOD::EgammaContainer> DerivationFramework::EGPhotonBDTToolWrapper::m_decoratorPass
private
Initial value:
{ this,
"decoratorPass", m_ContainerName, "", "" }

Definition at line 43 of file EGPhotonBDTToolWrapper.h.

43 { this,
44 "decoratorPass", m_ContainerName, "", "" };

◆ m_fudgedContainerName

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

Definition at line 39 of file EGPhotonBDTToolWrapper.h.

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

◆ m_selectorTool

ToolHandle<IAsgEGammaIsEMSelector> DerivationFramework::EGPhotonBDTToolWrapper::m_selectorTool {this, "PhotonBDTSelectionTool", "", "Selector tool",}
private

Definition at line 35 of file EGPhotonBDTToolWrapper.h.

35{this, "PhotonBDTSelectionTool", "", "Selector tool",};

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