I have two root files that I would like to friend. They have the same number of entries. The code that fails is below. I am using root version 5.30.00 compiled on a 64 bit RHEL6 machine.
I have tried the following substitutions in the code below but all seg fault:
[ul]
building an index in both root files
t_test->AddFriend(“test2”,“test2.root”)
test->AddFriend(“test2”,“test2.root”)
t_test->FindBranch(“test2.reg_asym_qwk_mdallbars”)->Print()
t_test->FindBranch(“t_test2.reg_asym_qwk_mdallbars”)->Print()
and, I believe, all the permutations of the above
[/ul]
TFile *f_test = new TFile("test.root");
TTree *t_test = (TTree*)f_test->Get("test");
TFile *f_test2 = new TFile("test2.root");
TTree *t_test2 = (TTree*)f_test2->Get("test2");
t_test2->FindBranch("reg_asym_qwk_mdallbars")->Print(); // succeeds
t_test->AddFriend(t_test2); // no warnings displayed
t_test->FindBranch("reg_asym_qwk_mdallbars")->Print(); // seg faults
The above code works with root-5.30.00 on ubuntu 11.04 32 bit.
test2.root (61.7 KB)
test.root (64.9 KB)