00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __BCH1D__H
00022 #define __BCH1D__H
00023
00024 #include <vector>
00025
00026 #include <TH1.h>
00027
00028 #include "BCLog.h"
00029
00030
00031
00032 class BCH1D
00033 {
00034
00035 public:
00036
00038
00039
00043 BCH1D();
00044
00048 ~BCH1D();
00049
00050
00051
00053
00054
00058 TH1D* GetHistogram()
00059 { return fHistogram; };
00060
00064 double GetMean()
00065 { return fHistogram -> GetMean(); };
00066
00070 double GetMode();
00071
00075 double GetMedian()
00076 { return this -> GetQuantile(0.5); };
00077
00084 double GetQuantile(double probablity);
00085
00092 double GetLimit(double probability)
00093 { return this -> GetQuantile(probability); };
00094
00098 double GetRMS()
00099 { return fHistogram -> GetRMS(); };
00100
00107 double GetIntegral(double valuemin, double valuemax);
00108
00115 double GetPValue(double probability);
00116
00117
00118
00120
00121
00125 void SetHistogram(TH1D * hist)
00126 { fHistogram = hist; };
00127
00132 void SetDefaultCLLimit(double limit);
00133
00137 void SetGlobalMode(double mode)
00138 { fMode=mode; fModeFlag=1; };
00139
00140
00141
00143
00144
00154 void Print(const char * filename, int options=0, double ovalue=0., int ww=0, int wh=0);
00155
00174 void Draw(int options=0, double ovalue=0.);
00175
00181 void DrawShadedLimits(double mode, double min, double max, double limit=0);
00182
00188 void DrawSmallest(double mode, double prob, bool drawmean=true);
00189
00196 void GetSmallestInterval(double & min, double & max, double content=.68);
00197
00198 TH1D * GetSmallestIntervalHistogram(double level);
00199
00200 std::vector <double> GetSmallestIntervals(double content = 0.68);
00201
00208 double IntegralWidth(double min, double max);
00209
00220 TH1D * GetSubHisto(double min, double max, const char * name);
00221
00222
00223
00224 private:
00225
00229 TH1D * fHistogram;
00230
00234 double fDefaultCLLimit;
00235
00239 double fMode;
00240
00244 int fModeFlag;
00245
00246 };
00247
00248
00249
00250 #endif