LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "StatCollector.h"
Public Types | |
using | Weight_t = W |
type of the weight More... | |
Public Member Functions | |
void | add (Weight_t weight) |
Adds the specified weight to the statistics. More... | |
void | clear () |
Resets the count. More... | |
int | N () const |
Returns the number of entries added. More... | |
Weight_t | Weights () const |
Returns the sum of the weights. More... | |
Weight_t | AverageWeight () const |
Returns the arithmetic average of the weights. More... | |
Static Public Member Functions | |
template<typename V > | |
static constexpr V | sqr (V const &v) |
Returns the square of the specified value. More... | |
Protected Attributes | |
int | n = 0 |
number of added entries More... | |
Weight_t | w = Weight_t(0) |
total weight More... | |
Class tracking the number of entries and their total weight
W | type of the weight |
Definition at line 48 of file StatCollector.h.
using lar::util::details::WeightTracker< W >::Weight_t = W |
type of the weight
Definition at line 50 of file StatCollector.h.
|
inline |
Adds the specified weight to the statistics.
Definition at line 53 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::add().
lar::util::details::WeightTracker< W >::Weight_t lar::util::details::WeightTracker< W >::AverageWeight | ( | ) | const |
Returns the arithmetic average of the weights.
std::range_error | if no entry was added |
Definition at line 841 of file StatCollector.h.
References lar::util::StatCollector< T, W >::add().
Referenced by lar::util::details::FitDataCollector< T, D >::AverageUncertainty().
|
inline |
Resets the count.
Definition at line 56 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::clear().
|
inline |
Returns the number of entries added.
Definition at line 59 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::N().
|
inlinestatic |
Returns the square of the specified value.
Definition at line 74 of file StatCollector.h.
|
inline |
Returns the sum of the weights.
Definition at line 62 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::Print(), lar::util::details::FitDataCollector< T, D >::SumExtractor< Power, 0U >::Sum(), and lar::util::details::FitDataCollector< T, D >::XN().
|
protected |
number of added entries
Definition at line 77 of file StatCollector.h.
|
protected |
total weight
Definition at line 78 of file StatCollector.h.