CloneTree issue

Hi,

I’m trying to copy one tree to another file with less branches (following the copytree*.C examples), and I’m running into a seg. viol.

If I do not select branches (i.e. I comment the SetBranchStatus lines in the attached macro) the cloning is running fine. But as soon as I try to select branches, I get the following backtrace.

Any idea ?

Thanks,

Running v5-34-08 on Mac OSX 10.8.4

root [0] .x basic.C+(“13000196474082.15filtered.root”)
Info in TUnixSystem::ACLiC: creating shared library /Users/laurent/Code/PerfCheck/./basic_C.so

*** Break *** segmentation violation

[3]+ Stopped root
16:55:55 laurent@nanpc225:~/Code/PerfCheck>

===========================================================
There was a crash.
This is the entire stack trace of all threads:

Thread 1 (process 37496):
#0 0x00007fff827b66ac in wait4 ()
#1 0x00007fff8271a03a in system ()
#2 0x0000000107f082ff in TUnixSystem::StackTrace ()
#3 0x0000000107f06147 in TUnixSystem::DispatchSignals ()
#4
#5 0x0000000107ec1bc4 in TObjArray::GetAbsLast ()
#6 0x0000000109850f05 in TObjArray::GetEntriesFast ()
#7 0x000000010b8cb682 in TTree::CloneTree (this=0x7fa5e48ecb90, nentries=10, option=0x108e8f73c “”) at /Users/laurent/Alice/Root/v5-34-08/tree/tree/src/TTree.cxx:2924
#8 0x0000000108e8eb2e in basic ()
#9 0x0000000108e8f41c in G__basic_C_ACLiC_dict__0_2007 ()
#10 0x000000010870dfef in Cint::G__ExceptionWrapper ()
#11 0x00000001087bdb8a in G__execute_call ()
#12 0x00000001087be16b in G__call_cppfunc ()
#13 0x0000000108792653 in G__interpret_func ()
#14 0x000000010877c5cf in G__getfunction ()
#15 0x000000010877098a in G__getitem ()
#16 0x000000010876fb16 in G__getexpr ()
#17 0x00000001087635b6 in G__calc_internal ()
#18 0x00000001087f84a9 in G__process_cmd ()
#19 0x0000000107ecd428 in TCint::ProcessLine ()
#20 0x0000000107ecd8b9 in TCint::ProcessLineSynch ()
#21 0x0000000107e361a7 in TApplication::ExecuteFile ()
#22 0x0000000107e358d8 in TApplication::ProcessLine ()
#23 0x0000000108e36cba in TRint::HandleTermInput ()
#24 0x0000000108e35357 in TTermInputHandler::Notify ()
#25 0x0000000108e3752d in TTermInputHandler::ReadNotify ()
#26 0x0000000107f05616 in TUnixSystem::CheckDescriptors ()
#27 0x0000000107f04e61 in TUnixSystem::DispatchOneEvent ()
#28 0x0000000107e8df7a in TSystem::InnerLoop ()
#29 0x0000000107e8ddad in TSystem::Run ()
#30 0x0000000107e362a4 in TApplication::Run ()
#31 0x0000000108e36650 in TRint::Run ()
#32 0x0000000107e29a5f in main ()

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#5 0x0000000107ec1bc4 in TObjArray::GetAbsLast ()
#6 0x0000000109850f05 in TObjArray::GetEntriesFast ()
#7 0x000000010b8cb682 in TTree::CloneTree (this=0x7fa5e48ecb90, nentries=10, option=0x108e8f73c “”) at /Users/laurent/Alice/Root/v5-34-08/tree/tree/src/TTree.cxx:2924
#8 0x0000000108e8eb2e in basic ()

13000196474082.15filtered.root (66.5 KB)
basic.C (838 Bytes)

Looking at the “RAW” TTree in the “13000196474082.15filtered.root” file, it seems to me that you have multiple subbranches with the same names (they begin with “fRawDataArray”).
I think you need to make sure that the “splitlevel” is 0 for all their “parent branches” when you create the “RAW” TTree.
Or you need to add a trailing “dot” to these “parent branches” names’ when creating them, so that the subbranches get unique names afterwards. Search for “parent” in http://root.cern.ch/root/html/TTree.html#TTree:GetEntry and http://root.cern.ch/root/html/TTree.html#TTree:SetBranchStatus descriptions and see the “IMPORTANT NOTE about branch names” in the http://root.cern.ch/root/html/TTree.html#TTree:Bronch description.

Also, you should probably load dictionaries (i.e. some shared libraries) for all classes that are used in the “RAW” TTree, before you try to use them. You could also “recreate” all dictionaries using something like:
root [0] TFile f = TFile::Open(“13000196474082.15filtered.root”)
root [1] f->MakeProject(“RAWDicts”, "
", “recreate++”)
and then use it:
root [0] .L RAWDicts/RAWDicts.so
root [1] .x basic.C++(“13000196474082.15filtered.root”)

Hi,

Well, the original tree I have no control on … It’s the raw data format of the Alice experiment :wink:

And for the loading of the librairies, it does not seem to make a difference either… Should it ? (I got the impression that the CloneTree was quite low level and was only dealing with buffers ?)

Regards,

Hi,

Finally your answer did help (sorry I disqualified it a bit too fast).

It’s a bit more manual than I’d like, but I now loop on the leaves and disable their (associated) branch based on the name of the “top” branch. It works fine (w/o loading the libraries containing the code actually).

Thanks for the help,

(I’m attaching the working macro for the record)
FilterRawData.cxx (2.11 KB)