-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add direct support for REST classes in PyROOT (Python) #323
Conversation
Thanks for this PR. I love it! |
When I do |
It's because loading root takes a long time ( This only loads REST libraries, you cannot use macros from python. |
What's the actual reason that the REST shared libraries need to be loaded only to read a REST generated ROOT file anyway? Doesn't ROOT provide some interface to define custom types to store in a ROOT file (I assume that's what requires it)? |
You can read a REST generated root file with ROOT without loading libraries or more especifically dictionaries, atleast when reading data from a TTree. This only works if the TTree splitting is set to the default value (full splitting or no splitting, I don't remember). What you cannot do without dictionaries is call the methods of each class. I would assume you can read data from EventTree / AnalysisTree (REST trees) directly from PyRoot also without loading dictionaries. You can also use https://github.com/scikit-hep/uproot5 to avoid ROOT altogether, I have verified this to work with REST before. I don't think you should be getting a segfault when reading from the analysis tree, maybe something is broken now (we should add a test for this...). I remember for instance that if we added an additional level of depth to the EventTree (event > track > hits, instead of event > track - hits, which is what we have now, this reading without loading REST libraries was also broken. |
After this PR, REST classes can be imported into Python via