15 void storetofGeomAlign() {
20 const Int_t NTRAY = 94;
21 const Int_t NVPDTRAY = 2;
22 const Int_t NMAX = 120;
25 gSystem->Load(
"St_base");
26 gSystem->Load(
"StChain");
27 gSystem->Load(
"StUtilities");
28 gSystem->Load(
"St_Tables.so");
29 gSystem->Load(
"StDbLib.so");
30 gSystem->Load(
"libStDb_Tables.so");
36 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
64 inTime.open(
"input/timestamp");
66 if (inTime.is_open()) {
67 getline(inTime, time);
70 cout <<
" Unable to open the TimeStamp file! EXIT! " << endl;
73 TString ZStoreTime = time;
74 cout <<
" Store Time " << ZStoreTime.Data() << endl;
78 StDbTable* tofGeomAlign = configNode->addDbTable(
"tofGeomAlign");
81 tofGeomAlign_st *tofAlign =
new tofGeomAlign_st[NMAX];
84 float shifty[NMAX], shiftz[NMAX], shiftx[NMAX];
86 inData.open(
"input/geometry.dat");
87 if (!inData.is_open()){
88 cerr <<
" unable to open geometry.dat; bailing out ..." << endl;
91 for(
int i=0;i<NMAX;i++) {
92 inData >> shifty[i] >> shiftz[i] >> shiftx[i];
96 for(
int i=0;i<NMAX;i++) {
98 tofAlign[i].x0 = shiftx[i];
99 tofAlign[i].phi0 = shifty[i];
100 tofAlign[i].z0 = shiftz[i];
101 tofAlign[i].angle0 = 0.;
105 tofGeomAlign->
SetTable((
char*)tofAlign, NMAX);
107 dbManager->setStoreTime(ZStoreTime.Data());
109 cout<<
"Storing DB Table ... "<<endl;
110 dbManager->storeDbTable(tofGeomAlign);
111 cout<<
"uploaded"<<endl;
virtual void SetTable(char *data, int nrows, int *idList=0)
calloc'd version of data for StRoot
static StDbManager * Instance()
strdup(..) is not ANSI