Generating samples in RooMCStudy

Dear experts,

I am using RooMCStudy to generate and fit with the model in this way:

RooMCStudy mcstudy(*MCPdf, *m, Binned(kTRUE), FitModel(*Pdf), Extended(), FitOptions(Save(kTRUE), PrintEvalErrors(0)));
mcstudy.generateAndFit(1000, 0, kFALSE,0);

here I set the number of signal (N_sig) to be around 50 000, but in generateAndFit(), the number of events is 0. I am wondering if this “0” here means “setting the default value of the one I input”?
Because if I changed the 0 to be 100 000, then the pull of the N_sig will not in the range around 0. Since I didn’t find the explanation in ROOT classlist, do you have any idea about it?


I guess @moneta can help you.


Passing 0 for the number of event per sample (nEvtSample in RooMCStudy::generateAndFit ) means that the expected number of events ( pdf->expectedEvents(obs)) will be used.
SInce your model is extended this number will fluctuate according to a Poisson distribution around the expected number of events.
If you instead pass a non-zero value the number of events per sample will fluactuate around that new given value

Best regards


Hi @moneta,

Thanks for your response!


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.