File EigenStepper.hppΒΆ
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
-
template<typename extensionlist_t = StepperExtensionList<DefaultExtension>, typename auctioneer_t = detail::VoidAuctioneer>
class EigenStepper - #include <Acts/Propagator/EigenStepper.hpp>
Runge-Kutta-Nystroem stepper based on Eigen implementation for the following ODE:
r = (x,y,z) β¦ global position T = (Ax,Ay,Az) β¦ momentum direction (normalized)
dr/ds = T dT/ds = q/p * (T x B)
with s being the arc length of the track, q the charge of the particle, p the momentum magnitude and B the magnetic field
Subclassed by Acts::MultiEigenStepperLoop< extensionlist_t, component_reducer_t, auctioneer_t >
Public Types
-
using BoundState = std::tuple<BoundTrackParameters, Jacobian, double>
-
using Covariance = BoundSymMatrix
-
using CurvilinearState = std::tuple<CurvilinearTrackParameters, Jacobian, double>
-
using Jacobian = BoundMatrix
Jacobian, Covariance and State defintions.
Public Functions
Constructor requires knowledge of the detectorβs magnetic field.
-
Result<BoundState> boundState(State &state, const Surface &surface, bool transportCov = true, const FreeToBoundCorrection &freeToBoundCorrection = FreeToBoundCorrection(false)) const
Create and return the bound state at the current position.
This transports (if necessary) the covariance to the surface and creates a bound state. It does not check if the transported state is at the surface, this needs to be guaranteed by the propagator
- Parameters
state β [in] State that will be presented as
BoundState
surface β [in] The surface to which we bind the state
transportCov β [in] Flag steering covariance transport
freeToBoundCorrection β [in] Correction for non-linearity effect during transform from free to bound
- Returns
A bound state:
the parameters at the surface
the stepwise jacobian towards it (from last bound)
and the path length (from start - for ordering)
-
inline double charge(const State &state) const
Charge access.
- Parameters
state β [in] The stepping state (thread-local cache)
-
CurvilinearState curvilinearState(State &state, bool transportCov = true) const
Create and return a curvilinear state at the current position.
This transports (if necessary) the covariance to the current position and creates a curvilinear state.
- Parameters
state β [in] State that will be presented as
CurvilinearState
transportCov β [in] Flag steering covariance transport
- Returns
A curvilinear state:
the curvilinear parameters at given position
the stepweise jacobian towards it (from last bound)
and the path length (from start - for ordering)
-
inline Vector3 direction(const State &state) const
Momentum direction accessor.
- Parameters
state β [in] The stepping state (thread-local cache)
-
inline Result<Vector3> getField(State &state, const Vector3 &pos) const
Get the field for the stepping, it checks first if the access is still within the Cell, and updates the cell if necessary.
- Parameters
state β [inout] is the propagation state associated with the track the magnetic field cell is used (and potentially updated)
pos β [in] is the field position
-
inline double getStepSize(const State &state, ConstrainedStep::Type stype) const
Get the step size.
- Parameters
state β [in] The stepping state (thread-local cache)
stype β [in] The step size type to be returned
-
template<typename charge_t>
State makeState(std::reference_wrapper<const GeometryContext> gctx, std::reference_wrapper<const MagneticFieldContext> mctx, const SingleBoundTrackParameters<charge_t> &par, Direction navDir = Direction::Forward, double ssize = std::numeric_limits<double>::max(), double stolerance = s_onSurfaceTolerance) const
-
inline double momentum(const State &state) const
Absolute momentum accessor.
- Parameters
state β [in] The stepping state (thread-local cache)
-
inline std::string outputStepSize(const State &state) const
Output the Step Size - single component.
- Parameters
state β [in,out] The stepping state (thread-local cache)
-
inline double overstepLimit(const State&) const
Overstep limit.
-
inline Vector3 position(const State &state) const
Global particle position accessor.
- Parameters
state β [in] The stepping state (thread-local cache)
-
inline double qop(const State &state) const
QoP direction accessor.
- Parameters
state β [in] The stepping state (thread-local cache)
-
inline void releaseStepSize(State &state) const
Release the Step size.
- Parameters
state β [in,out] The stepping state (thread-local cache)
-
void resetState(State &state, const BoundVector &boundParams, const BoundSymMatrix &cov, const Surface &surface, const Direction navDir = Direction::Forward, const double stepSize = std::numeric_limits<double>::max()) const
Resets the state.
- Parameters
state β [inout] State of the stepper
boundParams β [in] Parameters in bound parametrisation
cov β [in] Covariance matrix
surface β [in] The reference surface of the bound parameters
navDir β [in] Navigation direction
stepSize β [in] Step size
-
void setIdentityJacobian(State &state) const
Method that reset the Jacobian to the Identity for when no bound state are available.
- Parameters
state β [inout] State of the stepper
-
inline void setStepSize(State &state, double stepSize, ConstrainedStep::Type stype = ConstrainedStep::actor, bool release = true) const
Set Step size - explicitely with a double.
- Parameters
state β [in,out] The stepping state (thread-local cache)
stepSize β [in] The step size value
stype β [in] The step size type to be set
release β [in] Do we release the step size?
Perform a Runge-Kutta track parameter propagation step.
Note
The state contains the desired step size. It can be negative during backwards track propagation, and since weβre using an adaptive algorithm, it can be modified by the stepper class during propagation.
- Parameters
state β [inout] the propagation state
navigator β [in] the navigator of the propagation
-
inline double time(const State &state) const
Time access.
- Parameters
state β [in] The stepping state (thread-local cache)
-
void transportCovarianceToBound(State &state, const Surface &surface, const FreeToBoundCorrection &freeToBoundCorrection = FreeToBoundCorrection(false)) const
Method for on-demand transport of the covariance to a new curvilinear frame at current position, or direction of the state.
Note
no check is done if the position is actually on the surface
- Template Parameters
surface_t β the Surface type
- Parameters
state β [inout] State of the stepper
surface β [in] is the surface to which the covariance is forwarded to
freeToBoundCorrection β [in] Correction for non-linearity effect during transform from free to bound
-
void transportCovarianceToCurvilinear(State &state) const
Method for on-demand transport of the covariance to a new curvilinear frame at current position, or direction of the state.
- Parameters
state β [inout] State of the stepper
-
void update(State &state, const FreeVector &freeParams, const BoundVector &boundParams, const Covariance &covariance, const Surface &surface) const
Method to update a stepper state to the some parameters.
- Parameters
state β [inout] State object that will be updated
freeParams β [in] Free parameters that will be written into
state
boundParams β [in] Corresponding bound parameters used to update jacToGlobal in
state
covariance β [in] The covariance that will be written into
state
surface β [in] The surface used to update the jacToGlobal
-
void update(State &state, const Vector3 &uposition, const Vector3 &udirection, double qop, double time) const
Method to update the stepper state.
- Parameters
state β [inout] State object that will be updated
uposition β [in] the updated position
udirection β [in] the updated direction
qop β [in] the updated qop value
time β [in] the updated time value
-
template<typename object_intersection_t>
inline void updateStepSize(State &state, const object_intersection_t &oIntersection, bool release = true) const Update step size.
This method intersects the provided surface and update the navigation step estimation accordingly (hence it changes the state). It also returns the status of the intersection to trigger onSurface in case the surface is reached.
- Parameters
state β [in,out] The stepping state (thread-local cache)
oIntersection β [in] The ObjectIntersection to layer, boundary, etc
release β [in] boolean to trigger step size release
-
inline Intersection3D::Status updateSurfaceStatus(State &state, const Surface &surface, const BoundaryCheck &bcheck, const Logger &logger = getDummyLogger()) const
Update surface status.
It checks the status to the reference surface & updates the step size accordingly
- Parameters
state β [inout] The stepping state (thread-local cache)
surface β [in] The surface provided
bcheck β [in] The boundary check for this status update
logger β [in] A
Logger
instance
Protected Attributes
-
std::shared_ptr<const MagneticFieldProvider> m_bFieldΒΆ
Magnetic field inside of the detector.
-
double m_overstepLimitΒΆ
Overstep limit.
-
struct State
- #include <Acts/Propagator/EigenStepper.hpp>
State for track parameter propagation.
It contains the stepping information and is provided thread local by the propagator
Public Functions
-
State() = delete
-
template<typename charge_t>
inline explicit State(const GeometryContext &gctx, MagneticFieldProvider::Cache fieldCacheIn, const SingleBoundTrackParameters<charge_t> &par, Direction ndir = Direction::Forward, double ssize = std::numeric_limits<double>::max(), double stolerance = s_onSurfaceTolerance) Constructor from the initial bound track parameters.
Note
the covariance matrix is copied when needed
- Template Parameters
charge_t β Type of the bound parameter charge
- Parameters
gctx β [in] is the context object for the geometry
fieldCacheIn β [in] is the cache object for the magnetic field
par β [in] The track parameters at start
ndir β [in] The navigation direction w.r.t momentum
ssize β [in] is the maximum step size
stolerance β [in] is the stepping tolerance
Public Members
-
double absCharge = UnitConstants::e
The absolute charge as the free vector can be 1/p or q/p.
-
auctioneer_t auctioneer
Auctioneer for choosing the extension.
-
Vector3 B_first
Magnetic field evaulations.
-
Vector3 B_last
-
Vector3 B_middle
-
Covariance cov = Covariance::Zero()
-
bool covTransport = false
Covariance matrix (and indicator) associated with the initial error on track parameters.
-
FreeVector derivative = FreeVector::Zero()
The propagation derivative.
-
extensionlist_t extension
List of algorithmic extensions.
-
MagneticFieldProvider::Cache fieldCache
This caches the current magnetic field cell and stays (and interpolates) within it as long as this is valid.
See step() code for details.
-
std::reference_wrapper<const GeometryContext> geoContext
The geometry context.
-
BoundToFreeMatrix jacToGlobal = BoundToFreeMatrix::Zero()
Jacobian from local to the global frame.
-
FreeMatrix jacTransport = FreeMatrix::Identity()
Pure transport jacobian part from runge kutta integration.
-
Vector3 k1
k_i of the RKN4 algorithm
-
Vector3 k2
-
Vector3 k3
-
Vector3 k4
-
std::array<double, 4> kQoP = {}
k_i elements of the momenta
Navigation direction, this is needed for searching.
-
FreeVector pars = FreeVector::Zero()
Internal free vector parameters.
-
double pathAccumulated = 0.
Accummulated path length state.
-
double previousStepSize = 0.
Last performed step (for overstep limit calculation)
-
struct Acts::EigenStepper::State::[anonymous] stepData
Storage of magnetic field and the sub steps during a RKN4 step.
-
ConstrainedStep stepSize
Adaptive step size of the runge-kutta integration.
-
double tolerance = s_onSurfaceTolerance
The tolerance for the stepping.
-
State() = delete
-
using BoundState = std::tuple<BoundTrackParameters, Jacobian, double>
-
template<typename extensionlist_t = StepperExtensionList<DefaultExtension>, typename auctioneer_t = detail::VoidAuctioneer>