Issue: plotPull in RooMCStudy with diff. gen and fit model

Hi,

Although I don’t hope to get any answer given my previous experience, here I report something that I expected to find in RooMCStudy and it does not provide. :frowning:

I have RooKeysPdf for my genModel and the fitModel is a complicated RooExtendPdf.
I want to check the pull for the normalization after fit and the code crashes (the normalization paramete and its error are retrieved easily).

I checked in this example
https://root.cern/doc/master/rf802__mcstudy__addons_8C.html

if I ask for a pull of “mean” of the model I get the following error:

[#0] ERROR:InputArguments -- RooDataSet::getRange(fitParData_gauss_gauss2) ERROR: unknown variable: meanpull
[#0] ERROR:InputArguments -- RooDataSet::moment(fitParData_gauss_gauss2) ERROR: unknown variable: meanpull
[#0] WARNING:InputArguments -- RooDataSet::fitParData_gauss_gauss2:fillHistogram: WARNING: data does not contain variable: meanpull

So is it really the case that when the same parameter is not in (pseudo)data, MCStudy cannot give the pull?
Or do I miss something more fundumental?

Thanks,
Nadjieh

Have you solved this issue ?

Hi, are there any news on this? Has somebody solved it?

@Wouter_Verkerke is the author of this macro. May be he can tell more about it. Also @moneta may have some ideas about it.

I solved it. You can track the progress here:
https://sft.its.cern.ch/jira/browse/ROOT-10242

The whole thing is not too easy because mean2 and mean in this example are physically different parameters. It’s not really clear that you have to subtract one from the other to get a pull distribution.
I used simple heuristics to make it work, though:
If the parameter used to generate is different from the one used to fit, it will find the position of the fit parameter in the input set, and subtract the parameter at the same position in the set of generator parameters.

That should work most of the time, but it may fail for complicated models. Anyway, it’s warning users when it is about to do this.
The crash has also been fixed.

Edit:
When the patch is merged into ROOT master, you can test it the following day by obtaining a nightly build:
https://root.cern/nightlies