diff --git a/Core/include/Acts/Propagator/Propagator.hpp b/Core/include/Acts/Propagator/Propagator.hpp index 147f04892c0..f101af7ba7e 100644 --- a/Core/include/Acts/Propagator/Propagator.hpp +++ b/Core/include/Acts/Propagator/Propagator.hpp @@ -353,6 +353,7 @@ class Propagator final { /// /// @param [in] start initial track parameters to propagate /// @param [in] options Propagation options, type Options<,> + /// @param [in] makeCurvilinear Produce curvilinear parameters at the end of the propagation /// /// @return Propagation result containing the propagation status, final /// track parameters, and output of actions (if they produce any) @@ -362,8 +363,8 @@ class Propagator final { Result< action_list_t_result_t> - propagate(const parameters_t& start, - const propagator_options_t& options) const; + propagate(const parameters_t& start, const propagator_options_t& options, + bool makeCurvilinear = true) const; /// @brief Propagate track parameters /// @@ -378,6 +379,7 @@ class Propagator final { /// /// @param [in] start initial track parameters to propagate /// @param [in] options Propagation options, type Options<,> + /// @param [in] makeCurvilinear Produce curvilinear parameters at the end of the propagation /// @param [in] inputResult an existing result object to start from /// /// @return Propagation result containing the propagation status, final @@ -390,6 +392,7 @@ class Propagator final { typename propagator_options_t::action_list_type>> propagate( const parameters_t& start, const propagator_options_t& options, + bool makeCurvilinear, action_list_t_result_t&& inputResult) const; diff --git a/Core/include/Acts/Propagator/Propagator.ipp b/Core/include/Acts/Propagator/Propagator.ipp index 718d03dcc96..6562dfbe20d 100644 --- a/Core/include/Acts/Propagator/Propagator.ipp +++ b/Core/include/Acts/Propagator/Propagator.ipp @@ -90,8 +90,9 @@ auto Acts::Propagator::propagate_impl(propagator_state_t& state, template template -auto Acts::Propagator::propagate( - const parameters_t& start, const propagator_options_t& options) const +auto Acts::Propagator::propagate(const parameters_t& start, + const propagator_options_t& options, + bool makeCurvilinear) const -> Result> { @@ -107,7 +108,7 @@ auto Acts::Propagator::propagate( typename propagator_options_t::action_list_type>; return propagate( - start, options, ResultType{}); + start, options, makeCurvilinear, ResultType{}); } template @@ -115,6 +116,7 @@ template auto Acts::Propagator::propagate( const parameters_t& start, const propagator_options_t& options, + bool makeCurvilinear, action_list_t_result_t&& inputResult) const @@ -162,13 +164,16 @@ auto Acts::Propagator::propagate( // Perform the actual propagation & check its outcome auto result = propagate_impl(state, inputResult); if (result.ok()) { - /// Convert into return type and fill the result object - auto curvState = m_stepper.curvilinearState(state.stepping); - // Fill the end parameters - inputResult.endParameters = std::get(curvState); - // Only fill the transport jacobian when covariance transport was done - if (state.stepping.covTransport) { - inputResult.transportJacobian = std::get(curvState); + if (makeCurvilinear) { + /// Convert into return type and fill the result object + auto curvState = m_stepper.curvilinearState(state.stepping); + // Fill the end parameters + inputResult.endParameters = + std::get(curvState); + // Only fill the transport jacobian when covariance transport was done + if (state.stepping.covTransport) { + inputResult.transportJacobian = std::get(curvState); + } } return Result::success(std::forward(inputResult)); } else { diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index 14cd9e37304..b77cf2a6ac9 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -1380,7 +1380,7 @@ class CombinatorialKalmanFilter { r.stateBuffer->clear(); auto result = m_propagator.template propagate( - initialParameters, propOptions, std::move(inputResult)); + initialParameters, propOptions, false, std::move(inputResult)); if (!result.ok()) { ACTS_ERROR("Propapation failed: " << result.error() << " " diff --git a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp index 0bc68fd4cb7..d313b614d85 100644 --- a/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp +++ b/Core/include/Acts/TrackFitting/GaussianSumFitter.hpp @@ -289,10 +289,10 @@ struct GaussianSumFitter { sParameters.referenceSurface().getSharedPtr(), sParameters.parameters(), sParameters.covariance()); - return m_propagator.propagate(params, fwdPropOptions, + return m_propagator.propagate(params, fwdPropOptions, false, std::move(inputResult)); } else { - return m_propagator.propagate(sParameters, fwdPropOptions, + return m_propagator.propagate(sParameters, fwdPropOptions, false, std::move(inputResult)); } }(); diff --git a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp index 15c194f55cb..7119319d80d 100644 --- a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp +++ b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp @@ -519,8 +519,8 @@ class Gx2Fitter { r.fittedStates = &trackContainer.trackStateContainer(); // propagate with params and return jacobians and residuals - auto result = m_propagator.template propagate(params, propagatorOptions, - std::move(inputResult)); + auto result = m_propagator.template propagate( + params, propagatorOptions, true, std::move(inputResult)); // TODO Improve Propagator + Actor [allocate before loop], rewrite // makeMeasurements diff --git a/Core/include/Acts/TrackFitting/KalmanFitter.hpp b/Core/include/Acts/TrackFitting/KalmanFitter.hpp index 8a587a24c62..3bdde9b924c 100644 --- a/Core/include/Acts/TrackFitting/KalmanFitter.hpp +++ b/Core/include/Acts/TrackFitting/KalmanFitter.hpp @@ -1093,8 +1093,8 @@ class KalmanFitter { r.fittedStates = &trackContainer.trackStateContainer(); // Run the fitter - auto result = m_propagator.template propagate(sParameters, kalmanOptions, - std::move(inputResult)); + auto result = m_propagator.template propagate( + sParameters, kalmanOptions, false, std::move(inputResult)); if (!result.ok()) { ACTS_ERROR("Propapation failed: " << result.error()); @@ -1232,8 +1232,8 @@ class KalmanFitter { r.fittedStates = &trackContainer.trackStateContainer(); // Run the fitter - auto result = m_propagator.template propagate(sParameters, kalmanOptions, - std::move(inputResult)); + auto result = m_propagator.template propagate( + sParameters, kalmanOptions, false, std::move(inputResult)); if (!result.ok()) { ACTS_ERROR("Propapation failed: " << result.error());