Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-06 09:47:08

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Units.hpp"
0012 #include "Acts/Seeding/GbtsLayerConnection.hpp"
0013 #include "Acts/Seeding/GbtsLayerDescription.hpp"
0014 #include "Acts/Seeding/detail/GbtsLayer.hpp"
0015 #include "Acts/Utilities/Logger.hpp"
0016 
0017 #include <cstdint>
0018 #include <map>
0019 #include <span>
0020 #include <vector>
0021 
0022 namespace Acts::Experimental {
0023 
0024 class GbtsNodeStorage;
0025 class GbtsTrackingFilter;
0026 class GraphBasedTrackSeeder;
0027 
0028 /// z0 range two eta bins must share a trajectory within, which fixes the bin
0029 /// table. A separate cut from `GraphBasedTrackSeeder::Config::minZ0`.
0030 struct GbtsZ0Range final {
0031   /// Minimum z0.
0032   float min = -168.0f * UnitConstants::mm;
0033   /// Maximum z0.
0034   float max = 168.0f * UnitConstants::mm;
0035 };
0036 
0037 /// Geometry helper built from layers and connectors.
0038 class GbtsGeometry final {
0039  public:
0040   /// Constructor
0041   /// @param layerDescriptions Layer descriptions for the layers
0042   /// @param layerConnections Pairs of layers the seeder may connect
0043   /// @param etaBinWidth Width of the eta bins each layer is split into
0044   /// @param z0Range z0 range the bin table is built against
0045   /// @param logger Logging instance, only used during construction
0046   GbtsGeometry(std::span<const GbtsLayerDescription> layerDescriptions,
0047                std::span<const GbtsLayerConnection> layerConnections,
0048                float etaBinWidth, const GbtsZ0Range& z0Range = {},
0049                const Logger& logger = getDummyLogger());
0050 
0051  private:
0052   // The layer binning is shared only with the classes that build the graph.
0053   friend class GbtsNodeStorage;
0054   friend class GbtsTrackingFilter;
0055   friend class GraphBasedTrackSeeder;
0056 
0057   /// Get number of eta bins
0058   /// @return Number of eta bins
0059   std::uint32_t numBins() const { return m_nEtaBins; }
0060 
0061   /// Get bin groups
0062   /// @return Bin groups vector
0063   const std::vector<std::pair<std::uint32_t, std::vector<std::uint32_t>>>&
0064   binGroups() const {
0065     return m_binGroups;
0066   }
0067 
0068   /// Get layer by ID
0069   /// @param id Layer ID
0070   /// @return Pointer to layer or nullptr
0071   const detail::GbtsLayer* layerById(std::uint32_t id) const;
0072 
0073   /// Get layer by index
0074   /// @param idx Layer index
0075   /// @return Reference to layer
0076   const detail::GbtsLayer& layerByIndex(std::int32_t idx) const;
0077 
0078   /// Get the description of a layer by index
0079   /// @param idx Layer index
0080   /// @return Reference to the layer description
0081   const GbtsLayerDescription& layerDescriptionByIndex(std::int32_t idx) const {
0082     return layerByIndex(idx).layerDescription();
0083   }
0084 
0085   /// @param layerDescription Layer description for the layer
0086   /// @param bin0 Starting bin index
0087   /// @return Reference to the newly added layer
0088   const detail::GbtsLayer& createLayer(
0089       const GbtsLayerDescription& layerDescription, std::uint32_t bin0);
0090 
0091   /// Eta bin width
0092   float m_etaBinWidth{};
0093 
0094   /// Layer array
0095   std::vector<detail::GbtsLayer> m_layers;
0096   /// Layer per user ID map
0097   std::map<std::uint32_t, std::uint32_t> m_layerFromUserIdMap;
0098   /// Number of eta bins
0099   std::uint32_t m_nEtaBins{};
0100 
0101   /// Bin groups
0102   std::vector<std::pair<std::uint32_t, std::vector<std::uint32_t>>> m_binGroups;
0103 };
0104 
0105 }  // namespace Acts::Experimental