Go to the documentation of this file.00001 #ifndef __BCH1D__H
00002 #define __BCH1D__H
00003
00022
00023
00024 #include <vector>
00025
00026 #include <TH1.h>
00027
00028
00029
00030 class BCH1D
00031 {
00032 public:
00033
00039 BCH1D();
00040
00043 BCH1D(TH1D * hist)
00044 { fHistogram = hist; };
00045
00048 ~BCH1D();
00049
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
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
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 DrawLegend(const char* text);
00180
00187 double GetSmallestInterval(double & min, double & max, double content=.68);
00188
00189 TH1D * GetSmallestIntervalHistogram(double level);
00190
00191 std::vector <double> GetSmallestIntervals(double content = 0.68);
00192
00198 double IntegralWidth(double min, double max);
00199
00209 TH1D * GetSubHisto(double min, double max, const char * name);
00210
00213 private:
00214
00217 TH1D * fHistogram;
00218
00221 double fDefaultCLLimit;
00222
00225 double fMode;
00226
00229 int fModeFlag;
00230
00231 };
00232
00233
00234
00235 #endif