3 Double_t dx, ddx, dy, ddy, dz, ddz, alpha, dalpha, beta, dbeta, gamma, dgamma;
17 {159, -45.65, 2.73, 13.73, 2.64, -9.93, 0.37,-0.03, 0.02,-0.06, 0.00, 0.06, 0.02,8159044, 20070524, 31, 0.,-1,
"AuAu200RF"}
19 const Int_t N =
sizeof(Data)/
sizeof(
data_t);
22 void MakeSvtOnGlobal(){
23 gROOT->LoadMacro(
"bfc.C");
24 bfc(0,
"mysql,tpcDb,MagF,nodefault");
25 StMaker *db = chain->Maker(
"db");
28 for (Int_t i = 0; i < N; i++) {
30 StarMagField::Instance()->SetFactor(Data[i].field);
32 header->SetRunNumber(i+1);
33 header->SetDateTime(20050101,i+1);
35 db->SetDateTime(Data[i].date,Data[i].time);
36 St_Survey *SvtOnGlobal = (St_Survey *) chain->GetDataBase(
"Geometry/svt/SvtOnGlobal");
37 if (! SvtOnGlobal) {cout <<
"SvtOnGlobal has not been found" << endl;
return 0;}
38 const TGeoHMatrix &Tpc2Global = gStTpcDb->Tpc2GlobalMatrix(); cout <<
"Tpc2Global\t"; Tpc2Global.Print();
40 Survey_st *OnGlobal = SvtOnGlobal->GetTable();
41 GL.SetRotation(&OnGlobal->r00);
42 GL.SetTranslation(&OnGlobal->t0); cout <<
"GL\t"; GL.Print();
43 TGeoHMatrix TPCGL = Tpc2Global * GL; cout <<
"TPCGL\t"; TPCGL.Print();
44 TGeoHMatrix TPC2Inv = Tpc2Global.Inverse(); cout <<
"TPC2Inv\t"; TPC2Inv.Print();
46 dR.RotateX(180./TMath::Pi()*Data[i].alpha*1e-3);
47 dR.RotateY(180./TMath::Pi()*Data[i].beta*1e-3);
48 dR.RotateZ(180./TMath::Pi()*Data[i].gamma*1e-3);
49 Double_t xyz[3], dxyz[3], drot[3];
50 xyz[0] = 1e-4*Data[i].dx;
51 xyz[1] = 1e-4*Data[i].dy;
52 xyz[2] = 1e-4*Data[i].dz;
53 dxyz[0] = 1e-4*Data[i].ddx;
54 dxyz[1] = 1e-4*Data[i].ddy;
55 dxyz[2] = 1e-4*Data[i].ddz;
56 drot[0] = Data[i].dalpha*1e-3;
57 drot[1] = Data[i].dbeta*1e-3;
58 drot[2] = Data[i].dgamma*1e-3;
59 dR.SetTranslation(xyz);
60 cout <<
"Additional rotation for Svt\t"; dR.Print();
61 TGeoHMatrix GLnew = TPC2Inv * dR * TPCGL; cout <<
"GLnew\t"; GLnew.Print();
62 Double_t *R = GLnew.GetRotationMatrix();
64 memcpy(&row.r00, R, 9*
sizeof(Double_t));
65 Double_t *tr = GLnew.GetTranslation();
66 memcpy(&row.t0, tr, 3*
sizeof(Double_t));
67 memcpy(&row.sigmaRotX, drot, 3*
sizeof(Double_t));
68 memcpy(&row.sigmaTrX, dxyz, 3*
sizeof(Double_t));
69 TString fOut = Form(
"SvtOnGlobal.%8i.%06i.C", Data[i].date, Data[i].time);
71 cout <<
"Create " << fOut << endl;
72 out.open(fOut.Data());
73 out <<
"TDataSet *CreateTable() {" << endl;
74 out <<
" if (!gROOT->GetClass(\"St_Survey\")) return 0;" << endl;
75 out <<
" Survey_st row = " << endl;
76 out <<
"\t{0,"; out << endl; out <<
"\t";
77 Double_t *r = &(row.r00);
78 for (Int_t j = 0; j < 9; j++) out << Form(
"%f,",r[j]);
81 for (Int_t j = 9; j < 12; j++) out << Form(
"%f,",r[j]);
84 for (Int_t j = 12; j < 18; j++) out << Form(
"%f,",r[j]);
87 out <<
"\"Run" << Data[i].run <<
" " << Data[i].comment <<
"\"};" << endl;
88 out <<
" St_Survey *tableSet = new St_Survey(\"SvtOnGlobal\",1);" << endl;
89 out <<
" tableSet->AddAt(&row.Id, 0);" << endl;
90 out <<
" return (TDataSet *)tableSet;" << endl;