Problem when reading trees

Hello,
I try to make a TFile with an UPDATE option which is created, wrote and deleted at each run.
I made 3 run :
Run 0 : the TFile is created at the beginning of the run,the tree(named mytree) is filled with 1 100 000 entries, the TFile is wrote, then The TFile is deleted
Run 1 : same thing as above with 1 200 000 entries
Run 2 : same thing as above with 1 500 000 entries
At the end of each run, i checked that trees have the rigth number of entries by doing tree->Print().
So, i expect to have in TFile 3 trees :
mytree;1 with 1 100 000 entries
mytree;2 with 1 200 000 entries
mytree;3 with 1 500 000 entries
When reading the TFile (with TBrowser), i see that i have 4 trees instead of 3 :
mytree;1 with 982 893 entries
mytree;3 with 982 893 entries
mytree;5 with 982 893 entries
mytree;6 with 1 500 000 entries
I have 3 problems :
–>the number of trees is no correct
–>the indexation of trees is not good : after mytree;1, i have mytree;3 instead of mytree;2
–>trees haven’t got the rigth number of entries although during writting, i checked that trees had the rigth number of entries
I think there is a problemof reading.
N.B.: if i do the same test with 110 000, 120 000 and 150 000 entries, there are no problem!
Can anybody help me?
Thanks,
Fabien
tree.tar (40 KB)

I believe that I already answered a similar question from you sometime ago.
By default the tree header is written to the file (generating a new cycle)
when the amount of uncompressed data written so far is 100 Mbytes.
If you have difficulties understanding the cycle mechanism, I suggest that
you call mytree.SetAutoSave(1900000000) after the creation of the tree and before filling it.
see also TTree::AutoSave

Rene