4 #include "fgtPedestal.h"
6 void write_fgt_status(
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");
20 StDbTable* dbtable = node->addDbTable(
"fgtStatus");
22 cout <<
"The RTS Start date and time is " << storeTime<<endl;
23 mgr->setStoreTime(storeTime);
28 int yearday=runnumber/1000;
31 infile +=
"/status/status.";
34 cout<<
" Opening File "<<infile<<endl;
36 std::ifstream in(infile);
38 cout <<
"Can't find file!\n";
50 for (
int i = 0; i < 51200; i++) {
51 table.Status[i] = (Char_t)zero;
55 while(in >> electId >>statread){
58 stat = statread.Atoi();
59 status = (Char_t)stat;
60 cout<<counter++<<
" electId="<<electId<<
" stat ="<<statread<<
" status="<<(Short_t)status<<endl;
61 table.Status[electId] = status;
69 mgr->storeDbTable(dbtable);
71 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