Re: [ROOT] Peculiar "feature" in TSelector decendant.

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Feb 25 2003 - 23:28:01 MET


Hi Jens,

Use:
       fChain->IsA(), TChain::Class(), TTree::Class());
instead of
       fChain->Class(), TChain::Class(), TTree::Class());


Rene Brun

On Tue, 25 Feb 
2003, Jens Ivar Jordre wrote:

> Howdy rooters.
> 
> Processing some trees with a class inheriting from a TSelector I noticed 
> some unexpected RTTI info. I've made the attached MySelector which 
> illustrates the problem on ROOT checked out from CVS yesterday (Feb. 
> 24th) and compiled on an x86 running RH8.0.
> 
> First I create an instance of TChain and add two files to it, the trees 
> in the files and the instance of TChain having the same name. Then I 
> call TTree::MakeSelector(<selector name>), i.e. the member of my chain.
> 
> The only lines I add to the output from 
> TTree::MakeSelector("MySelector") are the following lines at the end of 
> MySelector::Begin(TTree* tree):
> 
>     Info("Begin", "fChain is %s", fChain->ClassName());
>     Info("Begin", "\n\tfChain->Class() = 0x%x
> 	\n\tTChain::Class() = 0x%x
> 	\n\tTTree::Class() = 0x%x",
> 	fChain->Class(), TChain::Class(), TTree::Class());
> 
> When I run TChain::Process("MySelector.C") the output from 
> MySelector::Begin(TTree* tree) is the following:
> ....
> Info in <TSelector::Begin>: fChain is TChain
> Info in <TSelector::Begin>:
>          fChain->Class() = 0x8c59948
>          TChain::Class() = 0x916d3d0
>          TTree::Class() = 0x8c59948
> ....
> 
> So, on the one hand fChain clames to be an instance of TChain (the first 
> line) while its TClass pointer indicates that it is an instance of 
> TTree. Is this the intention?
> 
> Best wishes from
> Jens Ivar
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET