18 rttDescriptor = argDict.get(
'JobDescriptor')
30 logfile =
open(self.
runPath +
"/MooRTT_dynamic_pagemaker.log",
'a')
31 logfile.write(
"Starting MooRTT_dynamic_pagemaker.py run method\n")
33 inputfile = self.
runPath +
"/ALL_MooRTT_Plots.html"
34 outputfile = inputfile.replace(
".html",
"_Dynamic.html")
36 datasetlist = {
"AthenaMooPerformance-MoMu-mupt100-geo-02-01-00" :
" SingleMu_100GeV_15616 " ,
37 "AthenaMooPerformance-MoMu-mupt10-geo-02-01-00" :
" SingleMu_10GeV_15616 " ,
38 "AthenaMooPerformance-MoMu-Zprime-geo-02-01-00" :
" SingleMu_5GeV_15616 " ,
39 "AthenaMooPerformance-MoMu-h4lep-geo-02-01-00" :
" SingleMu_3GeV_15616 " ,
40 "AthenaMooPerformance-MoMu-mupt5-hyb-geo-08-00-02mupt10-geo-02-01-00" :
" SingleMu_5GeV_15616 " ,
41 "AthenaMooPerformance-MoMu-mupt5-TGmat-geo-08-00-02mupt10-geo-02-01-00" :
" SingleMu_5GeV_15616 " ,
42 "AthenaMooPerformance-MoMu-Jpsi-geo-08-00-02" :
" Jpsi_15616 " ,
43 "AthenaMooPerformance-MoMu-zmumu-geo-08-00-02" :
" Zmumu_15616 " ,
44 "AthenaMooPerformance-MoMu-ttbar-geo-08-00-02" :
" ttbar_15616 " ,
45 "AthenaMooPerformance-MoMu-zmumu-csc-01-02-00-sf05" :
" pile1sf05_misal1_csc11.005145.PythiaZmumu.digit.RDO.v12000605 "
49 def szsplit(stringlist,splitchar=" "):
50 if str(splitchar) == splitchar:
52 return stringlist.split(splitchar)
55 for item
in stringlist:
56 newlist += item.split(splitchar)
59 for onechar
in splitchar:
60 stringlist = szsplit(stringlist,onechar)
63 logfile.write(
"Input file: " + inputfile +
"\n")
64 logfile.write(
"Output file: " + outputfile +
"\n")
65 logfile.write(
"datasetlist: \n")
66 for key
in datasetlist.keys():
67 logfile.write(
" " + key +
": " + datasetlist[key] +
"\n")
69 logfile.write(
"Getting dataset... ")
72 logfile.write(
"OK!\n")
74 dataset =
"Unknown (jobGroup = " + self.
jobGroup +
")"
75 logfile.write(
"Unknown!\n")
77 logfile.write(
" Dataset name is " + dataset +
"\n")
79 jobinfolist = {
"Release" : self.
release ,
"Branch" : self.
branch ,
"Build" : self.
build ,
"Platform" : self.
platform ,
"Dataset" : dataset }
83 self.
runPath =
"/afs/cern.ch/atlas/project/RTT/Results/rel_3/devval/build/i686-slc4-gcc34-dbg/offline/MooPerformance/AthenaMooPerformance-MoMu-mupt10-csc-01-02-00/MoMuStandalone_topOptions/100"
85 logfile.write(
"jobinfolist: \n")
86 for key
in jobinfolist.keys():
87 logfile.write(
" " + key +
": " + jobinfolist[key] +
"\n")
89 logfile.write(
"Opening input file: " + inputfile +
"\n")
90 input =
open(inputfile,
'r')
92 logfile.write(
"Opening output file: " + outputfile +
"\n")
93 output =
open(outputfile,
'w')
95 logfile.write(
"Starting copy...\n")
98 logfile.write(
"Line: " + line)
99 if line.count(
"<h2>Contents</h2>"):
100 logfile.write(
" Contains <h2>Contents</h2>\n")
101 output.write(
"<TABLE BORDER=6 CELLSPACING=4 CELLPADDING=4>\n")
102 for key
in jobinfolist.keys():
103 logfile.write(
" Going through jobinfo list and writing value of " + key +
"... ")
104 output.write(
" <TR><TD><b>" + key +
"</b></TD><TD>" + jobinfolist[key] +
"</TD></TR>\n")
105 logfile.write(
"Done.\n")
106 logfile.write(
"Writing date and finishing table... ")
107 output.write(
" <TR><TD><b>" +
"Date" +
"</b></TD><TD>" + os.popen(
"date").readline().strip() +
"</TD></TR>\n")
108 output.write(
"</TABLE>\n\n")
109 logfile.write(
"Done.\n")
110 if line.count(
"RTT default page"):
111 logfile.write(
" Contains RTT default page")
112 htmlline =
"<li><a href=\"http://atlas-project-rtt-results.web.cern.ch/atlas-project-rtt-results/page2.php?xml="
113 htmlline += szsplit(self.
runPath,[
"Results/",
"/MooPerformance"])[1]
114 htmlline +=
"/RTTSummary.xml&package=MooPerformance&job=MoMuStandalone_topOptions&id=" + self.
runPath.
split(
"/")[-1]
115 htmlline +=
"\">RTT default page</a></li>\n"
116 output.write(htmlline)
117 logfile.write(
" Writing: " + htmlline)
119 if line.count(
"Log files"):
120 logfile.write(
" Contains log files")
121 htmlline =
"<li>Log files: "
122 for filename
in os.listdir(self.
runPath):
123 if filename.count(
"log"):
124 htmlline +=
"<a href=\"" + filename +
"\">" + filename +
"</a> "
125 htmlline +=
"</li>\n"
126 output.write(htmlline)
127 logfile.write(
" Writing: " + htmlline)
130 logfile.write(
" Output original line.\n")
132 logfile.write(
"Now closing files.\n")
138 def __init__(self,release="release",build="build",platform="platform",branch="branch"):
143 self.
runPath = os.popen(
"pwd").readline().strip()
148 self.
jobGroup =
"AthenaMooPerformance-MoMu-mupt10-csc-01-02-00"
152 if sys.argv[0] ==
"./MooRTT_dynamic_pagemaker.py":
155 fakeArgDict = {
'JobDescriptor' : fakedecr }