diff --git a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp index dd3496910f7..749435066de 100644 --- a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp +++ b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp @@ -262,7 +262,7 @@ class MultiComponentCurvilinearTrackParameters avgDir += w * dir; } - auto s = Surface::makeShared(avgPos, avgDir); + auto s = CurvilinearSurface(avgPos, avgDir).planeSurface(); std::vector> bound; bound.reserve(curvi.size()); diff --git a/Core/include/Acts/Geometry/CylinderVolumeStack.hpp b/Core/include/Acts/Geometry/CylinderVolumeStack.hpp index 4c83b6c0678..1f1eb748947 100644 --- a/Core/include/Acts/Geometry/CylinderVolumeStack.hpp +++ b/Core/include/Acts/Geometry/CylinderVolumeStack.hpp @@ -87,7 +87,7 @@ class CylinderVolumeStack : public Volume { /// @param transform is the new transform /// @pre The volume bounds need to be of type /// @c CylinderVolumeBounds. - void update(std::shared_ptr volbounds, + void update(std::shared_ptr volbounds, std::optional transform = std::nullopt) override; /// Update the volume bounds and transform. This @@ -100,7 +100,7 @@ class CylinderVolumeStack : public Volume { /// @param logger is the logger /// @pre The volume bounds need to be of type /// @c CylinderVolumeBounds. - void update(std::shared_ptr newBounds, + void update(std::shared_ptr newBounds, std::optional transform, const Logger& logger); /// Access the gap volume that were created during attachment or resizing. diff --git a/Core/include/Acts/Geometry/TrackingVolume.hpp b/Core/include/Acts/Geometry/TrackingVolume.hpp index 9cea4b8653c..a343f40bf2d 100644 --- a/Core/include/Acts/Geometry/TrackingVolume.hpp +++ b/Core/include/Acts/Geometry/TrackingVolume.hpp @@ -125,7 +125,7 @@ class TrackingVolume : public Volume { /// @param volbounds is the description of the volume boundaries /// @param volumeName is a string identifier TrackingVolume(const Transform3& transform, - std::shared_ptr volbounds, + std::shared_ptr volbounds, const std::string& volumeName = "undefined"); /// Constructor for a full equipped Tracking Volume @@ -140,8 +140,7 @@ class TrackingVolume : public Volume { /// @param denseVolumeVector The contained dense volumes /// @param volumeName is a string identifier TrackingVolume( - const Transform3& transform, - std::shared_ptr volumeBounds, + const Transform3& transform, std::shared_ptr volumeBounds, std::shared_ptr volumeMaterial, std::unique_ptr staticLayerArray = nullptr, std::shared_ptr containedVolumeArray = nullptr, @@ -151,8 +150,7 @@ class TrackingVolume : public Volume { /// Constructor from a regular volume /// @param volume is the volume to be converted /// @param volumeName is a string identifier - TrackingVolume(const Volume& volume, - const std::string& volumeName = "undefined"); + TrackingVolume(Volume& volume, const std::string& volumeName = "undefined"); // @TODO: This needs to be refactored to include Gen3 volumes /// Return the associated sub Volume, returns THIS if no subVolume exists diff --git a/Core/include/Acts/Geometry/Volume.hpp b/Core/include/Acts/Geometry/Volume.hpp index 3df0b339fd9..65e3e8b9219 100644 --- a/Core/include/Acts/Geometry/Volume.hpp +++ b/Core/include/Acts/Geometry/Volume.hpp @@ -37,8 +37,7 @@ class Volume : public GeometryObject { /// /// @param transform is the transform to position the volume in 3D space /// @param volbounds is the volume boundary definitions - Volume(const Transform3& transform, - std::shared_ptr volbounds); + Volume(const Transform3& transform, std::shared_ptr volbounds); /// Copy Constructor - with optional shift /// @@ -65,20 +64,26 @@ class Volume : public GeometryObject { /// returns the center of the volume const Vector3& center() const; - /// Returns const reference to the volume bounds + /// Returns a const reference to the volume bounds const VolumeBounds& volumeBounds() const; + /// Returns a mutable reference to the volume bounds + VolumeBounds& volumeBounds(); + /// Returns shared pointer to the volume bounds std::shared_ptr volumeBoundsPtr() const; + /// Returns shared pointer to the volume bounds + std::shared_ptr volumeBoundsPtr(); + /// Set volume bounds and update volume bounding boxes implicitly /// @param volbounds The volume bounds to be assigned - void assignVolumeBounds(std::shared_ptr volbounds); + void assignVolumeBounds(std::shared_ptr volbounds); /// Set the volume bounds and optionally also update the volume transform /// @param volbounds The volume bounds to be assigned /// @param transform The transform to be assigned, can be optional - virtual void update(std::shared_ptr volbounds, + virtual void update(std::shared_ptr volbounds, std::optional transform = std::nullopt); /// Construct bounding box for this shape @@ -117,7 +122,9 @@ class Volume : public GeometryObject { Transform3 m_transform; Transform3 m_itransform; Vector3 m_center; - std::shared_ptr m_volumeBounds; + + private: + std::shared_ptr m_volumeBounds; }; /**Overload of << operator for std::ostream for debug output*/ diff --git a/Core/include/Acts/Material/ISurfaceMaterial.hpp b/Core/include/Acts/Material/ISurfaceMaterial.hpp index d76254f2224..34d3d25c938 100644 --- a/Core/include/Acts/Material/ISurfaceMaterial.hpp +++ b/Core/include/Acts/Material/ISurfaceMaterial.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -139,7 +139,7 @@ inline MaterialSlab ISurfaceMaterial::materialSlab( // The plain material properties associated to this bin MaterialSlab plainMatProp = materialSlab(lp); // Scale if you have material to scale - if (plainMatProp) { + if (plainMatProp.isValid()) { double scaleFactor = factor(pDir, mStage); if (scaleFactor == 0.) { return MaterialSlab(); @@ -154,7 +154,7 @@ inline MaterialSlab ISurfaceMaterial::materialSlab( // The plain material properties associated to this bin MaterialSlab plainMatProp = materialSlab(gp); // Scale if you have material to scale - if (plainMatProp) { + if (plainMatProp.isValid()) { double scaleFactor = factor(pDir, mStage); if (scaleFactor == 0.) { return MaterialSlab(); diff --git a/Core/include/Acts/Material/Material.hpp b/Core/include/Acts/Material/Material.hpp index bccea094a90..2984a26a18d 100644 --- a/Core/include/Acts/Material/Material.hpp +++ b/Core/include/Acts/Material/Material.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -74,7 +74,7 @@ class Material { /// Construct a vacuum representation. Material() = default; /// Construct from an encoded parameters vector. - Material(const ParametersVector& parameters); + explicit Material(const ParametersVector& parameters); Material(Material&& mat) = default; Material(const Material& mat) = default; @@ -83,9 +83,9 @@ class Material { Material& operator=(const Material& mat) = default; /// Check if the material is valid, i.e. it is not vacuum. - constexpr operator bool() const { return 0.0f < m_ar; } + bool isValid() const { return 0.0f < m_ar; } - /// Return the radition length. Infinity in case of vacuum. + /// Return the radiation length. Infinity in case of vacuum. constexpr float X0() const { return m_x0; } /// Return the nuclear interaction length. Infinity in case of vacuum. constexpr float L0() const { return m_l0; } diff --git a/Core/include/Acts/Material/MaterialSlab.hpp b/Core/include/Acts/Material/MaterialSlab.hpp index cfa531a9ff4..1942498daba 100644 --- a/Core/include/Acts/Material/MaterialSlab.hpp +++ b/Core/include/Acts/Material/MaterialSlab.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2020 CERN for the benefit of the Acts project +// Copyright (C) 2016-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -45,7 +45,7 @@ class MaterialSlab { /// Construct vacuum without thickness. MaterialSlab() = default; /// Construct vacuum with thickness. - MaterialSlab(float thickness); + explicit MaterialSlab(float thickness); /// Construct from material description. /// /// @param material is the material description @@ -62,7 +62,7 @@ class MaterialSlab { void scaleThickness(float scale); /// Check if the material is valid, i.e. it is finite and not vacuum. - constexpr operator bool() const { return m_material && (0.0f < m_thickness); } + bool isValid() const { return m_material.isValid() && (0.0f < m_thickness); } /// Access the (average) material parameters. constexpr const Material& material() const { return m_material; } diff --git a/Core/include/Acts/Propagator/EigenStepper.hpp b/Core/include/Acts/Propagator/EigenStepper.hpp index f1c9f2995eb..52126c46fba 100644 --- a/Core/include/Acts/Propagator/EigenStepper.hpp +++ b/Core/include/Acts/Propagator/EigenStepper.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2022 CERN for the benefit of the Acts project +// Copyright (C) 2016-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -15,20 +15,18 @@ #include "Acts/Definitions/Tolerance.hpp" #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/TrackParameters.hpp" +#include "Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp" +#include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/MagneticField/MagneticFieldProvider.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" -#include "Acts/Propagator/DefaultExtension.hpp" -#include "Acts/Propagator/DenseEnvironmentExtension.hpp" -#include "Acts/Propagator/EigenStepperError.hpp" +#include "Acts/Propagator/EigenStepperDefaultExtension.hpp" #include "Acts/Propagator/PropagatorTraits.hpp" -#include "Acts/Propagator/StepperExtensionList.hpp" #include "Acts/Propagator/StepperOptions.hpp" -#include "Acts/Propagator/detail/Auctioneer.hpp" #include "Acts/Propagator/detail/SteppingHelper.hpp" #include "Acts/Utilities/Intersection.hpp" #include "Acts/Utilities/Result.hpp" -#include #include #include #include @@ -47,8 +45,7 @@ namespace Acts { /// with s being the arc length of the track, q the charge of the particle, /// p the momentum magnitude and B the magnetic field /// -template , - typename auctioneer_t = detail::VoidAuctioneer> +template class EigenStepper { public: /// Jacobian, Covariance and State definitions @@ -155,11 +152,8 @@ class EigenStepper { /// The geometry context std::reference_wrapper geoContext; - /// List of algorithmic extensions - extensionlist_t extension; - - /// Auctioneer for choosing the extension - auctioneer_t auctioneer; + /// Algorithmic extension + extension_t extension; /// @brief Storage of magnetic field and the sub steps during a RKN4 step struct { diff --git a/Core/include/Acts/Propagator/EigenStepper.ipp b/Core/include/Acts/Propagator/EigenStepper.ipp index eb693a9148a..71aa342ed12 100644 --- a/Core/include/Acts/Propagator/EigenStepper.ipp +++ b/Core/include/Acts/Propagator/EigenStepper.ipp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019-2022 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -8,30 +8,31 @@ #include "Acts/EventData/TransformationHelpers.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" +#include "Acts/Propagator/EigenStepperError.hpp" #include "Acts/Propagator/detail/CovarianceEngine.hpp" #include "Acts/Utilities/QuickMath.hpp" #include -template -Acts::EigenStepper::EigenStepper( +template +Acts::EigenStepper::EigenStepper( std::shared_ptr bField) : m_bField(std::move(bField)) {} -template -auto Acts::EigenStepper::makeState( +template +auto Acts::EigenStepper::makeState( std::reference_wrapper gctx, std::reference_wrapper mctx, const BoundTrackParameters& par, double ssize) const -> State { return State{gctx, m_bField->makeCache(mctx), par, ssize}; } -template -void Acts::EigenStepper::resetState(State& state, - const BoundVector& boundParams, - const BoundSquareMatrix& cov, - const Surface& surface, - const double stepSize) const { +template +void Acts::EigenStepper::resetState(State& state, + const BoundVector& boundParams, + const BoundSquareMatrix& cov, + const Surface& surface, + const double stepSize) const { FreeVector freeParams = transformBoundToFreeParameters(surface, state.geoContext, boundParams); @@ -50,8 +51,8 @@ void Acts::EigenStepper::resetState(State& state, state.derivative = FreeVector::Zero(); } -template -auto Acts::EigenStepper::boundState( +template +auto Acts::EigenStepper::boundState( State& state, const Surface& surface, bool transportCov, const FreeToBoundCorrection& freeToBoundCorrection) const -> Result { @@ -62,36 +63,32 @@ auto Acts::EigenStepper::boundState( freeToBoundCorrection); } -template +template template -bool Acts::EigenStepper::prepareCurvilinearState( +bool Acts::EigenStepper::prepareCurvilinearState( propagator_state_t& prop_state, const navigator_t& navigator) const { // test whether the accumulated path has still its initial value. if (prop_state.stepping.pathAccumulated == 0.) { // if no step was executed the path length derivates have not been // computed but are needed to compute the curvilinear covariance. The // derivates are given by k1 for a zero step width. - if (prop_state.stepping.extension.validExtensionForStep(prop_state, *this, - navigator)) { - // First Runge-Kutta point (at current position) - auto& sd = prop_state.stepping.stepData; - auto pos = position(prop_state.stepping); - auto fieldRes = getField(prop_state.stepping, pos); - if (fieldRes.ok()) { - sd.B_first = *fieldRes; - if (prop_state.stepping.extension.k1(prop_state, *this, navigator, - sd.k1, sd.B_first, sd.kQoP)) { - // dr/ds : - prop_state.stepping.derivative.template head<3>() = - prop_state.stepping.pars.template segment<3>(eFreeDir0); - // d (dr/ds) / ds : - prop_state.stepping.derivative.template segment<3>(4) = sd.k1; - // to set dt/ds : - prop_state.stepping.extension.finalize( - prop_state, *this, navigator, - prop_state.stepping.pathAccumulated); - return true; - } + // First Runge-Kutta point (at current position) + auto& sd = prop_state.stepping.stepData; + auto pos = position(prop_state.stepping); + auto fieldRes = getField(prop_state.stepping, pos); + if (fieldRes.ok()) { + sd.B_first = *fieldRes; + if (prop_state.stepping.extension.template k<0>( + prop_state, *this, navigator, sd.k1, sd.B_first, sd.kQoP)) { + // dr/ds : + prop_state.stepping.derivative.template head<3>() = + prop_state.stepping.pars.template segment<3>(eFreeDir0); + // d (dr/ds) / ds : + prop_state.stepping.derivative.template segment<3>(4) = sd.k1; + // to set dt/ds : + prop_state.stepping.extension.finalize( + prop_state, *this, navigator, prop_state.stepping.pathAccumulated); + return true; } } return false; @@ -99,8 +96,8 @@ bool Acts::EigenStepper::prepareCurvilinearState( return true; } -template -auto Acts::EigenStepper::curvilinearState( +template +auto Acts::EigenStepper::curvilinearState( State& state, bool transportCov) const -> CurvilinearState { return detail::curvilinearState( state.cov, state.jacobian, state.jacTransport, state.derivative, @@ -108,12 +105,11 @@ auto Acts::EigenStepper::curvilinearState( state.covTransport && transportCov, state.pathAccumulated); } -template -void Acts::EigenStepper::update(State& state, - const FreeVector& freeParams, - const BoundVector& /*boundParams*/, - const Covariance& covariance, - const Surface& surface) const { +template +void Acts::EigenStepper::update(State& state, const FreeVector& freeParams, + const BoundVector& /*boundParams*/, + const Covariance& covariance, + const Surface& surface) const { state.pars = freeParams; state.cov = covariance; state.jacToGlobal = surface.boundToFreeJacobian( @@ -121,26 +117,26 @@ void Acts::EigenStepper::update(State& state, freeParams.template segment<3>(eFreeDir0)); } -template -void Acts::EigenStepper::update(State& state, const Vector3& uposition, - const Vector3& udirection, double qOverP, - double time) const { +template +void Acts::EigenStepper::update(State& state, const Vector3& uposition, + const Vector3& udirection, double qOverP, + double time) const { state.pars.template segment<3>(eFreePos0) = uposition; state.pars.template segment<3>(eFreeDir0) = udirection; state.pars[eFreeTime] = time; state.pars[eFreeQOverP] = qOverP; } -template -void Acts::EigenStepper::transportCovarianceToCurvilinear( +template +void Acts::EigenStepper::transportCovarianceToCurvilinear( State& state) const { detail::transportCovarianceToCurvilinear(state.cov, state.jacobian, state.jacTransport, state.derivative, state.jacToGlobal, direction(state)); } -template -void Acts::EigenStepper::transportCovarianceToBound( +template +void Acts::EigenStepper::transportCovarianceToBound( State& state, const Surface& surface, const FreeToBoundCorrection& freeToBoundCorrection) const { detail::transportCovarianceToBound(state.geoContext.get(), surface, state.cov, @@ -149,9 +145,9 @@ void Acts::EigenStepper::transportCovarianceToBound( state.pars, freeToBoundCorrection); } -template +template template -Acts::Result Acts::EigenStepper::step( +Acts::Result Acts::EigenStepper::step( propagator_state_t& state, const navigator_t& navigator) const { // Runge-Kutta integrator state auto& sd = state.stepping.stepData; @@ -169,10 +165,8 @@ Acts::Result Acts::EigenStepper::step( return fieldRes.error(); } sd.B_first = *fieldRes; - if (!state.stepping.extension.validExtensionForStep(state, *this, - navigator) || - !state.stepping.extension.k1(state, *this, navigator, sd.k1, sd.B_first, - sd.kQoP)) { + if (!state.stepping.extension.template k<0>(state, *this, navigator, sd.k1, + sd.B_first, sd.kQoP)) { return 0.; } @@ -230,14 +224,16 @@ Acts::Result Acts::EigenStepper::step( } sd.B_middle = *field; - if (!state.stepping.extension.k2(state, *this, navigator, sd.k2, - sd.B_middle, sd.kQoP, half_h, sd.k1)) { + if (!state.stepping.extension.template k<1>(state, *this, navigator, sd.k2, + sd.B_middle, sd.kQoP, half_h, + sd.k1)) { return success(false); } // Third Runge-Kutta point - if (!state.stepping.extension.k3(state, *this, navigator, sd.k3, - sd.B_middle, sd.kQoP, half_h, sd.k2)) { + if (!state.stepping.extension.template k<2>(state, *this, navigator, sd.k3, + sd.B_middle, sd.kQoP, half_h, + sd.k2)) { return success(false); } @@ -248,8 +244,8 @@ Acts::Result Acts::EigenStepper::step( return failure(field.error()); } sd.B_last = *field; - if (!state.stepping.extension.k4(state, *this, navigator, sd.k4, sd.B_last, - sd.kQoP, h, sd.k3)) { + if (!state.stepping.extension.template k<3>(state, *this, navigator, sd.k4, + sd.B_last, sd.kQoP, h, sd.k3)) { return success(false); } @@ -373,7 +369,7 @@ Acts::Result Acts::EigenStepper::step( return h; } -template -void Acts::EigenStepper::setIdentityJacobian(State& state) const { +template +void Acts::EigenStepper::setIdentityJacobian(State& state) const { state.jacobian = BoundMatrix::Identity(); } diff --git a/Core/include/Acts/Propagator/DefaultExtension.hpp b/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp similarity index 91% rename from Core/include/Acts/Propagator/DefaultExtension.hpp rename to Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp index 1ae901f42eb..cf6cadbbb41 100644 --- a/Core/include/Acts/Propagator/DefaultExtension.hpp +++ b/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2018-2023 CERN for the benefit of the Acts project +// Copyright (C) 2018-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -18,28 +18,15 @@ namespace Acts { /// @brief Default evaluater of the k_i's and elements of the transport matrix /// D of the RKN4 stepping. This is a pure implementation by textbook. -struct DefaultExtension { +struct EigenStepperDefaultExtension { using Scalar = ActsScalar; /// @brief Vector3 replacement for the custom scalar type using ThisVector3 = Eigen::Matrix; - /// @brief Control function if the step evaluation would be valid - /// - /// @tparam propagator_state_t Type of the state of the propagator - /// @tparam stepper_t Type of the stepper - /// @tparam navigator_t Type of the navigator - /// - /// @return Boolean flag if the step would be valid - template - int bid(const propagator_state_t& /*state*/, const stepper_t& /*stepper*/, - const navigator_t& /*navigator*/) const { - return 1; - } - /// @brief Evaluater of the k_i's of the RKN4. For the case of i = 0 this /// step sets up qop, too. /// + /// @tparam i Index of the k_i, i = [0, 3] /// @tparam propagator_state_t Type of the state of the propagator /// @tparam stepper_t Type of the stepper /// @tparam navigator_t Type of the navigator @@ -49,20 +36,21 @@ struct DefaultExtension { /// @param [out] knew Next k_i that is evaluated /// @param [in] bField B-Field at the evaluation position /// @param [out] kQoP k_i elements of the momenta - /// @param [in] i Index of the k_i, i = [0, 3] /// @param [in] h Step size (= 0. ^ 0.5 * StepSize ^ StepSize) /// @param [in] kprev Evaluated k_{i - 1} /// /// @return Boolean flag if the calculation is valid - template bool k(const propagator_state_t& state, const stepper_t& stepper, const navigator_t& /*navigator*/, ThisVector3& knew, - const Vector3& bField, std::array& kQoP, const int i = 0, - const double h = 0., const ThisVector3& kprev = ThisVector3::Zero()) { + const Vector3& bField, std::array& kQoP, + const double h = 0., const ThisVector3& kprev = ThisVector3::Zero()) + requires(i >= 0 && i <= 3) + { auto qop = stepper.qOverP(state.stepping); // First step does not rely on previous data - if (i == 0) { + if constexpr (i == 0) { knew = qop * stepper.direction(state.stepping).cross(bField); kQoP = {0., 0., 0., 0.}; } else { diff --git a/Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp b/Core/include/Acts/Propagator/EigenStepperDenseEnvironmentExtension.hpp similarity index 89% rename from Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp rename to Core/include/Acts/Propagator/EigenStepperDenseEnvironmentExtension.hpp index eed51e1e847..befab8f96ce 100644 --- a/Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp +++ b/Core/include/Acts/Propagator/EigenStepperDenseEnvironmentExtension.hpp @@ -12,16 +12,11 @@ #include "Acts/Utilities/detail/ReferenceWrapperAnyCompat.hpp" #include "Acts/Definitions/Algebra.hpp" -#include "Acts/Definitions/PdgParticle.hpp" -#include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Material/Interactions.hpp" -#include "Acts/Propagator/AbortList.hpp" -#include "Acts/Propagator/ActionList.hpp" +#include "Acts/Material/Material.hpp" +#include "Acts/Material/MaterialSlab.hpp" +#include "Acts/Propagator/EigenStepperDefaultExtension.hpp" #include "Acts/Propagator/Propagator.hpp" -#include "Acts/Utilities/VectorHelpers.hpp" - -#include -#include namespace Acts { @@ -30,11 +25,14 @@ namespace Acts { /// ioninisation, bremsstrahlung, pair production and photonuclear interaction /// in the propagation and the jacobian. These effects will only occur if the /// propagation is in a TrackingVolume with attached material. -struct DenseEnvironmentExtension { +struct EigenStepperDenseEnvironmentExtension { using Scalar = ActsScalar; /// @brief Vector3 replacement for the custom scalar type using ThisVector3 = Eigen::Matrix; + /// Fallback extension + EigenStepperDefaultExtension defaultExtension; + /// Momentum at a certain point Scalar currentMomentum = 0.; /// Particles momentum at k1 @@ -59,44 +57,11 @@ struct DenseEnvironmentExtension { /// Energy at each sub-step std::array energy{}; - /// @brief Control function if the step evaluation would be valid - /// - /// @tparam propagator_state_t Type of the state of the propagator - /// @tparam stepper_t Type of the stepper - /// @tparam navigator_t Type of the navigator - /// - /// @param [in] state State of the propagator - /// @param [in] stepper Stepper of the propagator - /// @param [in] navigator Navigator of the propagator - /// - /// @return Boolean flag if the step would be valid - template - int bid(const propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator) const { - const auto& particleHypothesis = stepper.particleHypothesis(state.stepping); - float absQ = particleHypothesis.absoluteCharge(); - float mass = particleHypothesis.mass(); - - // Check for valid particle properties - if (absQ == 0. || mass == 0. || - stepper.absoluteMomentum(state.stepping) < - state.options.stepping.dense.momentumCutOff) { - return 0; - } - - // Check existence of a volume with material - if (!navigator.currentVolumeMaterial(state.navigation)) { - return 0; - } - - return 2; - } - /// @brief Evaluater of the k_i's of the RKN4. For the case of i = 0 this /// step sets up member parameters, too. /// - /// @tparam stepper_state_t Type of the state of the propagator + /// @tparam i Index of the k_i, i = [0, 3] + /// @tparam propagator_state_t Type of the state of the propagator /// @tparam stepper_t Type of the stepper /// @tparam navigator_t Type of the navigator /// @@ -106,30 +71,32 @@ struct DenseEnvironmentExtension { /// @param [out] knew Next k_i that is evaluated /// @param [out] kQoP k_i elements of the momenta /// @param [in] bField B-Field at the evaluation position - /// @param [in] i Index of the k_i, i = [0, 3] /// @param [in] h Step size (= 0. ^ 0.5 * StepSize ^ StepSize) /// @param [in] kprev Evaluated k_{i - 1} /// /// @return Boolean flag if the calculation is valid - template bool k(const propagator_state_t& state, const stepper_t& stepper, const navigator_t& navigator, ThisVector3& knew, const Vector3& bField, - std::array& kQoP, const int i = 0, const double h = 0., - const ThisVector3& kprev = ThisVector3::Zero()) { + std::array& kQoP, const double h = 0., + const ThisVector3& kprev = ThisVector3::Zero()) + requires(i >= 0 && i <= 3) + { + const auto* volumeMaterial = + navigator.currentVolumeMaterial(state.navigation); + if (volumeMaterial == nullptr) { + return defaultExtension.template k(state, stepper, navigator, knew, + bField, kQoP, h, kprev); + } + double q = stepper.charge(state.stepping); const auto& particleHypothesis = stepper.particleHypothesis(state.stepping); float mass = particleHypothesis.mass(); // i = 0 is used for setup and evaluation of k - if (i == 0) { - // Set up container for energy loss - const auto* volumeMaterial = - navigator.currentVolumeMaterial(state.navigation); - if (volumeMaterial == nullptr) { - // This function is very hot, so we prefer to terminate here - std::terminate(); - } + if constexpr (i == 0) { + // Set up for energy loss ThisVector3 position = stepper.position(state.stepping); material = volumeMaterial->material(position.template cast()); initialMomentum = stepper.absoluteMomentum(state.stepping); @@ -172,13 +139,20 @@ struct DenseEnvironmentExtension { /// /// @param [in] state State of the propagator /// @param [in] stepper Stepper of the propagator + /// @param [in] navigator Navigator of the propagator /// @param [in] h Step size /// /// @return Boolean flag if the calculation is valid template bool finalize(propagator_state_t& state, const stepper_t& stepper, - const navigator_t& /*navigator*/, const double h) const { + const navigator_t& navigator, const double h) const { + const auto* volumeMaterial = + navigator.currentVolumeMaterial(state.navigation); + if (volumeMaterial == nullptr) { + return defaultExtension.finalize(state, stepper, navigator, h); + } + const auto& particleHypothesis = stepper.particleHypothesis(state.stepping); float mass = particleHypothesis.mass(); @@ -231,6 +205,12 @@ struct DenseEnvironmentExtension { bool finalize(propagator_state_t& state, const stepper_t& stepper, const navigator_t& navigator, const double h, FreeMatrix& D) const { + const auto* volumeMaterial = + navigator.currentVolumeMaterial(state.navigation); + if (volumeMaterial == nullptr) { + return defaultExtension.finalize(state, stepper, navigator, h, D); + } + return finalize(state, stepper, navigator, h) && transportMatrix(state, stepper, h, D); } @@ -398,7 +378,7 @@ struct DenseEnvironmentExtension { energy[0] = std::hypot(initialMomentum, mass); // use unit length as thickness to compute the energy loss per unit length - Acts::MaterialSlab slab(material, 1); + MaterialSlab slab(material, 1); // Use the same energy loss throughout the step. if (state.options.stepping.dense.meanEnergyLoss) { g = -computeEnergyLossMean(slab, absPdg, mass, static_cast(qop[0]), diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index dce5c475bc8..357d6b7b4bb 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2021-2023 CERN for the benefit of the Acts project +// Copyright (C) 2021-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -22,6 +22,7 @@ #include "Acts/Propagator/ConstrainedStep.hpp" #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/EigenStepperError.hpp" +#include "Acts/Propagator/MultiStepperError.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StepperOptions.hpp" #include "Acts/Propagator/detail/LoopStepperUtils.hpp" @@ -40,8 +41,6 @@ #include -#include "MultiStepperError.hpp" - namespace Acts { using namespace Acts::UnitLiterals; @@ -235,17 +234,14 @@ using MaxWeightReducerLoop = /// * There are certain redundancies between the global State and the /// component states /// * The components do not share a single magnetic-field-cache -/// @tparam extensionlist_t See EigenStepper for details +/// @tparam extension_t See EigenStepper for details /// @tparam component_reducer_t How to map the multi-component state to a single /// component -/// @tparam auctioneer_t See EigenStepper for details /// @tparam small_vector_size A size-hint how much memory should be allocated /// by the small vector -template , - typename component_reducer_t = WeightedComponentReducerLoop, - typename auctioneer_t = detail::VoidAuctioneer> -class MultiEigenStepperLoop - : public EigenStepper { +template +class MultiEigenStepperLoop : public EigenStepper { /// Limits the number of steps after at least one component reached the /// surface std::size_t m_stepLimitAfterFirstComponentOnSurface = 50; @@ -260,7 +256,7 @@ class MultiEigenStepperLoop public: /// @brief Typedef to the Single-Component Eigen Stepper - using SingleStepper = EigenStepper; + using SingleStepper = EigenStepper; /// @brief Typedef to the State of the single component Stepper using SingleState = typename SingleStepper::State; @@ -366,15 +362,14 @@ class MultiEigenStepperLoop MultiEigenStepperLoop(std::shared_ptr bField, std::unique_ptr logger = getDefaultLogger("GSF", Logging::INFO)) - : EigenStepper(std::move(bField)), + : EigenStepper(std::move(bField)), m_logger(std::move(logger)) {} /// Constructor from a configuration and optionally provided Logger MultiEigenStepperLoop(const Config& config, std::unique_ptr logger = getDefaultLogger("GSF", Logging::INFO)) - : EigenStepper(config), - m_logger(std::move(logger)) {} + : EigenStepper(config), m_logger(std::move(logger)) {} /// Construct and initialize a state State makeState(std::reference_wrapper gctx, diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp index f743d059a2f..8f9d3216d6a 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2023 CERN for the benefit of the Acts project +// Copyright (C) 2023-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -11,8 +11,8 @@ namespace Acts { -template -auto MultiEigenStepperLoop::boundState( +template +auto MultiEigenStepperLoop::boundState( State& state, const Surface& surface, bool transportCov, const FreeToBoundCorrection& freeToBoundCorrection) const -> Result { @@ -62,8 +62,8 @@ auto MultiEigenStepperLoop::boundState( Jacobian::Zero(), accumulatedPathLength}; } -template -auto MultiEigenStepperLoop::curvilinearState( +template +auto MultiEigenStepperLoop::curvilinearState( State& state, bool transportCov) const -> CurvilinearState { assert(!state.components.empty()); @@ -89,9 +89,9 @@ auto MultiEigenStepperLoop::curvilinearState( Jacobian::Zero(), accumulatedPathLength}; } -template +template template -Result MultiEigenStepperLoop::step( +Result MultiEigenStepperLoop::step( propagator_state_t& state, const navigator_t& navigator) const { using Status = Acts::Intersection3D::Status; diff --git a/Core/include/Acts/Propagator/StepperExtensionList.hpp b/Core/include/Acts/Propagator/StepperExtensionList.hpp deleted file mode 100644 index 3454030dd5c..00000000000 --- a/Core/include/Acts/Propagator/StepperExtensionList.hpp +++ /dev/null @@ -1,232 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include "Acts/Definitions/Algebra.hpp" -#include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/Propagator/detail/Auctioneer.hpp" -#include "Acts/Utilities/detail/Extendable.hpp" -#include "Acts/Utilities/detail/MPL/all_of.hpp" -#include "Acts/Utilities/detail/MPL/has_duplicates.hpp" - -#include - -namespace Acts { - -/// @brief Container of extensions used in the stepper of the propagation. This -/// struct allows a broadcast of function calls for each element in the list. -/// The broadcasts occur for a certain function at each step in a specific -/// order. -/// The first function is an evaluater if an extension is or how many extensions -/// are applicable for an upcoming step. -/// The next functions called are the evaluations of the k_1 - k_4 or the RKN4 -/// integration. -/// The last function call in a step is the finalize() method. This method is an -/// overloaded function (optionally propagates the covariance). -/// Each method has the possibility to break the evaluation of a given step if -/// an extension reports that something went wrong (e.g. a particle lost too -/// much momentum during the step) -/// @tparam extensions Types of the extensions -template -struct StepperExtensionList : private detail::Extendable { - private: - // Checkout for duplicates in the extensions - static_assert(!detail::has_duplicates_v, - "same extension type specified several times"); - - static constexpr unsigned int nExtensions = sizeof...(extensions); - - static_assert(nExtensions != 0, "no extension type specified"); - - // Access to all extensions - using detail::Extendable::tuple; - - // Vector of valid extensions for a step - std::array validExtensions{}; - - public: - // Access to an extension - using detail::Extendable::get; - - /// @brief Evaluation function to set valid extensions for an upcoming - /// integration step - /// - /// @tparam propagator_state_t Type of the state of the propagator - /// @tparam stepper_t Type of the stepper - /// @tparam navigtor_t Type of the navigator - /// - /// @param [in] state State of the propagator - /// @param [in] stepper Stepper of the propagation - /// @param [in] navigator Navigator of the propagation - template - bool validExtensionForStep(const propagator_state_t& state, - const stepper_t& stepper, - const navigtor_t& navigator) { - const auto bids = std::apply( - [&](const auto&... ext) { - return std::array{ - ext.bid(state, stepper, navigator)...}; - }, - tuple()); - - validExtensions = state.stepping.auctioneer(std::move(bids)); - - return (std::find(validExtensions.begin(), validExtensions.end(), true) != - validExtensions.end()); - } - - /// @brief This functions broadcasts the call for evaluating a generic k. It - /// collects all arguments and extensions, test their validity for the - /// evaluation and passes them forward for evaluation and returns a boolean as - /// indicator if the evaluation is valid. - template - bool k(const propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, Vector3& knew, const Vector3& bField, - std::array& kQoP, const int i, const double h = 0., - const Vector3& kprev = Vector3::Zero()) { - // TODO replace with integer-templated lambda with C++20 - auto impl = [&, i, h](auto intType, auto& implRef) { - constexpr int N = decltype(intType)::value; - - if constexpr (N == 0) { - return true; - } else { - // If element is invalid: continue - if (!std::get(validExtensions)) { - return implRef(std::integral_constant{}, implRef); - } - // Continue as long as evaluations are 'true' - if (std::get(this->tuple()) - .template k(state, stepper, navigator, knew, bField, kQoP, i, h, - kprev)) { - return implRef(std::integral_constant{}, implRef); - } else { - // Break at false - return false; - } - } - }; - - return impl(std::integral_constant{}, impl); - } - - /// @brief This functions broadcasts the call for evaluating k1. It collects - /// all arguments and extensions, test their validity for the evaluation and - /// passes them forward for evaluation and returns a boolean as indicator if - /// the evaluation is valid. - template - bool k1(const propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, Vector3& knew, const Vector3& bField, - std::array& kQoP) { - return k(state, stepper, navigator, knew, bField, kQoP, 0); - } - - /// @brief This functions broadcasts the call for evaluating k2. It collects - /// all arguments and extensions and passes them forward for evaluation and - /// returns a boolean as indicator if the evaluation is valid. - template - bool k2(const propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, Vector3& knew, const Vector3& bField, - std::array& kQoP, const double h, const Vector3& kprev) { - return k(state, stepper, navigator, knew, bField, kQoP, 1, h, kprev); - } - - /// @brief This functions broadcasts the call for evaluating k3. It collects - /// all arguments and extensions and passes them forward for evaluation and - /// returns a boolean as indicator if the evaluation is valid. - template - bool k3(const propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, Vector3& knew, const Vector3& bField, - std::array& kQoP, const double h, const Vector3& kprev) { - return k(state, stepper, navigator, knew, bField, kQoP, 2, h, kprev); - } - - /// @brief This functions broadcasts the call for evaluating k4. It collects - /// all arguments and extensions and passes them forward for evaluation and - /// returns a boolean as indicator if the evaluation is valid. - template - bool k4(const propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, Vector3& knew, const Vector3& bField, - std::array& kQoP, const double h, const Vector3& kprev) { - return k(state, stepper, navigator, knew, bField, kQoP, 3, h, kprev); - } - - /// @brief This functions broadcasts the call of the method finalize(). It - /// collects all extensions and arguments and passes them forward for - /// evaluation and returns a boolean. - template - bool finalize(propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, const double h, FreeMatrix& D) { - // TODO replace with integer-templated lambda with C++20 - auto impl = [&, h](auto intType, auto& implRef) { - constexpr int N = decltype(intType)::value; - - if constexpr (N == 0) { - return true; - } else { - // If element is invalid: continue - if (!std::get(validExtensions)) { - return implRef(std::integral_constant{}, implRef); - } - // Continue as long as evaluations are 'true' - if (std::get(this->tuple()) - .finalize(state, stepper, navigator, h, D)) { - return implRef(std::integral_constant{}, implRef); - } else { - // Break at false - return false; - } - } - }; - - return impl(std::integral_constant{}, impl); - } - - /// @brief This functions broadcasts the call of the method finalize(). It - /// collects all extensions and arguments and passes them forward for - /// evaluation and returns a boolean. - template - bool finalize(propagator_state_t& state, const stepper_t& stepper, - const navigator_t& navigator, const double h) { - // TODO replace with integer-templated lambda with C++20 - auto impl = [&, h](auto intType, auto& implRef) { - constexpr int N = decltype(intType)::value; - - if constexpr (N == 0) { - return true; - } else { - // If element is invalid: continue - if (!std::get(validExtensions)) { - return implRef(std::integral_constant{}, implRef); - } - - // Continue as long as evaluations are 'true' - if (std::get(this->tuple()) - .finalize(state, stepper, navigator, h)) { - return implRef(std::integral_constant{}, implRef); - } else { - // Break at false - return false; - } - } - }; - - return impl(std::integral_constant{}, impl); - } -}; - -} // namespace Acts diff --git a/Core/include/Acts/Propagator/detail/Auctioneer.hpp b/Core/include/Acts/Propagator/detail/Auctioneer.hpp deleted file mode 100644 index e086526d327..00000000000 --- a/Core/include/Acts/Propagator/detail/Auctioneer.hpp +++ /dev/null @@ -1,108 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#include -#include - -namespace Acts::detail { -/// The StepperExtensionList allows to add an arbitrary number of step -/// evaluation algorithms for the RKN4 evaluation. These can be categorised in -/// two general types: -/// a) Step evaluation that should not be evaluated along with other -/// extensions, or at least would overwrite partial results. This means that -/// in the best case unnecessary/redundant calculation would be performed, in -/// the worst case the evaluation would go wrong. -/// b) The step evaluation remains untouched and only further calculations are -/// performed (like additional features or data gathering) that can be treated -/// as independent of the basic step evaluation in type a). These types can be -/// added but do not require special treatment in order to not ruin the step -/// evaluation. -/// The concept of the auctioneers aims in the first place to judge which -/// extension of category a) is the one to go. Although every extension can -/// judge if it is valid based on the data given from the state of stepper, -/// multiple extensions from type a) could fulfill their dependencies. Since -/// an extension does not know about other extensions, the decision for the -/// best extension for the step can only be estimated on a global scope. This -/// is the job of the auctioneers. -/// -/// TODO: An anticipation of an optimal concept of the input (and maybe also -/// the output) of the call operator of an auctioneer cannot be performed at -/// the current stage. At the current stage, a real bid-system would be pure -/// guessing. - -/// @brief Auctioneer that takes all extensions as valid that make a valid bid -struct VoidAuctioneer { - /// @brief Default constructor - VoidAuctioneer() = default; - - /// @brief Call operator that returns the list of valid candidates as valids - /// - /// @param [in] vCandidates Candidates that are treated as valid extensions - /// @return The to vCandidates identical list of valid extensions - template - std::array operator()(std::array vCandidates) const { - std::array valids{}; - - for (unsigned int i = 0; i < vCandidates.size(); i++) { - valids[i] = (vCandidates[i] > 0) ? true : false; - } - return valids; - } -}; - -/// @brief Auctioneer that states only the first one that makes a valid bid -struct FirstValidAuctioneer { - /// @brief Default constructor - FirstValidAuctioneer() = default; - - /// @brief Call operator that states the first valid extension as the only - /// valid extension - /// - /// @param [in] vCandidates Candidates for a valid extension - /// @return List with at most one valid extension - template - std::array operator()(std::array vCandidates) const { - std::array valids = {}; - - for (unsigned int i = 0; i < vCandidates.size(); i++) { - if (vCandidates[i] > 0) { - valids[i] = true; - return valids; - } - } - return valids; - } -}; - -/// @brief Auctioneer that makes only the highest bidding extension valid. If -/// multiple elements have the same int, the first one with this value is -/// picked. -struct HighestValidAuctioneer { - /// @brief Default constructor - HighestValidAuctioneer() = default; - - /// @brief Call operator that states the highest bidding extension as the - /// only - /// valid extension - /// - /// @param [in] vCandidates Candidates for a valid extension - /// @return List with at most one valid extension - template - std::array operator()(std::array vCandidates) const { - std::array valids = {}; - - auto highscore = std::max_element(vCandidates.begin(), vCandidates.end()); - valids.at(std::distance(vCandidates.begin(), highscore)) = true; - - return valids; - } -}; - -} // namespace Acts::detail diff --git a/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp b/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp index e3c32247b64..66624b4ca11 100644 --- a/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp +++ b/Core/include/Acts/Propagator/detail/PointwiseMaterialInteraction.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -50,7 +50,7 @@ struct PointwiseMaterialInteraction { const Direction navDir; /// The effective, passed material properties including the path correction. - MaterialSlab slab; + MaterialSlab slab = MaterialSlab(0.); /// The path correction factor due to non-zero incidence on the surface. double pathCorrection = 0.; /// Expected phi variance due to the interactions. @@ -89,6 +89,7 @@ struct PointwiseMaterialInteraction { navDir(state.options.direction) {} /// @brief This function evaluates the material properties to interact with + /// This updates the slab and then returns, if the resulting slab is valid /// /// @tparam propagator_state_t Type of the propagator state /// @tparam navigator_t Type of the navigator @@ -119,8 +120,8 @@ struct PointwiseMaterialInteraction { pathCorrection = surface->pathCorrection(state.geoContext, pos, dir); slab.scaleThickness(pathCorrection); - // Get the surface material & properties from them - return slab; + // Check if the evaluated material is valid + return slab.isValid(); } /// @brief This function evaluate the material effects diff --git a/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp b/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp index 8fd72f38aa8..e5a8efbd29f 100644 --- a/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp +++ b/Core/include/Acts/Propagator/detail/VolumeMaterialInteraction.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -119,7 +119,7 @@ struct VolumeMaterialInteraction { } else { slab = MaterialSlab(); } - return slab; + return slab.isValid(); } }; diff --git a/Core/include/Acts/Surfaces/PlaneSurface.hpp b/Core/include/Acts/Surfaces/PlaneSurface.hpp index bbfa1374362..da15e3bd794 100644 --- a/Core/include/Acts/Surfaces/PlaneSurface.hpp +++ b/Core/include/Acts/Surfaces/PlaneSurface.hpp @@ -58,15 +58,6 @@ class PlaneSurface : public RegularSurface { PlaneSurface(const GeometryContext& gctx, const PlaneSurface& other, const Transform3& transform); - /// @deprecated Use `CurvilinearSurface` instead - /// - /// Dedicated Constructor with normal vector - /// This is for curvilinear surfaces which are by definition boundless - /// - /// @param center is the center position of the surface - /// @param normal is thenormal vector of the plane surface - PlaneSurface(const Vector3& center, const Vector3& normal); - /// Constructor from DetectorElementBase : Element proxy /// /// @param pbounds are the provided planar bounds diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index 4a7920646cc..baa4cc2e2b1 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -1235,7 +1235,9 @@ class CombinatorialKalmanFilter { /// @param initialParameters The initial track parameters /// @param tfOptions CombinatorialKalmanFilterOptions steering the track /// finding - /// @param trackContainer Input track container to use + /// @param trackContainer Track container in which to store the results + /// @param rootBranch The track to be used as the root branch + /// /// @note The input measurements are given in the form of @c SourceLinks. /// It's @c calibrator_t's job to turn them into calibrated measurements /// used in the track finding. @@ -1247,7 +1249,8 @@ class CombinatorialKalmanFilter { auto findTracks(const start_parameters_t& initialParameters, const CombinatorialKalmanFilterOptions< source_link_iterator_t, track_container_t>& tfOptions, - track_container_t& trackContainer) const + track_container_t& trackContainer, + typename track_container_t::TrackProxy rootBranch) const -> Result::TrackProxy>> { using SourceLinkAccessor = @@ -1310,7 +1313,6 @@ class CombinatorialKalmanFilter { r.tracks = &trackContainer; r.trackStates = &trackContainer.trackStateContainer(); - auto rootBranch = trackContainer.makeTrack(); r.activeBranches.push_back(rootBranch); auto propagationResult = m_propagator.propagate(propState); @@ -1349,6 +1351,34 @@ class CombinatorialKalmanFilter { return std::move(combKalmanResult.collectedTracks); } + + /// Combinatorial Kalman Filter implementation, calls the Kalman filter + /// + /// @tparam source_link_iterator_t Type of the source link iterator + /// @tparam start_parameters_t Type of the initial parameters + /// @tparam parameters_t Type of parameters used for local parameters + /// + /// @param initialParameters The initial track parameters + /// @param tfOptions CombinatorialKalmanFilterOptions steering the track + /// finding + /// @param trackContainer Track container in which to store the results + /// @note The input measurements are given in the form of @c SourceLinks. + /// It's @c calibrator_t's job to turn them into calibrated measurements + /// used in the track finding. + /// + /// @return a container of track finding result for all the initial track + /// parameters + template + auto findTracks(const start_parameters_t& initialParameters, + const CombinatorialKalmanFilterOptions< + source_link_iterator_t, track_container_t>& tfOptions, + track_container_t& trackContainer) const + -> Result::TrackProxy>> { + auto rootBranch = trackContainer.makeTrack(); + return findTracks(initialParameters, tfOptions, trackContainer, rootBranch); + } }; } // namespace Acts diff --git a/Core/include/Acts/TrackFitting/detail/GsfComponentMerging.hpp b/Core/include/Acts/TrackFitting/detail/GsfComponentMerging.hpp index cf5bc4bf1b0..8881bf8a298 100644 --- a/Core/include/Acts/TrackFitting/detail/GsfComponentMerging.hpp +++ b/Core/include/Acts/TrackFitting/detail/GsfComponentMerging.hpp @@ -12,7 +12,6 @@ #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/TrackFitting/GsfOptions.hpp" -#include "Acts/Utilities/Identity.hpp" #include "Acts/Utilities/detail/periodic.hpp" #include @@ -123,7 +122,7 @@ auto gaussianMixtureCov(const components_t components, /// std::tuple< weight, mean, std::optional< cov > > /// @tparam angle_desc_t A angle description object which defines the cyclic /// angles in the bound parameters -template ::Desc> auto gaussianMixtureMeanCov(const components_t components, projector_t &&projector = projector_t{}, @@ -212,7 +211,7 @@ auto gaussianMixtureMeanCov(const components_t components, /// like a std::tuple< double, BoundVector, BoundMatrix > /// /// @return parameters and covariance as std::tuple< BoundVector, BoundMatrix > -template +template auto mergeGaussianMixture(const mixture_t &mixture, const Surface &surface, ComponentMergeMethod method, projector_t &&projector = projector_t{}) { diff --git a/Core/include/Acts/Utilities/Identity.hpp b/Core/include/Acts/Utilities/Identity.hpp deleted file mode 100644 index 2d5c759b595..00000000000 --- a/Core/include/Acts/Utilities/Identity.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2021 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#pragma once - -#if __cplusplus >= 202002L - -#include - -namespace Acts { -using Identity = std::identity; -} - -#else - -#include - -namespace Acts { - -/// @brief Function object which maps a value to itself by perfect forwarding -/// This is a backport of C++20's std::identity -struct Identity { - template - constexpr auto operator()(T &&v) const { - return std::forward(v); - } -}; - -} // namespace Acts - -#endif diff --git a/Core/include/Acts/Utilities/Intersection.hpp b/Core/include/Acts/Utilities/Intersection.hpp index 30b986f6d24..03cce17ffb9 100644 --- a/Core/include/Acts/Utilities/Intersection.hpp +++ b/Core/include/Acts/Utilities/Intersection.hpp @@ -59,13 +59,6 @@ class Intersection { Status status) : m_position(position), m_pathLength(pathLength), m_status(status) {} - /// Returns whether the intersection was successful or not - /// @deprecated - [[deprecated("Use isValid() instead")]] constexpr explicit operator bool() - const { - return isValid(); - } - /// Returns whether the intersection was successful or not constexpr bool isValid() const { return m_status != Status::missed; } @@ -149,13 +142,6 @@ class ObjectIntersection { const object_t* object, std::uint8_t index = 0) : m_intersection(intersection), m_object(object), m_index(index) {} - /// Returns whether the intersection was successful or not - /// @deprecated - [[deprecated("Use isValid() instead")]] constexpr explicit operator bool() - const { - return isValid(); - } - /// Returns whether the intersection was successful or not constexpr bool isValid() const { return m_intersection.isValid(); } diff --git a/Core/include/Acts/Vertexing/Vertex.hpp b/Core/include/Acts/Vertexing/Vertex.hpp index 1ce6e0ae7c5..10fbf6a2df0 100644 --- a/Core/include/Acts/Vertexing/Vertex.hpp +++ b/Core/include/Acts/Vertexing/Vertex.hpp @@ -78,15 +78,6 @@ class Vertex { /// @param position Vertex position void setPosition(const Vector3& position); - /// @brief Set position and time - /// - /// @deprecated Use setFullPosition instead - /// - /// @param position Vertex position - /// @param time The time - [[deprecated("Use setFullPosition instead")]] void setPosition( - const Vector3& position, ActsScalar time); - /// @brief Set position and time /// /// @param fullPosition Vertex position and time diff --git a/Core/include/Acts/Visualization/GeometryView3D.hpp b/Core/include/Acts/Visualization/GeometryView3D.hpp index 0243e8e58ad..f1abba71424 100644 --- a/Core/include/Acts/Visualization/GeometryView3D.hpp +++ b/Core/include/Acts/Visualization/GeometryView3D.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -14,6 +14,7 @@ #include "Acts/Visualization/IVisualization3D.hpp" #include "Acts/Visualization/ViewConfig.hpp" +#include #include namespace Acts { @@ -75,7 +76,7 @@ struct GeometryView3D { const ViewConfig& sensitiveConfig = s_viewSensitive, const ViewConfig& passiveConfig = s_viewPassive, const ViewConfig& gridConfig = s_viewGrid, - const std::string& outputDir = "."); + const std::filesystem::path& outputDir = std::filesystem::path(".")); /// Helper method to draw Volume objects /// @@ -132,12 +133,12 @@ struct GeometryView3D { /// @param sensitiveConfig The drawing configuration for sensitive surfaces /// @param gridConfig The drawing configuration for grid display /// @param outputDir Directory to write to - static void drawLayer(IVisualization3D& helper, const Layer& layer, - const GeometryContext& gctx, - const ViewConfig& layerConfig = s_viewPassive, - const ViewConfig& sensitiveConfig = s_viewSensitive, - const ViewConfig& gridConfig = s_viewGrid, - const std::string& outputDir = "."); + static void drawLayer( + IVisualization3D& helper, const Layer& layer, const GeometryContext& gctx, + const ViewConfig& layerConfig = s_viewPassive, + const ViewConfig& sensitiveConfig = s_viewSensitive, + const ViewConfig& gridConfig = s_viewGrid, + const std::filesystem::path& outputDir = std::filesystem::path(".")); /// Helper method to draw TrackingVolume objects /// @@ -161,7 +162,8 @@ struct GeometryView3D { const ViewConfig& layerView = s_viewPassive, const ViewConfig& sensitiveView = s_viewSensitive, const ViewConfig& gridView = s_viewGrid, bool writeIt = true, - const std::string& tag = "", const std::string& outputDir = "."); + const std::string& tag = "", + const std::filesystem::path& outputDir = std::filesystem::path(".")); /// Helper method to draw lines - base for all lines /// diff --git a/Core/include/Acts/Visualization/IVisualization3D.hpp b/Core/include/Acts/Visualization/IVisualization3D.hpp index 6daf34c4e2f..96af6328979 100644 --- a/Core/include/Acts/Visualization/IVisualization3D.hpp +++ b/Core/include/Acts/Visualization/IVisualization3D.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -67,28 +68,11 @@ class IVisualization3D { /// Write the content of the helper to an outstream. /// @param path is the file system path for writing the file - /// @note will change to std::filesystem::path once gcc9 is standard - virtual void write(const std::string& path) const = 0; + virtual void write(const std::filesystem::path& path) const = 0; /// Remove all contents of this helper /// virtual void clear() = 0; - - protected: - /// Helper: check for extension - /// - /// @note this is a placeholder for std::filesystem::has_extension - /// which needs special linking until gcc9 - /// @param path the path to be checked - bool hasExtension(const std::string& path) const; - - /// Helper: replace the extension - /// - /// @note this is a placeholder for std::filesystem::replace_extension - /// which needs special linking until gcc9 - /// @param path [in,out] the path to be changed - /// @param suffix the extension to be added - void replaceExtension(std::string& path, const std::string& suffix) const; }; /// Overload of the << operator to facilitate writing to streams. diff --git a/Core/include/Acts/Visualization/ObjVisualization3D.hpp b/Core/include/Acts/Visualization/ObjVisualization3D.hpp index a915ecadee8..79da56d3e9c 100644 --- a/Core/include/Acts/Visualization/ObjVisualization3D.hpp +++ b/Core/include/Acts/Visualization/ObjVisualization3D.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -13,6 +13,7 @@ #include "Acts/Visualization/ViewConfig.hpp" #include +#include #include #include #include @@ -61,8 +62,8 @@ class ObjVisualization3D : public IVisualization3D { const std::vector& faces, ColorRGB color = {0, 0, 0}) final; - /// @copydoc Acts::IVisualization3D::write(const std::string&) const - void write(const std::string& path) const final; + /// @copydoc Acts::IVisualization3D::write(const std::filesystem::path&) const + void write(const std::filesystem::path& path) const final; /// @copydoc Acts::IVisualization3D::write(std::ostream&) const void write(std::ostream& os) const final; diff --git a/Core/include/Acts/Visualization/PlyVisualization3D.hpp b/Core/include/Acts/Visualization/PlyVisualization3D.hpp index b28783a0bcd..95f2fdacd28 100644 --- a/Core/include/Acts/Visualization/PlyVisualization3D.hpp +++ b/Core/include/Acts/Visualization/PlyVisualization3D.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -13,6 +13,7 @@ #include "Acts/Visualization/ViewConfig.hpp" #include +#include #include #include #include @@ -50,8 +51,8 @@ class PlyVisualization3D : public IVisualization3D { void line(const Vector3& a, const Vector3& b, ColorRGB color = {120, 120, 120}) final; - /// @copydoc Acts::IVisualization3D::write(const std::string&) const - void write(const std::string& path) const final; + /// @copydoc Acts::IVisualization3D::write(const std::filesystem::path&) const + void write(const std::filesystem::path& path) const final; /// @copydoc Acts::IVisualization3D::write(std::ostream&) const void write(std::ostream& os) const final; diff --git a/Core/include/Acts/Visualization/ViewConfig.hpp b/Core/include/Acts/Visualization/ViewConfig.hpp index 06c4f7a675b..7e6e70dbdcc 100644 --- a/Core/include/Acts/Visualization/ViewConfig.hpp +++ b/Core/include/Acts/Visualization/ViewConfig.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -9,6 +9,7 @@ #pragma once #include +#include #include namespace Acts { @@ -42,7 +43,7 @@ struct ViewConfig { /// Whether to triangulate or not bool triangulate = false; /// Write name - non-empty string indicates writing - std::string outputName = ""; + std::filesystem::path outputName = std::filesystem::path(""); }; } // namespace Acts diff --git a/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp b/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp index 51a0854b85e..e43bbb11f19 100644 --- a/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp +++ b/Core/include/Acts/Visualization/detail/ObjVisualization3D.ipp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -69,18 +69,21 @@ void ObjVisualization3D::faces(const std::vector& vtxs, } template -void ObjVisualization3D::write(const std::string& path) const { +void ObjVisualization3D::write(const std::filesystem::path& path) const { std::ofstream os; - std::string objectpath = path; - if (!IVisualization3D::hasExtension(objectpath)) { - objectpath += std::string(".obj"); + std::filesystem::path objectpath = path; + if (!objectpath.has_extension()) { + objectpath.replace_extension(std::filesystem::path("obj")); } - os.open(objectpath); - std::string mtlpath = objectpath; - IVisualization3D::replaceExtension(mtlpath, ".mtl"); - os << "mtllib " << mtlpath << "\n"; + os.open(std::filesystem::absolute(objectpath).string()); + std::filesystem::path mtlpath = objectpath; + mtlpath.replace_extension(std::filesystem::path("mtl")); + + const std::string mtlpathString = std::filesystem::absolute(mtlpath).string(); + os << "mtllib " << mtlpathString << "\n"; std::ofstream mtlos; - mtlos.open(mtlpath); + mtlos.open(mtlpathString); + write(os, mtlos); os.close(); mtlos.close(); diff --git a/Core/include/Acts/Visualization/detail/PlyVisualization3D.ipp b/Core/include/Acts/Visualization/detail/PlyVisualization3D.ipp index b97dbde0fc9..c5c12b2dc89 100644 --- a/Core/include/Acts/Visualization/detail/PlyVisualization3D.ipp +++ b/Core/include/Acts/Visualization/detail/PlyVisualization3D.ipp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -41,13 +41,13 @@ void PlyVisualization3D::line(const Vector3& a, const Vector3& b, } template -void PlyVisualization3D::write(const std::string& path) const { +void PlyVisualization3D::write(const std::filesystem::path& path) const { std::ofstream os; - std::string objectpath = path; - if (!IVisualization3D::hasExtension(path)) { - objectpath += std::string(".ply"); + std::filesystem::path objectpath = path; + if (!objectpath.has_extension()) { + objectpath.replace_extension(std::filesystem::path("ply")); } - os.open(objectpath); + os.open(std::filesystem::absolute(objectpath).string()); write(os); os.close(); } diff --git a/Core/src/Geometry/CylinderVolumeStack.cpp b/Core/src/Geometry/CylinderVolumeStack.cpp index b6c75afb54f..9b4f05fc43e 100644 --- a/Core/src/Geometry/CylinderVolumeStack.cpp +++ b/Core/src/Geometry/CylinderVolumeStack.cpp @@ -150,7 +150,7 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction, const auto* cylBounds = dynamic_cast( &m_volumes.front()->volumeBounds()); assert(cylBounds != nullptr && "Volume bounds are not cylinder bounds"); - m_volumeBounds = std::make_shared(*cylBounds); + Volume::update(std::make_shared(*cylBounds)); return; } @@ -211,8 +211,8 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction, m_transform = m_groupTransform * Translation3{0, 0, midZ}; - m_volumeBounds = std::make_shared(minR, maxR, hlZ); - ACTS_DEBUG("Outer bounds are:\n" << *m_volumeBounds); + Volume::update(std::make_shared(minR, maxR, hlZ)); + ACTS_DEBUG("Outer bounds are:\n" << volumeBounds()); ACTS_DEBUG("Outer transform / new group transform is:\n" << m_transform.matrix()); @@ -269,9 +269,9 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction, m_transform = m_groupTransform * Translation3{0, 0, midZ}; - m_volumeBounds = std::make_shared(minR, maxR, hlZ); + Volume::update(std::make_shared(minR, maxR, hlZ)); - ACTS_DEBUG("Outer bounds are:\n" << *m_volumeBounds); + ACTS_DEBUG("Outer bounds are:\n" << volumeBounds()); ACTS_DEBUG("Outer transform is:\n" << m_transform.matrix()); // Update group transform to the new center @@ -625,13 +625,12 @@ std::pair CylinderVolumeStack::synchronizeZBounds( return {minZ, maxZ}; } -void CylinderVolumeStack::update(std::shared_ptr volbounds, +void CylinderVolumeStack::update(std::shared_ptr volbounds, std::optional transform) { if (volbounds == nullptr) { throw std::invalid_argument("New bounds are nullptr"); } - auto cylBounds = - std::dynamic_pointer_cast(volbounds); + auto cylBounds = std::dynamic_pointer_cast(volbounds); if (cylBounds == nullptr) { throw std::invalid_argument( "CylinderVolumeStack requires CylinderVolumeBounds"); @@ -641,7 +640,7 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, } void CylinderVolumeStack::update( - std::shared_ptr newBounds, + std::shared_ptr newBounds, std::optional transform, const Logger& logger) { ACTS_DEBUG( "Resizing CylinderVolumeStack with strategy: " << m_resizeStrategy); @@ -934,7 +933,7 @@ void CylinderVolumeStack::update( } m_transform = newVolume.globalTransform; - m_volumeBounds = std::move(newBounds); + Volume::update(std::move(newBounds)); } void CylinderVolumeStack::checkNoPhiOrBevel(const CylinderVolumeBounds& bounds, diff --git a/Core/src/Geometry/TrackingVolume.cpp b/Core/src/Geometry/TrackingVolume.cpp index dcf9e93a0da..bbed048efdd 100644 --- a/Core/src/Geometry/TrackingVolume.cpp +++ b/Core/src/Geometry/TrackingVolume.cpp @@ -31,8 +31,7 @@ namespace Acts { // constructor for arguments TrackingVolume::TrackingVolume( - const Transform3& transform, - std::shared_ptr volumeBounds, + const Transform3& transform, std::shared_ptr volumeBounds, std::shared_ptr volumeMaterial, std::unique_ptr staticLayerArray, std::shared_ptr containedVolumeArray, @@ -49,14 +48,13 @@ TrackingVolume::TrackingVolume( connectDenseBoundarySurfaces(denseVolumeVector); } -TrackingVolume::TrackingVolume(const Volume& volume, - const std::string& volumeName) +TrackingVolume::TrackingVolume(Volume& volume, const std::string& volumeName) : TrackingVolume(volume.transform(), volume.volumeBoundsPtr(), nullptr, nullptr, nullptr, MutableTrackingVolumeVector{}, volumeName) {} TrackingVolume::TrackingVolume(const Transform3& transform, - std::shared_ptr volbounds, + std::shared_ptr volbounds, const std::string& volumeName) : TrackingVolume(transform, std::move(volbounds), nullptr, nullptr, nullptr, {}, volumeName) {} diff --git a/Core/src/Geometry/Volume.cpp b/Core/src/Geometry/Volume.cpp index 79dcf5598dc..a04cab7b6f7 100644 --- a/Core/src/Geometry/Volume.cpp +++ b/Core/src/Geometry/Volume.cpp @@ -19,7 +19,7 @@ using namespace Acts::UnitLiterals; namespace Acts { Volume::Volume(const Transform3& transform, - std::shared_ptr volbounds) + std::shared_ptr volbounds) : GeometryObject(), m_transform(transform), m_itransform(m_transform.inverse()), @@ -74,11 +74,11 @@ Volume::BoundingBox Volume::orientedBoundingBox() const { this); } -void Volume::assignVolumeBounds(std::shared_ptr volbounds) { +void Volume::assignVolumeBounds(std::shared_ptr volbounds) { update(std::move(volbounds)); } -void Volume::update(std::shared_ptr volbounds, +void Volume::update(std::shared_ptr volbounds, std::optional transform) { if (volbounds) { m_volumeBounds = std::move(volbounds); @@ -104,10 +104,18 @@ const VolumeBounds& Volume::volumeBounds() const { return *m_volumeBounds; } +VolumeBounds& Volume::volumeBounds() { + return *m_volumeBounds; +} + std::shared_ptr Volume::volumeBoundsPtr() const { return m_volumeBounds; } +std::shared_ptr Volume::volumeBoundsPtr() { + return m_volumeBounds; +} + void Volume::setTransform(const Transform3& transform) { m_transform = transform; m_itransform = m_transform.inverse(); diff --git a/Core/src/Material/AverageMaterials.cpp b/Core/src/Material/AverageMaterials.cpp index af81781c8d5..29d07bd814d 100644 --- a/Core/src/Material/AverageMaterials.cpp +++ b/Core/src/Material/AverageMaterials.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -29,10 +29,11 @@ Acts::MaterialSlab Acts::detail::combineSlabs(const MaterialSlab& slab1, // to properly account for the energy loss in multiple material. // use double for (intermediate) computations to avoid precision loss + const double thickness1 = static_cast(slab1.thickness()); + const double thickness2 = static_cast(slab2.thickness()); // the thickness properties are purely additive - double thickness = static_cast(slab1.thickness()) + - static_cast(slab2.thickness()); + const double thickness = thickness1 + thickness2; // if the two materials are the same there is no need for additional // computation @@ -40,30 +41,30 @@ Acts::MaterialSlab Acts::detail::combineSlabs(const MaterialSlab& slab1, return {mat1, static_cast(thickness)}; } - double thicknessInX0 = static_cast(slab1.thicknessInX0()) + - static_cast(slab2.thicknessInX0()); - double thicknessInL0 = static_cast(slab1.thicknessInL0()) + - static_cast(slab2.thicknessInL0()); - - // radiation/interaction length follows from consistency argument - float x0 = thickness / thicknessInX0; - float l0 = thickness / thicknessInL0; - // molar amount-of-substance assuming a unit area, i.e. volume = thickness*1*1 - double molarAmount1 = static_cast(mat1.molarDensity()) * - static_cast(slab1.thickness()); - double molarAmount2 = static_cast(mat2.molarDensity()) * - static_cast(slab2.thickness()); - double molarAmount = molarAmount1 + molarAmount2; + const double molarDensity1 = static_cast(mat1.molarDensity()); + const double molarDensity2 = static_cast(mat2.molarDensity()); + + const double molarAmount1 = molarDensity1 * thickness1; + const double molarAmount2 = molarDensity2 * thickness2; + const double molarAmount = molarAmount1 + molarAmount2; // handle vacuum specially if (!(0.0 < molarAmount)) { return {Material(), static_cast(thickness)}; } - // compute average molar density by dividing the total amount-of-substance by - // the total volume for the same unit area, i.e. volume = totalThickness*1*1 - float molarDensity = molarAmount / thickness; + // radiation/interaction length follows from consistency argument + const double thicknessX01 = static_cast(slab1.thicknessInX0()); + const double thicknessX02 = static_cast(slab2.thicknessInX0()); + const double thicknessL01 = static_cast(slab1.thicknessInL0()); + const double thicknessL02 = static_cast(slab2.thicknessInL0()); + + const double thicknessInX0 = thicknessX01 + thicknessX02; + const double thicknessInL0 = thicknessL01 + thicknessL02; + + const float x0 = static_cast(thickness / thicknessInX0); + const float l0 = static_cast(thickness / thicknessInL0); // assume two slabs of materials with N1,N2 atoms/molecules each with atomic // masses A1,A2 and nuclear charges. We have a total of N = N1 + N2 @@ -82,10 +83,12 @@ Acts::MaterialSlab Acts::detail::combineSlabs(const MaterialSlab& slab1, // = (Vi*rhoi) / (V1*rho1 + V2*rho2) // // which can be computed from the molar amount-of-substance above. + const double ar1 = static_cast(mat1.Ar()); + const double ar2 = static_cast(mat2.Ar()); - double molarWeight1 = molarAmount1 / molarAmount; - double molarWeight2 = molarAmount2 / molarAmount; - float ar = molarWeight1 * mat1.Ar() + molarWeight2 * mat2.Ar(); + const double molarWeight1 = molarAmount1 / molarAmount; + const double molarWeight2 = molarAmount2 / molarAmount; + const float ar = static_cast(molarWeight1 * ar1 + molarWeight2 * ar2); // In the case of the atomic number, its main use is the computation // of the mean excitation energy approximated in ATL-SOFT-PUB-2008-003 as : @@ -100,17 +103,23 @@ Acts::MaterialSlab Acts::detail::combineSlabs(const MaterialSlab& slab1, // To respect this the average atomic number thus need to be defined as : // ln(Z)*t = ln(Z1)*t1 + ln(Z2)*t2 // Z = Exp( ln(Z1)*t1/t + ln(Z2)*t2/t ) - - double thicknessWeight1 = slab1.thickness() / thickness; - double thicknessWeight2 = slab2.thickness() / thickness; - float z = 0; - if (mat1.Z() != 0 && mat2.Z() != 0) { - z = exp(thicknessWeight1 * log(mat1.Z()) + - thicknessWeight2 * log(mat2.Z())); + const double z1 = static_cast(mat1.Z()); + const double z2 = static_cast(mat2.Z()); + + const double thicknessWeight1 = thickness1 / thickness; + const double thicknessWeight2 = thickness2 / thickness; + float z = 0.f; + if (z1 > 0. && z2 > 0.) { + z = static_cast(std::exp(thicknessWeight1 * std::log(z1) + + thicknessWeight2 * std::log(z2))); } else { - z = thicknessWeight1 * mat1.Z() + thicknessWeight2 * mat2.Z(); + z = static_cast(thicknessWeight1 * z1 + thicknessWeight2 * z2); } + // compute average molar density by dividing the total amount-of-substance by + // the total volume for the same unit area, i.e. volume = totalThickness*1*1 + const float molarDensity = static_cast(molarAmount / thickness); + return {Material::fromMolarDensity(x0, l0, ar, z, molarDensity), static_cast(thickness)}; } diff --git a/Core/src/Material/Interactions.cpp b/Core/src/Material/Interactions.cpp index db3c4f9d483..b6a725cb4ca 100644 --- a/Core/src/Material/Interactions.cpp +++ b/Core/src/Material/Interactions.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -154,7 +154,7 @@ namespace detail { inline float computeEnergyLossLandauFwhm(const Acts::MaterialSlab& slab, const RelativisticQuantities& rq) { // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -171,7 +171,7 @@ inline float computeEnergyLossLandauFwhm(const Acts::MaterialSlab& slab, float Acts::computeEnergyLossBethe(const MaterialSlab& slab, float m, float qOverP, float absQ) { // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -196,7 +196,7 @@ float Acts::computeEnergyLossBethe(const MaterialSlab& slab, float m, float Acts::deriveEnergyLossBetheQOverP(const MaterialSlab& slab, float m, float qOverP, float absQ) { // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -233,7 +233,7 @@ float Acts::deriveEnergyLossBetheQOverP(const MaterialSlab& slab, float m, float Acts::computeEnergyLossLandau(const MaterialSlab& slab, float m, float qOverP, float absQ) { // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -253,7 +253,7 @@ float Acts::computeEnergyLossLandau(const MaterialSlab& slab, float m, float Acts::deriveEnergyLossLandauQOverP(const MaterialSlab& slab, float m, float qOverP, float absQ) { // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -288,7 +288,7 @@ float Acts::deriveEnergyLossLandauQOverP(const MaterialSlab& slab, float m, float Acts::computeEnergyLossLandauSigma(const MaterialSlab& slab, float m, float qOverP, float absQ) { // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -386,7 +386,7 @@ float Acts::computeEnergyLossRadiative(const MaterialSlab& slab, "pdg is not absolute"); // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -415,7 +415,7 @@ float Acts::deriveEnergyLossRadiativeQOverP(const MaterialSlab& slab, "pdg is not absolute"); // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } @@ -504,7 +504,7 @@ float Acts::computeMultipleScatteringTheta0(const MaterialSlab& slab, "pdg is not absolute"); // return early in case of vacuum or zero thickness - if (!slab) { + if (!slab.isValid()) { return 0.0f; } diff --git a/Core/src/Material/Material.cpp b/Core/src/Material/Material.cpp index 9056c937fa7..21325f6e900 100644 --- a/Core/src/Material/Material.cpp +++ b/Core/src/Material/Material.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019-2020 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -96,7 +96,7 @@ Acts::Material::ParametersVector Acts::Material::parameters() const { } std::ostream& Acts::operator<<(std::ostream& os, const Material& material) { - if (!material) { + if (!material.isValid()) { os << "vacuum"; } else { os << "x0=" << material.X0(); diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index e8b0e90a76f..f3bf814e97e 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -37,12 +37,6 @@ Acts::PlaneSurface::PlaneSurface(const GeometryContext& gctx, RegularSurface(gctx, other, transform), m_bounds(other.m_bounds) {} -Acts::PlaneSurface::PlaneSurface(const Vector3& center, const Vector3& normal) - : RegularSurface(), m_bounds(nullptr) { - m_transform = std::make_unique( - CurvilinearSurface(center, normal).transform()); -} - Acts::PlaneSurface::PlaneSurface(std::shared_ptr pbounds, const Acts::DetectorElementBase& detelement) : RegularSurface(detelement), m_bounds(std::move(pbounds)) { diff --git a/Core/src/Vertexing/Vertex.cpp b/Core/src/Vertexing/Vertex.cpp index f8373ba774a..6d1fa9bf902 100644 --- a/Core/src/Vertexing/Vertex.cpp +++ b/Core/src/Vertexing/Vertex.cpp @@ -81,11 +81,6 @@ void Vertex::setPosition(const Vector3& position) { m_position.head<3>() = position; } -void Vertex::setPosition(const Vector3& position, ActsScalar time) { - m_position.head<3>() = position; - m_position[eTime] = time; -} - void Vertex::setFullPosition(const Vector4& fullPosition) { m_position = fullPosition; } diff --git a/Core/src/Visualization/CMakeLists.txt b/Core/src/Visualization/CMakeLists.txt index ea2bd2427e6..5d4f916af1c 100644 --- a/Core/src/Visualization/CMakeLists.txt +++ b/Core/src/Visualization/CMakeLists.txt @@ -1,4 +1 @@ -target_sources( - ActsCore - PRIVATE IVisualization3D.cpp GeometryView3D.cpp EventDataView3D.cpp -) +target_sources(ActsCore PRIVATE GeometryView3D.cpp EventDataView3D.cpp) diff --git a/Core/src/Visualization/GeometryView3D.cpp b/Core/src/Visualization/GeometryView3D.cpp index 93f45c4e91d..14923b66a50 100644 --- a/Core/src/Visualization/GeometryView3D.cpp +++ b/Core/src/Visualization/GeometryView3D.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -34,36 +34,12 @@ #include #include +#include #include #include #include #include -#include -#include - -namespace { - -std::string joinPaths(const std::string& a, const std::string& b) { - if (b.substr(0, 1) == "/" || a.empty()) { - return b; - } - - if (a.substr(a.size() - 1) == "/") { - return a.substr(a.size() - 1) + "/" + b; - } - - return a + "/" + b; -} - -std::string getWorkingDirectory() { - char buffer[PATH_MAX]; - return (getcwd(buffer, sizeof(buffer)) != nullptr ? std::string(buffer) - : std::string("")); -} - -} // namespace - namespace Acts::Experimental { ViewConfig s_viewSensitive = ViewConfig({0, 180, 240}); ViewConfig s_viewPassive = ViewConfig({240, 280, 0}); @@ -102,9 +78,7 @@ void Acts::GeometryView3D::drawSurfaceArray( IVisualization3D& helper, const SurfaceArray& surfaceArray, const GeometryContext& gctx, const Transform3& transform, const ViewConfig& sensitiveConfig, const ViewConfig& passiveConfig, - const ViewConfig& gridConfig, const std::string& _outputDir) { - std::string outputDir = - _outputDir == "." ? getWorkingDirectory() : _outputDir; + const ViewConfig& gridConfig, const std::filesystem::path& outputDir) { // Draw all the surfaces Extent arrayExtent; for (const auto& sf : surfaceArray.surfaces()) { @@ -117,7 +91,7 @@ void Acts::GeometryView3D::drawSurfaceArray( } if (!sensitiveConfig.outputName.empty()) { - helper.write(joinPaths(outputDir, sensitiveConfig.outputName)); + helper.write(outputDir / sensitiveConfig.outputName); helper.clear(); } @@ -181,7 +155,7 @@ void Acts::GeometryView3D::drawSurfaceArray( } if (!gridConfig.outputName.empty()) { - helper.write(joinPaths(outputDir, gridConfig.outputName)); + helper.write(outputDir / gridConfig.outputName); helper.clear(); } } @@ -239,10 +213,7 @@ void Acts::GeometryView3D::drawDetectorVolume( void Acts::GeometryView3D::drawLayer( IVisualization3D& helper, const Layer& layer, const GeometryContext& gctx, const ViewConfig& layerConfig, const ViewConfig& sensitiveConfig, - const ViewConfig& gridConfig, const std::string& _outputDir) { - std::string outputDir = - _outputDir == "." ? getWorkingDirectory() : _outputDir; - + const ViewConfig& gridConfig, const std::filesystem::path& outputDir) { if (layerConfig.visible) { auto layerVolume = layer.representingVolume(); if (layerVolume != nullptr) { @@ -254,7 +225,7 @@ void Acts::GeometryView3D::drawLayer( layerConfig); } if (!layerConfig.outputName.empty()) { - helper.write(joinPaths(outputDir, layerConfig.outputName)); + helper.write(outputDir / layerConfig.outputName); helper.clear(); } } @@ -273,9 +244,7 @@ void Acts::GeometryView3D::drawTrackingVolume( const GeometryContext& gctx, const ViewConfig& containerView, const ViewConfig& volumeView, const ViewConfig& layerView, const ViewConfig& sensitiveView, const ViewConfig& gridView, bool writeIt, - const std::string& tag, const std::string& _outputDir) { - std::string outputDir = - _outputDir == "." ? getWorkingDirectory() : _outputDir; + const std::string& tag, const std::filesystem::path& outputDir) { if (tVolume.confinedVolumes() != nullptr) { const auto& subVolumes = tVolume.confinedVolumes()->arrayObjects(); for (const auto& tv : subVolumes) { @@ -303,10 +272,9 @@ void Acts::GeometryView3D::drawTrackingVolume( } if (tVolume.confinedVolumes() == nullptr) { vcConfig = vConfig; - vcConfig.outputName = vname + std::string("_boundaries") + tag; + vcConfig.outputName = + std::filesystem::path(vname + std::string("_boundaries") + tag); } else { - std::stringstream vs; - vs << "Container"; std::vector ids{tVolume.geometryId().volume()}; for (const auto* current = &tVolume; current->motherVolume() != nullptr; @@ -314,11 +282,14 @@ void Acts::GeometryView3D::drawTrackingVolume( ids.push_back(current->motherVolume()->geometryId().volume()); } - for (std::size_t i = ids.size() - 1; i < ids.size(); --i) { - vs << "_v" << ids[i]; + std::ranges::reverse(ids); + vname = "Container"; + for (const auto& id : ids) { + vname += "_v" + std::to_string(id); } - vname = vs.str(); - vcConfig.outputName = vname + std::string("_boundaries") + tag; + + vcConfig.outputName = + std::filesystem::path(vname + std::string("_boundaries") + tag); } } @@ -328,7 +299,7 @@ void Acts::GeometryView3D::drawTrackingVolume( Transform3::Identity(), vcConfig); } if (writeIt) { - std::string outputName = joinPaths(outputDir, vcConfig.outputName); + const std::filesystem::path outputName = outputDir / vcConfig.outputName; helper.write(outputName); helper.clear(); } @@ -338,12 +309,12 @@ void Acts::GeometryView3D::drawTrackingVolume( std::size_t il = 0; for (const auto& tl : layers) { if (writeIt) { - lConfig.outputName = - vname + std::string("_passives_l") + std::to_string(il) + tag; - sConfig.outputName = - vname + std::string("_sensitives_l") + std::to_string(il) + tag; - gConfig.outputName = - vname + std::string("_grids_l") + std::to_string(il) + tag; + lConfig.outputName = std::filesystem::path( + vname + std::string("_passives_l") + std::to_string(il) + tag); + sConfig.outputName = std::filesystem::path( + vname + std::string("_sensitives_l") + std::to_string(il) + tag); + gConfig.outputName = std::filesystem::path( + vname + std::string("_grids_l") + std::to_string(il) + tag); } drawLayer(helper, *tl, gctx, lConfig, sConfig, gConfig, outputDir); ++il; diff --git a/Core/src/Visualization/IVisualization3D.cpp b/Core/src/Visualization/IVisualization3D.cpp deleted file mode 100644 index aad131a156d..00000000000 --- a/Core/src/Visualization/IVisualization3D.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2020 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include "Acts/Visualization/IVisualization3D.hpp" - -bool Acts::IVisualization3D::hasExtension(const std::string& path) const { - return (path.find(".") != std::string::npos); -} - -void Acts::IVisualization3D::replaceExtension(std::string& path, - const std::string& suffix) const { - auto ppoint = path.find_last_of("."); - if (ppoint != std::string::npos) { - path.replace(ppoint, path.length(), suffix); - } else { - path += suffix; - } -} diff --git a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp index 8d31a99b0f8..784bb74176a 100644 --- a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp +++ b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp @@ -69,7 +69,7 @@ class TrackFindingAlgorithm final : public IAlgorithm { virtual ~TrackFinderFunction() = default; virtual TrackFinderResult operator()(const TrackParameters&, const TrackFinderOptions&, - TrackContainer&) const = 0; + TrackContainer&, TrackProxy) const = 0; }; /// Create the track finder function implementation. diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp index bb88f0e0208..03688c2c943 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp @@ -470,8 +470,9 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { const Acts::BoundTrackParameters& firstInitialParameters = initialParameters.at(iSeed); - auto firstResult = - (*m_cfg.findTracks)(firstInitialParameters, firstOptions, tracksTemp); + auto firstRootBranch = tracksTemp.makeTrack(); + auto firstResult = (*m_cfg.findTracks)(firstInitialParameters, firstOptions, + tracksTemp, firstRootBranch); nSeed++; if (!firstResult.ok()) { @@ -507,13 +508,9 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { // has already been updated seedNumber(trackCandidate) = nSeed - 1; - auto firstState = *std::next(trackCandidate.trackStatesReversed().begin(), - trackCandidate.nTrackStates() - 1); - assert(firstState.previous() == Acts::kTrackIndexInvalid); - if (m_cfg.twoWay) { std::optional - firstMeasurement; + firstMeasurementOpt; for (auto trackState : trackCandidate.trackStatesReversed()) { bool isMeasurement = trackState.typeFlags().test( Acts::TrackStateFlag::MeasurementFlag); @@ -523,21 +520,29 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { // decrease resolution because only the smoothing corrected the very // first prediction as filtering is not possible. if (isMeasurement && !isOutlier) { - firstMeasurement = trackState; + firstMeasurementOpt = trackState; } } - if (firstMeasurement.has_value()) { + if (firstMeasurementOpt.has_value()) { + auto& firstMeasurement = firstMeasurementOpt.value(); + Acts::BoundTrackParameters secondInitialParameters = - trackCandidate.createParametersFromState(*firstMeasurement); + trackCandidate.createParametersFromState(firstMeasurement); - auto secondResult = (*m_cfg.findTracks)(secondInitialParameters, - secondOptions, tracksTemp); + auto secondRootBranch = tracksTemp.makeTrack(); + secondRootBranch.copyFrom(trackCandidate, false); + auto secondResult = + (*m_cfg.findTracks)(secondInitialParameters, secondOptions, + tracksTemp, secondRootBranch); if (!secondResult.ok()) { ACTS_WARNING("Second track finding failed for seed " << iSeed << " with error" << secondResult.error()); } else { + // store the original previous state to restore it later + auto originalFirstMeasurementPrevious = firstMeasurement.previous(); + auto& secondTracksForSeed = secondResult.value(); for (auto& secondTrack : secondTracksForSeed) { // TODO a copy of the track should not be necessary but is the @@ -552,7 +557,7 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { // processed secondTrackCopy.reverseTrackStates(true); - firstState.previous() = + firstMeasurement.previous() = secondTrackCopy.outermostTrackState().index(); trackCandidate.copyFrom(secondTrackCopy, false); @@ -605,6 +610,9 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { ++nSecond; } + + // restore the original previous state + firstMeasurement.previous() = originalFirstMeasurementPrevious; } } } @@ -613,7 +621,6 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { if (nSecond == 0) { // restore the track to the original state trackCandidate.copyFrom(firstTrack, false); - firstState.previous() = Acts::kTrackIndexInvalid; auto firstExtrapolationResult = Acts::extrapolateTrackToReferenceSurface( diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp index 71298d98767..0ffef02588f 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithmFunction.cpp @@ -49,8 +49,10 @@ struct TrackFinderFunctionImpl ActsExamples::TrackFindingAlgorithm::TrackFinderResult operator()( const ActsExamples::TrackParameters& initialParameters, const ActsExamples::TrackFindingAlgorithm::TrackFinderOptions& options, - ActsExamples::TrackContainer& tracks) const override { - return trackFinder.findTracks(initialParameters, options, tracks); + ActsExamples::TrackContainer& tracks, + ActsExamples::TrackProxy rootBranch) const override { + return trackFinder.findTracks(initialParameters, options, tracks, + rootBranch); }; }; diff --git a/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp b/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp index 69d281110cf..bd4b57dd4e5 100644 --- a/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp +++ b/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp @@ -142,7 +142,9 @@ ActsExamples::ProcessCode TrackFindingFromPrototrackAlgorithm::execute( } } - auto result = (*m_cfg.findTracks)(initialParameters.at(i), options, tracks); + auto rootBranch = tracks.makeTrack(); + auto result = (*m_cfg.findTracks)(initialParameters.at(i), options, tracks, + rootBranch); nSeed++; if (!result.ok()) { diff --git a/Examples/Algorithms/TrackFitting/src/GsfFitterFunction.cpp b/Examples/Algorithms/TrackFitting/src/GsfFitterFunction.cpp index bfadb103a25..8770b77bf52 100644 --- a/Examples/Algorithms/TrackFitting/src/GsfFitterFunction.cpp +++ b/Examples/Algorithms/TrackFitting/src/GsfFitterFunction.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2022 CERN for the benefit of the Acts project +// Copyright (C) 2022-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -19,7 +19,6 @@ #include "Acts/Propagator/MultiEigenStepperLoop.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StepperExtensionList.hpp" #include "Acts/TrackFitting/GainMatrixUpdater.hpp" #include "Acts/TrackFitting/GaussianSumFitter.hpp" #include "Acts/TrackFitting/GsfMixtureReduction.hpp" @@ -58,9 +57,9 @@ using namespace ActsExamples; namespace { -using MultiStepper = Acts::MultiEigenStepperLoop< - Acts::StepperExtensionList, - Acts::MaxWeightReducerLoop>; +using MultiStepper = + Acts::MultiEigenStepperLoop; using Propagator = Acts::Propagator; using DirectPropagator = Acts::Propagator; diff --git a/Examples/Io/Obj/src/ObjTrackingGeometryWriter.cpp b/Examples/Io/Obj/src/ObjTrackingGeometryWriter.cpp index 707add19bfd..a0f4948a1ff 100644 --- a/Examples/Io/Obj/src/ObjTrackingGeometryWriter.cpp +++ b/Examples/Io/Obj/src/ObjTrackingGeometryWriter.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2017 CERN for the benefit of the Acts project +// Copyright (C) 2017-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -14,6 +14,8 @@ #include #include +#include + ActsExamples::ObjTrackingGeometryWriter::ObjTrackingGeometryWriter( const ActsExamples::ObjTrackingGeometryWriter::Config& config, Acts::Logging::Level level) @@ -43,5 +45,5 @@ void ActsExamples::ObjTrackingGeometryWriter::write( Acts::GeometryView3D::drawTrackingVolume( objVis, tVolume, context.geoContext, m_cfg.containerView, m_cfg.volumeView, m_cfg.passiveView, m_cfg.sensitiveView, m_cfg.gridView, - true, "", m_cfg.outputDir); + true, "", std::filesystem::path(m_cfg.outputDir)); } diff --git a/Examples/Io/Root/src/RootMaterialWriter.cpp b/Examples/Io/Root/src/RootMaterialWriter.cpp index be43994f192..692036667a9 100644 --- a/Examples/Io/Root/src/RootMaterialWriter.cpp +++ b/Examples/Io/Root/src/RootMaterialWriter.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2017-2018 CERN for the benefit of the Acts project +// Copyright (C) 2017-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -297,7 +297,7 @@ void ActsExamples::RootMaterialWriter::writeMaterial( Acts::MaterialGrid3D grid = bvMaterial3D->getMapper().getGrid(); for (std::size_t point = 0; point < points; point++) { auto mat = Acts::Material(grid.at(point)); - if (mat) { + if (mat.isValid()) { x0->SetBinContent(point + 1, mat.X0()); l0->SetBinContent(point + 1, mat.L0()); A->SetBinContent(point + 1, mat.Ar()); @@ -311,7 +311,7 @@ void ActsExamples::RootMaterialWriter::writeMaterial( Acts::MaterialGrid2D grid = bvMaterial2D->getMapper().getGrid(); for (std::size_t point = 0; point < points; point++) { auto mat = Acts::Material(grid.at(point)); - if (mat) { + if (mat.isValid()) { x0->SetBinContent(point + 1, mat.X0()); l0->SetBinContent(point + 1, mat.L0()); A->SetBinContent(point + 1, mat.Ar()); diff --git a/Examples/Io/Root/src/RootTrackStatesWriter.cpp b/Examples/Io/Root/src/RootTrackStatesWriter.cpp index 55947c67f7a..7015a535ff8 100644 --- a/Examples/Io/Root/src/RootTrackStatesWriter.cpp +++ b/Examples/Io/Root/src/RootTrackStatesWriter.cpp @@ -504,39 +504,6 @@ ProcessCode RootTrackStatesWriter::writeT(const AlgorithmContext& ctx, state.smoothedCovariance() - K * H * state.smoothedCovariance(); return std::make_pair(unbiasedParamsVec, unbiasedParamsCov); } - if (ipar == eUnbiased && !state.hasSmoothed() && state.hasFiltered() && - state.hasProjector() && state.hasCalibrated()) { - // Same calculation as above but using the filtered states. - auto m = state.effectiveCalibrated(); - auto H = state.effectiveProjector(); - auto V = state.effectiveCalibratedCovariance(); - auto K = - (state.filteredCovariance() * H.transpose() * - (H * state.filteredCovariance() * H.transpose() - V).inverse()) - .eval(); - auto unbiasedParamsVec = - state.filtered() + K * (m - H * state.filtered()); - auto unbiasedParamsCov = - state.filteredCovariance() - K * H * state.filteredCovariance(); - return std::make_pair(unbiasedParamsVec, unbiasedParamsCov); - } - if (ipar == eUnbiased && !state.hasSmoothed() && !state.hasFiltered() && - state.hasPredicted() && state.hasProjector() && - state.hasCalibrated()) { - // Same calculation as above but using the predicted states. - auto m = state.effectiveCalibrated(); - auto H = state.effectiveProjector(); - auto V = state.effectiveCalibratedCovariance(); - auto K = - (state.predictedCovariance() * H.transpose() * - (H * state.predictedCovariance() * H.transpose() - V).inverse()) - .eval(); - auto unbiasedParamsVec = - state.predicted() + K * (m - H * state.predicted()); - auto unbiasedParamsCov = - state.predictedCovariance() - K * H * state.predictedCovariance(); - return std::make_pair(unbiasedParamsVec, unbiasedParamsCov); - } return std::nullopt; }; @@ -547,7 +514,7 @@ ProcessCode RootTrackStatesWriter::writeT(const AlgorithmContext& ctx, // fill the track parameters status m_hasParams[ipar].push_back(trackParamsOpt.has_value()); - if (!trackParamsOpt) { + if (!trackParamsOpt.has_value()) { if (ipar == ePredicted) { // push default values if no track parameters m_res_x_hit.push_back(nan); diff --git a/Examples/Python/src/Base.cpp b/Examples/Python/src/Base.cpp index b6582c15d1f..aae48a6a3b4 100644 --- a/Examples/Python/src/Base.cpp +++ b/Examples/Python/src/Base.cpp @@ -297,9 +297,12 @@ void addAlgebra(Acts::Python::Context& ctx) { Acts::Vector3(translation[0], translation[1], translation[2])); return t; })) - .def("getTranslation", [](const Acts::Transform3& self) { - return Vector3(self.translation()); - }); + .def("getTranslation", + [](const Acts::Transform3& self) { + return Vector3(self.translation()); + }) + .def_static("Identity", &Acts::Transform3::Identity); + ; } void addBinning(Context& ctx) { diff --git a/Examples/Python/src/Geometry.cpp b/Examples/Python/src/Geometry.cpp index 114e54e29a5..4f4752aa4ef 100644 --- a/Examples/Python/src/Geometry.cpp +++ b/Examples/Python/src/Geometry.cpp @@ -189,11 +189,8 @@ void addGeometry(Context& ctx) { py::class_>(m, "TrackingVolume") - .def(py::init([](std::shared_ptr bounds, - std::string name) { - return std::make_shared(Transform3::Identity(), - bounds, name); - })); + .def(py::init, + std::string>()); } { diff --git a/Examples/Python/tests/root_file_hashes.txt b/Examples/Python/tests/root_file_hashes.txt index 88d903b6f1e..f46e52e5aa1 100644 --- a/Examples/Python/tests/root_file_hashes.txt +++ b/Examples/Python/tests/root_file_hashes.txt @@ -20,7 +20,7 @@ test_propagation__propagation_summary.root: 85d877c3a48a6235d3d5a398b47130d5d17d test_material_recording__geant4_material_tracks.root: c022b9362249b29f57a07926b20644e3ab4ab8ebcf03f773fbf46c446fc1a0a1 test_truth_tracking_gsf[generic]__trackstates_gsf.root: 974968d9c867a18e2477fb241288e8d8a4a5e7499495d3e1a7b9cafa26c6dda5 test_truth_tracking_gsf[generic]__tracksummary_gsf.root: b698e3d21eacc34fc8b0ce1d3fbe07405a4b8b549e07f0160573e64c3b401f04 -test_truth_tracking_gsf[odd]__trackstates_gsf.root: 3da3911267af3878976f1aed53e40b20aa3a6c04b0717235556633d7c0935426 +test_truth_tracking_gsf[odd]__trackstates_gsf.root: a3ee2401c42e226d61dce0b47f497bd273d8eb5ef6bc0ed541e08180fbb549f3 test_truth_tracking_gsf[odd]__tracksummary_gsf.root: 2cfdc8002c36c2dabddce827d90ddfc865fef15f43faa15a98884f120542cbbd test_particle_gun__particles.root: 5fe7dda2933ee6b9615b064d192322fe07831133cd998e5ed99a3b992b713a10 test_material_mapping__material-map_tracks.root: 938b1a855369e9304401cb10d2751df3fd7acf32a2573f2057eb1691cd94edf3 @@ -33,7 +33,7 @@ test_digitization_example_input[smeared]__particles.root: 5fe7dda2933ee6b9615b06 test_digitization_example_input[smeared]__measurements.root: 243c2f69b7b0db9dbeaa7494d4ea0f3dd1691dc90f16e10df6c0491ff4dc7d62 test_digitization_example_input[geometric]__particles.root: 5fe7dda2933ee6b9615b064d192322fe07831133cd998e5ed99a3b992b713a10 test_digitization_example_input[geometric]__measurements.root: 63ec81635979058fb8976f94455bf490cf92b7b142c4a05cc39de6225f5de2fb -test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: b61fa5d207d3d87742a8bae454eb4c97b2ef6613fe38f388f147da104ec7ff84 +test_ckf_tracks_example[generic-full_seeding]__trackstates_ckf.root: 5eb5ef380aab8e5334b1d4365b945f21addcea86c569b78171ea1ca8a23dae84 test_ckf_tracks_example[generic-full_seeding]__tracksummary_ckf.root: 18580d384e3ceb126be9c5d8857e176cff6c7d549155012d87939c91dba87015 test_ckf_tracks_example[generic-full_seeding]__performance_seeding_trees.root: 0e0676ffafdb27112fbda50d1cf627859fa745760f98073261dcf6db3f2f991e test_ckf_tracks_example[generic-truth_estimated]__trackstates_ckf.root: afc9984f5b1f0b9d42156a1c3917df68144f1c486dd2b9b9a199309aa958cddc @@ -41,13 +41,13 @@ test_ckf_tracks_example[generic-truth_estimated]__tracksummary_ckf.root: e5db279 test_ckf_tracks_example[generic-truth_estimated]__performance_seeding.root: 1facb05c066221f6361b61f015cdf0918e94d9f3fce2269ec7b6a4dffeb2bc7e test_ckf_tracks_example[generic-truth_smeared]__trackstates_ckf.root: 47c5e18de310363fdebe79d6c82c3cf5407200f2f06879f79217924d28a67a6e test_ckf_tracks_example[generic-truth_smeared]__tracksummary_ckf.root: 961aa19995a8a1c64a365c6d72a90eee9809efaaee652b674db287acacfb810c -test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 65e17d3747dbf415bcaf31101e23bb48e61d8bc5da817e0fd33a4d03d77d4601 +test_ckf_tracks_example[odd-full_seeding]__trackstates_ckf.root: 86a6ca1f902450501183f8fa62ff585a7c27011ebf63e8f88330d2e36d2c2f12 test_ckf_tracks_example[odd-full_seeding]__tracksummary_ckf.root: 2a905c02e3fd3b9f0626ee204294c223d9a05e7774a4234c51114e4e380954b9 test_ckf_tracks_example[odd-full_seeding]__performance_seeding_trees.root: 43c58577aafe07645e5660c4f43904efadf91d8cda45c5c04c248bbe0f59814f -test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: a1103e9429076d3e5d0b9e3007710d26460ca9c4824c586522adedb19ce9e442 +test_ckf_tracks_example[odd-truth_estimated]__trackstates_ckf.root: 350e228ac082c5ef0bfa2280fb46bb8fdda790b78a6c5337d8e5ff4dfbe9a717 test_ckf_tracks_example[odd-truth_estimated]__tracksummary_ckf.root: a5eecfb6907406286c56db4df19937539cb43e454307bc53bd1eda535526736c test_ckf_tracks_example[odd-truth_estimated]__performance_seeding.root: 1a36b7017e59f1c08602ef3c2cb0483c51df248f112e3780c66594110719c575 -test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: 620c05ac64c9d398417edf8261cfd89023e14083b9357e236077f4e5ea4d9c0b +test_ckf_tracks_example[odd-truth_smeared]__trackstates_ckf.root: 41627c8522bc6436cf0c605912531742db80bdfbaefb46d8b58e5d79e4fc0858 test_ckf_tracks_example[odd-truth_smeared]__tracksummary_ckf.root: 772855a12b7c7ca1170b112e00ae73e4e43b269c2b6bb1f881e761c089255cf5 test_vertex_fitting_reading[Truth-False-100]__performance_vertexing.root: 76ef6084d758dfdfc0151ddec2170e12d73394424e3dac4ffe46f0f339ec8293 test_vertex_fitting_reading[Iterative-False-100]__performance_vertexing.root: 60372210c830a04f95ceb78c6c68a9b0de217746ff59e8e73053750c837b57eb @@ -88,9 +88,9 @@ test_truth_tracking_kalman[generic-True-1000.0]__trackstates_kf.root: 0a2428ff26 test_truth_tracking_kalman[generic-True-1000.0]__tracksummary_kf.root: 055a74d2747d360398cc846cc2791204491528896de78cca66b188e3ff530dc1 test_truth_tracking_kalman[odd-False-0.0]__trackstates_kf.root: a34546ba6cfdbecc3bcf6f02ec782ebcc76f332070e7ff8a64207ed815f65c7e test_truth_tracking_kalman[odd-False-0.0]__tracksummary_kf.root: 7f1bb68b39e52da7a77ea295819fa3776e947568455338738c3a6436c2d7599c -test_truth_tracking_kalman[odd-False-1000.0]__trackstates_kf.root: 0e508f4a6b13dec00a4c55629c90cd055d1aef7dec9c6d86edf55403d20b424d +test_truth_tracking_kalman[odd-False-1000.0]__trackstates_kf.root: 0344aa50ba6c14152cf0f29b6f6da8af88fd61556a99baa62bef2fdbbc121ac8 test_truth_tracking_kalman[odd-False-1000.0]__tracksummary_kf.root: 87eaae3192ab29e2c2542c017071b6477c7237c5b8eaff107e84caed2a5e5b7a test_truth_tracking_kalman[odd-True-0.0]__trackstates_kf.root: a34546ba6cfdbecc3bcf6f02ec782ebcc76f332070e7ff8a64207ed815f65c7e test_truth_tracking_kalman[odd-True-0.0]__tracksummary_kf.root: 7f1bb68b39e52da7a77ea295819fa3776e947568455338738c3a6436c2d7599c -test_truth_tracking_kalman[odd-True-1000.0]__trackstates_kf.root: 0e508f4a6b13dec00a4c55629c90cd055d1aef7dec9c6d86edf55403d20b424d +test_truth_tracking_kalman[odd-True-1000.0]__trackstates_kf.root: 0344aa50ba6c14152cf0f29b6f6da8af88fd61556a99baa62bef2fdbbc121ac8 test_truth_tracking_kalman[odd-True-1000.0]__tracksummary_kf.root: 87eaae3192ab29e2c2542c017071b6477c7237c5b8eaff107e84caed2a5e5b7a diff --git a/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp b/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp index 91482d3abd6..1e5deef90b5 100644 --- a/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp +++ b/Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2018-2021 CERN for the benefit of the Acts project +// Copyright (C) 2018-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -183,7 +183,7 @@ struct SimulationActor { Acts::MaterialSlab slab = surface.surfaceMaterial()->materialSlab(local); // again: interact only if there is valid material to interact with - if (slab) { + if (slab.isValid()) { // adapt material for non-zero incidence auto normal = surface.normal(state.geoContext, before.position(), before.direction()); diff --git a/Plugins/Json/src/MaterialJsonConverter.cpp b/Plugins/Json/src/MaterialJsonConverter.cpp index 8d523229435..7213f4bca17 100644 --- a/Plugins/Json/src/MaterialJsonConverter.cpp +++ b/Plugins/Json/src/MaterialJsonConverter.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2021 CERN for the benefit of the Acts project +// Copyright (C) 2021-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -283,7 +283,7 @@ Acts::ISurfaceMaterial* indexedMaterialFromJson(nlohmann::json& jMaterial) { } // namespace void Acts::to_json(nlohmann::json& j, const Material& t) { - if (!t) { + if (!t.isValid()) { return; } for (unsigned i = 0; i < t.parameters().size(); ++i) { diff --git a/Tests/IntegrationTests/PropagationDenseConstant.cpp b/Tests/IntegrationTests/PropagationDenseConstant.cpp index 381e7639111..c27e38088b4 100644 --- a/Tests/IntegrationTests/PropagationDenseConstant.cpp +++ b/Tests/IntegrationTests/PropagationDenseConstant.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -15,8 +15,8 @@ #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Material/HomogeneousVolumeMaterial.hpp" -#include "Acts/Propagator/DenseEnvironmentExtension.hpp" #include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/EigenStepperDenseEnvironmentExtension.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/RiddersPropagator.hpp" @@ -34,8 +34,7 @@ namespace ds = ActsTests::PropagationDatasets; using namespace Acts::UnitLiterals; using MagneticField = Acts::ConstantBField; -using Stepper = Acts::EigenStepper< - Acts::StepperExtensionList>; +using Stepper = Acts::EigenStepper; using Propagator = Acts::Propagator; using RiddersPropagator = Acts::RiddersPropagator; diff --git a/Tests/UnitTests/Core/EventData/BoundTrackParametersTests.cpp b/Tests/UnitTests/Core/EventData/BoundTrackParametersTests.cpp index 4410679256e..5e79730056b 100644 --- a/Tests/UnitTests/Core/EventData/BoundTrackParametersTests.cpp +++ b/Tests/UnitTests/Core/EventData/BoundTrackParametersTests.cpp @@ -252,9 +252,9 @@ const auto perigees = bdata::make({ Surface::makeShared(Vector3(0, 0, -1.5)), }); const auto planes = bdata::make({ - Surface::makeShared(Vector3(1, 2, 3), Vector3::UnitX()), - Surface::makeShared(Vector3(-2, -3, -4), Vector3::UnitY()), - Surface::makeShared(Vector3(3, -4, 5), Vector3::UnitZ()), + CurvilinearSurface(Vector3(1, 2, 3), Vector3::UnitX()).planeSurface(), + CurvilinearSurface(Vector3(-2, -3, -4), Vector3::UnitY()).planeSurface(), + CurvilinearSurface(Vector3(3, -4, 5), Vector3::UnitZ()).planeSurface(), }); const auto straws = bdata::make({ Surface::makeShared(Transform3::Identity(), 2.0 /* radius */, diff --git a/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp b/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp index 0697c965bb2..c5eca8fca6c 100644 --- a/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp +++ b/Tests/UnitTests/Core/EventData/CorrectedTransformFreeToBoundTests.cpp @@ -14,6 +14,7 @@ #include "Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" @@ -54,8 +55,8 @@ BOOST_AUTO_TEST_CASE(CorrectedFreeToBoundTrackParameters) { // construct two parallel plane surfaces with normal in x direction ActsScalar distance = 10_mm; - auto eSurface = Surface::makeShared(Vector3(distance, 0, 0), - Vector3::UnitX()); + auto eSurface = CurvilinearSurface(Vector3(distance, 0, 0), Vector3::UnitX()) + .planeSurface(); // the bound parameters at the starting plane BoundVector sBoundParams = BoundVector::Zero(); diff --git a/Tests/UnitTests/Core/EventData/MultiComponentBoundTrackParametersTests.cpp b/Tests/UnitTests/Core/EventData/MultiComponentBoundTrackParametersTests.cpp index 29f90c2a6de..62425e23c03 100644 --- a/Tests/UnitTests/Core/EventData/MultiComponentBoundTrackParametersTests.cpp +++ b/Tests/UnitTests/Core/EventData/MultiComponentBoundTrackParametersTests.cpp @@ -14,6 +14,7 @@ #include "Acts/EventData/GenericBoundTrackParameters.hpp" #include "Acts/EventData/ParticleHypothesis.hpp" #include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include #include @@ -38,8 +39,9 @@ BOOST_AUTO_TEST_CASE(test_constructors) { b; b.push_back({1.0, BoundVector::Ones(), BoundSquareMatrix::Identity()}); - auto surface = Acts::Surface::makeShared( - Vector3::Ones(), Vector3::Ones().normalized()); + auto surface = + CurvilinearSurface(Vector3::Ones(), Vector3::Ones().normalized()) + .planeSurface(); const auto ap = MultiComponentBoundTrackParameters(surface, a, particleHypothesis); @@ -62,8 +64,9 @@ BOOST_AUTO_TEST_CASE(test_accessors) { using cov_t = std::optional; for (const auto &cov : {cov_t{}, cov_t{BoundSquareMatrix::Identity()}, cov_t{BoundSquareMatrix::Identity()}}) { - auto surface = Acts::Surface::makeShared( - Vector3::Ones(), Vector3::Ones().normalized()); + auto surface = + CurvilinearSurface(Vector3::Ones(), Vector3::Ones().normalized()) + .planeSurface(); const BoundTrackParameters single_pars(surface, BoundVector::Ones(), cov, particleHypothesis); diff --git a/Tests/UnitTests/Core/EventData/TrackParametersDatasets.hpp b/Tests/UnitTests/Core/EventData/TrackParametersDatasets.hpp index d7781058557..05e256fd434 100644 --- a/Tests/UnitTests/Core/EventData/TrackParametersDatasets.hpp +++ b/Tests/UnitTests/Core/EventData/TrackParametersDatasets.hpp @@ -11,6 +11,7 @@ #include #include "Acts/Definitions/Units.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" @@ -34,9 +35,9 @@ const auto surfaces = Transform3::Identity(), 10 /* radius */, 100 /* half-length z */), // TODO perigee roundtrip local->global->local does not seem to work // Surface::makeShared(Vector3(0, 0, -1.5)), - Surface::makeShared(Vector3::Zero(), Vector3::UnitX()), - Surface::makeShared(Vector3::Zero(), Vector3::UnitY()), - Surface::makeShared(Vector3::Zero(), Vector3::UnitZ()), + CurvilinearSurface(Vector3::Zero(), Vector3::UnitX()).planeSurface(), + CurvilinearSurface(Vector3::Zero(), Vector3::UnitY()).planeSurface(), + CurvilinearSurface(Vector3::Zero(), Vector3::UnitZ()).planeSurface(), }); // positions const auto posAngle = bdata::xrange(-M_PI, M_PI, 0.50); diff --git a/Tests/UnitTests/Core/EventData/TrackTestsExtra.cpp b/Tests/UnitTests/Core/EventData/TrackTestsExtra.cpp index 811c3cd3770..2f7df54f055 100644 --- a/Tests/UnitTests/Core/EventData/TrackTestsExtra.cpp +++ b/Tests/UnitTests/Core/EventData/TrackTestsExtra.cpp @@ -12,6 +12,7 @@ #include "Acts/EventData/ProxyAccessor.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Utilities/Zip.hpp" @@ -216,8 +217,9 @@ BOOST_AUTO_TEST_CASE_TEMPLATE(Build, factory_t, holder_types) { t.covariance() = cov; BOOST_CHECK_EQUAL(t.covariance(), cov); - auto surface = Acts::Surface::makeShared( - Acts::Vector3{-3_m, 0., 0.}, Acts::Vector3{1., 0., 0}); + auto surface = + CurvilinearSurface(Acts::Vector3{-3_m, 0., 0.}, Acts::Vector3{1., 0., 0}) + .planeSurface(); t.setReferenceSurface(surface); BOOST_CHECK_EQUAL(surface.get(), &t.referenceSurface()); diff --git a/Tests/UnitTests/Core/Material/AccumulatedMaterialSlabTests.cpp b/Tests/UnitTests/Core/Material/AccumulatedMaterialSlabTests.cpp index f9e0c4ad759..578b562cc8b 100644 --- a/Tests/UnitTests/Core/Material/AccumulatedMaterialSlabTests.cpp +++ b/Tests/UnitTests/Core/Material/AccumulatedMaterialSlabTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2017-2020 CERN for the benefit of the Acts project +// Copyright (C) 2017-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -35,7 +35,7 @@ BOOST_AUTO_TEST_CASE(Nothing) { AccumulatedMaterialSlab a; auto [average, trackCount] = a.totalAverage(); // material is vacuum - BOOST_CHECK(!(average)); + BOOST_CHECK(!average.isValid()); BOOST_CHECK_EQUAL(trackCount, 0u); } @@ -46,7 +46,7 @@ BOOST_AUTO_TEST_CASE(EmptyTracksIgnored) { a.trackAverage(); a.trackAverage(); auto [average, trackCount] = a.totalAverage(); - BOOST_CHECK(!(average)); + BOOST_CHECK(!average.isValid()); BOOST_CHECK_EQUAL(trackCount, 0u); } @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(EmptyTracks) { a.trackAverage(true); a.trackAverage(true); auto [average, trackCount] = a.totalAverage(); - BOOST_CHECK(!(average)); + BOOST_CHECK(!average.isValid()); BOOST_CHECK_EQUAL(trackCount, 3u); } diff --git a/Tests/UnitTests/Core/Material/AccumulatedVolumeMaterialTests.cpp b/Tests/UnitTests/Core/Material/AccumulatedVolumeMaterialTests.cpp index 10fdced1c15..6ededefb715 100644 --- a/Tests/UnitTests/Core/Material/AccumulatedVolumeMaterialTests.cpp +++ b/Tests/UnitTests/Core/Material/AccumulatedVolumeMaterialTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -23,11 +23,11 @@ BOOST_AUTO_TEST_CASE(vacuum) { AccumulatedVolumeMaterial avm; // averaging over nothing is vacuum - BOOST_CHECK(!avm.average()); + BOOST_CHECK(!avm.average().isValid()); // averaging over vacuum is still vacuum avm.accumulate(MaterialSlab(1)); - BOOST_CHECK(!avm.average()); + BOOST_CHECK(!avm.average().isValid()); } BOOST_AUTO_TEST_CASE(single_material) { diff --git a/Tests/UnitTests/Core/Material/AverageMaterialsTests.cpp b/Tests/UnitTests/Core/Material/AverageMaterialsTests.cpp index 599c7f739c4..fcfe8eaee08 100644 --- a/Tests/UnitTests/Core/Material/AverageMaterialsTests.cpp +++ b/Tests/UnitTests/Core/Material/AverageMaterialsTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2020 CERN for the benefit of the Acts project +// Copyright (C) 2020-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -41,7 +41,8 @@ BOOST_AUTO_TEST_CASE(CombineSlabsVacuum) { // vacuum with zero thickness { auto slab = combineSlabs(zeroVacuum, zeroVacuum); - BOOST_CHECK(!slab.material()); + BOOST_CHECK(!slab.isValid()); + BOOST_CHECK(!slab.material().isValid()); BOOST_CHECK_EQUAL(slab.thickness(), 0.0f); BOOST_CHECK_EQUAL(slab.thicknessInX0(), 0.0f); BOOST_CHECK_EQUAL(slab.thicknessInL0(), 0.0f); @@ -49,7 +50,8 @@ BOOST_AUTO_TEST_CASE(CombineSlabsVacuum) { // vacuum with unit thickness { auto slab = combineSlabs(unitVacuum, unitVacuum); - BOOST_CHECK(!slab.material()); + BOOST_CHECK(!slab.isValid()); + BOOST_CHECK(!slab.material().isValid()); BOOST_CHECK_EQUAL(slab.thickness(), 2.0f); BOOST_CHECK_EQUAL(slab.thicknessInX0(), 0.0f); BOOST_CHECK_EQUAL(slab.thicknessInL0(), 0.0f); @@ -59,8 +61,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsVacuum) { BOOST_AUTO_TEST_CASE(CombineSlabsPercent) { auto slab = combineSlabs(percent, percent); // combining two identical slabs must give the same average material - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), percent); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), percent.material()); // thickness-like properties must double BOOST_CHECK_EQUAL(slab.thickness(), 2 * percent.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), 2 * percent.thicknessInX0()); @@ -70,8 +73,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsPercent) { BOOST_AUTO_TEST_CASE(CombineSlabsUnit) { auto slab = combineSlabs(unit, unit); // combining two identical slabs must give the same average material - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), unit); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), unit.material()); // thickness-like properties must double BOOST_CHECK_EQUAL(slab.thickness(), 2 * unit.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), 2 * unit.thicknessInX0()); @@ -83,8 +87,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsUnit) { BOOST_AUTO_TEST_CASE(CombineSlabsPercentZeroVacuum) { { auto slab = combineSlabs(percent, zeroVacuum); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), percent); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), percent.material()); BOOST_CHECK_EQUAL(slab.thickness(), percent.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), percent.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), percent.thicknessInL0()); @@ -92,8 +97,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsPercentZeroVacuum) { // reverse input order { auto slab = combineSlabs(zeroVacuum, percent); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), percent); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), percent.material()); BOOST_CHECK_EQUAL(slab.thickness(), percent.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), percent.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), percent.thicknessInL0()); @@ -103,8 +109,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsPercentZeroVacuum) { BOOST_AUTO_TEST_CASE(CombineSlabsUnitZeroVacuum) { { auto slab = combineSlabs(unit, zeroVacuum); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), unit); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), unit.material()); BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0()); @@ -112,8 +119,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsUnitZeroVacuum) { // reverse input order { auto slab = combineSlabs(zeroVacuum, unit); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), unit); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), unit.material()); BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0()); @@ -126,8 +134,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsPercentUnit) { // the two slabs have the same material -> average should be identical { auto slab = combineSlabs(percent, unit); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), percent); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), percent.material()); BOOST_CHECK_EQUAL(slab.thickness(), percent.thickness() + unit.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), percent.thicknessInX0() + unit.thicknessInX0()); @@ -137,8 +146,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsPercentUnit) { // reverse input order { auto slab = combineSlabs(unit, percent); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), unit); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), unit.material()); BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness() + percent.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), percent.thicknessInX0() + unit.thicknessInX0()); @@ -153,8 +163,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsUnitZero) { // the two slabs have the same material -> average should be identical { auto slab = combineSlabs(unit, zero); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), unit); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), unit.material()); BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0()); @@ -162,8 +173,9 @@ BOOST_AUTO_TEST_CASE(CombineSlabsUnitZero) { // reverse input order { auto slab = combineSlabs(zero, unit); - BOOST_CHECK(slab.material()); - BOOST_CHECK_EQUAL(slab.material(), unit); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); + BOOST_CHECK_EQUAL(slab.material(), unit.material()); BOOST_CHECK_EQUAL(slab.thickness(), unit.thickness()); BOOST_CHECK_EQUAL(slab.thicknessInX0(), unit.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), unit.thicknessInL0()); @@ -178,10 +190,11 @@ BOOST_AUTO_TEST_CASE(CombineSlabsEqualThicknessVacuum) { const auto slabVac = Acts::MaterialSlab(Acts::Material(), 1.0f); { auto slab = combineSlabs(slabMat, slabVac); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); BOOST_CHECK_EQUAL(slab.thickness(), 2.0f); BOOST_CHECK_EQUAL(slab.thicknessInX0(), slabMat.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), slabMat.thicknessInL0()); - BOOST_CHECK(slab.material()); // atomic mass and nuclear charge are per atom, adding any amount vacuum // does not change the average atom properties only their density BOOST_CHECK_EQUAL(slab.material().Ar(), mat.Ar()); @@ -196,7 +209,8 @@ BOOST_AUTO_TEST_CASE(CombineSlabsEqualThicknessVacuum) { // reverse input order { auto slab = combineSlabs(slabVac, slabMat); - BOOST_CHECK(slab.material()); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); BOOST_CHECK_EQUAL(slab.thickness(), 2.0f); BOOST_CHECK_EQUAL(slab.thicknessInX0(), slabMat.thicknessInX0()); BOOST_CHECK_EQUAL(slab.thicknessInL0(), slabMat.thicknessInL0()); @@ -222,16 +236,21 @@ BOOST_AUTO_TEST_CASE(CombineSlabs) { const auto slabMat1 = Acts::MaterialSlab(mat1, 1.0f); // verify derived quantities for the input slabs. these tests are not really // needed, but to show the input values for the tests below. + BOOST_CHECK(slabMat0.isValid()); + BOOST_CHECK(slabMat0.material().isValid()); BOOST_CHECK_EQUAL(slabMat0.thickness(), 0.5f); BOOST_CHECK_EQUAL(slabMat0.thicknessInX0(), 0.5f); BOOST_CHECK_EQUAL(slabMat0.thicknessInL0(), 0.5f); + BOOST_CHECK(slabMat1.isValid()); + BOOST_CHECK(slabMat1.material().isValid()); BOOST_CHECK_EQUAL(slabMat1.thickness(), 1.0f); BOOST_CHECK_EQUAL(slabMat1.thicknessInX0(), 0.5f); BOOST_CHECK_EQUAL(slabMat1.thicknessInL0(), 0.5f); // check combined slabs { auto slab = combineSlabs(slabMat0, slabMat1); - BOOST_CHECK(slab.material()); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); BOOST_CHECK_EQUAL(slab.thickness(), 1.5f); BOOST_CHECK_EQUAL(slab.thicknessInX0(), 1.0f); BOOST_CHECK_EQUAL(slab.thicknessInL0(), 1.0f); @@ -246,7 +265,8 @@ BOOST_AUTO_TEST_CASE(CombineSlabs) { // reverse input order { auto slab = combineSlabs(slabMat0, slabMat1); - BOOST_CHECK(slab.material()); + BOOST_CHECK(slab.isValid()); + BOOST_CHECK(slab.material().isValid()); BOOST_CHECK_EQUAL(slab.thickness(), 1.5f); BOOST_CHECK_EQUAL(slab.thicknessInX0(), 1.0f); BOOST_CHECK_EQUAL(slab.thicknessInL0(), 1.0f); diff --git a/Tests/UnitTests/Core/Material/GridSurfaceMaterialTests.cpp b/Tests/UnitTests/Core/Material/GridSurfaceMaterialTests.cpp index 910f6c9960f..ed47cfcaf96 100644 --- a/Tests/UnitTests/Core/Material/GridSurfaceMaterialTests.cpp +++ b/Tests/UnitTests/Core/Material/GridSurfaceMaterialTests.cpp @@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(GridIndexedMaterial1D) { const Acts::MaterialSlab& mg4 = ism.materialSlab(g4); BOOST_CHECK_EQUAL(mg0.material().X0(), 1.); - BOOST_CHECK(!mg1.material()); + BOOST_CHECK(!mg1.material().isValid()); BOOST_CHECK_EQUAL(mg2.material().X0(), 11.); BOOST_CHECK_EQUAL(mg3.material().X0(), 11.); BOOST_CHECK_EQUAL(mg4.material().X0(), 21.); @@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(GridIndexedMaterial1D) { const Acts::MaterialSlab& ml4 = ism.materialSlab(l4); BOOST_CHECK_EQUAL(ml0.material().X0(), 1.); - BOOST_CHECK(!ml1.material()); + BOOST_CHECK(!ml1.material().isValid()); BOOST_CHECK_EQUAL(ml2.material().X0(), 11.); BOOST_CHECK_EQUAL(ml3.material().X0(), 11.); BOOST_CHECK_EQUAL(ml4.material().X0(), 21.); @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE(GridIndexedMaterial1D) { const Acts::MaterialSlab& sml4 = ism.materialSlab(l4); BOOST_CHECK_EQUAL(sml0.thickness(), 2.); - BOOST_CHECK(!sml1.material()); + BOOST_CHECK(!sml1.material().isValid()); BOOST_CHECK_EQUAL(sml2.thickness(), 4.); BOOST_CHECK_EQUAL(sml3.thickness(), 4.); BOOST_CHECK_EQUAL(sml4.thickness(), 6.); @@ -245,7 +245,7 @@ BOOST_AUTO_TEST_CASE(GridIndexedMaterial2D) { Acts::Vector3 g2(0.5, 0.5, -10.5); const Acts::MaterialSlab& mg2 = ism.materialSlab(g2); - BOOST_CHECK(!mg2.material()); // vacuum + BOOST_CHECK(!mg2.material().isValid()); // vacuum Acts::Vector3 g3(0.5, 0.5, -9.5); // should be material 3, same phi but different z @@ -306,7 +306,7 @@ BOOST_AUTO_TEST_CASE(GridGloballyIndexedMaterialNonShared) { const Acts::MaterialSlab& ml4 = ism.materialSlab(l4); BOOST_CHECK_EQUAL(ml0.material().X0(), 1.); - BOOST_CHECK(!ml1.material()); + BOOST_CHECK(!ml1.material().isValid()); BOOST_CHECK_EQUAL(ml2.material().X0(), 11.); BOOST_CHECK_EQUAL(ml3.material().X0(), 11.); BOOST_CHECK_EQUAL(ml4.material().X0(), 21.); diff --git a/Tests/UnitTests/Core/Material/InterpolatedMaterialMapTests.cpp b/Tests/UnitTests/Core/Material/InterpolatedMaterialMapTests.cpp index f75bd1e5176..60bdafc7062 100644 --- a/Tests/UnitTests/Core/Material/InterpolatedMaterialMapTests.cpp +++ b/Tests/UnitTests/Core/Material/InterpolatedMaterialMapTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2019 CERN for the benefit of the Acts project +// Copyright (C) 2019-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -57,8 +57,7 @@ BOOST_AUTO_TEST_CASE(InterpolatedMaterialMap_MaterialCell_test) { BOOST_CHECK_EQUAL(materialCell.isInside(Vector3(0., 0., 2.)), true); // Test the getter - CHECK_CLOSE_REL(materialCell.getMaterial({0.5, 0.5, 0.5}), Material(mat), - 1e-4); + BOOST_CHECK_EQUAL(materialCell.getMaterial({0.5, 0.5, 0.5}), Material(mat)); } BOOST_AUTO_TEST_CASE(InterpolatedMaterialMap_MaterialMapper_test) { @@ -77,12 +76,12 @@ BOOST_AUTO_TEST_CASE(InterpolatedMaterialMap_MaterialMapper_test) { MaterialMapper matMap(trafoGlobalToLocal, grid); // Test Material getter - CHECK_CLOSE_REL(matMap.getMaterial({0.5, 0.5, 0.5}), Material(mat), 1e-4); + BOOST_CHECK_EQUAL(matMap.getMaterial({0.5, 0.5, 0.5}), Material(mat)); // Test the MaterialCell getter MaterialMapper::MaterialCell matCell = matMap.getMaterialCell({0.5, 0.5, 0.5}); - CHECK_CLOSE_REL(matCell.getMaterial({0.5, 0.5, 0.5}), Material(mat), 1e-4); + BOOST_CHECK_EQUAL(matCell.getMaterial({0.5, 0.5, 0.5}), Material(mat)); // Test the number of bins getter std::vector nBins = matMap.getNBins(); @@ -137,7 +136,7 @@ BOOST_AUTO_TEST_CASE(InterpolatedMaterialMap_test) { InterpolatedMaterialMap ipolMatMap(std::move(matMap)); // Test the material getter - CHECK_CLOSE_REL(ipolMatMap.material({0.5, 0.5, 0.5}), Material(mat), 1e-4); + BOOST_CHECK_EQUAL(ipolMatMap.material({0.5, 0.5, 0.5}), Material(mat)); // Test the material getter with a cache // Build a material cell @@ -151,8 +150,8 @@ BOOST_AUTO_TEST_CASE(InterpolatedMaterialMap_test) { InterpolatedMaterialMap>::Cache cache; cache.matCell = materialCell; cache.initialized = true; - CHECK_CLOSE_REL(ipolMatMap.getMaterial(Vector3(0.5, 0.5, 0.5), cache), - Material(mat), 1e-4); + BOOST_CHECK_EQUAL(ipolMatMap.getMaterial(Vector3(0.5, 0.5, 0.5), cache), + Material(mat)); // Test the inside check BOOST_CHECK_EQUAL(ipolMatMap.isInside(Vector3(1., 1., 1.)), true); diff --git a/Tests/UnitTests/Core/Material/MaterialTests.cpp b/Tests/UnitTests/Core/Material/MaterialTests.cpp index 2df7c8c6183..0f339c3733e 100644 --- a/Tests/UnitTests/Core/Material/MaterialTests.cpp +++ b/Tests/UnitTests/Core/Material/MaterialTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2017-2018 CERN for the benefit of the Acts project +// Copyright (C) 2017-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -30,13 +30,13 @@ BOOST_AUTO_TEST_SUITE(Material) BOOST_AUTO_TEST_CASE(ConstructVacuum) { // default constructor builds invalid material a.k.a. vacuum Acts::Material vacuum; - BOOST_CHECK(!vacuum); + BOOST_CHECK(!vacuum.isValid()); } BOOST_AUTO_TEST_CASE(ConstructSomething) { // anything with non-zero Ar is a valid material auto notVacuum = Acts::Material::fromMolarDensity(1, 2, 3, 4, 5); - BOOST_CHECK(!!notVacuum); + BOOST_CHECK(notVacuum.isValid()); } BOOST_AUTO_TEST_CASE(Units) { diff --git a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp index 98c10e33767..fca2ae2fd98 100644 --- a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp +++ b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp @@ -280,7 +280,8 @@ BOOST_AUTO_TEST_CASE(VolumeMaterialMapper_comparison_tests) { std::vector matvector; double gridX0 = 0., gridL0 = 0., trueX0 = 0., trueL0 = 0.; for (unsigned int i = 0; i < stepResult.position.size(); i++) { - matvector.push_back(matGrid.atPosition(stepResult.position[i])); + matvector.push_back( + Acts::Material{matGrid.atPosition(stepResult.position[i])}); gridX0 += 1 / matvector[i].X0(); gridL0 += 1 / matvector[i].L0(); trueX0 += 1 / stepResult.matTrue[i].X0(); diff --git a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp index 90860e0cc44..72f00bcdc9d 100644 --- a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp @@ -27,6 +27,7 @@ #include "Acts/Propagator/AtlasStepper.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" @@ -183,7 +184,7 @@ BOOST_AUTO_TEST_CASE(UpdateFromBound) { auto newAbsMom = 0.9 * absMom; // example surface and bound parameters at the updated position - auto plane = Surface::makeShared(newPos, newUnitDir); + auto plane = CurvilinearSurface(newPos, newUnitDir).planeSurface(); auto params = BoundTrackParameters::create(plane, geoCtx, newPos4, newUnitDir, charge / absMom, cov, particleHypothesis) @@ -242,7 +243,7 @@ BOOST_AUTO_TEST_CASE(BuildBound) { particleHypothesis), stepSize, tolerance); // example surface at the current state position - auto plane = Surface::makeShared(pos, unitDir); + auto plane = CurvilinearSurface(pos, unitDir).planeSurface(); auto&& [pars, jac, pathLength] = stepper.boundState(state, *plane).value(); // check parameters @@ -578,8 +579,8 @@ BOOST_AUTO_TEST_CASE(StepSizeSurface) { stepSize, tolerance); auto distance = 10_mm; - auto target = Surface::makeShared( - pos + navDir * distance * unitDir, unitDir); + auto target = CurvilinearSurface(pos + navDir * distance * unitDir, unitDir) + .planeSurface(); stepper.updateSurfaceStatus(state, *target, 0, navDir, BoundaryTolerance::Infinite()); diff --git a/Tests/UnitTests/Core/Propagator/AuctioneerTests.cpp b/Tests/UnitTests/Core/Propagator/AuctioneerTests.cpp deleted file mode 100644 index 8d3a96158ea..00000000000 --- a/Tests/UnitTests/Core/Propagator/AuctioneerTests.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// This file is part of the Acts project. -// -// Copyright (C) 2016-2018 CERN for the benefit of the Acts project -// -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#include - -#include "Acts/Propagator/detail/Auctioneer.hpp" - -#include - -namespace Acts::Test { - -BOOST_AUTO_TEST_CASE(AuctioneerTest_VoidAuctioneer) { - // Build arbitrary vector - std::array vecArb = {0, 2, -5, 4}; - std::array vecRes = {false, true, false, true}; - // Let it run through auction - detail::VoidAuctioneer va; - std::array resultVa = va(vecArb); - // Test that vector did not change - BOOST_CHECK_EQUAL_COLLECTIONS(vecRes.begin(), vecRes.end(), resultVa.begin(), - resultVa.end()); -} - -BOOST_AUTO_TEST_CASE(AuctioneerTest_FirstValidAuctioneer) { - // Build arbitrary vector - std::array vecArb = {0, 1, -2, 4}; - // Let it run through auction - detail::FirstValidAuctioneer fva; - std::array resultFva = fva(vecArb); - std::array expected = {false, true, false, false}; - // Test that vector did not change - BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(), - resultFva.begin(), resultFva.end()); -} - -BOOST_AUTO_TEST_CASE(AuctioneerTest_HighestValidAuctioneer) { - // Build arbitrary vector - std::array vecArb = {0, 1, -2, 4}; - // Let it run through auction - detail::HighestValidAuctioneer fva; - std::array resultFva = fva(vecArb); - std::array expected = {false, false, false, true}; - // Test that vector did not change - BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(), - resultFva.begin(), resultFva.end()); -} -} // namespace Acts::Test diff --git a/Tests/UnitTests/Core/Propagator/CMakeLists.txt b/Tests/UnitTests/Core/Propagator/CMakeLists.txt index fa90e29b22a..34f3e88f23f 100644 --- a/Tests/UnitTests/Core/Propagator/CMakeLists.txt +++ b/Tests/UnitTests/Core/Propagator/CMakeLists.txt @@ -1,5 +1,4 @@ add_unittest(AtlasStepper AtlasStepperTests.cpp) -add_unittest(Auctioneer AuctioneerTests.cpp) add_unittest(ConstrainedStep ConstrainedStepTests.cpp) add_unittest(CovarianceEngine CovarianceEngineTests.cpp) add_unittest(DirectNavigator DirectNavigatorTests.cpp) diff --git a/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp b/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp index b8fd2280852..d914374ac23 100644 --- a/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp +++ b/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp @@ -97,7 +97,7 @@ BOOST_AUTO_TEST_CASE(covariance_engine_test) { // Repeat transport to surface FreeToBoundCorrection freeToBoundCorrection(false); - auto surface = Surface::makeShared(position, direction); + auto surface = CurvilinearSurface(position, direction).planeSurface(); detail::transportCovarianceToBound( tgContext, *surface, covariance, jacobian, transportJacobian, derivatives, boundToFreeJacobian, parameters, freeToBoundCorrection); diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index dbf6b7b8ad4..fc7175aaf85 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2018-2020 CERN for the benefit of the Acts project +// Copyright (C) 2018-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -12,7 +12,6 @@ #include "Acts/Definitions/Direction.hpp" #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Definitions/Units.hpp" -#include "Acts/EventData/Charge.hpp" #include "Acts/EventData/GenericBoundTrackParameters.hpp" #include "Acts/EventData/GenericCurvilinearTrackParameters.hpp" #include "Acts/EventData/ParticleHypothesis.hpp" @@ -34,16 +33,15 @@ #include "Acts/Propagator/AbortList.hpp" #include "Acts/Propagator/ActionList.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" -#include "Acts/Propagator/DefaultExtension.hpp" -#include "Acts/Propagator/DenseEnvironmentExtension.hpp" #include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/EigenStepperDefaultExtension.hpp" +#include "Acts/Propagator/EigenStepperDenseEnvironmentExtension.hpp" #include "Acts/Propagator/EigenStepperError.hpp" #include "Acts/Propagator/MaterialInteractor.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StepperExtensionList.hpp" -#include "Acts/Propagator/detail/Auctioneer.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/RectangleBounds.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -54,15 +52,11 @@ #include "Acts/Utilities/UnitVectors.hpp" #include -#include #include -#include #include -#include #include #include #include -#include #include #include #include @@ -369,7 +363,6 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { copy.geoContext = state.geoContext; copy.extension = state.extension; - copy.auctioneer = state.auctioneer; copy.stepData = state.stepData; return copy; @@ -448,7 +441,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { BOOST_CHECK_EQUAL(esStateCopy.previousStepSize, ps.stepping.previousStepSize); /// Repeat with surface related methods - auto plane = Surface::makeShared(pos, dir.normalized()); + auto plane = CurvilinearSurface(pos, dir.normalized()).planeSurface(); auto bp = BoundTrackParameters::create( plane, tgContext, makeVector4(pos, time), dir, charge / absMom, cov, ParticleHypothesis::pion()) @@ -458,7 +451,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { // Test the intersection in the context of a surface auto targetSurface = - Surface::makeShared(pos + navDir * 2. * dir, dir); + CurvilinearSurface(pos + navDir * 2. * dir, dir).planeSurface(); es.updateSurfaceStatus(esState, *targetSurface, 0, navDir, BoundaryTolerance::Infinite()); CHECK_CLOSE_ABS(esState.stepSize.value(ConstrainedStep::actor), navDir * 2., @@ -543,14 +536,13 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { BOOST_CHECK_EQUAL(res.error(), EigenStepperError::StepSizeAdjustmentFailed); } -/// @brief This function tests the EigenStepper with the DefaultExtension and -/// the DenseEnvironmentExtension. The focus of this tests lies in the -/// choosing of the right extension for the individual use case. This is +/// @brief This function tests the EigenStepper with the EigenStepperDefaultExtension and +/// the EigenStepperDenseEnvironmentExtension. The focus of this tests lies in +/// the choosing of the right extension for the individual use case. This is /// performed with three different detectors: /// a) Pure vacuum -> DefaultExtension needs to act /// b) Pure Be -> DenseEnvironmentExtension needs to act -/// c) Vacuum - Be - Vacuum -> Both should act and switch during the -/// propagation +/// c) Vacuum - Be - Vacuum -> Both should act and switch during the propagation // Test case a). The DenseEnvironmentExtension should state that it is not // valid in this case. @@ -585,9 +577,7 @@ BOOST_AUTO_TEST_CASE(step_extension_vacuum_test) { const CurvilinearTrackParameters sbtp(Vector4::Zero(), startDir, 1_e / 1_GeV, cov, ParticleHypothesis::pion()); - using Stepper = EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer>; + using Stepper = EigenStepper; using Propagator = Propagator; using PropagatorOptions = Propagator::Options, AbortList>; @@ -619,9 +609,7 @@ BOOST_AUTO_TEST_CASE(step_extension_vacuum_test) { CHECK_CLOSE_ABS(mom, startMom, 1_keV); } - using DefStepper = EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer>; + using DefStepper = EigenStepper; using DefPropagator = Acts::Propagator; using DefPropagatorOptions = DefPropagator::Options, AbortList>; @@ -684,9 +672,7 @@ BOOST_AUTO_TEST_CASE(step_extension_material_test) { const CurvilinearTrackParameters sbtp(Vector4::Zero(), startDir, 1_e / 5_GeV, cov, ParticleHypothesis::pion()); - using Stepper = EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer>; + using Stepper = EigenStepper; using Propagator = Propagator; using PropagatorOptions = Propagator::Options, AbortList>; @@ -727,9 +713,7 @@ BOOST_AUTO_TEST_CASE(step_extension_material_test) { } } - using DenseStepper = - EigenStepper, - detail::HighestValidAuctioneer>; + using DenseStepper = EigenStepper; using DensePropagator = Acts::Propagator; using DensePropagatorOptions = DensePropagator::Options, @@ -834,9 +818,7 @@ BOOST_AUTO_TEST_CASE(step_extension_vacmatvac_test) { 1_e / 5_GeV, Covariance::Identity(), ParticleHypothesis::pion()); - using Stepper = EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer>; + using Stepper = EigenStepper; using Propagator = Acts::Propagator; using PropagatorOptions = Propagator::Options, AbortList>; @@ -890,7 +872,7 @@ BOOST_AUTO_TEST_CASE(step_extension_vacmatvac_test) { // Build launcher through vacuum // Set options for propagator - using DefStepper = EigenStepper>; + using DefStepper = EigenStepper; using DefPropagator = Acts::Propagator; using DefPropagatorOptions = DefPropagator::Options, AbortList>; @@ -940,8 +922,7 @@ BOOST_AUTO_TEST_CASE(step_extension_vacmatvac_test) { // Set initial parameters for the particle track by using the result of the // first volume - using DenseStepper = EigenStepper< - StepperExtensionList>; + using DenseStepper = EigenStepper; using DensePropagator = Acts::Propagator; using DensePropagatorOptions = DensePropagator::Options, @@ -1071,9 +1052,7 @@ BOOST_AUTO_TEST_CASE(step_extension_trackercalomdt_test) { 1_e / 1_GeV, Covariance::Identity(), ParticleHypothesis::pion()); - using Stepper = EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer>; + using Stepper = EigenStepper; using Propagator = Acts::Propagator; using PropagatorOptions = Propagator::Options, diff --git a/Tests/UnitTests/Core/Propagator/JacobianEngineTests.cpp b/Tests/UnitTests/Core/Propagator/JacobianEngineTests.cpp index 6371c03afd5..899caf97277 100644 --- a/Tests/UnitTests/Core/Propagator/JacobianEngineTests.cpp +++ b/Tests/UnitTests/Core/Propagator/JacobianEngineTests.cpp @@ -33,11 +33,11 @@ BOOST_AUTO_TEST_CASE(jacobian_engine_to_bound) { double qop = 0.125; // Build a surface - auto pSurface = Surface::makeShared(position, direction); + auto pSurface = CurvilinearSurface(position, direction).planeSurface(); // Other rotated surface Vector3 odirection = Vector3(6., 2., 8.).normalized(); - auto oSurface = Surface::makeShared(position, odirection); + auto oSurface = CurvilinearSurface(position, odirection).planeSurface(); // The free parameter vector FreeVector freeParameters; @@ -108,7 +108,7 @@ BOOST_AUTO_TEST_CASE(jacobian_engine_to_curvilinear) { Vector3 direction = Vector3(5., 2., 7.).normalized(); // Build a surface, starting surface for curvilinear - auto pSurface = Surface::makeShared(position, direction); + auto pSurface = CurvilinearSurface(position, direction).planeSurface(); // Build covariance matrices for bound and free case BoundSquareMatrix boundCovariance = 0.025 * BoundSquareMatrix::Identity(); @@ -160,7 +160,7 @@ BOOST_AUTO_TEST_CASE(jacobian_engine_to_free) { Vector3 direction = Vector3(5., 2., 7.).normalized(); // Build a surface, starting surface for curvilinear - auto pSurface = Surface::makeShared(position, direction); + auto pSurface = CurvilinearSurface(position, direction).planeSurface(); // Build covariance matrices for bound and free case BoundSquareMatrix boundCovariance = 0.025 * BoundSquareMatrix::Identity(); diff --git a/Tests/UnitTests/Core/Propagator/JacobianTests.cpp b/Tests/UnitTests/Core/Propagator/JacobianTests.cpp index c58bab9ee69..9d43d22dbd1 100644 --- a/Tests/UnitTests/Core/Propagator/JacobianTests.cpp +++ b/Tests/UnitTests/Core/Propagator/JacobianTests.cpp @@ -18,6 +18,7 @@ #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Propagator/AtlasStepper.hpp" #include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" @@ -209,7 +210,7 @@ BOOST_AUTO_TEST_CASE(JacobianPlaneToGlobalTest) { Vector3 sNormal = Vector3(1.2, -0.3, 0.05).normalized(); // Create a surface & parameters with covariance on the surface - auto pSurface = Surface::makeShared(sPosition, sNormal); + auto pSurface = CurvilinearSurface(sPosition, sNormal).planeSurface(); Covariance cov; cov << 10_mm, 0, 0, 0, 0, 0, 0, 10_mm, 0, 0, 0, 0, 0, 0, 0.1, 0, 0, 0, 0, 0, diff --git a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp index 0d1638b43b4..27625c5ea5c 100644 --- a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2018-2020 CERN for the benefit of the Acts project +// Copyright (C) 2018-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -20,12 +20,12 @@ #include "Acts/MagneticField/ConstantBField.hpp" #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/MagneticField/NullBField.hpp" -#include "Acts/Propagator/DefaultExtension.hpp" #include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/EigenStepperDefaultExtension.hpp" #include "Acts/Propagator/MultiEigenStepperLoop.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StepperExtensionList.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Helpers.hpp" @@ -63,10 +63,8 @@ using namespace Acts::VectorHelpers; const MagneticFieldContext magCtx; const GeometryContext geoCtx; -using MultiStepperLoop = - MultiEigenStepperLoop, - MaxWeightReducerLoop>; -using SingleStepper = EigenStepper>; +using MultiStepperLoop = MultiEigenStepperLoop; +using SingleStepper = EigenStepper; const double defaultStepSize = 123.; const auto defaultNDir = Direction::Backward; @@ -131,8 +129,8 @@ auto makeDefaultBoundPars(bool cov = true, std::size_t n = 4, cov ? Opt{make_random_sym_matrix()} : Opt{}}); } - auto surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3{1., 0., 0.}); + auto surface = Acts::CurvilinearSurface(Vector3::Zero(), Vector3{1., 0., 0.}) + .planeSurface(); return MultiComponentBoundTrackParameters(surface, cmps, particleHypothesis); } @@ -295,8 +293,9 @@ void test_multi_stepper_vs_eigen_stepper() { std::vector>> cmps(4, {0.25, pars, cov}); - auto surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3::Ones().normalized()); + auto surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3::Ones().normalized()) + .planeSurface(); MultiComponentBoundTrackParameters multi_pars(surface, cmps, particleHypothesis); @@ -445,11 +444,13 @@ void test_multi_stepper_surface_status_update() { using MultiState = typename multi_stepper_t::State; using MultiStepper = multi_stepper_t; - auto start_surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3{1.0, 0.0, 0.0}); + auto start_surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3{1.0, 0.0, 0.0}) + .planeSurface(); - auto right_surface = Acts::Surface::makeShared( - Vector3{1.0, 0.0, 0.0}, Vector3{1.0, 0.0, 0.0}); + auto right_surface = + Acts::CurvilinearSurface(Vector3{1.0, 0.0, 0.0}, Vector3{1.0, 0.0, 0.0}) + .planeSurface(); std::vector>> cmps(2, {0.5, BoundVector::Zero(), std::nullopt}); @@ -554,11 +555,13 @@ void test_component_bound_state() { using MultiState = typename multi_stepper_t::State; using MultiStepper = multi_stepper_t; - auto start_surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3{1.0, 0.0, 0.0}); + auto start_surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3{1.0, 0.0, 0.0}) + .planeSurface(); - auto right_surface = Acts::Surface::makeShared( - Vector3{1.0, 0.0, 0.0}, Vector3{1.0, 0.0, 0.0}); + auto right_surface = + Acts::CurvilinearSurface(Vector3{1.0, 0.0, 0.0}, Vector3{1.0, 0.0, 0.0}) + .planeSurface(); std::vector>> cmps(2, {0.5, BoundVector::Zero(), std::nullopt}); @@ -632,8 +635,9 @@ void test_combined_bound_state_function() { using MultiState = typename multi_stepper_t::State; using MultiStepper = multi_stepper_t; - auto surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3{1.0, 0.0, 0.0}); + auto surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3{1.0, 0.0, 0.0}) + .planeSurface(); // Use Ones() here, so that the angles are in correct range const auto pars = BoundVector::Ones().eval(); @@ -677,8 +681,9 @@ void test_combined_curvilinear_state_function() { using MultiState = typename multi_stepper_t::State; using MultiStepper = multi_stepper_t; - auto surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3{1.0, 0.0, 0.0}); + auto surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3{1.0, 0.0, 0.0}) + .planeSurface(); // Use Ones() here, so that the angles are in correct range const auto pars = BoundVector::Ones().eval(); @@ -729,8 +734,9 @@ void test_single_component_interface_function() { cmps.push_back({0.25, BoundVector::Random(), BoundSquareMatrix::Random()}); } - auto surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3::Ones().normalized()); + auto surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3::Ones().normalized()) + .planeSurface(); MultiComponentBoundTrackParameters multi_pars(surface, cmps, particleHypothesis); @@ -815,8 +821,9 @@ void propagator_instatiation_test_function() { Propagator propagator( std::move(multi_stepper), Navigator{Navigator::Config{}}); - auto surface = Acts::Surface::makeShared( - Vector3::Zero(), Vector3{1.0, 0.0, 0.0}); + auto surface = + Acts::CurvilinearSurface(Vector3::Zero(), Vector3{1.0, 0.0, 0.0}) + .planeSurface(); using PropagatorOptions = typename Propagator::template Options<>; PropagatorOptions options(geoCtx, magCtx); diff --git a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp index dad3439cba7..d53ae87eb96 100644 --- a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2019 CERN for the benefit of the Acts project +// Copyright (C) 2016-2024 CERN for the benefit of the Acts project // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -23,13 +23,13 @@ #include "Acts/Propagator/AbortList.hpp" #include "Acts/Propagator/ActionList.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" -#include "Acts/Propagator/DenseEnvironmentExtension.hpp" #include "Acts/Propagator/EigenStepper.hpp" +#include "Acts/Propagator/EigenStepperDenseEnvironmentExtension.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StandardAborters.hpp" -#include "Acts/Propagator/StepperExtensionList.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/CylinderBounds.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" @@ -396,9 +396,10 @@ BOOST_AUTO_TEST_CASE(BasicPropagatorInterface) { VoidNavigator navigator{}; auto startSurface = - Surface::makeShared(Vector3::Zero(), Vector3::UnitX()); - auto targetSurface = Surface::makeShared( - Vector3::UnitX() * 20_mm, Vector3::UnitX()); + CurvilinearSurface(Vector3::Zero(), Vector3::UnitX()).planeSurface(); + auto targetSurface = + CurvilinearSurface(Vector3::UnitX() * 20_mm, Vector3::UnitX()) + .planeSurface(); BoundVector startPars; startPars << 0, 0, 0, M_PI / 2, 1 / 1_GeV, 0; @@ -475,8 +476,7 @@ BOOST_AUTO_TEST_CASE(BasicPropagatorInterface) { BOOST_CHECK(resultCurv.ok()); } - EigenStepper> - denseEigenStepper{field}; + EigenStepper denseEigenStepper{field}; { Propagator propagator{denseEigenStepper, navigator}; diff --git a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp index bbb9cb9b83a..527c727146f 100644 --- a/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/StraightLineStepperTests.cpp @@ -22,6 +22,7 @@ #include "Acts/Propagator/ConstrainedStep.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" @@ -319,7 +320,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { BOOST_CHECK_EQUAL(slsStateCopy.tolerance, ps.stepping.tolerance); /// Repeat with surface related methods - auto plane = Surface::makeShared(pos, dir); + auto plane = CurvilinearSurface(pos, dir).planeSurface(); auto bp = BoundTrackParameters::create( plane, tgContext, makeVector4(pos, time), dir, charge / absMom, cov, ParticleHypothesis::pion()) @@ -329,7 +330,7 @@ BOOST_AUTO_TEST_CASE(straight_line_stepper_test) { // Test the intersection in the context of a surface auto targetSurface = - Surface::makeShared(pos + navDir * 2. * dir, dir); + CurvilinearSurface(pos + navDir * 2. * dir, dir).planeSurface(); sls.updateSurfaceStatus(slsState, *targetSurface, 0, navDir, BoundaryTolerance::Infinite()); CHECK_CLOSE_ABS(slsState.stepSize.value(ConstrainedStep::actor), navDir * 2., diff --git a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp index 1ea875e5735..13edeaeaf91 100644 --- a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp @@ -34,15 +34,12 @@ #include "Acts/Propagator/AbortList.hpp" #include "Acts/Propagator/ActionList.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" -#include "Acts/Propagator/DefaultExtension.hpp" -#include "Acts/Propagator/DenseEnvironmentExtension.hpp" #include "Acts/Propagator/MaterialInteractor.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" -#include "Acts/Propagator/StepperExtensionList.hpp" #include "Acts/Propagator/SympyStepper.hpp" -#include "Acts/Propagator/detail/Auctioneer.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/RectangleBounds.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -445,7 +442,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { BOOST_CHECK_EQUAL(esStateCopy.previousStepSize, ps.stepping.previousStepSize); /// Repeat with surface related methods - auto plane = Surface::makeShared(pos, dir.normalized()); + auto plane = CurvilinearSurface(pos, dir.normalized()).planeSurface(); auto bp = BoundTrackParameters::create( plane, tgContext, makeVector4(pos, time), dir, charge / absMom, cov, ParticleHypothesis::pion()) @@ -455,7 +452,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { // Test the intersection in the context of a surface auto targetSurface = - Surface::makeShared(pos + navDir * 2. * dir, dir); + CurvilinearSurface(pos + navDir * 2. * dir, dir).planeSurface(); es.updateSurfaceStatus(esState, *targetSurface, 0, navDir, BoundaryTolerance::None()); CHECK_CLOSE_ABS(esState.stepSize.value(ConstrainedStep::actor), navDir * 2., diff --git a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp index 131e257c491..22f69a64109 100644 --- a/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/CylinderSurfaceTests.cpp @@ -195,13 +195,13 @@ BOOST_AUTO_TEST_CASE(CylinderSurfaceProperties) { testContext, offSurface, direction, BoundaryTolerance::Infinite()); Intersection3D expectedIntersect{Vector3{1, 1, 2}, 99., Intersection3D::Status::reachable}; - BOOST_CHECK(sfIntersection[0]); + BOOST_CHECK(sfIntersection[0].isValid()); CHECK_CLOSE_ABS(sfIntersection[0].position(), expectedIntersect.position(), 1e-9); CHECK_CLOSE_ABS(sfIntersection[0].pathLength(), expectedIntersect.pathLength(), 1e-9); // there is a second solution & and it should be valid - BOOST_CHECK(sfIntersection[1]); + BOOST_CHECK(sfIntersection[1].isValid()); // And it's path should be further away then the primary solution double pn = sfIntersection[0].pathLength(); double pa = sfIntersection[1].pathLength(); diff --git a/Tests/UnitTests/Core/Surfaces/IntersectionHelper2DTests.cpp b/Tests/UnitTests/Core/Surfaces/IntersectionHelper2DTests.cpp index 67c3d2a3555..5fc1c882378 100644 --- a/Tests/UnitTests/Core/Surfaces/IntersectionHelper2DTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/IntersectionHelper2DTests.cpp @@ -117,13 +117,13 @@ BOOST_AUTO_TEST_CASE(EllipseIntersection) { radiusX, radiusY, start, direction); // Numerically checked / per hand calculated - BOOST_CHECK(solution[0]); + BOOST_CHECK(solution[0].isValid()); CHECK_CLOSE_ABS(solution[0].position().x(), -283.68, 0.01); CHECK_CLOSE_ABS(solution[0].position().y(), -213.47, 0.01); BOOST_CHECK_GT(solution[0].pathLength(), 0.); - BOOST_CHECK(solution[1]); + BOOST_CHECK(solution[1].isValid()); CHECK_CLOSE_ABS(solution[1].position().x(), 433.65, 0.01); CHECK_CLOSE_ABS(solution[1].position().y(), 73.46, 0.01); @@ -147,13 +147,13 @@ BOOST_AUTO_TEST_CASE(CircleIntersection) { detail::IntersectionHelper2D::intersectCircle(radius, start, direction); // Numerically checked / per hand calculated - BOOST_CHECK(solution[0]); + BOOST_CHECK(solution[0].isValid()); CHECK_CLOSE_ABS(solution[0].position().x(), -266.771, 0.001); CHECK_CLOSE_ABS(solution[0].position().y(), -66.771, 0.001); BOOST_CHECK_GT(solution[0].pathLength(), 0.); - BOOST_CHECK(solution[1]); + BOOST_CHECK(solution[1].isValid()); CHECK_CLOSE_ABS(solution[1].position().x(), 66.771, 0.001); CHECK_CLOSE_ABS(solution[1].position().y(), 266.771, 0.001); @@ -165,12 +165,12 @@ BOOST_AUTO_TEST_CASE(CircleIntersection) { solution = detail::IntersectionHelper2D::intersectCircle(radius, start, direction); - BOOST_CHECK(solution[0]); + BOOST_CHECK(solution[0].isValid()); CHECK_CLOSE_ABS(solution[0].position().x(), 66.771, 0.001); CHECK_CLOSE_ABS(solution[0].position().y(), 266.771, 0.001); BOOST_CHECK_LT(solution[0].pathLength(), 0.); - BOOST_CHECK(solution[1]); + BOOST_CHECK(solution[1].isValid()); CHECK_CLOSE_ABS(solution[1].position().x(), -266.771, 0.001); CHECK_CLOSE_ABS(solution[1].position().y(), -66.771, 0.001); BOOST_CHECK_LT(solution[1].pathLength(), 0.); @@ -180,12 +180,12 @@ BOOST_AUTO_TEST_CASE(CircleIntersection) { solution = detail::IntersectionHelper2D::intersectCircle(radius, start, direction); - BOOST_CHECK(solution[0]); + BOOST_CHECK(solution[0].isValid()); CHECK_CLOSE_ABS(solution[0].position().x(), 66.771, 0.001); CHECK_CLOSE_ABS(solution[0].position().y(), 266.771, 0.001); BOOST_CHECK_GT(solution[0].pathLength(), 0.); - BOOST_CHECK(solution[1]); + BOOST_CHECK(solution[1].isValid()); CHECK_CLOSE_ABS(solution[1].position().x(), -266.771, 0.001); CHECK_CLOSE_ABS(solution[1].position().y(), -66.771, 0.001); BOOST_CHECK_GT(solution[1].pathLength(), 0.); diff --git a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp index 90a48df6a00..d52a15da8be 100644 --- a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp @@ -121,7 +121,7 @@ BOOST_AUTO_TEST_CASE(LineSurface_allNamedMethods_test) { line.intersect(tgContext, {0., 0., 0.}, direction.normalized(), BoundaryTolerance::Infinite()) .closest(); - BOOST_CHECK(sfIntersection); + BOOST_CHECK(sfIntersection.isValid()); Vector3 expectedIntersection(0, 1., 2.); CHECK_CLOSE_ABS(sfIntersection.position(), expectedIntersection, 1e-6); // need more tests.. @@ -357,4 +357,5 @@ BOOST_AUTO_TEST_CASE(LineSurfaceIntersection) { } BOOST_AUTO_TEST_SUITE_END() + } // namespace Acts::Test diff --git a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp index 96f0371735d..a6e8da997d6 100644 --- a/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp @@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceProperties) { .closest(); Intersection3D expectedIntersect{Vector3{0, 1, 2}, 4., Intersection3D::Status::reachable}; - BOOST_CHECK(sfIntersection); + BOOST_CHECK(sfIntersection.isValid()); BOOST_CHECK_EQUAL(sfIntersection.position(), expectedIntersect.position()); BOOST_CHECK_EQUAL(sfIntersection.pathLength(), expectedIntersect.pathLength()); diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp index eb7671e6733..55cbe668d58 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceIntersectionTests.cpp @@ -68,14 +68,14 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { BoundaryTolerance::None()); // Check the validity of the intersection - BOOST_CHECK(aIntersection[0]); + BOOST_CHECK(aIntersection[0].isValid()); // The status of this one should be on surface BOOST_CHECK_EQUAL(aIntersection[0].status(), Intersection3D::Status::reachable); // The intersection is at 2 meter distance CHECK_CLOSE_ABS(aIntersection[0].pathLength(), -2_m, s_onSurfaceTolerance); // There MUST be a second solution - BOOST_CHECK(aIntersection[1]); + BOOST_CHECK(aIntersection[1].isValid()); // The other intersection MUST be reachable BOOST_CHECK_EQUAL(aIntersection[1].status(), Intersection3D::Status::onSurface); @@ -85,12 +85,12 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { BoundaryTolerance::None()); // Check the validity of the intersection - BOOST_CHECK(cIntersection[0]); + BOOST_CHECK(cIntersection[0].isValid()); // The status of this one MUST be reachable BOOST_CHECK_EQUAL(cIntersection[0].status(), Intersection3D::Status::reachable); // There MUST be a second solution - BOOST_CHECK(cIntersection[1]); + BOOST_CHECK(cIntersection[1].isValid()); // The other intersection MUST be reachable BOOST_CHECK_EQUAL(cIntersection[1].status(), Intersection3D::Status::reachable); @@ -103,12 +103,12 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { BoundaryTolerance::None()); // Check the validity of the intersection - BOOST_CHECK(oIntersection[0]); + BOOST_CHECK(oIntersection[0].isValid()); // The status of this one MUST be reachable BOOST_CHECK_EQUAL(oIntersection[0].status(), Intersection3D::Status::reachable); // There MUST be a second solution - BOOST_CHECK(oIntersection[1]); + BOOST_CHECK(oIntersection[1].isValid()); // The other intersection MUST be reachable BOOST_CHECK_EQUAL(oIntersection[1].status(), Intersection3D::Status::reachable); @@ -128,14 +128,14 @@ BOOST_AUTO_TEST_CASE(CylinderIntersectionTests) { BoundaryTolerance::Infinite()); // Check the validity of the intersection - BOOST_CHECK(eIntersection[0]); + BOOST_CHECK(eIntersection[0].isValid()); // This should be the positive one BOOST_CHECK_LT(eIntersection[0].pathLength(), 0.); // The status of this one should be reachable BOOST_CHECK_EQUAL(eIntersection[0].status(), Intersection3D::Status::reachable); // There MUST be a second solution - BOOST_CHECK(eIntersection[1]); + BOOST_CHECK(eIntersection[1].isValid()); // The other intersection MUST be reachable BOOST_CHECK_EQUAL(eIntersection[1].status(), Intersection3D::Status::reachable); @@ -192,14 +192,14 @@ BOOST_AUTO_TEST_CASE(ConeIntersectionTest) { aCone->intersect(tgContext, onCone, transXY, BoundaryTolerance::None()); // Check the validity of the intersection - BOOST_CHECK(aIntersection[0]); + BOOST_CHECK(aIntersection[0].isValid()); // The status of this one should be on surface BOOST_CHECK_EQUAL(aIntersection[0].status(), Intersection3D::Status::reachable); // The intersection is at 4 mm distance CHECK_CLOSE_ABS(aIntersection[0].pathLength(), -4., s_onSurfaceTolerance); // There MUST be a second solution - BOOST_CHECK(aIntersection[1]); + BOOST_CHECK(aIntersection[1].isValid()); // The other intersection MUST be reachable BOOST_CHECK_EQUAL(aIntersection[1].status(), Intersection3D::Status::onSurface); @@ -250,7 +250,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(fIntersection[0]); + BOOST_CHECK(fIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(fIntersection[0].status(), Intersection3D::Status::reachable); @@ -263,7 +263,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { auto oIntersection = aPlane->intersect(tgContext, onit, direction, BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(oIntersection[0]); + BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(oIntersection[0].status(), Intersection3D::Status::onSurface); @@ -277,7 +277,7 @@ BOOST_AUTO_TEST_CASE(PlanarIntersectionTest) { auto bIntersection = aPlane->intersect(tgContext, after, direction, BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(bIntersection[0]); + BOOST_CHECK(bIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(bIntersection[0].status(), Intersection3D::Status::reachable); @@ -348,7 +348,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { auto fIntersection = aLine->intersect(tgContext, before, direction, BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(fIntersection[0]); + BOOST_CHECK(fIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(fIntersection[0].status(), Intersection3D::Status::reachable); @@ -361,7 +361,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { auto oIntersection = aLine->intersect(tgContext, onit1, direction, BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(oIntersection[0]); + BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(oIntersection[0].status(), Intersection3D::Status::onSurface); @@ -375,7 +375,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { oIntersection = aLine->intersect(tgContext, onitP, normalP, BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(oIntersection[0]); + BOOST_CHECK(oIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(oIntersection[0].status(), Intersection3D::Status::onSurface); @@ -389,7 +389,7 @@ BOOST_AUTO_TEST_CASE(LineIntersectionTest) { auto bIntersection = aLine->intersect(tgContext, after, direction, BoundaryTolerance::None()); // The intersection MUST be valid - BOOST_CHECK(bIntersection[0]); + BOOST_CHECK(bIntersection[0].isValid()); // The intersection MUST be reachable BOOST_CHECK_EQUAL(bIntersection[0].status(), Intersection3D::Status::reachable); diff --git a/Tests/UnitTests/Core/Surfaces/SurfaceLocalToGlobalRoundtripTests.cpp b/Tests/UnitTests/Core/Surfaces/SurfaceLocalToGlobalRoundtripTests.cpp index 005295928a4..8f3ff6e5f02 100644 --- a/Tests/UnitTests/Core/Surfaces/SurfaceLocalToGlobalRoundtripTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/SurfaceLocalToGlobalRoundtripTests.cpp @@ -17,6 +17,7 @@ #include "Acts/Definitions/Common.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Surfaces/ConeSurface.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" @@ -102,9 +103,9 @@ const auto perigees = bdata::make({ Surface::makeShared(Vector3(0, 0, -1.5)), }); const auto planes = bdata::make({ - Surface::makeShared(Vector3(1, 2, 3), Vector3::UnitX()), - Surface::makeShared(Vector3(-2, -3, -4), Vector3::UnitY()), - Surface::makeShared(Vector3(3, -4, 5), Vector3::UnitZ()), + CurvilinearSurface(Vector3(1, 2, 3), Vector3::UnitX()).planeSurface(), + CurvilinearSurface(Vector3(-2, -3, -4), Vector3::UnitY()).planeSurface(), + CurvilinearSurface(Vector3(3, -4, 5), Vector3::UnitZ()).planeSurface(), }); const auto straws = bdata::make({ Surface::makeShared(Transform3::Identity(), 2.0 /* radius */, diff --git a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp index 3569f6c9a9d..cb730f470a9 100644 --- a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp +++ b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp @@ -31,6 +31,7 @@ #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/CubicTrackingGeometry.hpp" @@ -307,8 +308,9 @@ BOOST_AUTO_TEST_CASE(ZeroFieldForward) { // this is the default option. set anyway for consistency options.propagatorPlainOptions.direction = Acts::Direction::Forward; // Construct a plane surface as the target surface - auto pSurface = Acts::Surface::makeShared( - Acts::Vector3{-3_m, 0., 0.}, Acts::Vector3{1., 0., 0}); + auto pSurface = Acts::CurvilinearSurface(Acts::Vector3{-3_m, 0., 0.}, + Acts::Vector3{1., 0., 0}) + .planeSurface(); Fixture::TestSourceLinkAccessor slAccessor; slAccessor.container = &f.sourceLinks; @@ -364,8 +366,9 @@ BOOST_AUTO_TEST_CASE(ZeroFieldBackward) { auto options = f.makeCkfOptions(); options.propagatorPlainOptions.direction = Acts::Direction::Backward; // Construct a plane surface as the target surface - auto pSurface = Acts::Surface::makeShared( - Acts::Vector3{3_m, 0., 0.}, Acts::Vector3{1., 0., 0}); + auto pSurface = Acts::CurvilinearSurface(Acts::Vector3{3_m, 0., 0.}, + Acts::Vector3{1., 0., 0}) + .planeSurface(); Fixture::TestSourceLinkAccessor slAccessor; slAccessor.container = &f.sourceLinks; diff --git a/Tests/UnitTests/Core/TrackFinding/TrackSelectorTests.cpp b/Tests/UnitTests/Core/TrackFinding/TrackSelectorTests.cpp index dfdf33885ed..01de2790874 100644 --- a/Tests/UnitTests/Core/TrackFinding/TrackSelectorTests.cpp +++ b/Tests/UnitTests/Core/TrackFinding/TrackSelectorTests.cpp @@ -15,6 +15,7 @@ #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/EventData/VectorTrackContainer.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/TrackFinding/TrackSelector.hpp" @@ -60,7 +61,7 @@ struct MockTrack { struct MockTrackState { const Surface& referenceSurface() const { static const auto srf = - Surface::makeShared(Vector3::Zero(), Vector3::UnitZ()); + CurvilinearSurface(Vector3::Zero(), Vector3::UnitZ()).planeSurface(); return *srf; } @@ -613,7 +614,7 @@ BOOST_AUTO_TEST_CASE(TestConstructor) { BOOST_AUTO_TEST_CASE(SubsetHitCountCut) { auto makeSurface = [](GeometryIdentifier id) { auto srf = - Surface::makeShared(Vector3::Zero(), Vector3::UnitZ()); + CurvilinearSurface(Vector3::Zero(), Vector3::UnitZ()).planeSurface(); srf->assignGeometryId(id); return srf; diff --git a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp index bef7ba52cd6..1b2500dc32a 100644 --- a/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp +++ b/Tests/UnitTests/Core/TrackFitting/FitterTestsCommon.hpp @@ -22,6 +22,7 @@ #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Tests/CommonHelpers/CubicTrackingGeometry.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" #include "Acts/Tests/CommonHelpers/MeasurementsCreator.hpp" @@ -340,7 +341,7 @@ struct FitterTester { Acts::Vector3 center(3._m, 0., 0.); Acts::Vector3 normal(1., 0., 0.); auto targetSurface = - Acts::Surface::makeShared(center, normal); + Acts::CurvilinearSurface(center, normal).planeSurface(); options.referenceSurface = targetSurface.get(); @@ -561,7 +562,7 @@ struct FitterTester { Acts::Vector3 center(-3._m, 0., 0.); Acts::Vector3 normal(1., 0., 0.); auto targetSurface = - Acts::Surface::makeShared(center, normal); + Acts::CurvilinearSurface(center, normal).planeSurface(); options.referenceSurface = targetSurface.get(); diff --git a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp index d9fc6581dc1..39959dfa0de 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfComponentMergingTests.cpp @@ -13,6 +13,7 @@ #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/TransformationHelpers.hpp" #include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/CylinderBounds.hpp" #include "Acts/Surfaces/CylinderSurface.hpp" #include "Acts/Surfaces/DiscSurface.hpp" @@ -21,7 +22,6 @@ #include "Acts/Surfaces/Surface.hpp" #include "Acts/Surfaces/SurfaceBounds.hpp" #include "Acts/TrackFitting/detail/GsfComponentMerging.hpp" -#include "Acts/Utilities/Identity.hpp" #include "Acts/Utilities/Intersection.hpp" #include "Acts/Utilities/Result.hpp" #include "Acts/Utilities/detail/periodic.hpp" @@ -215,7 +215,7 @@ using LocPosArray = std::array, 4>; template void test_surface(const Surface &surface, const angle_description_t &desc, const LocPosArray &loc_pos, double expectedError) { - const auto proj = Identity{}; + const auto proj = std::identity{}; for (auto phi : {-175_degree, 0_degree, 175_degree}) { for (auto theta : {5_degree, 90_degree, 175_degree}) { @@ -270,7 +270,7 @@ BOOST_AUTO_TEST_CASE(test_with_data) { const auto boundCov_data = boundCov(samples, mean_data); const auto [mean_test, boundCov_test] = - detail::gaussianMixtureMeanCov(cmps, Identity{}, std::tuple<>{}); + detail::gaussianMixtureMeanCov(cmps, std::identity{}, std::tuple<>{}); CHECK_CLOSE_MATRIX(mean_data, mean_test, 1.e-1); CHECK_CLOSE_MATRIX(boundCov_data, boundCov_test, 1.e-1); @@ -301,7 +301,7 @@ BOOST_AUTO_TEST_CASE(test_with_data_circular) { using detail::CyclicAngle; const auto d = std::tuple, CyclicAngle>{}; const auto [mean_test, boundCov_test] = - detail::gaussianMixtureMeanCov(cmps, Identity{}, d); + detail::gaussianMixtureMeanCov(cmps, std::identity{}, d); BOOST_CHECK(std::abs(detail::difference_periodic(mean_data[0], mean_test[0], 2 * M_PI)) < 1.e-1); @@ -314,7 +314,7 @@ BOOST_AUTO_TEST_CASE(test_plane_surface) { const auto desc = detail::AngleDescription::Desc{}; const auto surface = - Surface::makeShared(Vector3{0, 0, 0}, Vector3{1, 0, 0}); + CurvilinearSurface(Vector3{0, 0, 0}, Vector3{1, 0, 0}).planeSurface(); const LocPosArray p{{{1, 1}, {1, -1}, {-1, 1}, {-1, -1}}}; diff --git a/Tests/UnitTests/Core/TrackFitting/GsfMixtureReductionTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfMixtureReductionTests.cpp index 3daa93a59f6..6a8b1ff7cd4 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfMixtureReductionTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfMixtureReductionTests.cpp @@ -11,6 +11,7 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Definitions/Units.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/TrackFitting/GsfMixtureReduction.hpp" #include "Acts/TrackFitting/detail/SymmetricKlDistanceMatrix.hpp" @@ -116,8 +117,8 @@ BOOST_AUTO_TEST_CASE(test_mixture_reduction) { }; // Assume that the components are on a generic plane surface - auto surface = Acts::Surface::makeShared(Vector3{0, 0, 0}, - Vector3{1, 0, 0}); + auto surface = Acts::CurvilinearSurface(Vector3{0, 0, 0}, Vector3{1, 0, 0}) + .planeSurface(); const std::size_t NComps = 4; std::vector cmps; @@ -165,8 +166,8 @@ BOOST_AUTO_TEST_CASE(test_mixture_reduction) { } BOOST_AUTO_TEST_CASE(test_weight_cut_reduction) { - auto dummy = Acts::Surface::makeShared(Vector3{0, 0, 0}, - Vector3{1, 0, 0}); + auto dummy = Acts::CurvilinearSurface(Vector3{0, 0, 0}, Vector3{1, 0, 0}) + .planeSurface(); std::vector cmps; // weights do not need to be normalized for this test diff --git a/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp index 5549e63f631..47f6539a36c 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp @@ -30,6 +30,7 @@ #include "Acts/Propagator/Navigator.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/LineSurfaceStub.hpp" @@ -240,8 +241,7 @@ BOOST_AUTO_TEST_CASE(WithFinalMultiComponentState) { // create a boundless target surface near the tracker exit Acts::Vector3 center(-3._m, 0., 0.); Acts::Vector3 normal(1., 0., 0.); - auto targetSurface = - Acts::Surface::makeShared(center, normal); + auto targetSurface = Acts::CurvilinearSurface(center, normal).planeSurface(); options.referenceSurface = targetSurface.get(); diff --git a/Tests/UnitTests/Core/Utilities/IntersectionTests.cpp b/Tests/UnitTests/Core/Utilities/IntersectionTests.cpp index 076abbfe088..644371c45a4 100644 --- a/Tests/UnitTests/Core/Utilities/IntersectionTests.cpp +++ b/Tests/UnitTests/Core/Utilities/IntersectionTests.cpp @@ -9,6 +9,7 @@ #include #include "Acts/Definitions/Algebra.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Intersection.hpp" @@ -140,16 +141,16 @@ BOOST_AUTO_TEST_CASE(IntersectionTest) { /// test of the object intersection class BOOST_AUTO_TEST_CASE(ObjectIntersectionTest) { - auto psf6 = Surface::makeShared(Vector3(6., 0., 0.), - Vector3(1., 0., 0.)); - auto psf7 = Surface::makeShared(Vector3(7., 0., 0.), - Vector3(1., 0., 0.)); - auto psf8 = Surface::makeShared(Vector3(8., 0., 0.), - Vector3(1., 0., 0.)); - auto psf9 = Surface::makeShared(Vector3(9., 0., 0.), - Vector3(1., 0., 0.)); - auto psf10 = Surface::makeShared(Vector3(10., 0., 0.), - Vector3(1., 0., 0.)); + auto psf6 = CurvilinearSurface(Vector3(6., 0., 0.), Vector3(1., 0., 0.)) + .planeSurface(); + auto psf7 = CurvilinearSurface(Vector3(7., 0., 0.), Vector3(1., 0., 0.)) + .planeSurface(); + auto psf8 = CurvilinearSurface(Vector3(8., 0., 0.), Vector3(1., 0., 0.)) + .planeSurface(); + auto psf9 = CurvilinearSurface(Vector3(9., 0., 0.), Vector3(1., 0., 0.)) + .planeSurface(); + auto psf10 = CurvilinearSurface(Vector3(10., 0., 0.), Vector3(1., 0., 0.)) + .planeSurface(); using PlaneIntersection = ObjectIntersection; diff --git a/Tests/UnitTests/Fatras/Digitization/ChannelizerTests.cpp b/Tests/UnitTests/Fatras/Digitization/ChannelizerTests.cpp index b437bd78167..a498f0f5f75 100644 --- a/Tests/UnitTests/Fatras/Digitization/ChannelizerTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/ChannelizerTests.cpp @@ -9,6 +9,7 @@ #include #include "Acts/Definitions/Units.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Utilities/BinUtility.hpp" #include "ActsFatras/Digitization/Channelizer.hpp" @@ -30,8 +31,9 @@ struct Helper { ActsFatras::Channelizer channelizer; Helper() { - surface = Acts::Surface::makeShared( - Acts::Vector3::Zero(), Acts::Vector3{0.0, 0.0, 1.0}); + surface = Acts::CurvilinearSurface(Acts::Vector3::Zero(), + Acts::Vector3{0.0, 0.0, 1.0}) + .planeSurface(); float pitchSize = 50_um; float min = -200_um; diff --git a/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp b/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp index 70de42ee6c4..171564af1b9 100644 --- a/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp +++ b/Tests/UnitTests/Fatras/Digitization/PlanarSurfaceDriftTests.cpp @@ -11,6 +11,7 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/Tolerance.hpp" #include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" @@ -32,7 +33,7 @@ BOOST_AUTO_TEST_CASE(PlanarSurfaceDrift) { Acts::Vector3 cNormal = Acts::Vector3(1., 1., 1.).normalized(); auto planeSurface = - Acts::Surface::makeShared(cPosition, cNormal); + Acts::CurvilinearSurface(cPosition, cNormal).planeSurface(); double depletion = 0.250; diff --git a/Tests/UnitTests/Fatras/Kernel/SimulationActorTests.cpp b/Tests/UnitTests/Fatras/Kernel/SimulationActorTests.cpp index ee463e5a729..748bbb9af5e 100644 --- a/Tests/UnitTests/Fatras/Kernel/SimulationActorTests.cpp +++ b/Tests/UnitTests/Fatras/Kernel/SimulationActorTests.cpp @@ -16,6 +16,7 @@ #include "Acts/Material/MaterialSlab.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" #include "Acts/Propagator/Propagator.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" @@ -203,8 +204,9 @@ struct Fixture { // make a surface without material. std::shared_ptr makeEmptySurface() { - auto surface = Acts::Surface::makeShared( - Acts::Vector3(1, 2, 3), Acts::Vector3(1, 0, 0)); + auto surface = + Acts::CurvilinearSurface(Acts::Vector3(1, 2, 3), Acts::Vector3(1, 0, 0)) + .planeSurface(); return surface; } diff --git a/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp b/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp index ffd2ef2e7d4..58c430f4e4c 100644 --- a/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp +++ b/Tests/UnitTests/Plugins/EDM4hep/ConvertTrackEDM4hepTest.cpp @@ -19,6 +19,7 @@ #include "Acts/Plugins/EDM4hep/EDM4hepUtil.hpp" #include "Acts/Propagator/detail/CovarianceEngine.hpp" #include "Acts/Propagator/detail/JacobianEngine.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -106,8 +107,9 @@ BOOST_AUTO_TEST_CASE(ConvertTrackParametersToEdm4hepWithPerigee) { } BOOST_AUTO_TEST_CASE(ConvertTrackParametersToEdm4hepWithOutPerigee) { - auto planeSurface = Surface::makeShared( - Vector3{50, 30, 20}, Vector3{1, 1, 0.3}.normalized()); + auto planeSurface = + CurvilinearSurface(Vector3{50, 30, 20}, Vector3{1, 1, 0.3}.normalized()) + .planeSurface(); BoundVector par; par << 1_mm, 5_mm, M_PI / 4., M_PI_2 * 0.9, -1 / 1_GeV, 5_ns; @@ -204,8 +206,9 @@ BOOST_AUTO_TEST_CASE(ConvertTrackParametersToEdm4hepWithPerigeeNoCov) { } BOOST_AUTO_TEST_CASE(ConvertTrackParametersToEdm4hepWithOutPerigeeNoCov) { - auto refSurface = Surface::makeShared( - Vector3{50, 30, 20}, Vector3{1, 1, 0.3}.normalized()); + auto refSurface = + CurvilinearSurface(Vector3{50, 30, 20}, Vector3{1, 1, 0.3}.normalized()) + .planeSurface(); BoundVector par; par << 1_mm, 5_mm, M_PI / 4., M_PI_2, -1 / 1_GeV, 5_ns; diff --git a/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp b/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp index 7bc829a1c88..7004216a790 100644 --- a/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp +++ b/Tests/UnitTests/Plugins/Json/PortalJsonConverterTests.cpp @@ -14,6 +14,7 @@ #include "Acts/Detector/detail/PortalHelper.hpp" #include "Acts/Geometry/GeometryContext.hpp" #include "Acts/Plugins/Json/PortalJsonConverter.hpp" +#include "Acts/Surfaces/CurvilinearSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Tests/CommonHelpers/FloatComparisons.hpp" @@ -33,8 +34,9 @@ BOOST_AUTO_TEST_SUITE(PortalJsonConverter) BOOST_AUTO_TEST_CASE(PortalUnconnected) { std::ofstream out; - auto surface = Acts::Surface::makeShared( - Acts::Vector3(0., 0., 0.), Acts::Vector3(0., 1., 0.)); + auto surface = Acts::CurvilinearSurface(Acts::Vector3(0., 0., 0.), + Acts::Vector3(0., 1., 0.)) + .planeSurface(); auto portal = std::make_shared(std::move(surface)); @@ -66,8 +68,9 @@ BOOST_AUTO_TEST_CASE(PortalSingleConnected) { auto forwardVolume = std::make_shared(); auto backwardVolume = std::make_shared(); - auto surface = Acts::Surface::makeShared( - Acts::Vector3(0., 0., 0.), Acts::Vector3(0., 1., 0.)); + auto surface = Acts::CurvilinearSurface(Acts::Vector3(0., 0., 0.), + Acts::Vector3(0., 1., 0.)) + .planeSurface(); auto portal = std::make_shared(std::move(surface)); @@ -112,8 +115,9 @@ BOOST_AUTO_TEST_CASE(PortalMultiConnected) { auto backwardVolume = std::make_shared(); - auto surface = Acts::Surface::makeShared( - Acts::Vector3(0., 0., 0.), Acts::Vector3(0., 1., 0.)); + auto surface = Acts::CurvilinearSurface(Acts::Vector3(0., 0., 0.), + Acts::Vector3(0., 1., 0.)) + .planeSurface(); auto portal = std::make_shared(std::move(surface)); diff --git a/docs/core/propagation.md b/docs/core/propagation.md index 175278a0157..0c9b8259f76 100644 --- a/docs/core/propagation.md +++ b/docs/core/propagation.md @@ -108,22 +108,17 @@ The {class}`Acts::StraightLineStepper` is a very stripped down stepper that just ### EigenStepper -The {class}`Acts::EigenStepper` implements the same functionality as the ATLAS stepper, however, the stepping code is rewritten by using `Eigen` primitives. Thus, it also uses a 4th-order Runge-Kutta algorithm for the integration of the EOM. Additionally, the {class}`Acts::EigenStepper` allows to customize the concrete integration step via **extensions**. +The {class}`Acts::EigenStepper` implements the same functionality as the ATLAS stepper, however, the stepping code is rewritten by using `Eigen` primitives. Thus, it also uses a 4th-order Runge-Kutta algorithm for the integration of the EOM. Additionally, the {class}`Acts::EigenStepper` allows to customize the concrete integration step via **extension**. -The extensions encapsulate the relevant equations for different environments. There exists a {struct}`Acts::DefaultExtension` that is suited for propagation in a vacuum, and the {struct}`Acts::DenseEnvironmentExtension`, that contains additional code to handle the propagation inside materials. Which extension is used is selected by a bidding-system. +The extension encapsulate the relevant equations for different environments. There exists a {struct}`Acts::EigenStepperDefaultExtension` that is suited for propagation in a vacuum, and the {struct}`Acts::EigenStepperDenseEnvironmentExtension`, that contains additional code to handle the propagation inside materials. Which extension is used is decided by the user. -The extension can be configured via the {struct}`Acts::StepperExtensionList`: +The extension can be configured via the {class}`Acts::EigenStepper`: -```cpp -using Stepper = Acts::EigenStepper< - Acts::StepperExtensionList< - Acts::DefaultExtension, - Acts::DenseEnvironmentExtension - > - >; +```c++ +using Stepper = Acts::EigenStepper; ``` -By default, the {class}`Acts::EigenStepper` only uses the {struct}`Acts::DefaultExtension`. +By default, the {class}`Acts::EigenStepper` only uses the {struct}`Acts::EigenStepperDenseEnvironmentExtension`. ### MultiEigenStepperLoop