32void rf802_mcstudy_addons()
41 RooRealVar mean(
"mean",
"mean of gaussian", 0, -2., 1.8);
63 hist_chi2->
SetTitle(
"#chi^{2} values of all toy runs;#chi^{2}");
65 hist_prob->
SetTitle(
"Corresponding #chi^{2} probability;Prob(#chi^{2},ndof)");
72 RooRealVar mean2(
"mean2",
"mean of gaussian 2", 2.);
94 auto pullMeanFrame = mcs2->
plotPull(mean);
105 leg.AddEntry(hist2_chi2,
"Biased fit",
"L");
106 leg.SetBorderSize(0);
109 TCanvas *
c =
new TCanvas(
"rf802_mcstudy_addons",
"rf802_mcstudy_addons", 800, 400);
112 gPad->SetLeftMargin(0.15);
115 hist2_chi2->
Draw(
"esame");
118 gPad->SetLeftMargin(0.15);
121 hist2_prob->
Draw(
"esame");
123 pullMeanFrame->Draw();
RooChi2MCSModule is an add-on module to RooMCStudy that calculates the chi-squared of fitted p....
TH2F * createHistogram(const RooAbsRealLValue &var1, const RooAbsRealLValue &var2, const char *cuts="", const char *name="hist") const
Create a TH2F histogram of the distribution of the specified variable using this dataset.
RooMCStudy is a helper class to facilitate Monte Carlo studies such as 'goodness-of-fit' studies,...
RooPlot * plotPull(const RooRealVar ¶m, 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())
Plot the distribution of pull values for the specified parameter on a newly created frame.
const RooDataSet & fitParDataSet()
Return a RooDataSet containing the post-fit parameters of each toy cycle.
Bool_t generateAndFit(Int_t nSamples, Int_t nEvtPerSample=0, Bool_t keepGenData=kFALSE, const char *asciiFilePat=0)
Generate and fit 'nSamples' samples of 'nEvtPerSample' events.
void addModule(RooAbsMCStudyModule &module)
Insert given RooMCStudy add-on module to the processing chain of this MCStudy object.
RooRealVar represents a variable that can be changed from the outside.
virtual void SetTitleOffset(Float_t offset=1)
Set distance between the axis and the axis title.
virtual void SetFillStyle(Style_t fstyle)
Set the fill area style.
virtual void SetLineColor(Color_t lcolor)
Set the line color.
TH1 is the base class of all histogram classes in ROOT.
virtual void SetTitle(const char *title)
See GetStatOverflows for more information.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
This class displays a legend box (TPaveText) containing several legend entries.
TLegendEntry * AddEntry(const TObject *obj, const char *label="", Option_t *option="lpf")
Add a new entry to this legend.
RooCmdArg Binned(Bool_t flag=kTRUE)
RooCmdArg Silence(Bool_t flag=kTRUE)
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
void FitModel(RooWorkspace *, std::string data_name="obsData")