[ROOT] Problem with Tree.Draw

From: cstrato@EUnet.at
Date: Sat May 19 2001 - 23:16:47 MEST


Dear Rooters

I have the following function in a macro to draw a tree:
void DrawTee(const char *vTreeName,const char *varexp)
{
   gSystem->Load("/opt/rootcode/Mylib.so");

   TFile *fFile = new TFile("/opt/rootcode/test.root","READ");
   TTree *vTree = (TTree*)fFile->Get(vTreeName);
//   MyClass *vClass = 0;
//   vTree->SetBranchAddress("vBranch",&vClass);

   vTree->Draw(varexp);
}

>From root I call this function:
root [1] DrawTree("vTree","fX")
This works fine, however, when I call:
root [2] DrawTree("vTree","sqrt(fX)")
I get the following error message printed 13 times:
Error: No symbol fX in current scope  FILE:macro4draw.C LINE:17
*** Interpreter error recovered ***
Error: class,struct,union or type (unknown) not defined
FILE:macro4draw.C LINE:17

Interestingly, the histogram is always drawn correctly, when
I use different functions.

I do understand why the error appears, since fX is a private member
of class MyClass and cannot be accessed directly, but then this error
should also appear in the case: DrawTree("vTree","fX").

What can I do to avoid the error messages?

Thank you in advance for your help.
My system: PowerBook LinuxPPC 2000, root 3.01/02

P.S.: When I rotate a 3-dim histogram interactively with the mouse in
such a way,
that I turn it upside-down often, then finally the vertical axis is no
longer
drawn correctly, and also the content is drawn partly outside of the
box.

P.P.S.: The function Tree->AddFriend() is really very helpful!

Best regards
Christian
----------------------------------
C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
V.i.e.n.n.a,  A.u.s.t.r.i.a



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:46 MET