Re: [ROOT] 2.25.03: TChain::Process + user defined TSelector sticks on first TFile and gets real slow

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Sep 21 2000 - 15:16:18 MEST


Hi Matt,
Are you really using 2.25/03? I do not understand how your piece of code
can even compile. fTree should be fChain.
Did you use the TTree::MakeSelector function to generate your skeleton
class?
I suggest you do. h1analysis.C works very well with 2.25/03.
In the Begin function, look how the Init function initializes the branch
address. Samething for the Notify function.

Rene Brun

On Wed, 20 Sep 2000, Matthew D. Langston wrote:

> A call to TChain::Process on a user defined TSelector erroneously
> iterates over and over again on the first TFile of a TChain.  In
> addition, this second and subsequent erroneous iterations over the first
> TFile is at least an order of magnitude slower than the first iteration,
> if not more.
> 
> I have attached the small, simple file named MySelector.cxx which
> demonstrates this problem.  Notice that I defined MySelector::ProcessCut
> as follows:
> 
>   Bool_t ProcessCut( Int_t entry )
>   {
>      fTree->GetEntry( entry );
>      return kTRUE;
>   }
> 
> Is this not the correct way to simply read in all of a TTree's
> TBranches?  I also tried the following with the same result:
> 
>   Bool_t ProcessCut( Int_t entry )
>   {
>      b_foo->GetEntry( entry );
>      return kTRUE;
>   }
> 
> 
> I followed the example in the files h1analysis.h and h1analysis.C in the
> tutorials subdirectory, which seem to do it as I describe as well.
> 
> The nature of the problem suggests that the user is required to call
> TChain::LoadTree during the call to TSelector::Notify, in a manner
> similar to the case with the code generated by TTree::MakeClass.
> However, it didn't seem like I should have to do this with a TSelector.
> Could somebody help me please?  Thank you :-)
> 
> Regards, Matt
> 
> --
> Matthew D. Langston
> SLD, Stanford Linear Accelerator Center
> langston@SLAC.Stanford.EDU
> 



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