Main Page
Namespaces
Classes
Package Documentation
TrackingTools
DetLayers
interface
simple_stat.h
Go to the documentation of this file.
1
#include <numeric>
2
#include <cmath>
3
8
template
<
class
CONT>
9
double
stat_mean
(
const
CONT & cont) {
10
double
sum = accumulate (cont.begin(), cont.end(), 0.);
11
return
sum / cont.size();
12
}
13
19
template
<
class
CONT>
20
double
stat_RMS
(
const
CONT & cont) {
21
22
typename
CONT::const_iterator
i
;
23
24
int
N
= cont.size();
25
if
(N > 1) {
26
double
sum=0.,
sum2
=0.;
27
for
(i=cont.begin(); i!=cont.end(); i++) {
28
sum += *
i
;
29
sum2
+= (*i) * (*i);
30
}
31
return
sqrt
(
std::max
( 0., (
sum2
- sum*sum/N) / (N-1))) ;
32
}
33
else
return
0.;
34
}
i
int i
Definition:
DBlmapReader.cc:9
hpstanc_transforms.max
max
Definition:
hpstanc_transforms.py:5
stat_mean
double stat_mean(const CONT &cont)
Definition:
simple_stat.h:9
combinedConstraintHelpers::sum2
void sum2(T &x, T y)
Definition:
CombinedKinematicConstraintT.h:74
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
stat_RMS
double stat_RMS(const CONT &cont)
Definition:
simple_stat.h:20
N
#define N
Definition:
blowfish.cc:9
Generated for CMSSW Reference Manual by
1.8.11