Loss of information in root file from a pyROOT manipulation prevent me to use uproot (tree.show())

Hello ROOT expert,

I am facing a strange issue, from ROOT files I have build with a Python script based on pyROOT to add sWeights on former ROOT files. You can found there the script in charge of the sFit:
FitMass-Run1.py.txt (8,2 Ko)

The issue is that when I try to read a tree from my new file with pyROOT on SWAN 102b, by using the tree.show() method for exemple I obtain this type of error:
output.txt (1,4 Ko)

Something seems to be badly transferred from the previous root files into the new one, and I don’t manage to understand why. When I try to read the previous root files on the same principle, it works as expected. Among all the subdirectory of my new root file only the TTree of the Luminosity one manage to be read (even the other one for which I don’t add any variables (e.g. sWeights) are not readable with .show()).

Does anyone has any idea about how to solve this issue ?

Please read tips for efficient and successful posting and posting code

ROOT Version: SWAN 102b
Platform: Not Provided
Compiler: Not Provided

The root files are unfortunately to heavy to be shared here, but I can copy them on my public afs if it can helps.

Hello @TristanM ,

and sorry for the high latency! The call stack shows that the error is in uproot:

Traceback (most recent call last):
  File "/eos/home-i00/t/tmiralle/SWAN_projects/l0caloscripts/for_Run1/MakeNPZFiles_PIDCALIB_run1-11_0.py", line 55, in <module>
    tree = f[f'DSt_{part}Tuple/DecayTree']
  File "/cvmfs/sft.cern.ch/lcg/views/LCG_102b_swan/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/uproot3/rootio.py", line 226, in __getitem__
    return self.get(name)
  File "/cvmfs/sft.cern.ch/lcg/views/LCG_102b_swan/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/uproot3/rootio.py", line 341, in get
    out = out.get(name=n, cycle=cycle)
  File "/cvmfs/sft.cern.ch/lcg/views/LCG_102b_swan/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/uproot3/rootio.py", line 371, in get
    return last.get()
  File "/cvmfs/sft.cern.ch/lcg/views/LCG_102b_swan/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/uproot3/rootio.py", line 1050, in get
    return _classof(self._context, self._fClassName).read(self._source, self._cursor.copied(), self._context, self)
  File "/cvmfs/sft.cern.ch/lcg/views/LCG_102b_swan/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/uproot3/rootio.py", line 990, in read
    out._postprocess(source, cursor, context, parent)
  File "/cvmfs/sft.cern.ch/lcg/views/LCG_102b_swan/x86_64-centos7-gcc11-opt/lib/python3.9/site-packages/uproot3/tree.py", line 319, in _postprocess
    branch._countleaf = branch._fLeaves[0]._fLeafCount
AttributeError: 'Undefined' object has no attribute '_fLeafCount'

uproot is a separate project from ROOT, I would suggest that you report this at GitHub - scikit-hep/uproot3: ROOT I/O in pure Python and NumPy. , I don’t think we can help.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.