test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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__
 
def addPlotSet
 
def addTable
 
def write
 

Private Member Functions

def _getPage
 
def _mapPagesName
 
def _orderPages
 

Private Attributes

 _pages
 
 _prefix
 
 _sampleName
 
 _title
 

Detailed Description

Definition at line 429 of file html.py.

Constructor & Destructor Documentation

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

Definition at line 430 of file html.py.

431  def __init__(self, title, sampleName, sample, fastVsFull):
432  self._title = title
433  self._sampleName = sampleName
434  self._pages = collections.OrderedDict()
436  self._prefix=""
437  if hasattr(sample, "hasPileup"):
438  self._prefix = "nopu"
439  if sample.hasPileup():
440  self._prefix = "pu"+sample.pileupType()
441  self._prefix += "_"
442 
443  if sample.fastsim():
444  self._prefix += "fast_"
445  if fastVsFull:
446  self._prefix += "full_"
447 
448  self._prefix += _sampleFileName.get(sample.label(), sample.label())+"_"
def __init__
Definition: html.py:430

Member Function Documentation

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

Definition at line 449 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().

450  def _getPage(self, key, pageClass):
451  if key not in self._pages:
452  page = pageClass(self._title, self._sampleName)
453  self._pages[key] = page
454  else:
455  page = self._pages[key]
456  return page
def _getPage
Definition: html.py:449
def html.PageSet._mapPagesName (   self,
  name 
)
private

Definition at line 497 of file html.py.

Referenced by html.PageSet.write().

498  def _mapPagesName(self, name):
499  return _pageNameMap.get(name, name)
def _mapPagesName
Definition: html.py:497
def html.PageSet._orderPages (   self,
  keys 
)
private

Definition at line 500 of file html.py.

Referenced by html.PageSet.write().

501  def _orderPages(self, keys):
502  return keys
503 
504 
def _orderPages
Definition: html.py:500
def html.PageSet.addPlotSet (   self,
  plotterFolder,
  dqmSubFolder,
  plotFiles 
)

Definition at line 457 of file html.py.

References html.PageSet._getPage().

458  def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles):
459  pageKey = plotterFolder.getPage()
460  if pageKey is None:
461  if dqmSubFolder is not None:
462  pageKey = dqmSubFolder.translated
463  else:
464  pageKey = plotterFolder.getName()
465 
466  page = self._getPage(pageKey, Page)
467  sectionName = plotterFolder.getSection()
468  if sectionName is None:
469  if plotterFolder.getPage() is not None and dqmSubFolder is not None:
470  sectionName = dqmSubFolder.translated
471  else:
472  sectionName = ""
473 
474  page.addPlotSet(sectionName, plotFiles)
def addPlotSet
Definition: html.py:457
def _getPage
Definition: html.py:449
def html.PageSet.addTable (   self,
  table 
)

Definition at line 475 of file html.py.

References html.PageSet._getPage().

476  def addTable(self, table):
477  if table is None:
478  return
479 
480  page = self._getPage(table.getPage(), Page)
481  page.addTable(table.getSection(), table)
def _getPage
Definition: html.py:449
def addTable
Definition: html.py:475
def html.PageSet.write (   self,
  baseDir 
)

Definition at line 482 of file html.py.

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

483  def write(self, baseDir):
484  #print "TrackingPageSet.write"
485  ret = []
486 
487  keys = self._orderPages(self._pages.keys())
488  for key in keys:
489  page = self._pages[key]
490  if page.isEmpty():
491  continue
492 
493  fileName = "%s%s.html" % (self._prefix, key)
494  page.write(os.path.join(baseDir, fileName))
495  ret.append( (self._mapPagesName(key), fileName) )
496  return ret
def _orderPages
Definition: html.py:500
def write
Definition: html.py:482
def _mapPagesName
Definition: html.py:497

Member Data Documentation

html.PageSet._pages
private

Definition at line 433 of file html.py.

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

html.PageSet._prefix
private

Definition at line 435 of file html.py.

Referenced by html.PageSet.write().

html.PageSet._sampleName
private

Definition at line 432 of file html.py.

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

html.PageSet._title
private

Definition at line 431 of file html.py.

Referenced by html.PageSet._getPage(), plotting.Subtract.create(), plotting.FakeDuplicate.create(), and plotting.Plot.create().