-
Notifications
You must be signed in to change notification settings - Fork 67
index out of bound #5
Comments
Thank you for finding a file with long enough branch names to resolve an uncertainty I had about Sebastian's code. (I didn't know whether a particular algorithm worked the way it did because it was a Go thing or a ROOT thing. Turns out, it's a ROOT thing, so I need to read string length prefixes as big-endian numbers.) I also put in a dummy So now you can read that file! I don't know how useful it would be, looking at those branch names. >>> import uproot
>>> t = uproot.open("/afs/cern.ch/user/v/valya/public/relval-qcd-7.4.root")["Events"]
>>> t['recoVertexsedmAssociation_offlinePrimaryVerticesWithBS__RECO.obj.ids_.first.processIndex_'].array()
array([3, 3, 3, 3, 3, 3, 3, 3, 3, 3], dtype=uint16) (By the way, in your example, you think you're working with a TTree, but actually you're working with a TFile. You need to pick |
Jim,
could you please clarify if the Go code is also affected by this?
Since we were able to find example and fix code to handle this specific use
case it would be nice if Go counterpart will handle it too. If it was only
uproot issue then everything is fine and I'm glad you fixed the issue, but
if Go code also needs to be adjusted I'll be glad if we'll open up issue
in Go hep and point to this one.
I'll continue testing once time permit and report with issues.
Thanks,
Valentin.
…On 0, Jim Pivarski ***@***.***> wrote:
Thank you for finding a file with long enough branch names to resolve an uncertainty I had about Sebastian's code. (I didn't know whether a particular algorithm worked the way it did because it was a Go thing or a ROOT thing. Turns out, it's a ROOT thing, so I need to read string length prefixes as big-endian numbers.)
I also put in a dummy `TList` implementation. I just needed to read past some objects I don't use. (Maybe when I encounter a new class, I should default to dummy instead of raising an exception.) This is #7.
So now you can read that file! I don't know how useful it would be, looking at those branch names.
```python
>>> import uproot
>>> t = uproot.open("/afs/cern.ch/user/v/valya/public/relval-qcd-7.4.root")["Events"]
>>> t['recoVertexsedmAssociation_offlinePrimaryVerticesWithBS__RECO.obj.ids_.first.processIndex_'].array()
array([3, 3, 3, 3, 3, 3, 3, 3, 3, 3], dtype=uint16)
```
(By the way, in your example, you think you're working with a TTree, but actually you're working with a TFile. You need to pick `["Events"]` from it.)
--
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub:
#5 (comment)
|
I came be sure because I couldn't tell if the Go code was reading big or little endian (due to not knowing the language). I have a backlog of small discoveries to send Sebastien. I'll get to it tonight. |
"can't be sure" |
If I use the following root file /afs/cern.ch/user/v/valya/public/relval-qcd-7.4.root
I get different errors. Some of them related to not implemented support to TList. But others seems to unable to parse particular tree branch. Here is code snippet to reproduce:
And here is traceback for index of bound error
The text was updated successfully, but these errors were encountered: