21 #include <system_error>
38 template <
typename traj_t>
44 using TrackStateProxy =
typename traj_t::TrackStateProxy;
54 filtered.connect([](
const void*,
void* ts) {
55 return static_cast<TrackStateProxy*
>(ts)->filtered();
57 filteredCovariance.connect([](
const void*,
void* ts) {
58 return static_cast<TrackStateProxy*
>(ts)->filteredCovariance();
61 smoothed.connect([](
const void*,
void* ts) {
62 return static_cast<TrackStateProxy*
>(ts)->smoothed();
64 smoothedCovariance.connect([](
const void*,
void* ts) {
65 return static_cast<TrackStateProxy*
>(ts)->smoothedCovariance();
68 predicted.connect([](
const void*,
void* ts) {
69 return static_cast<TrackStateProxy*
>(ts)->predicted();
71 predictedCovariance.connect([](
const void*,
void* ts) {
72 return static_cast<TrackStateProxy*
>(ts)->predictedCovariance();
75 jacobian.connect([](
const void*,
void* ts) {
76 return static_cast<TrackStateProxy*
>(ts)->jacobian();
79 ACTS_VERBOSE(
"Invoked GainMatrixSmoother on entry index: " << entryIndex);
83 auto prev_ts = trajectory.getTrackState(entryIndex);
85 prev_ts.smoothed() = prev_ts.filtered();
86 prev_ts.smoothedCovariance() = prev_ts.filteredCovariance();
89 if (!prev_ts.hasPrevious()) {
90 ACTS_VERBOSE(
"Only one track state given, smoothing terminates early");
94 ACTS_VERBOSE(
"Start smoothing from previous track state at index: "
95 << prev_ts.previous());
98 std::error_code
error;
99 trajectory.applyBackwards(prev_ts.previous(), [&,
this](
auto ts) {
103 assert(ts.hasPredicted());
106 assert(prev_ts.hasSmoothed());
107 assert(prev_ts.hasPredicted());
108 assert(prev_ts.hasJacobian());
111 ACTS_VERBOSE(
"Filtered covariance:\n" << ts.filteredCovariance());
114 if (
auto res =
calculate(&ts, &prev_ts, filtered, filteredCovariance,
115 smoothed, predicted, predictedCovariance,
116 smoothedCovariance, jacobian,
logger);
131 false>::Parameters(
void*)>;