26 const Int_t NCHAN = 192;
27 const Int_t NVPD = 19;
30 gSystem->Load(
"St_base");
31 gSystem->Load(
"StChain");
32 gSystem->Load(
"StUtilities");
33 gSystem->Load(
"St_Tables.so");
35 gSystem->Load(
"StDbLib.so");
36 gSystem->Load(
"libStDb_Tables.so");
42 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
46 TString ZStoreTime =
"2014-02-18 00:00:00";
49 StDbTable* tofDaqMap = configNode->addDbTable(
"tofDaqMap");
52 tofDaqMap_st *daqmap =
new tofDaqMap_st[1];
54 Short_t Chan2M[24] = {1, 3, 2, 3, 2, 1, 2, 1,
55 3, 4, 1, 2, 4, 4, 1, 1,
56 4, 4, 3, 3, 2, 4, 3, 2};
60 Short_t Chan2C[24] = {4, 2, 3, 4, 5, 2, 1, 6,
61 6, 1, 3, 2, 3, 5, 1, 5,
62 6, 4, 5, 3, 4, 2, 1, 6};
64 Short_t Chan2MRPC[24], MRPC2Chan[24];
112 Short_t PMT2LeChan[38] = {5, 22, 12, 29, 46, 36, 53, 70, 60, 101,
113 0, 24, 118, 108, 125, 139, 133, 48, 96,
114 5, 22, 12, 29, 46, 36, 53, 70, 60, 101,
115 0, 24, 118, 108, 125, 139, 133, 48, 96};
116 Short_t PMT2TeChan[38] = {5, 22, 12, 29, 46, 36, 53, 70, 60, 101,
117 0, 24, 118, 108, 125, 139, 133, 48, 96,
118 5, 22, 12, 29, 46, 36, 53, 70, 60, 101,
119 0, 24, 118, 108, 125, 139, 133, 48, 96};
121 for(
int i=0;i<24;i++) {
122 Chan2MRPC[i] = (Chan2M[i] - 1)*6 + (Chan2C[i] - 1);
123 MRPC2Chan[Chan2MRPC[i]] = i;
126 for(
int i=0;i<24;i++) {
127 if(i%8==0) cout << endl;
128 cout <<
" " << MRPC2Chan[i];
138 cout <<
" West PMT 2 leading Tdc " << endl;
139 for(
int i=0;i<19;i++) cout <<
" " << PMT2LeChan[i];
141 cout <<
" West PMT 2 trailing Tdc " << endl;
142 for(
int i=0;i<19;i++) cout <<
" " << PMT2TeChan[i];
145 cout <<
" East PMT 2 leading Tdc " << endl;
146 for(
int i=19;i<38;i++) cout <<
" " << PMT2LeChan[i];
148 cout <<
" West PMT 2 trailing Tdc " << endl;
149 for(
int i=19;i<38;i++) cout <<
" " << PMT2TeChan[i];
153 for(
int i=0;i<NCHAN;i++) {
157 daqmap[0].MRPC2TDIGChanMap[i] = iboard*24 + MRPC2Chan[ii];
160 for(
int i=0;i<50;i++) {
162 daqmap[0].PMT2TDIGLeChanMap[i] = PMT2LeChan[i];
163 daqmap[0].PMT2TDIGTeChanMap[i] = PMT2TeChan[i];
165 daqmap[0].PMT2TDIGLeChanMap[i] = -1;
166 daqmap[0].PMT2TDIGTeChanMap[i] = -1;
171 tofDaqMap->
SetTable((
char*)daqmap, 1);
173 dbManager->setStoreTime(ZStoreTime.Data());
175 cout<<
" here "<<endl;
176 dbManager->storeDbTable(tofDaqMap);
177 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