ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackingGeometry.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TrackingGeometry.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2019 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 
10 // TrackingGeometry.cpp, Acts project
12 
13 #include <functional>
14 
15 #include "Acts/Geometry/Layer.hpp"
20 
22  const MutableTrackingVolumePtr& highestVolume,
23  const IMaterialDecorator* materialDecorator)
24  : m_world(highestVolume),
25  m_beam(Surface::makeShared<PerigeeSurface>(s_origin)) {
26  // Close the geometry: assign geometryID and successively the material
27  size_t volumeID = 0;
28  highestVolume->closeGeometry(materialDecorator, m_trackingVolumes, volumeID);
29 }
30 
32 
34  const GeometryContext& gctx, const Acts::Vector3D& gp) const {
35  const TrackingVolume* searchVolume = m_world.get();
36  const TrackingVolume* currentVolume = nullptr;
37  while (currentVolume != searchVolume && (searchVolume != nullptr)) {
38  currentVolume = searchVolume;
39  searchVolume = searchVolume->lowestTrackingVolume(gctx, gp);
40  }
41  return currentVolume;
42 }
43 
45  const {
46  return (m_world.get());
47 }
48 
50  const std::string& name) const {
51  auto sVol = m_trackingVolumes.begin();
52  sVol = m_trackingVolumes.find(name);
53  if (sVol != m_trackingVolumes.end()) {
54  return (sVol->second);
55  }
56  return nullptr;
57 }
58 
60  const GeometryContext& gctx, const Acts::Vector3D& gp) const {
61  const TrackingVolume* lowestVol = (lowestTrackingVolume(gctx, gp));
62  return lowestVol->associatedLayer(gctx, gp);
63 }
64 
66  std::shared_ptr<const PerigeeSurface> beam) {
67  m_beam = std::move(beam);
68 }
69 
71  return m_beam.get();
72 }
73 
75  const std::function<void(const Acts::Surface*)>& visitor) const {
76  highestTrackingVolume()->visitSurfaces(visitor);
77 }