diff --git a/src/algorithms/tracking/TrackSeeding.cc b/src/algorithms/tracking/TrackSeeding.cc index f6b6b0bf9b..be1f5684b7 100644 --- a/src/algorithms/tracking/TrackSeeding.cc +++ b/src/algorithms/tracking/TrackSeeding.cc @@ -24,8 +24,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -100,6 +102,17 @@ void TrackSeeding::process(const Input& input, const Output& output) const { auto [trk_seeds, trk_params] = output; std::vector spacePoints = getSpacePoints(*trk_hits); + std::stable_sort(spacePoints.begin(), spacePoints.end(), [](const auto* lhs, const auto* rhs) { + const auto lhsPositionKey = std::tuple{lhs->r(), lhs->z(), lhs->x(), lhs->y()}; + const auto rhsPositionKey = std::tuple{rhs->r(), rhs->z(), rhs->x(), rhs->y()}; + if (lhsPositionKey != rhsPositionKey) { + return lhsPositionKey < rhsPositionKey; + } + + const auto lhsId = lhs->getObjectID(); + const auto rhsId = rhs->getObjectID(); + return std::tie(lhsId.collectionID, lhsId.index) < std::tie(rhsId.collectionID, rhsId.index); + }); Acts::SeedFinderOrthogonal finder(m_seedFinderConfig); // FIXME move into class scope