src
CommonTools
Statistics
interface
Accumulator.h
Go to the documentation of this file.
1
#ifndef Statistics_Accumulator_h
2
#define Statistics_Accumulator_h
3
9
#include <iosfwd>
10
#include <cmath>
11
12
class
Accumulator
{
13
public
:
14
Accumulator
();
15
16
void
addEntry
(
double
value
,
double
weight
= 1.);
17
18
double
mean
()
const
;
19
20
double
variance
()
const
;
21
22
double
sigma
()
const
{
return
std::sqrt
(
variance
()); }
23
24
double
weightedMean
()
const
;
25
26
unsigned
long
nEntries
()
const
{
return
n_
; }
27
28
private
:
29
double
sum_
;
30
double
sumOfSquares_
;
31
double
weightedSum_
;
32
double
sumOfWeights_
;
33
unsigned
long
n_
;
34
};
35
36
std::ostream&
operator<<
(std::ostream& os,
const
Accumulator
&
stat
);
37
38
#endif
Accumulator::nEntries
unsigned long nEntries() const
Definition:
Accumulator.h:26
Accumulator::Accumulator
Accumulator()
Definition:
Accumulator.cc:4
stat
Accumulator::addEntry
void addEntry(double value, double weight=1.)
Definition:
Accumulator.cc:6
Accumulator::weightedSum_
double weightedSum_
Definition:
Accumulator.h:31
weight
Definition:
weight.py:1
Accumulator::n_
unsigned long n_
Definition:
Accumulator.h:33
Accumulator
Definition:
Accumulator.h:12
Accumulator::sum_
double sum_
Definition:
Accumulator.h:29
operator<<
std::ostream & operator<<(std::ostream &os, const Accumulator &stat)
Definition:
Accumulator.cc:24
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:23
Accumulator::sigma
double sigma() const
Definition:
Accumulator.h:22
value
Definition:
value.py:1
Accumulator::mean
double mean() const
Definition:
Accumulator.cc:14
Accumulator::weightedMean
double weightedMean() const
Definition:
Accumulator.cc:22
Accumulator::variance
double variance() const
Definition:
Accumulator.cc:16
Accumulator::sumOfSquares_
double sumOfSquares_
Definition:
Accumulator.h:30
Accumulator::sumOfWeights_
double sumOfWeights_
Definition:
Accumulator.h:32
Generated for CMSSW Reference Manual by
1.8.14