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

fix: Allow CKF smoothing without a target surface #2317

Merged
merged 2 commits into from
Jul 26, 2023
Merged
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
32 changes: 19 additions & 13 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,26 +497,32 @@ class CombinatorialKalmanFilter {
}
result.smoothed = true;
}

// -> then progress to target/reference surface and built the final
// track parameters for found track indexed with iSmoothed
if (result.smoothed and targetReached(state, stepper, navigator,
*targetSurface, logger())) {
if (result.smoothed and (targetSurface == nullptr or
targetReached(state, stepper, navigator,
*targetSurface, logger()))) {
ACTS_VERBOSE(
"Completing the track with last measurement index = "
<< result.lastMeasurementIndices.at(result.iSmoothed));
// Transport & bind the parameter to the final surface
auto res = stepper.boundState(state.stepping, *targetSurface);
if (!res.ok()) {
ACTS_ERROR("Error in finalize: " << res.error());
result.result = res.error();
return;

if (targetSurface != nullptr) {
// Transport & bind the parameter to the final surface
auto res = stepper.boundState(state.stepping, *targetSurface);
if (!res.ok()) {
ACTS_ERROR("Error in finalize: " << res.error());
result.result = res.error();
return;
}

auto fittedState = *res;
// Assign the fitted parameters
result.fittedParameters.emplace(
result.lastMeasurementIndices.at(result.iSmoothed),
std::get<BoundTrackParameters>(fittedState));
}

auto fittedState = *res;
// Assign the fitted parameters
result.fittedParameters.emplace(
result.lastMeasurementIndices.at(result.iSmoothed),
std::get<BoundTrackParameters>(fittedState));
// If there are more trajectories to handle:
// -> set the targetReached status to false
// -> set the smoothed status to false
Expand Down