00001 #ifndef __BCH1D__H
00002 #define __BCH1D__H
00003
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <vector>
00025
00026 #include <TH1.h>
00027
00028
00029
00030 class BCH1D
00031 {
00032 public:
00033
00035
00036
00039 BCH1D();
00040
00043 BCH1D(TH1D * hist)
00044 { fHistogram = hist; };
00045
00048 ~BCH1D();
00049
00050
00051
00053
00054
00057 TH1D * GetHistogram()
00058 { return fHistogram; };
00059
00062 double GetMean()
00063 { return fHistogram -> GetMean(); };
00064
00067 double GetMode();
00068
00071 double GetMedian()
00072 { return this -> GetQuantile(0.5); };
00073
00079 double GetQuantile(double probablity);
00080
00086 double GetLimit(double probability)
00087 { return this -> GetQuantile(probability); };
00088
00091 double GetRMS()
00092 { return fHistogram -> GetRMS(); };
00093
00099 double GetIntegral(double valuemin, double valuemax);
00100
00106 double GetPValue(double probability);
00107
00108
00109
00111
00112
00115 void SetHistogram(TH1D * hist)
00116 { fHistogram = hist; };
00117
00121 void SetDefaultCLLimit(double limit);
00122
00125 void SetGlobalMode(double mode)
00126 { fMode=mode; fModeFlag=1; };
00127
00128
00129
00131
00132
00141 void Print(const char * filename, int options=0, double ovalue=0., int ww=0, int wh=0);
00142
00160 void Draw(int options=0, double ovalue=0.);
00161
00166 void DrawShadedLimits(double mode, double min, double max, double limit=0);
00167
00172 void DrawSmallest(double mode, double prob, bool drawmean=true);
00173
00179 void GetSmallestInterval(double & min, double & max, double content=.68);
00180
00181 TH1D * GetSmallestIntervalHistogram(double level);
00182
00183 std::vector <double> GetSmallestIntervals(double content = 0.68);
00184
00190 double IntegralWidth(double min, double max);
00191
00201 TH1D * GetSubHisto(double min, double max, const char * name);
00202
00203
00204
00205 private:
00206
00209 TH1D * fHistogram;
00210
00213 double fDefaultCLLimit;
00214
00217 double fMode;
00218
00221 int fModeFlag;
00222
00223 };
00224
00225
00226
00227 #endif