Skip to content

Commit

Permalink
Merge pull request #458 from beomki-yeo/refactor-measurement-io
Browse files Browse the repository at this point in the history
Make Csv Edm Public and add `local_key` to Measurement Edm
  • Loading branch information
beomki-yeo authored Oct 10, 2023
2 parents af6dcca + 8cdc263 commit 7a4aca5
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ traccc_add_library( traccc_io io TYPE SHARED
"include/traccc/io/utils.hpp"
"include/traccc/io/details/read_surfaces.hpp"
"include/traccc/io/reader_edm.hpp"
"include/traccc/io/csv/cell.hpp"
"include/traccc/io/csv/hit.hpp"
"include/traccc/io/csv/measurement.hpp"
"include/traccc/io/csv/particle.hpp"
# Implementation
"src/data_format.cpp"
"src/event_map2.cpp"
Expand All @@ -51,25 +55,21 @@ traccc_add_library( traccc_io io TYPE SHARED
"src/csv/make_surface_reader.cpp"
"src/csv/read_surfaces.hpp"
"src/csv/read_surfaces.cpp"
"src/csv/cell.hpp"
"src/csv/make_cell_reader.hpp"
"src/csv/make_cell_reader.cpp"
"src/csv/read_cells.hpp"
"src/csv/read_cells.cpp"
"src/csv/hit.hpp"
"src/csv/make_hit_reader.hpp"
"src/csv/make_hit_reader.cpp"
"src/csv/read_spacepoints.hpp"
"src/csv/read_spacepoints.cpp"
"src/csv/measurement.hpp"
"src/csv/make_measurement_reader.hpp"
"src/csv/make_measurement_reader.cpp"
"src/csv/read_measurements.hpp"
"src/csv/read_measurements.cpp"
"src/csv/measurement_hit_id.hpp"
"src/csv/make_measurement_hit_id_reader.hpp"
"src/csv/make_measurement_hit_id_reader.cpp"
"src/csv/particle.hpp"
"src/csv/make_particle_reader.hpp"
"src/csv/make_particle_reader.cpp"
"src/csv/read_particles.hpp"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct measurement {

uint64_t measurement_id = 0;
uint64_t geometry_id = 0;
std::string local_key = "";
uint8_t local_key = 0;
float local0 = 0.;
float local1 = 0.;
float phi = 0.;
Expand All @@ -33,9 +33,9 @@ struct measurement {
float var_theta = 0.;
float var_time = 0.;

DFE_NAMEDTUPLE(measurement, measurement_id, geometry_id, local0, local1,
phi, theta, time, var_local0, var_local1, var_phi, var_theta,
var_time);
DFE_NAMEDTUPLE(measurement, measurement_id, geometry_id, local_key, local0,
local1, phi, theta, time, var_local0, var_local1, var_phi,
var_theta, var_time);
};

} // namespace traccc::io::csv
File renamed without changes.
2 changes: 1 addition & 1 deletion io/src/csv/make_cell_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

// Local include(s).
#include "cell.hpp"
#include "traccc/io/csv/cell.hpp"

// DFE include(s).
#include <dfe/dfe_io_dsv.hpp>
Expand Down
2 changes: 1 addition & 1 deletion io/src/csv/make_hit_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

// Local include(s).
#include "hit.hpp"
#include "traccc/io/csv/hit.hpp"

// DFE include(s).
#include <dfe/dfe_io_dsv.hpp>
Expand Down
2 changes: 1 addition & 1 deletion io/src/csv/make_measurement_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

// Local include(s).
#include "measurement.hpp"
#include "traccc/io/csv/measurement.hpp"

// DFE include(s).
#include <dfe/dfe_io_dsv.hpp>
Expand Down
2 changes: 1 addition & 1 deletion io/src/csv/make_particle_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#pragma once

// Local include(s).
#include "particle.hpp"
#include "traccc/io/csv/particle.hpp"

// DFE include(s).
#include <dfe/dfe_io_dsv.hpp>
Expand Down
6 changes: 3 additions & 3 deletions tests/io/mock_data/event000000000-measurements.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
measurement_id,geometry_id,local_key,local0,local1,phi,theta,time,var_local0,var_local1,var_phi,var_theta,var_time
0,576460889742407168,unknown,4.2657785415649414,11.742777824401855,-2.8126237392425537,2.1995303630828857,0,0.0025000001769512892,0.0025000001769512892,0,0,0
1,576460889742407168,unknown,2.4493119716644287,-17.223770141601562,-2.8123311996459961,2.1995320320129395,0,0.0025000001769512892,0.0025000001769512892,0,0,0
2,576460889742407168,unknown,3.1442358493804932,21.099834442138672,-2.8119988441467285,2.1995346546173096,0,0.0025000001769512892,0.0025000001769512892,0,0,0
0,576460889742407168,,4.2657785415649414,11.742777824401855,-2.8126237392425537,2.1995303630828857,0,0.0025000001769512892,0.0025000001769512892,0,0,0
1,576460889742407168,,2.4493119716644287,-17.223770141601562,-2.8123311996459961,2.1995320320129395,0,0.0025000001769512892,0.0025000001769512892,0,0,0
2,576460889742407168,,3.1442358493804932,21.099834442138672,-2.8119988441467285,2.1995346546173096,0,0.0025000001769512892,0.0025000001769512892,0,0,0

0 comments on commit 7a4aca5

Please sign in to comment.