From 8cdc2639b9d6b82141ff01cd48841a80c5fb9698 Mon Sep 17 00:00:00 2001 From: beomki-yeo Date: Tue, 10 Oct 2023 15:10:52 +0200 Subject: [PATCH] Make Csv Edm Public and add local_key to Measurement Edm --- io/CMakeLists.txt | 8 ++++---- io/{src => include/traccc/io}/csv/cell.hpp | 0 io/{src => include/traccc/io}/csv/hit.hpp | 0 io/{src => include/traccc/io}/csv/measurement.hpp | 8 ++++---- io/{src => include/traccc/io}/csv/particle.hpp | 0 io/src/csv/make_cell_reader.hpp | 2 +- io/src/csv/make_hit_reader.hpp | 2 +- io/src/csv/make_measurement_reader.hpp | 2 +- io/src/csv/make_particle_reader.hpp | 2 +- tests/io/mock_data/event000000000-measurements.csv | 6 +++--- 10 files changed, 15 insertions(+), 15 deletions(-) rename io/{src => include/traccc/io}/csv/cell.hpp (100%) rename io/{src => include/traccc/io}/csv/hit.hpp (100%) rename io/{src => include/traccc/io}/csv/measurement.hpp (83%) rename io/{src => include/traccc/io}/csv/particle.hpp (100%) diff --git a/io/CMakeLists.txt b/io/CMakeLists.txt index 763d8b0998..f407ea32df 100644 --- a/io/CMakeLists.txt +++ b/io/CMakeLists.txt @@ -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" @@ -51,17 +55,14 @@ 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" @@ -69,7 +70,6 @@ traccc_add_library( traccc_io io TYPE SHARED "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" diff --git a/io/src/csv/cell.hpp b/io/include/traccc/io/csv/cell.hpp similarity index 100% rename from io/src/csv/cell.hpp rename to io/include/traccc/io/csv/cell.hpp diff --git a/io/src/csv/hit.hpp b/io/include/traccc/io/csv/hit.hpp similarity index 100% rename from io/src/csv/hit.hpp rename to io/include/traccc/io/csv/hit.hpp diff --git a/io/src/csv/measurement.hpp b/io/include/traccc/io/csv/measurement.hpp similarity index 83% rename from io/src/csv/measurement.hpp rename to io/include/traccc/io/csv/measurement.hpp index e99d4c7f31..df04582c2e 100644 --- a/io/src/csv/measurement.hpp +++ b/io/include/traccc/io/csv/measurement.hpp @@ -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.; @@ -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 diff --git a/io/src/csv/particle.hpp b/io/include/traccc/io/csv/particle.hpp similarity index 100% rename from io/src/csv/particle.hpp rename to io/include/traccc/io/csv/particle.hpp diff --git a/io/src/csv/make_cell_reader.hpp b/io/src/csv/make_cell_reader.hpp index be61769f4f..d58c6c922b 100644 --- a/io/src/csv/make_cell_reader.hpp +++ b/io/src/csv/make_cell_reader.hpp @@ -8,7 +8,7 @@ #pragma once // Local include(s). -#include "cell.hpp" +#include "traccc/io/csv/cell.hpp" // DFE include(s). #include diff --git a/io/src/csv/make_hit_reader.hpp b/io/src/csv/make_hit_reader.hpp index 131ec5cebe..8e59d186dc 100644 --- a/io/src/csv/make_hit_reader.hpp +++ b/io/src/csv/make_hit_reader.hpp @@ -8,7 +8,7 @@ #pragma once // Local include(s). -#include "hit.hpp" +#include "traccc/io/csv/hit.hpp" // DFE include(s). #include diff --git a/io/src/csv/make_measurement_reader.hpp b/io/src/csv/make_measurement_reader.hpp index 9f950fab83..d6e5ddbc23 100644 --- a/io/src/csv/make_measurement_reader.hpp +++ b/io/src/csv/make_measurement_reader.hpp @@ -8,7 +8,7 @@ #pragma once // Local include(s). -#include "measurement.hpp" +#include "traccc/io/csv/measurement.hpp" // DFE include(s). #include diff --git a/io/src/csv/make_particle_reader.hpp b/io/src/csv/make_particle_reader.hpp index 7f4ac984b7..0a8b913e94 100644 --- a/io/src/csv/make_particle_reader.hpp +++ b/io/src/csv/make_particle_reader.hpp @@ -8,7 +8,7 @@ #pragma once // Local include(s). -#include "particle.hpp" +#include "traccc/io/csv/particle.hpp" // DFE include(s). #include diff --git a/tests/io/mock_data/event000000000-measurements.csv b/tests/io/mock_data/event000000000-measurements.csv index e84ef7ab01..037b2880e3 100644 --- a/tests/io/mock_data/event000000000-measurements.csv +++ b/tests/io/mock_data/event000000000-measurements.csv @@ -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 \ No newline at end of file +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 \ No newline at end of file