3 from __future__
import print_function
8 cool_database_strings=[
'COOLOFL_MDT/COMP200',
'COOLOFL_MDT/COMP200']
9 cool_folders=[
'/MDT/RT',
'/MDT/RT']
10 cool_tags=[
'COMCOND-BLKPST-004-07',
'COMCOND-BLKPST-004-07']
11 run_numbers=[
None,
None]
14 sys.stderr.write(
"Usage: " + argv0 +
" [-h] [-s <cool database string>] [-f <cool folder>] [-t <cool tag>] <run number 1> [-s <cool database string>] [-f <cool folder>] [-t <cool tag>] <run number 2> <root file>\n")
20 optlist, args = getopt.getopt(theArgs,
'hs:f:t:')
22 for opt, oa
in optlist:
25 cool_database_strings[i] =
'sqlite://;schema=' + oa +
';dbname=COMP200'
28 cool_database_strings[i] = oa
40 sys.stderr.write(
"Error in commandline!\n")
43 run_numbers[i]=
int(args[0])
45 sys.stderr.write(
"Error in commandline!\n")
50 sys.stderr.write(
"Error in commandline!\n")
55 print (cool_database_strings)
61 sys.argv=[sys.argv[0],
'-b']
71 outfile=TFile(outfile_nm,
"RECREATE")
74 outfile.mkdir(
"graphs_"+
str(i)).
cd()
76 cool_tags[i] =
GetFolderTag(cool_database_strings[i], cool_folders[i])
77 print (
"Cool database: " + cool_database_strings[i] +
" " + cool_folders[i] +
" " + cool_tags[i] +
" " +
str(run_numbers[i]))
78 cool_rts.append(
ReadRtCool(cool_database_strings[i], cool_folders[i], cool_tags[i], run_numbers[i])[1])
84 tree=TTree(
"tree",
"t0 differences")
89 tree.Branch(
"station_nm", station_nm,
"station_nm/C")
90 tree.Branch(
"station_phi", station_phi,
"station_phi/I")
91 tree.Branch(
"station_eta", station_eta,
"station_eta/I")
99 tree.Branch(
"r", r,
"r[13]/F")
103 t.append(
array(
'f', 13*[0.0]))
104 v.append(
array(
'f', 13*[0.0]))
105 tree.Branch(
"t_" +
str(i), t[-1],
"t_" +
str(i) +
"[13]/F")
106 tree.Branch(
"v_" +
str(i), v[-1],
"v_" +
str(i) +
"[13]/F")
108 for ident
in all_stations:
110 nm=up.stationNameString()
113 station_phi[0]=up.stationPhi()
114 station_eta[0]=up.stationEta()
116 if not ident
in cool_rts[i]:
121 theRt=cool_rts[i][ident]
123 t[i][j]=theRt.Eval(
float(j+1))
124 v[i][j]=1/theRt.Derivative(
float(j+1))