A regular axis with equidistant bins in the interval \([fLow, fHigh)\).
For example, the following creates a regular axis with 10 normal bins between 5 and 15:
It is possible to disable underflow and overflow bins by passing enableFlowBins = false
. In that case, arguments outside the axis will be silently discarded.
Definition at line 36 of file RRegularAxis.hxx.
Public Member Functions | |
RRegularAxis (std::size_t nNormalBins, double low, double high, bool enableFlowBins=true) | |
Construct a regular axis object. | |
RLinearizedIndex | ComputeLinearizedIndex (double x) const |
Compute the linarized index for a single argument. | |
RBinIndexRange | GetFullRange () const |
Get the full range of all bins. | |
double | GetHigh () const |
RLinearizedIndex | GetLinearizedIndex (RBinIndex index) const |
Get the linearized index for an RBinIndex. | |
double | GetLow () const |
std::size_t | GetNNormalBins () const |
RBinIndexRange | GetNormalRange () const |
Get the range of all normal bins. | |
RBinIndexRange | GetNormalRange (RBinIndex begin, RBinIndex end) const |
Get a range of normal bins. | |
std::size_t | GetTotalNBins () const |
bool | HasFlowBins () const |
void | Streamer (TBuffer &) |
ROOT Streamer function to throw when trying to store an object of this class. | |
Private Attributes | |
bool | fEnableFlowBins |
Whether underflow and overflow bins are enabled. | |
double | fHigh |
The upper end of the axis interval. | |
double | fInvBinWidth |
The cached inverse of the bin width to speed up ComputeLinearizedIndex. | |
double | fLow |
The lower end of the axis interval. | |
std::size_t | fNNormalBins |
The number of normal bins. | |
Friends | |
bool | operator== (const RRegularAxis &lhs, const RRegularAxis &rhs) |
#include <ROOT/RRegularAxis.hxx>
|
inline |
Construct a regular axis object.
[in] | nNormalBins | the number of normal bins, must be > 0 |
[in] | low | the lower end of the axis interval (inclusive) |
[in] | high | the upper end of the axis interval (exclusive), must be > low |
[in] | enableFlowBins | whether to enable underflow and overflow bins |
Definition at line 55 of file RRegularAxis.hxx.
|
inline |
Compute the linarized index for a single argument.
The normal bins have indices \(0\) to \(fNNormalBins - 1\), the underflow bin has index \(fNNormalBins\), and the overflow bin has index \(fNNormalBins + 1\). If the argument is outside the interval \([fLow, fHigh)\) and the flow bins are disabled, the return value is invalid.
[in] | x | the argument |
Definition at line 88 of file RRegularAxis.hxx.
|
inline |
Get the full range of all bins.
This includes underflow and overflow bins, if enabled.
Definition at line 162 of file RRegularAxis.hxx.
|
inline |
Definition at line 71 of file RRegularAxis.hxx.
|
inline |
Get the linearized index for an RBinIndex.
The normal bins have indices \(0\) to \(fNNormalBins - 1\), the underflow bin has index \(fNNormalBins\), and the overflow bin has index \(fNNormalBins + 1\).
[in] | index | the RBinIndex |
Definition at line 110 of file RRegularAxis.hxx.
|
inline |
Definition at line 70 of file RRegularAxis.hxx.
|
inline |
Definition at line 68 of file RRegularAxis.hxx.
|
inline |
Get the range of all normal bins.
Definition at line 127 of file RRegularAxis.hxx.
|
inline |
Get a range of normal bins.
[in] | begin | the begin of the bin index range (inclusive), must be normal |
[in] | end | the end of the bin index range (exclusive), must be normal and >= begin |
Definition at line 137 of file RRegularAxis.hxx.
|
inline |
Definition at line 69 of file RRegularAxis.hxx.
|
inline |
Definition at line 72 of file RRegularAxis.hxx.
|
inline |
ROOT Streamer function to throw when trying to store an object of this class.
Definition at line 169 of file RRegularAxis.hxx.
|
friend |
Definition at line 74 of file RRegularAxis.hxx.
|
private |
Whether underflow and overflow bins are enabled.
Definition at line 46 of file RRegularAxis.hxx.
|
private |
The upper end of the axis interval.
Definition at line 42 of file RRegularAxis.hxx.
|
private |
The cached inverse of the bin width to speed up ComputeLinearizedIndex.
Definition at line 44 of file RRegularAxis.hxx.
|
private |
The lower end of the axis interval.
Definition at line 40 of file RRegularAxis.hxx.
|
private |
The number of normal bins.
Definition at line 38 of file RRegularAxis.hxx.