Skip to content

Commit

Permalink
fix: Direct Navigator: Set surface iterator to next surface in case s…
Browse files Browse the repository at this point in the history
…tart surface is in the list (#2605)

As the title says ... 

Point is that I noticed the when I was setting the start surface to be the first surface in `navSurfaces` the KF was correctly processing it doing its computations, but then it was stepping ahead and still searching for the first surface realizing it was behind and thus unreachable. With this the KF knows that surface has already been processed.
  • Loading branch information
CarloVarni committed Nov 1, 2023
1 parent 159acb7 commit 5a05bca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Core/include/Acts/Propagator/DirectNavigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ class DirectNavigator {
// Initialize the surface sequence
state.navigation.navSurfaces = navSurfaces;
state.navigation.navSurfaceIter = state.navigation.navSurfaces.begin();

// In case the start surface is in the list of nav surfaces
// we need to correct the iterator to point to the next surface
// in the vector
if (state.navigation.startSurface) {
auto surfaceIter = std::find(state.navigation.navSurfaces.begin(),
state.navigation.navSurfaces.end(),
state.navigation.startSurface);
// if current surface in the list, point to the next surface
if (surfaceIter != state.navigation.navSurfaces.end()) {
state.navigation.navSurfaceIter = ++surfaceIter;
}
}

r.initialized = true;
}
}
Expand Down

0 comments on commit 5a05bca

Please sign in to comment.