Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/algorithms/tracking/TrackSeeding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
#include <edm4hep/Vector3f.h>
#include <Eigen/Core>
#include <Eigen/Geometry>
#include <algorithm>
#include <array>
#include <cmath>
#include <compare>
#include <limits>
#include <tuple>

Expand Down Expand Up @@ -100,6 +102,17 @@ void TrackSeeding::process(const Input& input, const Output& output) const {
auto [trk_seeds, trk_params] = output;

std::vector<const eicrecon::SpacePoint*> spacePoints = getSpacePoints(*trk_hits);
std::stable_sort(spacePoints.begin(), spacePoints.end(), [](const auto* lhs, const auto* rhs) {
Comment thread
wdconinc marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ modernize-use-ranges ⚠️
use a ranges version of this algorithm

Suggested change
std::stable_sort(spacePoints.begin(), spacePoints.end(), [](const auto* lhs, const auto* rhs) {
std::ranges::stable_sort(spacePoints,, [](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<proxy_type> finder(m_seedFinderConfig); // FIXME move into class scope

Expand Down
Loading