LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Class tracking sums of variables up to a specified power. More...
#include "StatCollector.h"
Public Types | |
using | Data_t = T |
type of data More... | |
using | Weight_t = T |
type of weight More... | |
Public Member Functions | |
DataTracker () | |
Default constructor. More... | |
void | add (Data_t v, Weight_t w) |
Adds the specified weight to the statistics. More... | |
void | clear () |
Resets the count. More... | |
template<unsigned int N> | |
Weight_t | SumN () const |
Returns the sum of the values to the power N (1 <= N <= 2) More... | |
Weight_t | Sum (unsigned int n) const |
Returns the sum of the values to the power n (1 <= n <= 2, no check) More... | |
Weight_t | Sum () const |
Returns the weighted sum of the entries. More... | |
Static Public Attributes | |
static constexpr unsigned int | Power = PWR |
Protected Attributes | |
std::array< Weight_t, Power > | sums |
Class tracking sums of variables up to a specified power.
Power | power up to which to collect statistics |
T | type of the quantity |
W | type of the weight (as T by default) |
Note that statistics of order 0 (that is, pertaining only weights) are not collected.
Definition at line 98 of file StatCollector.h.
using lar::util::details::DataTracker< PWR, T, W >::Data_t = T |
type of data
Definition at line 103 of file StatCollector.h.
using lar::util::details::DataTracker< PWR, T, W >::Weight_t = T |
type of weight
Definition at line 104 of file StatCollector.h.
|
inline |
|
inline |
Adds the specified weight to the statistics.
Definition at line 110 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::add().
|
inline |
Resets the count.
Definition at line 118 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::clear().
|
inline |
Returns the sum of the values to the power n (1 <= n <= 2, no check)
Definition at line 129 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::Print(), and lar::util::details::FitDataCollector< T, D >::XNY().
|
inline |
Returns the weighted sum of the entries.
Definition at line 132 of file StatCollector.h.
|
inline |
Returns the sum of the values to the power N (1 <= N <= 2)
Definition at line 122 of file StatCollector.h.
|
static |
Definition at line 100 of file StatCollector.h.
Referenced by lar::util::details::FitDataCollector< T, D >::Print().
|
protected |
Definition at line 135 of file StatCollector.h.