Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackingGeometry.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackingGeometry.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
18 
19 #include <memory>
20 #include <string>
21 #include <unordered_map>
22 #include <utility>
23 
24 namespace Acts {
25 
26 class Layer;
27 class Surface;
28 class PerigeeSurface;
29 class IMaterialDecorator;
30 class TrackingVolume;
31 
32 using TrackingVolumePtr = std::shared_ptr<const TrackingVolume>;
33 using MutableTrackingVolumePtr = std::shared_ptr<TrackingVolume>;
34 
46 
47  public:
55  TrackingGeometry(const MutableTrackingVolumePtr& highestVolume,
56  const IMaterialDecorator* materialDecorator = nullptr,
57  const GeometryIdentifierHook& hook = {},
58  const Logger& logger = getDummyLogger());
59 
62 
66 
69  const std::shared_ptr<const TrackingVolume>& highestTrackingVolumeShared()
70  const;
71 
79  const Vector3& gp) const;
80 
88  const Vector3& gp) const;
89 
93  void registerBeamTube(std::shared_ptr<const PerigeeSurface> beam);
94 
101  const Surface* getBeamline() const;
102 
109  template <ACTS_CONCEPT(SurfaceVisitor) visitor_t>
110  void visitSurfaces(visitor_t&& visitor) const {
111  highestTrackingVolume()->template visitSurfaces<visitor_t>(
112  std::forward<visitor_t>(visitor));
113  }
114 
121 
127  const Surface* findSurface(GeometryIdentifier id) const;
128 
129  private:
130  // the known world
132  // beam line
133  std::shared_ptr<const PerigeeSurface> m_beam;
134  // lookup containers
135  std::unordered_map<GeometryIdentifier, const TrackingVolume*> m_volumesById;
136  std::unordered_map<GeometryIdentifier, const Surface*> m_surfacesById;
137 };
138 
139 } // namespace Acts