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))
57 [i[0][0]
for i
in np.array(list(dataDict.values()))],
63 [i[1][0]
for i
in np.array(list(dataDict.values()))],
69 [i[2][0]
for i
in np.array(list(dataDict.values()))],
73 ax.set_xlabel(
"$p_T$ [GeV]")
74 ax.set_ylabel(
"#steps")
75 ax.set_xlim((-10, 150))
76 plt.legend(numpoints=1)
79 plt.loglog(dataDict.keys(), [i[0][2]
for i
in np.array(list(dataDict.values()))],
"+")
80 plt.loglog(dataDict.keys(), [i[1][2]
for i
in np.array(list(dataDict.values()))],
"*")
81 plt.loglog(dataDict.keys(), [i[2][2]
for i
in np.array(list(dataDict.values()))],
"o")
82 ax.set_xlabel(
"$p_T$ [GeV]")
83 ax.set_ylabel(
"time [a.u.]")
84 ax.set_xlim((-10, 150))
88 plt.loglog(dataDict.keys(), [i[0][3]
for i
in np.array(list(dataDict.values()))],
"+")
89 plt.loglog(dataDict.keys(), [i[1][3]
for i
in np.array(list(dataDict.values()))],
"*")
90 plt.loglog(dataDict.keys(), [i[2][3]
for i
in np.array(list(dataDict.values()))],
"o")
91 ax.set_xlabel(
"$p_T$ [GeV]")
92 ax.set_ylabel(
"time/steps [a.u.]")
93 ax.set_xlim((-10, 150))
96 plt.suptitle(
"Stepper comparison: Constant Field")