File indexing completed on 2025-01-19 09:23:34
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/TrackParametrization.hpp"
0012 #include "Acts/EventData/SourceLink.hpp"
0013 #include "Acts/Geometry/GeometryContext.hpp"
0014 #include "Acts/Geometry/TrackingGeometry.hpp"
0015 #include "Acts/SpacePointFormation/SpacePointBuilderConfig.hpp"
0016 #include "Acts/SpacePointFormation/SpacePointBuilderOptions.hpp"
0017 #include "Acts/Surfaces/Surface.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019 #include "Acts/Utilities/SpacePointUtility.hpp"
0020
0021 #include <boost/container/static_vector.hpp>
0022
0023 namespace Acts {
0024
0025
0026
0027
0028
0029
0030
0031 template <typename spacepoint_t>
0032 class SpacePointBuilder {
0033 public:
0034 using BuilderFunction = std::function<spacepoint_t(
0035 Acts::Vector3, std::optional<double>, Acts::Vector2,
0036 std::optional<double>, boost::container::static_vector<SourceLink, 2>)>;
0037
0038
0039
0040
0041
0042 SpacePointBuilder(const SpacePointBuilderConfig& cfg, BuilderFunction func,
0043 std::unique_ptr<const Logger> logger =
0044 getDefaultLogger("SpacePointBuilder", Logging::INFO));
0045
0046
0047 SpacePointBuilder() = default;
0048
0049
0050
0051
0052
0053
0054
0055
0056 template <template <typename...> typename container_t>
0057 void buildSpacePoint(
0058 const GeometryContext& gctx, const std::vector<SourceLink>& sourceLinks,
0059 const SpacePointBuilderOptions& opt,
0060 std::back_insert_iterator<container_t<spacepoint_t>> spacePointIt) const;
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 void makeSourceLinkPairs(
0071 const GeometryContext& gctx, const std::vector<SourceLink>& slinksFront,
0072 const std::vector<SourceLink>& slinksBack,
0073 std::vector<std::pair<SourceLink, SourceLink>>& slinkPairs,
0074 const StripPairOptions& pairOpt) const;
0075
0076 protected:
0077
0078 SpacePointBuilderConfig m_config;
0079
0080
0081
0082
0083 BuilderFunction m_spConstructor;
0084
0085
0086 std::unique_ptr<const Acts::Logger> m_logger;
0087
0088 std::shared_ptr<const SpacePointUtility> m_spUtility;
0089
0090 const Logger& logger() const { return *m_logger; }
0091 };
0092
0093 }
0094
0095 #include "Acts/SpacePointFormation/detail/SpacePointBuilder.ipp"