Help: Multiple saved versions of tree in file

Hi everyone,
I have come across a problem when I try to apply cuts to a large root tree using TEventList. I fill a new (cloned) tree with the events defined in the event list and then write the new tree to a file. When I open the file, I see two trees, one with fewer events (and a lower version number) than the other). This only occurs when I have a root tree with ~4.5 million events; it does not occur when I have one with 700k events.

Is there any way to fix this behaviour? I could simply ignore it, but I am writing this code for multiple users and would prefer to find a way to fix it, particularly since choosing the wrong tree can be misleading. I’ve attached a shortened version of the code below.

Many thanks,
problemGate.C (2.15 KB)