Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Trigger
TrigAnalysis
TriggerMatchingTool
Root
EgammaDRScoringTool.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TriggerMatchingTool/EgammaDRScoringTool.h
"
6
#include "
FourMomUtils/xAODP4Helpers.h
"
7
#include "
xAODBase/ObjectType.h
"
8
#include "
xAODCaloEvent/CaloCluster.h
"
9
#include "
xAODEgamma/Egamma.h
"
10
#include "
AthContainers/ConstAccessor.h
"
11
#include <sstream>
12
13
// Anonymous namespace for helper functions
14
namespace
{
15
float
dr
(
const
xAOD::CaloCluster
&lhs,
const
xAOD::CaloCluster
&rhs)
16
{
17
return
xAOD::P4Helpers::deltaR
(lhs.
etaBE
(2), lhs.
phiBE
(2), rhs.
etaBE
(2), rhs.
phiBE
(2));
18
}
19
float
dr
(
const
xAOD::IParticle
&
online
,
const
xAOD::CaloCluster
&
offline
,
bool
useDecor =
true
)
20
{
21
static
const
SG::ConstAccessor<float>
cl_eta2Acc (
"cl_eta2"
);
22
static
const
SG::ConstAccessor<float>
cl_phi2Acc (
"cl_phi2"
);
23
double
lhs_eta = useDecor ? cl_eta2Acc(
online
) :
online
.
eta
();
24
double
lhs_phi = useDecor ? cl_phi2Acc(
online
) :
online
.
phi
();
25
double
rhs_eta =
offline
.etaBE(2);
26
double
rhs_phi =
offline
.phiBE(2);
27
28
return
xAOD::P4Helpers::deltaR
(lhs_eta, lhs_phi, rhs_eta, rhs_phi);
29
}
30
}
31
32
namespace
Trig
{
33
EgammaDRScoringTool::EgammaDRScoringTool
(
const
std::string &
name
) :
34
asg
::AsgTool(
name
)
35
{
36
declareProperty
(
"UseClusterDecorator"
,
m_useClusterDecorator
=
true
,
37
"Use the decorated cluster values instead of the link to the cluster."
);
38
}
39
40
StatusCode
EgammaDRScoringTool::initialize
()
41
{
42
return
StatusCode::SUCCESS;
43
}
44
45
float
EgammaDRScoringTool::score
(
46
const
xAOD::IParticle
&
online
,
47
const
xAOD::IParticle
&
offline
)
const
48
{
49
switch
(
online
.type())
50
{
51
case
xAOD::Type::CaloCluster
:
52
return
dr
(
53
dynamic_cast<
const
xAOD::CaloCluster
&
>
(
online
),
54
dynamic_cast<
const
xAOD::CaloCluster
&
>
(
offline
));
55
case
xAOD::Type::Electron
:
56
if
(
m_useClusterDecorator
)
57
{
58
return
dr
(
online
,
59
*
dynamic_cast<
const
xAOD::Egamma
&
>
(
offline
).caloCluster(),
true
);
60
}
else
{
61
return
dr
(
62
*
dynamic_cast<
const
xAOD::Egamma
&
>
(
online
).caloCluster(),
63
*
dynamic_cast<
const
xAOD::Egamma
&
>
(
offline
).caloCluster());
64
}
65
case
xAOD::Type::Photon
:
66
return
dr
(
67
*
dynamic_cast<
const
xAOD::Egamma
&
>
(
online
).caloCluster(),
68
*
dynamic_cast<
const
xAOD::Egamma
&
>
(
offline
).caloCluster());
69
default
:
70
{
71
std::ostringstream oss;
72
oss <<
"Not an egamma type: "
<<
online
.type();
73
throw
std::runtime_error(oss.str());
74
}
75
}
76
return
-1;
77
}
78
}
//> end namespace Trig
xAOD::Electron
Electron_v1 Electron
Definition of the current "egamma version".
Definition:
Event/xAOD/xAODEgamma/xAODEgamma/Electron.h:17
Trig::EgammaDRScoringTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition:
EgammaDRScoringTool.cxx:40
phi
Scalar phi() const
phi method
Definition:
AmgMatrixBasePlugin.h:67
EgammaDRScoringTool.h
Trig::EgammaDRScoringTool::EgammaDRScoringTool
EgammaDRScoringTool(const std::string &name)
Definition:
EgammaDRScoringTool.cxx:33
Trig
The common trigger namespace for trigger analysis tools.
Definition:
LArCellMonAlg.h:33
eta
Scalar eta() const
pseudorapidity method
Definition:
AmgMatrixBasePlugin.h:83
xAODP4Helpers.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition:
AthCommonDataStore.h:145
asg
Definition:
DataHandleTestTool.h:28
offline
xAOD::CaloCluster_v1::phiBE
float phiBE(const unsigned layer) const
Get the phi in one layer of the EM Calo.
Definition:
CaloCluster_v1.cxx:680
xAOD::Egamma_v1
Definition:
Egamma_v1.h:56
SG::ConstAccessor< float >
python.TurnDataReader.dr
dr
Definition:
TurnDataReader.py:112
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition:
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition:
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::CaloCluster_v1::etaBE
float etaBE(const unsigned layer) const
Get the eta in one layer of the EM Calo.
Definition:
CaloCluster_v1.cxx:644
Egamma.h
TileSynchronizeBch.online
online
Definition:
TileSynchronizeBch.py:88
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition:
CaloCluster_v1.h:59
ObjectType.h
CaloCluster.h
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition:
xAODP4Helpers.h:150
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:228
xAOD::Photon
Photon_v1 Photon
Definition of the current "egamma version".
Definition:
Event/xAOD/xAODEgamma/xAODEgamma/Photon.h:17
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
Trig::EgammaDRScoringTool::score
virtual float score(const xAOD::IParticle &online, const xAOD::IParticle &offline) const override
Calculate the matching score for a pair of particles.
Definition:
EgammaDRScoringTool.cxx:45
Trig::EgammaDRScoringTool::m_useClusterDecorator
bool m_useClusterDecorator
Use decorated cluster information.
Definition:
EgammaDRScoringTool.h:28
Generated on Fri Mar 21 2025 21:09:59 for ATLAS Offline Software by
1.8.18