ATLAS Offline Software
Loading...
Searching...
No Matches
LocalExtrapolatorCache.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4
5#ifndef TRKEXTOOLS_LOCALEXCACHE_H
6#define TRKEXTOOLS_LOCALEXCACHE_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;
21 class EnergyLoss;
23 }
24
25namespace Dbg {
26 // counters to gather statistics for abort conditions
27 struct PropStat {
28 std::atomic<unsigned int> m_maxRecursionCount{};
29 std::atomic<unsigned int> m_maxPropagations{};
30 std::atomic<unsigned int> m_maxMethodSequence{};
31 };
32}
33
34namespace Trk{
35struct Cache
36 {
37 using TrackParametersUVector = std::vector<std::unique_ptr<Trk::TrackParameters>>;
38 using identifiedParameters_t = std::vector<std::pair<std::unique_ptr<Trk::TrackParameters>, int>>;
39 using DestSurf = std::pair<const Surface*, BoundaryCheck>;
47 std::vector<Trk::IMaterialEffectsUpdator::ICache> m_MaterialUpCache;
49 bool m_dense = false;
50 unsigned int m_layerResolved{};
51 unsigned int m_methodSequence = 0;
52 const Surface* m_destinationSurface = nullptr;
54 const Volume* m_boundaryVolume = nullptr;
56 const Surface* m_recallSurface = nullptr;
58 const Layer* m_recallLayer = nullptr;
64 //Tracking Geometry ptr
66 //path
67 double m_path{};
69 //to a vector of unique parameters of detector elements
72 bool m_cacheLastMatLayer = false;
73 const Layer* m_lastMaterialLayer = nullptr;
77 const Trk::EnergyLoss* m_cacheEloss = nullptr;
79 std::vector<const Trk::TrackStateOnSurface*>* m_matstates = nullptr;
80 // for active volumes
81 std::unique_ptr<identifiedParameters_t> m_identifiedParameters{};
82 //
83 std::pair<unsigned int, unsigned int> m_denseResolved{};
84 //
85 std::vector<DestSurf> m_staticBoundaries{};
86 std::vector<DestSurf> m_detachedBoundaries{};
87 std::vector<DestSurf> m_denseBoundaries{};
88 std::vector<DestSurf> m_navigBoundaries{};
89 std::vector<DestSurf> m_layers{};
90 //
91 std::vector<std::pair<const Trk::DetachedTrackingVolume*, unsigned int>> m_detachedVols{};
92 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>> m_denseVols{};
93 std::vector<std::pair<const Trk::TrackingVolume*, const Trk::Layer*>> m_navigLays{};
94 std::vector<std::pair<const Trk::Surface*, Trk::BoundaryCheck>> m_navigSurfs{};
95 std::vector<const Trk::DetachedTrackingVolume*> m_navigVols{};
96 std::vector<std::pair<const Trk::TrackingVolume*, unsigned int>> m_navigVolsInt{};
97
98 // To gather statistics to tune abort condition based for to large call depth, or too many propagations
101 std::array<unsigned short,kNRecursionValues> m_recursionCount {}; // current-recursion-level, max
102 unsigned int m_nPropagations {};
104
105 //methods
106 Cache(Dbg::PropStat &stat);
107 ~Cache();
108 Cache(const std::vector<const IMaterialEffectsUpdator*> & updaters);
109
111 const EventContext& ctx) {
112 if (!m_trackingGeometry) {
113 m_trackingGeometry = navigator.trackingGeometry(ctx);
114 }
115 }
116
117 const Trk::TrackingVolume* volume(const EventContext&,
118 const Amg::Vector3D& gp) const {
119 assert(m_trackingGeometry);
120 return m_trackingGeometry->lowestTrackingVolume(gp);
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
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
This class describes energy loss material effects in the ATLAS tracking EDM.
Definition EnergyLoss.h:34
Cache class to allow passing information to/between calls.
Interface class for the navigation AlgTool, it inherits from IAlgTool Detailed information about priv...
Definition INavigator.h:68
virtual const TrackingGeometry * trackingGeometry(const EventContext &ctx) const =0
INavigator interface method - returns the TrackingGeometry used for navigation.
Base Class for a Detector Layer in the Tracking realm.
Definition Layer.h:72
Abstract Base Class for tracking surfaces.
represents the track state (measurement, material, fit parameters and quality) at a surface.
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
Base class for all volumes inside the tracking realm, it defines the interface for inherited Volume c...
Definition Volume.h:36
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
ParametersBase< TrackParametersDim, Charged > TrackParameters
std::atomic< unsigned int > m_maxMethodSequence
std::atomic< unsigned int > m_maxRecursionCount
std::atomic< unsigned int > m_maxPropagations
const Surface * m_destinationSurface
the boundary volume check
Cache(Dbg::PropStat &stat)
const Layer * m_lastMaterialLayer
cache for collecting the total X0 ans Eloss
IMaterialEffectsUpdator::ICache & subMaterialEffectsUpdatorCache()
std::string elossPointerErrorMsg(int lineNumber=0) const
String error message if the cache has a problem.
const Volume * m_boundaryVolume
Destination Surface for recall.
const Trk::EnergyLoss * m_cacheEloss
cache of TrackStateOnSurfaces
void retrieveBoundaries()
Retrieve boundaries.
std::vector< std::unique_ptr< Trk::TrackParameters > > TrackParametersUVector
const Trk::TrackingVolume * volume(const EventContext &, const Amg::Vector3D &gp) const
void setRecallInformation(const Surface &, const Layer &, const TrackingVolume &)
Private method for setting recall Information.
bool elossPointerOverwritten() const
Check cache integrity.
std::vector< std::pair< const Trk::Surface *, Trk::BoundaryCheck > > m_navigSurfs
std::array< unsigned short, kNRecursionValues > m_recursionCount
const TrackingVolume * m_recallTrackingVolume
std::pair< const Surface *, BoundaryCheck > DestSurf
The class holding the unique ptr during the extrapolation loop.
const Layer * m_recallLayer
Destination TrackingVolume for recall.
std::vector< const Trk::DetachedTrackingVolume * > m_navigVols
std::pair< unsigned int, unsigned int > m_denseResolved
double m_path
Pointer (not owning) pointing.
std::vector< Trk::IMaterialEffectsUpdator::ICache > m_MaterialUpCache
internal switch for resolved configuration
unsigned int m_layerResolved
void addOneNavigationLayer(const Trk::TrackingVolume *pDetVol, const Trk::Layer *pLayer, bool boundaryCheck=true)
Add one layer and navigLayer.
std::vector< std::pair< std::unique_ptr< Trk::TrackParameters >, int > > identifiedParameters_t
Dbg::PropStat * m_statPtr
std::vector< DestSurf > m_detachedBoundaries
void populateMatEffUpdatorCache(const std::vector< const IMaterialEffectsUpdator * > &updaters)
std::vector< std::pair< const Trk::TrackingVolume *, const Trk::Layer * > > m_navigLays
unsigned int m_nPropagations
const Surface * m_recallSurface
Destination Layer for recall.
std::vector< DestSurf > m_staticBoundaries
const Trk::TrackingVolume * m_highestVolume
Trk::ExtrUniquePtrHolder< Trk::TrackParameters > m_ownedPtrs
parameters to be used for final propagation in case of fallback
Trk::TrackParameters * m_lastValidParameters
return helper for parameters and boundary
std::vector< std::pair< const Trk::TrackingVolume *, unsigned int > > m_navigVolsInt
std::vector< const Trk::TrackStateOnSurface * > * m_matstates
void setTrackingGeometry(const Trk::INavigator &navigator, const EventContext &ctx)
std::vector< std::pair< const Trk::DetachedTrackingVolume *, unsigned int > > m_detachedVols
std::string to_string(const std::string &txt) const
String representation of cache.
std::vector< std::pair< const Trk::TrackingVolume *, unsigned int > > m_denseVols
std::vector< DestSurf > m_navigBoundaries
const Trk::TrackingGeometry * m_trackingGeometry
std::unique_ptr< identifiedParameters_t > m_identifiedParameters
enum Trk::Cache::EStatus m_status
void copyToNavigationSurfaces()
Insert navigation surfaces from layers, dense boundaries, navig boundaries and detached boundaries.
Trk::ExtrapolationCache * m_extrapolationCache
cache pointer for Eloss
ParametersNextVolume m_parametersAtBoundary
Caches per MaterialUpdator.
const Trk::TrackingVolume * m_currentStatic
const Trk::TrackingVolume * m_currentDense
std::vector< DestSurf > m_layers
TrackParametersUVector * m_parametersOnDetElements
cache layer with last material update
unsigned int m_methodSequence
std::vector< DestSurf > m_denseBoundaries