Skip to content

Commit

Permalink
refactor: Improve CKF error message if target surface is not reached (#…
Browse files Browse the repository at this point in the history
…2587)

After this failure popped up in Athena and was kind of cryptic we wanted to improve the error message
  • Loading branch information
andiwand committed Oct 27, 2023
1 parent 825828c commit fa3e67e
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,13 @@ class CombinatorialKalmanFilter {

// -> then progress to target/reference surface and built the final
// track parameters for found track indexed with iSmoothed
if (result.smoothed and
(smoothingTargetSurface == nullptr or
targetReached(state, stepper, navigator,
*smoothingTargetSurface, logger()) or
result.pathLimitReached(state, stepper, navigator,
logger()))) {
bool isTargetReached =
(smoothingTargetSurface == nullptr) or
targetReached(state, stepper, navigator,
*smoothingTargetSurface, logger());
bool isPathLimitReached =
result.pathLimitReached(state, stepper, navigator, logger());
if (result.smoothed and (isTargetReached or isPathLimitReached)) {
ACTS_VERBOSE(
"Completing the track with last measurement index = "
<< result.lastMeasurementIndices.at(result.iSmoothed));
Expand All @@ -564,7 +565,14 @@ class CombinatorialKalmanFilter {
auto res =
stepper.boundState(state.stepping, *smoothingTargetSurface);
if (!res.ok()) {
ACTS_ERROR("Error in finalize: " << res.error());
if (isPathLimitReached) {
ACTS_ERROR("Target surface not reached due to path limit: "
<< res.error() << " " << res.error().message());
} else {
ACTS_ERROR(
"Error while acquiring bound state for target surface: "
<< res.error() << " " << res.error().message());
}
result.lastError = res.error();
} else {
auto fittedState = *res;
Expand Down

0 comments on commit fa3e67e

Please sign in to comment.