Re: [ROOT] TBranch->GetEntry(i)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Nov 27 2002 - 18:34:01 MET


Hi daniel,

I suggest to read the tutorials tree0.C, tree1.C, tree2.C, tree3.C
With your example, you can do
  TLeaf *l_phioffset = t->GetLeaf(("phioffset");
  l_phioffset->GetBranch()->GetEntry(5); //to read entry 5
  double phioffset = l_phioffset->GetValue();

Rene Brun

On Wed, 27 Nov 2002, Daniel Holmes wrote:

> Maybe someone knows the answer to this:
> 
> I have a tree (*t) with a variable "phioffset" in it.
> 
> i can do:
> t->Draw("phioffset"); //fine, plots a 1Dhisto of the phioffset entries
>  
> ..now i want to be able to read out the actual entry values so i do:
> TBranch* b_phioffset=t->GetBranch("phioffset");
> b_phioffset->GetEntries(); //fine,returns the number of entries i expected  
> b_phioffset->GetEntry(5);
> 
> ..this returns :(Int_t)4  ..as does every other entry value.. 
> i know that not all of the entries are 4 .. so this is wrong?? ..so how do
> i read out their values??  I have other similar variables which also
> return just one integer for all entries.
> 
> any ideas anyone??
> 
> 
> 



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