RooMCStudy not working at all

I tried the simple example extracted from a RooFit powerpoint talk:

{
RooMCS  RooRealVar x("x","x",5,10);
RooRealVar mean("mean","mean of gaussian",1);
RooRealVar sigma("sigma", "width of gaussian",3);
RooGaussian gauss("gauss", "gaussian PDF",x,mean,sigma);
RooMCStudy manager(gauss, gauss,x,"","emh");
manager.generateAndFit(100,10);
}

on Root Versions 5.22, 5.20, 5.13 across 3 different computers and they all crash. I must be missing something very important.

James

Hi,

Can you try the modern RooMCStudy constructor?
E.g.

RooMCStudy manager(gauss,x,FitOptions(“mhv”))

This will work fine. It looks like I broke the ‘legacy’ ctor a long time
ago without noticing. I will fix the legacy ctor form in the next
release again. Sorry about that.

Wouter

Hi James,

I have meanwhile found the problem in the ‘classic’ constructor and applied the fix to the dev/roostats branch. The fix will also be in the 5.24 pro release later this month. I can also confirm now that this problem will not occur if you use the named argument ctor of RooMCStudy.

Wouter