An axis with variable bins defined by their edges.
For example, the following creates an axis with 3 log-spaced bins:
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 39 of file RVariableBinAxis.hxx.
Public Member Functions | |
RVariableBinAxis (std::vector< double > binEdges, bool enableFlowBins=true) | |
Construct an axis object with variable bins. | |
RLinearizedIndex | ComputeLinearizedIndex (double x) const |
Compute the linarized index for a single argument. | |
const std::vector< double > & | GetBinEdges () const |
RBinIndexRange | GetFullRange () const |
Get the full range of all bins. | |
RLinearizedIndex | GetLinearizedIndex (RBinIndex index) const |
Get the linearized index for an RBinIndex. | |
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 | |
std::vector< double > | fBinEdges |
The (ordered) edges of the normal bins. | |
bool | fEnableFlowBins |
Whether underflow and overflow bins are enabled. | |
Friends | |
bool | operator== (const RVariableBinAxis &lhs, const RVariableBinAxis &rhs) |
#include <ROOT/RVariableBinAxis.hxx>
|
inlineexplicit |
Construct an axis object with variable bins.
[in] | binEdges | the (ordered) edges of the normal bins, must define at least one bin (i.e. size >= 2) |
[in] | enableFlowBins | whether to enable underflow and overflow bins |
Definition at line 50 of file RVariableBinAxis.hxx.
|
inline |
Compute the linarized index for a single argument.
The normal bins have indices \(0\) to \(fBinEdges.size() - 2\), the underflow bin has index \(fBinEdges.size() - 1\), and the overflow bin has index \(fBinEdges.size()\). If the argument is outside all bin edges and the flow bins are disabled, the return value is invalid.
[in] | x | the argument |
Definition at line 83 of file RVariableBinAxis.hxx.
Definition at line 67 of file RVariableBinAxis.hxx.
|
inline |
Get the full range of all bins.
This includes underflow and overflow bins, if enabled.
Definition at line 163 of file RVariableBinAxis.hxx.
|
inline |
Get the linearized index for an RBinIndex.
The normal bins have indices \(0\) to \(fBinEdges.size() - 2\), the underflow bin has index \(fBinEdges.size() - 1\), and the overflow bin has index \(fBinEdges.size()\).
[in] | index | the RBinIndex |
Definition at line 111 of file RVariableBinAxis.hxx.
|
inline |
Definition at line 65 of file RVariableBinAxis.hxx.
|
inline |
Get the range of all normal bins.
Definition at line 128 of file RVariableBinAxis.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 138 of file RVariableBinAxis.hxx.
|
inline |
Definition at line 66 of file RVariableBinAxis.hxx.
|
inline |
Definition at line 68 of file RVariableBinAxis.hxx.
|
inline |
ROOT Streamer function to throw when trying to store an object of this class.
Definition at line 170 of file RVariableBinAxis.hxx.
|
friend |
Definition at line 70 of file RVariableBinAxis.hxx.
|
private |
The (ordered) edges of the normal bins.
Definition at line 41 of file RVariableBinAxis.hxx.
|
private |
Whether underflow and overflow bins are enabled.
Definition at line 43 of file RVariableBinAxis.hxx.