Skip to content
Snippets Groups Projects
Commit 47137682 authored by Klaus Rabbertz's avatar Klaus Rabbertz
Browse files

Adapt plotting script to changed NNLOJET modules2 runcards

parent 55a667cb
No related merge requests found
......@@ -208,15 +208,36 @@ def get_runinformation(files):
for file in files:
with open(file) as origin:
# deactivate channel reading
lmod1 = False
lchan = False
for line in origin:
# extract total events
if 'Number of events' in line:
line = line.split()
nevents.append(line[0])
if 'Job name id' in line:
# extract number of events and channel (with region a/b) from NNLOJET run card
# remove leading and trailing whitespace
line = line.strip()
# skip all comment lines
if line.startswith("#"):
continue
# identify run card version
if 'Job name id' in line: # NNLOJET modules 1
lmod1 = True
line = line.split()
parts = line[0].split('-')
channels.append(parts[0])
elif 'Number of events' in line and lmod1: # NNLOJET modules 1
line = line.split()
nevents.append(line[0])
elif line.startswith("production") and not lmod1: # NNLOJET modules 2
line = line.split()
parts = line[2].split('[')
nevents.append(parts[0])
elif line.startswith("CHANNELS") and not lmod1: # NNLOJET modules 2; channel names now include region a/b information
# read channel from next line; does not require anymore to have channel in job name
lchan = True
elif lchan and not lmod1:
lchan = False
line = line.split()
channels.append(line[0])
nevents = np.array(nevents)
channels = np.array(channels)
......@@ -247,6 +268,8 @@ def plot_elapsed_time(infodict, out_path, out_name, formats):
std = np.std(times)
median = np.median(times)
iqd = np.subtract(*np.percentile(times, [75, 25], interpolation='linear'))/2.
# In future?:
# iqd = np.subtract(*np.percentile(times, [75, 25], method='linear'))/2.
CPUtime = np.sum(times)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment