ATLAS Offline Software
Loading...
Searching...
No Matches
TritonTracccTrackMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TritonTracccTrackMaker_H
6#define TritonTracccTrackMaker_H
7
8// System include(s).
9#include <filesystem>
10#include <format>
11#include <fstream>
12#include <memory>
13#include <string>
14
19
20// Athena includes
29#include "Acts/EventData/BoundTrackParameters.hpp"
30
34#include "GaudiKernel/IChronoStatSvc.h"
35#include "GaudiKernel/ServiceHandle.h"
36
49
57
59
60// Tool handles
61#include "ITracccTritonTool.h"
62
73
74public:
75 using AthReentrantAlgorithm::AthReentrantAlgorithm;
76
77 virtual StatusCode initialize() override;
78 virtual StatusCode execute(const EventContext& ctx) const override;
79
80protected:
84
85
86 // Input helpers
88 "ITkPixelRDOs"};
90 "ITkStripRDOs"};
91
92 const PixelID* m_pixelID{nullptr};
93 const SCT_ID* m_stripID{nullptr};
96
97 // Read input data to hits for Traccc use!
98 std::vector<int> map_index(int index,
99 int low_bound,
100 int high_bound,
101 int threshold,
102 int shift) const;
103
104 std::vector<std::pair<int, int>> correct_indices(
105 int phiIndex, int etaIndex, int rows,
106 int columns) const;
107
108 StatusCode read_cells(std::vector<TracccCell>& cells,
109 const EventContext& evtcontext) const;
110
111
112 std::unordered_map<int64_t, int> readAndConvertClusters(
113 const EventContext& eventContext) const;
114
115 StatusCode convertInDetToXaodCluster(
116 const InDet::PixelCluster& indetCluster,
117 const InDetDD::SiDetectorElement& element, xAOD::PixelCluster& xaodCluster) const;
118
119 StatusCode convertInDetToXaodCluster(
120 const InDet::SCT_Cluster& indetCluster,
121 const InDetDD::SiDetectorElement& element, xAOD::StripCluster& xaodCluster) const;
123
127
128 // output container
129 // TODO: this should return type PersistentTrackContainer
130 // The tool ActsTrackToTrackParticleCnvAlgCfg needs to be appropriately updated
132 this, "TracccTracks", "TracccTracks",
133 "Output track collection (ActsTrk variant)"};
134
135 // acts helper for the output
139
140 std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
142
143 const Acts::Surface* actsSurfaceFromAtlasId(const Identifier& atlasID) const;
144
145 Acts::BoundMatrix buildBoundCovariance(
146 const LocalMeasurementInfoInTracks& state) const;
147
148 std::optional<Acts::BoundTrackParameters> convertToActsParameters(
149 const LocalMeasurementInfoInTracks& state) const;
150
151 StatusCode convertTracks(
152 EventContext const& eventContext,
153 std::vector<TracccTrackParameters>& trackParams,
154 std::vector<LocalMeasurementInfoInTracks>& measInfo,
155 const std::unordered_map<int64_t, int>& cluster_map,
156 unsigned& nb_output_tracks) const;
157
159
163
164 ToolHandle<ITracccTritonTool> m_tracccTrackingTool{
165 this, "TracccTritonTool", "TracccTritonTool"};
166
168 this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};
169 // @}
170
173
174 StringProperty m_featureNames{this, "FeatureNames",
175 "geometry_id,measurement_id,channel0,channel1,timestamp,value"};
176 std::vector<std::string> m_featureNamesVec;
177
178
180 Gaudi::Property<bool> m_doTruth{
181 this, "doTruth", true,
182 "Create output containers and link to truth"};
183
186 this, "PixelClustersToTruthParticlesMap",
187 "PixelClustersForTruthSeedingToTruthParticlesMap",
188 "Association map from pixel measurements to generator particles."};
189
192 this, "StripClustersToTruthParticlesMap",
193 "StripClustersForTruthSeedingToTruthParticlesMap",
194 "Association map from strip measurements to generator particles."};
195
198 this, "InputPixelClustersName", "ITkPixelClusters",
199 "name of the input InDet pixel cluster container"};
202 this, "InputStripClustersName", "ITkStripClusters",
203 "name of the input InDet strip cluster container"};
204
207 this, "xAODPixelClusterFromInDetClusterKey",
208 "xAODPixelClustersFromInDetCluster",
209 "InDet cluster->xAOD PixelClusters Container"};
212 this, "xAODStripClusterFromInDetClusterKey",
213 "xAODStripClustersFromInDetCluster",
214 "InDet cluster ->xAOD StripClusters Container"};
217 this, "xAODSpacepointFromInDetClusterKey",
218 "xAODSpacepointFromInDetCluster",
219 "InDet cluster->xAOD Spacepoint Container"};
220
222 m_pixelDetEleCollKey{this, "PixelDetEleCollKey",
223 "ITkPixelDetectorElementCollection",
224 "Key of SiDetectorElementCollection for Pixel"};
226 m_stripDetEleCollKey{this, "StripDetEleCollKey",
227 "ITkStripDetectorElementCollection",
228 "Key of SiDetectorElementCollection for Strip"};
229
230
231}; // TritonTracccTrackMaker
232
233#endif
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Utility class to handle the three contexts neeeded in an ACTS reconstruction job 1) GeometryContext -...
An algorithm that can be simultaneously executed in multiple threads.
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
Class to hold geometrical description of a silicon detector element.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
TritonTracccTrackMaker is an algorithm that uses the Traccc-algorithm to reconstruct tracks from cell...
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_inputStripClusterContainerKey
const Acts::Surface * actsSurfaceFromAtlasId(const Identifier &atlasID) const
Acts::BoundMatrix buildBoundCovariance(const LocalMeasurementInfoInTracks &state) const
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
const InDetDD::PixelDetectorManager * m_pixelManager
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
StatusCode convertInDetToXaodCluster(const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster) const
ActsTrk::MutableTrackContainerHandlesHelper m_tracksBackendHandlesHelper
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
std::unordered_map< int64_t, int > readAndConvertClusters(const EventContext &eventContext) const
StatusCode read_cells(std::vector< TracccCell > &cells, const EventContext &evtcontext) const
StatusCode convertTracks(EventContext const &eventContext, std::vector< TracccTrackParameters > &trackParams, std::vector< LocalMeasurementInfoInTracks > &measInfo, const std::unordered_map< int64_t, int > &cluster_map, unsigned &nb_output_tracks) const
const InDetDD::SCT_DetectorManager * m_stripManager
SG::WriteHandleKey< xAOD::SpacePointContainer > m_xAODSpacepointFromInDetClusterKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
SG::WriteHandleKey< ActsTrk::TrackContainer > m_ActsTracccTrackContainerKey
SG::ReadHandleKey< SCT_RDO_Container > m_stripRDOKey
SG::ReadHandleKey< InDet::PixelClusterContainer > m_inputPixelClusterContainerKey
ActsTrk::ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociation > m_stripClustersToTruth
const ActsTrk::DetectorElementToActsGeometryIdMap * m_detEleToGeoIdMap
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_xAODPixelClusterFromInDetClusterKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
std::optional< Acts::BoundTrackParameters > convertToActsParameters(const LocalMeasurementInfoInTracks &state) const
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
std::vector< int > map_index(int index, int low_bound, int high_bound, int threshold, int shift) const
Gaudi::Property< bool > m_doTruth
Truth association for plotting and debugging.
virtual StatusCode initialize() override
std::vector< std::string > m_featureNamesVec
std::vector< std::pair< int, int > > correct_indices(int phiIndex, int etaIndex, int rows, int columns) const
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociation > m_pixelClustersToTruth
SG::WriteHandleKey< xAOD::StripClusterContainer > m_xAODStripClusterFromInDetClusterKey
ToolHandle< ITracccTritonTool > m_tracccTrackingTool
small converter from the (abs) PDG code to the particle hypothsis used in Tracking
Definition index.py:1
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.