Skip to content

Commit def074c

Browse files
committed
[RF] Fix allowed range for RooPoisson parameters
Notably, the limits of `[0, inf]` should be included in the allowed range. This should be backported to 6.38 to avoid a warning that would otherwise happen all over HistFactory. This follows up on cde3b9b.
1 parent e4894ad commit def074c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

roofit/roofit/src/RooPoisson.cxx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ Poisson pdf
1414

1515
#include "RooPoisson.h"
1616
#include "RooRandom.h"
17-
#include "RooMath.h"
1817
#include "RooNaNPacker.h"
1918
#include "RooBatchCompute.h"
2019
#include "RooHelpers.h"
2120

2221
#include <RooFit/Detail/MathFuncs.h>
2322

2423
#include <array>
24+
#include <limits>
2525

26-
////////////////////////////////////////////////////////////////////////////////
27-
/// Constructor
26+
////////////////////////////////////////////////////////////////////////////////
27+
/// Constructor
2828

29-
RooPoisson::RooPoisson(const char *name, const char *title, RooAbsReal::Ref _x, RooAbsReal::Ref _mean, bool noRounding)
30-
: RooAbsPdf(name, title), x("x", "x", this, _x), mean("mean", "mean", this, _mean), _noRounding(noRounding)
31-
{
32-
RooHelpers::checkRangeOfParameters(this, {&static_cast<RooAbsReal &>(_x), &static_cast<RooAbsReal &>(_mean)}, 0.);
29+
RooPoisson::RooPoisson(const char *name, const char *title, RooAbsReal::Ref _x, RooAbsReal::Ref _mean, bool noRounding)
30+
: RooAbsPdf(name, title), x("x", "x", this, _x), mean("mean", "mean", this, _mean), _noRounding(noRounding)
31+
{
32+
RooHelpers::checkRangeOfParameters(
33+
/*callingClass=*/this, /*pars=*/{&x.arg(), &mean.arg()}, /*min=*/0.,
34+
/*max=*/std::numeric_limits<double>::infinity(),
35+
/*limitsInAllowedRange=*/true);
3336
}
3437

3538
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)