ATLAS Offline Software
Loading...
Searching...
No Matches
ActsToTrkConverterTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSEVENTCNV_ActsToTrkConverterTool_H
6#define ACTSEVENTCNV_ActsToTrkConverterTool_H
7
8#include <tuple>
9
10// ATHENA
12
13
16
17#include "TrkParameters/TrackParameters.h" //typedef, cannot fwd declare
22
24
25
26// PACKAGE
29
34
35#include "Acts/EventData/BoundTrackParameters.hpp"
36
37
42
43namespace ActsTrk {
44class ActsToTrkConverterTool : public extends<AthAlgTool, IActsToTrkConverterTool>
45{
46
47public:
48 virtual StatusCode initialize() override;
49
50 using base_class::base_class;
51
52
53
57 virtual SurfacePtr_t actsSurfaceToTrkSurface(const EventContext& ctx,
58 const Acts::Surface &actsSurface) const override;
59
63 virtual std::shared_ptr<const Acts::Surface> trkSurfaceToActsSurface(const Trk::Surface &atlasSurface) const override;
64
67 virtual std::vector<Acts::SourceLink> trkTrackToSourceLinks(const Trk::Track& track) const override;
68
69 virtual void toSourceLinks(const std::vector<const Trk::MeasurementBase*>& measSet,
70 std::vector<Acts::SourceLink>& links) const override final;
71
72 virtual void toSourceLinks(const std::vector<const Trk::PrepRawData*>& prdSet,
73 std::vector<Acts::SourceLink>& links) const override final;
74
75 virtual std::unique_ptr<Trk::Track> convertFitResult(const EventContext& ctx,
76 TrackFitResult_t& fitResult,
77 const Trk::TrackInfo::TrackFitter fitAuthor,
78 const detail::SourceLinkType slType) const override final;
81 virtual
82 const Acts::BoundTrackParameters
83 trkTrackParametersToActsParameters(const Trk::TrackParameters &atlasParameter, const Acts::GeometryContext& gctx, Trk::ParticleHypothesis = Trk::pion) const override;
84
87 virtual
88 std::unique_ptr<Trk::TrackParameters>
89 actsTrackParametersToTrkParameters(const EventContext& ctx, const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext& gctx) const override;
90
94 virtual
95 void trkTrackCollectionToActsTrackContainer(ActsTrk::MutableTrackContainer &tc, const TrackCollection& trackColl, const Acts::GeometryContext& gctx) const override;
96
97 virtual std::unique_ptr<TrackCollection>
98 convertActsToTrkContainer(const EventContext& ctx,
99 const ActsTrk::TrackContainer& trackCont) const override final;
100private:
107 template <typename Proxy_t>
108 std::unique_ptr<Trk::Track> convertActsTrack(const EventContext& ctx,
109 const Proxy_t& track,
110 const Trk::TrackInfo::TrackFitter fitAuthor,
111 const detail::SourceLinkType slType) const;
112
113 /*** @brief Translate the Acts surface bounds to its equivalent in the Trk realm.
114 * @note Not all bounds are implemented
115 * @param bounds: Refrence to the bounds to be translated */
116 std::shared_ptr<Trk::SurfaceBounds> translateBounds(const Acts::SurfaceBounds& bounds) const;
120 SurfacePtr_t translateFreeSurface(const Acts::Surface& surface) const;
121
123 using TrkTSOSMask = std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes>;
134 void appendMeasTSOS(const EventContext& ctx,
136 const TrkTSOSMask typePattern,
137 Trk::FitQualityOnSurface&& quality,
138 std::unique_ptr<Trk::TrackParameters> trkPars,
139 Trk::TrackStates& states) const;
146 template <typename PrdType_t>
147 const Trk::PrepRawData* fetchPrd(const EventContext& ctx,
149 const Identifier& prdId,
150 const IdentifierHash& hash) const;
151
152
154 const Acts::BoundTrackParameters& actsParameter,
155 const Trk::TrackParameters& tsos, const Acts::GeometryContext& gctx) const;
156
157 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
158
160 ToolHandle<Trk::IExtendedTrackSummaryTool> m_trkSummaryTool {this, "SummaryTool", "", "ToolHandle for track summary tool"};
161 ToolHandle<Trk::IRIO_OnTrackCreator> m_ROTcreator {this, "RotCreatorTool", ""};
162
163 std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry{};
164 std::unordered_map<Identifier, std::shared_ptr<const Acts::Surface>> m_actsSurfaceMap{};
165
166 Gaudi::Property<bool> m_visualDebugOutput{
167 this, "VisualDebugOutput", false,
168 "Print additional output for debug plots"};
169
170
171 Gaudi::Property<bool> m_extractMuonSurfaces{this, "ExtractMuonSurfaces", false,
172 "If True, use the MuonDetectorManager to extract the Muon surfaces"};
173
175 Gaudi::Property<int> m_sourceLinkType{this, "SourceLinkType",
176 Acts::toUnderlying(detail::SourceLinkType::nTypes) };
177
178 Gaudi::Property<bool> m_convertHoles{this, "convertHoles", true };
180 Gaudi::Property<bool> m_convertOutliers{this, "convertOutliers", true};
182 Gaudi::Property<bool> m_convertMaterial{this, "convertMaterial", false};
183
184 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
185
186 SG::ReadHandleKey<Muon::MdtPrepDataContainer> m_keyMdt{this, "MdtKey", "MDT_DriftCircles"};
187 SG::ReadHandleKey<Muon::RpcPrepDataContainer> m_keyRpc{this, "RpcKey", "RPC_Measurements"};
188 SG::ReadHandleKey<Muon::TgcPrepDataContainer> m_keyTgc{this, "TgcKey", "TGC_MeasurementsAllBCs"};
189 SG::ReadHandleKey<Muon::MMPrepDataContainer> m_keyMm{this, "MmKey", "MM_Measurements"};
190 SG::ReadHandleKey<Muon::sTgcPrepDataContainer> m_keyStgc{this, "sTgcKey", "STGC_Measurements"};
191
192
193 ToolHandle<Muon::IMuonCompetingClustersOnTrackCreator> m_compRotCreator{this, "CompetingRotCreator", ""}; //<! competing clusters rio ontrack creator
194
196 SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muonMgrKey{this, "MuonManagerKey", "MuonDetectorManager"};
197
199
202
204
205};
206
207}; // namespace ActsTrk
208
209#endif
static Double_t tc
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
std::bitset< Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes > TrkTSOSMask
Abrivate the state mask for the TSOS.
virtual void toSourceLinks(const std::vector< const Trk::MeasurementBase * > &measSet, std::vector< Acts::SourceLink > &links) const override final
virtual std::unique_ptr< Trk::Track > convertFitResult(const EventContext &ctx, TrackFitResult_t &fitResult, const Trk::TrackInfo::TrackFitter fitAuthor, const detail::SourceLinkType slType) const override final
virtual SurfacePtr_t actsSurfaceToTrkSurface(const EventContext &ctx, const Acts::Surface &actsSurface) const override
Find the ATLAS surface corresponding to the Acts surface Only work if the Acts surface has an associa...
bool actsTrackParameterPositionCheck(const Acts::BoundTrackParameters &actsParameter, const Trk::TrackParameters &tsos, const Acts::GeometryContext &gctx) const
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Tools needed to create Trk::Tracks from the ACts fit result.
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muonMgrKey
Detector manager to fetch the legacy Trk surfaces.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Gaudi::Property< bool > m_convertOutliers
Flag to convert the outlier states.
SG::ReadHandleKey< Muon::RpcPrepDataContainer > m_keyRpc
virtual StatusCode initialize() override
std::shared_ptr< Trk::SurfaceBounds > translateBounds(const Acts::SurfaceBounds &bounds) const
std::unique_ptr< Trk::Track > convertActsTrack(const EventContext &ctx, const Proxy_t &track, const Trk::TrackInfo::TrackFitter fitAuthor, const detail::SourceLinkType slType) const
Helper function to convert a Acts TrackPoxy (which may be const or not) into a Trk::Track.
ToolHandle< Muon::IMuonCompetingClustersOnTrackCreator > m_compRotCreator
Gaudi::Property< bool > m_visualDebugOutput
detail::TrkPrepRawDataCalibrator m_prdCalib
virtual const Acts::BoundTrackParameters trkTrackParametersToActsParameters(const Trk::TrackParameters &atlasParameter, const Acts::GeometryContext &gctx, Trk::ParticleHypothesis=Trk::pion) const override
Create Acts TrackParameter from ATLAS one.
SurfacePtr_t translateFreeSurface(const Acts::Surface &surface) const
Translate a surface that is not associated with any detector element.
virtual std::unique_ptr< TrackCollection > convertActsToTrkContainer(const EventContext &ctx, const ActsTrk::TrackContainer &trackCont) const override final
Gaudi::Property< bool > m_convertHoles
Flag to convert the hole states.
ToolHandle< Trk::IRIO_OnTrackCreator > m_ROTcreator
Gaudi::Property< bool > m_extractMuonSurfaces
virtual std::unique_ptr< Trk::TrackParameters > actsTrackParametersToTrkParameters(const EventContext &ctx, const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext &gctx) const override
Create ATLAS TrackParameter from Acts one.
SG::ReadHandleKey< Muon::MMPrepDataContainer > m_keyMm
SG::ReadHandleKey< Muon::MdtPrepDataContainer > m_keyMdt
SG::ReadHandleKey< Muon::TgcPrepDataContainer > m_keyTgc
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
detail::TrkMeasurementCalibrator m_measCalib
virtual void trkTrackCollectionToActsTrackContainer(ActsTrk::MutableTrackContainer &tc, const TrackCollection &trackColl, const Acts::GeometryContext &gctx) const override
Convert TrackCollection to Acts track container.
std::unordered_map< Identifier, std::shared_ptr< const Acts::Surface > > m_actsSurfaceMap
const Trk::PrepRawData * fetchPrd(const EventContext &ctx, const SG::ReadHandleKey< PrdType_t > &key, const Identifier &prdId, const IdentifierHash &hash) const
Searches a Prd object from a collection according to the measurement's Identifier and the container's...
Gaudi::Property< int > m_sourceLinkType
Source link sepcification used when the ActTrk container -> Trk container conversion is called.
void appendMeasTSOS(const EventContext &ctx, const xAOD::UncalibratedMeasurement *meas, const TrkTSOSMask typePattern, Trk::FitQualityOnSurface &&quality, std::unique_ptr< Trk::TrackParameters > trkPars, Trk::TrackStates &states) const
Append the translated TSOS at the beginning of the states container corresponding to the parsed measu...
Trk::TrackInfo::TrackFitter m_fitAuthor
SG::ReadHandleKey< Muon::sTgcPrepDataContainer > m_keyStgc
virtual std::vector< Acts::SourceLink > trkTrackToSourceLinks(const Trk::Track &track) const override
Transform an ATLAS track into a vector of SourceLink to be use in the avts tracking Transform both me...
virtual std::shared_ptr< const Acts::Surface > trkSurfaceToActsSurface(const Trk::Surface &atlasSurface) const override
Find the Acts surface corresponding to the ATLAS surface Use a map associating ATLAS ID to Acts surfa...
Gaudi::Property< bool > m_convertMaterial
Flag to convert the material states (non sensitive) Acts -> Trk conversion.
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Calibrator class that links the legacy Trk::MeasurementBase objects with the Acts MultiTrajectory tra...
Class to calibrate the Acts track states with uncalibrated Trk::PrepRaw data objects.
This is a "hash" representation of an Identifier.
Property holding a SG store/key/clid from which a ReadHandle is made.
Abstract Base Class for tracking surfaces.
Definition Surface.h:79
TrackFitter
enums to identify who created this track and what propertis does it have.
@ GlobalChi2Fitter
Track's from Thijs' global chi^2 fitter.
SourceLinkType
Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.
@ nTypes
Uncalbirated xAOD::UnCalibratedMeasurement objects.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
ActsToTrkConverterTool::SurfacePtr_t SurfacePtr_t
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
DataVector< const Trk::TrackStateOnSurface > TrackStates
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
ParametersBase< TrackParametersDim, Charged > TrackParameters
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.