Logo ROOT   6.08/07
Reference Guide
List of all members | Public Types | Public Member Functions | Private Attributes | List of all members
ROOT::Experimental::Detail::THistImplBase< DATA > Class Template Referenceabstract

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

Interface class for THistImpl.

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

Definition at line 140 of file THistImpl.hxx.

Public Types

using CoordArray_t = Hist::CoordArray_t< DATA::GetNDim()>
 Type of the coordinate: a DIMENSIONS-dimensional array of doubles. More...
 
using FillFunc_t = void(THistImplBase::*)(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::THistImplPrecisionAgnosticBase< 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

 THistImplBase ()=default
 
 THistImplBase (size_t numBins)
 
 THistImplBase (std::string_view title, size_t numBins)
 
 THistImplBase (const THistImplBase &)=default
 
 THistImplBase (THistImplBase &&)=default
 
void AddBinContent (int binidx, Weight_t w)
 Add w to the bin at index bin. More...
 
virtual void Apply (std::function< void(THistBinRef< const THistImplBase >)>) 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 void FillN (const std::array_view< CoordArray_t > xN, const std::array_view< Weight_t > weightN)=0
 Interface function to fill a vector or array of coordinates with corresponding weights. More...
 
virtual void FillN (const std::array_view< CoordArray_t > xN)=0
 Interface function to fill a vector or array of coordinates. 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_t GetBinContent (int binidx) const
 Get the bin content (sum of weights) for bin index binidx. More...
 
Weight_tGetBinContent (int binidx)
 Get the bin content (sum of weights) for bin index binidx (non-const). 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::THistImplPrecisionAgnosticBase< DATA::GetNDim()>
 THistImplPrecisionAgnosticBase ()=default
 
 THistImplPrecisionAgnosticBase (const THistImplPrecisionAgnosticBase &)=default
 
 THistImplPrecisionAgnosticBase (THistImplPrecisionAgnosticBase &&)=default
 
 THistImplPrecisionAgnosticBase (std::string_view title)
 
virtual ~THistImplPrecisionAgnosticBase ()
 
virtual TAxisView GetAxis (int iAxis) const=0
 Get a TAxisView 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 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 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

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

Additional Inherited Members

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

#include <ROOT/THistImpl.hxx>

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

Member Typedef Documentation

◆ CoordArray_t

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

Type of the coordinate: a DIMENSIONS-dimensional array of doubles.

Definition at line 145 of file THistImpl.hxx.

◆ FillFunc_t

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

Type of the Fill(x, w) function.

Definition at line 150 of file THistImpl.hxx.

◆ Stat_t

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

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

Definition at line 143 of file THistImpl.hxx.

◆ Weight_t

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

Type of the bin content (and thus weights).

Definition at line 147 of file THistImpl.hxx.

Constructor & Destructor Documentation

◆ THistImplBase() [1/5]

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

◆ THistImplBase() [2/5]

template<class DATA >
ROOT::Experimental::Detail::THistImplBase< DATA >::THistImplBase ( size_t  numBins)
inline

Definition at line 158 of file THistImpl.hxx.

◆ THistImplBase() [3/5]

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

Definition at line 159 of file THistImpl.hxx.

◆ THistImplBase() [4/5]

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

◆ THistImplBase() [5/5]

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

Member Function Documentation

◆ AddBinContent()

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

Add w to the bin at index bin.

Definition at line 219 of file THistImpl.hxx.

◆ Apply()

template<class DATA >
virtual void ROOT::Experimental::Detail::THistImplBase< DATA >::Apply ( std::function< void(THistBinRef< const THistImplBase< DATA > >)>  ) const
pure virtual

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

The function takes the bin reference.

◆ ApplyXC()

template<class DATA >
virtual void ROOT::Experimental::Detail::THistImplBase< DATA >::ApplyXC ( std::function< void(const CoordArray_t &, Weight_t)>  ) const
pure virtual

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

The function takes the bin coordinate and content.

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

◆ ApplyXCE()

template<class DATA >
virtual void ROOT::Experimental::Detail::THistImplBase< DATA >::ApplyXCE ( std::function< void(const CoordArray_t &, Weight_t, double)>  ) const
pure virtual

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

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

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

◆ FillN() [1/2]

template<class DATA >
virtual void ROOT::Experimental::Detail::THistImplBase< DATA >::FillN ( const std::array_view< CoordArray_t xN,
const std::array_view< 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::THistImpl< DATA, AXISCONFIG >.

◆ FillN() [2/2]

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

Interface function to fill a vector or array of coordinates.

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

◆ GetBinContent() [1/3]

template<class DATA >
virtual Weight_t ROOT::Experimental::Detail::THistImplBase< 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::THistImpl< DATA, AXISCONFIG >.

◆ GetBinContent() [2/3]

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

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

Definition at line 201 of file THistImpl.hxx.

◆ GetBinContent() [3/3]

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

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

Definition at line 204 of file THistImpl.hxx.

◆ GetBinContentAsDouble()

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

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

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

Definition at line 214 of file THistImpl.hxx.

◆ GetBinUncertainty()

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

Get the bin uncertainty for the bin at coordinate x.

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

◆ GetFillFunc()

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

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

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

◆ GetNBins()

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

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

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

Definition at line 198 of file THistImpl.hxx.

◆ GetStat() [1/2]

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

Const access to statistics.

Definition at line 207 of file THistImpl.hxx.

◆ GetStat() [2/2]

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

Non-const access to statistics.

Definition at line 210 of file THistImpl.hxx.

Member Data Documentation

◆ fStatistics

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

The histogram's bin content, uncertainties etc.

Definition at line 154 of file THistImpl.hxx.


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