11 void readtofSimResParams(
string ZReadTime =
"2029-12-31 23:59:59")
13 const int mNTray = 120;
14 const int mNCellsPerTray = 192;
19 gSystem->Load(
"St_base");
20 gSystem->Load(
"StChain");
21 gSystem->Load(
"StUtilities");
22 gSystem->Load(
"St_Tables.so");
23 gSystem->Load(
"StDbLib.so");
24 gSystem->Load(
"libStDb_Tables.so");
30 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
31 dbManager->setRequestTime(ZReadTime.c_str());
34 StDbTable* tofSimResParams = configNode->addDbTable(
"tofSimResParams");
35 dbManager->fetchDbTable(tofSimResParams);
37 cout<<
"--- BTOF table ---"<< endl;
38 cout<<
"version : " << tofSimResParams->getVersion()<<endl;
39 cout<<
"begin data/time :" << tofSimResParams->getBeginDateTime()<<endl;
40 cout<<
"end data/time :" << tofSimResParams->getEndDateTime()<<endl;
42 tofSimResParams_st* tofTable =
static_cast<tofSimResParams_st*
>(tofSimResParams->GetTable());
44 cout <<
" No BTOF table? arrghhhhhh! " << endl;
49 StDbTable* vpdSimParams = configNode->addDbTable(
"vpdSimParams");
50 dbManager->fetchDbTable(vpdSimParams);
52 cout<<
"--- VPD table ---"<< endl;
53 cout<<
"version : " << vpdSimParams->getVersion()<<endl;
54 cout<<
"begin data/time :" << vpdSimParams->getBeginDateTime()<<endl;
55 cout<<
"end data/time :" << vpdSimParams->getEndDateTime()<<endl;
57 vpdSimParams_st* vpdTable =
static_cast<vpdSimParams_st*
>(vpdSimParams->GetTable());
59 cout <<
" No VPD table? arrghhhhhh! " << endl;
65 cout <<
"--- Read from BTOF table ---"<<endl;
66 Int_t nRows = tofSimResParams->GetNRows();
67 cout <<
" NRows = " << nRows << endl;
70 outData.open(
"tofSimResParams.dat");
72 for (
int row = 0; row < nRows; row++){
74 for (
int i = 0; i < mNTray; i++ ){
76 for (
int j = 0; j < mNCellsPerTray; j++ ){
77 size_t index = i * mNTray + j;
79 outData << setw(6) << i << setw(6) << j << setw(6) << tofTable[0].resolution[index] << endl;
88 cout <<
"--- Read from VPD table ---"<<endl;
89 nRows = vpdSimParams->GetNRows();
90 cout <<
" NRows = " << nRows << endl;
92 outData.open(
"vpdSimParams.dat");
94 for (
int row = 0; row < nRows; row++){
96 for (
int i = 0; i < 2*mNVPD; i++ ){
102 outData << setw(6) << i << setw(6) << vpdTable->tubeRes[i] << endl;
static StDbManager * Instance()
strdup(..) is not ANSI