TVector3 in ROOT 4

Hi all,

this is my first post so, sorry if I make a stupid question.
I’m trying to upgrade a program which uses ROOT routines from v3 to v4.
First remark, they are not trivially back-compatible. As explenade on the NOTE TMath is not a class anymore but a namespace: so far so good.
Anyway, the program uses the class TVector3, but in the header file of TVector3
(/opt/products/root/4.04.02/include/TVector3.h) there is:
#include "TMath.h"
that is: TMath is still considered as a class and, of course, my compilation crashes (see below).

In file included from /opt/products/root/4.04.02/include/TVector3.h:16,
from …/inc/ZVertex.h:21,
from …/inc/ZEvent.h:82,
from …/src/ZCanvas.cxx:34:
/opt/products/root/4.04.02/include/TVector2.h: In member function `Double_t TVector2::Phi() const’:
/opt/products/root/4.04.02/include/TVector2.h:90: error: incomplete type ‘TMath
’ cannot be used to name a scope

Any suggestions?
Thanks a lot in advance.

Regards, Ale

Could you send the shortest possible file reproducing this problem?
I do not see any problem in including TMath.h in TVector3.

Rene

Hi Rene,

sorry for the late answer. I realized that I forgot to delete the “class TMath;” declaration from the header, from the error message wasn’t clear.

Now I have a lot of problems with the 3d view, changing “x3d” to “GetView3D” is not enought: i.e. it compiles but when I run the program I get the following error:
Error in ZPad::TPad::CreateViewer3D: Cannot create 3D viewer of type: XY,SAME

Regards, Ale