#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 |
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.
|
inline |
Resets the count.
Definition at line 56 of file StatCollector.h.
|
inline |
|
inlinestatic |
Returns the square of the specified value.
Definition at line 74 of file StatCollector.h.
|
inline |
|
protected |
number of added entries
Definition at line 77 of file StatCollector.h.
|
protected |
total weight
Definition at line 78 of file StatCollector.h.