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