ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/algomez/Stops/BATLimits/statistics.hh
Revision: 1.1
Committed: Thu Sep 5 03:58:17 2013 UTC (11 years, 8 months ago) by algomez
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Log Message:
First version

File Contents

# User Rev Content
1 algomez 1.1 #ifndef __STATISTICS_HH__
2     #define __STATISTICS_HH__
3    
4     #include <vector>
5    
6     #include "fit.hh"
7    
8     class TF1;
9     class TH1D;
10     class TGraph;
11    
12     // lognormal distribution where par[0] is the median and par[1] is the variance
13     double lognormal(double *x, double *par);
14     // gaussian distribution where par[0] is the median and par[1] is the variance
15     double gaussian(double *x, double *par);
16     // gamma distribution where par[0] is the median and par[1] is the variance
17     double gamma(double *x, double *par);
18    
19     // evaluate the interval given a posterior distribution, alpha, and left side tail
20     std::pair<double, double> evaluateInterval(TGraph* posterior, double alpha=0.05, double leftsidetail=0.0);
21    
22     // get the quantiles for a set of numbers/limits
23     void getQuantiles(std::vector<double>& limits, double &median, std::pair<double, double>& onesigma, std::pair<double, double>& twosigma);
24    
25     // get a random lognormal value given a value for the median and variance
26     class RandomPrior
27     {
28     public:
29     RandomPrior(int priorType, double median, double variance, double min, double max);
30     virtual ~RandomPrior();
31    
32     double getRandom(void) const;
33     double getXmin(void) const;
34     double getXmax(void) const;
35     double eval(double x) const;
36     int getPriorType(void) const;
37    
38     private:
39    
40     TF1* priorfcn_;
41     static int counter_;
42     int priorType_;
43     };
44    
45    
46     #endif