24namespace Experimental {
124 throw std::logic_error(
"statistics are tainted, for example after setting bin contents or slicing");
135 throw std::invalid_argument(
"nDimensions must be > 0");
170 throw std::invalid_argument(
"dimension is disabled");
201 throw std::invalid_argument(
"number of dimensions not identical in Add");
208 throw std::invalid_argument(
"the same dimensions must be enabled to combine statistics with Add");
227 throw std::invalid_argument(
"number of dimensions not identical in Add");
234 throw std::invalid_argument(
"the same dimensions must be enabled to combine statistics with Add");
266 return std::numeric_limits<double>::signaling_NaN();
284 return std::numeric_limits<double>::signaling_NaN();
286 return stats.fSumWX /
fSumW;
310 return std::numeric_limits<double>::signaling_NaN();
313 return stats.fSumWX2 /
fSumW - mean * mean;
354 return std::numeric_limits<double>::signaling_NaN();
359 return std::numeric_limits<double>::signaling_NaN();
363 return (
EWX3 - 3 *
EWX2 * mean + 2 * mean * mean * mean) / std::pow(var, 1.5);
391 return std::numeric_limits<double>::signaling_NaN();
396 return std::numeric_limits<double>::signaling_NaN();
401 return (
EWX4 - 4 *
EWX3 * mean + 6 *
EWX2 * mean * mean - 3 * mean * mean * mean * mean) / (var * var) - 3;
405 template <std::size_t
I,
typename... A>
408 using ArgumentType = std::tuple_element_t<
I, std::tuple<A...>>;
410 if constexpr (std::is_convertible_v<ArgumentType, double>) {
413 throw std::invalid_argument(
"invalid type of argument in RHistStats");
416 if constexpr (
I + 1 <
sizeof...(A)) {
421 template <std::size_t
I, std::size_t
N,
typename... A>
424 using ArgumentType = std::tuple_element_t<
I, std::tuple<A...>>;
426 if constexpr (std::is_convertible_v<ArgumentType, double>) {
431 throw std::invalid_argument(
"invalid type of argument in RHistStats");
434 if constexpr (
I + 1 <
N) {
454 template <
typename... A>
455 void Fill(
const std::tuple<A...> &args)
458 throw std::invalid_argument(
"invalid number of arguments to Fill");
479 template <
typename... A>
483 throw std::invalid_argument(
"invalid number of arguments to Fill");
510 template <
typename... A>
513 static_assert(
sizeof...(A) >= 1,
"need at least one argument to Fill");
514 if constexpr (
sizeof...(A) >= 1) {
515 auto t = std::forward_as_tuple(args...);
517 static constexpr std::size_t
N =
sizeof...(A) - 1;
519 throw std::invalid_argument(
"invalid number of arguments to Fill");
522 double w = std::get<N>(t).fValue;
540 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.
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.
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.