ATLAS Offline Software
StaticNavigationEngine.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // StaticNavigationEngine.h, (c) ATLAS Detector software
8 
9 #ifndef TRKEXENGINE_STATICNAVIGATIONENGINE_H
10 #define TRKEXENGINE_STATICNAVIGATIONENGINE_H
11 
12 // Gaudi
14 #include "GaudiKernel/ToolHandle.h"
15 // Trk
22 // throw GaudiExceptions where necessary
23 #include "GaudiKernel/GaudiException.h"
24 
27 
29 
30 
31 namespace Trk {
32 
33  class IPropagationEngine;
34  class IMaterialEffectsEngine;
35 
43  class StaticNavigationEngine : public AthAlgTool, virtual public INavigationEngine {
44 
45  public:
47  StaticNavigationEngine(const std::string&,const std::string&,const IInterface*);
48 
51 
54 
57 
61 
64 
67 
69  virtual ExtrapolationCode resolvePosition(Trk::ExCellCharged& eCell, PropDirection dir=alongMomentum, bool noLoop=false) const;
70 
72  virtual ExtrapolationCode resolvePosition(Trk::ExCellNeutral& eCelll, PropDirection dir=alongMomentum, bool noLoop=false) const;
73 
75  virtual const TrackingGeometry& trackingGeometry() const;
76 
77  private:
81 
85  bool noLoop=false) const;
86 
89  const BoundarySurface<TrackingVolume>& bSurfaceTV,
91  bool stepout=false) const;
92 
93 
95  const TrackingGeometry* retrieveTrackingGeometry(const EventContext& ctx) const {
97  if (!handle.isValid()) {
98  EX_MSG_FATAL("", "updateGeo", "", "Could not load TrackingGeometry with name '" << m_trackingGeometryReadKey.key() << "'. Aborting." );
100  }
101  return handle.cptr();
102  }
103 
105  {this, "TrackingGeometryReadKey", "", "Key of the TrackingGeometry conditions data."};
106 
109 
110  ToolHandle<IPropagationEngine> m_propagationEngine{this, "PropagationEngine", "Trk::PropagationEngine/AtlasStaticPropagation"};
111  ToolHandle<IMaterialEffectsEngine> m_materialEffectsEngine{this, "MaterialEffectsEngine", "Trk::MaterialEffectsEngine/AtlasStaticNavigationMaterialEffects"};
112 
114 
115  };
116 
118  const Trk::TrackingGeometry *tracking_geometry = retrieveTrackingGeometry(Gaudi::Hive::currentContext());
119  if (!tracking_geometry){
120  EX_MSG_FATAL("", "updateGeo", "", "Did not get valid TrackingGeometry. Aborting." );
121  throw GaudiException("ExtrapolationEngine", "Problem with TrackingGeometry loading.", StatusCode::FAILURE);
122  }
123  return *tracking_geometry;
124  }
125 
126 } // end of namespace
127 
129 #include "StaticNavigationEngine.icc"
130 
131 #endif // TRKEXENGINE_STATICNAVIGATIONENGINE_H
132 
Trk::StaticNavigationEngine::m_propagationEngine
ToolHandle< IPropagationEngine > m_propagationEngine
the used propagation engine
Definition: StaticNavigationEngine.h:110
Trk::BoundarySurface
Definition: BoundarySurface.h:50
TrackParameters.h
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
INavigationEngine.h
Trk::StaticNavigationEngine
Definition: StaticNavigationEngine.h:43
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
Trk::StaticNavigationEngine::throwFailedToGetTrackingGeomtry
void throwFailedToGetTrackingGeomtry() const
Definition: StaticNavigationEngine.cxx:71
Trk::StaticNavigationEngine::resolveBoundary
virtual ExtrapolationCode resolveBoundary(Trk::ExCellCharged &eCell, PropDirection dir=alongMomentum) const
resolve the boundary situation - for charged particles
Definition: StaticNavigationEngine.cxx:56
Trk::INavigationEngine::resolveBoundary
virtual ExtrapolationCode resolveBoundary(ExCellCharged &ecCell, PropDirection dir=alongMomentum) const =0
resolve the boundary situation - for charged particles
Trk::alongMomentum
@ alongMomentum
Definition: PropDirection.h:20
NeutralParameters.h
Trk::StaticNavigationEngine::retrieveTrackingGeometry
const TrackingGeometry * retrieveTrackingGeometry(const EventContext &ctx) const
Definition: StaticNavigationEngine.h:95
Trk::StaticNavigationEngine::m_trackingGeometryReadKey
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
retrieve TrackingGeometry
Definition: StaticNavigationEngine.h:105
Trk::StaticNavigationEngine::m_trackingGeometryName
std::string m_trackingGeometryName
Name of the TrackingGeometry as given in Detector Store.
Definition: StaticNavigationEngine.h:113
Trk::StaticNavigationEngine::trackingGeometry
virtual const TrackingGeometry & trackingGeometry() const
acces to tracking geometry
Definition: StaticNavigationEngine.h:117
Trk::PropDirection
PropDirection
Definition: PropDirection.h:19
EX_MSG_FATAL
#define EX_MSG_FATAL(navstep, step, idx, x)
Definition: ExtrapolationMacros.h:16
Trk::StaticNavigationEngine::handleBoundaryT
ExtrapolationCode handleBoundaryT(ExtrapolationCell< T > &eCell, const BoundarySurface< TrackingVolume > &bSurfaceTV, PropDirection dir=alongMomentum, bool stepout=false) const
deal with the boundary Surface - called by resolveBoundary
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::StaticNavigationEngine::resolvePosition
virtual ExtrapolationCode resolvePosition(Trk::ExCellCharged &eCell, PropDirection dir=alongMomentum, bool noLoop=false) const
resolve the boundary situation - for charged particles
Definition: StaticNavigationEngine.cxx:64
AthAlgTool.h
Trk::ExtrapolationCode
Definition: ExtrapolationCell.h:105
Trk::INavigationEngine
Definition: INavigationEngine.h:37
Trk::StaticNavigationEngine::m_materialEffectsEngine
ToolHandle< IMaterialEffectsEngine > m_materialEffectsEngine
the material effects updated
Definition: StaticNavigationEngine.h:111
beamspotman.dir
string dir
Definition: beamspotman.py:623
ReadCondHandleKey.h
Trk::StaticNavigationEngine::finalize
StatusCode finalize()
AlgTool finalize method.
Definition: StaticNavigationEngine.cxx:49
ExtrapolationMacros.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::StaticNavigationEngine::resolvePositionT
ExtrapolationCode resolvePositionT(ExtrapolationCell< T > &eCell, PropDirection dir=alongMomentum, bool noLoop=false) const
resolve position
Trk::StaticNavigationEngine::initialize
StatusCode initialize()
AlgTool initialize method.
Definition: StaticNavigationEngine.cxx:29
StaticNavigationEngine.icc
BoundarySurface.h
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
Trk::StaticNavigationEngine::~StaticNavigationEngine
~StaticNavigationEngine()
Destructor.
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
Trk::INavigationEngine::resolvePosition
virtual ExtrapolationCode resolvePosition(ExCellCharged &ecCell, PropDirection dir=alongMomentum, bool noLoop=false) const =0
resolve the position - for charged particles
ExtrapolationCell.h
Trk::StaticNavigationEngine::StaticNavigationEngine
StaticNavigationEngine(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: StaticNavigationEngine.cxx:15
TrackingGeometry.h
AthAlgTool
Definition: AthAlgTool.h:26
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::StaticNavigationEngine::updateTrackingGeometry
StatusCode updateTrackingGeometry() const
Trk::StaticNavigationEngine::resolveBoundaryT
ExtrapolationCode resolveBoundaryT(ExtrapolationCell< T > &eCell, PropDirection dir=alongMomentum) const
resolve the boundary situation
SG::ReadCondHandle::cptr
const_pointer_type cptr()
Definition: ReadCondHandle.h:67