ATLAS Offline Software
Loading...
Searching...
No Matches
ExtrapolationEngine.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// ExtrapolationEngine.cxx, (c) ATLAS Detector software
8
9// STL
10#include <sstream>
11// Trk include
14
15// constructor
16Trk::ExtrapolationEngine::ExtrapolationEngine(const std::string& t, const std::string& n, const IInterface* p)
18{
19 declareInterface<Trk::IExtrapolationEngine>(this);
20}
21
22// destructor
24= default;
25
26
27// the interface method initialize
29{
30 EX_MSG_DEBUG( "", "initialize", "", "starting initialize()" );
31
34
35 // get the TrackingGeometrySvc
37
38 // retrieve the ExtrapolationEngines
39 if (m_extrapolationEngines.retrieve().isFailure()){
40
41 } else {
42 EX_MSG_DEBUG( "", "initialize", "", "Successfully retrieved " << m_extrapolationEngines.size() << " ExtrapolationEngines. Ordering them now." );
43 m_eeAccessor = std::vector<const Trk::IExtrapolationEngine*>(int(Trk::NumberOfGeometryTypes), (const Trk::IExtrapolationEngine*)nullptr);
44 for (auto& ee : m_extrapolationEngines){
45 EX_MSG_DEBUG( "", "initialize", "", "Registering " << ee->name() << " - for GeometryType : " << ee->geometryType() );
46 m_eeAccessor[ee->geometryType()] = (&*ee);
47 }
48 }
49
50 if (m_propagationEngine.retrieve().isFailure()){
51 EX_MSG_FATAL("", "initialize", "", "failed to retrieve propagation engine '"<< m_propagationEngine << "'. Aborting." );
52 return StatusCode::FAILURE;
53 } else
54 EX_MSG_DEBUG("", "initialize", "", "successfully propagation engine '" << m_propagationEngine << "'." );
55
56 if (m_navigationEngine.retrieve().isFailure()){
57 EX_MSG_FATAL("", "initialize", "", "failed to retrieve navigation engine '"<< m_navigationEngine << "'. Aborting." );
58 return StatusCode::FAILURE;
59 } else
60 EX_MSG_DEBUG("", "initialize", "", "successfully retrieved '" << m_navigationEngine << "'." );
61
62 return StatusCode::SUCCESS;
63}
64
65// the interface method finalize
67{
68 EX_MSG_DEBUG( "", "finalize", "", "successful" );
69 return StatusCode::SUCCESS;
70}
71
72
75 const Surface* sf,
76 const BoundaryCheck& bcheck) const
77{ return extrapolateT<TrackParameters>(ecCharged,sf,ecCharged.propDirection,bcheck); }
78
79
82 const Surface* sf,
83 const BoundaryCheck& bcheck) const
84{ return extrapolateT<NeutralParameters>(ecNeutral,sf,ecNeutral.propDirection,bcheck); }
85
87 std::stringstream msg;
88 msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
89 throw std::runtime_error(msg.str());
90}
91
#define ATH_CHECK
Evaluate an expression and check for errors.
#define EX_MSG_DEBUG(navstep, step, idx, x)
#define EX_MSG_FATAL(navstep, step, idx, x)
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Mixin class to perform additional checks on a component.
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
PropDirection propDirection
this is the propagation direction
virtual ExtrapolationCode extrapolate(ExCellCharged &ecCharged, const Surface *sf=0, const BoundaryCheck &bcheck=true) const
charged extrapolation - public interface
~ExtrapolationEngine()
Destructor.
ExtrapolationCode extrapolateT(ExtrapolationCell< T > &eCell, const Surface *sf=0, PropDirection dir=alongMomentum, const BoundaryCheck &bcheck=true) const
main loop extrapolation method
ToolHandle< IPropagationEngine > m_propagationEngine
the used propagation engine for navigation initialization
SG::ReadCondHandleKey< TrackingGeometry > m_trackingGeometryReadKey
the tool handle array for static / dense / detached
ExtrapolationEngine(const std::string &, const std::string &, const IInterface *)
Constructor.
ToolHandle< INavigationEngine > m_navigationEngine
access to tracking geometry (unique?)
StatusCode finalize()
AlgTool finalize method.
StatusCode initialize()
AlgTool initialize method.
ToolHandleArray< IExtrapolationEngine > m_extrapolationEngines
std::vector< const IExtrapolationEngine * > m_eeAccessor
the extrapolation engines for
Extrapolation engine interface for Charged and Neutral parameters, it serves as the Master extrapolat...
std::string m_sopPrefix
< SCREEN output formatting (SOP) - unify amongst extrapolation engines
std::string m_sopPostfix
prefix for screen output
Abstract Base Class for tracking surfaces.
@ NumberOfGeometryTypes
ExtrapolationCell< TrackParameters > ExCellCharged
ExtrapolationCell< NeutralParameters > ExCellNeutral
MsgStream & msg
Definition testRead.cxx:32