24namespace Experimental {
131 throw std::logic_error(
"statistics are tainted, for example after setting bin contents or slicing");
142 throw std::invalid_argument(
"nDimensions must be > 0");
180 throw std::invalid_argument(
"dimension is disabled");
216 return std::numeric_limits<double>::signaling_NaN();
234 return std::numeric_limits<double>::signaling_NaN();
236 return stats.fSumWX /
fSumW;
260 return std::numeric_limits<double>::signaling_NaN();
263 return stats.fSumWX2 /
fSumW - mean * mean;
304 return std::numeric_limits<double>::signaling_NaN();
309 return std::numeric_limits<double>::signaling_NaN();
313 return (
EWX3 - 3 *
EWX2 * mean + 2 * mean * mean * mean) / std::pow(var, 1.5);
341 return std::numeric_limits<double>::signaling_NaN();
346 return std::numeric_limits<double>::signaling_NaN();
351 return (
EWX4 - 4 *
EWX3 * mean + 6 *
EWX2 * mean * mean - 3 * mean * mean * mean * mean) / (var * var) - 3;
357 template <std::size_t
I, std::size_t
N,
typename... A>
360 using ArgumentType = std::tuple_element_t<
I, std::tuple<A...>>;
362 if constexpr (!std::is_convertible_v<ArgumentType, double>) {
363 throw std::invalid_argument(
"invalid type of argument in RHistStats");
366 if constexpr (
I + 1 <
N) {
371 template <std::size_t
I,
typename... A>
374 using ArgumentType = std::tuple_element_t<
I, std::tuple<A...>>;
376 if constexpr (std::is_convertible_v<ArgumentType, double>) {
383 if constexpr (
I + 1 <
sizeof...(A)) {
388 template <std::size_t
I, std::size_t
N,
typename... A>
391 using ArgumentType = std::tuple_element_t<
I, std::tuple<A...>>;
393 if constexpr (std::is_convertible_v<ArgumentType, double>) {
402 if constexpr (
I + 1 <
N) {
425 template <
typename... A>
426 void Fill(
const std::tuple<A...> &args)
429 throw std::invalid_argument(
"invalid number of arguments to Fill");
453 template <
typename... A>
457 throw std::invalid_argument(
"invalid number of arguments to Fill");
487 template <
typename... A>
490 static_assert(
sizeof...(A) >= 1,
"need at least one argument to Fill");
491 if constexpr (
sizeof...(A) >= 1) {
492 auto t = std::forward_as_tuple(args...);
494 static constexpr std::size_t
N =
sizeof...(A) - 1;
496 throw std::invalid_argument(
"invalid number of arguments to Fill");
502 double w = std::get<N>(t).fValue;
526 throw std::invalid_argument(
"number of dimensions not identical in Add");
531 throw std::invalid_argument(
"the same dimensions must be enabled to combine statistics with Add");
556 throw std::invalid_argument(
"number of dimensions not identical in AddAtomic");
561 throw std::invalid_argument(
"the same dimensions must be enabled to combine statistics with AddAtomic");
596 fSumW2 *= factor * factor;
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Histogram statistics of unbinned values.
void Add(const RHistStats &other)
Add all entries from another statistics object.
void Fill(const std::tuple< A... > &args, RWeight weight)
Fill an entry into this statistics object with a weight.
void FillImpl(const std::tuple< A... > &args)
double ComputeSkewness(std::size_t dim=0) const
Compute the skewness of unbinned values.
void Fill(const A &...args)
Fill an entry into this statistics object.
std::vector< RDimensionStats > fDimensionStats
The sums per dimension.
void Clear()
Clear this statistics object.
void Taint()
Taint this statistics object.
void FillImpl(const std::tuple< A... > &args, double w)
void AddAtomic(const RHistStats &other)
Add all entries from another statistics object using atomic instructions.
double fSumW
The sum of weights.
std::size_t GetNDimensions() const
const RDimensionStats & GetDimensionStats(std::size_t dim=0) const
Get the statistics object for one dimension.
double fSumW2
The sum of weights squared.
void Scale(double factor)
Scale the histogram statistics.
void Fill(const std::tuple< A... > &args)
Fill an entry into this statistics object.
double ComputeNEffectiveEntries() const
Compute the number of effective entries.
void DisableDimension(std::size_t dim)
Disable one dimension of this statistics object.
void CheckArguments(const std::tuple< A... > &args) const
double ComputeVariance(std::size_t dim=0) const
Compute the variance of unbinned values.
void Streamer(TBuffer &)
ROOT Streamer function to throw when trying to store an object of this class.
std::uint64_t GetNEntries() const
void ThrowIfTainted() const
double ComputeMean(std::size_t dim=0) const
Compute the arithmetic mean of unbinned values.
double ComputeKurtosis(std::size_t dim=0) const
Compute the (excess) kurtosis of unbinned values.
RHistStats(std::size_t nDimensions)
Construct a statistics object.
bool IsEnabled(std::size_t dim) const
std::uint64_t fNEntries
The number of entries.
bool fTainted
Whether this object is tainted, in which case read access will throw.
double ComputeStdDev(std::size_t dim=0) const
Compute the standard deviation of unbinned values.
A histogram for aggregation of data along multiple dimensions.
Buffer base class used for serializing objects.
std::enable_if_t< std::is_integral_v< T > > AtomicAdd(T *ptr, T val)
Statistics for one dimension.
void Scale(double factor)
void Add(double x, double w)
void AddAtomic(const RDimensionStats &other)
Add another statistics object using atomic instructions.
void Add(const RDimensionStats &other)
A weight for filling histograms.