Skip to content

Commit

Permalink
fix: Fix and refactor PathLimitReached (#2536)
Browse files Browse the repository at this point in the history
`PathLimitReached` should not update the step length if it already reached its target

Pulled this out of #2518
  • Loading branch information
andiwand committed Oct 11, 2023
1 parent c77ea1d commit e328ce0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Core/include/Acts/Propagator/StandardAborters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,20 @@ struct PathLimitReached {
double distance =
std::abs(internalLimit) - std::abs(state.stepping.pathAccumulated);
double tolerance = state.options.targetTolerance;
stepper.setStepSize(state.stepping, distance, ConstrainedStep::aborter,
false);
bool limitReached = (std::abs(distance) < std::abs(tolerance));
if (limitReached) {
ACTS_VERBOSE("Target: x | "
<< "Path limit reached at distance " << distance);
// reaching the target means navigation break
navigator.targetReached(state.navigation, true);
} else {
ACTS_VERBOSE("Target: 0 | "
<< "Target stepSize (path limit) updated to "
<< stepper.outputStepSize(state.stepping));
return true;
}
// path limit check
return limitReached;
stepper.setStepSize(state.stepping, distance, ConstrainedStep::aborter,
false);
ACTS_VERBOSE("Target: 0 | "
<< "Target stepSize (path limit) updated to "
<< stepper.outputStepSize(state.stepping));
return false;
}
};

Expand Down

0 comments on commit e328ce0

Please sign in to comment.