|
ACTS
Experiment-independent tracking
|
Common base class for all MultiAxis instances. More...
#include <Acts/Utilities/IMultiAxis.hpp>
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 IAxis & | getAxis (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< IMultiAxis1D > | create (const IAxis &axis1) |
| Factory method to create a multi-axis of dimension 1. | |
| static std::unique_ptr< IMultiAxis2D > | create (const IAxis &axis1, const IAxis &axis2) |
| Factory method to create a multi-axis of dimension 2. | |
| static std::unique_ptr< IMultiAxis3D > | create (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. | |
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.
| iterator Acts::IMultiAxis::begin | ( | ) | const |
|
static |
Factory method to create a multi-axis of dimension 1.
| axis1 | the single axis of the grid |
|
static |
Factory method to create a multi-axis of dimension 2.
| axis1 | the first axis of the grid |
| axis2 | the second axis of the grid |
|
static |
Factory method to create a multi-axis of dimension 3.
| axis1 | the first axis of the grid |
| axis2 | the second axis of the grid |
| axis3 | the third axis of the grid |
| iterator Acts::IMultiAxis::end | ( | ) | const |
|
virtual |
Get (non-owning) pointers to all contained axes.
|
pure virtual |
Get the axis at the given dimension.
| i | index of the axis |
Implemented in Acts::MultiAxis< Axes >, and Acts::MultiAxis< Axes... >.
|
virtual |
Get the center of the bin given by a multi-index.
| indices | local bin indices along each axis |
|
virtual |
Get the lower-left corner of the bin given by a multi-index.
| indices | local bin indices along each axis |
|
virtual |
Get the upper boundary of the grid range along each axis.
|
virtual |
Get the lower boundary of the grid range along each axis.
|
pure virtual |
Get the number of axes spanning the grid.
Implemented in Acts::IMultiAxisXD< _DIM >, Acts::IMultiAxisXD< 1 >, Acts::IMultiAxisXD< 2 >, Acts::IMultiAxisXD< 3 >, and Acts::IMultiAxisXD< sizeof...(Axes)>.
|
virtual |
Get the number of bins along each axis.
|
virtual |
Get the total number of bins in the grid.
| includeOverflowBins | if true the under-/overflow bins of every axis are included in the count, otherwise only the regular bins are counted |
|
virtual |
Get the upper-right corner of the bin given by a multi-index.
| indices | local bin indices along each axis |
|
virtual |
Check whether a point lies inside the grid limits.
| point | coordinates to check, one per axis |
true if the point is within range along every axis | std::invalid_argument | if the number of coordinates does not match the number of axes |
|
protectedvirtual |
Print the contained axes to the given stream.
| os | output stream |