Skip to content

Commit cde3b9b

Browse files
authored
[RF] Implement checking param range (#19258)
* [RF] Check range of Breit-Wigner * [RF] Check range of Chi-Square * [RF] Check param range of BifurGauss * [RF] Check param range of Poisson
1 parent fcd0d45 commit cde3b9b

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

roofit/roofit/src/RooBifurGauss.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ side of maximum value.
2424
#include <RooBifurGauss.h>
2525

2626
#include "RooBatchCompute.h"
27+
#include "RooHelpers.h"
2728

2829
#include <RooFit/Detail/MathFuncs.h>
2930

@@ -39,6 +40,7 @@ RooBifurGauss::RooBifurGauss(const char *name, const char *title, RooAbsReal &_x
3940
sigmaR("sigmaR", "Right Sigma", this, _sigmaR)
4041

4142
{
43+
RooHelpers::checkRangeOfParameters(this, {&_sigmaL, &_sigmaR}, 0.);
4244
}
4345

4446
////////////////////////////////////////////////////////////////////////////////

roofit/roofit/src/RooBreitWigner.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ that models a non-relativistic Breit-Wigner shape
2727

2828
#include "RooBreitWigner.h"
2929
#include "RooRealVar.h"
30+
#include "RooHelpers.h"
3031
#include "RooBatchCompute.h"
3132

3233

@@ -40,6 +41,7 @@ RooBreitWigner::RooBreitWigner(const char *name, const char *title,
4041
mean("mean","Mean",this,_mean),
4142
width("width","Width",this,_width)
4243
{
44+
RooHelpers::checkRangeOfParameters(this, {&_width}, 0.);
4345
}
4446

4547
////////////////////////////////////////////////////////////////////////////////

roofit/roofit/src/RooChiSquarePdf.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Here we also implement the analytic integral.
1818
#include "RooChiSquarePdf.h"
1919
#include "RooRealVar.h"
2020
#include "RooBatchCompute.h"
21+
#include "RooHelpers.h"
2122

2223
#include "TMath.h"
2324

@@ -39,6 +40,7 @@ RooChiSquarePdf::RooChiSquarePdf(const char* name, const char* title,
3940
_x("x", "Dependent", this, x),
4041
_ndof("ndof","ndof", this, ndof)
4142
{
43+
RooHelpers::checkRangeOfParameters(this, {&x, &ndof}, 0.);
4244
}
4345

4446
////////////////////////////////////////////////////////////////////////////////

roofit/roofit/src/RooPoisson.cxx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,19 @@ Poisson pdf
1717
#include "RooMath.h"
1818
#include "RooNaNPacker.h"
1919
#include "RooBatchCompute.h"
20+
#include "RooHelpers.h"
2021

2122
#include <RooFit/Detail/MathFuncs.h>
2223

2324
#include <array>
2425

26+
////////////////////////////////////////////////////////////////////////////////
27+
/// Constructor
2528

26-
////////////////////////////////////////////////////////////////////////////////
27-
/// Constructor
28-
29-
RooPoisson::RooPoisson(const char *name, const char *title,
30-
RooAbsReal::Ref _x,
31-
RooAbsReal::Ref _mean,
32-
bool noRounding) :
33-
RooAbsPdf(name,title),
34-
x("x","x",this,_x),
35-
mean("mean","mean",this,_mean),
36-
_noRounding(noRounding)
37-
{
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.);
3833
}
3934

4035
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)