Open asalzburger opened 3 months ago
Super-rough NavigationKernel
API:
class NavigationKernel {
public:
/// This is a candidate type for the tracing kernel
/// a Surface : always set
/// a Portal : set if the surface represents a portal
/// a size_t : the index of the intersection solution
/// an ActsScalar : the path length to the intersection
/// a BoundaryTolerance : the boundary tolerance used for the intersection
using TracedCandidate = std::tuple<const Surface*, const Portal*, std::size_t,
ActsScalar, BoundaryTolerance>;
/// Current navigation state:
/// - the surface for the current surface to be set
/// - the candidate for the next candidate to be set, nullptr if kernel is
/// exhausted
using State = std::tuple<const Surface*, const TracedCandidate*>;
/// @brief Initialize the tracing kernel
///
/// @param gctx The geometry context
/// @param position the currevnt position
/// @param direction the current direction
/// @param stepSize the estimated step size of the stepper
/// @param intial if this is the initial call
///
State update(const GeometryContext& gctx, const Vector3& position,
const Vector3& direction, ActsScalar stepSize, bool initial = false);
private:
/// The traced candidates belonging to this kernel
std::vector<TracedCandidate> m_candidates = {};
/// The candidate index of the next candidate
std::array<std::index_t> m_candidateRange = {};
/// The distance at which the surface is considered to be close enough
/// for a full intersection check
ActsScalar m_surfaceProximity = std::numeric_limits<ActsScalar>::max();
};
} // namespace Acts
@asalzburger
using TracedCandidate = std::tuple<const Surface*, const Portal*, std::size_t,
ActsScalar, BoundaryTolerance>;
State
contains a surface pointer, and TracedCandidate
, which contains another surfacer pointer.update
returns by valueNotes:
TracedCandidate
can be an ObjectIntersection
+ BoundaryTolerance
Portal
and Surface
Just for reference I tried to decouple and move some logic from the navigator to the propagator here https://github.com/acts-project/acts/pull/3449. This also reduces the number of intersections while approaching a surface with multiple steps.
A few learnings from that procedure
This issue/PR has been automatically marked as stale because it has not had recent activity. The stale label will be removed if any interaction occurs.
The current Gen1/Gen2 navigators have to deal with different (implicit) navigation streams:
The proposal is to make those streams for Gen3 explicit and base them onto the same implementation:
The proposal would be the following 2-3 streams (and associated kernels):
target stream
: this stream holds the target surface(s) - this can be the final target surface, but also what was formally calledexternal surfaces
. The kernel of this stream is not really updated, just the tracing of the candidates internally is updated.geometry stream
: this stream comes from the geometry and runs on a kernel (~ similar to what is now called theNavigationState
) that is updated by the volumes navigation delegates (either during the stepping) and/or at portal passing.Test, development sequence:
NavigationKernel
prototype (first w/o dependence on the stepper for multi-surface approach)StreamNavigator
prototype having two different streamsStreamNavigator
with two streams: sensitives and portals/boundaries from Gen1/Gen2 and demonstrate that correct navigation can be achievedIf/when proof of concept is achieved:
NavigationKernel
instead ofNavigationState
(or morph NavigationKernel into NavigationState)Watchpoints:
target stream
should overwritegeometry stream
, i.e. if a surface is in thetarget stream
it should be ignored somehow in a thegeometry stream
: possible solution is to hand exclusion candidates to the delegate when updating the kernel (i.e. could be a kernel member)