File indexing completed on 2025-01-18 09:10:48
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Utilities/AlgebraHelpers.hpp"
0010
0011 #include <bitset>
0012 #include <cstdint>
0013 #include <type_traits>
0014 #include <vector>
0015
0016 #include <Eigen/Core>
0017
0018 namespace Acts {
0019
0020 template <typename D>
0021 template <typename F>
0022 void MultiTrajectory<D>::visitBackwards(IndexType iendpoint, F&& callable) const
0023 requires detail_lt::VisitorConcept<F, ConstTrackStateProxy>
0024 {
0025 if (iendpoint == MultiTrajectoryTraits::kInvalid) {
0026 throw std::runtime_error(
0027 "Cannot visit backwards with kInvalid as endpoint");
0028 }
0029
0030 while (true) {
0031 auto ts = getTrackState(iendpoint);
0032 if constexpr (std::is_same_v<std::invoke_result_t<F, ConstTrackStateProxy>,
0033 bool>) {
0034 bool proceed = callable(ts);
0035
0036
0037 if (!proceed || !ts.hasPrevious()) {
0038 break;
0039 }
0040 } else {
0041 callable(ts);
0042
0043 if (!ts.hasPrevious()) {
0044 break;
0045 }
0046 }
0047 iendpoint = ts.previous();
0048 }
0049 }
0050
0051 }