Re: TTree::Write() Problem

From: Rene Brun <Rene.Brun_at_cern.ch>
Date: Wed, 25 Oct 2006 15:39:54 +0200


Could you send the shortest possible RUNNING script reproducing your problem?

Rene Brun

Hengtong Ding wrote:
> Hi all,
>
> I first compiled my code by .L code.C++ and then
> load "code_C.so" to run some functions. The compilation
> is quit OK, but when I run some events, erros happened ,
>
> *** Break *** segmentation violation
> Generating stack trace...
> /usr/bin/addr2line: root.exe: No such file or directory
> /usr/bin/addr2line: root.exe: No such file or directory
> 0x41e03bdc in <unknown> from
> /direct/alice/dinght/HVQMuon/NEW/RAA/submit/old/testdir/./code_C.so
> 0x40848f56 in G__ExceptionWrapper + 0x42 from
> /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libCint.so.5.12
> 0x408e473f in G__call_cppfunc + 0x2a7 from
> /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libCint.so.5.12
> ...
> ...
> ...
> 0x402114ac in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*)
> + 0x138 from
> /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libCore.so.5.12
> 0x4021160e in TCint::ProcessLineSynch(char const*,
> TInterpreter::EErrorCode*) + 0x46 from
> /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libCore.so.5.12
> 0x4014ad41 in TApplication::ProcessFile(char const*, int*) + 0x8b9 from
> /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libCore.so.5.12
> 0x4014a40d in TApplication::ProcessLine(char const*, bool, int*) + 0x5ab
> from /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libCore.so.5.12
> 0x415187ec in TRint::Run(bool) + 0x23a from
> /direct/data01/CERN/alice/alisoft/Root/v5-12-00/lib/libRint.so.5.12
> 0x08048899 in main + 0x71 from root.exe
> 0x42015704 in __libc_start_main + 0xe4 from /lib/tls/libc.so.6
> 0x08048799 in _Unwind_Resume + 0x31 from root.exe
> Function Run() busy flag cleared
>
> But finally I can get the output "test.root" in which histograms are
> included and are OK but no trees.
>
> My code is listed as below :
>
> TFile *outfile = new TFile("test.root","recreate");
> const Int_t ArraySize = 13 ;
> Double_t *store_pp=0;
> if((store_pp=new Double_t[ArraySize]) == NULL) {
> cout << "can't allocate more memory for store_pp,terminating.\n" ;
> exit(0) ;
> }
> TTree *tree = new TTree("tree","variables in pp AA and AAquenched") ;
>
> tree->Branch("bpp",store_pp,"ptQ/D:ptM:ptmu:pzQ:pzM:pzMu:etaQ:etaM:etamu:yQ:yM:ymu:weightpp");
> /*
> some histograms are defined here !
> */
>
> /*
> One loop in which
> the values are assigned to store_pp[0], store_pp[1] ... store_pp[12]
> and "tree -> Fill()" is done. Also the histograms are filled here.
> */
> // some histograms Write() ;
> tree -> Write() ;
> outfile->Close();
>
> --------------------------
> My root version is v5-12-00, OS is Linux 2.4.20-8smp #1 SMP Redhat 9.
>
> I don't know why this happened, as when I write a testcode
> in which only Tree are defined(no histograms) in the way above, it
> runs OK. Also if I don't use the TTree in the above code, the codes
> also run OK. Maybe I ask too many memoris by "new TH1D()" when defining
> the histograms and after that you could not use a "new TTree() " ?
>
> Any suggestion will be appreciate.
> Thanks in advance.
>
> Hengtong
>
>
>
Received on Wed Oct 25 2006 - 15:40:11 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET