Logo ROOT   6.10/00
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT > Class Template Reference

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
class ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >

Histogram class for histograms with DIMENSIONS dimensions, where each bin count is stored by a value of type PRECISION.

STAT stores statistical data of the entries filled into the histogram (bin content, uncertainties etc).

A histogram counts occurrences of values or n-dimensional combinations thereof. Contrary to for instance a TTree, a histogram combines adjacent values. The resolution of this combination is defined by the axis binning, see e.g. http://www.wikiwand.com/en/Histogram

Definition at line 33 of file THist.hxx.

Public Types

using AxisRange_t = typename ImplBase_t::AxisIterRange_t
 Range. More...
 
using const_iterator = Detail::THistBinIter< ImplBase_t >
 
using CoordArray_t = typename ImplBase_t::CoordArray_t
 The coordinates type: a DIMENSIONS-dimensional std::array of double. More...
 
using FillFunc_t = typename ImplBase_t::FillFunc_t
 Pointer type to HistImpl_t::Fill, for faster access. More...
 
using ImplBase_t = Detail::THistImplBase< Detail::THistData< DIMENSIONS, PRECISION, Detail::THistDataDefaultStorage, STAT...>>
 The type of the Detail::THistImplBase of this histogram. More...
 
using Weight_t = PRECISION
 The type of weights. More...
 

Public Member Functions

 THist ()=default
 
 THist (THist &&)=default
 
 THist (std::array< TAxisConfig, DIMENSIONS > axes)
 Create a histogram from an array of axes (TAxisConfigs). More...
 
 THist (std::string_view histTitle, std::array< TAxisConfig, DIMENSIONS > axes)
 Constructor overload taking the histogram title. More...
 
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 1>::type>
 THist (const TAxisConfig &xaxis)
 Constructor overload that's only available for a 1-dimensional histogram. More...
 

Static Public Member Functions

static constexpr int GetNDim () noexcept
 Number of dimensions of the coordinates. More...
 

Public Attributes

FillFunc_t fFillFunc = nullptr
 The actual histogram implementation. More...
 

Friends

THist HistFromImpl (std::unique_ptr< ImplBase_t >)
 

#include <ROOT/THist.hxx>

Member Typedef Documentation

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
using ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::AxisRange_t = typename ImplBase_t::AxisIterRange_t

Range.

Definition at line 68 of file THist.hxx.

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
using ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::const_iterator = Detail::THistBinIter<ImplBase_t>

Definition at line 70 of file THist.hxx.

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
using ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::CoordArray_t = typename ImplBase_t::CoordArray_t

The coordinates type: a DIMENSIONS-dimensional std::array of double.

Definition at line 62 of file THist.hxx.

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
using ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::FillFunc_t = typename ImplBase_t::FillFunc_t

Pointer type to HistImpl_t::Fill, for faster access.

Definition at line 66 of file THist.hxx.

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
using ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::ImplBase_t = Detail::THistImplBase<Detail::THistData<DIMENSIONS, PRECISION, Detail::THistDataDefaultStorage, STAT...>>

The type of the Detail::THistImplBase of this histogram.

Definition at line 60 of file THist.hxx.

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
using ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::Weight_t = PRECISION

The type of weights.

Definition at line 64 of file THist.hxx.

Constructor & Destructor Documentation

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::THist ( )
default
template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::THist ( THist< DIMENSIONS, PRECISION, STAT > &&  )
default
template<int DIMENSIONS, class PRECISION , template< int D_, class P_, template< class P__ > class S_ > class... STAT>
ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::THist ( std::array< TAxisConfig, DIMENSIONS >  axes)
explicit

Create a histogram from an array of axes (TAxisConfigs).

Example code:

Construct a 1-dimensional histogram that can be filled with floatss. The axis has 10 bins between 0. and 1. The two outermost sets of curly braces are to reach the initialization of the std::array elements; the inner one is for the initialization of a TAxisCoordinate.

THist<1,float> h1f({{ {10, 0., 1.} }});

Construct a 2-dimensional histogram, with the first axis as before, and the second axis having non-uniform ("irregular") binning, where all bin- edges are specified. As this is itself an array it must be enclosed by double curlies.

THist<2,int> h2i({{ {10, 0., 1.}, {{-1., 0., 1., 10., 100.}} }});  

Definition at line 289 of file THist.hxx.

template<int DIMENSIONS, class PRECISION , template< int D_, class P_, template< class P__ > class S_ > class... STAT>
ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::THist ( std::string_view  histTitle,
std::array< TAxisConfig, DIMENSIONS >  axes 
)

Constructor overload taking the histogram title.

Definition at line 279 of file THist.hxx.

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 1>::type>
ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::THist ( const TAxisConfig xaxis)
inlineexplicit

Constructor overload that's only available for a 1-dimensional histogram.

Definition at line 101 of file THist.hxx.

Member Function Documentation

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
static constexpr int ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::GetNDim ( )
inlinestaticnoexcept

Number of dimensions of the coordinates.

Definition at line 73 of file THist.hxx.

Friends And Related Function Documentation

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
THist HistFromImpl ( std::unique_ptr< ImplBase_t )
friend

Member Data Documentation

template<int DIMENSIONS, class PRECISION, template< int D_, class P_, template< class P__ > class S_ > class... STAT>
FillFunc_t ROOT::Experimental::THist< DIMENSIONS, PRECISION, STAT >::fFillFunc = nullptr

The actual histogram implementation.

! Pinter to THistImpl::Fill() member function

Definition at line 186 of file THist.hxx.


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