1 void getBeginTime(
int runNumber = 15047028)
3 const char* database =
"mysql://db04.star.bnl.gov:3413/RunLog?timeout=60";
4 const char* user =
"zchang";
6 TMySQLServer* mysql = TMySQLServer::Connect(database,user,pass);
7 gSystem->mkdir(
"beginTimes");
8 ofstream of(Form(
"beginTimes_t/%0.8d.beginTimes.txt", runNumber));
10 cerr <<
"Connection to " << database <<
" failed" << endl;
17 query = Form(
"select distinct beginTime from `RunLog`.`runDescriptor` where runNumber = %d",runNumber);
19 result = (TMySQLResult*)mysql->Query(query);
22 while (row = (TMySQLRow*)result->Next()) {
23 TString str(Form(
"%s", row->GetField(0)));
24 cout<<str.Data()<<endl;
25 TString str_new = str;
26 cout<<str_new.Data()<<endl;
27 of<<str_new.Data()<<endl;