13 template <
typename E,
typename R,
typename A>
20 std::vector<std::tuple<double, BoundVector, Covariance>> cmps;
21 cmps.reserve(numberComponents(
state));
22 double accumulatedPathLength = 0.0;
24 for (
auto i = 0ul;
i < numberComponents(
state); ++
i) {
25 auto& cmpState =
state.components[
i].state;
33 cmpState.pars.template segment<3>(
eFreePos0) =
36 cmpState.pars.template segment<3>(
eFreePos0),
37 cmpState.pars.template segment<3>(
eFreeDir0),
false)
42 freeToBoundCorrection);
45 const auto& btp = std::get<BoundTrackParameters>(*bs);
47 state.components[
i].weight, btp.parameters(),
48 btp.covariance().value_or(Acts::BoundSquareMatrix::Zero()));
49 accumulatedPathLength +=
50 std::get<double>(*bs) *
state.components[
i].weight;
55 return MultiStepperError::AllComponentsConversionToBoundFailed;
60 Jacobian::Zero(), accumulatedPathLength};
63 template <
typename E,
typename R,
typename A>
65 bool transportCov)
const
70 std::tuple<double, Vector4, Vector3, ActsScalar, BoundSquareMatrix>>
72 cmps.reserve(numberComponents(
state));
73 double accumulatedPathLength = 0.0;
75 for (
auto i = 0ul;
i < numberComponents(
state); ++
i) {
77 state.components[
i].state, transportCov);
79 cmps.emplace_back(
state.components[
i].weight,
80 cp.fourPosition(
state.geoContext), cp.direction(),
81 (cp.charge() / cp.absoluteMomentum()),
82 cp.covariance().value_or(BoundSquareMatrix::Zero()));
83 accumulatedPathLength +=
state.components[
i].weight * pl;
88 Jacobian::Zero(), accumulatedPathLength};
91 template <
typename E,
typename R,
typename A>
92 template <
typename propagator_state_t,
typename navigator_t>
97 State& stepping = state.stepping;
105 if (stepping.stepCounterAfterFirstComponentOnSurface) {
106 (*stepping.stepCounterAfterFirstComponentOnSurface)++;
110 if (*stepping.stepCounterAfterFirstComponentOnSurface >=
111 m_stepLimitAfterFirstComponentOnSurface) {
113 if (
cmp.status != Status::onSurface) {
114 cmp.status = Status::missed;
118 removeMissedComponents(stepping);
119 reweightComponents(stepping);
122 << m_stepLimitAfterFirstComponentOnSurface
123 <<
" after the first component hit a surface.");
125 "-> remove all components not on a surface, perform no step");
127 stepping.stepCounterAfterFirstComponentOnSurface.reset();
134 bool reweightNecessary =
false;
139 const auto cmpsOnSurface =
141 return cmp.status == Intersection3D::Status::onSurface;
144 if (cmpsOnSurface > 0) {
145 removeMissedComponents(stepping);
146 reweightNecessary =
true;
152 double accumulatedPathLength = 0.0;
153 std::size_t errorSteps = 0;
156 using ThisSinglePropState =
158 decltype(state.options), decltype(state.geoContext)>;
162 auto errorInStep = [&](
auto& component) {
163 if (component.status == Status::onSurface) {
166 results.emplace_back(std::nullopt);
170 ThisSinglePropState single_state(component.state, state.navigation,
171 state.options, state.geoContext);
175 if (results.back()->ok()) {
176 accumulatedPathLength += component.weight * results.back()->value();
180 reweightNecessary =
true;
186 stepping.components.erase(
191 if (reweightNecessary) {
192 reweightComponents(stepping);
196 auto summary = [](
auto& result_vec) {
197 std::stringstream ss;
198 for (
auto& optRes : result_vec) {
200 ss <<
"on surface | ";
201 }
else if (optRes->ok()) {
202 ss << optRes->value() <<
" | ";
204 ss << optRes->error() <<
" | ";
208 str.resize(
str.size() - 3);
213 if (errorSteps == 0) {
220 if (stepping.components.empty()) {
221 return MultiStepperError::AllComponentsSteppingError;
226 return accumulatedPathLength;