00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <iostream>
00016 #include <fstream>
00017 using namespace std;
00018
00019 void readtofTDIGOnTray()
00020 {
00021
00022 gSystem->Load("St_base");
00023 gSystem->Load("StChain");
00024 gSystem->Load("StUtilities");
00025 gSystem->Load("St_Tables.so");
00026
00027 gSystem->Load("StDbLib.so");
00028 gSystem->Load("libStDb_Tables.so");
00029
00030
00031 StDbManager* dbManager = StDbManager::Instance();
00032
00033
00034 StDbConfigNode* configNode = dbManager->initConfig("Calibrations_tof");
00035
00036 string ZReadTime = "2010-12-20 00:00:00";
00037 dbManager->setRequestTime(ZReadTime.c_str());
00038
00039 StDbTable* tofmaptable = configNode->addDbTable("tofTDIGOnTray");
00040
00041 dbManager->fetchDbTable(tofmaptable);
00042
00043 cout<<tofmaptable->getVersion()<<endl;
00044
00045 cout<<tofmaptable->getBeginDateTime()<<endl;
00046 cout<<tofmaptable->getEndDateTime()<<endl;
00047
00048 tofTDIGOnTray_st* maptable = static_cast<tofTDIGOnTray_st*>(tofmaptable->GetTable());
00049
00050 cout<<"Read out from DataBase-------------->"<<endl;
00051 Int_t nRows = tofmaptable->GetNRows();
00052 cout << " nRows = " << nRows << endl;
00053 for(int i=0;i<nRows;i++) {
00054 short trayId = maptable[i].trayId;
00055 for(int j=0;j<8;j++) {
00056 cout << maptable[i].tdigId[j] << " ";
00057 }
00058 cout << endl;
00059 }
00060
00061 }