CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Member Functions
cmsPerfPublish.Table Class Reference
Inheritance diagram for cmsPerfPublish.Table:

Public Member Functions

def __init__ (self)
 
def __str__ (self)
 
def addRow (self, row, name)
 
def getCols (self)
 
def getTable (self, mode=0)
 
def newRow (self, name)
 
def transpose (self)
 

Public Attributes

 colNames
 
 keys
 
 rows
 

Private Member Functions

def _newCol (self, name)
 

Detailed Description

Definition at line 121 of file cmsPerfPublish.py.

Constructor & Destructor Documentation

def cmsPerfPublish.Table.__init__ (   self)

Definition at line 123 of file cmsPerfPublish.py.

123  def __init__(self):
124  self.colNames = []
125  self.keys = [None]
126  self.rows = {None: self.colNames}
127 

Member Function Documentation

def cmsPerfPublish.Table.__str__ (   self)
def cmsPerfPublish.Table._newCol (   self,
  name 
)
private

Definition at line 133 of file cmsPerfPublish.py.

References cmsPerfPublish.Table.colNames.

133  def _newCol(self,name):
134  if name in self.colNames:
135  pass
136  else:
137  self.colNames.append(name)
138 
def _newCol(self, name)
def cmsPerfPublish.Table.addRow (   self,
  row,
  name 
)

Definition at line 179 of file cmsPerfPublish.py.

References PhysicsTools::Calibration::Matrix.rows, ProcMatrix::Matrix.rows, and cmsPerfPublish.Table.rows.

179  def addRow(self,row,name):
180  if name in self.rows.keys():
181  pass
182  else:
183  self.keys.append(name)
184  self.rows[name] = row
185 
def addRow(self, row, name)
def cmsPerfPublish.Table.getCols (   self)

Definition at line 139 of file cmsPerfPublish.py.

References cmsPerfPublish.Table.colNames.

139  def getCols(self):
140  return self.colNames
141 
def cmsPerfPublish.Table.getTable (   self,
  mode = 0 
)

Definition at line 151 of file cmsPerfPublish.py.

References cmsPerfPublish.Table.colNames, MagFieldConfig.keys, cmsPerfPublish.Table.keys, PhysicsTools::Calibration::Matrix.rows, ProcMatrix::Matrix.rows, and cmsPerfPublish.Table.rows.

151  def getTable(self,mode=0):
152  name = "Total"
153 
154  for key in self.keys:
155  if key == None:
156  pass
157  else:
158  total1 = 0
159  total2 = 0
160  rowobj = self.rows[key]
161  rowdict = rowobj.getRowDict()
162  for col in self.colNames:
163  if col == None:
164  pass
165  elif col in rowdict and not col == name:
166  if mode == 1:
167  total1 += rowdict[col]
168  else:
169  (step_tot1, step_tot2) = rowdict[col]
170  total1 += step_tot1
171  total2 += step_tot2
172  if mode == 1:
173  rowobj.addEntry(name,total1)
174  else:
175  rowobj.addEntry(name,(total1,total2))
176 
177  return (self.keys, self.rows)
178 
def getTable(self, mode=0)
def cmsPerfPublish.Table.newRow (   self,
  name 
)

Definition at line 142 of file cmsPerfPublish.py.

References PhysicsTools::Calibration::Matrix.rows, ProcMatrix::Matrix.rows, and cmsPerfPublish.Table.rows.

142  def newRow(self,name):
143  if name in self.rows.keys():
144  pass
145  else:
146  self.keys.append(name)
147  self.rows[name] = Row(self)
148 
149  return self.rows[name]
150 
def newRow(self, name)
def cmsPerfPublish.Table.transpose (   self)

Definition at line 186 of file cmsPerfPublish.py.

References MagFieldConfig.keys, cmsPerfPublish.Table.keys, PhysicsTools::Calibration::Matrix.rows, ProcMatrix::Matrix.rows, and cmsPerfPublish.Table.rows.

186  def transpose(self):
187  transp = Table()
188  for col in self.colnames:
189  rowobj = transp.newRow(col)
190  for key in self.keys:
191  if key == None:
192  pass
193  else:
194  row_dict = self.rows[key].getRowDict()
195  if key in row_dict:
196  rowobj.addEntry(key,row_dict[col])
197  return transp
198 

Member Data Documentation

cmsPerfPublish.Table.colNames
cmsPerfPublish.Table.keys
cmsPerfPublish.Table.rows