-
Notifications
You must be signed in to change notification settings - Fork 67
How to write aliases to a new tree? #425
Comments
EDIT: We do not currently support the user specifying attributes such as fAliases to be written. @jpivarski if we add this, is there any other attribute we should allow the user to specify? |
Would it be possible for you (or @jpivarski ) to point me to a ROOT file having a TTree with fAliases set? The fAliases I have looked at have been TLists whereas in your example it is a TObjArray (or there is some gaps in my understanding of TList and TObjArray). |
I'm not sure it's a bug. Was there ever an attempt to implement alias-writing? If we've never tried to do it and never tested it, that makes it "not implemented," not a bug. There might be some files in tests/samples with aliases. I'm pretty sure CMSSW MiniAOD files have aliases (available in CERN's Open Data Portal), but that's going to a lot of effort. Some of these other issues really are bugs, and they should take priority over new features. |
I agree.
I suspect it just wasn't implemented. As for my use case -- being able to mimic |
@reikdas - if you already have a ROOT file, there are two forms of aliases that would generally need to get handled by
Aliases, are as I understand it, just fundamentally the name and a formula to evaluate. There's no check in ROOT to see if the alias evaluates successfully or not until the user runs it or tries to evaluate it. So as for writing these two kinds into a ROOT file from uproot, they should be treated identically. They seem to load as |
It's worth adding, though we'd want to make it a |
I've been stockholm-syndrome'd into using ROOT capitalization's scheme. One other thing I forgot: aliases don't have dtypes (until evaluated). That might not be tricky to handle in a language like python... |
In uproot, |
Except for the simple ones, which get treated like branches. |
Oh, right—early on, I misunderstood what aliases were (I thought they were just renaming branches, not formulas) and so a |
Following the example here
trying to do something like
doesn't seem to be writing the aliases out.
The text was updated successfully, but these errors were encountered: