#ifndef ROOSTATS_SamplingDistPlot
#define ROOSTATS_SamplingDistPlot
#include "RooList.h"
#include "RooPrintable.h"
#include "TNamed.h"
#include "TIterator.h"
#include "TH1F.h"
#include "TLegend.h"
#ifndef ROOSTATS_SamplingDistribution
#include "RooStats/SamplingDistribution.h"
#endif
#ifndef ROO_PLOT
#include "RooPlot.h"
#endif
namespace RooStats {
class SamplingDistPlot : public TNamed, public RooPrintable {
public:
SamplingDistPlot(Int_t nbins = 100);
virtual ~SamplingDistPlot() {}
Double_t AddSamplingDistribution(const SamplingDistribution *samplingDist, Option_t *drawOptions="NORMALIZE HIST");
Double_t AddSamplingDistributionShaded(const SamplingDistribution *samplingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions="NORMALIZE HIST");
void AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const char* title = NULL);
void Draw(Option_t *options=0);
void ApplyDefaultStyle(void);
void SetLineColor(Color_t color, const SamplingDistribution *samplDist = 0);
void SetLineWidth(Width_t lwidth, const SamplingDistribution *samplDist = 0);
void SetLineStyle(Style_t style, const SamplingDistribution *samplDist = 0);
void SetMarkerColor(Color_t color, const SamplingDistribution *samplDist = 0);
void SetMarkerStyle(Style_t style, const SamplingDistribution *samplDist = 0);
void SetMarkerSize(Size_t size, const SamplingDistribution *samplDist = 0);
void RebinDistribution(Int_t rebinFactor, const SamplingDistribution *samplDist = 0);
void SetAxisTitle(char *varName) { fVarName = TString(varName); }
void SetApplyStyle(Bool_t s) { fApplyStyle = s; }
TH1F* GetTH1F(const SamplingDistribution *samplDist);
void SetLogXaxis(Bool_t lx) { fLogXaxis = lx; }
void SetLogYaxis(Bool_t ly) { fLogYaxis = ly; }
void DumpToFile(const char* RootFileName, Option_t *option="", const char *ftitle="", Int_t compress=1);
private:
std::vector<Double_t> fSamplingDistr;
std::vector<Double_t> fSampleWeights;
Bool_t fIsWeighted;
Int_t fBins;
Int_t fMarkerType;
Int_t fColor;
TString fVarName;
protected:
TH1F* fHist;
TLegend *fLegend;
RooList fItems;
RooList fOtherItems;
TIterator* fIterator;
RooPlot* fRooPlot;
Bool_t fLogXaxis;
Bool_t fLogYaxis;
Bool_t fApplyStyle;
Style_t fFillStyle;
void SetSampleWeights(const SamplingDistribution *samplingDist);
void addObject(TObject *obj, Option_t *drawOptions=0);
void addOtherObject(TObject *obj, Option_t *drawOptions=0);
void GetAbsoluteInterval(Float_t &theMin, Float_t &theMax, Float_t &theYMax) const;
ClassDef(SamplingDistPlot,1)
};
}
#endif