Re: [ROOT] How to know whether a histogram has ZERO entries?

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Jul 16 2002 - 15:51:43 MEST


The recipee that I gave to you works for Trees. Did you try?
If one element in the directory is a Tree,
TTree::Print is called, showing the number of entries per branch.
By definition all leaves in one branch have the same number
of entries

Rene Brun

On Tue, 16 Jul 2002, Jyothsna Rani wrote:

> 
> It gives the number of entries of histograms only not for the leafs in the
> tree. 
> 
> Will it be possible to get the number of entries for each and every leaf
> of a branch in a tree?
> 
> Thanks,
> Jyothsna
> 
> On Tue, 16 Jul 2002, Rene Brun wrote:
> 
> > You can do
> > root > gDirectory->Print(); //will print one line for each object in
> >                             //the current directory in memory
> > 
> > To print the same for objects in a file, do:
> > root > TFile f("myfile.root")
> > root > f.ReadAll();
> > root > f.Print();
> > 
> > Rene Brun
> > 
> > On Mon, 15 Jul 2002, Jyothsna Rani wrote:
> > 
> > > 
> > > Would like to get the output inside root session?
> > > 
> > > Something like this:
> > > 
> > > root[]jet*->GetEntries();
> > >       jet1   100
> > >       jet2   300
> > > 	........
> > >       jet10  0
> > > 
> > > Yep..each histogram has different number of entries.
> > > 
> > > This option would help in determining the histograms/ntuple variables with
> > > zero entries. 
> > > 
> > > Thanks in advance,
> > > Jyothsna
> 
> 
> 
> 



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