From 19f11be139a46ecc3f52b45b9aa0302c7625902a Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Tue, 10 Dec 2024 15:37:10 +0100 Subject: [PATCH] refactor!: Make Direction constructor explicit This requires changing the static names values to static functions --- Core/include/Acts/Definitions/Direction.hpp | 33 +++++++------ .../CorrectedTransformationFreeToBound.hpp | 2 +- .../Acts/Geometry/BoundarySurfaceT.hpp | 4 +- .../Acts/Material/ISurfaceMaterial.hpp | 4 +- .../Acts/Propagator/DirectNavigator.hpp | 6 +-- .../Acts/Propagator/PropagatorOptions.hpp | 2 +- .../Acts/TrackFitting/detail/GsfActor.hpp | 4 +- .../detail/CuboidalDetectorHelper.cpp | 8 ++- .../detail/CylindricalDetectorHelper.cpp | 46 ++++++++--------- Core/src/Geometry/ConeVolumeBounds.cpp | 18 +++---- Core/src/Geometry/CuboidVolumeBounds.cpp | 12 ++--- .../Geometry/CutoutCylinderVolumeBounds.cpp | 16 +++--- Core/src/Geometry/CylinderVolumeBounds.cpp | 12 ++--- Core/src/Geometry/Portal.cpp | 18 +++---- Core/src/Geometry/TrackingVolume.cpp | 8 +-- Core/src/Geometry/TrapezoidVolumeBounds.cpp | 12 ++--- Core/src/Vertexing/ImpactPointEstimator.cpp | 4 +- .../Geant4/src/SensitiveSteppingAction.cpp | 2 +- .../src/SimHitToSummaryConversion.cpp | 2 +- .../ActsExamples/Traccc/DetrayPropagator.hpp | 5 +- .../src/TrackFindingAlgorithm.cpp | 4 +- Plugins/Json/src/PortalJsonConverter.cpp | 4 +- .../IntegrationTests/NavigatorConsistency.cpp | 4 +- Tests/IntegrationTests/PropagationTests.hpp | 4 +- .../Core/Definitions/DirectionTests.cpp | 8 +-- Tests/UnitTests/Core/Detector/PortalTests.cpp | 24 ++++----- .../Core/Geometry/PortalShellTests.cpp | 32 ++++++------ Tests/UnitTests/Core/Geometry/PortalTests.cpp | 49 ++++++++++--------- .../HomogeneousSurfaceMaterialTests.cpp | 4 +- .../Core/Material/ISurfaceMaterialTests.cpp | 12 ++--- .../Navigation/DetectorNavigatorTests.cpp | 12 ++--- .../Core/Propagator/AtlasStepperTests.cpp | 6 +-- .../Core/Propagator/EigenStepperTests.cpp | 6 +-- .../Core/Propagator/LoopProtectionTests.cpp | 2 +- .../Propagator/MaterialCollectionTests.cpp | 4 +- .../Core/Propagator/MultiStepperTests.cpp | 20 ++++---- .../Core/Propagator/NavigatorTests.cpp | 2 +- .../Propagator/StraightLineStepperTests.cpp | 6 +-- .../Core/Propagator/SympyStepperTests.cpp | 6 +-- .../VolumeMaterialInteractionTests.cpp | 4 +- .../Core/Surfaces/LineSurfaceTests.cpp | 4 +- .../CombinatorialKalmanFilterTests.cpp | 4 +- .../Core/TrackFitting/FitterTestsCommon.hpp | 4 +- .../Plugins/Json/PortalJsonConverterTests.cpp | 8 +-- 44 files changed, 227 insertions(+), 224 deletions(-) diff --git a/Core/include/Acts/Definitions/Direction.hpp b/Core/include/Acts/Definitions/Direction.hpp index 985caac0e6c..8e9437bc31e 100644 --- a/Core/include/Acts/Definitions/Direction.hpp +++ b/Core/include/Acts/Definitions/Direction.hpp @@ -27,14 +27,18 @@ class Direction final { }; public: - static constexpr auto Negative = Value::Negative; - static constexpr auto Positive = Value::Positive; + static constexpr Direction Negative() { return Direction{Value::Negative}; } + static constexpr Direction Positive() { return Direction{Value::Positive}; } - static constexpr auto Backward = Value::Negative; - static constexpr auto Forward = Value::Positive; + static constexpr Direction Backward() { return Direction{Value::Negative}; } + static constexpr Direction Forward() { return Direction{Value::Positive}; } - static constexpr auto OppositeNormal = Value::Negative; - static constexpr auto AlongNormal = Value::Positive; + static constexpr Direction OppositeNormal() { + return Direction{Value::Negative}; + } + static constexpr Direction AlongNormal() { + return Direction{Value::Positive}; + } /// This turns a signed value into a direction. Will assert on zero. /// @@ -43,7 +47,7 @@ class Direction final { /// @return a direction enum static constexpr Direction fromScalar(double scalar) { assert(scalar != 0); - return scalar >= 0 ? Value::Positive : Value::Negative; + return Direction{scalar >= 0 ? Value::Positive : Value::Negative}; } /// This turns a signed value into a direction and 0 will be handled as a @@ -54,7 +58,7 @@ class Direction final { /// /// @return a direction enum static constexpr Direction fromScalarZeroAsPositive(double scalar) { - return scalar >= 0 ? Value::Positive : Value::Negative; + return Direction{scalar >= 0 ? Value::Positive : Value::Negative}; } /// Convert and index [0,1] to a direction e.g. for sorting in @@ -63,9 +67,9 @@ class Direction final { /// @param index is the direction at input static constexpr Direction fromIndex(std::size_t index) { if (index == 0u) { - return Value::Negative; + return Direction{Value::Negative}; } - return Value::Positive; + return Direction{Value::Positive}; } /// Convert dir to index [0,1] which allows to store direction dependent @@ -88,16 +92,17 @@ class Direction final { /// /// @return an opposite direction constexpr Direction invert() const { - return (m_value == Value::Positive) ? Value::Negative : Value::Positive; + return Direction{m_value == Value::Positive ? Value::Negative + : Value::Positive}; } std::string toString() const; constexpr Direction() = default; - constexpr Direction(Value value) : m_value(value) {} + explicit constexpr Direction(Value value) : m_value(value) {} - constexpr bool operator==(Direction other) const { - return m_value == other.m_value; + friend constexpr bool operator==(Direction lhs, Direction rhs) { + return lhs.m_value == rhs.m_value; } private: diff --git a/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp b/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp index 72cb0965507..42b480482ec 100644 --- a/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp +++ b/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp @@ -96,7 +96,7 @@ struct CorrectedFreeToBoundTransformer { std::optional> operator()( const FreeVector& freeParams, const FreeSquareMatrix& freeCovariance, const Surface& surface, const GeometryContext& geoContext, - Direction navDir = Direction::Forward, + Direction navDir = Direction::Forward(), const Logger& logger = getDummyLogger()) const; private: diff --git a/Core/include/Acts/Geometry/BoundarySurfaceT.hpp b/Core/include/Acts/Geometry/BoundarySurfaceT.hpp index 60fd4be9dc4..eafc84e5fa6 100644 --- a/Core/include/Acts/Geometry/BoundarySurfaceT.hpp +++ b/Core/include/Acts/Geometry/BoundarySurfaceT.hpp @@ -161,7 +161,7 @@ inline const RegularSurface& BoundarySurfaceT::surfaceRepresentation() template void BoundarySurfaceT::attachVolume(const volume_t* volume, Direction dir) { - if (dir == Direction::Backward) { + if (dir == Direction::Backward()) { m_oppositeVolume = volume; } else { m_alongVolume = volume; @@ -171,7 +171,7 @@ void BoundarySurfaceT::attachVolume(const volume_t* volume, template void BoundarySurfaceT::attachVolumeArray( const std::shared_ptr volumes, Direction dir) { - if (dir == Direction::Backward) { + if (dir == Direction::Backward()) { m_oppositeVolumeArray = volumes; } else { m_alongVolumeArray = volumes; diff --git a/Core/include/Acts/Material/ISurfaceMaterial.hpp b/Core/include/Acts/Material/ISurfaceMaterial.hpp index cad6832441a..734930cca40 100644 --- a/Core/include/Acts/Material/ISurfaceMaterial.hpp +++ b/Core/include/Acts/Material/ISurfaceMaterial.hpp @@ -137,9 +137,9 @@ inline double ISurfaceMaterial::factor(Direction pDir, if (mStage == Acts::MaterialUpdateStage::FullUpdate) { return 1.; } else if (mStage == Acts::MaterialUpdateStage::PreUpdate) { - return pDir == Direction::Negative ? m_splitFactor : 1 - m_splitFactor; + return pDir == Direction::Negative() ? m_splitFactor : 1 - m_splitFactor; } else /*if (mStage == Acts::MaterialUpdateStage::PostUpdate)*/ { - return pDir == Direction::Positive ? m_splitFactor : 1 - m_splitFactor; + return pDir == Direction::Positive() ? m_splitFactor : 1 - m_splitFactor; } } diff --git a/Core/include/Acts/Propagator/DirectNavigator.hpp b/Core/include/Acts/Propagator/DirectNavigator.hpp index fd85f71af91..af9048f31c6 100644 --- a/Core/include/Acts/Propagator/DirectNavigator.hpp +++ b/Core/include/Acts/Propagator/DirectNavigator.hpp @@ -82,7 +82,7 @@ class DirectNavigator { } void nextSurface(Direction direction) { - if (direction == Direction::Forward) { + if (direction == Direction::Forward()) { ++surfaceIndex; } else { --surfaceIndex; @@ -95,7 +95,7 @@ class DirectNavigator { } int remainingSurfaces(Direction direction) const { - if (direction == Direction::Forward) { + if (direction == Direction::Forward()) { return options.surfaces.size() - surfaceIndex; } return surfaceIndex + 1; @@ -103,7 +103,7 @@ class DirectNavigator { void resetSurfaceIndex(Direction direction) { surfaceIndex = - direction == Direction::Forward ? 0 : options.surfaces.size() - 1; + direction == Direction::Forward() ? 0 : options.surfaces.size() - 1; } }; diff --git a/Core/include/Acts/Propagator/PropagatorOptions.hpp b/Core/include/Acts/Propagator/PropagatorOptions.hpp index c6d77550661..28f9c171657 100644 --- a/Core/include/Acts/Propagator/PropagatorOptions.hpp +++ b/Core/include/Acts/Propagator/PropagatorOptions.hpp @@ -25,7 +25,7 @@ namespace detail { /// @brief Holds the generic pure propagator options struct PurePropagatorPlainOptions { /// Propagation direction - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); /// Maximum number of steps for one propagate call unsigned int maxSteps = 1000; diff --git a/Core/include/Acts/TrackFitting/detail/GsfActor.hpp b/Core/include/Acts/TrackFitting/detail/GsfActor.hpp index 695198a7dfc..e7dfbfb690f 100644 --- a/Core/include/Acts/TrackFitting/detail/GsfActor.hpp +++ b/Core/include/Acts/TrackFitting/detail/GsfActor.hpp @@ -416,7 +416,7 @@ struct GsfActor { auto new_pars = old_bound.parameters(); const auto delta_p = [&]() { - if (state.options.direction == Direction::Forward) { + if (state.options.direction == Direction::Forward()) { return p_prev * (gaussian.mean - 1.); } else { return p_prev * (1. / gaussian.mean - 1.); @@ -431,7 +431,7 @@ struct GsfActor { auto new_cov = old_bound.covariance().value(); const auto varInvP = [&]() { - if (state.options.direction == Direction::Forward) { + if (state.options.direction == Direction::Forward()) { const auto f = 1. / (p_prev * gaussian.mean); return f * f * gaussian.var; } else { diff --git a/Core/src/Detector/detail/CuboidalDetectorHelper.cpp b/Core/src/Detector/detail/CuboidalDetectorHelper.cpp index aef8d2a5c02..db71fa1a7df 100644 --- a/Core/src/Detector/detail/CuboidalDetectorHelper.cpp +++ b/Core/src/Detector/detail/CuboidalDetectorHelper.cpp @@ -208,7 +208,7 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( // Assign the portal direction // in a consistent way Acts::Direction dir = - (index % 2 == 0) ? Direction::Forward : Direction::Backward; + (index % 2 == 0) ? Direction::Forward() : Direction::Backward(); // Make the stitch boundaries pReplacements.push_back(PortalReplacement( @@ -283,13 +283,11 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( std::shared_ptr sPortal = formerContainer.find(startIndex)->second; auto sAttachedVolumes = - sPortal - ->attachedDetectorVolumes()[Direction(Direction::Backward).index()]; + sPortal->attachedDetectorVolumes()[Direction::Backward().index()]; std::shared_ptr ePortal = currentContainer.find(endIndex)->second; auto eAttachedVolumes = - ePortal - ->attachedDetectorVolumes()[Direction(Direction::Forward).index()]; + ePortal->attachedDetectorVolumes()[Direction::Forward().index()]; auto fusedPortal = Portal::fuse(sPortal, ePortal); diff --git a/Core/src/Detector/detail/CylindricalDetectorHelper.cpp b/Core/src/Detector/detail/CylindricalDetectorHelper.cpp index 2d1c021bbe6..43c2978f57d 100644 --- a/Core/src/Detector/detail/CylindricalDetectorHelper.cpp +++ b/Core/src/Detector/detail/CylindricalDetectorHelper.cpp @@ -370,8 +370,8 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInR( std::vector pReplacements = {}; // Disc assignments are forward for negative disc, backward for positive - std::vector discDirs = {Acts::Direction::Forward, - Acts::Direction::Backward}; + std::vector discDirs = {Acts::Direction::Forward(), + Acts::Direction::Backward()}; for (const auto [iu, idir] : enumerate(discDirs)) { if (selectedOnly.empty() || rangeContainsValue(selectedOnly, iu)) { const Surface& refSurface = volumes[0u]->portals()[iu]->surface(); @@ -386,8 +386,8 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInR( if (sectorsPresent) { ACTS_VERBOSE("Sector planes are present, they need replacement."); // Sector assignments are forward backward - std::vector sectorDirs = {Acts::Direction::Forward, - Acts::Direction::Backward}; + std::vector sectorDirs = {Acts::Direction::Forward(), + Acts::Direction::Backward()}; Acts::Vector3 vCenter = volumes[0u]->transform(gctx).translation(); for (const auto [iu, idir] : enumerate(sectorDirs)) { // (iu + 4u) corresponds to the indices of the phi-low and phi-high sector @@ -564,12 +564,12 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( std::vector pReplacements = {}; // Disc assignments are forward for negative disc, backward for positive - std::vector cylinderDirs = {Acts::Direction::Backward}; + std::vector cylinderDirs = {Acts::Direction::Backward()}; // Cylinder radii std::vector cylinderR = {maxR}; if (innerPresent) { ACTS_VERBOSE("Inner surface present, tube geometry detected."); - cylinderDirs.push_back(Direction::Forward); + cylinderDirs.push_back(Direction::Forward()); cylinderR.push_back(minR); } else { ACTS_VERBOSE("No inner surface present, solid cylinder geometry detected."); @@ -589,8 +589,8 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( if (sectorsPresent) { ACTS_VERBOSE("Sector planes are present, they need replacement."); // Sector assignmenta are forward backward - std::vector sectorDirs = {Acts::Direction::Forward, - Acts::Direction::Backward}; + std::vector sectorDirs = {Acts::Direction::Forward(), + Acts::Direction::Backward()}; for (const auto [iu, idir] : enumerate(sectorDirs)) { // Access with 3u or 4u but always write 4u (to be caught later) if (selectedOnly.empty() || rangeContainsValue(selectedOnly, iu + 4u)) { @@ -710,21 +710,21 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInPhi( refTransform, {refValues[CylinderVolumeBounds::BoundValues::eMinR], refValues[CylinderVolumeBounds::BoundValues::eMaxR]}, - phiBoundaries, 0u, Acts::Direction::Forward)); + phiBoundaries, 0u, Acts::Direction::Forward())); // Positive disc pReplacements.push_back(createDiscReplacement( refTransform, {refValues[CylinderVolumeBounds::BoundValues::eMinR], refValues[CylinderVolumeBounds::BoundValues::eMaxR]}, - phiBoundaries, 1u, Acts::Direction::Backward)); + phiBoundaries, 1u, Acts::Direction::Backward())); // Outside cylinder pReplacements.push_back(createCylinderReplacement( refTransform, refValues[CylinderVolumeBounds::BoundValues::eMaxR], {-refValues[CylinderVolumeBounds::BoundValues::eHalfLengthZ], refValues[CylinderVolumeBounds::BoundValues::eHalfLengthZ]}, - phiBoundaries, 2u, Acts::Direction::Backward)); + phiBoundaries, 2u, Acts::Direction::Backward())); // If the volume has a different inner radius than 0, it MUST have // an inner cylinder @@ -734,7 +734,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInPhi( refTransform, refValues[CylinderVolumeBounds::BoundValues::eMinR], {-refValues[CylinderVolumeBounds::BoundValues::eHalfLengthZ], refValues[CylinderVolumeBounds::BoundValues::eHalfLengthZ]}, - phiBoundaries, 3u, Acts::Direction::Forward)); + phiBoundaries, 3u, Acts::Direction::Forward())); } // Attach the new volume multi links @@ -822,7 +822,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( std::vector pReplacements; pReplacements.push_back(createCylinderReplacement( volumes[0u]->transform(gctx), innerR, {-HlZ, -hlZ, hlZ, HlZ}, - {-std::numbers::pi, std::numbers::pi}, 3u, Direction::Forward)); + {-std::numbers::pi, std::numbers::pi}, 3u, Direction::Forward())); std::vector> zVolumes = { volumes[1u], volumes[0u], volumes[1u]}; // Attach the new volume multi links @@ -874,12 +874,10 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInR( std::shared_ptr innerCylinder = containers[ic - 1].find(2u)->second; // Direction is explicitly addressed with a direction index auto innerAttachedVolumes = - innerCylinder - ->attachedDetectorVolumes()[Direction(Direction::Backward).index()]; + innerCylinder->attachedDetectorVolumes()[Direction::Backward().index()]; std::shared_ptr outerCylinder = containers[ic].find(3u)->second; auto outerAttachedVolume = - outerCylinder - ->attachedDetectorVolumes()[Direction(Direction::Forward).index()]; + outerCylinder->attachedDetectorVolumes()[Direction::Forward().index()]; auto fusedCylinder = Portal::fuse(innerCylinder, outerCylinder); // Update the attached volumes with the new portal @@ -944,12 +942,11 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( // Container attachment positive Disc of lower, negative Disc at higher std::shared_ptr pDisc = formerContainer.find(1u)->second; auto pAttachedVolumes = - pDisc - ->attachedDetectorVolumes()[Direction(Direction::Backward).index()]; + pDisc->attachedDetectorVolumes()[Direction::Backward().index()]; std::shared_ptr nDisc = currentContainer.find(0u)->second; auto nAttachedVolumes = - nDisc->attachedDetectorVolumes()[Direction(Direction::Forward).index()]; + nDisc->attachedDetectorVolumes()[Direction::Forward().index()]; auto fusedDisc = Portal::fuse(pDisc, nDisc); @@ -1058,8 +1055,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( // Fuse outer cover of first with inner cylinder of wrapping volume auto& innerCover = innerContainer[2u]; auto innerAttachedVolumes = - innerCover - ->attachedDetectorVolumes()[Direction(Direction::Backward).index()]; + innerCover->attachedDetectorVolumes()[Direction::Backward().index()]; auto& innerTube = wrappingVolume->portalPtrs()[3u]; auto fusedCover = Portal::fuse(innerCover, innerTube); @@ -1074,8 +1070,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( auto& firstDiscN = innerContainer[0u]; auto firstNAttachedVolumes = - firstDiscN - ->attachedDetectorVolumes()[Direction(Direction::Forward).index()]; + firstDiscN->attachedDetectorVolumes()[Direction::Forward().index()]; auto& secondDiscN = wrappingVolume->portalPtrs()[4u]; auto fusedDiscN = Portal::fuse(firstDiscN, secondDiscN); @@ -1089,8 +1084,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( // Stich sides - positive auto& firstDiscP = innerContainer[1u]; auto firstPAttachedVolumes = - firstDiscP - ->attachedDetectorVolumes()[Direction(Direction::Backward).index()]; + firstDiscP->attachedDetectorVolumes()[Direction::Backward().index()]; auto& secondDiscP = wrappingVolume->portalPtrs()[5u]; auto fusedDiscP = Portal::fuse(firstDiscP, secondDiscP); diff --git a/Core/src/Geometry/ConeVolumeBounds.cpp b/Core/src/Geometry/ConeVolumeBounds.cpp index 425166abcd0..45ca5eedf95 100644 --- a/Core/src/Geometry/ConeVolumeBounds.cpp +++ b/Core/src/Geometry/ConeVolumeBounds.cpp @@ -107,13 +107,13 @@ std::vector Acts::ConeVolumeBounds::orientedSurfaces( auto innerCone = Surface::makeShared(innerConeTrans, m_innerConeBounds); oSurfaces.push_back( - OrientedSurface{std::move(innerCone), Direction::AlongNormal}); + OrientedSurface{std::move(innerCone), Direction::AlongNormal()}); } else if (m_innerCylinderBounds != nullptr) { // Or alternatively the inner Cylinder auto innerCylinder = Surface::makeShared(transform, m_innerCylinderBounds); oSurfaces.push_back( - OrientedSurface{std::move(innerCylinder), Direction::AlongNormal}); + OrientedSurface{std::move(innerCylinder), Direction::AlongNormal()}); } // Create an outer Cone @@ -122,13 +122,13 @@ std::vector Acts::ConeVolumeBounds::orientedSurfaces( auto outerCone = Surface::makeShared(outerConeTrans, m_outerConeBounds); oSurfaces.push_back( - OrientedSurface{std::move(outerCone), Direction::OppositeNormal}); + OrientedSurface{std::move(outerCone), Direction::OppositeNormal()}); } else if (m_outerCylinderBounds != nullptr) { // or alternatively an outer Cylinder auto outerCylinder = Surface::makeShared(transform, m_outerCylinderBounds); oSurfaces.push_back( - OrientedSurface{std::move(outerCylinder), Direction::OppositeNormal}); + OrientedSurface{std::move(outerCylinder), Direction::OppositeNormal()}); } // Set a disc at Zmin @@ -138,7 +138,7 @@ std::vector Acts::ConeVolumeBounds::orientedSurfaces( auto negativeDisc = Surface::makeShared(negativeDiscTrans, m_negativeDiscBounds); oSurfaces.push_back( - OrientedSurface{std::move(negativeDisc), Direction::AlongNormal}); + OrientedSurface{std::move(negativeDisc), Direction::AlongNormal()}); } // Set a disc at Zmax @@ -146,7 +146,7 @@ std::vector Acts::ConeVolumeBounds::orientedSurfaces( auto positiveDisc = Surface::makeShared(positiveDiscTrans, m_positiveDiscBounds); oSurfaces.push_back( - OrientedSurface{std::move(positiveDisc), Direction::OppositeNormal}); + OrientedSurface{std::move(positiveDisc), Direction::OppositeNormal()}); if (m_sectorBounds) { RotationMatrix3 sectorRotation; @@ -161,7 +161,7 @@ std::vector Acts::ConeVolumeBounds::orientedSurfaces( auto negSectorPlane = Surface::makeShared(negSectorAbsTrans, m_sectorBounds); oSurfaces.push_back( - OrientedSurface{std::move(negSectorPlane), Direction::AlongNormal}); + OrientedSurface{std::move(negSectorPlane), Direction::AlongNormal()}); Transform3 posSectorRelTrans{sectorRotation}; posSectorRelTrans.prerotate( @@ -170,8 +170,8 @@ std::vector Acts::ConeVolumeBounds::orientedSurfaces( auto posSectorPlane = Surface::makeShared(posSectorAbsTrans, m_sectorBounds); - oSurfaces.push_back( - OrientedSurface{std::move(posSectorPlane), Direction::OppositeNormal}); + oSurfaces.push_back(OrientedSurface{std::move(posSectorPlane), + Direction::OppositeNormal()}); } return oSurfaces; } diff --git a/Core/src/Geometry/CuboidVolumeBounds.cpp b/Core/src/Geometry/CuboidVolumeBounds.cpp index 29e7714fedf..9b01eb54ae8 100644 --- a/Core/src/Geometry/CuboidVolumeBounds.cpp +++ b/Core/src/Geometry/CuboidVolumeBounds.cpp @@ -42,36 +42,36 @@ std::vector Acts::CuboidVolumeBounds::orientedSurfaces( // (1) - at negative local z auto sf = Surface::makeShared( transform * Translation3(0., 0., -get(eHalfLengthZ)), m_xyBounds); - oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal}); + oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal()}); // (2) - at positive local z sf = Surface::makeShared( transform * Translation3(0., 0., get(eHalfLengthZ)), m_xyBounds); oSurfaces.push_back( - OrientedSurface{std::move(sf), Direction::OppositeNormal}); + OrientedSurface{std::move(sf), Direction::OppositeNormal()}); // Face surfaces yz ------------------------------------- // (3) - at negative local x sf = Surface::makeShared( transform * Translation3(-get(eHalfLengthX), 0., 0.) * s_planeYZ, m_yzBounds); - oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal}); + oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal()}); // (4) - at positive local x sf = Surface::makeShared( transform * Translation3(get(eHalfLengthX), 0., 0.) * s_planeYZ, m_yzBounds); oSurfaces.push_back( - OrientedSurface{std::move(sf), Direction::OppositeNormal}); + OrientedSurface{std::move(sf), Direction::OppositeNormal()}); // Face surfaces zx ------------------------------------- // (5) - at negative local y sf = Surface::makeShared( transform * Translation3(0., -get(eHalfLengthY), 0.) * s_planeZX, m_zxBounds); - oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal}); + oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal()}); // (6) - at positive local y sf = Surface::makeShared( transform * Translation3(0., get(eHalfLengthY), 0.) * s_planeZX, m_zxBounds); oSurfaces.push_back( - OrientedSurface{std::move(sf), Direction::OppositeNormal}); + OrientedSurface{std::move(sf), Direction::OppositeNormal()}); return oSurfaces; } diff --git a/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp b/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp index 62033200b58..8c30f13c0c4 100644 --- a/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CutoutCylinderVolumeBounds.cpp @@ -81,13 +81,13 @@ std::vector CutoutCylinderVolumeBounds::orientedSurfaces( auto outer = Surface::makeShared(transform, m_outerCylinderBounds); oSurfaces.at(tubeOuterCover) = - OrientedSurface{std::move(outer), Direction::OppositeNormal}; + OrientedSurface{std::move(outer), Direction::OppositeNormal()}; // Inner (cutout) cylinder envelope auto cutoutInner = Surface::makeShared(transform, m_cutoutCylinderBounds); oSurfaces.at(tubeInnerCover) = - OrientedSurface{std::move(cutoutInner), Direction::AlongNormal}; + OrientedSurface{std::move(cutoutInner), Direction::AlongNormal()}; // z position of the pos and neg choke points double hlChoke = (get(eHalfLengthZ) - get(eHalfLengthZcutout)) * 0.5; @@ -98,13 +98,13 @@ std::vector CutoutCylinderVolumeBounds::orientedSurfaces( auto posInner = Surface::makeShared(posChokeTrf, m_innerCylinderBounds); oSurfaces.at(index7) = - OrientedSurface{std::move(posInner), Direction::AlongNormal}; + OrientedSurface{std::move(posInner), Direction::AlongNormal()}; auto negChokeTrf = transform * Translation3(Vector3(0, 0, -zChoke)); auto negInner = Surface::makeShared(negChokeTrf, m_innerCylinderBounds); oSurfaces.at(index6) = - OrientedSurface{std::move(negInner), Direction::AlongNormal}; + OrientedSurface{std::move(negInner), Direction::AlongNormal()}; } // Two Outer disks @@ -113,14 +113,14 @@ std::vector CutoutCylinderVolumeBounds::orientedSurfaces( auto posOutDisc = Surface::makeShared(posOutDiscTrf, m_outerDiscBounds); oSurfaces.at(positiveFaceXY) = - OrientedSurface{std::move(posOutDisc), Direction::OppositeNormal}; + OrientedSurface{std::move(posOutDisc), Direction::OppositeNormal()}; auto negOutDiscTrf = transform * Translation3(Vector3(0, 0, -get(eHalfLengthZ))); auto negOutDisc = Surface::makeShared(negOutDiscTrf, m_outerDiscBounds); oSurfaces.at(negativeFaceXY) = - OrientedSurface{std::move(negOutDisc), Direction::AlongNormal}; + OrientedSurface{std::move(negOutDisc), Direction::AlongNormal()}; // Two Inner disks auto posInDiscTrf = @@ -128,14 +128,14 @@ std::vector CutoutCylinderVolumeBounds::orientedSurfaces( auto posInDisc = Surface::makeShared(posInDiscTrf, m_innerDiscBounds); oSurfaces.at(index5) = - OrientedSurface{std::move(posInDisc), Direction::AlongNormal}; + OrientedSurface{std::move(posInDisc), Direction::AlongNormal()}; auto negInDiscTrf = transform * Translation3(Vector3(0, 0, -get(eHalfLengthZcutout))); auto negInDisc = Surface::makeShared(negInDiscTrf, m_innerDiscBounds); oSurfaces.at(index4) = - OrientedSurface{std::move(negInDisc), Direction::OppositeNormal}; + OrientedSurface{std::move(negInDisc), Direction::OppositeNormal()}; return oSurfaces; } diff --git a/Core/src/Geometry/CylinderVolumeBounds.cpp b/Core/src/Geometry/CylinderVolumeBounds.cpp index f6e37230943..8d1001e22be 100644 --- a/Core/src/Geometry/CylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CylinderVolumeBounds.cpp @@ -115,24 +115,24 @@ std::vector CylinderVolumeBounds::orientedSurfaces( // [0] Bottom Disc (negative z) auto dSurface = Surface::makeShared(transMinZ, m_discBounds); oSurfaces.push_back( - OrientedSurface{std::move(dSurface), Direction::AlongNormal}); + OrientedSurface{std::move(dSurface), Direction::AlongNormal()}); // [1] Top Disc (positive z) dSurface = Surface::makeShared(transMaxZ, m_discBounds); oSurfaces.push_back( - OrientedSurface{std::move(dSurface), Direction::OppositeNormal}); + OrientedSurface{std::move(dSurface), Direction::OppositeNormal()}); // [2] Outer Cylinder auto cSurface = Surface::makeShared(transform, m_outerCylinderBounds); oSurfaces.push_back( - OrientedSurface{std::move(cSurface), Direction::OppositeNormal}); + OrientedSurface{std::move(cSurface), Direction::OppositeNormal()}); // [3] Inner Cylinder (optional) if (m_innerCylinderBounds != nullptr) { cSurface = Surface::makeShared(transform, m_innerCylinderBounds); oSurfaces.push_back( - OrientedSurface{std::move(cSurface), Direction::AlongNormal}); + OrientedSurface{std::move(cSurface), Direction::AlongNormal()}); } // [4] & [5] - Sectoral planes (optional) @@ -147,7 +147,7 @@ std::vector CylinderVolumeBounds::orientedSurfaces( auto pSurface = Surface::makeShared(sp1Transform, m_sectorPlaneBounds); oSurfaces.push_back( - OrientedSurface{std::move(pSurface), Direction::AlongNormal}); + OrientedSurface{std::move(pSurface), Direction::AlongNormal()}); // sectorPlane 2 (positive phi) const Transform3 sp2Transform = Transform3(transform * @@ -158,7 +158,7 @@ std::vector CylinderVolumeBounds::orientedSurfaces( pSurface = Surface::makeShared(sp2Transform, m_sectorPlaneBounds); oSurfaces.push_back( - OrientedSurface{std::move(pSurface), Direction::OppositeNormal}); + OrientedSurface{std::move(pSurface), Direction::OppositeNormal()}); } return oSurfaces; } diff --git a/Core/src/Geometry/Portal.cpp b/Core/src/Geometry/Portal.cpp index 0244b4c648e..b667b566cca 100644 --- a/Core/src/Geometry/Portal.cpp +++ b/Core/src/Geometry/Portal.cpp @@ -40,7 +40,7 @@ Portal::Portal(Direction direction, std::unique_ptr link) { m_surface = link->surfacePtr(); - if (direction == Direction::AlongNormal) { + if (direction == Direction::AlongNormal()) { m_alongNormal = std::move(link); } else { m_oppositeNormal = std::move(link); @@ -60,10 +60,10 @@ Portal::Portal(const GeometryContext& gctx, } if (alongNormal != nullptr) { - setLink(gctx, Direction::AlongNormal, std::move(alongNormal)); + setLink(gctx, Direction::AlongNormal(), std::move(alongNormal)); } if (oppositeNormal != nullptr) { - setLink(gctx, Direction::OppositeNormal, std::move(oppositeNormal)); + setLink(gctx, Direction::OppositeNormal(), std::move(oppositeNormal)); } } @@ -73,12 +73,12 @@ Portal::Portal(const GeometryContext& gctx, Arguments&& args) { } if (args.alongNormal.surface) { - setLink(gctx, Direction::AlongNormal, + setLink(gctx, Direction::AlongNormal(), std::make_unique( std::move(args.alongNormal.surface), *args.alongNormal.volume)); } if (args.oppositeNormal.surface) { - setLink(gctx, Direction::OppositeNormal, + setLink(gctx, Direction::OppositeNormal(), std::make_unique( std::move(args.oppositeNormal.surface), *args.oppositeNormal.volume)); @@ -92,9 +92,9 @@ void Portal::setLink(const GeometryContext& gctx, Direction direction, } auto& target = - direction == Direction::AlongNormal ? m_alongNormal : m_oppositeNormal; + direction == Direction::AlongNormal() ? m_alongNormal : m_oppositeNormal; const auto& other = - direction == Direction::AlongNormal ? m_oppositeNormal : m_alongNormal; + direction == Direction::AlongNormal() ? m_oppositeNormal : m_alongNormal; // check if surfaces are identical if (m_surface != nullptr && @@ -136,7 +136,7 @@ void Portal::setLink(const GeometryContext& gctx, Direction direction, } const PortalLinkBase* Portal::getLink(Direction direction) const { - if (direction == Direction::AlongNormal) { + if (direction == Direction::AlongNormal()) { return m_alongNormal.get(); } else { return m_oppositeNormal.get(); @@ -150,7 +150,7 @@ Result Portal::resolveVolume( const Vector3 normal = m_surface->normal(gctx, position); Direction side = Direction::fromScalarZeroAsPositive(normal.dot(direction)); - const PortalLinkBase* link = side == Direction::AlongNormal + const PortalLinkBase* link = side == Direction::AlongNormal() ? m_alongNormal.get() : m_oppositeNormal.get(); diff --git a/Core/src/Geometry/TrackingVolume.cpp b/Core/src/Geometry/TrackingVolume.cpp index 21c22fa8c8d..e5d0aef3885 100644 --- a/Core/src/Geometry/TrackingVolume.cpp +++ b/Core/src/Geometry/TrackingVolume.cpp @@ -114,7 +114,7 @@ const TrackingVolumeBoundaries& TrackingVolume::boundarySurfaces() const { void TrackingVolume::connectDenseBoundarySurfaces( MutableTrackingVolumeVector& confinedDenseVolumes) { if (!confinedDenseVolumes.empty()) { - Direction dir = Direction::Positive; + Direction dir = Direction::Positive(); // Walk over each dense volume for (auto& confDenseVol : confinedDenseVolumes) { // Walk over each boundary surface of the volume @@ -133,12 +133,12 @@ void TrackingVolume::connectDenseBoundarySurfaces( boundSur.at(i)); if (mutableBs->m_oppositeVolume != nullptr && mutableBs->m_alongVolume == nullptr) { - dir = Direction::Positive; + dir = Direction::Positive(); mutableBs->attachVolume(this, dir); } else { if (mutableBs->m_oppositeVolume == nullptr && mutableBs->m_alongVolume != nullptr) { - dir = Direction::Negative; + dir = Direction::Negative(); mutableBs->attachVolume(this, dir); } } @@ -163,7 +163,7 @@ void TrackingVolume::createBoundarySurfaces() { for (auto& osf : orientedSurfaces) { TrackingVolume* opposite = nullptr; TrackingVolume* along = nullptr; - if (osf.direction == Direction::OppositeNormal) { + if (osf.direction == Direction::OppositeNormal()) { opposite = this; } else { along = this; diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index 2034ce6f302..67b231aa43f 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -74,12 +74,12 @@ std::vector TrapezoidVolumeBounds::orientedSurfaces( auto nzTransform = transform * Translation3(0., 0., -get(eHalfLengthZ)); auto sf = Surface::makeShared(nzTransform, m_faceXYTrapezoidBounds); - oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal}); + oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal()}); // (2) - At positive local z auto pzTransform = transform * Translation3(0., 0., get(eHalfLengthZ)); sf = Surface::makeShared(pzTransform, m_faceXYTrapezoidBounds); oSurfaces.push_back( - OrientedSurface{std::move(sf), Direction::OppositeNormal}); + OrientedSurface{std::move(sf), Direction::OppositeNormal()}); double poshOffset = get(eHalfLengthY) / std::tan(get(eAlpha)); double neghOffset = get(eHalfLengthY) / std::tan(get(eBeta)); @@ -94,7 +94,7 @@ std::vector TrapezoidVolumeBounds::orientedSurfaces( s_planeYZ; sf = Surface::makeShared(fbTransform, m_faceBetaRectangleBounds); - oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal}); + oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal()}); // (4) - At point A, attached to alpha opening angle Vector3 faPosition(get(eHalfLengthXnegY) + poshOffset, 0., 0.); @@ -105,7 +105,7 @@ std::vector TrapezoidVolumeBounds::orientedSurfaces( sf = Surface::makeShared(faTransform, m_faceAlphaRectangleBounds); oSurfaces.push_back( - OrientedSurface{std::move(sf), Direction::OppositeNormal}); + OrientedSurface{std::move(sf), Direction::OppositeNormal()}); // Face surfaces zx // (5) - At negative local y @@ -113,14 +113,14 @@ std::vector TrapezoidVolumeBounds::orientedSurfaces( transform * Translation3(0., -get(eHalfLengthY), 0.) * s_planeZX; sf = Surface::makeShared(nxTransform, m_faceZXRectangleBoundsBottom); - oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal}); + oSurfaces.push_back(OrientedSurface{std::move(sf), Direction::AlongNormal()}); // (6) - At positive local y auto pxTransform = transform * Translation3(topShift, get(eHalfLengthY), 0.) * s_planeZX; sf = Surface::makeShared(pxTransform, m_faceZXRectangleBoundsTop); oSurfaces.push_back( - OrientedSurface{std::move(sf), Direction::OppositeNormal}); + OrientedSurface{std::move(sf), Direction::OppositeNormal()}); return oSurfaces; } diff --git a/Core/src/Vertexing/ImpactPointEstimator.cpp b/Core/src/Vertexing/ImpactPointEstimator.cpp index 51f0ebe24db..a58ee19de96 100644 --- a/Core/src/Vertexing/ImpactPointEstimator.cpp +++ b/Core/src/Vertexing/ImpactPointEstimator.cpp @@ -509,7 +509,7 @@ Result> ImpactPointEstimator::getLifetimeSignOfTrack( // Create propagator options PropagatorPlainOptions pOptions(gctx, mctx); - pOptions.direction = Direction::Backward; + pOptions.direction = Direction::Backward(); // Do the propagation to the perigeee auto result = @@ -548,7 +548,7 @@ Result ImpactPointEstimator::get3DLifetimeSignOfTrack( // Create propagator options PropagatorPlainOptions pOptions(gctx, mctx); - pOptions.direction = Direction::Backward; + pOptions.direction = Direction::Backward(); // Do the propagation to the perigeee auto result = diff --git a/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp b/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp index 9d3121cdc44..7aae103ff4a 100644 --- a/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp +++ b/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp @@ -98,7 +98,7 @@ Acts::detail::Step stepFromG4Step(const G4Step* step) { auto [preStepPosition, preStepMomentum, postStepPosition, postStepMomentum] = kinematicsOfStep(step); - pStep.navDir = Acts::Direction::Forward; + pStep.navDir = Acts::Direction::Forward(); pStep.position = 0.5 * (preStepPosition + postStepPosition).block<3, 1>(0, 0); pStep.momentum = 0.5 * (preStepMomentum + postStepMomentum).block<3, 1>(0, 0); pStep.nTotalTrials = 1; diff --git a/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp b/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp index a653794dec1..567923776c1 100644 --- a/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp +++ b/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp @@ -99,7 +99,7 @@ ActsExamples::ProcessCode ActsExamples::SimHitToSummaryConversion::execute( step.position = Acts::Vector3(hx, hy, hz); step.momentum = simHit.direction(); step.geoID = moduleGeoId; - step.navDir = Acts::Direction::Forward; + step.navDir = Acts::Direction::Forward(); moduleSteps[paritcleId].push_back(step); } // Loop over and fill into the trackSteps diff --git a/Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp b/Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp index d27902c7739..27c435c80fb 100644 --- a/Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp +++ b/Examples/Algorithms/Traccc/include/ActsExamples/Traccc/DetrayPropagator.hpp @@ -129,8 +129,9 @@ class DetrayPropagator : public PropagatorInterface { Acts::detail::Step step; step.position = Acts::Vector3(dposition[0], dposition[1], dposition[2]); step.geoID = geoID; - step.navDir = object.intersection.direction ? Acts::Direction::Forward - : Acts::Direction::Backward; + step.navDir = object.intersection.direction + ? Acts::Direction::Forward() + : Acts::Direction::Backward(); summary.steps.emplace_back(step); } } else { diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp index 53b47a86d07..7caa25f20fb 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp @@ -343,8 +343,8 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { Acts::PropagatorPlainOptions firstPropOptions(ctx.geoContext, ctx.magFieldContext); firstPropOptions.maxSteps = m_cfg.maxSteps; - firstPropOptions.direction = m_cfg.reverseSearch ? Acts::Direction::Backward - : Acts::Direction::Forward; + firstPropOptions.direction = m_cfg.reverseSearch ? Acts::Direction::Backward() + : Acts::Direction::Forward(); firstPropOptions.constrainToVolumeIds = m_cfg.constrainToVolumeIds; firstPropOptions.endOfWorldVolumeIds = m_cfg.endOfWorldVolumeIds; diff --git a/Plugins/Json/src/PortalJsonConverter.cpp b/Plugins/Json/src/PortalJsonConverter.cpp index fd1bd742068..0178bc71234 100644 --- a/Plugins/Json/src/PortalJsonConverter.cpp +++ b/Plugins/Json/src/PortalJsonConverter.cpp @@ -319,8 +319,8 @@ std::shared_ptr Acts::PortalJsonConverter::fromJson( } auto portal = std::make_shared(regSurface); - std::array normalDirs = {Direction::Backward, - Direction::Forward}; + std::array normalDirs = {Direction::Backward(), + Direction::Forward()}; // re-create the volume links auto jLinks = jPortal["volume_links"]; for (auto [ivl, vl] : enumerate(jLinks)) { diff --git a/Tests/IntegrationTests/NavigatorConsistency.cpp b/Tests/IntegrationTests/NavigatorConsistency.cpp index ea74491a1c0..edda414a1df 100644 --- a/Tests/IntegrationTests/NavigatorConsistency.cpp +++ b/Tests/IntegrationTests/NavigatorConsistency.cpp @@ -103,7 +103,7 @@ void runSelfConsistencyTest(const propagator_t& prop, // backward surface test Options bwdOptions(tgContext, mfContext); bwdOptions.pathLimit = 25_cm; - bwdOptions.direction = Direction::Backward; + bwdOptions.direction = Direction::Backward(); // get the surface collector and configure it auto& bwdMSurfaceCollector = @@ -189,7 +189,7 @@ void runSelfConsistencyTest(const propagator_t& prop, // stepping from one surface to the next : backwards // now go from surface to surface and check Options bwdStepOptions(tgContext, mfContext); - bwdStepOptions.direction = Direction::Backward; + bwdStepOptions.direction = Direction::Backward(); // get the surface collector and configure it auto& bwdStepSurfaceCollector = diff --git a/Tests/IntegrationTests/PropagationTests.hpp b/Tests/IntegrationTests/PropagationTests.hpp index b7b40c66e0c..56722d8462f 100644 --- a/Tests/IntegrationTests/PropagationTests.hpp +++ b/Tests/IntegrationTests/PropagationTests.hpp @@ -269,7 +269,7 @@ inline std::pair transportToSurface( // setup propagation options options_t options(geoCtx, magCtx); - options.direction = Acts::Direction::Forward; + options.direction = Acts::Direction::Forward(); options.pathLimit = pathLimit; options.surfaceTolerance = 1_nm; options.stepping.stepTolerance = 1_nm; @@ -293,7 +293,7 @@ inline void runForwardBackwardTest( const Acts::MagneticFieldContext& magCtx, const Acts::CurvilinearTrackParameters& initialParams, double pathLength, double epsPos, double epsDir, double epsMom) { - // propagate parameters Acts::Direction::Forward + // propagate parameters Acts::Direction::Forward() auto [fwdParams, fwdPathLength] = transportFreely( propagator, geoCtx, magCtx, initialParams, pathLength); CHECK_CLOSE_ABS(fwdPathLength, pathLength, epsPos); diff --git a/Tests/UnitTests/Core/Definitions/DirectionTests.cpp b/Tests/UnitTests/Core/Definitions/DirectionTests.cpp index 0badd75c66a..4eb5603d1fc 100644 --- a/Tests/UnitTests/Core/Definitions/DirectionTests.cpp +++ b/Tests/UnitTests/Core/Definitions/DirectionTests.cpp @@ -18,11 +18,11 @@ using namespace Acts; BOOST_AUTO_TEST_SUITE(DefinitionsDirection) BOOST_AUTO_TEST_CASE(DirectionTests) { - constexpr Direction bwd = Direction::Backward; - constexpr Direction fwd = Direction::Forward; + constexpr Direction bwd = Direction::Backward(); + constexpr Direction fwd = Direction::Forward(); - BOOST_CHECK_EQUAL(bwd, Direction::Negative); - BOOST_CHECK_EQUAL(fwd, Direction::Positive); + BOOST_CHECK_EQUAL(bwd, Direction::Negative()); + BOOST_CHECK_EQUAL(fwd, Direction::Positive()); BOOST_CHECK_EQUAL(Direction::fromScalar(-1.), bwd); BOOST_CHECK_EQUAL(Direction::fromScalar(1.), fwd); diff --git a/Tests/UnitTests/Core/Detector/PortalTests.cpp b/Tests/UnitTests/Core/Detector/PortalTests.cpp index 46d6b32b94c..46a0558db9d 100644 --- a/Tests/UnitTests/Core/Detector/PortalTests.cpp +++ b/Tests/UnitTests/Core/Detector/PortalTests.cpp @@ -88,8 +88,8 @@ BOOST_AUTO_TEST_CASE(PortalTest) { auto linkToAImpl = std::make_unique(volumeA); ExternalNavigationDelegate linkToA; linkToA.connect<&LinkToVolumeImpl::link>(std::move(linkToAImpl)); - portalA->assignPortalNavigation(Acts::Direction::Positive, std::move(linkToA), - {volumeA}); + portalA->assignPortalNavigation(Acts::Direction::Positive(), + std::move(linkToA), {volumeA}); auto attachedDetectorVolumes = portalA->attachedDetectorVolumes(); BOOST_CHECK(attachedDetectorVolumes[0u].empty()); @@ -111,8 +111,8 @@ BOOST_AUTO_TEST_CASE(PortalTest) { ExternalNavigationDelegate linkToB; auto linkToBImpl = std::make_unique(volumeB); linkToB.connect<&LinkToVolumeImpl::link>(std::move(linkToBImpl)); - portalB->assignPortalNavigation(Acts::Direction::Negative, std::move(linkToB), - {volumeB}); + portalB->assignPortalNavigation(Acts::Direction::Negative(), + std::move(linkToB), {volumeB}); // Reverse: positive volume nullptr, negative volume volumeB nState.direction = Acts::Vector3(0., 0., 1.); @@ -206,8 +206,8 @@ BOOST_AUTO_TEST_CASE(PortalMaterialTest) { ExternalNavigationDelegate linkToA; auto linkToAImpl = std::make_unique(volumeA); linkToA.connect<&LinkToVolumeImpl::link>(std::move(linkToAImpl)); - portalA->assignPortalNavigation(Acts::Direction::Positive, std::move(linkToA), - {volumeA}); + portalA->assignPortalNavigation(Acts::Direction::Positive(), + std::move(linkToA), {volumeA}); auto surfaceB = Acts::Surface::makeShared( Acts::Transform3::Identity(), rectangle); @@ -215,8 +215,8 @@ BOOST_AUTO_TEST_CASE(PortalMaterialTest) { ExternalNavigationDelegate linkToB; auto linkToBImpl = std::make_unique(volumeB); linkToB.connect<&LinkToVolumeImpl::link>(std::move(linkToBImpl)); - portalB->assignPortalNavigation(Acts::Direction::Negative, std::move(linkToB), - {volumeB}); + portalB->assignPortalNavigation(Acts::Direction::Negative(), + std::move(linkToB), {volumeB}); // Portal A fuses with B // - has material and keeps it @@ -228,7 +228,7 @@ BOOST_AUTO_TEST_CASE(PortalMaterialTest) { ExternalNavigationDelegate linkToB2; auto linkToB2Impl = std::make_unique(volumeB); linkToB2.connect<&LinkToVolumeImpl::link>(std::move(linkToB2Impl)); - portalB->assignPortalNavigation(Acts::Direction::Negative, + portalB->assignPortalNavigation(Acts::Direction::Negative(), std::move(linkToB2), {volumeB}); // Portal B fuses with A @@ -238,7 +238,7 @@ BOOST_AUTO_TEST_CASE(PortalMaterialTest) { // This fails because A has accumulated volumes on both sides through fusing BOOST_CHECK_THROW(Portal::fuse(portalB, portalA), std::invalid_argument); // Remove Negative volume on A - portalA->assignPortalNavigation(Acts::Direction::Negative, + portalA->assignPortalNavigation(Acts::Direction::Negative(), ExternalNavigationDelegate{}, {}); portalB = Portal::fuse(portalB, portalA); @@ -249,7 +249,7 @@ BOOST_AUTO_TEST_CASE(PortalMaterialTest) { ExternalNavigationDelegate linkToA2; auto linkToA2Impl = std::make_unique(volumeA); linkToA2.connect<&LinkToVolumeImpl::link>(std::move(linkToA2Impl)); - portalA->assignPortalNavigation(Acts::Direction::Positive, + portalA->assignPortalNavigation(Acts::Direction::Positive(), std::move(linkToA2), {volumeA}); surfaceB->assignSurfaceMaterial(materialB); @@ -257,7 +257,7 @@ BOOST_AUTO_TEST_CASE(PortalMaterialTest) { ExternalNavigationDelegate linkToB3; auto linkToB3Impl = std::make_unique(volumeB); linkToB3.connect<&LinkToVolumeImpl::link>(std::move(linkToB3Impl)); - portalB->assignPortalNavigation(Acts::Direction::Negative, + portalB->assignPortalNavigation(Acts::Direction::Negative(), std::move(linkToB3), {volumeB}); // Portal A fuses with B - both have material, throw exception diff --git a/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp b/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp index e12a3ca3dbc..b4e9eaa6dfe 100644 --- a/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp +++ b/Tests/UnitTests/Core/Geometry/PortalShellTests.cpp @@ -314,13 +314,13 @@ BOOST_AUTO_TEST_CASE(PortalAssignment) { // Setting new outer cylinder BOOST_REQUIRE_NE(oCyl, nullptr); auto* oCylLink = dynamic_cast( - oCyl->getLink(Direction::OppositeNormal)); + oCyl->getLink(Direction::OppositeNormal())); BOOST_REQUIRE_NE(oCylLink, nullptr); auto grid = oCylLink->makeGrid(AxisDirection::AxisZ); auto portal2 = - std::make_shared(Direction::OppositeNormal, std::move(grid)); + std::make_shared(Direction::OppositeNormal(), std::move(grid)); shell.setPortal(portal2, OuterCylinder); BOOST_CHECK_EQUAL(shell.portal(OuterCylinder), portal2.get()); @@ -332,13 +332,13 @@ BOOST_AUTO_TEST_CASE(PortalAssignment) { // Setting new negative disc BOOST_REQUIRE_NE(nDisc, nullptr); auto* nDiscLink = dynamic_cast( - nDisc->getLink(Direction::AlongNormal)); + nDisc->getLink(Direction::AlongNormal())); BOOST_REQUIRE_NE(nDiscLink, nullptr); grid = nDiscLink->makeGrid(AxisDirection::AxisR); auto portal3 = - std::make_shared(Direction::AlongNormal, std::move(grid)); + std::make_shared(Direction::AlongNormal(), std::move(grid)); shell.setPortal(portal3, NegativeDisc); BOOST_CHECK_EQUAL(shell.portal(NegativeDisc), portal3.get()); @@ -728,24 +728,28 @@ BOOST_AUTO_TEST_CASE(Fill) { using enum CylinderVolumeBounds::Face; BOOST_CHECK_EQUAL( - shell.portal(OuterCylinder)->getLink(Direction::AlongNormal), nullptr); + shell.portal(OuterCylinder)->getLink(Direction::AlongNormal()), nullptr); BOOST_CHECK_EQUAL( - shell.portal(InnerCylinder)->getLink(Direction::OppositeNormal), nullptr); - BOOST_CHECK_EQUAL(shell.portal(PositiveDisc)->getLink(Direction::AlongNormal), - nullptr); + shell.portal(InnerCylinder)->getLink(Direction::OppositeNormal()), + nullptr); BOOST_CHECK_EQUAL( - shell.portal(NegativeDisc)->getLink(Direction::OppositeNormal), nullptr); + shell.portal(PositiveDisc)->getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_EQUAL( + shell.portal(NegativeDisc)->getLink(Direction::OppositeNormal()), + nullptr); shell.fill(cyl2); - BOOST_CHECK_NE(shell.portal(OuterCylinder)->getLink(Direction::AlongNormal), + BOOST_CHECK_NE(shell.portal(OuterCylinder)->getLink(Direction::AlongNormal()), nullptr); BOOST_CHECK_NE( - shell.portal(InnerCylinder)->getLink(Direction::OppositeNormal), nullptr); - BOOST_CHECK_NE(shell.portal(PositiveDisc)->getLink(Direction::AlongNormal), - nullptr); - BOOST_CHECK_NE(shell.portal(NegativeDisc)->getLink(Direction::OppositeNormal), + shell.portal(InnerCylinder)->getLink(Direction::OppositeNormal()), + nullptr); + BOOST_CHECK_NE(shell.portal(PositiveDisc)->getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_NE( + shell.portal(NegativeDisc)->getLink(Direction::OppositeNormal()), + nullptr); } BOOST_AUTO_TEST_CASE(RegisterInto) { diff --git a/Tests/UnitTests/Core/Geometry/PortalTests.cpp b/Tests/UnitTests/Core/Geometry/PortalTests.cpp index 0eb38677154..3586bf0a115 100644 --- a/Tests/UnitTests/Core/Geometry/PortalTests.cpp +++ b/Tests/UnitTests/Core/Geometry/PortalTests.cpp @@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE(Cylinder) { auto cyl2 = Surface::makeShared( Transform3{Translation3{Vector3::UnitZ() * 100_mm}}, 50_mm, 100_mm); - Portal portal1{Direction::AlongNormal, + Portal portal1{Direction::AlongNormal(), std::make_unique(cyl1, *vol1)}; BOOST_CHECK(portal1.isValid()); @@ -87,7 +87,7 @@ BOOST_AUTO_TEST_CASE(Cylinder) { .value(), nullptr); - Portal portal2{Direction::AlongNormal, cyl2, *vol2}; + Portal portal2{Direction::AlongNormal(), cyl2, *vol2}; BOOST_CHECK(portal2.isValid()); BOOST_CHECK_EQUAL( @@ -106,15 +106,15 @@ BOOST_AUTO_TEST_CASE(Cylinder) { nullptr}; BOOST_CHECK(portal3.isValid()); - BOOST_CHECK_NE(portal3.getLink(Direction::AlongNormal), nullptr); - BOOST_CHECK_EQUAL(portal3.getLink(Direction::OppositeNormal), nullptr); + BOOST_CHECK_NE(portal3.getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_EQUAL(portal3.getLink(Direction::OppositeNormal()), nullptr); Portal portal4{gctx, nullptr, std::make_unique(cyl2, *vol2)}; BOOST_CHECK(portal4.isValid()); - BOOST_CHECK_EQUAL(portal4.getLink(Direction::AlongNormal), nullptr); - BOOST_CHECK_NE(portal4.getLink(Direction::OppositeNormal), nullptr); + BOOST_CHECK_EQUAL(portal4.getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_NE(portal4.getLink(Direction::OppositeNormal()), nullptr); // Not mergeable because 1 has portal along but 4 has portal oppsite // ^ @@ -169,11 +169,11 @@ BOOST_AUTO_TEST_CASE(Cylinder) { Portal merged12 = Portal::merge(gctx, portal1, portal2, AxisDirection::AxisZ, *logger); - BOOST_CHECK_NE(merged12.getLink(Direction::AlongNormal), nullptr); - BOOST_CHECK_EQUAL(merged12.getLink(Direction::OppositeNormal), nullptr); + BOOST_CHECK_NE(merged12.getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_EQUAL(merged12.getLink(Direction::OppositeNormal()), nullptr); auto composite12 = dynamic_cast( - merged12.getLink(Direction::AlongNormal)); + merged12.getLink(Direction::AlongNormal())); BOOST_REQUIRE_NE(composite12, nullptr); BOOST_CHECK_EQUAL( @@ -369,9 +369,10 @@ BOOST_AUTO_TEST_CASE(Separated) { BOOST_CHECK(portal2.isValid()); // Same way can't set cyl2 as other link - BOOST_CHECK_THROW(portal1.setLink(gctx, Direction::AlongNormal, cyl2, *vol2), - PortalFusingException); - BOOST_CHECK_EQUAL(portal1.getLink(Direction::AlongNormal), nullptr); + BOOST_CHECK_THROW( + portal1.setLink(gctx, Direction::AlongNormal(), cyl2, *vol2), + PortalFusingException); + BOOST_CHECK_EQUAL(portal1.getLink(Direction::AlongNormal()), nullptr); Portal portal1b{gctx, {.oppositeNormal = {cyl1, *vol1}}}; BOOST_CHECK(portal1b.isValid()); @@ -452,7 +453,7 @@ BOOST_AUTO_TEST_CASE(Success) { // | | | | // +---+ +---+ Portal portal1{gctx, {.oppositeNormal = {cyl1, *vol1}}}; - BOOST_CHECK_EQUAL(&portal1.getLink(Direction::OppositeNormal)->surface(), + BOOST_CHECK_EQUAL(&portal1.getLink(Direction::OppositeNormal())->surface(), cyl1.get()); Portal portal2{gctx, {.alongNormal = {cyl2, *vol2}}}; @@ -471,7 +472,7 @@ BOOST_AUTO_TEST_CASE(Success) { // Portal surface is set to the one from "along", because it gets set first BOOST_CHECK_EQUAL(&portal3.surface(), cyl2.get()); // "Opposite" gets the already-set surface set as well - BOOST_CHECK_EQUAL(&portal3.getLink(Direction::OppositeNormal)->surface(), + BOOST_CHECK_EQUAL(&portal3.getLink(Direction::OppositeNormal())->surface(), cyl2.get()); } @@ -579,11 +580,11 @@ BOOST_AUTO_TEST_CASE(GridCreationOnFuse) { Portal fused = Portal::fuse(gctx, aPortal, bPortal, *logger); BOOST_CHECK_NE(dynamic_cast( - fused.getLink(Direction::OppositeNormal)), + fused.getLink(Direction::OppositeNormal())), nullptr); const auto* grid = dynamic_cast( - fused.getLink(Direction::AlongNormal)); + fused.getLink(Direction::AlongNormal())); BOOST_REQUIRE_NE(grid, nullptr); BOOST_CHECK_EQUAL(grid->grid().axes().front()->getNBins(), 3); @@ -612,19 +613,19 @@ BOOST_AUTO_TEST_CASE(Construction) { } BOOST_AUTO_TEST_CASE(InvalidConstruction) { - BOOST_CHECK_THROW(Portal(Direction::AlongNormal, nullptr), + BOOST_CHECK_THROW(Portal(Direction::AlongNormal(), nullptr), std::invalid_argument); auto vol1 = makeDummyVolume(); - BOOST_CHECK_THROW(Portal(Direction::AlongNormal, nullptr, *vol1), + BOOST_CHECK_THROW(Portal(Direction::AlongNormal(), nullptr, *vol1), std::invalid_argument); auto disc1 = Surface::makeShared( Transform3::Identity(), std::make_shared(50_mm, 100_mm)); - Portal portal(Direction::AlongNormal, disc1, *vol1); + Portal portal(Direction::AlongNormal(), disc1, *vol1); - BOOST_CHECK_THROW(portal.setLink(gctx, Direction::AlongNormal, nullptr), + BOOST_CHECK_THROW(portal.setLink(gctx, Direction::AlongNormal(), nullptr), std::invalid_argument); } @@ -646,12 +647,12 @@ BOOST_AUTO_TEST_CASE(PortalFill) { portal1 = Portal{gctx, {.oppositeNormal = {cyl1, *vol1}}}; portal2 = Portal{gctx, {.alongNormal = {cyl1, *vol2}}}; - BOOST_CHECK_EQUAL(portal1.getLink(Direction::AlongNormal), nullptr); - BOOST_CHECK_NE(portal1.getLink(Direction::OppositeNormal), nullptr); + BOOST_CHECK_EQUAL(portal1.getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_NE(portal1.getLink(Direction::OppositeNormal()), nullptr); portal1.fill(*vol2); - BOOST_CHECK_NE(portal1.getLink(Direction::AlongNormal), nullptr); - BOOST_CHECK_NE(portal1.getLink(Direction::OppositeNormal), nullptr); + BOOST_CHECK_NE(portal1.getLink(Direction::AlongNormal()), nullptr); + BOOST_CHECK_NE(portal1.getLink(Direction::OppositeNormal()), nullptr); BOOST_CHECK_THROW(portal1.fill(*vol2), std::logic_error); } diff --git a/Tests/UnitTests/Core/Material/HomogeneousSurfaceMaterialTests.cpp b/Tests/UnitTests/Core/Material/HomogeneousSurfaceMaterialTests.cpp index 10db0c4b689..c353d1e92e0 100644 --- a/Tests/UnitTests/Core/Material/HomogeneousSurfaceMaterialTests.cpp +++ b/Tests/UnitTests/Core/Material/HomogeneousSurfaceMaterialTests.cpp @@ -82,8 +82,8 @@ BOOST_AUTO_TEST_CASE(HomogeneousSurfaceMaterial_access_test) { BOOST_CHECK_EQUAL(mat, mat2d); BOOST_CHECK_EQUAL(mat, mat3d); - Direction fDir = Direction::Forward; - Direction bDir = Direction::Backward; + Direction fDir = Direction::Forward(); + Direction bDir = Direction::Backward(); MaterialUpdateStage pre = MaterialUpdateStage::PreUpdate; MaterialUpdateStage full = MaterialUpdateStage::FullUpdate; diff --git a/Tests/UnitTests/Core/Material/ISurfaceMaterialTests.cpp b/Tests/UnitTests/Core/Material/ISurfaceMaterialTests.cpp index 1bdb2cef716..f302acf37f0 100644 --- a/Tests/UnitTests/Core/Material/ISurfaceMaterialTests.cpp +++ b/Tests/UnitTests/Core/Material/ISurfaceMaterialTests.cpp @@ -45,25 +45,25 @@ BOOST_AUTO_TEST_CASE(ISurfaceMaterial_factor_test) { SurfaceMaterialStub stub{splitFactor}; BOOST_CHECK_EQUAL( - stub.factor(Direction::Forward, MaterialUpdateStage::FullUpdate), 1.0); + stub.factor(Direction::Forward(), MaterialUpdateStage::FullUpdate), 1.0); BOOST_CHECK_EQUAL( - stub.factor(Direction::Backward, MaterialUpdateStage::FullUpdate), 1.0); + stub.factor(Direction::Backward(), MaterialUpdateStage::FullUpdate), 1.0); BOOST_CHECK_EQUAL( - stub.factor(Direction::Forward, MaterialUpdateStage::PostUpdate), + stub.factor(Direction::Forward(), MaterialUpdateStage::PostUpdate), splitFactor); BOOST_CHECK_EQUAL( - stub.factor(Direction::Backward, MaterialUpdateStage::PreUpdate), + stub.factor(Direction::Backward(), MaterialUpdateStage::PreUpdate), splitFactor); BOOST_CHECK_EQUAL( - stub.factor(Direction::Forward, MaterialUpdateStage::PreUpdate), + stub.factor(Direction::Forward(), MaterialUpdateStage::PreUpdate), 1 - splitFactor); BOOST_CHECK_EQUAL( - stub.factor(Direction::Backward, MaterialUpdateStage::PostUpdate), + stub.factor(Direction::Backward(), MaterialUpdateStage::PostUpdate), 1 - splitFactor); } diff --git a/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp b/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp index 7596c4881ad..b50a37dceba 100644 --- a/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp +++ b/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp @@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsForwardBackward) { Acts::Logging::Level::VERBOSE)); PropagatorOptions options(geoContext, mfContext); - options.direction = Acts::Direction::Forward; + options.direction = Acts::Direction::Forward(); Propagator propagator( stepper, navigator, @@ -295,7 +295,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsForwardBackward) { auto resultFwd = propagator.propagate(startFwd, options).value(); auto statesFwd = resultFwd.get(); - options.direction = Acts::Direction::Backward; + options.direction = Acts::Direction::Backward(); Acts::Vector4 posBwd(14, 0, 0, 0); Acts::CurvilinearTrackParameters startBwd( @@ -439,7 +439,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsAmbiguity) { Acts::Logging::Level::VERBOSE)); PropagatorOptions options(geoContext, mfContext); - options.direction = Acts::Direction::Forward; + options.direction = Acts::Direction::Forward(); Propagator propagator( stepper, navigator, @@ -457,7 +457,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsAmbiguity) { auto resultFwd = propagator.propagate(start, options).value(); auto statesFwd = resultFwd.get(); - options.direction = Acts::Direction::Backward; + options.direction = Acts::Direction::Backward(); auto resultBwd = propagator.propagate(start, options).value(); auto statesBwd = resultBwd.get(); @@ -554,7 +554,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsMultipleIntersection) { Acts::Logging::Level::VERBOSE)); PropagatorOptions options(geoContext, mfContext); - options.direction = Acts::Direction::Forward; + options.direction = Acts::Direction::Forward(); Propagator propagator( stepper, navigator, @@ -572,7 +572,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsMultipleIntersection) { auto resultFwd = propagator.propagate(startFwd, options).value(); auto statesFwd = resultFwd.get(); - options.direction = Acts::Direction::Backward; + options.direction = Acts::Direction::Backward(); Acts::Vector4 posBwd(5, 0, 0, 0); Acts::CurvilinearTrackParameters startBwd( posBwd, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, diff --git a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp index 9974fd3dfad..bb41f78e6e6 100644 --- a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp @@ -64,7 +64,7 @@ struct MockPropagatorState { Stepper::State stepping; /// Propagator options with only the relevant components. struct { - Direction direction = Direction::Backward; + Direction direction = Direction::Backward(); struct { double stepTolerance = 10_um; } stepping; @@ -80,7 +80,7 @@ static constexpr auto eps = 1024 * std::numeric_limits::epsilon(); // propagation settings static constexpr auto stepSize = 10_mm; -static constexpr Direction navDir = Direction::Backward; +static constexpr Direction navDir = Direction::Backward(); static auto magneticField = std::make_shared(Vector3(0.1_T, -0.2_T, 2_T)); @@ -404,7 +404,7 @@ BOOST_AUTO_TEST_CASE(Reset) { particleHypothesis); FreeVector freeParams = transformBoundToFreeParameters( cp.referenceSurface(), geoCtx, cp.parameters()); - Direction navDir = Direction::Forward; + Direction navDir = Direction::Forward(); double stepSize = -256.; auto copyState = [&](auto& field, const auto& other) { diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index a96df18fa52..a6cfaa117d8 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -86,7 +86,7 @@ struct PropState { stepper_state_t stepping; /// Propagator options which only carry the relevant components struct { - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); struct { double stepTolerance = 1e-4; double stepSizeCutOff = 0.; @@ -226,7 +226,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_state_test) { /// The numerical correctness of the stepper is tested in the integration tests BOOST_AUTO_TEST_CASE(eigen_stepper_test) { // Set up some variables for the state - Direction navDir = Direction::Backward; + Direction navDir = Direction::Backward(); double stepSize = 123.; auto bField = std::make_shared(Vector3(1., 2.5, 33.33)); auto bCache = bField->makeCache(mfContext); @@ -338,7 +338,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { ParticleHypothesis::pion()); FreeVector freeParams = transformBoundToFreeParameters( cp2.referenceSurface(), tgContext, cp2.parameters()); - navDir = Direction::Forward; + navDir = Direction::Forward(); double stepSize2 = -2. * stepSize; auto copyState = [&](auto& field, const auto& state) { diff --git a/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp b/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp index ecb3fab014b..a7a3503d006 100644 --- a/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp @@ -95,7 +95,7 @@ struct Options { double pathLimit = std::numeric_limits::max(); bool loopProtection = true; double loopFraction = 0.5; - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); bool debug = false; std::string debugString; diff --git a/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp b/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp index e7f8f70080c..4d25392f9e1 100644 --- a/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp @@ -135,7 +135,7 @@ void runTest(const propagator_t& prop, Options bwdOptions(tgContext, mfContext); bwdOptions.stepping.maxStepSize = 25_cm; bwdOptions.pathLimit = -25_cm; - bwdOptions.direction = Direction::Backward; + bwdOptions.direction = Direction::Backward(); // get the material collector and configure it auto& bwdMaterialInteractor = @@ -266,7 +266,7 @@ void runTest(const propagator_t& prop, Options bwdStepOptions(tgContext, mfContext); bwdStepOptions.stepping.maxStepSize = 25_cm; bwdStepOptions.pathLimit = -25_cm; - bwdStepOptions.direction = Direction::Backward; + bwdStepOptions.direction = Direction::Backward(); // get the material collector and configure it auto& bwdStepMaterialInteractor = diff --git a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp index f8d46e84d42..b748d62bd9c 100644 --- a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp @@ -67,7 +67,7 @@ using MultiStepperLoop = MultiEigenStepperLoop; using SingleStepper = EigenStepper; const double defaultStepSize = 123.; -const auto defaultNDir = Direction::Backward; +const auto defaultNDir = Direction::Backward(); const auto defaultBField = std::make_shared(Vector3(1., 2.5, 33.33)); @@ -507,7 +507,7 @@ void test_multi_stepper_surface_status_update() { // Update surface status and check { auto status = multi_stepper.updateSurfaceStatus( - multi_state, *right_surface, 0, Direction::Forward, + multi_state, *right_surface, 0, Direction::Forward(), BoundaryTolerance::Infinite(), s_onSurfaceTolerance, ConstrainedStep::navigator); @@ -526,18 +526,18 @@ void test_multi_stepper_surface_status_update() { // Step forward now { - auto multi_prop_state = DummyPropState(Direction::Forward, multi_state); + auto multi_prop_state = DummyPropState(Direction::Forward(), multi_state); multi_stepper.step(multi_prop_state, mockNavigator); // Single stepper - auto single_prop_state = DummyPropState(Direction::Forward, single_state); + auto single_prop_state = DummyPropState(Direction::Forward(), single_state); single_stepper.step(single_prop_state, mockNavigator); } // Update surface status and check again { auto status = multi_stepper.updateSurfaceStatus( - multi_state, *right_surface, 0, Direction::Forward, + multi_state, *right_surface, 0, Direction::Forward(), BoundaryTolerance::Infinite(), s_onSurfaceTolerance, ConstrainedStep::navigator); @@ -554,7 +554,7 @@ void test_multi_stepper_surface_status_update() { // Start surface should be reachable { auto status = multi_stepper.updateSurfaceStatus( - multi_state, *start_surface, 0, Direction::Forward, + multi_state, *start_surface, 0, Direction::Forward(), BoundaryTolerance::Infinite(), s_onSurfaceTolerance, ConstrainedStep::navigator); @@ -624,18 +624,18 @@ void test_component_bound_state() { // Step forward now { multi_stepper.updateSurfaceStatus( - multi_state, *right_surface, 0, Direction::Forward, + multi_state, *right_surface, 0, Direction::Forward(), BoundaryTolerance::Infinite(), s_onSurfaceTolerance, ConstrainedStep::navigator); - auto multi_prop_state = DummyPropState(Direction::Forward, multi_state); + 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, + single_state, *right_surface, 0, Direction::Forward(), BoundaryTolerance::Infinite(), s_onSurfaceTolerance, ConstrainedStep::navigator); - auto single_prop_state = DummyPropState(Direction::Forward, single_state); + auto single_prop_state = DummyPropState(Direction::Forward(), single_state); single_stepper.step(single_prop_state, mockNavigator); } diff --git a/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp b/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp index c6f9e8e6853..690311b2ca2 100644 --- a/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/NavigatorTests.cpp @@ -230,7 +230,7 @@ struct PropagatorState { /// emulate the options template struct Options { - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); const Acts::Logger& logger = Acts::getDummyLogger(); diff --git a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp index ae61bce99ea..3b8990341f4 100644 --- a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp @@ -50,7 +50,7 @@ struct PropState { StraightLineStepper::State stepping; /// Propagator options which only carry the particle's mass struct { - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); } options; }; @@ -119,7 +119,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { // Set up some variables for the state GeometryContext tgContext = GeometryContext(); MagneticFieldContext mfContext = MagneticFieldContext(); - Direction navDir = Direction::Backward; + Direction navDir = Direction::Backward(); double stepSize = 123.; // Construct the parameters @@ -234,7 +234,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { BOOST_CHECK(cp2.covariance().has_value()); FreeVector freeParams = transformBoundToFreeParameters( cp2.referenceSurface(), tgContext, cp2.parameters()); - navDir = Direction::Forward; + navDir = Direction::Forward(); double stepSize2 = -2. * stepSize; // Reset all possible parameters diff --git a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp index 207504cf453..c953cdb3f87 100644 --- a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp @@ -65,7 +65,7 @@ struct PropState { stepper_state_t stepping; /// Propagator options which only carry the relevant components struct { - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); struct { double stepTolerance = 1e-4; double stepSizeCutOff = 0.; @@ -200,7 +200,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_state_test) { /// The numerical correctness of the stepper is tested in the integration tests BOOST_AUTO_TEST_CASE(sympy_stepper_test) { // Set up some variables for the state - Direction navDir = Direction::Backward; + Direction navDir = Direction::Backward(); double stepSize = 123.; auto bField = std::make_shared(Vector3(1., 2.5, 33.33)); auto bCache = bField->makeCache(mfContext); @@ -312,7 +312,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { ParticleHypothesis::pion()); FreeVector freeParams = transformBoundToFreeParameters( cp2.referenceSurface(), tgContext, cp2.parameters()); - navDir = Direction::Forward; + navDir = Direction::Forward(); double stepSize2 = -2. * stepSize; auto copyState = [&](auto& field, const auto& state) { diff --git a/Tests/UnitTests/Core/Propagator/VolumeMaterialInteractionTests.cpp b/Tests/UnitTests/Core/Propagator/VolumeMaterialInteractionTests.cpp index 5bc361fc0a0..c97f8e4876d 100644 --- a/Tests/UnitTests/Core/Propagator/VolumeMaterialInteractionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/VolumeMaterialInteractionTests.cpp @@ -44,7 +44,7 @@ struct NaivgatorState { /// @brief Simplified propagator state struct State { struct { - Direction direction = Direction::Forward; + Direction direction = Direction::Forward(); } options; StepperState stepping; @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(volume_material_interaction_test) { state.stepping.q = 9.; state.stepping.absCharge = std::abs(state.stepping.q); state.stepping.covTransport = true; - state.options.direction = Direction::Backward; + state.options.direction = Direction::Backward(); state.navigation.currentVolume = volume.get(); Stepper stepper; diff --git a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp index b1e4e3d9a93..e9577bc8fa6 100644 --- a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp @@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE(LineSurfaceIntersection) { ParticleHypothesis::pion()}; { PropagatorOptions options(tgContext, {}); - options.direction = Acts::Direction::Backward; + options.direction = Acts::Direction::Backward(); options.pathLimit = pathLimit; auto result = propagator.propagate(initialParams, options); @@ -343,7 +343,7 @@ BOOST_AUTO_TEST_CASE(LineSurfaceIntersection) { std::nullopt, ParticleHypothesis::pion()}; { PropagatorOptions options(tgContext, {}); - options.direction = Acts::Direction::Forward; + options.direction = Acts::Direction::Forward(); options.stepping.maxStepSize = 1_mm; auto result = propagator.propagate(displacedParameters, *surface, options); diff --git a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp index 6cb9559691c..89698a0bd38 100644 --- a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp +++ b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp @@ -304,7 +304,7 @@ BOOST_AUTO_TEST_CASE(ZeroFieldForward) { auto options = f.makeCkfOptions(); // this is the default option. set anyway for consistency - options.propagatorPlainOptions.direction = Acts::Direction::Forward; + options.propagatorPlainOptions.direction = Acts::Direction::Forward(); // Construct a plane surface as the target surface auto pSurface = Acts::CurvilinearSurface(Acts::Vector3{-3_m, 0., 0.}, Acts::Vector3{1., 0., 0}) @@ -362,7 +362,7 @@ BOOST_AUTO_TEST_CASE(ZeroFieldBackward) { Fixture f(0_T); auto options = f.makeCkfOptions(); - options.propagatorPlainOptions.direction = Acts::Direction::Backward; + options.propagatorPlainOptions.direction = Acts::Direction::Backward(); // Construct a plane surface as the target surface auto pSurface = Acts::CurvilinearSurface(Acts::Vector3{3_m, 0., 0.}, Acts::Vector3{1., 0., 0}) diff --git a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp index dca8ac045ca..757e6f5da81 100644 --- a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp +++ b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp @@ -236,7 +236,7 @@ struct FitterTester { // backward filtering requires a reference surface options.referenceSurface = &start.referenceSurface(); // this is the default option. set anyway for consistency - options.propagatorPlainOptions.direction = Acts::Direction::Forward; + options.propagatorPlainOptions.direction = Acts::Direction::Forward(); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -295,7 +295,7 @@ struct FitterTester { Acts::ParticleHypothesis::pion()); options.referenceSurface = &startOuter.referenceSurface(); - options.propagatorPlainOptions.direction = Acts::Direction::Backward; + options.propagatorPlainOptions.direction = Acts::Direction::Backward(); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; diff --git a/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp b/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp index c52b72f2b60..ecdb602a4e2 100644 --- a/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp +++ b/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp @@ -77,9 +77,9 @@ BOOST_AUTO_TEST_CASE(PortalSingleConnected) { BOOST_CHECK_NE(portal, nullptr); // Attaching the portals Acts::Experimental::detail::PortalHelper::attachExternalNavigationDelegate( - *portal, forwardVolume, Acts::Direction::Forward); + *portal, forwardVolume, Acts::Direction::Forward()); Acts::Experimental::detail::PortalHelper::attachExternalNavigationDelegate( - *portal, backwardVolume, Acts::Direction::Backward); + *portal, backwardVolume, Acts::Direction::Backward()); std::vector detectorVolumes = { forwardVolume.get(), backwardVolume.get()}; @@ -125,11 +125,11 @@ BOOST_AUTO_TEST_CASE(PortalMultiConnected) { // Attaching the portals Acts::Experimental::detail::PortalHelper::attachExternalNavigationDelegate( - *portal, backwardVolume, Acts::Direction::Backward); + *portal, backwardVolume, Acts::Direction::Backward()); Acts::Experimental::detail::PortalHelper::attachDetectorVolumesUpdater( tContext, *portal, {forwardVolumeA, forwardVolumeB, forwardVolumeC}, - Acts::Direction::Forward, {-100, 10, 20, 200}, + Acts::Direction::Forward(), {-100, 10, 20, 200}, Acts::AxisDirection::AxisX); std::vector detectorVolumes = {