Troubles opening a tree with a custom-class branch #879
Unanswered
mattiasoldani
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Howdy!
I'm using uproot 4.3.7 to open a ROOT file (of which a sample is attached: TEST230417_LOCAL_SMALL.zip) and access a tree ("Z") that is inside it. One of the branches of this tree, "Cluster[6]", should be an array of 6 custom zCluster objects for each event. Each zCluster object includes several members, mostly float and TVector3 entries. I checked with ROOT and all the branch dimensions are as expected, as seen in the TBrowser screenshots below: the tree contains 116 events, whereas all the Cluster[6] numerical subbranches contain 116*6 = 696 entries.
If I try to open the same file in uproot via
I get the correct tree, i.e.
tree.num_entries
outputs 116 andtree.show()
outputsHowever,
tree.arrays(["Event/Cluster[6]"])
raises aCannotBeAwkward: classes that can contain members of the same type cannot be Awkward Arrays because the depth of instances is unbounded
error andtree.arrays(["Event/Cluster[6]"], library="np")
outputs a dictionary of 116 entries whose values are single zCluster objects, i.e. one single zCluster per event. Accessing any of them via e.g.tree["Event/Cluster[6]"].arrays(library="np")["Cluster[6]"][0].all_members
seems to correctly output all the information regarding one single cluster, i.e.but where are the other 5 clusters? Am I missing something trivial?
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions