00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROOSTATS_HybridPlot
00017 #define ROOSTATS_HybridPlot
00018
00019 #include <vector>
00020 #include <iostream>
00021
00022 #ifndef ROOT_TNamed
00023 #include "TNamed.h"
00024 #endif
00025
00026
00027
00028 #include "TH1.h"
00029
00030
00031 class TLine;
00032 class TLegend;
00033 class TH1;
00034 class TVirtualPad;
00035
00036
00037 namespace RooStats {
00038
00039 class HybridPlot : public TNamed {
00040
00041 public:
00042
00043
00044 HybridPlot(const char* name,
00045 const char* title,
00046 const std::vector<double> & sb_values,
00047 const std::vector<double> & b_values,
00048 double testStat_data,
00049 int n_bins,
00050 bool verbosity=true);
00051
00052
00053 ~HybridPlot();
00054
00055
00056 void Draw (const char* options="");
00057
00058
00059 void DumpToFile (const char* RootFileName, const char* options);
00060
00061
00062 double GetBmean(){return fB_histo->GetMean();};
00063
00064
00065 double GetBrms(){return fB_histo->GetRMS();};
00066
00067
00068 TH1F * GetBhisto(){return fB_histo;}
00069
00070
00071 double GetBCenter(double n_sigmas=1, bool display=false)
00072 {return GetHistoCenter(fB_histo,n_sigmas,display);};
00073
00074
00075 double* GetBIntExtremes(double frac)
00076 {return GetHistoPvals(fB_histo,frac);};
00077
00078
00079 double GetSBmean(){return fSb_histo->GetMean();};
00080
00081
00082 double GetSBCenter(double n_sigmas=1, bool display=false)
00083 {return GetHistoCenter(fSb_histo,n_sigmas,display);};
00084
00085
00086 double GetSBrms(){return fSb_histo->GetRMS();};
00087
00088
00089 double* GetSBIntExtremes(double frac)
00090 {return GetHistoPvals(fSb_histo,frac);};
00091
00092
00093 TH1F* GetSBhisto(){return fSb_histo;}
00094
00095
00096 TVirtualPad * GetCanvas() { return fPad; }
00097
00098
00099 void DumpToImage (const char* filename);
00100
00101
00102
00103 double GetHistoCenter(TH1* histo, double n_rms=1,bool display_result=false);
00104
00105
00106 double* GetHistoPvals (TH1* histo, double percentage);
00107
00108
00109 double GetMedian(TH1* histo);
00110
00111 private:
00112
00113 TH1F* fSb_histo;
00114 TH1F* fSb_histo_shaded;
00115 TH1F* fB_histo;
00116 TH1F* fB_histo_shaded;
00117 TLine* fData_testStat_line;
00118 TLegend* fLegend;
00119 TVirtualPad * fPad;
00120 bool fVerbose;
00121
00122 ClassDef(HybridPlot,1)
00123 };
00124 }
00125
00126 #endif