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-2026 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
StatusCode
TauVertexedClusterDecorator::initialize
() {
15
16
if
(std::string(
m_seedJet
).
find
(
"LC"
) != std::string::npos ||
17
std::string(
m_seedJet
).
find
(
"MLTopo"
) != std::string::npos) {
18
ATH_MSG_INFO
(
"Set the cluster state to CALIBRATED"
);
19
m_clusterState
=
xAOD::CaloCluster::State::CALIBRATED
;
20
}
21
else
if
(std::string(
m_seedJet
).
find
(
"EM"
) != std::string::npos) {
22
ATH_MSG_INFO
(
"Set the cluster state to UNCALIBRATED"
);
23
m_clusterState
=
xAOD::CaloCluster::State::UNCALIBRATED
;
24
}
25
else
if
(!
inTrigger
()) {
26
ATH_MSG_ERROR
(
"Seed jet "
<<
m_seedJet
<<
" not supported !"
);
27
return
StatusCode::FAILURE;
28
}
29
30
return
StatusCode::SUCCESS;
31
}
32
33
34
StatusCode
TauVertexedClusterDecorator::executeTool
(
xAOD::TauJet
& tau,
35
const
EventContext&
/*ctx*/
)
const
{
36
37
// Obtain the vertex to correct the cluster
38
const
xAOD::Vertex
* vertex = tau.vertex();
39
40
std::vector<const xAOD::IParticle*> particleList = tau.clusters();
41
42
std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList;
43
for
(
const
xAOD::IParticle
* particle : particleList) {
44
const
xAOD::CaloCluster
* cluster =
static_cast<
const
xAOD::CaloCluster
*
>
(particle);
45
46
if
(
inTrigger
()) {
// In trigger, we use the default calibration state
47
if
(vertex) {
48
vertexedClusterList.emplace_back(*cluster, vertex->position());
49
}
50
else
{
51
vertexedClusterList.emplace_back(*cluster);
52
}
53
}
54
else
{
// In offline reconstruction, the calibration state is based on the name of seed jet
55
if
(vertex) {
56
vertexedClusterList.emplace_back(*cluster,
m_clusterState
, vertex->position());
57
}
58
else
{
59
vertexedClusterList.emplace_back(*cluster,
m_clusterState
);
60
}
61
}
62
}
63
64
static
const
SG::Accessor<std::vector<xAOD::CaloVertexedTopoCluster>
> vertexedClustersAcc(
"VertexedClusters"
);
65
vertexedClustersAcc(tau) = std::move(vertexedClusterList);
66
67
return
StatusCode::SUCCESS;
68
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
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:28
TauRecToolBase::inTrigger
bool inTrigger() const
Definition
TauRecToolBase.h:115
TauVertexedClusterDecorator::m_clusterState
xAOD::CaloCluster::State m_clusterState
Calibration state of cluster.
Definition
TauVertexedClusterDecorator.h:40
TauVertexedClusterDecorator::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition
TauVertexedClusterDecorator.cxx:14
TauVertexedClusterDecorator::TauVertexedClusterDecorator
TauVertexedClusterDecorator(const std::string &name)
Definition
TauVertexedClusterDecorator.cxx:9
TauVertexedClusterDecorator::executeTool
virtual StatusCode executeTool(xAOD::TauJet &tau, const EventContext &ctx) const override
Execute - called for each tau candidate.
Definition
TauVertexedClusterDecorator.cxx:34
TauVertexedClusterDecorator::m_seedJet
Gaudi::Property< std::string > m_seedJet
Definition
TauVertexedClusterDecorator.h:37
xAOD::CaloCluster_v1::UNCALIBRATED
@ UNCALIBRATED
Definition
CaloCluster_v1.h:313
xAOD::CaloCluster_v1::CALIBRATED
@ CALIBRATED
Definition
CaloCluster_v1.h:314
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
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