Skip to content

Commit

Permalink
Merge branch 'fix-a-bug' into sort-track-params
Browse files Browse the repository at this point in the history
  • Loading branch information
beomki-yeo committed Oct 21, 2023
2 parents 90bbbcb + c803b84 commit 95e1227
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions io/src/csv/read_measurements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion io/src/csv/read_measurements.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion io/src/csv/read_spacepoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 95e1227

Please sign in to comment.