Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Propagator::propagateToSurface with FreeVector as starting parameters #3909

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions Core/include/Acts/Propagator/Propagator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,8 @@
#include "Acts/Utilities/detail/ReferenceWrapperAnyCompat.hpp"
// clang-format on

#include "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/PdgParticle.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/EventData/TrackParameters.hpp"
#include "Acts/EventData/TrackParametersConcept.hpp"
#include "Acts/Geometry/GeometryContext.hpp"
#include "Acts/MagneticField/MagneticFieldContext.hpp"
#include "Acts/Propagator/ActorList.hpp"
#include "Acts/Propagator/PropagatorOptions.hpp"
#include "Acts/Propagator/PropagatorResult.hpp"
Expand All @@ -32,8 +27,6 @@
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/Result.hpp"

#include <optional>

namespace Acts {

/// Common simplified base interface for propagators.
Expand All @@ -56,6 +49,17 @@ class BasePropagator {
const BoundTrackParameters& start, const Surface& target,
const Options& options) const = 0;

/// Method to propagate start free vector to a target surface.
/// @note this will not do covariance transport and the particle
/// hypothesis in the result is meaningless
/// @param start The start free vector.
/// @param target The target surface.
/// @param options The propagation options.
/// @return The end bound track parameters.
virtual Result<BoundTrackParameters> propagateToSurface(
const FreeVector& start, const Surface& target,
const Options& options) const = 0;

virtual ~BasePropagator() = default;
};

Expand All @@ -68,6 +72,10 @@ class BasePropagatorHelper : public BasePropagator {
Result<BoundTrackParameters> propagateToSurface(
const BoundTrackParameters& start, const Surface& target,
const Options& options) const override;

Result<BoundTrackParameters> propagateToSurface(
const FreeVector& start, const Surface& target,
const Options& options) const override;
};
} // namespace detail

Expand Down
17 changes: 17 additions & 0 deletions Core/include/Acts/Propagator/Propagator.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#include "Acts/Definitions/TrackParametrization.hpp"
#include "Acts/EventData/TrackParametersConcept.hpp"
#include "Acts/Propagator/ActorList.hpp"
#include "Acts/Propagator/ConstrainedStep.hpp"
#include "Acts/Propagator/PropagatorError.hpp"
#include "Acts/Propagator/StandardAborters.hpp"
#include "Acts/Propagator/detail/LoopProtection.hpp"
#include "Acts/Surfaces/CurvilinearSurface.hpp"

#include <concepts>

Expand Down Expand Up @@ -383,3 +385,18 @@ Acts::detail::BasePropagatorHelper<derived_t>::propagateToSurface(
return res.error();
}
}

template <typename derived_t>
Acts::Result<Acts::BoundTrackParameters>
Acts::detail::BasePropagatorHelper<derived_t>::propagateToSurface(
const FreeVector& start, const Surface& target,
const Options& options) const {
// Convert free parameters to curvilinear parameters. Randomly picking pion
// hypothesis which should not make a difference as we extrapolate without
// interactions.
CurvilinearTrackParameters startBound(
start.segment<4>(Acts::eFreePos0), start.segment<3>(Acts::eFreeDir0),
start[Acts::eFreeQOverP], std::nullopt, ParticleHypothesis::pion());

andiwand marked this conversation as resolved.
Show resolved Hide resolved
return propagateToSurface(startBound, target, options);
}
Loading