Commit 4224d9a
committed
[RF] Fix RooLognormal analytical integral for xMin < zero
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;
```
(cherry picked from commit 7ffaf51)1 parent 87dd853 commit 4224d9a
1 file changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
0 commit comments