-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Don't deep clone the RooAbsArg in RooAbsReal::getPropagatedError
#10762
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
[RF] Don't deep clone the RooAbsArg in RooAbsReal::getPropagatedError
#10762
Conversation
Starting build on |
Build failed on ROOT-ubuntu16/nortcxxmod. Errors:
|
21879fc
to
d78f5b3
Compare
Starting build on |
Build failed on ROOT-ubuntu16/nortcxxmod. Errors:
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Failing tests: |
The `RooAbsReal::getPropagatedError()` function was using some of the most expensive operations in RooFit for larger computation graphs: cloning the model, and figuring out parameters and observables. This was done for no apparent reason, as the `RooAbsReal` is not mutated by `getPropagaterError`. Parameter values are slightly changed for reevaluation, but they are reset right after. A final call to `getVal()` is enough to reset the original state, which is much more efficient than cloning everything. This commit also adds a check if the parameters in the RooAbsReal have the same values as in the fit result (otherwise the logic of getPropagatedError() is broken). This change was motivated by the following forum post: https://root-forum.cern.ch/t/getpropagatederror-method-taking-too-long-to-run/50392
d78f5b3
to
7979d21
Compare
Starting build on |
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.
LGTM!
I agree it is better not cloning the model and just re-evaluate it with the initial parameter values to have the same state as before.
Build failed on mac1015/cxx17. Failing tests: |
The
RooAbsReal::getPropagatedError()
function was using some of themost expensive operations in RooFit for larger computation graphs:
cloning the model, and figuring out parameters and observables.
This was done for no apparent reason, as the
RooAbsReal
is not mutatedby
getPropagaterError
. Parameter values are slightly changed forreevaluation, but they are reset right after. A final call to
getVal()
is enough to reset the original state, which is much more efficient than
cloning everything.
This change was motivated by the following forum post:
https://root-forum.cern.ch/t/getpropagatederror-method-taking-too-long-to-run/50392