Re: [ROOT] problem with tree->GetEntry

From: Ursula Berthon (berthon@in2p3.fr)
Date: Mon Oct 23 2000 - 14:34:14 MEST


On Wed, 18 Oct 2000, Rene Brun wrote:

> Hello Ursula,
> What you get is correct. Let me explain.
> At the first call to GetEntry for a given entry, the branch data
> will be read from the branch buffer and the function returns the number
> of bytes effectively read.
> If you call again GetEntry for the same entry via TTree::GetEntry
> or TBranch::GetEntry, these two functions check if you try to read
> again the same data. If this is the case, one can skip the step
> of decoding the branch data from the branch buffer(s) since
> the data are already available in memory.
> The TBranch::GetEntry function returns the code 1 in this case,
> and TTree::GetEntry returns the sum of all branches (ie the number
> of branches). The functions return 1 instead of 0 to distinguish
> for the case 0 of a non-existing entry.
> Logically these two functions should return the corresponding
> number of bytes in the branch buffers, but returning this info would
> require additional bookeeping and a time penalty.
> 
> Rene Brun
> 
Hello Rene,
that is approximately what I assumed to be true if you call GetEntry with 
the last parameter (getall) =1. In the documentation is said that with
getall=0, you will read all active branches, so  I would have thought
that in this case no checks are made whether parts of the entry have
already been read or not.
   In any case, I think it is interesting for some applications to be
able to reread the branches you decide to read, without root deciding
for you. For example in my case, in the H1 display, I want to make
lists of run and event numbers so that the user can just
click on this number to get the corresponding image. With the scheme that 
root applies, I have 
to transmit the last entry number read to the (quite
different) part of the display where I treat one event,
because, if the user chooses to see the last event of the
list, things are not the same as for the other events. This 
is rather clumsy, and since I am interactive and not in
batch, I would prefer to have a simpler logic and would not mind to
reread small parts of the event. 

        Gruss/greetings/A bientot!
  
                         Ursula

*************************************************************
                                                Ursula Berthon
                                      E-mail  berthon@in2p3.fr
                                    Tel. 33 - 1 - 69 33 31 21
                                    Fax  33 - 1 - 69 33 30 02



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