All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Types | List of all members
lar::util::details::DataTracker2< T, W, PWR > Class Template Reference

Class tracking sums of variables up to power 2. More...

#include <StatCollector.h>

Inheritance diagram for lar::util::details::DataTracker2< T, W, PWR >:
lar::util::details::DataTracker< PWR, T, W > lar::util::details::DataTracker3< T, W, PWR >

Public Types

using Weight_t = typename Base_t::Weight_t
 
- Public Types inherited from lar::util::details::DataTracker< PWR, T, W >
using Data_t = T
 type of data More...
 
using Weight_t = T
 type of weight More...
 

Public Member Functions

Weight_t SumSq () const
 Returns the weighted sum of the square of the entries. More...
 
- Public Member Functions inherited from lar::util::details::DataTracker< PWR, T, W >
 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...
 

Private Types

using Base_t = DataTracker< PWR, T, W >
 base class type More...
 

Additional Inherited Members

- Static Public Attributes inherited from lar::util::details::DataTracker< PWR, T, W >
static constexpr unsigned int Power = PWR
 
- Protected Attributes inherited from lar::util::details::DataTracker< PWR, T, W >
std::array< Weight_t, Powersums
 

Detailed Description

template<typename T, typename W = T, unsigned int PWR = 2>
class lar::util::details::DataTracker2< T, W, PWR >

Class tracking sums of variables up to power 2.

Template Parameters
Ttype of the quantity
Wtype of the weight (as T by default)

Definition at line 141 of file StatCollector.h.

Member Typedef Documentation

template<typename T, typename W = T, unsigned int PWR = 2>
using lar::util::details::DataTracker2< T, W, PWR >::Base_t = DataTracker<PWR, T, W>
private

base class type

Definition at line 142 of file StatCollector.h.

template<typename T, typename W = T, unsigned int PWR = 2>
using lar::util::details::DataTracker2< T, W, PWR >::Weight_t = typename Base_t::Weight_t

Definition at line 146 of file StatCollector.h.

Member Function Documentation

template<typename T, typename W = T, unsigned int PWR = 2>
Weight_t lar::util::details::DataTracker2< T, W, PWR >::SumSq ( ) const
inline

Returns the weighted sum of the square of the entries.

Definition at line 149 of file StatCollector.h.

150  { return Base_t::sums[1]; }
std::array< Weight_t, Power > sums

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