ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v > Class Template Referencefinal

Runge-Kutta-Nystrom 4th order stepper implementation. More...

#include <detray/propagator/rk_stepper.hpp>

Inheritance diagram for detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >:
[legend]
Collaboration diagram for detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >:
[legend]

Classes

struct  intermediate_state
 Intermediate values evaluated at the RK integration stages. More...
struct  state
 Per-track integration state maintained by the stepper. More...

Public Types

using algebra_type = algebra_t
 Algebra backend used by this stepper.
using bound_track_parameters_type
 Bound track parameter type accepted by the stepper.
using free_track_parameters_type
 Free track parameter type advanced by the stepper.
using magnetic_field_type = magnetic_field_t
 Magnetic field representation used by the stepper.
template<std::size_t ROWS, std::size_t COLS>
using matrix_type = dmatrix<algebra_t, ROWS, COLS>
 Matrix type with the requested dimensions.
using point3_type = dpoint3D<algebra_t>
 Three-dimensional point type.
using scalar_type = dscalar<algebra_t>
 Scalar type associated with the algebra backend.
using transform3_type = dtransform3D<algebra_t>
 Three-dimensional transform type.
using transport_jacobian_type
 Transport Jacobian representation selected by the flags.
using vector3_type = dvector3D<algebra_t>
 Three-dimensional vector type.

Public Member Functions

void advance_jacobian (detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state &stepping, const stepping::config &cfg, const intermediate_state &sd, const material< scalar_type > *vol_mat_ptr) const
 Update the jacobian transport from free propagation.
void advance_track (detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state &stepping, const intermediate_state &sd, const material< scalar_type > *vol_mat_ptr) const
 Update the track state by Runge-Kutta-Nystrom integration.
detray::pair< scalar_type, scalar_type > evaluate_dqopds (detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state &stepping, const std::size_t i, const scalar_type h, const scalar_type dqopds_prev, const material< scalar_type > *vol_mat_ptr, const detray::stepping::config &cfg) const
 evaluate dqopds for a given step size and material
detray::pair< vector3_type, vector3_type > evaluate_dtds (detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state &stepping, const vector3_type &b_field, const std::size_t i, const scalar_type h, const vector3_type &dtds_prev, const scalar_type qop) const
 Evaluate dtds for Runge-Kutta stepping.
matrix_type< 3, 3 > evaluate_field_gradient (detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state &stepping, const point3_type &pos) const
 Estimate the magnetic-field spatial gradient by centered differences.
bool step (const scalar_type dist_to_next, state &stepping, const stepping::config &cfg, bool do_reset, const material< scalar_type > *vol_mat_ptr=nullptr) const
 Take a step, using an adaptive Runge-Kutta algorithm.

Static Public Attributes

static constexpr bool uses_gradient
 True when field-gradient terms are available for transport.

Detailed Description

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
class detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >

Runge-Kutta-Nystrom 4th order stepper implementation.

Template Parameters
magnetic_field_tthe type of magnetic field
algebra_talgebra backend used for track calculations
constraint_tconstraints applied to the step size
policy_tpolicy used to update navigation trust
inspector_toptional stepping inspector
flags_vbitmask of enabled stepper capabilities

Member Typedef Documentation

◆ bound_track_parameters_type

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
using detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::bound_track_parameters_type
Initial value:
bound_track_parameters< algebra_t > bound_track_parameters_type
Definition base_stepper.hpp:57

Bound track parameter type accepted by the stepper.

◆ free_track_parameters_type

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
using detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::free_track_parameters_type
Initial value:
free_track_parameters< algebra_t > free_track_parameters_type
Definition base_stepper.hpp:55

Free track parameter type advanced by the stepper.

◆ transport_jacobian_type

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
using detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::transport_jacobian_type
Initial value:
std::conditional_t<
detail::transport_jacobian_matrix_with_gradient<algebra_type>,
detail::transport_jacobian_matrix_without_gradient<algebra_type>>
static constexpr bool uses_gradient
True when field-gradient terms are available for transport.
Definition rk_stepper.hpp:57

Transport Jacobian representation selected by the flags.

Member Function Documentation

◆ advance_jacobian()

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
void detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::advance_jacobian ( detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state & stepping,
const stepping::config & cfg,
const intermediate_state & sd,
const material< scalar_type > * vol_mat_ptr ) const

Update the jacobian transport from free propagation.

Parameters
steppingState whose Jacobian is updated.
cfgStepping configuration controlling gradient terms.
sdEvaluated RK stage data.
vol_mat_ptrMaterial in the current volume, or null in vacuum.

◆ advance_track()

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
void detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::advance_track ( detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state & stepping,
const intermediate_state & sd,
const material< scalar_type > * vol_mat_ptr ) const

Update the track state by Runge-Kutta-Nystrom integration.

Parameters
steppingState to update.
sdEvaluated RK stage data.
vol_mat_ptrMaterial in the current volume, or null in vacuum.

◆ evaluate_dqopds()

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
detray::pair< scalar_type, scalar_type > detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::evaluate_dqopds ( detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state & stepping,
const std::size_t i,
const scalar_type h,
const scalar_type dqopds_prev,
const material< scalar_type > * vol_mat_ptr,
const detray::stepping::config & cfg ) const

evaluate dqopds for a given step size and material

Parameters
steppingState being integrated.
iRK stage index.
hStage step offset.
dqopds_prevDerivative from the preceding stage.
vol_mat_ptrMaterial in the current volume, or null in vacuum.
cfgStepping configuration.
Returns
Derivative and charge-over-momentum value for this stage.

◆ evaluate_dtds()

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
detray::pair< vector3_type, vector3_type > detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::evaluate_dtds ( detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state & stepping,
const vector3_type & b_field,
const std::size_t i,
const scalar_type h,
const vector3_type & dtds_prev,
const scalar_type qop ) const

Evaluate dtds for Runge-Kutta stepping.

Parameters
steppingState being integrated.
b_fieldMagnetic field at this stage.
iRK stage index.
hStage step offset.
dtds_prevDirection derivative from the preceding stage.
qopCharge-over-momentum at this stage.
Returns
Direction derivative and tangential direction.

◆ evaluate_field_gradient()

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
matrix_type< 3, 3 > detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::evaluate_field_gradient ( detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::state & stepping,
const point3_type & pos ) const

Estimate the magnetic-field spatial gradient by centered differences.

Parameters
steppingState providing the magnetic field.
posPosition where the gradient is evaluated.
Returns
Matrix whose columns are field derivatives by coordinate.

◆ step()

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
bool detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::step ( const scalar_type dist_to_next,
state & stepping,
const stepping::config & cfg,
bool do_reset,
const material< scalar_type > * vol_mat_ptr = nullptr ) const

Take a step, using an adaptive Runge-Kutta algorithm.

Parameters
dist_to_nextThe straight line distance to the next surface
steppingThe state object of a stepper
cfgThe stepping configuration
do_resetwhether to reset the RKN step size to "dist to next"
vol_mat_ptrMaterial in the current volume, or null in vacuum.
Returns
returning the heartbeat, indicating if the stepping is alive

Member Data Documentation

◆ uses_gradient

template<typename magnetic_field_t, concepts::algebra algebra_t, typename constraint_t = unconstrained_step<dscalar<algebra_t>>, typename policy_t = stepper_rk_policy<dscalar<algebra_t>>, typename inspector_t = stepping::void_inspector, std::uint32_t flags_v = (static_cast<std::uint32_t>( rk_stepper_flags::e_allow_covariance_transport) | static_cast<std::uint32_t>( rk_stepper_flags::e_allow_field_gradient))>
bool detray::rk_stepper< magnetic_field_t, algebra_t, constraint_t, policy_t, inspector_t, flags_v >::uses_gradient
staticconstexpr
Initial value:
= static_cast<bool>(
flags_v &
static_cast<std::uint32_t>(rk_stepper_flags::e_allow_field_gradient))
@ e_allow_field_gradient
Allow use of magnetic-field gradients in Jacobian transport.
Definition rk_stepper.hpp:30

True when field-gradient terms are available for transport.