ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::IMultiAxis Class Referenceabstract

Common base class for all MultiAxis instances. More...

#include <Acts/Utilities/IMultiAxis.hpp>

Inheritance diagram for Acts::IMultiAxis:
[legend]

Classes

class  iterator
 Random-access iterator over the contained axes. More...

Public Types

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

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 std::size_t getNAxes () const =0
 Get the number of axes spanning the grid.
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 Member Functions

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

virtual void toStream (std::ostream &os) const
 Print the contained axes to the given stream.

Detailed Description

Common base class for all MultiAxis instances.

This allows generic handling such as for inspection.

A multi-axis describes the binning of a multi-dimensional grid as the product of several one-dimensional IAxis objects. The number of axes (i.e. the dimension of the grid) is only known at runtime through this interface; the dimension-aware variant is exposed by the derived IMultiAxisXD template.

This base class exposes a type-erased, dynamically sized API (the *Any methods, using small vectors) so that grids of differing dimension can be handled through a common pointer. Bins are addressed either via a multi-index (one local bin index per axis) or via a single flattened global bin index. As for IAxis, local bin indices start at 1, with index 0 and nBins + 1 denoting the underflow and overflow bins of an axis; flattened global indices include these under-/overflow bins.

Member Function Documentation

◆ begin()

iterator Acts::IMultiAxis::begin ( ) const
Returns
iterator to the first axis

◆ create() [1/3]

std::unique_ptr< IMultiAxis1D > Acts::IMultiAxis::create ( const IAxis & axis1)
static

Factory method to create a multi-axis of dimension 1.

Parameters
axis1the single axis of the grid
Returns
unique pointer to the created multi-axis

◆ create() [2/3]

std::unique_ptr< IMultiAxis2D > Acts::IMultiAxis::create ( const IAxis & axis1,
const IAxis & axis2 )
static

Factory method to create a multi-axis of dimension 2.

Parameters
axis1the first axis of the grid
axis2the second axis of the grid
Returns
unique pointer to the created multi-axis

◆ create() [3/3]

std::unique_ptr< IMultiAxis3D > Acts::IMultiAxis::create ( const IAxis & axis1,
const IAxis & axis2,
const IAxis & axis3 )
static

Factory method to create a multi-axis of dimension 3.

Parameters
axis1the first axis of the grid
axis2the second axis of the grid
axis3the third axis of the grid
Returns
unique pointer to the created multi-axis

◆ end()

iterator Acts::IMultiAxis::end ( ) const
Returns
iterator past the last axis

◆ getAnyAxesVector()

virtual AnyAxesVector Acts::IMultiAxis::getAnyAxesVector ( ) const
virtual

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

Returns
vector of pointers to the axes, in axis order

◆ getAxis()

virtual const IAxis & Acts::IMultiAxis::getAxis ( std::size_t i) const
pure virtual

Get the axis at the given dimension.

Parameters
iindex of the axis
Returns
const reference to the requested axis

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

◆ getBinCenterAny()

virtual AnyPoint Acts::IMultiAxis::getBinCenterAny ( const AnyLocalBins & indices) const
virtual

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

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

◆ getLowerLeftBinEdgeAny()

virtual AnyPoint Acts::IMultiAxis::getLowerLeftBinEdgeAny ( const AnyLocalBins & indices) const
virtual

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

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

◆ getMaxPointAny()

virtual AnyPoint Acts::IMultiAxis::getMaxPointAny ( ) const
virtual

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

Returns
point holding the maximum of each axis

◆ getMinPointAny()

virtual AnyPoint Acts::IMultiAxis::getMinPointAny ( ) const
virtual

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

Returns
point holding the minimum of each axis

◆ getNAxes()

virtual std::size_t Acts::IMultiAxis::getNAxes ( ) const
pure virtual

Get the number of axes spanning the grid.

Returns
number of axes (i.e. the dimension of the grid)

Implemented in Acts::IMultiAxisXD< _DIM >, Acts::IMultiAxisXD< 1 >, Acts::IMultiAxisXD< 2 >, Acts::IMultiAxisXD< 3 >, and Acts::IMultiAxisXD< sizeof...(Axes)>.

◆ getNBinsAny()

virtual AnyLocalBins Acts::IMultiAxis::getNBinsAny ( ) const
virtual

Get the number of bins along each axis.

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

◆ getNTotalBins()

virtual std::size_t Acts::IMultiAxis::getNTotalBins ( bool includeOverflowBins = false) const
virtual

Get the total number of bins in the grid.

Parameters
includeOverflowBinsif true the under-/overflow bins of every axis are included in the count, otherwise only the regular bins are counted
Returns
product of the per-axis bin counts

◆ getUpperRightBinEdgeAny()

virtual AnyPoint Acts::IMultiAxis::getUpperRightBinEdgeAny ( const AnyLocalBins & indices) const
virtual

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

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

◆ isInsideAny()

virtual bool Acts::IMultiAxis::isInsideAny ( const AnyPoint & 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
Exceptions
std::invalid_argumentif the number of coordinates does not match the number of axes

◆ toStream()

virtual void Acts::IMultiAxis::toStream ( std::ostream & os) const
protectedvirtual

Print the contained axes to the given stream.

Parameters
osoutput stream