ATLAS Offline Software
LocalExtrapolatorCache.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 TRKEXTOOLS_LOCALEXCACHE_H
6 #define TRKEXTOOLS_LOCALEXCACHE_H
7 #include "ObjContainer.h"
9 #include "ParametersNextVolume.h"
11 #include "TrkGeometry/TrackingGeometry.h" //because of m_trackingGeometry-> in header
12 #include "TrkExInterfaces/INavigator.h" //using navigator. in this header
13 #include <utility>
14 #include <vector>
15 #include <string>
16 #include <memory>
17 
18  namespace Trk{
19  class Surface;
20  class ExtrapolationCache;
21  class EnergyLoss;
22  class TrackStateOnSurface;
23  }
24 
25 namespace Trk{
26 struct Cache
27  {
30  typedef std::vector<std::unique_ptr<Trk::TrackParameters>> TrackParametersUVector;
31  typedef std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>, int>> identifiedParameters_t;
33  typedef std::pair<const Surface*, BoundaryCheck> DestSurf;
34  //
41  std::vector<Trk::IMaterialEffectsUpdator::ICache> m_MaterialUpCache;
43  bool m_dense = false;
45  bool m_recall = false;
46  bool m_robustSampling = true;
47  unsigned int m_layerResolved{};
48  unsigned int m_methodSequence = 0;
49  const Surface* m_destinationSurface = nullptr;
51  const Volume* m_boundaryVolume = nullptr;
53  const Surface* m_recallSurface = nullptr;
55  const Layer* m_recallLayer = nullptr;
62  //to a vector of unique parameters of detector elements
65  const Layer* m_lastMaterialLayer = nullptr;
69  const Trk::EnergyLoss* m_cacheEloss = nullptr;
71  std::vector<const Trk::TrackStateOnSurface*>* m_matstates = nullptr;
72  // for active volumes
73  std::unique_ptr<identifiedParameters_t> m_identifiedParameters;
74 
76  double m_path{};
77 
78  std::pair<unsigned int, unsigned int> m_denseResolved;
79 
80  std::vector<DestSurf> m_staticBoundaries;
81  std::vector<DestSurf> m_detachedBoundaries;
82  std::vector<DestSurf> m_denseBoundaries;
83  std::vector<DestSurf> m_navigBoundaries;
84  std::vector<DestSurf> m_layers;
85 
86  std::vector<std::pair<const Trk::DetachedTrackingVolume*, unsigned int>> m_detachedVols;
87  std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>> m_denseVols;
88  std::vector<std::pair<const Trk::TrackingVolume*, const Trk::Layer*>> m_navigLays;
89  std::vector<std::pair<const Trk::Surface*, Trk::BoundaryCheck>> m_navigSurfs;
90  std::vector<const Trk::DetachedTrackingVolume*> m_navigVols;
91  std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>> m_navigVolsInt;
92 
93  //methods
94  Cache();
95  ~Cache();
96  Cache(const std::vector<const IMaterialEffectsUpdator*> & updaters);
97 
99 
100  ManagedTrackParmPtr manage(std::unique_ptr<Trk::TrackParameters>&& parm)
101  {
102  return ManagedTrackParmPtr(trackParmContainer(), std::move(parm));
103  }
105  {
106  return ManagedTrackParmPtr(trackParmContainer(), parm);
107  }
109 
110  const Trk::TrackingGeometry *trackingGeometry( const Trk::INavigator &navigator, const EventContext &ctx) {
111  if (!m_trackingGeometry) {
112  m_trackingGeometry = navigator.trackingGeometry(ctx);
113  }
114  return m_trackingGeometry;
115  }
116 
117  const Trk::TrackingVolume
118  *volume(const EventContext&, const Amg::Vector3D& gp) const {
119  assert(m_trackingGeometry);
121  }
122 
126 
129 
130  //
131  void
132  populateMatEffUpdatorCache(const std::vector<const IMaterialEffectsUpdator*> & updaters);
133 
135  void
136  setRecallInformation(const Surface&,const Layer&,const TrackingVolume&);
137 
138  void
140 
142  std::string
143  to_string(const std::string& txt) const;
144 
146  bool
147  elossPointerOverwritten() const;
148 
150  std::string
151  elossPointerErrorMsg(int lineNumber=0) const;
152 
154  void
156 
158  void
159  addOneNavigationLayer(const Trk::TrackingVolume* pDetVol, const Trk::Layer* pLayer, bool boundaryCheck=true);
160 
162  void
163  addOneNavigationLayer(const Trk::Layer* pLayer, bool boundaryCheck=true);
164 
166  void
168  };
169  }
170  #endif
171 
172 
Trk::Cache::subMaterialEffectsUpdatorCache
IMaterialEffectsUpdator::ICache & subMaterialEffectsUpdatorCache()
Definition: LocalExtrapolatorCache.cxx:38
Trk::Cache::m_detachedBoundaries
std::vector< DestSurf > m_detachedBoundaries
Definition: LocalExtrapolatorCache.h:81
Trk::Cache::m_lastValidParameters
ManagedTrackParmPtr m_lastValidParameters
return helper for parameters and boundary
Definition: LocalExtrapolatorCache.h:37
Trk::Cache::m_denseVols
std::vector< std::pair< const Trk::TrackingVolume *, unsigned int > > m_denseVols
Definition: LocalExtrapolatorCache.h:87
Trk::Cache::m_detachedVols
std::vector< std::pair< const Trk::DetachedTrackingVolume *, unsigned int > > m_detachedVols
Definition: LocalExtrapolatorCache.h:86
Trk::IMaterialEffectsUpdator::ICache
Cache class to allow passing information to/between calls.
Definition: IMaterialEffectsUpdator.h:63
TrackParameters.h
Trk::Cache::m_MaterialUpCache
std::vector< Trk::IMaterialEffectsUpdator::ICache > m_MaterialUpCache
internal switch for resolved configuration
Definition: LocalExtrapolatorCache.h:41
Trk::Cache
Definition: LocalExtrapolatorCache.h:27
Trk::Cache::m_extrapolationCache
Trk::ExtrapolationCache * m_extrapolationCache
cache pointer for Eloss
Definition: LocalExtrapolatorCache.h:67
Trk::Cache::m_navigBoundaries
std::vector< DestSurf > m_navigBoundaries
Definition: LocalExtrapolatorCache.h:83
Trk::Cache::m_recallTrackingVolume
const TrackingVolume * m_recallTrackingVolume
Definition: LocalExtrapolatorCache.h:57
Trk::Cache::trackingGeometry
const Trk::TrackingGeometry * trackingGeometry(const Trk::INavigator &navigator, const EventContext &ctx)
Definition: LocalExtrapolatorCache.h:110
Trk::Cache::m_layers
std::vector< DestSurf > m_layers
Definition: LocalExtrapolatorCache.h:84
Trk::Cache::populateMatEffUpdatorCache
void populateMatEffUpdatorCache(const std::vector< const IMaterialEffectsUpdator * > &updaters)
Definition: LocalExtrapolatorCache.cxx:43
Trk::Cache::m_parametersOnDetElements
TrackParametersUVector * m_parametersOnDetElements
cache layer with last material update
Definition: LocalExtrapolatorCache.h:63
Trk::Cache::m_navigLays
std::vector< std::pair< const Trk::TrackingVolume *, const Trk::Layer * > > m_navigLays
Definition: LocalExtrapolatorCache.h:88
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
ParametersNextVolume.h
Trk::Cache::setRecallInformation
void setRecallInformation(const Surface &, const Layer &, const TrackingVolume &)
Private method for setting recall Information.
Definition: LocalExtrapolatorCache.cxx:52
Trk::Cache::retrieveBoundaries
void retrieveBoundaries()
Retrieve boundaries.
Definition: LocalExtrapolatorCache.cxx:100
Trk::Cache::resetRecallInformation
void resetRecallInformation()
Definition: LocalExtrapolatorCache.cxx:60
Trk::Cache::m_path
double m_path
Definition: LocalExtrapolatorCache.h:76
Trk::Cache::DestSurf
std::pair< const Surface *, BoundaryCheck > DestSurf
Definition: LocalExtrapolatorCache.h:33
Trk::Cache::m_robustSampling
bool m_robustSampling
Definition: LocalExtrapolatorCache.h:46
Trk::Cache::identifiedParameters_t
std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int > > identifiedParameters_t
Definition: LocalExtrapolatorCache.h:31
Trk::Cache::addOneNavigationLayer
void addOneNavigationLayer(const Trk::TrackingVolume *pDetVol, const Trk::Layer *pLayer, bool boundaryCheck=true)
Add one layer and navigLayer.
Definition: LocalExtrapolatorCache.cxx:110
Trk::INavigator::trackingGeometry
virtual const TrackingGeometry * trackingGeometry(const EventContext &ctx) const =0
INavigator interface method - returns the TrackingGeometry used for navigation.
Trk::Cache::m_boundaryVolume
const Volume * m_boundaryVolume
Destination Surface for recall.
Definition: LocalExtrapolatorCache.h:51
ObjContainer.h
Trk::Cache::ManagedTrackParmPtr
ObjPtr< Trk::TrackParameters > ManagedTrackParmPtr
Definition: LocalExtrapolatorCache.h:29
Trk::Cache::m_layerResolved
unsigned int m_layerResolved
Definition: LocalExtrapolatorCache.h:47
Trk::Cache::m_matstates
std::vector< const Trk::TrackStateOnSurface * > * m_matstates
Definition: LocalExtrapolatorCache.h:71
Trk::TrackingGeometry
Definition: TrackingGeometry.h:67
Trk::Cache::m_denseResolved
std::pair< unsigned int, unsigned int > m_denseResolved
Definition: LocalExtrapolatorCache.h:78
Trk::Cache::m_dense
bool m_dense
Flag the recall solution.
Definition: LocalExtrapolatorCache.h:43
Trk::Cache::m_navigSurfs
std::vector< std::pair< const Trk::Surface *, Trk::BoundaryCheck > > m_navigSurfs
Definition: LocalExtrapolatorCache.h:89
Trk::Cache::m_highestVolume
const Trk::TrackingVolume * m_highestVolume
Pointer (not owning) pointing.
Definition: LocalExtrapolatorCache.h:60
Trk::Cache::m_staticBoundaries
std::vector< DestSurf > m_staticBoundaries
Definition: LocalExtrapolatorCache.h:80
Trk::ParametersNextVolume
Definition: ParametersNextVolume.h:13
Trk::Cache::m_denseBoundaries
std::vector< DestSurf > m_denseBoundaries
Definition: LocalExtrapolatorCache.h:82
Trk::Cache::m_recallSurface
const Surface * m_recallSurface
Destination Layer for recall.
Definition: LocalExtrapolatorCache.h:53
Trk::Cache::m_currentDense
const Trk::TrackingVolume * m_currentDense
Definition: LocalExtrapolatorCache.h:59
Trk::Cache::m_trackingGeometry
const Trk::TrackingGeometry * m_trackingGeometry
Definition: LocalExtrapolatorCache.h:75
Trk::Cache::manage
ManagedTrackParmPtr manage()
Definition: LocalExtrapolatorCache.h:108
Trk::Cache::m_recallLayer
const Layer * m_recallLayer
Destination TrackingVolume for recall.
Definition: LocalExtrapolatorCache.h:55
Trk::Cache::manage
ManagedTrackParmPtr manage(TrackParmPtr parm)
Definition: LocalExtrapolatorCache.h:104
Trk::Cache::elossPointerErrorMsg
std::string elossPointerErrorMsg(int lineNumber=0) const
String error message if the cache has a problem.
Definition: LocalExtrapolatorCache.cxx:91
Trk::Cache::m_destinationSurface
const Surface * m_destinationSurface
the boundary volume check
Definition: LocalExtrapolatorCache.h:49
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
ObjPtr< Trk::TrackParameters >
IMaterialEffectsUpdator.h
Trk::EnergyLoss
This class describes energy loss material effects in the ATLAS tracking EDM.
Definition: EnergyLoss.h:34
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
Trk::Cache::m_trackParmContainer
TrackParmContainer m_trackParmContainer
parameters to be used for final propagation in case of fallback
Definition: LocalExtrapolatorCache.h:35
ObjRef
Helper class to refer to objects in the container ObjContainer.
Definition: ObjContainer.h:61
Trk::Cache::m_methodSequence
unsigned int m_methodSequence
Definition: LocalExtrapolatorCache.h:48
INavigator.h
Trk::Cache::elossPointerOverwritten
bool elossPointerOverwritten() const
Check cache integrity.
Definition: LocalExtrapolatorCache.cxx:86
Trk::TrackingGeometry::lowestTrackingVolume
const TrackingVolume * lowestTrackingVolume(const Amg::Vector3D &gp) const
return the lowest tracking Volume
Definition: TrackingGeometry.cxx:53
Trk::Cache::m_navigVols
std::vector< const Trk::DetachedTrackingVolume * > m_navigVols
Definition: LocalExtrapolatorCache.h:90
Trk::Cache::m_recall
bool m_recall
Definition: LocalExtrapolatorCache.h:45
Trk::Cache::to_string
std::string to_string(const std::string &txt) const
String representation of cache.
Definition: LocalExtrapolatorCache.cxx:68
Trk::Cache::copyToNavigationSurfaces
void copyToNavigationSurfaces()
Insert navigation surfaces from layers, dense boundaries, navig boundaries and detached boundaries.
Definition: LocalExtrapolatorCache.cxx:122
TrackingGeometry.h
Trk::INavigator
Definition: INavigator.h:68
Trk::Cache::~Cache
~Cache()
Trk::Cache::Cache
Cache()
Definition: LocalExtrapolatorCache.cxx:11
Trk::Cache::m_navigVolsInt
std::vector< std::pair< const Trk::TrackingVolume *, unsigned int > > m_navigVolsInt
Definition: LocalExtrapolatorCache.h:91
Trk::Cache::manage
ManagedTrackParmPtr manage(std::unique_ptr< Trk::TrackParameters > &&parm)
Definition: LocalExtrapolatorCache.h:100
Trk::Cache::volume
const Trk::TrackingVolume * volume(const EventContext &, const Amg::Vector3D &gp) const
Definition: LocalExtrapolatorCache.h:118
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::Volume
Definition: Volume.h:35
Trk::Cache::trackParmContainer
TrackParmContainer & trackParmContainer()
Definition: LocalExtrapolatorCache.h:98
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Trk::ExtrapolationCache
Definition: ExtrapolationCache.h:26
Trk::Cache::m_cacheEloss
const Trk::EnergyLoss * m_cacheEloss
cache of TrackStateOnSurfaces
Definition: LocalExtrapolatorCache.h:69
Trk::Cache::m_lastMaterialLayer
const Layer * m_lastMaterialLayer
cache for collecting the total X0 ans Eloss
Definition: LocalExtrapolatorCache.h:65
Trk::Cache::m_currentStatic
const Trk::TrackingVolume * m_currentStatic
Definition: LocalExtrapolatorCache.h:58
Trk::Cache::m_parametersAtBoundary
ParametersNextVolume m_parametersAtBoundary
Caches per MaterialUpdator.
Definition: LocalExtrapolatorCache.h:39
Trk::Cache::TrackParametersUVector
std::vector< std::unique_ptr< Trk::TrackParameters > > TrackParametersUVector
Definition: LocalExtrapolatorCache.h:30
Trk::Cache::m_identifiedParameters
std::unique_ptr< identifiedParameters_t > m_identifiedParameters
Definition: LocalExtrapolatorCache.h:73
ObjContainer< Trk::TrackParameters >
Trk::Layer
Definition: Layer.h:73