Merging *nearly* identical TTrees


I have two .root files each containing a TTree (same name) and want to merge them. The structure is identical, except for one branch (that I don’t care about) that has a unique name in each file. I would like to merge the two TTrees except for the uninteresting branch. Is this possible without manually populating a new TTree?


ROOT Version: 6.08.06 (as it happens)
Platform: slc6
Compiler: Not Provided


inputChain->SetBranchStatus(nameOfBranchInFirstFile, kFALSE);
TFile *outputFile = TFile::Open( ... );
TTree *outputTTree = inputChain->CloneTree(-1, "fast");
delete outputFile;

Thank you, that did work. I was running up against an impenetrable segfault when following Rene’s TList instructions here: Merging TTrees on the fly

However, I think his instructions lacked a “= new TList()” which, when I added it, removed the segfault.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.