root icon indicating copy to clipboard operation
root copied to clipboard

[RF] Error out when setting out-of-range variable value instead of clipping

Open guitargeek opened this issue 3 years ago • 10 comments

In previous ROOT versions, if you set the value of a variable with RooRealVar::setVal(), the value was silently clippend when it was outside the variable range. This silent mutation of data can be dangerous. With ROOT 6.28, an exception will be thrown instead. If you know what you are doing and want to restore the old clipping behavior, you can do so with RooRealVar::enableSilentClipping(), but this is not recommended.

This change caught a logic error in stressRooFit where a background fraction was randomized to be outside the [0,1] interval. That part of the test was therefore removed (it was already removed from the corresponding tutorial).

Closes https://github.com/root-project/root/issues/6937.

guitargeek avatar Apr 27 '22 13:04 guitargeek

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac12arm/cxx20, windows10/default How to customize builds

phsft-bot avatar Nov 28 '23 10:11 phsft-bot

Let's test again. Now that Minuit 2 is the default minimizer, the situation might be different.

guitargeek avatar Nov 28 '23 10:11 guitargeek

Build failed on ROOT-ubuntu2204/nortcxxmod. Running on root-ubuntu-2204-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Nov 28 '23 11:11 phsft-bot

Test Results

    11 files      11 suites   2d 10h 6m 22s :stopwatch:  2 963 tests  2 950 :white_check_mark: 0 :zzz: 13 :x: 29 112 runs  29 019 :white_check_mark: 0 :zzz: 93 :x:

For more details on these failures, see this check.

Results for commit 74a09ba5.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Nov 28 '23 11:11 github-actions[bot]

Build failed on ROOT-ubuntu2004/python3. Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Nov 28 '23 12:11 phsft-bot

Build failed on windows10/default. Running on null:C:\build\workspace\root-pullrequests-build See console output.

Failing tests:

phsft-bot avatar Nov 28 '23 12:11 phsft-bot

@guitargeek too much time passed and I cannot restart the builds. Do you feel like rebasing so to trigger the tests and then, if satisfied, merge?

dpiparo avatar Apr 25 '24 07:04 dpiparo

@guitargeek too much time passed and I cannot restart the builds. Do you feel like rebasing so to trigger the tests and then, if satisfied, merge?

I will rebase so that we can see the status, but we can't merge it yet. First we need to make sure that Minuit 2 doesn't set parameter values outside of boundaries to begin with. This is still happening in the contour plots, and will be fixed by:

  • https://github.com/root-project/root/pull/13966

After that PR is merged, I can come back to this one.

guitargeek avatar Apr 25 '24 10:04 guitargeek