yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2
YODA::Dbn< 3 > Class Reference

Partial template specialisation with CRTP for x-, y- and z-methods. More...

#include <Dbn.h>

Inheritance diagram for YODA::Dbn< 3 >:
YODA::DbnBase< 3 > YODA::XDbnMixin< Dbn< 3 > > YODA::YDbnMixin< Dbn< 3 > > YODA::ZDbnMixin< Dbn< 3 > >

Public Types

using BaseT = DbnBase< 3 >
 
- Public Types inherited from YODA::DbnBase< 3 >
using BaseT = DbnBase< N >
 
using FillDim = std::integral_constant< size_t, N >
 
using DataSize = std::integral_constant< size_t, 1+2 *(N+1)+(N *(N-1)/2)>
 

Public Member Functions

 Dbn ()
 
 Dbn (const double numEntries, const double sumW, const double sumW2, const double sumWX, const double sumWX2, const double sumWY, const double sumWY2, const double sumWZ, const double sumWZ2, const double sumWXY, const double sumWXZ, const double sumWYZ)
 
 Dbn (const BaseT &other)
 
 Dbn (BaseT &&other)
 
void fill (const std::array< double, 3 > &vals, const double weight=1.0, const double fraction=1.0)
 
void fill (const double valX, const double valY, const double valZ, const double weight=1.0, const double fraction=1.0)
 
- Public Member Functions inherited from YODA::DbnBase< 3 >
 DbnBase ()
 Default constructor of a new distribution.
 
 DbnBase (const double numEntries, const std::array< double, N+1 > &sumW, const std::array< double, N+1 > &sumW2)
 Constructor to set a distribution with a pre-filled state.
 
 DbnBase (const double numEntries, const std::array< double, N+1 > &sumW, const std::array< double, N+1 > &sumW2, const std::array< double, N *(N-1)/2 > &sumWcross)
 Constructor to set a distribution with a pre-filled state.
 
 DbnBase (const DbnBase &)=default
 
 DbnBase (DbnBase &&)=default
 
DbnBaseoperator= (const DbnBase &)=default
 
DbnBaseoperator= (DbnBase &&)=default
 
void fill (const std::array< double, N > vals, const double weight=1.0, const double fraction=1.0)
 Contribute a sample at val (from an array) with weight weight.
 
void fill (Args &&... args)
 Templated convenience overload of fill method.
 
void set (const double numEntries, const std::array< double, N+1 > &sumW, const std::array< double, N+1 > &sumW2, const std::array< double, N *(N-1)/2 > &sumWcross)
 Set a sample with array-based number of entries numEntries, sum of weights sumW (and corresponding moments), sum of squared weights sumW2 (and corresponding moments).
 
void set (const double numEntries, const std::vector< double > &sumW, const std::vector< double > &sumW2, const std::vector< double > &sumWcross={})
 Set a sample with vector-based number of entries numEntries, sum of weights sumW (and corresponding moments), sum of squared weights sumW2 (and corresponding moments).
 
void set (const DbnBase< N > &other)
 Set a sample with other.
 
void set (DbnBase< N > &&other)
 Set a sample with other.
 
void reset ()
 Reset the internal counters.
 
void scaleW (const double scalefactor)
 Rescale as if all fill weights had been different by factor scalefactor.
 
void scale (const size_t dim, const double factor)
 
double errW () const
 The absolute error on sumW.
 
double relErrW () const
 The relative error on sumW.
 
double mean (const size_t i) const
 Weighted mean, $ \bar{x} $, of distribution.
 
double variance (const size_t i) const
 Weighted variance, $ \sigma^2 $, of distribution.
 
double stdDev (const size_t i) const
 Weighted standard deviation, $ \sigma $, of distribution.
 
double stdErr (const size_t i) const
 Weighted standard error on the mean, $ \sim \sigma/\sqrt{N-1} $, of distribution.
 
double relStdErr (const size_t i) const
 Relative weighted standard error on the mean, $ \sim \sigma/\sqrt{N-1} $, of distribution.
 
double RMS (const size_t i) const
 Weighted RMS, $ \sqrt{ \sum{w x^2}/\sum{w} } $, of distribution.
 
double numEntries () const
 Number of entries (number of times fill was called, ignoring weights)
 
double effNumEntries () const
 Effective number of entries $ = (\sum w)^2 / \sum w^2 $.
 
double sumW () const
 The sum of weights.
 
double sumW (const size_t i) const
 The sum of x*weight.
 
double sumW2 () const
 The sum of weights squared.
 
double sumW2 (const size_t i) const
 The sum of x^2*weight.
 
double crossTerm (const size_t A1, const size_t A2) const
 The second-order cross term between axes k and l.
 
size_t dim () const
 
std::string toString () const
 String representation of the DbnBase for debugging.
 
DbnBase< sizeof...(size_t)> reduceTo (size_t... axes) const
 Reduce operation that produces a lower-dimensional DbnBase keeping only the specified axes in the new DbnBase.
 
DbnBase< sizeof...(Is)> reduceTo (std::index_sequence< Is... >) const
 Same as above but using an std::integer_sequence.
 
auto reduce () const
 Reduce operation that produces a lower-dimensional DbnBase removing the specified axes for the new DbnBase.
 
DbnBaseoperator+= (const DbnBase &d)
 Add two DbnBases.
 
DbnBaseoperator+= (DbnBase &&d)
 Add two DbnBases.
 
DbnBaseoperator-= (const DbnBase &d)
 Subtract one DbnBase from another.
 
DbnBaseoperator-= (DbnBase &&d)
 Subtract one DbnBase from another.
 
- Public Member Functions inherited from YODA::XDbnMixin< Dbn< 3 > >
void scaleX (double factor)
 
double xMean () const
 
double xVariance () const
 
double xStdDev () const
 
double xStdErr () const
 
double xRMS () const
 
double sumWX () const
 
double sumWX2 () const
 
- Public Member Functions inherited from YODA::YDbnMixin< Dbn< 3 > >
void scaleY (double factor)
 
void scaleXY (double fx, double fy)
 
double yMean () const
 
double yVariance () const
 
double yStdDev () const
 
double yStdErr () const
 
double yRMS () const
 
double sumWY () const
 
double sumWY2 () const
 
double sumWXY () const
 
- Public Member Functions inherited from YODA::ZDbnMixin< Dbn< 3 > >
void scaleZ (double factor)
 
void scaleXZ (double fx, double fz)
 
void scaleYZ (double fy, double fz)
 
void scaleXYZ (double fx, double fy, double fz)
 
double zMean () const
 
double zVariance () const
 
double zStdDev () const
 
double zStdErr () const
 
double zRMS () const
 
double sumWZ () const
 
double sumWZ2 () const
 
double sumWXZ () const
 
double sumWYZ () const
 

Detailed Description

Partial template specialisation with CRTP for x-, y- and z-methods.

Definition at line 741 of file Dbn.h.

Member Typedef Documentation

◆ BaseT

using YODA::Dbn< 3 >::BaseT = DbnBase<3>

Definition at line 747 of file Dbn.h.

Constructor & Destructor Documentation

◆ Dbn() [1/4]

YODA::Dbn< 3 >::Dbn ( )
inline

Definition at line 751 of file Dbn.h.

751: BaseT() {}
DbnBase< 3 > BaseT
Definition Dbn.h:747

◆ Dbn() [2/4]

YODA::Dbn< 3 >::Dbn ( const double  numEntries,
const double  sumW,
const double  sumW2,
const double  sumWX,
const double  sumWX2,
const double  sumWY,
const double  sumWY2,
const double  sumWZ,
const double  sumWZ2,
const double  sumWXY,
const double  sumWXZ,
const double  sumWYZ 
)
inline

Definition at line 753 of file Dbn.h.

double sumW() const
The sum of weights.
Definition Dbn.h:320
double numEntries() const
Number of entries (number of times fill was called, ignoring weights)
Definition Dbn.h:309
double sumW2() const
The sum of weights squared.
Definition Dbn.h:325
double sumWX2() const
Definition DbnUtils.h:41
double sumWXY() const
Definition DbnUtils.h:73
double sumWY2() const
Definition DbnUtils.h:72

References YODA::DbnBase< N >::sumW().

◆ Dbn() [3/4]

YODA::Dbn< 3 >::Dbn ( const BaseT other)
inline

Definition at line 760 of file Dbn.h.

760: BaseT(other) {}

◆ Dbn() [4/4]

YODA::Dbn< 3 >::Dbn ( BaseT &&  other)
inline

Definition at line 762 of file Dbn.h.

762: BaseT(std::move(other)) {}

Member Function Documentation

◆ fill() [1/2]

void YODA::Dbn< 3 >::fill ( const double  valX,
const double  valY,
const double  valZ,
const double  weight = 1.0,
const double  fraction = 1.0 
)
inline

Definition at line 768 of file Dbn.h.

768 {
769 BaseT::fill({valX, valY, valZ}, weight, fraction);
770 }
void fill(const std::array< double, N > vals, const double weight=1.0, const double fraction=1.0)
Contribute a sample at val (from an array) with weight weight.
Definition Dbn.h:152

References YODA::DbnBase< N >::fill().

◆ fill() [2/2]

void YODA::Dbn< 3 >::fill ( const std::array< double, 3 > &  vals,
const double  weight = 1.0,
const double  fraction = 1.0 
)
inline

Definition at line 764 of file Dbn.h.

764 {
765 BaseT::fill(vals, weight, fraction);
766 }

References YODA::DbnBase< N >::fill().


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