Re: [ROOT] TTree::Draw with objects

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Aug 03 2000 - 14:36:52 MEST


Angela,
You should use TTree::MakeClass and use the generated skeleton code
fot thid kind of queries.
Access to data members only works in split mode.
Only one level access to functions is currently supported.

Rene Brun



On Wed, 2 Aug 2000, Angela Biselli wrote:

> Dear Rooters,
> I created a class V4 that contain another clas V3 
> 
> class V4 : public TObject {
> ...
>   double GetT() {return tt}
>   V3 GetV() {return vv}
>  private:
>   V3 vv;  
>   Double_t tt;
>   ClassDef(V4,1)
> };
> 
> Then a created a tree with a single branch 
> tree->Branch("vec2","V4",&vec2,bsize,0);
> If I try to use T->Draw I can plot member functions that return directly a
> Double_t 
> T->Draw("vec2.GetT()") 
> 
> but if I try to plot the modulus of the 3 vector(V3::Mod())
> T->Draw("vec2.GetV().Mod()")
> the histogram has the right number of entries but the values are always
> zero
> 
> Also if I have a public member "var" and I try to do
> T->Draw("vec2.var")
> I get
> Error in <TLeafObject::GetMethodCall>: Unknown method:var
> 
> *ERROR 26 : 
>  Unknown name : "vec2.var"
> 
> 
> It seems to me that if I want to use TTree::Draw I need to write a lot of
> "get" functions that return directly what I want
> Am I wrong?
> 
> Angela
> 
> -- 
> Angela Biselli             homepage : http://ignatz.phys.rpi.edu/~biselli
> Graduate Student           e-mail:biselli@angel.phys.rpi.edu
> Office TEL.518-276-2050 
> 
> 
> 



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