11 #include <type_traits>
21 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
24 : m_traj(&trajectory), m_istate(istate) {}
26 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
31 idx =
data().ismoothed;
32 }
else if (hasFiltered()) {
33 idx =
data().ifiltered;
35 idx =
data().ipredicted;
38 return Parameters(m_traj->m_params.data.col(idx).data());
41 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
46 idx =
data().ismoothed;
47 }
else if (hasFiltered()) {
48 idx =
data().ifiltered;
50 idx =
data().ipredicted;
52 return Covariance(m_traj->m_cov.data.col(idx).data());
55 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
62 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
69 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
72 return {
gctx, predictedCovariance(), predicted(),
73 m_traj->m_referenceSurfaces[
data().irefsurface]};
76 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
83 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
90 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
93 return {
gctx, filteredCovariance(), filtered(),
94 m_traj->m_referenceSurfaces[
data().irefsurface]};
97 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
104 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
111 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
114 return {
gctx, smoothedCovariance(), smoothed(),
115 m_traj->m_referenceSurfaces[
data().irefsurface]};
118 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
125 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
129 return bitsetToMatrix<Projector>(m_traj->m_projectors[
data().iprojector]);
132 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
136 return m_traj->m_sourceLinks[
data().iuncalibrated];
139 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
146 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
150 return m_traj->m_sourceLinks[
data().icalibratedsourcelink];
153 template <
typename SL,
size_t N,
size_t M,
bool ReadOnly>
158 m_traj->m_measCov.col(
data().icalibrated).data());
163 template <
typename SL>
164 template <
typename parameters_t>
171 m_index.emplace_back();
173 size_t index = m_index.size() - 1;
181 if (iprevious != SIZE_MAX) {
182 p.
iprevious =
static_cast<uint16_t
>(iprevious);
187 m_params.addCol() = predicted.parameters();
188 CovMap(m_cov.addCol().data()) = *predicted.covariance();
194 m_params.addCol() = filtered.parameters();
195 CovMap(m_cov.addCol().data()) = *filtered.covariance();
201 m_params.addCol() = smoothed.parameters();
202 CovMap(m_cov.addCol().data()) = *smoothed.covariance();
230 template <
typename SL>
233 namespace PropMask = TrackStatePropMask;
235 m_index.emplace_back();
237 size_t index = m_index.size() - 1;
239 if (iprevious != SIZE_MAX) {
240 p.
iprevious =
static_cast<uint16_t
>(iprevious);
244 m_referenceSurfaces.emplace_back(
nullptr);
271 m_sourceLinks.emplace_back();
280 m_sourceLinks.emplace_back();
283 m_projectors.emplace_back();
290 template <
typename SL>
291 template <
typename F>
293 static_assert(detail_lt::VisitorConcept<F, ConstTrackStateProxy>,
294 "Callable needs to satisfy VisitorConcept");
297 if constexpr (std::is_same_v<std::invoke_result_t<F, ConstTrackStateProxy>,
299 bool proceed = callable(getTrackState(iendpoint));
307 callable(getTrackState(iendpoint));
313 iendpoint = m_index[iendpoint].iprevious;
317 template <
typename SL>
318 template <
typename F>
320 static_assert(detail_lt::VisitorConcept<F, TrackStateProxy>,
321 "Callable needs to satisfy VisitorConcept");
324 if constexpr (std::is_same_v<std::invoke_result_t<F, TrackStateProxy>,
326 bool proceed = callable(getTrackState(iendpoint));
334 callable(getTrackState(iendpoint));
340 iendpoint = m_index[iendpoint].iprevious;