From 0b3beeb463a89dd33261cdf0aeae96066929b223 Mon Sep 17 00:00:00 2001 From: cvarni Date: Fri, 27 Sep 2024 13:08:46 +0200 Subject: [PATCH 1/3] Add support for Timed Clusterization --- .../Acts/Clusterization/Clusterization.hpp | 50 +++- .../Acts/Clusterization/Clusterization.ipp | 100 ++----- .../Clusterization/TimedClusterization.hpp | 39 +++ .../Clusterization/TimedClusterization.ipp | 36 +++ .../Core/Clusterization/CMakeLists.txt | 1 + .../TimedClusterizationTests.cpp | 260 ++++++++++++++++++ 6 files changed, 402 insertions(+), 84 deletions(-) create mode 100644 Core/include/Acts/Clusterization/TimedClusterization.hpp create mode 100644 Core/include/Acts/Clusterization/TimedClusterization.ipp create mode 100644 Tests/UnitTests/Core/Clusterization/TimedClusterizationTests.cpp diff --git a/Core/include/Acts/Clusterization/Clusterization.hpp b/Core/include/Acts/Clusterization/Clusterization.hpp index 3ebfd8d562d..f9b07226167 100644 --- a/Core/include/Acts/Clusterization/Clusterization.hpp +++ b/Core/include/Acts/Clusterization/Clusterization.hpp @@ -13,6 +13,26 @@ namespace Acts::Ccl { +template +concept HasRetrievableColumnInfo = requires(Cell cell) { + { getCellColumn(cell) } -> std::same_as; +}; + +template +concept HasRetrievableRowInfo = requires(Cell cell) { + { getCellRow(cell) } -> std::same_as; +}; + +template +concept HasRetrievableLabelInfo = requires(Cell cell) { + { getCellLabel(cell) } -> std::same_as; +}; + +template +concept CanAcceptCell = requires(Cell cell, Cluster cluster) { + { clusterAddCell(cluster, cell) } -> std::same_as; +}; + using Label = int; constexpr Label NO_LABEL = 0; @@ -28,17 +48,21 @@ enum class ConnectResult { // Default connection type for 2-D grids: 4- or 8-cell connectivity template + requires(Acts::Ccl::HasRetrievableColumnInfo && + Acts::Ccl::HasRetrievableRowInfo) struct Connect2D { - bool conn8; - Connect2D() : conn8{true} {} + bool conn8{true}; + Connect2D() = default; explicit Connect2D(bool commonCorner) : conn8{commonCorner} {} - ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ~Connect2D() = default; }; // Default connection type for 1-D grids: 2-cell connectivity -template +template struct Connect1D { - ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ConnectResult operator()(const Cell& ref, const Cell& iter) const; + virtual ~Connect1D() = default; }; // Default connection type based on GridDim @@ -49,13 +73,16 @@ struct DefaultConnect { }; template -struct DefaultConnect : public Connect2D { - explicit DefaultConnect(bool commonCorner) : Connect2D(commonCorner) {} - DefaultConnect() : DefaultConnect(true) {} +struct DefaultConnect : public Connect1D { + virtual ~DefaultConnect() = default; }; template -struct DefaultConnect : public Connect1D {}; +struct DefaultConnect : public Connect2D { + explicit DefaultConnect(bool commonCorner) : Connect2D(commonCorner) {} + DefaultConnect() = default; + virtual ~DefaultConnect() = default; +}; /// @brief labelClusters /// @@ -70,6 +97,8 @@ struct DefaultConnect : public Connect1D {}; template > + requires( + Acts::Ccl::HasRetrievableLabelInfo) void labelClusters(CellCollection& cells, Connect connect = Connect()); /// @brief mergeClusters @@ -82,6 +111,9 @@ void labelClusters(CellCollection& cells, Connect connect = Connect()); /// @return nothing template + requires(GridDim == 1 || GridDim == 2) && + Acts::Ccl::HasRetrievableLabelInfo< + typename CellCollection::value_type> ClusterCollection mergeClusters(CellCollection& /*cells*/); /// @brief createClusters diff --git a/Core/include/Acts/Clusterization/Clusterization.ipp b/Core/include/Acts/Clusterization/Clusterization.ipp index 0aa79b53981..90a69930ce1 100644 --- a/Core/include/Acts/Clusterization/Clusterization.ipp +++ b/Core/include/Acts/Clusterization/Clusterization.ipp @@ -14,60 +14,6 @@ namespace Acts::Ccl::internal { -// Machinery for validating generic Cell/Cluster types at compile-time - -template -struct cellTypeHasRequiredFunctions : std::false_type {}; - -template -struct cellTypeHasRequiredFunctions< - T, 2, - std::void_t())), - decltype(getCellColumn(std::declval())), - decltype(getCellLabel(std::declval()))>> : std::true_type { -}; - -template -struct cellTypeHasRequiredFunctions< - T, 1, - std::void_t())), - decltype(getCellLabel(std::declval()))>> : std::true_type { -}; - -template -struct clusterTypeHasRequiredFunctions : std::false_type {}; - -template -struct clusterTypeHasRequiredFunctions< - T, U, - std::void_t(), std::declval()))>> - : std::true_type {}; - -template -constexpr void staticCheckGridDim() { - static_assert( - GridDim == 1 || GridDim == 2, - "mergeClusters is only defined for grid dimensions of 1 or 2. "); -} - -template -constexpr void staticCheckCellType() { - constexpr bool hasFns = cellTypeHasRequiredFunctions(); - static_assert(hasFns, - "Cell type should have the following functions: " - "'int getCellRow(const Cell&)', " - "'int getCellColumn(const Cell&)', " - "'Label& getCellLabel(Cell&)'"); -} - -template -constexpr void staticCheckClusterType() { - constexpr bool hasFns = clusterTypeHasRequiredFunctions(); - static_assert(hasFns, - "Cluster type should have the following function: " - "'void clusterAddCell(Cluster&, const Cell&)'"); -} - template struct Compare { static_assert(GridDim != 1 && GridDim != 2, @@ -75,25 +21,27 @@ struct Compare { }; // Comparator function object for cells, column-wise ordering -// Specialization for 2-D grid -template -struct Compare { +// Specialization for 1-D grids +template +struct Compare { bool operator()(const Cell& c0, const Cell& c1) const { - int row0 = getCellRow(c0); - int row1 = getCellRow(c1); int col0 = getCellColumn(c0); int col1 = getCellColumn(c1); - return (col0 == col1) ? row0 < row1 : col0 < col1; + return col0 < col1; } }; -// Specialization for 1-D grids +// Specialization for 2-D grid template -struct Compare { + requires(Acts::Ccl::HasRetrievableColumnInfo && + Acts::Ccl::HasRetrievableRowInfo) +struct Compare { bool operator()(const Cell& c0, const Cell& c1) const { + int row0 = getCellRow(c0); + int row1 = getCellRow(c1); int col0 = getCellColumn(c0); int col1 = getCellColumn(c1); - return col0 < col1; + return (col0 == col1) ? row0 < row1 : col0 < col1; } }; @@ -184,6 +132,10 @@ Connections getConnections(typename std::vector::iterator it, } template + requires( + Acts::Ccl::HasRetrievableLabelInfo && + Acts::Ccl::CanAcceptCell) ClusterCollection mergeClustersImpl(CellCollection& cells) { using Cluster = typename ClusterCollection::value_type; @@ -215,6 +167,8 @@ ClusterCollection mergeClustersImpl(CellCollection& cells) { namespace Acts::Ccl { template + requires(Acts::Ccl::HasRetrievableColumnInfo && + Acts::Ccl::HasRetrievableRowInfo) ConnectResult Connect2D::operator()(const Cell& ref, const Cell& iter) const { int deltaRow = std::abs(getCellRow(ref) - getCellRow(iter)); @@ -237,7 +191,7 @@ ConnectResult Connect2D::operator()(const Cell& ref, return ConnectResult::eNoConn; } -template +template ConnectResult Connect1D::operator()(const Cell& ref, const Cell& iter) const { int deltaCol = std::abs(getCellColumn(ref) - getCellColumn(iter)); @@ -267,9 +221,10 @@ void recordEquivalences(const internal::Connections seen, } template + requires( + Acts::Ccl::HasRetrievableLabelInfo) void labelClusters(CellCollection& cells, Connect connect) { using Cell = typename CellCollection::value_type; - internal::staticCheckCellType(); internal::DisjointSets ds{}; @@ -277,7 +232,8 @@ void labelClusters(CellCollection& cells, Connect connect) { std::ranges::sort(cells, internal::Compare()); // First pass: Allocate labels and record equivalences - for (auto it = cells.begin(); it != cells.end(); ++it) { + for (auto it = std::ranges::begin(cells); it != std::ranges::end(cells); + ++it) { const internal::Connections seen = internal::getConnections(it, cells, connect); if (seen.nconn == 0) { @@ -299,13 +255,11 @@ void labelClusters(CellCollection& cells, Connect connect) { template + requires(GridDim == 1 || GridDim == 2) && + Acts::Ccl::HasRetrievableLabelInfo< + typename CellCollection::value_type> ClusterCollection mergeClusters(CellCollection& cells) { using Cell = typename CellCollection::value_type; - using Cluster = typename ClusterCollection::value_type; - internal::staticCheckGridDim(); - internal::staticCheckCellType(); - internal::staticCheckClusterType(); - if constexpr (GridDim > 1) { // Sort the cells by their cluster label, only needed if more than // one spatial dimension @@ -318,10 +272,6 @@ ClusterCollection mergeClusters(CellCollection& cells) { template ClusterCollection createClusters(CellCollection& cells, Connect connect) { - using Cell = typename CellCollection::value_type; - using Cluster = typename ClusterCollection::value_type; - internal::staticCheckCellType(); - internal::staticCheckClusterType(); labelClusters(cells, connect); return mergeClusters(cells); } diff --git a/Core/include/Acts/Clusterization/TimedClusterization.hpp b/Core/include/Acts/Clusterization/TimedClusterization.hpp new file mode 100644 index 00000000000..93148db0671 --- /dev/null +++ b/Core/include/Acts/Clusterization/TimedClusterization.hpp @@ -0,0 +1,39 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Clusterization/Clusterization.hpp" +#include "Acts/Definitions/Algebra.hpp" + +#include + +namespace Acts::Ccl { + +template +concept HasRetrievableTimeInfo = requires(Cell cell) { + { getCellTime(cell) } -> std::same_as; +}; + +template +struct TimedConnect : public Acts::Ccl::DefaultConnect { + Acts::ActsScalar timeTollerance{std::numeric_limits::max()}; + + TimedConnect() = default; + TimedConnect(Acts::ActsScalar time); + TimedConnect(Acts::ActsScalar time, bool conn) + requires(N == 2); + virtual ~TimedConnect() = default; + + virtual ConnectResult operator()(const Cell& ref, + const Cell& iter) const override; +}; + +} // namespace Acts::Ccl + +#include "Acts/Clusterization/TimedClusterization.ipp" diff --git a/Core/include/Acts/Clusterization/TimedClusterization.ipp b/Core/include/Acts/Clusterization/TimedClusterization.ipp new file mode 100644 index 00000000000..cfbbe1d7ac4 --- /dev/null +++ b/Core/include/Acts/Clusterization/TimedClusterization.ipp @@ -0,0 +1,36 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +namespace Acts::Ccl { + +template +TimedConnect::TimedConnect(Acts::ActsScalar time) + : timeTollerance(time) {} + +template +TimedConnect::TimedConnect(Acts::ActsScalar time, bool conn) + requires(N == 2) + : Acts::Ccl::DefaultConnect(conn), timeTollerance(time) {} + +template +Acts::Ccl::ConnectResult TimedConnect::operator()( + const Cell& ref, const Cell& iter) const { + Acts::Ccl::ConnectResult spaceCompatibility = + Acts::Ccl::DefaultConnect::operator()(ref, iter); + if (spaceCompatibility != Acts::Ccl::ConnectResult::eConn) { + return spaceCompatibility; + } + + if (std::abs(getCellTime(ref) - getCellTime(iter)) < timeTollerance) { + return Acts::Ccl::ConnectResult::eConn; + } + + return Acts::Ccl::ConnectResult::eNoConn; +} + +} // namespace Acts::Ccl diff --git a/Tests/UnitTests/Core/Clusterization/CMakeLists.txt b/Tests/UnitTests/Core/Clusterization/CMakeLists.txt index 38dffefd462..a6c4844bdb9 100644 --- a/Tests/UnitTests/Core/Clusterization/CMakeLists.txt +++ b/Tests/UnitTests/Core/Clusterization/CMakeLists.txt @@ -1,2 +1,3 @@ add_unittest(Clusterization1D ClusterizationTests1D.cpp) add_unittest(Clusterization2D ClusterizationTests2D.cpp) +add_unittest(TimedClusterization TimedClusterizationTests.cpp) diff --git a/Tests/UnitTests/Core/Clusterization/TimedClusterizationTests.cpp b/Tests/UnitTests/Core/Clusterization/TimedClusterizationTests.cpp new file mode 100644 index 00000000000..ac60393d9b6 --- /dev/null +++ b/Tests/UnitTests/Core/Clusterization/TimedClusterizationTests.cpp @@ -0,0 +1,260 @@ +// This file is part of the ACTS project. +// +// Copyright (C) 2016 CERN for the benefit of the ACTS project +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +#include + +#include "Acts/Clusterization/TimedClusterization.hpp" + +namespace Acts::Test { + +// Define objects +using Identifier = std::size_t; +struct Cell { + Cell(Identifier identifier, int c, int r, double t) + : id(identifier), column(c), row(r), time(t) {} + + Identifier id{}; + int column{0}; + int row{0}; + int label{-1}; + double time{0.}; +}; + +struct Cluster { + std::vector ids{}; +}; + +using CellCollection = std::vector; +using ClusterCollection = std::vector; + +// Define functions +static inline int getCellRow(const Cell& cell) { + return cell.row; +} + +static inline int getCellColumn(const Cell& cell) { + return cell.column; +} + +static inline int& getCellLabel(Cell& cell) { + return cell.label; +} + +static inline double getCellTime(const Cell& cell) { + return cell.time; +} + +static void clusterAddCell(Cluster& cl, const Cell& cell) { + cl.ids.push_back(cell.id); +} + +BOOST_AUTO_TEST_CASE(TimedGrid_1D_withtime) { + // 1x10 matrix + /* + X X X Y O X Y Y X X + */ + // 6 + 3 cells -> 3 + 2 clusters in total + + std::vector cells; + // X + cells.emplace_back(0ul, 0, -1, 0); + cells.emplace_back(1ul, 1, -1, 0); + cells.emplace_back(2ul, 2, -1, 0); + cells.emplace_back(3ul, 5, -1, 0); + cells.emplace_back(4ul, 8, -1, 0); + cells.emplace_back(5ul, 9, -1, 0); + // Y + cells.emplace_back(6ul, 3, 0, 1); + cells.emplace_back(7ul, 6, 1, 1); + cells.emplace_back(8ul, 7, 1, 1); + + std::vector> expectedResults; + expectedResults.push_back({0ul, 1ul, 2ul}); + expectedResults.push_back({6ul}); + expectedResults.push_back({3ul}); + expectedResults.push_back({7ul, 8ul}); + expectedResults.push_back({4ul, 5ul}); + + ClusterCollection clusters = + Acts::Ccl::createClusters( + cells, Acts::Ccl::TimedConnect(0.5)); + + BOOST_CHECK_EQUAL(5ul, clusters.size()); + + for (std::size_t i(0); i < clusters.size(); ++i) { + std::vector& timedIds = clusters[i].ids; + const std::vector& expected = expectedResults[i]; + std::sort(timedIds.begin(), timedIds.end()); + BOOST_CHECK_EQUAL(timedIds.size(), expected.size()); + + for (std::size_t j(0); j < timedIds.size(); ++j) { + BOOST_CHECK_EQUAL(timedIds[j], expected[j]); + } + } +} + +BOOST_AUTO_TEST_CASE(TimedGrid_2D_notime) { + // 4x4 matrix + /* + X O O X + O O O X + X X O O + X O O X + */ + // 7 cells -> 4 clusters in total + + std::vector cells; + cells.emplace_back(0ul, 0, 0, 0); + cells.emplace_back(1ul, 3, 0, 0); + cells.emplace_back(2ul, 3, 1, 0); + cells.emplace_back(3ul, 0, 2, 0); + cells.emplace_back(4ul, 1, 2, 0); + cells.emplace_back(5ul, 0, 3, 0); + cells.emplace_back(6ul, 3, 3, 0); + + std::vector> expectedResults; + expectedResults.push_back({0ul}); + expectedResults.push_back({3ul, 4ul, 5ul}); + expectedResults.push_back({1ul, 2ul}); + expectedResults.push_back({6ul}); + + ClusterCollection clusters = + Acts::Ccl::createClusters( + cells, + Acts::Ccl::TimedConnect(std::numeric_limits::max())); + + BOOST_CHECK_EQUAL(4ul, clusters.size()); + + // Compare against default connect (only space) + ClusterCollection defaultClusters = + Acts::Ccl::createClusters( + cells, Acts::Ccl::DefaultConnect()); + + BOOST_CHECK_EQUAL(4ul, defaultClusters.size()); + BOOST_CHECK_EQUAL(defaultClusters.size(), expectedResults.size()); + + std::vector sizes{1, 3, 2, 1}; + for (std::size_t i(0); i < clusters.size(); ++i) { + std::vector& timedIds = clusters[i].ids; + std::vector& defaultIds = defaultClusters[i].ids; + const std::vector& expected = expectedResults[i]; + BOOST_CHECK_EQUAL(timedIds.size(), defaultIds.size()); + BOOST_CHECK_EQUAL(timedIds.size(), sizes[i]); + BOOST_CHECK_EQUAL(timedIds.size(), expected.size()); + + std::sort(timedIds.begin(), timedIds.end()); + std::sort(defaultIds.begin(), defaultIds.end()); + for (std::size_t j(0); j < timedIds.size(); ++j) { + BOOST_CHECK_EQUAL(timedIds[j], defaultIds[j]); + BOOST_CHECK_EQUAL(timedIds[j], expected[j]); + } + } +} + +BOOST_AUTO_TEST_CASE(TimedGrid_2D_withtime) { + // 4x4 matrix + /* + X Y O X + O Y Y X + X X Z Z + X O O X + */ + // 7 + 3 + 2 cells -> 4 + 1 + 1 clusters in total + + std::vector cells; + // X + cells.emplace_back(0ul, 0, 0, 0); + cells.emplace_back(1ul, 3, 0, 0); + cells.emplace_back(2ul, 3, 1, 0); + cells.emplace_back(3ul, 0, 2, 0); + cells.emplace_back(4ul, 1, 2, 0); + cells.emplace_back(5ul, 0, 3, 0); + cells.emplace_back(6ul, 3, 3, 0); + // Y + cells.emplace_back(7ul, 1, 0, 1); + cells.emplace_back(8ul, 1, 1, 1); + cells.emplace_back(9ul, 2, 1, 1); + // Z + cells.emplace_back(10ul, 2, 2, 2); + cells.emplace_back(11ul, 3, 2, 2); + + std::vector> expectedResults; + expectedResults.push_back({0ul}); + expectedResults.push_back({3ul, 4ul, 5ul}); + expectedResults.push_back({7ul, 8ul, 9ul}); + expectedResults.push_back({10ul, 11ul}); + expectedResults.push_back({1ul, 2ul}); + expectedResults.push_back({6ul}); + + ClusterCollection clusters = + Acts::Ccl::createClusters( + cells, Acts::Ccl::TimedConnect(0.5)); + + BOOST_CHECK_EQUAL(6ul, clusters.size()); + + std::vector sizes{1, 3, 3, 2, 2, 1}; + for (std::size_t i(0); i < clusters.size(); ++i) { + std::vector& timedIds = clusters[i].ids; + BOOST_CHECK_EQUAL(timedIds.size(), sizes[i]); + std::sort(timedIds.begin(), timedIds.end()); + + const std::vector& expected = expectedResults[i]; + BOOST_CHECK_EQUAL(timedIds.size(), expected.size()); + + for (std::size_t j(0); j < timedIds.size(); ++j) { + BOOST_CHECK_EQUAL(timedIds[j], expected[j]); + } + } +} + +BOOST_AUTO_TEST_CASE(TimedGrid_2D_noTollerance) { + // 4x4 matrix + /* + X O O X + O O O X + X X O O + X O O X + */ + // 7 cells -> 7 clusters in total + // since time requirement will never be satisfied + + std::vector cells; + cells.emplace_back(0ul, 0, 0, 0); + cells.emplace_back(1ul, 3, 0, 0); + cells.emplace_back(2ul, 3, 1, 0); + cells.emplace_back(3ul, 0, 2, 0); + cells.emplace_back(4ul, 1, 2, 0); + cells.emplace_back(5ul, 0, 3, 0); + cells.emplace_back(6ul, 3, 3, 0); + + std::vector> expectedResults; + expectedResults.push_back({0ul}); + expectedResults.push_back({3ul}); + expectedResults.push_back({5ul}); + expectedResults.push_back({4ul}); + expectedResults.push_back({1ul}); + expectedResults.push_back({2ul}); + expectedResults.push_back({6ul}); + + ClusterCollection clusters = + Acts::Ccl::createClusters( + cells, Acts::Ccl::TimedConnect(0.)); + + BOOST_CHECK_EQUAL(7ul, clusters.size()); + + for (std::size_t i(0); i < clusters.size(); ++i) { + std::vector& timedIds = clusters[i].ids; + const std::vector& expected = expectedResults[i]; + + BOOST_CHECK_EQUAL(timedIds.size(), 1); + BOOST_CHECK_EQUAL(timedIds.size(), expected.size()); + BOOST_CHECK_EQUAL(timedIds[0], expected[0]); + } +} + +} // namespace Acts::Test From a43eed33a7c0e015cd58b592e9de92410ff75867 Mon Sep 17 00:00:00 2001 From: cvarni Date: Wed, 2 Oct 2024 16:18:06 +0200 Subject: [PATCH 2/3] clang_tidy --- Core/include/Acts/Clusterization/Clusterization.hpp | 4 ++-- Core/include/Acts/Clusterization/TimedClusterization.hpp | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Core/include/Acts/Clusterization/Clusterization.hpp b/Core/include/Acts/Clusterization/Clusterization.hpp index f9b07226167..a7b4d853b20 100644 --- a/Core/include/Acts/Clusterization/Clusterization.hpp +++ b/Core/include/Acts/Clusterization/Clusterization.hpp @@ -74,14 +74,14 @@ struct DefaultConnect { template struct DefaultConnect : public Connect1D { - virtual ~DefaultConnect() = default; + ~DefaultConnect() override = default; }; template struct DefaultConnect : public Connect2D { explicit DefaultConnect(bool commonCorner) : Connect2D(commonCorner) {} DefaultConnect() = default; - virtual ~DefaultConnect() = default; + ~DefaultConnect() override = default; }; /// @brief labelClusters diff --git a/Core/include/Acts/Clusterization/TimedClusterization.hpp b/Core/include/Acts/Clusterization/TimedClusterization.hpp index 93148db0671..2844a57e90a 100644 --- a/Core/include/Acts/Clusterization/TimedClusterization.hpp +++ b/Core/include/Acts/Clusterization/TimedClusterization.hpp @@ -28,10 +28,9 @@ struct TimedConnect : public Acts::Ccl::DefaultConnect { TimedConnect(Acts::ActsScalar time); TimedConnect(Acts::ActsScalar time, bool conn) requires(N == 2); - virtual ~TimedConnect() = default; + ~TimedConnect() override = default; - virtual ConnectResult operator()(const Cell& ref, - const Cell& iter) const override; + ConnectResult operator()(const Cell& ref, const Cell& iter) const override; }; } // namespace Acts::Ccl From 225a488da8a7e85ca0bd9f8ad5e28ace7807e93d Mon Sep 17 00:00:00 2001 From: cvarni Date: Fri, 4 Oct 2024 15:13:59 +0200 Subject: [PATCH 3/3] actual changes ... --- Core/include/Acts/Clusterization/TimedClusterization.hpp | 4 ++-- Core/include/Acts/Clusterization/TimedClusterization.ipp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Core/include/Acts/Clusterization/TimedClusterization.hpp b/Core/include/Acts/Clusterization/TimedClusterization.hpp index 2844a57e90a..e92ebce44e2 100644 --- a/Core/include/Acts/Clusterization/TimedClusterization.hpp +++ b/Core/include/Acts/Clusterization/TimedClusterization.hpp @@ -22,11 +22,11 @@ concept HasRetrievableTimeInfo = requires(Cell cell) { template struct TimedConnect : public Acts::Ccl::DefaultConnect { - Acts::ActsScalar timeTollerance{std::numeric_limits::max()}; + Acts::ActsScalar timeTolerance{std::numeric_limits::max()}; TimedConnect() = default; TimedConnect(Acts::ActsScalar time); - TimedConnect(Acts::ActsScalar time, bool conn) + TimedConnect(Acts::ActsScalar time, bool commonCorner) requires(N == 2); ~TimedConnect() override = default; diff --git a/Core/include/Acts/Clusterization/TimedClusterization.ipp b/Core/include/Acts/Clusterization/TimedClusterization.ipp index cfbbe1d7ac4..0e7b3e5bda8 100644 --- a/Core/include/Acts/Clusterization/TimedClusterization.ipp +++ b/Core/include/Acts/Clusterization/TimedClusterization.ipp @@ -10,12 +10,12 @@ namespace Acts::Ccl { template TimedConnect::TimedConnect(Acts::ActsScalar time) - : timeTollerance(time) {} + : timeTolerance(time) {} template -TimedConnect::TimedConnect(Acts::ActsScalar time, bool conn) +TimedConnect::TimedConnect(Acts::ActsScalar time, bool commonCorner) requires(N == 2) - : Acts::Ccl::DefaultConnect(conn), timeTollerance(time) {} + : Acts::Ccl::DefaultConnect(commonCorner), timeTolerance(time) {} template Acts::Ccl::ConnectResult TimedConnect::operator()( @@ -26,7 +26,7 @@ Acts::Ccl::ConnectResult TimedConnect::operator()( return spaceCompatibility; } - if (std::abs(getCellTime(ref) - getCellTime(iter)) < timeTollerance) { + if (std::abs(getCellTime(ref) - getCellTime(iter)) < timeTolerance) { return Acts::Ccl::ConnectResult::eConn; }