ROOT
6.06/09
Reference Guide
|
An axis with non-equidistant bins (also known as "variable binning").
It is defined by an array of bin borders - one more than the number of (non-overflow-) bins it has! As an example, an axis with two bin needs three bin borders:
This axis cannot grow; the size of new bins would not be well defined.
Public Member Functions | |
TAxisIrregular (const std::vector< double > &binborders) | |
Construct a TAxisIrregular from a vector of bin borders. More... | |
TAxisIrregular (std::vector< double > &&binborders) noexcept | |
Construct a TAxisIrregular from a vector of bin borders. More... | |
int | FindBin (double x) const noexcept |
Find the bin index corresponding to coordinate x. More... | |
double | GetBinCenter (int bin) const noexcept |
Get the bin center of the bin with the given index. More... | |
double | GetBinFrom (int bin) const noexcept |
Get the lower bin border for a given bin index. More... | |
double | GetBinTo (int bin) const noexcept |
Get the higher bin border for a given bin index. More... | |
const std::vector< double > & | GetBinBorders () const noexcept |
Access to the bin borders used by this axis. 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... | |
Static Public Member Functions | |
static constexpr bool | CanGrow () noexcept |
This axis cannot be extended. More... | |
Private Attributes | |
std::vector< double > | fBinBorders |
Bin borders, one more than the number of non-overflow bins. More... | |
Additional Inherited Members | |
Public Types inherited from ROOT::TAxisBase | |
enum | EFindStatus { EFindStatus::kCanGrow, EFindStatus::kValid } |
Status of FindBin(x) 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 |
#include <ROOT/TAxis.h>
|
inline |
Construct a TAxisIrregular from a vector of bin borders.
|
inlinenoexcept |
Construct a TAxisIrregular from a vector of bin borders.
|
inlinestaticnoexcept |
|
inlinenoexcept |
Find the bin index corresponding to coordinate x.
If the coordinate is below the axis range, return 0. If it is above, return N + 1 for an axis with N non-overflow bins.
Definition at line 432 of file TAxis.h.
Referenced by ROOT::TAxisView::FindBin().
|
inlinenoexcept |
|
inlinenoexcept |
Get the bin center of the bin with the given index.
For the bin at index 0 (i.e. the underflow bin), a bin center of std::numeric_limits<double>min()
is returned, i.e. the minimum value that can be held in a double. Similarly, for the bin at index N + 1 (i.e. the overflow bin), a bin center of std::numeric_limits<double>max()
is returned, i.e. the maximum value that can be held in a double.
Definition at line 451 of file TAxis.h.
Referenced by ROOT::TAxisView::GetBinCenter().
|
inlinenoexcept |
Get the lower bin border for a given bin index.
For the bin at index 0 (i.e. the underflow bin), a lower bin border of std::numeric_limits<double>min()
is returned, i.e. the minimum value that can be held in a double.
Definition at line 464 of file TAxis.h.
Referenced by ROOT::TAxisView::GetBinFrom(), and GetBinTo().
|
inlinenoexcept |
Get the higher bin border for a given bin index.
For the bin at index N + 1 (i.e. the overflow bin), a bin border of std::numeric_limits<double>max()
is returned, i.e. the maximum value that can be held in a double.
Definition at line 477 of file TAxis.h.
Referenced by ROOT::TAxisView::GetBinTo().
|
private |
Bin borders, one more than the number of non-overflow bins.
Definition at line 404 of file TAxis.h.
Referenced by GetBinBorders().