template<
int DIMENSIONS, class
PRECISION, template<
int D_, class P_ > class... STAT>
class ROOT::Experimental::RHist< 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 RTree
, 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 53 of file RHist.hxx.
|
| RHist ()=default |
|
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 1>::type> |
| RHist (const RAxisConfig &xaxis) |
| Constructor overload that's only available for a 1-dimensional histogram.
|
|
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 2>::type> |
| RHist (const RAxisConfig &xaxis, const RAxisConfig &yaxis) |
| Constructor overload that's only available for a 2-dimensional histogram.
|
|
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 3>::type> |
| RHist (const RAxisConfig &xaxis, const RAxisConfig &yaxis, const RAxisConfig &zaxis) |
| Constructor overload that's only available for a 3-dimensional histogram.
|
|
| RHist (const RHist &other) |
|
| RHist (RHist &&)=default |
|
| RHist (std::array< RAxisConfig, DIMENSIONS > axes) |
| Create a histogram from an array of axes (RAxisConfig s).
|
|
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 1>::type> |
| RHist (std::string_view histTitle, const RAxisConfig &xaxis) |
| Constructor overload that's only available for a 1-dimensional histogram, also passing the histogram title.
|
|
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 2>::type> |
| RHist (std::string_view histTitle, const RAxisConfig &xaxis, const RAxisConfig &yaxis) |
| Constructor overload that's only available for a 2-dimensional histogram, also passing the histogram title.
|
|
template<int ENABLEIF_NDIM = DIMENSIONS, class = typename std::enable_if<ENABLEIF_NDIM == 3>::type> |
| RHist (std::string_view histTitle, const RAxisConfig &xaxis, const RAxisConfig &yaxis, const RAxisConfig &zaxis) |
| Constructor overload that's only available for a 3-dimensional histogram, also passing the histogram title.
|
|
| RHist (std::string_view histTitle, std::array< RAxisConfig, DIMENSIONS > axes) |
| Constructor overload taking the histogram title.
|
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
void | Fill (const CoordArray_t &x, Weight_t weight=(Weight_t) 1) noexcept |
| Add weight to the bin containing coordinate x .
|
|
void | FillN (const std::span< const CoordArray_t > xN) noexcept |
| Convenience overload: FillN() with weight 1.
|
|
void | FillN (const std::span< const CoordArray_t > xN, const std::span< const Weight_t > weightN) noexcept |
| For each coordinate in xN , add weightN[i] to the bin at coordinate xN[i] .
|
|
void | FillN (std::initializer_list< const CoordArray_t > xN) noexcept |
| Convenience overload: FillN() with weight 1.
|
|
void | FillN (std::initializer_list< const CoordArray_t > xN, std::initializer_list< const Weight_t > weightN) noexcept |
| For each coordinate in xN , add weightN[i] to the bin at coordinate xN[i] .
|
|
Weight_t | GetBinContent (const CoordArray_t &x) const |
| Get the content of the bin at x .
|
|
double | GetBinUncertainty (const CoordArray_t &x) const |
| Get the uncertainty on the content of the bin at x .
|
|
int64_t | GetEntries () const noexcept |
| Get the number of entries this histogram was filled with.
|
|
ImplBase_t * | GetImpl () const noexcept |
| Access the ImplBase_t this RHist points to.
|
|
void | swap (RHist< DIMENSIONS, PRECISION, STAT... > &other) noexcept |
| Swap *this and other.
|
|
std::unique_ptr< ImplBase_t > | TakeImpl () &&noexcept |
| "Steal" the ImplBase_t this RHist points to.
|
|
template<
int DIMENSIONS, class
PRECISION , template<
int D_, class P_ > class... STAT>
Create a histogram from an array
of axes (RAxisConfig
s).
Example code:
Construct a 1-dimensional histogram that can be filled with floats
s. 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 RAxisCoordinate
.
RHist<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.
RHist<2,int> h2i({{ {10, 0., 1.}, {{-1., 0., 1., 10., 100.}} }});
Definition at line 286 of file RHist.hxx.