12 #ifndef ROOSTATS_SamplingDistPlot
13 #define ROOSTATS_SamplingDistPlot
31 class SamplingDistPlot :
public TNamed,
public RooPrintable {
35 SamplingDistPlot(Int_t nbins = 100);
36 SamplingDistPlot(Int_t nbins, Double_t min, Double_t max);
40 virtual ~SamplingDistPlot();
43 Double_t AddSamplingDistribution(
const SamplingDistribution *samplingDist, Option_t *drawOptions=
"NORMALIZE HIST");
46 Double_t AddSamplingDistributionShaded(
const SamplingDistribution *samplingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions=
"NORMALIZE HIST");
49 void AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2,
const char* title = NULL);
51 void AddTH1(TH1* h, Option_t *drawOptions=
"");
53 void AddTF1(TF1* f,
const char* title = NULL, Option_t *drawOptions=
"SAME");
55 void SetLegend(TLegend* l){ fLegend = l; }
57 void Draw(Option_t *options=0);
60 void ApplyDefaultStyle(
void);
62 void SetLineColor(Color_t color,
const SamplingDistribution *samplDist = 0);
63 void SetLineWidth(Width_t lwidth,
const SamplingDistribution *samplDist = 0);
64 void SetLineStyle(Style_t style,
const SamplingDistribution *samplDist = 0);
66 void SetMarkerColor(Color_t color,
const SamplingDistribution *samplDist = 0);
67 void SetMarkerStyle(Style_t style,
const SamplingDistribution *samplDist = 0);
68 void SetMarkerSize(Size_t size,
const SamplingDistribution *samplDist = 0);
70 void RebinDistribution(Int_t rebinFactor,
const SamplingDistribution *samplDist = 0);
72 void SetAxisTitle(
char *varName) { fVarName = TString(varName); }
76 void SetApplyStyle(Bool_t s) { fApplyStyle = s; }
82 TH1F* GetTH1F(
const SamplingDistribution *samplDist = NULL);
83 TH1 * GetHistogram(
const SamplingDistribution *samplDist = NULL) {
return GetTH1F(samplDist); }
87 RooPlot * GetPlot() {
return fRooPlot; }
90 void SetLogXaxis(Bool_t lx) { fLogXaxis = lx; }
92 void SetLogYaxis(Bool_t ly) { fLogYaxis = ly; }
95 void SetXRange(
double mi,
double ma ) { fXMin = mi; fXMax = ma; }
97 void SetYRange(
double mi,
double ma ) { fYMin = mi; fYMax = ma; }
100 void DumpToFile(
const char* RootFileName, Option_t *option=
"",
const char *ftitle=
"", Int_t compress = ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault);
103 std::vector<Double_t> fSamplingDistr;
104 std::vector<Double_t> fSampleWeights;
121 TIterator* fIterator;
126 double fXMin, fXMax, fYMin, fYMax;
131 void SetSampleWeights(
const SamplingDistribution *samplingDist);
133 void addObject(TObject *obj, Option_t *drawOptions=0);
134 void addOtherObject(TObject *obj, Option_t *drawOptions=0);
135 void GetAbsoluteInterval(Double_t &theMin, Double_t &theMax, Double_t &theYMax)
const;
137 ClassDef(SamplingDistPlot,1)