RE: [ROOT] Problem copying a chain

From: Philippe Canal (pcanal@fnal.gov)
Date: Fri Jun 27 2003 - 16:26:39 MEST


Hi Edward,

Did you remove the line:
	oldtree->SetBranchAddress(...)?
Could you give me access to your to files?

Cheers,
Philippe

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of Edward Chen
Sent: Thursday, June 26, 2003 10:33 PM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] Problem copying a chain


Hi - I'm having problems modifying $ROOTSYS/tutorials/copytree3.C so that
it copies a chain to a single file.

I have a chain file (mychainfile.cc) which looks something like this:

  TChain *ntp1 = new TChain("ntp1");
  ntp1->Add("myfile1.root/ntp1");
  ntp1->Add("myfile2.root/ntp1");

Then, in copytree3.C, I have:

  gROOT->Macro("mychainfile.cc");
  TTree *oldtree = ntp1;

in lieu of the following original lines:

   //Get old file, old tree and set top branch address
   TFile *oldfile = new TFile("$ROOTSYS/test/Event.root");
   TTree *oldtree = (TTree*)oldfile->Get("T");



Now when running copytree3.C, I get a seg fault and the following stack
trace:

 *** Break *** segmentation violation
 Generating stack trace...
 0x401ae93b in TUnixSystem::StackTrace(void) + 0x25b from
/home/edward/root/lib/libCore.so
 0x401ad5ba in TUnixSystem::DispatchSignals(ESignals) + 0xb2 from
/home/edward/root/lib/libCore.so
 0x401ac763 in <unknown> from /home/edward/root/lib/libCore.so
 0x401b01fd in <unknown> from /home/edward/root/lib/libCore.so
 0x40c258d5 in <unknown> from /lib/i686/libpthread.so.0
 0x40cc5848 in <unknown> from /lib/i686/libc.so.6
 0x40ad2b6b in TLeafF::FillBasket(TBuffer &) + 0x43 from
/home/edward/root/lib/libTree.so
 0x40ac0fd9 in TBranch::FillLeaves(TBuffer &) + 0x39 from
/home/edward/root/lib/libTree.so
 0x40ac0cfc in TBranch::Fill(void) + 0x214 from
/home/edward/root/lib/libTree.so
 0x40ada968 in TTree::Fill(void) + 0x80 from
/home/edward/root/lib/libTree.so
 0x40af23e2 in <unknown> from /home/edward/root/lib/libTree.so
 0x4056e69f in G__call_cppfunc + 0x237 from
/home/edward/root/lib/libCint.so
 0x4055df35 in G__interpret_func + 0x895 from
/home/edward/root/lib/libCint.so
 0x40543fa5 in G__getfunction + 0x1431 from
/home/edward/root/lib/libCint.so
 0x405d0d3f in G__getstructmem + 0x7c3 from
/home/edward/root/lib/libCint.so
 0x405c9b4a in G__getvariable + 0x636 from
/home/edward/root/lib/libCint.so
 0x4053c09d in G__getitem + 0x4dd from /home/edward/root/lib/libCint.so
 0x4053a863 in G__getexpr + 0x8ba3 from /home/edward/root/lib/libCint.so
 0x4058553b in G__exec_function + 0x123 from
/home/edward/root/lib/libCint.so
 0x4058c924 in G__exec_statement + 0x2e74 from
/home/edward/root/lib/libCint.so
 0x4058906d in G__exec_loop + 0x261 from /home/edward/root/lib/libCint.so
 0x405897c5 in G__exec_for + 0x255 from /home/edward/root/lib/libCint.so
 0x4058c6b6 in G__exec_statement + 0x2c06 from
/home/edward/root/lib/libCint.so
 0x40522630 in G__exec_tempfile + 0x2a0 from
/home/edward/root/lib/libCint.so
 0x405948b4 in G__process_cmd + 0x4a38 from
/home/edward/root/lib/libCint.so
 0x401710ba in TCint::ProcessLine(char const *, TInterpreter::EErrorCode
*) + 0x9a from /home/edward/root/lib/libCore.so
 0x401711a8 in TCint::ProcessLineSynch(char const *,
TInterpreter::EErrorCode *) + 0x48 from /home/edward/root/lib/libCore.so
 0x40107bb6 in TApplication::ProcessFile(char const *, int *) + 0x6e2 from
/home/edward/root/lib/libCore.so
 0x40107320 in TApplication::ProcessLine(char const *, bool, int *) +
0x4ec from /home/edward/root/lib/libCore.so
 0x40bec45b in TRint::HandleTermInput(void) + 0x127 from
/home/edward/root/lib/libRint.so
 0x40beb780 in TTermInputHandler::Notify(void) + 0x28 from
/home/edward/root/lib/libRint.so
 0x40bfb853 in TTermInputHandler::ReadNotify(void) at
/usr/src/build/85131-i386/BUILD/glibc-2.2.4/stdlib/atexit.c:33 from
/home/edward/root/lib/libRint.so
 0x401ad9af in TUnixSystem::CheckDescriptors(void) + 0x113 from
/home/edward/root/lib/libCore.so
 0x401ad0c2 in TUnixSystem::DispatchOneEvent(bool) + 0x112 from
/home/edward/root/lib/libCore.so
 0x4014a669 in TSystem::InnerLoop(void) + 0x1d from
/home/edward/root/lib/libCore.so
 0x4014a5fe in TSystem::Run(void) + 0x7e from
/home/edward/root/lib/libCore.so
 0x40107f2d in TApplication::Run(bool) + 0x31 from
/home/edward/root/lib/libCore.so
 0x40bebf96 in TRint::Run(bool) + 0x2ba from
/home/edward/root/lib/libRint.so
 0x08048802 in main + 0x52 from /home/edward/root/bin/root.exe
 0x40cb3507 in __libc_start_main at
/usr/src/build/40457-i686/BUILD/glibc-2.2.4/csu/../sysdeps/generic/libc-star
t.c:129
from /lib/i686/libc.so.6
 0x080486d1 in __register_frame_info + 0x35 from
/home/edward/root/bin/root.exe

Thanks for any help.

-Ed



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:12 MET