Re: [ROOT] Two dimension array of histogram

From: Luiz Martins Mundim Filho (mundim@uerj.br)
Date: Fri Nov 22 2002 - 00:19:20 MET


I could create the array os histogram as told by Rene:

TH1F *x;

x[i][k] = new TH1F("x[i][k]","title",...)

But now I want to put a protection at the begining of the program, that 
means, deleting the
histogram before creating it again. I used to do:

gDirectory->Delete("h");

It work for a normal histogram (h), but it is not working for the array 
above, ROOT keeps warning me about recreation of existing histo and 
about potential memory leakage. As argument to the Delete command above, 
I used a Char_t variable, as:

sprintf(var,"histoname[%d][%d",i,j);
gDirectory->Delete(var);

Could some of you give me some help?

Thanks in advance.

Luiz

Luiz Martins Mundim Filho wrote:

> Hi rooters
>
> In my analysis program, I need a two dimension array of histograms. I 
> found how to define and fill an one dimension array, but could not 
> define one the way I really need. I searched the root site also and 
> found nothing like this.
>
> Could you help me?
>
> Thanks
>
> Luiz
>



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