Hey everyone. I’m a having a problem and am in need of a sanity check to make sure that what I’m doing should indeed work. I have a bunch of files with TTree’s in them. In each file, there’s a master tree that has an EventID and RunID for every single event. Other trees have EventID’s and RunID’s and other quantities, but there is not necessarily an entry in each of these trees for each entry in the master tree. These trees are friends of the master tree. I’m trying to do the following in order to loop over the chains:
TChain* masterTree = new TChain(“tree”);
TChain* subTree1 = new TChain(“tree1”);
TChain* subTree2 = new TChain(“tree2”);
masterTree->Add(“blah”);
subTree1->Add(“blah”);
subTree2->Add(“blah”);
masterTree->AddFriend(subTree1, “”);
masterTree->AddFriend(subTree2,"");
Double_t value1;
Double_t value2;
subTree1->SetBranchAddress(“value1”, &value1);
subTree2->SetBranchAddress(“value2”, &value2);
Long64_t entries = masterTree->GetEntries();
for(Long64_t i=0; i<entries; i++){
masterTree->GetEntry(i);
}
This appears to work fine, and the data members of the friend trees seem to be filled in properly, at least for awhile. However, things eventually segmentation fault, and they always segmentation fault at the boundary between one file in the chain and the next. (core dump below…) I’ve tried this with a bunch of different chains with the same result.
My question: Is there something fundamentally wrong here? Is the fact that the subsidiary trees don’t have entries for all the entries of the master tree a problem? It seems to me that this should work, but the seg faults are persistent. Any help you all could provide would be much appreciated. Thanks!
Michelangelo
core dump:
*** Break *** segmentation violation
(no debugging symbols found)
Using host libthread_db library “/lib64/tls/libthread_db.so.1”.
Attaching to program: /proc/26139/exe, process 26139
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
[New Thread 182943199456 (LWP 26139)]
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
(no debugging symbols found)…done.
0x0000002a9816eca6 in waitpid () from /lib64/tls/libc.so.6
Thread 1 (Thread 182943199456 (LWP 26139)):
#0 0x0000002a9816eca6 in waitpid () from /lib64/tls/libc.so.6
#1 0x0000002a98105ea1 in do_system () from /lib64/tls/libc.so.6
#2 0x0000002a97fb9e19 in system () from /lib64/tls/libpthread.so.0
#3 0x0000002a9598069c in TUnixSystem::Exec () from /opt/cern/root_v5.14.00_x86-64/lib/libCore.so
#4 0x0000002a95980a56 in TUnixSystem::StackTrace () from /opt/cern/root_v5.14.00_x86-64/lib/libCore.so
#5 0x0000002a9597ee08 in TUnixSystem::DispatchSignals () from /opt/cern/root_v5.14.00_x86-64/lib/libCore.so
#6 0x0000002a9597d061 in SigHandler () from /opt/cern/root_v5.14.00_x86-64/lib/libCore.so
#7 0x0000002a9598325c in sighandler () from /opt/cern/root_v5.14.00_x86-64/lib/libCore.so
#8
#9 0x00000000017a3bd7 in ?? ()
#10 0x0000002a9a7b37c4 in TTreeFormula::EvalInstance () from /opt/cern/root_v5.14.00_x86-64/lib/libTreePlayer.so
#11 0x0000002a9a7b86b8 in TTreeIndex::GetEntryNumberFriend () from /opt/cern/root_v5.14.00_x86-64/lib/libTreePlayer.so
#12 0x0000002a9736a0cc in TTree::LoadTreeFriend () from /opt/cern/root_v5.14.00_x86-64/lib/libTree.so
#13 0x0000002a97368ddb in TTree::GetEntry () from /opt/cern/root_v5.14.00_x86-64/lib/libTree.so
#14 0x0000002a97345e64 in TChain::GetEntry () from /opt/cern/root_v5.14.00_x86-64/lib/libTree.so
#15 0x0000002a99a88a5c in drawBasics (LFcutVal=