Axis with equidistant bin borders.
Defined by lower l and upper u limit and the number of bins n. All bins have the same width (u-l)/n.
This axis cannot grow; use RAxisGrow
for that.
Public Member Functions | |
RAxisEquidistant ()=default | |
RAxisEquidistant (int nbinsNoOver, double low, double high) noexcept | |
Initialize a RAxisEquidistant. | |
RAxisEquidistant (std::string_view title, int nbinsNoOver, double low, double high) noexcept | |
Initialize a RAxisEquidistant. | |
bool | CanGrow () const noexcept override |
This axis cannot grow. | |
int | FindBin (double x) const noexcept final |
Find the adjusted bin index (returning kUnderflowBin for underflow and kOverflowBin for overflow) for the given coordinate. | |
double | GetBinCenter (int bin) const final |
Get the bin center for the given bin index. | |
double | GetBinFrom (int bin) const final |
Get the low bin border for the given bin index. | |
int | GetBinIndexForLowEdge (double x) const noexcept final |
If the coordinate x is within 10 ULPs of a bin low edge coordinate, return the bin for which this is a low edge. | |
double | GetBinWidth () const noexcept |
Get the width of the bins. | |
double | GetInverseBinWidth () const noexcept |
Get the inverse of the width of the bins. | |
int | GetNBinsNoOver () const noexcept final |
Get the number of bins, excluding under- and overflow. | |
operator RAxisConfig () const | |
Convert to RAxisConfig. | |
Public Member Functions inherited from ROOT::Experimental::RAxisBase | |
double | GetBinTo (int bin) const |
Get the high bin border ("right edge") for the given bin index. | |
int | GetFirstBin () const noexcept |
Get the bin index for the first bin of the axis. | |
int | GetLastBin () const noexcept |
Get the bin index for the last bin of the axis. | |
double | GetMaximum () const |
Get the high end of the axis range. | |
double | GetMinimum () const |
Get the low end of the axis range. | |
int | GetNBins () const noexcept |
Get the number of bins, including under- and overflow. | |
int | GetNOverflowBins () const noexcept |
Get the number of over- and underflow bins: 0 for growable axes, 2 otherwise. | |
int | GetOverflowBin () const noexcept |
Get the bin index for the overflow bin (or kInvalidBin if CanGrow()). | |
const std::string & | GetTitle () const |
Get the axis's title. | |
int | GetUnderflowBin () const noexcept |
Get the bin index for the underflow bin (or kInvalidBin if CanGrow()). | |
bool | HasSameBinningAs (const RAxisBase &other) const |
Check if two axes use the same binning convention, i.e. | |
const_iterator | begin () const noexcept |
Get a const_iterator pointing to the first regular bin. | |
const_iterator | end () const noexcept |
Get a const_iterator pointing beyond the last regular bin. | |
Protected Member Functions | |
double | FindBinRaw (double x) const noexcept |
Find the raw bin index (not adjusted) for the given coordinate. | |
bool | HasSameBinBordersAs (const RAxisBase &other) const override |
See RAxisBase::HasSameBinBordersAs. | |
Protected Member Functions inherited from ROOT::Experimental::RAxisBase | |
RAxisBase () noexcept(noexcept(std::string()))=default | |
Default construct a RAxisBase (for use by derived classes for I/O) | |
RAxisBase (std::string_view title) noexcept | |
Construct a RAxisBase. | |
virtual | ~RAxisBase () |
Virtual destructor needed in this inheritance-based design. | |
int | AdjustOverflowBinNumber (double rawbin) const |
Given rawbin (<0 for underflow, >=GetNBinsNoOver() for overflow), determine the bin number taking into account how over/underflow should be handled. | |
RAxisBase (const RAxisBase &)=default | |
RAxisBase (RAxisBase &&)=default | |
RAxisBase & | operator= (const RAxisBase &)=default |
RAxisBase & | operator= (RAxisBase &&)=default |
Static Protected Member Functions | |
static double | GetInvBinWidth (int nbinsNoOver, double lowOrHigh, double highOrLow) |
Determine the inverse bin width. | |
Protected Attributes | |
double | fInvBinWidth = 0. |
The inverse of the bin width. | |
double | fLow = 0. |
The lower limit of the axis. | |
unsigned int | fNBinsNoOver |
Number of bins excluding under- and overflow. | |
Additional Inherited Members | |
Static Public Attributes inherited from ROOT::Experimental::RAxisBase | |
static constexpr const int | kInvalidBin = 0 |
Special bin index returned to signify that no bin matches a request. | |
static constexpr const int | kOverflowBin = -2 |
Index of the overflow bin, if any. | |
static constexpr const int | kUnderflowBin = -1 |
Index of the underflow bin, if any. | |
#include <ROOT/RAxis.hxx>
|
default |
|
inlineexplicitnoexcept |
Initialize a RAxisEquidistant.
[in] | title | - axis title used for graphics and text representation. |
nbinsNoOver | - number of bins in the axis, excluding under- and overflow bins. | |
low | - the low axis range. Any coordinate below that is considered as underflow. The first bin's lower edge is at this value. | |
high | - the high axis range. Any coordinate above that is considered as overflow. The last bin's higher edge is at this value. |
|
inlineexplicitnoexcept |
Initialize a RAxisEquidistant.
nbinsNoOver | - number of bins in the axis, excluding under- and overflow bins. |
low | - the low axis range. Any coordinate below that is considered as underflow. The first bin's lower edge is at this value. |
high | - the high axis range. Any coordinate above that is considered as overflow. The last bin's higher edge is at this value. |
|
inlineoverridevirtualnoexcept |
This axis cannot grow.
Implements ROOT::Experimental::RAxisBase.
Reimplemented in ROOT::Experimental::RAxisGrow.
Find the adjusted bin index (returning kUnderflowBin
for underflow and kOverflowBin
for overflow) for the given coordinate.
Implements ROOT::Experimental::RAxisBase.
Get the bin center for the given bin index.
For the bin == 1 (the first bin) of 2 bins for an axis (0., 1.), this returns 0.25. The result of this method on an overflow or underflow bin is unspecified.
Implements ROOT::Experimental::RAxisBase.
Get the low bin border for the given bin index.
For the bin == 1 (the first bin) of 2 bins for an axis (0., 1.), this returns 0. The result of this method on an underflow bin is unspecified.
Implements ROOT::Experimental::RAxisBase.
|
finalvirtualnoexcept |
If the coordinate x
is within 10 ULPs of a bin low edge coordinate, return the bin for which this is a low edge.
If it's not a bin edge, return kInvalidBin
.
Implements ROOT::Experimental::RAxisBase.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinefinalvirtualnoexcept |
Get the number of bins, excluding under- and overflow.
Implements ROOT::Experimental::RAxisBase.
|
overrideprotectedvirtual |
See RAxisBase::HasSameBinBordersAs.
Reimplemented from ROOT::Experimental::RAxisBase.
|
inline |
Convert to RAxisConfig.
|
protected |
|
protected |
|
protected |