File indexing completed on 2026-11-20 09:46:42
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Surfaces/Surface.hpp"
0012
0013 #include <type_traits>
0014
0015 namespace Acts::detail {
0016
0017
0018
0019 template <typename stepping_t, typename navigation_t, typename options_t,
0020 typename geoctx_t>
0021 struct SinglePropState {
0022 stepping_t& stepping;
0023 navigation_t& navigation;
0024 options_t& options;
0025 geoctx_t& geoContext;
0026
0027 SinglePropState(stepping_t& s, navigation_t& n, options_t& o, geoctx_t& g)
0028 : stepping(s), navigation(n), options(o), geoContext(g) {}
0029 };
0030
0031
0032
0033
0034 template <typename component_t, typename loop_stepper_t>
0035 struct LoopComponentProxyBase {
0036 using SingleStepper = typename loop_stepper_t::SingleStepper;
0037 using SingleState = typename loop_stepper_t::SingleState;
0038
0039 static_assert(std::is_same_v<std::remove_const_t<component_t>,
0040 typename loop_stepper_t::State::Component>);
0041
0042 component_t& cmp;
0043
0044 explicit LoopComponentProxyBase(component_t& c) : cmp(c) {}
0045
0046
0047
0048 const auto& state() const { return cmp.state; }
0049 auto status() const { return cmp.status; }
0050 auto weight() const { return cmp.weight; }
0051 auto pathAccumulated() const { return cmp.state.pathAccumulated; }
0052 const auto& pars() const { return cmp.state.pars; }
0053 const auto& derivative() const { return cmp.state.derivative; }
0054 const auto& cov() const { return cmp.state.cov; }
0055 const auto& jacobian() const { return cmp.state.jacobian; }
0056 const auto& jacToGlobal() const { return cmp.state.jacToGlobal; }
0057
0058 template <typename propagator_state_t>
0059 auto singleState(const propagator_state_t& state) const {
0060 using DeducedStepping = decltype(state.stepping.components.front().state);
0061 static_assert(std::is_same_v<SingleState, DeducedStepping>);
0062
0063 return SinglePropState<const SingleState, const decltype(state.navigation),
0064 const decltype(state.options),
0065 const decltype(state.geoContext)>(
0066 cmp.state, state.navigation, state.options, state.geoContext);
0067 }
0068
0069 const SingleStepper& singleStepper(const loop_stepper_t& stepper) const {
0070 return stepper.singleStepper();
0071 }
0072 };
0073
0074
0075
0076
0077
0078 template <typename component_t, typename loop_stepper_t>
0079 struct LoopComponentProxy
0080 : LoopComponentProxyBase<component_t, loop_stepper_t> {
0081 using State = typename loop_stepper_t::State;
0082 using Base = LoopComponentProxyBase<component_t, loop_stepper_t>;
0083
0084 using SingleState = typename loop_stepper_t::SingleState;
0085 using SingleStepper = typename loop_stepper_t::SingleStepper;
0086 using Covariance = typename loop_stepper_t::Covariance;
0087
0088
0089 using Base::cmp;
0090 using Base::cov;
0091 using Base::derivative;
0092 using Base::jacobian;
0093 using Base::jacToGlobal;
0094 using Base::pars;
0095 using Base::pathAccumulated;
0096 using Base::singleState;
0097 using Base::singleStepper;
0098 using Base::state;
0099 using Base::status;
0100 using Base::weight;
0101
0102
0103 const State& all_state;
0104
0105 LoopComponentProxy(typename State::Component& c, const State& s)
0106 : Base(c), all_state(s) {}
0107
0108
0109
0110 auto& state() { return cmp.state; }
0111 auto& status() { return cmp.status; }
0112 auto& weight() { return cmp.weight; }
0113 auto& pathAccumulated() { return cmp.state.pathAccumulated; }
0114 auto& pars() { return cmp.state.pars; }
0115 auto& derivative() { return cmp.state.derivative; }
0116 auto& cov() { return cmp.state.cov; }
0117 auto& jacobian() { return cmp.state.jacobian; }
0118 auto& jacToGlobal() { return cmp.state.jacToGlobal; }
0119
0120 template <typename propagator_state_t>
0121 auto singleState(propagator_state_t& state) {
0122 using DeducedStepping = decltype(state.stepping.components.front().state);
0123 static_assert(std::is_same_v<SingleState, DeducedStepping>);
0124
0125 return SinglePropState<SingleState, decltype(state.navigation),
0126 decltype(state.options), decltype(state.geoContext)>(
0127 cmp.state, state.navigation, state.options, state.geoContext);
0128 }
0129
0130 void update(const FreeVector& freeParams, const BoundVector& boundParams,
0131 const Covariance& covariance, const Surface& surface) {
0132 cmp.state.pars = freeParams;
0133 cmp.state.cov = covariance;
0134 cmp.state.jacToGlobal =
0135 surface.boundToFreeJacobian(all_state.geoContext, boundParams);
0136 }
0137 };
0138
0139 }