Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-13 07:57:33

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/EventData/SourceLink.hpp"
0012 #include "Acts/Geometry/GeometryContext.hpp"
0013 #include "Acts/SpacePointFormation/SpacePointBuilderConfig.hpp"
0014 #include "Acts/SpacePointFormation/SpacePointBuilderOptions.hpp"
0015 #include "Acts/Utilities/Diagnostics.hpp"
0016 #include "Acts/Utilities/Logger.hpp"
0017 #include "Acts/Utilities/SpacePointUtility.hpp"
0018 
0019 #include <boost/container/static_vector.hpp>
0020 
0021 ACTS_PUSH_IGNORE_DEPRECATED()
0022 
0023 namespace Acts {
0024 
0025 /// @class SpacePointBuilder
0026 ///
0027 /// After the particle interaction with surfaces are recorded and digitized
0028 /// measurements on the pixel or strip detectors need further treatment. This
0029 /// class takes the SouceLinks and provides the corresponding space points.
0030 ///
0031 template <typename space_point_t>
0032 class [[deprecated(
0033     "Will be dropped soon and is replaced by PixelSpacePointBuilder / "
0034     "StripSpacePointBuilder")]] SpacePointBuilder {
0035  public:
0036   /// Type alias for space point builder function
0037   using BuilderFunction = std::function<space_point_t(
0038       Acts::Vector3, std::optional<double>, Acts::Vector2,
0039       std::optional<double>, boost::container::static_vector<SourceLink, 2>)>;
0040 
0041   // Constructor
0042   /// @param cfg The configuration for the space point builder
0043   /// @param func The function that provides user's SP constructor with global pos, global cov, and sourceLinks.
0044   /// @param logger The logging instance
0045   SpacePointBuilder(const SpacePointBuilderConfig& cfg,
0046                     const BuilderFunction& func,
0047                     std::unique_ptr<const Logger> logger =
0048                         getDefaultLogger("SpacePointBuilder", Logging::INFO));
0049 
0050   // Default constructor
0051   SpacePointBuilder() = default;
0052 
0053   /// @brief Calculates the space points out of a given collection of SourceLinks
0054   /// and stores the results
0055   ///
0056   /// @param gctx The current geometry context object, e.g. alignment
0057   /// @param sourceLinks vector of Sourcelink
0058   /// @param opt option for the space point building. It contains the ends of the strips for strip SP building
0059   /// @param spacePointIt Output iterator for the space point
0060   template <template <typename...> typename container_t>
0061   void buildSpacePoint(
0062       const GeometryContext& gctx, const std::vector<SourceLink>& sourceLinks,
0063       const SpacePointBuilderOptions& opt,
0064       std::back_insert_iterator<container_t<space_point_t>> spacePointIt) const;
0065 
0066   /// @brief Searches possible combinations of two SourceLinks on different
0067   /// surfaces that may come from the same particles
0068   ///
0069   /// @param gctx The current geometry context object, e.g. alignment
0070   /// @param slinksFront vector of Sourcelinks on a surface
0071   /// @param slinksBack vector of SoruceLinks on another surface
0072   /// @param slinkPairs storage of the SouceLink pairs
0073   /// @param pairOpt pair maker option with paramCovAccessor
0074   void makeSourceLinkPairs(
0075       const GeometryContext& gctx, const std::vector<SourceLink>& slinksFront,
0076       const std::vector<SourceLink>& slinksBack,
0077       std::vector<std::pair<SourceLink, SourceLink>>& slinkPairs,
0078       const StripPairOptions& pairOpt) const;
0079 
0080  protected:
0081   /// Configuration of the single hit space point builder
0082   SpacePointBuilderConfig m_config;
0083 
0084   /// @brief Function to create external space point
0085   /// The constructor of space_point_t with Vector3 global pos, Vector2 global
0086   /// cov, and vector of source link pointers.
0087   BuilderFunction m_spConstructor;
0088 
0089   /// the logging instance
0090   std::unique_ptr<const Acts::Logger> m_logger;
0091 
0092   /// Utility for space point calculations
0093   std::shared_ptr<const SpacePointUtility> m_spUtility;
0094 
0095   /// Get the logger instance
0096   /// @return Reference to the logger
0097   const Logger& logger() const { return *m_logger; }
0098 };
0099 
0100 }  // namespace Acts
0101 
0102 #include "Acts/SpacePointFormation/SpacePointBuilder.ipp"
0103 
0104 ACTS_POP_IGNORE_DEPRECATED()