ATLAS Offline Software
TauVertexedClusterDecorator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9 
12  declareProperty("SeedJet", m_seedJet = "");
13 }
14 
15 
16 
18 
19  if (std::string(m_seedJet).find("LC") != std::string::npos) {
20  ATH_MSG_INFO("Set the cluster state to CALIBRATED");
21  m_clusterState = xAOD::CaloCluster::State::CALIBRATED;
22  }
23  else if (std::string(m_seedJet).find("EM") != std::string::npos) {
24  ATH_MSG_INFO("Set the cluster state to UNCALIBRATED");
25  m_clusterState = xAOD::CaloCluster::State::UNCALIBRATED;
26  }
27  else if (! inTrigger()) {
28  ATH_MSG_ERROR("Seed jet " << m_seedJet << " not supported !");
29  return StatusCode::FAILURE;
30  }
31 
32  return StatusCode::SUCCESS;
33 }
34 
35 
36 
38 
39  // Obtain the vertex to correct the cluster
40  const xAOD::Vertex* vertex = tau.vertex();
41 
42  std::vector<const xAOD::IParticle*> particleList = tau.clusters();
43 
44  std::vector<xAOD::CaloVertexedTopoCluster> vertexedClusterList;
45  for (const xAOD::IParticle* particle : particleList) {
46  const xAOD::CaloCluster* cluster = static_cast<const xAOD::CaloCluster*>(particle);
47 
48  if (inTrigger()) { // In trigger, we use the default calibration state
49  if (vertex) {
50  vertexedClusterList.emplace_back(*cluster, vertex->position());
51  }
52  else {
53  vertexedClusterList.emplace_back(*cluster);
54  }
55  }
56  else { // In offline reconstruction, the calibration state is based on the name of seed jet
57  if (vertex) {
58  vertexedClusterList.emplace_back(*cluster, m_clusterState, vertex->position());
59  }
60  else {
61  vertexedClusterList.emplace_back(*cluster, m_clusterState);
62  }
63  }
64  }
65 
66  static const SG::AuxElement::Accessor<std::vector<xAOD::CaloVertexedTopoCluster>> vertexedClustersAcc("VertexedClusters");
67  vertexedClustersAcc(tau) = vertexedClusterList;
68 
69  return StatusCode::SUCCESS;
70 }
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:66
TauVertexedClusterDecorator::m_seedJet
std::string m_seedJet
Name of the seed jet.
Definition: TauVertexedClusterDecorator.h:35
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TauVertexedClusterDecorator::execute
virtual StatusCode execute(xAOD::TauJet &tau) const override
Execute - called for each tau candidate.
Definition: TauVertexedClusterDecorator.cxx:37
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
TauRecToolBase::inTrigger
bool inTrigger() const
Definition: TauRecToolBase.h:87
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:40
xAOD::TauJet_v3::clusters
std::vector< const IParticle * > clusters() const
Definition: TauJet_v3.cxx:585
TauVertexedClusterDecorator::m_clusterState
xAOD::CaloCluster::State m_clusterState
Calibration state of cluster.
Definition: TauVertexedClusterDecorator.h:38
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
TauVertexedClusterDecorator::TauVertexedClusterDecorator
TauVertexedClusterDecorator(const std::string &name)
Definition: TauVertexedClusterDecorator.cxx:10
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
CaloVertexedTopoCluster.h
Evaluate cluster kinematics with a different vertex / signal state.
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::TauJet_v3::vertex
const Vertex * vertex() const
HelperFunctions.h
TauVertexedClusterDecorator.h
TauVertexedClusterDecorator::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition: TauVertexedClusterDecorator.cxx:17