diff --git a/io/src/csv/read_measurements.cpp b/io/src/csv/read_measurements.cpp index d5e262d78a..de98e5b6fa 100644 --- a/io/src/csv/read_measurements.cpp +++ b/io/src/csv/read_measurements.cpp @@ -19,7 +19,7 @@ namespace traccc::io::csv { void read_measurements(measurement_reader_output& out, - std::string_view filename) { + std::string_view filename, bool do_sort) { // Construct the measurement reader object. auto reader = make_measurement_reader(filename); @@ -82,8 +82,10 @@ void read_measurements(measurement_reader_output& out, result_measurements.push_back(meas); } - std::sort(result_measurements.begin(), result_measurements.end(), - measurement_sort_comp()); + if (do_sort) { + std::sort(result_measurements.begin(), result_measurements.end(), + measurement_sort_comp()); + } } measurement_container_types::host read_measurements_container( diff --git a/io/src/csv/read_measurements.hpp b/io/src/csv/read_measurements.hpp index c8d44537c6..1072d87c6a 100644 --- a/io/src/csv/read_measurements.hpp +++ b/io/src/csv/read_measurements.hpp @@ -22,6 +22,6 @@ namespace traccc::io::csv { /// @param filename The file to read the measurement data from /// void read_measurements(measurement_reader_output& out, - std::string_view filename); + std::string_view filename, bool do_sort = true); } // namespace traccc::io::csv diff --git a/io/src/csv/read_spacepoints.cpp b/io/src/csv/read_spacepoints.cpp index 6f59d150ee..b2a38aba76 100644 --- a/io/src/csv/read_spacepoints.cpp +++ b/io/src/csv/read_spacepoints.cpp @@ -27,7 +27,7 @@ void read_spacepoints(spacepoint_reader_output& out, std::string_view filename, const geometry& geom) { // Read measurements measurement_reader_output meas_reader_out; - read_measurements(meas_reader_out, meas_filename); + read_measurements(meas_reader_out, meas_filename, false); // Measurement hit id reader auto mhid_reader =