9 void readtofTrgWindow(
string ZReadTime =
"2029-12-31 23:59:59") {
11 const Int_t NTRAY = 120;
12 const Int_t NVPDTRAY = 2;
13 const Int_t NMAX = 120;
17 gSystem->Load(
"St_base");
18 gSystem->Load(
"StChain");
19 gSystem->Load(
"StUtilities");
20 gSystem->Load(
"St_Tables.so");
22 gSystem->Load(
"StDbLib.so");
23 gSystem->Load(
"libStDb_Tables.so");
29 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
31 dbManager->setRequestTime(ZReadTime.c_str());
34 StDbTable* tofTrgWindow = configNode->addDbTable(
"tofTrgWindow");
36 dbManager->fetchDbTable(tofTrgWindow);
38 cout <<
"version : " << tofTrgWindow->getVersion() <<endl;
40 cout <<
"begin data/time : "<< tofTrgWindow->getBeginDateTime() <<endl;
41 cout <<
"end data/time : " << tofTrgWindow->getEndDateTime() <<endl;
44 tofTrgWindow_st* trg =
static_cast<tofTrgWindow_st*
>(tofTrgWindow->GetTable());
47 cout <<
" Oops ... no pointer to table. Exiting" << endl;
52 Int_t nRows = tofTrgWindow->GetNRows();
53 cout <<
" NRows = " << nRows << endl;
54 if(nRows!=(NTRAY+NVPDTRAY+NMTD)) {
55 cout <<
" NRows doesn't match !!! " << endl;
65 cout <<
"read out from database ..." << endl;
67 outData.open(
"TrgWindow_read.dat");
68 for (
int i=0;i<NTRAY+NVPDTRAY+NMTD;i++){
69 cout << i <<
" " << trg[i].trgWindow_Min <<
" "<< trg[i].trgWindow_Max << endl;
70 outData << i <<
" " << trg[i].trgWindow_Min <<
" "<< trg[i].trgWindow_Max << endl;
static StDbManager * Instance()
strdup(..) is not ANSI