File indexing completed on 2025-01-18 09:10:52
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Detector/ProtoDetector.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Geometry/GeometryIdentifier.hpp"
0015 #include "Acts/Geometry/ITrackingGeometryBuilder.hpp"
0016 #include "Acts/Geometry/TrackingGeometryBuilder.hpp"
0017 #include "Acts/Utilities/KDTree.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019
0020 #include <array>
0021 #include <cstddef>
0022 #include <memory>
0023 #include <string>
0024 #include <vector>
0025
0026 namespace Acts {
0027
0028 class TrackingGeometry;
0029 class Layer;
0030 class LayerCreator;
0031 class Surface;
0032 class ITrackingVolumeHelper;
0033 class TrackingVolume;
0034
0035
0036
0037
0038
0039
0040
0041 class KDTreeTrackingGeometryBuilder : public ITrackingGeometryBuilder {
0042 public:
0043
0044 struct Config {
0045
0046 std::shared_ptr<const ITrackingVolumeHelper> trackingVolumeHelper = nullptr;
0047
0048 std::shared_ptr<const LayerCreator> layerCreator = nullptr;
0049
0050 std::vector<std::shared_ptr<Surface>> surfaces = {};
0051
0052 ProtoDetector protoDetector;
0053
0054 std::shared_ptr<const GeometryIdentifierHook> geometryIdentifierHook =
0055 std::make_shared<GeometryIdentifierHook>();
0056
0057 std::string hierarchyIndent = " ";
0058 };
0059
0060 using SurfaceKDT =
0061 KDTree<2u, std::shared_ptr<Surface>, double, std::array, 100>;
0062
0063
0064
0065
0066
0067 KDTreeTrackingGeometryBuilder(
0068 const Config& cfg,
0069 std::unique_ptr<const Logger> logger =
0070 getDefaultLogger("KDTreeTrackingGeometryBuilder", Logging::INFO));
0071
0072
0073
0074
0075
0076
0077 std::unique_ptr<const TrackingGeometry> trackingGeometry(
0078 const GeometryContext& gctx) const final;
0079
0080 private:
0081
0082 Config m_cfg;
0083
0084
0085 const Logger& logger() const { return *m_logger; }
0086
0087
0088 std::unique_ptr<const Logger> m_logger;
0089
0090
0091 struct Cache {
0092 std::size_t surfaceCounter = 0;
0093 };
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104 std::shared_ptr<TrackingVolume> translateVolume(
0105 Cache& cCache, const GeometryContext& gctx, const SurfaceKDT& kdt,
0106 const ProtoVolume& ptVolume, const std::string& indent = "") const;
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117 std::shared_ptr<const Layer> translateLayer(
0118 Cache& cCache, const GeometryContext& gctx, const SurfaceKDT& kdt,
0119 const ProtoVolume& plVolume, const std::string& indent = "") const;
0120 };
0121
0122 }