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 ,
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) ;
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();
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
-- ************************************************ * Hengtong Ding * * * * Address: Institute of Particle Physics, * * Central China Normal University * * Wuhan, 430079, P. R. China * * Tel: 0086 27 6786 7946 (lab) * * 0086 27 8715 0351 (dormitory) * * Fax: 0086 27 6786 3213 * * Email: dinght_at_iopp.ccnu.edu.cn * * dinghengtong_at_hotmail.com * ************************************************Received on Wed Oct 25 2006 - 15:07:30 MEST
This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:01 MET