ATLAS Offline Software
Functions | Variables
StandAloneDisplay Namespace Reference

Functions

def handi (name, resultsFile, htmlDir)
 
def usage ()
 
def makeAllDirsFile (htmlDir, name, s, number, resultsFile)
 
def makeSubDirFile (htmlDir, name, s, number, subname, assessIndex)
 
def makeOneHistFile (htmlDir, name, subname, sp)
 
def makeRootFile (htmlDir, name, subname)
 
def makeCSSFile (htmlDir, name, subname)
 

Variables

 CWD = os.getcwd()
 Needed to correct ROOT behavior; see below. More...
 
 resultsFile = sys.argv[1]
 main() More...
 
 html_dir = sys.argv[2]
 
 name = resultsFile
 

Function Documentation

◆ handi()

def StandAloneDisplay.handi (   name,
  resultsFile,
  htmlDir 
)

Definition at line 23 of file StandAloneDisplay.py.

23 def handi( name, resultsFile, htmlDir ):
24 
25  if ( htmlDir.rfind("/")!=(len(htmlDir)-1) ): # htmlDir needs "/" at the end
26  htmlDir+="/"
27 
28  of = dqutils.HanOutputFile(resultsFile)
29 
30  dirsstring = of.stringListSystemPaths(htmlDir)
31  dirs = dirsstring.rsplit()
32  for subHtmlDir in dirs:
33  if( not os.access(subHtmlDir,os.F_OK) ):
34  try:
35  os.makedirs(subHtmlDir)
36  except os.error:
37  print('Cannot create directory "' + subHtmlDir + '"; exiting.')
38  sys.exit(-1)
39 
40  total=of.stringAllHistograms()
41  of.saveAllHistograms(htmlDir,False)
42 
43  s=total.rsplit('\n')
44  # number = number of lines in total
45  number=len(s)
46  if (len(s[number-1])<1): # last line is empty
47  number-=1
48 
49  list, namelist = makeAllDirsFile( htmlDir, name, s, number, resultsFile )
50 
51  for x in range(0,len(list)):
52  makeSubDirFile( htmlDir, name, s, number, namelist[x], list[x] )
53  makeCSSFile( htmlDir,"", namelist[x] )
54 
55  makeCSSFile( htmlDir,"", "." )
56 
57 

◆ makeAllDirsFile()

def StandAloneDisplay.makeAllDirsFile (   htmlDir,
  name,
  s,
  number,
  resultsFile 
)

Definition at line 63 of file StandAloneDisplay.py.

63 def makeAllDirsFile( htmlDir, name, s, number, resultsFile ):
64  g=open(htmlDir+'index.html','w')
65  g.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
66  g.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
67  g.write('<head>\n')
68  g.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
69  g.write('<title>'+ name+ '</title>\n')
70  g.write('<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
71  g.write('</head>\n')
72  g.write('<body>')
73  g.write('<font class="DQGroup">[<a href="../index.html">Back</a>]</font>\n')
74  g.write('<h1>' + name + ': Monitoring</h1>\n')
75 
76  # initial number of white spaces, will change to positive value once we go over the lines
77  spaces=-1
78  # list = list with directories (the line number) that contain histos
79  list=[]
80  # namelist = list with corresponding direcotory names
81  namelist=[]
82 
83  num_lists=0
84 
85  g.write('<table>\n<tr valign="top">\n<td width="500">\n')
86  for x in range(0,number):
87  sp=s[x].rsplit()
88  if sp[3]=='dir': # a directory
89  namedir=sp[0]
90  shortNameDir = namedir
91  namediri = namedir.rfind("/")
92  if( namediri != -1 ):
93  shortNameDir = namedir[namediri+1:]
94  if namedir=='<top_level>':
95  shortNameDir='Overall Status'
96  spaces_new=s[x].find(sp[0][0])
97  if spaces_new > spaces: # current dir is subdir of previous dir -> new item in new list
98  g.write('<ul>\n<li>')
99  num_lists+=1
100  elif spaces_new==spaces: # current en previous dir in same motherdir -> new item
101  g.write('</li>\n<li>')
102  else: # close list and open new one
103  g.write('</li>')
104  diff = spaces - spaces_new
105  while diff > 0:
106  g.write('</ul></li>\n')
107  diff -= 2
108  num_lists-=1
109  g.write('<li>')
110  if namedir!='<top_level>':
111  g.write('<img src="pixel.png" width="0" height="13" alt="" />')
112  if ( (x<number-1) and (s[x+1].rsplit())[3]=='ass' ): # check that dir contains histos
113  if namedir=='<top_level>':
114  namedir = '.'
115  g.write('<font class="DQGroup"><a href="'+namedir +'/toplevel.html">'+shortNameDir+ '</a></font>')
116  else:
117  g.write('<font class="DQGroup"><a href="'+namedir +'/index.html" >'+shortNameDir+ '</a></font>')
118  list.append(x)
119  namelist.append(namedir)
120  else:
121  g.write('<font class="DQGroup">'+shortNameDir+ '</font>')
122  spaces=spaces_new
123  if num_lists>0:
124  g.write('</li>')
125  for x in range(0,num_lists-1):
126  g.write('</ul></li>\n')
127  if num_lists>0:
128  g.write('</ul>\n')
129  g.write('</td>\n<td><font class="Info">From file:</font><br/><font class="Note">' + resultsFile + '</font></td>\n</tr>\n</table>')
130  g.write('</body>\n</html>')
131  g.close()
132  return list, namelist
133 
134 

◆ makeCSSFile()

def StandAloneDisplay.makeCSSFile (   htmlDir,
  name,
  subname 
)

Definition at line 231 of file StandAloneDisplay.py.

231 def makeCSSFile( htmlDir, name, subname ):
232  css=open(htmlDir+'/'+subname+'/'+name+'AutomChecks.css','w')
233  css.write('BODY\n{\n background: #E6E6FA;\n color: #000000;\n font-family: helvetica,sans-serif;\n}\n')
234  css.write('H1\n{\n font-family: helvetica,sans-serif;\n font-size: x-large;\n text-align: left;\n}\n')
235  css.write('H2\n{\n font-family: helvetica,sans-serif;\n font-size: large;\n text-align: center;\n}\n')
236  css.write('H3\n{\n font-family: helvetica,sans-serif;\n font-size: medium;\n text-align: left;\n}\n')
237  css.write('FONT.Info\n{\n color: black;\n font-style: italic;\n}\n')
238  css.write('FONT.Heading\n{\n color: black;\n font-weight: bold;\n font-size: large;\n}\n')
239  css.write('FONT.DatumName\n{\n color: black;\n font-weight: bold;\n}\n')
240  css.write('FONT.Note\n{\n color: black;\n font-size: small;\n}\n')
241  css.write('FONT.DQGroup\n{\n font-size: small;\n}\n')
242  css.write('FONT.Red\n{\n color: red;\n font-weight: bold;\n}\n')
243  css.write('FONT.Yellow\n{\n color: #ffd700;\n font-weight: bold;\n}\n')
244  css.write('FONT.Green\n{\n color: green;\n font-weight: bold;\n}\n')
245  css.write('FONT.Undef\n{\n color: gray;\n font-weight: bold;\n}\n')
246  css.write('FONT.NoCheck\n{\n color: black;\n font-weight: bold;\n}\n')
247  css.write('TD.Red\n{\n background-color: red;\n}\n')
248  css.write('TD.Yellow\n{\n background-color: #ffd700;\n}\n')
249  css.write('TD.Green\n{\n background-color: green;\n}\n')
250  css.write('TD.Undef\n{\n background-color: gray;\n}\n')
251  css.write('TD.NoCheck\n{\n background-color: #E6E6FA;\n}\n')
252  css.close()
253 
254 

◆ makeOneHistFile()

def StandAloneDisplay.makeOneHistFile (   htmlDir,
  name,
  subname,
  sp 
)

Definition at line 184 of file StandAloneDisplay.py.

184 def makeOneHistFile( htmlDir, name, subname, sp ):
185  k=open(htmlDir+'/'+subname+'/'+sp[0]+'.html','w')
186  k.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
187  k.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
188  k.write('<head>\n')
189  k.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
190  k.write('<title>'+name+ ' ' + subname+ ' ' + sp[0]+'</title>\n')
191  k.write('<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
192  k.write('</head>\n')
193  k.write('<body>\n')
194  k.write('<center>\n')
195  k.write('<table>\n<tr valign="top">\n')
196  if subname=='.':
197  k.write('<td width="250"><font class="DQGroup">[<a href="toplevel.html">Back</a></font>]</td>\n')
198  else:
199  k.write('<td width="250"><font class="DQGroup">[<a href="index.html">Back</a></font>]</td>\n')
200  k.write('<td width="500"><h2>'+name + ' ' + subname+'/'+sp[0]+'</h2></td>\n')
201  k.write('<td width="250"></td>\n</tr></table>\n')
202  k.write('<table cellpadding="10">\n<tr>\n')
203  k.write('<td>\n<table width="400">\n')
204  k.write('<tr><td colspan="2"><font class="Heading">Details:</font></td></tr>\n')
205  k.write('<tr><td>&nbsp;</td></tr>\n')
206  k.write('<tr><td align="right"><font class="DatumName">Name:</font></td>')
207  k.write('<td>' +sp[0] +'</td></tr>\n' )
208  k.write('</table>\n</td>\n')
209  if subname == '.':
210  k.write('<td><a href="toplevel.html"><img src="'+ sp[0] +'.png" alt="' + name + ' ' + subname+'/'+sp[0]+'.png" /></a></td>\n')
211  else:
212  k.write('<td><a href="index.html"><img src="'+ sp[0] +'.png" alt="' + name + ' ' + subname+'/'+sp[0]+'.png" /></a></td>\n')
213  k.write('</tr></table>\n')
214  k.write('</center>\n</body>\n</html>\n')
215  k.close()
216 
217 

◆ makeRootFile()

def StandAloneDisplay.makeRootFile (   htmlDir,
  name,
  subname 
)

Definition at line 218 of file StandAloneDisplay.py.

218 def makeRootFile( htmlDir, name, subname ):
219  k=open(htmlDir+'index.html','w')
220  k.write('<html>\n<frameset rows="200,*">\n')
221  k.write('<frame src="'+name+'AllDirs.html">\n')
222  if subname != "":
223  if subname != '.':
224  k.write('<frame src="'+subname+'/index.html" name="showframe"> \n')
225  else:
226  k.write('<frame src="'+subname+'/toplevel.html" name="showframe"> \n')
227  k.write('</frameset>\n</html> \n')
228  k.close()
229 
230 

◆ makeSubDirFile()

def StandAloneDisplay.makeSubDirFile (   htmlDir,
  name,
  s,
  number,
  subname,
  assessIndex 
)

Definition at line 135 of file StandAloneDisplay.py.

135 def makeSubDirFile( htmlDir, name, s, number, subname, assessIndex ):
136 
137  if( subname == '.' ):
138  h=open(htmlDir+'/'+subname+'/toplevel.html','w')
139  subnameTitle = 'Top Level'
140  else:
141  h=open(htmlDir+'/'+subname+'/index.html','w')
142  subnameTitle = subname
143  h.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
144  h.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n')
145  h.write('<head>\n')
146  h.write('<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />\n')
147  h.write('<title>'+ name + ' ' + subnameTitle + '</title>\n')
148  h.write('<link rel="stylesheet" href="AutomChecks.css" type="text/css" />\n')
149  h.write('</head>\n')
150  h.write('<body>\n')
151  h.write('<font class="DQGroup">[<a href="')
152  for x in range(subname.count("/")):
153  h.write('../')
154  h.write('../index.html">Back</a>]</font>\n')
155  h.write('<center>')
156  h.write('<table>\n<tr valign="top">\n<td width="250"></td>\n')
157  h.write('<td width="300"><h2>'+name+' '+subnameTitle+'</h2></td>\n')
158  h.write('<td width="250">\n<font class="Note">Click on images for details and full size.</font>\n')
159  h.write('</td>\n</tr>\n</table>\n')
160  h.write('<table cellpadding="4" cellspacing="20">\n')
161  y=assessIndex+1
162  sp=s[y].rsplit()
163  col=0
164  while(sp[3]=='ass' and y<number):
165  sp=s[y].rsplit()
166  col+=1
167  if col==1:
168  h.write('<tr>\n<td class="' + sp[1] + '"><a href="'+sp[0]+'.html"><img src="'+ sp[0] +'.png" height="200" alt="' + name + ' ' + subname+'/'+sp[0]+'.png" /></a></td>\n')
169  elif col==3:
170  h.write('<td class="' + sp[1] + '"><a href="'+sp[0]+'.html"><img src="'+ sp[0] +'.png" height="200" alt="' + name + ' ' + subname+'/'+sp[0]+'.png" /></a></td>\n</tr>\n')
171  col=0
172  else:
173  h.write('<td class="' + sp[1] + '"><a href="'+sp[0]+'.html"><img src="'+ sp[0] +'.png" height="200" alt="' + name + ' ' + subname+'/'+sp[0]+'.png" /></a></td>\n')
174  makeOneHistFile( htmlDir, name, subname, sp )
175  y=y+1
176  if y< number-1:
177  sp=s[y].rsplit()
178  if not (col==3):
179  h.write('</tr>\n')
180  h.write('</table>\n</center>\n</body>\n</html>\n')
181  h.close()
182 
183 

◆ usage()

def StandAloneDisplay.usage ( )

Definition at line 58 of file StandAloneDisplay.py.

58 def usage():
59  cmdi = sys.argv[0].rfind("/")
60  cmd = sys.argv[0][cmdi+1:]
61  print("Usage: ", cmd, "<imput_file> <html_output_directory>")
62 

Variable Documentation

◆ CWD

StandAloneDisplay.CWD = os.getcwd()

Needed to correct ROOT behavior; see below.

Definition at line 7 of file StandAloneDisplay.py.

◆ html_dir

StandAloneDisplay.html_dir = sys.argv[2]

Definition at line 267 of file StandAloneDisplay.py.

◆ name

StandAloneDisplay.name = resultsFile

Definition at line 268 of file StandAloneDisplay.py.

◆ resultsFile

StandAloneDisplay.resultsFile = sys.argv[1]

main()

Definition at line 266 of file StandAloneDisplay.py.

find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
while
while((inf=(TStreamerInfo *) nextinfo()) !=0)
Definition: liststreamerinfos.cxx:13
dqutils::HanOutputFile
Definition: HanOutputFile.h:32
StandAloneDisplay.makeAllDirsFile
def makeAllDirsFile(htmlDir, name, s, number, resultsFile)
Definition: StandAloneDisplay.py:63
StandAloneDisplay.makeSubDirFile
def makeSubDirFile(htmlDir, name, s, number, subname, assessIndex)
Definition: StandAloneDisplay.py:135
StandAloneDisplay.handi
def handi(name, resultsFile, htmlDir)
Definition: StandAloneDisplay.py:23
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
StandAloneDisplay.makeOneHistFile
def makeOneHistFile(htmlDir, name, subname, sp)
Definition: StandAloneDisplay.py:184
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
Trk::open
@ open
Definition: BinningType.h:40
StandAloneDisplay.makeRootFile
def makeRootFile(htmlDir, name, subname)
Definition: StandAloneDisplay.py:218
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:567
StandAloneDisplay.makeCSSFile
def makeCSSFile(htmlDir, name, subname)
Definition: StandAloneDisplay.py:231
StandAloneDisplay.usage
def usage()
Definition: StandAloneDisplay.py:58