Skip to content

Commit 3f1dc9e

Browse files
authored
Merge pull request #731 from beomki-yeo/kf-particle-hypo
Change the particle hypo of KF in case of charge is changed
2 parents 35706ff + c2f3299 commit 3f1dc9e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

core/include/traccc/fitting/kalman_filter/gain_matrix_updater.hpp

-6
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ struct gain_matrix_updater {
121121
const matrix_type<1, 1> chi2 = matrix_operator().transpose(residual) *
122122
matrix_operator().inverse(R) * residual;
123123

124-
// Make sure that the sign of qop does not change (This rarely happens
125-
// when qop is set with a poor seed resolution)
126-
assert(bound_params[e_bound_qoverp] *
127-
getter::element(filtered_vec, e_bound_qoverp, 0u) >
128-
0.f);
129-
130124
// Set the stepper parameter
131125
bound_params.set_vector(filtered_vec);
132126
bound_params.set_covariance(filtered_cov);

core/include/traccc/fitting/kalman_filter/kalman_actor.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "traccc/definitions/qualifiers.hpp"
1212
#include "traccc/edm/track_state.hpp"
1313
#include "traccc/fitting/kalman_filter/gain_matrix_updater.hpp"
14+
#include "traccc/utils/particle.hpp"
1415

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

106107
// Run Kalman Gain Updater
107108
const auto sf = navigation.get_surface();
109+
108110
sf.template visit_mask<gain_matrix_updater<algebra_t>>(
109111
trk_state, propagation._stepping._bound_params);
110112

113+
// Change the charge of hypothesized particles when the sign of qop
114+
// is changed (This rarely happens when qop is set with a poor seed
115+
// resolution)
116+
detail::correct_particle_hypothesis(stepping._ptc,
117+
trk_state.filtered());
118+
111119
// Update iterator
112120
actor_state.next();
113121

0 commit comments

Comments
 (0)