-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[ntuple] various interface improvements #14454
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
|
Starting build on |
enirolf
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.
Thanks! I have left two small comments.
| std::function<std::string(const std::string &)> mapping); | ||
|
|
||
| template <typename T> | ||
| T *Get(std::string_view fieldName) const |
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.
Would it be an idea to have a Get<T> (perhaps named differently) that returns a shared pointer to the object? The use case would be for type-erased fields. Right now the (only) way to do it is through ntuple->GetModel().GetDefaultEntry()->GetPtr<T>("fieldname"), which feels a bit unwieldy.
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.
That's a possibility, a getter acting as a shortcut for GetModel().GetDefaultEntry()->GetPtr<T>. On the other hand, callers can could also first get the entry and then call (multiple times) entry.GetPtr<T>(). How about we see if users stumble across it and defer the addition of the method until then?
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.
Yes fair enough, sounds good!
| /// set memory addresses to be serialized / deserialized | ||
| std::unique_ptr<REntry> CreateBareEntry() const; | ||
| REntry *GetDefaultEntry() const; | ||
| Detail::RFieldBase::RBulk GenerateBulk(std::string_view fieldName) const; |
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.
Perhaps add some documentation
Test Results 10 files 10 suites 2d 0h 39m 48s ⏱️ Results for commit 4eb071d. ♻️ This comment has been updated with latest results. |
|
Starting build on |
enirolf
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.
It looks good to me, but following from the discussion on shared pointers on Friday maybe someone else should also have a look.
|
I already had a quick look last week and didn't have any further comments (except maybe that |
|
@jblomer , we are trying to test latest root master changes in CMSSW and our build failed with errors like [a]. Looks like this change is causing cmssw to fail. I guess we need to update cmssw to use We also want same cmssw code to work for ROOT 6.26 and above. So should we add some |
|
@jblomer @hahnjo any suggestion about #14454 (comment) ? |
Yes, but with yesterday's changes I think it will be
That one is a bit more complicated; after a quick look, I think |
|
thanks @hahnjo , I have opened cms-sw/cmssw#43834 |
Change raw pointer methods to shared pointers or const ref. Remove unsafe and unnecessary methods.
Add
RNTupleModel::GenerateBulk().