template<int DIMENSIONS, class PRECISION>
class ROOT::THist< DIMENSIONS, PRECISION >
Histogram class for histograms with DIMENSIONS
dimensions, where each bin count is stored by a value of type PRECISION
.
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 binning, see e.g. http://www.wikiwand.com/en/Histogram
Definition at line 31 of file THist.h.
|
| THist ()=default |
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>> |
| THist (std::array< TAxisConfig, DIMENSIONS > axes, STATISTICS statConfig=STATISTICS()) |
| Create a histogram from an array of axes (TAxisConfig s) and possibly an initial STATISTICS object. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>> |
| THist (std::array< TAxisConfig, DIMENSIONS > axes, std::string_view histTitle, std::array< std::string_view, DIMENSIONS > axisTitles, STATISTICS statConfig=STATISTICS()) |
| Constructor overload taking histogram and axis titles. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>, class = typename std::enable_if<DIMENSIONS == 1>> |
| THist (const TAxisConfig &xaxis, STATISTICS statConfig=STATISTICS()) |
| Constructor overload that's only available for DIMENSIONS == 1. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>, class = typename std::enable_if<DIMENSIONS == 1>> |
| THist (const TAxisConfig &xaxis, std::string_view histTitle, std::string_view xAxisTitle, STATISTICS statConfig=STATISTICS()) |
| Constructor overload that's only available for DIMENSIONS == 1, also passing histogram and axis title. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>, class = typename std::enable_if<DIMENSIONS == 2>> |
| THist (const TAxisConfig &xaxis, const TAxisConfig &yaxis, STATISTICS statConfig=STATISTICS()) |
| Constructor overload that's only available for DIMENSIONS == 2. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>, class = typename std::enable_if<DIMENSIONS == 2>> |
| THist (const TAxisConfig &xaxis, const TAxisConfig &yaxis, std::string_view histTitle, std::string_view xAxisTitle, std::string_view yAxisTitle, STATISTICS statConfig=STATISTICS()) |
| Constructor overload that's only available for DIMENSIONS == 2, also passing histogram and axis titles. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>, class = typename std::enable_if<DIMENSIONS == 3>> |
| THist (const TAxisConfig &xaxis, const TAxisConfig &yaxis, const TAxisConfig &zaxis, STATISTICS statConfig=STATISTICS()) |
| Constructor overload that's only available for DIMENSIONS == 3. More...
|
|
template<class STATISTICS = THistStatUncertainty<DIMENSIONS, PRECISION>, class = typename std::enable_if<DIMENSIONS == 3>> |
| THist (const TAxisConfig &xaxis, const TAxisConfig &yaxis, const TAxisConfig &zaxis, std::string_view histTitle, std::string_view xAxisTitle, std::string_view yAxisTitle, std::string_view zAxisTitle, STATISTICS statConfig=STATISTICS()) |
|
ImplBase_t * | GetImpl () const noexcept |
| Access the ImplBase_t this THist points to. More...
|
|
void | Fill (const Coord_t &x, Weight_t weight=1.) noexcept |
| Add weight to the bin containing coordinate x . More...
|
|
void | FillN (const std::array_view< Coord_t > xN, const std::array_view< Weight_t > weightN) noexcept |
| For each coordinate in xN , add weightN[i] to the bin at coordinate xN[i] . More...
|
|
void | FillN (const std::array_view< Coord_t > xN) noexcept |
| Convenience overload: FillN() with weight 1. More...
|
|
int64_t | GetEntries () const noexcept |
| Get the number of entries this histogram was filled with. More...
|
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
template<int DIMENSIONS, class PRECISION >
template<class STATISTICS >
Create a histogram from an array
of axes (TAxisConfig
s) and possibly an initial STATISTICS
object.
The latter is usually just fine when not passed (i.e. default-constructed). 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 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 300 of file THist.h.