Error reading tree

28 views
Skip to first unread message

Himanshu Sharma

unread,
Aug 29, 2019, 1:34:12 PM8/29/19
to uproot users
Hello, I am getting some trouble to read the tree using uproot. 
Here are the details...

--------------------------------
import uproot
import pandas as pd
from root_pandas import read_root
f = uproot.open("~/Sharma/JPSiTestsTrees/dstTree.root")["DstTree"]
f.keys()


------ Output ------------------
Welcome to JupyROOT 6.16/00
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-1-b9265a3e80e0> in <module>
      2 import pandas as pd
      3 from root_pandas import read_root
----> 4 f = uproot.open("~/Sharma/JPSiTestsTrees/dstTree.root")["DstTree"]
      5 #df = read_root("~/Sharma/JPSiTestsTrees/dstTree.root",'DstTree')
      6 f.keys()

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/rootio.py in __getitem__(self, name)
    236 
    237     def __getitem__(self, name):
--> 238         return self.get(name)
    239 
    240     def __len__(self):

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/rootio.py in get(self, name, cycle)
    354 
    355             if last is not None:
--> 356                 return last.get()
    357             elif cycle is None:
    358                 raise _KeyError("not found: {0}\n in file: {1}".format(repr(name), self._context.sourcepath))

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/rootio.py in get(self, dismiss)
    914 
    915         try:
--> 916             return _classof(self._context, self._fClassName).read(self._source, self._cursor.copied(), self._context, self)
    917         finally:
    918             if dismiss:

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/rootio.py in read(cls, source, cursor, context, parent)
    857         out = cls.__new__(cls)
    858         out = cls._readinto(out, source, cursor, context, parent)
--> 859         out._postprocess(source, cursor, context, parent)
    860         return out
    861 

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/tree.py in _postprocess(self, source, cursor, context, parent)
    290 
    291         for branch in self._fBranches:
--> 292             self._attachstreamer(branch, context.streamerinfosmap.get(getattr(branch, "_fClassName", None), None), context.streamerinfosmap, False)
    293 
    294         self._branchlookup = {}

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/tree.py in _attachstreamer(self, branch, streamer, streamerinfosmap, isTClonesArray)
    282                     pass
    283 
--> 284                 self._attachstreamer(subbranch, submembers.get(name, None), streamerinfosmap, isTClonesArray)
    285 
    286     def _postprocess(self, source, cursor, context, parent):

~/alice/sw/ubuntu1804_x86-64/Python-modules/1.0-1/lib/python/site-packages/uproot/tree.py in _attachstreamer(self, branch, streamer, streamerinfosmap, isTClonesArray)
    249                 if typename == b'TClonesArray' and m is not None:
    250                     typename = m.group(1)
--> 251                 members = streamerinfosmap[typename].members
    252         elif isinstance(streamer, uproot.rootio.TStreamerSTL):
    253             try:

KeyError: b'NEW) (AliReducedFMDInfo'

Reply all
Reply to author
Forward
0 new messages