ROOT  6.06/09
Reference Guide
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ROOT::TAxisEquidistant Class Reference

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 TAxisGrow for that.

Definition at line 271 of file TAxis.h.

Public Member Functions

 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...
 

Static Public Member Functions

static constexpr bool CanGrow () noexcept
 This axis cannot grow. More...
 

Protected Attributes

double fLow = 0.
 The lower limit of the axis. More...
 
double fInvBinWidth = 0.
 The inverse of the bin width. 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
 
TAxisBaseoperator= (const TAxisBase &)=default
 
TAxisBaseoperator= (TAxisBase &&)=default
 

#include <ROOT/TAxis.h>

+ Inheritance diagram for ROOT::TAxisEquidistant:
+ Collaboration diagram for ROOT::TAxisEquidistant:

Constructor & Destructor Documentation

ROOT::TAxisEquidistant::TAxisEquidistant ( )
default
constexpr ROOT::TAxisEquidistant::TAxisEquidistant ( int  nbins,
double  low,
double  high 
)
inlinenoexcept

Initialize a TAxisEquidistant.

Parameters
nbins- 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.

Definition at line 286 of file TAxis.h.

Member Function Documentation

static constexpr bool ROOT::TAxisEquidistant::CanGrow ( )
inlinestaticnoexcept

This axis cannot grow.

Definition at line 299 of file TAxis.h.

constexpr int ROOT::TAxisEquidistant::FindBin ( double  x) const
inlinenoexcept

Find the bin index for the given coordinate.

Note
Passing a bin border coordinates can either return the bin above or below the bin border. I.e. don't do that for reliable results!

Definition at line 293 of file TAxis.h.

Referenced by ROOT::TAxisView::FindBin().

double ROOT::TAxisEquidistant::GetBinCenter ( int  bin) const
inlinenoexcept

Get the bin center for the given bin index.

Definition at line 314 of file TAxis.h.

Referenced by ROOT::TAxisView::GetBinCenter().

double ROOT::TAxisEquidistant::GetBinFrom ( int  bin) const
inlinenoexcept

Get the low bin border for the given bin index.

Definition at line 319 of file TAxis.h.

Referenced by ROOT::TAxisView::GetBinFrom(), and GetBinTo().

int ROOT::TAxisEquidistant::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.

If it's not a bin edge, return -1.

Definition at line 24 of file TAxis.cxx.

double ROOT::TAxisEquidistant::GetBinTo ( int  bin) const
inlinenoexcept

Get the high bin border for the given bin index.

Definition at line 324 of file TAxis.h.

Referenced by ROOT::TAxisView::GetBinTo().

double ROOT::TAxisEquidistant::GetBinWidth ( ) const
inlinenoexcept

Get the width of the bins.

Definition at line 308 of file TAxis.h.

double ROOT::TAxisEquidistant::GetInverseBinWidth ( ) const
inlinenoexcept

Get the inverse of the width of the bins.

Definition at line 311 of file TAxis.h.

double ROOT::TAxisEquidistant::GetMaximum ( ) const
inlinenoexcept

Get the high end of the axis range.

Definition at line 305 of file TAxis.h.

Referenced by ROOT::TAxisConfig::TAxisConfig().

double ROOT::TAxisEquidistant::GetMinimum ( ) const
inlinenoexcept

Get the low end of the axis range.

Definition at line 302 of file TAxis.h.

Referenced by ROOT::TAxisConfig::TAxisConfig().

Member Data Documentation

double ROOT::TAxisEquidistant::fInvBinWidth = 0.
protected

The inverse of the bin width.

Definition at line 274 of file TAxis.h.

Referenced by GetBinCenter(), GetBinFrom(), GetBinWidth(), and GetInverseBinWidth().

double ROOT::TAxisEquidistant::fLow = 0.
protected

The lower limit of the axis.

Definition at line 273 of file TAxis.h.

Referenced by FindBin(), and GetMinimum().


The documentation for this class was generated from the following files: