3 from __future__
import print_function
10 cool_database_string = CalibDbDefaults.cool_database_string
11 dbname = CalibDbDefaults.cool_dbname
18 sys.stderr.write(
"Usage: " + argv0 +
" [-h] [-s <cool database string>] [-o <t0 cool folder>] [-r <rt cool folder>] [-t <cool tag>] <run nr>\n")
21 optlist, args = getopt.gnu_getopt(sys.argv,
'hs:o:r:t:')
23 for opt, oa
in optlist:
26 cool_database_string =
'sqlite://;schema=' + oa +
';dbname=' + dbname
29 cool_database_string = oa
44 sys.stderr.write(
"Need Run Number\n")
45 print (len(args), args)
49 run_number=
int(args[1])
51 sys.stderr.write(
"Cannot parse run number " + run_number +
"\n")
54 sys.argv=[ sys.argv[0],
'-b' ]
62 if up.stationNameString()==
"XXX":
63 sys.stderr.write(
"WARNING: Unknown station found!\n")
65 f=
file(
"calibration/rts/Rt_" +
str(up.stationNameString()) +
"_" +
str(up.stationPhi()) +
"_" +
str(up.stationEta()) +
".dat",
"w")
66 f.write(
"v1.0 1 Resolution 1 20000 0 0 0 0 dummy 800 ")
67 f.write(
str(rt.GetN()))
69 for i
in range(rt.GetN()):
70 f.write(
str(rt.GetX()[i]) +
" " +
str(rt.GetY()[i]) +
" " +
str(rt.GetEY()[i]))
78 graphs=
ReadRtCool(cool_database_string, rt_cool_folder, cool_tag, run_number)[0]
80 os.makedirs(
"calibration/rts")
83 os.stat(
"calibration/rts")
85 sys.stderr.write(
"ERROR: Cannot create calibration directory!\n")
87 for ident, rt
in graphs.items():