21 void storetofINLSCorr()
26 const Int_t NMAX = 1200;
28 const Int_t NCHAN = 8;
31 gSystem->Load(
"St_base");
32 gSystem->Load(
"StChain");
33 gSystem->Load(
"StUtilities");
34 gSystem->Load(
"St_Tables.so");
36 gSystem->Load(
"StDbLib.so");
37 gSystem->Load(
"libStDb_Tables.so");
43 StDbConfigNode* configNode = dbManager->initConfig(
"Calibrations_tof");
46 TString ZStoreTime =
"2008-11-01 00:00:00";
49 StDbTable* tofINLSCorr = configNode->addDbTable(
"tofINLSCorr");
52 tofINLSCorr_st *inlcorr=
new tofINLSCorr_st[NMAX*NTDC*NCHAN];
58 TH1S *hINLSCorr[NMAX][NTDC][NCHAN];
60 for(
int i=0;i<NMAX;i++) hFlag[i] =
false;
62 TFile *f =
new TFile(
"INL_test.root");
64 for(
int iboard=0;iboard<NMAX;iboard++) {
65 if(iboard%100==0) cout <<
" Processing board Id = " << iboard << endl;
67 for(
int itdc=0;itdc<NTDC;itdc++){
68 for(
int ichan=0;ichan<NCHAN;ichan++) {
71 sprintf(hisname,
"b_%d_tdc_%d_chan_%d",iboard,itdc,ichan);
73 hINLSCorr[iboard][itdc][ichan] = (TH1S *)f->Get(hisname);
75 if(!hINLSCorr[iboard][itdc][ichan]) {
80 inlcorr[NFILL].tdigId = (Short_t)iboard;
81 inlcorr[NFILL].tdcChanId = (Short_t)(itdc*NCHAN+ichan);
83 for(
int j=0;j<1024;j++) {
84 inlcorr[NFILL].INLCorr[j]=(Short_t)(hINLSCorr[iboard][itdc][ichan]->GetBinContent(j+1));
96 cout<<
" prepare to upload data to DB NFILL="<<NFILL<<
" NBOARD="<<NBOARD<<endl;
125 tofINLSCorr->
SetTable((
char*)inlcorr, NFILL);
127 dbManager->setStoreTime(ZStoreTime.Data());
129 cout<<
" here "<<endl;
130 dbManager->storeDbTable(tofINLSCorr);
131 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