Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-27 08:30:34

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/Seeding/GbtsLayerConnection.hpp"
0012 #include "Acts/Seeding/GbtsLayerDescription.hpp"
0013 #include "Acts/Seeding/detail/GbtsLayer.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 
0016 #include <cstdint>
0017 #include <map>
0018 #include <vector>
0019 
0020 namespace Acts::Experimental {
0021 
0022 class GbtsNodeStorage;
0023 class GbtsTrackingFilter;
0024 class GraphBasedTrackSeeder;
0025 
0026 /// Geometry helper built from layers and connectors.
0027 class GbtsGeometry final {
0028  public:
0029   /// Constructor
0030   /// @param layerDescriptions Layer descriptions for the layers
0031   /// @param layerConnections Layer connections map
0032   /// @param logger Logging instance, only used during construction
0033   GbtsGeometry(const std::vector<GbtsLayerDescription>& layerDescriptions,
0034                const GbtsLayerConnectionMap& layerConnections,
0035                const Logger& logger = getDummyLogger());
0036 
0037  private:
0038   // The layer binning is shared only with the classes that build the graph.
0039   friend class GbtsNodeStorage;
0040   friend class GbtsTrackingFilter;
0041   friend class GraphBasedTrackSeeder;
0042 
0043   /// Get number of eta bins
0044   /// @return Number of eta bins
0045   std::uint32_t numBins() const { return m_nEtaBins; }
0046 
0047   /// Get bin groups
0048   /// @return Bin groups vector
0049   const std::vector<std::pair<std::uint32_t, std::vector<std::uint32_t>>>&
0050   binGroups() const {
0051     return m_binGroups;
0052   }
0053 
0054   /// Get layer by ID
0055   /// @param id Layer ID
0056   /// @return Pointer to layer or nullptr
0057   const detail::GbtsLayer* layerById(std::uint32_t id) const;
0058 
0059   /// Get layer by index
0060   /// @param idx Layer index
0061   /// @return Reference to layer
0062   const detail::GbtsLayer& layerByIndex(std::int32_t idx) const;
0063 
0064   /// Get layer ID by index
0065   /// @param idx Layer index
0066   /// @return Layer ID
0067   std::uint32_t layerIdByIndex(std::uint32_t idx) const {
0068     return m_layers.at(idx).layerDescription().id;
0069   }
0070 
0071   /// @param layerDescription Layer description for the layer
0072   /// @param bin0 Starting bin index
0073   /// @return Reference to the newly added layer
0074   const detail::GbtsLayer& createLayer(
0075       const GbtsLayerDescription& layerDescription, std::uint32_t bin0);
0076 
0077   /// Eta bin width
0078   float m_etaBinWidth{};
0079 
0080   /// Layer array
0081   std::vector<detail::GbtsLayer> m_layers;
0082   /// Layer per user ID map
0083   std::map<std::uint32_t, std::uint32_t> m_layerFromUserIdMap;
0084   /// Number of eta bins
0085   std::uint32_t m_nEtaBins{};
0086 
0087   /// Bin groups
0088   std::vector<std::pair<std::uint32_t, std::vector<std::uint32_t>>> m_binGroups;
0089 };
0090 
0091 }  // namespace Acts::Experimental