Hi,
I have a set of root files containing 2 separate TTrees. I’d like to chain all the trees and connect them as friends. I’m not sure what’s the most optimal way to do that. I currently have something like:
[code]// first chain
TChain *C1 = new TChain(“tree1”);
C1->AddFile(file1.root);
C1->AddFile(file2.root);
// second chain
TChain *C2 = new TChain(“tree2”);
C2->AddFile(file1.root);
C2->AddFile(file2.root);
// make friends
C1->AddFriend(C2);[/code]
As you can see file1.root and file2.root are read twice. I have the feeling this is not optimal when looping over the tree entries.
Any better idea?
Thank you