ATLAS Offline Software
ExtrapolationEngine.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // ExtrapolationEngine.h, (c) ATLAS Detector software
8 
9 #ifndef TRKEXINTERFACES_EXTRAPOLATIONENGINE_H
10 #define TRKEXINTERFACES_EXTRAPOLATIONENGINE_H
11 
12 // Gaudi
15 #include "GaudiKernel/ToolHandle.h"
16 #include "GaudiKernel/ServiceHandle.h"
17 // Trk
24 // throw GaudiExceptions where necessary
25 #include "GaudiKernel/GaudiException.h"
26 
30 
31 namespace Trk {
32 
33  class IPropagationEngine;
34  class INavigationEngine;
35 
49  class ExtrapolationEngine : public AthCheckedComponent<AthAlgTool>, virtual public IExtrapolationEngine {
50 
51  friend class NavigationInitTest;
52 
53  public:
55  ExtrapolationEngine(const std::string&,const std::string&,const IInterface*);
56 
59 
62 
65 
67 
69  virtual ExtrapolationCode extrapolate(ExCellCharged& ecCharged,
70  const Surface* sf = 0,
71  const BoundaryCheck& bcheck = true) const;
72 
74  virtual ExtrapolationCode extrapolate(ExCellNeutral& ecNeutral,
75  const Surface* sf = 0,
76  const BoundaryCheck& bcheck = true) const;
77 
78 
80  GeometryType geometryType() const;
81 
82  private:
85  const Surface* sf = 0,
87  const BoundaryCheck& bcheck = true) const;
88 
91  const Surface* sf = 0,
93 
94 
96  const TrackingGeometry& trackingGeometry() const;
97 
99  const TrackingGeometry* retrieveTrackingGeometry(const EventContext& ctx) const {
101  if (!handle.isValid()) {
102  EX_MSG_FATAL("", "updateGeo", "", "Could not load TrackingGeometry with name '" << m_trackingGeometryReadKey.key() << "'. Aborting." );
104  }
105  return handle.cptr();
106  }
107 
109  {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."};
110 
112  ToolHandleArray<IExtrapolationEngine> m_extrapolationEngines{ this, "ExtrapolationEngines", {} };
113  ToolHandle<IPropagationEngine> m_propagationEngine{this, "PropagationEngine", "Trk::PropagationEngine/AtlasStaticPropagation"};
114  ToolHandle<INavigationEngine> m_navigationEngine{this, "NavigationEngine", "Trk::StaticNavigationEngine/AtlasStaticNavigation"};
115  std::vector<const IExtrapolationEngine*> m_eeAccessor;
116 
117 
120 
121  };
122 
124  { return Trk::Master; }
125 
126 
128  const Trk::TrackingGeometry *tracking_geometry = retrieveTrackingGeometry(Gaudi::Hive::currentContext());
129  if (!tracking_geometry){
130  EX_MSG_FATAL("", "updateGeo", "", "Did not get valid TrackingGeometry. Aborting." );
131  throw GaudiException("ExtrapolationEngine", "Problem with TrackingGeometry loading.", StatusCode::FAILURE);
132  }
133  return *tracking_geometry;
134  }
135 
136 
137 
138 } // end of namespace
139 
141 #include "ExtrapolationEngine.icc"
142 
143 #endif // TRKEXINTERFACES_IEXTRAPOLATIONENGINE_H
144 
TrackParameters.h
ExtrapolationEngine.icc
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
Trk::ExtrapolationEngine::m_forceSearchInit
bool m_forceSearchInit
Definition: ExtrapolationEngine.h:119
Trk::ExtrapolationEngine::m_trackingGeometryReadKey
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
the tool handle array for static / dense / detached
Definition: ExtrapolationEngine.h:109
Trk::ExtrapolationEngine::retrieveTrackingGeometry
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const
Definition: ExtrapolationEngine.h:99
Trk::ExtrapolationEngine::initialize
StatusCode initialize()
AlgTool initialize method.
Definition: ExtrapolationEngine.cxx:34
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
Trk::ExtrapolationEngine::extrapolate
virtual ExtrapolationCode extrapolate(ExCellCharged &ecCharged, const Surface *sf=0, const BoundaryCheck &bcheck=true) const
charged extrapolation - public interface
Definition: ExtrapolationEngine.cxx:77
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
NeutralParameters.h
Trk::ExtrapolationEngine::m_propagationEngine
ToolHandle< IPropagationEngine > m_propagationEngine
the used propagation engine for navigation initialization
Definition: ExtrapolationEngine.h:113
Trk::ExtrapolationEngine::throwFailedToGetTrackingGeomtry
void throwFailedToGetTrackingGeomtry() const
Definition: ExtrapolationEngine.cxx:89
Trk::ExtrapolationEngine::ExtrapolationEngine
ExtrapolationEngine(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: ExtrapolationEngine.cxx:16
Trk::ExtrapolationEngine::trackingGeometry
const TrackingGeometry & trackingGeometry() const
Definition: ExtrapolationEngine.h:127
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
EX_MSG_FATAL
#define EX_MSG_FATAL(navstep, step, idx, x)
Definition: ExtrapolationMacros.h:16
AthCheckedComponent
Mixin class to perform additional checks on a component.
Definition: AthCheckedComponent.h:25
Trk::ExtrapolationEngine::NavigationInitTest
friend class NavigationInitTest
Definition: ExtrapolationEngine.h:51
Trk::ExtrapolationEngine::m_extrapolationEngines
ToolHandleArray< IExtrapolationEngine > m_extrapolationEngines
Definition: ExtrapolationEngine.h:112
Trk::ExtrapolationEngine::m_eeAccessor
std::vector< const IExtrapolationEngine * > m_eeAccessor
the extrapolation engines for
Definition: ExtrapolationEngine.h:115
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::ExtrapolationEngine::geometryType
GeometryType geometryType() const
define for which GeometrySignature this extrapolator is valid - this is GLOBAL
Definition: ExtrapolationEngine.h:123
Trk::ExtrapolationEngine::m_navigationEngine
ToolHandle< INavigationEngine > m_navigationEngine
access to tracking geometry (unique?)
Definition: ExtrapolationEngine.h:114
AthAlgTool.h
Trk::ExtrapolationCode
Definition: ExtrapolationCell.h:105
Trk::ExtrapolationEngine::extrapolateT
ExtrapolationCode extrapolateT(ExtrapolationCell< T > &eCell, const Surface *sf=0, PropDirection dir=alongMomentum, const BoundaryCheck &bcheck=true) const
main loop extrapolation method
beamspotman.dir
string dir
Definition: beamspotman.py:623
ReadCondHandleKey.h
ExtrapolationMacros.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ExtrapolationEngine::finalize
StatusCode finalize()
AlgTool finalize method.
Definition: ExtrapolationEngine.cxx:69
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
Trk::IExtrapolationEngine::extrapolate
virtual ExtrapolationCode extrapolate(ExCellCharged &ecCharged, const Surface *sf=0, const BoundaryCheck &bcheck=true) const =0
charged extrapolation
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
Trk::IExtrapolationEngine
Definition: IExtrapolationEngine.h:36
AthCheckedComponent.h
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
ITrackingGeometrySvc.h
ExtrapolationCell.h
Trk::GeometryType
GeometryType
Definition: GeometrySignature.h:37
TrackingGeometry.h
Trk::ExtrapolationEngine::initNavigation
ExtrapolationCode initNavigation(ExtrapolationCell< T > &eCell, const Surface *sf=0, PropDirection dir=alongMomentum) const
initialization method
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
checker_macros.h
Define macros for attributes used to control the static checker.
IExtrapolationEngine.h
Trk::ExtrapolationEngine
Definition: ExtrapolationEngine.h:49
Trk::Master
@ Master
Definition: GeometrySignature.h:42
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67
Trk::ExtrapolationEngine::~ExtrapolationEngine
~ExtrapolationEngine()
Destructor.