Skip to content

Commit

Permalink
Backup
Browse files Browse the repository at this point in the history
  • Loading branch information
beomki-yeo committed Oct 16, 2024
1 parent ae882f1 commit 1414b91
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
3 changes: 2 additions & 1 deletion io/include/traccc/io/csv/cell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ struct cell {
float timestamp = 0.;
float value = 0.;

//auto operator<=>(const cell& other) const = default;

// geometry_id,measurement_id,channel0,channel1,timestamp,value
DFE_NAMEDTUPLE(cell, geometry_id, measurement_id, channel0, channel1,
timestamp, value);
};

bool operator<(const cell& lhs, const cell& rhs);
bool operator==(const cell& lhs, const cell& rhs);

} // namespace traccc::io::csv
10 changes: 1 addition & 9 deletions io/src/csv/cell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@ bool operator<(const cell& lhs, const cell& rhs) {
return (lhs.channel1 < rhs.channel1);
} else {
return (lhs.channel0 < rhs.channel0);
}
}

bool operator==(const cell& lhs, const cell& rhs) {
if (lhs.geometry_id == rhs.geometry_id && lhs.channel0 == rhs.channel0 &&
lhs.channel1 == rhs.channel1) {
return true;
}
return false;
}
}

} // namespace traccc::io::csv
8 changes: 5 additions & 3 deletions performance/src/utils/event_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,13 @@ void event_data::fill_cca_result(
// Cells from CCL
for (const auto& ce : cluster) {

const auto it = m_cell_to_particle_map.find(ce);
if (it != m_cell_to_particle_map.end()) {
const auto it_lo = m_cell_to_particle_map.lower_bound(ce);
const auto it_up = m_cell_to_particle_map.upper_bound(ce);

for (auto it = it_lo; it != it_up; it++) {
const auto ptc = it->second;
m_found_meas_to_ptc_map[ms][ptc]++;
meas_counts[ce.measurement_id]++;
meas_counts[it->first.measurement_id]++;
}
}

Expand Down
2 changes: 0 additions & 2 deletions tests/io/mock_data/event000000000-cells.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ geometry_id,measurement_id,channel0,channel1,timestamp,value
1224979236083738112,0,1,0,0,0.0041470062
1224979236083738112,0,0,1,0,0.00306466641
1224979236083738112,0,1,1,0,0.00868905429
1224979236083738112,1,1,1,0,0.00886478275
1224979236083738112,1,1,2,0,0.00580428448
1224979236083738112,1,2,1,0,0.0016894876
1224979236083738112,1,2,2,0,0.00199076766
1224979236083738112,2,5,5,0,0.00632160669
Expand Down
8 changes: 3 additions & 5 deletions tests/io/test_event_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST(event_data, mock_data) {
* thrid particle: one hit, three cells
*
* [ ] [1] [ ] [ ] [ ] [ ] [ ] [ ]
* [1][1,2][2] [ ] [ ] [ ] [ ] [ ]
* [1] [1] [ ] [ ] [ ] [ ] [ ] [ ]
* [ ] [2] [2] [ ] [ ] [ ] [ ] [ ]
* [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
* [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ]
Expand Down Expand Up @@ -125,7 +125,7 @@ TEST(event_data, mock_data) {
EXPECT_EQ(count, 3);
} else if (ptc.particle_id == 4503599660924928) {
// number of cells from 2nd particle
EXPECT_EQ(count, 4);
EXPECT_EQ(count, 2);
} else if (ptc.particle_id == 4503599744811008) {
// number of cells from 3rd particle
EXPECT_EQ(count, 3);
Expand Down Expand Up @@ -180,7 +180,7 @@ TEST(event_data, mock_data) {
has_first_particle = true;
} else if (ptc.particle_id == 4503599660924928) {
// number of cells from 2nd particle
EXPECT_EQ(count, 4);
EXPECT_EQ(count, 2);
has_second_particle = true;
}
}
Expand Down Expand Up @@ -214,10 +214,8 @@ TEST(event_data, mock_data) {
for (auto const& [meas, param] : evt_data.m_found_meas_to_param_map) {
if (meas.measurement_id == 0u) {
has_first_param = true;
EXPECT_NEAR(param.first[0u], 31.5048428f, 1e-4f);
} else if (meas.measurement_id == 1u) {
has_second_param = true;
EXPECT_NEAR(param.first[0u], 90.4015808f, 1e-4f);
}
}

Expand Down

0 comments on commit 1414b91

Please sign in to comment.