18 void storePvpdDbTable()
21 gSystem->Load(
"StDbLib.so");
22 gSystem->Load(
"libStDb_Tables.so");
28 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
33 const Int_t nCfgs = 4;
34 TString cfgStoreTime[nCfgs];
37 StDbTable* configTable = configNode->addDbTable(
"pvpdConfig");
40 pvpdConfig_st b[nCfgs];
45 b[0].eastwestCoincidence=1;
48 cfgStoreTime[0] =
"2001-07-01 00:00:00";
52 b[1].eastwestCoincidence=0;
55 cfgStoreTime[1] =
"2001-11-27 00:00:00";
59 b[2].eastwestCoincidence=1;
62 cfgStoreTime[2] =
"2003-01-06 00:00:00";
66 b[3].eastwestCoincidence=1;
69 cfgStoreTime[3] =
"2003-03-24 12:00:00";
72 for (
int i=0;i<nCfgs;i++){
74 configTable->
SetTable((
char*)&b[i],1);
76 dbManager->setStoreTime(cfgStoreTime[i].Data());
78 dbManager->storeDbTable(configTable);
84 const Int_t nStrobeDefs = 2;
85 const Int_t nTubes = 6;
86 TString strobeStoreTime[nStrobeDefs];
89 StDbTable* strobeDefTable = configNode->addDbTable(
"pvpdStrobeDef");
95 int tdcMin[nStrobeDefs] = {1600, 980};
96 int tdcMax[nStrobeDefs] = {1650, 1020};
98 strobeStoreTime[0] =
"2001-07-01 00:00:00"; strobeStoreTime[1] =
"2003-01-06 00:00:00";
102 pvpdStrobeDef_st *d =
new pvpdStrobeDef_st[nTubes];
103 for (
int i=0;i<nStrobeDefs;i++){
105 for (
int t=0;t<nTubes;t++){
107 d[t].strobeTdcMin=tdcMin[i];
108 d[t].strobeTdcMax=tdcMax[i];
111 strobeDefTable->
SetTable((
char*)d,nTubes);
113 dbManager->setStoreTime(strobeStoreTime[i].Data());
115 dbManager->storeDbTable(strobeDefTable);
virtual void SetTable(char *data, int nrows, int *idList=0)
calloc'd version of data for StRoot
static StDbManager * Instance()
strdup(..) is not ANSI