From 1e2ea8e8e1983a264703adac4e03d860130f9d2b Mon Sep 17 00:00:00 2001 From: Jonas Rembser Date: Mon, 17 Nov 2025 11:46:33 +0100 Subject: [PATCH] [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 cde3b9beb900d9. --- roofit/roofit/src/RooPoisson.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/roofit/roofit/src/RooPoisson.cxx b/roofit/roofit/src/RooPoisson.cxx index f3e0a475d6dd4..d7d7d9374c443 100644 --- a/roofit/roofit/src/RooPoisson.cxx +++ b/roofit/roofit/src/RooPoisson.cxx @@ -14,7 +14,6 @@ Poisson pdf #include "RooPoisson.h" #include "RooRandom.h" -#include "RooMath.h" #include "RooNaNPacker.h" #include "RooBatchCompute.h" #include "RooHelpers.h" @@ -22,14 +21,18 @@ Poisson pdf #include #include +#include - //////////////////////////////////////////////////////////////////////////////// - /// Constructor +//////////////////////////////////////////////////////////////////////////////// +/// Constructor - RooPoisson::RooPoisson(const char *name, const char *title, RooAbsReal::Ref _x, RooAbsReal::Ref _mean, bool noRounding) - : RooAbsPdf(name, title), x("x", "x", this, _x), mean("mean", "mean", this, _mean), _noRounding(noRounding) - { - RooHelpers::checkRangeOfParameters(this, {&static_cast(_x), &static_cast(_mean)}, 0.); +RooPoisson::RooPoisson(const char *name, const char *title, RooAbsReal::Ref _x, RooAbsReal::Ref _mean, bool noRounding) + : RooAbsPdf(name, title), x("x", "x", this, _x), mean("mean", "mean", this, _mean), _noRounding(noRounding) +{ + RooHelpers::checkRangeOfParameters( + /*callingClass=*/this, /*pars=*/{&x.arg(), &mean.arg()}, /*min=*/0., + /*max=*/std::numeric_limits::infinity(), + /*limitsInAllowedRange=*/true); } ////////////////////////////////////////////////////////////////////////////////