30 template <
typename parameters_t>
39 std::shared_ptr<const Logger>
logger = std::shared_ptr<const Logger>(
54 template <
typename track_state_t>
61 using TrackStateProxy =
63 static_assert(std::is_same_v<track_state_t, TrackStateProxy>,
64 "Given track state type is not a track state proxy");
66 using CovMatrix_t =
typename parameters_t::CovMatrix_t;
67 using ParVector_t =
typename parameters_t::ParVector_t;
70 assert(trackState.hasUncalibrated());
72 assert(trackState.hasCalibrated());
74 assert(trackState.hasPredicted());
76 assert(trackState.hasFiltered());
79 const auto predicted = trackState.predicted();
80 const auto predicted_covariance = trackState.predictedCovariance();
82 ACTS_VERBOSE(
"Predicted parameters: " << predicted.transpose());
83 ACTS_VERBOSE(
"Predicted covariance:\n" << predicted_covariance);
87 auto filtered = trackState.filtered();
88 auto filtered_covariance = trackState.filteredCovariance();
90 std::optional<std::error_code>
error{std::nullopt};
92 trackState.calibrated(), trackState.calibratedCovariance(),
93 trackState.calibratedSize(),
94 [&](
const auto calibrated,
const auto calibrated_covariance) {
95 constexpr
size_t measdim = decltype(calibrated)::RowsAtCompileTime;
100 ACTS_VERBOSE(
"Calibrated measurement: " << calibrated.transpose());
102 << calibrated_covariance);
105 trackState.projector()
106 .template topLeftCorner<measdim, eBoundParametersSize>();
111 predicted_covariance * H.transpose() *
112 (H * predicted_covariance * H.transpose() + calibrated_covariance)
120 ? KalmanFitterError::ForwardUpdateFailed
121 : KalmanFitterError::BackwardUpdateFailed;
125 filtered = predicted + K * (calibrated - H * predicted);
126 filtered_covariance =
130 predicted_covariance;
131 ACTS_VERBOSE(
"Filtered parameters: " << filtered.transpose());
132 ACTS_VERBOSE(
"Filtered covariance:\n" << filtered_covariance);
135 par_t residual(trackState.calibratedSize());
136 residual = (calibrated - H * filtered);
140 (residual.transpose() *
141 ((cov_t::Identity() - H * K) * calibrated_covariance).inverse() *