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 TrackingGeometry::constMapRange_t
71 TrackingGeometry::boundaryLayers() const
72 {
73  iterator_convert_const_t begin = boost::make_transform_iterator(
74  m_boundaryLayers.begin(), constTransformLayerMap());
75 
76  iterator_convert_const_t end = boost::make_transform_iterator(
77  m_boundaryLayers.end(), constTransformLayerMap());
78 
79  return TrackingGeometry::constMapRange_t(begin, end);
80 }
81 
82 inline size_t
83 TrackingGeometry::numBoundaryLayers() const
84 {
85  return m_boundaryLayers.size();
86 }
87 
88 template<class T>
89 LayerIntersection<Amg::Vector3D>
90 TrackingGeometry::closestMaterialLayer(const T& pars,
91  PropDirection pDir,
92  const BoundaryCheck& bchk) const
93 {
94  const TrackingVolume* lowestVol = (lowestTrackingVolume(pars.position()));
95  return (lowestVol) ? (lowestVol->closestMaterialLayer(
96  pars.position(), pars.momentum().unit(), pDir, bchk))
97  : Trk::LayerIntersection<Amg::Vector3D>(
98  Trk::Intersection(pars.position(), 10e10, false),
99  nullptr,
100  nullptr,
101  nullptr);
102 }
103 
104 } // namespace Trk