Dear Expert,
I am using ROOMCStudy for the toy study.
I want to make the pull distribution calculated by RooMCStudy using the below piece of code:
RooMCStudy *mcs = new RooMCStudy(model, RooArgSet(mD0, mD0pi), Binned(true), Extended(), Silence(), FitOptions(Save(kTRUE), PrintEvalErrors(0)));
mcs->generateAndFit(500, 145072, true);
RooPlot* frame1 = mcs->plotParam(sig_peak_yield, Bins(100)) ;
frame1->SetTitle("Distribution of fitted signal yield") ;
RooPlot* frame2 = mcs->plotError(sig_peak_yield, Bins(100),FitGauss(false)) ;
frame2->SetTitle("Distribution of fit uncertainty on signal yield") ;
RooPlot* frame3 = mcs->plotPull(sig_peak_yield, Bins(100),FitGauss(false)) ;
frame3->SetTitle("Distribution of signal yield pull") ;
TCanvas* c = new TCanvas("TestPulls","TestPulls",1200,400);
c->Divide(3, 2) ;
c->cd(1) ; gPad->SetLeftMargin(0.15) ; frame1->GetYaxis()->SetTitleOffset(1.4) ; frame1->Draw() ;
c->cd(2) ; gPad->SetLeftMargin(0.15) ; frame2->GetYaxis()->SetTitleOffset(1.4) ; frame2->Draw() ;
c->cd(3) ; gPad->SetLeftMargin(0.15) ; frame3->GetYaxis()->SetTitleOffset(1.4) ; frame3->Draw() ;
Here fitted yield seems fine but the pull does not seem good (not around zero).
As far as I know, the pull definition is pull(nsig) = ( Nsig_fit - Nsig_true ) / error_Nfit. but how Nsig_true is taken?
Here is the complete code that I am using:
toy_data_new.C (13.8 KB)
Can you please comment on this and suggest to improve this?
Regards
Chanchal