9 sOut =
"cpuSummary.log"
10 sInArray = glob.glob(sIn)
15 fOut.write(
str(fIn)+
'\n')
16 lines = fIn.readlines()
22 myString = line.split(
'=')
25 myString2 = myString[2].
split(
'(')
27 val =
float(myString2[0])
28 if myString[2].
find(
'[s]') >= 0:
30 elif myString[2].
find(
'[min]') >= 0:
32 elif myString[2].
find(
'[ms]') >= 0:
34 elif myString[2].
find(
'[us]') >= 0:
36 else :
print "ERROR: time units not found"
51 for i
in range(len(lines)):
52 if lines[i].
find(
'iPatRec:execute') >= 0
or lines[i].
find(
'InDetPriVxFinder:execute') >= 0
or lines[i].
find(
'InDetTRT_SeededAmbiguitySolver:execute') >= 0
or lines[i].
find(
'InDetAmbiguitySolver:execute') >= 0
or lines[i].
find(
'InDetExtensionProcessor:execute') >= 0
or lines[i].
find(
'InDetSiSpTrackFinder:execute') >= 0
or lines[i].
find(
'InDetTRT_TrackSegmentsFinder:execute') >= 0
or lines[i].
find(
'InDetTRT_StandaloneTrackFinder:execute') >= 0
or lines[i].
find(
'InDetTRT_SeededTrackFinder:execute') >= 0:
56 print lines[i].strip()
57 fOut.write(
str(lines[i].strip())+
'\n')
58 elif lines[i].
find(
'MuTagMasterIMO:execute') >= 0:
61 print lines[i].strip()
62 fOut.write(
str(lines[i].strip())+
'\n')
63 elif lines[i].
find(
'MuGirl:execute') >= 0:
66 print lines[i].strip()
67 fOut.write(
str(lines[i].strip())+
'\n')
68 elif lines[i].
find(
'MuonCombiTrackBuilder:execute') >= 0
or lines[i].
find(
'MooSegmentMaker:execute') >= 0:
71 print lines[i].strip()
72 fOut.write(
str(lines[i].strip())+
'\n')
73 elif lines[i].
find(
'MuidVertexAssociator:execute') >= 0
or lines[i].
find(
'MuidCombined:execute') >= 0
or lines[i].
find(
'MuidStandalone:execute') >= 0:
76 print lines[i].strip()
77 fOut.write(
str(lines[i].strip())+
'\n')
78 elif lines[i].
find(
'StacoMaster:execute') >= 0
or lines[i].
find(
'StacoDressingTP2Ana:execute') >= 0:
81 print lines[i].strip()
82 fOut.write(
str(lines[i].strip())+
'\n')
83 elif lines[i].
find(
'MboyRec:execute') >= 0:
86 print lines[i].strip()
87 fOut.write(
str(lines[i].strip())+
'\n')
88 elif lines[i].
find(
'MuTagMaster:execute') >= 0:
91 print lines[i].strip()
92 fOut.write(
str(lines[i].strip())+
'\n')
93 elif lines[i].
find(
'AthMasterSeq:execute') >= 0:
96 print lines[i].strip()
97 fOut.write(
str(lines[i].strip())+
'\n')
100 print '*** Summary of average time per event ***'
101 print 'Muid '+
str(muid)+
' s'
102 print 'Moore '+
str(moore)+
' s'
103 print 'MuGirl '+
str(mugirl)+
' s'
104 print 'MuTagIMO '+
str(mutagimo)+
' s'
105 print '-------------------------'
106 print 'Staco '+
str(staco)+
' s'
107 print 'Muonboy '+
str(muonboy)+
' s'
108 print 'MuTag '+
str(mutag)+
' s'
109 print '-------------------------'
110 print 'InnerDet '+
str(innerdet)+
' s'
111 print 'Athena '+
str(athena)+
' s'
112 print 'Muon reconstruction uses '+
str(
round(100*(muid+moore+mugirl+mutagimo+staco+muonboy+mutag)/athena,2))+
'% of total Athena time'
113 fOut.write(
'*** Summary of average time per event ***\n'
114 +
'Muid '+
str(muid)+
' s\n'
115 +
'Moore '+
str(moore)+
' s\n'
116 +
'MuGirl '+
str(mugirl)+
' s\n'
117 +
'MuTagIMO '+
str(mutagimo)+
' s\n'
118 +
'-------------------------\n'
119 +
'Staco '+
str(staco)+
' s\n'
120 +
'Muonboy '+
str(muonboy)+
' s\n'
121 +
'MuTag '+
str(mutag)+
' s\n'
122 +
'-------------------------\n'
123 +
'InnerDet '+
str(innerdet)+
' s\n'
124 +
'Athena '+
str(athena)+
' s\n'
125 +
'Muon reconstruction uses '+
str(
round(100*(muid+moore+mugirl+mutagimo+staco+muonboy+mutag)/athena,2))+
'% of total Athena time\n' )