Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Detail::RHistImplBase< DATA > Class Template Referenceabstract

template<class DATA>
class ROOT::Experimental::Detail::RHistImplBase< DATA >

Interface class for RHistImpl.

RHistImpl is templated for a specific configuration of axes. To enable access through RHist, RHistImpl inherits from RHistImplBase, exposing only dimension (DIMENSION) and bin type (PRECISION).

Definition at line 152 of file RHistImpl.hxx.

Public Types

using BinArray_t = std::array< int, DATA::GetNDim()>
 Type of the local per-axis bin indices.
 
using CoordArray_t = Hist::CoordArray_t< DATA::GetNDim()>
 Type of the coordinates.
 
using FillFunc_t = void(RHistImplBase::*)(const CoordArray_t &x, Weight_t w)
 Type of the Fill(x, w) function.
 
using Stat_t = DATA
 Type of the statistics (bin content, uncertainties etc).
 
using Weight_t = typename DATA::Weight_t
 Type of the bin content (and thus weights).
 
- Public Types inherited from ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>
using AxisIterRange_t = Hist::AxisIterRange_t< DIMENSIONS >
 Range type.
 
using BinArray_t = std::array< int, DIMENSIONS >
 Type of the local per-axis bin indices.
 
using CoordArray_t = Hist::CoordArray_t< DIMENSIONS >
 Type of the coordinates.
 

Public Member Functions

 RHistImplBase ()=default
 
 RHistImplBase (const RHistImplBase &)=default
 
 RHistImplBase (RHistImplBase &&)=default
 
 RHistImplBase (size_t numBins, size_t numOverflowBins)
 
 RHistImplBase (std::string_view title, size_t numBins, size_t numOverflowBins)
 
void AddBinContent (int binidx, Weight_t w)
 Add w to the bin at index bin.
 
virtual std::unique_ptr< RHistImplBaseClone () const =0
 
virtual void FillN (const std::span< const CoordArray_t > xN)=0
 Interface function to fill a vector or array of coordinates.
 
virtual void FillN (const std::span< const CoordArray_t > xN, const std::span< const Weight_t > weightN)=0
 Interface function to fill a vector or array of coordinates with corresponding weights.
 
virtual Weight_t GetBinContent (const CoordArray_t &x) const =0
 Get the bin content (sum of weights) for the bin at coordinate x.
 
Weight_tGetBinContent (int binidx)
 Get the bin content (sum of weights) for bin index binidx (non-const).
 
Weight_t GetBinContent (int binidx) const
 Get the bin content (sum of weights) for bin index binidx.
 
double GetBinContentAsDouble (int binidx) const final
 Get the bin content (sum of weights) for bin index binidx, cast to double.
 
virtual double GetBinUncertainty (const CoordArray_t &x) const =0
 Get the bin uncertainty for the bin at coordinate x.
 
virtual FillFunc_t GetFillFunc () const =0
 Retrieve the pointer to the overridden Fill(x, w) function.
 
int GetNBins () const noexcept final
 Get the number of bins in this histogram, including possible under- and overflow bins.
 
int GetNBinsNoOver () const noexcept final
 Get the number of bins in this histogram, excluding possible under- and overflow bins.
 
int GetNOverflowBins () const noexcept final
 Get the number of under- and overflow bins of this histogram, excluding all regular bins.
 
const Stat_tGetStat () const noexcept
 Const access to statistics.
 
Stat_tGetStat () noexcept
 Non-const access to statistics.
 
- Public Member Functions inherited from ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>
 RHistImplPrecisionAgnosticBase ()=default
 
 RHistImplPrecisionAgnosticBase (const RHistImplPrecisionAgnosticBase &)=default
 
 RHistImplPrecisionAgnosticBase (RHistImplPrecisionAgnosticBase &&)=default
 
 RHistImplPrecisionAgnosticBase (std::string_view title)
 
virtual ~RHistImplPrecisionAgnosticBase ()
 
virtual const RAxisBaseGetAxis (int iAxis) const=0
 Get a base-class view on axis with index iAxis.
 
virtual CoordArray_t GetBinCenter (int binidx) const=0
 Get the center in all dimensions of the bin with index binidx.
 
virtual CoordArray_t GetBinFrom (int binidx) const=0
 Get the lower edge in all dimensions of the bin with index binidx.
 
virtual int GetBinIndex (const CoordArray_t &x) const=0
 Given the coordinate x, determine the index of the bin.
 
virtual int GetBinIndexAndGrow (const CoordArray_t &x) const=0
 Given the coordinate x, determine the index of the bin, possibly growing axes for which x is out of range.
 
virtual int GetBinIndexFromLocalBins (const BinArray_t &x) const=0
 Given the local per-axis bins x, determine the index of the bin.
 
virtual CoordArray_t GetBinTo (int binidx) const=0
 Get the upper edge in all dimensions of the bin with index binidx.
 
virtual double GetBinUncertainty (int binidx) const=0
 Get the uncertainty of the bin with index binidx.
 
virtual BinArray_t GetLocalBins (int binidx) const=0
 Given the index of the bin, determine the local per-axis bins x.
 
virtual AxisIterRange_t GetRange () const=0
 Get an AxisIterRange_t for the whole histogram, excluding under- and overflow.
 
const std::string & GetTitle () const
 Get the histogram title.
 
virtual bool HasBinUncertainty () const=0
 Whether this histogram's statistics provide storage for uncertainties, or whether uncertainties are determined as poisson uncertainty of the content.
 

Private Attributes

Stat_t fStatistics
 The histogram's bin content, uncertainties etc.
 

Additional Inherited Members

- Static Public Member Functions inherited from ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>
static constexpr int GetNDim ()
 Number of dimensions of the coordinates.
 

#include <ROOT/RHistImpl.hxx>

Inheritance diagram for ROOT::Experimental::Detail::RHistImplBase< DATA >:
[legend]

Member Typedef Documentation

◆ BinArray_t

template<class DATA >
using ROOT::Experimental::Detail::RHistImplBase< DATA >::BinArray_t = std::array<int, DATA::GetNDim()>

Type of the local per-axis bin indices.

Definition at line 159 of file RHistImpl.hxx.

◆ CoordArray_t

template<class DATA >
using ROOT::Experimental::Detail::RHistImplBase< DATA >::CoordArray_t = Hist::CoordArray_t<DATA::GetNDim()>

Type of the coordinates.

Definition at line 157 of file RHistImpl.hxx.

◆ FillFunc_t

template<class DATA >
using ROOT::Experimental::Detail::RHistImplBase< DATA >::FillFunc_t = void (RHistImplBase::*)(const CoordArray_t &x, Weight_t w)

Type of the Fill(x, w) function.

Definition at line 164 of file RHistImpl.hxx.

◆ Stat_t

template<class DATA >
using ROOT::Experimental::Detail::RHistImplBase< DATA >::Stat_t = DATA

Type of the statistics (bin content, uncertainties etc).

Definition at line 155 of file RHistImpl.hxx.

◆ Weight_t

template<class DATA >
using ROOT::Experimental::Detail::RHistImplBase< DATA >::Weight_t = typename DATA::Weight_t

Type of the bin content (and thus weights).

Definition at line 161 of file RHistImpl.hxx.

Constructor & Destructor Documentation

◆ RHistImplBase() [1/5]

template<class DATA >
ROOT::Experimental::Detail::RHistImplBase< DATA >::RHistImplBase ( )
default

◆ RHistImplBase() [2/5]

template<class DATA >
ROOT::Experimental::Detail::RHistImplBase< DATA >::RHistImplBase ( size_t  numBins,
size_t  numOverflowBins 
)
inline

Definition at line 172 of file RHistImpl.hxx.

◆ RHistImplBase() [3/5]

template<class DATA >
ROOT::Experimental::Detail::RHistImplBase< DATA >::RHistImplBase ( std::string_view  title,
size_t  numBins,
size_t  numOverflowBins 
)
inline

Definition at line 173 of file RHistImpl.hxx.

◆ RHistImplBase() [4/5]

template<class DATA >
ROOT::Experimental::Detail::RHistImplBase< DATA >::RHistImplBase ( const RHistImplBase< DATA > &  )
default

◆ RHistImplBase() [5/5]

template<class DATA >
ROOT::Experimental::Detail::RHistImplBase< DATA >::RHistImplBase ( RHistImplBase< DATA > &&  )
default

Member Function Documentation

◆ AddBinContent()

template<class DATA >
void ROOT::Experimental::Detail::RHistImplBase< DATA >::AddBinContent ( int  binidx,
Weight_t  w 
)
inline

Add w to the bin at index bin.

Definition at line 237 of file RHistImpl.hxx.

◆ Clone()

template<class DATA >
virtual std::unique_ptr< RHistImplBase > ROOT::Experimental::Detail::RHistImplBase< DATA >::Clone ( ) const
pure virtual

◆ FillN() [1/2]

template<class DATA >
virtual void ROOT::Experimental::Detail::RHistImplBase< DATA >::FillN ( const std::span< const CoordArray_t xN)
pure virtual

Interface function to fill a vector or array of coordinates.

Implemented in ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >.

◆ FillN() [2/2]

template<class DATA >
virtual void ROOT::Experimental::Detail::RHistImplBase< DATA >::FillN ( const std::span< const CoordArray_t xN,
const std::span< const Weight_t weightN 
)
pure virtual

Interface function to fill a vector or array of coordinates with corresponding weights.

Note
the size of xN and weightN must be the same!

Implemented in ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >.

◆ GetBinContent() [1/3]

template<class DATA >
virtual Weight_t ROOT::Experimental::Detail::RHistImplBase< DATA >::GetBinContent ( const CoordArray_t x) const
pure virtual

Get the bin content (sum of weights) for the bin at coordinate x.

Implemented in ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >.

◆ GetBinContent() [2/3]

template<class DATA >
Weight_t & ROOT::Experimental::Detail::RHistImplBase< DATA >::GetBinContent ( int  binidx)
inline

Get the bin content (sum of weights) for bin index binidx (non-const).

Definition at line 220 of file RHistImpl.hxx.

◆ GetBinContent() [3/3]

template<class DATA >
Weight_t ROOT::Experimental::Detail::RHistImplBase< DATA >::GetBinContent ( int  binidx) const
inline

Get the bin content (sum of weights) for bin index binidx.

Definition at line 213 of file RHistImpl.hxx.

◆ GetBinContentAsDouble()

template<class DATA >
double ROOT::Experimental::Detail::RHistImplBase< DATA >::GetBinContentAsDouble ( int  binidx) const
inlinefinalvirtual

Get the bin content (sum of weights) for bin index binidx, cast to double.

Implements ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>.

Definition at line 234 of file RHistImpl.hxx.

◆ GetBinUncertainty()

template<class DATA >
virtual double ROOT::Experimental::Detail::RHistImplBase< DATA >::GetBinUncertainty ( const CoordArray_t x) const
pure virtual

Get the bin uncertainty for the bin at coordinate x.

Implemented in ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >.

◆ GetFillFunc()

template<class DATA >
virtual FillFunc_t ROOT::Experimental::Detail::RHistImplBase< DATA >::GetFillFunc ( ) const
pure virtual

Retrieve the pointer to the overridden Fill(x, w) function.

Implemented in ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >.

◆ GetNBins()

template<class DATA >
int ROOT::Experimental::Detail::RHistImplBase< DATA >::GetNBins ( ) const
inlinefinalvirtualnoexcept

Get the number of bins in this histogram, including possible under- and overflow bins.

Implements ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>.

Definition at line 202 of file RHistImpl.hxx.

◆ GetNBinsNoOver()

template<class DATA >
int ROOT::Experimental::Detail::RHistImplBase< DATA >::GetNBinsNoOver ( ) const
inlinefinalvirtualnoexcept

Get the number of bins in this histogram, excluding possible under- and overflow bins.

Implements ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>.

Definition at line 206 of file RHistImpl.hxx.

◆ GetNOverflowBins()

template<class DATA >
int ROOT::Experimental::Detail::RHistImplBase< DATA >::GetNOverflowBins ( ) const
inlinefinalvirtualnoexcept

Get the number of under- and overflow bins of this histogram, excluding all regular bins.

Implements ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>.

Definition at line 210 of file RHistImpl.hxx.

◆ GetStat() [1/2]

template<class DATA >
const Stat_t & ROOT::Experimental::Detail::RHistImplBase< DATA >::GetStat ( ) const
inlinenoexcept

Const access to statistics.

Definition at line 227 of file RHistImpl.hxx.

◆ GetStat() [2/2]

template<class DATA >
Stat_t & ROOT::Experimental::Detail::RHistImplBase< DATA >::GetStat ( )
inlinenoexcept

Non-const access to statistics.

Definition at line 230 of file RHistImpl.hxx.

Member Data Documentation

◆ fStatistics

template<class DATA >
Stat_t ROOT::Experimental::Detail::RHistImplBase< DATA >::fStatistics
private

The histogram's bin content, uncertainties etc.

Definition at line 168 of file RHistImpl.hxx.

  • hist/histv7/inc/ROOT/RHistImpl.hxx