4 #include "fgtPedestal.h"
6 void write_fgt_pedestal(
int runnumber,
char* date,
char* time,
int opt=0){
8 sprintf(storeTime,
"%s %s",date,time);
9 cout <<
"Run"<<runnumber<<
" the RTS Start date and time is " << storeTime<<endl;
11 gSystem->Setenv(
"DB_ACCESS_MODE",
"write");
12 gROOT->Macro(
"LoadLogger.C");
13 gSystem->Load(
"St_base.so");
14 gSystem->Load(
"libStDb_Tables.so");
15 gSystem->Load(
"StDbLib.so");
19 StDbTable* dbtable = node->addDbTable(
"fgtPedestal");
20 mgr->setStoreTime(storeTime);
24 int yearday=runnumber/1000;
29 cout<<
" Opening File "<<infile<<endl;
31 std::ifstream in(infile);
33 cout <<
"Can't find file!\n";
37 std::cout << setprecision(10);
40 Int_t electId, timebin;
44 for (
int i = 0; i < 51200; i++) {
45 table.AdcPedestal[i] = 0.0;
46 table.AdcPedestalRMS[i] = 0.0;
47 table.Status[i] =
'0';
52 in >> electId >> timebin >> ped >> stdev;
53 cout<<counter++<<
" electId="<<electId<<
" ped ="<<ped<<
" stdev="<<stdev<<endl;
54 table.AdcPedestal[electId]=ped;
55 table.AdcPedestalRMS[electId]=stdev;
65 mgr->storeDbTable(dbtable);
67 printf(
"Not interting... specify opt=1 to actually insert into DB\n");
virtual void SetTable(char *data, int nrows, int *idList=0)
calloc'd version of data for StRoot
static StDbManager * Instance()
strdup(..) is not ANSI