The following code block will cause a segfault (root 5.27 and gcc 4.1.2):
- Code: Select all
TChain* c1 = new TChain("data");
c1->Add("data*.root");
TChain* c2 = new TChain("cuts");
c2->Add("cuts*.root");
c1->AddFriend(c2);
c1->Draw("varincutstree");
c1->RemoveFriend(c2);
delete c2;
c1->SetBranchStatus("*",0);
It seems c1 still has some reference to the branches in c2 even after the friend is removed (and it _is_ removed from the ListOfFriends).
Until a bugfix happens, is there a reasonably convenient workaround? The use case is that my dataset is broken up into trees with interesting data and trees that are only really used to generate cuts. So I want to temporarily add the cut trees as friends just to generate a TEntryList, then get rid of them.
Thanks,
~Ben