While trying to read a tree having same name from across multiple root files, I am looping all the root files and loading the tree and finally reading it using a TreeReader().
Is there any more efficient way in root to directly create a combined tree by merging all the entries in all the trees across the root files.
If yes, is this more efficient way of looping through the root files and loading the trees individually.? There are about 100 files.
PS: I tries using hadd however it takes significantly longer than the first approach and shows a message merging trees with different compression levels….
@Danilo I think the question is clear.
Assuming @utkarsh-2000 uses a TChain, one needs automatic ways to call some function (defined by the user, of course) that will retrieve (or calculate) the “p0”, “p1”, and “p2” parameters for the currently processed TTree. That means always for the very first entry in every new tree (when switching trees) and for the very first entry in a “chunk of entries” (when they are analyzed in “parallel”, e.g., in separate threads so that each “chunk” will need different tree specific parameters). These parameters may then be “saved” in some global variables (and used by the analyzing code for all events that belong to the same tree or “chunk of entries”).