19 void readtofINLSCorr(
string ZReadTime =
"2029-12-31 23:59:59")
22 gSystem->Load(
"St_base");
23 gSystem->Load(
"StChain");
24 gSystem->Load(
"StUtilities");
25 gSystem->Load(
"St_Tables.so");
27 gSystem->Load(
"StDbLib.so");
28 gSystem->Load(
"libStDb_Tables.so");
34 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
36 dbManager->setRequestTime(ZReadTime.c_str());
38 StDbTable* tofinlcorr = configNode->addDbTable(
"tofINLSCorr");
40 dbManager->fetchDbTable(tofinlcorr);
42 cout<<tofinlcorr->getVersion()<<endl;
44 cout<<tofinlcorr->getBeginDateTime()<<endl;
45 cout<<tofinlcorr->getEndDateTime()<<endl;
47 tofINLSCorr_st* inlcorr =
static_cast<tofINLSCorr_st*
>(tofinlcorr->GetTable());
49 const Int_t mNTDIGMAX = 1400;
50 const Int_t mNChanOnTDIG = 24;
51 const Int_t mNChanMAX = 1024;
52 const Int_t mNBoardIdMAX = 4800;
53 Short_t mINLCorr[mNTDIGMAX][mNChanOnTDIG][mNChanMAX];
54 Int_t mBoardId[mNTDIGMAX];
56 cout<<
"Read out from DataBase-------------->"<<endl;
57 Int_t nRows = tofinlcorr->GetNRows();
58 cout <<
" nRows = " << nRows << endl;
61 for(
int i=0;i<nRows;i++) {
62 if(NTdig>=mNTDIGMAX) {
63 cout <<
" exceed the limit! " << endl;
68 int tdigId = (Int_t)(inlcorr[i].tdigId);
69 int tdcChanId = (Int_t)(inlcorr[i].tdcChanId);
70 if(tdigId!=tdigId_old) {
71 mBoardId[NTdig] = tdigId;
77 for(Int_t j=0;j<mNChanMAX;j++) {
78 Short_t corr = (Short_t)(inlcorr[i].INLCorr[j]);
79 mINLCorr[NTdig-1][tdcChanId][j] = corr;
83 cout <<
" Total # of boards read in : " << NTdig << endl;
86 for(
int i=0;i<NTdig;i++){cout << mBoardId[i] << endl;}
static StDbManager * Instance()
strdup(..) is not ANSI