ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_TrackDecaySelectionTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
3*/
4
6
10
12 const std::string& n,
13 const IInterface* p)
14 : base_class(t, n, p) {}
15
17 return StatusCode::SUCCESS;
18}
19
25 const xAOD::TrackParticle* track_particle) const {
26
27 const xAOD::TruthParticle* truth_particle =
29
30 if (truth_particle and truth_particle->hasProdVtx()) {
31
32 const xAOD::TruthVertex* truth_vertex_prod = truth_particle->prodVtx();
33
34 float prodVTX_r_abs = std::hypot(std::abs(truth_vertex_prod->x()),
35 std::abs(truth_vertex_prod->y()));
36 float prodVTX_z_abs = std::abs(truth_vertex_prod->z());
37
38 if (prodVTX_r_abs < m_min_radius_prod or
39 prodVTX_r_abs > m_max_radius_prod or prodVTX_z_abs < m_min_z_prod or
40 prodVTX_z_abs > m_max_z_prod) {
41 return false;
42 }
43
44 const xAOD::TruthVertex* truth_vertex_decay = truth_particle->decayVtx();
45 if (not truth_vertex_decay) {
46 return true;
47 }
48
49 float decayVTX_r_abs = std::hypot(std::abs(truth_vertex_decay->x()),
50 std::abs(truth_vertex_decay->y()));
51 float decayVTX_z_abs = std::abs(truth_vertex_decay->z());
52
53 ATH_MSG_DEBUG("Track has a decay vertex at z = "
54 << decayVTX_z_abs << " and r = " << decayVTX_r_abs);
55
56 return decayVTX_r_abs > m_min_radius_dec and
57 decayVTX_r_abs < m_max_radius_dec and
58 decayVTX_z_abs > m_min_z_dec and decayVTX_z_abs < m_max_z_dec;
59 }
60
61 return false;
62}
#define ATH_MSG_DEBUG(x,...)
virtual StatusCode initialize() override final
virtual bool trackPassesSelection(const xAOD::TrackParticle *track_particle) const override final
Selects tracks that have a valid link to a truth particle and for which the decay vertex is inside of...
HGTD_TrackDecaySelectionTool(const std::string &, const std::string &, const IInterface *)
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
float z() const
Vertex longitudinal distance along the beam line form the origin.
float y() const
Vertex y displacement.
float x() const
Vertex x displacement.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any).
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition TruthVertex.h:15
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.