QCorrelations.hh

Go to the documentation of this file.
00001 
00010 #ifndef __QCORRELATIONS_HH_
00011 #define __QCORRELATIONS_HH_
00012 
00013 #include <iostream>
00014 #include <string>
00015 #include <vector>
00016 #include "QObject.hh"
00017 #include "QMatrix.hh"
00018 #include "QVector.hh"
00019 class TH2D;
00020 
00021 using namespace std; 
00022 
00023 Q_BEGIN_NAMESPACE
00024 
00025 class QCorrelations {
00026 public:
00032   QCorrelations(int nvar,string suff="");
00033 
00038   void StoreHistos(const QVector& min, const QVector& max);
00043   void StoreVectors(int nEntries=10000);
00044  
00049   int Load(const QVector& data);
00050 
00054   double GetCovariance (int i,int j) const;
00055 
00059   QMatrix GetCovariance () const;
00060 
00064   double GetCorrelation (int i,int j) const;
00065 
00066 
00071   TH2D* GetHisto(int i,int j) const {return fHistos[code(i,j)];}
00072 
00077   QVector* GetVec(int i)const ;
00078 
00079   size_t NVars() const { return fNVars;}
00080   
00081   ~QCorrelations();
00082 
00083 private:
00084 
00085   int code (int i, int j) const{ return (i-1)*i/2+j;}// code for the map. Note i>j
00086 
00087   size_t fNVars;
00088   size_t fNevts;
00089   QVector fSums;
00090   QVector fSums2;
00091   QMatrix fCrossSums;
00092   vector<TH2D*> fHistos;
00093   vector<QVector*> fVectors;
00094   string fSuff;
00095 };
00096 
00097 // formatted printout
00098 ostream& operator<<(ostream&s,const QCorrelations&v);
00099 
00100 Q_END_NAMESPACE
00101 
00102 #endif

Generated on Tue Nov 16 10:49:57 2010 for CUORE Software by  doxygen 1.5.6