RooBinSamplingPdf broken in root version 6.26 or later

I have encountered a “bug” in RooBinSamplingPdf introduced in root version 6.26

When I minimise a RooBinSamplingPdf I get the following error:

[#0] WARNING:Eval -- Evaluating RooAddPdf without a defined normalization set. This can lead to ambiguos coefficients definition and incorrect results. Use RooAddPdf::fixCoefNormalization(nset) to provide a normalization set for defining uniquely RooAddPdf coefficients!

This error does not occur in version 6.24.06.

I have attached a root program that works in 6.24 and fails inversion 6.26 as well as the log of the output.

Code:
TestRoot.C (3.6 KB)

Log file:
log.txt (394.3 KB)

@Jonas Here is the problem I noted.

Additional information if required: I have built this version of root on a Mac OS 12.6:

  | Built for macosx64 on Nov 16 2022, 10:42:54                      |
  | From tags/v6-26-10@v6-26-10                                      |
  | With Apple clang version 13.0.0 (clang-1300.0.29.3)              |

Hi @Iain_Bertram1,

thanks for reporting!

This is not a bug, but a new printout that warns the user if a RooAddPdf is evaluated without a well-defined set of normalization observables, in which case the result could be wrong. See: Add a warning message when the RooAddPdf normalization set is not defined (ROOT-10814) by lmoneta · Pull Request #7129 · root-project/root · GitHub

You can get rid of the warning by fixing the normalization set manually for the RooAddPdf in your script:

RooArgSet normSet{mass};
ThreeParamBackgroundOnlyPDF->fixCoefNormalization(normSet);

This change is also backwards compatible with older ROOT versions.

I don’t think in your script, the evaluation without defined normalization set lead to wrong results, because even if I add the fixCoefNormalization call to the script, the result doesn’t change. But it’s still better to put it to make sure the computation is well defined and you get rid of the warnings.

I hope this helps, and sorry for the inconvenience from printing out this new warning in 6.26!

Jonas

Thanks @Jonas for the quick reply and fix…

It did make an enormous difference when working with RooBinSamplingPdf. Without it the fit was not converging and the pulls were awful in 26.10 where it worked with 24.06. So the change is more than just a warning in this case…

I would like to note that this does not appear in any of the tutorials and I find the documentation here to be confusing and couldn’t work out how to actually implement the required fix to the problem from the error message or the RooAddPdf page.

Okay, if for 6.26 the fit result was right and for 6.24 it was wrong, then it’s a bug indeed.

I understand, this new error message is confusing and it’s not good that it happens. I’m trying to improve the RooFit internals such that an evaluation without normalization set of a RooAddPdf can’t happen to begin with, and then you will also not see the error anymore.

So I hope that with the developments done after 6.26, I have already fixed your problem and you can the upcoming ROOT 6.28 or the next 6.26 patch release again. I’m quite certain this commit fixed it: [RF] Re-implement multi-range fits by guitargeek · Pull Request #11455 · root-project/root · GitHub.

If you have a moment to do me a favor, can you try it out if it actually works for your usecase? If you are on lxplus, you can just source the current ROOT master from the nightlies and try out your scripts: Nightlies - ROOT.

If you don’t have access to lxplus and also not the time to compile ROOT master to try it, no worries!

Cheers,
Jonas

For some reason could not get the nightly to setup and work on lxplus.

Will try and build locally.

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