Skip to content

Conversation

@guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Jan 31, 2023

  1. Don't use RooTruthModel in rf704_aplitudefit tutorial
  2. Register correct servers in RooTruthModel
  3. Ignore whitespaces diffs in RooTruthModel basis code matching
  4. Change some casts that were too specialized
  5. Implement RooTruthModel in RooBatchCompute library

More detail in the commit descriptions.

@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@root-project root-project deleted a comment from phsft-bot Feb 1, 2023
@phsft-bot
Copy link

Build failed on ROOT-performance-centos8-multicore/cxx17.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

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.
@phsft-bot
Copy link

Starting build on ROOT-debian10-i386/soversion, ROOT-performance-centos8-multicore/cxx17, ROOT-ubuntu18.04/nortcxxmod, ROOT-ubuntu2004/python3, mac12/noimt, mac11/cxx14, windows10/cxx14
How to customize builds

@guitargeek
Copy link
Contributor Author

Sorry, I made a typo in the tutorials myself now... I have updated the PR one more time, it should work now

Copy link
Member

@lmoneta lmoneta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants