10 import sys, socket, pathlib, errno, re, subprocess, os
13 from DeMoLib
import retrieveYearTagProperties,returnPeriod
15 maindir =
"/eos/project/a/atlas-dataquality/www/DeMo/"
16 libdir = os.path.dirname(__file__)
19 weeklyTag =
"AtlasReady"
22 run3_yt = {
"2022":[
"AtlasReady_BestLumi_HEAD",
"AtlasReady_BestLumi",
"GRL_M"],
23 "2023":[
"AtlasReady",
"GRL_summer"],
24 "2024":[
"AtlasReady"]}
27 global run3_yt_description
28 run3_yt_description = {}
31 subsystems = {
"Inner detector":[
"Pixel",
"SCT",
"TRT"],
32 "Calorimeters":[
"LAr",
"Tile"],
33 "Muon":[
"RPC",
"MDT",
"TGC",
"CSC"],
34 "Trigger/Lumi/Global":[
"Trig_L1",
"Trig_HLT",
"Lumi",
"Global"],
35 "Forward": [
"ALFA",
"AFP",
"LUCID",
"ZDC"],
36 "Combined perf.":[
"IDGlobal",
"BTag",
"CaloCP",
"MuonCP"]}
38 subsystemName = {
"Pixel":
"Pixel",
47 "Trig_L1":
"L1 trigger",
48 "Trig_HLT":
"HLT trigger",
55 "IDGlobal":
"ID global",
57 "CaloCP":
"Calorimeter combined",
58 "MuonCP":
"Muon combined"}
60 subsystemNotInRun2 = {}
61 subsystemNotInRun3 = [
"CSC"]
63 runListDir =
"./YearStats-common"
69 htmlSplitted = l.split(
"https")
71 if len(htmlSplitted)>1:
72 urlAlreadyReplaced = []
73 for iUrl
in range(1,len(htmlSplitted)):
74 url =
"https%s"%(htmlSplitted[iUrl].
split(
" ")[0])
75 if (url
not in urlAlreadyReplaced):
76 l = l.replace(url,
'''<a href="%s" target="_blank"> %s </a>'''%(url,url))
77 urlAlreadyReplaced.append(url)
85 run3 = (year !=
"Run2")
87 page.write(
'''<!doctype html>\n''')
88 page.write(
'''<html lang=''>\n''')
89 page.write(
'''<head>\n''')
90 page.write(
''' <meta charset='utf-8'>\n''')
91 page.write(
''' <meta http-equiv="X-UA-Compatible" content="IE=edge">\n''')
92 page.write(
''' <meta name="viewport" content="width=device-width, initial-scale=1">\n''')
93 page.write(
''' <link rel="stylesheet" href="styles.css">\n''')
94 page.write(
''' <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>\n''')
95 page.write(
''' <script src="script.js"></script>\n''')
96 page.write(
''' <title>DeMo outputs</title>\n''')
97 page.write(
'''</head> \n''')
98 page.write(
'''<body>\n''')
101 page.write(
'''<div id='cssmenu'>\n''')
102 page.write(
'''<ul>\n''')
104 page.write(
''' <li><a href='index-Run2.html'><span><b>Run 2</b></span></a></li>\n''')
106 page.write(
''' <li><a href='index-Run2.html'><span>Run 2</span></a></li>\n''')
107 for irun3_year
in run3_yt.keys():
108 if (irun3_year == year):
109 page.write(
''' <li><a href='index-%s.html'><span><b>%s</b></span></a></li>\n'''%(irun3_year,irun3_year))
111 page.write(
''' <li><a href='index-%s.html'><span>%s</span></a></li>\n'''%(irun3_year,irun3_year))
112 page.write(
'''</ul>\n''')
113 page.write(
'''</div>\n''')
116 page.write(
'''<div id='cssmenu'>\n''')
117 page.write(
'''<ul>\n''')
120 page.write(
''' <li class='active has-sub'><a><span>Overview</span></a>\n''')
121 page.write(
''' <ul>\n''')
123 if (year == weeklyYear):
124 page.write(
''' <li><a href='Weekly.html'><span>Weekly</span></a></li>\n''')
126 for iTag
in run3_yt[year]:
127 page.write(
''' <li><hr><a href='YearStats-%s-%s.html'><span>Year stats - %s </span></a></li>\n'''%(year,iTag,run3_yt_description[
"%s_%s"%(year,iTag)]))
128 page.write(
''' <li><a href='recapDefectsHighlights-%s-%s.html'><span>Defect highlights (beta) - %s </span></a></li>\n'''%(year,iTag,run3_yt_description[
"%s_%s"%(year,iTag)]))
130 page.write(
''' <li><a href='YearStats-2018-DQPaper_2018.html'><span>2018 overview - DQ Paper</span></a></li>\n''')
131 page.write(
''' <li><a href='YearStats-2017-DQPaper_2017.html'><span>2017 overview - DQ Paper</span></a></li>\n''')
132 page.write(
''' <li><a href='YearStats-2016-DQPaper_2016.html'><span>2016 overview - DQ Paper</span></a></li>\n''')
133 page.write(
''' <li><a href='YearStats-2015-DQPaper_2015.html'><span>2015 overview - DQ Paper</span></a></li>\n''')
135 page.write(
''' </ul>\n''')
136 page.write(
''' </li>\n''')
138 for iSystem
in subsystems.keys():
139 page.write(
''' <li class='active has-sub'><a><span>%s</span></a>'''%iSystem)
140 page.write(
''' <ul>\n''')
142 for iSystem
in subsystems[iSystem]:
143 if ((run3)
and (iSystem
not in subsystemNotInRun3))
or ((
not run3)
and (iSystem
not in subsystemNotInRun2)):
144 page.write(
'''<li class='has-sub'><a ><span>%s</span></a>'''%subsystemName[iSystem])
145 page.write(
''' <ul>\n''')
149 if (run3)
and (iSystem
not in subsystemNotInRun3):
150 if (year == weeklyYear):
151 page.write(
''' <li><a href='%s-Weekly.html'><span>Weekly</span></a></li>\n'''%(iSystem))
152 for iTag
in run3_yt[year]:
153 page.write(
''' <li><hr><a href='%s-YearStats-%s-%s.html'><span>Year stats - %s </span></a></li>\n'''%(iSystem,year,iTag,run3_yt_description[
"%s_%s"%(year,iTag)]))
154 page.write(
''' <li><a href='%s-recapDefects-%s-%s.html'><span>Defect recap - %s </span></a></li>\n'''%(iSystem,year,iTag,run3_yt_description[
"%s_%s"%(year,iTag)]))
155 elif (iSystem
not in subsystemNotInRun2):
156 page.write(
''' <li><hr><a href='%s-YearStats-DQPaper_.html'><span>Year stats - Run2</span></a></li>\n'''%(iSystem))
157 page.write(
''' <li class='last'><a href='%s-recapDefects-DQPaper_.html'><span>Defect recap - Run2</span></a></li>\n'''%(iSystem))
158 page.write(
''' </ul>\n''')
159 page.write(
'''</li>\n''')
160 page.write(
'''</ul>\n''')
161 page.write(
'''</li>\n''')
163 page.write(
'''</ul>\n''')
164 page.write(
'''</div>\n''')
166 page.write(
'''<br>\n''')
172 page.write(
'''<div style="text-align:left" class="rectangle">\n''')
173 page.write(
'''Link to the <a href="logs/DeMoCron.log"> cron job output </a> - Documentation available <a href="https://twiki.cern.ch/twiki/bin/view/Atlas/DataQualityDemo"> here </a> <br>\n''')
174 page.write(
'''Original developer: Benjamin Trocmé (LPSC Grenoble) - Maintenance: Benjamin Trocmé (LPSC Grenoble)\n''')
175 page.write(
'''</div></body>\n''')
176 page.write(
'''<html>\n''')
181 page.write(
'''<div style="text-align:left" class="rectangle">\n''')
182 page.write(
'''Considered dataset: <br>\n''')
183 page.write(
'''- all ATLAS-ready runs acquired in the last 7 days <br>\n''')
184 page.write(
'''- all ATLAS-ready runs fully signed off in the last 7 days <br>\n''')
185 page.write(
'''- all runs considered for the upcoming wednesday formal signoff (list available <a href="%s/%s/runlist-weekly.dat" target="_blank"> here </a>)<br>'''%(runListDir,weeklyYear))
186 page.write(
'''Plots updated daily at midnight<br>\n''')
187 page.write(
'''Status meaning (based on UNCHECKED defect status):<br>\n''')
188 page.write(
'''-EXPR. : no assessment yet<br>\n''')
189 page.write(
'''-BULK : express assessment completed<br>\n''')
190 page.write(
'''-DONE : express and bulk assessment completed (but no final signoff - relevant only for LAr)<br>\n''')
191 page.write(
'''-FINAL OK: assessment completed<br>\n''')
192 page.write(
'''The spade symbol after the status indicates that this run is supposed to be signed off at the upcoming DQ wednesday meeting <br>\n''')
193 page.write(
'''</div>\n''')
198 page.write(
'''<div style="text-align:left" class="rectangle">\n''')
201 if (type ==
"YearStats"):
202 page.write(
'''<b>%s - %s</b> - Switch to the <a href="%s-recapDefects-%s-%s.html"> defect recap page</a><br>\n'''%(year,run3_yt_description[
"%s_%s"%(year,tag)],system,year,tag))
204 page.write(
'''<b>%s - %s</b> - Switch to the <a href="%s-YearStats-%s-%s.html"> year stats page</a><br>\n'''%(year,run3_yt_description[
"%s_%s"%(year,tag)],system,year,tag))
206 page.write(
'''<b>%s - %s</b><br>\n'''%(year,run3_yt_description[
"%s_%s"%(year,tag)]))
208 if "AtlasReady" in tag:
209 page.write(
'''All runs with ATLAS ready considered.''')
211 page.write(
'''List of runs derived from the <a href="https://twiki.cern.ch/twiki/bin/view/AtlasProtected/GoodRunListsForAnalysisRun3" target="_blank">GRL twiki </a>.''')
212 page.write(
'''<br> Direct link to the <a href="%s/%s/runlist-%s-%s.dat" target="_blank"> list. </a> <br>\n'''%(runListDir,year,year,tag))
215 DeMoLibFile =
open(
"%s/DeMoLib.py"%libdir,
"r")
220 listOfDefects = {
"partIntol":
"",
"partTol":
"",
"globIntol":
"",
"globTol":
""}
222 for line
in DeMoLibFile:
224 defectSearch =
"%s system"%system
225 for iType
in listOfDefects.keys():
226 if re.search(defectSearch, line)
and iType
in line:
227 listOfDefects[iType] = (((line.split(
" = ")[1]).
split(
"# %s system"%system)[0]).
replace(
" ",
"")).
replace(
",",
", ")
233 page.write(
'''<b>Monitored defects </b><br>\n''')
234 if len(listOfDefects[
"globIntol"])>2:
235 page.write(
'''Global intolerable defects: %s <br>'''%listOfDefects[
"globIntol"])
236 if len(listOfDefects[
"partIntol"])>2:
237 page.write(
'''Partition intolerable defects: %s <br>'''%listOfDefects[
"partIntol"])
238 if len(listOfDefects[
"globTol"])>2:
239 page.write(
'''Global tolerable defects : %s <br>'''%listOfDefects[
"globTol"])
240 if len(listOfDefects[
"partTol"])>2:
241 page.write(
'''Partition tolerable defects : %s <br>'''%listOfDefects[
"partTol"])
244 page.write(
'''<b>Database tags </b><br>\n''')
246 for iyt
in yearTagProperties.keys():
247 if (iyt ==
"Defect tag")
or (iyt ==
"OflLumi tag")
or (iyt ==
"OflLumiAcct tag"):
248 page.write(
'''%s: %s <br>\n'''%(iyt,yearTagProperties[iyt]))
249 if (iyt ==
"Veto tag")
and (system ==
"LAr"):
250 page.write(
'''%s: %s <br>\n'''%(iyt,yearTagProperties[iyt]))
253 page.write(
'''<hr><a href="YearStats-%s/%s/%s/runs-notYetSignedOff.dat" target="_blank"> Runs not yet signed off </a> - \n'''%(system,year,tag))
254 if (type ==
"YearStats"):
255 page.write(
'''<a href="YearStats-%s/%s/%s/daemon-grl.out" target="_blank"> daemon output </a> - \n'''%(system,year,tag))
257 page.write(
'''<a href="YearStats-%s/%s/%s/daemon-grl.out" target="_blank"> daemon output </a> - \n'''%(system,year,tag))
259 if (os.path.exists(
"YearStats-%s/%s/%s/lastResetYS.dat"%(system,year,tag))):
260 lastResetFile =
open(
"YearStats-%s/%s/%s/lastResetYS.dat"%(system,year,tag),
"r")
261 for iline
in lastResetFile.readlines():
262 page.write(
"Last year-stats reset: %s"%iline)
265 p = subprocess.Popen(
"ls",stdout=subprocess.PIPE)
266 (output, err) = p.communicate()
268 for iLine
in (output.decode(
'ascii').
split(
"\n")):
270 if "%s-%s-%s.token"%(system,year,tag)
in iLine:
271 remainingToken =
"%s<br>"%iLine
273 if "%s-%s.token"%(year,tag)
in iLine:
274 remainingToken = remainingToken +
"%s<br>"%iLine
275 if remainingToken !=
"":
276 page.write(
'''<hr><b>Remaining tokens</b>\n''')
277 page.write(
'''<br>There are some remaining tokens in ~atlasdqm/w1/DeMo: %s <br> This may indicate a problem in processing. Please check the daemon ouputs...'''%remainingToken)
280 page.write(
'''</div>\n''')
288 page.write(
'''<div style="text-align:left" class="rectangle">\n''')
289 page.write(
'''Considered dataset: all "stable beam" runs signed off.\n''')
290 page.write(
'''<br><a href='#2018' target='_self'> 2018 dataset </a>\n''')
291 page.write(
'''<br><a href='#2017' target='_self'> 2017 dataset </a>\n''')
292 page.write(
'''<br><a href='#2016' target='_self'> 2016 dataset </a>\n''')
293 page.write(
'''<br><a href='#2015' target='_self'> 2015 dataset </a>\n''')
294 page.write(
'''</div>\n''')
300 for iYear
in [
"2015",
"2016",
"2017",
"2018"]:
301 page =
open(
"%s/YearStats-%s-DQPaper_%s.html"%(maindir,iYear,iYear),
"w")
303 for iSystem
in subsystemName.keys():
304 if (iSystem
not in subsystemNotInRun2):
305 page.write(
'''<div style="text-align:left" class="rectangle"> <b>%s</b>'''%iSystem)
306 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/DQPaper_%s/grl-defects.png" alt="" width="750" content="no-cache" /></figure>\n'''%(iSystem,iYear,iYear))
308 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/DQPaper_%s/grl-veto.png" alt="" width="750" content="no-cache" /></figure>\n'''%(iSystem,iYear,iYear))
309 page.write(
'''</div>\n''')
314 for iSystem
in subsystemName.keys():
315 if (iSystem
not in subsystemNotInRun3):
316 page =
open(
"%s/%s-YearStats-DQPaper_.html"%(maindir,iSystem),
"w")
318 for iYear
in [
"2015",
"2016",
"2017",
"2018"]:
319 page.write(
'''<div style="text-align:left" class="rectangle"><b>%s</b>\n'''%(iYear))
320 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-LAr/%s/DQPaper_%s/grl-defects.png" alt="" width="750" content="no-cache" /></figure>\n'''%(iYear,iYear))
322 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-LAr/%s/DQPaper_%s/grl-veto.png" alt="" width="750" content="no-cache" /></figure>\n'''%(iYear,iYear))
323 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-LAr/%s/DQPaper_%s/grl-lumi.png" alt="" width="750" content="no-cache" /></figure>\n'''%(iYear,iYear))
324 page.write(
'''</div>\n''')
329 for iSystem
in subsystemName.keys():
330 if (iSystem
not in subsystemNotInRun2):
331 page =
open(
"%s/%s-recapDefects-DQPaper_.html"%(maindir,iSystem),
"w")
334 for iYear
in [
"2015",
"2016",
"2017",
"2018"]:
335 page.write(
'''<hr>\n''')
336 page.write(
'''<a id='%s'> %s dataset </a>\n'''%(iYear,iYear))
337 readFile =
open(
"YearStats-%s/%s/DQPaper_%s/recapDefects.html"%(iSystem,iYear,iYear))
338 for line
in readFile:
345 weekly =
open(
"%s/Weekly.html"%maindir,
"w")
348 for iSystem
in subsystemName.keys():
349 if (iSystem
not in subsystemNotInRun3):
350 weekly.write(
'''<div style="text-align:left" class="rectangle"> <b>%s</b>'''%subsystemName[iSystem])
351 weekly.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/Weekly/summary-0.png" alt="" width="750" content="no-cache"/></figure>\n'''%(iSystem,weeklyYear,weeklyTag))
352 weekly.write(
'''<a> Link to the <a href="%s-Weekly.html" > weekly plots.</a>\n'''%(iSystem))
353 weekly.write(
'''</div>\n''')
359 page =
open(
"%s/%s-Weekly.html"%(maindir,system),
"w")
362 page.write(
'''<div style="text-align:left" class="rectangle"><b>%s</b> - <a href="YearStats-%s/%s/%s/daemon-weekly.out" target="_blank"> Daemon output </a>\n'''%(subsystemName[system],system,weeklyYear,weeklyTag))
363 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/Weekly/defects--Run--%s.png" alt="" width="750" content="no-cache" /></figure>\n'''%(system,weeklyYear,weeklyTag,weeklyTag))
365 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/Weekly/veto--Run--%s.png" alt="" width="750" content="no-cache" /></figure>\n'''%(system,weeklyYear,weeklyTag,weeklyTag))
366 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/Weekly/noiseBurst_veto_evol.png" alt="" width="750" content="no-cache" /></figure>\n'''%(system,weeklyYear,weeklyTag))
367 page.write(
'''<figure> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/Weekly/summary-0.png" alt="" width="750" content="no-cache" /></figure>\n'''%(system,weeklyYear,weeklyTag))
373 yearTag =
"%s_%s"%(year,tag)
374 page =
open(
"%s/%s-YearStats-%s-%s.html"%(maindir,system,year,tag),
"w")
377 page.write(
'''<div style="text-align:left" class="rectangle"><figure> <a href="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-defects.png" target="_blank"> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-defects.png" alt="" width="750" content="no-cache" /> </a></figure>\n'''%(system,year,tag,system,year,tag))
379 page.write(
'''<figure> <a href="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-veto.png" target="_blank"><img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-veto.png" alt="" width="750" content="no-cache" /></a></figure>\n'''%(system,year,tag,system,year,tag))
380 page.write(
'''<figure> <a href="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-lumi.png" target="_blank"> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-lumi.png" alt="" width="750" content="no-cache" /></a></figure>\n'''%(system,year,tag,system,year,tag))
381 page.write(
'''</div>\n''')
382 page.write(
'''</div>\n''')
388 yearTag =
"%s_%s"%(year,tag)
389 page =
open(
"%s/YearStats-%s-%s.html"%(maindir,year,tag),
"w")
393 page.write(
'''<div style="text-align:left" class="rectangle"> <b>ATLAS </b><br>\n''')
394 page.write(
'''Within each system, the overlaps between defects are treated.<br>\n''')
395 page.write(
'''For the ATLAS inefficiency, the overlaps between systems are treated.<br>\n''')
396 page.write(
'''<figure> <a href="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-Global/%s/%s/DataLoss.png" target="_blank"> <img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-Global/%s/%s/DataLoss.png" alt="" width="750" content="no-cache" /></figure> </a>\n'''%(year,tag,year,tag))
397 page.write(
'''</div>\n''')
399 for iSystem
in subsystemName.keys():
400 if (iSystem
not in subsystemNotInRun3):
401 page.write(
'''<div style="text-align:left" class="rectangle"> <b>%s</b>'''%subsystemName[iSystem])
402 page.write(
'''<figure> <a href="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-defects.png" target="_blank"><img src="https://atlasdqm.web.cern.ch/atlasdqm/DeMo/YearStats-%s/%s/%s/grl-defects.png" alt="" width="750" content="no-cache" /></a></figure>\n'''%(iSystem,year,tag,iSystem,year,tag))
403 page.write(
'''</div>\n''')
410 yearTag =
"%s_%s"%(year,tag)
411 page =
open(
"%s/%s-recapDefects-%s-%s.html"%(maindir,system,year,tag),
"w")
416 if (os.path.exists(
"YearStats-%s/%s/%s/recapDefects.html"%(system,year,tag))):
417 readFile =
open(
"YearStats-%s/%s/%s/recapDefects.html"%(system,year,tag))
418 for line
in readFile:
421 page.write(
'''</div>\n''')
427 yearTag =
"%s_%s"%(year,tag)
428 page =
open(
"%s/recapDefectsHighlights-%s-%s.html"%(maindir,year,tag),
"w")
432 defectsToKeep = {
"Pixel":[
"DISABLED"],
437 "Global":[
"TOROID_OFF",
"NOTCONSIDERED"]
442 for iSystem
in subsystemName.keys():
443 if (iSystem
in defectsToKeep.keys())
and (iSystem
not in subsystemNotInRun3):
444 if (os.path.exists(
"YearStats-%s/%s/%s/recapDefects.txt"%(iSystem,year,tag))):
445 readFile =
open(
"YearStats-%s/%s/%s/recapDefects.txt"%(iSystem,year,tag))
450 for line
in readFile:
451 if line.startswith(
"===== Recap for "):
452 currentDefect = ((line.split(
"===== Recap for ")[1]).
split(
"===")[0]).
replace(
" ",
"")
453 elif line.startswith(
"Description:")
or line.startswith(
" Run")
or (currentDefect
not in defectsToKeep[iSystem]):
456 iovLine = line.split(
"|")
457 if (len(iovLine) == 8):
458 runFound = iovLine[0]
459 if (runFound
not in runHighlights.keys()):
460 runHighlights[runFound] = {}
461 runHighlights[runFound][
"TotLumi"] = iovLine[2]
462 if (iovLine[3] == runHighlights[runFound][
"TotLumi"]):
463 runHighlights[runFound][iSystem] =
"<th>Whole run </th><th>%s : %s</th>"%(currentDefect,
addLink(iovLine[7]))
465 runHighlights[runFound][iSystem] =
"<th>%s </th><th>%s : %s</th>"%(iovLine[3],currentDefect,
addLink(iovLine[7]))
467 page.write(
'''<div style="text-align:left" class="rectangle">''')
469 page.write(
'''<table class="report"><tr class="out0"> <th width="100pix"></th><th width="100pix"></th><th width="100pix"></th><th width="150pix"></th><th width="100pix"></th></th><th width="1200pix"></th></tr>\n''')
470 page.write(
'''<tr class="out0"><th> Run </th><th> Period </th> <th> Total lumi </th><th> Affected system </th> <th> Lost lumi </th> <th> Comment </th> </tr> \n''')
472 listOfRuns =
list(runHighlights.keys())
473 listOfRuns.sort(reverse=
True)
475 for iRun
in listOfRuns:
477 for iSystem
in runHighlights[iRun].
keys():
478 if iSystem ==
"TotLumi":
481 page.write(
'''<tr class="out1"><th> %s </th> <th> %s </th> <th> %s </th> <th> %s </th> %s </tr> </tr>\n'''%(iRun,
returnPeriod(
int(iRun),
"Pixel",year,
"AtlasReady"),runHighlights[iRun][
"TotLumi"],iSystem,runHighlights[iRun][iSystem]))
484 page.write(
'''<tr class="out1"><th> </th> <th> </th> <th> </th> <th> %s </th> %s </tr></tr>\n'''%(iSystem,runHighlights[iRun][iSystem]))
486 page.write(
'''</table>\n''')
489 page.write(
'''</div>''')
498 parser = argparse.ArgumentParser(description=
'')
499 parser.add_argument(
'-y',
'--year',dest=
'parser_year',default =
"2024",help=
'Year: Run2, 2022,2023...[Default: 2024].',action=
'store')
501 args = parser.parse_args()
504 year = args.parser_year
507 run3_yt_description = {}
508 for iYear
in run3_yt.keys():
509 for iTag
in run3_yt[iYear]:
510 DeMoConfigFile =
open(
"%s/%s/DeMoConfig-%s-%s.dat"%(runListDir,iYear,iYear,iTag),
"r")
511 for iline
in DeMoConfigFile:
512 if "Description: " in iline:
513 run3_yt_description[
"%s_%s"%(iYear,iTag)] = (iline.split(
"Description: ")[1]).
replace(
"\n",
"")
515 homepage =
open(
"%s/index-%s.html"%(maindir,year),
"w")
528 for iSystem
in subsystemName.keys():
529 if iSystem
not in subsystemNotInRun3:
533 for iTag
in run3_yt[year]:
537 for iTag
in run3_yt[year]:
538 for iSystem
in subsystemName.keys():
539 if (iSystem
not in subsystemNotInRun3):
543 for iTag
in run3_yt[year]:
544 for iSystem
in subsystemName.keys():
545 if (iSystem
not in subsystemNotInRun3):
549 for iTag
in run3_yt[year]: