ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::IMultiAxisXD< _DIM > Class Template Referenceabstract

Common base class for all multi-axes of a fixed, compile-time dimension. More...

#include <Acts/Utilities/IMultiAxis.hpp>

Inheritance diagram for Acts::IMultiAxisXD< _DIM >:
[legend]
Collaboration diagram for Acts::IMultiAxisXD< _DIM >:
[legend]

Public Types

using AnyAxesArray = std::array<const IAxis*, DIM>
 Statically sized array of (non-owning) pointers to the contained axes.
using AnyAxesTuple
 Tuple of const references to the contained axes.
using LocalBins = std::array<std::size_t, DIM>
 Statically sized multi-index holding one local bin index per axis.
using Point = std::array<double, DIM>
 Statically sized point holding one coordinate per axis.
Public Types inherited from Acts::IMultiAxis
using AnyAxesVector = SmallVector<const IAxis*>
 Dynamically sized vector of (non-owning) pointers to the contained axes.
using AnyLocalBins = SmallVector<std::size_t>
 Dynamically sized multi-index holding one local bin index per axis.
using AnyPoint = SmallVector<double>
 Dynamically sized point holding one coordinate per axis.
using GlobalBin = std::size_t
 Flattened global bin index across all axes.

Public Member Functions

virtual AnyAxesArray getAnyAxesArray () const
 Get (non-owning) pointers to all contained axes.
virtual AnyAxesTuple getAnyAxesTuple () const
 Get const references to all contained axes as a tuple.
virtual Point getBinCenter (const LocalBins &localBins) const
 Get the center of the bin given by a multi-index.
virtual Point getBinWidth (const LocalBins &localBins) const
 Get the bin width along each axis for a given multi-index.
virtual detail::FlatNeighborHoodIndices< DIMgetClosestPointsIndices (const LocalBins &localBins) const =0
 Get the global bin indices of the grid points closest to the given bin.
virtual detail::FlatNeighborHoodIndices< DIMgetClosestPointsIndices (const Point &point) const
 Get the global bin indices of the grid points closest to the given point.
virtual GlobalBin getGlobalBinFromLocalBins (const LocalBins &localBins) const
 Determine the flattened global bin index from a multi-index.
virtual GlobalBin getGlobalBinFromPoint (const Point &point) const
 Determine the flattened global bin index for a given point.
virtual LocalBins getLocalBinsFromGlobalBin (GlobalBin globalBin) const
 Determine the multi-index of local bin indices from a flattened global bin index.
virtual LocalBins getLocalBinsFromPoint (const Point &point) const
 Determine the multi-index of local bin indices for a given point.
virtual Point getLowerLeftBinEdge (const LocalBins &localBins) const
 Get the lower-left corner of the bin given by a multi-index.
virtual Point getMaxPoint () const
 Get the upper boundary of the grid range along each axis.
virtual Point getMinPoint () const
 Get the lower boundary of the grid range along each axis.
std::size_t getNAxes () const override
 Get the number of axes spanning the grid.
virtual LocalBins getNBins () const
 Get the number of bins along each axis.
virtual detail::FlatNeighborHoodIndices< DIMgetNeighborHoodIndices (const LocalBins &localBins, const std::array< std::pair< int, int >, DIM > &sizePerAxis) const =0
 Get the global bin indices of the bins in the neighborhood of a bin, with a separate neighborhood size per axis.
virtual detail::FlatNeighborHoodIndices< DIMgetNeighborHoodIndices (const LocalBins &localBins, const std::pair< int, int > &size) const =0
 Get the global bin indices of the bins in the neighborhood of a bin.
virtual detail::FlatNeighborHoodIndices< DIMgetNeighborHoodIndices (const LocalBins &localBins, std::size_t size=1u) const =0
 Get the global bin indices of the bins in the neighborhood of a bin.
virtual Point getUpperRightBinEdge (const LocalBins &localBins) const
 Get the upper-right corner of the bin given by a multi-index.
virtual bool isInside (const Point &point) const
 Check whether a point lies inside the grid limits.
Public Member Functions inherited from Acts::IMultiAxis
iterator begin () const
iterator end () const
virtual AnyAxesVector getAnyAxesVector () const
 Get (non-owning) pointers to all contained axes.
virtual const IAxisgetAxis (std::size_t i) const =0
 Get the axis at the given dimension.
virtual AnyPoint getBinCenterAny (const AnyLocalBins &indices) const
 Get the center of the bin given by a multi-index.
virtual AnyPoint getLowerLeftBinEdgeAny (const AnyLocalBins &indices) const
 Get the lower-left corner of the bin given by a multi-index.
virtual AnyPoint getMaxPointAny () const
 Get the upper boundary of the grid range along each axis.
virtual AnyPoint getMinPointAny () const
 Get the lower boundary of the grid range along each axis.
virtual AnyLocalBins getNBinsAny () const
 Get the number of bins along each axis.
virtual std::size_t getNTotalBins (bool includeOverflowBins=false) const
 Get the total number of bins in the grid.
virtual AnyPoint getUpperRightBinEdgeAny (const AnyLocalBins &indices) const
 Get the upper-right corner of the bin given by a multi-index.
virtual bool isInsideAny (const AnyPoint &point) const
 Check whether a point lies inside the grid limits.

Static Public Attributes

static constexpr std::size_t DIM = _DIM
 Dimension of the grid (number of axes).

Additional Inherited Members

Static Public Member Functions inherited from Acts::IMultiAxis
static std::unique_ptr< IMultiAxis1Dcreate (const IAxis &axis1)
 Factory method to create a multi-axis of dimension 1.
static std::unique_ptr< IMultiAxis2Dcreate (const IAxis &axis1, const IAxis &axis2)
 Factory method to create a multi-axis of dimension 2.
static std::unique_ptr< IMultiAxis3Dcreate (const IAxis &axis1, const IAxis &axis2, const IAxis &axis3)
 Factory method to create a multi-axis of dimension 3.
Protected Member Functions inherited from Acts::IMultiAxis
virtual void toStream (std::ostream &os) const
 Print the contained axes to the given stream.

Detailed Description

template<std::size_t _DIM>
class Acts::IMultiAxisXD< _DIM >

Common base class for all multi-axes of a fixed, compile-time dimension.

On top of the dynamically sized IMultiAxis API this adds a statically sized API (using std::array of fixed length DIM) and the grid index conversions between points, multi-indices and flattened global indices. The actual axis storage is provided by the concrete MultiAxis derived class.

Template Parameters
_DIMnumber of axes (dimension of the grid)

Member Typedef Documentation

◆ AnyAxesTuple

template<std::size_t _DIM>
using Acts::IMultiAxisXD< _DIM >::AnyAxesTuple
Initial value:
decltype(std::apply(
[](auto&&... xs) { return std::tie(*xs...); }, AnyAxesArray{}))
std::array< const IAxis *, DIM > AnyAxesArray
Statically sized array of (non-owning) pointers to the contained axes.
Definition IMultiAxis.hpp:379

Tuple of const references to the contained axes.

Member Function Documentation

◆ getAnyAxesArray()

template<std::size_t _DIM>
virtual AnyAxesArray Acts::IMultiAxisXD< _DIM >::getAnyAxesArray ( ) const
virtual

Get (non-owning) pointers to all contained axes.

Returns
fixed-size array of pointers to the axes, in axis order

◆ getAnyAxesTuple()

template<std::size_t _DIM>
virtual AnyAxesTuple Acts::IMultiAxisXD< _DIM >::getAnyAxesTuple ( ) const
virtual

Get const references to all contained axes as a tuple.

Returns
tuple of references to the axes, in axis order

◆ getBinCenter()

template<std::size_t _DIM>
virtual Point Acts::IMultiAxisXD< _DIM >::getBinCenter ( const LocalBins & localBins) const
virtual

Get the center of the bin given by a multi-index.

Parameters
localBinslocal bin indices along each axis
Returns
point holding the bin center coordinate of each axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getBinWidth()

template<std::size_t _DIM>
virtual Point Acts::IMultiAxisXD< _DIM >::getBinWidth ( const LocalBins & localBins) const
virtual

Get the bin width along each axis for a given multi-index.

Parameters
localBinslocal bin indices along each axis
Returns
point holding the bin width along each axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getClosestPointsIndices() [1/2]

template<std::size_t _DIM>
virtual detail::FlatNeighborHoodIndices< DIM > Acts::IMultiAxisXD< _DIM >::getClosestPointsIndices ( const LocalBins & localBins) const
pure virtual

Get the global bin indices of the grid points closest to the given bin.

Parameters
localBinslocal bin indices of the bin of interest
Returns
sorted collection of global bin indices whose lower-left corners are the closest grid points to every point in the given bin

Implemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getClosestPointsIndices() [2/2]

template<std::size_t _DIM>
virtual detail::FlatNeighborHoodIndices< DIM > Acts::IMultiAxisXD< _DIM >::getClosestPointsIndices ( const Point & point) const
virtual

Get the global bin indices of the grid points closest to the given point.

Parameters
pointcoordinates to look up, one per axis
Returns
sorted collection of global bin indices of the closest grid points

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getGlobalBinFromLocalBins()

template<std::size_t _DIM>
virtual GlobalBin Acts::IMultiAxisXD< _DIM >::getGlobalBinFromLocalBins ( const LocalBins & localBins) const
virtual

Determine the flattened global bin index from a multi-index.

Parameters
localBinslocal bin indices along each axis (under-/overflow bins are allowed)
Returns
global bin index of the bin

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getGlobalBinFromPoint()

template<std::size_t _DIM>
virtual GlobalBin Acts::IMultiAxisXD< _DIM >::getGlobalBinFromPoint ( const Point & point) const
virtual

Determine the flattened global bin index for a given point.

Parameters
pointcoordinates to look up, one per axis
Returns
global bin index of the bin containing the point

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getLocalBinsFromGlobalBin()

template<std::size_t _DIM>
virtual LocalBins Acts::IMultiAxisXD< _DIM >::getLocalBinsFromGlobalBin ( GlobalBin globalBin) const
virtual

Determine the multi-index of local bin indices from a flattened global bin index.

Parameters
globalBinglobal bin index
Returns
local bin indices along each axis (may be under-/overflow bins)

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getLocalBinsFromPoint()

template<std::size_t _DIM>
virtual LocalBins Acts::IMultiAxisXD< _DIM >::getLocalBinsFromPoint ( const Point & point) const
virtual

Determine the multi-index of local bin indices for a given point.

Parameters
pointcoordinates to look up, one per axis
Returns
local bin indices along each axis (may be under-/overflow bins)

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getLowerLeftBinEdge()

template<std::size_t _DIM>
virtual Point Acts::IMultiAxisXD< _DIM >::getLowerLeftBinEdge ( const LocalBins & localBins) const
virtual

Get the lower-left corner of the bin given by a multi-index.

Parameters
localBinslocal bin indices along each axis
Returns
point holding the lower bin boundary of each axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getMaxPoint()

template<std::size_t _DIM>
virtual Point Acts::IMultiAxisXD< _DIM >::getMaxPoint ( ) const
virtual

Get the upper boundary of the grid range along each axis.

Returns
point holding the maximum of each axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getMinPoint()

template<std::size_t _DIM>
virtual Point Acts::IMultiAxisXD< _DIM >::getMinPoint ( ) const
virtual

Get the lower boundary of the grid range along each axis.

Returns
point holding the minimum of each axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getNAxes()

template<std::size_t _DIM>
std::size_t Acts::IMultiAxisXD< _DIM >::getNAxes ( ) const
overridevirtual

Get the number of axes spanning the grid.

Returns
the compile-time dimension DIM

Implements Acts::IMultiAxis.

◆ getNBins()

template<std::size_t _DIM>
virtual LocalBins Acts::IMultiAxisXD< _DIM >::getNBins ( ) const
virtual

Get the number of bins along each axis.

Returns
per-axis number of bins (excluding under-/overflow bins)

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getNeighborHoodIndices() [1/3]

template<std::size_t _DIM>
virtual detail::FlatNeighborHoodIndices< DIM > Acts::IMultiAxisXD< _DIM >::getNeighborHoodIndices ( const LocalBins & localBins,
const std::array< std::pair< int, int >, DIM > & sizePerAxis ) const
pure virtual

Get the global bin indices of the bins in the neighborhood of a bin, with a separate neighborhood size per axis.

Parameters
localBinslocal bin indices of the bin of interest
sizePerAxisper-axis lower/upper number of adjacent bins to include
Returns
sorted collection of global bin indices in the neighborhood

Implemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getNeighborHoodIndices() [2/3]

template<std::size_t _DIM>
virtual detail::FlatNeighborHoodIndices< DIM > Acts::IMultiAxisXD< _DIM >::getNeighborHoodIndices ( const LocalBins & localBins,
const std::pair< int, int > & size ) const
pure virtual

Get the global bin indices of the bins in the neighborhood of a bin.

Parameters
localBinslocal bin indices of the bin of interest
sizeof neighborhood determining how many adjacent bins along each axis are considered
Returns
sorted collection of global bin indices in the neighborhood

Implemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getNeighborHoodIndices() [3/3]

template<std::size_t _DIM>
virtual detail::FlatNeighborHoodIndices< DIM > Acts::IMultiAxisXD< _DIM >::getNeighborHoodIndices ( const LocalBins & localBins,
std::size_t size = 1u ) const
pure virtual

Get the global bin indices of the bins in the neighborhood of a bin.

Parameters
localBinslocal bin indices of the bin of interest
sizenumber of adjacent bins to include along each axis (symmetric)
Returns
sorted collection of global bin indices in the neighborhood

Implemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ getUpperRightBinEdge()

template<std::size_t _DIM>
virtual Point Acts::IMultiAxisXD< _DIM >::getUpperRightBinEdge ( const LocalBins & localBins) const
virtual

Get the upper-right corner of the bin given by a multi-index.

Parameters
localBinslocal bin indices along each axis
Returns
point holding the upper bin boundary of each axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.

◆ isInside()

template<std::size_t _DIM>
virtual bool Acts::IMultiAxisXD< _DIM >::isInside ( const Point & point) const
virtual

Check whether a point lies inside the grid limits.

Parameters
pointcoordinates to check, one per axis
Returns
true if the point is within range along every axis

Reimplemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.