ATLAS Offline Software
plot_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 import pylab as pl
4 import sys
5 import os
6 
7 
8 
9 
10 
11 def times(fn):
12  result = []
13  with open(fn) as iff:
14  for l in iff:
15  if 'tav' in l and 'node: 0 parent: 0' in l:
16  result.append(float(l[:-1].split()[-1]))
17 
18  return result
19 
20 
21 if __name__ == '__main__':
22 
23  if len(sys.argv) < 2:
24  print('Please supply an input file name on the command line')
25  sys.exit(0)
26 
27 
28  fn = sys.argv[1]
29  if not os.path.exists(fn):
30  print('unknown file. giving up: ', fn)
31  sys.exit(0)
32  x = times(fn)
33  # print x
34  pl.hist(x)
35  pl.suptitle('Execution times for %s' % fn)
36  pl.xlabel('time (ns)')
37  pl.ylabel('no of calls')
38  pl.savefig('%s_times.pdf' % fn[:-4])
39  pl.show()
Trk::open
@ open
Definition: BinningType.h:40
Muon::print
std::string print(const MuPatSegment &)
Definition: MuonTrackSteering.cxx:28
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
plot_times.times
def times(fn)
Definition: plot_times.py:11