From 569e122be9c5ede47a9bc02652b85ab3df062ff4 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 16:10:39 +0100 Subject: [PATCH 1/3] 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 603b8a2abe9..9c5d8f73fd7 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -58,10 +58,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 { @@ -102,24 +108,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 f03af8c85c0..10674c912dd 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -149,7 +149,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 b5077fa4ec4..bdd9ee5187c 100644 --- a/Core/src/Surfaces/BoundaryTolerance.cpp +++ b/Core/src/Surfaces/BoundaryTolerance.cpp @@ -16,10 +16,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} {} @@ -37,15 +38,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 fcfddd42adb..1d3fa39b16c 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 1a347344592..8178ee5109c 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 edc401e9b83..71368d3421c 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -49,8 +49,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( @@ -72,7 +72,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( @@ -101,7 +101,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)); @@ -140,7 +140,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( @@ -158,7 +158,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( @@ -176,7 +176,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( @@ -188,8 +188,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 14cafdd045b..cf134554837 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -125,10 +125,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 0e9f1bba029..b96591d6002 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -191,7 +191,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 9cfaf3d8b23876d021a7b9c41189a0907da0e2e2 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 16:10:46 +0100 Subject: [PATCH 2/3] 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 9c5d8f73fd7..603b8a2abe9 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -58,16 +58,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 { @@ -108,24 +102,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 10674c912dd..f03af8c85c0 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -149,7 +149,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 bdd9ee5187c..b5077fa4ec4 100644 --- a/Core/src/Surfaces/BoundaryTolerance.cpp +++ b/Core/src/Surfaces/BoundaryTolerance.cpp @@ -16,11 +16,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} {} @@ -38,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 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 1d3fa39b16c..fcfddd42adb 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 8178ee5109c..1a347344592 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 71368d3421c..edc401e9b83 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -49,8 +49,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( @@ -72,7 +72,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( @@ -101,7 +101,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)); @@ -140,7 +140,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( @@ -158,7 +158,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( @@ -176,7 +176,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( @@ -188,8 +188,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 cf134554837..14cafdd045b 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -125,9 +125,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 b96591d6002..0e9f1bba029 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -191,7 +191,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 2729d6e9dbc16aedb9dbfa93aeaa7c6de01da7fc Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 16:30:05 +0100 Subject: [PATCH 3/3] option two: additional factories --- .../MultiComponentTrackParameters.hpp | 2 +- Core/include/Acts/Geometry/GridPortalLink.hpp | 2 +- Core/include/Acts/Geometry/Layer.hpp | 2 +- .../include/Acts/Geometry/NavigationLayer.hpp | 2 +- .../Acts/Navigation/NavigationDelegate.hpp | 2 +- .../Acts/Navigation/NavigationState.hpp | 4 +- .../Navigation/NavigationStateFillers.hpp | 2 +- .../Navigation/NavigationStateUpdaters.hpp | 2 +- .../Acts/Navigation/NavigationStream.hpp | 2 +- .../Acts/Propagator/DirectNavigator.hpp | 8 ++-- .../Acts/Propagator/MultiEigenStepperLoop.hpp | 2 +- .../Acts/Propagator/MultiEigenStepperLoop.ipp | 2 +- Core/include/Acts/Propagator/Navigator.hpp | 18 ++++----- .../Acts/Propagator/StandardAborters.hpp | 2 +- .../Acts/Propagator/TryAllNavigator.hpp | 10 ++--- .../Propagator/detail/NavigationHelpers.hpp | 6 +-- .../Acts/Surfaces/BoundaryTolerance.hpp | 38 ++++++++++++++---- Core/include/Acts/Surfaces/ConeBounds.hpp | 2 +- Core/include/Acts/Surfaces/ConeSurface.hpp | 2 +- .../include/Acts/Surfaces/CylinderSurface.hpp | 2 +- Core/include/Acts/Surfaces/DiscSurface.hpp | 2 +- .../Acts/Surfaces/DiscTrapezoidBounds.hpp | 2 +- Core/include/Acts/Surfaces/LineSurface.hpp | 2 +- Core/include/Acts/Surfaces/PlaneSurface.hpp | 2 +- Core/include/Acts/Surfaces/RegularSurface.hpp | 2 +- Core/include/Acts/Surfaces/Surface.hpp | 6 +-- .../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 | 12 +++--- 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/AtlasStepperTests.cpp | 6 +-- .../Core/Propagator/EigenStepperTests.cpp | 6 +-- .../Core/Propagator/MultiStepperTests.cpp | 10 ++--- .../Core/Propagator/PropagatorTests.cpp | 2 +- .../Propagator/StraightLineStepperTests.cpp | 6 +-- .../Core/Propagator/SympyStepperTests.cpp | 6 +-- .../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 +- 87 files changed, 252 insertions(+), 228 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 8bf1d06ee08..7874708a8c6 100644 --- a/Core/include/Acts/Geometry/GridPortalLink.hpp +++ b/Core/include/Acts/Geometry/GridPortalLink.hpp @@ -526,7 +526,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/Layer.hpp b/Core/include/Acts/Geometry/Layer.hpp index 15b1b98c621..83af9ec2213 100644 --- a/Core/include/Acts/Geometry/Layer.hpp +++ b/Core/include/Acts/Geometry/Layer.hpp @@ -132,7 +132,7 @@ class Layer : public virtual GeometryObject { /// @return boolean that indicates success of the operation virtual bool isOnLayer(const GeometryContext& gctx, const Vector3& position, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::None()) const; + BoundaryTolerance::none()) const; /// Return method for the approach descriptor, can be nullptr const ApproachDescriptor* approachDescriptor() const; diff --git a/Core/include/Acts/Geometry/NavigationLayer.hpp b/Core/include/Acts/Geometry/NavigationLayer.hpp index 6c80477d98a..b44972932c0 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/NavigationDelegate.hpp b/Core/include/Acts/Navigation/NavigationDelegate.hpp index 8e243818d30..a1853e0aaac 100644 --- a/Core/include/Acts/Navigation/NavigationDelegate.hpp +++ b/Core/include/Acts/Navigation/NavigationDelegate.hpp @@ -24,7 +24,7 @@ struct NavigationArguments { Vector3 position; Vector3 direction; - BoundaryTolerance tolerance = BoundaryTolerance::None(); + BoundaryTolerance tolerance = BoundaryTolerance::none(); }; /// Central alias for the navigation delegate. This type is owning to support diff --git a/Core/include/Acts/Navigation/NavigationState.hpp b/Core/include/Acts/Navigation/NavigationState.hpp index 0e0d8e5af9c..74cf55c78fd 100644 --- a/Core/include/Acts/Navigation/NavigationState.hpp +++ b/Core/include/Acts/Navigation/NavigationState.hpp @@ -46,7 +46,7 @@ struct NavigationState { const Portal* portal = nullptr; /// The boundary check used for the candidate, boundary checks /// can differ for sensitive surfaces and portals - BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); }; /// Surface candidate vector alias, this allows to use e.g. boost_small vector @@ -85,7 +85,7 @@ struct NavigationState { std::size_t surfaceCandidateIndex = 0; /// Boundary directives for surfaces - BoundaryTolerance surfaceBoundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance surfaceBoundaryTolerance = BoundaryTolerance::none(); /// An overstep tolerance double overstepTolerance = -100 * UnitConstants::um; 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 83b7bfd5016..9c739ec1b39 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/Navigation/NavigationStream.hpp b/Core/include/Acts/Navigation/NavigationStream.hpp index 067831b181e..a23a7e14f5c 100644 --- a/Core/include/Acts/Navigation/NavigationStream.hpp +++ b/Core/include/Acts/Navigation/NavigationStream.hpp @@ -59,7 +59,7 @@ class NavigationStream { const Acts::Experimental::Portal* gen2Portal = nullptr; const Portal* portal = nullptr; /// The boundary tolerance - BoundaryTolerance bTolerance = BoundaryTolerance::None(); + BoundaryTolerance bTolerance = BoundaryTolerance::none(); /// Convenience access to surface const Surface& surface() const { return *intersection.object(); } /// Cinvencience access to the path length diff --git a/Core/include/Acts/Propagator/DirectNavigator.hpp b/Core/include/Acts/Propagator/DirectNavigator.hpp index d2f66468168..58cf8ed0eae 100644 --- a/Core/include/Acts/Propagator/DirectNavigator.hpp +++ b/Core/include/Acts/Propagator/DirectNavigator.hpp @@ -250,12 +250,12 @@ class DirectNavigator { chooseIntersection( state.geoContext, surface, stepper.position(state.stepping), state.options.direction * stepper.direction(state.stepping), - BoundaryTolerance::Infinite(), state.navigation.options.nearLimit, + BoundaryTolerance::infinite(), state.navigation.options.nearLimit, farLimit, state.options.surfaceTolerance) .index(); auto surfaceStatus = stepper.updateSurfaceStatus( state.stepping, surface, index, state.options.direction, - BoundaryTolerance::Infinite(), state.options.surfaceTolerance, + BoundaryTolerance::infinite(), state.options.surfaceTolerance, *m_logger); if (surfaceStatus == IntersectionStatus::unreachable) { ACTS_VERBOSE( @@ -304,12 +304,12 @@ class DirectNavigator { chooseIntersection( state.geoContext, surface, stepper.position(state.stepping), state.options.direction * stepper.direction(state.stepping), - BoundaryTolerance::Infinite(), state.navigation.options.nearLimit, + BoundaryTolerance::infinite(), state.navigation.options.nearLimit, farLimit, state.options.surfaceTolerance) .index(); auto surfaceStatus = stepper.updateSurfaceStatus( state.stepping, surface, index, state.options.direction, - BoundaryTolerance::Infinite(), state.options.surfaceTolerance, + BoundaryTolerance::infinite(), state.options.surfaceTolerance, *m_logger); if (surfaceStatus == IntersectionStatus::onSurface) { // Set the current surface diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index a5236e571e3..c66c6cdbcd7 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -601,7 +601,7 @@ class MultiEigenStepperLoop : public EigenStepper { auto intersection = surface.intersect( component.state.geoContext, SingleStepper::position(component.state), direction * SingleStepper::direction(component.state), - BoundaryTolerance::None())[oIntersection.index()]; + BoundaryTolerance::none())[oIntersection.index()]; SingleStepper::updateStepSize(component.state, intersection, direction, release); diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp index 3eac67c27b3..36da38d5872 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp @@ -37,7 +37,7 @@ auto MultiEigenStepperLoop::boundState( .intersect(state.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/Navigator.hpp b/Core/include/Acts/Propagator/Navigator.hpp index 504912b507f..3f0a7eba1a2 100644 --- a/Core/include/Acts/Propagator/Navigator.hpp +++ b/Core/include/Acts/Propagator/Navigator.hpp @@ -35,7 +35,7 @@ namespace Acts { template struct NavigationOptions { /// The boundary check directive - BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); // How to resolve the geometry /// Always look for sensitive @@ -367,7 +367,7 @@ class Navigator { assert(state.navigation.currentSurface->isOnSurface( state.geoContext, stepper.position(state.stepping), stepper.direction(state.stepping), - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), state.options.surfaceTolerance) && "Stepper not on surface"); } @@ -596,7 +596,7 @@ class Navigator { assert(state.navigation.currentSurface->isOnSurface( state.geoContext, stepper.position(state.stepping), stepper.direction(state.stepping), - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), state.options.surfaceTolerance) && "Stepper not on surface"); } @@ -648,7 +648,7 @@ class Navigator { // it the current one to pass it to the other actors auto surfaceStatus = stepper.updateSurfaceStatus( state.stepping, *surface, intersection.index(), state.options.direction, - BoundaryTolerance::None(), state.options.surfaceTolerance, logger()); + BoundaryTolerance::none(), state.options.surfaceTolerance, logger()); if (surfaceStatus == IntersectionStatus::onSurface) { ACTS_VERBOSE(volInfo(state) << "Status Surface successfully hit, storing it."); @@ -713,11 +713,11 @@ class Navigator { ACTS_VERBOSE(volInfo(state) << "Next surface candidate will be " << surface->geometryId()); // Estimate the surface status - BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); for (auto it = externalSurfaceRange.first; it != externalSurfaceRange.second; it++) { if (surface->geometryId() == it->second) { - boundaryTolerance = BoundaryTolerance::Infinite(); + boundaryTolerance = BoundaryTolerance::infinite(); break; } } @@ -813,7 +813,7 @@ class Navigator { // Try to step towards it auto layerStatus = stepper.updateSurfaceStatus( state.stepping, *layerSurface, intersection.index(), - state.options.direction, BoundaryTolerance::None(), + state.options.direction, BoundaryTolerance::none(), state.options.surfaceTolerance, logger()); if (layerStatus == IntersectionStatus::reachable) { ACTS_VERBOSE(volInfo(state) << "Layer reachable, step size updated to " @@ -935,7 +935,7 @@ class Navigator { // Step towards the boundary surfrace auto boundaryStatus = stepper.updateSurfaceStatus( state.stepping, *boundarySurface, intersection.index(), - state.options.direction, BoundaryTolerance::None(), + state.options.direction, BoundaryTolerance::none(), state.options.surfaceTolerance, logger()); if (boundaryStatus == IntersectionStatus::reachable) { ACTS_VERBOSE(volInfo(state) @@ -1157,7 +1157,7 @@ class Navigator { // TODO we do not know the intersection index - passing 0 auto targetStatus = stepper.updateSurfaceStatus( state.stepping, *state.navigation.targetSurface, 0, - state.options.direction, BoundaryTolerance::None(), + state.options.direction, BoundaryTolerance::none(), state.options.surfaceTolerance, logger()); // the only advance could have been to the target if (targetStatus == IntersectionStatus::onSurface) { diff --git a/Core/include/Acts/Propagator/StandardAborters.hpp b/Core/include/Acts/Propagator/StandardAborters.hpp index 271ebd85239..d9f42fa16dc 100644 --- a/Core/include/Acts/Propagator/StandardAborters.hpp +++ b/Core/include/Acts/Propagator/StandardAborters.hpp @@ -68,7 +68,7 @@ struct PathLimitReached { /// propagation abort struct SurfaceReached { const Surface* surface = nullptr; - BoundaryTolerance boundaryTolerance = BoundaryTolerance::None(); + BoundaryTolerance boundaryTolerance = BoundaryTolerance::none(); // TODO https://github.com/acts-project/acts/issues/2738 /// Distance limit to discard intersections "behind us" diff --git a/Core/include/Acts/Propagator/TryAllNavigator.hpp b/Core/include/Acts/Propagator/TryAllNavigator.hpp index 7470fa0da0c..228c3bde35a 100644 --- a/Core/include/Acts/Propagator/TryAllNavigator.hpp +++ b/Core/include/Acts/Propagator/TryAllNavigator.hpp @@ -47,7 +47,7 @@ class TryAllNavigatorBase { /// Which boundary checks to perform for surface approach BoundaryTolerance boundaryToleranceSurfaceApproach = - BoundaryTolerance::None(); + BoundaryTolerance::none(); }; struct Options : public NavigatorPlainOptions { @@ -436,7 +436,7 @@ class TryAllNavigator : public TryAllNavigatorBase { IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus( state.stepping, surface, intersection.index(), - state.options.direction, BoundaryTolerance::Infinite(), + state.options.direction, BoundaryTolerance::infinite(), state.options.surfaceTolerance, logger()); if (surfaceStatus != IntersectionStatus::onSurface) { @@ -465,7 +465,7 @@ class TryAllNavigator : public TryAllNavigatorBase { IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus( state.stepping, surface, intersection.index(), - state.options.direction, BoundaryTolerance::None(), + state.options.direction, BoundaryTolerance::none(), state.options.surfaceTolerance, logger()); if (surfaceStatus != IntersectionStatus::onSurface) { @@ -790,7 +790,7 @@ class TryAllOverstepNavigator : public TryAllNavigatorBase { IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus( state.stepping, surface, intersection.index(), - state.options.direction, BoundaryTolerance::Infinite(), + state.options.direction, BoundaryTolerance::infinite(), state.options.surfaceTolerance, logger()); if (surfaceStatus != IntersectionStatus::onSurface) { @@ -817,7 +817,7 @@ class TryAllOverstepNavigator : public TryAllNavigatorBase { IntersectionStatus surfaceStatus = stepper.updateSurfaceStatus( state.stepping, surface, intersection.index(), - state.options.direction, BoundaryTolerance::None(), + state.options.direction, BoundaryTolerance::none(), state.options.surfaceTolerance, logger()); if (surfaceStatus != IntersectionStatus::onSurface) { diff --git a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp index 8965dacae45..896bd9c7b83 100644 --- a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp +++ b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp @@ -114,7 +114,7 @@ inline void emplaceAllVolumeCandidates( for (const auto& boundary : boundaries) { addCandidate(boundary.get(), &boundary->surfaceRepresentation(), - BoundaryTolerance::None()); + BoundaryTolerance::none()); } } @@ -134,7 +134,7 @@ inline void emplaceAllVolumeCandidates( if (!resolveSensitive || layer->surfaceRepresentation().surfaceMaterial() != nullptr) { addCandidate(layer.get(), &layer->surfaceRepresentation(), - BoundaryTolerance::None()); + BoundaryTolerance::none()); } if (layer->approachDescriptor() != nullptr) { @@ -142,7 +142,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 603b8a2abe9..ae733edf6b1 100644 --- a/Core/include/Acts/Surfaces/BoundaryTolerance.hpp +++ b/Core/include/Acts/Surfaces/BoundaryTolerance.hpp @@ -60,9 +60,13 @@ class BoundaryTolerance { /// Infinite tolerance i.e. no boundary check struct Infinite {}; + static auto infinite() { return BoundaryTolerance{Infinite{}}; } + /// No tolerance i.e. exact boundary check struct None {}; + static auto none() { return BoundaryTolerance{None{}}; } + /// Absolute tolerance in bound coordinates struct AbsoluteBound { double tolerance0{}; @@ -73,6 +77,11 @@ class BoundaryTolerance { : tolerance0(tolerance0_), tolerance1(tolerance1_) {} }; + template + static auto absoluteBound(Ts&&... args) { + return BoundaryTolerance{AbsoluteBound{std::forward(args)...}}; + } + /// Absolute tolerance in Cartesian coordinates struct AbsoluteCartesian { double tolerance0{}; @@ -83,6 +92,11 @@ class BoundaryTolerance { : tolerance0(tolerance0_), tolerance1(tolerance1_) {} }; + template + static auto absoluteCartesian(Ts&&... args) { + return BoundaryTolerance{AbsoluteCartesian{std::forward(args)...}}; + } + /// Absolute tolerance in Euclidean distance struct AbsoluteEuclidean { double tolerance{}; @@ -91,6 +105,11 @@ class BoundaryTolerance { explicit AbsoluteEuclidean(double tolerance_) : tolerance(tolerance_) {} }; + template + static auto absoluteEuclidean(Ts&&... args) { + return BoundaryTolerance{AbsoluteEuclidean{std::forward(args)...}}; + } + /// Chi2 tolerance in bound coordinates struct Chi2Bound { double maxChi2{}; @@ -101,25 +120,30 @@ class BoundaryTolerance { : maxChi2(maxChi2_), weight(weight_) {} }; + template + static auto chi2Bound(Ts&&... args) { + return BoundaryTolerance{Chi2Bound{std::forward(args)...}}; + } + /// Underlying variant type using Variant = std::variant; /// Construct with infinite tolerance. - BoundaryTolerance(const Infinite& infinite); + explicit BoundaryTolerance(const Infinite& infinite); /// Construct with no tolerance. - BoundaryTolerance(const None& none); + explicit BoundaryTolerance(const None& 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/include/Acts/Surfaces/ConeBounds.hpp b/Core/include/Acts/Surfaces/ConeBounds.hpp index d0d684016a8..c360b24c37f 100644 --- a/Core/include/Acts/Surfaces/ConeBounds.hpp +++ b/Core/include/Acts/Surfaces/ConeBounds.hpp @@ -93,7 +93,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 2f88bfe9532..3112009591e 100644 --- a/Core/include/Acts/Surfaces/ConeSurface.hpp +++ b/Core/include/Acts/Surfaces/ConeSurface.hpp @@ -186,7 +186,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/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index 971ff7039f7..d55b811edc5 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -197,7 +197,7 @@ class CylinderSurface : public RegularSurface { const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), double tolerance = s_onSurfaceTolerance) const final; /// Path correction due to incident of the track diff --git a/Core/include/Acts/Surfaces/DiscSurface.hpp b/Core/include/Acts/Surfaces/DiscSurface.hpp index 6a3144a00aa..636a73c9607 100644 --- a/Core/include/Acts/Surfaces/DiscSurface.hpp +++ b/Core/include/Acts/Surfaces/DiscSurface.hpp @@ -293,7 +293,7 @@ class DiscSurface : public RegularSurface { const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), double tolerance = s_onSurfaceTolerance) const final; /// Implement the binningValue diff --git a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp index 32c63c2aef6..dd05cc4536a 100644 --- a/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp +++ b/Core/include/Acts/Surfaces/DiscTrapezoidBounds.hpp @@ -81,7 +81,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/Surfaces/LineSurface.hpp b/Core/include/Acts/Surfaces/LineSurface.hpp index 15af6aa6be8..7870b684cf2 100644 --- a/Core/include/Acts/Surfaces/LineSurface.hpp +++ b/Core/include/Acts/Surfaces/LineSurface.hpp @@ -247,7 +247,7 @@ class LineSurface : public Surface { 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/PlaneSurface.hpp b/Core/include/Acts/Surfaces/PlaneSurface.hpp index e4fda361828..eed62b2b918 100644 --- a/Core/include/Acts/Surfaces/PlaneSurface.hpp +++ b/Core/include/Acts/Surfaces/PlaneSurface.hpp @@ -192,7 +192,7 @@ class PlaneSurface : public RegularSurface { const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), double tolerance = s_onSurfaceTolerance) const final; /// Return a Polyhedron for the surfaces diff --git a/Core/include/Acts/Surfaces/RegularSurface.hpp b/Core/include/Acts/Surfaces/RegularSurface.hpp index f091c73b99a..2ba3f043b09 100644 --- a/Core/include/Acts/Surfaces/RegularSurface.hpp +++ b/Core/include/Acts/Surfaces/RegularSurface.hpp @@ -111,7 +111,7 @@ class RegularSurface : public Surface { /// @return boolean indication if operation was successful bool isOnSurface( const GeometryContext& gctx, const Vector3& position, - const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::None(), + const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::none(), double tolerance = s_onSurfaceTolerance) const; using Surface::isOnSurface; diff --git a/Core/include/Acts/Surfaces/Surface.hpp b/Core/include/Acts/Surfaces/Surface.hpp index 43d8161aa8c..7a9928a0b1a 100644 --- a/Core/include/Acts/Surfaces/Surface.hpp +++ b/Core/include/Acts/Surfaces/Surface.hpp @@ -254,7 +254,7 @@ class Surface : public virtual GeometryObject, bool isOnSurface( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, - const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::None(), + const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::none(), double tolerance = s_onSurfaceTolerance) const; /// The insideBounds method for local positions @@ -264,7 +264,7 @@ class Surface : public virtual GeometryObject, /// @return boolean indication if operation was successful virtual bool insideBounds(const Vector2& lposition, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::None()) const; + BoundaryTolerance::none()) const; /// Local to global transformation /// Generalized local to global transformation for the surface types. Since @@ -398,7 +398,7 @@ class Surface : public virtual GeometryObject, const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = - BoundaryTolerance::Infinite(), + BoundaryTolerance::infinite(), double tolerance = s_onSurfaceTolerance) const = 0; /// Helper method for printing: the returned object captures the diff --git a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp index 4efcd82e4c4..0439e45ff30 100644 --- a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp +++ b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp @@ -214,7 +214,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 12b70c8a562..7b7038ef92b 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -968,7 +968,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 dc3765be7f6..db57c765455 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 108db95c192..9d8732d8458 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 f03af8c85c0..3ba88ee36d1 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -149,7 +149,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 6976388dbc0..cc0853fc11e 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 5dddd1527bf..350d3a9732b 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -328,7 +328,7 @@ Acts::SurfaceMultiIntersection Acts::ConeSurface::intersect( Acts::AlignmentToPathMatrix Acts::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 23bb74e49f8..a3c17383b2e 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -297,7 +297,7 @@ Acts::SurfaceMultiIntersection Acts::CylinderSurface::intersect( Acts::AlignmentToPathMatrix Acts::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 ac3c188fd7d..3b5e9c6f15c 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -209,7 +209,7 @@ Acts::Vector2 Acts::DiscSurface::localCartesianToPolar( Acts::BoundToFreeMatrix Acts::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 = @@ -245,7 +245,7 @@ Acts::FreeToBoundMatrix Acts::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 166a36bf630..814d4786a12 100644 --- a/Core/src/Surfaces/LineSurface.cpp +++ b/Core/src/Surfaces/LineSurface.cpp @@ -195,7 +195,7 @@ Acts::SurfaceMultiIntersection Acts::LineSurface::intersect( Acts::BoundToFreeMatrix Acts::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); @@ -232,7 +232,7 @@ Acts::BoundToFreeMatrix Acts::LineSurface::boundToFreeJacobian( Acts::FreeToPathMatrix Acts::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); @@ -261,7 +261,7 @@ Acts::FreeToPathMatrix Acts::LineSurface::freeToPathDerivative( Acts::AlignmentToPathMatrix Acts::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 0fbfe6bc982..e299d6963e6 100644 --- a/Core/src/Surfaces/Surface.cpp +++ b/Core/src/Surfaces/Surface.cpp @@ -62,7 +62,7 @@ bool Acts::Surface::isOnSurface(const GeometryContext& gctx, Acts::AlignmentToBoundMatrix Acts::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 @@ -86,7 +86,7 @@ Acts::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(); @@ -126,7 +126,7 @@ Acts::Surface::alignmentToBoundDerivativeWithoutCorrection( Acts::AlignmentToPathMatrix Acts::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(); @@ -264,7 +264,7 @@ Acts::RotationMatrix3 Acts::Surface::referenceFrame( Acts::BoundToFreeMatrix Acts::Surface::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 const auto rframe = referenceFrame(gctx, position, direction); @@ -285,7 +285,7 @@ Acts::BoundToFreeMatrix Acts::Surface::boundToFreeJacobian( Acts::FreeToBoundMatrix Acts::Surface::freeToBoundJacobian( 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 = @@ -307,7 +307,7 @@ Acts::FreeToBoundMatrix Acts::Surface::freeToBoundJacobian( Acts::FreeToPathMatrix Acts::Surface::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 measurement frame of the surface const RotationMatrix3 rframe = referenceFrame(gctx, position, direction); diff --git a/Core/src/Vertexing/HelicalTrackLinearizer.cpp b/Core/src/Vertexing/HelicalTrackLinearizer.cpp index e42bc9d0aad..71f07c24288 100644 --- a/Core/src/Vertexing/HelicalTrackLinearizer.cpp +++ b/Core/src/Vertexing/HelicalTrackLinearizer.cpp @@ -33,7 +33,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 6304af1cb8d..43c411c47b0 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 fcfddd42adb..ccd5a7c7f12 100644 --- a/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp +++ b/Tests/Benchmarks/AnnulusBoundsBenchmark.cpp @@ -55,11 +55,11 @@ int main(int /*argc*/, char** /*argv[]*/) { ActsMatrix<2, 2> 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 ea74491a1c0..7f3b4f85e3c 100644 --- a/Tests/IntegrationTests/NavigatorConsistency.cpp +++ b/Tests/IntegrationTests/NavigatorConsistency.cpp @@ -331,7 +331,7 @@ StraightLinePropagator slpropagator(slstepper, Reference1EigenPropagator refepropagator1( estepper, TryAllNavigator({tGeometry, true, true, false, - BoundaryTolerance::Infinite()}, + BoundaryTolerance::infinite()}, getDefaultLogger("ref1_e_nav", Logging::INFO)), getDefaultLogger("ref1_e_prop", Logging::INFO)); Reference1StraightLinePropagator refslpropagator1( @@ -343,7 +343,7 @@ Reference1StraightLinePropagator refslpropagator1( 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 32406c3a288..71468b30f05 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/AtlasStepperTests.cpp b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp index 0a707c7f299..7f0bf850dcb 100644 --- a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp @@ -583,7 +583,7 @@ BOOST_AUTO_TEST_CASE(StepSizeSurface) { .planeSurface(); stepper.updateSurfaceStatus(state, *target, 0, navDir, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); BOOST_CHECK_EQUAL(state.stepSize.value(ConstrainedStep::actor), distance); // test the step size modification in the context of a surface @@ -592,7 +592,7 @@ BOOST_AUTO_TEST_CASE(StepSizeSurface) { target ->intersect(state.geoContext, stepper.position(state), navDir * stepper.direction(state), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, false); BOOST_CHECK_EQUAL(state.stepSize.value(), distance); @@ -604,7 +604,7 @@ BOOST_AUTO_TEST_CASE(StepSizeSurface) { target ->intersect(state.geoContext, stepper.position(state), navDir * stepper.direction(state), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, true); BOOST_CHECK_EQUAL(state.stepSize.value(), navDir * stepSize); diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index d784c0b26bb..b87c14b16f2 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -458,7 +458,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { auto targetSurface = CurvilinearSurface(pos + navDir * 2. * dir, dir).planeSurface(); es.updateSurfaceStatus(esState, *targetSurface, 0, navDir, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); CHECK_CLOSE_ABS(esState.stepSize.value(ConstrainedStep::actor), navDir * 2., eps); @@ -467,7 +467,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { targetSurface ->intersect(esState.geoContext, es.position(esState), navDir * es.direction(esState), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, false); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); @@ -476,7 +476,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { targetSurface ->intersect(esState.geoContext, es.position(esState), navDir * es.direction(esState), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, true); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); diff --git a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp index a851d7592d9..c83ca392680 100644 --- a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp @@ -481,7 +481,7 @@ void test_multi_stepper_surface_status_update() { { auto status = multi_stepper.updateSurfaceStatus( multi_state, *right_surface, 0, Direction::Forward, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); BOOST_CHECK_EQUAL(status, IntersectionStatus::reachable); @@ -510,7 +510,7 @@ void test_multi_stepper_surface_status_update() { { auto status = multi_stepper.updateSurfaceStatus( multi_state, *right_surface, 0, Direction::Forward, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); BOOST_CHECK_EQUAL(status, IntersectionStatus::onSurface); @@ -526,7 +526,7 @@ void test_multi_stepper_surface_status_update() { { auto status = multi_stepper.updateSurfaceStatus( multi_state, *start_surface, 0, Direction::Forward, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); BOOST_CHECK_EQUAL(status, IntersectionStatus::reachable); @@ -593,14 +593,14 @@ void test_component_bound_state() { { multi_stepper.updateSurfaceStatus(multi_state, *right_surface, 0, Direction::Forward, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); auto multi_prop_state = DummyPropState(Direction::Forward, multi_state); multi_stepper.step(multi_prop_state, mockNavigator); // Single stepper single_stepper.updateSurfaceStatus(single_state, *right_surface, 0, Direction::Forward, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); auto single_prop_state = DummyPropState(Direction::Forward, single_state); single_stepper.step(single_prop_state, mockNavigator); } diff --git a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp index 3728ca7b78e..74dbd4a5f99 100644 --- a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp @@ -115,7 +115,7 @@ struct SurfaceObserver { surface ->intersect(state.geoContext, stepper.position(state.stepping), stepper.direction(state.stepping), - BoundaryTolerance::None()) + BoundaryTolerance::none()) .closest() .pathLength(); // Adjust the step size so that we cannot cross the target surface diff --git a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp index fb8d348c38a..125a619b35f 100644 --- a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp @@ -332,7 +332,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { auto targetSurface = CurvilinearSurface(pos + navDir * 2. * dir, dir).planeSurface(); sls.updateSurfaceStatus(slsState, *targetSurface, 0, navDir, - BoundaryTolerance::Infinite()); + BoundaryTolerance::infinite()); CHECK_CLOSE_ABS(slsState.stepSize.value(ConstrainedStep::actor), navDir * 2., 1e-6); @@ -342,7 +342,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { targetSurface ->intersect(slsState.geoContext, sls.position(slsState), navDir * sls.direction(slsState), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, false); CHECK_CLOSE_ABS(slsState.stepSize.value(), 2, 1e-6); @@ -352,7 +352,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { targetSurface ->intersect(slsState.geoContext, sls.position(slsState), navDir * sls.direction(slsState), - BoundaryTolerance::Infinite()) + BoundaryTolerance::infinite()) .closest(), navDir, true); CHECK_CLOSE_ABS(slsState.stepSize.value(), 2, 1e-6); diff --git a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp index 7ed2255afdc..4c63694e5ff 100644 --- a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp @@ -430,7 +430,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { auto targetSurface = CurvilinearSurface(pos + navDir * 2. * dir, dir).planeSurface(); es.updateSurfaceStatus(esState, *targetSurface, 0, navDir, - BoundaryTolerance::None()); + BoundaryTolerance::none()); CHECK_CLOSE_ABS(esState.stepSize.value(ConstrainedStep::actor), navDir * 2., eps); @@ -439,7 +439,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { esState, targetSurface ->intersect(esState.geoContext, es.position(esState), - navDir * es.direction(esState), BoundaryTolerance::None()) + navDir * es.direction(esState), BoundaryTolerance::none()) .closest(), navDir, false); CHECK_CLOSE_ABS(esState.stepSize.value(), 2., eps); @@ -448,7 +448,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { esState, targetSurface ->intersect(esState.geoContext, es.position(esState), - navDir * es.direction(esState), BoundaryTolerance::None()) + navDir * es.direction(esState), BoundaryTolerance::none()) .closest(), navDir, true); 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 1a347344592..385415be1a0 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 f2a060167c7..16542726e56 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 edc401e9b83..17a679d0bbc 100644 --- a/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/BoundaryToleranceTests.cpp @@ -30,7 +30,7 @@ BOOST_AUTO_TEST_SUITE(Surfaces) 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( @@ -49,7 +49,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)); @@ -72,7 +72,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( @@ -88,7 +88,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( @@ -101,7 +101,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)); @@ -116,7 +116,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( @@ -128,7 +128,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( @@ -140,7 +140,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( @@ -158,7 +158,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( @@ -176,7 +176,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( @@ -189,7 +189,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 5d0102653b2..14b3a3e732a 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 6b6712c230b..0e1706599f6 100644 --- a/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/ConvexPolygonBoundsTests.cpp @@ -70,7 +70,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)); @@ -120,7 +120,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 14cafdd045b..671f9389752 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderBoundsTests.cpp @@ -126,9 +126,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 9ef504bd0df..22e64c1d627 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp @@ -186,18 +186,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 2e1fd4473f9..b106cbc13b8 100644 --- a/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/DiscSurfaceTests.cpp @@ -127,13 +127,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}; @@ -214,7 +214,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 15d930929af..d180e93c24b 100644 --- a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp @@ -127,7 +127,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.); @@ -140,10 +140,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 de2a87483e0..d836060fa1c 100644 --- a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp @@ -157,19 +157,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}; @@ -300,16 +300,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 a25eeb4d352..faa67d04238 100644 --- a/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/RadialBoundsTests.cpp @@ -104,8 +104,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 14b432d2945..7dc65a099f0 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp @@ -66,7 +66,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()); @@ -81,7 +81,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()); @@ -97,7 +97,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()); @@ -113,14 +113,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()); @@ -137,7 +137,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 @@ -180,9 +180,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()); @@ -197,7 +197,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()); @@ -238,7 +238,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()); @@ -251,7 +251,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 @@ -264,7 +264,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 @@ -276,7 +276,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 @@ -289,7 +289,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 @@ -334,7 +334,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 @@ -346,7 +346,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 @@ -359,7 +359,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 @@ -372,7 +372,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 @@ -384,7 +384,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 @@ -397,7 +397,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 0e9f1bba029..9a099cd5373 100644 --- a/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/TrapezoidBoundsTests.cpp @@ -125,12 +125,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 @@ -188,10 +188,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 d26ba186e84..1bfaae0597b 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());