CMS 3D CMS Logo

Functions
createFEDtable Namespace Reference

Functions

def printHtmlTable (fedEntries)
 
def printTwikiTable (fedEntries)
 
def retrieveFedEntries (fedNumberingHeader)
 

Function Documentation

def createFEDtable.printHtmlTable (   fedEntries)

Definition at line 21 of file createFEDtable.py.

References reco.print().

Referenced by printTwikiTable().

21 def printHtmlTable(fedEntries):
22  lastId = -1
23  tableRow = "<tr style='color:%s'><td><div align='center'>%s</div></td><td><div align='center'>%s</div></td><td><div align='center'>%s</div></td></tr>"
24  print("<table width='75%' border='1' align='center'>")
25  print("<tr style='color:#FF0000'><th>Detector</th><th>Min FED id (decimal)</th><th>Max FED id (decimal)</th></tr>")
26  for item in fedEntries:
27  if lastId+1 < item[1][0]:
28  print(tableRow%('#FF0000','Free IDs',lastId+1,item[1][0]-1))
29  print(tableRow%('#000000',item[0],item[1][0],item[1][1]))
30  lastId = item[1][1]
31  print("</table>")
32 
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
def printHtmlTable(fedEntries)
def createFEDtable.printTwikiTable (   fedEntries)

Definition at line 33 of file createFEDtable.py.

References reco.print(), printHtmlTable(), and retrieveFedEntries().

33 def printTwikiTable(fedEntries):
34  lastId = -1
35  tableRow = "|%(color)s !%(label)s|%(color)s %(minId)s|%(color)s %(maxId)s|"
36  print("|*Detector*|*Min FED id (decimal)*|*Max FED id (decimal)*|")
37  for item in fedEntries:
38  if lastId+1 < item[1][0]:
39  print(tableRow%{'color':'%RED%','label':'Free IDs','minId':lastId+1,'maxId':item[1][0]-1})
40  print(tableRow%{'color':'%BLACK%','label':item[0],'minId':item[1][0],'maxId':item[1][1]})
41  lastId = item[1][1]
42 
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
def printTwikiTable(fedEntries)
def createFEDtable.retrieveFedEntries (   fedNumberingHeader)

Definition at line 6 of file createFEDtable.py.

References mps_setup.append, and createfilelist.int.

Referenced by printTwikiTable().

6 def retrieveFedEntries(fedNumberingHeader):
7  reFedEntry = re.compile('\s*(MIN|MAX)(?P<name>.*)FEDID\s*=\s*(?P<id>[0-9]+).*')
8  entries = {}
9 
10  with open(fedNumberingHeader) as fedNumbering:
11  for line in fedNumbering:
12  match = reFedEntry.match(line)
13  if match and match.group('name'):
14  try:
15  entries[match.group('name')].append(int(match.group('id')))
16  except KeyError:
17  entries[match.group('name')] = [int(match.group('id'))]
18  entries[match.group('name')].sort()
19  return sorted(entries.items(), key=lambda e: e[1][0])
20 
def retrieveFedEntries(fedNumberingHeader)