21 void readvpdTotCorr(
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* vpdTotCorr = configNode->addDbTable(
"vpdTotCorr");
46 dbManager->fetchDbTable(vpdTotCorr);
48 cout<<vpdTotCorr->getVersion()<<endl;
50 cout<<vpdTotCorr->getBeginDateTime()<<endl;
51 cout<<vpdTotCorr->getEndDateTime()<<endl;
54 vpdTotCorr_st* totcorr =
static_cast<vpdTotCorr_st*
>(vpdTotCorr->GetTable());
57 cout <<
" ahhhhhh! " << endl;
61 cout<<
"Read out from DataBase-------------->"<<endl;
63 Int_t nRows = vpdTotCorr->GetNRows();
64 cout <<
" NRows = " << nRows << endl;
66 cout <<
" NRows doesn't match !!! " << endl;
70 outData.open(
"vpdTotCorr_read.dat");
71 for(
int i=0;i<2*mNVPD;i++) {
72 outData << setw(6) << totcorr[i].tubeId << endl;
73 cout << totcorr[i].tubeId <<
" " << totcorr[i].corralgo << endl;
74 for(
int j=0;j<128;j++) {
75 if(totcorr[i].tot[j]>1.e-4)
76 outData << setw(15) << totcorr[i].tot[j];
79 for(
int j=0;j<128;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