29 template <
typename external_spacepo
int_t>
34 : m_commonConfig(std::move(commonConfig)),
35 m_seedFilterConfig(seedFilterConfig),
36 m_tripletFilterConfig(tripletFilterConfig) {
55 template <
typename external_spacepo
int_t>
56 template <
typename sp_range_t>
57 std::vector<Seed<external_spacepoint_t>>
59 sp_range_t bottomSPs, sp_range_t middleSPs, sp_range_t topSPs)
const {
62 std::vector<Seed<external_spacepoint_t>> outputVec;
69 auto spVecMaker = [](sp_range_t spRange) {
70 std::vector<const Acts::InternalSpacePoint<external_spacepoint_t>*> result;
71 for (
auto* sp : spRange) {
77 std::vector<const Acts::InternalSpacePoint<external_spacepoint_t>*>
78 bottomSPVec(spVecMaker(bottomSPs));
79 std::vector<const Acts::InternalSpacePoint<external_spacepoint_t>*>
80 middleSPVec(spVecMaker(middleSPs));
81 std::vector<const Acts::InternalSpacePoint<external_spacepoint_t>*> topSPVec(
85 if ((middleSPVec.size() == 0) || (bottomSPVec.size() == 0) ||
86 (topSPVec.size() == 0)) {
92 auto bottomSPArray = make_host_array<Details::SpacePoint>(bottomSPVec.size());
93 auto middleSPArray = make_host_array<Details::SpacePoint>(middleSPVec.size());
94 auto topSPArray = make_host_array<Details::SpacePoint>(topSPVec.size());
98 for (std::size_t i = 0; i < spVec.size(); ++i) {
99 array[i].
x = spVec[i]->x();
100 array[i].
y = spVec[i]->y();
101 array[i].
z = spVec[i]->z();
102 array[i].
radius = spVec[i]->radius();
103 array[i].
varianceR = spVec[i]->varianceR();
104 array[i].
varianceZ = spVec[i]->varianceZ();
107 fillSPArray(bottomSPArray.get(), bottomSPVec);
108 fillSPArray(middleSPArray.get(), middleSPVec);
109 fillSPArray(topSPArray.get(), topSPVec);
112 auto bottomSPDeviceArray =
113 make_device_array<Details::SpacePoint>(bottomSPVec.size());
114 auto middleSPDeviceArray =
115 make_device_array<Details::SpacePoint>(middleSPVec.size());
116 auto topSPDeviceArray =
117 make_device_array<Details::SpacePoint>(topSPVec.size());
118 copyToDevice(bottomSPDeviceArray, bottomSPArray, bottomSPVec.size());
119 copyToDevice(middleSPDeviceArray, middleSPArray, middleSPVec.size());
120 copyToDevice(topSPDeviceArray, topSPArray, topSPVec.size());
128 auto dubletCountsHost = make_host_array<unsigned int>(middleSPVec.size());
129 memset(dubletCountsHost.get(), 0, middleSPVec.size() *
sizeof(
unsigned int));
130 auto middleBottomCounts = make_device_array<unsigned int>(middleSPVec.size());
131 copyToDevice(middleBottomCounts, dubletCountsHost, middleSPVec.size());
132 auto middleTopCounts = make_device_array<unsigned int>(middleSPVec.size());
133 copyToDevice(middleTopCounts, dubletCountsHost, middleSPVec.size());
137 auto middleBottomDublets =
138 make_device_array<std::size_t>(middleSPVec.size() * bottomSPVec.size());
139 auto middleTopDublets =
140 make_device_array<std::size_t>(middleSPVec.size() * topSPVec.size());
144 m_commonConfig.maxBlockSize, bottomSPVec.size(), bottomSPDeviceArray,
145 middleSPVec.size(), middleSPDeviceArray, topSPVec.size(),
146 topSPDeviceArray, m_commonConfig.deltaRMin, m_commonConfig.deltaRMax,
147 m_commonConfig.cotThetaMax, m_commonConfig.collisionRegionMin,
148 m_commonConfig.collisionRegionMax, middleBottomCounts,
149 middleBottomDublets, middleTopCounts, middleTopDublets);
155 middleBottomCounts, middleTopCounts);
158 if ((dubletCounts.nDublets == 0) || (dubletCounts.nTriplets == 0)) {
164 m_commonConfig.maxBlockSize, dubletCounts, m_seedFilterConfig,
165 m_tripletFilterConfig, bottomSPVec.size(), bottomSPDeviceArray,
166 middleSPVec.size(), middleSPDeviceArray, topSPVec.size(),
167 topSPDeviceArray, middleBottomCounts, middleBottomDublets,
168 middleTopCounts, middleTopDublets, m_commonConfig.maxScatteringAngle2,
169 m_commonConfig.sigmaScattering, m_commonConfig.minHelixDiameter2,
170 m_commonConfig.pT2perRadius, m_commonConfig.impactMax);
171 assert(tripletCandidates.size() == middleSPVec.size());
174 std::size_t middleIndex = 0;
175 auto triplet_itr = tripletCandidates.begin();
176 auto triplet_end = tripletCandidates.end();
177 for (; triplet_itr != triplet_end; ++triplet_itr, ++middleIndex) {
179 float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>
181 const auto& middleSP = *(middleSPVec[middleIndex]);
183 assert(triplet.bottomIndex < bottomSPVec.size());
184 const auto& bottomSP = *(bottomSPVec[triplet.bottomIndex]);
185 assert(triplet.topIndex < topSPVec.size());
186 const auto& topSP = *(topSPVec[triplet.topIndex]);
187 seedsPerSPM.emplace_back(std::make_pair(
190 bottomSP, middleSP, topSP, 0)));
192 m_commonConfig.seedFilter->filterSeeds_1SpFixed(seedsPerSPM, outputVec);