54 using namespace RooFit;
55 using namespace RooStats;
62 Double_t lowRange = -1, highRange =5;
94 Error(
"rs_bernsteinCorrection",
"Bernstein correction failed ! ");
98 cout <<
" Correction based on Bernstein Poly of degree " << degree << endl;
110 if (!corrected)
return;
129 bool checkSamplingDist =
true;
132 TCanvas*
c1 =
new TCanvas();
133 if(checkSamplingDist) {
140 if(checkSamplingDist) {
143 TH1F* samplingDist =
new TH1F(
"samplingDist",
"",20,0,10);
144 TH1F* samplingDistExtra =
new TH1F(
"samplingDistExtra",
"",20,0,10);
145 bernsteinCorrection.
CreateQSamplingDist(wks,
"nominal",
"x",
"data",samplingDist, samplingDistExtra, degree,numToyMC);
148 samplingDistExtra->SetLineColor(
kRed);
149 samplingDistExtra->Draw();
150 samplingDist->Draw(
"same");
RooCmdArg LineColor(Color_t color)
RooCmdArg PrintLevel(Int_t code)
static void SetDefaultPrintLevel(int level)
RooAbsPdf * pdf(const char *name) const
Retrieve p.d.f (RooAbsPdf) with given name. A null pointer is returned if not found.
RooCmdArg LineStyle(Style_t style)
Int_t ImportCorrectedPdf(RooWorkspace *, const char *, const char *, const char *)
Main method for Bernstein correction.
void rs_bernsteinCorrection()
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
Plot dataset on specified frame.
void Error(const char *location, const char *msgfmt,...)
RooRealVar represents a fundamental (non-derived) real valued object.
static const std::string & DefaultMinimizerType()
virtual RooPlot * plotOn(RooPlot *frame, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none(), const RooCmdArg &arg9=RooCmdArg::none(), const RooCmdArg &arg10=RooCmdArg::none()) const
Plot (project) PDF on specified frame.
RooCmdArg Minimizer(const char *type, const char *alg=0)
RooCmdArg Rename(const char *suffix)
RooPlot * frame(const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none()) const
RooDataSet is a container class to hold unbinned data.
A RooPlot is a plot frame and a container for graphics objects within that frame. ...
void CreateQSamplingDist(RooWorkspace *wks, const char *nominalName, const char *varName, const char *dataName, TH1F *, TH1F *, Int_t degree, Int_t nToys=500)
Create sampling distribution for q given degree-1 vs. degree corrections.
RooConstVar & RooConst(Double_t val)
RooAbsPdf is the abstract interface for all probability density functions The class provides hybrid a...
Bool_t import(const RooAbsArg &arg, const RooCmdArg &arg1=RooCmdArg(), const RooCmdArg &arg2=RooCmdArg(), const RooCmdArg &arg3=RooCmdArg(), const RooCmdArg &arg4=RooCmdArg(), const RooCmdArg &arg5=RooCmdArg(), const RooCmdArg &arg6=RooCmdArg(), const RooCmdArg &arg7=RooCmdArg(), const RooCmdArg &arg8=RooCmdArg(), const RooCmdArg &arg9=RooCmdArg())
Import a RooAbsArg object, e.g.
RooDataSet * generate(const RooArgSet &whatVars, Int_t nEvents, const RooCmdArg &arg1, const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none())
Generate a new dataset containing the specified variables with events sampled from our distribution...
virtual RooFitResult * fitTo(RooAbsData &data, const RooCmdArg &arg1=RooCmdArg::none(), const RooCmdArg &arg2=RooCmdArg::none(), const RooCmdArg &arg3=RooCmdArg::none(), const RooCmdArg &arg4=RooCmdArg::none(), const RooCmdArg &arg5=RooCmdArg::none(), const RooCmdArg &arg6=RooCmdArg::none(), const RooCmdArg &arg7=RooCmdArg::none(), const RooCmdArg &arg8=RooCmdArg::none())
Fit PDF to given dataset.
BernsteinCorrection is a utility in RooStats to augment a nominal PDF with a polynomial correction te...
static void SetDefaultMinimizer(const char *type, const char *algo=0)
The RooWorkspace is a persistable container for RooFit projects.
virtual void Draw(Option_t *options=0)
Draw this plot and all of the elements it contains.