Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KDTreeTrackingGeometryBuilder.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file KDTreeTrackingGeometryBuilder.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2022 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 
19 
20 #include <array>
21 #include <cstddef>
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 namespace Acts {
27 
28 class TrackingGeometry;
29 class Layer;
30 class LayerCreator;
31 class Surface;
32 class ITrackingVolumeHelper;
33 class TrackingVolume;
34 
42  public:
44  struct Config {
46  std::shared_ptr<const ITrackingVolumeHelper> trackingVolumeHelper = nullptr;
48  std::shared_ptr<const LayerCreator> layerCreator = nullptr;
50  std::vector<std::shared_ptr<Surface>> surfaces = {};
54  std::shared_ptr<const GeometryIdentifierHook> geometryIdentifierHook =
55  std::make_shared<GeometryIdentifierHook>();
58  };
59 
60  using SurfaceKDT =
62 
68  const Config& cfg,
69  std::unique_ptr<const Logger> logger =
70  getDefaultLogger("KDTreeTrackingGeometryBuilder", Logging::INFO));
71 
77  std::unique_ptr<const TrackingGeometry> trackingGeometry(
78  const GeometryContext& gctx) const final;
79 
80  private:
83 
85  const Logger& logger() const { return *m_logger; }
86 
88  std::unique_ptr<const Logger> m_logger;
89 
91  struct Cache {
92  size_t surfaceCounter = 0;
93  };
94 
104  std::shared_ptr<TrackingVolume> translateVolume(
105  Cache& cCache, const GeometryContext& gctx, const SurfaceKDT& kdt,
106  const ProtoVolume& ptVolume, const std::string& indent = "") const;
107 
117  std::shared_ptr<const Layer> translateLayer(
118  Cache& cCache, const GeometryContext& gctx, const SurfaceKDT& kdt,
119  const ProtoVolume& plVolume, const std::string& indent = "") const;
120 };
121 
122 } // namespace Acts