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] Fix some design issues with the RooTreeDataStore #17165

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

guitargeek
Copy link
Contributor

  1. The RooAbsDataStore has a virtual function tree() which is not meaningful for a general data store. This function should be removed.

  2. The RooTreeDataStore has one const version on tree() and one non-const version. One returns a pointer and the other a reference, which is very confusing.

  3. The RooTreeDataStore has some methods that just forward to the underlying TTree, but they were not used.

Changes to the data store classes can be made without impacting users because they are implementation details of the RooFit dataset classes.

Copy link

github-actions bot commented Dec 2, 2024

Test Results

    16 files      16 suites   4d 1h 33m 18s ⏱️
 2 694 tests  2 694 ✅ 0 💤 0 ❌
41 700 runs  41 700 ✅ 0 💤 0 ❌

Results for commit 8e46d9d.

♻️ This comment has been updated with latest results.

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.

The RooAbsDataStore::addColumns is removed. What is the reason for this?

1. The RooAbsDataStore has a virtual function `tree()` which is not
   meaningful for a general data store. This function should be removed.

2. The RooTreeDataStore has one `const` version on `tree()` and one
   non-const version. One returns a pointer and the other a reference,
   which is very confusing.

3. The RooTreeDataStore has some methods that just forward to the
   underlying TTree, but they were not used.

Changes to the data store classes can be made without impacting users
because they are implementation details of the RooFit dataset classes.
Using this function is introducing memory leaks too easily if used
wrong, because it returns a `RooArgsSet *` that needs to be deleted by
the caller without documenting this.

This commit suggests to simply remove this function, after all one could
just call `addColumn()` in a loop and be safe.
@dpiparo dpiparo closed this Jan 11, 2025
@dpiparo dpiparo reopened this Jan 11, 2025
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