Is there a way to write std::vector<std::vector<float>> in a tree with uproot (or a reasonable alternative structure)? #1313
Replies: 2 comments
-
In short, no. Writing doubly nested variable-length lists is a fundamentally different prospect from singly nested variable-length lists in TTree, and it's beyond our scope to attempt it. (This is one of the reasons that we're looking forward to RNTuple: there aren't limitations like this.) To get this to work, you'll need ROOT. I'd suggest running your Awkward Array through |
Beta Was this translation helpful? Give feedback.
-
https://awkward-array.org/doc/main/reference/generated/ak.to_rdataframe.html https://awkward-array.org/doc/main/user-guide/how-to-convert-rdataframe.html |
Beta Was this translation helpful? Give feedback.
-
Hi everyone! 👋
I’m working with uproot4 (*) and ran into a bit of a roadblock. In my project, I need to store a variable amount of data across a variable number of channels, so I’m trying to use a nested
std::vector
structure. The issue arises when I try to write this data to a TTree in a ROOT file.For example, I have the following structure in Python:
When I try to write this to a ROOT tree, I encounter the following exception:
It is now my understanding that this data structures are off-limits in uproot at the moment.
Question:
Is there a way to write variable-sized
std::vector<std::vector<float>>
structures, or a resonable alternative / workaround?Any advice or suggestions would be greatly appreciated. Thanks in advance for any help you can offer!
(*) but the following seems to be true for uproot5, which I plan on upgrading to in the future
Beta Was this translation helpful? Give feedback.
All reactions