Skip to content

Commit

Permalink
feat: Add Propagator::propagateToSurface for FreeVector as start
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Nov 26, 2024
1 parent a0aed8c commit e6446e4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
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());

return propagateToSurface(startBound, target, options);
}

0 comments on commit e6446e4

Please sign in to comment.