Creating and Filling Many Histogram

From: zaldy <zaldy_at_neutrino.kek.jp>
Date: Thu, 3 Feb 2005 10:04:46 +0900 (JST)


Dear Root Experts,

I have two questions.
I would like to create many histogram simultaneously with names of the form: histo_1, histo_2, .... , histo_(i) where i=1,2,3,4,....,n.

I figure out doing it like this:

  for(Int_t i=1; i<n; i++)
{

    TH1F * histo_(i) = .....
  }

But this method does not simply work here.

  1. How do we give names to the histogram?
  2. How do we fill this histogram? ( histo_(i)->Fill(.....);)

Naming the histogram something like:

  char histo_name[100];
  for(Int_t i=1; i<n; i++)
{

   sprintf(histo_name,"histo_%d",i);
   TH1F * histo_(i) =....
  }

But it does not simply work.   

Any Hint how to do this?
Thanks

-- 
Zaldy A. Nawang

PS,
Using Version   4.02/00   29 January 2005 on 
gcc version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)
Received on Thu Feb 03 2005 - 02:02:00 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET