Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the particle hypo of KF in case of charge is changed #731

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ 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);
Expand Down
8 changes: 8 additions & 0 deletions core/include/traccc/fitting/kalman_filter/kalman_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "traccc/definitions/qualifiers.hpp"
#include "traccc/edm/track_state.hpp"
#include "traccc/fitting/kalman_filter/gain_matrix_updater.hpp"
#include "traccc/utils/particle.hpp"

// detray include(s).
#include "detray/propagator/base_actor.hpp"
Expand Down Expand Up @@ -105,9 +106,16 @@ struct kalman_actor : detray::actor {

// Run Kalman Gain Updater
const auto sf = navigation.get_surface();

sf.template visit_mask<gain_matrix_updater<algebra_t>>(
trk_state, propagation._stepping._bound_params);

// Change the charge of hypothesized particles when the sign of qop
// is changed (This rarely happens when qop is set with a poor seed
// resolution)
detail::correct_particle_hypothesis(stepping._ptc,
trk_state.filtered());

// Update iterator
actor_state.next();

Expand Down
Loading