CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
html.PageSet Class Reference
Inheritance diagram for html.PageSet:
html.TrackingPageSet

Public Member Functions

def __init__ (self, title, sampleName, sample, fastVsFull, pileupComparison)
 
def addPlotSet (self, plotterFolder, dqmSubFolder, plotFiles)
 
def addTable (self, table)
 
def write (self, baseDir)
 

Private Member Functions

def _getPage (self, key, pageClass)
 
def _mapPagesName (self, name)
 
def _orderPages (self, keys)
 

Private Attributes

 _pages
 
 _prefix
 
 _sampleName
 
 _title
 

Detailed Description

Definition at line 464 of file html.py.

Constructor & Destructor Documentation

def html.PageSet.__init__ (   self,
  title,
  sampleName,
  sample,
  fastVsFull,
  pileupComparison 
)

Definition at line 465 of file html.py.

465  def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison):
466  self._title = title
467  self._sampleName = sampleName
468  self._pages = collections.OrderedDict()
469 
470  self._prefix = ""
471  if sample.fastsim():
472  self._prefix += "fast_"
473  if fastVsFull:
474  self._prefix += "full_"
475 
476  self._prefix += _sampleFileName.get(sample.label(), sample.label())+"_"
477  if hasattr(sample, "hasScenario") and sample.hasScenario():
478  self._prefix += sample.scenario()+"_"
479 
480  if hasattr(sample, "hasPileup"):
481  if sample.hasPileup():
482  self._prefix += "pu"+str(sample.pileupNumber())+"_"+sample.pileupType()+"_"
483  else:
484  self._prefix += "nopu_"
485  if pileupComparison:
486  self._prefix += "vspu_"
487 
488 
def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison)
Definition: html.py:465

Member Function Documentation

def html.PageSet._getPage (   self,
  key,
  pageClass 
)
private

Definition at line 489 of file html.py.

References html.PageSet._pages, html.PageSet._sampleName, HistoParams< T >._title, SiStripHitEffFromCalibTree._title, HistoParams< TH2F >._title, HistoParams< TProfile2D >._title, and html.PageSet._title.

Referenced by html.PageSet.addPlotSet(), html.TrackingPageSet.addPlotSet(), and html.PageSet.addTable().

489  def _getPage(self, key, pageClass):
490  if key not in self._pages:
491  page = pageClass(self._title, self._sampleName)
492  self._pages[key] = page
493  else:
494  page = self._pages[key]
495  return page
496 
def _getPage(self, key, pageClass)
Definition: html.py:489
def html.PageSet._mapPagesName (   self,
  name 
)
private

Definition at line 537 of file html.py.

Referenced by html.PageSet.write().

537  def _mapPagesName(self, name):
538  return _pageNameMap.get(name, name)
539 
def _mapPagesName(self, name)
Definition: html.py:537
def html.PageSet._orderPages (   self,
  keys 
)
private

Definition at line 540 of file html.py.

Referenced by html.PageSet.write().

540  def _orderPages(self, keys):
541  return keys
542 
543 
544 
def _orderPages(self, keys)
Definition: html.py:540
def html.PageSet.addPlotSet (   self,
  plotterFolder,
  dqmSubFolder,
  plotFiles 
)

Definition at line 497 of file html.py.

References html.PageSet._getPage().

497  def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles):
498  pageKey = plotterFolder.getPage()
499  if pageKey is None:
500  if dqmSubFolder is not None:
501  pageKey = dqmSubFolder.translated
502  else:
503  pageKey = plotterFolder.getName()
504 
505  page = self._getPage(pageKey, Page)
506  sectionName = plotterFolder.getSection()
507  if sectionName is None:
508  if plotterFolder.getPage() is not None and dqmSubFolder is not None:
509  sectionName = dqmSubFolder.translated
510  else:
511  sectionName = ""
512 
513  page.addPlotSet(sectionName, plotFiles)
514 
def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles)
Definition: html.py:497
def _getPage(self, key, pageClass)
Definition: html.py:489
def html.PageSet.addTable (   self,
  table 
)

Definition at line 515 of file html.py.

References html.PageSet._getPage().

515  def addTable(self, table):
516  if table is None:
517  return
518 
519  page = self._getPage(table.getPage(), Page)
520  page.addTable(table.getSection(), table)
521 
def addTable(self, table)
Definition: html.py:515
def _getPage(self, key, pageClass)
Definition: html.py:489
def html.PageSet.write (   self,
  baseDir 
)

Definition at line 522 of file html.py.

References html.PageSet._mapPagesName(), html.PageSet._orderPages(), html.PageSet._pages, CommonAnalyzer._prefix, and html.PageSet._prefix.

522  def write(self, baseDir):
523  #print "TrackingPageSet.write"
524  ret = []
525 
526  keys = self._orderPages(self._pages.keys())
527  for key in keys:
528  page = self._pages[key]
529  if page.isEmpty():
530  continue
531 
532  fileName = "%s%s.html" % (self._prefix, key)
533  page.write(os.path.join(baseDir, fileName))
534  ret.append( (self._mapPagesName(key), fileName) )
535  return ret
536 
def _mapPagesName(self, name)
Definition: html.py:537
def _orderPages(self, keys)
Definition: html.py:540
def write(self, baseDir)
Definition: html.py:522

Member Data Documentation

html.PageSet._pages
private

Definition at line 468 of file html.py.

Referenced by html.PageSet._getPage(), and html.PageSet.write().

html.PageSet._prefix
private
html.PageSet._sampleName
private

Definition at line 467 of file html.py.

Referenced by html.PageSet._getPage(), and html.IndexSection.write().

html.PageSet._title
private