Re: [ROOT] Problem with TVectorD

From: Sebastien Greder (greder@in2p3.fr)
Date: Thu Jun 24 2004 - 17:23:30 MEST


 Hi Perfetto,

 you are retrieving a pointer from the TFile so
 if you wanna get a entry in the TVectorD you
 should write :

 (*par)(i) which represents your TVectorD whereas
 par is the pointer on your TVectorD (this is a C issue)

 Writing down xxx() , i.e something with brackets means
 that you are using a function, that's what the message is
 telling you

 cheers,

 seb.


On 24 Jun 2004, Francesco Perfetto wrote:

> Hi All,
> 
> I have the following problem:
> I use the TVectorD class in my program, 
> ...
> / definizione della Fermi Dirac e della tripla gaussiana
> Double_t norm_FD[] = {474.76,466.72,459.35,423.14};
> Double_t parFD[4][4];
> Double_t par3G[9][21];
> 
> void riempi()
> {
>   Int_t kfd = 0;
>   for(Int_t i=1; i<=4; i++){
>     for(Int_t j=0; j<4; j++){
>       TVectorD *par = (TVectorD*)fpar->Get(Form("par%d",i));
>       parFD[j][kfd] = par(j);   <<<<<<<---------THIS IS LINE 81
>     }
>     kfd++;
>   }
> 
>   Int_t kg3 = 0;
>   for(Int_t i=5;i<=25; i++){
>     for(Int_t j=0;j<9; j++){
>       TVectorD *par = (TVectorD*)fpar->Get(Form("par%d",i));
>       par3G[j][kg3] = par(j);   <<<<------THIS IS LINE 90
>     }
>     kg3++;
>   }
> }
> 
> ...
> 
> when I compile my program I have the following errors:
> 
> likelihood.cc: In function `void riempi()':
> likelihood.cc:81: `par' cannot be used as a function
> likelihood.cc:90: `par' cannot be used as a function
> gmake: *** [Linux/likelihood.o] Error 1
> 
> Can anyone help me?
> 
> I use root 4.00/04 on linux redhat 9.0 
> 
> P.S. The same function riempi() work very well from the root prompt:
>  
> root [0] .L inserimento_numeri.C
> root [1] riempi()
>  
> 
> Thanks
> Francesco.
> 
> 
> 
> 

  ---------------------------------------------------------------------
 | Sebastien GREDER                        tel :  +33 (0)3 88 10 63 54 |
 | D0 Strasbourg,	  					       |
 | Institut de Recherches Subatomiques     fax :  +33 (0)3 88 10 62 34 |
 | 23, rue du loess - BP 28                secr : +33 (0)3 88 10 66 40 |
 | F-67037- STRASBOURG cedex 2             e-mail : greder@in2p3.fr,   |
 |						    greder@fnal.gov    |
  ---------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET