Skip to content
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] Forbid calling getVal() with r-value references to norm set #17094

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

guitargeek
Copy link
Contributor

Calling RooAbsReal::getVal() with r-value references to the normalization set (i.e. with RooArgSets that are created in place) is a bad idea, because it breaks RooFits caching logic and potentially introduces significant overhead.

There was even a dedicated Pythonization to deal with the related memory problems.

Since to avoid the problems and the need for a workaround in Python, this commit simply suggests to forbid calling getVal() with r-value references at runtime by printing a clear exception.

@guitargeek guitargeek self-assigned this Nov 27, 2024
@guitargeek guitargeek changed the title [RF] Forbid calling getVal() with r-value refernnces to norm set [RF] Forbid calling getVal() with r-value references to norm set Nov 27, 2024
Calling RooAbsReal::getVal() with r-value references to the
normalization set (i.e. with RooArgSets that are created in place) is a
bad idea, because it breaks RooFits caching logic and potentially
introduces significant overhead.

There was even a dedicated Pythonization to deal with the related memory
problems.

Since to avoid the problems and the need for a workaround in Python,
this commit simply suggests to forbid calling getVal() with r-value
references at runtime by printing a clear exception.
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.

1 participant