File indexing completed on 2025-12-13 09:39:03
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/EventData/Types.hpp"
0012
0013 #include <limits>
0014 #include <vector>
0015
0016 namespace Acts {
0017
0018
0019 struct TripletCandidate2 {
0020
0021 TripletCandidate2() = default;
0022
0023
0024
0025
0026
0027
0028
0029
0030 TripletCandidate2(SpacePointIndex2 b, SpacePointIndex2 m, SpacePointIndex2 t,
0031 float w, float z, bool q)
0032 : bottom(b), middle(m), top(t), weight(w), zOrigin(z), isQuality(q) {}
0033
0034 SpacePointIndex2 bottom{};
0035 SpacePointIndex2 middle{};
0036 SpacePointIndex2 top{};
0037 float weight{};
0038 float zOrigin{};
0039 bool isQuality{};
0040 };
0041
0042 class CandidatesForMiddleSp2 {
0043 public:
0044 using Index = std::uint32_t;
0045 using Size = std::uint32_t;
0046
0047 static constexpr Size kNoSize = std::numeric_limits<Size>::max();
0048
0049 CandidatesForMiddleSp2();
0050
0051
0052
0053
0054 CandidatesForMiddleSp2(Size nLow, Size nHigh);
0055
0056 Size size() const { return m_storage.size(); }
0057
0058
0059 void clear();
0060
0061
0062
0063 Size nLowQualityCandidates() const {
0064 return static_cast<Size>(m_indicesLow.size());
0065 }
0066
0067
0068
0069 Size nHighQualityCandidates() const {
0070 return static_cast<Size>(m_indicesHigh.size());
0071 }
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082 bool push(SpacePointIndex2 spB, SpacePointIndex2 spM, SpacePointIndex2 spT,
0083 float weight, float zOrigin, bool isQuality);
0084
0085
0086
0087 void toSortedCandidates(std::vector<TripletCandidate2>& output);
0088
0089 private:
0090 using WeightIndex = std::pair<float, Index>;
0091 using Container = std::vector<WeightIndex>;
0092
0093 static constexpr bool comparator(const WeightIndex& a, const WeightIndex& b) {
0094 return a.first > b.first;
0095 }
0096
0097
0098
0099
0100 Size m_maxSizeLow{kNoSize};
0101 Size m_maxSizeHigh{kNoSize};
0102
0103
0104 std::vector<TripletCandidate2> m_storage;
0105
0106 Container m_indicesLow;
0107 Container m_indicesHigh;
0108
0109 bool push(Container& container, Size nMax, SpacePointIndex2 spB,
0110 SpacePointIndex2 spM, SpacePointIndex2 spT, float weight,
0111 float zOrigin, bool isQuality);
0112 };
0113
0114 }