[ROOT] one problem

From: Junjie Zhu (junjie@wam.umd.edu)
Date: Fri Apr 27 2001 - 19:20:28 MEST


Hi, Rooters:

I have one problem about Root:  for each event, I want to generate two
particles and I have written the class Particle (this class works very
well), for the event loop,  the code is as followed:

for (Int_t i = 0; i < 2; i ++){
Particle MCpart[i] = new Particle(emcid[i], emcpx[i], emcpy[i],
emcpz[i],emcE[i]);
}

cout << "MCpart[0] -> pt() = " << MCpart[0] -> pt() << endl;
cout << "MCpart[1] -> pt() = " << MCpart[1] -> pt() << endl;
// pt() is a member function of Particle

Then I run it, and got the following error message:

Error: Non-static-const variable in array dimention FILE:electron.C
LINE:80
 (cint allows this only in interactive command and special form macro
which is special extension. It is not allowed in source code. Please
ignore subsequent errors.)

It seems that this is a syntax problem, but I do not know how to solve it, 
any idea about it?

ROOT Version:  2.23/11       
CINT/ROOT C/C++ Interpreter version: 5.14.25

Jim



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