BCH2D.h

Go to the documentation of this file.
00001 #ifndef __BCH2D__H
00002 #define __BCH2D__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 // ROOT classes
00027 class TH1D;
00028 class TH2D;
00029 class TGraph;
00030 
00031 // ---------------------------------------------------------
00032 
00033 class BCH2D
00034 {
00035 
00036    public:
00037 
00039       /* @{ */
00040 
00043       BCH2D();
00044 
00047       BCH2D(TH2D * h);
00048 
00051       ~BCH2D();
00052 
00053       /* @} */
00055       /* @{ */
00056 
00059       TH2D * GetHistogram()
00060          { return fHistogram; };
00061 
00064 //    void GetMean(double& mean);
00065 
00068       void GetMode(double& mode);
00069 
00070       /* @} */
00072       /* @{ */
00073 
00076       void SetHistogram(TH2D * hist)
00077          { fHistogram = hist; };
00078 
00082       void SetGlobalMode(double mode[2])
00083          { fMode[0] = mode[0]; fMode[1] = mode[1]; fModeFlag =1; };
00084 
00085       /* @} */
00087       /* @{ */
00088 
00096       void Print(const char * filename, int options=0, int ww=0, int wh=0);
00097 
00102       void Draw(int options=0, bool drawmode=true);
00103 
00104       /*
00105        * Calculates the integral of the distribution as a function of the
00106        * height. */
00107       void CalculateIntegratedHistogram();
00108 
00109       /*
00110        * Calculates the height below which the integrated probability has
00111        * a certain value.
00112        * @param p The integrated probability in the region below the height to be estimated. */
00113       double GetLevel(double p);
00114 
00120       std::vector <int> GetNIntervalsY(TH2D * h, int &nfoundmax);
00121 
00124       TGraph * GetLowestBandGraph(TH2D * h, std::vector<int> nint);
00125       TGraph * GetLowestBandGraph(TH2D * h);
00126 
00127 
00128       std::vector <double> GetLevelBoundary(double level);
00129       std::vector <double> GetLevelBoundary(TH2D * h, double level);
00130       TGraph * GetBandGraph(double level1, double level2);
00131       TGraph * GetBandGraph(TH2D * h , double level1, double level2);
00132 
00133 //    TGraph ** GetBandGraphs(TH2D * h);
00134       TGraph ** GetBandGraphs(TH2D * h, int &n);
00135 
00136       /* @} */
00137 
00138    private:
00139 
00142       TH2D * fHistogram;
00143 
00146       TH1D * fIntegratedHistogram;
00147 
00150       double fMode[2];
00151 
00154       int fModeFlag;
00155 
00156 };
00157 
00158 // ---------------------------------------------------------
00159 
00160 #endif

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