CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
plotting.PlotterTableItem Class Reference

Public Member Functions

def __init__ (self, possibleDirs, tableCreator)
 
def create (self, openFiles, legendLabels, dqmSubFolder)
 

Private Attributes

 _possibleDirs
 
 _tableCreator
 

Detailed Description

Definition at line 2930 of file plotting.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 2931 of file plotting.py.

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

Member Function Documentation

◆ create()

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

Definition at line 2935 of file plotting.py.

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

References plotting._getDirectory(), plotting.PlotterItem._possibleDirs, plotting.PlotterTableItem._possibleDirs, plotting.PlotterTableItem._tableCreator, getRunAppsInfo.headers, FastTimerService_cff.range, and ComparisonHelper.zip().

Member Data Documentation

◆ _possibleDirs

plotting.PlotterTableItem._possibleDirs
private

Definition at line 2932 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

◆ _tableCreator

plotting.PlotterTableItem._tableCreator
private

Definition at line 2933 of file plotting.py.

Referenced by plotting.PlotterTableItem.create().

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
plotting._getDirectory
def _getDirectory(*args, **kwargs)
Definition: plotting.py:97
getRunAppsInfo.headers
headers
Definition: getRunAppsInfo.py:65
html.Table
Definition: html.py:293
Exception
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:41