21 void readtofZbCorr(
string ZReadTime =
"2029-12-31 23:59:59")
23 const int mNTray = 120;
28 gSystem->Load(
"St_base");
29 gSystem->Load(
"StChain");
30 gSystem->Load(
"StUtilities");
31 gSystem->Load(
"St_Tables.so");
33 gSystem->Load(
"StDbLib.so");
34 gSystem->Load(
"libStDb_Tables.so");
40 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
42 dbManager->setRequestTime(ZReadTime.c_str());
44 StDbTable* tofZbCorr = configNode->addDbTable(
"tofZbCorr");
46 dbManager->fetchDbTable(tofZbCorr);
48 cout<<tofZbCorr->getVersion()<<endl;
50 cout<<tofZbCorr->getBeginDateTime()<<endl;
51 cout<<tofZbCorr->getEndDateTime()<<endl;
54 tofZbCorr_st* zcorr =
static_cast<tofZbCorr_st*
>(tofZbCorr->GetTable());
57 cout <<
" ahhhhhh! " << endl;
61 cout<<
"Read out from DataBase-------------->"<<endl;
63 Int_t nRows = tofZbCorr->GetNRows();
64 cout <<
" NRows = " << nRows << endl;
70 outData.open(
"zCorr_read.dat");
72 for(
int i=0;i<nRows;i++) {
73 outData << setw(6) << zcorr[i].trayId << setw(6) << zcorr[i].moduleId << setw(6) << zcorr[i].cellId << endl;
74 for(
int j=0;j<60;j++) {
75 if(fabs(zcorr[i].z[j])<1.e-4 && fabs(zcorr[i].corr[j])<1.e-4)
continue;
76 outData << setw(15) << zcorr[i].z[j];
79 for(
int j=0;j<60;j++) {
80 if(fabs(zcorr[i].z[j])<1.e-4 && fabs(zcorr[i].corr[j])<1.e-4)
continue;
81 outData << setw(15) << zcorr[i].corr[j];
static StDbManager * Instance()
strdup(..) is not ANSI