LArSoft
v09_90_00
Liquid Argon Software toolkit - https://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 44 of file StatCollector.h.
using lar::util::details::WeightTracker< W >::Weight_t = W |
type of the weight
Definition at line 46 of file StatCollector.h.
|
inline |
Adds the specified weight to the statistics.
Definition at line 49 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 839 of file StatCollector.h.
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 63 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::N().
|
inlinestatic |
Returns the square of the specified value.
Definition at line 77 of file StatCollector.h.
|
inline |
Returns the sum of the weights.
Definition at line 66 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 83 of file StatCollector.h.
|
protected |
total weight
Definition at line 84 of file StatCollector.h.