ATLAS Offline Software
ExtrapolationEngine.cxx
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.cxx, (c) ATLAS Detector software
8 
9 // STL
10 #include <sstream>
11 // Trk include
14 
15 // constructor
16 Trk::ExtrapolationEngine::ExtrapolationEngine(const std::string& t, const std::string& n, const IInterface* p)
18  m_forceSearchInit(false)
19 {
20  declareInterface<Trk::IExtrapolationEngine>(this);
21  // steering of the screen outoput (SOP)
22  declareProperty("OutputPrefix" , m_sopPrefix);
23  declareProperty("OutputPostfix" , m_sopPostfix);
24  // the properties to be given
25  declareProperty("ForceSearchAtInit" , m_forceSearchInit);
26 }
27 
28 // destructor
30 = default;
31 
32 
33 // the interface method initialize
35 {
36 
37  EX_MSG_DEBUG( "", "initialize", "", "starting initialize()" );
38  // get the TrackingGeometrySvc
39  ATH_CHECK( m_trackingGeometryReadKey.initialize(!m_trackingGeometryReadKey.key().empty()) );
40 
41  // retrieve the ExtrapolationEngines
42  if (m_extrapolationEngines.retrieve().isFailure()){
43 
44  } else {
45  EX_MSG_DEBUG( "", "initialize", "", "Successfully retrieved " << m_extrapolationEngines.size() << " ExtrapolationEngines. Ordering them now." );
46  m_eeAccessor = std::vector<const Trk::IExtrapolationEngine*>(int(Trk::NumberOfGeometryTypes), (const Trk::IExtrapolationEngine*)nullptr);
47  for (auto& ee : m_extrapolationEngines){
48  EX_MSG_DEBUG( "", "initialize", "", "Registering " << ee->name() << " - for GeometryType : " << ee->geometryType() );
49  m_eeAccessor[ee->geometryType()] = (&*ee);
50  }
51  }
52 
53  if (m_propagationEngine.retrieve().isFailure()){
54  EX_MSG_FATAL("", "initialize", "", "failed to retrieve propagation engine '"<< m_propagationEngine << "'. Aborting." );
55  return StatusCode::FAILURE;
56  } else
57  EX_MSG_DEBUG("", "initialize", "", "successfully propagation engine '" << m_propagationEngine << "'." );
58 
59  if (m_navigationEngine.retrieve().isFailure()){
60  EX_MSG_FATAL("", "initialize", "", "failed to retrieve navigation engine '"<< m_navigationEngine << "'. Aborting." );
61  return StatusCode::FAILURE;
62  } else
63  EX_MSG_DEBUG("", "initialize", "", "successfully retrieved '" << m_navigationEngine << "'." );
64 
65  return StatusCode::SUCCESS;
66 }
67 
68 // the interface method finalize
70 {
71  EX_MSG_DEBUG( "", "finalize", "", "successful" );
72  return StatusCode::SUCCESS;
73 }
74 
75 
78  const Surface* sf,
79  const BoundaryCheck& bcheck) const
80 { return extrapolateT<TrackParameters>(ecCharged,sf,ecCharged.propDirection,bcheck); }
81 
82 
85  const Surface* sf,
86  const BoundaryCheck& bcheck) const
87 { return extrapolateT<NeutralParameters>(ecNeutral,sf,ecNeutral.propDirection,bcheck); }
88 
90  std::stringstream msg;
91  msg << "Failed to get conditions data " << m_trackingGeometryReadKey.key() << ".";
92  throw std::runtime_error(msg.str());
93 }
94 
GeometrySignature.h
Trk::ExtrapolationEngine::m_forceSearchInit
bool m_forceSearchInit
Definition: ExtrapolationEngine.h:119
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Trk::ExtrapolationCell::propDirection
PropDirection propDirection
this is the propagation direction
Definition: ExtrapolationCell.h:260
Trk::ExtrapolationEngine::initialize
StatusCode initialize()
AlgTool initialize method.
Definition: ExtrapolationEngine.cxx:34
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ExtrapolationEngine.h
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::IExtrapolationEngine::m_sopPostfix
std::string m_sopPostfix
prefix for screen output
Definition: IExtrapolationEngine.h:64
Trk::NumberOfGeometryTypes
@ NumberOfGeometryTypes
Definition: GeometrySignature.h:43
Trk::IExtrapolationEngine::m_sopPrefix
std::string m_sopPrefix
< SCREEN output formatting (SOP) - unify amongst extrapolation engines
Definition: IExtrapolationEngine.h:63
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
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
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Trk::ExtrapolationCode
Definition: ExtrapolationCell.h:105
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::ExtrapolationEngine::finalize
StatusCode finalize()
AlgTool finalize method.
Definition: ExtrapolationEngine.cxx:69
EX_MSG_DEBUG
#define EX_MSG_DEBUG(navstep, step, idx, x)
Definition: ExtrapolationMacros.h:13
Trk::ExtrapolationCell
Definition: ExtrapolationCell.h:231
Trk::IExtrapolationEngine
Definition: IExtrapolationEngine.h:36
mapkey::sf
@ sf
Definition: TElectronEfficiencyCorrectionTool.cxx:38
Trk::BoundaryCheck
Definition: BoundaryCheck.h:51
AthAlgTool
Definition: AthAlgTool.h:26
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
Trk::ExtrapolationEngine::~ExtrapolationEngine
~ExtrapolationEngine()
Destructor.