Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-27 07:55:11

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/Geometry/GeometryContext.hpp"
0012 #include "Acts/Geometry/ProtoLayer.hpp"
0013 #include "Acts/Utilities/AxisDefinitions.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 
0016 #include <memory>
0017 #include <utility>
0018 #include <vector>
0019 
0020 namespace Acts {
0021 
0022 class Surface;
0023 struct ProtoLayer;
0024 
0025 /// @class ProtoLayerHelper
0026 ///
0027 /// This class is designed to parse a vector of Surfaces and sort them
0028 /// into corresponding proto layers.
0029 ///
0030 /// @todo write more documentation on how this is done
0031 class ProtoLayerHelper {
0032  public:
0033   /// Type alias for sorting configuration with axis direction and tolerance
0034   using SortingConfig = std::pair<AxisDirection, double>;
0035 
0036   struct Config {};
0037 
0038   /// Constructor with explicit config
0039   ///
0040   /// @param logger logging instance
0041   explicit ProtoLayerHelper(const Config& /*config*/,
0042                             std::unique_ptr<const Logger> logger =
0043                                 getDefaultLogger("ProtoLayerHelper",
0044                                                  Logging::INFO))
0045       : m_logger(std::move(logger)) {}
0046   ~ProtoLayerHelper() = default;
0047 
0048   /// Sort the surfaces into ProtoLayers
0049   ///
0050   /// @param gctx The geometry context (usually building context at this stage)
0051   /// @param surfaces The surfaces to be sorted into arrays
0052   /// @param sorting The sorting setup, one single sorting
0053   ///
0054   /// @return A vector of ProtoLayers
0055   std::vector<ProtoLayer> protoLayers(
0056       const GeometryContext& gctx, const std::vector<const Surface*>& surfaces,
0057       const SortingConfig& sorting) const;
0058 
0059   /// Sort the surfaces into ProtoLayers, sequential sorting
0060   ///
0061   /// @param gctx The geometry context (usually building context at this stage)
0062   /// @param surfaces The surfaces to be sorted into arrays
0063   /// @param sortings The sequential sorting setup
0064   ///
0065   /// @return A vector of ProtoLayers
0066   std::vector<ProtoLayer> protoLayers(
0067       const GeometryContext& gctx, const std::vector<const Surface*>& surfaces,
0068       const std::vector<SortingConfig>& sortings) const;
0069 
0070  private:
0071   /// Logging instance
0072   std::unique_ptr<const Logger> m_logger;
0073 
0074   /// Private access to logger
0075   const Logger& logger() const { return *m_logger; }
0076 };
0077 
0078 }  // namespace Acts