diff --git a/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp b/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp index e2494b35030..6cb85d74e75 100644 --- a/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp +++ b/Core/include/Acts/Material/PropagatorMaterialAssigner.hpp @@ -134,8 +134,10 @@ class PropagatorMaterialAssigner final : public IAssignmentFinder { using ActionList = ActionList; using AbortList = AbortList; + using PropagatorOptions = + typename propagator_t::template Options; - PropagatorOptions options(gctx, mctx); + PropagatorOptions options(gctx, mctx); const auto& result = m_propagator.propagate(start, options).value(); diff --git a/Core/include/Acts/Navigation/DetectorNavigator.hpp b/Core/include/Acts/Navigation/DetectorNavigator.hpp index b9fcae83728..cc6f0aad0c3 100644 --- a/Core/include/Acts/Navigation/DetectorNavigator.hpp +++ b/Core/include/Acts/Navigation/DetectorNavigator.hpp @@ -16,6 +16,7 @@ #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Geometry/Layer.hpp" #include "Acts/Navigation/NavigationState.hpp" +#include "Acts/Propagator/NavigatorOptions.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -46,6 +47,12 @@ class DetectorNavigator { bool resolvePassive = false; }; + struct Options : public NavigatorPlainOptions { + void setPlainOptions(const NavigatorPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// Nested State struct /// /// It acts as an internal state which is diff --git a/Core/include/Acts/Propagator/AtlasStepper.hpp b/Core/include/Acts/Propagator/AtlasStepper.hpp index c4bad4561e8..f84d02cd543 100644 --- a/Core/include/Acts/Propagator/AtlasStepper.hpp +++ b/Core/include/Acts/Propagator/AtlasStepper.hpp @@ -20,6 +20,7 @@ #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/MagneticField/MagneticFieldProvider.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" +#include "Acts/Propagator/StepperOptions.hpp" #include "Acts/Propagator/detail/SteppingHelper.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Intersection.hpp" @@ -40,6 +41,16 @@ class AtlasStepper { using CurvilinearState = std::tuple; + struct Config { + std::shared_ptr bField; + }; + + struct Options : public StepperPlainOptions { + void setPlainOptions(const StepperPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// @brief Nested State struct for the local caching struct State { /// Default constructor - deleted @@ -296,9 +307,11 @@ class AtlasStepper { std::size_t debugMsgWidth = 50; }; - AtlasStepper(std::shared_ptr bField) + explicit AtlasStepper(std::shared_ptr bField) : m_bField(std::move(bField)) {} + explicit AtlasStepper(const Config& config) : m_bField(config.bField) {} + State makeState(std::reference_wrapper gctx, std::reference_wrapper mctx, const BoundTrackParameters& par, @@ -1258,7 +1271,7 @@ class AtlasStepper { 2. * h * (std::abs((A1 + A6) - (A3 + A4)) + std::abs((B1 + B6) - (B3 + B4)) + std::abs((C1 + C6) - (C3 + C4))); - if (std::abs(EST) > std::abs(state.options.stepTolerance)) { + if (std::abs(EST) > std::abs(state.options.stepping.stepTolerance)) { h = h * .5; // neutralize the sign of h again state.stepping.stepSize.setAccuracy(h * state.options.direction); diff --git a/Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp b/Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp index bb209a2a123..68868de8a92 100644 --- a/Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp +++ b/Core/include/Acts/Propagator/DenseEnvironmentExtension.hpp @@ -81,7 +81,7 @@ struct DenseEnvironmentExtension { // Check for valid particle properties if (absQ == 0. || mass == 0. || stepper.absoluteMomentum(state.stepping) < - state.options.momentumCutOff) { + state.options.stepping.dense.momentumCutOff) { return 0; } @@ -141,7 +141,7 @@ struct DenseEnvironmentExtension { } else { // Update parameters and check for momentum condition updateEnergyLoss(mass, h, state, stepper, i); - if (currentMomentum < state.options.momentumCutOff) { + if (currentMomentum < state.options.stepping.dense.momentumCutOff) { return false; } // Evaluate k @@ -183,7 +183,7 @@ struct DenseEnvironmentExtension { (h / 6.) * (dPds[0] + 2. * (dPds[1] + dPds[2]) + dPds[3]); // Break propagation if momentum becomes below cut-off - if (newMomentum < state.options.momentumCutOff) { + if (newMomentum < state.options.stepping.dense.momentumCutOff) { return false; } @@ -395,7 +395,7 @@ struct DenseEnvironmentExtension { // use unit length as thickness to compute the energy loss per unit length Acts::MaterialSlab slab(material, 1); // Use the same energy loss throughout the step. - if (state.options.meanEnergyLoss) { + if (state.options.stepping.dense.meanEnergyLoss) { g = -computeEnergyLossMean(slab, absPdg, mass, static_cast(qop[0]), absQ); } else { @@ -410,8 +410,8 @@ struct DenseEnvironmentExtension { if (state.stepping.covTransport) { // Calculate the change of the energy loss per path length and // inverse momentum - if (state.options.includeGradient) { - if (state.options.meanEnergyLoss) { + if (state.options.stepping.dense.includeGradient) { + if (state.options.stepping.dense.meanEnergyLoss) { dgdqopValue = deriveEnergyLossMeanQOverP( slab, absPdg, mass, static_cast(qop[0]), absQ); } else { @@ -458,58 +458,4 @@ struct DenseEnvironmentExtension { } }; -template , - typename aborter_list_t = AbortList<>> -struct DenseStepperPropagatorOptions - : public PropagatorOptions { - /// Copy Constructor - DenseStepperPropagatorOptions( - const DenseStepperPropagatorOptions& - dspo) = default; - - /// Constructor with GeometryContext - /// - /// @param gctx The current geometry context object, e.g. alignment - /// @param mctx The current magnetic fielc context object - DenseStepperPropagatorOptions(const GeometryContext& gctx, - const MagneticFieldContext& mctx) - : PropagatorOptions(gctx, mctx) {} - - /// Toggle between mean and mode evaluation of energy loss - bool meanEnergyLoss = true; - - /// Boolean flag for inclusion of d(dEds)d(q/p) into energy loss - bool includeGradient = true; - - /// Cut-off value for the momentum in SI units - double momentumCutOff = 0.; - - /// @brief Expand the Options with extended aborters - /// - /// @tparam extended_aborter_list_t Type of the new aborter list - /// - /// @param aborters The new aborter list to be used (internally) - template - DenseStepperPropagatorOptions extend( - extended_aborter_list_t aborters) const { - DenseStepperPropagatorOptions - eoptions(this->geoContext, this->magFieldContext); - - // Copy the options over - eoptions.setPlainOptions(*this); - - // Action / abort list - eoptions.actionList = std::move(this->actionList); - eoptions.abortList = std::move(aborters); - - // Copy dense environment specific parameters - eoptions.meanEnergyLoss = meanEnergyLoss; - eoptions.includeGradient = includeGradient; - eoptions.momentumCutOff = momentumCutOff; - - // And return the options - return eoptions; - } -}; - } // namespace Acts diff --git a/Core/include/Acts/Propagator/DirectNavigator.hpp b/Core/include/Acts/Propagator/DirectNavigator.hpp index d05531bcb36..e85cde96dca 100644 --- a/Core/include/Acts/Propagator/DirectNavigator.hpp +++ b/Core/include/Acts/Propagator/DirectNavigator.hpp @@ -12,6 +12,7 @@ #include "Acts/Geometry/Layer.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/Geometry/TrackingVolume.hpp" +#include "Acts/Propagator/NavigatorOptions.hpp" #include "Acts/Propagator/Propagator.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Intersection.hpp" @@ -35,9 +36,7 @@ class DirectNavigator { using SurfaceSequence = std::vector; using SurfaceIter = std::vector::iterator; - DirectNavigator(std::unique_ptr _logger = - getDefaultLogger("DirectNavigator", Logging::INFO)) - : m_logger{std::move(_logger)} {} + struct Config {}; /// @brief Nested Actor struct, called Initializer /// @@ -127,6 +126,16 @@ class DirectNavigator { bool navigationBreak = false; }; + struct Options : public NavigatorPlainOptions { + void setPlainOptions(const NavigatorPlainOptions& options) { + static_cast(*this) = options; + } + }; + + DirectNavigator(std::unique_ptr _logger = + getDefaultLogger("DirectNavigator", Logging::INFO)) + : m_logger{std::move(_logger)} {} + State makeState(const Surface* startSurface, const Surface* targetSurface) const { State result; diff --git a/Core/include/Acts/Propagator/EigenStepper.hpp b/Core/include/Acts/Propagator/EigenStepper.hpp index 7b318dbf32b..f1c9f2995eb 100644 --- a/Core/include/Acts/Propagator/EigenStepper.hpp +++ b/Core/include/Acts/Propagator/EigenStepper.hpp @@ -22,6 +22,7 @@ #include "Acts/Propagator/EigenStepperError.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" @@ -57,6 +58,16 @@ class EigenStepper { using CurvilinearState = std::tuple; + struct Config { + std::shared_ptr bField; + }; + + struct Options : public StepperPlainOptions { + void setPlainOptions(const StepperPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// @brief State for track parameter propagation /// /// It contains the stepping information and is provided thread local @@ -165,6 +176,11 @@ class EigenStepper { /// @param bField The magnetic field provider explicit EigenStepper(std::shared_ptr bField); + /// @brief Constructor with configuration + /// + /// @param [in] config The configuration of the stepper + explicit EigenStepper(const Config& config) : m_bField(config.bField) {} + State makeState(std::reference_wrapper gctx, std::reference_wrapper mctx, const BoundTrackParameters& par, diff --git a/Core/include/Acts/Propagator/EigenStepper.ipp b/Core/include/Acts/Propagator/EigenStepper.ipp index e1633765456..ea2834b61b0 100644 --- a/Core/include/Acts/Propagator/EigenStepper.ipp +++ b/Core/include/Acts/Propagator/EigenStepper.ipp @@ -187,7 +187,7 @@ Acts::Result Acts::EigenStepper::step( // Whether to use fast power function if available constexpr bool tryUseFastPow{false}; - double x = state.options.stepTolerance / errorEstimate_; + double x = state.options.stepping.stepTolerance / errorEstimate_; if constexpr (exponent == 0.25 && !tryUseFastPow) { // This is 3x faster than std::pow @@ -206,7 +206,8 @@ Acts::Result Acts::EigenStepper::step( // For details about these values see ATL-SOFT-PUB-2009-001 constexpr double marginFactor = 4.0; - return errorEstimate_ <= marginFactor * state.options.stepTolerance; + return errorEstimate_ <= + marginFactor * state.options.stepping.stepTolerance; }; // The following functor starts to perform a Runge-Kutta step of a certain @@ -284,14 +285,14 @@ Acts::Result Acts::EigenStepper::step( // If step size becomes too small the particle remains at the initial // place - if (std::abs(h) < std::abs(state.options.stepSizeCutOff)) { + if (std::abs(h) < std::abs(state.options.stepping.stepSizeCutOff)) { // Not moving due to too low momentum needs an aborter return EigenStepperError::StepSizeStalled; } // If the parameter is off track too much or given stepSize is not // appropriate - if (nStepTrials > state.options.maxRungeKuttaStepTrials) { + if (nStepTrials > state.options.stepping.maxRungeKuttaStepTrials) { // Too many trials, have to abort return EigenStepperError::StepSizeAdjustmentFailed; } diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index ccb0afe4e3d..41e68890c94 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -23,6 +23,7 @@ #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/EigenStepperError.hpp" #include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/StepperOptions.hpp" #include "Acts/Propagator/detail/LoopStepperUtils.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Intersection.hpp" @@ -256,12 +257,15 @@ class MultiEigenStepperLoop /// @brief How many components can this stepper manage? static constexpr int maxComponents = std::numeric_limits::max(); - /// Constructor from a magnetic field and a optionally provided Logger - MultiEigenStepperLoop(std::shared_ptr bField, - std::unique_ptr logger = - getDefaultLogger("GSF", Logging::INFO)) - : EigenStepper(std::move(bField)), - m_logger(std::move(logger)) {} + struct Config { + std::shared_ptr bField; + }; + + struct Options : public StepperPlainOptions { + void setPlainOptions(const StepperPlainOptions& options) { + static_cast(*this) = options; + } + }; struct State { /// The struct that stores the individual components @@ -332,6 +336,20 @@ class MultiEigenStepperLoop } }; + /// Constructor from a magnetic field and a optionally provided Logger + MultiEigenStepperLoop(std::shared_ptr bField, + std::unique_ptr logger = + getDefaultLogger("GSF", Logging::INFO)) + : 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)) {} + /// Construct and initialize a state State makeState(std::reference_wrapper gctx, std::reference_wrapper mctx, diff --git a/Core/include/Acts/Propagator/Navigator.hpp b/Core/include/Acts/Propagator/Navigator.hpp index 67d9ddd2a89..61f0b96fafa 100644 --- a/Core/include/Acts/Propagator/Navigator.hpp +++ b/Core/include/Acts/Propagator/Navigator.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 @@ -14,6 +14,7 @@ #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/Geometry/TrackingVolume.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" +#include "Acts/Propagator/NavigatorOptions.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Utilities/Logger.hpp" #include "Acts/Utilities/StringHelpers.hpp" @@ -111,6 +112,12 @@ class Navigator { bool resolvePassive = false; }; + struct Options : public NavigatorPlainOptions { + void setPlainOptions(const NavigatorPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// @brief Nested State struct /// /// It acts as an internal state which is created for every propagation and diff --git a/Core/include/Acts/Propagator/NavigatorOptions.hpp b/Core/include/Acts/Propagator/NavigatorOptions.hpp new file mode 100644 index 00000000000..266fd4adb20 --- /dev/null +++ b/Core/include/Acts/Propagator/NavigatorOptions.hpp @@ -0,0 +1,15 @@ +// This file is part of the Acts project. +// +// Copyright (C) 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 +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#pragma once + +namespace Acts { + +struct NavigatorPlainOptions {}; + +} // namespace Acts diff --git a/Core/include/Acts/Propagator/Propagator.hpp b/Core/include/Acts/Propagator/Propagator.hpp index 036650d9f99..576a221bc43 100644 --- a/Core/include/Acts/Propagator/Propagator.hpp +++ b/Core/include/Acts/Propagator/Propagator.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2023 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 @@ -22,6 +22,9 @@ #include "Acts/MagneticField/MagneticFieldContext.hpp" #include "Acts/Propagator/AbortList.hpp" #include "Acts/Propagator/ActionList.hpp" +#include "Acts/Propagator/PropagatorOptions.hpp" +#include "Acts/Propagator/PropagatorResult.hpp" +#include "Acts/Propagator/PropagatorState.hpp" #include "Acts/Propagator/PropagatorTraits.hpp" #include "Acts/Propagator/StandardAborters.hpp" #include "Acts/Propagator/StepperConcept.hpp" @@ -34,152 +37,6 @@ namespace Acts { -/// @brief Different stages during propagation -enum class PropagatorStage { - invalid, ///< Invalid stage - prePropagation, ///< Before the propagation - postPropagation, ///< After the propagation - preStep, ///< Before a step - postStep, ///< After a step -}; - -/// @brief Simple class holding result of propagation call -/// -/// @tparam parameters_t Type of final track parameters -/// @tparam result_list Result pack for additional propagation -/// quantities -template -struct PropagatorResult : private detail::Extendable { - using detail::Extendable::get; - using detail::Extendable::tuple; - - /// Final track parameters - std::optional endParameters = std::nullopt; - - /// Full transport jacobian - std::optional transportJacobian = std::nullopt; - - /// Number of propagation steps that were carried out - std::size_t steps = 0; - - /// Signed distance over which the parameters were propagated - double pathLength = 0.; -}; - -/// @brief Class holding the trivial options in propagator options -/// -struct PropagatorPlainOptions { - /// Propagation direction - Direction direction = Direction::Forward; - - /// Maximum number of steps for one propagate call - unsigned int maxSteps = 1000; - - /// Absolute maximum path length - double pathLimit = std::numeric_limits::max(); - - /// Required tolerance to reach surface - double surfaceTolerance = s_onSurfaceTolerance; - - /// Loop protection step, it adapts the pathLimit - bool loopProtection = true; - double loopFraction = 0.5; ///< Allowed loop fraction, 1 is a full loop - - // Configurations for Stepper - - /// Tolerance for the error of the integration - double stepTolerance = 1e-4; - - /// Cut-off value for the step size - double stepSizeCutOff = 0.; - - /// Absolute maximum step size - double maxStepSize = std::numeric_limits::max(); - - /// Maximum number of Runge-Kutta steps for the stepper step call - unsigned int maxRungeKuttaStepTrials = 10000; -}; - -/// @brief Options for propagate() call -/// -/// @tparam action_list_t List of action types called after each -/// propagation step with the current propagation and stepper state -/// -/// @tparam aborter_list_t List of abort conditions tested after each -/// propagation step using the current propagation and stepper state -/// -template , - typename aborter_list_t = AbortList<>> -struct PropagatorOptions : public PropagatorPlainOptions { - using action_list_type = action_list_t; - using aborter_list_type = aborter_list_t; - - /// Delete default constructor - PropagatorOptions() = delete; - - /// PropagatorOptions copy constructor - PropagatorOptions( - const PropagatorOptions& po) = default; - - /// PropagatorOptions with context - PropagatorOptions(const GeometryContext& gctx, - const MagneticFieldContext& mctx) - : geoContext(gctx), magFieldContext(mctx) {} - - /// @brief Expand the Options with extended aborters - /// - /// @tparam extended_aborter_list_t Type of the new aborter list - /// - /// @param aborters The new aborter list to be used (internally) - template - PropagatorOptions extend( - extended_aborter_list_t aborters) const { - PropagatorOptions eoptions( - geoContext, magFieldContext); - - // Copy the options over - eoptions.setPlainOptions(*this); - - // Action / abort list - eoptions.actionList = std::move(actionList); - eoptions.abortList = std::move(aborters); - - // And return the options - return eoptions; - } - - /// @brief Set the plain options - /// - /// @param pOptions The plain options - void setPlainOptions(const PropagatorPlainOptions& pOptions) { - // Copy the options over - direction = pOptions.direction; - maxSteps = pOptions.maxSteps; - surfaceTolerance = pOptions.surfaceTolerance; - pathLimit = direction * std::abs(pOptions.pathLimit); - loopProtection = pOptions.loopProtection; - loopFraction = pOptions.loopFraction; - - // Stepper options - stepTolerance = pOptions.stepTolerance; - stepSizeCutOff = pOptions.stepSizeCutOff; - maxStepSize = pOptions.maxStepSize; - maxRungeKuttaStepTrials = pOptions.maxRungeKuttaStepTrials; - } - - /// List of actions - action_list_t actionList; - - /// List of abort conditions - aborter_list_t abortList; - - /// The context object for the geometry - std::reference_wrapper geoContext; - - /// The context object for the magnetic field - std::reference_wrapper magFieldContext; -}; - /// Common simplified base interface for propagators. /// /// This class only supports propagation from start bound parameters to a target @@ -189,7 +46,7 @@ struct PropagatorOptions : public PropagatorPlainOptions { class BasePropagator { public: /// Base propagator options - using Options = PropagatorOptions<>; + using Options = PropagatorPlainOptions; /// Method to propagate start bound track parameters to a target surface. /// @param start The start bound track parameters. @@ -285,6 +142,19 @@ class Propagator final /// Typedef the navigator state using NavigatorState = typename navigator_t::State; + template + using State = PropagatorState; + + using StepperOptions = typename stepper_t::Options; + + using NavigatorOptions = typename navigator_t::Options; + + template , + typename aborter_list_t = AbortList<>> + using Options = PropagatorOptions; + /// Constructor from implementation object /// /// @param stepper The stepper implementation is moved to a private member @@ -297,55 +167,6 @@ class Propagator final m_navigator(std::move(navigator)), m_logger{std::move(_logger)} {} - /// @brief private Propagator state for navigation and debugging - /// - /// @tparam propagator_options_t Type of the Objections object - /// - /// This struct holds the common state information for propagating - /// which is independent of the actual stepper implementation. - template - struct State : private detail::Extendable { - using options_type = propagator_options_t; - - /// Create the propagator state from the options - /// - /// @tparam propagator_options_t the type of the propagator options - /// - /// @param topts The options handed over by the propagate call - /// @param steppingIn Stepper state instance to begin with - /// @param navigationIn Navigator state instance to begin with - State(const propagator_options_t& topts, StepperState steppingIn, - NavigatorState navigationIn) - : options(topts), - stepping{std::move(steppingIn)}, - navigation{std::move(navigationIn)}, - geoContext(topts.geoContext) {} - - using detail::Extendable::get; - using detail::Extendable::tuple; - - /// Propagation stage - PropagatorStage stage = PropagatorStage::invalid; - - /// These are the options - provided for each propagation step - propagator_options_t options; - - /// Stepper state - internal state of the Stepper - StepperState stepping; - - /// Navigation state - internal state of the Navigator - NavigatorState navigation; - - /// Context object for the geometry - std::reference_wrapper geoContext; - - /// Number of propagation steps that were carried out - std::size_t steps = 0; - - /// Signed distance over which the parameters were propagated - double pathLength = 0.; - }; - private: /// @brief Helper struct determining the state's type /// @@ -413,7 +234,6 @@ class Propagator final using action_list_t_result_t = typename result_type_helper::type; - public: /// @brief Propagate track parameters /// /// This function performs the propagation of the track parameters using the diff --git a/Core/include/Acts/Propagator/Propagator.ipp b/Core/include/Acts/Propagator/Propagator.ipp index ee4b7034534..8850b86e889 100644 --- a/Core/include/Acts/Propagator/Propagator.ipp +++ b/Core/include/Acts/Propagator/Propagator.ipp @@ -167,7 +167,7 @@ auto Acts::Propagator::makeState( StateType state{ eOptions, m_stepper.makeState(eOptions.geoContext, eOptions.magFieldContext, start, - eOptions.maxStepSize), + eOptions.stepping.maxStepSize), m_navigator.makeState(&start.referenceSurface(), nullptr)}; static_assert( @@ -208,7 +208,7 @@ auto Acts::Propagator::makeState( StateType state{ eOptions, m_stepper.makeState(eOptions.geoContext, eOptions.magFieldContext, start, - eOptions.maxStepSize), + eOptions.stepping.maxStepSize), m_navigator.makeState(&start.referenceSurface(), &target)}; static_assert( @@ -339,6 +339,9 @@ Acts::detail::BasePropagatorHelper::propagateToSurface( const Options& options) const { using ResultType = Result>>; + using DerivedOptions = typename derived_t::template Options<>; + + DerivedOptions derivedOptions(options); // dummy initialization ResultType res = ResultType::failure(PropagatorError::Failure); @@ -347,14 +350,14 @@ Acts::detail::BasePropagatorHelper::propagateToSurface( // is sometimes not met. if (target.type() == Surface::SurfaceType::Perigee) { res = static_cast(this) - ->template propagate, + ->template propagate( - start, target, options); + start, target, derivedOptions); } else { res = static_cast(this) - ->template propagate, + ->template propagate( - start, target, options); + start, target, derivedOptions); } if (res.ok()) { diff --git a/Core/include/Acts/Propagator/PropagatorOptions.hpp b/Core/include/Acts/Propagator/PropagatorOptions.hpp new file mode 100644 index 00000000000..46916aece54 --- /dev/null +++ b/Core/include/Acts/Propagator/PropagatorOptions.hpp @@ -0,0 +1,166 @@ +// This file is part of the Acts project. +// +// Copyright (C) 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 +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Definitions/Direction.hpp" +#include "Acts/Definitions/Tolerance.hpp" +#include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/MagneticField/MagneticFieldContext.hpp" +#include "Acts/Propagator/AbortList.hpp" +#include "Acts/Propagator/ActionList.hpp" +#include "Acts/Propagator/NavigatorOptions.hpp" +#include "Acts/Propagator/StepperOptions.hpp" + +#include + +namespace Acts { + +namespace detail { + +/// @brief Holds the generic pure propagator options +struct PurePropagatorPlainOptions { + /// Propagation direction + Direction direction = Direction::Forward; + + /// Maximum number of steps for one propagate call + unsigned int maxSteps = 1000; + + /// Absolute maximum path length + double pathLimit = std::numeric_limits::max(); + + /// Required tolerance to reach surface + double surfaceTolerance = s_onSurfaceTolerance; + + /// Loop protection step, it adapts the pathLimit + bool loopProtection = true; + /// Allowed loop fraction, 1 is a full loop + double loopFraction = 0.5; +}; + +} // namespace detail + +/// @brief Holds the generic propagator options +struct PropagatorPlainOptions : public detail::PurePropagatorPlainOptions { + /// PropagatorPlainOptions with context + PropagatorPlainOptions(const GeometryContext& gctx, + const MagneticFieldContext& mctx) + : geoContext(gctx), magFieldContext(mctx) {} + + /// The context object for the geometry + std::reference_wrapper geoContext; + + /// The context object for the magnetic field + std::reference_wrapper magFieldContext; + + /// Stepper plain options + StepperPlainOptions stepping; + + /// Navigator plain options + NavigatorPlainOptions navigation; +}; + +/// @brief Options for propagate() call +/// +/// @tparam action_list_t List of action types called after each +/// propagation step with the current propagation and stepper state +/// +/// @tparam aborter_list_t List of abort conditions tested after each +/// propagation step using the current propagation and stepper state +/// +template , + typename aborter_list_t = AbortList<>> +struct PropagatorOptions : public detail::PurePropagatorPlainOptions { + using stepper_options_type = stepper_options_t; + using navigator_options_type = navigator_options_t; + using action_list_type = action_list_t; + using aborter_list_type = aborter_list_t; + + /// PropagatorOptions with context + PropagatorOptions(const GeometryContext& gctx, + const MagneticFieldContext& mctx) + : geoContext(gctx), magFieldContext(mctx) {} + + /// PropagatorOptions with context and plain options + PropagatorOptions(const PropagatorPlainOptions& pOptions) + : geoContext(pOptions.geoContext), + magFieldContext(pOptions.magFieldContext) { + setPlainOptions(pOptions); + } + + /// @brief Convert to plain options + operator PropagatorPlainOptions() const { + PropagatorPlainOptions pOptions(geoContext, magFieldContext); + static_cast(pOptions) = + static_cast(*this); + pOptions.stepping = static_cast(stepping); + pOptions.navigation = static_cast(navigation); + return pOptions; + } + + /// @brief Expand the Options with extended aborters + /// + /// @tparam extended_aborter_list_t Type of the new aborter list + /// + /// @param aborters The new aborter list to be used (internally) + template + PropagatorOptions + extend(extended_aborter_list_t aborters) const { + PropagatorOptions + eoptions(geoContext, magFieldContext); + + // Copy the base options + static_cast(eoptions) = + static_cast(*this); + + // Stepper / Navigator options + eoptions.stepping = stepping; + eoptions.navigation = navigation; + + // Action / Abort list + eoptions.actionList = actionList; + eoptions.abortList = aborters; + + // And return the options + return eoptions; + } + + /// @brief Set the plain options + /// + /// @param pOptions The plain options + void setPlainOptions(const PropagatorPlainOptions& pOptions) { + static_cast(*this) = + static_cast(pOptions); + + stepping.setPlainOptions(pOptions.stepping); + navigation.setPlainOptions(pOptions.navigation); + } + + /// The context object for the geometry + std::reference_wrapper geoContext; + + /// The context object for the magnetic field + std::reference_wrapper magFieldContext; + + /// Stepper options + stepper_options_t stepping; + + /// Navigator options + navigator_options_t navigation; + + /// List of actions + action_list_t actionList; + + /// List of abort conditions + aborter_list_t abortList; +}; + +} // namespace Acts diff --git a/Core/include/Acts/Propagator/PropagatorResult.hpp b/Core/include/Acts/Propagator/PropagatorResult.hpp new file mode 100644 index 00000000000..3c4998d7291 --- /dev/null +++ b/Core/include/Acts/Propagator/PropagatorResult.hpp @@ -0,0 +1,41 @@ +// This file is part of the Acts project. +// +// Copyright (C) 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 +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Definitions/TrackParametrization.hpp" +#include "Acts/Utilities/detail/Extendable.hpp" + +#include + +namespace Acts { + +/// @brief Simple class holding result of propagation call +/// +/// @tparam parameters_t Type of final track parameters +/// @tparam result_list Result pack for additional propagation +/// quantities +template +struct PropagatorResult : private detail::Extendable { + using detail::Extendable::get; + using detail::Extendable::tuple; + + /// Final track parameters + std::optional endParameters = std::nullopt; + + /// Full transport jacobian + std::optional transportJacobian = std::nullopt; + + /// Number of propagation steps that were carried out + std::size_t steps = 0; + + /// Signed distance over which the parameters were propagated + double pathLength = 0.; +}; + +} // namespace Acts diff --git a/Core/include/Acts/Propagator/PropagatorState.hpp b/Core/include/Acts/Propagator/PropagatorState.hpp new file mode 100644 index 00000000000..c7ed3394df7 --- /dev/null +++ b/Core/include/Acts/Propagator/PropagatorState.hpp @@ -0,0 +1,77 @@ +// This file is part of the Acts project. +// +// Copyright (C) 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 +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#pragma once + +#include "Acts/Geometry/GeometryContext.hpp" +#include "Acts/Utilities/detail/Extendable.hpp" + +#include + +namespace Acts { + +/// @brief Different stages during propagation +enum class PropagatorStage { + invalid, ///< Invalid stage + prePropagation, ///< Before the propagation + postPropagation, ///< After the propagation + preStep, ///< Before a step + postStep, ///< After a step +}; + +/// @brief private Propagator state for navigation and debugging +/// +/// @tparam propagator_options_t Type of the Objections object +/// +/// This struct holds the common state information for propagating +/// which is independent of the actual stepper implementation. +template +struct PropagatorState : private detail::Extendable { + using options_type = propagator_options_t; + + /// Create the propagator state from the options + /// + /// @tparam propagator_options_t the type of the propagator options + /// + /// @param topts The options handed over by the propagate call + /// @param steppingIn Stepper state instance to begin with + /// @param navigationIn Navigator state instance to begin with + PropagatorState(const propagator_options_t& topts, stepper_state_t steppingIn, + navigator_state_t navigationIn) + : options(topts), + stepping{std::move(steppingIn)}, + navigation{std::move(navigationIn)}, + geoContext(topts.geoContext) {} + + using detail::Extendable::get; + using detail::Extendable::tuple; + + /// Propagation stage + PropagatorStage stage = PropagatorStage::invalid; + + /// These are the options - provided for each propagation step + propagator_options_t options; + + /// Stepper state - internal state of the Stepper + stepper_state_t stepping; + + /// Navigation state - internal state of the Navigator + navigator_state_t navigation; + + /// Context object for the geometry + std::reference_wrapper geoContext; + + /// Number of propagation steps that were carried out + std::size_t steps = 0; + + /// Signed distance over which the parameters were propagated + double pathLength = 0.; +}; + +} // namespace Acts diff --git a/Core/include/Acts/Propagator/RiddersPropagator.hpp b/Core/include/Acts/Propagator/RiddersPropagator.hpp index 01c050ddfec..9f265f153ae 100644 --- a/Core/include/Acts/Propagator/RiddersPropagator.hpp +++ b/Core/include/Acts/Propagator/RiddersPropagator.hpp @@ -81,6 +81,11 @@ class RiddersPropagator { std::vector deviationsDisc = {-3e-5, -1e-5, 1e-5, 3e-5}; }; + template , + typename aborter_list_t = AbortList<>> + using Options = + typename propagator_t::template Options; + /// @brief Constructor using a propagator /// /// @param [in] propagator Underlying propagator that will be used diff --git a/Core/include/Acts/Propagator/StepperOptions.hpp b/Core/include/Acts/Propagator/StepperOptions.hpp new file mode 100644 index 00000000000..555ef30d865 --- /dev/null +++ b/Core/include/Acts/Propagator/StepperOptions.hpp @@ -0,0 +1,40 @@ +// This file is part of the Acts project. +// +// Copyright (C) 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 +// file, You can obtain one at http://mozilla.org/MPL/2.0/. + +#pragma once + +#include + +namespace Acts { + +struct StepperPlainOptions { + /// Tolerance for the error of the integration + double stepTolerance = 1e-4; + + /// Cut-off value for the step size + double stepSizeCutOff = 0.; + + /// Absolute maximum step size + double maxStepSize = std::numeric_limits::max(); + + /// Maximum number of Runge-Kutta steps for the stepper step call + unsigned int maxRungeKuttaStepTrials = 10000; + + struct Dense { + /// Toggle between mean and mode evaluation of energy loss + bool meanEnergyLoss = true; + + /// Boolean flag for inclusion of d(dEds)d(q/p) into energy loss + bool includeGradient = true; + + /// Cut-off value for the momentum in SI units + double momentumCutOff = 0.; + } dense; +}; + +} // namespace Acts diff --git a/Core/include/Acts/Propagator/StraightLineStepper.hpp b/Core/include/Acts/Propagator/StraightLineStepper.hpp index e8a9554e9b2..1e6879676d2 100644 --- a/Core/include/Acts/Propagator/StraightLineStepper.hpp +++ b/Core/include/Acts/Propagator/StraightLineStepper.hpp @@ -22,6 +22,7 @@ #include "Acts/MagneticField/NullBField.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" #include "Acts/Propagator/PropagatorTraits.hpp" +#include "Acts/Propagator/StepperOptions.hpp" #include "Acts/Propagator/detail/SteppingHelper.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -52,6 +53,14 @@ class StraightLineStepper { std::tuple; using BField = NullBField; + struct Config {}; + + struct Options : public StepperPlainOptions { + void setPlainOptions(const StepperPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// State for track parameter propagation /// struct State { @@ -134,10 +143,6 @@ class StraightLineStepper { std::reference_wrapper geoContext; }; - /// Always use the same propagation state type, independently of the initial - /// track parameter type and of the target surface - using state_type = State; - StraightLineStepper() = default; State makeState(std::reference_wrapper gctx, diff --git a/Core/include/Acts/Propagator/SympyStepper.hpp b/Core/include/Acts/Propagator/SympyStepper.hpp index 2029dceeaaa..b981d39aa95 100644 --- a/Core/include/Acts/Propagator/SympyStepper.hpp +++ b/Core/include/Acts/Propagator/SympyStepper.hpp @@ -21,6 +21,7 @@ #include "Acts/MagneticField/MagneticFieldProvider.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" #include "Acts/Propagator/PropagatorTraits.hpp" +#include "Acts/Propagator/StepperOptions.hpp" #include "Acts/Propagator/detail/SteppingHelper.hpp" namespace Acts { @@ -34,6 +35,16 @@ class SympyStepper { using CurvilinearState = std::tuple; + struct Config { + std::shared_ptr bField; + }; + + struct Options : public StepperPlainOptions { + void setPlainOptions(const StepperPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// @brief State for track parameter propagation /// /// It contains the stepping information and is provided thread local @@ -133,8 +144,12 @@ class SympyStepper { }; /// Constructor requires knowledge of the detector's magnetic field - SympyStepper(std::shared_ptr bField, - double overstepLimit = 100 * UnitConstants::um); + /// @param bField The magnetic field provider + explicit SympyStepper(std::shared_ptr bField); + + /// @brief Constructor with configuration + /// @param config The configuration of the stepper + explicit SympyStepper(const Config& config); State makeState(std::reference_wrapper gctx, std::reference_wrapper mctx, @@ -289,12 +304,6 @@ class SympyStepper { return state.stepSize.toString(); } - /// Overstep limit - double overstepLimit(const State& /*state*/) const { - // A dynamic overstep limit could sit here - return -m_overstepLimit; - } - /// Create and return the bound state at the current position /// /// @brief This transports (if necessary) the covariance @@ -411,9 +420,6 @@ class SympyStepper { /// Magnetic field inside of the detector std::shared_ptr m_bField; - /// Overstep limit - double m_overstepLimit; - private: Result stepImpl(State& state, Direction stepDirection, double stepTolerance, double stepSizeCutOff, diff --git a/Core/include/Acts/Propagator/SympyStepper.ipp b/Core/include/Acts/Propagator/SympyStepper.ipp index 13d3de8c307..42714f4cdbb 100644 --- a/Core/include/Acts/Propagator/SympyStepper.ipp +++ b/Core/include/Acts/Propagator/SympyStepper.ipp @@ -14,8 +14,9 @@ template Result SympyStepper::step(propagator_state_t& state, const navigator_t& /*navigator*/) const { return stepImpl(state.stepping, state.options.direction, - state.options.stepTolerance, state.options.stepSizeCutOff, - state.options.maxRungeKuttaStepTrials); + state.options.stepping.stepTolerance, + state.options.stepping.stepSizeCutOff, + state.options.stepping.maxRungeKuttaStepTrials); } } // namespace Acts diff --git a/Core/include/Acts/Propagator/TryAllNavigator.hpp b/Core/include/Acts/Propagator/TryAllNavigator.hpp index 6093b65a3bf..c375c407603 100644 --- a/Core/include/Acts/Propagator/TryAllNavigator.hpp +++ b/Core/include/Acts/Propagator/TryAllNavigator.hpp @@ -13,6 +13,7 @@ #include "Acts/Geometry/TrackingGeometry.hpp" #include "Acts/Geometry/TrackingVolume.hpp" #include "Acts/Propagator/ConstrainedStep.hpp" +#include "Acts/Propagator/NavigatorOptions.hpp" #include "Acts/Propagator/detail/NavigationHelpers.hpp" #include "Acts/Surfaces/BoundaryTolerance.hpp" #include "Acts/Surfaces/Surface.hpp" @@ -47,6 +48,12 @@ class TryAllNavigatorBase { BoundaryTolerance::None(); }; + struct Options : public NavigatorPlainOptions { + void setPlainOptions(const NavigatorPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// @brief Nested State struct /// /// It acts as an internal state which is created for every propagation and diff --git a/Core/include/Acts/Propagator/VoidNavigator.hpp b/Core/include/Acts/Propagator/VoidNavigator.hpp index fd8d7fc50e8..5b2c4516982 100644 --- a/Core/include/Acts/Propagator/VoidNavigator.hpp +++ b/Core/include/Acts/Propagator/VoidNavigator.hpp @@ -8,6 +8,7 @@ #pragma once +#include "Acts/Propagator/NavigatorOptions.hpp" namespace Acts { class Surface; @@ -18,6 +19,14 @@ class Surface; /// should eventually optimise that the function call is not done /// struct VoidNavigator { + struct Config {}; + + struct Options : public NavigatorPlainOptions { + void setPlainOptions(const NavigatorPlainOptions& options) { + static_cast(*this) = options; + } + }; + /// @brief Nested State struct, minimal requirement struct State { /// Navigation state - external state: the start surface @@ -36,9 +45,6 @@ struct VoidNavigator { bool navigationBreak = false; }; - /// Unique typedef to publish to the Propagator - using state_type = State; - State makeState(const Surface* startSurface, const Surface* targetSurface) const { State result; diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index 0b061e974ef..d60a83e3749 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -668,7 +668,7 @@ class CombinatorialKalmanFilter { stepper.resetState(state.stepping, currentState.filtered(), currentState.filteredCovariance(), currentState.referenceSurface(), - state.options.maxStepSize); + state.options.stepping.maxStepSize); // Reset the navigation state // Set targetSurface to nullptr for forward filtering; it's only needed @@ -1205,8 +1205,8 @@ class CombinatorialKalmanFilter { using Aborters = AbortList; // Create relevant options for the propagation options - PropagatorOptions propOptions(tfOptions.geoContext, - tfOptions.magFieldContext); + typename propagator_t::template Options propOptions( + tfOptions.geoContext, tfOptions.magFieldContext); // Set the trivial propagator options propOptions.setPlainOptions(tfOptions.propagatorPlainOptions); diff --git a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp index 63b30fdcbcc..bc28e000bb7 100644 --- a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp +++ b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp @@ -106,9 +106,10 @@ struct GaussianSumFitter { auto fwdPropInitializer = [&sSequence, this](const auto& opts) { using Actors = ActionList; using Aborters = AbortList; + using PropagatorOptions = + typename propagator_t::template Options; - PropagatorOptions propOptions(opts.geoContext, - opts.magFieldContext); + PropagatorOptions propOptions(opts.geoContext, opts.magFieldContext); propOptions.setPlainOptions(opts.propagatorPlainOptions); @@ -124,13 +125,14 @@ struct GaussianSumFitter { auto bwdPropInitializer = [&sSequence, this](const auto& opts) { using Actors = ActionList; using Aborters = AbortList<>; + using PropagatorOptions = + typename propagator_t::template Options; std::vector backwardSequence( std::next(sSequence.rbegin()), sSequence.rend()); backwardSequence.push_back(opts.referenceSurface); - PropagatorOptions propOptions(opts.geoContext, - opts.magFieldContext); + PropagatorOptions propOptions(opts.geoContext, opts.magFieldContext); propOptions.setPlainOptions(opts.propagatorPlainOptions); @@ -161,10 +163,13 @@ struct GaussianSumFitter { auto fwdPropInitializer = [this](const auto& opts) { using Actors = ActionList; using Aborters = AbortList; + using PropagatorOptions = + typename propagator_t::template Options; + + PropagatorOptions propOptions(opts.geoContext, opts.magFieldContext); - PropagatorOptions propOptions(opts.geoContext, - opts.magFieldContext); propOptions.setPlainOptions(opts.propagatorPlainOptions); + propOptions.actionList.template get() .m_cfg.bethe_heitler_approx = &m_betheHeitlerApproximation; @@ -175,9 +180,10 @@ struct GaussianSumFitter { auto bwdPropInitializer = [this](const auto& opts) { using Actors = ActionList; using Aborters = AbortList; + using PropagatorOptions = + typename propagator_t::template Options; - PropagatorOptions propOptions(opts.geoContext, - opts.magFieldContext); + PropagatorOptions propOptions(opts.geoContext, opts.magFieldContext); propOptions.setPlainOptions(opts.propagatorPlainOptions); diff --git a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp index 593ad95e1c2..051aa95fbe4 100644 --- a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp +++ b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp @@ -698,7 +698,8 @@ class Gx2Fitter { using Actors = Acts::ActionList; using Aborters = Acts::AbortList; - using PropagatorOptions = Acts::PropagatorOptions; + using PropagatorOptions = + typename propagator_t::template Options; start_parameters_t params = sParameters; BoundVector deltaParams = BoundVector::Zero(); diff --git a/Core/include/Acts/TrackFitting/KalmanFitter.hpp b/Core/include/Acts/TrackFitting/KalmanFitter.hpp index 501b5827cdb..66fe6b11bf0 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -553,7 +553,7 @@ class KalmanFitter { stepper.resetState( state.stepping, st.filtered(), reversedFilteringCovarianceScaling * st.filteredCovariance(), - st.referenceSurface(), state.options.maxStepSize); + st.referenceSurface(), state.options.stepping.maxStepSize); // For the last measurement state, smoothed is filtered st.smoothed() = st.filtered(); @@ -1012,13 +1012,13 @@ class KalmanFitter { stepper.resetState(state.stepping, firstCreatedState.smoothed(), firstCreatedState.smoothedCovariance(), firstCreatedState.referenceSurface(), - state.options.maxStepSize); + state.options.stepping.maxStepSize); reverseDirection = firstIntersection.pathLength() < 0; } else { stepper.resetState(state.stepping, lastCreatedMeasurement.smoothed(), lastCreatedMeasurement.smoothedCovariance(), lastCreatedMeasurement.referenceSurface(), - state.options.maxStepSize); + state.options.stepping.maxStepSize); reverseDirection = lastIntersection.pathLength() < 0; } // Reverse the navigation direction if necessary @@ -1118,16 +1118,19 @@ class KalmanFitter { using KalmanResult = typename KalmanActor::result_type; using Actors = ActionList; using Aborters = AbortList; + using PropagatorOptions = + typename propagator_t::template Options; // Create relevant options for the propagation options - PropagatorOptions kalmanOptions( - kfOptions.geoContext, kfOptions.magFieldContext); + PropagatorOptions propagatorOptions(kfOptions.geoContext, + kfOptions.magFieldContext); // Set the trivial propagator options - kalmanOptions.setPlainOptions(kfOptions.propagatorPlainOptions); + propagatorOptions.setPlainOptions(kfOptions.propagatorPlainOptions); // Catch the actor and set the measurements - auto& kalmanActor = kalmanOptions.actionList.template get(); + auto& kalmanActor = + propagatorOptions.actionList.template get(); kalmanActor.inputMeasurements = &inputMeasurements; kalmanActor.targetReached.surface = kfOptions.referenceSurface; kalmanActor.targetSurfaceStrategy = kfOptions.referenceSurfaceStrategy; @@ -1141,8 +1144,8 @@ class KalmanFitter { kalmanActor.extensions = kfOptions.extensions; kalmanActor.actorLogger = m_actorLogger.get(); - return fit_impl(sParameters, kalmanOptions, + return fit_impl(sParameters, propagatorOptions, trackContainer); } @@ -1199,16 +1202,19 @@ class KalmanFitter { using KalmanResult = typename KalmanActor::result_type; using Actors = ActionList; using Aborters = AbortList; + using PropagatorOptions = + typename propagator_t::template Options; // Create relevant options for the propagation options - PropagatorOptions kalmanOptions( - kfOptions.geoContext, kfOptions.magFieldContext); + PropagatorOptions propagatorOptions(kfOptions.geoContext, + kfOptions.magFieldContext); // Set the trivial propagator options - kalmanOptions.setPlainOptions(kfOptions.propagatorPlainOptions); + propagatorOptions.setPlainOptions(kfOptions.propagatorPlainOptions); // Catch the actor and set the measurements - auto& kalmanActor = kalmanOptions.actionList.template get(); + auto& kalmanActor = + propagatorOptions.actionList.template get(); kalmanActor.inputMeasurements = &inputMeasurements; kalmanActor.targetReached.surface = kfOptions.referenceSurface; kalmanActor.targetSurfaceStrategy = kfOptions.referenceSurfaceStrategy; @@ -1221,12 +1227,12 @@ class KalmanFitter { kalmanActor.actorLogger = m_actorLogger.get(); // Set the surface sequence - auto& dInitializer = - kalmanOptions.actionList.template get(); + auto& dInitializer = propagatorOptions.actionList + .template get(); dInitializer.navSurfaces = sSequence; - return fit_impl(sParameters, kalmanOptions, + return fit_impl(sParameters, propagatorOptions, trackContainer); } @@ -1241,21 +1247,21 @@ class KalmanFitter { /// @tparam holder_t Type defining track container backend ownership /// /// @param sParameters The initial track parameters - /// @param kalmanOptions The Kalman Options + /// @param propagatorOptions The Propagator Options /// @param trackContainer Input track container storage to append into /// /// @return the output as an output track - template class holder_t> + template class holder_t> auto fit_impl( const start_parameters_t& sParameters, - const PropagatorOptions& kalmanOptions, + const propagator_options_t& propagatorOptions, TrackContainer& trackContainer) const -> Result::TrackProxy> { auto propagatorState = - m_propagator.template makeState(sParameters, kalmanOptions); + m_propagator.template makeState(sParameters, propagatorOptions); auto& kalmanResult = propagatorState.template get>(); diff --git a/Core/include/Acts/Utilities/detail/Extendable.hpp b/Core/include/Acts/Utilities/detail/Extendable.hpp index 4ae1912b6b4..66ce1c79579 100644 --- a/Core/include/Acts/Utilities/detail/Extendable.hpp +++ b/Core/include/Acts/Utilities/detail/Extendable.hpp @@ -1,6 +1,6 @@ // This file is part of the Acts project. // -// Copyright (C) 2016-2018 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 @@ -41,7 +41,7 @@ struct Extendable { Extendable(const Extendable& extendable) = default; // Default move constructor - Extendable(Extendable&& extendable) = default; + Extendable(Extendable&& extendable) noexcept = default; /// Constructor from tuple /// @@ -65,7 +65,7 @@ struct Extendable { /// /// @param extendable The source Extendable list Extendable& operator=( - Extendable&& extendable) = default; + Extendable&& extendable) noexcept = default; /// Append new entries and return a new condition /// diff --git a/Core/src/Material/SurfaceMaterialMapper.cpp b/Core/src/Material/SurfaceMaterialMapper.cpp index eab37ad1476..1a5ae1ba382 100644 --- a/Core/src/Material/SurfaceMaterialMapper.cpp +++ b/Core/src/Material/SurfaceMaterialMapper.cpp @@ -244,8 +244,8 @@ void Acts::SurfaceMaterialMapper::mapInteraction( ActionList; using AbortList = AbortList; - PropagatorOptions options(mState.geoContext, - mState.magFieldContext); + StraightLinePropagator::Options options( + mState.geoContext, mState.magFieldContext); // Now collect the material layers by using the straight line propagator const auto& result = m_propagator.propagate(start, options).value(); diff --git a/Core/src/Material/VolumeMaterialMapper.cpp b/Core/src/Material/VolumeMaterialMapper.cpp index 9e7d6aff023..f46edb9cfa4 100644 --- a/Core/src/Material/VolumeMaterialMapper.cpp +++ b/Core/src/Material/VolumeMaterialMapper.cpp @@ -377,8 +377,8 @@ void Acts::VolumeMaterialMapper::mapMaterialTrack( using ActionList = ActionList; using AbortList = AbortList; - PropagatorOptions options(mState.geoContext, - mState.magFieldContext); + StraightLinePropagator::Options options( + mState.geoContext, mState.magFieldContext); // Now collect the material volume by using the straight line propagator const auto& result = m_propagator.propagate(start, options).value(); diff --git a/Core/src/Propagator/SympyStepper.cpp b/Core/src/Propagator/SympyStepper.cpp index 71732baa1e8..25fc6983cc9 100644 --- a/Core/src/Propagator/SympyStepper.cpp +++ b/Core/src/Propagator/SympyStepper.cpp @@ -19,9 +19,10 @@ namespace Acts { -SympyStepper::SympyStepper(std::shared_ptr bField, - double overstepLimit) - : m_bField(std::move(bField)), m_overstepLimit(overstepLimit) {} +SympyStepper::SympyStepper(std::shared_ptr bField) + : m_bField(std::move(bField)) {} + +SympyStepper::SympyStepper(const Config& config) : m_bField(config.bField) {} SympyStepper::State SympyStepper::makeState( std::reference_wrapper gctx, diff --git a/Core/src/Vertexing/HelicalTrackLinearizer.cpp b/Core/src/Vertexing/HelicalTrackLinearizer.cpp index 59934eb7ca2..8a9f59120da 100644 --- a/Core/src/Vertexing/HelicalTrackLinearizer.cpp +++ b/Core/src/Vertexing/HelicalTrackLinearizer.cpp @@ -8,6 +8,7 @@ #include "Acts/Vertexing/HelicalTrackLinearizer.hpp" +#include "Acts/Propagator/PropagatorOptions.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Vertexing/LinearizerTrackParameters.hpp" @@ -18,7 +19,7 @@ Acts::HelicalTrackLinearizer::linearizeTrack( const Acts::MagneticFieldContext& mctx, MagneticFieldProvider::Cache& fieldCache) const { // Create propagator options - PropagatorOptions<> pOptions(gctx, mctx); + PropagatorPlainOptions pOptions(gctx, mctx); // Length scale at which we consider to be sufficiently close to the Perigee // surface to skip the propagation. diff --git a/Core/src/Vertexing/ImpactPointEstimator.cpp b/Core/src/Vertexing/ImpactPointEstimator.cpp index 1a43e57afce..9be733ff3a2 100644 --- a/Core/src/Vertexing/ImpactPointEstimator.cpp +++ b/Core/src/Vertexing/ImpactPointEstimator.cpp @@ -10,6 +10,7 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/PropagatorOptions.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Surfaces/PlaneSurface.hpp" #include "Acts/Vertexing/VertexingError.hpp" @@ -366,7 +367,7 @@ Result ImpactPointEstimator::estimate3DImpactParameters( .closest(); // Create propagator options - PropagatorOptions<> pOptions(gctx, mctx); + PropagatorPlainOptions pOptions(gctx, mctx); pOptions.direction = Direction::fromScalarZeroAsPositive(intersection.pathLength()); @@ -422,7 +423,7 @@ Result ImpactPointEstimator::getImpactParameters( Surface::makeShared(vtx.position()); // Create propagator options - PropagatorOptions<> pOptions(gctx, mctx); + PropagatorPlainOptions pOptions(gctx, mctx); auto intersection = perigeeSurface ->intersect(gctx, track.position(gctx), track.direction(), @@ -506,7 +507,7 @@ Result> ImpactPointEstimator::getLifetimeSignOfTrack( Surface::makeShared(vtx.position()); // Create propagator options - PropagatorOptions<> pOptions(gctx, mctx); + PropagatorPlainOptions pOptions(gctx, mctx); pOptions.direction = Direction::Backward; // Do the propagation to the perigeee @@ -545,7 +546,7 @@ Result ImpactPointEstimator::get3DLifetimeSignOfTrack( Surface::makeShared(vtx.position()); // Create propagator options - PropagatorOptions<> pOptions(gctx, mctx); + PropagatorPlainOptions pOptions(gctx, mctx); pOptions.direction = Direction::Backward; // Do the propagation to the perigeee diff --git a/Core/src/Vertexing/NumericalTrackLinearizer.cpp b/Core/src/Vertexing/NumericalTrackLinearizer.cpp index 03e4762e678..2a5f31007da 100644 --- a/Core/src/Vertexing/NumericalTrackLinearizer.cpp +++ b/Core/src/Vertexing/NumericalTrackLinearizer.cpp @@ -8,6 +8,7 @@ #include "Acts/Vertexing/NumericalTrackLinearizer.hpp" +#include "Acts/Propagator/PropagatorOptions.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" #include "Acts/Utilities/UnitVectors.hpp" #include "Acts/Vertexing/LinearizerTrackParameters.hpp" @@ -19,7 +20,7 @@ Acts::NumericalTrackLinearizer::linearizeTrack( const Acts::MagneticFieldContext& mctx, MagneticFieldProvider::Cache& /*fieldCache*/) const { // Create propagator options - PropagatorOptions<> pOptions(gctx, mctx); + PropagatorPlainOptions pOptions(gctx, mctx); // Length scale at which we consider to be sufficiently close to the Perigee // surface to skip the propagation. diff --git a/Examples/Algorithms/Alignment/src/AlignmentAlgorithm.cpp b/Examples/Algorithms/Alignment/src/AlignmentAlgorithm.cpp index 51760a8f8dd..444b818233d 100644 --- a/Examples/Algorithms/Alignment/src/AlignmentAlgorithm.cpp +++ b/Examples/Algorithms/Alignment/src/AlignmentAlgorithm.cpp @@ -113,9 +113,10 @@ ActsExamples::ProcessCode ActsExamples::AlignmentAlgorithm::execute( &kfSmoother); // Set the KalmanFitter options - TrackFitterOptions kfOptions(ctx.geoContext, ctx.magFieldContext, - ctx.calibContext, extensions, - Acts::PropagatorPlainOptions(), &(*pSurface)); + TrackFitterOptions kfOptions( + ctx.geoContext, ctx.magFieldContext, ctx.calibContext, extensions, + Acts::PropagatorPlainOptions(ctx.geoContext, ctx.magFieldContext), + &(*pSurface)); // Set the alignment options ActsAlignment::AlignmentOptions alignOptions( diff --git a/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp b/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp index 82d5b5343dd..ceab9369c99 100644 --- a/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp +++ b/Examples/Algorithms/Propagation/include/ActsExamples/Propagation/PropagatorInterface.hpp @@ -86,7 +86,7 @@ class ConcretePropagator : public PropagatorInterface { using ActionList = Acts::ActionList; using AbortList = Acts::AbortList; using PropagatorOptions = - Acts::DenseStepperPropagatorOptions; + typename propagator_t::template Options; PropagatorOptions options(context.geoContext, context.magFieldContext); options.pathLimit = pathLength; @@ -96,16 +96,16 @@ class ConcretePropagator : public PropagatorInterface { startParameters.transverseMomentum() < cfg.ptLoopers; // Switch the material interaction on/off & eventually into logging mode - auto& mInteractor = options.actionList.get(); + auto& mInteractor = options.actionList.template get(); mInteractor.multipleScattering = cfg.multipleScattering; mInteractor.energyLoss = cfg.energyLoss; mInteractor.recordInteractions = cfg.recordMaterialInteractions; // Switch the logger to sterile, e.g. for timing checks - auto& sLogger = options.actionList.get(); + auto& sLogger = options.actionList.template get(); sLogger.sterile = cfg.sterileLogger; // Set a maximum step size - options.maxStepSize = cfg.maxStepSize; + options.stepping.maxStepSize = cfg.maxStepSize; // Propagate using the propagator auto result = m_propagator.propagate(startParameters, options); diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp index 544e15de48e..1b748e263f5 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp @@ -346,11 +346,13 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { slAccessorDelegate; slAccessorDelegate.connect<&IndexSourceLinkAccessor::range>(&slAccessor); - Acts::PropagatorPlainOptions firstPropOptions; + Acts::PropagatorPlainOptions firstPropOptions(ctx.geoContext, + ctx.magFieldContext); firstPropOptions.maxSteps = m_cfg.maxSteps; firstPropOptions.direction = Acts::Direction::Forward; - Acts::PropagatorPlainOptions secondPropOptions; + Acts::PropagatorPlainOptions secondPropOptions(ctx.geoContext, + ctx.magFieldContext); secondPropOptions.maxSteps = m_cfg.maxSteps; secondPropOptions.direction = firstPropOptions.direction.invert(); @@ -364,15 +366,18 @@ ProcessCode TrackFindingAlgorithm::execute(const AlgorithmContext& ctx) const { extensions, secondPropOptions); secondOptions.targetSurface = pSurface.get(); - Acts::Propagator, Acts::Navigator> extrapolator( + using Extrapolator = Acts::Propagator, Acts::Navigator>; + using ExtrapolatorOptions = + Extrapolator::template Options, + Acts::AbortList>; + + Extrapolator extrapolator( Acts::EigenStepper<>(m_cfg.magneticField), Acts::Navigator({m_cfg.trackingGeometry}, logger().cloneWithSuffix("Navigator")), logger().cloneWithSuffix("Propagator")); - Acts::PropagatorOptions, - Acts::AbortList> - extrapolationOptions(ctx.geoContext, ctx.magFieldContext); + ExtrapolatorOptions extrapolationOptions(ctx.geoContext, ctx.magFieldContext); // Perform the track finding for all initial parameters ACTS_DEBUG("Invoke track finding with " << initialParameters.size() diff --git a/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp b/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp index 7af0e40ced1..69d281110cf 100644 --- a/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp +++ b/Examples/Algorithms/TrackFindingExaTrkX/src/TrackFindingFromPrototrackAlgorithm.cpp @@ -78,7 +78,7 @@ ActsExamples::ProcessCode TrackFindingFromPrototrackAlgorithm::execute( auto pSurface = Acts::Surface::makeShared( Acts::Vector3{0., 0., 0.}); - Acts::PropagatorPlainOptions pOptions; + Acts::PropagatorPlainOptions pOptions(ctx.geoContext, ctx.magFieldContext); pOptions.maxSteps = 10000; PassThroughCalibrator pcalibrator; diff --git a/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp b/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp index 393192209c7..e4642b23c3d 100644 --- a/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFitting/src/RefittingAlgorithm.cpp @@ -69,7 +69,8 @@ ActsExamples::ProcessCode ActsExamples::RefittingAlgorithm::execute( TrackFitterFunction::GeneralFitterOptions options{ ctx.geoContext, ctx.magFieldContext, ctx.calibContext, - &track.referenceSurface(), Acts::PropagatorPlainOptions()}; + &track.referenceSurface(), + Acts::PropagatorPlainOptions(ctx.geoContext, ctx.magFieldContext)}; const Acts::BoundTrackParameters initialParams( track.referenceSurface().getSharedPtr(), track.parameters(), diff --git a/Examples/Algorithms/TrackFitting/src/TrackFittingAlgorithm.cpp b/Examples/Algorithms/TrackFitting/src/TrackFittingAlgorithm.cpp index 280726d9729..2a593669a81 100644 --- a/Examples/Algorithms/TrackFitting/src/TrackFittingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFitting/src/TrackFittingAlgorithm.cpp @@ -96,7 +96,7 @@ ActsExamples::ProcessCode ActsExamples::TrackFittingAlgorithm::execute( TrackFitterFunction::GeneralFitterOptions options{ ctx.geoContext, ctx.magFieldContext, ctx.calibContext, pSurface.get(), - Acts::PropagatorPlainOptions()}; + Acts::PropagatorPlainOptions(ctx.geoContext, ctx.magFieldContext)}; auto trackContainer = std::make_shared(); auto trackStateContainer = std::make_shared(); diff --git a/Examples/Algorithms/Vertexing/src/VertexFitterAlgorithm.cpp b/Examples/Algorithms/Vertexing/src/VertexFitterAlgorithm.cpp index 15ab2b81860..b105ab31880 100644 --- a/Examples/Algorithms/Vertexing/src/VertexFitterAlgorithm.cpp +++ b/Examples/Algorithms/Vertexing/src/VertexFitterAlgorithm.cpp @@ -43,7 +43,7 @@ ActsExamples::VertexFitterAlgorithm::VertexFitterAlgorithm( ActsExamples::ProcessCode ActsExamples::VertexFitterAlgorithm::execute( const ActsExamples::AlgorithmContext& ctx) const { using Propagator = Acts::Propagator>; - using PropagatorOptions = Acts::PropagatorOptions<>; + using PropagatorOptions = Propagator::Options<>; using Linearizer = Acts::HelicalTrackLinearizer; using VertexFitter = Acts::FullBilloirVertexFitter; using VertexFitterOptions = Acts::VertexingOptions; diff --git a/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp b/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp index 6aa4959dcd2..99055b51e1c 100644 --- a/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp +++ b/Examples/Io/Performance/ActsExamples/Io/Performance/VertexPerformanceWriter.cpp @@ -776,7 +776,8 @@ ProcessCode VertexPerformanceWriter::writeT( .closest(); // Setting the geometry/magnetic field context for the event - Acts::PropagatorOptions pOptions(ctx.geoContext, ctx.magFieldContext); + using PropagatorOptions = Propagator::Options<>; + PropagatorOptions pOptions(ctx.geoContext, ctx.magFieldContext); pOptions.direction = Acts::Direction::fromScalarZeroAsPositive(intersection.pathLength()); diff --git a/Fatras/include/ActsFatras/Kernel/Simulation.hpp b/Fatras/include/ActsFatras/Kernel/Simulation.hpp index 07e4f570444..13528e40792 100644 --- a/Fatras/include/ActsFatras/Kernel/Simulation.hpp +++ b/Fatras/include/ActsFatras/Kernel/Simulation.hpp @@ -83,11 +83,12 @@ struct SingleParticleSimulation { using Result = typename Actor::result_type; using Actions = Acts::ActionList; using Abort = Acts::AbortList; - using PropagatorOptions = Acts::PropagatorOptions; + using PropagatorOptions = + typename propagator_t::template Options; // Construct per-call options. PropagatorOptions options(geoCtx, magCtx); - options.maxStepSize = maxStepSize; + options.stepping.maxStepSize = maxStepSize; options.pathLimit = pathLimit; // setup the interactor as part of the propagator options auto &actor = options.actionList.template get(); diff --git a/Tests/Benchmarks/StepperBenchmarkCommons.hpp b/Tests/Benchmarks/StepperBenchmarkCommons.hpp index 4a63cce7b8d..3fc6d361bef 100644 --- a/Tests/Benchmarks/StepperBenchmarkCommons.hpp +++ b/Tests/Benchmarks/StepperBenchmarkCommons.hpp @@ -74,6 +74,7 @@ struct BenchmarkStepper { template void run(Stepper stepper, const std::string& name) const { using Propagator = Propagator; + using PropagatorOptions = typename Propagator::template Options<>; using Covariance = BoundSquareMatrix; // Create a test context @@ -88,7 +89,7 @@ struct BenchmarkStepper { Propagator propagator(std::move(stepper)); - PropagatorOptions<> options(tgContext, mfContext); + PropagatorOptions options(tgContext, mfContext); options.pathLimit = maxPathInM * UnitConstants::m; Vector4 pos4(0, 0, 0, 0); diff --git a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp index b8637c9e037..f88d86c4c88 100644 --- a/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp +++ b/Tests/CommonHelpers/Acts/Tests/CommonHelpers/MeasurementsCreator.hpp @@ -157,10 +157,12 @@ Measurements createMeasurements(const propagator_t& propagator, std::size_t sourceId = 0u) { using Actions = Acts::ActionList; using Aborters = Acts::AbortList; + using PropagatorOptions = + typename propagator_t::template Options; // Set options for propagator - Acts::PropagatorOptions options(geoCtx, magCtx); - auto& creator = options.actionList.get(); + PropagatorOptions options(geoCtx, magCtx); + auto& creator = options.actionList.template get(); creator.resolutions = resolutions; creator.rng = &rng; creator.sourceId = sourceId; diff --git a/Tests/IntegrationTests/NavigatorConsistency.cpp b/Tests/IntegrationTests/NavigatorConsistency.cpp index 356fe345d0f..c4a380a5d3f 100644 --- a/Tests/IntegrationTests/NavigatorConsistency.cpp +++ b/Tests/IntegrationTests/NavigatorConsistency.cpp @@ -72,7 +72,8 @@ void runSelfConsistencyTest(const propagator_t& prop, // Action list and abort list using ActionListType = ActionList; using AbortListType = AbortList<>; - using Options = PropagatorOptions; + using Options = + typename propagator_t::template Options; // forward surface test Options fwdOptions(tgContext, mfContext); @@ -257,13 +258,16 @@ void runConsistencyTest(const propagator_probe_t& propProbe, // Action list and abort list using ActionListType = ActionList; using AbortListType = AbortList<>; - using Options = PropagatorOptions; auto run = [&](const auto& prop) { + using propagator_t = std::decay_t; + using Options = + typename propagator_t::template Options; + // forward surface test Options fwdOptions(tgContext, mfContext); fwdOptions.pathLimit = 25_cm; - fwdOptions.maxStepSize = 1_cm; + fwdOptions.stepping.maxStepSize = 1_cm; // get the surface collector and configure it auto& fwdSurfaceCollector = diff --git a/Tests/IntegrationTests/PropagationBentTracks.cpp b/Tests/IntegrationTests/PropagationBentTracks.cpp index 15c950c8192..5b7a96404f7 100644 --- a/Tests/IntegrationTests/PropagationBentTracks.cpp +++ b/Tests/IntegrationTests/PropagationBentTracks.cpp @@ -56,8 +56,8 @@ std::vector xPositionsOfPassedSurfaces(Acts::Navigator::Config navCfg, Acts::Vector4(0.01, 0, 0, 0), dir.normalized(), 1 / 1_GeV, std::nullopt, Acts::ParticleHypothesis::pion()); - Acts::PropagatorOptions, - Acts::AbortList> + Propagator::Options, + Acts::AbortList> opts(geoCtx, magCtx); auto res = propagator.propagate(start, opts); diff --git a/Tests/IntegrationTests/PropagationDenseConstant.cpp b/Tests/IntegrationTests/PropagationDenseConstant.cpp index 3f1efdeaa1e..381e7639111 100644 --- a/Tests/IntegrationTests/PropagationDenseConstant.cpp +++ b/Tests/IntegrationTests/PropagationDenseConstant.cpp @@ -112,7 +112,7 @@ BOOST_DATA_TEST_CASE(ForwardBackward, ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runForwardBackwardTest( + runForwardBackwardTest( makePropagator(bz), geoCtx, magCtx, makeParametersCurvilinear(phi, theta, p, q), s, epsPos, epsDir, epsMom); } @@ -124,8 +124,7 @@ BOOST_DATA_TEST_CASE(ToCylinderAlongZ, ds::phi* ds::thetaWithoutBeam* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runToSurfaceTest( + runToSurfaceTest( makePropagator(bz), geoCtx, magCtx, makeParametersCurvilinear(phi, theta, p, q), s, ZCylinderSurfaceBuilder(), epsPos, epsDir, epsMom); @@ -135,8 +134,7 @@ BOOST_DATA_TEST_CASE(ToDisc, ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runToSurfaceTest( + runToSurfaceTest( makePropagator(bz), geoCtx, magCtx, makeParametersCurvilinear(phi, theta, p, q), s, DiscSurfaceBuilder(), epsPos, epsDir, epsMom); @@ -146,8 +144,7 @@ BOOST_DATA_TEST_CASE(ToPlane, ds::phi* ds::theta* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runToSurfaceTest( + runToSurfaceTest( makePropagator(bz), geoCtx, magCtx, makeParametersCurvilinear(phi, theta, p, q), s, PlaneSurfaceBuilder(), epsPos, epsDir, epsMom); @@ -158,8 +155,7 @@ BOOST_DATA_TEST_CASE(ToStrawAlongZ, ds::phi* ds::thetaWithoutBeam* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runToSurfaceTest( + runToSurfaceTest( makePropagator(bz), geoCtx, magCtx, makeParametersCurvilinear(phi, theta, p, q), s, ZStrawSurfaceBuilder(), epsPos, epsDir, epsMom); @@ -171,8 +167,7 @@ BOOST_DATA_TEST_CASE(CovarianceCurvilinear, ds::phi* ds::thetaWithoutBeam* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runForwardComparisonTest( + runForwardComparisonTest( makePropagator(bz), makeRiddersPropagator(bz), geoCtx, magCtx, makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, epsPos, epsDir, epsMom, epsCov); @@ -184,8 +179,7 @@ BOOST_DATA_TEST_CASE(CovarianceToCylinderAlongZ, ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { runToSurfaceComparisonTest( + ZCylinderSurfaceBuilder>( makePropagator(bz), makeRiddersPropagator(bz), geoCtx, magCtx, makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, ZCylinderSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov); @@ -195,8 +189,7 @@ BOOST_DATA_TEST_CASE(CovarianceToDisc, ds::phi* ds::thetaWithoutBeam* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runToSurfaceComparisonTest( + runToSurfaceComparisonTest( makePropagator(bz), makeRiddersPropagator(bz), geoCtx, magCtx, makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, DiscSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov); @@ -207,8 +200,8 @@ BOOST_DATA_TEST_CASE(CovarianceToPlane, ds::phi* ds::thetaWithoutBeam* ds::absMomentum* ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { - runToSurfaceComparisonTest( + runToSurfaceComparisonTest( makePropagator(bz), makeRiddersPropagator(bz), geoCtx, magCtx, makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, PlaneSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov); @@ -220,8 +213,7 @@ BOOST_DATA_TEST_CASE(CovarianceToStrawAlongZ, ds::chargeNonZero* ds::pathLength* ds::magneticField, phi, theta, p, q, s, bz) { runToSurfaceComparisonTest( + ZStrawSurfaceBuilder>( makePropagator(bz), makeRiddersPropagator(bz), geoCtx, magCtx, makeParametersCurvilinearWithCovariance(phi, theta, p, q), s, ZStrawSurfaceBuilder(), epsPos, epsDir, epsMom, epsCov); diff --git a/Tests/IntegrationTests/PropagationTests.hpp b/Tests/IntegrationTests/PropagationTests.hpp index 5bb34657f79..6be2ebd220d 100644 --- a/Tests/IntegrationTests/PropagationTests.hpp +++ b/Tests/IntegrationTests/PropagationTests.hpp @@ -234,23 +234,20 @@ struct ZStrawSurfaceBuilder { /// Propagate the initial parameters for the given pathlength in space. /// /// Use a negative path length to indicate backward propagation. -template - class options_t = Acts::PropagatorOptions> +template > inline std::pair transportFreely( const propagator_t& propagator, const Acts::GeometryContext& geoCtx, const Acts::MagneticFieldContext& magCtx, const Acts::CurvilinearTrackParameters& initialParams, double pathLength) { using namespace Acts::UnitLiterals; - using Actions = Acts::ActionList<>; - using Aborts = Acts::AbortList<>; - // setup propagation options - options_t options(geoCtx, magCtx); + options_t options(geoCtx, magCtx); options.direction = Acts::Direction::fromScalar(pathLength); options.pathLimit = pathLength; options.surfaceTolerance = 1_nm; - options.stepTolerance = 1_nm; + options.stepping.stepTolerance = 1_nm; auto result = propagator.propagate(initialParams, options); BOOST_CHECK(result.ok()); @@ -260,8 +257,8 @@ inline std::pair transportFreely( } /// Propagate the initial parameters to the target surface. -template - class options_t = Acts::PropagatorOptions> +template > inline std::pair transportToSurface( const propagator_t& propagator, const Acts::GeometryContext& geoCtx, const Acts::MagneticFieldContext& magCtx, @@ -269,15 +266,12 @@ inline std::pair transportToSurface( const Acts::Surface& targetSurface, double pathLimit) { using namespace Acts::UnitLiterals; - using Actions = Acts::ActionList<>; - using Aborts = Acts::AbortList<>; - // setup propagation options - options_t options(geoCtx, magCtx); + options_t options(geoCtx, magCtx); options.direction = Acts::Direction::Forward; options.pathLimit = pathLimit; options.surfaceTolerance = 1_nm; - options.stepTolerance = 1_nm; + options.stepping.stepTolerance = 1_nm; auto result = propagator.propagate(initialParams, targetSurface, options); BOOST_CHECK(result.ok()); @@ -291,8 +285,8 @@ inline std::pair transportToSurface( /// Propagate the initial parameters the given path length along its /// trajectory and then propagate the final parameters back. Verify that the /// propagated parameters match the initial ones. -template - class options_t = Acts::PropagatorOptions> +template > inline void runForwardBackwardTest( const propagator_t& propagator, const Acts::GeometryContext& geoCtx, const Acts::MagneticFieldContext& magCtx, @@ -316,8 +310,7 @@ inline void runForwardBackwardTest( /// initial parameters again to the target surface. Verify that the surface has /// been found and the parameters are consistent. template - class options_t = Acts::PropagatorOptions> + typename options_t = typename propagator_t::template Options<>> inline void runToSurfaceTest( const propagator_t& propagator, const Acts::GeometryContext& geoCtx, const Acts::MagneticFieldContext& magCtx, @@ -355,8 +348,7 @@ inline void runToSurfaceTest( /// Propagate the initial parameters along their trajectory for the given path /// length using two different propagators and verify consistent output. template - class options_t = Acts::PropagatorOptions> + typename options_t = typename ref_propagator_t::template Options<>> inline void runForwardComparisonTest( const cmp_propagator_t& cmpPropagator, const ref_propagator_t& refPropagator, const Acts::GeometryContext& geoCtx, @@ -383,8 +375,7 @@ inline void runForwardComparisonTest( /// different propagators and verify consistent output. template - class options_t = Acts::PropagatorOptions> + typename options_t = typename ref_propagator_t::template Options<>> inline void runToSurfaceComparisonTest( const cmp_propagator_t& cmpPropagator, const ref_propagator_t& refPropagator, const Acts::GeometryContext& geoCtx, diff --git a/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp b/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp index 77549e821cf..5a388d3a307 100644 --- a/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp +++ b/Tests/UnitTests/Alignment/Kernel/AlignmentTests.cpp @@ -300,7 +300,7 @@ BOOST_AUTO_TEST_CASE(ZeroFieldKalmanAlignment) { extensions.surfaceAccessor .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); KalmanFitterOptions kfOptions(geoCtx, magCtx, calCtx, extensions, - PropagatorPlainOptions()); + PropagatorPlainOptions(geoCtx, magCtx)); // Construct a non-updating alignment updater AlignedTransformUpdater voidAlignUpdater = diff --git a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp index 406cf9deabe..d4f5572d0cf 100644 --- a/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp +++ b/Tests/UnitTests/Core/Material/VolumeMaterialMapperTests.cpp @@ -268,9 +268,10 @@ BOOST_AUTO_TEST_CASE(VolumeMaterialMapper_comparison_tests) { MagneticFieldContext mc; // Launch propagation and gather result - PropagatorOptions, AbortList> - po(gc, mc); - po.maxStepSize = 1._mm; + using PropagatorOptions = Propagator::Options< + ActionList, AbortList>; + PropagatorOptions po(gc, mc); + po.stepping.maxStepSize = 1._mm; po.maxSteps = 1e6; const auto& result = prop.propagate(sctp, po).value(); diff --git a/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp b/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp index 4d97743182f..a6a098ad248 100644 --- a/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp +++ b/Tests/UnitTests/Core/Navigation/DetectorNavigatorTests.cpp @@ -69,34 +69,35 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsInitialization) { auto detector = Acts::Experimental::Detector::makeShared( "detector", {volume}, Acts::Experimental::tryRootVolumes()); + using Stepper = Acts::StraightLineStepper; + using Navigator = Acts::Experimental::DetectorNavigator; + using Propagator = Acts::Propagator; using ActionList = Acts::ActionList<>; using AbortList = Acts::AbortList<>; + using PropagatorOptions = Propagator::Options; - auto options = - Acts::PropagatorOptions(geoContext, mfContext); + PropagatorOptions options(geoContext, mfContext); - auto stepper = Acts::StraightLineStepper(); + Stepper stepper; Acts::Vector4 pos(-2, 0, 0, 0); - auto start = Acts::CurvilinearTrackParameters( - pos, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, - Acts::ParticleHypothesis::electron()); + Acts::CurvilinearTrackParameters start(pos, 0_degree, 90_degree, 1_e / 1_GeV, + std::nullopt, + Acts::ParticleHypothesis::electron()); // // (1) Test for inactivity // // Run without anything present { - Acts::Experimental::DetectorNavigator::Config navCfg; + Navigator::Config navCfg; navCfg.resolveSensitive = false; navCfg.resolveMaterial = false; navCfg.resolvePassive = false; - auto navigator = Acts::Experimental::DetectorNavigator(navCfg); + Navigator navigator(navCfg); - auto propagator = Acts::Propagator( - stepper, navigator); + Propagator propagator(stepper, navigator); BOOST_CHECK_THROW(propagator.makeState(start, options), std::invalid_argument); @@ -110,11 +111,11 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsInitialization) { navCfg.resolvePassive = false; navCfg.detector = detector.get(); - auto navigator = Acts::Experimental::DetectorNavigator(navCfg); + Acts::Experimental::DetectorNavigator navigator(navCfg); - auto propagator = Acts::Propagator( - stepper, navigator); + Acts::Propagator + propagator(stepper, navigator); auto state = propagator.makeState(start, options); @@ -137,18 +138,18 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsInitialization) { // Run from endOfWorld { Acts::Vector4 posEoW(-20, 0, 0, 0); - auto startEoW = Acts::CurvilinearTrackParameters( + Acts::CurvilinearTrackParameters startEoW( posEoW, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, Acts::ParticleHypothesis::electron()); Acts::Experimental::DetectorNavigator::Config navCfg; navCfg.detector = detector.get(); - auto navigator = Acts::Experimental::DetectorNavigator(navCfg); + Acts::Experimental::DetectorNavigator navigator(navCfg); - auto propagator = Acts::Propagator( - stepper, navigator); + Acts::Propagator + propagator(stepper, navigator); BOOST_CHECK_THROW(propagator.makeState(startEoW, options), std::invalid_argument); @@ -159,11 +160,11 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsInitialization) { Acts::Experimental::DetectorNavigator::Config navCfg; navCfg.detector = detector.get(); - auto navigator = Acts::Experimental::DetectorNavigator(navCfg); + Acts::Experimental::DetectorNavigator navigator(navCfg); - auto propagator = Acts::Propagator( - stepper, navigator); + Acts::Propagator + propagator(stepper, navigator); auto state = propagator.makeState(start, options); @@ -264,31 +265,33 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsForwardBackward) { auto detector = Acts::Experimental::Detector::makeShared( "cubicDetector", detectorVolumes, Acts::Experimental::tryRootVolumes()); + using Stepper = Acts::StraightLineStepper; + using Navigator = Acts::Experimental::DetectorNavigator; + using Propagator = Acts::Propagator; using ActionList = Acts::ActionList; using AbortList = Acts::AbortList; + using PropagatorOptions = Propagator::Options; - Acts::Experimental::DetectorNavigator::Config navCfg; + Navigator::Config navCfg; navCfg.detector = detector.get(); - auto stepper = Acts::StraightLineStepper(); + Stepper stepper; - auto navigator = Acts::Experimental::DetectorNavigator( - navCfg, Acts::getDefaultLogger("DetectorNavigator", - Acts::Logging::Level::VERBOSE)); + Navigator navigator(navCfg, + Acts::getDefaultLogger("DetectorNavigator", + Acts::Logging::Level::VERBOSE)); - auto options = - Acts::PropagatorOptions(geoContext, mfContext); + PropagatorOptions options(geoContext, mfContext); options.direction = Acts::Direction::Forward; - auto propagator = Acts::Propagator( + Propagator propagator( stepper, navigator, Acts::getDefaultLogger("Propagator", Acts::Logging::Level::VERBOSE)); // Forward and backward propagation // should be consistent between each other Acts::Vector4 posFwd(-2, 0, 0, 0); - auto startFwd = Acts::CurvilinearTrackParameters( + Acts::CurvilinearTrackParameters startFwd( posFwd, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, Acts::ParticleHypothesis::electron()); @@ -298,7 +301,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsForwardBackward) { options.direction = Acts::Direction::Backward; Acts::Vector4 posBwd(14, 0, 0, 0); - auto startBwd = Acts::CurvilinearTrackParameters( + Acts::CurvilinearTrackParameters startBwd( posBwd, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, Acts::ParticleHypothesis::electron()); @@ -417,33 +420,35 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsAmbiguity) { auto detector = Acts::Experimental::Detector::makeShared( "detector", {volume}, Acts::Experimental::tryRootVolumes()); + using Stepper = Acts::StraightLineStepper; + using Navigator = Acts::Experimental::DetectorNavigator; + using Propagator = Acts::Propagator; using ActionList = Acts::ActionList; using AbortList = Acts::AbortList; + using PropagatorOptions = Propagator::Options; - Acts::Experimental::DetectorNavigator::Config navCfg; + Navigator::Config navCfg; navCfg.detector = detector.get(); - auto stepper = Acts::StraightLineStepper(); + Stepper stepper; - auto navigator = Acts::Experimental::DetectorNavigator( - navCfg, Acts::getDefaultLogger("DetectorNavigator", - Acts::Logging::Level::VERBOSE)); + Navigator navigator(navCfg, + Acts::getDefaultLogger("DetectorNavigator", + Acts::Logging::Level::VERBOSE)); - auto options = - Acts::PropagatorOptions(geoContext, mfContext); + PropagatorOptions options(geoContext, mfContext); options.direction = Acts::Direction::Forward; - auto propagator = Acts::Propagator( + Propagator propagator( stepper, navigator, Acts::getDefaultLogger("Propagator", Acts::Logging::Level::VERBOSE)); // Depending on the direction, the same surface // may be reached in different points Acts::Vector4 pos(0, 0, 0, 0); - auto start = Acts::CurvilinearTrackParameters( - pos, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, - Acts::ParticleHypothesis::electron()); + Acts::CurvilinearTrackParameters start(pos, 0_degree, 90_degree, 1_e / 1_GeV, + std::nullopt, + Acts::ParticleHypothesis::electron()); // Has to properly handle propagation in the // forward and backward direction @@ -529,24 +534,26 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsMultipleIntersection) { auto detector = Acts::Experimental::Detector::makeShared( "detector", {volume}, Acts::Experimental::tryRootVolumes()); + using Stepper = Acts::StraightLineStepper; + using Navigator = Acts::Experimental::DetectorNavigator; + using Propagator = Acts::Propagator; using ActionList = Acts::ActionList; using AbortList = Acts::AbortList; + using PropagatorOptions = Propagator::Options; - Acts::Experimental::DetectorNavigator::Config navCfg; + Navigator::Config navCfg; navCfg.detector = detector.get(); - auto stepper = Acts::StraightLineStepper(); + Stepper stepper; - auto navigator = Acts::Experimental::DetectorNavigator( - navCfg, Acts::getDefaultLogger("DetectorNavigator", - Acts::Logging::Level::VERBOSE)); + Navigator navigator(navCfg, + Acts::getDefaultLogger("DetectorNavigator", + Acts::Logging::Level::VERBOSE)); - auto options = - Acts::PropagatorOptions(geoContext, mfContext); + PropagatorOptions options(geoContext, mfContext); options.direction = Acts::Direction::Forward; - auto propagator = Acts::Propagator( + Propagator propagator( stepper, navigator, Acts::getDefaultLogger("Propagator", Acts::Logging::Level::VERBOSE)); @@ -555,7 +562,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsMultipleIntersection) { // and the cylindrical surface should be // reached in two points during navigation Acts::Vector4 posFwd(-5, 0, 0, 0); - auto startFwd = Acts::CurvilinearTrackParameters( + Acts::CurvilinearTrackParameters startFwd( posFwd, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, Acts::ParticleHypothesis::electron()); @@ -564,7 +571,7 @@ BOOST_AUTO_TEST_CASE(DetectorNavigatorTestsMultipleIntersection) { options.direction = Acts::Direction::Backward; Acts::Vector4 posBwd(5, 0, 0, 0); - auto startBwd = Acts::CurvilinearTrackParameters( + Acts::CurvilinearTrackParameters startBwd( posBwd, 0_degree, 90_degree, 1_e / 1_GeV, std::nullopt, Acts::ParticleHypothesis::electron()); diff --git a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp index fd9da066a10..90860e0cc44 100644 --- a/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/AtlasStepperTests.cpp @@ -66,8 +66,10 @@ struct MockPropagatorState { Stepper::State stepping; /// Propagator options with only the relevant components. struct { - double stepTolerance = 10_um; Direction direction = Direction::Backward; + struct { + double stepTolerance = 10_um; + } stepping; } options; }; diff --git a/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp b/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp index 0cb593f60e6..3ab839d96b1 100644 --- a/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/BoundToCurvilinearConversionTests.cpp @@ -232,29 +232,32 @@ void test_bound_to_curvilinear(const std::vector &test_data_list, MSG_DEBUG("curvilinear covariance alt.:" << std::endl << curvi_cov_alt); + auto stepper = stepper_creator(bField); + MSG_DEBUG("Stepper type " << typeid(stepper).name()); + + using Stepper = decltype(stepper); + using Propagator = Acts::Propagator; + using PropagatorOptions = typename Propagator::template Options<>; + // configure propagator for tiny step size - Acts::PropagatorOptions<> null_propagation_options(geoCtx, - magFieldContext); + PropagatorOptions null_propagation_options(geoCtx, magFieldContext); null_propagation_options.pathLimit = i == 0 ? 0 : 1e-12 * 1_m * std::pow(10, i - 1); if (null_propagation_options.pathLimit > 0 && i > 1) { - null_propagation_options.stepTolerance = + null_propagation_options.stepping.stepTolerance = null_propagation_options.pathLimit * .99; null_propagation_options.surfaceTolerance = null_propagation_options.pathLimit * .99; } - auto stepper = stepper_creator(bField); - MSG_DEBUG("Stepper type " << typeid(stepper).name()); auto log_level = (isDebugOutputEnabled() ? Acts::Logging::VERBOSE : Acts::Logging::INFO); // Use propagator with small step size to compute parameters in // curvilinear parameterisation - Propagator propagator( - std::move(stepper), Acts::VoidNavigator(), - Acts::getDefaultLogger("Propagator", log_level)); + Propagator propagator(std::move(stepper), Acts::VoidNavigator(), + Acts::getDefaultLogger("Propagator", log_level)); auto result = propagator.propagate(params, null_propagation_options, true); { @@ -264,7 +267,8 @@ void test_bound_to_curvilinear(const std::vector &test_data_list, MSG_DEBUG(i << " | " << "limit: " << null_propagation_options.pathLimit << " tolerance: " - << null_propagation_options.stepTolerance << std::endl); + << null_propagation_options.stepping.stepTolerance + << std::endl); Acts::BoundSquareMatrix curvi_cov = curvilinear_parameters.value().covariance().value(); diff --git a/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp b/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp index a7cd0e2de39..b8fd2280852 100644 --- a/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp +++ b/Tests/UnitTests/Core/Propagator/CovarianceEngineTests.cpp @@ -198,8 +198,9 @@ using propagator_t = Propagator, VoidNavigator>; BoundVector localToLocal(const propagator_t& prop, const BoundVector& local, const Surface& src, const Surface& dst) { - PropagatorOptions<> options{gctx, mctx}; - options.stepTolerance = 1e-10; + using PropagatorOptions = typename propagator_t::template Options<>; + PropagatorOptions options{gctx, mctx}; + options.stepping.stepTolerance = 1e-10; options.surfaceTolerance = 1e-10; BoundTrackParameters start{src.getSharedPtr(), local, std::nullopt, diff --git a/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp b/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp index 44b5b73a620..af778c06db4 100644 --- a/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/DirectNavigatorTests.cpp @@ -111,10 +111,11 @@ void runTest(const rpropagator_t& rprop, const dpropagator_t& dprop, double pT, using ReferenceAbortList = AbortList; // Options definition - using Options = PropagatorOptions; + using Options = typename rpropagator_t::template Options; Options pOptions(tgContext, mfContext); if (oversteppingTest) { - pOptions.maxStepSize = oversteppingMaxStepSize; + pOptions.stepping.maxStepSize = oversteppingMaxStepSize; } // Surface collector configuration @@ -144,11 +145,12 @@ void runTest(const rpropagator_t& rprop, const dpropagator_t& dprop, double pT, MaterialInteractor, SurfaceCollector<>>; // Direct options definition - using DirectOptions = PropagatorOptions>; + using DirectOptions = + typename dpropagator_t::template Options>; DirectOptions dOptions(tgContext, mfContext); // Set the surface sequence auto& dInitializer = - dOptions.actionList.get(); + dOptions.actionList.template get(); dInitializer.navSurfaces = surfaceSequence; // Surface collector configuration auto& dCollector = dOptions.actionList.template get>(); diff --git a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp index a3560924fc0..dbf6b7b8ad4 100644 --- a/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/EigenStepperTests.cpp @@ -97,10 +97,12 @@ struct PropState { stepper_state_t stepping; /// Propagator options which only carry the relevant components struct { - double stepTolerance = 1e-4; - double stepSizeCutOff = 0.; - unsigned int maxRungeKuttaStepTrials = 10000; Direction direction = Direction::Forward; + struct { + double stepTolerance = 1e-4; + double stepSizeCutOff = 0.; + unsigned int maxRungeKuttaStepTrials = 10000; + } stepping; } options; }; @@ -515,7 +517,7 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { CHECK_CLOSE_COVARIANCE(esState.cov, Covariance(2. * cov), eps); // Test a case where no step size adjustment is required - ps.options.stepTolerance = 2. * 4.4258e+09; + ps.options.stepping.stepTolerance = 2. * 4.4258e+09; double h0 = esState.stepSize.value(); es.step(ps, mockNavigator); CHECK_CLOSE_ABS(h0, esState.stepSize.value(), eps); @@ -527,15 +529,15 @@ BOOST_AUTO_TEST_CASE(eigen_stepper_test) { stepSize); PropState nps(navDir, copyState(*nBfield, nesState)); // Test that we can reach the minimum step size - nps.options.stepTolerance = 1e-21; - nps.options.stepSizeCutOff = 1e20; + nps.options.stepping.stepTolerance = 1e-21; + nps.options.stepping.stepSizeCutOff = 1e20; auto res = nes.step(nps, mockNavigator); BOOST_CHECK(!res.ok()); BOOST_CHECK_EQUAL(res.error(), EigenStepperError::StepSizeStalled); // Test that the number of trials exceeds - nps.options.stepSizeCutOff = 0.; - nps.options.maxRungeKuttaStepTrials = 0.; + nps.options.stepping.stepSizeCutOff = 0.; + nps.options.stepping.maxRungeKuttaStepTrials = 0.; res = nes.step(nps, mockNavigator); BOOST_CHECK(!res.ok()); BOOST_CHECK_EQUAL(res.error(), EigenStepperError::StepSizeAdjustmentFailed); @@ -583,30 +585,22 @@ BOOST_AUTO_TEST_CASE(step_extension_vacuum_test) { const CurvilinearTrackParameters sbtp(Vector4::Zero(), startDir, 1_e / 1_GeV, cov, ParticleHypothesis::pion()); - // Create action list for surface collection - ActionList aList; - AbortList abortList; + using Stepper = EigenStepper< + StepperExtensionList, + detail::HighestValidAuctioneer>; + using Propagator = Propagator; + using PropagatorOptions = + Propagator::Options, AbortList>; // Set options for propagator - DenseStepperPropagatorOptions, - AbortList> - propOpts(tgContext, mfContext); - propOpts.actionList = aList; - propOpts.abortList = abortList; + PropagatorOptions propOpts(tgContext, mfContext); propOpts.maxSteps = 100; - propOpts.maxStepSize = 1.5_m; + propOpts.stepping.maxStepSize = 1.5_m; // Build stepper and propagator auto bField = std::make_shared(Vector3(0., 0., 0.)); - EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer> - es(bField); - Propagator, - detail::HighestValidAuctioneer>, - Navigator> - prop(es, naviVac); + Stepper es(bField); + Propagator prop(es, naviVac); // Launch and collect results const auto& result = prop.propagate(sbtp, propOpts).value(); @@ -625,20 +619,20 @@ BOOST_AUTO_TEST_CASE(step_extension_vacuum_test) { CHECK_CLOSE_ABS(mom, startMom, 1_keV); } - // Rebuild and check the choice of extension - ActionList aListDef; + using DefStepper = EigenStepper< + StepperExtensionList, + detail::HighestValidAuctioneer>; + using DefPropagator = Acts::Propagator; + using DefPropagatorOptions = + DefPropagator::Options, AbortList>; // Set options for propagator - PropagatorOptions, AbortList> - propOptsDef(tgContext, mfContext); - propOptsDef.actionList = aListDef; - propOptsDef.abortList = abortList; + DefPropagatorOptions propOptsDef(tgContext, mfContext); propOptsDef.maxSteps = 100; - propOptsDef.maxStepSize = 1.5_m; + propOptsDef.stepping.maxStepSize = 1.5_m; - EigenStepper> esDef(bField); - Propagator>, Navigator> - propDef(esDef, naviVac); + DefStepper esDef(bField); + DefPropagator propDef(esDef, naviVac); // Launch and collect results const auto& resultDef = propDef.propagate(sbtp, propOptsDef).value(); @@ -690,31 +684,23 @@ BOOST_AUTO_TEST_CASE(step_extension_material_test) { const CurvilinearTrackParameters sbtp(Vector4::Zero(), startDir, 1_e / 5_GeV, cov, ParticleHypothesis::pion()); - // Create action list for surface collection - ActionList aList; - AbortList abortList; + using Stepper = EigenStepper< + StepperExtensionList, + detail::HighestValidAuctioneer>; + using Propagator = Propagator; + using PropagatorOptions = + Propagator::Options, AbortList>; // Set options for propagator - DenseStepperPropagatorOptions, - AbortList> - propOpts(tgContext, mfContext); - propOpts.actionList = aList; - propOpts.abortList = abortList; + PropagatorOptions propOpts(tgContext, mfContext); propOpts.maxSteps = 10000; - propOpts.maxStepSize = 1.5_m; + propOpts.stepping.maxStepSize = 1.5_m; // Build stepper and propagator auto bField = std::make_shared(Vector3(0., 0., 0.)); - EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer> - es(bField); - Propagator, - detail::HighestValidAuctioneer>, - Navigator> - prop(es, naviMat, - Acts::getDefaultLogger("Propagator", Acts::Logging::VERBOSE)); + Stepper es(bField); + Propagator prop(es, naviMat, + Acts::getDefaultLogger("Propagator", Acts::Logging::VERBOSE)); // Launch and collect results const auto& result = prop.propagate(sbtp, propOpts).value(); @@ -741,21 +727,23 @@ BOOST_AUTO_TEST_CASE(step_extension_material_test) { } } + using DenseStepper = + EigenStepper, + detail::HighestValidAuctioneer>; + using DensePropagator = Acts::Propagator; + using DensePropagatorOptions = + DensePropagator::Options, + AbortList>; + // Rebuild and check the choice of extension // Set options for propagator - DenseStepperPropagatorOptions, - AbortList> - propOptsDense(tgContext, mfContext); - propOptsDense.actionList = aList; - propOptsDense.abortList = abortList; + DensePropagatorOptions propOptsDense(tgContext, mfContext); propOptsDense.maxSteps = 1000; - propOptsDense.maxStepSize = 1.5_m; + propOptsDense.stepping.maxStepSize = 1.5_m; // Build stepper and propagator - EigenStepper> esDense(bField); - Propagator>, - Navigator> - propDense(esDense, naviMat); + DenseStepper esDense(bField); + DensePropagator propDense(esDense, naviMat); // Launch and collect results const auto& resultDense = propDense.propagate(sbtp, propOptsDense).value(); @@ -779,15 +767,8 @@ BOOST_AUTO_TEST_CASE(step_extension_material_test) { // Re-launch the configuration with magnetic field bField->setField(Vector3{0., 1_T, 0.}); - EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer> - esB(bField); - Propagator, - detail::HighestValidAuctioneer>, - Navigator> - propB(esB, naviMat); + Stepper esB(bField); + Propagator propB(esB, naviMat); const auto& resultB = propB.propagate(sbtp, propOptsDense).value(); const StepCollector::this_result& stepResultB = @@ -853,29 +834,23 @@ BOOST_AUTO_TEST_CASE(step_extension_vacmatvac_test) { 1_e / 5_GeV, Covariance::Identity(), ParticleHypothesis::pion()); - // Create action list for surface collection - AbortList abortList; - abortList.get().maxX = 3_m; + using Stepper = EigenStepper< + StepperExtensionList, + detail::HighestValidAuctioneer>; + using Propagator = Acts::Propagator; + using PropagatorOptions = + Propagator::Options, AbortList>; // Set options for propagator - DenseStepperPropagatorOptions, - AbortList> - propOpts(tgContext, mfContext); - propOpts.abortList = abortList; + PropagatorOptions propOpts(tgContext, mfContext); + propOpts.abortList.get().maxX = 3_m; propOpts.maxSteps = 1000; - propOpts.maxStepSize = 1.5_m; + propOpts.stepping.maxStepSize = 1.5_m; // Build stepper and propagator auto bField = std::make_shared(Vector3(0., 1_T, 0.)); - EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer> - es(bField); - Propagator, - detail::HighestValidAuctioneer>, - Navigator> - prop(es, naviDet); + Stepper es(bField); + Propagator prop(es, naviDet); // Launch and collect results const auto& result = prop.propagate(sbtp, propOpts).value(); @@ -915,17 +890,19 @@ BOOST_AUTO_TEST_CASE(step_extension_vacmatvac_test) { // Build launcher through vacuum // Set options for propagator - PropagatorOptions, AbortList> - propOptsDef(tgContext, mfContext); - abortList.get().maxX = 3_m; - propOptsDef.abortList = abortList; + using DefStepper = EigenStepper>; + using DefPropagator = Acts::Propagator; + using DefPropagatorOptions = + DefPropagator::Options, AbortList>; + + DefPropagatorOptions propOptsDef(tgContext, mfContext); + propOptsDef.abortList.get().maxX = 3_m; propOptsDef.maxSteps = 1000; - propOptsDef.maxStepSize = 1.5_m; + propOptsDef.stepping.maxStepSize = 1.5_m; // Build stepper and propagator - EigenStepper> esDef(bField); - Propagator>, Navigator> - propDef(esDef, naviDet); + DefStepper esDef(bField); + DefPropagator propDef(esDef, naviDet); // Launch and collect results const auto& resultDef = propDef.propagate(sbtp, propOptsDef).value(); @@ -963,23 +940,22 @@ 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 DensePropagator = Acts::Propagator; + using DensePropagatorOptions = + DensePropagator::Options, + AbortList>; + // Set options for propagator - DenseStepperPropagatorOptions, - AbortList> - propOptsDense(tgContext, mfContext); - abortList.get().maxX = 3_m; - propOptsDense.abortList = abortList; + DensePropagatorOptions propOptsDense(tgContext, mfContext); + propOptsDense.abortList.get().maxX = 3_m; propOptsDense.maxSteps = 1000; - propOptsDense.maxStepSize = 1.5_m; + propOptsDense.stepping.maxStepSize = 1.5_m; // Build stepper and propagator - EigenStepper< - StepperExtensionList> - esDense(bField); - Propagator>, - Navigator> - propDense(esDense, naviDet); + DenseStepper esDense(bField); + DensePropagator propDense(esDense, naviDet); // Launch and collect results const auto& resultDense = propDense.propagate(sbtp, propOptsDense).value(); @@ -1095,24 +1071,23 @@ BOOST_AUTO_TEST_CASE(step_extension_trackercalomdt_test) { 1_e / 1_GeV, Covariance::Identity(), ParticleHypothesis::pion()); + using Stepper = EigenStepper< + StepperExtensionList, + detail::HighestValidAuctioneer>; + using Propagator = Acts::Propagator; + using PropagatorOptions = + Propagator::Options, + AbortList>; + // Set options for propagator - DenseStepperPropagatorOptions, - AbortList> - propOpts(tgContext, mfContext); + PropagatorOptions propOpts(tgContext, mfContext); propOpts.abortList.get().maxX = 3._m; propOpts.maxSteps = 10000; // Build stepper and propagator auto bField = std::make_shared(Vector3(0., 0., 0.)); - EigenStepper< - StepperExtensionList, - detail::HighestValidAuctioneer> - es(bField); - Propagator, - detail::HighestValidAuctioneer>, - Navigator> - prop(es, naviVac); + Stepper es(bField); + Propagator prop(es, naviVac); // Launch and collect results const auto& result = prop.propagate(sbtp, propOpts).value(); diff --git a/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp b/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp index 842590527b2..e20cc7430ba 100644 --- a/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/ExtrapolatorTests.cpp @@ -112,8 +112,8 @@ BOOST_DATA_TEST_CASE( CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, ParticleHypothesis::pion()); - PropagatorOptions<> options(tgContext, mfContext); - options.maxStepSize = 10_cm; + EigenPropagatorType::Options<> options(tgContext, mfContext); + options.stepping.maxStepSize = 10_cm; options.pathLimit = 25_cm; BOOST_CHECK( @@ -157,18 +157,19 @@ BOOST_DATA_TEST_CASE( // A PlaneSelector for the SurfaceCollector using PlaneCollector = SurfaceCollector; - PropagatorOptions> options(tgContext, mfContext); + EigenPropagatorType::Options> options(tgContext, + mfContext); - options.maxStepSize = 10_cm; + options.stepping.maxStepSize = 10_cm; options.pathLimit = 25_cm; const auto& result = epropagator.propagate(start, options).value(); auto collector_result = result.get(); // step through the surfaces and go step by step - PropagatorOptions<> optionsEmpty(tgContext, mfContext); + EigenPropagatorType::Options<> optionsEmpty(tgContext, mfContext); - optionsEmpty.maxStepSize = 25_cm; + optionsEmpty.stepping.maxStepSize = 25_cm; // Try propagation from start to each surface for (const auto& colsf : collector_result.collected) { const auto& csurface = colsf.surface; @@ -219,9 +220,9 @@ BOOST_DATA_TEST_CASE( CurvilinearTrackParameters start(Vector4(0, 0, 0, 0), phi, theta, q / p, cov, ParticleHypothesis::pion()); - PropagatorOptions> options(tgContext, - mfContext); - options.maxStepSize = 25_cm; + EigenPropagatorType::Options> options( + tgContext, mfContext); + options.stepping.maxStepSize = 25_cm; options.pathLimit = 25_cm; const auto& result = epropagator.propagate(start, options).value(); @@ -267,9 +268,9 @@ BOOST_DATA_TEST_CASE( ParticleHypothesis::pion()); // Action list and abort list - PropagatorOptions> options(tgContext, - mfContext); - options.maxStepSize = 25_cm; + EigenPropagatorType::Options> options( + tgContext, mfContext); + options.stepping.maxStepSize = 25_cm; options.pathLimit = 1500_mm; const auto& status = epropagator.propagate(start, options).value(); diff --git a/Tests/UnitTests/Core/Propagator/KalmanExtrapolatorTests.cpp b/Tests/UnitTests/Core/Propagator/KalmanExtrapolatorTests.cpp index 700caf744ee..a41cce01297 100644 --- a/Tests/UnitTests/Core/Propagator/KalmanExtrapolatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/KalmanExtrapolatorTests.cpp @@ -139,11 +139,11 @@ BOOST_AUTO_TEST_CASE(kalman_extrapolator) { using Aborters = AbortList; // Create some options - using StepWiseOptions = PropagatorOptions; + using StepWiseOptions = Propagator::Options; StepWiseOptions swOptions(tgContext, mfContext); using PlainActors = ActionList<>; - using PlainOptions = PropagatorOptions; + using PlainOptions = Propagator::Options; PlainOptions pOptions(tgContext, mfContext); // Run the standard propagation diff --git a/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp b/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp index af97bbde10a..c0a2a35d214 100644 --- a/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/LoopProtectionTests.cpp @@ -198,7 +198,7 @@ BOOST_DATA_TEST_CASE( CurvilinearTrackParameters start(Vector4(0, 0, 0, 42), phi, theta, q / p, std::nullopt, ParticleHypothesis::pion()); - using PropagatorOptions = PropagatorOptions, AbortList<>>; + using PropagatorOptions = EigenPropagator::Options, AbortList<>>; PropagatorOptions options(tgContext, mfContext); options.maxSteps = 1e6; const auto& result = epropagator.propagate(start, options).value(); diff --git a/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp b/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp index 6c8e16d56df..a1bce8d77dc 100644 --- a/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MaterialCollectionTests.cpp @@ -89,11 +89,10 @@ void runTest(const propagator_t& prop, using ActionListType = ActionList; using AbortListType = AbortList<>; - using Options = PropagatorOptions; - - // forward material test + using Options = + typename propagator_t::template Options; Options fwdOptions(tgContext, mfContext); - fwdOptions.maxStepSize = 25_cm; + fwdOptions.stepping.maxStepSize = 25_cm; fwdOptions.pathLimit = 25_cm; // get the material collector and configure it @@ -136,7 +135,7 @@ void runTest(const propagator_t& prop, // backward material test Options bwdOptions(tgContext, mfContext); - bwdOptions.maxStepSize = 25_cm; + bwdOptions.stepping.maxStepSize = 25_cm; bwdOptions.pathLimit = -25_cm; bwdOptions.direction = Direction::Backward; @@ -194,7 +193,7 @@ void runTest(const propagator_t& prop, // stepping from one surface to the next // now go from surface to surface and check Options fwdStepOptions(tgContext, mfContext); - fwdStepOptions.maxStepSize = 25_cm; + fwdStepOptions.stepping.maxStepSize = 25_cm; fwdStepOptions.pathLimit = 25_cm; // get the material collector and configure it @@ -267,7 +266,7 @@ void runTest(const propagator_t& prop, // stepping from one surface to the next : backwards // now go from surface to surface and check Options bwdStepOptions(tgContext, mfContext); - bwdStepOptions.maxStepSize = 25_cm; + bwdStepOptions.stepping.maxStepSize = 25_cm; bwdStepOptions.pathLimit = -25_cm; bwdStepOptions.direction = Direction::Backward; diff --git a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp index ef231d56669..be4b0d81661 100644 --- a/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/MultiStepperTests.cpp @@ -72,11 +72,15 @@ const auto defaultNullBField = std::make_shared(); const auto particleHypothesis = ParticleHypothesis::pion(); struct Options { - double stepTolerance = 1e-4; - double stepSizeCutOff = 0.0; - std::size_t maxRungeKuttaStepTrials = 10; Direction direction = defaultNDir; + const Acts::Logger &logger = Acts::getDummyLogger(); + + struct { + double stepTolerance = 1e-4; + double stepSizeCutOff = 0.0; + std::size_t maxRungeKuttaStepTrials = 10; + } stepping; }; struct MockNavigator {}; @@ -730,6 +734,8 @@ void propagator_instatiation_test_function() { auto surface = Acts::Surface::makeShared( Vector3::Zero(), Vector3{1.0, 0.0, 0.0}); + using PropagatorOptions = + typename Propagator::template Options<>; PropagatorOptions options(geoCtx, magCtx); std::vector>> diff --git a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp index ed1ddeba766..dad3439cba7 100644 --- a/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp +++ b/Tests/UnitTests/Core/Propagator/PropagatorTests.cpp @@ -153,7 +153,7 @@ const int ntests = 5; // This tests the Options BOOST_AUTO_TEST_CASE(PropagatorOptions_) { - using null_optionsType = PropagatorOptions<>; + using null_optionsType = EigenPropagatorType::Options<>; null_optionsType null_options(tgContext, mfContext); // todo write null options test @@ -195,11 +195,11 @@ BOOST_DATA_TEST_CASE( using AbortConditionsType = AbortList<>; // setup propagation options - PropagatorOptions options(tgContext, - mfContext); + EigenPropagatorType::Options options( + tgContext, mfContext); options.pathLimit = 20_m; - options.maxStepSize = 1_cm; + options.stepping.maxStepSize = 1_cm; // set the surface to be passed by options.actionList.get().surface = mSurface.get(); @@ -253,9 +253,9 @@ BOOST_DATA_TEST_CASE( (void)index; // setup propagation options - the tow step options - PropagatorOptions<> options_2s(tgContext, mfContext); + EigenPropagatorType::Options<> options_2s(tgContext, mfContext); options_2s.pathLimit = 50_cm; - options_2s.maxStepSize = 1_cm; + options_2s.stepping.maxStepSize = 1_cm; // define start parameters double x = 0; @@ -283,9 +283,9 @@ BOOST_DATA_TEST_CASE( epropagator.propagate(*mid_parameters, options_2s).value().endParameters; // setup propagation options - the one step options - PropagatorOptions<> options_1s(tgContext, mfContext); + EigenPropagatorType::Options<> options_1s(tgContext, mfContext); options_1s.pathLimit = 100_cm; - options_1s.maxStepSize = 1_cm; + options_1s.stepping.maxStepSize = 1_cm; // propagate to a path length of 100 in one step const auto& end_parameters_1s = epropagator.propagate(start, options_1s).value().endParameters; @@ -333,9 +333,9 @@ BOOST_DATA_TEST_CASE( (void)index; // setup propagation options - 2 setp options - PropagatorOptions<> options_2s(tgContext, mfContext); + EigenPropagatorType::Options<> options_2s(tgContext, mfContext); options_2s.pathLimit = 10_m; - options_2s.maxStepSize = 1_cm; + options_2s.stepping.maxStepSize = 1_cm; // define start parameters double x = 0; @@ -366,9 +366,9 @@ BOOST_DATA_TEST_CASE( .endParameters; // setup propagation options - one step options - PropagatorOptions<> options_1s(tgContext, mfContext); + EigenPropagatorType::Options<> options_1s(tgContext, mfContext); options_1s.pathLimit = 10_m; - options_1s.maxStepSize = 1_cm; + options_1s.stepping.maxStepSize = 1_cm; // propagate to a final surface in one stop const auto& end_parameters_1s = epropagator.propagate(start, *cSurface, options_1s).value().endParameters; @@ -412,7 +412,7 @@ BOOST_AUTO_TEST_CASE(BasicPropagatorInterface) { GeometryContext gctx; MagneticFieldContext mctx; - PropagatorOptions<> options{gctx, mctx}; + EigenPropagatorType::Options<> options{gctx, mctx}; { Propagator propagator{eigenStepper, navigator}; diff --git a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp index ce6d335217c..1ea875e5735 100644 --- a/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp +++ b/Tests/UnitTests/Core/Propagator/SympyStepperTests.cpp @@ -96,10 +96,12 @@ struct PropState { stepper_state_t stepping; /// Propagator options which only carry the relevant components struct { - double stepTolerance = 1e-4; - double stepSizeCutOff = 0.; - unsigned int maxRungeKuttaStepTrials = 10000; Direction direction = Direction::Forward; + struct { + double stepTolerance = 1e-4; + double stepSizeCutOff = 0.; + unsigned int maxRungeKuttaStepTrials = 10000; + } stepping; } options; }; @@ -512,7 +514,7 @@ BOOST_AUTO_TEST_CASE(sympy_stepper_test) { CHECK_CLOSE_COVARIANCE(esState.cov, Covariance(2. * cov), eps); // Test a case where no step size adjustment is required - ps.options.stepTolerance = 2. * 4.4258e+09; + ps.options.stepping.stepTolerance = 2. * 4.4258e+09; double h0 = esState.stepSize.value(); es.step(ps, mockNavigator); CHECK_CLOSE_ABS(h0, esState.stepSize.value(), eps); diff --git a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp index 2e9142f7a11..90a48df6a00 100644 --- a/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp +++ b/Tests/UnitTests/Core/Surfaces/LineSurfaceTests.cpp @@ -312,13 +312,16 @@ BOOST_AUTO_TEST_CASE(LineSurfaceIntersection) { BoundTrackParameters initialParams{surface, boundVector, std::nullopt, ParticleHypothesis::pion()}; - Propagator propagator({}); + using Propagator = Propagator; + using PropagatorOptions = Propagator::Options<>; + + Propagator propagator({}); CurvilinearTrackParameters displacedParameters{ Vector4::Zero(), Vector3::Zero(), 1, std::nullopt, ParticleHypothesis::pion()}; { - PropagatorOptions<> options(tgContext, {}); + PropagatorOptions options(tgContext, {}); options.direction = Acts::Direction::Backward; options.pathLimit = pathLimit; @@ -339,9 +342,9 @@ BOOST_AUTO_TEST_CASE(LineSurfaceIntersection) { BoundTrackParameters endParameters{surface, BoundVector::Zero(), std::nullopt, ParticleHypothesis::pion()}; { - PropagatorOptions<> options(tgContext, {}); + PropagatorOptions options(tgContext, {}); options.direction = Acts::Direction::Forward; - options.maxStepSize = 1_mm; + options.stepping.maxStepSize = 1_mm; auto result = propagator.propagate(displacedParameters, *surface, options); BOOST_CHECK(result.ok()); diff --git a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp index c879edab9f0..3569f6c9a9d 100644 --- a/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp +++ b/Tests/UnitTests/Core/TrackFinding/CombinatorialKalmanFilterTests.cpp @@ -292,7 +292,7 @@ struct Fixture { return CombinatorialKalmanFilterOptions( geoCtx, magCtx, calCtx, Acts::SourceLinkAccessorDelegate{}, - getExtensions(), Acts::PropagatorPlainOptions()); + getExtensions(), Acts::PropagatorPlainOptions(geoCtx, magCtx)); } }; diff --git a/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp b/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp index 1a30d047c99..803a81f8043 100644 --- a/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/GsfTests.cpp @@ -98,9 +98,9 @@ const GSF gsfZero(makeConstantFieldPropagator(tester.geometry, 0_T), std::default_random_engine rng(42); auto makeDefaultGsfOptions() { - return GsfOptions{tester.geoCtx, tester.magCtx, - tester.calCtx, getExtensions(), - PropagatorPlainOptions()}; + return GsfOptions{ + tester.geoCtx, tester.magCtx, tester.calCtx, getExtensions(), + PropagatorPlainOptions(tester.geoCtx, tester.magCtx)}; } // A Helper type to allow us to put the MultiComponentBoundTrackParameters into diff --git a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp index c84cd0957f2..caa15e9c6d8 100644 --- a/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/Gx2fTests.cpp @@ -239,8 +239,9 @@ BOOST_AUTO_TEST_CASE(NoFit) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 0, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 0, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -326,8 +327,9 @@ BOOST_AUTO_TEST_CASE(Fit5Iterations) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 5, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 5, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -431,8 +433,9 @@ BOOST_AUTO_TEST_CASE(MixedDetector) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 5, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 5, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -526,8 +529,9 @@ BOOST_AUTO_TEST_CASE(FitWithBfield) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 5, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 5, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -623,8 +627,9 @@ BOOST_AUTO_TEST_CASE(relChi2changeCutOff) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 500, 1e-5); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 500, 1e-5); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -723,8 +728,9 @@ BOOST_AUTO_TEST_CASE(DidNotConverge) { // Since we didn't break due to convergence, we reach nUpdatesMax and // therefore fail the fit. const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 6, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 6, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -791,8 +797,9 @@ BOOST_AUTO_TEST_CASE(NotEnoughMeasurements) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 6, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 6, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -879,8 +886,9 @@ BOOST_AUTO_TEST_CASE(FindHoles) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 20, 1e-5); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 20, 1e-5); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; @@ -984,8 +992,9 @@ BOOST_AUTO_TEST_CASE(Material) { .connect<&TestSourceLink::SurfaceAccessor::operator()>(&surfaceAccessor); const Experimental::Gx2FitterOptions gx2fOptions( - geoCtx, magCtx, calCtx, extensions, PropagatorPlainOptions(), rSurface, - false, false, FreeToBoundCorrection(false), 5, 0); + geoCtx, magCtx, calCtx, extensions, + PropagatorPlainOptions(geoCtx, magCtx), rSurface, false, false, + FreeToBoundCorrection(false), 5, 0); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; diff --git a/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp b/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp index 710579ca73c..34811d7b6e8 100644 --- a/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp +++ b/Tests/UnitTests/Core/TrackFitting/KalmanFitterTests.cpp @@ -102,8 +102,9 @@ auto makeDefaultKalmanFitterOptions() { &Acts::detail::Test::TestSourceLink::SurfaceAccessor::operator()>( &tester.surfaceAccessor); - return KalmanFitterOptions(tester.geoCtx, tester.magCtx, tester.calCtx, - extensions, PropagatorPlainOptions()); + return KalmanFitterOptions( + tester.geoCtx, tester.magCtx, tester.calCtx, extensions, + PropagatorPlainOptions(tester.geoCtx, tester.magCtx)); } } // namespace diff --git a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp index dbd3e442d05..321aa852da7 100644 --- a/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp +++ b/Tests/UnitTests/Core/Vertexing/ImpactPointEstimatorTests.cpp @@ -25,6 +25,7 @@ #include "Acts/MagneticField/NullBField.hpp" #include "Acts/Propagator/EigenStepper.hpp" #include "Acts/Propagator/Propagator.hpp" +#include "Acts/Propagator/PropagatorOptions.hpp" #include "Acts/Propagator/StraightLineStepper.hpp" #include "Acts/Propagator/VoidNavigator.hpp" #include "Acts/Surfaces/PerigeeSurface.hpp" @@ -195,6 +196,7 @@ BOOST_DATA_TEST_CASE(SingleTrackDistanceParametersCompatibility3D, tracks, d0, BOOST_DATA_TEST_CASE(TimeAtPca, tracksWithoutIPs* vertices, t0, phi, theta, p, q, vx0, vy0, vz0, vt0) { using Propagator = Acts::Propagator; + using PropagatorOptions = Propagator::Options<>; using StraightPropagator = Acts::Propagator; // Set up quantities for constant B field diff --git a/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp b/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp index 22be56bab6e..b642b3a5ddc 100644 --- a/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp +++ b/Tests/UnitTests/Core/Visualization/EventDataView3DBase.hpp @@ -357,7 +357,8 @@ static inline std::string testMultiTrajectory(IVisualization3D& helper) { &surfaceAccessor); KalmanFitterOptions kfOptions(tgContext, mfContext, calContext, extensions, - PropagatorPlainOptions(), rSurface); + PropagatorPlainOptions(tgContext, mfContext), + rSurface); Acts::TrackContainer tracks{Acts::VectorTrackContainer{}, Acts::VectorMultiTrajectory{}}; diff --git a/docs/_extensions/lazy_autodoc.py b/docs/_extensions/lazy_autodoc.py index 28da5b16fd0..1c31e855195 100644 --- a/docs/_extensions/lazy_autodoc.py +++ b/docs/_extensions/lazy_autodoc.py @@ -74,7 +74,6 @@ def run() -> None: } role_instances["struct"] |= { - "Acts::DenseStepperPropagatorOptions", "Acts::Geant4PhysicalVolumeSelectors::AllSelector", "Acts::Geant4PhysicalVolumeSelectors::NameSelector", "Acts::Geant4PhysicalVolumeSelectors::PositionSelector",