ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
HighGranularityTimingDetector
HGTD_Analysis
src
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
5
#include "
HGTD_Analysis/HGTD_TrackDecaySelectionTool.h
"
6
7
#include "
xAODTruth/TruthParticle.h
"
8
#include "
xAODTruth/TruthVertex.h
"
9
#include "
xAODTruth/xAODTruthHelpers.h
"
10
11
HGTD_TrackDecaySelectionTool::HGTD_TrackDecaySelectionTool
(
const
std::string& t,
12
const
std::string& n,
13
const
IInterface* p)
14
: base_class(t, n, p) {}
15
16
StatusCode
HGTD_TrackDecaySelectionTool::initialize
() {
17
return
StatusCode::SUCCESS;
18
}
19
24
bool
HGTD_TrackDecaySelectionTool::trackPassesSelection
(
25
const
xAOD::TrackParticle
* track_particle)
const
{
26
27
const
xAOD::TruthParticle
* truth_particle =
28
xAOD::TruthHelpers::getTruthParticle
(*track_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
}
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
TruthParticle.h
HGTD_TrackDecaySelectionTool.h
TruthVertex.h
HGTD_TrackDecaySelectionTool::initialize
virtual StatusCode initialize() override final
Definition
HGTD_TrackDecaySelectionTool.cxx:16
HGTD_TrackDecaySelectionTool::m_min_radius_prod
Gaudi::Property< float > m_min_radius_prod
Definition
HGTD_TrackDecaySelectionTool.h:32
HGTD_TrackDecaySelectionTool::m_max_z_prod
Gaudi::Property< float > m_max_z_prod
Definition
HGTD_TrackDecaySelectionTool.h:41
HGTD_TrackDecaySelectionTool::m_max_z_dec
Gaudi::Property< float > m_max_z_dec
Definition
HGTD_TrackDecaySelectionTool.h:53
HGTD_TrackDecaySelectionTool::m_min_z_dec
Gaudi::Property< float > m_min_z_dec
Definition
HGTD_TrackDecaySelectionTool.h:50
HGTD_TrackDecaySelectionTool::m_min_radius_dec
Gaudi::Property< float > m_min_radius_dec
Definition
HGTD_TrackDecaySelectionTool.h:45
HGTD_TrackDecaySelectionTool::m_min_z_prod
Gaudi::Property< float > m_min_z_prod
Definition
HGTD_TrackDecaySelectionTool.h:38
HGTD_TrackDecaySelectionTool::m_max_radius_prod
Gaudi::Property< float > m_max_radius_prod
Definition
HGTD_TrackDecaySelectionTool.h:35
HGTD_TrackDecaySelectionTool::trackPassesSelection
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...
Definition
HGTD_TrackDecaySelectionTool.cxx:24
HGTD_TrackDecaySelectionTool::m_max_radius_dec
Gaudi::Property< float > m_max_radius_dec
Definition
HGTD_TrackDecaySelectionTool.h:47
HGTD_TrackDecaySelectionTool::HGTD_TrackDecaySelectionTool
HGTD_TrackDecaySelectionTool(const std::string &, const std::string &, const IInterface *)
Definition
HGTD_TrackDecaySelectionTool.cxx:11
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition
TruthParticle_v1.cxx:69
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition
TruthParticle_v1.cxx:75
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
xAOD::TruthVertex_v1::y
float y() const
Vertex y displacement.
xAOD::TruthVertex_v1::x
float x() const
Vertex x displacement.
xAOD::TruthHelpers::getTruthParticle
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any).
Definition
xAODTruthHelpers.cxx:25
xAOD::TruthVertex
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition
TruthVertex.h:15
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
xAODTruthHelpers.h
Generated on
for ATLAS Offline Software by
1.17.0