Class Acts::StraightLineStepper

class StraightLineStepper

straight line stepper based on Surface intersection

The straight line stepper is a simple navigation stepper to be used to navigate through the tracking geometry. It can be used for simple material mapping, navigation validation

Public Types

using BField = NullBField
using BoundState = std::tuple<BoundTrackParameters, Jacobian, double>
using Covariance = BoundSymMatrix
using CurvilinearState = std::tuple<CurvilinearTrackParameters, Jacobian, double>
using Jacobian = BoundMatrix
using state_type = State

Always use the same propagation state type, independently of the initial track parameter type and of the target surface.

Public Functions

StraightLineStepper() = default
inline double absoluteMomentum(const State &state) const

Absolute momentum accessor.

Parameters

state – [in] The stepping state (thread-local cache)

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.

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 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, this gives back a zero field.

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>
inline State makeState(std::reference_wrapper<const GeometryContext> gctx, std::reference_wrapper<const MagneticFieldContext> mctx, const GenericBoundTrackParameters<charge_t> &par, Direction navDir = Direction::Forward, double ssize = std::numeric_limits<double>::max(), double stolerance = s_onSurfaceTolerance) const
inline Vector3 momentum(const State &state) const

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 &state) const

Overstep limit.

Parameters

state – The stepping state (thread-local cache)

inline Vector3 position(const State &state) const

Global particle position accessor.

Parameters

state – [in] The stepping state (thread-local cache)

inline double qOverP(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 reset State will be on this surface

  • navDir[in] Navigation direction

  • stepSize[in] Step size

inline void setStepSize(State &state, double stepSize, ConstrainedStep::Type stype = ConstrainedStep::actor, bool release = true) const

Set Step size - explicitly 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?

template<typename propagator_state_t, typename navigator_t>
inline Result<double> step(propagator_state_t &state, const navigator_t&) const

Perform a straight line propagation step.

Parameters

state[inout] is the propagation state associated with the track parameters that are being propagated. 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.

Returns

the step size taken

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 - for the moment a dummy method.

Note

no check is done if the position is actually on the surface

Template Parameters

surface_t – the surface type - ignored here

Parameters
  • state[inout] The stepper state

  • 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 - for the moment a dummy method.

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] 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.

It checks the status to the reference surface & updates the step size accordingly

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(), ActsScalar surfaceTolerance = s_onSurfaceTolerance) const

Update surface status.

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[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

  • surfaceTolerance[in] Surface tolerance used for intersection

struct State

State for track parameter propagation.

Public Functions

State() = delete
template<typename charge_t>
inline explicit State(const GeometryContext &gctx, const MagneticFieldContext &mctx, const GenericBoundTrackParameters<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

  • mctx[in] is the context 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.

Covariance cov = Covariance::Zero()
bool covTransport = false

Boolean to indicate if you need covariance transport.

FreeVector derivative = FreeVector::Zero()

The propagation derivative.

std::reference_wrapper<const GeometryContext> geoContext
Jacobian jacobian = Jacobian::Identity()

The full jacobian of the transport entire transport.

BoundToFreeMatrix jacToGlobal = BoundToFreeMatrix::Zero()

Jacobian from local to the global frame.

FreeMatrix jacTransport = FreeMatrix::Identity()

Pure transport jacobian part from runge kutta integration.

Direction navDir

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.
ConstrainedStep stepSize

adaptive step size of the runge-kutta integration

double tolerance = s_onSurfaceTolerance

The tolerance for the stepping.