12from ROOT
import TSQLServer, TSQLResult, TStopwatch, gRandom
17ins =
"INSERT INTO runcatalog VALUES ('%s', %d," \
18 " %d, %d, %d, %10.2f, '%s', '%s', '1997-01-15 20:16:28'," \
19 " '1999-01-15 20:16:28', '%s', '%s')"
27res = db.Query(
"DELETE FROM runcatalog")
34for i
in range(nfiles):
35 dataset =
"testrun_%d" % i
36 rawfile =
"/v1/data/lead/test/run_%d.root" % i
37 tag =
int(gRandom.Rndm() * 10.)
38 sql = ins % (dataset, i, evt, evt + 10000, tag, 25.5,
"test",
"lead",
39 rawfile,
"test run dummy data")
47rtime = timer.RealTime()
48ctime = timer.CpuTime()
51print(
"%d files in run catalog" % nfiles)
52print(
"RealTime=%f seconds, CpuTime=%f seconds" % (rtime, ctime))
static TSQLServer * Connect(const char *db, const char *uid, const char *pw)
The db should be of the form: <dbms>://<host>[:<port>][/<database>], e.g.: mysql://pcroot....