I understand that the tree with cycle 1000 is saved by the last AutoSave (happening at event 999001), and the cycle 1001 is created by f.Write() at event 999999.
I wonder why, then, the number of entries in the TTrees is, for both cases, 999999.
Dear Rene,
thanks for the lines of code, I was wrong.
I was inspecting the trees using the TBrowser and starting a tree viewer.
I think that the tree viewer always attaches to the tree with the largest cycle number, I was starting the viewer for cycle 1000 and getting 999999 events (from cycle 1001).
Is this correct?
I then open the root file, I can see the two trees with cycle 1000 and 1001.
I select “test;1000” right clicking on it and then select start viewer (see screenshot.png).
TreeViewer reports: “First entry: 0 Last entry: 999999” (see screenshot1.png)
Drawing leaf a also reports 1M entries (screenshot2.png).