Re: [ROOT] Problem with Tree.Draw

From: Rene Brun (Rene.Brun@cern.ch)
Date: Sun May 20 2001 - 17:31:26 MEST


Hi Christian,
   
The first problem is not connected with Trees. It seems that there is
a problem with the CINT macro call mechanism when an argument
is a string with a ")". This is under investigation.
Instead of doing  .x DrawTree.C("...
   do
.L DrawTree.C, then
  DrawTree(""...
   
If this does not solve your problem, please send me a short macro
that I can use to to debug.
   
About your second problem. I am aware of some combinations
of viewing angles that give problems. This happens if you make more
than one complete turn with the picture upside down.
   
 Rene Brun  

On Sat, 19 May 2001 cstrato@EUnet.at wrote:

> 
> 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