ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 > Struct Template Reference

Lookup helper which encapsulates a Grid. More...

#include <Acts/Surfaces/SurfaceArray.hpp>

Inheritance diagram for Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >:
[legend]
Collaboration diagram for Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >:
[legend]

Public Member Functions

 SurfaceGridLookup (std::shared_ptr< RegularSurface > representative, double tolerance, std::tuple< Axis1, Axis2 > axes, const std::vector< AxisDirection > &bValues={}, std::uint8_t maxNeighborDistance=1)
 Construct a surface grid lookup.
std::span< const Surface *const > at (std::array< std::size_t, 2 > gridIndices, std::uint8_t neighborDistance) const override
 Get all surfaces in bin given by local grid indices and neighbor distance.
std::vector< AxisDirectionbinningValues () const override
 The binning values described by this surface grid lookup.
void fill (const GeometryContext &gctx, std::span< const Surface *const > surfaces) override
 Fill provided surfaces into the contained Grid.
std::vector< const IAxis * > getAxes () const override
 Returns copies of the axes used in the grid as AnyAxis.
Vector3 getBinCenter (std::size_t bin) const override
 Gets the center position of bin bin in global coordinates.
bool isValidBin (std::size_t bin) const override
 Checks if global bin is valid.
std::span< const Surface *const > lookup (const GeometryContext &gctx, const Vector3 &position, const Vector3 &direction) const override
 Performs lookup at pos and returns bin content as const reference.
const std::vector< const Surface * > & lookup (const Vector3 &position, const Vector3 &direction) const override
 Performs lookup at pos and returns bin content as const reference.
const std::vector< const Surface * > & lookup (std::size_t bin) const override
 Performs lookup at global bin and returns bin content as const reference.
std::vector< const Surface * > & lookup (std::size_t bin) override
 Performs lookup at global bin and returns bin content as reference.
std::uint8_t maxNeighborDistance () const override
 Get the maximum neighbor distance that is supported by this lookup.
std::span< const Surface *const > neighbors (const GeometryContext &gctx, const Vector3 &position, const Vector3 &direction) const override
 Performs a lookup at pos, but returns neighbors as well.
const std::vector< const Surface * > & neighbors (const Vector3 &position, const Vector3 &direction) const override
 Performs a lookup at pos, but returns neighbors as well.
std::array< std::size_t, 2 > numLocalBins () const override
 Get the number of local bins in each dimension.
std::size_t size () const override
 Returns the total size of the grid (including under/overflow bins).
const SurfacesurfaceRepresentation () const override
 Get the representative surface used for this lookup.

Detailed Description

template<class Axis1, class Axis2>
struct Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >

Lookup helper which encapsulates a Grid.

Template Parameters
Axis1The first axis
Axis2The second axis
Deprecated
This is deprecated in favor of direct SurfaceArray constructors.

Constructor & Destructor Documentation

◆ SurfaceGridLookup()

template<class Axis1, class Axis2>
Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::SurfaceGridLookup ( std::shared_ptr< RegularSurface > representative,
double tolerance,
std::tuple< Axis1, Axis2 > axes,
const std::vector< AxisDirection > & bValues = {},
std::uint8_t maxNeighborDistance = 1 )

Construct a surface grid lookup.

Parameters
representativeThe surface which is used as representative
toleranceThe tolerance used for intersection checks
axesThe axes used for the grid
bValuesOptional vector of axis directions for binning
maxNeighborDistanceMaximum next neighbor distance to be included in neighbor lookups

Member Function Documentation

◆ at()

template<class Axis1, class Axis2>
std::span< const Surface *const > Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::at ( std::array< std::size_t, 2 > gridIndices,
std::uint8_t neighborDistance ) const
overridevirtual

Get all surfaces in bin given by local grid indices and neighbor distance.

Parameters
gridIndicesthe local grid indices
neighborDistancethe neighbor distance to include in the lookup
Returns
span of surface pointers of the bin at that position and its neighbors

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ binningValues()

template<class Axis1, class Axis2>
std::vector< AxisDirection > Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::binningValues ( ) const
overridevirtual

The binning values described by this surface grid lookup.

They are in order of the axes (optional) and empty for eingle lookups

Returns
Vector of axis directions for binning

Reimplemented from Acts::SurfaceArray::ISurfaceGridLookup.

◆ fill()

template<class Axis1, class Axis2>
void Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::fill ( const GeometryContext & gctx,
std::span< const Surface *const > surfaces )
overridevirtual

Fill provided surfaces into the contained Grid.

Parameters
gctxThe current geometry context object, e.g. alignment
surfacesInput surface pointers

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ getAxes()

template<class Axis1, class Axis2>
std::vector< const IAxis * > Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::getAxes ( ) const
overridevirtual

Returns copies of the axes used in the grid as AnyAxis.

Returns
The axes
Note
This returns copies. Use for introspection and querying.

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ getBinCenter()

template<class Axis1, class Axis2>
Vector3 Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::getBinCenter ( std::size_t bin) const
overridevirtual

Gets the center position of bin bin in global coordinates.

Parameters
binthe global bin index
Returns
The bin center

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ isValidBin()

template<class Axis1, class Axis2>
bool Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::isValidBin ( std::size_t bin) const
overridevirtual

Checks if global bin is valid.

Parameters
binthe global bin index
Returns
bool if the bin is valid
Note
Valid means that the index points to a bin which is not a under or overflow bin or out of range in any axis.

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ lookup() [1/4]

template<class Axis1, class Axis2>
std::span< const Surface *const > Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::lookup ( const GeometryContext & gctx,
const Vector3 & position,
const Vector3 & direction ) const
overridevirtual

Performs lookup at pos and returns bin content as const reference.

Parameters
gctxThe current geometry context object, e.g. alignment
positionLookup position
directionLookup direction
Returns
A span of surface pointers

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ lookup() [2/4]

template<class Axis1, class Axis2>
const std::vector< const Surface * > & Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::lookup ( const Vector3 & position,
const Vector3 & direction ) const
overridevirtual

Performs lookup at pos and returns bin content as const reference.

Parameters
positionLookup position
directionLookup direction
Returns
A vector of surfaces at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ lookup() [3/4]

template<class Axis1, class Axis2>
const std::vector< const Surface * > & Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::lookup ( std::size_t bin) const
overridevirtual

Performs lookup at global bin and returns bin content as const reference.

Parameters
binGlobal lookup bin
Returns
A vector of surfaces at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ lookup() [4/4]

template<class Axis1, class Axis2>
std::vector< const Surface * > & Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::lookup ( std::size_t bin)
overridevirtual

Performs lookup at global bin and returns bin content as reference.

Parameters
binGlobal lookup bin
Returns
A vector of surfaces at given bin

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ maxNeighborDistance()

template<class Axis1, class Axis2>
std::uint8_t Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::maxNeighborDistance ( ) const
overridevirtual

Get the maximum neighbor distance that is supported by this lookup.

This is used to determine how many neighbors to include in neighbor lookups.

Returns
Maximum neighbor distance

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ neighbors() [1/2]

template<class Axis1, class Axis2>
std::span< const Surface *const > Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::neighbors ( const GeometryContext & gctx,
const Vector3 & position,
const Vector3 & direction ) const
overridevirtual

Performs a lookup at pos, but returns neighbors as well.

Parameters
gctxThe current geometry context object, e.g. alignment
positionLookup position
directionLookup direction
Returns
A span of surface pointers

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ neighbors() [2/2]

template<class Axis1, class Axis2>
const std::vector< const Surface * > & Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::neighbors ( const Vector3 & position,
const Vector3 & direction ) const
overridevirtual

Performs a lookup at pos, but returns neighbors as well.

Parameters
positionLookup position
directionLookup direction
Returns
A vector of surfaces at given bin. Copy of all bins selected

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ numLocalBins()

template<class Axis1, class Axis2>
std::array< std::size_t, 2 > Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::numLocalBins ( ) const
overridevirtual

Get the number of local bins in each dimension.

This is used to determine the size of the grid for neighbor lookups.

Returns
Array of number of local bins in each dimension

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ size()

template<class Axis1, class Axis2>
std::size_t Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::size ( ) const
overridevirtual

Returns the total size of the grid (including under/overflow bins).

Returns
Size of the grid data structure

Implements Acts::SurfaceArray::ISurfaceGridLookup.

◆ surfaceRepresentation()

template<class Axis1, class Axis2>
const Surface * Acts::SurfaceArray::SurfaceGridLookup< Axis1, Axis2 >::surfaceRepresentation ( ) const
overridevirtual

Get the representative surface used for this lookup.

Returns
Surface pointer

Implements Acts::SurfaceArray::ISurfaceGridLookup.