Logo ROOT   6.14/05
Reference Guide
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ROOT::Experimental::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 403 of file TAxis.hxx.

Public Member Functions

 TAxisEquidistant ()=default
 
 TAxisEquidistant (int nbinsNoOver, double low, double high) noexcept
 Initialize a TAxisEquidistant. More...
 
 TAxisEquidistant (std::string_view title, int nbinsNoOver, double low, double high) noexcept
 Initialize a TAxisEquidistant. More...
 
int FindBin (double x) const noexcept
 Find the bin index for the given coordinate. 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...
 
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...
 
double GetBinTo (int bin) const noexcept
 Get the high bin border for the given bin index. 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 GetMaximum () const noexcept
 Get the high end of the axis range. More...
 
double GetMinimum () const noexcept
 Get the low end of the axis range. More...
 
 operator TAxisConfig () const
 Convert to TAxisConfig. More...
 
- Public Member Functions inherited from ROOT::Experimental::TAxisBase
 TAxisBase (std::string_view title, int nbinsNoOver, bool canGrow) noexcept
 Construct a TAxisBase. More...
 
 TAxisBase (int nbinsNoOver, bool canGrow) noexcept
 Construct a TAxisBase. More...
 
int GetNBins () const noexcept
 Get the number of bins, including under- and overflow. More...
 
int GetNBinsNoOver () const noexcept
 Get the number of bins, excluding under- and overflow. More...
 
int GetNOverflowBins () const noexcept
 Get the number of over- and underflow bins: 0 for growable axes, 2 otherwise. More...
 
int GetOverflowBin () const noexcept
 Get the bin index for the underflow bin (or the next bin outside range if CanGrow()). More...
 
const std::string & GetTitle () const
 
int GetUnderflowBin () const noexcept
 Get the bin index for the underflow bin. More...
 
bool IsOverflowBin (int bin) const noexcept
 Whether the bin index is referencing a bin higher than the axis range. More...
 
bool IsUnderflowBin (int bin) const noexcept
 Whether the bin index is referencing a bin lower 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 bool CanGrow () noexcept
 This axis cannot grow. More...
 

Protected Member Functions

 TAxisEquidistant (std::string_view title, int nbinsNoOver, double low, double high, bool canGrow) noexcept
 Initialize a TAxisEquidistant. More...
 
 TAxisEquidistant (int nbinsNoOver, double low, double high, bool canGrow) noexcept
 Initialize a TAxisEquidistant. More...
 
- Protected Member Functions inherited from ROOT::Experimental::TAxisBase
 TAxisBase ()=default
 Default construct a TAxisBase (for use by derived classes for I/O) More...
 
int AdjustOverflowBinNumber (double 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
 

Static Protected Member Functions

static double GetInvBinWidth (int nbinsNoOver, double lowOrHigh, double highOrLow)
 Determine the inverse bin width. More...
 

Protected Attributes

double fInvBinWidth = 0.
 The inverse of the bin width. More...
 
double fLow = 0.
 The lower limit of the axis. More...
 

Additional Inherited Members

- Public Types inherited from ROOT::Experimental::TAxisBase
enum  EFindStatus { EFindStatus::kCanGrow, EFindStatus::kValid }
 Status of FindBin(x) More...
 
- Static Public Attributes inherited from ROOT::Experimental::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...
 

#include <ROOT/TAxis.hxx>

Inheritance diagram for ROOT::Experimental::TAxisEquidistant:
[legend]

Constructor & Destructor Documentation

◆ TAxisEquidistant() [1/5]

ROOT::Experimental::TAxisEquidistant::TAxisEquidistant ( std::string_view  title,
int  nbinsNoOver,
double  low,
double  high,
bool  canGrow 
)
inlineexplicitprotectednoexcept

Initialize a TAxisEquidistant.

Parameters
[in]title- axis title used for graphics and text representation.
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 425 of file TAxis.hxx.

◆ TAxisEquidistant() [2/5]

ROOT::Experimental::TAxisEquidistant::TAxisEquidistant ( int  nbinsNoOver,
double  low,
double  high,
bool  canGrow 
)
inlineexplicitprotectednoexcept

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 436 of file TAxis.hxx.

◆ TAxisEquidistant() [3/5]

ROOT::Experimental::TAxisEquidistant::TAxisEquidistant ( )
default

◆ TAxisEquidistant() [4/5]

ROOT::Experimental::TAxisEquidistant::TAxisEquidistant ( int  nbinsNoOver,
double  low,
double  high 
)
inlineexplicitnoexcept

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.
canGrow- whether this axis can extend its range.

Definition at line 451 of file TAxis.hxx.

◆ TAxisEquidistant() [5/5]

ROOT::Experimental::TAxisEquidistant::TAxisEquidistant ( std::string_view  title,
int  nbinsNoOver,
double  low,
double  high 
)
inlineexplicitnoexcept

Initialize a TAxisEquidistant.

Parameters
[in]title- axis title used for graphics and text representation.
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 463 of file TAxis.hxx.

Member Function Documentation

◆ CanGrow()

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

This axis cannot grow.

Definition at line 480 of file TAxis.hxx.

◆ FindBin()

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

Find the bin index for the given coordinate.

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

Definition at line 473 of file TAxis.hxx.

◆ GetBinCenter()

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

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.

Definition at line 497 of file TAxis.hxx.

◆ GetBinFrom()

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

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.

Definition at line 502 of file TAxis.hxx.

◆ GetBinIndexForLowEdge()

int ROOT::Experimental::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 25 of file TAxis.cxx.

◆ GetBinTo()

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

Get the high 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.5.

Definition at line 507 of file TAxis.hxx.

◆ GetBinWidth()

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

Get the width of the bins.

Definition at line 489 of file TAxis.hxx.

◆ GetInvBinWidth()

static double ROOT::Experimental::TAxisEquidistant::GetInvBinWidth ( int  nbinsNoOver,
double  lowOrHigh,
double  highOrLow 
)
inlinestaticprotected

Determine the inverse bin width.

Parameters
nbinsNoOver- number of bins without unter-/overflow
lowOrHigh- first axis boundary
lighOrLow- second axis boundary

Definition at line 412 of file TAxis.hxx.

◆ GetInverseBinWidth()

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

Get the inverse of the width of the bins.

Definition at line 492 of file TAxis.hxx.

◆ GetMaximum()

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

Get the high end of the axis range.

Definition at line 486 of file TAxis.hxx.

◆ GetMinimum()

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

Get the low end of the axis range.

Definition at line 483 of file TAxis.hxx.

◆ operator TAxisConfig()

ROOT::Experimental::TAxisEquidistant::operator TAxisConfig ( ) const
inline

Convert to TAxisConfig.

Definition at line 468 of file TAxis.hxx.

Member Data Documentation

◆ fInvBinWidth

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

The inverse of the bin width.

Definition at line 406 of file TAxis.hxx.

◆ fLow

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

The lower limit of the axis.

Definition at line 405 of file TAxis.hxx.

Libraries for ROOT::Experimental::TAxisEquidistant:
[legend]

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