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

Provides Surface binning in 2 dimensions. More...

#include <Acts/Surfaces/SurfaceArray.hpp>

Classes

struct  ISurfaceGridLookup
 Base interface for all surface lookups. More...
struct  SingleElementLookup
 Lookup implementation which wraps one element and always returns this element when lookup is called. More...
struct  SurfaceGridLookup
 Lookup helper which encapsulates a Grid. More...

Public Member Functions

 SurfaceArray (std::shared_ptr< const Surface > srf)
 Constructor with a single surface.
 SurfaceArray (std::unique_ptr< ISurfaceGridLookup > gridLookup, std::vector< std::shared_ptr< const Surface > > surfaces, const Transform3 &transform=Transform3::Identity())
 Default constructor which takes a SurfaceLookup and a vector of surfaces.
const SurfaceVectorat (const Vector3 &position, const Vector3 &direction) const
 Get all surfaces in bin given by position pos.
SurfaceVectorat (std::size_t bin)
 Get all surfaces in bin given by global bin index bin.
const SurfaceVectorat (std::size_t bin) const
 Get all surfaces in bin given by global bin index.
std::vector< AxisDirectionbinningValues () const
 The binning values described by this surface grid lookup They are in order of the axes.
std::vector< const IAxis * > getAxes () const
 Get vector of axes spanning the grid as AnyAxis.
Vector3 getBinCenter (std::size_t bin) const
 Get the center of the bin identified by global bin index bin.
const ISurfaceGridLookupgridLookup () const
 Return the lookup object.
bool isValidBin (std::size_t bin) const
 Checks if global bin is valid.
const SurfaceVectorneighbors (const Vector3 &position, const Vector3 &direction) const
 Get all surfaces in bin at pos and its neighbors.
std::size_t size () const
 Get the size of the underlying grid structure including under/overflow bins.
const SurfaceVectorsurfaces () const
 Get all surfaces attached to this SurfaceArray.
std::ostream & toStream (const GeometryContext &gctx, std::ostream &sl) const
 String representation of this SurfaceArray.
const Transform3transform () const
 Get the transform of this surface array.

Detailed Description

Provides Surface binning in 2 dimensions.

Uses Grid under the hood to implement the storage and lookup Contains a lookup struct which talks to the Grid and performs utility actions. This struct needs to be initialised externally and passed to SurfaceArray on construction.

Constructor & Destructor Documentation

◆ SurfaceArray() [1/2]

Acts::SurfaceArray::SurfaceArray ( std::unique_ptr< ISurfaceGridLookup > gridLookup,
std::vector< std::shared_ptr< const Surface > > surfaces,
const Transform3 & transform = Transform3::Identity() )
explicit

Default constructor which takes a SurfaceLookup and a vector of surfaces.

Parameters
gridLookupThe grid storage. SurfaceArray does not fill it on its own
surfacesThe input vector of surfaces. This is only for bookkeeping, so we can ask
transformOptional additional transform for this SurfaceArray

◆ SurfaceArray() [2/2]

Acts::SurfaceArray::SurfaceArray ( std::shared_ptr< const Surface > srf)
explicit

Constructor with a single surface.

Parameters
srfThe one and only surface

Member Function Documentation

◆ at() [1/3]

const SurfaceVector & Acts::SurfaceArray::at ( const Vector3 & position,
const Vector3 & direction ) const

Get all surfaces in bin given by position pos.

Parameters
positionthe lookup position
directionthe lookup direction
Returns
const reference to SurfaceVector contained in bin at that position

◆ at() [2/3]

SurfaceVector & Acts::SurfaceArray::at ( std::size_t bin)

Get all surfaces in bin given by global bin index bin.

Parameters
binthe global bin index
Returns
reference to SurfaceVector contained in bin

◆ at() [3/3]

const SurfaceVector & Acts::SurfaceArray::at ( std::size_t bin) const

Get all surfaces in bin given by global bin index.

Parameters
binthe global bin index
Returns
const reference to SurfaceVector contained in bin

◆ binningValues()

std::vector< AxisDirection > Acts::SurfaceArray::binningValues ( ) const

The binning values described by this surface grid lookup They are in order of the axes.

Returns
Vector of axis directions for binning

◆ getAxes()

std::vector< const IAxis * > Acts::SurfaceArray::getAxes ( ) const

Get vector of axes spanning the grid as AnyAxis.

Returns
vector of AnyAxis
Note
The axes in the vector are copies. Only use for introspection and querying.

◆ getBinCenter()

Vector3 Acts::SurfaceArray::getBinCenter ( std::size_t bin) const

Get the center of the bin identified by global bin index bin.

Parameters
binthe global bin index
Returns
Center position of the bin in global coordinates

◆ gridLookup()

const ISurfaceGridLookup & Acts::SurfaceArray::gridLookup ( ) const

Return the lookup object.

Returns
Reference to the surface grid lookup interface

◆ isValidBin()

bool Acts::SurfaceArray::isValidBin ( std::size_t bin) const

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.

◆ neighbors()

const SurfaceVector & Acts::SurfaceArray::neighbors ( const Vector3 & position,
const Vector3 & direction ) const

Get all surfaces in bin at pos and its neighbors.

Parameters
positionThe position to lookup
directionThe direction to lookup
Returns
Merged SurfaceVector of neighbors and nominal
Note
The SurfaceVector will be combined. For technical reasons, the different bin content vectors have to be copied, so the resulting vector contains copies.

◆ size()

std::size_t Acts::SurfaceArray::size ( ) const

Get the size of the underlying grid structure including under/overflow bins.

Returns
the size

◆ surfaces()

const SurfaceVector & Acts::SurfaceArray::surfaces ( ) const

Get all surfaces attached to this SurfaceArray.

Returns
Reference to SurfaceVector containing all surfaces
Note
This does not reflect the actual state of the grid. It only returns what was given in the constructor, without any checks if that is actually what's in the grid.

◆ toStream()

std::ostream & Acts::SurfaceArray::toStream ( const GeometryContext & gctx,
std::ostream & sl ) const

String representation of this SurfaceArray.

Parameters
gctxThe current geometry context object, e.g. alignment
slOutput stream to write to
Returns
the output stream given as sl

◆ transform()

const Transform3 & Acts::SurfaceArray::transform ( ) const

Get the transform of this surface array.

Returns
Reference to the transformation matrix