File indexing completed on 2025-12-16 09:41:31
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/EventData/Seed.hpp"
0012 #include "Acts/EventData/SpacePointMutableData.hpp"
0013 #include "Acts/Seeding/CandidatesForMiddleSp.hpp"
0014 #include "Acts/Seeding/Neighbour.hpp"
0015 #include "Acts/Seeding/SeedFilter.hpp"
0016 #include "Acts/Seeding/SeedFinderConfig.hpp"
0017 #include "Acts/Seeding/SeedFinderUtils.hpp"
0018 #include "Acts/Seeding/detail/UtilityFunctions.hpp"
0019 #include "Acts/Utilities/Logger.hpp"
0020 #include "Acts/Utilities/RangeXD.hpp"
0021
0022 #include <memory>
0023 #include <ranges>
0024 #include <string>
0025 #include <utility>
0026 #include <vector>
0027
0028 namespace Acts {
0029
0030 template <typename Coll>
0031 concept GridBinCollection =
0032 std::ranges::random_access_range<Coll> &&
0033 std::same_as<typename Coll::value_type, std::size_t>;
0034
0035 template <typename collection_t, typename external_t, std::size_t N = 3ul>
0036 concept CollectionStoresSeedsTo =
0037 requires(collection_t coll, Seed<external_t, N> seed) {
0038 detail::pushBackOrInsertAtEnd(coll, seed);
0039 };
0040
0041
0042 enum class SpacePointCandidateType : short { eBottom, eTop };
0043
0044
0045 enum class DetectorMeasurementInfo : short { eDefault, eDetailed };
0046
0047 template <typename external_spacepoint_t, typename grid_t,
0048 typename platform_t = void*>
0049 class SeedFinder {
0050 public:
0051 struct SeedingState {
0052
0053 std::vector<const external_spacepoint_t*> compatBottomSP{};
0054 std::vector<const external_spacepoint_t*> compatTopSP{};
0055
0056
0057 std::vector<LinCircle> linCircleBottom{};
0058
0059 std::vector<LinCircle> linCircleTop{};
0060
0061
0062 std::vector<const external_spacepoint_t*> topSpVec{};
0063 std::vector<float> curvatures{};
0064 std::vector<float> impactParameters{};
0065
0066
0067 CandidatesForMiddleSp<const external_spacepoint_t> candidatesCollector{};
0068
0069
0070 boost::container::small_vector<Neighbour<grid_t>,
0071 detail::ipow(3, grid_t::DIM)>
0072 bottomNeighbours{};
0073 boost::container::small_vector<Neighbour<grid_t>,
0074 detail::ipow(3, grid_t::DIM)>
0075 topNeighbours{};
0076
0077
0078 SpacePointMutableData spacePointMutableData{};
0079 };
0080
0081 SeedFinder() = default;
0082
0083
0084
0085
0086 explicit SeedFinder(const SeedFinderConfig<external_spacepoint_t>& config,
0087 std::unique_ptr<const Logger> logger =
0088 getDefaultLogger("Finder", Logging::Level::INFO));
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102 template <typename container_t, GridBinCollection sp_range_t>
0103 requires CollectionStoresSeedsTo<container_t, external_spacepoint_t, 3ul>
0104 void createSeedsForGroup(const SeedFinderOptions& options,
0105 SeedingState& state, const grid_t& grid,
0106 container_t& outputCollection,
0107 const sp_range_t& bottomSPs,
0108 const std::size_t middleSPs,
0109 const sp_range_t& topSPs,
0110 const Range1D<float>& rMiddleSPRange) const;
0111
0112 private:
0113
0114
0115
0116
0117
0118
0119 std::pair<float, float> retrieveRadiusRangeForMiddle(
0120 const external_spacepoint_t& spM,
0121 const Range1D<float>& rMiddleSPRange) const;
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138 template <SpacePointCandidateType candidateType, typename out_range_t>
0139 void getCompatibleDoublets(
0140 const SeedFinderOptions& options, const grid_t& grid,
0141 SpacePointMutableData& mutableData,
0142 boost::container::small_vector<
0143 Neighbour<grid_t>, detail::ipow(3, grid_t::DIM)>& otherSPsNeighbours,
0144 const external_spacepoint_t& mediumSP,
0145 std::vector<LinCircle>& linCircleVec, out_range_t& outVec,
0146 const float deltaRMinSP, const float deltaRMaxSP, const float uIP,
0147 const float uIP2, const float cosPhiM, const float sinPhiM) const;
0148
0149
0150
0151
0152
0153
0154
0155 template <DetectorMeasurementInfo detailedMeasurement>
0156 void filterCandidates(const external_spacepoint_t& spM,
0157 const SeedFinderOptions& options,
0158 SeedFilterState& seedFilterState,
0159 SeedingState& state) const;
0160
0161 private:
0162 const Logger& logger() const { return *m_logger; }
0163
0164 SeedFinderConfig<external_spacepoint_t> m_config;
0165 std::unique_ptr<const Logger> m_logger;
0166 };
0167
0168 }
0169
0170 #ifndef DOXYGEN
0171 #include "Acts/Seeding/SeedFinder.ipp"
0172 #endif