Skip to content

Commit

Permalink
Remove the module link from measurement
Browse files Browse the repository at this point in the history
  • Loading branch information
beomki-yeo committed Oct 9, 2024
1 parent ce1b363 commit f228ee3
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ TRACCC_HOST_DEVICE inline void fill_measurement(
const auto module_dd = det_descr.at(module_idx);

// Fill the measurement object.
m.module_link = module_idx;
m.surface_link = module_dd.geometry_id();
// normalize the cell position
m.local = mean;
Expand Down
1 change: 0 additions & 1 deletion core/include/traccc/edm/measurement.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ struct measurement {

/// Link to Module vector index
using link_type = unsigned int;
link_type module_link = 0;

/// Cluster link
std::size_t cluster_link = std::numeric_limits<std::size_t>::max();
Expand Down
2 changes: 1 addition & 1 deletion core/include/traccc/utils/projections.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct [[maybe_unused]] cell_module_projection{

struct [[maybe_unused]] measurement_module_projection{
TRACCC_HOST_DEVICE auto operator()(const traccc::measurement& m)
const {return m.module_link;
const {return m.surface_link;
}
}
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ inline void aggregate_cluster(
out.local = mean + offset;
out.variance = var;
out.surface_link = module_descr.geometry_id();
out.module_link = module_idx;
// Set a unique identifier for the measurement.
out.measurement_id = link;
// Set the dimensionality of the measurement.
Expand Down
10 changes: 0 additions & 10 deletions io/src/csv/read_measurements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,6 @@ void read_measurements(measurement_collection_types::host& measurements,
csv::measurement iomeas;
while (reader.read(iomeas)) {

// Find the module index for the measurement.
unsigned int link = 0u;
if (dd != nullptr) {
auto it = m.find(iomeas.geometry_id);
if (it != m.end()) {
link = it->second;
}
}

// Construct the measurement object.
traccc::measurement meas;
std::array<typename transform3::size_type, 2u> indices{0u, 0u};
Expand Down Expand Up @@ -75,7 +66,6 @@ void read_measurements(measurement_collection_types::host& measurements,

meas.subs.set_indices(indices);
meas.surface_link = detray::geometry::barcode{iomeas.geometry_id};
meas.module_link = link;
// Keeps measurement_id for ambiguity resolution
meas.measurement_id = iomeas.measurement_id;

Expand Down
2 changes: 0 additions & 2 deletions io/src/mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ hit_particle_map generate_hit_particle_map(std::size_t event,
link = (*it).second;
}

sp.meas.module_link = link;

particle ptc = pmap[iohit.particle_id];

result[sp] = ptc;
Expand Down
3 changes: 1 addition & 2 deletions performance/src/performance/details/is_same_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ bool is_same_object<measurement>::operator()(const measurement& obj) const {
return (is_same_scalar(obj.local[0], m_ref.get().local[0], m_unc) &&
is_same_scalar(obj.local[1], m_ref.get().local[1], m_unc) &&
is_same_scalar(obj.variance[0], m_ref.get().variance[0], m_unc) &&
is_same_scalar(obj.variance[1], m_ref.get().variance[1], m_unc) &&
obj.module_link == m_ref.get().module_link);
is_same_scalar(obj.variance[1], m_ref.get().variance[1], m_unc));
}

/// @}
Expand Down
4 changes: 2 additions & 2 deletions tests/alpaka/test_cca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ cca_function_t get_f_with(traccc::clustering_config cfg) {
copy(measurements_buffer, measurements)->wait();

for (std::size_t i = 0; i < measurements.size(); i++) {
result[dd.acts_geometry_id().at(measurements.at(i).module_link)]
.push_back(measurements.at(i));
result[measurements.at(i).surface_link.value()].push_back(
measurements.at(i));
}

return result;
Expand Down
4 changes: 2 additions & 2 deletions tests/cpu/test_cca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ cca_function_t f = [](const traccc::edm::silicon_cell_collection::host& cells,
vecmem::get_data(dd);
auto measurements = ca(cells_data, dd_data);
for (std::size_t i = 0; i < measurements.size(); i++) {
result[dd.acts_geometry_id().at(measurements.at(i).module_link)]
.push_back(measurements.at(i));
result[measurements.at(i).surface_link.value()].push_back(
measurements.at(i));
}

return result;
Expand Down
4 changes: 2 additions & 2 deletions tests/cuda/test_cca.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ cca_function_t get_f_with(traccc::clustering_config cfg) {
copy(measurements_buffer, measurements)->wait();

for (std::size_t i = 0; i < measurements.size(); i++) {
result[dd.acts_geometry_id().at(measurements.at(i).module_link)]
.push_back(measurements.at(i));
result[measurements.at(i).surface_link.value()].push_back(
measurements.at(i));
}

return result;
Expand Down
4 changes: 2 additions & 2 deletions tests/sycl/test_cca.sycl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ cca_function_t get_f_with(traccc::clustering_config cfg) {
copy(measurements_buffer, measurements)->wait();

for (std::size_t i = 0; i < measurements.size(); i++) {
result[dd.acts_geometry_id().at(measurements.at(i).module_link)]
.push_back(measurements.at(i));
result[measurements.at(i).surface_link.value()].push_back(
measurements.at(i));
}

return result;
Expand Down

0 comments on commit f228ee3

Please sign in to comment.