00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOSTATS_SamplingDistPlot
00013 #define ROOSTATS_SamplingDistPlot
00014
00015 #include "RooList.h"
00016 #include "RooPrintable.h"
00017 #include "TNamed.h"
00018 #include "TIterator.h"
00019 #include "TH1F.h"
00020 #include "TLegend.h"
00021
00022 #ifndef ROOSTATS_SamplingDistribution
00023 #include "RooStats/SamplingDistribution.h"
00024 #endif
00025
00026 #ifndef ROO_PLOT
00027 #include "RooPlot.h"
00028 #endif
00029
00030
00031 namespace RooStats {
00032
00033 class SamplingDistPlot : public TNamed, public RooPrintable {
00034
00035 public:
00036
00037 SamplingDistPlot(Int_t nbins = 100);
00038
00039
00040
00041 virtual ~SamplingDistPlot() {}
00042
00043
00044 Double_t AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST");
00045
00046
00047 Double_t AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions="NORMALIZE HIST");
00048
00049
00050 void AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char* title = NULL);
00051
00052 void Draw(Option_t *options=0);
00053
00054
00055 void ApplyDefaultStyle(void);
00056
00057 void SetLineColor(Color_t color, const SamplingDistribution *samplDist = 0);
00058 void SetLineWidth(Width_t lwidth, const SamplingDistribution *samplDist = 0);
00059 void SetLineStyle(Style_t style, const SamplingDistribution *samplDist = 0);
00060
00061 void SetMarkerColor(Color_t color, const SamplingDistribution *samplDist = 0);
00062 void SetMarkerStyle(Style_t style, const SamplingDistribution *samplDist = 0);
00063 void SetMarkerSize(Size_t size, const SamplingDistribution *samplDist = 0);
00064
00065 void RebinDistribution(Int_t rebinFactor, const SamplingDistribution *samplDist = 0);
00066
00067 void SetAxisTitle(char *varName) { fVarName = TString(varName); }
00068
00069
00070
00071 void SetApplyStyle(Bool_t s) { fApplyStyle = s; }
00072
00073
00074
00075
00076 TH1F* GetTH1F(const SamplingDistribution *samplDist);
00077
00078
00079 void SetLogXaxis(Bool_t lx) { fLogXaxis = lx; }
00080
00081 void SetLogYaxis(Bool_t ly) { fLogYaxis = ly; }
00082
00083
00084 void DumpToFile(const char* RootFileName, Option_t *option="", const char *ftitle="", Int_t compress=1);
00085
00086 private:
00087 std::vector<Double_t> fSamplingDistr;
00088 std::vector<Double_t> fSampleWeights;
00089
00090 Bool_t fIsWeighted;
00091
00092 Int_t fBins;
00093 Int_t fMarkerType;
00094 Int_t fColor;
00095
00096 TString fVarName;
00097
00098 protected:
00099
00100 TH1F* fHist;
00101 TLegend *fLegend;
00102
00103 RooList fItems;
00104 RooList fOtherItems;
00105 TIterator* fIterator;
00106 RooPlot* fRooPlot;
00107 Bool_t fLogXaxis;
00108 Bool_t fLogYaxis;
00109
00110 Bool_t fApplyStyle;
00111 Style_t fFillStyle;
00112
00113 void SetSampleWeights(const SamplingDistribution *samplingDist);
00114
00115 void addObject(TObject *obj, Option_t *drawOptions=0);
00116 void addOtherObject(TObject *obj, Option_t *drawOptions=0);
00117 void GetAbsoluteInterval(Float_t &theMin, Float_t &theMax, Float_t &theYMax) const;
00118
00119 ClassDef(SamplingDistPlot,1)
00120 };
00121 }
00122
00123 #endif