CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AutocorrelationAnalyzer.cc
Go to the documentation of this file.
2 #include <iostream>
3 #include <cassert>
4 
6 : theSize(size),
7  theNTotal(0),
8  theMeans(size, 0),
9  theCovariances(theSize, 0),
10  theCorrelations(theSize, 0),
11  calculated_(false)
12 {
13 }
14 
15 
17 {
18  if(!calculated_) calculate();
19  assert(i < theSize);
20  return theMeans[i];
21 }
22 
23 
25 {
26  if(!calculated_) calculate();
27  assert(i<=theSize && j<=theSize);
28  return theCovariances(i+1,j+1);
29 }
30 
31 
33 {
34  if(!calculated_) calculate();
35  assert(i<=theSize && j<=theSize);
36  return theCorrelations(i+1,j+1);
37 }
38 
39 
40 
42 {
43  for(int k = 0; k < theSize; ++k)
44  {
45  theMeans[k] /= theNTotal;
46  for (int kk = k; kk < theSize; kk++)
47  {
49  }
50  }
51 
52  for (int k = 0; k < theSize; k++)
53  {
54  for (int kk = k; kk < theSize; kk++)
55  {
58  }
59  }
60 
61  calculated_ = true;
62 }
63 
64 
65 std::ostream & operator<<(std::ostream & os, AutocorrelationAnalyzer & aa)
66 {
67  aa.calculate();
68  os << "Means: " << std::endl << aa.theMeans << std::endl;
69  os << "Covariances: " << std::endl << aa.theCovariances << std::endl;
70  os << "Correlations: " << std::endl << aa.theCorrelations << std::endl;
71  return os;
72 }
73 
int i
Definition: DBlmapReader.cc:9
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
T sqrt(T t)
Definition: SSEVec.h:46
int j
Definition: DBlmapReader.cc:9
int k[5][pyjets_maxn]
double mean(int i)
indexing starts from 0
CLHEP::HepSymMatrix theCorrelations
double covariance(int i, int j)
double correlation(int i, int j)
CLHEP::HepSymMatrix theCovariances
tuple size
Write out results.