Re: TBranch::GetEntry(Int_t)

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Nov 16 1999 - 09:21:18 MET


Hi Kris,
TBranch::GetEntry tests if you try to read from a file the same entry
than in the previous call for the same tree and branch. This is clearly
to save time. The typical situation were this test is essential is when
  - you read only one branch (branch->GetEntry(entry);
  - skip all the other branches if some test using the branch variables
    decide so.
  - invoke tree->GetEntry(entry) to read the complete event. There is no
need
    to read again the first branch (or branches).

I do not understand in which situation you can get a problem.

Rene Brun

Kristjan H Gulbrandsen wrote:
> 
> Does anybody know why the first line TBranch::GetEntry is
> 
>      if (fReadEntry == entry) return 1;
> 
> ?
> 
> The effect is to not give your object or set the value of the
> leaves (if you use basic types). It seems rather annoying if
> you somehow changed some values and would like to get the
> same entry again. I end in most of my code just getting some
> dummy entry often just to ensure that I really get the data
> I want. I think it would be nice if this behavior could be
> overridden somehow.
> 
> Besides a possible speed issue, if anybody knows any reasons
> for this behavior, it would be helpful if they could clue me
> in.
> 
>                                 Thanks,
> 
>                                 Kris Gulbrandsen
>                                 gulbrand@mit.edu



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:43 MET