ATLAS Offline Software
Loading...
Searching...
No Matches
TrackingGeometry.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TrackingGeometry.h, (c) ATLAS Detector software
8
9#ifndef TRKGEOMETRY_TRACKINGGEOMETRY_H
10#define TRKGEOMETRY_TRACKINGGEOMETRY_H
11
12// Amg
14// Trk
17// ATH_MSG macros
19// CLASS DEF
21// STL
22#include <map>
23#include <ranges>
24#include <memory>
25#include <string_view>
26
27
29
30class MsgStream;
31
32// must be known to declare friend class
33namespace Muon {
35}
36
37namespace Trk {
38
42
49
50class TrackingVolume;
51class Layer;
52class MaterialProperties;
53
68{
69
71 friend class GeometryBuilder;
72
73 friend class GeometryBuilderCond;
74
75public:
76
78 TrackingGeometry(TrackingVolume* highestVolume,
79 NavigationLevel navlevel = globalSearch);
81 virtual ~TrackingGeometry();
82
86
87
90
92 std::vector<const Trk::DetachedTrackingVolume*>
94
97 const Amg::Vector3D& gp) const;
98
100 const TrackingVolume* trackingVolume(const std::string& name) const;
101
103 const Layer* associatedLayer(const Amg::Vector3D& gp) const;
104
106 const Layer* nextLayer(const Amg::Vector3D& gp,
107 const Amg::Vector3D& mom,
108 bool skipNavLayer = false) const;
109
111 template<class T>
114 const BoundaryCheck& bchk = true) const;
116 static bool atVolumeBoundary(const Amg::Vector3D& gp,
117 const TrackingVolume* vol,
118 double tol);
119
121 static bool atVolumeBoundary(const Amg::Vector3D& gp,
122 const Amg::Vector3D& mom,
123 const TrackingVolume* vol,
124 const TrackingVolume*& nextVol,
126 double tol);
127
129 const std::map<Layer*, int>& boundaryLayers() ;
130 auto boundaryLayers() const;
131
132 size_t numBoundaryLayers() const;
136
138 void printVolumeHierarchy(MsgStream& msgstream) const;
139
142 void indexStaticLayers(GeometrySignature geosit, int offset = 0);
143
144 void dump(MsgStream& out, const std::string& head) const;
145
146 // get ownership of Muon Tracking Geometry Elements
147 void addToGarbage(std::vector<std::unique_ptr<Trk::DetachedTrackingVolume>>&& garbageVec);
148 void addToGarbage(std::vector<std::unique_ptr<Trk::TrackingVolume>>&& garbageVec);
149
150
151 private:
154 void sign(GeometrySignature geosit, GeometryType geotype = Static);
155
160 void compactify(MsgStream& msgstream, TrackingVolume* vol = nullptr);
161
164 void synchronizeLayers(MsgStream& msgstream, TrackingVolume* vol = nullptr);
165
168
171 TrackingVolume* mvol = nullptr,
172 int lvl = 0);
173
177
179 void printVolumeInformation(MsgStream& msgstream,
180 const TrackingVolume& tvol,
181 int lvl) const;
182
183 static void dumpLayer(MsgStream& out,
184 std::string_view head,
185 const Layer* layer);
186
188 std::unique_ptr<TrackingVolume> m_world;
189
191 std::map<Layer*, int> m_boundaryLayers;
192
194 std::map<const std::string, const TrackingVolume*> m_trackingVolumes;
195
198
205 std::vector<std::unique_ptr<DetachedTrackingVolume>> m_detachedVolGarbage{};
206 std::vector<std::unique_ptr<TrackingVolume>> m_trkVolumeGarbage{};
207
208};
209
210} // end of namespace
212CLASS_DEF(Trk::TrackingGeometry, 167645219, 1)
213#include "AthenaKernel/CondCont.h"
215
216#endif // TRKGEOMETRY_TRACKINGGEOMETRY_H
#define CONDCONT_MIXED_DEF(...)
Definition CondCont.h:1446
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Define macros for attributes used to control the static checker.
The Muon::MuonTrackingGeometryBuilderCond retrieves MuonStationBuilder and MuonInertMaterialBuilder f...
The BoundaryCheck class allows to steer the way surface boundaries are used for inside/outside checks...
Base Class for a Detector Layer in the Tracking realm.
Definition Layer.h:72
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
std::vector< const Trk::DetachedTrackingVolume * > lowestDetachedTrackingVolumes(const Amg::Vector3D &gp) const
return the vector of lowest detached tracking Volume(->overlaps)
const TrackingVolume * trackingVolume(const std::string &name) const
return the tracking Volume by name, 0 if it doesn't exist
virtual ~TrackingGeometry()
Destructor.
LayerIntersection< Amg::Vector3D > closestMaterialLayer(const T &pars, PropDirection pDir=Trk::alongMomentum, const BoundaryCheck &bchk=true) const
Closest Material Layer - used for the mapping option.
void addToGarbage(std::vector< std::unique_ptr< Trk::DetachedTrackingVolume > > &&garbageVec)
NavigationLevel navigationLevel() const
Return the Navigation Level - only one TrackingGeometry can have full association to GeoModel.
const Layer * nextLayer(const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool skipNavLayer=false) const
Forward the next Layer information.
auto boundaryLayers() const
const Layer * associatedLayer(const Amg::Vector3D &gp) const
Forward the associated Layer information.
static bool atVolumeBoundary(const Amg::Vector3D &gp, const TrackingVolume *vol, double tol)
check position at volume boundary
std::map< Layer *, int > m_boundaryLayers
The unique boundary Layers.
const std::map< Layer *, int > & boundaryLayers()
Return the unique BoundarySurfaces with MaterialInformation.
friend class GeometryBuilder
Give the GeometryBuilder friend rights.
void registerTrackingVolumes(TrackingVolume &tvol, TrackingVolume *mvol=nullptr, int lvl=0)
private method to register recursively the tracking volumes
friend class GeometryBuilderCond
const TrackingVolume * highestTrackingVolume() const
return the world
std::vector< std::unique_ptr< DetachedTrackingVolume > > m_detachedVolGarbage
In some cases the Tracking Geometry needs to keep certain objectss alive delete them at the end of it...
std::vector< std::unique_ptr< TrackingVolume > > m_trkVolumeGarbage
void registerNavigationLevel(NavigationLevel navlevel)
private method the Navigation Level
static void dumpLayer(MsgStream &out, std::string_view head, const Layer *layer)
void indexStaticLayers(GeometrySignature geosit, int offset=0)
indexLayers : method to re-set the index of the layers, depending on geometrySignature
void compactify(MsgStream &msgstream, TrackingVolume *vol=nullptr)
Geometry Builder busineess: set all contained surfaces TG owned - this should save memory and avoid s...
const TrackingVolume * lowestTrackingVolume(const Amg::Vector3D &gp) const
return the lowest tracking Volume
const TrackingVolume * lowestStaticTrackingVolume(const Amg::Vector3D &gp) const
return the lowest static tracking Volume
void sign(GeometrySignature geosit, GeometryType geotype=Static)
Geometry Builder busineess: the geometry builder has to sign.
void synchronizeLayers(MsgStream &msgstream, TrackingVolume *vol=nullptr)
Geometry Builder business: synchronize all layers to enclosed volume dimensions.
void printVolumeInformation(MsgStream &msgstream, const TrackingVolume &tvol, int lvl) const
print VolumeInformation with Level
NavigationLevel m_navigationLevel
The Navigation level for identification.
TrackingVolume * highestTrackingVolume()
void printVolumeHierarchy(MsgStream &msgstream) const
Print the summary of volume Hierarchy of the TrackingGeometry.
size_t numBoundaryLayers() const
TrackingVolume * checkoutHighestTrackingVolume()
private method to be called from GeometryBuilder: return the world with ownership
std::map< const std::string, const TrackingVolume * > m_trackingVolumes
The Volumes in a map for later finding.
TrackingGeometry(TrackingVolume *highestVolume, NavigationLevel navlevel=globalSearch)
Constructor.
std::unique_ptr< TrackingVolume > m_world
The known world - and the beam.
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
std::string head(std::string s, const std::string &pattern)
head of a string
Eigen::Matrix< double, 3, 1 > Vector3D
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Ensure that the ATLAS eigen extensions are properly loaded.
PropDirection
PropDirection, enum for direction of the propagation.
@ alongMomentum
NavigationLevel
destinguishes an association TrackingGeometry with one for global search
FullIntersection< Layer, Surface, T > LayerIntersection
-event-from-file