-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF] Fixes and improvements to RooTruthModel and related tutorials
#12180
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
Conversation
8e0154d to
2f39809
Compare
|
Starting build on |
|
Build failed on ROOT-performance-centos8-multicore/cxx17. Errors:
Failing tests: |
The RooTruthModel can't be used in that test, because it will always return zero for negative observable values. The point of the tutorial is to demostrate that the fit can deal with negative amplitude values for negative observable values, so this feature of the RooTruthModel is not helpful here. It was only a coincidence that the tutorial still worked: there was a typo in the RooFormulaVars (extra whitespace), causing the RooTruthModel to just relay to the original formula instead of using the compiled code that returns zero for negative observable values.
The `RooTruthModel` when compiled for a basis registered only the `RooFormulaVar` for the basis as a value server, instead of replicating the server structore of the `RooFormulaVar` as done in the general `RooResolutionModel`. While this was the correct thing to do for the "generic basis" case where the RooFormulaVar was actually evaluated, it was wrong for the case where it is not evaluated (any other case). This commit changes the `RooTruthModel::changeBasis()` function such that in the non-generic basis case, it will take over the servers of the `RooFormulaVar`, just like in the implementation of the `RooResolutionModel` base class. This change is done to avoid unnecessary evaluation and copying in the RooFit GPU BatchMode. Also, a memory leak is fixed where the old basis was not deleted in case the resolution model owned the basis.
It is overly pedantic to ask from the user to pass the formula expression without whitespaces, therefore whitespaces are now removed from the input before matching the basis functions.
|
Starting build on |
|
Sorry, I made a typo in the tutorials myself now... I have updated the PR one more time, it should work now |
lmoneta
left a comment
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!
rf704_aplitudefittutorialMore detail in the commit descriptions.