[ROOT] TTree::Draw with objects

From: Angela Biselli (biselli@angel.phys.rpi.edu)
Date: Wed Aug 02 2000 - 20:55:16 MEST


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