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

Common base class for all Axis instance. More...

#include <Acts/Utilities/IAxis.hpp>

Inheritance diagram for Acts::IAxis:
[legend]

Public Member Functions

virtual ~IAxis ()=default
 Virtual destructor.
virtual std::vector< double > getBinEdges () const =0
 Return a vector of bin edges.
virtual AxisBoundaryType getBoundaryType () const =0
 returns the boundary type set in the template param
virtual double getMax () const =0
 get maximum of binning range
virtual double getMin () const =0
 get minimum of binning range
virtual std::size_t getNBins () const =0
 get total number of bins
virtual AxisType getType () const =0
 returns the type of the axis
virtual bool isEquidistant () const =0
 returns whether the axis is equidistant
virtual bool isVariable () const =0
 returns whether the axis is variable
template<typename callable_t>
decltype(auto) visit (const callable_t &callable) const
 Helper function that dispatches from the IAxis base class to a concrete axis type.

Static Public Member Functions

static std::unique_ptr< IAxiscreateEquidistant (AxisBoundaryType aBoundaryType, double min, double max, std::size_t nbins)
 Centralized axis factory for equidistant binning.
static std::unique_ptr< IAxiscreateVariable (AxisBoundaryType aBoundaryType, const std::vector< double > &edges)
 Centralized axis factory for variable binning.

Protected Member Functions

virtual void toStream (std::ostream &os) const =0
 Dispatch to the correct stream operator.

Detailed Description

Common base class for all Axis instance.

This allows generice handling such as for inspection.

Constructor & Destructor Documentation

◆ ~IAxis()

virtual Acts::IAxis::~IAxis ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ createEquidistant()

std::unique_ptr< IAxis > Acts::IAxis::createEquidistant ( AxisBoundaryType aBoundaryType,
double min,
double max,
std::size_t nbins )
static

Centralized axis factory for equidistant binning.

Parameters
aBoundaryTypethe axis boundary type
minthe minimum edge of the axis
maxthe maximum edge of the axis
nbinsthe number of bins
Exceptions
std::invalid_argumentif min >= max or nbins == 0
Returns
a unique pointer to the axis

◆ createVariable()

std::unique_ptr< IAxis > Acts::IAxis::createVariable ( AxisBoundaryType aBoundaryType,
const std::vector< double > & edges )
static

Centralized axis factory for variable binning.

Parameters
aBoundaryTypethe axis boundary type
edgesare the bin edges
Exceptions
std::invalid_argumentif edges is empty or not strictly increasing
Returns
a unique pointer to the axis

◆ getBinEdges()

virtual std::vector< double > Acts::IAxis::getBinEdges ( ) const
pure virtual

Return a vector of bin edges.

Returns
Vector which contains the bin edges

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ getBoundaryType()

virtual AxisBoundaryType Acts::IAxis::getBoundaryType ( ) const
pure virtual

returns the boundary type set in the template param

Returns
AxisBoundaryType of this axis

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ getMax()

virtual double Acts::IAxis::getMax ( ) const
pure virtual

get maximum of binning range

Returns
maximum of binning range

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ getMin()

virtual double Acts::IAxis::getMin ( ) const
pure virtual

get minimum of binning range

Returns
minimum of binning range

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ getNBins()

virtual std::size_t Acts::IAxis::getNBins ( ) const
pure virtual

get total number of bins

Returns
total number of bins (excluding under-/overflow bins)

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ getType()

virtual AxisType Acts::IAxis::getType ( ) const
pure virtual

returns the type of the axis

Returns
AxisType of this axis

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ isEquidistant()

virtual bool Acts::IAxis::isEquidistant ( ) const
pure virtual

returns whether the axis is equidistant

Returns
bool is equidistant

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ isVariable()

virtual bool Acts::IAxis::isVariable ( ) const
pure virtual

returns whether the axis is variable

Returns
bool is variable

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ toStream()

virtual void Acts::IAxis::toStream ( std::ostream & os) const
protectedpure virtual

Dispatch to the correct stream operator.

Parameters
osoutput stream

Implemented in Acts::Axis< AxisType::Equidistant, bdt >, and Acts::Axis< AxisType::Variable, bdt >.

◆ visit()

template<typename callable_t>
decltype(auto) Acts::IAxis::visit ( const callable_t & callable) const

Helper function that dispatches from the IAxis base class to a concrete axis type.

It will call the provided callable with a const reference to the concrete axis type.

Template Parameters
callable_tthe callable type
Parameters
callablethe callable object
Returns
the value returned by the callable