1 #include "StFgtCosmicAlignment.h"
5 float z0[MaxDisc]={0.0, 16.51, 2.0*16.51};
7 float x00=2.0, y00=-26.0, z00=0.0;
9 float par[MaxDisc][6]= { {0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
10 {-0.0314,-0.1427, 0.1298, -0.0746, 0.0247, -0.0311},
11 {0.0228, 0.3543, 0.0815, -0.1006, -0.0110, -0.0372}};
14 void rot(
float x,
float y,
float z,
15 float x0,
float y0,
float z0,
16 float o,
float p,
float q,
17 float &xx,
float &yy,
float &zz){
20 float co=cos(o), so=sin(o);
21 float cp=cos(p), sp=sin(p);
22 float cq=cos(q), sq=sin(q);
30 xx=x1*co*cp + y1*(-cq*sp+sq*so*cp) + z1*( sq*sp+cq*so*cp) + x00;
31 yy=x1*co*sp + y1*( cq*cp+sq*so*sp) + z1*(-sq*cp+cq*so*sp) + y00;
32 zz=x1*(-so) + y1*( sq*co ) + z1*( cq*co ) + z00;
35 void getAlign(
int idisc,
float pl,
float rl,
float &x,
float &y,
float &z,
float &p,
float &r){
36 float xx=rl * cos(pl);
37 float yy=rl * sin(pl);
38 rot(xx,yy,0.0,par[idisc][0],par[idisc][1],par[idisc][2],par[idisc][3],par[idisc][4],par[idisc][5],x,y,z);