ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
ElectronPhotonID
ElectronPhotonSelectorTools
ElectronPhotonSelectorTools
PhotonBDTCalculator.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
26
27
#ifndef ELECTRONPHOTONSELECTORTOOLS_PHOTONBDTCALCULATOR_H
28
#define ELECTRONPHOTONSELECTORTOOLS_PHOTONBDTCALCULATOR_H
29
30
#include "
AsgTools/AsgTool.h
"
31
#include "
AsgTools/ToolHandle.h
"
32
#include "
EgammaAnalysisInterfaces/IPhotonObservableTool.h
"
33
#include "
xAODEgamma/Photon.h
"
34
#include "
PhotonSingleBDTCalculator.h
"
35
#include <string>
36
37
namespace
PhotonIDBDT
{
38
39
class
PhotonBDTCalculator
:
public
asg::AsgTool
,
virtual
public
IPhotonObservableTool
40
{
41
ASG_TOOL_CLASS2
(
PhotonBDTCalculator
,
IPhotonObservableTool
,
asg::IAsgTool
)
42
43
public
:
44
PhotonBDTCalculator
(
const
std::string& name);
45
virtual
~PhotonBDTCalculator
()
override
;
46
47
virtual
StatusCode
initialize
()
override
;
48
51
using
IPhotonObservableTool::evaluate
;
52
virtual
double
evaluate
(
const
xAOD::Photon
* photon)
const override
;
53
55
StatusCode
decorate
(
const
xAOD::Photon
& ph)
const
;
56
58
StatusCode
getScore
(
const
xAOD::Photon
& ph,
float
& score)
const
;
59
60
private
:
61
// Helpers to compute input variables for converted and unconverted photons
62
StatusCode
fillVariablesConv
(
const
xAOD::Photon
& ph, std::vector<float>& vars)
const
;
63
StatusCode
fillVariablesUnconv
(
const
xAOD::Photon
& ph, std::vector<float>& vars)
const
;
64
65
// Reserve size for input features vector for converted and unconverted photons
66
Gaudi::Property<unsigned>
m_reserveVarsConv
{
this
,
"ReserveVarsConv"
, 16,
"Reserve size for input vector (converted photons)"
};
67
Gaudi::Property<unsigned>
m_reserveVarsUnconv
{
this
,
"ReserveVarsUnconv"
, 16,
"Reserve size for input vector (unconverted photons)"
};
68
69
// Sub-tools for the evaluation of the BDT score for converted and unconverted photons.
70
ToolHandle<PhotonSingleBDTCalculator>
m_toolConv
{
this
,
"ToolConv"
,
""
,
"BDT calculator for converted photons"
};
71
ToolHandle<PhotonSingleBDTCalculator>
m_toolUnconv
{
this
,
"ToolUnconv"
,
""
,
"BDT calculator for unconverted photons"
};
72
73
// Properties
74
Gaudi::Property<std::string>
m_decorationName
{
this
,
"DecorationName"
,
"PhotonBDTScore"
,
"Aux decoration name for BDT score"
};
75
Gaudi::Property<bool>
m_excludeTRT
{
this
,
"ExcludeTRT"
,
true
,
"Exclude TRT conversions (for Run 3 conversion definition)"
};
76
Gaudi::Property<bool>
m_forceRecompute
{
this
,
"ForceRecompute"
,
false
,
"If true, recompute even if decoration exists"
};
77
78
bool
isConverted
(
const
xAOD::Photon
& ph)
const
;
79
};
80
81
}
// namespace PhotonIDBDT
82
83
#endif
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition
AsgToolMacros.h:77
AsgTool.h
Photon.h
IPhotonObservableTool.h
PhotonSingleBDTCalculator.h
ToolHandle.h
IPhotonObservableTool
Definition
IPhotonObservableTool.h:14
IPhotonObservableTool::evaluate
virtual double evaluate(const xAOD::Photon *photon) const =0
PhotonIDBDT::PhotonBDTCalculator::getScore
StatusCode getScore(const xAOD::Photon &ph, float &score) const
Return the score (computes if needed if m_forceRecompute is true).
Definition
PhotonBDTCalculator.cxx:155
PhotonIDBDT::PhotonBDTCalculator::m_excludeTRT
Gaudi::Property< bool > m_excludeTRT
Definition
PhotonBDTCalculator.h:75
PhotonIDBDT::PhotonBDTCalculator::fillVariablesConv
StatusCode fillVariablesConv(const xAOD::Photon &ph, std::vector< float > &vars) const
Definition
PhotonBDTCalculator.cxx:49
PhotonIDBDT::PhotonBDTCalculator::evaluate
virtual double evaluate(const xAOD::Photon *photon) const override
Definition
PhotonBDTCalculator.cxx:172
PhotonIDBDT::PhotonBDTCalculator::~PhotonBDTCalculator
virtual ~PhotonBDTCalculator() override
PhotonIDBDT::PhotonBDTCalculator::m_forceRecompute
Gaudi::Property< bool > m_forceRecompute
Definition
PhotonBDTCalculator.h:76
PhotonIDBDT::PhotonBDTCalculator::isConverted
bool isConverted(const xAOD::Photon &ph) const
Definition
PhotonBDTCalculator.cxx:143
PhotonIDBDT::PhotonBDTCalculator::m_reserveVarsConv
Gaudi::Property< unsigned > m_reserveVarsConv
Definition
PhotonBDTCalculator.h:66
PhotonIDBDT::PhotonBDTCalculator::fillVariablesUnconv
StatusCode fillVariablesUnconv(const xAOD::Photon &ph, std::vector< float > &vars) const
Definition
PhotonBDTCalculator.cxx:96
PhotonIDBDT::PhotonBDTCalculator::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
PhotonBDTCalculator.cxx:40
PhotonIDBDT::PhotonBDTCalculator::m_decorationName
Gaudi::Property< std::string > m_decorationName
Definition
PhotonBDTCalculator.h:74
PhotonIDBDT::PhotonBDTCalculator::m_toolConv
ToolHandle< PhotonSingleBDTCalculator > m_toolConv
Definition
PhotonBDTCalculator.h:70
PhotonIDBDT::PhotonBDTCalculator::m_toolUnconv
ToolHandle< PhotonSingleBDTCalculator > m_toolUnconv
Definition
PhotonBDTCalculator.h:71
PhotonIDBDT::PhotonBDTCalculator::decorate
StatusCode decorate(const xAOD::Photon &ph) const
Compute and decorate the photon with the BDT score.
Definition
PhotonBDTCalculator.cxx:147
PhotonIDBDT::PhotonBDTCalculator::m_reserveVarsUnconv
Gaudi::Property< unsigned > m_reserveVarsUnconv
Definition
PhotonBDTCalculator.h:67
PhotonIDBDT::PhotonBDTCalculator::PhotonBDTCalculator
PhotonBDTCalculator(const std::string &name)
Definition
PhotonBDTCalculator.cxx:34
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition
IAsgTool.h:41
PhotonIDBDT
Definition
AsgPhotonBDTSelector.h:55
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