ATLAS Offline Software
Loading...
Searching...
No Matches
ExpertTrackTimeFromClustersTool.h
Go to the documentation of this file.
1
23
24#ifndef HGTD_EXPERTTRACKTIMEFROMCLUSTERSTOOL_H
25#define HGTD_EXPERTTRACKTIMEFROMCLUSTERSTOOL_H
26
29
31
32#include <memory>
33#include <string>
34#include <vector>
35
36#include "TVector3.h"
37
38namespace HGTD {
39
41 : public extends<AthAlgTool, IHGTD_ExpertTrackTimeAccessor> {
42
43 struct Hit {
44 float time;
46 bool isprime;
47 TVector3 position;
48 };
49
50 using HitVec_t = std::vector<Hit>;
51 using FloatVec_t = std::vector<float>;
52
53public:
54 ExpertTrackTimeFromClustersTool(const std::string&, const std::string&,
55 const IInterface*);
56
58
60 // for AthAlgTool interface
61 virtual StatusCode initialize() override final;
62
63 // for IHGTD_ExpertTrackTimeAccessor interface
64
65 virtual bool
66 expertHasTime(const xAOD::TrackParticle& track_particle) const override final;
67
68 virtual float
69 expertTime(const xAOD::TrackParticle& track_particle) const override final;
70
71 virtual float
72 expertTimeRes(const xAOD::TrackParticle& track_particle) const override final;
73
74 virtual float
75 fracPrimaryHits(const xAOD::TrackParticle& track_particle) const override final;
76
78 const xAOD::TrackParticle& track_particle) const override final;
79
81
89 int nHits(const xAOD::TrackParticle& track_particle) const;
90
95 int nPrimaryHits(const xAOD::TrackParticle& track_particle) const;
96
101 HitVec_t getValidHits(const xAOD::TrackParticle& track_particle) const;
102
107 HitVec_t getTimeCompatibleHits(const xAOD::TrackParticle& track_particle) const;
108
114 TVector3 getLastMeasurement(const xAOD::TrackParticle& track) const;
115
121 bool lastHitIsOnLastSurface(const xAOD::TrackParticle& track) const;
122
126 float calculateMean(const HitVec_t& hits) const;
127
132 bool passesDeltaT(const HitVec_t& hits) const;
133
134 float calculateChi2(const HitVec_t& vals) const;
135
137
139
140 Gaudi::Property<bool> m_do_last_hit{this, "UseLastHitCut", true,
141 "Default value"};
142 Gaudi::Property<bool> m_do_time_cons{this, "UseTimeConsistency", true,
143 "Default value"};
144 Gaudi::Property<float> m_deltat_cut{this, "DeltaTCut", 2.0, "Default value"};
145 Gaudi::Property<float> m_chi2_threshold{this, "TimeChi2Cut", 1.5,
146 "Default value"};
147 Gaudi::Property<bool> m_do_min_nhits{this, "UseMinNHits", true,
148 "Default value"};
149 Gaudi::Property<float> m_min_eta{this, "MinEta", 3.5, "Default value"};
150 Gaudi::Property<float> m_max_eta{this, "MaxEta", 3.9, "Default value"};
151 Gaudi::Property<bool> m_do_smearing{this, "DoSmearing", false,
152 "Default value"};
153
158 std::string m_dec_prefix;
159
160 std::unique_ptr<SG::AuxElement::Decorator<bool>> m_dec_isset;
161 std::unique_ptr<SG::AuxElement::Decorator<bool>> m_dec_hastime;
162 std::unique_ptr<SG::AuxElement::Decorator<float>> m_dec_time;
163 std::unique_ptr<SG::AuxElement::Decorator<int>> m_dec_nhits;
164 std::unique_ptr<SG::AuxElement::Decorator<int>> m_dec_nprimehits;
165 std::unique_ptr<SG::AuxElement::Decorator<float>> m_dec_resolution;
166
167 std::unique_ptr<SG::ConstAccessor<bool>> m_acc_isset;
168 std::unique_ptr<SG::ConstAccessor<bool>> m_acc_hastime;
169 std::unique_ptr<SG::ConstAccessor<float>> m_acc_time;
170 std::unique_ptr<SG::ConstAccessor<int>> m_acc_nhits;
171 std::unique_ptr<SG::ConstAccessor<int>> m_acc_nprimehits;
172 std::unique_ptr<SG::ConstAccessor<float>> m_acc_resolution;
173
184};
185
186} // namespace HGTD
187
188#endif // HGTD_EXPERTTRACKTIMEFROMCLUSTERSTOOL_H
Helper class to provide constant type-safe access to aux data.
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration.
std::unique_ptr< SG::AuxElement::Decorator< int > > m_dec_nhits
ExpertTrackTimeFromClustersTool(const std::string &, const std::string &, const IInterface *)
std::unique_ptr< SG::ConstAccessor< float > > m_acc_time
std::unique_ptr< SG::ConstAccessor< bool > > m_acc_isset
std::unique_ptr< SG::ConstAccessor< int > > m_acc_nhits
std::unique_ptr< SG::AuxElement::Decorator< float > > m_dec_resolution
int nPrimaryHits(const xAOD::TrackParticle &track_particle) const
Number of hits used for the track time that were left by a primary particle.
std::unique_ptr< SG::AuxElement::Decorator< float > > m_dec_time
virtual float fracPrimaryHits(const xAOD::TrackParticle &track_particle) const override final
float calculateMean(const HitVec_t &hits) const
Returns the arithmetic average mean of the hit times.
std::unique_ptr< SG::ConstAccessor< float > > m_acc_resolution
std::string m_dec_prefix
Prefix of the decorations this tool writes.
HitVec_t getTimeCompatibleHits(const xAOD::TrackParticle &track_particle) const
Retrieve the hit information from the decorators and build a vector of hits for those hits that survi...
SG::ConstAccessor< std::vector< float > > m_acc_perLayer_clusterTime
HitVec_t getValidHits(const xAOD::TrackParticle &track_particle) const
Retrieve the hit information from the decorators and build a vector of hits.
virtual int numberPotentialPrimaryHits(const xAOD::TrackParticle &track_particle) const override final
bool lastHitIsOnLastSurface(const xAOD::TrackParticle &track) const
Check wheather the last hit on track is on a surface close to HGTD.
virtual bool expertHasTime(const xAOD::TrackParticle &track_particle) const override final
SG::ConstAccessor< std::vector< int > > m_acc_perLayer_clusterTruthClass
virtual ~ExpertTrackTimeFromClustersTool()=default
std::unique_ptr< SG::ConstAccessor< bool > > m_acc_hastime
std::unique_ptr< SG::AuxElement::Decorator< bool > > m_dec_isset
TVector3 getLastMeasurement(const xAOD::TrackParticle &track) const
In the samples used for HGTD studies the last hit on track in ITk is written to file and can be used ...
SG::ConstAccessor< std::vector< bool > > m_acc_perLayer_expectCluster
std::unique_ptr< SG::AuxElement::Decorator< int > > m_dec_nprimehits
int nHits(const xAOD::TrackParticle &track_particle) const
Number of hits that were used to build the track time.
bool passesDeltaT(const HitVec_t &hits) const
Tests if a given set of exactly 2 Hit objects passes the set time difference cut, which is defined in...
virtual float expertTime(const xAOD::TrackParticle &track_particle) const override final
float calculateTrackResolution(const HitVec_t &vals) const
SG::ConstAccessor< std::vector< bool > > m_acc_perLayer_hasCluster
Input decorations produced by the HGTD track extension, read with fixed names.
virtual float expertTimeRes(const xAOD::TrackParticle &track_particle) const override final
std::unique_ptr< SG::ConstAccessor< int > > m_acc_nprimehits
std::unique_ptr< SG::AuxElement::Decorator< bool > > m_dec_hastime
Support class for PropertyMgr.
Definition Property.h:23
Helper class to provide constant type-safe access to aux data.
=============================================================================
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
#define private
Definition testRead.cxx:27