ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
Interfaces
EgammaAnalysisInterfaces
EgammaAnalysisInterfaces
IPhotonObservableTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef EGAMMAANALYSISINTERFACES__IPHOTONOBSERVABLETOOL__
6
#define EGAMMAANALYSISINTERFACES__IPHOTONOBSERVABLETOOL__
7
8
#include <stdexcept>
9
#include <string>
10
#include <type_traits>
11
#include "
AsgAnalysisInterfaces/IObservableTool.h
"
12
#include "
xAODEgamma/Photon.h
"
13
14
class
IPhotonObservableTool
:
public
virtual
IObservableTool
{
15
ASG_TOOL_INTERFACE
(
IPhotonObservableTool
)
16
17
public
:
18
virtual
~IPhotonObservableTool
() =
default
;
19
20
virtual
double
evaluate
(
const
xAOD::Photon
* photon)
const
= 0;
21
22
double
evaluate
(
const
xAOD::IParticle
* particle)
const
override
final
{
23
if
(
const
auto
* photon =
dynamic_cast<
const
xAOD::Photon
*
>
(particle)) {
24
return
evaluate
(photon);
25
}
else
{
26
throw
std::invalid_argument(
"Wrong particle type, input="
+ std::to_string(particle->type()));
27
}
28
}
29
};
30
31
#endif
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition
AsgToolMacros.h:40
Photon.h
IObservableTool.h
IObservableTool
Interface for tools that want to calculate a quantity from an xAOD::IParticle.
Definition
IObservableTool.h:32
IPhotonObservableTool
Definition
IPhotonObservableTool.h:14
IPhotonObservableTool::evaluate
double evaluate(const xAOD::IParticle *particle) const override final
returns: the value that was calculated from the xAOD::IParticle
Definition
IPhotonObservableTool.h:22
IPhotonObservableTool::~IPhotonObservableTool
virtual ~IPhotonObservableTool()=default
IPhotonObservableTool::evaluate
virtual double evaluate(const xAOD::Photon *photon) const =0
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
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.14.0