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 __future__ import print_function
3 from plot_times import times
4 import pylab as pl
5 import sys
6 import glob
7 
8 if len(sys.argv) < 3:
9  print('Please supply an input file name stub to glob on the command line, and an output file name')
10  sys.exit(0)
11 
12 
13 stub = sys.argv[1]
14 outname = sys.argv[2]
15 if not outname.endswith('.pdf'): outname += '.pdf'
16 
17 fns = glob.glob(stub)
18 print('glob found %d files: %s for stub %s' % (len(fns), str(fns), stub))
19 if not fns:
20  print('no files found for stub', stub)
21  sys.exit()
22 
23 def get_av(fn):
24  t = times(fn)
25  return sum(t)/float(len(t))
26 
27 av_times = [get_av(fn) for fn in fns]
28 
29 def get_nbkgd(fn):
30  print(fn)
31  x = fn.split('.')[0] # remove .log
32  toks = x.split('_')
33  x = [t for t in toks if t.startswith('b')][0]
34  x = x[1:] # remove 'b'
35  print(x)
36  return float(x)
37 
38 n_bkgd = [get_nbkgd(fn) for fn in fns]
39 
40 # print x
41 pl.plot(n_bkgd, av_times, 'o')
42 pl.suptitle(outname[:-4])
43 pl.xlabel('n background')
44 pl.ylabel('av exec time (ns)')
45 pl.savefig(outname)
46 pl.show()
plot_av_times.get_av
def get_av(fn)
Definition: plot_av_times.py:23
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
plot_av_times.get_nbkgd
def get_nbkgd(fn)
Definition: plot_av_times.py:29
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
str
Definition: BTagTrackIpAccessor.cxx:11
readCCLHist.float
float
Definition: readCCLHist.py:83
plot_times.times
def times(fn)
Definition: plot_times.py:11