Skip to content

Commit

Permalink
fix: Fix try all navigators after running with track finding (#3408)
Browse files Browse the repository at this point in the history
After running the try all navigators with track finding a found a few bugs which lead to navigation failures. After these changes I was able to run a couple single muons without problems.

I will think about how to monitor this in the CI with a couple of events as this is nice to have for testing.
  • Loading branch information
andiwand committed Jul 19, 2024
1 parent e754bf8 commit 544917b
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions Core/include/Acts/Propagator/TryAllNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "Acts/Surfaces/Surface.hpp"
#include "Acts/Utilities/Intersection.hpp"
#include "Acts/Utilities/Logger.hpp"
#include "Acts/Utilities/StringHelpers.hpp"

#include <algorithm>
#include <cstdint>
Expand Down Expand Up @@ -342,7 +343,8 @@ class TryAllNavigator : public TryAllNavigatorBase {
state.options.surfaceTolerance);
for (const auto& intersection : intersections.first.split()) {
// exclude invalid intersections
if (!detail::checkIntersection(intersection, nearLimit, farLimit)) {
if (!intersection ||
!detail::checkIntersection(intersection, nearLimit, farLimit)) {
continue;
}
// store candidate
Expand All @@ -357,6 +359,8 @@ class TryAllNavigator : public TryAllNavigatorBase {
ACTS_VERBOSE(volInfo(state) << "found " << intersectionCandidates.size()
<< " intersections");

bool intersectionFound = false;

for (const auto& candidate : intersectionCandidates) {
const auto& intersection = candidate.intersection;
const Surface& surface = *intersection.object();
Expand All @@ -375,13 +379,16 @@ class TryAllNavigator : public TryAllNavigatorBase {
continue;
}

ACTS_VERBOSE(volInfo(state) << "aiming at surface "
<< surface.geometryId() << ". step size is "
<< stepper.outputStepSize(state.stepping));
break;
if (surfaceStatus == IntersectionStatus::reachable) {
ACTS_VERBOSE(volInfo(state)
<< "Surface reachable, step size updated to "
<< stepper.outputStepSize(state.stepping));
intersectionFound = true;
break;
}
}

if (intersectionCandidates.empty()) {
if (!intersectionFound) {
stepper.releaseStepSize(state.stepping, ConstrainedStep::actor);

ACTS_VERBOSE(volInfo(state) << "no intersections found. advance without "
Expand Down Expand Up @@ -675,7 +682,8 @@ class TryAllOverstepNavigator : public TryAllNavigatorBase {
break;
}

ACTS_WARNING(volInfo(state) << "Surface unreachable, skip.");
ACTS_VERBOSE(volInfo(state) << "Surface " << surface.geometryId()
<< " unreachable, skip.");
++state.navigation.activeCandidateIndex;
}

Expand Down

0 comments on commit 544917b

Please sign in to comment.