Hi,
This is the program result:
root [0]
Processing Lorentz_Transformation.C...
In file included from input_line_8:1:
/home/andre/Dropbox/Doutorado/FPMC/Lorentz_Transformation.C:118:3: error: assigning to 'Double_t *' (aka 'double *') from incompatible type 'Double_t' (aka 'double')
v = BOOST(px[i],py[i],pz[i],E1[i]);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am using the root 6.
The structure of the program:
#include "READT.C"
#include "WRITET.C"
//Definition of function
Double_t BOOST(Double_t , Double_t , Double_t , Double_t);
//Lorentz Transformation ...
Double_t BOOST(Double_t px, Double_t py, Double_t pz, Double_t E1){
...
...
...
Double_t *vector = (Double_t*)calloc(4,sizeof(Double_t));
After the Lorentz Transformation
vector[0] = P0;
vector[1] = P1;
vector[2] = P2;
vector[3] = P3;
return *vector;
}
void Lorentz_Transformation(){
#define N 200000
Definition of the variables...
Double_t px[N], py[N], pz[N], E1[N], E1T[N], pxT[N], pyT[N], pzT[N], x1[N], x2[N], x3[N];
int lNpts = READT("file_p_E.txt",x1,x2,x3,px,py,pz,E1);
cout<<"lNpts = "<<lNpts<<endl;
Double_t *v;
for(long i=0; i<lNpts; i++){
v = BOOST(px[i],py[i],pz[i],E1[i]);
E1T[i] = v[0];
pxT[i] = v[1];
pyT[i] = v[2];
pzT[i] = v[3];
free(v);
}
WRITET(pxT,pyT,pzT,E1T,lNpts,"Dados_Transfor_LAB.txt");
}
Can someone help me?
Thanks.
Cheers,
Andre