ROOT  6.06/09
Reference Guide
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
ROOT::TAxisBase Class Reference

Histogram axis base class.

Keeps track of the number of bins and overflow handling. Offers bin iteration.

Bin indices are starting from 0 for the underflow bin (representing values that are lower than the axis range). Starting at index 1 are the actual bins of the axis, up to N + 1 for an axis with N bins. Index N + 2 is the overflow bin for values larger than the axis range.

Definition at line 37 of file TAxis.h.

Classes

class  const_iterator
 Random const_iterator through bins. More...
 

Public Types

enum  EFindStatus { EFindStatus::kCanGrow, EFindStatus::kValid }
 Status of FindBin(x) More...
 

Public Member Functions

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...
 
Iterator interfaces
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 Attributes

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

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...
 
Inaccessible copy, assignment

The copy and move constructors and assignment operators are protected to prevent slicing.

 TAxisBase (const TAxisBase &)=default
 
 TAxisBase (TAxisBase &&)=default
 
TAxisBaseoperator= (const TAxisBase &)=default
 
TAxisBaseoperator= (TAxisBase &&)=default
 

Private Attributes

unsigned int fNBinsNoOver
 Number of bins excluding under- and overflow. More...
 

#include <ROOT/TAxis.h>

+ Inheritance diagram for ROOT::TAxisBase:

Member Enumeration Documentation

Status of FindBin(x)

Enumerator
kCanGrow 

Coordinate could fit after growing the axis.

kValid 

The returned bin index is valid.

Definition at line 40 of file TAxis.h.

Constructor & Destructor Documentation

ROOT::TAxisBase::TAxisBase ( const TAxisBase )
protecteddefault
ROOT::TAxisBase::TAxisBase ( TAxisBase &&  )
protecteddefault
constexpr ROOT::TAxisBase::TAxisBase ( int  nbins)
inlinenoexcept

Construct a TAxisBase.

Parameters
[in]nbins- number of bins in this axis, excluding under- and overflow bins.

Definition at line 170 of file TAxis.h.

Member Function Documentation

constexpr int ROOT::TAxisBase::AdjustOverflowBinNumber ( int  rawbin) const
inlineprotected

Given rawbin (<0 for underflow, >= GetNBinsNoOver() for overflow), determine the actual bin number taking into account how over/underflow should be handled.

Parameters
[out]statusresult status of the bin determination.
Returns
Returns the bin number adjusted for potential over- and underflow bins. Returns kIgnoreBin if the axis cannot handle the over- / underflow, in which case status will tell how to deal with this overflow.

Definition at line 64 of file TAxis.h.

Referenced by ROOT::TAxisEquidistant::FindBin(), and ROOT::TAxisIrregular::FindBin().

const_iterator ROOT::TAxisBase::begin ( ) const
inlinenoexcept

Get a const_iterator pointing to the first non-underflow bin.

Definition at line 203 of file TAxis.h.

const_iterator ROOT::TAxisBase::begin_with_underflow ( ) const
inlinenoexcept

Get a const_iterator pointing the underflow bin.

Definition at line 206 of file TAxis.h.

const_iterator ROOT::TAxisBase::end ( ) const
inlinenoexcept

Get a const_iterator pointing right beyond the last non-overflow bin (i.e.

pointing to the overflow bin).

Definition at line 210 of file TAxis.h.

const_iterator ROOT::TAxisBase::end_with_overflow ( ) const
inlinenoexcept

Get a const_iterator pointing right beyond the overflow bin.

Definition at line 215 of file TAxis.h.

constexpr int ROOT::TAxisBase::GetNBins ( ) const
inlinenoexcept

Get the number of bins, including under- and overflow.

Definition at line 179 of file TAxis.h.

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

constexpr int ROOT::TAxisBase::GetNBinsNoOver ( ) const
inlinenoexcept

Get the number of bins, excluding under- and overflow.

Definition at line 174 of file TAxis.h.

Referenced by ROOT::TAxisEquidistant::GetMaximum(), and GetOverflowBin().

constexpr int ROOT::TAxisBase::GetOverflowBin ( ) const
inlinenoexcept

Get the bin index for the underflow bin.

Definition at line 187 of file TAxis.h.

Referenced by end(), end_with_overflow(), and IsOverflowBin().

constexpr int ROOT::TAxisBase::GetUnderflowBin ( ) const
inlinenoexcept

Get the bin index for the underflow bin.

Definition at line 184 of file TAxis.h.

Referenced by IsUnderflowBin().

constexpr bool ROOT::TAxisBase::IsOverflowBin ( int  bin) const
inlinenoexcept

Whether the bin index is referencing a bin higher than the axis range.

Definition at line 195 of file TAxis.h.

Referenced by ROOT::TAxisIrregular::GetBinCenter(), and ROOT::TAxisIrregular::GetBinTo().

constexpr bool ROOT::TAxisBase::IsUnderflowBin ( int  bin) const
inlinenoexcept

Whether the bin index is referencing a bin lower than the axis range.

Definition at line 190 of file TAxis.h.

Referenced by ROOT::TAxisIrregular::GetBinCenter(), and ROOT::TAxisIrregular::GetBinFrom().

TAxisBase& ROOT::TAxisBase::operator= ( const TAxisBase )
protecteddefault
TAxisBase& ROOT::TAxisBase::operator= ( TAxisBase &&  )
protecteddefault

Member Data Documentation

unsigned int ROOT::TAxisBase::fNBinsNoOver
private

Number of bins excluding under- and overflow.

Definition at line 221 of file TAxis.h.

Referenced by GetNBins().

constexpr const int ROOT::TAxisBase::kIgnoreBin = -1
static

FindBin() returns this bin to signal that the bin number is invalid.

Definition at line 161 of file TAxis.h.

constexpr const int ROOT::TAxisBase::kNOverflowBins = {0, 1, 1, 2}
static

Extra bins for each EAxisOverflow value.

Definition at line 164 of file TAxis.h.


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