Re: [ROOT] TVECTOR3 as an argument.

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Sep 11 2002 - 16:08:22 MEST


Hi Statis,

You should remove the calls gSystem->Load("libPhysics"); from your code.
then, only once do:
gSystem->Load("libPhysics");
then
.L mycode.C
main()

Rene Brun

On Wed, 11 Sep 2002, Stathis Stefanidis wrote:

> Hello ,
> 
> I am trying to pass a TVECTOR3 as an argument to function created by me ,
> and the thing seems not to work. I work on RedHat Linux v7.2 and the
> 3.02/07 version of ROOT.
> 
> The code looks like
>  
>  gSystem->Load("libPhysics");
>  Float_t my_func(TVector3 p_one, TVector3 p_two);
> 
>  void main()
>     {
>      gSystem->Load("libPhysics");
>        ......
>      TVector3 *a = new TVector3(5.0, 6.0, 7.0);
>      TVector3 *b = new TVector3(2.0, 5.0, 2.0);
>   
>      Float_t c = my_func(a,b);
>        .......
> 
>      }
>  
>   Float_t my_func(TVector3 *p_one, TVector3  *p_two)
>       {   
>      
>         gSystem->Load("libPhysics");
>        
>         Float_t k1 = p_one->Mag(); 
>         Float_t k2 = p_two->Mag(); 
> 
>         return sqrt(k1*k2);
>      }
>  
> The error i get is :
>  
> Error: Illegal Assignment to an undeclared symbol TVector3*p_one FILE:testing.C LINE:20
> Error: Illegal Assignment to an undeclared symbol TVector3*p_two FILE:testing.C LINE:20
> *** Interpreter error recovered ***
> 
>  What do i miss?
> Thanks in advance.
> 
>  
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:09 MET