File indexing completed on 2025-12-16 10:29:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROOSTATS_HybridPlot
0017 #define ROOSTATS_HybridPlot
0018
0019 #include <vector>
0020 #include <iostream>
0021
0022 #include "TNamed.h"
0023
0024
0025
0026
0027 #include "TH1.h"
0028
0029 class TLine;
0030 class TLegend;
0031 class TH1;
0032 class TVirtualPad;
0033
0034 namespace RooStats {
0035
0036 class HybridPlot : public TNamed {
0037
0038 public:
0039
0040
0041 HybridPlot(const char* name,
0042 const char* title,
0043 const std::vector<double> & sb_values,
0044 const std::vector<double> & b_values,
0045 double testStat_data,
0046 int n_bins,
0047 bool verbosity=true);
0048
0049
0050 ~HybridPlot() override;
0051
0052
0053 void Draw (const char* options="") override;
0054
0055
0056 void DumpToFile (const char* RootFileName, const char* options);
0057
0058
0059 double GetBmean(){return fB_histo->GetMean();};
0060
0061
0062 double GetBrms(){return fB_histo->GetRMS();};
0063
0064
0065 TH1F * GetBhisto(){return fB_histo;}
0066
0067
0068 double GetBCenter(double n_sigmas=1, bool display=false)
0069 {return GetHistoCenter(fB_histo,n_sigmas,display);};
0070
0071
0072
0073 double* GetBIntExtremes(double frac)
0074 {return GetHistoPvals(fB_histo,frac);};
0075
0076
0077 double GetSBmean(){return fSb_histo->GetMean();};
0078
0079
0080 double GetSBCenter(double n_sigmas=1, bool display=false)
0081 {return GetHistoCenter(fSb_histo,n_sigmas,display);};
0082
0083
0084 double GetSBrms(){return fSb_histo->GetRMS();};
0085
0086
0087
0088 double* GetSBIntExtremes(double frac)
0089 {return GetHistoPvals(fSb_histo,frac);};
0090
0091
0092 TH1F* GetSBhisto(){return fSb_histo;}
0093
0094
0095 TVirtualPad * GetCanvas() { return fPad; }
0096
0097
0098 void DumpToImage (const char* filename);
0099
0100
0101
0102 double GetHistoCenter(TH1* histo, double n_rms=1,bool display_result=false);
0103
0104
0105 double* GetHistoPvals (TH1* histo, double percentage);
0106
0107
0108 double GetMedian(TH1* histo);
0109
0110 private:
0111
0112 TH1F* fSb_histo;
0113 TH1F* fSb_histo_shaded;
0114 TH1F* fB_histo;
0115 TH1F* fB_histo_shaded;
0116 TLine* fData_testStat_line;
0117 TLegend* fLegend;
0118 TVirtualPad * fPad;
0119 bool fVerbose;
0120
0121 ClassDefOverride(HybridPlot,0)
0122 };
0123 }
0124
0125 #endif