40 template <
typename track_state_t>
42 track_state_t trackState,
48 using TrackStateProxy =
50 static_assert(std::is_same_v<track_state_t, TrackStateProxy>,
51 "Given track state type is not a track state proxy");
54 assert(trackState.hasUncalibrated());
56 assert(trackState.hasCalibrated());
58 assert(trackState.hasPredicted());
60 assert(trackState.hasFiltered());
63 const auto predicted = trackState.predicted();
64 const auto predicted_covariance = trackState.predictedCovariance();
66 ACTS_VERBOSE(
"Predicted parameters: " << predicted.transpose());
67 ACTS_VERBOSE(
"Predicted covariance:\n" << predicted_covariance);
71 auto filtered = trackState.filtered();
72 auto filtered_covariance = trackState.filteredCovariance();
74 std::optional<std::error_code> error{std::nullopt};
76 trackState.calibrated(), trackState.calibratedCovariance(),
77 trackState.calibratedSize(),
78 [&](
const auto calibrated,
const auto calibrated_covariance) {
79 constexpr
size_t measdim = decltype(calibrated)::RowsAtCompileTime;
84 ACTS_VERBOSE(
"Calibrated measurement: " << calibrated.transpose());
86 << calibrated_covariance);
89 trackState.projector()
90 .template topLeftCorner<measdim, eBoundSize>();
95 predicted_covariance * H.transpose() *
96 (H * predicted_covariance * H.transpose() + calibrated_covariance)
104 ? KalmanFitterError::ForwardUpdateFailed
105 : KalmanFitterError::BackwardUpdateFailed;
109 filtered = predicted + K * (calibrated - H * predicted);
110 filtered_covariance =
111 (BoundSymMatrix::Identity() - K * H) * predicted_covariance;
112 ACTS_VERBOSE(
"Filtered parameters: " << filtered.transpose());
113 ACTS_VERBOSE(
"Filtered covariance:\n" << filtered_covariance);
123 residual = calibrated - H * filtered;
127 (residual.transpose() *
128 ((cov_t::Identity() - H * K) * calibrated_covariance).inverse() *