10 template <
typename spacepo
int_t>
14 boost::container::static_vector<SourceLink, 2>)>
16 std::unique_ptr<const Logger>
logger)
17 : m_config(cfg), m_spConstructor(func),
m_logger(std::
move(logger)) {
21 template <
typename spacepo
int_t>
22 template <
template <
typename...>
typename container_t>
26 std::back_insert_iterator<container_t<spacepoint_t>> spacePointIt)
const {
27 const unsigned int num_slinks = sourceLinks.size();
32 if (num_slinks == 1) {
33 auto slink = sourceLinks.at(0);
35 auto gPosCov = m_spUtility->globalCoords(
36 gctx, slink, m_config.slSurfaceAccessor, param,
cov);
38 gCov = gPosCov.second;
39 }
else if (num_slinks == 2) {
46 if (!m_config.usePerpProj) {
48 auto spFound = m_spUtility->calculateStripSPPosition(
52 spFound = m_spUtility->recoverSpacePoint(spParams,
61 (ends1.first + ends1.second + spParams.
m * spParams.
firstBtmToTop);
66 m_spUtility->calcPerpendicularProjection(ends1, ends2, spParams);
68 if (!resultPerpProj.ok()) {
71 gPos = ends1.first + resultPerpProj.value() * spParams.
firstBtmToTop;
78 gCov = m_spUtility->calcRhoZVars(gctx, sourceLinks.at(0), sourceLinks.at(1),
79 m_config.slSurfaceAccessor,
83 ACTS_ERROR(
"More than 2 sourceLinks are given for a space point.");
85 boost::container::static_vector<SourceLink, 2> slinks(sourceLinks.begin(),
88 spacePointIt = m_spConstructor(gPos, gCov,
std::move(slinks));
91 template <
typename spacepo
int_t>
94 const std::vector<SourceLink>& slinksBack,
95 std::vector<std::pair<SourceLink, SourceLink>>& slinkPairs,
97 if (slinksFront.empty() || slinksBack.empty()) {
100 double minDistance = 0;
101 unsigned int closestIndex = 0;
103 for (
unsigned int i = 0;
i < slinksFront.size();
i++) {
104 const auto& slinkFront = slinksFront[
i];
105 minDistance = std::numeric_limits<double>::max();
106 closestIndex = slinksBack.size();
107 for (
unsigned int j = 0;
j < slinksBack.size();
j++) {
108 const auto& slinkBack = slinksBack[
j];
111 const auto [gposFront, gcovFront] = m_spUtility->globalCoords(
112 gctx, slinkFront, m_config.slSurfaceAccessor, paramFront, covFront);
115 const auto [gposBack, gcovBack] = m_spUtility->globalCoords(
116 gctx, slinkBack, m_config.slSurfaceAccessor, paramBack, covBack);
118 auto res = m_spUtility->differenceOfMeasurementsChecked(
130 if (closestIndex < slinksBack.size()) {
131 slinkPairs.emplace_back(slinksFront[
i], slinksBack[closestIndex]);