CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
plotting.PlotterTableItem Class Reference

Public Member Functions

def __init__
 
def create
 

Private Attributes

 _possibleDirs
 
 _tableCreator
 

Detailed Description

Definition at line 2931 of file plotting.py.

Constructor & Destructor Documentation

def plotting.PlotterTableItem.__init__ (   self,
  possibleDirs,
  tableCreator 
)

Definition at line 2932 of file plotting.py.

2933  def __init__(self, possibleDirs, tableCreator):
2934  self._possibleDirs = possibleDirs
2935  self._tableCreator = tableCreator

Member Function Documentation

def plotting.PlotterTableItem.create (   self,
  openFiles,
  legendLabels,
  dqmSubFolder 
)

Definition at line 2936 of file plotting.py.

References plotting._getDirectory(), plotting.PlotterItem._possibleDirs, plotting.PlotterTableItem._possibleDirs, sistrip::SpyUtilities.range(), and ComparisonHelper.zip().

2937  def create(self, openFiles, legendLabels, dqmSubFolder):
2938  if isinstance(dqmSubFolder, list):
2939  if len(dqmSubFolder) != len(openFiles):
2940  raise Exception("When dqmSubFolder is a list, len(dqmSubFolder) should be len(openFiles), now they are %d and %d" % (len(dqmSubFolder), len(openFiles)))
2941  else:
2942  dqmSubFolder = [dqmSubFolder]*len(openFiles)
2943  dqmSubFolder = [sf.subfolder if sf is not None else None for sf in dqmSubFolder]
2944 
2945  tbl = []
2946  for f, sf in zip(openFiles, dqmSubFolder):
2947  data = None
2948  tdir = _getDirectory(f, self._possibleDirs, sf)
2949  if tdir is not None:
2950  data = self._tableCreator.create(tdir)
2951  tbl.append(data)
2952 
2953  # Check if we have any content
2954  allNones = True
2955  colLen = 0
2956  for col in tbl:
2957  if col is not None:
2958  allNones = False
2959  colLen = len(col)
2960  break
2961  if allNones:
2962  return None
2963 
2964  # Replace all None columns with lists of column length
2965  for i in range(len(tbl)):
2966  if tbl[i] is None:
2967  tbl[i] = [None]*colLen
2968 
2969  return html.Table(columnHeaders=legendLabels, rowHeaders=self._tableCreator.headers(), table=tbl,
2970  purpose=self._tableCreator.getPurpose(), page=self._tableCreator.getPage(), section=self._tableCreator.getSection(dqmSubFolder[0]))
const uint16_t range(const Frame &aFrame)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def _getDirectory
Definition: plotting.py:97

Member Data Documentation

plotting.PlotterTableItem._possibleDirs
private

Definition at line 2933 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

plotting.PlotterTableItem._tableCreator
private

Definition at line 2934 of file plotting.py.