Main Page
Namespaces
Classes
Package Documentation
TrackingTools
DetLayers
interface
simple_stat.h
Go to the documentation of this file.
1
#ifndef TrackingTools_DetLayers_simple_stat_h
2
#define TrackingTools_DetLayers_simple_stat_h
3
4
#include <algorithm>
5
#include <numeric>
6
#include <cmath>
7
12
template
<
class
CONT>
13
double
stat_mean
(
const
CONT & cont) {
14
double
sum = accumulate (cont.begin(), cont.end(), 0.);
15
return
sum / cont.size();
16
}
17
23
template
<
class
CONT>
24
double
stat_RMS
(
const
CONT & cont) {
25
26
typename
CONT::const_iterator
i
;
27
28
int
N
= cont.size();
29
if
(N > 1) {
30
double
sum=0.,
sum2
=0.;
31
for
(i=cont.begin(); i!=cont.end(); i++) {
32
sum += *
i
;
33
sum2
+= (*i) * (*i);
34
}
35
return
sqrt
(
std::max
( 0., (
sum2
- sum*sum/N) / (N-1))) ;
36
}
37
else
return
0.;
38
}
39
40
#endif // TrackingTools_DetLayers_simple_stat_h
mps_fire.i
i
Definition:
mps_fire.py:338
stat_mean
double stat_mean(const CONT &cont)
Definition:
simple_stat.h:13
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:24
SiStripPI::max
Definition:
SiStripPayloadInspectorHelper.h:178
N
#define N
Definition:
blowfish.cc:9
Generated for CMSSW Reference Manual by
1.8.11