I am doing a toy MC study using RooMCStudy.
I have different generating and fit pdf. For my generating pdf, I am using the Extended() option which I believe samples the generated number of events according to Poisson distribution.
I can plot the pull distributions for all variables without any problems as solved in this post:
I want to know the generated value of the number of signal and background for each toy experiment. How can I do that?
I know how to obtain the fitted values of parameters for each toy experiment but no success in doing the same for generated values.
For my fit result I get the following message:
1> The fit parameter ‘n1f’ is not in the model that was used to generate toy data. The parameter ‘n1’=4529 was found at the same position in the generator model. It will be used to compute pulls. (n1 is signal yield). But since I am using the Extended() option, n1 generated should be different for every toy experiment ? The same problem with the background yields.
The relevant piece of code:
RooMCStudy *mcstudy = new RooMCStudy(simPdf,RooArgSet(x,y),Extended(),FitModel(simPdf_f),FitOptions(NumCPU(4),Save(kTRUE),PrintEvalErrors(0),Minos(1)));
Similar questions asked in this post:
clarification on the issue will be really helpfull