ROOT
6.06/09
Reference Guide
|
An axis that can extend its range, keeping the number of its bins unchanged.
The axis is constructed with an initial range. Apart from its ability to grow, this axis behaves like a TAxisEquidistant.
Public Member Functions | |
constexpr | TAxisGrow (int nbins, double low, double high) noexcept |
Initialize a TAxisGrow. More... | |
int | Grow (int toBin) |
Grow this axis to make the "virtual bin" toBin in-range. More... | |
constexpr bool | CanGrow () const |
This axis kind can increase its range. More... | |
Public Member Functions inherited from ROOT::TAxisEquidistant | |
TAxisEquidistant ()=default | |
constexpr | TAxisEquidistant (int nbins, double low, double high) noexcept |
Initialize a TAxisEquidistant. More... | |
constexpr int | FindBin (double x) const noexcept |
Find the bin index for the given coordinate. More... | |
double | GetMinimum () const noexcept |
Get the low end of the axis range. More... | |
double | GetMaximum () const noexcept |
Get the high end of the axis range. More... | |
double | GetBinWidth () const noexcept |
Get the width of the bins. More... | |
double | GetInverseBinWidth () const noexcept |
Get the inverse of the width of the bins. More... | |
double | GetBinCenter (int bin) const noexcept |
Get the bin center for the given bin index. More... | |
double | GetBinFrom (int bin) const noexcept |
Get the low bin border for the given bin index. More... | |
double | GetBinTo (int bin) const noexcept |
Get the high bin border for the given bin index. More... | |
int | GetBinIndexForLowEdge (double x) const noexcept |
If the coordinate x is a bin low edge (within 1E-6 of the coordinate), return the bin for which this is a low edge. More... | |
Public Member Functions inherited from ROOT::TAxisBase | |
constexpr | TAxisBase (int nbins) noexcept |
Construct a TAxisBase. More... | |
constexpr int | GetNBinsNoOver () const noexcept |
Get the number of bins, excluding under- and overflow. More... | |
constexpr int | GetNBins () const noexcept |
Get the number of bins, including under- and overflow. More... | |
constexpr int | GetUnderflowBin () const noexcept |
Get the bin index for the underflow bin. More... | |
constexpr int | GetOverflowBin () const noexcept |
Get the bin index for the underflow bin. More... | |
constexpr bool | IsUnderflowBin (int bin) const noexcept |
Whether the bin index is referencing a bin lower than the axis range. More... | |
constexpr bool | IsOverflowBin (int bin) const noexcept |
Whether the bin index is referencing a bin higher than the axis range. More... | |
const_iterator | begin () const noexcept |
Get a const_iterator pointing to the first non-underflow bin. More... | |
const_iterator | begin_with_underflow () const noexcept |
Get a const_iterator pointing the underflow bin. More... | |
const_iterator | end () const noexcept |
Get a const_iterator pointing right beyond the last non-overflow bin (i.e. More... | |
const_iterator | end_with_overflow () const noexcept |
Get a const_iterator pointing right beyond the overflow bin. More... | |
Additional Inherited Members | |
Public Types inherited from ROOT::TAxisBase | |
enum | EFindStatus { EFindStatus::kCanGrow, EFindStatus::kValid } |
Status of FindBin(x) More... | |
Static Public Member Functions inherited from ROOT::TAxisEquidistant | |
static constexpr bool | CanGrow () noexcept |
This axis cannot grow. More... | |
Static Public Attributes inherited from ROOT::TAxisBase | |
static constexpr const int | kIgnoreBin = -1 |
FindBin() returns this bin to signal that the bin number is invalid. More... | |
static constexpr const int | kNOverflowBins [4] = {0, 1, 1, 2} |
Extra bins for each EAxisOverflow value. More... | |
Protected Member Functions inherited from ROOT::TAxisBase | |
constexpr int | AdjustOverflowBinNumber (int rawbin) const |
Given rawbin (<0 for underflow, >= GetNBinsNoOver() for overflow), determine the actual bin number taking into account how over/underflow should be handled. More... | |
TAxisBase (const TAxisBase &)=default | |
TAxisBase (TAxisBase &&)=default | |
TAxisBase & | operator= (const TAxisBase &)=default |
TAxisBase & | operator= (TAxisBase &&)=default |
Protected Attributes inherited from ROOT::TAxisEquidistant | |
double | fLow = 0. |
The lower limit of the axis. More... | |
double | fInvBinWidth = 0. |
The inverse of the bin width. More... | |
#include <ROOT/TAxis.h>
Initialize a TAxisGrow.
nbins | - number of bins in the axis, excluding under- and overflow bins. This value is fixed over the lifetime of the object. |
low | - the initial value for the low axis range. Any coordinate below that is considered as underflow. To trigger the growing of the axis call Grow(). |
high | - the initial value for the high axis range. Any coordinate above that is considered as overflow. To trigger the growing of the axis call Grow() |
|
inline |
int ROOT::TAxisGrow::Grow | ( | int | toBin | ) |
Grow this axis to make the "virtual bin" toBin in-range.
This keeps the non-affected axis limit unchanged, and extends the other axis limit such that a number of consecutive bins are merged.
Example, assuming an initial TAxisGrow with 10 bins from 0. to 1.:
Grow(0)
: that (virtual) bin spans from -0.1 to 0. To include it in the axis range, the lower limit must be shifted. The minimal number of bins that can be merged is 2, thus the new axis will span from -1. to 1.Grow(-1)
: that (virtual) bin spans from -0.2 to 0.1. To include it in the axis range, the lower limit must be shifted. The minimal number of bins that can be merged is 2, thus the new axis will span from -1. to 1.Grow(50)
: that (virtual) bin spans from 4.9 to 5.0. To include it in the axis range, the higher limit must be shifted. Five bins need to be merged, making the new axis range 0. to 5.0.toBin | - the "virtual" bin number, as if the axis had an infinite number of bins with the current bin width. For instance, for an axis with ten bins in the range 0. to 1., the coordinate 2.05 has the virtual bin index 20. |