Skip to content

Commit

Permalink
fix: Fix CKF finalization (#2299)
Browse files Browse the repository at this point in the history
Apparently our CKF was not able to smooth multiple tracks for a single
seed in some cases. The problem was that we expected the CKF actor to be
called a second time after the first smoothing was done but there is a
Stepper step in between which could kick you out of the detector because
the step length is basically unconstrained.

fixes
- #1484

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
andiwand and kodiakhq[bot] committed Jul 13, 2023
1 parent d37616b commit 4409f3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,12 @@ class CombinatorialKalmanFilter {
/// @param stepper is the stepper in use
/// @param navigator is the navigator in use
/// @param result is the mutable result state object
/// @param logger the logger object to be used
template <typename propagator_state_t, typename stepper_t,
typename navigator_t>
void operator()(propagator_state_t& state, const stepper_t& stepper,
const navigator_t& navigator, result_type& result,
const Logger& /*logger*/) const {
const Logger& logger) const {
assert(result.fittedStates && "No MultiTrajectory set");

if (result.finished) {
Expand Down Expand Up @@ -521,16 +522,15 @@ class CombinatorialKalmanFilter {
// -> set the smoothed status to false
// -> update the index of track to be smoothed
if (result.iSmoothed < result.lastMeasurementIndices.size() - 1) {
navigator.targetReached(state.navigation, false);
result.smoothed = false;
result.iSmoothed++;
// Reverse navigation direction to start targeting for the rest
// tracks
state.stepping.navDir = state.stepping.navDir.invert();
// To avoid meaningless navigation target call
state.stepping.stepSize =
ConstrainedStep(state.stepping.navDir *
std::abs(state.options.maxStepSize));

// TODO this is kinda silly but I dont see a better solution
// with the current CKF control flow
operator()(state, stepper, navigator, result, logger);
} else {
ACTS_VERBOSE("Finish Kalman filtering and smoothing");
// Remember that track finding is done
Expand Down

0 comments on commit 4409f3c

Please sign in to comment.