16 void readtofGeomAlign(
string ZReadTime =
"2029-12-31 23:59:59")
19 gSystem->Load(
"St_base");
20 gSystem->Load(
"StChain");
21 gSystem->Load(
"StUtilities");
22 gSystem->Load(
"St_Tables.so");
24 gSystem->Load(
"StDbLib.so");
25 gSystem->Load(
"libStDb_Tables.so");
27 const Int_t NTRAY = 94;
28 const Int_t NVPDTRAY = 2;
29 const Int_t NMAX = 120;
35 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
37 dbManager->setRequestTime(ZReadTime.c_str());
39 StDbTable* tofGeomAlign = configNode->addDbTable(
"tofGeomAlign");
40 dbManager->fetchDbTable(tofGeomAlign);
42 cout<<
"--- Table properties: ---" << endl;
43 cout<<tofGeomAlign->getVersion()<<endl;
44 cout<<tofGeomAlign->getBeginDateTime()<<endl;
45 cout<<tofGeomAlign->getEndDateTime()<<endl;
46 cout<<
"------------------------" << endl;
48 tofGeomAlign_st *tofAlign =
static_cast<tofGeomAlign_st*
>(tofGeomAlign->GetTable());
50 cout <<
"ERROR: no such table" << endl;
54 cout <<
"Reading out from database ..." << endl;
55 Int_t nRows = tofGeomAlign->GetNRows();
56 cout <<
"Number of rows: " << nRows << endl;
58 cout <<
" WARNING: number of rows does not match " << NMAX << endl;
62 outData.open(
"geomAlign_readback.dat");
64 for(
int i=0;i<nRows;i++) {
66 cout <<
" trayId=" << tray
67 <<
" phi0=" << tofAlign[i].phi0
68 <<
" z0=" << tofAlign[i].z0
69 <<
" x0=" << tofAlign[i].x0
70 <<
" a0=" << tofAlign[i].angle0 << endl;
71 outData << setw(6) << tray
72 << setw(15) << tofAlign[i].phi0
73 << setw(15) << tofAlign[i].z0
74 << setw(15) << tofAlign[i].x0
75 << setw(15) << tofAlign[i].angle0
80 cout <<
"done." << endl;
static StDbManager * Instance()
strdup(..) is not ANSI