19 void readtofTOffset(
string ZReadTime =
"2029-12-31 23:59:59")
21 const int mNTray = 120;
22 const Int_t mNTOF = 192;
23 const Int_t mNModule = 32;
24 const Int_t mNCell = 6;
27 gSystem->Load(
"St_base");
28 gSystem->Load(
"StChain");
29 gSystem->Load(
"StUtilities");
30 gSystem->Load(
"St_Tables.so");
32 gSystem->Load(
"StDbLib.so");
33 gSystem->Load(
"libStDb_Tables.so");
39 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
41 dbManager->setRequestTime(ZReadTime.c_str());
43 StDbTable* tofTOffset = configNode->addDbTable(
"tofTOffset");
45 dbManager->fetchDbTable(tofTOffset);
47 cout<<tofTOffset->getVersion()<<endl;
49 cout<<tofTOffset->getBeginDateTime()<<endl;
50 cout<<tofTOffset->getEndDateTime()<<endl;
54 tofTOffset_st* tZero =
static_cast<tofTOffset_st*
>(tofTOffset->GetTable());
57 cout <<
" ahhhhhh! " << endl;
61 Int_t nRows = tofTOffset->GetNRows();
62 cout <<
" NRows = " << nRows << endl;
64 cout <<
" NRows doesn't match !!! " << endl;
67 Double_t mTofTZero[120][32][6];
68 for(
int i=0;i<120;i++) {
69 for(
int j=0;j<32;j++) {
70 for(
int k=0;k<6;k++) {
71 mTofTZero[i][j][k] = 0.0;
76 cout<<
"Read out from DataBase-------------->"<<endl;
79 outData.open(
"TOffset_read.dat");
80 for (Int_t i=0;i<mNTray;i++) {
81 for(
int j=0;j<mNModule;j++) {
82 for(
int k=0;k<mNCell;k++) {
83 short trayId, moduleId, cellId;
84 trayId = tZero[i].trayId;
87 int index = j*mNCell+k;
88 outData <<
" " << trayId <<
" " << moduleId <<
" " << cellId << endl;
89 outData << tZero[i].T0[index] << endl;
95 cout<<tofTOffset->getVersion()<<endl;
97 cout<<tofTOffset->getBeginDateTime()<<endl;
98 cout<<tofTOffset->getEndDateTime()<<endl;
static StDbManager * Instance()
strdup(..) is not ANSI