00001 #ifndef STATISTICS_HEADER
00002 #define STATISTICS_HEADER
00003
00004 #include <iostream.h>
00005 #include <stdlib.h>
00006 #include <string>
00007 #include <vector>
00008 #include <map>
00009
00010 #include "TFile.h"
00011 #include "TH1D.h"
00012 #include "TH2D.h"
00013 #include "TObject.h"
00014
00015 using namespace std;
00016
00017 class Statistics : public TObject {
00018
00019 public:
00020 Statistics();
00021 ~Statistics();
00022
00023 static Double_t MAXIT() { return 100; }
00024 static Double_t EPS() { return 3.0e-7; }
00025 static Double_t EPS1() { return 0.001; }
00026 static Double_t EPS2() { return 1.0e-8; }
00027 static Double_t FPMIN() { return 1.0e-30; }
00028 static Double_t Max(Double_t val1, Double_t val2);
00029 static Double_t Max(vector<Double_t> vector);
00030 static Double_t Min(Double_t val1, Double_t val2);
00031 static Double_t Min(vector<Double_t> vector);
00032 static Double_t Mean(vector<Double_t> vector);
00033 static Double_t Average(vector<Double_t> vector);
00034 static Double_t Variance(vector<Double_t> vector);
00035 static Double_t BiasedVariance(vector<Double_t> vector);
00036 static Double_t UnbiasedVariance(vector<Double_t> vector);
00037 static Double_t Covariance(vector<Double_t> v1, vector<Double_t> v2);
00038 static Double_t StandardDeviation(vector<Double_t> vector);
00039 static Double_t BiasedStandardDeviation(vector<Double_t> vector);
00040 static Double_t UnbiasedStandardDeviation(vector<Double_t> vector);
00041 static Double_t RMS(vector<Double_t> vector);
00042 static map<string, Double_t> ChiSquareTest(vector<Double_t> v1, vector<Double_t> v2, int nbins);
00043 static map<string, Double_t> KSTest(vector<Double_t> v1, vector<Double_t> v2);
00044 static map<string, Double_t> BinnedKSTest(vector<Double_t> v1, vector<Double_t> v2, int nbins);
00045 static map<string, Double_t> BinnedKSTestRoot(vector<Double_t> v1, vector<Double_t> v2, int nbins);
00046 static vector<Double_t> SortBubble(vector<Double_t> vector);
00047 static vector<int> GetSortedIndex(vector<Double_t> vector);
00048 static Double_t CalculateKSProbability(Double_t alam);
00049 static Double_t Entropy(vector<Double_t> vector);
00050 static Double_t MutualEntropy(vector<Double_t> vector1, vector<Double_t> vector2);
00051 static map<string, Double_t> FTest(vector<Double_t> vector1, vector<Double_t> vector2);
00052 static map<string, Double_t> TTestForEqualVariances(vector<Double_t> vector1, vector<Double_t> vector2);
00053 static map<string, Double_t> TTestForUnequalVariances(vector<Double_t> vector1, vector<Double_t> vector2);
00054 static Double_t IncompleteBetaFunction(Double_t a, Double_t b, Double_t x);
00055 static Double_t IncompleteBetaFunctionContinuedFraction(Double_t a, Double_t b, Double_t x);
00056 static Double_t IncompleteGammaFunctionQ(Double_t a, Double_t x);
00057 static Double_t IncompleteGammaFunctionQContinuedFraction(Double_t a, Double_t x);
00058 static Double_t IncompleteGammaFunctionPSeries(Double_t a, Double_t x);
00059 static Double_t LogOfGammaFunction(Double_t x);
00060 static Double_t Correlation(vector<Double_t> cv1, vector<Double_t> cv2);
00061 static Double_t RandomPoisson(Double_t *x, Double_t *par);
00062
00063 ClassDef(Statistics, 1)
00064 };
00065 #endif