ATLAS Offline Software
Loading...
Searching...
No Matches
HGTDTrackExtensionAlg.h
Go to the documentation of this file.
1
12
13#ifndef HGTDTRACKEXTENSIONALG_H
14#define HGTDTRACKEXTENSIONALG_H
15
16// Base Class
17#include "TrackFindingBaseAlg.h"
18
19// Gaudi
20#include "GaudiKernel/ToolHandle.h"
21#include "GaudiKernel/EventContext.h"
22
23// Athena
34
35// STL
36#include <memory>
37#include <string>
38
39// Handle Keys
49
50// Acts
51#include "Acts/TrackFinding/TrackStateCreator.hpp"
52#include "Acts/EventData/TrackContainer.hpp"
55
56// Tools
59#include "Acts/Surfaces/PerigeeSurface.hpp"
60
61
62namespace ActsTrk {
63
65using DefaultTrackStateCreator = Acts::TrackStateCreator<ActsTrk::detail::UncalibSourceLinkAccessor::Iterator,detail::RecoTrackContainer>;
66
68
69public:
71 virtual ~HGTDTrackExtensionAlg() = default;
72 virtual StatusCode initialize() override;
73 virtual StatusCode execute(const EventContext &ctx) const override;
74
75 using ExpectedLayerPattern = std::array<unsigned int, 4>;
76
77private:
78 // Properties
79 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackParticleContainerName{this, "TrackParticleContainerName", "InDetTrackParticles", "Name of the TrackParticle container"};
80 SG::ReadHandleKey<xAOD::HGTDClusterContainer> m_HGTDClusterContainerName{this, "HGTDClusterContainerName", "HGTD_Clusters", "Name of the HGTD_Cluster container"};
81
82 // Measurement collections
83 SG::ReadHandleKeyArray<xAOD::UncalibratedMeasurementContainer> m_uncalibratedMeasurementContainerKeys{this, "UncalibratedMeasurementContainerKeys", {}, "input cluster collections"};
84
86
87 // Configuration
88 Gaudi::Property<float> m_minEtaAcceptance {this, "MinEtaAcceptance", 2.38, "Minimum eta to consider a track for extension"};
89 Gaudi::Property<float> m_maxEtaAcceptance {this, "MaxEtaAcceptance", 4.00, "Maximum eta to consider a track for extension"};
90
91 // Tool Handles
93
94
95 // WriteDecorHandleKeys for decorating tracks
96 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_numHGTDHitsKey{this, "numHGTDHits", m_trackParticleContainerName, "numHGTDHits", "Number of HGTD hits on the track extension"};
97 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerHasExtensionKey { this, "HGTD_has_extension", m_trackParticleContainerName, "HGTD_has_extension", "Decoration for layer extension" };
98 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerExtensionChi2Key { this, "HGTD_extension_chi2", m_trackParticleContainerName, "HGTD_extension_chi2", "Decoration for chi2 of extension" };
99 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerClusterRawTimeKey { this, "HGTD_cluster_raw_time", m_trackParticleContainerName, "HGTD_cluster_raw_time", "Decoration for raw time of cluster" };
100 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_layerClusterTimeKey { this, "HGTD_cluster_time", m_trackParticleContainerName, "HGTD_cluster_time", "Decoration for cluster time" };
101 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_extrapXKey { this, "HGTD_extrap_x", m_trackParticleContainerName, "HGTD_extrap_x", "Decoration for extrapolated X coordinate" };
102 SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> m_extrapYKey { this, "HGTD_extrap_y", m_trackParticleContainerName, "HGTD_extrap_y", "Decoration for extrapolated Y coordinate" };
104
105
109 std::vector<char> hasClusterVec = {false, false, false, false};
110 std::vector<float> chi2Vec = {0.0, 0.0, 0.0, 0.0};
111 std::vector<float> rawTimeVec = {0.0, 0.0, 0.0, 0.0};
112 std::vector<float> timeVec = {0.0, 0.0, 0.0, 0.0};
113 float extrapX = 0.0;
114 float extrapY = 0.0;
115 float extrapZ = 0.0;
116 int numHGTDHits = 0;
117 };
118
120
121 Gaudi::Property< float > m_memorySafetyMargin {this, "MemorySafetyMargin", 1.2};
122 mutable std::atomic<std::size_t> m_nTrackReserve ATLAS_THREAD_SAFE {0ul};
123 mutable std::atomic<std::size_t> m_nTrackStateReserve ATLAS_THREAD_SAFE {0ul};
124
142 bool findExtension(
143 const EventContext &ctx,
144 const DetectorContextHolder& detContext,
145 const detail::TrackFindingMeasurements &measurements,
146 const detail::MeasurementIndex& measurementIndex,
147 const Acts::BoundTrackParameters lastMeasurementStateParameters,
148 detail::RecoTrackContainer &tracksContainerTemp,
149 detail::RecoTrackContainer &actsTracksContainer,
150 EventStats& event_stat,
151 const Acts::Surface& refSurface,
152 int& extension_index) const;
153
167 bool addTrack(
168 const DetectorContextHolder& detContext,
170 const Acts::Surface& refSurface,
171 const Acts::TrackExtrapolationStrategy& extrapolationStrategy,
172 detail::RecoTrackContainer &actsTracksContainer,
173 const detail::MeasurementIndex& measurementIndex,
174 const detail::RecoTrackContainer& tracksContainerTemp) const;
175
188 Acts::Result<void> extrapolateTrackToReferenceSurface(
189 const DetectorContextHolder& detContext,
191 const Acts::Surface &referenceSurface,
192 const detail::Extrapolator &propagator,
193 Acts::TrackExtrapolationStrategy strategy,
194 ExpectedLayerPattern& expectedLayerPattern) const;
195
204 const EventContext& context,
205 detail::TrackFindingMeasurements& measurements) const;
206
207
220 const EventContext& ctx,
221 const xAOD::TrackParticle* trackParticle,
222 const detail::RecoTrackContainer::TrackProxy& trackProxy,
223 const xAOD::HGTDClusterContainer* hgtdClusters) const;
224
237 std::pair<float, float> correctTOF(
238 const xAOD::TrackParticle* trackParticle,
239 const xAOD::HGTDCluster* cluster,
240 float measuredTime,
241 float measuredTimeErr,
242 const Acts::TrackingGeometry* trackingGeometry,
243 const Acts::GeometryContext& geoContext) const;
244
245
254 const EventContext& ctx,
256 const xAOD::HGTDClusterContainer* hgtdClusters) const;
257
266 std::size_t getHGTDLayerIndex(
267 const Acts::GeometryIdentifier& geoID) const;
268
269};
270} // namespace ActsTrk
271
272
273#endif // HGTDTRACKEXTENSIONALG_H
274
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleContainerName
StatusCode collectMeasurements(const EventContext &context, detail::TrackFindingMeasurements &measurements) const
Create and fills the TrackExtensionData with HGTD hits at the extension.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterRawTimeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_numHGTDHitsKey
virtual StatusCode execute(const EventContext &ctx) const override
std::atomic< std::size_t > m_nTrackReserve ATLAS_THREAD_SAFE
const xAOD::HGTDCluster * getHGTDClusterFromState(const EventContext &ctx, const ActsTrk::detail::RecoConstTrackStateContainerProxy &state, const xAOD::HGTDClusterContainer *hgtdClusters) const
Get xAOD::HGTDCluster from track state, so it is possible to retrieve its raw time and position for e...
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerExtensionChi2Key
Gaudi::Property< float > m_minEtaAcceptance
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerHasExtensionKey
bool addTrack(const DetectorContextHolder &detContext, detail::RecoTrackContainerProxy &track, const Acts::Surface &refSurface, const Acts::TrackExtrapolationStrategy &extrapolationStrategy, detail::RecoTrackContainer &actsTracksContainer, const detail::MeasurementIndex &measurementIndex, const detail::RecoTrackContainer &tracksContainerTemp) const
add extension to track container if it passes the track selector criteria
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_extrapYKey
std::pair< float, float > correctTOF(const xAOD::TrackParticle *trackParticle, const xAOD::HGTDCluster *cluster, float measuredTime, float measuredTimeErr, const Acts::TrackingGeometry *trackingGeometry, const Acts::GeometryContext &geoContext) const
subtracts the time of flight (TOF) from a measured hit time.
std::size_t getHGTDLayerIndex(const Acts::GeometryIdentifier &geoID) const
returns the index of HGTD layer where surfaces lies.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_actsTrackLinkKey
virtual ~HGTDTrackExtensionAlg()=default
virtual StatusCode initialize() override
Gaudi::Property< float > m_maxEtaAcceptance
TrackFindingBaseAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_uncalibratedMeasurementContainerKeys
bool findExtension(const EventContext &ctx, const DetectorContextHolder &detContext, const detail::TrackFindingMeasurements &measurements, const detail::MeasurementIndex &measurementIndex, const Acts::BoundTrackParameters lastMeasurementStateParameters, detail::RecoTrackContainer &tracksContainerTemp, detail::RecoTrackContainer &actsTracksContainer, EventStats &event_stat, const Acts::Surface &refSurface, int &extension_index) const
invoke track finding procedure to extend ITk tracks to HGTD layers using CKF.
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_layerClusterTimeKey
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_extrapXKey
Acts::Result< void > extrapolateTrackToReferenceSurface(const DetectorContextHolder &detContext, detail::RecoTrackContainerProxy &track, const Acts::Surface &referenceSurface, const detail::Extrapolator &propagator, Acts::TrackExtrapolationStrategy strategy, ExpectedLayerPattern &expectedLayerPattern) const
it can happen that the last hit of an extension doesn't have a surface associated with it,...
ActsTrk::detail::xAODUncalibMeasSurfAcc m_surfAcc
SG::ReadHandleKey< xAOD::HGTDClusterContainer > m_HGTDClusterContainerName
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_hgtdTrackLinkKey
Gaudi::Property< float > m_memorySafetyMargin
std::array< unsigned int, 4 > ExpectedLayerPattern
TrackExtensionData processTrackExtension(const EventContext &ctx, const xAOD::TrackParticle *trackParticle, const detail::RecoTrackContainer::TrackProxy &trackProxy, const xAOD::HGTDClusterContainer *hgtdClusters) const
Create and fills the TrackExtensionData with HGTD hits at the extension.
TrackFindingBaseAlg(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::array< unsigned int, kNStat > > EventStats
Helper class to access the Acts::surface associated with an Uncalibrated xAOD measurement.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
GenUncalibSourceLinkAccessor< MeasurementRangeList > UncalibSourceLinkAccessor
Acts::TrackContainer< Acts::VectorTrackContainer, Acts::VectorMultiTrajectory > RecoTrackContainer
RecoTrackStateContainer::ConstTrackStateProxy RecoConstTrackStateContainerProxy
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
detail::UncalibSourceLinkAccessor AtlUncalibSourceLinkAccessor
Acts::TrackStateCreator< ActsTrk::detail::UncalibSourceLinkAccessor::Iterator, detail::RecoTrackContainer > DefaultTrackStateCreator
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
HGTDClusterContainer_v1 HGTDClusterContainer
Define the version of the HGTD cluster container.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
HGTDCluster_v1 HGTDCluster
Define the version of the pixel cluster class.
Definition HGTDCluster.h:13
Data structure to hold HGTD track extension results Contains information about hits,...
std::vector< float > chi2Vec
Chi2 contribution per HGTD layer.
std::vector< float > timeVec
TOF-corrected time per HGTD layer.
std::vector< float > rawTimeVec
Raw measured time per HGTD layer.
int numHGTDHits
Total number of HGTD hits on extended track.
std::vector< char > hasClusterVec
Whether extension has cluster in each HGTD layer.