ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::NavigationStream Class Reference

The NavigationStream is a container for the navigation candidates that are currentlu processed in a given context. More...

#include <Acts/Navigation/NavigationStream.hpp>

Classes

struct  QueryPoint
 The query point for the navigation stream. More...

Public Member Functions

void addPortalCandidate (const Portal &portal)
 Fill one portal into the candidate vector.
void addSurfaceCandidate (const Surface &surface, const BoundaryTolerance &bTolerance)
 Fill one surface into the candidate vector.
void addSurfaceCandidates (std::span< const Surface * > surfaces, const BoundaryTolerance &bTolerance)
 Fill n surfaces into the candidate vector.
std::span< NavigationTargetcandidates ()
 Non-const access the candidate vector.
std::span< const NavigationTargetcandidates () const
 Const access the candidate vector.
NavigationTargetcurrentCandidate ()
 Non-const access the current candidate.
const NavigationTargetcurrentCandidate () const
 Const access the current candidate.
const std::optional< std::size_t > & currentIndex () const
 Current Index.
bool initialize (const GeometryContext &gctx, const NavigationStream::QueryPoint &queryPoint, const Logger &logger, double onSurfaceTolerance=s_onSurfaceTolerance, bool candidatesAreUnique=false)
 Initialize the stream from a query point.
bool isValid () const
 Performs the validity check on the navigation current navigation candidate index.
std::size_t remainingCandidates () const
 The number of active candidates.
void reserve (const std::size_t n)
 Preallocate the memory to store a certain amount of candidates.
void reset (const bool keepBoundLess=false)
 Reset the navigation stream by clearing all candidates and resetting the index.
bool switchToNextCandidate ()
 Switch to next next candidate.
bool update (const GeometryContext &gctx, const NavigationStream::QueryPoint &queryPoint, const Logger &logger, double onSurfaceTolerance=s_onSurfaceTolerance)
 Convenience method to update a stream from a new query point, this could be called from navigation delegates that do not require a local state or from the navigator on the target stream.

Detailed Description

The NavigationStream is a container for the navigation candidates that are currentlu processed in a given context.

The context could be local to a volume, or global to an entire track following.

The current candidates are stored in a vector of candidates, where an index is used to indicate the current active candidate.

Member Function Documentation

◆ addPortalCandidate()

void Acts::NavigationStream::addPortalCandidate ( const Portal & portal)

Fill one portal into the candidate vector.

Parameters
portalthe portals that are filled in

◆ addSurfaceCandidate()

void Acts::NavigationStream::addSurfaceCandidate ( const Surface & surface,
const BoundaryTolerance & bTolerance )

Fill one surface into the candidate vector.

Parameters
surfacethe surface to be filled
bTolerancethe boundary tolerance used for the intersection

◆ addSurfaceCandidates()

void Acts::NavigationStream::addSurfaceCandidates ( std::span< const Surface * > surfaces,
const BoundaryTolerance & bTolerance )

Fill n surfaces into the candidate vector.

Parameters
surfacesthe surfaces that are filled in
bTolerancethe boundary tolerance used for the intersection

◆ candidates() [1/2]

std::span< NavigationTarget > Acts::NavigationStream::candidates ( )

Non-const access the candidate vector.

Returns
Mutable reference to vector of navigation candidates

◆ candidates() [2/2]

std::span< const NavigationTarget > Acts::NavigationStream::candidates ( ) const

Const access the candidate vector.

Returns
Const reference to vector of navigation candidates

◆ currentCandidate() [1/2]

NavigationTarget & Acts::NavigationStream::currentCandidate ( )

Non-const access the current candidate.

This will throw and out of bounds exception if the stream is not valid anymore.

Returns
Mutable reference to current candidate

◆ currentCandidate() [2/2]

const NavigationTarget & Acts::NavigationStream::currentCandidate ( ) const

Const access the current candidate.

Returns
Const reference to current candidate

◆ currentIndex()

const std::optional< std::size_t > & Acts::NavigationStream::currentIndex ( ) const

Current Index.

Returns
Index of the current candidate in the vector

◆ initialize()

bool Acts::NavigationStream::initialize ( const GeometryContext & gctx,
const NavigationStream::QueryPoint & queryPoint,
const Logger & logger,
double onSurfaceTolerance = s_onSurfaceTolerance,
bool candidatesAreUnique = false )

Initialize the stream from a query point.

Parameters
gctxis the geometry context
queryPointholds current position, direction, etc.
loggeris the navigator's logger
onSurfaceToleranceis the tolerance for on-surface intersections
candidatesAreUniquethe caller guarantees that no surface was added more than once, so the pre-intersection de-duplication pass can be skipped. Candidates that intersect the same surface twice (multi-intersections) are still handled correctly.

This method will first de-duplicate the candidates on basis of the surface pointer to make sure that the multi-intersections are handled correctly. This will allow intializeStream() to be called even as a re-initialization and still work correctly with at one time valid candidates.

Returns
true if the stream is active, false indicates that there are no valid candidates

◆ isValid()

bool Acts::NavigationStream::isValid ( ) const

Performs the validity check on the navigation current navigation candidate index.

Returns
Returns whether the index is initialized and less than the size of the available candidates

◆ remainingCandidates()

std::size_t Acts::NavigationStream::remainingCandidates ( ) const

The number of active candidates.

Returns
Number of remaining candidates from current position onwards

◆ reserve()

void Acts::NavigationStream::reserve ( const std::size_t n)

Preallocate the memory to store a certain amount of candidates.

Parameters
nThe number of candidates to be stored

◆ reset()

void Acts::NavigationStream::reset ( const bool keepBoundLess = false)

Reset the navigation stream by clearing all candidates and resetting the index.

This clears the candidates vector and resets the current index to 0.

Parameters
keepBoundLessFlag to toggle whether unreached boundless navigation targets remain in the stream

◆ switchToNextCandidate()

bool Acts::NavigationStream::switchToNextCandidate ( )

Switch to next next candidate.

Returns
true if a next candidate is available

◆ update()

bool Acts::NavigationStream::update ( const GeometryContext & gctx,
const NavigationStream::QueryPoint & queryPoint,
const Logger & logger,
double onSurfaceTolerance = s_onSurfaceTolerance )

Convenience method to update a stream from a new query point, this could be called from navigation delegates that do not require a local state or from the navigator on the target stream.

Parameters
gctxis the geometry context
queryPointholds current position, direction, etc.
loggeris the navigator's logger
onSurfaceToleranceis the tolerance for on-surface intersections
Returns
true if the stream is active, false indicate no valid candidates left