Logo ROOT  
Reference Guide
ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG > Class Template Referencefinal

template<class DATA, class... AXISCONFIG>
class ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >

Definition at line 362 of file RHistImpl.hxx.

Public Types

template<int NDIM = DATA::GetNDim()>
using AxisIterRange_t = typename Hist::AxisIterRange_t< NDIM >
 
using CoordArray_t = typename ImplBase_t::CoordArray_t
 
using FillFunc_t = void(RHistImplBase::*)(const CoordArray_t &x, Weight_t w)
 Type of the Fill(x, w) function. More...
 
using ImplBase_t = RHistImplBase< DATA >
 
using Weight_t = typename ImplBase_t::Weight_t
 
- Public Types inherited from ROOT::Experimental::Detail::RHistImplBase< DATA >
using CoordArray_t = Hist::CoordArray_t< DATA::GetNDim()>
 Type of the coordinate: a DIMENSIONS-dimensional array of doubles. More...
 
using FillFunc_t = void(RHistImplBase::*)(const CoordArray_t &x, Weight_t w)
 Type of the Fill(x, w) function. More...
 
using Stat_t = DATA
 Type of the statistics (bin content, uncertainties etc). More...
 
using Weight_t = typename DATA::Weight_t
 Type of the bin content (and thus weights). More...
 
- Public Types inherited from ROOT::Experimental::Detail::RHistImplPrecisionAgnosticBase< DATA::GetNDim()>
using AxisIterRange_t = Hist::AxisIterRange_t< DIMENSIONS >
 Range type. More...
 
using CoordArray_t = Hist::CoordArray_t< DIMENSIONS >
 Type of the coordinate: a DIMENSIONS-dimensional array of doubles. More...
 

Public Member Functions

 RHistImpl (AXISCONFIG... axisArgs)
 
 RHistImpl (std::string_view title, AXISCONFIG... axisArgs)
 
 RHistImpl (TRootIOCtor *)
 
void Apply (std::function< void(RHistBinRef< const ImplBase_t >)> op) const final
 Apply a function (lambda) to all bins of the histogram. More...
 
void ApplyXC (std::function< void(const CoordArray_t &, Weight_t)> op) const final
 Apply a function (lambda) to all bins of the histogram. More...
 
virtual void ApplyXCE (std::function< void(const CoordArray_t &, Weight_t, double)> op) const final
 Apply a function (lambda) to all bins of the histogram. More...
 
std::unique_ptr< ImplBase_tClone () const override
 
void Fill (const CoordArray_t &x, Weight_t w=1.)
 Add a single weight w to the bin at coordinate x. More...
 
void FillN (const std::span< const CoordArray_t > xN) final
 Fill an array of weightN to the bins specified by coordinates xN. More...
 
void FillN (const std::span< const CoordArray_t > xN, const std::span< const Weight_t > weightN) final
 Fill an array of weightN to the bins specified by coordinates xN. More...
 
const std::tuple< AXISCONFIG... > & GetAxes () const
 Get the axes of this histogram. More...
 
RAxisView GetAxis (int iAxis) const final
 Normalized axes access, converting the actual axis to RAxisConfig. More...
 
CoordArray_t GetBinCenter (int binidx) const final
 Get the center coordinate of the bin. More...
 
Weight_t GetBinContent (const CoordArray_t &x) const final
 Get the content of the bin at position x. More...
 
CoordArray_t GetBinFrom (int binidx) const final
 Get the coordinate of the low limit of the bin. More...
 
int GetBinIndex (const CoordArray_t &x) const final
 Gets the bin index for coordinate x; returns -1 if there is no such bin, e.g. More...
 
int GetBinIndexAndGrow (const CoordArray_t &x) final
 Gets the bin index for coordinate x, growing the axes as needed and possible. More...
 
CoordArray_t GetBinTo (int binidx) const final
 Get the coordinate of the high limit of the bin. More...
 
double GetBinUncertainty (const CoordArray_t &x) const final
 Get the bin uncertainty for the bin at coordinate x. More...
 
double GetBinUncertainty (int binidx) const final
 Return the uncertainties for the given bin. More...
 
FillFunc_t GetFillFunc () const final
 Retrieve the fill function for this histogram implementation, to prevent the virtual function call for high-frequency fills. More...
 
AxisIterRange_t< DATA::GetNDim()> GetRange (const std::array< Hist::EOverflow, DATA::GetNDim()> &withOverUnder) const final
 Get the begin() and end() for each axis. More...
 
void GrowAxis (int, double)
 Grow the axis number iAxis to fit the coordinate x. More...
 
bool HasBinUncertainty () const final
 Whether this histogram's statistics provide storage for uncertainties, or whether uncertainties are determined as poisson uncertainty of the content. More...
 
- Public Member Functions inherited from ROOT::Experimental::Detail::RHistImplBase< DATA >
 RHistImplBase ()=default
 
 RHistImplBase (const RHistImplBase &)=default
 
 RHistImplBase (RHistImplBase &&)=default
 
 RHistImplBase (size_t numBins)
 
 RHistImplBase (std::string_view title, size_t numBins)
 
void AddBinContent (int binidx, Weight_t w)
 Add w to the bin at index bin. More...
 
virtual void Apply (std::function< void(RHistBinRef< const RHistImplBase >)>) const =0
 Apply a function (lambda) to all bins of the histogram. More...
 
virtual void ApplyXC (std::function< void(const CoordArray_t &, Weight_t)>) const =0
 Apply a function (lambda) to all bins of the histogram. More...
 
virtual void ApplyXCE (std::function< void(const CoordArray_t &, Weight_t, double)>) const =0
 Apply a function (lambda) to all bins of the histogram. More...
 
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. More...
 
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. More...
 
virtual Weight_t GetBinContent (const CoordArray_t &x) const =0
 Get the bin content (sum of weights) for the bin at coordinate x. More...
 
Weight_tGetBinContent (int binidx)
 Get the bin content (sum of weights) for bin index binidx (non-const). More...
 
Weight_t GetBinContent (int binidx) const
 Get the bin content (sum of weights) for bin index binidx. More...
 
double GetBinContentAsDouble (int binidx) const final
 Get the bin content (sum of weights) for bin index binidx, cast to double. More...
 
virtual double GetBinUncertainty (const CoordArray_t &x) const =0
 Get the bin uncertainty for the bin at coordinate x. More...
 
virtual FillFunc_t GetFillFunc () const =0
 Retrieve the pointer to the overridden Fill(x, w) function. More...
 
int GetNBins () const noexcept final
 Get the number of bins in this histogram, including possible under- and overflow bins. More...
 
const Stat_tGetStat () const noexcept
 Const access to statistics. More...
 
Stat_tGetStat () noexcept
 Non-const access to statistics. More...
 
- 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 RAxisView GetAxis (int iAxis) const=0
 Get a RAxisView on axis with index iAxis. More...
 
virtual CoordArray_t GetBinCenter (int binidx) const=0
 Get the center in all dimensions of the bin with index binidx. More...
 
virtual double GetBinContentAsDouble (int binidx) const=0
 The bin content, cast to double. More...
 
virtual CoordArray_t GetBinFrom (int binidx) const=0
 Get the lower edge in all dimensions of the bin with index binidx. More...
 
virtual int GetBinIndex (const CoordArray_t &x) const=0
 Given the coordinate x, determine the index of the bin. More...
 
virtual int GetBinIndexAndGrow (const CoordArray_t &x)=0
 Given the coordinate x, determine the index of the bin, possibly growing axes for which x is out of range. More...
 
virtual CoordArray_t GetBinTo (int binidx) const=0
 Get the upper edge in all dimensions of the bin with index binidx. More...
 
virtual double GetBinUncertainty (int binidx) const=0
 The bin's uncertainty. More...
 
virtual int GetNBins () const noexcept=0
 Number of bins of this histogram, including all overflow and underflow bins. More...
 
virtual AxisIterRange_t GetRange (const std::array< Hist::EOverflow, DIMENSIONS > &withOverUnder) const=0
 Get a AxisIterRange_t for the whole histogram, possibly restricting the range to non-overflow bins. More...
 
const std::string & GetTitle () const
 Get the histogram title. More...
 
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. More...
 

Private Attributes

std::tuple< AXISCONFIG... > fAxes
 The histogram's axes. More...
 

Iterator interface

using const_iterator = RHistBinIter< const ImplBase_t >
 
using iterator = RHistBinIter< ImplBase_t >
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 

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

#include <ROOT/RHistImpl.hxx>

Inheritance diagram for ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >:
[legend]

Member Typedef Documentation

◆ AxisIterRange_t

template<class DATA , class... AXISCONFIG>
template<int NDIM = DATA::GetNDim()>
using ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::AxisIterRange_t = typename Hist::AxisIterRange_t<NDIM>

Definition at line 373 of file RHistImpl.hxx.

◆ const_iterator

template<class DATA , class... AXISCONFIG>
using ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::const_iterator = RHistBinIter<const ImplBase_t>

Definition at line 555 of file RHistImpl.hxx.

◆ CoordArray_t

template<class DATA , class... AXISCONFIG>
using ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::CoordArray_t = typename ImplBase_t::CoordArray_t

Definition at line 369 of file RHistImpl.hxx.

◆ FillFunc_t

template<class DATA , class... AXISCONFIG>
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 151 of file RHistImpl.hxx.

◆ ImplBase_t

template<class DATA , class... AXISCONFIG>
using ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::ImplBase_t = RHistImplBase<DATA>

Definition at line 368 of file RHistImpl.hxx.

◆ iterator

template<class DATA , class... AXISCONFIG>
using ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::iterator = RHistBinIter<ImplBase_t>

Definition at line 556 of file RHistImpl.hxx.

◆ Weight_t

template<class DATA , class... AXISCONFIG>
using ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::Weight_t = typename ImplBase_t::Weight_t

Definition at line 370 of file RHistImpl.hxx.

Constructor & Destructor Documentation

◆ RHistImpl() [1/3]

template<class DATA , class... AXISCONFIG>
ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::RHistImpl ( TRootIOCtor )

Definition at line 565 of file RHistImpl.hxx.

◆ RHistImpl() [2/3]

template<class DATA , class... AXISCONFIG>
ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::RHistImpl ( AXISCONFIG...  axisArgs)

Definition at line 569 of file RHistImpl.hxx.

◆ RHistImpl() [3/3]

template<class DATA , class... AXISCONFIG>
ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::RHistImpl ( std::string_view  title,
AXISCONFIG...  axisArgs 
)

Definition at line 574 of file RHistImpl.hxx.

Member Function Documentation

◆ Apply()

template<class DATA , class... AXISCONFIG>
void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::Apply ( std::function< void(RHistBinRef< const ImplBase_t >)>  op) const
inlinefinal

Apply a function (lambda) to all bins of the histogram.

The function takes the bin reference.

Definition at line 393 of file RHistImpl.hxx.

◆ ApplyXC()

template<class DATA , class... AXISCONFIG>
void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::ApplyXC ( std::function< void(const CoordArray_t &, Weight_t)>  op) const
inlinefinalvirtual

Apply a function (lambda) to all bins of the histogram.

The function takes the bin coordinate and content.

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 401 of file RHistImpl.hxx.

◆ ApplyXCE()

template<class DATA , class... AXISCONFIG>
virtual void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::ApplyXCE ( std::function< void(const CoordArray_t &, Weight_t, double)>  op) const
inlinefinalvirtual

Apply a function (lambda) to all bins of the histogram.

The function takes the bin coordinate, content and uncertainty ("error") of the content.

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 409 of file RHistImpl.hxx.

◆ begin() [1/2]

template<class DATA , class... AXISCONFIG>
const_iterator ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::begin ( ) const
inlinenoexcept

Definition at line 558 of file RHistImpl.hxx.

◆ begin() [2/2]

template<class DATA , class... AXISCONFIG>
iterator ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::begin ( )
inlinenoexcept

Definition at line 557 of file RHistImpl.hxx.

◆ Clone()

template<class DATA , class... AXISCONFIG>
std::unique_ptr< ImplBase_t > ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::Clone ( ) const
inlineoverridevirtual

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 383 of file RHistImpl.hxx.

◆ end() [1/2]

template<class DATA , class... AXISCONFIG>
const_iterator ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::end ( ) const
inlinenoexcept

Definition at line 560 of file RHistImpl.hxx.

◆ end() [2/2]

template<class DATA , class... AXISCONFIG>
iterator ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::end ( )
inlinenoexcept

Definition at line 559 of file RHistImpl.hxx.

◆ Fill()

template<class DATA , class... AXISCONFIG>
void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::Fill ( const CoordArray_t x,
Weight_t  w = 1. 
)
inline

Add a single weight w to the bin at coordinate x.

Definition at line 502 of file RHistImpl.hxx.

◆ FillN() [1/2]

template<class DATA , class... AXISCONFIG>
void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::FillN ( const std::span< const CoordArray_t xN)
inlinefinalvirtual

Fill an array of weightN to the bins specified by coordinates xN.

For each element i, the weight weightN[i] will be added to the bin at the coordinate xN[i]

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 494 of file RHistImpl.hxx.

◆ FillN() [2/2]

template<class DATA , class... AXISCONFIG>
void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::FillN ( const std::span< const CoordArray_t xN,
const std::span< const Weight_t weightN 
)
inlinefinalvirtual

Fill an array of weightN to the bins specified by coordinates xN.

For each element i, the weight weightN[i] will be added to the bin at the coordinate xN[i]

Note
xN and weightN must have the same size!

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 477 of file RHistImpl.hxx.

◆ GetAxes()

template<class DATA , class... AXISCONFIG>
const std::tuple< AXISCONFIG... > & ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetAxes ( ) const
inline

Get the axes of this histogram.

Definition at line 416 of file RHistImpl.hxx.

◆ GetAxis()

template<class DATA , class... AXISCONFIG>
RAxisView ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetAxis ( int  iAxis) const
inlinefinalvirtual

Normalized axes access, converting the actual axis to RAxisConfig.

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

Definition at line 419 of file RHistImpl.hxx.

◆ GetBinCenter()

template<class DATA , class... AXISCONFIG>
CoordArray_t ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinCenter ( int  binidx) const
inlinefinalvirtual

Get the center coordinate of the bin.

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

Definition at line 447 of file RHistImpl.hxx.

◆ GetBinContent()

template<class DATA , class... AXISCONFIG>
Weight_t ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinContent ( const CoordArray_t x) const
inlinefinalvirtual

Get the content of the bin at position x.

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 509 of file RHistImpl.hxx.

◆ GetBinFrom()

template<class DATA , class... AXISCONFIG>
CoordArray_t ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinFrom ( int  binidx) const
inlinefinalvirtual

Get the coordinate of the low limit of the bin.

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

Definition at line 456 of file RHistImpl.hxx.

◆ GetBinIndex()

template<class DATA , class... AXISCONFIG>
int ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinIndex ( const CoordArray_t x) const
inlinefinal

Gets the bin index for coordinate x; returns -1 if there is no such bin, e.g.

for axes without over / underflow but coordinate out of range.

Definition at line 423 of file RHistImpl.hxx.

◆ GetBinIndexAndGrow()

template<class DATA , class... AXISCONFIG>
int ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinIndexAndGrow ( const CoordArray_t x)
inlinefinal

Gets the bin index for coordinate x, growing the axes as needed and possible.

Returns -1 if there is no such bin, e.g. for axes without over / underflow but coordinate out of range.

Definition at line 436 of file RHistImpl.hxx.

◆ GetBinTo()

template<class DATA , class... AXISCONFIG>
CoordArray_t ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinTo ( int  binidx) const
inlinefinalvirtual

Get the coordinate of the high limit of the bin.

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

Definition at line 465 of file RHistImpl.hxx.

◆ GetBinUncertainty() [1/2]

template<class DATA , class... AXISCONFIG>
double ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinUncertainty ( const CoordArray_t x) const
inlinefinalvirtual

Get the bin uncertainty for the bin at coordinate x.

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 521 of file RHistImpl.hxx.

◆ GetBinUncertainty() [2/2]

template<class DATA , class... AXISCONFIG>
double ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetBinUncertainty ( int  binidx) const
inlinefinalvirtual

Return the uncertainties for the given bin.

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

Definition at line 518 of file RHistImpl.hxx.

◆ GetFillFunc()

template<class DATA , class... AXISCONFIG>
FillFunc_t ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetFillFunc ( ) const
inlinefinalvirtual

Retrieve the fill function for this histogram implementation, to prevent the virtual function call for high-frequency fills.

Implements ROOT::Experimental::Detail::RHistImplBase< DATA >.

Definition at line 389 of file RHistImpl.hxx.

◆ GetRange()

template<class DATA , class... AXISCONFIG>
AxisIterRange_t< DATA::GetNDim()> ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GetRange ( const std::array< Hist::EOverflow, DATA::GetNDim()> &  withOverUnder) const
inlinefinal

Get the begin() and end() for each axis.

Parameters
[in]withOverUnder- Whether the begin and end should contain over- or underflow. Ignored if the axis does not support over- / underflow.

Definition at line 536 of file RHistImpl.hxx.

◆ GrowAxis()

template<class DATA , class... AXISCONFIG>
void ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::GrowAxis ( int  ,
double   
)
inline

Grow the axis number iAxis to fit the coordinate x.

The histogram (conceptually) combines pairs of bins along this axis until x is within the range of the axis. The axis must support growing for this to work (e.g. a RAxisGrow).

Definition at line 548 of file RHistImpl.hxx.

◆ HasBinUncertainty()

template<class DATA , class... AXISCONFIG>
bool ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::HasBinUncertainty ( ) const
inlinefinalvirtual

Whether this histogram's statistics provide storage for uncertainties, or whether uncertainties are determined as poisson uncertainty of the content.

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

Definition at line 529 of file RHistImpl.hxx.

Member Data Documentation

◆ fAxes

template<class DATA , class... AXISCONFIG>
std::tuple<AXISCONFIG...> ROOT::Experimental::Detail::RHistImpl< DATA, AXISCONFIG >::fAxes
private

The histogram's axes.

Definition at line 376 of file RHistImpl.hxx.


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