Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:27:39

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2020 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 http://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/BinningType.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   using SortingConfig = std::pair<BinningValue, double>;
0034 
0035   struct Config {};
0036 
0037   /// Constructor with explicit config
0038   ///
0039   /// @param logger logging instance
0040   ProtoLayerHelper(const Config& /*config*/,
0041                    std::unique_ptr<const Logger> logger =
0042                        getDefaultLogger("ProtoLayerHelper", Logging::INFO))
0043       : m_logger(std::move(logger)) {}
0044   ~ProtoLayerHelper() = default;
0045 
0046   /// Sort the surfaces into ProtoLayers
0047   ///
0048   /// @param gctx The geometry context (usually building context at this stage)
0049   /// @param surfaces The surfaces to be sorted into arrays
0050   /// @param sorting The sorting setup, one single sorting
0051   ///
0052   /// @return A vector of ProtoLayers
0053   std::vector<ProtoLayer> protoLayers(
0054       const GeometryContext& gctx, const std::vector<const Surface*>& surfaces,
0055       const SortingConfig& sorting) const;
0056 
0057   /// Sort the surfaces into ProtoLayers, sequential sorting
0058   ///
0059   /// @param gctx The geometry context (usually building context at this stage)
0060   /// @param surfaces The surfaces to be sorted into arrays
0061   /// @param sortings The sequential sorting setup
0062   ///
0063   /// @return A vector of ProtoLayers
0064   std::vector<ProtoLayer> protoLayers(
0065       const GeometryContext& gctx, const std::vector<const Surface*>& surfaces,
0066       const std::vector<SortingConfig>& sortings) const;
0067 
0068  private:
0069   /// Logging instance
0070   std::unique_ptr<const Logger> m_logger;
0071 
0072   /// Private access to logger
0073   const Logger& logger() const { return *m_logger; }
0074 };
0075 
0076 }  // namespace Acts