Re: [ROOT] dinamic memory allocation within ROOT

From: Henrique de M. J. Barbosa - mestrado (hbarbosa@ifi.unicamp.br)
Date: Fri Nov 29 2002 - 19:17:45 MET


Hello Rene,

> At least one advantage of deriving from a common base class TObject.
> You can do
>   Histo_List[0])->Draw();

I tried your example and it doesn't work for me.  Here's what I got:

root [0] TH1D* h = new TH1D()
root [1] h->Draw()                                <- this draw is ok
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
root [2] TObjArray *t = new TObjArray()
root [3] t->GetEntries()
(const Int_t)0
root [4] t->Add(h)
root [5] t->GetEntries()
(const Int_t)1
root [6] t[0])->Draw()                            <- this draw is not ok
!!!Bad command input. Ignored!!!
root [7] ((TH1D*) t[0])->Draw()                   <- this draw is ok

Am I missing something?

thanks,

Henrique
****************************************
State University at Campinas - BRASIL
"Gleb Wathagin" Physics Institute
Department of Cosmic Rays and Chronology

Henrique Barbosa      The Pierre Auger
PhD Student             Observatory
****************************************



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