Hallo,
I have a problem using an array defined in my own namespace with TTree::Draw() method.
For example, If I define the namespace like this:
namespace MyNameSpace {
int A;
int B[2];
}
and try to run this piece of code:
MyNameSpace::A = 1;
MyNameSpace::B[0] = 2;
MyNameSpace::B[1] = 3;
tree->Draw("MyMethod(MyNameSpace::A)"); // works
tree->Draw("MyMethod(MyNameSpace::B[0])"); // does not work
there is no problem using MyNameSpace::A as an argument of TTree::Draw(), but when I’m trying to use MyNameSpace::B[0], I get the following error:
[quote]
Error in TTreeFormula::Compile: Bad numerical expression “MyNameSpace::B[0]” [/quote]
How do I solve this problem?
My ROOT version is 5.15/07
PS:
My LinkDef.h file contains this line:
#pragma link C++ namespace MyNameSpace+;