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

This class is a pure run-time placeholder for the axis definition. More...

#include <Acts/Utilities/ProtoAxis.hpp>

Inheritance diagram for Acts::ProtoAxis:
[legend]
Collaboration diagram for Acts::ProtoAxis:
[legend]

Public Member Functions

 ProtoAxis (Acts::AxisBoundaryType abType, const std::vector< double > &edges)
 Convenience constructors - for variable binning.
 ProtoAxis (AxisBoundaryType abType, double minE, double maxE, std::size_t nbins)
 Convenience constructors - for equidistant binning.
 ProtoAxis (AxisBoundaryType abType, std::size_t nbins)
 Placeholder constructor for auto-range binning.
 ProtoAxis (const ProtoAxis &other)
 Custom copy constructor.
 ProtoAxis (ProtoAxis &&)=default
 Move constructor.
 ~ProtoAxis ()=default
const IAxisgetAxis () const
 Return the IAxis representation.
bool isAutorange () const
 check if this is an auto-range binning
ProtoAxisoperator= (const ProtoAxis &other)
 Custom assignment operator.
ProtoAxisoperator= (ProtoAxis &&)=default
 Move assignment operator.
void setRange (double minE, double maxE)
 Set the range, in case of autorange, this will toggle the autorange flag to false.
std::string toString () const
 Dump into a string.

Protected Attributes

bool m_autorange = false
 Indicate if this is a place holder auto-range binning.
std::unique_ptr< IAxism_axis = nullptr
 The axis representation.

Detailed Description

This class is a pure run-time placeholder for the axis definition.

The IAxis allows via the visitor pattern to access the actual axis type which helps to create grid creation code by the compiler as done in the makeGrid helper functions.

In addition to a simple axis definitions, it holds also a description of the axis direction.

Constructor & Destructor Documentation

◆ ProtoAxis() [1/5]

Acts::ProtoAxis::ProtoAxis ( Acts::AxisBoundaryType abType,
const std::vector< double > & edges )

Convenience constructors - for variable binning.

Parameters
abTypethe axis boundary type
edgesthe bin edges (variable binning)

◆ ProtoAxis() [2/5]

Acts::ProtoAxis::ProtoAxis ( AxisBoundaryType abType,
double minE,
double maxE,
std::size_t nbins )

Convenience constructors - for equidistant binning.

Parameters
abTypethe axis boundary type
minEthe lowest edge of the binning
maxEthe highest edge of the binning
nbinsthe number of bins

◆ ProtoAxis() [3/5]

Acts::ProtoAxis::ProtoAxis ( AxisBoundaryType abType,
std::size_t nbins )

Placeholder constructor for auto-range binning.

Parameters
abTypethe axis boundary type
nbinsthe number of bins
Note
that auto-range is only supported for equidistant binning

◆ ProtoAxis() [4/5]

Acts::ProtoAxis::ProtoAxis ( const ProtoAxis & other)

Custom copy constructor.

Parameters
otheris the right hand side ProtoAxis

◆ ProtoAxis() [5/5]

Acts::ProtoAxis::ProtoAxis ( ProtoAxis && )
default

Move constructor.

◆ ~ProtoAxis()

Acts::ProtoAxis::~ProtoAxis ( )
default

Member Function Documentation

◆ getAxis()

const IAxis & Acts::ProtoAxis::getAxis ( ) const

Return the IAxis representation.

Returns
AxisType of this axis

◆ isAutorange()

bool Acts::ProtoAxis::isAutorange ( ) const

check if this is an auto-range binning

Returns
True if this axis uses auto-ranging

◆ operator=() [1/2]

ProtoAxis & Acts::ProtoAxis::operator= ( const ProtoAxis & other)

Custom assignment operator.

Parameters
otheris the right hand side ProtoAxis
Returns
Reference to this ProtoAxis for assignment chaining

◆ operator=() [2/2]

ProtoAxis & Acts::ProtoAxis::operator= ( ProtoAxis && )
default

Move assignment operator.

Returns
Reference to this ProtoAxis for assignment chaining

◆ setRange()

void Acts::ProtoAxis::setRange ( double minE,
double maxE )

Set the range, in case of autorange, this will toggle the autorange flag to false.

Exceptions
anexception if minE > maxE
Note
In case of variable binning, it will clip the bins outside the new range off, i.e. it will potentially change the number of bins.
In case of equidistant binning, it will adapt the bin size, and NOT change the number of bins.
Parameters
minEthe lowest edge of the binning
maxEthe highest edge of the binning

◆ toString()

std::string Acts::ProtoAxis::toString ( ) const

Dump into a string.

Returns
the string representation

Member Data Documentation

◆ m_autorange

bool Acts::ProtoAxis::m_autorange = false
protected

Indicate if this is a place holder auto-range binning.

◆ m_axis

std::unique_ptr<IAxis> Acts::ProtoAxis::m_axis = nullptr
protected

The axis representation.