ROOT Version: Not Provided Platform: Not Provided Compiler: Not Provided
Hi all,
I have some questions related to one problem:
Q1, Is there a storage limitation for a tree in a root file? how large is it?
Q2, In a root file, if there are several trees named with the same name, we can just take it as one to read? In my case, It seems I did not get branches from these trees simultaneously.
What I am doing:
I am trying to do BDT study. There will be 3 models so I train and predict my samples one model after one model.
=> then I found, for some trees, seems they are too large. Very time I store my result, there will be a new tree with the same name.
=> but when I read the final root file, I did not read one BDT score branch successfully. these 3 BDT scores are stored in different trees(same name).
Thank you very much! Hopefully, I express this problem well.
For Q2, I suppose you see inside the file something like
tree;1
tree;2
and so on. If that’s the case, just getting the tree without numbers (Get(“tree”)) should be enough, as ROOT takes the highest number by default, giving access to all data. Read about namecycle by searching at Get Started - ROOT (use the top right loupe icon), or search for that word on this forum or documentation; e.g. Aux;1 aux;2 aux3;
In reply to Q1, you can check this documentation. Also, keep in mind that due to a limtation (see issue #6734 on GitHub), the maximum size of a single entry in a TBranch is ~1GB.
KEY: TTree WZ_nom;6 WZ_nom [current cycle]
KEY: TTree WZ_nom;5 WZ_nom [backup cycle]
KEY: TTree WZ_nom;2 WZ_nom [backup cycle]
int WZ_nom;6 → there is a branch named “lightgbm_mid”
int WZ_nom;2 → there is a branch named “lightgbm_low”
Problem: When I read WZ_nom, it seems that I can get access to lightgbm_mid:
Yes, that was exactly what I said in my last post. Apparently, WZ_nom has three cycles (enumerated 2, 5, and 6). If you open WZ_nom, ROOT will just read the current cycle, i.e. 6 in the list above (all the rest are considered backup/old versions).
Each of those is a different TTree, i.e., you can read data from a specific instance by specifying also the cycle number, e.g. WZ_nom;2.
Also, as I said, if you want to have a homogeneous view of branches in all the cycles, you can probably open WZ_nom;6 and add WZ_nom;2 as a friend. For that, check documentation here.
Q2: If you only want to store in the TFile the last cycle of the tree and not previous backups, use kWriteDelete: Adding entries to a TTree - #2 by brun