Re: [ROOT] Histogram List

From: Otto Schaile (Otto.Schaile@Physik.uni-muenchen.de)
Date: Thu Oct 19 2000 - 15:54:35 MEST


Hi Isidro
below a piece of code which use for that purpose (forget my own class
TMrbStatEntry)
Cheers
Otto
//____________________________________________________________________________

Int_t TMrbStatistics::Fill(){
//
//  Look for all histograms in current directory and make an entry in
statistics list
//
   Int_t nhists = 0;
   TIter next(gDirectory->GetList());
   TMrbStatEntry * ent;
   TH1 *h;
   TObject* obj;
   while(obj= (TObject*)next()){
      if(obj->InheritsFrom(TH1::Class())){
         h = (TH1*)obj;
         ent = new TMrbStatEntry(h, h->GetName(), h->GetTitle());
         fStatEntries->Add(ent); 
         if(h->InheritsFrom(TH2::Class())){
            ent->Set(h->GetEntries(), h->GetSumOfWeights()); 
         } else {
            ent->Set(h->GetEntries(), h->GetSumOfWeights(),
                     h->GetMean(), h->GetRMS()); 
         }
         nhists++;
      }
   }
   return nhists;
}
//____________________________________________________________________________


On Thu, 19 Oct 2000 Isidro.Gonzalez.Caballero@cern.ch wrote:

> Hi,
> 	Is there any way to get the list of Root Histogram created within
> an application?... I would like that each histogram name gets
> automatically into a menu so that the histogram can be plotted at any
> time.
> 
> 	Cheers:
> 
> 		Isidro
> 
> +---------------------------+--------------------------------+
> | Isidro González Caballero | mailto:Isidro.Gonzalez@cern.ch |
> | CERN-EP / Mailbox: F28010 | http://home.cern.ch/~iglez/    |
> | 1211 Geneva 23            |               -o-              |
> | Switzerland               | Tel: +41 22 76 73060, 73316    |
> +---------------------------+--------------------------------+
> 
> 

Dr. Otto Schaile            Sektion Physik, LMU Muenchen
Phone: +49 89 289 14070     Am Coulombwall 1, D-85748 Garching, Germany
GSM:   +49 171 4312031
FAX:   +49 89 289 14072     EMail: Otto.Schaile@Physik.Uni-Muenchen.DE



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:35 MET