Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::RRegularAxis Class Referencefinal

A regular axis with equidistant bins in the interval \([fLow, fHigh)\).

For example, the following creates a regular axis with 10 normal bins between 5 and 15:

A regular axis with equidistant bins in the interval .

It is possible to disable underflow and overflow bins by passing enableFlowBins = false. In that case, arguments outside the axis will be silently discarded.

Warning
This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

Definition at line 36 of file RRegularAxis.hxx.

Public Member Functions

 RRegularAxis (std::size_t nNormalBins, double low, double high, bool enableFlowBins=true)
 Construct a regular axis object.
 
RLinearizedIndex ComputeLinearizedIndex (double x) const
 Compute the linarized index for a single argument.
 
RBinIndexRange GetFullRange () const
 Get the full range of all bins.
 
double GetHigh () const
 
RLinearizedIndex GetLinearizedIndex (RBinIndex index) const
 Get the linearized index for an RBinIndex.
 
double GetLow () const
 
std::size_t GetNNormalBins () const
 
RBinIndexRange GetNormalRange () const
 Get the range of all normal bins.
 
RBinIndexRange GetNormalRange (RBinIndex begin, RBinIndex end) const
 Get a range of normal bins.
 
std::size_t GetTotalNBins () const
 
bool HasFlowBins () const
 
void Streamer (TBuffer &)
 ROOT Streamer function to throw when trying to store an object of this class.
 

Private Attributes

bool fEnableFlowBins
 Whether underflow and overflow bins are enabled.
 
double fHigh
 The upper end of the axis interval.
 
double fInvBinWidth
 The cached inverse of the bin width to speed up ComputeLinearizedIndex.
 
double fLow
 The lower end of the axis interval.
 
std::size_t fNNormalBins
 The number of normal bins.
 

Friends

bool operator== (const RRegularAxis &lhs, const RRegularAxis &rhs)
 

#include <ROOT/RRegularAxis.hxx>

Constructor & Destructor Documentation

◆ RRegularAxis()

ROOT::Experimental::RRegularAxis::RRegularAxis ( std::size_t nNormalBins,
double low,
double high,
bool enableFlowBins = true )
inline

Construct a regular axis object.

Parameters
[in]nNormalBinsthe number of normal bins, must be > 0
[in]lowthe lower end of the axis interval (inclusive)
[in]highthe upper end of the axis interval (exclusive), must be > low
[in]enableFlowBinswhether to enable underflow and overflow bins

Definition at line 55 of file RRegularAxis.hxx.

Member Function Documentation

◆ ComputeLinearizedIndex()

RLinearizedIndex ROOT::Experimental::RRegularAxis::ComputeLinearizedIndex ( double x) const
inline

Compute the linarized index for a single argument.

The normal bins have indices \(0\) to \(fNNormalBins - 1\), the underflow bin has index \(fNNormalBins\), and the overflow bin has index \(fNNormalBins + 1\). If the argument is outside the interval \([fLow, fHigh)\) and the flow bins are disabled, the return value is invalid.

Parameters
[in]xthe argument
Returns
the linearized index that may be invalid

Definition at line 88 of file RRegularAxis.hxx.

◆ GetFullRange()

RBinIndexRange ROOT::Experimental::RRegularAxis::GetFullRange ( ) const
inline

Get the full range of all bins.

This includes underflow and overflow bins, if enabled.

Returns
the bin index range of all bins

Definition at line 162 of file RRegularAxis.hxx.

◆ GetHigh()

double ROOT::Experimental::RRegularAxis::GetHigh ( ) const
inline

Definition at line 71 of file RRegularAxis.hxx.

◆ GetLinearizedIndex()

RLinearizedIndex ROOT::Experimental::RRegularAxis::GetLinearizedIndex ( RBinIndex index) const
inline

Get the linearized index for an RBinIndex.

The normal bins have indices \(0\) to \(fNNormalBins - 1\), the underflow bin has index \(fNNormalBins\), and the overflow bin has index \(fNNormalBins + 1\).

Parameters
[in]indexthe RBinIndex
Returns
the linearized index that may be invalid

Definition at line 110 of file RRegularAxis.hxx.

◆ GetLow()

double ROOT::Experimental::RRegularAxis::GetLow ( ) const
inline

Definition at line 70 of file RRegularAxis.hxx.

◆ GetNNormalBins()

std::size_t ROOT::Experimental::RRegularAxis::GetNNormalBins ( ) const
inline

Definition at line 68 of file RRegularAxis.hxx.

◆ GetNormalRange() [1/2]

RBinIndexRange ROOT::Experimental::RRegularAxis::GetNormalRange ( ) const
inline

Get the range of all normal bins.

Returns
the bin index range from the first to the last normal bin, inclusive

Definition at line 127 of file RRegularAxis.hxx.

◆ GetNormalRange() [2/2]

RBinIndexRange ROOT::Experimental::RRegularAxis::GetNormalRange ( RBinIndex begin,
RBinIndex end ) const
inline

Get a range of normal bins.

Parameters
[in]beginthe begin of the bin index range (inclusive), must be normal
[in]endthe end of the bin index range (exclusive), must be normal and >= begin
Returns
a bin index range \([begin, end)\)

Definition at line 137 of file RRegularAxis.hxx.

◆ GetTotalNBins()

std::size_t ROOT::Experimental::RRegularAxis::GetTotalNBins ( ) const
inline

Definition at line 69 of file RRegularAxis.hxx.

◆ HasFlowBins()

bool ROOT::Experimental::RRegularAxis::HasFlowBins ( ) const
inline

Definition at line 72 of file RRegularAxis.hxx.

◆ Streamer()

void ROOT::Experimental::RRegularAxis::Streamer ( TBuffer & )
inline

ROOT Streamer function to throw when trying to store an object of this class.

Definition at line 169 of file RRegularAxis.hxx.

Friends And Related Symbol Documentation

◆ operator==

bool operator== ( const RRegularAxis & lhs,
const RRegularAxis & rhs )
friend

Definition at line 74 of file RRegularAxis.hxx.

Member Data Documentation

◆ fEnableFlowBins

bool ROOT::Experimental::RRegularAxis::fEnableFlowBins
private

Whether underflow and overflow bins are enabled.

Definition at line 46 of file RRegularAxis.hxx.

◆ fHigh

double ROOT::Experimental::RRegularAxis::fHigh
private

The upper end of the axis interval.

Definition at line 42 of file RRegularAxis.hxx.

◆ fInvBinWidth

double ROOT::Experimental::RRegularAxis::fInvBinWidth
private

The cached inverse of the bin width to speed up ComputeLinearizedIndex.

Definition at line 44 of file RRegularAxis.hxx.

◆ fLow

double ROOT::Experimental::RRegularAxis::fLow
private

The lower end of the axis interval.

Definition at line 40 of file RRegularAxis.hxx.

◆ fNNormalBins

std::size_t ROOT::Experimental::RRegularAxis::fNNormalBins
private

The number of normal bins.

Definition at line 38 of file RRegularAxis.hxx.

Libraries for ROOT::Experimental::RRegularAxis:

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