# TBasket errors when looping over TTree

**URL:** <https://root-forum.cern.ch/t/tbasket-errors-when-looping-over-ttree/24395>\
**Category:** ROOT\
**Tags:** tree\
**Created:** [April 11, 2017, 2:19pm UTC](https://root-forum.cern.ch/t/tbasket-errors-when-looping-over-ttree/24395 "2017-04-11T14:19:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adasgupt](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@adasgupt](https://root-forum.cern.ch/u/adasgupt)\
**Post date:** [April 11, 2017, 2:19pm UTC](https://root-forum.cern.ch/t/tbasket-errors-when-looping-over-ttree/24395/1 "2017-04-11T14:19:00Z")

</div>

Hi,

I have a tree with 3.7M events, with most branches being vectors of floats or ints.

I get thousands of this kind of error at various times with various scripts about 2.2M into the event:

```auto
Error in <TBasket::ReadBasketBuffers>: fNbytes = 189808, fKeylen = 82, fObjlen = 209182, noutot = 0, nout=0, nin=189726, nbuf=209182
Error in <TBranchElement::GetBasket>: File: /afs/cern.ch/work/c/cschnaib/public/P5Neutron/ana_p5.root at byte:16857682192, branch:rh_pos_x, entry:2438758, badread=1, nerrors=9, basketnumber=13755
R__unzip: error -5 in inflate (zlib)
Error in <TBasket::ReadBasketBuffers>: fNbytes = 189808, fKeylen = 82, fObjlen = 209182, noutot = 0, nout=0, nin=189726, nbuf=209182
 file probably overwritten: stopping reporting error messages
===>File is more than 2 Gigabytes
R__unzip: error -5 in inflate (zlib)
Error in <TBasket::ReadBasketBuffers>: fNbytes = 189808, fKeylen = 82, fObjlen = 209182, noutot = 0, nout=0, nin=189726, nbuf=209182

```

It persists even if I parallelize (run over the tree in chunks and hadd together the output).

The tree is not corrupted; I have other scripts that run over the tree just fine. This script is simply making a smaller tree from the existing tree. I also have this problem when making certain histograms.

Any advice? If any additional information is needed, please let me know. Thanks in advance!

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [April 11, 2017, 2:45pm UTC](https://root-forum.cern.ch/t/tbasket-errors-when-looping-over-ttree/24395/2 "2017-04-11T14:45:35Z")

</div>

Hi,

This looks weird… Maybe @pcanal has an idea…

Cheers, Bertrand.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [April 25, 2017, 2:45pm UTC](https://root-forum.cern.ch/t/tbasket-errors-when-looping-over-ttree/24395/3 "2017-04-25T14:45:39Z")

</div>

Closed on April 25, 2017, 2:45pm UTC

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