RE: [ROOT] TChain and friends

From: Andreas Petzold (A.Petzold@Physik.TU-Dresden.DE)
Date: Wed Jul 03 2002 - 12:31:10 MEST


On Tue, 25 Jun 2002, Philippe Canal wrote:

> Hi,
> 
> We update to the code in CVS to repair the situation.
> Please try it and let us now.
> 
> Cheers,
> Philippe
> 
> Ps.  We also have one additional API:
> 	TChain * c1;
> 	TChain * c2;
> 	..... 
> 	c1->AddFriend(c2,"AliasForTreeInTheChain");
> 

Hello again,

shame on me, but my testing wasn't any good. I wasn't aware that my test
directory contained only one root file. Doing what worked before with one
file now with many files results in a segmentation violation. Here is what
I do:

root [0] .T

Trace mode on 1
root [1] TChain ch("ntp1")
{TChain ch("ntp1");
!!!Calling constructor 0xffffffff.TChain("ntp1") for declaration of ch
2    }root [2] 
root [2] TChain as("ntp2")
{TChain as("ntp2");
!!!Calling constructor 0xffffffff.TChain("ntp2") for declaration of as
2    }root [3] 
root [3]  ch.Add("MC*.root")
{ch.Add("MC*.root");
2    }
# _iostream
70   G__ateval(const int x) {return(0);}

(Int_t)40
root [4]  as.Add("MC*.root")
{as.Add("MC*.root");
2    }
# _iostream
70   G__ateval(const int x) {return(0);}

(Int_t)40
root [5]  ch.AddFriend("ntp2")
{ch.AddFriend("ntp2");
2    }
# _iostream
63   G__ateval(TFriendElement* c const & x) {return(0);}

(class TFriendElement*)0x87964e8
root [6] ch.Draw("ntp2.eventInRun")
{ch.Draw("ntp2.eventInRun");1    1    <TCanvas::MakeDefCanvas>: created 
default TCanvas with name c1

 *** Break *** segmentation violation
Root > 
root [7] .q

!!!Calling destructor 0x878e848.~TChain() for as ary0:link-1
!!!Calling destructor 0x878e268.~TChain() for ch ary0:link-1
 *** Break *** segmentation violation


output from gdb info stack

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 29505)]
0x412b32d0 in TTreeFormula::EvalInstance ()
   from /opt/root/V-CVS_Sun-30-Jun-2002.pktw23/lib/libTreePlayer.so
(gdb) info stack
#0  0x412b32d0 in TTreeFormula::EvalInstance ()
   from /opt/root/V-CVS_Sun-30-Jun-2002.pktw23/lib/libTreePlayer.so
#1  0x412ba959 in TTreePlayer::EntryLoop ()
   from /opt/root/V-CVS_Sun-30-Jun-2002.pktw23/lib/libTreePlayer.so
#2  0x412b8a18 in TTreePlayer::DrawSelect ()
   from /opt/root/V-CVS_Sun-30-Jun-2002.pktw23/lib/libTreePlayer.so
#3  0x409e4ba0 in TTree::Draw () at eval.c:41
#4  0x409d5dce in TChain::Draw () at eval.c:41
#5  0x40a377b1 in TChain::Draw () at eval.c:41
#6  0x40a0b274 in G__TChain_Draw_1_1 () at eval.c:41
#7  0x404f3aea in G__call_cppfunc () at eval.c:41
#8  0x404e370d in G__interpret_func () at eval.c:41
#9  0x404c9f05 in G__getfunction () at eval.c:41
#10 0x405547b3 in G__getstructmem () at eval.c:41
#11 0x4054d662 in G__getvariable () at eval.c:41
#12 0x404c2319 in G__getitem () at eval.c:41
#13 0x404c0adf in G__getexpr () at eval.c:41
#14 0x40509e83 in G__exec_function () at eval.c:41
#15 0x40511244 in G__exec_statement () at eval.c:41
#16 0x404a8a31 in G__exec_tempfile () at eval.c:41
#17 0x40519245 in G__process_cmd () at eval.c:41
#18 0x401489b6 in TCint::ProcessLine () at eval.c:41
#19 0x400e723b in TApplication::ProcessLine () at eval.c:41
#20 0x40ac58ff in TRint::HandleTermInput () at eval.c:41
#21 0x40ac4c48 in TTermInputHandler::Notify () at eval.c:41
#22 0x40ad54c3 in TTermInputHandler::ReadNotify () at eval.c:41
#23 0x4017fa83 in TUnixSystem::CheckDescriptors () at eval.c:41
#24 0x4017f1a6 in TUnixSystem::DispatchOneEvent () at eval.c:41
#25 0x40125f39 in TSystem::InnerLoop () at eval.c:41
#26 0x40125ece in TSystem::Run () at eval.c:41
#27 0x400e7cf9 in TApplication::Run () at eval.c:41
#28 0x40ac5446 in TRint::Run () at eval.c:41
#29 0x08048802 in main () at eval.c:41
#30 0x40b89507 in __libc_start_main (main=0x80487b0 <main>, argc=1, 
    ubp_av=0xbffff4f4, init=0x80485f4 <_init>, fini=0x80488b0 <_fini>, 
    rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbffff4ec)
    at ../sysdeps/generic/libc-start.c:129



40 files are added to each TChain, each containing 2 TTrees ntp1, ntp2. 
I think the files are not corrupted because w/o the friend stuff I can 
loop over the entire chains.

I'm using last sundays cvs version on rh72. 

Hope this helps

Andreas



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:58 MET