diff --git a/core/include/traccc/clusterization/impl/measurement_creation.ipp b/core/include/traccc/clusterization/impl/measurement_creation.ipp index 2f9ebafe5..f66f67a03 100644 --- a/core/include/traccc/clusterization/impl/measurement_creation.ipp +++ b/core/include/traccc/clusterization/impl/measurement_creation.ipp @@ -19,8 +19,10 @@ TRACCC_HOST_DEVICE inline vector2 position_from_cell(const cell& cell, const cell_module& mod) { // Retrieve the specific values based on module idx - return {mod.pixel.min_center_x + cell.channel0 * mod.pixel.pitch_x, - mod.pixel.min_center_y + cell.channel1 * mod.pixel.pitch_y}; + return {mod.pixel.min_corner_x + + (scalar{0.5} + cell.channel0) * mod.pixel.pitch_x, + mod.pixel.min_corner_y + + (scalar{0.5} + cell.channel1) * mod.pixel.pitch_y}; } TRACCC_HOST_DEVICE inline void calc_cluster_properties( diff --git a/core/include/traccc/geometry/pixel_data.hpp b/core/include/traccc/geometry/pixel_data.hpp index 500014480..743104a1d 100644 --- a/core/include/traccc/geometry/pixel_data.hpp +++ b/core/include/traccc/geometry/pixel_data.hpp @@ -19,8 +19,8 @@ namespace traccc { /// No checking on out of bounds done struct pixel_data { - scalar min_center_x = 0.f; - scalar min_center_y = 0.f; + scalar min_corner_x = 0.f; + scalar min_corner_y = 0.f; scalar pitch_x = 1.f; scalar pitch_y = 1.f; char dimension = 2; diff --git a/io/src/csv/read_cells.cpp b/io/src/csv/read_cells.cpp index 46a2af65c..a80d8f928 100644 --- a/io/src/csv/read_cells.cpp +++ b/io/src/csv/read_cells.cpp @@ -76,10 +76,10 @@ traccc::cell_module get_module(const std::uint64_t geometry_id, // Set the value on the module description. const auto& binning_data = geo_it->segmentation.binningData(); assert(binning_data.size() > 0); - result.pixel.min_center_x = binning_data[0].min; + result.pixel.min_corner_x = binning_data[0].min; result.pixel.pitch_x = binning_data[0].step; if (binning_data.size() > 1) { - result.pixel.min_center_y = binning_data[1].min; + result.pixel.min_corner_y = binning_data[1].min; result.pixel.pitch_y = binning_data[1].step; } result.pixel.dimension = geo_it->dimensions; diff --git a/tests/common/tests/cca_test.hpp b/tests/common/tests/cca_test.hpp index 150fe8277..b099462b3 100644 --- a/tests/common/tests/cca_test.hpp +++ b/tests/common/tests/cca_test.hpp @@ -1,6 +1,6 @@ /** TRACCC library, part of the ACTS project (R&D line) * - * (c) 2021-2022 CERN for the benefit of the ACTS project + * (c) 2021-2024 CERN for the benefit of the ACTS project * * Mozilla Public License Version 2.0 */ @@ -98,7 +98,7 @@ class ConnectedComponentAnalysisTests traccc::cell_module_collection_types::host &modules = data.modules; for (std::size_t i = 0; i < modules.size(); i++) { - modules.at(i).pixel = traccc::pixel_data{0, 0, 1, 1}; + modules.at(i).pixel = {-0.5f, -0.5f, 1.f, 1.f}; } std::map>