ATLAS Offline Software
VertexTimeAlg.h
Go to the documentation of this file.
1 
11 #ifndef HGTD_VERTEXTIMEALG_H
12 #define HGTD_VERTEXTIMEALG_H
13 
14 // Local includes
15 #include "Clustering.h"
16 
17 // Athena includes
25 #include "xAODTracking/Vertex.h"
27 
28 // Gaudi includes
29 #include "Gaudi/Property.h"
30 #include "GaudiKernel/SystemOfUnits.h"
31 
32 // ROOT includes
33 #include "TMVA/Reader.h"
34 
35 // Standard library includes
36 #include <memory>
37 #include <string>
38 #include <utility>
39 #include <vector>
40 
41 namespace HGTD {
42 
44 
45 public:
46  VertexTimeAlg(const std::string& name, ISvcLocator* pSvcLocator);
47 
48  StatusCode initialize() override final;
49  StatusCode execute(const EventContext& ctx) const override final;
50 
51 private:
53  this, "PrimaryVertexContainer", "PrimaryVertices",
54  "Name of the primary vertex container"
55  };
56 
58  this, "TrackParticleContainer", "InDetTrackParticles",
59  "Name of the track container"
60  };
61 
63  this, "VertexHasValidTime", "PrimaryVertices.hasValidTime",
64  "Specifies if the vertex has a valid time"
65  };
66 
68  this, "VertexTime", "PrimaryVertices.time", "Time assigned to vertices"
69  };
70 
72  this, "VertexTimeResolution", "PrimaryVertices.timeResolution",
73  "Time resolution assigned to vertices"
74  };
75 
77  this, "TrackHasValidTime", "InDetTrackParticles.hasValidTime",
78  "Specifies if the track has a valid precision time"
79  };
80 
82  this, "TrackTime", "InDetTrackParticles.time", "Time assigned to tracks"
83  };
84 
86  this, "TrackTimeResolution", "InDetTrackParticles.timeResolution",
87  "Time resolution assigned to tracks"
88  };
89 
90  Gaudi::Property<float> m_default_vxTime {
91  this, "DefaultVertexTime", 0.0 * Gaudi::Units::ns,
92  "The default time assigned to the vertex if no precision time can be calculated"
93  };
94 
95  Gaudi::Property<float> m_default_vxTimeRes {
96  this, "DefaultVertexTimeResolution", 50.0 / std::sqrt(12.0) * Gaudi::Units::ns,
97  "The default time resolution assigned to the vertex if no precision time can be calculated"
98  };
99 
100  Gaudi::Property<float> m_bdt_cutvalue {
101  this, "BDTCutValue", 0.2f ,
102  "The BDT output has to be above this value for the cluster to be accepted as HS"
103  };
104 
105  std::vector<const xAOD::TrackParticle*> vertexAssociatedHGTDTracks(
106  const xAOD::Vertex* vertex, const xAOD::TrackParticleContainer* tracks,
107  double min_trk_pt) const;
108 
111  double min_trk_pt, const double significance_cut = 2.5) const;
112 
113  std::vector<HGTD::Cluster<const xAOD::TrackParticle*>> clusterTracksInTime(
114  const EventContext& ctx,
115  const std::vector<const xAOD::TrackParticle*>& tracks,
116  double cluster_distance) const;
117 
119  const EventContext& ctx,
121  const xAOD::Vertex* vertex) const;
122 
123  float scoreCluster(
124  const EventContext& ctx,
126  const xAOD::Vertex* vertex) const;
127 
128  std::pair<float, float> getZOfCluster(
129  const HGTD::Cluster<const xAOD::TrackParticle*>& cluster) const;
130 
131  std::pair<float, float> getOneOverPOfCluster(
132  const HGTD::Cluster<const xAOD::TrackParticle*>& cluster) const;
133 
134  std::pair<float, float> getDOfCluster(
135  const HGTD::Cluster<const xAOD::TrackParticle*>& cluster) const;
136 
137  float getSumPt2OfCluster(
138  const HGTD::Cluster<const xAOD::TrackParticle*>& cluster) const;
139 
140  struct HSclusterBDT {
141  // Reader
142  std::unique_ptr<TMVA::Reader> reader { };
143 
144  // BDT inputs
145  float delta_z { 0.0f };
146  float z_sigma { 0.0f };
147  float q_over_p { 0.0f };
148  float q_over_p_sigma { 0.0f };
149  float d0 { 0.0f };
150  float d0_sigma { 0.0f };
151  float delta_z_resunits { 0.0f };
152  float cluster_sumpt2 { 0.0f };
153  };
154 
156 
157 };
158 
159 } // namespace HGTD
160 
161 #endif // HGTD_VERTEXTIMEALG_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
HGTD::VertexTimeAlg::HSclusterBDT::cluster_sumpt2
float cluster_sumpt2
Definition: VertexTimeAlg.h:152
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
Clustering.h
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
HGTD::VertexTimeAlg::getZOfCluster
std::pair< float, float > getZOfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
Definition: VertexTimeAlg.cxx:257
HGTD::VertexTimeAlg::m_vxHasTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxHasTime_key
Definition: VertexTimeAlg.h:62
HGTD::VertexTimeAlg::getOneOverPOfCluster
std::pair< float, float > getOneOverPOfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
Definition: VertexTimeAlg.cxx:282
HGTD::VertexTimeAlg::VertexTimeAlg
VertexTimeAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: VertexTimeAlg.cxx:25
HGTD::VertexTimeAlg::m_trackCont_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackCont_key
Definition: VertexTimeAlg.h:57
HGTD::VertexTimeAlg
Definition: VertexTimeAlg.h:43
HGTD::VertexTimeAlg::m_default_vxTime
Gaudi::Property< float > m_default_vxTime
Definition: VertexTimeAlg.h:90
HGTD::VertexTimeAlg::m_vxTime_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxTime_key
Definition: VertexTimeAlg.h:67
HGTD::VertexTimeAlg::HSclusterBDT::q_over_p_sigma
float q_over_p_sigma
Definition: VertexTimeAlg.h:148
HGTD::VertexTimeAlg::m_trackValidTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackValidTime_key
Definition: VertexTimeAlg.h:76
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
HGTD::Cluster
Definition: Clustering.h:30
HGTD::VertexTimeAlg::HSclusterBDT::reader
std::unique_ptr< TMVA::Reader > reader
Definition: VertexTimeAlg.h:142
HGTD::VertexTimeAlg::passTrackVertexAssociation
bool passTrackVertexAssociation(const xAOD::TrackParticle *track, const xAOD::Vertex *vertex, double min_trk_pt, const double significance_cut=2.5) const
Definition: VertexTimeAlg.cxx:144
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
HGTD::VertexTimeAlg::HSclusterBDT::d0_sigma
float d0_sigma
Definition: VertexTimeAlg.h:150
HGTD::VertexTimeAlg::getSumPt2OfCluster
float getSumPt2OfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
Definition: VertexTimeAlg.cxx:332
HGTD::VertexTimeAlg::getDOfCluster
std::pair< float, float > getDOfCluster(const HGTD::Cluster< const xAOD::TrackParticle * > &cluster) const
Definition: VertexTimeAlg.cxx:307
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
HGTD
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
Definition: Clustering.h:28
HGTD::VertexTimeAlg::scoreCluster
float scoreCluster(const EventContext &ctx, const HGTD::Cluster< const xAOD::TrackParticle * > &cluster, const xAOD::Vertex *vertex) const
Definition: VertexTimeAlg.cxx:232
HGTD::VertexTimeAlg::HSclusterBDT::delta_z_resunits
float delta_z_resunits
Definition: VertexTimeAlg.h:151
HGTD::VertexTimeAlg::HSclusterBDT::q_over_p
float q_over_p
Definition: VertexTimeAlg.h:147
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HGTD::VertexTimeAlg::m_trackTime_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackTime_key
Definition: VertexTimeAlg.h:81
HGTD::VertexTimeAlg::getHScluster
HGTD::Cluster< const xAOD::TrackParticle * > getHScluster(const EventContext &ctx, const std::vector< HGTD::Cluster< const xAOD::TrackParticle * >> &clusters, const xAOD::Vertex *vertex) const
Definition: VertexTimeAlg.cxx:203
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
Vertex.h
HGTD::VertexTimeAlg::ATLAS_THREAD_SAFE
SG::SlotSpecificObj< HSclusterBDT > m_BDT ATLAS_THREAD_SAFE
Definition: VertexTimeAlg.h:155
HGTD::VertexTimeAlg::execute
StatusCode execute(const EventContext &ctx) const override final
Definition: VertexTimeAlg.cxx:64
AthReentrantAlgorithm.h
HGTD::VertexTimeAlg::HSclusterBDT::d0
float d0
Definition: VertexTimeAlg.h:149
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
HGTD::VertexTimeAlg::m_vxTimeRes_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vxTimeRes_key
Definition: VertexTimeAlg.h:71
HGTD::VertexTimeAlg::m_primVxCont_key
SG::ReadHandleKey< xAOD::VertexContainer > m_primVxCont_key
Definition: VertexTimeAlg.h:52
TrackParticle.h
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
VertexContainer.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
HGTD::VertexTimeAlg::m_bdt_cutvalue
Gaudi::Property< float > m_bdt_cutvalue
Definition: VertexTimeAlg.h:100
HGTD::VertexTimeAlg::vertexAssociatedHGTDTracks
std::vector< const xAOD::TrackParticle * > vertexAssociatedHGTDTracks(const xAOD::Vertex *vertex, const xAOD::TrackParticleContainer *tracks, double min_trk_pt) const
Definition: VertexTimeAlg.cxx:122
HGTD::VertexTimeAlg::HSclusterBDT::delta_z
float delta_z
Definition: VertexTimeAlg.h:145
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
HGTD::VertexTimeAlg::HSclusterBDT::z_sigma
float z_sigma
Definition: VertexTimeAlg.h:146
HGTD::VertexTimeAlg::m_default_vxTimeRes
Gaudi::Property< float > m_default_vxTimeRes
Definition: VertexTimeAlg.h:95
HGTD::VertexTimeAlg::HSclusterBDT
Definition: VertexTimeAlg.h:140
SlotSpecificObj.h
Maintain a set of objects, one per slot.
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
HGTD::VertexTimeAlg::initialize
StatusCode initialize() override final
Definition: VertexTimeAlg.cxx:28
TrackParticleContainer.h
HGTD::VertexTimeAlg::m_trackTimeRes_key
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_trackTimeRes_key
Definition: VertexTimeAlg.h:85
HGTD::VertexTimeAlg::clusterTracksInTime
std::vector< HGTD::Cluster< const xAOD::TrackParticle * > > clusterTracksInTime(const EventContext &ctx, const std::vector< const xAOD::TrackParticle * > &tracks, double cluster_distance) const
Definition: VertexTimeAlg.cxx:167