RooPlot data statistics box when using RooMCStudy class

Dear roottalkers,

I was (unsuccessfully) trying to set the statistics box on (with event number, mean and rms) when using
RooMCStudy:


RooRealVar nsig(“nsig”,“signal fraction”,1.5E7,1,1E8) ; // p2e signal fraction
RooRealVar nbkg1(“nbkg1”,“background fraction”,1.5E,1,1E8) ; // Michel fraction
RooRealVar nbkg2(“nbkg2”,“background fraction”,1E6,1,1E8) ; // accidental fraction

// model
RooAddPdf tmodel(“tmodel”,“tmodel”,RooArgList(t_p2e,t_mich,t_acc),RooArgList(nsig,nbkg1,nbkg2)) ;


RooMCStudy* mcstudy = new RooMCStudy(tmodel,t,Binned(kTRUE),Silence(),Extended(),
FitOptions(Save(kTRUE),PrintEvalErrors(0))) ;
t.setBins(280) ;
mcstudy->generateAndFit(nsample,nev) ;
RooPlot* frame1 = mcstudy->plotParam(nsig,Bins(10)) ;
frame1->Draw() ;

So, I get a RooPlot of the “signal fraction” nsig (a histogram). What I would like to get is the statisctics
box on that histogram showing the mean and rms of “nsig” parameter for “nsample” number of studies,
but I cannot find a way to do it … ;8-( The syntax should be something like data.statOn(), but what is
a pointer to my data when in RooMCStudy generation & fitting is done with a single command?

                                                                                                   TIA, Emil

Hi Emil,

You can use mcstudy->fitParDataSet(), which returns the RooDataSet that contains all the fit results for this purpose, for your statOn() call.

Wouter

1 Like

Thanks.

          Emil