RooProfileLL RooMinuit instance is deleted?

Hi,

I’m seeing some strange behaviour from RooProfileLL. I can create an instance of this class from a RooNLLVar using:

RooAbsReal * likelihood = ws.pdf("combinedMod")->createNLL(jointData); RooProfileLL * profile = dynamic_cast<RooProfileLL*>(likelihood->createProfile(*ws.var("nSig")));
and plot it using:

RooPlot * sigFrame = ws.var("nSig")->frame(Range(0.0, 100.0)); profile->plotOn(sigFrame); sigFrame->Draw();
Which results in the following message (among others) being printed:

[quote][#1] INFO:Minization – RooProfileLL::evaluate(nll_combinedMod_jointData_with_constr_Profile[nSig]) Creating instance of MINUIT
[/quote]
All fine so far. However, trying to find the most likely observable or parameter values using:

or

results in a segmentation fault when attempting to call the RooMinuit::migrad() method. Here’s the stack trace:

[quote]#5 0x0000000104144a7c in RooMinuit::migrad ()
#6 0x000000010417509a in RooProfileLL::validateAbsMin ()
#7 0x0000000104175da1 in RooProfileLL::bestFitObs ()
#8 0x00000001048ef9d7 in RoofitTest ()
[/quote]
After a bit of investigation it seems like the instance of RooMinuit created during the plotting operation is not persistent because explicitly calling:

at any point within the code always returns a null pointer. Is this a bug or am I doing something stupid? I can of course explicitly perform the required minimisation steps myself with another instance of RooMinuit but should this actually be necessary?

Any solutions or suggestions would be most welcome,

Cheers,

Hugh