ATLAS Offline Software
ActsToTrkConverterTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 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 #include "GaudiKernel/IInterface.h"
13 #include "GaudiKernel/ServiceHandle.h"
14 #include "Gaudi/Property.h"
15 #include "GaudiKernel/EventContext.h"
16 #include "TrkParameters/TrackParameters.h" //typedef, cannot fwd declare
23 
24 // PACKAGE
27 #include "Acts/EventData/TrackParameters.hpp"
28 
29 namespace ActsTrk {
30 class ActsToTrkConverterTool : public extends<AthAlgTool, IActsToTrkConverterTool>
31 {
32 
33 public:
34  virtual StatusCode initialize() override;
35 
36  ActsToTrkConverterTool(const std::string& type, const std::string& name,
37  const IInterface* parent);
38 
39 
43  virtual
44  const Trk::Surface&
45  actsSurfaceToTrkSurface(const Acts::Surface &actsSurface) const override;
46 
50  virtual
51  const Acts::Surface&
52  trkSurfaceToActsSurface(const Trk::Surface &atlasSurface) const override;
53 
57  virtual
58  Acts::SourceLink
59  trkMeasurementToSourceLink(const Acts::GeometryContext& gctx, const Trk::MeasurementBase &measurement) const override;
60 
63  virtual std::vector<Acts::SourceLink> trkTrackToSourceLinks(
64  const Acts::GeometryContext& gctx, const Trk::Track& track) const override;
65 
68  virtual
69  const Acts::BoundTrackParameters
70  trkTrackParametersToActsParameters(const Trk::TrackParameters &atlasParameter, const Acts::GeometryContext& gctx, Trk::ParticleHypothesis = Trk::pion) const override;
71 
74  virtual
75  std::unique_ptr<Trk::TrackParameters>
76  actsTrackParametersToTrkParameters(const Acts::BoundTrackParameters &actsParameter, const Acts::GeometryContext& gctx) const override;
77 
81  virtual
82  void trkTrackCollectionToActsTrackContainer(ActsTrk::MutableTrackContainer &tc, const TrackCollection& trackColl, const Acts::GeometryContext& gctx) const override;
83 
84  virtual
86  trackingGeometryTool() const override
87  {
88  return m_trackingGeometryTool.get();
89  };
90 
91 private:
93  const Acts::BoundTrackParameters& actsParameter,
94  const Trk::TrackParameters& tsos, const Acts::GeometryContext& gctx) const;
95 
96  ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{
97  this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};
98  std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry;
99  std::map<Identifier, const Acts::Surface*> m_actsSurfaceMap;
100 
101  Gaudi::Property<bool> m_visualDebugOutput{
102  this, "VisualDebugOutput", false,
103  "Print additional output for debug plots"};
104 
106 
107  Gaudi::Property<bool> m_extractMuonSurfaces{
108  this, "ExtractMuonSurfaces", false,
109  "If True, use the MuonDetectorManager to extract the Muon surfaces"};
110  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
111 
112 };
113 
114 }; // namespace ActsTrk
115 
116 #endif
ActsTrk::ActsToTrkConverterTool::trackingGeometryTool
virtual const IActsTrackingGeometryTool * trackingGeometryTool() const override
Definition: ActsToTrkConverterTool.h:86
ActsTrk::ActsToTrkConverterTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: ActsToTrkConverterTool.h:110
ActsTrk::ActsToTrkConverterTool::trkTrackToSourceLinks
virtual std::vector< Acts::SourceLink > trkTrackToSourceLinks(const Acts::GeometryContext &gctx, 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:156
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:175
TrackParameters.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
ActsTrk::ActsToTrkConverterTool::trkMeasurementToSourceLink
virtual Acts::SourceLink trkMeasurementToSourceLink(const Acts::GeometryContext &gctx, const Trk::MeasurementBase &measurement) const override
Create an SourceLink from an ATLAS measurment Works for 1 and 2D measurmenent.
Definition: ActsToTrkConverterTool.cxx:147
ActsTrk::ActsToTrkConverterTool::m_pdgToParticleHypothesis
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
Definition: ActsToTrkConverterTool.h:105
ActsTrk::ActsToTrkConverterTool::actsTrackParameterPositionCheck
bool actsTrackParameterPositionCheck(const Acts::BoundTrackParameters &actsParameter, const Trk::TrackParameters &tsos, const Acts::GeometryContext &gctx) const
Definition: ActsToTrkConverterTool.cxx:567
ActsTrk::ActsToTrkConverterTool::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: ActsToTrkConverterTool.h:96
ActsTrk::ActsToTrkConverterTool
Definition: ActsToTrkConverterTool.h:31
TrackParametersContainer.h
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:134
PdgToParticleHypothesis.h
ActsTrk::ActsToTrkConverterTool::m_trackingGeometry
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
Definition: ActsToTrkConverterTool.h:98
IActsTrackingGeometryTool
Definition: IActsTrackingGeometryTool.h:18
Trk::ParticleHypothesis
ParticleHypothesis
Definition: ParticleHypothesis.h:25
TrackStateContainer.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::pion
@ pion
Definition: ParticleHypothesis.h:29
AthAlgTool.h
ActsTrk::ActsToTrkConverterTool::m_visualDebugOutput
Gaudi::Property< bool > m_visualDebugOutput
Definition: ActsToTrkConverterTool.h:101
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ActsTrk::ActsToTrkConverterTool::m_actsSurfaceMap
std::map< Identifier, const Acts::Surface * > m_actsSurfaceMap
Definition: ActsToTrkConverterTool.h:99
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:270
Trk::ParametersBase
Definition: ParametersBase.h:55
ActsTrk::ActsToTrkConverterTool::ActsToTrkConverterTool
ActsToTrkConverterTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ActsToTrkConverterTool.cxx:68
ActsTrk::ActsToTrkConverterTool::initialize
virtual StatusCode initialize() override
Definition: ActsToTrkConverterTool.cxx:72
DataVector< Trk::Track >
TrackJacobianContainer.h
Trk::MeasurementBase
Definition: MeasurementBase.h:58
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
Trk::PdgToParticleHypothesis
Definition: PdgToParticleHypothesis.h:29
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IActsToTrkConverterTool.h
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
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:433
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
ActsTrk::ActsToTrkConverterTool::m_extractMuonSurfaces
Gaudi::Property< bool > m_extractMuonSurfaces
Definition: ActsToTrkConverterTool.h:107
ActsTrk::MutableTrackContainer
Definition: TrackContainer.h:122
IActsTrackingGeometryTool.h
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:123
ServiceHandle< Muon::IMuonIdHelperSvc >