21 void readtofTotbCorr(
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* tofTotbCorr = configNode->addDbTable(
"tofTotbCorr");
46 dbManager->fetchDbTable(tofTotbCorr);
48 cout<<tofTotbCorr->getVersion()<<endl;
50 cout<<tofTotbCorr->getBeginDateTime()<<endl;
51 cout<<tofTotbCorr->getEndDateTime()<<endl;
54 tofTotbCorr_st* totcorr =
static_cast<tofTotbCorr_st*
>(tofTotbCorr->GetTable());
57 cout <<
" ahhhhhh! " << endl;
61 cout<<
"Read out from DataBase-------------->"<<endl;
63 Int_t nRows = tofTotbCorr->GetNRows();
64 cout <<
" NRows = " << nRows << endl;
70 outData.open(
"totCorr_read.dat");
72 for(
int i=0;i<nRows;i++) {
73 outData << setw(6) << totcorr[i].trayId << setw(6) << totcorr[i].moduleId << setw(6) << totcorr[i].cellId << setw(6) << totcorr[i].tdcId << endl;
74 for(
int j=0;j<60;j++) {
75 if(totcorr[i].tot[j]>1.e-4)
76 outData << setw(15) << totcorr[i].tot[j];
79 for(
int j=0;j<60;j++) {
80 if(totcorr[i].tot[j]>1.e-4)
81 outData << setw(15) << totcorr[i].corr[j];
static StDbManager * Instance()
strdup(..) is not ANSI