ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
tauRecTools
Root
TauVertexedClusterDecorator.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
tauRecTools/TauVertexedClusterDecorator.h
"
6
7
#include "
xAODCaloEvent/CaloVertexedTopoCluster.h
"
8
9
TauVertexedClusterDecorator::TauVertexedClusterDecorator
(
const
std::string& name):
10
TauRecToolBase
(name) {
11
}
12
13
14
15
StatusCode
TauVertexedClusterDecorator::initialize
() {
16
17
if
(std::string(
m_seedJet
).
find
(
"LC"
) != std::string::npos ||
18
std::string(
m_seedJet
).
find
(
"MLTopo"
) != std::string::npos) {
19
ATH_MSG_INFO
(
"Set the cluster state to CALIBRATED"
);
20
m_clusterState
=
xAOD::CaloCluster::State::CALIBRATED
;
21
}
22
else
if
(std::string(
m_seedJet
).
find
(
"EM"
) != std::string::npos) {
23
ATH_MSG_INFO
(
"Set the cluster state to UNCALIBRATED"
);
24
m_clusterState
=
xAOD::CaloCluster::State::UNCALIBRATED
;
25
}
26
else
if
(!
inTrigger
()) {
27
ATH_MSG_ERROR
(
"Seed jet "
<<
m_seedJet
<<
" not supported !"
);
28
return
StatusCode::FAILURE;
29
}
30
31
return
StatusCode::SUCCESS;
32
}
33
34
35
36
StatusCode
TauVertexedClusterDecorator::execute
(
xAOD::TauJet
& tau)
const
{
37
38
// Obtain the vertex to correct the cluster
39
const
xAOD::Vertex
* vertex = tau.
vertex
();
40
41
std::vector<const xAOD::IParticle*> particleList = tau.
clusters
();
42
43
std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList;
44
for
(
const
xAOD::IParticle
* particle : particleList) {
45
const
xAOD::CaloCluster
* cluster =
static_cast<
const
xAOD::CaloCluster
*
>
(particle);
46
47
if
(
inTrigger
()) {
// In trigger, we use the default calibration state
48
if
(vertex) {
49
vertexedClusterList.emplace_back(*cluster, vertex->position());
50
}
51
else
{
52
vertexedClusterList.emplace_back(*cluster);
53
}
54
}
55
else
{
// In offline reconstruction, the calibration state is based on the name of seed jet
56
if
(vertex) {
57
vertexedClusterList.emplace_back(*cluster,
m_clusterState
, vertex->position());
58
}
59
else
{
60
vertexedClusterList.emplace_back(*cluster,
m_clusterState
);
61
}
62
}
63
}
64
65
static
const
SG::Accessor<std::vector<xAOD::CaloVertexedTopoCluster>
> vertexedClustersAcc(
"VertexedClusters"
);
66
vertexedClustersAcc(tau) = vertexedClusterList;
67
68
return
StatusCode::SUCCESS;
69
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
CaloVertexedTopoCluster.h
Evaluate cluster kinematics with a different vertex / signal state.
TauVertexedClusterDecorator.h
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
TauRecToolBase::TauRecToolBase
TauRecToolBase(const std::string &name)
Definition
TauRecToolBase.cxx:125
TauRecToolBase::inTrigger
bool inTrigger() const
Definition
TauRecToolBase.h:87
TauVertexedClusterDecorator::m_clusterState
xAOD::CaloCluster::State m_clusterState
Calibration state of cluster.
Definition
TauVertexedClusterDecorator.h:38
TauVertexedClusterDecorator::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition
TauVertexedClusterDecorator.cxx:15
TauVertexedClusterDecorator::TauVertexedClusterDecorator
TauVertexedClusterDecorator(const std::string &name)
Definition
TauVertexedClusterDecorator.cxx:9
TauVertexedClusterDecorator::m_seedJet
Gaudi::Property< std::string > m_seedJet
Definition
TauVertexedClusterDecorator.h:35
TauVertexedClusterDecorator::execute
virtual StatusCode execute(xAOD::TauJet &tau) const override
Execute - called for each tau candidate.
Definition
TauVertexedClusterDecorator.cxx:36
xAOD::CaloCluster_v1::UNCALIBRATED
@ UNCALIBRATED
Definition
CaloCluster_v1.h:309
xAOD::CaloCluster_v1::CALIBRATED
@ CALIBRATED
Definition
CaloCluster_v1.h:310
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
xAOD::TauJet_v3::vertex
const Vertex * vertex() const
xAOD::TauJet_v3::clusters
std::vector< const IParticle * > clusters() const
Definition
TauJet_v3.cxx:545
find
std::string find(const std::string &s)
return a remapped string
Definition
hcg.cxx:140
xAOD::CaloCluster
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
Definition
Event/xAOD/xAODCaloEvent/xAODCaloEvent/CaloCluster.h:19
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
xAOD::TauJet
TauJet_v3 TauJet
Definition of the current "tau version".
Definition
TauJet.h:17
Generated on
for ATLAS Offline Software by
1.17.0