From 40d7b37016e59f789f4bbf74cdd4f6b0c717833b Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 16:10:39 +0100 Subject: [PATCH 1/5] option one: partial statics --- .../Acts/Surfaces/BoundaryTolerance.hpp | 28 +++++++++++-------- Core/src/Geometry/TrapezoidVolumeBounds.cpp | 2 +- Core/src/Surfaces/BoundaryTolerance.cpp | 11 ++++---- Examples/Io/Root/src/RootAthenaDumpReader.cpp | 11 ++++---- Tests/Benchmarks/AnnulusBoundsBenchmark.cpp | 8 +++--- .../Benchmarks/BoundaryToleranceBenchmark.cpp | 9 +++--- .../UnitTests/Core/Seeding/PathSeederTest.cpp | 3 +- .../Core/Surfaces/BoundaryToleranceTests.cpp | 18 ++++++------ .../Core/Surfaces/CylinderBoundsTests.cpp | 7 ++--- .../Core/Surfaces/LineBoundsTests.cpp | 3 +- .../Core/Surfaces/TrapezoidBoundsTests.cpp | 2 +- 11 files changed, 55 insertions(+), 47 deletions(-) diff --git a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp index 5dfc7ad6552..1675c6a6ec9 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -55,10 +55,16 @@ namespace Acts { class BoundaryTolerance { public: /// Infinite tolerance i.e. no boundary check - struct Infinite {}; + struct InfiniteTolerance {}; + + static BoundaryTolerance Infinite() { + return BoundaryTolerance{InfiniteTolerance{}}; + } /// No tolerance i.e. exact boundary check - struct None {}; + struct NoneTolerance {}; + + static BoundaryTolerance None() { return BoundaryTolerance{NoneTolerance{}}; } /// Absolute tolerance in bound coordinates struct AbsoluteBound { @@ -119,24 +125,24 @@ class BoundaryTolerance { }; /// Underlying variant type - using Variant = std::variant; + using Variant = std::variant; /// Construct with infinite tolerance. - BoundaryTolerance(const Infinite& infinite); + explicit BoundaryTolerance(const InfiniteTolerance& infinite); /// Construct with no tolerance. - BoundaryTolerance(const None& none); + explicit BoundaryTolerance(const NoneTolerance& none); /// Construct with absolute tolerance in bound coordinates. - BoundaryTolerance(const AbsoluteBound& AbsoluteBound); + explicit BoundaryTolerance(const AbsoluteBound& AbsoluteBound); /// Construct with absolute tolerance in Cartesian coordinates. - BoundaryTolerance(const AbsoluteCartesian& absoluteCartesian); + explicit BoundaryTolerance(const AbsoluteCartesian& absoluteCartesian); /// Construct with absolute tolerance in Euclidean distance. - BoundaryTolerance(const AbsoluteEuclidean& absoluteEuclidean); + explicit BoundaryTolerance(const AbsoluteEuclidean& absoluteEuclidean); /// Construct with chi2 tolerance in bound coordinates. - BoundaryTolerance(const Chi2Bound& Chi2Bound); + explicit BoundaryTolerance(const Chi2Bound& Chi2Bound); /// Construct from variant - BoundaryTolerance(Variant variant); + explicit BoundaryTolerance(Variant variant); /// Check if the tolerance is infinite. bool isInfinite() const; diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index 2034ce6f302..fe3739963c3 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -153,7 +153,7 @@ bool TrapezoidVolumeBounds::inside(const Vector3& pos, double tol) const { } Vector2 locp(pos.x(), pos.y()); bool inside(m_faceXYTrapezoidBounds->inside( - locp, BoundaryTolerance::AbsoluteBound{tol, tol})); + locp, BoundaryTolerance{BoundaryTolerance::AbsoluteBound{tol, tol}})); return inside; } diff --git a/Core/src/Surfaces/BoundaryTolerance.cpp b/Core/src/Surfaces/BoundaryTolerance.cpp index 971a026d7de..d7c66b0fa72 100644 --- a/Core/src/Surfaces/BoundaryTolerance.cpp +++ b/Core/src/Surfaces/BoundaryTolerance.cpp @@ -15,10 +15,11 @@ namespace Acts { -BoundaryTolerance::BoundaryTolerance(const Infinite& infinite) +BoundaryTolerance::BoundaryTolerance(const InfiniteTolerance& infinite) : m_variant{infinite} {} -BoundaryTolerance::BoundaryTolerance(const None& none) : m_variant{none} {} +BoundaryTolerance::BoundaryTolerance(const NoneTolerance& none) + : m_variant{none} {} BoundaryTolerance::BoundaryTolerance(const AbsoluteBound& absoluteBound) : m_variant{absoluteBound} {} @@ -36,15 +37,15 @@ BoundaryTolerance::BoundaryTolerance(Variant variant) : m_variant{std::move(variant)} {} bool BoundaryTolerance::isInfinite() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::isNone() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::hasAbsoluteBound(bool isCartesian) const { - return holdsVariant() || holdsVariant() || + return holdsVariant() || holdsVariant() || (isCartesian && holdsVariant()); } diff --git a/Examples/Io/Root/src/RootAthenaDumpReader.cpp b/Examples/Io/Root/src/RootAthenaDumpReader.cpp index 421affa36ba..80c6482228d 100644 --- a/Examples/Io/Root/src/RootAthenaDumpReader.cpp +++ b/Examples/Io/Root/src/RootAthenaDumpReader.cpp @@ -11,6 +11,7 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/SourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" +#include "Acts/Surfaces/BoundaryTolerance.hpp" #include "Acts/Utilities/Zip.hpp" #include "ActsExamples/EventData/Cluster.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" @@ -396,11 +397,11 @@ RootAthenaDumpReader::readMeasurements( continue; } - bool inside = - surface->isOnSurface(gctx, cluster.globalPosition, {}, - Acts::BoundaryTolerance::AbsoluteEuclidean{ - m_cfg.absBoundaryTolerance}, - std::numeric_limits::max()); + bool inside = surface->isOnSurface( + gctx, cluster.globalPosition, {}, + Acts::BoundaryTolerance{Acts::BoundaryTolerance::AbsoluteEuclidean{ + m_cfg.absBoundaryTolerance}}, + std::numeric_limits::max()); if (!inside) { const Acts::Vector3 v = diff --git a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp index 4d89df9bb41..2dce9f8aff4 100644 --- a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp +++ b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp @@ -56,10 +56,10 @@ int main(int /*argc*/, char** /*argv[]*/) { cov << 1.0, 0, 0, 0.05; BoundaryTolerance bcAbs = BoundaryTolerance::None(); - BoundaryTolerance bcTol0 = BoundaryTolerance::AbsoluteBound{1.0, 0}; - BoundaryTolerance bcTol1 = BoundaryTolerance::AbsoluteBound{0, 0.2}; - BoundaryTolerance bcTol01 = BoundaryTolerance::AbsoluteBound{1.0, 0.2}; - BoundaryTolerance bcCov = BoundaryTolerance::Chi2Bound{cov, 1}; + BoundaryTolerance bcTol0{BoundaryTolerance::AbsoluteBound{1.0, 0}}; + BoundaryTolerance bcTol1{BoundaryTolerance::AbsoluteBound{0, 0.2}}; + BoundaryTolerance bcTol01{BoundaryTolerance::AbsoluteBound{1.0, 0.2}}; + BoundaryTolerance bcCov{BoundaryTolerance::Chi2Bound{cov, 1}}; // visualization to make sense of things for (std::size_t i = 0; i < 10000; i++) { diff --git a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp index f18a32070be..1cc3cadf713 100644 --- a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp +++ b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp @@ -141,10 +141,11 @@ int main(int /*argc*/, char** /*argv[]*/) { // Benchmark scenarios run_all_benches(BoundaryTolerance::Infinite(), "No check", Mode::None); run_all_benches(BoundaryTolerance::None(), "No tolerance", Mode::FastOutside); - run_all_benches(BoundaryTolerance::AbsoluteBound(0.6, 0.45), "Abs. tolerance", - Mode::SlowOutside); - run_all_benches(BoundaryTolerance::Chi2Bound(cov, 3.0), "Cov. tolerance", - Mode::SlowOutside); + run_all_benches( + BoundaryTolerance{BoundaryTolerance::AbsoluteBound(0.6, 0.45)}, + "Abs. tolerance", Mode::SlowOutside); + run_all_benches(BoundaryTolerance{BoundaryTolerance::Chi2Bound(cov, 3.0)}, + "Cov. tolerance", Mode::SlowOutside); return 0; } diff --git a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp index 0162fb78525..e1b5d951ae5 100644 --- a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp +++ b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp @@ -78,7 +78,8 @@ class NoFieldIntersectionFinder { // Get the intersection auto sMultiIntersection = surface->intersect( geoCtx, position, direction, - BoundaryTolerance::AbsoluteCartesian(m_tol, m_tol)); + BoundaryTolerance{ + BoundaryTolerance::AbsoluteCartesian(m_tol, m_tol)}); // Take the closest auto closestForward = sMultiIntersection.closestForward(); diff --git a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp index e80035a10a8..17a0c95438d 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -132,8 +132,8 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxToleranceLoc0) { em.execute([]() { Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::AbsoluteBound( - 1.5, std::numeric_limits::infinity()); + BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound( + 1.5, std::numeric_limits::infinity())}; BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) { cov << 1, 0.5, 0.5, 2; Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 3.); + BoundaryTolerance tolerance{BoundaryTolerance::Chi2Bound(cov.inverse(), 3.)}; BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckTriangleCovariance) { Vector2 vertices[] = {{-2, 0}, {2, 0}, {0, 2}}; SquareMatrix2 cov; cov << 0.5, 0, 0, 0.5; - auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 4.1); + BoundaryTolerance tolerance{BoundaryTolerance::Chi2Bound(cov.inverse(), 4.1)}; BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 1}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 2}, std::nullopt)); @@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::AbsoluteBound(0.5, 0.5); + BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound(0.5, 0.5)}; BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::AbsoluteCartesian(0.5, 0.5); + BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteCartesian(0.5, 0.5)}; BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::AbsoluteEuclidean(1.1); + BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteEuclidean(1.1)}; BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -271,8 +271,8 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = - BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.); + BoundaryTolerance tolerance{ + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.)}; BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( diff --git a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp index 6cc6bc8da82..4753e5875a3 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -124,10 +124,9 @@ BOOST_AUTO_TEST_CASE(CylinderBoundsProperties) { const Vector2 unitPhi{1., 0.}; const Vector2 withinBevelMin{0.5, -20.012}; const Vector2 outsideBevelMin{0.5, -40.}; - const BoundaryTolerance tolerance = - BoundaryTolerance::AbsoluteBound(0.1, 0.1); - const BoundaryTolerance lessTolerance = - BoundaryTolerance::AbsoluteBound(0.01, 0.01); + const BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound(0.1, 0.1)}; + const BoundaryTolerance lessTolerance{ + BoundaryTolerance::AbsoluteBound(0.01, 0.01)}; BOOST_CHECK(cylinderBoundsObject.inside(atPiBy2, tolerance)); BOOST_CHECK(!cylinderBoundsSegment.inside(unitPhi, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp index c8022a9174c..99a656ddf76 100644 --- a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp @@ -90,8 +90,7 @@ BOOST_AUTO_TEST_CASE(LineBoundsProperties) { const Vector2 beyondEnd{0., 30.}; const Vector2 unitZ{0., 1.}; const Vector2 unitR{1., 0.}; - const BoundaryTolerance tolerance = - BoundaryTolerance::AbsoluteBound(0.1, 0.1); + const BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound(0.1, 0.1)}; // This fails because the bounds are not inclusive. BOOST_CHECK(!lineBoundsObject.inside(atRadius, tolerance)); BOOST_CHECK(!lineBoundsObject.inside(beyondEnd, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp index 52155fec5fe..250991fb3af 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -189,7 +189,7 @@ BOOST_DATA_TEST_CASE( BoundaryTolerance tolerance = BoundaryTolerance::None(); if (tol != 0.) { - tolerance = BoundaryTolerance::AbsoluteBound{tol, tol}; + tolerance = BoundaryTolerance{BoundaryTolerance::AbsoluteBound{tol, tol}}; } BOOST_CHECK_EQUAL( From 951feed066a896140144a10f9a9821761189196a Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 16:10:46 +0100 Subject: [PATCH 2/5] Revert "option one: partial statics" This reverts commit 569e122be9c5ede47a9bc02652b85ab3df062ff4. --- .../Acts/Surfaces/BoundaryTolerance.hpp | 28 ++++++++----------- Core/src/Geometry/TrapezoidVolumeBounds.cpp | 2 +- Core/src/Surfaces/BoundaryTolerance.cpp | 11 ++++---- Examples/Io/Root/src/RootAthenaDumpReader.cpp | 11 ++++---- Tests/Benchmarks/AnnulusBoundsBenchmark.cpp | 8 +++--- .../Benchmarks/BoundaryToleranceBenchmark.cpp | 9 +++--- .../UnitTests/Core/Seeding/PathSeederTest.cpp | 3 +- .../Core/Surfaces/BoundaryToleranceTests.cpp | 18 ++++++------ .../Core/Surfaces/CylinderBoundsTests.cpp | 7 +++-- .../Core/Surfaces/LineBoundsTests.cpp | 3 +- .../Core/Surfaces/TrapezoidBoundsTests.cpp | 2 +- 11 files changed, 47 insertions(+), 55 deletions(-) diff --git a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp index 1675c6a6ec9..5dfc7ad6552 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -55,16 +55,10 @@ namespace Acts { class BoundaryTolerance { public: /// Infinite tolerance i.e. no boundary check - struct InfiniteTolerance {}; - - static BoundaryTolerance Infinite() { - return BoundaryTolerance{InfiniteTolerance{}}; - } + struct Infinite {}; /// No tolerance i.e. exact boundary check - struct NoneTolerance {}; - - static BoundaryTolerance None() { return BoundaryTolerance{NoneTolerance{}}; } + struct None {}; /// Absolute tolerance in bound coordinates struct AbsoluteBound { @@ -125,24 +119,24 @@ class BoundaryTolerance { }; /// Underlying variant type - using Variant = std::variant; + using Variant = std::variant; /// Construct with infinite tolerance. - explicit BoundaryTolerance(const InfiniteTolerance& infinite); + BoundaryTolerance(const Infinite& infinite); /// Construct with no tolerance. - explicit BoundaryTolerance(const NoneTolerance& none); + BoundaryTolerance(const None& none); /// Construct with absolute tolerance in bound coordinates. - explicit BoundaryTolerance(const AbsoluteBound& AbsoluteBound); + BoundaryTolerance(const AbsoluteBound& AbsoluteBound); /// Construct with absolute tolerance in Cartesian coordinates. - explicit BoundaryTolerance(const AbsoluteCartesian& absoluteCartesian); + BoundaryTolerance(const AbsoluteCartesian& absoluteCartesian); /// Construct with absolute tolerance in Euclidean distance. - explicit BoundaryTolerance(const AbsoluteEuclidean& absoluteEuclidean); + BoundaryTolerance(const AbsoluteEuclidean& absoluteEuclidean); /// Construct with chi2 tolerance in bound coordinates. - explicit BoundaryTolerance(const Chi2Bound& Chi2Bound); + BoundaryTolerance(const Chi2Bound& Chi2Bound); /// Construct from variant - explicit BoundaryTolerance(Variant variant); + BoundaryTolerance(Variant variant); /// Check if the tolerance is infinite. bool isInfinite() const; diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index fe3739963c3..2034ce6f302 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -153,7 +153,7 @@ bool TrapezoidVolumeBounds::inside(const Vector3& pos, double tol) const { } Vector2 locp(pos.x(), pos.y()); bool inside(m_faceXYTrapezoidBounds->inside( - locp, BoundaryTolerance{BoundaryTolerance::AbsoluteBound{tol, tol}})); + locp, BoundaryTolerance::AbsoluteBound{tol, tol})); return inside; } diff --git a/Core/src/Surfaces/BoundaryTolerance.cpp b/Core/src/Surfaces/BoundaryTolerance.cpp index d7c66b0fa72..971a026d7de 100644 --- a/Core/src/Surfaces/BoundaryTolerance.cpp +++ b/Core/src/Surfaces/BoundaryTolerance.cpp @@ -15,11 +15,10 @@ namespace Acts { -BoundaryTolerance::BoundaryTolerance(const InfiniteTolerance& infinite) +BoundaryTolerance::BoundaryTolerance(const Infinite& infinite) : m_variant{infinite} {} -BoundaryTolerance::BoundaryTolerance(const NoneTolerance& none) - : m_variant{none} {} +BoundaryTolerance::BoundaryTolerance(const None& none) : m_variant{none} {} BoundaryTolerance::BoundaryTolerance(const AbsoluteBound& absoluteBound) : m_variant{absoluteBound} {} @@ -37,15 +36,15 @@ BoundaryTolerance::BoundaryTolerance(Variant variant) : m_variant{std::move(variant)} {} bool BoundaryTolerance::isInfinite() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::isNone() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::hasAbsoluteBound(bool isCartesian) const { - return holdsVariant() || holdsVariant() || + return holdsVariant() || holdsVariant() || (isCartesian && holdsVariant()); } diff --git a/Examples/Io/Root/src/RootAthenaDumpReader.cpp b/Examples/Io/Root/src/RootAthenaDumpReader.cpp index 80c6482228d..421affa36ba 100644 --- a/Examples/Io/Root/src/RootAthenaDumpReader.cpp +++ b/Examples/Io/Root/src/RootAthenaDumpReader.cpp @@ -11,7 +11,6 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/SourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" -#include "Acts/Surfaces/BoundaryTolerance.hpp" #include "Acts/Utilities/Zip.hpp" #include "ActsExamples/EventData/Cluster.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" @@ -397,11 +396,11 @@ RootAthenaDumpReader::readMeasurements( continue; } - bool inside = surface->isOnSurface( - gctx, cluster.globalPosition, {}, - Acts::BoundaryTolerance{Acts::BoundaryTolerance::AbsoluteEuclidean{ - m_cfg.absBoundaryTolerance}}, - std::numeric_limits::max()); + bool inside = + surface->isOnSurface(gctx, cluster.globalPosition, {}, + Acts::BoundaryTolerance::AbsoluteEuclidean{ + m_cfg.absBoundaryTolerance}, + std::numeric_limits::max()); if (!inside) { const Acts::Vector3 v = diff --git a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp index 2dce9f8aff4..4d89df9bb41 100644 --- a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp +++ b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp @@ -56,10 +56,10 @@ int main(int /*argc*/, char** /*argv[]*/) { cov << 1.0, 0, 0, 0.05; BoundaryTolerance bcAbs = BoundaryTolerance::None(); - BoundaryTolerance bcTol0{BoundaryTolerance::AbsoluteBound{1.0, 0}}; - BoundaryTolerance bcTol1{BoundaryTolerance::AbsoluteBound{0, 0.2}}; - BoundaryTolerance bcTol01{BoundaryTolerance::AbsoluteBound{1.0, 0.2}}; - BoundaryTolerance bcCov{BoundaryTolerance::Chi2Bound{cov, 1}}; + BoundaryTolerance bcTol0 = BoundaryTolerance::AbsoluteBound{1.0, 0}; + BoundaryTolerance bcTol1 = BoundaryTolerance::AbsoluteBound{0, 0.2}; + BoundaryTolerance bcTol01 = BoundaryTolerance::AbsoluteBound{1.0, 0.2}; + BoundaryTolerance bcCov = BoundaryTolerance::Chi2Bound{cov, 1}; // visualization to make sense of things for (std::size_t i = 0; i < 10000; i++) { diff --git a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp index 1cc3cadf713..f18a32070be 100644 --- a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp +++ b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp @@ -141,11 +141,10 @@ int main(int /*argc*/, char** /*argv[]*/) { // Benchmark scenarios run_all_benches(BoundaryTolerance::Infinite(), "No check", Mode::None); run_all_benches(BoundaryTolerance::None(), "No tolerance", Mode::FastOutside); - run_all_benches( - BoundaryTolerance{BoundaryTolerance::AbsoluteBound(0.6, 0.45)}, - "Abs. tolerance", Mode::SlowOutside); - run_all_benches(BoundaryTolerance{BoundaryTolerance::Chi2Bound(cov, 3.0)}, - "Cov. tolerance", Mode::SlowOutside); + run_all_benches(BoundaryTolerance::AbsoluteBound(0.6, 0.45), "Abs. tolerance", + Mode::SlowOutside); + run_all_benches(BoundaryTolerance::Chi2Bound(cov, 3.0), "Cov. tolerance", + Mode::SlowOutside); return 0; } diff --git a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp index e1b5d951ae5..0162fb78525 100644 --- a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp +++ b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp @@ -78,8 +78,7 @@ class NoFieldIntersectionFinder { // Get the intersection auto sMultiIntersection = surface->intersect( geoCtx, position, direction, - BoundaryTolerance{ - BoundaryTolerance::AbsoluteCartesian(m_tol, m_tol)}); + BoundaryTolerance::AbsoluteCartesian(m_tol, m_tol)); // Take the closest auto closestForward = sMultiIntersection.closestForward(); diff --git a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp index 17a0c95438d..e80035a10a8 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -132,8 +132,8 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxToleranceLoc0) { em.execute([]() { Vector2 ll(-1, -1); Vector2 ur(1, 1); - BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound( - 1.5, std::numeric_limits::infinity())}; + auto tolerance = BoundaryTolerance::AbsoluteBound( + 1.5, std::numeric_limits::infinity()); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) { cov << 1, 0.5, 0.5, 2; Vector2 ll(-1, -1); Vector2 ur(1, 1); - BoundaryTolerance tolerance{BoundaryTolerance::Chi2Bound(cov.inverse(), 3.)}; + auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 3.); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckTriangleCovariance) { Vector2 vertices[] = {{-2, 0}, {2, 0}, {0, 2}}; SquareMatrix2 cov; cov << 0.5, 0, 0, 0.5; - BoundaryTolerance tolerance{BoundaryTolerance::Chi2Bound(cov.inverse(), 4.1)}; + auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 4.1); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 1}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 2}, std::nullopt)); @@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound(0.5, 0.5)}; + auto tolerance = BoundaryTolerance::AbsoluteBound(0.5, 0.5); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteCartesian(0.5, 0.5)}; + auto tolerance = BoundaryTolerance::AbsoluteCartesian(0.5, 0.5); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteEuclidean(1.1)}; + auto tolerance = BoundaryTolerance::AbsoluteEuclidean(1.1); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -271,8 +271,8 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - BoundaryTolerance tolerance{ - BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.)}; + auto tolerance = + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( diff --git a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp index 4753e5875a3..6cc6bc8da82 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -124,9 +124,10 @@ BOOST_AUTO_TEST_CASE(CylinderBoundsProperties) { const Vector2 unitPhi{1., 0.}; const Vector2 withinBevelMin{0.5, -20.012}; const Vector2 outsideBevelMin{0.5, -40.}; - const BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound(0.1, 0.1)}; - const BoundaryTolerance lessTolerance{ - BoundaryTolerance::AbsoluteBound(0.01, 0.01)}; + const BoundaryTolerance tolerance = + BoundaryTolerance::AbsoluteBound(0.1, 0.1); + const BoundaryTolerance lessTolerance = + BoundaryTolerance::AbsoluteBound(0.01, 0.01); BOOST_CHECK(cylinderBoundsObject.inside(atPiBy2, tolerance)); BOOST_CHECK(!cylinderBoundsSegment.inside(unitPhi, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp index 99a656ddf76..c8022a9174c 100644 --- a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp @@ -90,7 +90,8 @@ BOOST_AUTO_TEST_CASE(LineBoundsProperties) { const Vector2 beyondEnd{0., 30.}; const Vector2 unitZ{0., 1.}; const Vector2 unitR{1., 0.}; - const BoundaryTolerance tolerance{BoundaryTolerance::AbsoluteBound(0.1, 0.1)}; + const BoundaryTolerance tolerance = + BoundaryTolerance::AbsoluteBound(0.1, 0.1); // This fails because the bounds are not inclusive. BOOST_CHECK(!lineBoundsObject.inside(atRadius, tolerance)); BOOST_CHECK(!lineBoundsObject.inside(beyondEnd, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp index 250991fb3af..52155fec5fe 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -189,7 +189,7 @@ BOOST_DATA_TEST_CASE( BoundaryTolerance tolerance = BoundaryTolerance::None(); if (tol != 0.) { - tolerance = BoundaryTolerance{BoundaryTolerance::AbsoluteBound{tol, tol}}; + tolerance = BoundaryTolerance::AbsoluteBound{tol, tol}; } BOOST_CHECK_EQUAL( From 39dd4bcae6712cced60fe9ba80adeb39184d7eb5 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 16:30:05 +0100 Subject: [PATCH 3/5] option two: additional factories --- .../MultiComponentTrackParameters.hpp | 2 +- Core/include/Acts/Geometry/GridPortalLink.hpp | 2 +- .../include/Acts/Geometry/NavigationLayer.hpp | 2 +- .../Navigation/NavigationStateFillers.hpp | 2 +- .../Navigation/NavigationStateUpdaters.hpp | 2 +- .../Acts/Propagator/MultiEigenStepperLoop.hpp | 2 +- .../Acts/Propagator/MultiEigenStepperLoop.ipp | 2 +- .../Acts/Propagator/TryAllNavigator.hpp | 2 +- .../Propagator/detail/NavigationHelpers.hpp | 6 +- .../Acts/Surfaces/BoundaryTolerance.hpp | 102 ++++++++++-------- Core/include/Acts/Surfaces/ConeBounds.hpp | 2 +- Core/include/Acts/Surfaces/ConeSurface.hpp | 2 +- .../Acts/Surfaces/DiscTrapezoidBounds.hpp | 2 +- .../Acts/TrackFitting/GaussianSumFitter.hpp | 2 +- .../Acts/TrackFitting/KalmanFitter.hpp | 2 +- Core/include/Acts/Utilities/TrackHelpers.hpp | 2 +- .../CorrectedTransformationFreeToBound.cpp | 2 +- Core/src/Geometry/CompositePortalLink.cpp | 4 +- Core/src/Geometry/Layer.cpp | 2 +- Core/src/Geometry/TrapezoidVolumeBounds.cpp | 2 +- Core/src/Geometry/TrivialPortalLink.cpp | 2 +- .../Material/IntersectionMaterialAssigner.cpp | 2 +- Core/src/Navigation/NavigationStream.cpp | 6 +- Core/src/Surfaces/ConeSurface.cpp | 2 +- Core/src/Surfaces/CylinderSurface.cpp | 2 +- Core/src/Surfaces/DiscSurface.cpp | 4 +- Core/src/Surfaces/LineSurface.cpp | 6 +- Core/src/Surfaces/Surface.cpp | 6 +- Core/src/Vertexing/HelicalTrackLinearizer.cpp | 2 +- Core/src/Vertexing/ImpactPointEstimator.cpp | 4 +- .../Vertexing/NumericalTrackLinearizer.cpp | 4 +- Examples/Io/Root/src/RootAthenaDumpReader.cpp | 4 +- .../Io/Root/src/RootMaterialTrackWriter.cpp | 2 +- .../Io/Root/src/RootTrackSummaryWriter.cpp | 2 +- Examples/Io/Root/src/VertexNTupleWriter.cpp | 2 +- Fatras/src/Digitization/PlanarSurfaceMask.cpp | 8 +- Tests/Benchmarks/AnnulusBoundsBenchmark.cpp | 10 +- .../Benchmarks/BoundaryToleranceBenchmark.cpp | 8 +- .../SurfaceIntersectionBenchmark.cpp | 2 +- .../IntegrationTests/NavigatorConsistency.cpp | 4 +- .../CorrectedTransformFreeToBoundTests.cpp | 2 +- .../GenericApproachDescriptorTests.cpp | 4 +- .../Core/Geometry/NavigationLayerTests.cpp | 4 +- .../Core/Material/MaterialMapperTests.cpp | 2 +- .../Core/Material/MaterialValidaterTests.cpp | 2 +- .../Core/Navigation/NavigationStreamTests.cpp | 28 ++--- .../Core/Propagator/EigenStepperTests.cpp | 4 +- .../UnitTests/Core/Seeding/PathSeederTest.cpp | 2 +- .../Core/Surfaces/AnnulusBoundsTests.cpp | 10 +- .../Core/Surfaces/BoundaryToleranceTests.cpp | 22 ++-- .../Core/Surfaces/ConeSurfaceTests.cpp | 4 +- .../Surfaces/ConvexPolygonBoundsTests.cpp | 4 +- .../Core/Surfaces/CylinderBoundsTests.cpp | 4 +- .../Core/Surfaces/CylinderSurfaceTests.cpp | 10 +- .../Core/Surfaces/DiamondBoundsTests.cpp | 4 +- .../Core/Surfaces/DiscSurfaceTests.cpp | 10 +- .../Surfaces/DiscTrapezoidBoundsTests.cpp | 4 +- .../Core/Surfaces/EllipseBoundsTests.cpp | 4 +- .../Core/Surfaces/InfiniteBoundsTests.cpp | 2 +- .../Core/Surfaces/LineBoundsTests.cpp | 2 +- .../Core/Surfaces/LineSurfaceTests.cpp | 6 +- .../Core/Surfaces/PlaneSurfaceTests.cpp | 18 ++-- .../Core/Surfaces/RadialBoundsTests.cpp | 4 +- .../Core/Surfaces/RectangleBoundsTests.cpp | 2 +- .../Surfaces/SurfaceIntersectionTests.cpp | 40 +++---- .../UnitTests/Core/Surfaces/SurfaceTests.cpp | 4 +- .../Core/Surfaces/TrapezoidBoundsTests.cpp | 10 +- .../TrackFitting/GsfComponentMergingTests.cpp | 2 +- .../Vertexing/ImpactPointEstimatorTests.cpp | 2 +- 69 files changed, 227 insertions(+), 217 deletions(-) diff --git a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp index 5e079af0df7..694541e81db 100644 --- a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp +++ b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp @@ -269,7 +269,7 @@ class MultiComponentCurvilinearTrackParameters // Project the position onto the surface, keep everything else as is for (const auto& [w, pos4, dir, qop, cov] : curvi) { Vector3 newPos = s->intersect(gctx, pos4.template segment<3>(eFreePos0), - dir, BoundaryTolerance::Infinite()) + dir, BoundaryTolerance::infinite()) .closest() .position(); diff --git a/Core/include/Acts/Geometry/GridPortalLink.hpp b/Core/include/Acts/Geometry/GridPortalLink.hpp index 7ba790b4d82..ca0e7bce08b 100644 --- a/Core/include/Acts/Geometry/GridPortalLink.hpp +++ b/Core/include/Acts/Geometry/GridPortalLink.hpp @@ -539,7 +539,7 @@ class GridPortalLinkT : public GridPortalLink { Result resolveVolume( const GeometryContext& /*gctx*/, const Vector2& position, double /*tolerance*/ = s_onSurfaceTolerance) const override { - assert(surface().insideBounds(position, BoundaryTolerance::None())); + assert(surface().insideBounds(position, BoundaryTolerance::none())); return m_grid.atPosition(m_projection(position)); } diff --git a/Core/include/Acts/Geometry/NavigationLayer.hpp b/Core/include/Acts/Geometry/NavigationLayer.hpp index 63536280a5a..ccd3bd99ada 100644 --- a/Core/include/Acts/Geometry/NavigationLayer.hpp +++ b/Core/include/Acts/Geometry/NavigationLayer.hpp @@ -77,7 +77,7 @@ class NavigationLayer : public Layer { /// @return boolean that indicates if the position is on surface bool isOnLayer(const GeometryContext& gctx, const Vector3& gp, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::None()) const final; + BoundaryTolerance::none()) const final; /// Accept layer according to the following collection directives /// diff --git a/Core/include/Acts/Navigation/NavigationStateFillers.hpp b/Core/include/Acts/Navigation/NavigationStateFillers.hpp index 74e6f3e7fb6..6d1dd540bd5 100644 --- a/Core/include/Acts/Navigation/NavigationStateFillers.hpp +++ b/Core/include/Acts/Navigation/NavigationStateFillers.hpp @@ -69,7 +69,7 @@ struct PortalsFiller { std::for_each(portals.begin(), portals.end(), [&](const auto& p) { nState.surfaceCandidates.push_back(NavigationState::SurfaceCandidate{ ObjectIntersection::invalid(), nullptr, p, - BoundaryTolerance::None()}); + BoundaryTolerance::none()}); }); } }; diff --git a/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp b/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp index 664c9c99166..1311d191b07 100644 --- a/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp +++ b/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp @@ -54,7 +54,7 @@ inline void intitializeCandidates(const GeometryContext& gctx, sc.portal != nullptr ? s_onSurfaceTolerance : nState.overstepTolerance; // Boundary tolerance is forced to 0 for portals BoundaryTolerance boundaryTolerance = - sc.portal != nullptr ? BoundaryTolerance::None() : sc.boundaryTolerance; + sc.portal != nullptr ? BoundaryTolerance::none() : sc.boundaryTolerance; // Check the surface intersection auto sIntersection = surface.intersect( gctx, position, direction, boundaryTolerance, s_onSurfaceTolerance); diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index 6e1364a16e4..706fc6a9647 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -588,7 +588,7 @@ class MultiEigenStepperLoop : public EigenStepper { component.state.options.geoContext, SingleStepper::position(component.state), direction * SingleStepper::direction(component.state), - BoundaryTolerance::None())[oIntersection.index()]; + BoundaryTolerance::none())[oIntersection.index()]; SingleStepper::updateStepSize(component.state, intersection, direction, stype); diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp index 01b392dbf2a..9e708991762 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp @@ -37,7 +37,7 @@ auto MultiEigenStepperLoop::boundState( .intersect(state.options.geoContext, cmpState.pars.template segment<3>(eFreePos0), cmpState.pars.template segment<3>(eFreeDir0), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest() .position(); diff --git a/Core/include/Acts/Propagator/TryAllNavigator.hpp b/Core/include/Acts/Propagator/TryAllNavigator.hpp index 84686bcee99..4d22d160014 100644 --- a/Core/include/Acts/Propagator/TryAllNavigator.hpp +++ b/Core/include/Acts/Propagator/TryAllNavigator.hpp @@ -51,7 +51,7 @@ class TryAllNavigatorBase { /// Which boundary checks to perform for surface approach BoundaryTolerance boundaryToleranceSurfaceApproach = - BoundaryTolerance::None(); + BoundaryTolerance::none(); }; /// @brief Options for this Navigator diff --git a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp index 646606132b9..79f3c7610a0 100644 --- a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp +++ b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp @@ -111,7 +111,7 @@ inline void emplaceAllVolumeCandidates( for (const auto& boundary : boundaries) { addCandidate(boundary.get(), &boundary->surfaceRepresentation(), - BoundaryTolerance::None()); + BoundaryTolerance::none()); } } @@ -131,7 +131,7 @@ inline void emplaceAllVolumeCandidates( if (!resolveSensitive || layer->surfaceRepresentation().surfaceMaterial() != nullptr) { addCandidate(layer.get(), &layer->surfaceRepresentation(), - BoundaryTolerance::None()); + BoundaryTolerance::none()); } if (layer->approachDescriptor() != nullptr) { @@ -139,7 +139,7 @@ inline void emplaceAllVolumeCandidates( layer->approachDescriptor()->containedSurfaces(); for (const auto& approach : approaches) { - addCandidate(layer.get(), approach, BoundaryTolerance::None()); + addCandidate(layer.get(), approach, BoundaryTolerance::none()); } } diff --git a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp index 5dfc7ad6552..d21cd387af5 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -53,20 +53,17 @@ namespace Acts { /// coordinates. /// class BoundaryTolerance { - public: - /// Infinite tolerance i.e. no boundary check - struct Infinite {}; + private: + struct InfiniteParams {}; - /// No tolerance i.e. exact boundary check - struct None {}; + struct NoneParams {}; - /// Absolute tolerance in bound coordinates - struct AbsoluteBound { + struct AbsoluteBoundParams { double tolerance0{}; double tolerance1{}; - AbsoluteBound() = default; - AbsoluteBound(double tolerance0_, double tolerance1_) + AbsoluteBoundParams() = default; + AbsoluteBoundParams(double tolerance0_, double tolerance1_) : tolerance0(tolerance0_), tolerance1(tolerance1_) { if (tolerance0 < 0 || tolerance1 < 0) { throw std::invalid_argument( @@ -75,13 +72,12 @@ class BoundaryTolerance { } }; - /// Absolute tolerance in Cartesian coordinates - struct AbsoluteCartesian { + struct AbsoluteCartesianParams { double tolerance0{}; double tolerance1{}; - AbsoluteCartesian() = default; - AbsoluteCartesian(double tolerance0_, double tolerance1_) + AbsoluteCartesianParams() = default; + AbsoluteCartesianParams(double tolerance0_, double tolerance1_) : tolerance0(tolerance0_), tolerance1(tolerance1_) { if (tolerance0 < 0 || tolerance1 < 0) { throw std::invalid_argument( @@ -94,50 +90,64 @@ class BoundaryTolerance { } }; - /// Absolute tolerance in Euclidean distance - struct AbsoluteEuclidean { + struct AbsoluteEuclideanParams { double tolerance{}; - AbsoluteEuclidean() = default; - explicit AbsoluteEuclidean(double tolerance_) : tolerance(tolerance_) {} + AbsoluteEuclideanParams() = default; + explicit AbsoluteEuclideanParams(double tolerance_) + : tolerance(tolerance_) {} }; - /// Chi2 tolerance in bound coordinates - struct Chi2Bound { + struct Chi2BoundParams { double maxChi2{}; SquareMatrix2 weight = SquareMatrix2::Identity(); - Chi2Bound() = default; - Chi2Bound(const SquareMatrix2& weight_, double maxChi2_) + Chi2BoundParams() = default; + Chi2BoundParams(const SquareMatrix2& weight_, double maxChi2_) : maxChi2(maxChi2_), weight(weight_) {} }; + /// Underlying variant type + using Variant = std::variant; + + /// Construct from variant + explicit BoundaryTolerance(Variant variant); + + public: + /// Infinite tolerance i.e. no boundary check + static auto Infinite() { return BoundaryTolerance{InfiniteParams{}}; } + + /// No tolerance i.e. exact boundary check + static auto None() { return BoundaryTolerance{NoneParams{}}; } + + /// Absolute tolerance in bound coordinates + static auto AbsoluteBound(double tolerance0, double tolerance1) { + return BoundaryTolerance{AbsoluteBoundParams{tolerance0, tolerance1}}; + } + + /// Absolute tolerance in Cartesian coordinates + static auto absoluteCartesian(double tolerance0, double tolerance1) { + return BoundaryTolerance{AbsoluteCartesianParams{tolerance0, tolerance1}}; + } + + /// Absolute tolerance in Euclidean distance + static auto absoluteEuclidean(double tolerance) { + return BoundaryTolerance{AbsoluteEuclideanParams{tolerance}}; + } + + /// Chi2 tolerance in bound coordinates + static auto Chi2Bound(const SquareMatrix2& weight, double maxChi2) { + return BoundaryTolerance{Chi2BoundParams{weight, maxChi2}}; + } + enum class ToleranceMode { Extend, // Extend the boundary None, // No tolerance Shrink // Shrink the boundary }; - /// Underlying variant type - using Variant = std::variant; - - /// Construct with infinite tolerance. - BoundaryTolerance(const Infinite& infinite); - /// Construct with no tolerance. - BoundaryTolerance(const None& none); - /// Construct with absolute tolerance in bound coordinates. - BoundaryTolerance(const AbsoluteBound& AbsoluteBound); - /// Construct with absolute tolerance in Cartesian coordinates. - BoundaryTolerance(const AbsoluteCartesian& absoluteCartesian); - /// Construct with absolute tolerance in Euclidean distance. - BoundaryTolerance(const AbsoluteEuclidean& absoluteEuclidean); - /// Construct with chi2 tolerance in bound coordinates. - BoundaryTolerance(const Chi2Bound& Chi2Bound); - - /// Construct from variant - BoundaryTolerance(Variant variant); - /// Check if the tolerance is infinite. bool isInfinite() const; /// Check if the is no tolerance. @@ -155,16 +165,16 @@ class BoundaryTolerance { ToleranceMode toleranceMode() const; /// Get the tolerance as absolute bound. - AbsoluteBound asAbsoluteBound(bool isCartesian = false) const; + AbsoluteBoundParams asAbsoluteBound(bool isCartesian = false) const; /// Get the tolerance as absolute Cartesian. - const AbsoluteCartesian& asAbsoluteCartesian() const; + const AbsoluteCartesianParams& asAbsoluteCartesian() const; /// Get the tolerance as absolute Euclidean. - const AbsoluteEuclidean& asAbsoluteEuclidean() const; + const AbsoluteEuclideanParams& asAbsoluteEuclidean() const; /// Get the tolerance as chi2 bound. - const Chi2Bound& asChi2Bound() const; + const Chi2BoundParams& asChi2Bound() const; /// Get the tolerance as absolute bound if possible. - std::optional asAbsoluteBoundOpt( + std::optional asAbsoluteBoundOpt( bool isCartesian = false) const; /// Check if the distance is tolerated. diff --git a/Core/include/Acts/Surfaces/ConeBounds.hpp b/Core/include/Acts/Surfaces/ConeBounds.hpp index 7d852f2df87..f4f214fbe94 100644 --- a/Core/include/Acts/Surfaces/ConeBounds.hpp +++ b/Core/include/Acts/Surfaces/ConeBounds.hpp @@ -85,7 +85,7 @@ class ConeBounds : public SurfaceBounds { /// @return is a boolean indicating if the position is inside bool inside(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::None()) const final; + BoundaryTolerance::none()) const final; /// Output Method for std::ostream /// diff --git a/Core/include/Acts/Surfaces/ConeSurface.hpp b/Core/include/Acts/Surfaces/ConeSurface.hpp index 6f7886e2063..71755cc2c67 100644 --- a/Core/include/Acts/Surfaces/ConeSurface.hpp +++ b/Core/include/Acts/Surfaces/ConeSurface.hpp @@ -180,7 +180,7 @@ class ConeSurface : public RegularSurface { const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), double tolerance = s_onSurfaceTolerance) const final; /// The pathCorrection for derived classes with thickness diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index 57ffd86586a..a7329e7456b 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -75,7 +75,7 @@ class DiscTrapezoidBounds : public DiscBounds { /// @param boundaryTolerance is the boundary check directive bool inside(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::None()) const final; + BoundaryTolerance::none()) const final; /// Output Method for std::ostream std::ostream& toStream(std::ostream& sl) const final; diff --git a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp index fcada49abc2..86a2f5b28fb 100644 --- a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp +++ b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp @@ -199,7 +199,7 @@ struct GaussianSumFitter { sParameters.referenceSurface() .intersect(GeometryContext{}, sParameters.position(GeometryContext{}), - sParameters.direction(), BoundaryTolerance::None()) + sParameters.direction(), BoundaryTolerance::none()) .closest() .status(); diff --git a/Core/include/Acts/TrackFitting/KalmanFitter.hpp b/Core/include/Acts/TrackFitting/KalmanFitter.hpp index 1bc0858b3df..d9f5a1e22b1 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -970,7 +970,7 @@ class KalmanFitter { ->intersect( state.geoContext, freeVector.segment<3>(eFreePos0), state.options.direction * freeVector.segment<3>(eFreeDir0), - BoundaryTolerance::None(), state.options.surfaceTolerance) + BoundaryTolerance::none(), state.options.surfaceTolerance) .closest(); }; diff --git a/Core/include/Acts/Utilities/TrackHelpers.hpp b/Core/include/Acts/Utilities/TrackHelpers.hpp index f8c61135502..daf4b0054da 100644 --- a/Core/include/Acts/Utilities/TrackHelpers.hpp +++ b/Core/include/Acts/Utilities/TrackHelpers.hpp @@ -187,7 +187,7 @@ findTrackStateForExtrapolation( return referenceSurface .intersect(geoContext, freeVector.template segment<3>(eFreePos0), freeVector.template segment<3>(eFreeDir0), - BoundaryTolerance::None(), s_onSurfaceTolerance) + BoundaryTolerance::none(), s_onSurfaceTolerance) .closest(); }; diff --git a/Core/src/EventData/CorrectedTransformationFreeToBound.cpp b/Core/src/EventData/CorrectedTransformationFreeToBound.cpp index 405fea01e3b..1929251079a 100644 --- a/Core/src/EventData/CorrectedTransformationFreeToBound.cpp +++ b/Core/src/EventData/CorrectedTransformationFreeToBound.cpp @@ -154,7 +154,7 @@ Acts::detail::CorrectedFreeToBoundTransformer::operator()( surface .intersect(geoContext, params.segment<3>(eFreePos0), navDir * params.segment<3>(eFreeDir0), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); correctedFreeParams.segment<3>(eFreePos0) = intersection.position(); diff --git a/Core/src/Geometry/CompositePortalLink.cpp b/Core/src/Geometry/CompositePortalLink.cpp index 19d9ea3c02a..211de309e2a 100644 --- a/Core/src/Geometry/CompositePortalLink.cpp +++ b/Core/src/Geometry/CompositePortalLink.cpp @@ -143,11 +143,11 @@ Result CompositePortalLink::resolveVolume( Result CompositePortalLink::resolveVolume( const GeometryContext& gctx, const Vector3& position, double tolerance) const { - assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::None(), + assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::none(), tolerance)); for (const auto& child : m_children) { - if (child->surface().isOnSurface(gctx, position, BoundaryTolerance::None(), + if (child->surface().isOnSurface(gctx, position, BoundaryTolerance::none(), tolerance)) { return child->resolveVolume(gctx, position); } diff --git a/Core/src/Geometry/Layer.cpp b/Core/src/Geometry/Layer.cpp index 024f99e9c42..6aaa8e56491 100644 --- a/Core/src/Geometry/Layer.cpp +++ b/Core/src/Geometry/Layer.cpp @@ -159,7 +159,7 @@ Acts::Layer::compatibleSurfaces( } BoundaryTolerance boundaryTolerance = options.boundaryTolerance; if (rangeContainsValue(options.externalSurfaces, sf.geometryId())) { - boundaryTolerance = BoundaryTolerance::Infinite(); + boundaryTolerance = BoundaryTolerance::infinite(); } // the surface intersection SurfaceIntersection sfi = diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index 2034ce6f302..32c4c686214 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -153,7 +153,7 @@ bool TrapezoidVolumeBounds::inside(const Vector3& pos, double tol) const { } Vector2 locp(pos.x(), pos.y()); bool inside(m_faceXYTrapezoidBounds->inside( - locp, BoundaryTolerance::AbsoluteBound{tol, tol})); + locp, BoundaryTolerance::absoluteBound(tol, tol))); return inside; } diff --git a/Core/src/Geometry/TrivialPortalLink.cpp b/Core/src/Geometry/TrivialPortalLink.cpp index 5e3b3ad5023..1ba8cbab07b 100644 --- a/Core/src/Geometry/TrivialPortalLink.cpp +++ b/Core/src/Geometry/TrivialPortalLink.cpp @@ -32,7 +32,7 @@ Result TrivialPortalLink::resolveVolume( static_cast(gctx); static_cast(position); static_cast(tolerance); - assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::None(), + assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::none(), tolerance) && "Trivial portal lookup point should be on surface"); return m_volume; diff --git a/Core/src/Material/IntersectionMaterialAssigner.cpp b/Core/src/Material/IntersectionMaterialAssigner.cpp index f85320ee119..8c61668fdb9 100644 --- a/Core/src/Material/IntersectionMaterialAssigner.cpp +++ b/Core/src/Material/IntersectionMaterialAssigner.cpp @@ -26,7 +26,7 @@ std::vector forwardOrderedIntersections( for (auto& surface : surfaces) { // Get the intersection auto sMultiIntersection = surface->intersect( - gctx, position, direction, Acts::BoundaryTolerance::None()); + gctx, position, direction, Acts::BoundaryTolerance::none()); // Take the closest auto closestForward = sMultiIntersection.closestForward(); diff --git a/Core/src/Navigation/NavigationStream.cpp b/Core/src/Navigation/NavigationStream.cpp index 3ea28dd748c..e84024afdf4 100644 --- a/Core/src/Navigation/NavigationStream.cpp +++ b/Core/src/Navigation/NavigationStream.cpp @@ -143,14 +143,14 @@ void NavigationStream::addPortalCandidate(const Experimental::Portal& portal) { m_candidates.emplace_back(Candidate{ .intersection = ObjectIntersection::invalid(&portal.surface()), .gen2Portal = &portal, - .bTolerance = BoundaryTolerance::None()}); + .bTolerance = BoundaryTolerance::none()}); } void NavigationStream::addPortalCandidate(const Portal& portal) { m_candidates.emplace_back(Candidate{ .intersection = ObjectIntersection::invalid(&portal.surface()), .portal = &portal, - .bTolerance = BoundaryTolerance::None()}); + .bTolerance = BoundaryTolerance::none()}); } void NavigationStream::addPortalCandidates( @@ -160,7 +160,7 @@ void NavigationStream::addPortalCandidates( .intersection = ObjectIntersection::invalid(&(portal->surface())), .gen2Portal = portal, - .bTolerance = BoundaryTolerance::None()}); + .bTolerance = BoundaryTolerance::none()}); }); } diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 1b9c1906856..0c41bbdbea8 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -325,7 +325,7 @@ SurfaceMultiIntersection ConeSurface::intersect( AlignmentToPathMatrix ConeSurface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index 45ec85ae1a8..cc83702dbf9 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -289,7 +289,7 @@ SurfaceMultiIntersection CylinderSurface::intersect( AlignmentToPathMatrix CylinderSurface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index 99d2f21885d..d023a7e1e48 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -202,7 +202,7 @@ Vector2 DiscSurface::localCartesianToPolar(const Vector2& lcart) const { BoundToFreeMatrix DiscSurface::boundToFreeJacobian( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The measurement frame of the surface RotationMatrix3 rframeT = @@ -238,7 +238,7 @@ FreeToBoundMatrix DiscSurface::freeToBoundJacobian( using VectorHelpers::perp; using VectorHelpers::phi; - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The measurement frame of the surface RotationMatrix3 rframeT = diff --git a/Core/src/Surfaces/LineSurface.cpp b/Core/src/Surfaces/LineSurface.cpp index 6f6350625d6..6fddef01869 100644 --- a/Core/src/Surfaces/LineSurface.cpp +++ b/Core/src/Surfaces/LineSurface.cpp @@ -186,7 +186,7 @@ SurfaceMultiIntersection LineSurface::intersect( BoundToFreeMatrix LineSurface::boundToFreeJacobian( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // retrieve the reference frame auto rframe = referenceFrame(gctx, position, direction); @@ -223,7 +223,7 @@ BoundToFreeMatrix LineSurface::boundToFreeJacobian( FreeToPathMatrix LineSurface::freeToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The vector between position and center Vector3 pcRowVec = position - center(gctx); @@ -252,7 +252,7 @@ FreeToPathMatrix LineSurface::freeToPathDerivative( AlignmentToPathMatrix LineSurface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The vector between position and center Vector3 pcRowVec = position - center(gctx); diff --git a/Core/src/Surfaces/Surface.cpp b/Core/src/Surfaces/Surface.cpp index 5394587eeae..03cc455647e 100644 --- a/Core/src/Surfaces/Surface.cpp +++ b/Core/src/Surfaces/Surface.cpp @@ -62,7 +62,7 @@ bool Surface::isOnSurface(const GeometryContext& gctx, const Vector3& position, AlignmentToBoundMatrix Surface::alignmentToBoundDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const FreeVector& pathDerivative) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // 1) Calculate the derivative of bound parameter local position w.r.t. // alignment parameters without path length correction @@ -85,7 +85,7 @@ AlignmentToBoundMatrix Surface::alignmentToBoundDerivativeWithoutCorrection( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { (void)direction; - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); @@ -125,7 +125,7 @@ AlignmentToBoundMatrix Surface::alignmentToBoundDerivativeWithoutCorrection( AlignmentToPathMatrix Surface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); diff --git a/Core/src/Vertexing/HelicalTrackLinearizer.cpp b/Core/src/Vertexing/HelicalTrackLinearizer.cpp index bc12feacbcb..76dfe1f9f84 100644 --- a/Core/src/Vertexing/HelicalTrackLinearizer.cpp +++ b/Core/src/Vertexing/HelicalTrackLinearizer.cpp @@ -32,7 +32,7 @@ Acts::HelicalTrackLinearizer::linearizeTrack( auto intersection = perigeeSurface .intersect(gctx, params.position(gctx), params.direction(), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); // Setting the propagation direction using the intersection length from diff --git a/Core/src/Vertexing/ImpactPointEstimator.cpp b/Core/src/Vertexing/ImpactPointEstimator.cpp index 51f0ebe24db..5558850428f 100644 --- a/Core/src/Vertexing/ImpactPointEstimator.cpp +++ b/Core/src/Vertexing/ImpactPointEstimator.cpp @@ -364,7 +364,7 @@ Result ImpactPointEstimator::estimate3DImpactParameters( auto intersection = planeSurface ->intersect(gctx, trkParams.position(gctx), trkParams.direction(), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); // Create propagator options @@ -428,7 +428,7 @@ Result ImpactPointEstimator::getImpactParameters( auto intersection = perigeeSurface ->intersect(gctx, track.position(gctx), track.direction(), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); diff --git a/Core/src/Vertexing/NumericalTrackLinearizer.cpp b/Core/src/Vertexing/NumericalTrackLinearizer.cpp index c7928a23258..fd372ad6353 100644 --- a/Core/src/Vertexing/NumericalTrackLinearizer.cpp +++ b/Core/src/Vertexing/NumericalTrackLinearizer.cpp @@ -35,7 +35,7 @@ Acts::NumericalTrackLinearizer::linearizeTrack( auto intersection = perigeeSurface .intersect(gctx, params.position(gctx), params.direction(), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); // Setting the propagation direction using the intersection length from @@ -123,7 +123,7 @@ Acts::NumericalTrackLinearizer::linearizeTrack( // Obtain propagation direction intersection = perigeeSurface .intersect(gctx, paramVecCopy.template head<3>(), - wiggledDir, BoundaryTolerance::Infinite()) + wiggledDir, BoundaryTolerance::infinite()) .closest(); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); diff --git a/Examples/Io/Root/src/RootAthenaDumpReader.cpp b/Examples/Io/Root/src/RootAthenaDumpReader.cpp index 421affa36ba..b81f0cd4fe9 100644 --- a/Examples/Io/Root/src/RootAthenaDumpReader.cpp +++ b/Examples/Io/Root/src/RootAthenaDumpReader.cpp @@ -398,8 +398,8 @@ RootAthenaDumpReader::readMeasurements( bool inside = surface->isOnSurface(gctx, cluster.globalPosition, {}, - Acts::BoundaryTolerance::AbsoluteEuclidean{ - m_cfg.absBoundaryTolerance}, + Acts::BoundaryTolerance::absoluteEuclidean( + m_cfg.absBoundaryTolerance), std::numeric_limits::max()); if (!inside) { diff --git a/Examples/Io/Root/src/RootMaterialTrackWriter.cpp b/Examples/Io/Root/src/RootMaterialTrackWriter.cpp index bec096d2ca7..35d0dad271c 100644 --- a/Examples/Io/Root/src/RootMaterialTrackWriter.cpp +++ b/Examples/Io/Root/src/RootMaterialTrackWriter.cpp @@ -302,7 +302,7 @@ ProcessCode RootMaterialTrackWriter::writeT( auto sfIntersection = surface ->intersect(ctx.geoContext, mint.position, mint.direction, - Acts::BoundaryTolerance::None()) + Acts::BoundaryTolerance::none()) .closest(); m_sur_id.push_back(surface->geometryId().value()); m_sur_pathCorrection.push_back(1.0); diff --git a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp index de6753ce3bf..f8e17a52fe7 100644 --- a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp +++ b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp @@ -345,7 +345,7 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, pSurface ->intersect(ctx.geoContext, particle.position(), particle.direction(), - Acts::BoundaryTolerance::Infinite()) + Acts::BoundaryTolerance::infinite()) .closest(); auto position = intersection.position(); diff --git a/Examples/Io/Root/src/VertexNTupleWriter.cpp b/Examples/Io/Root/src/VertexNTupleWriter.cpp index affd046b564..a9518d95312 100644 --- a/Examples/Io/Root/src/VertexNTupleWriter.cpp +++ b/Examples/Io/Root/src/VertexNTupleWriter.cpp @@ -774,7 +774,7 @@ ProcessCode VertexNTupleWriter::writeT( perigeeSurface ->intersect(ctx.geoContext, params.position(ctx.geoContext), params.direction(), - Acts::BoundaryTolerance::Infinite()) + Acts::BoundaryTolerance::infinite()) .closest(); // Setting the geometry/magnetic field context for the event diff --git a/Fatras/src/Digitization/PlanarSurfaceMask.cpp b/Fatras/src/Digitization/PlanarSurfaceMask.cpp index 1b73ff409e6..b92c4600cbe 100644 --- a/Fatras/src/Digitization/PlanarSurfaceMask.cpp +++ b/Fatras/src/Digitization/PlanarSurfaceMask.cpp @@ -98,9 +98,9 @@ ActsFatras::PlanarSurfaceMask::apply(const Acts::Surface& surface, Acts::VectorHelpers::phi(segment[1])); bool startInside = - surface.bounds().inside(localStart, Acts::BoundaryTolerance::None()); + surface.bounds().inside(localStart, Acts::BoundaryTolerance::none()); bool endInside = - surface.bounds().inside(localEnd, Acts::BoundaryTolerance::None()); + surface.bounds().inside(localEnd, Acts::BoundaryTolerance::none()); // Fast exit, both inside if (startInside && endInside) { @@ -133,9 +133,9 @@ ActsFatras::PlanarSurfaceMask::apply(const Acts::Surface& surface, Acts::VectorHelpers::phi(segment[1])); bool startInside = - surface.bounds().inside(sPolar, Acts::BoundaryTolerance::None()); + surface.bounds().inside(sPolar, Acts::BoundaryTolerance::none()); bool endInside = - surface.bounds().inside(ePolar, Acts::BoundaryTolerance::None()); + surface.bounds().inside(ePolar, Acts::BoundaryTolerance::none()); // Fast exit for both inside if (startInside && endInside) { diff --git a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp index 4d89df9bb41..d22dc5bcfe4 100644 --- a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp +++ b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp @@ -55,11 +55,11 @@ int main(int /*argc*/, char** /*argv[]*/) { SquareMatrix2 cov; cov << 1.0, 0, 0, 0.05; - BoundaryTolerance bcAbs = BoundaryTolerance::None(); - BoundaryTolerance bcTol0 = BoundaryTolerance::AbsoluteBound{1.0, 0}; - BoundaryTolerance bcTol1 = BoundaryTolerance::AbsoluteBound{0, 0.2}; - BoundaryTolerance bcTol01 = BoundaryTolerance::AbsoluteBound{1.0, 0.2}; - BoundaryTolerance bcCov = BoundaryTolerance::Chi2Bound{cov, 1}; + BoundaryTolerance bcAbs = BoundaryTolerance::none(); + BoundaryTolerance bcTol0 = BoundaryTolerance::absoluteBound(1.0, 0.0); + BoundaryTolerance bcTol1 = BoundaryTolerance::absoluteBound(0.0, 0.2); + BoundaryTolerance bcTol01 = BoundaryTolerance::absoluteBound(1.0, 0.2); + BoundaryTolerance bcCov = BoundaryTolerance::chi2Bound(cov, 1.0); // visualization to make sense of things for (std::size_t i = 0; i < 10000; i++) { diff --git a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp index f18a32070be..aa9adfebecb 100644 --- a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp +++ b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp @@ -139,11 +139,11 @@ int main(int /*argc*/, char** /*argv[]*/) { }; // Benchmark scenarios - run_all_benches(BoundaryTolerance::Infinite(), "No check", Mode::None); - run_all_benches(BoundaryTolerance::None(), "No tolerance", Mode::FastOutside); - run_all_benches(BoundaryTolerance::AbsoluteBound(0.6, 0.45), "Abs. tolerance", + run_all_benches(BoundaryTolerance::infinite(), "No check", Mode::None); + run_all_benches(BoundaryTolerance::none(), "No tolerance", Mode::FastOutside); + run_all_benches(BoundaryTolerance::absoluteBound(0.6, 0.45), "Abs. tolerance", Mode::SlowOutside); - run_all_benches(BoundaryTolerance::Chi2Bound(cov, 3.0), "Cov. tolerance", + run_all_benches(BoundaryTolerance::chi2Bound(cov, 3.0), "Cov. tolerance", Mode::SlowOutside); return 0; diff --git a/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp b/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp index 4d92589bd66..a1c9af5001e 100644 --- a/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp +++ b/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp @@ -32,7 +32,7 @@ namespace Acts::Test { // Some randomness & number crunching unsigned int ntests = 10; unsigned int nrepts = 2000; -const BoundaryTolerance boundaryTolerance = BoundaryTolerance::Infinite(); +const BoundaryTolerance boundaryTolerance = BoundaryTolerance::infinite(); const bool testPlane = true; const bool testDisc = true; const bool testCylinder = true; diff --git a/Tests/IntegrationTests/NavigatorConsistency.cpp b/Tests/IntegrationTests/NavigatorConsistency.cpp index 627c87161e4..3aae08ad975 100644 --- a/Tests/IntegrationTests/NavigatorConsistency.cpp +++ b/Tests/IntegrationTests/NavigatorConsistency.cpp @@ -337,14 +337,14 @@ Reference1StraightLinePropagator refslpropagator1( Reference1EigenPropagator refepropagator1( estepper, TryAllNavigator({tGeometry, true, true, false, - BoundaryTolerance::Infinite()}, + BoundaryTolerance::infinite()}, getDefaultLogger("ref1_e_nav", Logging::INFO)), getDefaultLogger("ref1_e_prop", Logging::INFO)); Reference2EigenPropagator refepropagator2( estepper, TryAllOverstepNavigator({tGeometry, true, true, false, - BoundaryTolerance::Infinite()}, + BoundaryTolerance::infinite()}, getDefaultLogger("ref2_e_nav", Logging::INFO)), getDefaultLogger("ref2_e_prop", Logging::INFO)); Reference2StraightLinePropagator refslpropagator2( diff --git a/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp b/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp index 25f9b8d7a14..acbc1a112f7 100644 --- a/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp +++ b/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(CorrectedFreeToBoundTrackParameters) { // the intersection of the track with the end surface SurfaceIntersection intersection = eSurface - ->intersect(geoCtx, Vector3(0, 0, 0), dir, BoundaryTolerance::None()) + ->intersect(geoCtx, Vector3(0, 0, 0), dir, BoundaryTolerance::none()) .closest(); Vector3 tpos = intersection.position(); auto s = intersection.pathLength(); diff --git a/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp b/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp index 9c84e3635bf..a288498569b 100644 --- a/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp +++ b/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(GenericApproachDescriptorProperties) { 0., }; Vector3 zDir{0., 0., 1.}; - BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); double nearLimit = -100 * UnitConstants::um; double farLimit = std::numeric_limits::max(); // @@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(GenericApproachDescriptorProperties) { BOOST_AUTO_TEST_CASE(GenericApproachNoOverstepping) { Vector3 origin{0., -0.5, 1.}; Vector3 direction{0., 1., 0.}; - BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); double nearLimit = -100 * UnitConstants::um; double farLimit = std::numeric_limits::max(); diff --git a/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp b/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp index 6e606e3e03c..31b1407b630 100644 --- a/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp +++ b/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp @@ -60,12 +60,12 @@ BOOST_AUTO_TEST_CASE(NavigationLayerProperties) { &(pNavigationLayer->surfaceRepresentation())); // isOnLayer() BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, origin, - BoundaryTolerance::None())); + BoundaryTolerance::none())); // isOnLayer() Vector3 crazyPosition{1000., 10000., std::nan("")}; // layer stub has hard-coded globalToLocal return value BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, crazyPosition, - BoundaryTolerance::None())); + BoundaryTolerance::none())); // resolve() BOOST_CHECK(!pNavigationLayer->resolve(true, true, true)); } diff --git a/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp b/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp index 9fca8bb64b7..2bf4a9cde13 100644 --- a/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp +++ b/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp @@ -56,7 +56,7 @@ class IntersectSurfacesFinder : public IAssignmentFinder { for (auto& surface : surfaces) { // Get the intersection auto sMultiIntersection = surface->intersect(gctx, position, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // One solution, take it if (sMultiIntersection.size() == 1u && sMultiIntersection[0u].status() >= diff --git a/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp b/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp index 7f4f89c8ca0..1447b00307a 100644 --- a/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp +++ b/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp @@ -55,7 +55,7 @@ class IntersectSurfacesFinder : public IAssignmentFinder { for (auto& surface : surfaces) { // Get the intersection auto sMultiIntersection = surface->intersect(gctx, position, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // One solution, take it if (sMultiIntersection.size() == 1u && sMultiIntersection[0u].status() >= diff --git a/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp b/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp index 2817465311a..eb2cc000637 100644 --- a/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp +++ b/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { NavigationStream nStreamTemplate; for (const auto& surface : surfaces) { nStreamTemplate.addSurfaceCandidate(*surface, - Acts::BoundaryTolerance::None()); + Acts::BoundaryTolerance::none()); } BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 4u); @@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { NavigationStream nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., -30.), Vector3(0., 0., 1.)}, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 4u); BOOST_CHECK_EQUAL(&nStream.currentCandidate().surface(), surfaces[1u].get()); @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(0., 0., 1.)}, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 3u); BOOST_CHECK_EQUAL(&nStream.currentCandidate().surface(), surfaces[3u].get()); @@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., -100.), Vector3(0., 0., 1.)}, - BoundaryTolerance::None())); + BoundaryTolerance::none())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 3u); // (4) Run an initial update @@ -134,20 +134,20 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { nStream = nStreamTemplate; BOOST_CHECK(!nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(1., 0., 0.)}, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 0u); BOOST_CHECK_THROW(nStream.currentCandidate(), std::out_of_range); // (5) Test de-duplication nStream = nStreamTemplate; nStreamTemplate.addSurfaceCandidate(*surfaces.at(0), - Acts::BoundaryTolerance::None()); + Acts::BoundaryTolerance::none()); // One surface is duplicated in the stream BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 5u); // Initialize stream reaches all surfaces, but also de-duplicates BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., -100.), Vector3(0., 0., 1.)}, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 4u); } @@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_UpdatePlanes) { NavigationStream nStreamTemplate; for (const auto& surface : surfaces) { nStreamTemplate.addSurfaceCandidate(*surface, - Acts::BoundaryTolerance::None()); + Acts::BoundaryTolerance::none()); } BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 4u); @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_UpdatePlanes) { NavigationStream nStream = nStreamTemplate; BOOST_CHECK( - nStream.initialize(gContext, qPoint, BoundaryTolerance::Infinite())); + nStream.initialize(gContext, qPoint, BoundaryTolerance::infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 4u); BOOST_CHECK_EQUAL(&nStream.currentCandidate().surface(), surfaces[1u].get()); CHECK_CLOSE_ABS(nStream.currentCandidate().pathLength(), 10., @@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { for (const auto& surface : surfaces) { const Surface* pointer = surface.get(); nStreamTemplate.addSurfaceCandidates({&pointer, 1}, - Acts::BoundaryTolerance::None()); + Acts::BoundaryTolerance::none()); } BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 4u); @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { NavigationStream nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize( gContext, {Vector3(0., 0., 0.), Vector3(1., 1., 0.).normalized()}, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); // We should have 5 candidates, as one cylinder is reachable twice BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 5u); // First one is inner candidate @@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(1., 0., 0.)}, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); // We should have 3 candidates BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 3u); @@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(1., 0., 0.)}, - BoundaryTolerance::None())); + BoundaryTolerance::none())); // We should have 2 candidates BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 2u); @@ -277,7 +277,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { nStream = nStreamTemplate; BOOST_CHECK(!nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(0., 0., 1.)}, - BoundaryTolerance::None())); + BoundaryTolerance::none())); // We should have 0 candidates BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 0u); BOOST_CHECK_THROW(nStream.currentCandidate(), std::out_of_range); diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index a96df18fa52..62f46283f15 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -459,7 +459,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { targetSurface ->intersect(tgContext, es.position(esState), navDir * es.direction(esState), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, ConstrainedStep::navigator); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); @@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { targetSurface ->intersect(tgContext, es.position(esState), navDir * es.direction(esState), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, ConstrainedStep::navigator); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); diff --git a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp index 0162fb78525..8303b8d2937 100644 --- a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp +++ b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp @@ -78,7 +78,7 @@ class NoFieldIntersectionFinder { // Get the intersection auto sMultiIntersection = surface->intersect( geoCtx, position, direction, - BoundaryTolerance::AbsoluteCartesian(m_tol, m_tol)); + BoundaryTolerance::absoluteCartesian(m_tol, m_tol)); // Take the closest auto closestForward = sMultiIntersection.closestForward(); diff --git a/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp index 10cfb500a50..43adadba36b 100644 --- a/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp @@ -97,15 +97,15 @@ BOOST_AUTO_TEST_CASE(AnnulusBoundsProperties) { }; BOOST_CHECK( - aBounds.inside(toStripFrame(inSurfaceXY), BoundaryTolerance::None())); + aBounds.inside(toStripFrame(inSurfaceXY), BoundaryTolerance::none())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY1), BoundaryTolerance::None())); + !aBounds.inside(toStripFrame(outsideXY1), BoundaryTolerance::none())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY2), BoundaryTolerance::None())); + !aBounds.inside(toStripFrame(outsideXY2), BoundaryTolerance::none())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY3), BoundaryTolerance::None())); + !aBounds.inside(toStripFrame(outsideXY3), BoundaryTolerance::none())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY4), BoundaryTolerance::None())); + !aBounds.inside(toStripFrame(outsideXY4), BoundaryTolerance::none())); // Check radial inside BOOST_CHECK(!aBounds.insideRadialBounds(0.5)); diff --git a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp index e80035a10a8..33f05eb5853 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(BoundaryToleranceConstructors) { BOOST_AUTO_TEST_CASE(BoundaryCheckBoxSimple) { Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::None(); + auto tolerance = BoundaryTolerance::none(); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -132,7 +132,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxToleranceLoc0) { em.execute([]() { Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::AbsoluteBound( + auto tolerance = BoundaryTolerance::absoluteBound( 1.5, std::numeric_limits::infinity()); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); @@ -155,7 +155,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) { cov << 1, 0.5, 0.5, 2; Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 3.); + auto tolerance = BoundaryTolerance::chi2Bound(cov.inverse(), 3.); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) { // Triangle w/ simple check BOOST_AUTO_TEST_CASE(BoundaryCheckTriangleSimple) { Vector2 vertices[] = {{-2, 0}, {2, 0}, {0, 2}}; - auto tolerance = BoundaryTolerance::None(); + auto tolerance = BoundaryTolerance::none(); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 1}, std::nullopt)); BOOST_CHECK( @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckTriangleCovariance) { Vector2 vertices[] = {{-2, 0}, {2, 0}, {0, 2}}; SquareMatrix2 cov; cov << 0.5, 0, 0, 0.5; - auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 4.1); + auto tolerance = BoundaryTolerance::chi2Bound(cov.inverse(), 4.1); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 1}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 2}, std::nullopt)); @@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { Vector2 ur(1, 1); { - auto tolerance = BoundaryTolerance::None(); + auto tolerance = BoundaryTolerance::none(); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::Infinite(); + auto tolerance = BoundaryTolerance::infinite(); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -223,7 +223,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::AbsoluteBound(0.5, 0.5); + auto tolerance = BoundaryTolerance::absoluteBound(0.5, 0.5); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -241,7 +241,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::AbsoluteCartesian(0.5, 0.5); + auto tolerance = BoundaryTolerance::absoluteCartesian(0.5, 0.5); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::AbsoluteEuclidean(1.1); + auto tolerance = BoundaryTolerance::absoluteEuclidean(1.1); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -272,7 +272,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { { auto tolerance = - BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.); + BoundaryTolerance::chi2Bound(SquareMatrix2::Identity(), 1.); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( diff --git a/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp index 3c9e114c05e..a6b7b9063f9 100644 --- a/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp @@ -158,9 +158,9 @@ BOOST_AUTO_TEST_CASE(ConeSurfaceProperties) { /// Test isOnSurface Vector3 offSurface{100, 1, 2}; BOOST_CHECK(coneSurfaceObject->isOnSurface( - tgContext, globalPosition, momentum, BoundaryTolerance::None())); + tgContext, globalPosition, momentum, BoundaryTolerance::none())); BOOST_CHECK(!coneSurfaceObject->isOnSurface(tgContext, offSurface, momentum, - BoundaryTolerance::None())); + BoundaryTolerance::none())); /// Test pathCorrection CHECK_CLOSE_REL(coneSurfaceObject->pathCorrection(tgContext, offSurface, diff --git a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp index 7b516b6bfec..33bf42436bb 100644 --- a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(ConvexPolygonBoundsConstruction) { BOOST_CHECK_EQUAL(bb.min(), Vector2(0, 0)); BOOST_CHECK_EQUAL(bb.max(), Vector2(1., 1)); - BoundaryTolerance tolerance = BoundaryTolerance::None(); + BoundaryTolerance tolerance = BoundaryTolerance::none(); BOOST_CHECK(triangle.inside({0.2, 0.2}, tolerance)); BOOST_CHECK(!triangle.inside({0.4, 0.9}, tolerance)); @@ -114,7 +114,7 @@ BOOST_AUTO_TEST_CASE(ConvexPolygonBoundsDynamicTest) { BOOST_CHECK_EQUAL(bb.min(), Vector2(0, 0)); BOOST_CHECK_EQUAL(bb.max(), Vector2(1., 1)); - BoundaryTolerance tolerance = BoundaryTolerance::None(); + BoundaryTolerance tolerance = BoundaryTolerance::none(); BOOST_CHECK(triangle.inside({0.2, 0.2}, tolerance)); BOOST_CHECK(!triangle.inside({0.4, 0.9}, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp index 6cc6bc8da82..dfdcef35b89 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -125,9 +125,9 @@ BOOST_AUTO_TEST_CASE(CylinderBoundsProperties) { const Vector2 withinBevelMin{0.5, -20.012}; const Vector2 outsideBevelMin{0.5, -40.}; const BoundaryTolerance tolerance = - BoundaryTolerance::AbsoluteBound(0.1, 0.1); + BoundaryTolerance::absoluteBound(0.1, 0.1); const BoundaryTolerance lessTolerance = - BoundaryTolerance::AbsoluteBound(0.01, 0.01); + BoundaryTolerance::absoluteBound(0.01, 0.01); BOOST_CHECK(cylinderBoundsObject.inside(atPiBy2, tolerance)); BOOST_CHECK(!cylinderBoundsSegment.inside(unitPhi, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp index 073f743ad29..fbbf743509f 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp @@ -178,18 +178,18 @@ BOOST_AUTO_TEST_CASE(CylinderSurfaceProperties) { /// Test isOnSurface Vector3 offSurface{100, 1, 2}; BOOST_CHECK(cylinderSurfaceObject->isOnSurface( - testContext, globalPosition, momentum, BoundaryTolerance::None())); + testContext, globalPosition, momentum, BoundaryTolerance::none())); BOOST_CHECK(cylinderSurfaceObject->isOnSurface(testContext, globalPosition, - BoundaryTolerance::None())); + BoundaryTolerance::none())); BOOST_CHECK(!cylinderSurfaceObject->isOnSurface( - testContext, offSurface, momentum, BoundaryTolerance::None())); + testContext, offSurface, momentum, BoundaryTolerance::none())); BOOST_CHECK(!cylinderSurfaceObject->isOnSurface(testContext, offSurface, - BoundaryTolerance::None())); + BoundaryTolerance::none())); /// Intersection test Vector3 direction{-1., 0, 0}; auto sfIntersection = cylinderSurfaceObject->intersect( - testContext, offSurface, direction, BoundaryTolerance::Infinite()); + testContext, offSurface, direction, BoundaryTolerance::infinite()); Intersection3D expectedIntersect{Vector3{1, 1, 2}, 99., IntersectionStatus::reachable}; BOOST_CHECK(sfIntersection[0].isValid()); diff --git a/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp index 1869cde057d..8ab65c9c952 100644 --- a/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp @@ -106,10 +106,10 @@ BOOST_AUTO_TEST_CASE(DiamondBoundsProperties) { "50.0000000, 30.0000000, 10.0000000, 20.0000000)")); /// Test inside - BOOST_CHECK(diamondBoundsObject.inside(origin, BoundaryTolerance::None())); + BOOST_CHECK(diamondBoundsObject.inside(origin, BoundaryTolerance::none())); // dont understand why this is so: BOOST_CHECK( - !diamondBoundsObject.inside(outsideBy10, BoundaryTolerance::None())); + !diamondBoundsObject.inside(outsideBy10, BoundaryTolerance::none())); /// Test vertices (does this need to be implemented in this class?? // auto v=diamondBoundsObject.vertices(); diff --git a/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp index 4a304f23510..6b2d6fb6f2a 100644 --- a/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp @@ -120,13 +120,13 @@ BOOST_AUTO_TEST_CASE(DiscSurfaceProperties) { Vector3 point3DOnSurface{1.2, 0., 0}; BOOST_CHECK(!discSurfaceObject->isOnSurface(tgContext, point3DNotInSector, ignoredMomentum, - BoundaryTolerance::None())); + BoundaryTolerance::none())); BOOST_CHECK(!discSurfaceObject->isOnSurface(tgContext, point3DNotInSector, - BoundaryTolerance::None())); + BoundaryTolerance::none())); BOOST_CHECK(discSurfaceObject->isOnSurface( - tgContext, point3DOnSurface, ignoredMomentum, BoundaryTolerance::None())); + tgContext, point3DOnSurface, ignoredMomentum, BoundaryTolerance::none())); BOOST_CHECK(discSurfaceObject->isOnSurface(tgContext, point3DOnSurface, - BoundaryTolerance::None())); + BoundaryTolerance::none())); /// Test localToGlobal Vector3 returnedPosition{10.9, 8.7, 6.5}; @@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(DiscSurfaceProperties) { // (bool) valid, it's contained in a Surface intersection auto sfIntersection = discSurfaceObject ->intersect(tgContext, globalPosition, direction, - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); Intersection3D expectedIntersect{Vector3{1.2, 0., 0.}, 10., IntersectionStatus::reachable}; diff --git a/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp index 8f6117ef1b0..816627b07da 100644 --- a/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp @@ -126,9 +126,9 @@ BOOST_AUTO_TEST_CASE(DiscTrapezoidBoundsProperties) { /// Test inside BOOST_CHECK( - DiscTrapezoidBoundsObject.inside(inSurface, BoundaryTolerance::None())); + DiscTrapezoidBoundsObject.inside(inSurface, BoundaryTolerance::none())); BOOST_CHECK( - !DiscTrapezoidBoundsObject.inside(outside, BoundaryTolerance::None())); + !DiscTrapezoidBoundsObject.inside(outside, BoundaryTolerance::none())); /// Test rMin CHECK_CLOSE_REL(DiscTrapezoidBoundsObject.rMin(), rMin, 1e-6); diff --git a/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp index 0ed78e656f6..85f844a3186 100644 --- a/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp @@ -179,10 +179,10 @@ BOOST_AUTO_TEST_CASE(EllipseBoundsProperties) { /// Test inside BOOST_CHECK( - !ellipseBoundsObject.inside(inRectangle, BoundaryTolerance::None())); + !ellipseBoundsObject.inside(inRectangle, BoundaryTolerance::none())); // don't understand why this is so: BOOST_CHECK( - !ellipseBoundsObject.inside(outsideBy15, BoundaryTolerance::None())); + !ellipseBoundsObject.inside(outsideBy15, BoundaryTolerance::none())); } /// Unit test for testing EllipseBounds assignment BOOST_AUTO_TEST_CASE(EllipseBoundsAssignment) { diff --git a/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp index b0c7fa0c94f..b4644514f3d 100644 --- a/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(InfiniteBoundsProperties) { /// Test for inside() const Vector2 anyVector{0., 1.}; - const BoundaryTolerance anyTolerance = BoundaryTolerance::None(); + const BoundaryTolerance anyTolerance = BoundaryTolerance::none(); BOOST_CHECK(infiniteBoundsObject.inside(anyVector, anyTolerance)); /// Test for dump diff --git a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp index c8022a9174c..b0edc35d968 100644 --- a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp @@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE(LineBoundsProperties) { const Vector2 unitZ{0., 1.}; const Vector2 unitR{1., 0.}; const BoundaryTolerance tolerance = - BoundaryTolerance::AbsoluteBound(0.1, 0.1); + BoundaryTolerance::absoluteBound(0.1, 0.1); // This fails because the bounds are not inclusive. BOOST_CHECK(!lineBoundsObject.inside(atRadius, tolerance)); BOOST_CHECK(!lineBoundsObject.inside(beyondEnd, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp index b1e4e3d9a93..ee4b84c6796 100644 --- a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(LineSurface_allNamedMethods_test) { const Vector3 direction{0., 1., 2.}; auto sfIntersection = line.intersect(tgContext, {0., 0., 0.}, direction.normalized(), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); BOOST_CHECK(sfIntersection.isValid()); Vector3 expectedIntersection(0, 1., 2.); @@ -134,10 +134,10 @@ BOOST_AUTO_TEST_CASE(LineSurface_allNamedMethods_test) { const Vector3 insidePosition{0., 2.5, 0.}; BOOST_CHECK(line.isOnSurface( tgContext, insidePosition, mom, - BoundaryTolerance::Infinite())); // need better test here + BoundaryTolerance::infinite())); // need better test here const Vector3 outsidePosition{100., 100., 200.}; BOOST_CHECK(!line.isOnSurface(tgContext, outsidePosition, mom, - BoundaryTolerance::None())); + BoundaryTolerance::none())); // localToGlobal Vector3 returnedGlobalPosition{0., 0., 0.}; diff --git a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp index 6c09e65ab65..fd9ae32f0e3 100644 --- a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp @@ -156,19 +156,19 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceProperties) { /// Test isOnSurface Vector3 offSurface{0, 1, -2.}; BOOST_CHECK(planeSurfaceObject->isOnSurface( - tgContext, globalPosition, momentum, BoundaryTolerance::None())); + tgContext, globalPosition, momentum, BoundaryTolerance::none())); BOOST_CHECK(planeSurfaceObject->isOnSurface(tgContext, globalPosition, - BoundaryTolerance::None())); + BoundaryTolerance::none())); BOOST_CHECK(!planeSurfaceObject->isOnSurface(tgContext, offSurface, momentum, - BoundaryTolerance::None())); + BoundaryTolerance::none())); BOOST_CHECK(!planeSurfaceObject->isOnSurface(tgContext, offSurface, - BoundaryTolerance::None())); + BoundaryTolerance::none())); /// Test intersection Vector3 direction{0., 0., 1.}; auto sfIntersection = planeSurfaceObject ->intersect(tgContext, offSurface, direction, - BoundaryTolerance::None()) + BoundaryTolerance::none()) .closest(); Intersection3D expectedIntersect{Vector3{0, 1, 2}, 4., IntersectionStatus::reachable}; @@ -299,16 +299,16 @@ BOOST_AUTO_TEST_CASE(RotatedTrapezoid) { std::shared_ptr bounds = std::make_shared(shortHalfX, longHalfX, halfY); - BOOST_CHECK(bounds->inside(edgePoint, BoundaryTolerance::None())); + BOOST_CHECK(bounds->inside(edgePoint, BoundaryTolerance::none())); BOOST_CHECK(!bounds->inside(Eigen::Rotation2D(-rotAngle) * edgePoint, - BoundaryTolerance::None())); + BoundaryTolerance::none())); std::shared_ptr rotatedBounds = std::make_shared(shortHalfX, longHalfX, halfY, rotAngle); - BOOST_CHECK(!rotatedBounds->inside(edgePoint, BoundaryTolerance::None())); + BOOST_CHECK(!rotatedBounds->inside(edgePoint, BoundaryTolerance::none())); BOOST_CHECK(rotatedBounds->inside(Eigen::Rotation2D(-rotAngle) * edgePoint, - BoundaryTolerance::None())); + BoundaryTolerance::none())); } /// Unit test for testing PlaneSurface alignment derivatives diff --git a/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp index a5083efaf92..bfb6de1a6cf 100644 --- a/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp @@ -103,8 +103,8 @@ BOOST_AUTO_TEST_CASE(RadialBoundsProperties) { "5.0000000, 0.3926991, 0.0000000)")); /// Test inside - BOOST_CHECK(radialBoundsObject.inside(inSurface, BoundaryTolerance::None())); - BOOST_CHECK(!radialBoundsObject.inside(outside, BoundaryTolerance::None())); + BOOST_CHECK(radialBoundsObject.inside(inSurface, BoundaryTolerance::none())); + BOOST_CHECK(!radialBoundsObject.inside(outside, BoundaryTolerance::none())); /// Test rMin BOOST_CHECK_EQUAL(radialBoundsObject.get(RadialBounds::eMinR), rMin); diff --git a/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp index ad310e393cf..9a049133e21 100644 --- a/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(RectangleBoundsProperties) { rectVertices.cbegin(), rectVertices.cend()); const Vector2 pointA{1., 1.}; // distance is signed, from boundary to point. (doesn't seem right, given - BoundaryTolerance tolerance = BoundaryTolerance::None(); + BoundaryTolerance tolerance = BoundaryTolerance::none(); BOOST_CHECK(rect.inside(pointA, tolerance)); } BOOST_AUTO_TEST_CASE(RectangleBoundsAssignment) { diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp index 655303f9602..c9f1d3a3eb8 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp @@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersect without boundary check auto aIntersection = aCylinder->intersect(tgContext, onCylinder, alongX, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // Check the validity of the intersection BOOST_CHECK(aIntersection[0].isValid()); @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersect from the center auto cIntersection = aCylinder->intersect(tgContext, atCenter, alongX, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // Check the validity of the intersection BOOST_CHECK(cIntersection[0].isValid()); @@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersect from outside where both intersections are reachable auto oIntersection = aCylinder->intersect(tgContext, outCylinder, alongX, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // Check the validity of the intersection BOOST_CHECK(oIntersection[0].isValid()); @@ -112,14 +112,14 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersection from outside without chance of hitting the cylinder auto iIntersection = aCylinder->intersect(tgContext, outCylinder, transXY, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); // Check the validity of the intersection BOOST_CHECK(!iIntersection[0].isValid()); // From edge tests - wo boundary test auto eIntersection = aCylinder->intersect(tgContext, atEdge, transTZ, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); // Check the validity of the intersection BOOST_CHECK(eIntersection[0].isValid()); @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Now re-do with boundary check eIntersection = aCylinder->intersect(tgContext, atEdge, transTZ, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // This should be the negative one BOOST_CHECK_LT(eIntersection[0].pathLength(), 0.); // The status of this one should be reachable @@ -179,9 +179,9 @@ BOOST_AUTO_TEST_CASE(ConeIntersectionTest) { // Intersect without boundary check with an on solution BOOST_CHECK(aCone->isOnSurface(tgContext, onCone, transXY, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); auto aIntersection = - aCone->intersect(tgContext, onCone, transXY, BoundaryTolerance::None()); + aCone->intersect(tgContext, onCone, transXY, BoundaryTolerance::none()); // Check the validity of the intersection BOOST_CHECK(aIntersection[0].isValid()); @@ -196,7 +196,7 @@ BOOST_AUTO_TEST_CASE(ConeIntersectionTest) { // Intersection from outside without chance of hitting the cylinder auto iIntersection = aCone->intersect(tgContext, outCone, perpXY, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); // Check the validity of the intersection BOOST_CHECK(!iIntersection[0].isValid()); @@ -237,7 +237,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // Intersect forward auto fIntersection = aPlane->intersect(tgContext, before, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(fIntersection[0].isValid()); @@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // On surface intersection auto oIntersection = aPlane->intersect(tgContext, onit, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable @@ -263,7 +263,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // Intersect backwards auto bIntersection = aPlane->intersect(tgContext, after, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(bIntersection[0].isValid()); // The intersection MUST be reachable @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // An out of bounds attempt: missed auto mIntersection = aPlane->intersect(tgContext, outside, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST NOT be valid BOOST_CHECK(!mIntersection[0].isValid()); // The intersection MUST be reachable @@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // An invalid attempt auto iIntersection = aPlane->intersect(tgContext, before, parallel, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST NOT be valid BOOST_CHECK(!iIntersection[0].isValid()); // The intersection MUST be reachable @@ -333,7 +333,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // A random intersection form backward // Intersect forward auto fIntersection = aLine->intersect(tgContext, before, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(fIntersection[0].isValid()); // The intersection MUST be reachable @@ -345,7 +345,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // On surface intersection - on the straw with random direction auto oIntersection = aLine->intersect(tgContext, onit1, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable @@ -358,7 +358,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // On surface intersecion - on the surface with normal vector oIntersection = - aLine->intersect(tgContext, onitP, normalP, BoundaryTolerance::None()); + aLine->intersect(tgContext, onitP, normalP, BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable @@ -371,7 +371,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // Intersect backwards auto bIntersection = aLine->intersect(tgContext, after, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST be valid BOOST_CHECK(bIntersection[0].isValid()); // The intersection MUST be reachable @@ -383,7 +383,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // An out of bounds attempt: missed auto mIntersection = aLine->intersect(tgContext, outside, direction, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST NOT be valid BOOST_CHECK(!mIntersection[0].isValid()); // The intersection MUST be reachable @@ -396,7 +396,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // An invalid attempt auto iIntersection = aLine->intersect(tgContext, before, parallel, - BoundaryTolerance::None()); + BoundaryTolerance::none()); // The intersection MUST NOT be valid BOOST_CHECK(!iIntersection[0].isValid()); // The intersection MUST be reachable diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp index e4c214b53d8..39c4f857ff8 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp @@ -108,10 +108,10 @@ BOOST_AUTO_TEST_CASE(SurfaceProperties) { // isOnSurface BOOST_CHECK(surface.isOnSurface(tgContext, reference, mom, - BoundaryTolerance::Infinite())); + BoundaryTolerance::infinite())); BOOST_CHECK(surface.isOnSurface( tgContext, reference, mom, - BoundaryTolerance::None())); // need to improve bounds() + BoundaryTolerance::none())); // need to improve bounds() // referenceFrame() RotationMatrix3 unitary; diff --git a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp index 52155fec5fe..9ec6134e92f 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -123,12 +123,12 @@ BOOST_AUTO_TEST_CASE(TrapezoidBoundsProperties) { /// Test inside BOOST_CHECK( - trapezoidBoundsObject.inside(inRectangle, BoundaryTolerance::None())); + trapezoidBoundsObject.inside(inRectangle, BoundaryTolerance::none())); BOOST_CHECK( - !trapezoidBoundsObject.inside(outside, BoundaryTolerance::None())); + !trapezoidBoundsObject.inside(outside, BoundaryTolerance::none())); const auto vertices = trapezoidBoundsObject.vertices(); - BoundaryTolerance tolerance = BoundaryTolerance::None(); + BoundaryTolerance tolerance = BoundaryTolerance::none(); std::vector testPoints = { // inside @@ -186,10 +186,10 @@ BOOST_DATA_TEST_CASE( static const TrapezoidBounds trapezoidBoundsObject(minHalfX, maxHalfX, halfY); static const auto vertices = trapezoidBoundsObject.vertices(); - BoundaryTolerance tolerance = BoundaryTolerance::None(); + BoundaryTolerance tolerance = BoundaryTolerance::none(); if (tol != 0.) { - tolerance = BoundaryTolerance::AbsoluteBound{tol, tol}; + tolerance = BoundaryTolerance::absoluteBound(tol, tol); } BOOST_CHECK_EQUAL( diff --git a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp index 50bfeac3504..26b94f14ae9 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp @@ -201,7 +201,7 @@ BoundVector meanFromFree(std::vector> cmps, Vector3 direction = mean.segment<3>(eFreeDir0); auto intersection = surface .intersect(GeometryContext{}, position, direction, - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(); mean.head<3>() = intersection.position(); diff --git a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp index 75bebd6a27d..82f47dd48ee 100644 --- a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp @@ -262,7 +262,7 @@ BOOST_DATA_TEST_CASE(TimeAtPca, tracksWithoutIPs* vertices, t0, phi, theta, p, auto intersection = refPerigeeSurface ->intersect(geoContext, params.position(geoContext), - params.direction(), BoundaryTolerance::Infinite()) + params.direction(), BoundaryTolerance::infinite()) .closest(); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); From ed9226264f81869fb2d04f812eda544760b0dd59 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Wed, 15 Jan 2025 16:16:34 +0100 Subject: [PATCH 4/5] walk back lower case factories --- .../MultiComponentTrackParameters.hpp | 2 +- Core/include/Acts/Geometry/GridPortalLink.hpp | 2 +- .../include/Acts/Geometry/NavigationLayer.hpp | 2 +- .../Navigation/NavigationStateFillers.hpp | 2 +- .../Navigation/NavigationStateUpdaters.hpp | 2 +- .../Acts/Propagator/MultiEigenStepperLoop.hpp | 2 +- .../Acts/Propagator/MultiEigenStepperLoop.ipp | 2 +- .../Acts/Propagator/TryAllNavigator.hpp | 2 +- .../Propagator/detail/NavigationHelpers.hpp | 6 +- .../Acts/Surfaces/BoundaryTolerance.hpp | 4 +- Core/include/Acts/Surfaces/ConeBounds.hpp | 2 +- Core/include/Acts/Surfaces/ConeSurface.hpp | 2 +- .../Acts/Surfaces/DiscTrapezoidBounds.hpp | 2 +- .../Acts/TrackFitting/GaussianSumFitter.hpp | 2 +- .../Acts/TrackFitting/KalmanFitter.hpp | 2 +- Core/include/Acts/Utilities/TrackHelpers.hpp | 2 +- .../CorrectedTransformationFreeToBound.cpp | 2 +- Core/src/Geometry/CompositePortalLink.cpp | 4 +- Core/src/Geometry/Layer.cpp | 2 +- Core/src/Geometry/TrapezoidVolumeBounds.cpp | 2 +- Core/src/Geometry/TrivialPortalLink.cpp | 2 +- .../Material/IntersectionMaterialAssigner.cpp | 2 +- Core/src/Navigation/NavigationStream.cpp | 6 +- Core/src/Surfaces/BoundaryTolerance.cpp | 75 ++++++++----------- Core/src/Surfaces/ConeSurface.cpp | 2 +- Core/src/Surfaces/CylinderSurface.cpp | 2 +- Core/src/Surfaces/DiscSurface.cpp | 4 +- Core/src/Surfaces/LineSurface.cpp | 6 +- Core/src/Surfaces/Surface.cpp | 6 +- Core/src/Vertexing/HelicalTrackLinearizer.cpp | 2 +- Core/src/Vertexing/ImpactPointEstimator.cpp | 4 +- .../Vertexing/NumericalTrackLinearizer.cpp | 4 +- Examples/Io/Root/src/RootAthenaDumpReader.cpp | 2 +- .../Io/Root/src/RootMaterialTrackWriter.cpp | 2 +- .../Io/Root/src/RootTrackSummaryWriter.cpp | 2 +- Examples/Io/Root/src/VertexNTupleWriter.cpp | 2 +- Fatras/src/Digitization/PlanarSurfaceMask.cpp | 8 +- Tests/Benchmarks/AnnulusBoundsBenchmark.cpp | 10 +-- .../Benchmarks/BoundaryToleranceBenchmark.cpp | 8 +- .../SurfaceIntersectionBenchmark.cpp | 2 +- .../IntegrationTests/NavigatorConsistency.cpp | 4 +- .../CorrectedTransformFreeToBoundTests.cpp | 2 +- .../GenericApproachDescriptorTests.cpp | 4 +- .../Core/Geometry/NavigationLayerTests.cpp | 4 +- .../Core/Material/MaterialMapperTests.cpp | 2 +- .../Core/Material/MaterialValidaterTests.cpp | 2 +- .../Core/Navigation/NavigationStreamTests.cpp | 28 +++---- .../Core/Propagator/EigenStepperTests.cpp | 4 +- .../UnitTests/Core/Seeding/PathSeederTest.cpp | 2 +- .../Core/Surfaces/AnnulusBoundsTests.cpp | 10 +-- .../Core/Surfaces/BoundaryToleranceTests.cpp | 64 ++++++++-------- .../Core/Surfaces/ConeSurfaceTests.cpp | 4 +- .../Surfaces/ConvexPolygonBoundsTests.cpp | 4 +- .../Core/Surfaces/CylinderBoundsTests.cpp | 4 +- .../Core/Surfaces/CylinderSurfaceTests.cpp | 10 +-- .../Core/Surfaces/DiamondBoundsTests.cpp | 4 +- .../Core/Surfaces/DiscSurfaceTests.cpp | 10 +-- .../Surfaces/DiscTrapezoidBoundsTests.cpp | 4 +- .../Core/Surfaces/EllipseBoundsTests.cpp | 4 +- .../Core/Surfaces/InfiniteBoundsTests.cpp | 2 +- .../Core/Surfaces/LineBoundsTests.cpp | 2 +- .../Core/Surfaces/LineSurfaceTests.cpp | 6 +- .../Core/Surfaces/PlaneSurfaceTests.cpp | 18 ++--- .../Core/Surfaces/RadialBoundsTests.cpp | 4 +- .../Core/Surfaces/RectangleBoundsTests.cpp | 2 +- .../Surfaces/SurfaceIntersectionTests.cpp | 40 +++++----- .../UnitTests/Core/Surfaces/SurfaceTests.cpp | 4 +- .../Core/Surfaces/TrapezoidBoundsTests.cpp | 10 +-- .../TrackFitting/GsfComponentMergingTests.cpp | 2 +- .../Vertexing/ImpactPointEstimatorTests.cpp | 2 +- 70 files changed, 222 insertions(+), 239 deletions(-) diff --git a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp index 694541e81db..5e079af0df7 100644 --- a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp +++ b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp @@ -269,7 +269,7 @@ class MultiComponentCurvilinearTrackParameters // Project the position onto the surface, keep everything else as is for (const auto& [w, pos4, dir, qop, cov] : curvi) { Vector3 newPos = s->intersect(gctx, pos4.template segment<3>(eFreePos0), - dir, BoundaryTolerance::infinite()) + dir, BoundaryTolerance::Infinite()) .closest() .position(); diff --git a/Core/include/Acts/Geometry/GridPortalLink.hpp b/Core/include/Acts/Geometry/GridPortalLink.hpp index ca0e7bce08b..7ba790b4d82 100644 --- a/Core/include/Acts/Geometry/GridPortalLink.hpp +++ b/Core/include/Acts/Geometry/GridPortalLink.hpp @@ -539,7 +539,7 @@ class GridPortalLinkT : public GridPortalLink { Result resolveVolume( const GeometryContext& /*gctx*/, const Vector2& position, double /*tolerance*/ = s_onSurfaceTolerance) const override { - assert(surface().insideBounds(position, BoundaryTolerance::none())); + assert(surface().insideBounds(position, BoundaryTolerance::None())); return m_grid.atPosition(m_projection(position)); } diff --git a/Core/include/Acts/Geometry/NavigationLayer.hpp b/Core/include/Acts/Geometry/NavigationLayer.hpp index ccd3bd99ada..63536280a5a 100644 --- a/Core/include/Acts/Geometry/NavigationLayer.hpp +++ b/Core/include/Acts/Geometry/NavigationLayer.hpp @@ -77,7 +77,7 @@ class NavigationLayer : public Layer { /// @return boolean that indicates if the position is on surface bool isOnLayer(const GeometryContext& gctx, const Vector3& gp, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::none()) const final; + BoundaryTolerance::None()) const final; /// Accept layer according to the following collection directives /// diff --git a/Core/include/Acts/Navigation/NavigationStateFillers.hpp b/Core/include/Acts/Navigation/NavigationStateFillers.hpp index 6d1dd540bd5..74e6f3e7fb6 100644 --- a/Core/include/Acts/Navigation/NavigationStateFillers.hpp +++ b/Core/include/Acts/Navigation/NavigationStateFillers.hpp @@ -69,7 +69,7 @@ struct PortalsFiller { std::for_each(portals.begin(), portals.end(), [&](const auto& p) { nState.surfaceCandidates.push_back(NavigationState::SurfaceCandidate{ ObjectIntersection::invalid(), nullptr, p, - BoundaryTolerance::none()}); + BoundaryTolerance::None()}); }); } }; diff --git a/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp b/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp index 1311d191b07..664c9c99166 100644 --- a/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp +++ b/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp @@ -54,7 +54,7 @@ inline void intitializeCandidates(const GeometryContext& gctx, sc.portal != nullptr ? s_onSurfaceTolerance : nState.overstepTolerance; // Boundary tolerance is forced to 0 for portals BoundaryTolerance boundaryTolerance = - sc.portal != nullptr ? BoundaryTolerance::none() : sc.boundaryTolerance; + sc.portal != nullptr ? BoundaryTolerance::None() : sc.boundaryTolerance; // Check the surface intersection auto sIntersection = surface.intersect( gctx, position, direction, boundaryTolerance, s_onSurfaceTolerance); diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index 706fc6a9647..6e1364a16e4 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -588,7 +588,7 @@ class MultiEigenStepperLoop : public EigenStepper { component.state.options.geoContext, SingleStepper::position(component.state), direction * SingleStepper::direction(component.state), - BoundaryTolerance::none())[oIntersection.index()]; + BoundaryTolerance::None())[oIntersection.index()]; SingleStepper::updateStepSize(component.state, intersection, direction, stype); diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp index 9e708991762..01b392dbf2a 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp @@ -37,7 +37,7 @@ auto MultiEigenStepperLoop::boundState( .intersect(state.options.geoContext, cmpState.pars.template segment<3>(eFreePos0), cmpState.pars.template segment<3>(eFreeDir0), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest() .position(); diff --git a/Core/include/Acts/Propagator/TryAllNavigator.hpp b/Core/include/Acts/Propagator/TryAllNavigator.hpp index 4d22d160014..84686bcee99 100644 --- a/Core/include/Acts/Propagator/TryAllNavigator.hpp +++ b/Core/include/Acts/Propagator/TryAllNavigator.hpp @@ -51,7 +51,7 @@ class TryAllNavigatorBase { /// Which boundary checks to perform for surface approach BoundaryTolerance boundaryToleranceSurfaceApproach = - BoundaryTolerance::none(); + BoundaryTolerance::None(); }; /// @brief Options for this Navigator diff --git a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp index 79f3c7610a0..646606132b9 100644 --- a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp +++ b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp @@ -111,7 +111,7 @@ inline void emplaceAllVolumeCandidates( for (const auto& boundary : boundaries) { addCandidate(boundary.get(), &boundary->surfaceRepresentation(), - BoundaryTolerance::none()); + BoundaryTolerance::None()); } } @@ -131,7 +131,7 @@ inline void emplaceAllVolumeCandidates( if (!resolveSensitive || layer->surfaceRepresentation().surfaceMaterial() != nullptr) { addCandidate(layer.get(), &layer->surfaceRepresentation(), - BoundaryTolerance::none()); + BoundaryTolerance::None()); } if (layer->approachDescriptor() != nullptr) { @@ -139,7 +139,7 @@ inline void emplaceAllVolumeCandidates( layer->approachDescriptor()->containedSurfaces(); for (const auto& approach : approaches) { - addCandidate(layer.get(), approach, BoundaryTolerance::none()); + addCandidate(layer.get(), approach, BoundaryTolerance::None()); } } diff --git a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp index d21cd387af5..259c4ba62cf 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -128,12 +128,12 @@ class BoundaryTolerance { } /// Absolute tolerance in Cartesian coordinates - static auto absoluteCartesian(double tolerance0, double tolerance1) { + static auto AbsoluteCartesian(double tolerance0, double tolerance1) { return BoundaryTolerance{AbsoluteCartesianParams{tolerance0, tolerance1}}; } /// Absolute tolerance in Euclidean distance - static auto absoluteEuclidean(double tolerance) { + static auto AbsoluteEuclidean(double tolerance) { return BoundaryTolerance{AbsoluteEuclideanParams{tolerance}}; } diff --git a/Core/include/Acts/Surfaces/ConeBounds.hpp b/Core/include/Acts/Surfaces/ConeBounds.hpp index f4f214fbe94..7d852f2df87 100644 --- a/Core/include/Acts/Surfaces/ConeBounds.hpp +++ b/Core/include/Acts/Surfaces/ConeBounds.hpp @@ -85,7 +85,7 @@ class ConeBounds : public SurfaceBounds { /// @return is a boolean indicating if the position is inside bool inside(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::none()) const final; + BoundaryTolerance::None()) const final; /// Output Method for std::ostream /// diff --git a/Core/include/Acts/Surfaces/ConeSurface.hpp b/Core/include/Acts/Surfaces/ConeSurface.hpp index 71755cc2c67..6f7886e2063 100644 --- a/Core/include/Acts/Surfaces/ConeSurface.hpp +++ b/Core/include/Acts/Surfaces/ConeSurface.hpp @@ -180,7 +180,7 @@ class ConeSurface : public RegularSurface { const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::infinite(), + BoundaryTolerance::Infinite(), double tolerance = s_onSurfaceTolerance) const final; /// The pathCorrection for derived classes with thickness diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index a7329e7456b..57ffd86586a 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -75,7 +75,7 @@ class DiscTrapezoidBounds : public DiscBounds { /// @param boundaryTolerance is the boundary check directive bool inside(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::none()) const final; + BoundaryTolerance::None()) const final; /// Output Method for std::ostream std::ostream& toStream(std::ostream& sl) const final; diff --git a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp index 86a2f5b28fb..fcada49abc2 100644 --- a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp +++ b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp @@ -199,7 +199,7 @@ struct GaussianSumFitter { sParameters.referenceSurface() .intersect(GeometryContext{}, sParameters.position(GeometryContext{}), - sParameters.direction(), BoundaryTolerance::none()) + sParameters.direction(), BoundaryTolerance::None()) .closest() .status(); diff --git a/Core/include/Acts/TrackFitting/KalmanFitter.hpp b/Core/include/Acts/TrackFitting/KalmanFitter.hpp index d9f5a1e22b1..1bc0858b3df 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -970,7 +970,7 @@ class KalmanFitter { ->intersect( state.geoContext, freeVector.segment<3>(eFreePos0), state.options.direction * freeVector.segment<3>(eFreeDir0), - BoundaryTolerance::none(), state.options.surfaceTolerance) + BoundaryTolerance::None(), state.options.surfaceTolerance) .closest(); }; diff --git a/Core/include/Acts/Utilities/TrackHelpers.hpp b/Core/include/Acts/Utilities/TrackHelpers.hpp index daf4b0054da..f8c61135502 100644 --- a/Core/include/Acts/Utilities/TrackHelpers.hpp +++ b/Core/include/Acts/Utilities/TrackHelpers.hpp @@ -187,7 +187,7 @@ findTrackStateForExtrapolation( return referenceSurface .intersect(geoContext, freeVector.template segment<3>(eFreePos0), freeVector.template segment<3>(eFreeDir0), - BoundaryTolerance::none(), s_onSurfaceTolerance) + BoundaryTolerance::None(), s_onSurfaceTolerance) .closest(); }; diff --git a/Core/src/EventData/CorrectedTransformationFreeToBound.cpp b/Core/src/EventData/CorrectedTransformationFreeToBound.cpp index 1929251079a..405fea01e3b 100644 --- a/Core/src/EventData/CorrectedTransformationFreeToBound.cpp +++ b/Core/src/EventData/CorrectedTransformationFreeToBound.cpp @@ -154,7 +154,7 @@ Acts::detail::CorrectedFreeToBoundTransformer::operator()( surface .intersect(geoContext, params.segment<3>(eFreePos0), navDir * params.segment<3>(eFreeDir0), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); correctedFreeParams.segment<3>(eFreePos0) = intersection.position(); diff --git a/Core/src/Geometry/CompositePortalLink.cpp b/Core/src/Geometry/CompositePortalLink.cpp index 211de309e2a..19d9ea3c02a 100644 --- a/Core/src/Geometry/CompositePortalLink.cpp +++ b/Core/src/Geometry/CompositePortalLink.cpp @@ -143,11 +143,11 @@ Result CompositePortalLink::resolveVolume( Result CompositePortalLink::resolveVolume( const GeometryContext& gctx, const Vector3& position, double tolerance) const { - assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::none(), + assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::None(), tolerance)); for (const auto& child : m_children) { - if (child->surface().isOnSurface(gctx, position, BoundaryTolerance::none(), + if (child->surface().isOnSurface(gctx, position, BoundaryTolerance::None(), tolerance)) { return child->resolveVolume(gctx, position); } diff --git a/Core/src/Geometry/Layer.cpp b/Core/src/Geometry/Layer.cpp index 6aaa8e56491..024f99e9c42 100644 --- a/Core/src/Geometry/Layer.cpp +++ b/Core/src/Geometry/Layer.cpp @@ -159,7 +159,7 @@ Acts::Layer::compatibleSurfaces( } BoundaryTolerance boundaryTolerance = options.boundaryTolerance; if (rangeContainsValue(options.externalSurfaces, sf.geometryId())) { - boundaryTolerance = BoundaryTolerance::infinite(); + boundaryTolerance = BoundaryTolerance::Infinite(); } // the surface intersection SurfaceIntersection sfi = diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index 32c4c686214..c4345f39c0d 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -153,7 +153,7 @@ bool TrapezoidVolumeBounds::inside(const Vector3& pos, double tol) const { } Vector2 locp(pos.x(), pos.y()); bool inside(m_faceXYTrapezoidBounds->inside( - locp, BoundaryTolerance::absoluteBound(tol, tol))); + locp, BoundaryTolerance::AbsoluteBound(tol, tol))); return inside; } diff --git a/Core/src/Geometry/TrivialPortalLink.cpp b/Core/src/Geometry/TrivialPortalLink.cpp index 1ba8cbab07b..5e3b3ad5023 100644 --- a/Core/src/Geometry/TrivialPortalLink.cpp +++ b/Core/src/Geometry/TrivialPortalLink.cpp @@ -32,7 +32,7 @@ Result TrivialPortalLink::resolveVolume( static_cast(gctx); static_cast(position); static_cast(tolerance); - assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::none(), + assert(m_surface->isOnSurface(gctx, position, BoundaryTolerance::None(), tolerance) && "Trivial portal lookup point should be on surface"); return m_volume; diff --git a/Core/src/Material/IntersectionMaterialAssigner.cpp b/Core/src/Material/IntersectionMaterialAssigner.cpp index 8c61668fdb9..f85320ee119 100644 --- a/Core/src/Material/IntersectionMaterialAssigner.cpp +++ b/Core/src/Material/IntersectionMaterialAssigner.cpp @@ -26,7 +26,7 @@ std::vector forwardOrderedIntersections( for (auto& surface : surfaces) { // Get the intersection auto sMultiIntersection = surface->intersect( - gctx, position, direction, Acts::BoundaryTolerance::none()); + gctx, position, direction, Acts::BoundaryTolerance::None()); // Take the closest auto closestForward = sMultiIntersection.closestForward(); diff --git a/Core/src/Navigation/NavigationStream.cpp b/Core/src/Navigation/NavigationStream.cpp index e84024afdf4..3ea28dd748c 100644 --- a/Core/src/Navigation/NavigationStream.cpp +++ b/Core/src/Navigation/NavigationStream.cpp @@ -143,14 +143,14 @@ void NavigationStream::addPortalCandidate(const Experimental::Portal& portal) { m_candidates.emplace_back(Candidate{ .intersection = ObjectIntersection::invalid(&portal.surface()), .gen2Portal = &portal, - .bTolerance = BoundaryTolerance::none()}); + .bTolerance = BoundaryTolerance::None()}); } void NavigationStream::addPortalCandidate(const Portal& portal) { m_candidates.emplace_back(Candidate{ .intersection = ObjectIntersection::invalid(&portal.surface()), .portal = &portal, - .bTolerance = BoundaryTolerance::none()}); + .bTolerance = BoundaryTolerance::None()}); } void NavigationStream::addPortalCandidates( @@ -160,7 +160,7 @@ void NavigationStream::addPortalCandidates( .intersection = ObjectIntersection::invalid(&(portal->surface())), .gen2Portal = portal, - .bTolerance = BoundaryTolerance::none()}); + .bTolerance = BoundaryTolerance::None()}); }); } diff --git a/Core/src/Surfaces/BoundaryTolerance.cpp b/Core/src/Surfaces/BoundaryTolerance.cpp index 971a026d7de..3bedc6ab8ff 100644 --- a/Core/src/Surfaces/BoundaryTolerance.cpp +++ b/Core/src/Surfaces/BoundaryTolerance.cpp @@ -15,49 +15,32 @@ namespace Acts { -BoundaryTolerance::BoundaryTolerance(const Infinite& infinite) - : m_variant{infinite} {} - -BoundaryTolerance::BoundaryTolerance(const None& none) : m_variant{none} {} - -BoundaryTolerance::BoundaryTolerance(const AbsoluteBound& absoluteBound) - : m_variant{absoluteBound} {} - -BoundaryTolerance::BoundaryTolerance(const AbsoluteCartesian& absoluteCartesian) - : m_variant{absoluteCartesian} {} - -BoundaryTolerance::BoundaryTolerance(const AbsoluteEuclidean& absoluteEuclidean) - : m_variant{absoluteEuclidean} {} - -BoundaryTolerance::BoundaryTolerance(const Chi2Bound& chi2Bound) - : m_variant{chi2Bound} {} - BoundaryTolerance::BoundaryTolerance(Variant variant) : m_variant{std::move(variant)} {} bool BoundaryTolerance::isInfinite() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::isNone() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::hasAbsoluteBound(bool isCartesian) const { - return holdsVariant() || holdsVariant() || - (isCartesian && holdsVariant()); + return holdsVariant() || holdsVariant() || + (isCartesian && holdsVariant()); } bool BoundaryTolerance::hasAbsoluteCartesian() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::hasAbsoluteEuclidean() const { - return holdsVariant(); + return holdsVariant(); } bool BoundaryTolerance::hasChi2Bound() const { - return holdsVariant(); + return holdsVariant(); } BoundaryTolerance::ToleranceMode BoundaryTolerance::toleranceMode() const { @@ -70,7 +53,7 @@ BoundaryTolerance::ToleranceMode BoundaryTolerance::toleranceMode() const { return None; } - if (const auto* absoluteBound = getVariantPtr(); + if (const auto* absoluteBound = getVariantPtr(); absoluteBound != nullptr) { if (absoluteBound->tolerance0 == 0. && absoluteBound->tolerance1 == 0.) { return None; @@ -79,7 +62,7 @@ BoundaryTolerance::ToleranceMode BoundaryTolerance::toleranceMode() const { return Extend; } - if (const auto* absoluteCartesian = getVariantPtr(); + if (const auto* absoluteCartesian = getVariantPtr(); absoluteCartesian != nullptr) { if (absoluteCartesian->tolerance0 == 0. && absoluteCartesian->tolerance1 == 0.) { @@ -89,7 +72,7 @@ BoundaryTolerance::ToleranceMode BoundaryTolerance::toleranceMode() const { return Extend; } - if (const auto* absoluteEuclidean = getVariantPtr(); + if (const auto* absoluteEuclidean = getVariantPtr(); absoluteEuclidean != nullptr) { if (absoluteEuclidean->tolerance == 0.) { return None; @@ -100,7 +83,7 @@ BoundaryTolerance::ToleranceMode BoundaryTolerance::toleranceMode() const { } } - if (const auto* chi2Bound = getVariantPtr(); + if (const auto* chi2Bound = getVariantPtr(); chi2Bound != nullptr) { if (chi2Bound->maxChi2 == 0.) { return None; @@ -115,35 +98,36 @@ BoundaryTolerance::ToleranceMode BoundaryTolerance::toleranceMode() const { return None; } -BoundaryTolerance::AbsoluteBound BoundaryTolerance::asAbsoluteBound( +BoundaryTolerance::AbsoluteBoundParams BoundaryTolerance::asAbsoluteBound( bool isCartesian) const { if (isNone()) { - return AbsoluteBound{0., 0.}; + return AbsoluteBoundParams{0., 0.}; } if (isCartesian && hasAbsoluteCartesian()) { - const auto& cartesian = getVariant(); - return AbsoluteBound{cartesian.tolerance0, cartesian.tolerance1}; + const auto& cartesian = getVariant(); + return AbsoluteBoundParams{cartesian.tolerance0, cartesian.tolerance1}; } - return getVariant(); + return getVariant(); } -const BoundaryTolerance::AbsoluteCartesian& +const BoundaryTolerance::AbsoluteCartesianParams& BoundaryTolerance::asAbsoluteCartesian() const { - return getVariant(); + return getVariant(); } -const BoundaryTolerance::AbsoluteEuclidean& +const BoundaryTolerance::AbsoluteEuclideanParams& BoundaryTolerance::asAbsoluteEuclidean() const { - return getVariant(); + return getVariant(); } -const BoundaryTolerance::Chi2Bound& BoundaryTolerance::asChi2Bound() const { - return getVariant(); +const BoundaryTolerance::Chi2BoundParams& BoundaryTolerance::asChi2Bound() + const { + return getVariant(); } -std::optional +std::optional BoundaryTolerance::asAbsoluteBoundOpt(bool isCartesian) const { return hasAbsoluteBound(isCartesian) ? std::optional(asAbsoluteBound(isCartesian)) @@ -161,13 +145,13 @@ bool BoundaryTolerance::isTolerated( return distance == Vector2::Zero(); } - if (const auto* absoluteBound = getVariantPtr(); + if (const auto* absoluteBound = getVariantPtr(); absoluteBound != nullptr) { return std::abs(distance[0]) <= absoluteBound->tolerance0 && std::abs(distance[1]) <= absoluteBound->tolerance1; } - if (const auto* chi2Bound = getVariantPtr(); + if (const auto* chi2Bound = getVariantPtr(); chi2Bound != nullptr) { // Mahalanobis distances mean is 2 in 2-dim. cut is 1-d sigma. double chi2 = distance.transpose() * chi2Bound->weight * distance; @@ -187,13 +171,13 @@ bool BoundaryTolerance::isTolerated( cartesianDistance = jacobian * distance; } - if (const auto* absoluteCartesian = getVariantPtr(); + if (const auto* absoluteCartesian = getVariantPtr(); absoluteCartesian != nullptr) { return std::abs(cartesianDistance[0]) <= absoluteCartesian->tolerance0 && std::abs(cartesianDistance[1]) <= absoluteCartesian->tolerance1; } - if (const auto* absoluteEuclidean = getVariantPtr(); + if (const auto* absoluteEuclidean = getVariantPtr(); absoluteEuclidean != nullptr) { if (absoluteEuclidean->tolerance < 0) { return cartesianDistance.norm() > std::abs(absoluteEuclidean->tolerance); @@ -214,7 +198,8 @@ SquareMatrix2 BoundaryTolerance::getMetric( bool isCartesian = !jacobianOpt.has_value(); SquareMatrix2 metric = SquareMatrix2::Identity(); - if (const auto* chi2Bound = getVariantPtr(); + if (const auto* chi2Bound = + getVariantPtr(); chi2Bound != nullptr) { metric = chi2Bound->weight; } else if (!isCartesian) { diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index 0c41bbdbea8..1b9c1906856 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -325,7 +325,7 @@ SurfaceMultiIntersection ConeSurface::intersect( AlignmentToPathMatrix ConeSurface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index cc83702dbf9..45ec85ae1a8 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -289,7 +289,7 @@ SurfaceMultiIntersection CylinderSurface::intersect( AlignmentToPathMatrix CylinderSurface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index d023a7e1e48..99d2f21885d 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -202,7 +202,7 @@ Vector2 DiscSurface::localCartesianToPolar(const Vector2& lcart) const { BoundToFreeMatrix DiscSurface::boundToFreeJacobian( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The measurement frame of the surface RotationMatrix3 rframeT = @@ -238,7 +238,7 @@ FreeToBoundMatrix DiscSurface::freeToBoundJacobian( using VectorHelpers::perp; using VectorHelpers::phi; - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The measurement frame of the surface RotationMatrix3 rframeT = diff --git a/Core/src/Surfaces/LineSurface.cpp b/Core/src/Surfaces/LineSurface.cpp index 6fddef01869..6f6350625d6 100644 --- a/Core/src/Surfaces/LineSurface.cpp +++ b/Core/src/Surfaces/LineSurface.cpp @@ -186,7 +186,7 @@ SurfaceMultiIntersection LineSurface::intersect( BoundToFreeMatrix LineSurface::boundToFreeJacobian( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // retrieve the reference frame auto rframe = referenceFrame(gctx, position, direction); @@ -223,7 +223,7 @@ BoundToFreeMatrix LineSurface::boundToFreeJacobian( FreeToPathMatrix LineSurface::freeToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The vector between position and center Vector3 pcRowVec = position - center(gctx); @@ -252,7 +252,7 @@ FreeToPathMatrix LineSurface::freeToPathDerivative( AlignmentToPathMatrix LineSurface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The vector between position and center Vector3 pcRowVec = position - center(gctx); diff --git a/Core/src/Surfaces/Surface.cpp b/Core/src/Surfaces/Surface.cpp index 03cc455647e..5394587eeae 100644 --- a/Core/src/Surfaces/Surface.cpp +++ b/Core/src/Surfaces/Surface.cpp @@ -62,7 +62,7 @@ bool Surface::isOnSurface(const GeometryContext& gctx, const Vector3& position, AlignmentToBoundMatrix Surface::alignmentToBoundDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const FreeVector& pathDerivative) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // 1) Calculate the derivative of bound parameter local position w.r.t. // alignment parameters without path length correction @@ -85,7 +85,7 @@ AlignmentToBoundMatrix Surface::alignmentToBoundDerivativeWithoutCorrection( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { (void)direction; - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); @@ -125,7 +125,7 @@ AlignmentToBoundMatrix Surface::alignmentToBoundDerivativeWithoutCorrection( AlignmentToPathMatrix Surface::alignmentToPathDerivative( const GeometryContext& gctx, const Vector3& position, const Vector3& direction) const { - assert(isOnSurface(gctx, position, direction, BoundaryTolerance::infinite())); + assert(isOnSurface(gctx, position, direction, BoundaryTolerance::Infinite())); // The vector between position and center const auto pcRowVec = (position - center(gctx)).transpose().eval(); diff --git a/Core/src/Vertexing/HelicalTrackLinearizer.cpp b/Core/src/Vertexing/HelicalTrackLinearizer.cpp index 76dfe1f9f84..bc12feacbcb 100644 --- a/Core/src/Vertexing/HelicalTrackLinearizer.cpp +++ b/Core/src/Vertexing/HelicalTrackLinearizer.cpp @@ -32,7 +32,7 @@ Acts::HelicalTrackLinearizer::linearizeTrack( auto intersection = perigeeSurface .intersect(gctx, params.position(gctx), params.direction(), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); // Setting the propagation direction using the intersection length from diff --git a/Core/src/Vertexing/ImpactPointEstimator.cpp b/Core/src/Vertexing/ImpactPointEstimator.cpp index 5558850428f..51f0ebe24db 100644 --- a/Core/src/Vertexing/ImpactPointEstimator.cpp +++ b/Core/src/Vertexing/ImpactPointEstimator.cpp @@ -364,7 +364,7 @@ Result ImpactPointEstimator::estimate3DImpactParameters( auto intersection = planeSurface ->intersect(gctx, trkParams.position(gctx), trkParams.direction(), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); // Create propagator options @@ -428,7 +428,7 @@ Result ImpactPointEstimator::getImpactParameters( auto intersection = perigeeSurface ->intersect(gctx, track.position(gctx), track.direction(), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); diff --git a/Core/src/Vertexing/NumericalTrackLinearizer.cpp b/Core/src/Vertexing/NumericalTrackLinearizer.cpp index fd372ad6353..c7928a23258 100644 --- a/Core/src/Vertexing/NumericalTrackLinearizer.cpp +++ b/Core/src/Vertexing/NumericalTrackLinearizer.cpp @@ -35,7 +35,7 @@ Acts::NumericalTrackLinearizer::linearizeTrack( auto intersection = perigeeSurface .intersect(gctx, params.position(gctx), params.direction(), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); // Setting the propagation direction using the intersection length from @@ -123,7 +123,7 @@ Acts::NumericalTrackLinearizer::linearizeTrack( // Obtain propagation direction intersection = perigeeSurface .intersect(gctx, paramVecCopy.template head<3>(), - wiggledDir, BoundaryTolerance::infinite()) + wiggledDir, BoundaryTolerance::Infinite()) .closest(); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); diff --git a/Examples/Io/Root/src/RootAthenaDumpReader.cpp b/Examples/Io/Root/src/RootAthenaDumpReader.cpp index b81f0cd4fe9..b791dbf2eba 100644 --- a/Examples/Io/Root/src/RootAthenaDumpReader.cpp +++ b/Examples/Io/Root/src/RootAthenaDumpReader.cpp @@ -398,7 +398,7 @@ RootAthenaDumpReader::readMeasurements( bool inside = surface->isOnSurface(gctx, cluster.globalPosition, {}, - Acts::BoundaryTolerance::absoluteEuclidean( + Acts::BoundaryTolerance::AbsoluteEuclidean( m_cfg.absBoundaryTolerance), std::numeric_limits::max()); diff --git a/Examples/Io/Root/src/RootMaterialTrackWriter.cpp b/Examples/Io/Root/src/RootMaterialTrackWriter.cpp index 35d0dad271c..bec096d2ca7 100644 --- a/Examples/Io/Root/src/RootMaterialTrackWriter.cpp +++ b/Examples/Io/Root/src/RootMaterialTrackWriter.cpp @@ -302,7 +302,7 @@ ProcessCode RootMaterialTrackWriter::writeT( auto sfIntersection = surface ->intersect(ctx.geoContext, mint.position, mint.direction, - Acts::BoundaryTolerance::none()) + Acts::BoundaryTolerance::None()) .closest(); m_sur_id.push_back(surface->geometryId().value()); m_sur_pathCorrection.push_back(1.0); diff --git a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp index f8e17a52fe7..de6753ce3bf 100644 --- a/Examples/Io/Root/src/RootTrackSummaryWriter.cpp +++ b/Examples/Io/Root/src/RootTrackSummaryWriter.cpp @@ -345,7 +345,7 @@ ProcessCode RootTrackSummaryWriter::writeT(const AlgorithmContext& ctx, pSurface ->intersect(ctx.geoContext, particle.position(), particle.direction(), - Acts::BoundaryTolerance::infinite()) + Acts::BoundaryTolerance::Infinite()) .closest(); auto position = intersection.position(); diff --git a/Examples/Io/Root/src/VertexNTupleWriter.cpp b/Examples/Io/Root/src/VertexNTupleWriter.cpp index a9518d95312..affd046b564 100644 --- a/Examples/Io/Root/src/VertexNTupleWriter.cpp +++ b/Examples/Io/Root/src/VertexNTupleWriter.cpp @@ -774,7 +774,7 @@ ProcessCode VertexNTupleWriter::writeT( perigeeSurface ->intersect(ctx.geoContext, params.position(ctx.geoContext), params.direction(), - Acts::BoundaryTolerance::infinite()) + Acts::BoundaryTolerance::Infinite()) .closest(); // Setting the geometry/magnetic field context for the event diff --git a/Fatras/src/Digitization/PlanarSurfaceMask.cpp b/Fatras/src/Digitization/PlanarSurfaceMask.cpp index b92c4600cbe..1b73ff409e6 100644 --- a/Fatras/src/Digitization/PlanarSurfaceMask.cpp +++ b/Fatras/src/Digitization/PlanarSurfaceMask.cpp @@ -98,9 +98,9 @@ ActsFatras::PlanarSurfaceMask::apply(const Acts::Surface& surface, Acts::VectorHelpers::phi(segment[1])); bool startInside = - surface.bounds().inside(localStart, Acts::BoundaryTolerance::none()); + surface.bounds().inside(localStart, Acts::BoundaryTolerance::None()); bool endInside = - surface.bounds().inside(localEnd, Acts::BoundaryTolerance::none()); + surface.bounds().inside(localEnd, Acts::BoundaryTolerance::None()); // Fast exit, both inside if (startInside && endInside) { @@ -133,9 +133,9 @@ ActsFatras::PlanarSurfaceMask::apply(const Acts::Surface& surface, Acts::VectorHelpers::phi(segment[1])); bool startInside = - surface.bounds().inside(sPolar, Acts::BoundaryTolerance::none()); + surface.bounds().inside(sPolar, Acts::BoundaryTolerance::None()); bool endInside = - surface.bounds().inside(ePolar, Acts::BoundaryTolerance::none()); + surface.bounds().inside(ePolar, Acts::BoundaryTolerance::None()); // Fast exit for both inside if (startInside && endInside) { diff --git a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp index d22dc5bcfe4..c700c3d08d5 100644 --- a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp +++ b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp @@ -55,11 +55,11 @@ int main(int /*argc*/, char** /*argv[]*/) { SquareMatrix2 cov; cov << 1.0, 0, 0, 0.05; - BoundaryTolerance bcAbs = BoundaryTolerance::none(); - BoundaryTolerance bcTol0 = BoundaryTolerance::absoluteBound(1.0, 0.0); - BoundaryTolerance bcTol1 = BoundaryTolerance::absoluteBound(0.0, 0.2); - BoundaryTolerance bcTol01 = BoundaryTolerance::absoluteBound(1.0, 0.2); - BoundaryTolerance bcCov = BoundaryTolerance::chi2Bound(cov, 1.0); + BoundaryTolerance bcAbs = BoundaryTolerance::None(); + BoundaryTolerance bcTol0 = BoundaryTolerance::AbsoluteBound(1.0, 0.0); + BoundaryTolerance bcTol1 = BoundaryTolerance::AbsoluteBound(0.0, 0.2); + BoundaryTolerance bcTol01 = BoundaryTolerance::AbsoluteBound(1.0, 0.2); + BoundaryTolerance bcCov = BoundaryTolerance::Chi2Bound(cov, 1.0); // visualization to make sense of things for (std::size_t i = 0; i < 10000; i++) { diff --git a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp index aa9adfebecb..f18a32070be 100644 --- a/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp +++ b/Tests/Benchmarks/BoundaryToleranceBenchmark.cpp @@ -139,11 +139,11 @@ int main(int /*argc*/, char** /*argv[]*/) { }; // Benchmark scenarios - run_all_benches(BoundaryTolerance::infinite(), "No check", Mode::None); - run_all_benches(BoundaryTolerance::none(), "No tolerance", Mode::FastOutside); - run_all_benches(BoundaryTolerance::absoluteBound(0.6, 0.45), "Abs. tolerance", + run_all_benches(BoundaryTolerance::Infinite(), "No check", Mode::None); + run_all_benches(BoundaryTolerance::None(), "No tolerance", Mode::FastOutside); + run_all_benches(BoundaryTolerance::AbsoluteBound(0.6, 0.45), "Abs. tolerance", Mode::SlowOutside); - run_all_benches(BoundaryTolerance::chi2Bound(cov, 3.0), "Cov. tolerance", + run_all_benches(BoundaryTolerance::Chi2Bound(cov, 3.0), "Cov. tolerance", Mode::SlowOutside); return 0; diff --git a/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp b/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp index a1c9af5001e..4d92589bd66 100644 --- a/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp +++ b/Tests/Benchmarks/SurfaceIntersectionBenchmark.cpp @@ -32,7 +32,7 @@ namespace Acts::Test { // Some randomness & number crunching unsigned int ntests = 10; unsigned int nrepts = 2000; -const BoundaryTolerance boundaryTolerance = BoundaryTolerance::infinite(); +const BoundaryTolerance boundaryTolerance = BoundaryTolerance::Infinite(); const bool testPlane = true; const bool testDisc = true; const bool testCylinder = true; diff --git a/Tests/IntegrationTests/NavigatorConsistency.cpp b/Tests/IntegrationTests/NavigatorConsistency.cpp index 3aae08ad975..627c87161e4 100644 --- a/Tests/IntegrationTests/NavigatorConsistency.cpp +++ b/Tests/IntegrationTests/NavigatorConsistency.cpp @@ -337,14 +337,14 @@ Reference1StraightLinePropagator refslpropagator1( Reference1EigenPropagator refepropagator1( estepper, TryAllNavigator({tGeometry, true, true, false, - BoundaryTolerance::infinite()}, + BoundaryTolerance::Infinite()}, getDefaultLogger("ref1_e_nav", Logging::INFO)), getDefaultLogger("ref1_e_prop", Logging::INFO)); Reference2EigenPropagator refepropagator2( estepper, TryAllOverstepNavigator({tGeometry, true, true, false, - BoundaryTolerance::infinite()}, + BoundaryTolerance::Infinite()}, getDefaultLogger("ref2_e_nav", Logging::INFO)), getDefaultLogger("ref2_e_prop", Logging::INFO)); Reference2StraightLinePropagator refslpropagator2( diff --git a/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp b/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp index acbc1a112f7..25f9b8d7a14 100644 --- a/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp +++ b/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp @@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(CorrectedFreeToBoundTrackParameters) { // the intersection of the track with the end surface SurfaceIntersection intersection = eSurface - ->intersect(geoCtx, Vector3(0, 0, 0), dir, BoundaryTolerance::none()) + ->intersect(geoCtx, Vector3(0, 0, 0), dir, BoundaryTolerance::None()) .closest(); Vector3 tpos = intersection.position(); auto s = intersection.pathLength(); diff --git a/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp b/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp index a288498569b..9c84e3635bf 100644 --- a/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp +++ b/Tests/UnitTests/Core/Geometry/GenericApproachDescriptorTests.cpp @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE(GenericApproachDescriptorProperties) { 0., }; Vector3 zDir{0., 0., 1.}; - BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); double nearLimit = -100 * UnitConstants::um; double farLimit = std::numeric_limits::max(); // @@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(GenericApproachDescriptorProperties) { BOOST_AUTO_TEST_CASE(GenericApproachNoOverstepping) { Vector3 origin{0., -0.5, 1.}; Vector3 direction{0., 1., 0.}; - BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); double nearLimit = -100 * UnitConstants::um; double farLimit = std::numeric_limits::max(); diff --git a/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp b/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp index 31b1407b630..6e606e3e03c 100644 --- a/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp +++ b/Tests/UnitTests/Core/Geometry/NavigationLayerTests.cpp @@ -60,12 +60,12 @@ BOOST_AUTO_TEST_CASE(NavigationLayerProperties) { &(pNavigationLayer->surfaceRepresentation())); // isOnLayer() BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, origin, - BoundaryTolerance::none())); + BoundaryTolerance::None())); // isOnLayer() Vector3 crazyPosition{1000., 10000., std::nan("")}; // layer stub has hard-coded globalToLocal return value BOOST_CHECK(pNavigationLayer->isOnLayer(tgContext, crazyPosition, - BoundaryTolerance::none())); + BoundaryTolerance::None())); // resolve() BOOST_CHECK(!pNavigationLayer->resolve(true, true, true)); } diff --git a/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp b/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp index 2bf4a9cde13..9fca8bb64b7 100644 --- a/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp +++ b/Tests/UnitTests/Core/Material/MaterialMapperTests.cpp @@ -56,7 +56,7 @@ class IntersectSurfacesFinder : public IAssignmentFinder { for (auto& surface : surfaces) { // Get the intersection auto sMultiIntersection = surface->intersect(gctx, position, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // One solution, take it if (sMultiIntersection.size() == 1u && sMultiIntersection[0u].status() >= diff --git a/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp b/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp index 1447b00307a..7f4f89c8ca0 100644 --- a/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp +++ b/Tests/UnitTests/Core/Material/MaterialValidaterTests.cpp @@ -55,7 +55,7 @@ class IntersectSurfacesFinder : public IAssignmentFinder { for (auto& surface : surfaces) { // Get the intersection auto sMultiIntersection = surface->intersect(gctx, position, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // One solution, take it if (sMultiIntersection.size() == 1u && sMultiIntersection[0u].status() >= diff --git a/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp b/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp index eb2cc000637..2817465311a 100644 --- a/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp +++ b/Tests/UnitTests/Core/Navigation/NavigationStreamTests.cpp @@ -95,7 +95,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { NavigationStream nStreamTemplate; for (const auto& surface : surfaces) { nStreamTemplate.addSurfaceCandidate(*surface, - Acts::BoundaryTolerance::none()); + Acts::BoundaryTolerance::None()); } BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 4u); @@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { NavigationStream nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., -30.), Vector3(0., 0., 1.)}, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 4u); BOOST_CHECK_EQUAL(&nStream.currentCandidate().surface(), surfaces[1u].get()); @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(0., 0., 1.)}, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 3u); BOOST_CHECK_EQUAL(&nStream.currentCandidate().surface(), surfaces[3u].get()); @@ -126,7 +126,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., -100.), Vector3(0., 0., 1.)}, - BoundaryTolerance::none())); + BoundaryTolerance::None())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 3u); // (4) Run an initial update @@ -134,20 +134,20 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializePlanes) { nStream = nStreamTemplate; BOOST_CHECK(!nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(1., 0., 0.)}, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 0u); BOOST_CHECK_THROW(nStream.currentCandidate(), std::out_of_range); // (5) Test de-duplication nStream = nStreamTemplate; nStreamTemplate.addSurfaceCandidate(*surfaces.at(0), - Acts::BoundaryTolerance::none()); + Acts::BoundaryTolerance::None()); // One surface is duplicated in the stream BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 5u); // Initialize stream reaches all surfaces, but also de-duplicates BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., -100.), Vector3(0., 0., 1.)}, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 4u); } @@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_UpdatePlanes) { NavigationStream nStreamTemplate; for (const auto& surface : surfaces) { nStreamTemplate.addSurfaceCandidate(*surface, - Acts::BoundaryTolerance::none()); + Acts::BoundaryTolerance::None()); } BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 4u); @@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_UpdatePlanes) { NavigationStream nStream = nStreamTemplate; BOOST_CHECK( - nStream.initialize(gContext, qPoint, BoundaryTolerance::infinite())); + nStream.initialize(gContext, qPoint, BoundaryTolerance::Infinite())); BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 4u); BOOST_CHECK_EQUAL(&nStream.currentCandidate().surface(), surfaces[1u].get()); CHECK_CLOSE_ABS(nStream.currentCandidate().pathLength(), 10., @@ -233,7 +233,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { for (const auto& surface : surfaces) { const Surface* pointer = surface.get(); nStreamTemplate.addSurfaceCandidates({&pointer, 1}, - Acts::BoundaryTolerance::none()); + Acts::BoundaryTolerance::None()); } BOOST_CHECK_EQUAL(nStreamTemplate.remainingCandidates(), 4u); @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { NavigationStream nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize( gContext, {Vector3(0., 0., 0.), Vector3(1., 1., 0.).normalized()}, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); // We should have 5 candidates, as one cylinder is reachable twice BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 5u); // First one is inner candidate @@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(1., 0., 0.)}, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); // We should have 3 candidates BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 3u); @@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { nStream = nStreamTemplate; BOOST_CHECK(nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(1., 0., 0.)}, - BoundaryTolerance::none())); + BoundaryTolerance::None())); // We should have 2 candidates BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 2u); @@ -277,7 +277,7 @@ BOOST_AUTO_TEST_CASE(NavigationStream_InitializeCylinders) { nStream = nStreamTemplate; BOOST_CHECK(!nStream.initialize(gContext, {Vector3(0., 0., 0.), Vector3(0., 0., 1.)}, - BoundaryTolerance::none())); + BoundaryTolerance::None())); // We should have 0 candidates BOOST_CHECK_EQUAL(nStream.remainingCandidates(), 0u); BOOST_CHECK_THROW(nStream.currentCandidate(), std::out_of_range); diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index 62f46283f15..a96df18fa52 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -459,7 +459,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { targetSurface ->intersect(tgContext, es.position(esState), navDir * es.direction(esState), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(), navDir, ConstrainedStep::navigator); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); @@ -469,7 +469,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { targetSurface ->intersect(tgContext, es.position(esState), navDir * es.direction(esState), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(), navDir, ConstrainedStep::navigator); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); diff --git a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp index 8303b8d2937..0162fb78525 100644 --- a/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp +++ b/Tests/UnitTests/Core/Seeding/PathSeederTest.cpp @@ -78,7 +78,7 @@ class NoFieldIntersectionFinder { // Get the intersection auto sMultiIntersection = surface->intersect( geoCtx, position, direction, - BoundaryTolerance::absoluteCartesian(m_tol, m_tol)); + BoundaryTolerance::AbsoluteCartesian(m_tol, m_tol)); // Take the closest auto closestForward = sMultiIntersection.closestForward(); diff --git a/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp index 43adadba36b..10cfb500a50 100644 --- a/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/AnnulusBoundsTests.cpp @@ -97,15 +97,15 @@ BOOST_AUTO_TEST_CASE(AnnulusBoundsProperties) { }; BOOST_CHECK( - aBounds.inside(toStripFrame(inSurfaceXY), BoundaryTolerance::none())); + aBounds.inside(toStripFrame(inSurfaceXY), BoundaryTolerance::None())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY1), BoundaryTolerance::none())); + !aBounds.inside(toStripFrame(outsideXY1), BoundaryTolerance::None())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY2), BoundaryTolerance::none())); + !aBounds.inside(toStripFrame(outsideXY2), BoundaryTolerance::None())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY3), BoundaryTolerance::none())); + !aBounds.inside(toStripFrame(outsideXY3), BoundaryTolerance::None())); BOOST_CHECK( - !aBounds.inside(toStripFrame(outsideXY4), BoundaryTolerance::none())); + !aBounds.inside(toStripFrame(outsideXY4), BoundaryTolerance::None())); // Check radial inside BOOST_CHECK(!aBounds.insideRadialBounds(0.5)); diff --git a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp index 33f05eb5853..47238d51068 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -39,11 +39,11 @@ BOOST_AUTO_TEST_CASE(BoundaryToleranceConstructors) { { // Valid positive tolerances auto tolerance = BoundaryTolerance::AbsoluteBound(1.0, 2.0); - BOOST_CHECK_EQUAL(tolerance.tolerance0, 1.0); - BOOST_CHECK_EQUAL(tolerance.tolerance1, 2.0); - BOOST_CHECK(BoundaryTolerance{tolerance}.toleranceMode() == Extend); - BOOST_CHECK(BoundaryTolerance{BoundaryTolerance::AbsoluteBound(0.0, 0.0)} - .toleranceMode() == None); + BOOST_CHECK_EQUAL(tolerance.asAbsoluteBound().tolerance0, 1.0); + BOOST_CHECK_EQUAL(tolerance.asAbsoluteBound().tolerance1, 2.0); + BOOST_CHECK(tolerance.toleranceMode() == Extend); + BOOST_CHECK(BoundaryTolerance::AbsoluteBound(0.0, 0.0).toleranceMode() == + None); // Negative tolerances should throw BOOST_CHECK_THROW(BoundaryTolerance::AbsoluteBound(-1.0, 2.0), @@ -56,27 +56,26 @@ BOOST_AUTO_TEST_CASE(BoundaryToleranceConstructors) { { // Valid positive tolerance auto tolerance = BoundaryTolerance::AbsoluteEuclidean(1.0); - BOOST_CHECK_EQUAL(tolerance.tolerance, 1.0); - BOOST_CHECK(BoundaryTolerance{tolerance}.toleranceMode() == Extend); - BOOST_CHECK(BoundaryTolerance{BoundaryTolerance::AbsoluteEuclidean(0.0)} - .toleranceMode() == None); + BOOST_CHECK_EQUAL(tolerance.asAbsoluteEuclidean().tolerance, 1.0); + BOOST_CHECK(tolerance.toleranceMode() == Extend); + BOOST_CHECK(BoundaryTolerance::AbsoluteEuclidean(0.0).toleranceMode() == + None); // Valid negative tolerance tolerance = BoundaryTolerance::AbsoluteEuclidean(-1.0); - BOOST_CHECK_EQUAL(tolerance.tolerance, -1.0); - BOOST_CHECK(BoundaryTolerance{tolerance}.toleranceMode() == Shrink); + BOOST_CHECK_EQUAL(tolerance.asAbsoluteEuclidean().tolerance, -1.0); + BOOST_CHECK(tolerance.toleranceMode() == Shrink); } // Test AbsoluteCartesian constructor { // Valid positive tolerance auto tolerance = BoundaryTolerance::AbsoluteCartesian(1.0, 2.0); - BOOST_CHECK_EQUAL(tolerance.tolerance0, 1.0); - BOOST_CHECK_EQUAL(tolerance.tolerance1, 2.0); - BOOST_CHECK(BoundaryTolerance{tolerance}.toleranceMode() == Extend); + BOOST_CHECK_EQUAL(tolerance.asAbsoluteCartesian().tolerance0, 1.0); + BOOST_CHECK_EQUAL(tolerance.asAbsoluteCartesian().tolerance1, 2.0); + BOOST_CHECK(tolerance.toleranceMode() == Extend); BOOST_CHECK( - BoundaryTolerance{BoundaryTolerance::AbsoluteCartesian(0.0, 0.0)} - .toleranceMode() == None); + BoundaryTolerance::AbsoluteCartesian(0.0, 0.0).toleranceMode() == None); // Negative tolerances should throw BOOST_CHECK_THROW(BoundaryTolerance::AbsoluteCartesian(-1.0, 2.0), @@ -92,15 +91,14 @@ BOOST_AUTO_TEST_CASE(BoundaryToleranceConstructors) { // Valid positive chi2 bound auto tolerance = BoundaryTolerance::Chi2Bound(cov, 3.0); - BOOST_CHECK_EQUAL(tolerance.maxChi2, 3.0); - BOOST_CHECK(BoundaryTolerance{tolerance}.toleranceMode() == Extend); - BOOST_CHECK(BoundaryTolerance{BoundaryTolerance::Chi2Bound(cov, 0.0)} - .toleranceMode() == None); + BOOST_CHECK_EQUAL(tolerance.asChi2Bound().maxChi2, 3.0); + BOOST_CHECK(tolerance.toleranceMode() == Extend); + BOOST_CHECK(BoundaryTolerance::Chi2Bound(cov, 0.0).toleranceMode() == None); // Valid negative chi2 bound tolerance = BoundaryTolerance::Chi2Bound(cov, -3.0); - BOOST_CHECK_EQUAL(tolerance.maxChi2, -3.0); - BOOST_CHECK(BoundaryTolerance{tolerance}.toleranceMode() == Shrink); + BOOST_CHECK_EQUAL(tolerance.asChi2Bound().maxChi2, -3.0); + BOOST_CHECK(tolerance.toleranceMode() == Shrink); } // Test None constructor @@ -113,7 +111,7 @@ BOOST_AUTO_TEST_CASE(BoundaryToleranceConstructors) { BOOST_AUTO_TEST_CASE(BoundaryCheckBoxSimple) { Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::none(); + auto tolerance = BoundaryTolerance::None(); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -132,7 +130,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxToleranceLoc0) { em.execute([]() { Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::absoluteBound( + auto tolerance = BoundaryTolerance::AbsoluteBound( 1.5, std::numeric_limits::infinity()); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); @@ -155,7 +153,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) { cov << 1, 0.5, 0.5, 2; Vector2 ll(-1, -1); Vector2 ur(1, 1); - auto tolerance = BoundaryTolerance::chi2Bound(cov.inverse(), 3.); + auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 3.); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -171,7 +169,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckBoxCovariance) { // Triangle w/ simple check BOOST_AUTO_TEST_CASE(BoundaryCheckTriangleSimple) { Vector2 vertices[] = {{-2, 0}, {2, 0}, {0, 2}}; - auto tolerance = BoundaryTolerance::none(); + auto tolerance = BoundaryTolerance::None(); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 1}, std::nullopt)); BOOST_CHECK( @@ -184,7 +182,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckTriangleCovariance) { Vector2 vertices[] = {{-2, 0}, {2, 0}, {0, 2}}; SquareMatrix2 cov; cov << 0.5, 0, 0, 0.5; - auto tolerance = BoundaryTolerance::chi2Bound(cov.inverse(), 4.1); + auto tolerance = BoundaryTolerance::Chi2Bound(cov.inverse(), 4.1); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 1}, std::nullopt)); BOOST_CHECK(detail::insidePolygon(vertices, tolerance, {0, 2}, std::nullopt)); @@ -199,7 +197,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { Vector2 ur(1, 1); { - auto tolerance = BoundaryTolerance::none(); + auto tolerance = BoundaryTolerance::None(); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -211,7 +209,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::infinite(); + auto tolerance = BoundaryTolerance::Infinite(); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -223,7 +221,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::absoluteBound(0.5, 0.5); + auto tolerance = BoundaryTolerance::AbsoluteBound(0.5, 0.5); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -241,7 +239,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::absoluteCartesian(0.5, 0.5); + auto tolerance = BoundaryTolerance::AbsoluteCartesian(0.5, 0.5); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -259,7 +257,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { } { - auto tolerance = BoundaryTolerance::absoluteEuclidean(1.1); + auto tolerance = BoundaryTolerance::AbsoluteEuclidean(1.1); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( @@ -272,7 +270,7 @@ BOOST_AUTO_TEST_CASE(BoundaryCheckDifferentTolerances) { { auto tolerance = - BoundaryTolerance::chi2Bound(SquareMatrix2::Identity(), 1.); + BoundaryTolerance::Chi2Bound(SquareMatrix2::Identity(), 1.); BOOST_CHECK( detail::insideAlignedBox(ll, ur, tolerance, {0, 0}, std::nullopt)); BOOST_CHECK( diff --git a/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp index a6b7b9063f9..3c9e114c05e 100644 --- a/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConeSurfaceTests.cpp @@ -158,9 +158,9 @@ BOOST_AUTO_TEST_CASE(ConeSurfaceProperties) { /// Test isOnSurface Vector3 offSurface{100, 1, 2}; BOOST_CHECK(coneSurfaceObject->isOnSurface( - tgContext, globalPosition, momentum, BoundaryTolerance::none())); + tgContext, globalPosition, momentum, BoundaryTolerance::None())); BOOST_CHECK(!coneSurfaceObject->isOnSurface(tgContext, offSurface, momentum, - BoundaryTolerance::none())); + BoundaryTolerance::None())); /// Test pathCorrection CHECK_CLOSE_REL(coneSurfaceObject->pathCorrection(tgContext, offSurface, diff --git a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp index 33bf42436bb..7b516b6bfec 100644 --- a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(ConvexPolygonBoundsConstruction) { BOOST_CHECK_EQUAL(bb.min(), Vector2(0, 0)); BOOST_CHECK_EQUAL(bb.max(), Vector2(1., 1)); - BoundaryTolerance tolerance = BoundaryTolerance::none(); + BoundaryTolerance tolerance = BoundaryTolerance::None(); BOOST_CHECK(triangle.inside({0.2, 0.2}, tolerance)); BOOST_CHECK(!triangle.inside({0.4, 0.9}, tolerance)); @@ -114,7 +114,7 @@ BOOST_AUTO_TEST_CASE(ConvexPolygonBoundsDynamicTest) { BOOST_CHECK_EQUAL(bb.min(), Vector2(0, 0)); BOOST_CHECK_EQUAL(bb.max(), Vector2(1., 1)); - BoundaryTolerance tolerance = BoundaryTolerance::none(); + BoundaryTolerance tolerance = BoundaryTolerance::None(); BOOST_CHECK(triangle.inside({0.2, 0.2}, tolerance)); BOOST_CHECK(!triangle.inside({0.4, 0.9}, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp index dfdcef35b89..6cc6bc8da82 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -125,9 +125,9 @@ BOOST_AUTO_TEST_CASE(CylinderBoundsProperties) { const Vector2 withinBevelMin{0.5, -20.012}; const Vector2 outsideBevelMin{0.5, -40.}; const BoundaryTolerance tolerance = - BoundaryTolerance::absoluteBound(0.1, 0.1); + BoundaryTolerance::AbsoluteBound(0.1, 0.1); const BoundaryTolerance lessTolerance = - BoundaryTolerance::absoluteBound(0.01, 0.01); + BoundaryTolerance::AbsoluteBound(0.01, 0.01); BOOST_CHECK(cylinderBoundsObject.inside(atPiBy2, tolerance)); BOOST_CHECK(!cylinderBoundsSegment.inside(unitPhi, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp index fbbf743509f..073f743ad29 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp @@ -178,18 +178,18 @@ BOOST_AUTO_TEST_CASE(CylinderSurfaceProperties) { /// Test isOnSurface Vector3 offSurface{100, 1, 2}; BOOST_CHECK(cylinderSurfaceObject->isOnSurface( - testContext, globalPosition, momentum, BoundaryTolerance::none())); + testContext, globalPosition, momentum, BoundaryTolerance::None())); BOOST_CHECK(cylinderSurfaceObject->isOnSurface(testContext, globalPosition, - BoundaryTolerance::none())); + BoundaryTolerance::None())); BOOST_CHECK(!cylinderSurfaceObject->isOnSurface( - testContext, offSurface, momentum, BoundaryTolerance::none())); + testContext, offSurface, momentum, BoundaryTolerance::None())); BOOST_CHECK(!cylinderSurfaceObject->isOnSurface(testContext, offSurface, - BoundaryTolerance::none())); + BoundaryTolerance::None())); /// Intersection test Vector3 direction{-1., 0, 0}; auto sfIntersection = cylinderSurfaceObject->intersect( - testContext, offSurface, direction, BoundaryTolerance::infinite()); + testContext, offSurface, direction, BoundaryTolerance::Infinite()); Intersection3D expectedIntersect{Vector3{1, 1, 2}, 99., IntersectionStatus::reachable}; BOOST_CHECK(sfIntersection[0].isValid()); diff --git a/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp index 8ab65c9c952..1869cde057d 100644 --- a/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiamondBoundsTests.cpp @@ -106,10 +106,10 @@ BOOST_AUTO_TEST_CASE(DiamondBoundsProperties) { "50.0000000, 30.0000000, 10.0000000, 20.0000000)")); /// Test inside - BOOST_CHECK(diamondBoundsObject.inside(origin, BoundaryTolerance::none())); + BOOST_CHECK(diamondBoundsObject.inside(origin, BoundaryTolerance::None())); // dont understand why this is so: BOOST_CHECK( - !diamondBoundsObject.inside(outsideBy10, BoundaryTolerance::none())); + !diamondBoundsObject.inside(outsideBy10, BoundaryTolerance::None())); /// Test vertices (does this need to be implemented in this class?? // auto v=diamondBoundsObject.vertices(); diff --git a/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp index 6b2d6fb6f2a..4a304f23510 100644 --- a/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp @@ -120,13 +120,13 @@ BOOST_AUTO_TEST_CASE(DiscSurfaceProperties) { Vector3 point3DOnSurface{1.2, 0., 0}; BOOST_CHECK(!discSurfaceObject->isOnSurface(tgContext, point3DNotInSector, ignoredMomentum, - BoundaryTolerance::none())); + BoundaryTolerance::None())); BOOST_CHECK(!discSurfaceObject->isOnSurface(tgContext, point3DNotInSector, - BoundaryTolerance::none())); + BoundaryTolerance::None())); BOOST_CHECK(discSurfaceObject->isOnSurface( - tgContext, point3DOnSurface, ignoredMomentum, BoundaryTolerance::none())); + tgContext, point3DOnSurface, ignoredMomentum, BoundaryTolerance::None())); BOOST_CHECK(discSurfaceObject->isOnSurface(tgContext, point3DOnSurface, - BoundaryTolerance::none())); + BoundaryTolerance::None())); /// Test localToGlobal Vector3 returnedPosition{10.9, 8.7, 6.5}; @@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(DiscSurfaceProperties) { // (bool) valid, it's contained in a Surface intersection auto sfIntersection = discSurfaceObject ->intersect(tgContext, globalPosition, direction, - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); Intersection3D expectedIntersect{Vector3{1.2, 0., 0.}, 10., IntersectionStatus::reachable}; diff --git a/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp index 816627b07da..8f6117ef1b0 100644 --- a/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiscTrapezoidBoundsTests.cpp @@ -126,9 +126,9 @@ BOOST_AUTO_TEST_CASE(DiscTrapezoidBoundsProperties) { /// Test inside BOOST_CHECK( - DiscTrapezoidBoundsObject.inside(inSurface, BoundaryTolerance::none())); + DiscTrapezoidBoundsObject.inside(inSurface, BoundaryTolerance::None())); BOOST_CHECK( - !DiscTrapezoidBoundsObject.inside(outside, BoundaryTolerance::none())); + !DiscTrapezoidBoundsObject.inside(outside, BoundaryTolerance::None())); /// Test rMin CHECK_CLOSE_REL(DiscTrapezoidBoundsObject.rMin(), rMin, 1e-6); diff --git a/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp index 85f844a3186..0ed78e656f6 100644 --- a/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/EllipseBoundsTests.cpp @@ -179,10 +179,10 @@ BOOST_AUTO_TEST_CASE(EllipseBoundsProperties) { /// Test inside BOOST_CHECK( - !ellipseBoundsObject.inside(inRectangle, BoundaryTolerance::none())); + !ellipseBoundsObject.inside(inRectangle, BoundaryTolerance::None())); // don't understand why this is so: BOOST_CHECK( - !ellipseBoundsObject.inside(outsideBy15, BoundaryTolerance::none())); + !ellipseBoundsObject.inside(outsideBy15, BoundaryTolerance::None())); } /// Unit test for testing EllipseBounds assignment BOOST_AUTO_TEST_CASE(EllipseBoundsAssignment) { diff --git a/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp index b4644514f3d..b0c7fa0c94f 100644 --- a/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/InfiniteBoundsTests.cpp @@ -34,7 +34,7 @@ BOOST_AUTO_TEST_CASE(InfiniteBoundsProperties) { /// Test for inside() const Vector2 anyVector{0., 1.}; - const BoundaryTolerance anyTolerance = BoundaryTolerance::none(); + const BoundaryTolerance anyTolerance = BoundaryTolerance::None(); BOOST_CHECK(infiniteBoundsObject.inside(anyVector, anyTolerance)); /// Test for dump diff --git a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp index b0edc35d968..c8022a9174c 100644 --- a/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineBoundsTests.cpp @@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE(LineBoundsProperties) { const Vector2 unitZ{0., 1.}; const Vector2 unitR{1., 0.}; const BoundaryTolerance tolerance = - BoundaryTolerance::absoluteBound(0.1, 0.1); + BoundaryTolerance::AbsoluteBound(0.1, 0.1); // This fails because the bounds are not inclusive. BOOST_CHECK(!lineBoundsObject.inside(atRadius, tolerance)); BOOST_CHECK(!lineBoundsObject.inside(beyondEnd, tolerance)); diff --git a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp index ee4b84c6796..b1e4e3d9a93 100644 --- a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(LineSurface_allNamedMethods_test) { const Vector3 direction{0., 1., 2.}; auto sfIntersection = line.intersect(tgContext, {0., 0., 0.}, direction.normalized(), - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); BOOST_CHECK(sfIntersection.isValid()); Vector3 expectedIntersection(0, 1., 2.); @@ -134,10 +134,10 @@ BOOST_AUTO_TEST_CASE(LineSurface_allNamedMethods_test) { const Vector3 insidePosition{0., 2.5, 0.}; BOOST_CHECK(line.isOnSurface( tgContext, insidePosition, mom, - BoundaryTolerance::infinite())); // need better test here + BoundaryTolerance::Infinite())); // need better test here const Vector3 outsidePosition{100., 100., 200.}; BOOST_CHECK(!line.isOnSurface(tgContext, outsidePosition, mom, - BoundaryTolerance::none())); + BoundaryTolerance::None())); // localToGlobal Vector3 returnedGlobalPosition{0., 0., 0.}; diff --git a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp index fd9ae32f0e3..6c09e65ab65 100644 --- a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp @@ -156,19 +156,19 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceProperties) { /// Test isOnSurface Vector3 offSurface{0, 1, -2.}; BOOST_CHECK(planeSurfaceObject->isOnSurface( - tgContext, globalPosition, momentum, BoundaryTolerance::none())); + tgContext, globalPosition, momentum, BoundaryTolerance::None())); BOOST_CHECK(planeSurfaceObject->isOnSurface(tgContext, globalPosition, - BoundaryTolerance::none())); + BoundaryTolerance::None())); BOOST_CHECK(!planeSurfaceObject->isOnSurface(tgContext, offSurface, momentum, - BoundaryTolerance::none())); + BoundaryTolerance::None())); BOOST_CHECK(!planeSurfaceObject->isOnSurface(tgContext, offSurface, - BoundaryTolerance::none())); + BoundaryTolerance::None())); /// Test intersection Vector3 direction{0., 0., 1.}; auto sfIntersection = planeSurfaceObject ->intersect(tgContext, offSurface, direction, - BoundaryTolerance::none()) + BoundaryTolerance::None()) .closest(); Intersection3D expectedIntersect{Vector3{0, 1, 2}, 4., IntersectionStatus::reachable}; @@ -299,16 +299,16 @@ BOOST_AUTO_TEST_CASE(RotatedTrapezoid) { std::shared_ptr bounds = std::make_shared(shortHalfX, longHalfX, halfY); - BOOST_CHECK(bounds->inside(edgePoint, BoundaryTolerance::none())); + BOOST_CHECK(bounds->inside(edgePoint, BoundaryTolerance::None())); BOOST_CHECK(!bounds->inside(Eigen::Rotation2D(-rotAngle) * edgePoint, - BoundaryTolerance::none())); + BoundaryTolerance::None())); std::shared_ptr rotatedBounds = std::make_shared(shortHalfX, longHalfX, halfY, rotAngle); - BOOST_CHECK(!rotatedBounds->inside(edgePoint, BoundaryTolerance::none())); + BOOST_CHECK(!rotatedBounds->inside(edgePoint, BoundaryTolerance::None())); BOOST_CHECK(rotatedBounds->inside(Eigen::Rotation2D(-rotAngle) * edgePoint, - BoundaryTolerance::none())); + BoundaryTolerance::None())); } /// Unit test for testing PlaneSurface alignment derivatives diff --git a/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp index bfb6de1a6cf..a5083efaf92 100644 --- a/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp @@ -103,8 +103,8 @@ BOOST_AUTO_TEST_CASE(RadialBoundsProperties) { "5.0000000, 0.3926991, 0.0000000)")); /// Test inside - BOOST_CHECK(radialBoundsObject.inside(inSurface, BoundaryTolerance::none())); - BOOST_CHECK(!radialBoundsObject.inside(outside, BoundaryTolerance::none())); + BOOST_CHECK(radialBoundsObject.inside(inSurface, BoundaryTolerance::None())); + BOOST_CHECK(!radialBoundsObject.inside(outside, BoundaryTolerance::None())); /// Test rMin BOOST_CHECK_EQUAL(radialBoundsObject.get(RadialBounds::eMinR), rMin); diff --git a/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp index 9a049133e21..ad310e393cf 100644 --- a/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/RectangleBoundsTests.cpp @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(RectangleBoundsProperties) { rectVertices.cbegin(), rectVertices.cend()); const Vector2 pointA{1., 1.}; // distance is signed, from boundary to point. (doesn't seem right, given - BoundaryTolerance tolerance = BoundaryTolerance::none(); + BoundaryTolerance tolerance = BoundaryTolerance::None(); BOOST_CHECK(rect.inside(pointA, tolerance)); } BOOST_AUTO_TEST_CASE(RectangleBoundsAssignment) { diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp index c9f1d3a3eb8..655303f9602 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp @@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersect without boundary check auto aIntersection = aCylinder->intersect(tgContext, onCylinder, alongX, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // Check the validity of the intersection BOOST_CHECK(aIntersection[0].isValid()); @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersect from the center auto cIntersection = aCylinder->intersect(tgContext, atCenter, alongX, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // Check the validity of the intersection BOOST_CHECK(cIntersection[0].isValid()); @@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersect from outside where both intersections are reachable auto oIntersection = aCylinder->intersect(tgContext, outCylinder, alongX, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // Check the validity of the intersection BOOST_CHECK(oIntersection[0].isValid()); @@ -112,14 +112,14 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Intersection from outside without chance of hitting the cylinder auto iIntersection = aCylinder->intersect(tgContext, outCylinder, transXY, - BoundaryTolerance::infinite()); + BoundaryTolerance::Infinite()); // Check the validity of the intersection BOOST_CHECK(!iIntersection[0].isValid()); // From edge tests - wo boundary test auto eIntersection = aCylinder->intersect(tgContext, atEdge, transTZ, - BoundaryTolerance::infinite()); + BoundaryTolerance::Infinite()); // Check the validity of the intersection BOOST_CHECK(eIntersection[0].isValid()); @@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { // Now re-do with boundary check eIntersection = aCylinder->intersect(tgContext, atEdge, transTZ, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // This should be the negative one BOOST_CHECK_LT(eIntersection[0].pathLength(), 0.); // The status of this one should be reachable @@ -179,9 +179,9 @@ BOOST_AUTO_TEST_CASE(ConeIntersectionTest) { // Intersect without boundary check with an on solution BOOST_CHECK(aCone->isOnSurface(tgContext, onCone, transXY, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); auto aIntersection = - aCone->intersect(tgContext, onCone, transXY, BoundaryTolerance::none()); + aCone->intersect(tgContext, onCone, transXY, BoundaryTolerance::None()); // Check the validity of the intersection BOOST_CHECK(aIntersection[0].isValid()); @@ -196,7 +196,7 @@ BOOST_AUTO_TEST_CASE(ConeIntersectionTest) { // Intersection from outside without chance of hitting the cylinder auto iIntersection = aCone->intersect(tgContext, outCone, perpXY, - BoundaryTolerance::infinite()); + BoundaryTolerance::Infinite()); // Check the validity of the intersection BOOST_CHECK(!iIntersection[0].isValid()); @@ -237,7 +237,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // Intersect forward auto fIntersection = aPlane->intersect(tgContext, before, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(fIntersection[0].isValid()); @@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // On surface intersection auto oIntersection = aPlane->intersect(tgContext, onit, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable @@ -263,7 +263,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // Intersect backwards auto bIntersection = aPlane->intersect(tgContext, after, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(bIntersection[0].isValid()); // The intersection MUST be reachable @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // An out of bounds attempt: missed auto mIntersection = aPlane->intersect(tgContext, outside, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST NOT be valid BOOST_CHECK(!mIntersection[0].isValid()); // The intersection MUST be reachable @@ -288,7 +288,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { // An invalid attempt auto iIntersection = aPlane->intersect(tgContext, before, parallel, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST NOT be valid BOOST_CHECK(!iIntersection[0].isValid()); // The intersection MUST be reachable @@ -333,7 +333,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // A random intersection form backward // Intersect forward auto fIntersection = aLine->intersect(tgContext, before, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(fIntersection[0].isValid()); // The intersection MUST be reachable @@ -345,7 +345,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // On surface intersection - on the straw with random direction auto oIntersection = aLine->intersect(tgContext, onit1, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable @@ -358,7 +358,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // On surface intersecion - on the surface with normal vector oIntersection = - aLine->intersect(tgContext, onitP, normalP, BoundaryTolerance::none()); + aLine->intersect(tgContext, onitP, normalP, BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable @@ -371,7 +371,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // Intersect backwards auto bIntersection = aLine->intersect(tgContext, after, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST be valid BOOST_CHECK(bIntersection[0].isValid()); // The intersection MUST be reachable @@ -383,7 +383,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // An out of bounds attempt: missed auto mIntersection = aLine->intersect(tgContext, outside, direction, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST NOT be valid BOOST_CHECK(!mIntersection[0].isValid()); // The intersection MUST be reachable @@ -396,7 +396,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { // An invalid attempt auto iIntersection = aLine->intersect(tgContext, before, parallel, - BoundaryTolerance::none()); + BoundaryTolerance::None()); // The intersection MUST NOT be valid BOOST_CHECK(!iIntersection[0].isValid()); // The intersection MUST be reachable diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp index 39c4f857ff8..e4c214b53d8 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceTests.cpp @@ -108,10 +108,10 @@ BOOST_AUTO_TEST_CASE(SurfaceProperties) { // isOnSurface BOOST_CHECK(surface.isOnSurface(tgContext, reference, mom, - BoundaryTolerance::infinite())); + BoundaryTolerance::Infinite())); BOOST_CHECK(surface.isOnSurface( tgContext, reference, mom, - BoundaryTolerance::none())); // need to improve bounds() + BoundaryTolerance::None())); // need to improve bounds() // referenceFrame() RotationMatrix3 unitary; diff --git a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp index 9ec6134e92f..76ac35d4bd9 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -123,12 +123,12 @@ BOOST_AUTO_TEST_CASE(TrapezoidBoundsProperties) { /// Test inside BOOST_CHECK( - trapezoidBoundsObject.inside(inRectangle, BoundaryTolerance::none())); + trapezoidBoundsObject.inside(inRectangle, BoundaryTolerance::None())); BOOST_CHECK( - !trapezoidBoundsObject.inside(outside, BoundaryTolerance::none())); + !trapezoidBoundsObject.inside(outside, BoundaryTolerance::None())); const auto vertices = trapezoidBoundsObject.vertices(); - BoundaryTolerance tolerance = BoundaryTolerance::none(); + BoundaryTolerance tolerance = BoundaryTolerance::None(); std::vector testPoints = { // inside @@ -186,10 +186,10 @@ BOOST_DATA_TEST_CASE( static const TrapezoidBounds trapezoidBoundsObject(minHalfX, maxHalfX, halfY); static const auto vertices = trapezoidBoundsObject.vertices(); - BoundaryTolerance tolerance = BoundaryTolerance::none(); + BoundaryTolerance tolerance = BoundaryTolerance::None(); if (tol != 0.) { - tolerance = BoundaryTolerance::absoluteBound(tol, tol); + tolerance = BoundaryTolerance::AbsoluteBound(tol, tol); } BOOST_CHECK_EQUAL( diff --git a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp index 26b94f14ae9..50bfeac3504 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp @@ -201,7 +201,7 @@ BoundVector meanFromFree(std::vector> cmps, Vector3 direction = mean.segment<3>(eFreeDir0); auto intersection = surface .intersect(GeometryContext{}, position, direction, - BoundaryTolerance::infinite()) + BoundaryTolerance::Infinite()) .closest(); mean.head<3>() = intersection.position(); diff --git a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp index 82f47dd48ee..75bebd6a27d 100644 --- a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp @@ -262,7 +262,7 @@ BOOST_DATA_TEST_CASE(TimeAtPca, tracksWithoutIPs* vertices, t0, phi, theta, p, auto intersection = refPerigeeSurface ->intersect(geoContext, params.position(geoContext), - params.direction(), BoundaryTolerance::infinite()) + params.direction(), BoundaryTolerance::Infinite()) .closest(); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); From 11ec20ab8d395ad6c87d5ed2e2bcfadaefcd152b Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 16 Jan 2025 09:44:16 +0100 Subject: [PATCH 5/5] make params types public again --- Core/include/Acts/Surfaces/BoundaryTolerance.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp index 259c4ba62cf..b0fabd8ec64 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -53,7 +53,7 @@ namespace Acts { /// coordinates. /// class BoundaryTolerance { - private: + public: struct InfiniteParams {}; struct NoneParams {}; @@ -107,6 +107,7 @@ class BoundaryTolerance { : maxChi2(maxChi2_), weight(weight_) {} }; + private: /// Underlying variant type using Variant = std::variant