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