ATLAS Offline Software
TrackingGeometry.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 namespace Trk {
5 
6 inline const TrackingVolume*
7 TrackingGeometry::highestTrackingVolume() const
8 {
9  return m_world;
10 }
11 
12 inline TrackingVolume*
13 TrackingGeometry::highestTrackingVolume()
14 {
15  return m_world;
16 }
17 
18 inline NavigationLevel
19 TrackingGeometry::navigationLevel() const
20 {
21  return m_navigationLevel;
22 }
23 
24 inline void
25 TrackingGeometry::registerNavigationLevel(NavigationLevel navLevel)
26 {
27  m_navigationLevel = navLevel;
28 }
29 
30 inline void
31 TrackingGeometry::sign(GeometrySignature geosit, GeometryType geotype)
32 {
33  m_world->sign(geosit, geotype);
34 }
35 
36 inline const TrackingVolume*
37 TrackingGeometry::trackingVolume(const std::string& name) const
38 {
39  std::map<const std::string, const TrackingVolume*>::const_iterator sVol =
40  m_trackingVolumes.begin();
41  sVol = m_trackingVolumes.find(name);
42  if (sVol != m_trackingVolumes.end()) {
43  return (sVol->second);
44  }
45  return nullptr;
46 }
47 
48 inline const Trk::Layer*
49 TrackingGeometry::associatedLayer(const Amg::Vector3D& gp) const
50 {
51  const TrackingVolume* lowestVol = (lowestTrackingVolume(gp));
52  return lowestVol->associatedLayer(gp);
53 }
54 
55 inline const Trk::Layer*
56 TrackingGeometry::nextLayer(const Amg::Vector3D& gp,
57  const Amg::Vector3D& mom,
58  bool skipNavLayer) const
59 {
60  const TrackingVolume* lowestVol = (lowestTrackingVolume(gp));
61  return lowestVol->nextLayer(gp, mom, true, skipNavLayer);
62 }
63 
64 inline const std::map<Layer*, int>&
65 TrackingGeometry::boundaryLayers()
66 {
67  return m_boundaryLayers;
68 }
69 
70 inline auto TrackingGeometry::boundaryLayers() const {
71  return std::views::transform(m_boundaryLayers, [](const auto& in) {
72  return std::pair<const Layer*, int>{in.first, in.second};
73  });
74 }
75 
76 inline size_t
77 TrackingGeometry::numBoundaryLayers() const
78 {
79  return m_boundaryLayers.size();
80 }
81 
82 template<class T>
83 LayerIntersection<Amg::Vector3D>
84 TrackingGeometry::closestMaterialLayer(const T& pars,
85  PropDirection pDir,
86  const BoundaryCheck& bchk) const
87 {
88  const TrackingVolume* lowestVol = (lowestTrackingVolume(pars.position()));
89  return (lowestVol) ? (lowestVol->closestMaterialLayer(
90  pars.position(), pars.momentum().unit(), pDir, bchk))
91  : Trk::LayerIntersection<Amg::Vector3D>(
92  Trk::Intersection(pars.position(), 10e10, false),
93  nullptr,
94  nullptr,
95  nullptr);
96 }
97 
98 } // namespace Trk