CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
createFEDtable Namespace Reference

Functions

def printHtmlTable
 
def printTwikiTable
 
def retrieveFedEntries
 

Variables

tuple fedEntries = retrieveFedEntries(os.environ['CMSSW_BASE']+'/src/DataFormats/FEDRawData/interface/FEDNumbering.h')
 

Function Documentation

def createFEDtable.printHtmlTable (   fedEntries)

Definition at line 21 of file createFEDtable.py.

References print().

21 
22 def printHtmlTable(fedEntries):
23  lastId = -1
24  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>"
25  print("<table width='75%' border='1' align='center'>")
26  print("<tr style='color:#FF0000'><th>Detector</th><th>Min FED id (decimal)</th><th>Max FED id (decimal)</th></tr>")
27  for item in fedEntries:
28  if lastId+1 < item[1][0]:
29  print(tableRow%('#FF0000','Free IDs',lastId+1,item[1][0]-1))
30  print(tableRow%('#000000',item[0],item[1][0],item[1][1]))
31  lastId = item[1][1]
32  print("</table>")
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def createFEDtable.printTwikiTable (   fedEntries)

Definition at line 33 of file createFEDtable.py.

References print().

33 
34 def printTwikiTable(fedEntries):
35  lastId = -1
36  tableRow = "|%(color)s !%(label)s|%(color)s %(minId)s|%(color)s %(maxId)s|"
37  print("|*Detector*|*Min FED id (decimal)*|*Max FED id (decimal)*|")
38  for item in fedEntries:
39  if lastId+1 < item[1][0]:
40  print(tableRow%{'color':'%RED%','label':'Free IDs','minId':lastId+1,'maxId':item[1][0]-1})
41  print(tableRow%{'color':'%BLACK%','label':item[0],'minId':item[1][0],'maxId':item[1][1]})
42  lastId = item[1][1]
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def createFEDtable.retrieveFedEntries (   fedNumberingHeader)

Definition at line 6 of file createFEDtable.py.

References bitset_utilities.append().

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

Variable Documentation

tuple createFEDtable.fedEntries = retrieveFedEntries(os.environ['CMSSW_BASE']+'/src/DataFormats/FEDRawData/interface/FEDNumbering.h')

Definition at line 44 of file createFEDtable.py.