-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Implement checking param range #19258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
It would be misleading. '[skip-CI]' indicates changes that have no functional effect, which is not the case for this commit/PR. |
I don't think we have a trigger on removing the tag. Since this PR is still awaiting more changes (including tests?), I move the PR is draft mode. For this PR, the CI will run only with one the maintainer launching it. Please let us know when it is ready to run the CI, for example by marking it as ready for review. |
Thank you very much for making the first step towards closing that PR! Personally, I have not addressed this issue because of two reasons:
But you are right, it's of course better to do something rather than to do nothing :) So let's maybe implement the checks for 2 or 3 more commonly used classes so we can claim success. What about |
@@ -39,6 +40,7 @@ RooChiSquarePdf::RooChiSquarePdf(const char* name, const char* title, | |||
_x("x", "Dependent", this, x), | |||
_ndof("ndof","ndof", this, ndof) | |||
{ | |||
RooHelpers::checkRangeOfParameters(this, {&_ndof}, 0.); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RooHelpers::checkRangeOfParameters(this, {&_ndof}, 0.); | |
RooHelpers::checkRangeOfParameters(this, {&_x, &_ndof}, 0.); |
Also the x variable for the chi2 pdf should be positive. If not, users will get NaN pdf/likelihood values, so it's good to warn about this too!
@@ -45,6 +46,7 @@ RooExponential::RooExponential(const char *name, const char *title, RooAbsReal & | |||
c{"c", "Exponent", this, coefficient}, | |||
_negateCoefficient{negateCoefficient} | |||
{ | |||
RooHelpers::checkRangeOfParameters(this, {&coefficient}, 0.); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RooHelpers::checkRangeOfParameters(this, {&coefficient}, 0.); |
This should not be done, as the class can be used to model both exponential decreases and increases
@@ -64,6 +65,7 @@ RooDecay::RooDecay(const char *name, const char *title, | |||
_basisExp = declareBasis("exp(-abs(@0)/@1)",tau) ; | |||
break ; | |||
} | |||
RooHelpers::checkRangeOfParameters(this, {&_tau}, 0.); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RooHelpers::checkRangeOfParameters(this, {&_tau}, 0.); |
I would not do this check either (yes, the name RooDecay
suggests that tau should be positive, but I have no reason to assume that this class technically doesn't work for negative tau as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the initiative! Just a few comments, and let's maybe so this for some more common classes so we can wrap up the issue.
This Pull request:
Changes or fixes:
As requested in #7210, adds parameters checks to:
Checklist:
Questions from me
This PR (partially) fixes #7210
Thanks!