Dear Expert,
I would like to solve an issue i have which lead me to do some nasty gymnastic using rdataframe and numpy array while there might be instead already an easier solution.
In practice i have 2 TTree, both with same branch names and number of entries.
What i would like to do is a global renaming of branches in tree 1 and tree2 and then parallel merge of the 2 ttrees. Say entry one of tree1 can now be compared to entry 1 of tree 2.
Is there any appropriate tool to massively rename branches and merge 2 Ttrees with ordered entries keeping constant the nEntries total to the original values of the tree1 and 2?
Thanks
Renato
Hi @pcanal, indeed, i was not smart enough to think about making the 2 friends. It might do the trick, however i have the base and friend tree with the exact same branch name, is there any issue if this is happening?
Yes, i will, if that’s the case it will work, however in my use case i have say 8 TTree to merge as friend, all with same TTree name and all with same branches, that might be tricky , probably.
Actually, i think that AddFriend( "CustomName = SAMENAMES", "FILEX") would do the trick.
Where CustomName must be different on each of the 8 friends to chain
The only caveat is that i need to have 1 branch in common to all ntuples , in my case the bsIDX whcih i have to emulate on a base root file using the _rdfentry trick.
Thanks a lot for the suggestions, this solution is very elegant and bookkeping wise it’s perfect.