diff --git a/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp b/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp index f1e68c493..824aaee27 100644 --- a/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp +++ b/core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp @@ -121,6 +121,12 @@ struct gain_matrix_updater { const matrix_type<1, 1> chi2 = matrix_operator().transpose(residual) * matrix_operator().inverse(R) * residual; + // Make sure that the sign of qop does not change (This rarely happens + // when qop is set with a poor seed resolution) + assert(bound_params[e_bound_qoverp] * + getter::element(filtered_vec, e_bound_qoverp, 0u) > + 0.f); + // Set the stepper parameter bound_params.set_vector(filtered_vec); bound_params.set_covariance(filtered_cov); diff --git a/examples/run/cpu/truth_fitting_example.cpp b/examples/run/cpu/truth_fitting_example.cpp index 20c707c37..ab0e9cd69 100644 --- a/examples/run/cpu/truth_fitting_example.cpp +++ b/examples/run/cpu/truth_fitting_example.cpp @@ -111,7 +111,7 @@ int main(int argc, char* argv[]) { 0.03f * detray::unit::mm, 0.017f, 0.017f, - 0.01f / detray::unit::GeV, + 0.001f / detray::unit::GeV, 1.f * detray::unit::ns}; // Fitting algorithm object diff --git a/examples/run/cuda/truth_fitting_example_cuda.cpp b/examples/run/cuda/truth_fitting_example_cuda.cpp index 7d5f485e7..672a66306 100644 --- a/examples/run/cuda/truth_fitting_example_cuda.cpp +++ b/examples/run/cuda/truth_fitting_example_cuda.cpp @@ -153,7 +153,7 @@ int main(int argc, char* argv[]) { 0.03f * detray::unit::mm, 0.017f, 0.017f, - 0.01f / detray::unit::GeV, + 0.001f / detray::unit::GeV, 1.f * detray::unit::ns}; // Fitting algorithm object diff --git a/tests/common/tests/kalman_fitting_toy_detector_test.hpp b/tests/common/tests/kalman_fitting_toy_detector_test.hpp index 2bcfb91a8..365dfc982 100644 --- a/tests/common/tests/kalman_fitting_toy_detector_test.hpp +++ b/tests/common/tests/kalman_fitting_toy_detector_test.hpp @@ -49,7 +49,7 @@ class KalmanFittingToyDetectorTests : public KalmanFittingTests { 0.01f * detray::unit::mm, 0.001f, 0.001f, - 0.01f / detray::unit::GeV, + 0.001f / detray::unit::GeV, 0.01f * detray::unit::ns}; protected: