33 namespace ActsExamples {
34 struct AlgorithmContext;
54 throw std::invalid_argument(
"Missing space point input collections");
59 throw std::invalid_argument(
"Invalid space point input collection");
66 handle->initialize(spName);
69 throw std::invalid_argument(
"Missing seeds output collection");
76 throw std::invalid_argument(
77 "Inconsistent config rMax: using different values in gridConfig and "
78 "seedFinderConfig. If values are intentional set allowSeparateRMax to "
83 throw std::invalid_argument(
"Inconsistent config deltaRMin");
87 throw std::invalid_argument(
"Inconsistent config deltaRMax");
93 "Value of deltaRMaxTopSP must support NaN values");
98 "Value of deltaRMinTopSP must support NaN values");
103 "Value of deltaRMaxBottomSP must support NaN values");
108 "Value of deltaRMinBottomSP must support NaN values");
127 throw std::invalid_argument(
"Inconsistent config zMin");
131 throw std::invalid_argument(
"Inconsistent config zMax");
136 throw std::invalid_argument(
"Inconsistent config maxSeedsPerSpM");
140 throw std::invalid_argument(
"Inconsistent config cotThetaMax");
144 throw std::invalid_argument(
"Inconsistent config minPt");
148 throw std::invalid_argument(
"Inconsistent config bFieldInZ");
153 throw std::invalid_argument(
"Inconsistent config zBinNeighborsTop");
159 throw std::invalid_argument(
"Inconsistent config zBinNeighborsBottom");
169 throw std::invalid_argument(
170 "Inconsistent config zBinsCustomLooping does not contain the same "
171 "bins as zBinEdges");
210 m_topBinFinder = std::make_shared<const Acts::BinFinder<SimSpacePoint>>(
223 size_t nSpacePoints = 0;
224 for (
const auto& isp : m_inputSpacePoints) {
225 nSpacePoints += (*isp)(ctx).
size();
228 std::vector<const SimSpacePoint*> spacePointPtrs;
229 spacePointPtrs.reserve(nSpacePoints);
230 for (
const auto& isp : m_inputSpacePoints) {
231 for (
const auto& spacePoint : (*isp)(ctx)) {
235 spacePointPtrs.push_back(&spacePoint);
241 auto extractGlobalQuantities =
243 float) -> std::pair<Acts::Vector3, Acts::Vector2> {
252 auto grid = Acts::SpacePointGridCreator::createGrid<SimSpacePoint>(
256 spacePointPtrs.begin(), spacePointPtrs.end(), extractGlobalQuantities,
257 m_bottomBinFinder, m_topBinFinder,
std::move(
grid), rRangeSPExtent,
258 m_cfg.seedFinderConfig,
m_cfg.seedFinderOptions);
261 float up = Acts::clampValue<float>(
262 std::floor(rRangeSPExtent.max(
Acts::binR) / 2) * 2);
266 std::floor(rRangeSPExtent.min(
Acts::binR) / 2) * 2 +
267 m_cfg.seedFinderConfig.deltaRMiddleMinSPRange,
268 up -
m_cfg.seedFinderConfig.deltaRMiddleMaxSPRange);
273 static thread_local decltype(m_seedFinder)::SeedingState
state;
274 state.spacePointData.resize(
275 spacePointPtrs.size(),
276 m_cfg.seedFinderConfig.useDetailedDoubleMeasurementInfo);
278 if (
m_cfg.seedFinderConfig.useDetailedDoubleMeasurementInfo) {
279 for (std::size_t grid_glob_bin(0);
280 grid_glob_bin < spacePointsGrouping.grid().size(); ++grid_glob_bin) {
281 const auto& collection = spacePointsGrouping.grid().at(grid_glob_bin);
282 for (
const auto& sp : collection) {
283 std::size_t
index = sp->index();
285 const float topHalfStripLength =
286 m_cfg.seedFinderConfig.getTopHalfStripLength(sp->sp());
287 const float bottomHalfStripLength =
288 m_cfg.seedFinderConfig.getBottomHalfStripLength(sp->sp());
290 m_cfg.seedFinderConfig.getTopStripDirection(sp->sp());
292 m_cfg.seedFinderConfig.getBottomStripDirection(sp->sp());
294 state.spacePointData.setTopStripVector(
295 index, topHalfStripLength * topStripDirection);
296 state.spacePointData.setBottomStripVector(
297 index, bottomHalfStripLength * bottomStripDirection);
298 state.spacePointData.setStripCenterDistance(
299 index,
m_cfg.seedFinderConfig.getStripCenterDistance(sp->sp()));
300 state.spacePointData.setTopStripCenterPosition(
301 index,
m_cfg.seedFinderConfig.getTopStripCenterPosition(sp->sp()));
306 for (
const auto [bottom, middle, top] : spacePointsGrouping) {
307 m_seedFinder.createSeedsForGroup(
308 m_cfg.seedFinderOptions, state, spacePointsGrouping.grid(),
309 std::back_inserter(seeds), bottom, middle, top, rMiddleSPRange);
312 ACTS_DEBUG(
"Created " << seeds.size() <<
" track seeds from "
313 << spacePointPtrs.size() <<
" space points");