[RF] Fix RooLognormal analytical integral for xMin < zero#20675
[RF] Fix RooLognormal analytical integral for xMin < zero#20675guitargeek merged 1 commit intoroot-project:masterfrom
Conversation
Just like for other pdfs that are strictly zero for negative observable values, the integral for xMin < zero should still evaluate correctly (compare for example with the RooLandau). Addresses this forum report: https://root-forum.cern.ch/t/roofit-pdfs-with-different-domain-in-the-same-model-e-g-gauss-lognormal/64505/3 Little demo that it works now: ```c++ RooRealVar x("x", "x", 0.0, 10.0); RooRealVar mu("mu", "mu", 1.0); RooRealVar sigma("sigma", "sigma", 0.5); RooLognormal logn("logn", "lognormal pdf", x, mu, sigma); double a = -1.0; double b = 5.0; x.setRange("intRange", -1.0, 5.0); RooAbsReal* integral = logn.createIntegral(x, RooFit::NormSet(x), RooFit::Range("intRange")); double result = integral->getVal(); std::cout << "Integral of Lognormal from " << a << " to " << b << " = " << result << std::endl; ```
Test Results 21 files 21 suites 3d 18h 53m 37s ⏱️ For more details on these failures, see this check. Results for commit 3721cac. |
lmoneta
left a comment
There was a problem hiding this comment.
LGTM!
I am not sure why somebody wants to integrate up to negative value, it should not make sense to use a region where the pdf is not defined and it is probably an error in the use case.
The case of the Landau distribution is different, since the Landau is defined and valid for negative values.
|
That is true. It's debatable whether a lognormal over a negative domain makes sense. But here we had no choice if we want to be consistent. Evaluating a RooLognormal for x < 0 gives zero and not NaN, so the integral needs to be consistent with that if we don't want to confuse users |
Just like for other pdfs that are strictly zero for negative observable values, the integral for xMin < zero should still evaluate correctly (compare for example with the RooLandau).
Addresses this forum report:
https://root-forum.cern.ch/t/roofit-pdfs-with-different-domain-in-the-same-model-e-g-gauss-lognormal/64505/3
Little demo that it works now: