Branch Size of tree w/ large number of entries

Dear experts,

While running a code on a root file, which has 13095658 entries, I run into these error messages:

Please correct me if I am wrong, but I think this might be because the branch size is not big enough to handle so many entries.
For eg: I fill a branch of the tree :(snippet of my code )

def MakeSkimmedTree(self):
outTree = TTree(“H4GSel”, “H4G Selected Events”)

  outTree.Branch('p1_pt', self.p1_pt, 'p1_pt/D')
  outTree.Branch('p2_pt', self.p2_pt, 'p2_pt/D')
  outTree.Branch('p3_pt', self.p3_pt, 'p3_pt/D')

How can I tackle this error?

Many thanks in advance,

The problem seems to be in (one of) the input TTree (i.e. unzip-ing, ReadBasketBuffer) and this looks like the file is corrupted on disk …


Thanks for the quick reply Philippe!
One thing I should mention is that this file was created by hadd’ing multiple files. When I try to run my analyzer code on some of the individual files, everything works fine. I only get these error messages when I run my code on this combined file (created by hadd’ing).

Could it still be due to the same reason you mentioned?


How were the original file produced (was it with an old version of Geant4)?

I am not sure about that since I didn’t produce them. Would the production method have something to do with this? My analyzer code runs fine on other files (belonging to different Runs).

Is there a way to allocate more memory to a particular branch? I want to check if I am running out of memory while filling the trees

It is not a matter of allocating ‘more’ memory to a particular branch.

In some older version of Geant4 there was a bug that prevented the merging of several files smaller than 2Gb into a file larger than 2Gb.

To work around the problem force hadd into ‘slow’ merging option

hadd -O ....


Thanks for the suggestions Philippe!

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