Hi Bent,
just in case this is still relevant to you: Could it be that what you are seeing are just the backup copies created by the root TTree Autosave?
If I open your file with root, and do â.lsâ, this is the output I see:
TFile* first_half_tele_events.root
KEY: TTree Pixel;3 Tree of Pixel [current cycle]
KEY: TTree Pixel;2 Tree of Pixel [backup cycle]
KEY: TTree Event;2 Tree of Events [current cycle]
KEY: TTree Event;1 Tree of Events [backup cycle]
KEY: TDirectoryFile config;1 config
This is not corryvreckan-specific, but generally, usually when you have âduplicate trees seen in TBrowserâ , thatâs a save cycle thing; hereâs my understanding on what could be causing this.
â the keyword to search for in the root documentation to understand this is âcycleâ or ânamecycleâ (for saved objects name;cycle)
Root begins filling the tree (e.g. âmytreeâ), and when the number of entries reaches the one given by âAutoSaveâ, the meta-data is flushed to the disk. mytree;1 is a snapshot of the metadata at that point. The next time a write operation is performed, the cycle number is increased, and you get mytree;2. The different cycles are kind of a crash-recovery mechanism - if your code crashes, and there was an autosave in between, you can usually recover the entries up to that point from the file.
TBrowser shows all versions of an object (a histogramm, a tree, âŚ). Thatâs what you are seeing.
If you just do âŚ->Get(âmytreeâ) in a macro/in cling, it automatically retrieves the one with the highest cycle number, i.e. the one that was most recently created, so in that case you donât even notice.
If it really bothers you to see multiple versions in TBrowser, I think you could prevent that by adding the option kWriteDelete when storing the file (from TObject documentation: âwrite object, then delete previous key with same nameâ).
Although I wouldnât really consider it a problem: mytree;2 and mytree;1 are not two completely different trees, just different namecycles for the same tree, and only the TTree metadata is duplicated between namecycles. The real data is only present once in the file, so it doesnât use a lot of extra filespace.