Fill run catalog with nfiles entries.
void sqlfilldb(int nfiles = 1000)
{
const char *ins = "INSERT INTO runcatalog VALUES ('%s', %d,"
" %d, %d, %d, %10.2f, '%s', '%s', '1997-01-15 20:16:28',"
" '1999-01-15 20:16:28', '%s', '%s')";
char sql[4096];
char dataset[32];
char rawfile[128];
int tag, evt = 0;
res = db->
Query(
"DELETE FROM runcatalog");
delete res;
for (int i = 0; i < nfiles; i++) {
sprintf(dataset, "testrun_%d", i);
sprintf(rawfile, "/v1/data/lead/test/run_%d.root", i);
tag = int(gRandom->Rndm()*10.);
sprintf(sql, ins, dataset, i, evt, evt+10000, tag, 25.5, "test", "lead",
rawfile, "test run dummy data");
evt += 10000;
delete res;
}
delete db;
printf("\n%d files in run catalog\n", nfiles);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime);
}