ATLAS Offline Software
plot_av_times.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 from plot_times import times
3 import pylab as pl
4 import sys
5 import glob
6 
7 if len(sys.argv) < 3:
8  print('Please supply an input file name stub to glob on the command line, and an output file name')
9  sys.exit(0)
10 
11 
12 stub = sys.argv[1]
13 outname = sys.argv[2]
14 if not outname.endswith('.pdf'): outname += '.pdf'
15 
16 fns = glob.glob(stub)
17 print('glob found %d files: %s for stub %s' % (len(fns), str(fns), stub))
18 if not fns:
19  print('no files found for stub', stub)
20  sys.exit()
21 
22 def get_av(fn):
23  t = times(fn)
24  return sum(t)/float(len(t))
25 
26 av_times = [get_av(fn) for fn in fns]
27 
28 def get_nbkgd(fn):
29  print(fn)
30  x = fn.split('.')[0] # remove .log
31  toks = x.split('_')
32  x = [t for t in toks if t.startswith('b')][0]
33  x = x[1:] # remove 'b'
34  print(x)
35  return float(x)
36 
37 n_bkgd = [get_nbkgd(fn) for fn in fns]
38 
39 # print x
40 pl.plot(n_bkgd, av_times, 'o')
41 pl.suptitle(outname[:-4])
42 pl.xlabel('n background')
43 pl.ylabel('av exec time (ns)')
44 pl.savefig(outname)
45 pl.show()
plot_av_times.get_av
def get_av(fn)
Definition: plot_av_times.py:22
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
plot_av_times.get_nbkgd
def get_nbkgd(fn)
Definition: plot_av_times.py:28
str
Definition: BTagTrackIpAccessor.cxx:11
plot_times.times
def times(fn)
Definition: plot_times.py:10
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65