Skip to content

Commit 4ec38cf

Browse files
committed
Fixed the I/O test failures.
One failure was because of a difference in the "module link" variable of cells. Since in the new scheme this link would mean an index in the "global" DD object. The other failure was however because of a genuine bug in the spacepoint reading that I introduced while updating the I/O code to use the new DD type.
1 parent 649def5 commit 4ec38cf

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

io/src/csv/read_spacepoints.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,11 @@ void read_spacepoints(spacepoint_collection_types::host& spacepoints,
5151
// Construct the global 3D position of the spacepoint.
5252
const point3 pos{iohit.tx, iohit.ty, iohit.tz};
5353

54-
// Find the measurement associated with this spacepoint.
54+
// Construct the local 3D(2D) position of the measurement.
5555
measurement meas;
56-
for (const measurement& meas1 : measurements) {
57-
if (meas1.surface_link ==
58-
detray::geometry::barcode{iohit.geometry_id}) {
59-
meas = meas1;
60-
break;
56+
for (auto const [meas_id, hit_id] : measurement_hit_ids) {
57+
if (hit_id == spacepoints.size()) {
58+
meas = measurements[meas_id];
6159
}
6260
}
6361

tests/io/test_mapper.cpp

+13-10
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,22 @@ TEST(mappper, measurement_cell_map) {
188188
auto m_c_map =
189189
traccc::generate_measurement_cell_map(event, cells_dir, dd, resource);
190190

191+
// The module that the cells of event 0 belong to, happens to be this one.
192+
constexpr traccc::cell::link_type module_link = 873;
193+
191194
vecmem::vector<traccc::cell> cells0;
192-
cells0.push_back({1, 0, 0.0041470062f, 0, 0});
193-
cells0.push_back({0, 1, 0.00306466641f, 0, 0});
194-
cells0.push_back({1, 1, 0.00868905429f, 0, 0});
195-
cells0.push_back({1, 1, 0.00886478275f, 0, 0});
196-
cells0.push_back({1, 2, 0.00580428448f, 0, 0});
197-
cells0.push_back({2, 1, 0.0016894876f, 0, 0});
198-
cells0.push_back({2, 2, 0.00199076766f, 0, 0});
195+
cells0.push_back({1, 0, 0.0041470062f, 0, module_link});
196+
cells0.push_back({0, 1, 0.00306466641f, 0, module_link});
197+
cells0.push_back({1, 1, 0.00868905429f, 0, module_link});
198+
cells0.push_back({1, 1, 0.00886478275f, 0, module_link});
199+
cells0.push_back({1, 2, 0.00580428448f, 0, module_link});
200+
cells0.push_back({2, 1, 0.0016894876f, 0, module_link});
201+
cells0.push_back({2, 2, 0.00199076766f, 0, module_link});
199202

200203
vecmem::vector<traccc::cell> cells1;
201-
cells1.push_back({5, 5, 0.00632160669f, 0, 0});
202-
cells1.push_back({5, 6, 0.00911649223f, 0, 0});
203-
cells1.push_back({5, 7, 0.00518329488f, 0, 0});
204+
cells1.push_back({5, 5, 0.00632160669f, 0, module_link});
205+
cells1.push_back({5, 6, 0.00911649223f, 0, module_link});
206+
cells1.push_back({5, 7, 0.00518329488f, 0, module_link});
204207

205208
EXPECT_EQ(m_c_map.size(), 2);
206209

0 commit comments

Comments
 (0)