ATLAS Offline Software
ActsToTrkConverterTool.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 ACTSEVENTCNV_ActsToTrkConverterTool_H
6 #define ACTSEVENTCNV_ActsToTrkConverterTool_H
7 
8 #include <tuple>
9 
10 // ATHENA
12 
13 
17 
18 
19 #include "TrkParameters/TrackParameters.h" //typedef, cannot fwd declare
26 
27 // PACKAGE
30 #include "Acts/EventData/TrackParameters.hpp"
32 
33 namespace ActsTrk {
34 class ActsToTrkConverterTool : public extends<AthAlgTool, IActsToTrkConverterTool>
35 {
36 
37 public:
38  virtual StatusCode initialize() override;
39 
40  using base_class::base_class;
41 
42 
43 
47  virtual
48  const Trk::Surface&
49  actsSurfaceToTrkSurface(const Acts::Surface &actsSurface) const override;
50 
54  virtual
55  const Acts::Surface&
56  trkSurfaceToActsSurface(const Trk::Surface &atlasSurface) const override;
57 
60  virtual std::vector<Acts::SourceLink> trkTrackToSourceLinks(const Trk::Track& track) const override;
61 
62  virtual void toSourceLinks(const std::vector<const Trk::MeasurementBase*>& measSet,
63  std::vector<Acts::SourceLink>& links) const override final;
64 
65  virtual void toSourceLinks(const std::vector<const Trk::PrepRawData*>& prdSet,
66  std::vector<Acts::SourceLink>& links) const override final;
67 
68  virtual std::unique_ptr<Trk::Track> convertFitResult(const EventContext& ctx,
70  TrackFitResult_t& fitResult,
71  const Trk::TrackInfo::TrackFitter fitAuthor,
72  const detail::SourceLinkType slType) const override final;
75  virtual
76  const Acts::BoundTrackParameters
77  trkTrackParametersToActsParameters(const Trk::TrackParameters &atlasParameter, const Acts::GeometryContext& gctx, Trk::ParticleHypothesis = Trk::pion) const override;
78 
81  virtual
82  std::unique_ptr<Trk::TrackParameters>
83  actsTrackParametersToTrkParameters(const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext& gctx) const override;
84 
88  virtual
89  void trkTrackCollectionToActsTrackContainer(ActsTrk::MutableTrackContainer &tc, const TrackCollection& trackColl, const Acts::GeometryContext& gctx) const override;
90 
91 
92 private:
94  const Acts::BoundTrackParameters& actsParameter,
95  const Trk::TrackParameters& tsos, const Acts::GeometryContext& gctx) const;
96 
97  PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
98 
100  ToolHandle<Trk::IExtendedTrackSummaryTool> m_trkSummaryTool {this, "SummaryTool", "", "ToolHandle for track summary tool"};
101  ToolHandle<Trk::IBoundaryCheckTool> m_boundaryCheckTool {this, "BoundaryCheckTool", "", "Boundary checking tool for detector sensitivities"};
102  ToolHandle<Trk::IRIO_OnTrackCreator> m_ROTcreator {this, "RotCreatorTool", ""};
103 
104  std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry{};
105  std::unordered_map<Identifier, const Acts::Surface*> m_actsSurfaceMap{};
106 
107  Gaudi::Property<bool> m_visualDebugOutput{
108  this, "VisualDebugOutput", false,
109  "Print additional output for debug plots"};
110 
111 
112  Gaudi::Property<bool> m_extractMuonSurfaces{
113  this, "ExtractMuonSurfaces", false,
114  "If True, use the MuonDetectorManager to extract the Muon surfaces"};
115 
116  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
117 
119  SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_muonMgrKey{this, "MuonManagerKey", "MuonDetectorManager"};
120 
121 };
122 
123 }; // namespace ActsTrk
124 
125 #endif
ActsTrk::ActsToTrkConverterTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: ActsToTrkConverterTool.h:116
ActsTrk::ActsToTrkConverterTool::trkTrackParametersToActsParameters
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.
Definition: ActsToTrkConverterTool.cxx:213
TrackParameters.h
ActsTrk::ActsToTrkConverterTool::m_ROTcreator
ToolHandle< Trk::IRIO_OnTrackCreator > m_ROTcreator
Definition: ActsToTrkConverterTool.h:102
ActsTrk::ActsToTrkConverterTool::m_actsSurfaceMap
std::unordered_map< Identifier, const Acts::Surface * > m_actsSurfaceMap
Definition: ActsToTrkConverterTool.h:105
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
ActsTrk::ActsToTrkConverterTool::m_trackingGeometryTool
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
Definition: ActsToTrkConverterTool.h:97
IRIO_OnTrackCreator.h
ActsTrk::MutableTrackContainer
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
Definition: TrackContainer.h:26
TrackParametersContainer.h
ActsTrk::ActsToTrkConverterTool::actsTrackParameterPositionCheck
bool actsTrackParameterPositionCheck(const Acts::BoundTrackParameters &actsParameter, const Trk::TrackParameters &tsos, const Acts::GeometryContext &gctx) const
Definition: ActsToTrkConverterTool.cxx:549
ActsTrk::ActsToTrkConverterTool
Definition: ActsToTrkConverterTool.h:35
ActsTrk::ActsToTrkConverterTool::toSourceLinks
virtual void toSourceLinks(const std::vector< const Trk::MeasurementBase * > &measSet, std::vector< Acts::SourceLink > &links) const override final
Definition: ActsToTrkConverterTool.cxx:193
ActsTrk::ActsToTrkConverterTool::trkSurfaceToActsSurface
virtual 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...
Definition: ActsToTrkConverterTool.cxx:169
PrepRawData.h
ActsTrk::ActsToTrkConverterTool::m_trackingGeometry
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
Definition: ActsToTrkConverterTool.h:104
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:28
ActsTrk::ActsToTrkConverterTool::m_muonMgrKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muonMgrKey
Detector manager to fetch the legacy Trk surfaces.
Definition: ActsToTrkConverterTool.h:119
TrackStateContainer.h
ActsTrk::ActsToTrkConverterTool::trkTrackToSourceLinks
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...
Definition: ActsToTrkConverterTool.cxx:183
Trk::TrackInfo::TrackFitter
TrackFitter
enums to identify who created this track and what propertis does it have.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/TrackInfo.h:39
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DMTest::links
links
Definition: CLinks_v1.cxx:22
Trk::pion
@ pion
Definition: ParticleHypothesis.h:32
AthAlgTool.h
ActsTrk::ActsToTrkConverterTool::m_visualDebugOutput
Gaudi::Property< bool > m_visualDebugOutput
Definition: ActsToTrkConverterTool.h:107
ActsTrk::detail::SourceLinkType
SourceLinkType
Enumeration to distinguish between the ATLAS EDM -> Acts::SourceLink variants.
Definition: SourceLinkType.h:9
ActsTrk::ActsToTrkConverterTool::actsTrackParametersToTrkParameters
virtual std::unique_ptr< Trk::TrackParameters > actsTrackParametersToTrkParameters(const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext &gctx) const override
Create ATLAS TrackParameter from Acts one.
Definition: ActsToTrkConverterTool.cxx:299
Trk::ParametersBase
Definition: ParametersBase.h:55
ActsTrk::ActsToTrkConverterTool::initialize
virtual StatusCode initialize() override
Definition: ActsToTrkConverterTool.cxx:78
DataVector< Trk::Track >
TrackJacobianContainer.h
ActsTrk::ActsToTrkConverterTool::m_trkSummaryTool
ToolHandle< Trk::IExtendedTrackSummaryTool > m_trkSummaryTool
Tools needed to create Trk::Tracks from the ACts fit result.
Definition: ActsToTrkConverterTool.h:100
MuonDetectorManager.h
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager >
IExtendedTrackSummaryTool.h
IBoundaryCheckTool.h
ITrackingGeometryTool.h
IActsToTrkConverterTool.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MSTrackingVolumeBuilder.cxx:24
ActsTrk::ActsToTrkConverterTool::trkTrackCollectionToActsTrackContainer
virtual void trkTrackCollectionToActsTrackContainer(ActsTrk::MutableTrackContainer &tc, const TrackCollection &trackColl, const Acts::GeometryContext &gctx) const override
Convert TrackCollection to Acts track container.
Definition: ActsToTrkConverterTool.cxx:425
ActsTrk::ActsToTrkConverterTool::m_boundaryCheckTool
ToolHandle< Trk::IBoundaryCheckTool > m_boundaryCheckTool
Definition: ActsToTrkConverterTool.h:101
xAOD::track
@ track
Definition: TrackingPrimitives.h:513
ActsTrk::ActsToTrkConverterTool::convertFitResult
virtual std::unique_ptr< Trk::Track > convertFitResult(const EventContext &ctx, ActsTrk::MutableTrackContainer &tracks, TrackFitResult_t &fitResult, const Trk::TrackInfo::TrackFitter fitAuthor, const detail::SourceLinkType slType) const override final
Definition: ActsToTrkConverterTool.cxx:741
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:79
ActsTrk::ActsToTrkConverterTool::m_extractMuonSurfaces
Gaudi::Property< bool > m_extractMuonSurfaces
Definition: ActsToTrkConverterTool.h:112
IMuonIdHelperSvc.h
TrackMeasurementContainer.h
ActsTrk::ActsToTrkConverterTool::actsSurfaceToTrkSurface
virtual const Trk::Surface & actsSurfaceToTrkSurface(const Acts::Surface &actsSurface) const override
Find the ATLAS surface corresponding to the Acts surface Only work if the Acts surface has an associa...
Definition: ActsToTrkConverterTool.cxx:131
ServiceHandle< Muon::IMuonIdHelperSvc >