3 import matplotlib.pyplot
as plt
10 with
open(
'output.log', mode=
'r') as csv_file:
11 csv_reader = csv.reader(csv_file, delimiter=',')
13 for csv_row
in csv_reader :
19 with open (
'timing_'+jobID+
".tsv")
as tsv_file:
20 tsv_reader = csv.reader(tsv_file, delimiter=
'\t')
21 for tsv_row
in tsv_reader :
22 if str(tsv_row[0])==
'Algorithm:PropagationAlgorithm' :
23 exectime=float(tsv_row[2])
25 stepper =
int(csv_row[1])
26 ptvalue = float(csv_row[2])
28 rfile = ROOT.TFile(
'propagation_steps_'+str(jobID)+
'.root')
29 stree = rfile.Get(
"propagation_steps")
30 stree.Draw(
'@g_x->size()>>h_steps')
31 h_steps = ROOT.gDirectory.Get(
'h_steps')
32 steps = h_steps.GetMean()
33 stepsSpread = h_steps.GetMeanError()
37 cdict = dataDict[ptvalue]
39 dataDict[ptvalue] = {}
40 cdict = dataDict[ptvalue]
44 vdict = cdict[stepper]
47 vdict = cdict[stepper]
49 vdict += [ steps, stepsSpread, exectime, exectime/steps ]
52 plt.figure(figsize=(16, 5))
55 plt.loglog(dataDict.keys(),[i[0][0]
for i
in np.array(list(dataDict.values()))],
'+', label=
'line')
56 plt.loglog(dataDict.keys(),[i[1][0]
for i
in np.array(list(dataDict.values()))],
'*', label=
'eigen')
57 plt.loglog(dataDict.keys(),[i[2][0]
for i
in np.array(list(dataDict.values()))],
'o', label=
'atlas')
58 ax.set_xlabel(
'$p_T$ [GeV]')
59 ax.set_ylabel(
'#steps')
60 ax.set_xlim((-10,150))
61 plt.legend(numpoints=1)
64 plt.loglog(dataDict.keys(),[i[0][2]
for i
in np.array(list(dataDict.values()))],
'+')
65 plt.loglog(dataDict.keys(),[i[1][2]
for i
in np.array(list(dataDict.values()))],
'*')
66 plt.loglog(dataDict.keys(),[i[2][2]
for i
in np.array(list(dataDict.values()))],
'o')
67 ax.set_xlabel(
'$p_T$ [GeV]')
68 ax.set_ylabel(
'time [a.u.]')
69 ax.set_xlim((-10,150))
73 plt.loglog(dataDict.keys(),[i[0][3]
for i
in np.array(list(dataDict.values()))],
'+')
74 plt.loglog(dataDict.keys(),[i[1][3]
for i
in np.array(list(dataDict.values()))],
'*')
75 plt.loglog(dataDict.keys(),[i[2][3]
for i
in np.array(list(dataDict.values()))],
'o')
76 ax.set_xlabel(
'$p_T$ [GeV]')
77 ax.set_ylabel(
'time/steps [a.u.]')
78 ax.set_xlim((-10,150))
81 plt.suptitle(
"Stepper comparison: Constant Field")