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 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.

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

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

Definition at line 537 of file html.py.

Referenced by html.PageSet.write().

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

Definition at line 540 of file html.py.

Referenced by html.PageSet.write().

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

Definition at line 497 of file html.py.

References html.PageSet._getPage().

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

Definition at line 515 of file html.py.

References html.PageSet._getPage().

516  def addTable(self, table):
517  if table is None:
518  return
519 
520  page = self._getPage(table.getPage(), Page)
521  page.addTable(table.getSection(), table)
def _getPage
Definition: html.py:489
def addTable
Definition: html.py:515
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.

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

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

Definition at line 470 of file html.py.

Referenced by ntuple._Object.__getattr__(), ntuple.BeamSpot.__getattr__(), ntuple._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntuple._LayerStrAdaptor.layerStr(), ntuple.TrackingParticle.matchedTrackInfos(), ntuple._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntuple._HitObject.nseeds(), ntuple._HitObject.ntracks(), ntuple._HitObject.seeds(), ntuple.TrackMatchInfo.track(), ntuple.TrackingParticleMatchInfo.trackingParticle(), ntuple.SimHit.trackingParticle(), ntuple._HitObject.tracks(), and html.PageSet.write().

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

Definition at line 466 of file html.py.

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