CMS 3D CMS Logo

Functions | Variables
createFEDtable Namespace Reference

Functions

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

Variables

 fedEntries
 

Function Documentation

◆ printHtmlTable()

def createFEDtable.printHtmlTable (   fedEntries)

Definition at line 21 of file createFEDtable.py.

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 

References print().

◆ printTwikiTable()

def createFEDtable.printTwikiTable (   fedEntries)

Definition at line 33 of file createFEDtable.py.

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 

References print().

◆ retrieveFedEntries()

def createFEDtable.retrieveFedEntries (   fedNumberingHeader)

Definition at line 6 of file createFEDtable.py.

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 

References mps_setup.append, and createfilelist.int.

Variable Documentation

◆ fedEntries

createFEDtable.fedEntries

Definition at line 44 of file createFEDtable.py.

createFEDtable.retrieveFedEntries
def retrieveFedEntries(fedNumberingHeader)
Definition: createFEDtable.py:6
createFEDtable.printTwikiTable
def printTwikiTable(fedEntries)
Definition: createFEDtable.py:33
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
mps_setup.append
append
Definition: mps_setup.py:85
createfilelist.int
int
Definition: createfilelist.py:10
createFEDtable.printHtmlTable
def printHtmlTable(fedEntries)
Definition: createFEDtable.py:21