BCH1D.h

Go to the documentation of this file.
00001 #ifndef __BCH1D__H
00002 #define __BCH1D__H
00003 
00015 /*
00016  * Copyright (C) 2008, Daniel Kollar and Kevin Kroeninger.
00017  * All rights reserved.
00018  *
00019  * For the licensing terms see doc/COPYING.
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 
00180       double GetSmallestInterval(double & min, double & max, double content=.68);
00181 
00182       TH1D * GetSmallestIntervalHistogram(double level);
00183 
00184       std::vector <double> GetSmallestIntervals(double content = 0.68);
00185 
00191       double IntegralWidth(double min, double max);
00192 
00202       TH1D * GetSubHisto(double min, double max, const char * name);
00203 
00204       /* @} */
00205 
00206    private:
00207 
00210       TH1D * fHistogram;
00211 
00214       double fDefaultCLLimit;
00215 
00218       double fMode;
00219 
00222       int fModeFlag;
00223 
00224 };
00225 
00226 // ---------------------------------------------------------
00227 
00228 #endif

Generated on Thu Feb 11 11:29:30 2010 for BayesianAnalysisToolkit by  doxygen 1.5.1