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

 _dqmSubFolderTranslatedToSectionName
 
 _pages
 
 _prefix
 
 _sampleName
 
 _title
 

Detailed Description

Definition at line 561 of file html.py.

Constructor & Destructor Documentation

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

Definition at line 562 of file html.py.

563  def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison, dqmSubFolderTranslatedToSectionName=None):
564  self._title = title
565  self._sampleName = sampleName
566  self._pages = collections.OrderedDict()
567  self._dqmSubFolderTranslatedToSectionName = dqmSubFolderTranslatedToSectionName
569  self._prefix = ""
570  if sample.fastsim():
571  self._prefix += "fast_"
572  if fastVsFull:
573  self._prefix += "full_"
574 
575  self._prefix += _sampleFileName.get(sample.label(), sample.label())+"_"
576  if hasattr(sample, "hasScenario") and sample.hasScenario():
577  self._prefix += sample.scenario()+"_"
578 
579  if hasattr(sample, "hasPileup"):
580  if sample.hasPileup():
581  self._prefix += "pu"+str(sample.pileupNumber())+"_"+sample.pileupType()+"_"
582  else:
583  self._prefix += "nopu_"
584  if pileupComparison:
585  self._prefix += "vspu_"
586 
_dqmSubFolderTranslatedToSectionName
Definition: html.py:566
def __init__
Definition: html.py:562
#define str(s)

Member Function Documentation

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

Definition at line 587 of file html.py.

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

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

588  def _getPage(self, key, pageClass):
589  if key not in self._pages:
590  page = pageClass(self._title, self._sampleName)
591  self._pages[key] = page
592  else:
593  page = self._pages[key]
594  return page
def _getPage
Definition: html.py:587
def html.PageSet._mapPagesName (   self,
  name 
)
private

Definition at line 638 of file html.py.

Referenced by html.PageSet.write().

639  def _mapPagesName(self, name):
640  return _pageNameMap.get(name, name)
def _mapPagesName
Definition: html.py:638
def html.PageSet._orderPages (   self,
  keys 
)
private

Definition at line 641 of file html.py.

Referenced by html.PageSet.write().

642  def _orderPages(self, keys):
643  return keys
644 
645 
def _orderPages
Definition: html.py:641
def html.PageSet.addPlotSet (   self,
  plotterFolder,
  dqmSubFolder,
  plotFiles 
)

Definition at line 595 of file html.py.

References html.PageSet._dqmSubFolderTranslatedToSectionName, and html.PageSet._getPage().

596  def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles):
597  pageKey = plotterFolder.getPage()
598  if pageKey is None:
599  if dqmSubFolder is not None:
600  pageKey = dqmSubFolder.translated
601  else:
602  pageKey = plotterFolder.getName()
603 
604  page = self._getPage(pageKey, Page)
605  sectionName = plotterFolder.getSection()
606  if sectionName is None:
607  if plotterFolder.getPage() is not None and dqmSubFolder is not None:
608  if self._dqmSubFolderTranslatedToSectionName is not None:
609  sectionName = self._dqmSubFolderTranslatedToSectionName(dqmSubFolder.translated)
610  else:
611  sectionName = dqmSubFolder.translated
612  else:
613  sectionName = ""
614 
615  page.addPlotSet(sectionName, plotFiles)
_dqmSubFolderTranslatedToSectionName
Definition: html.py:566
def addPlotSet
Definition: html.py:595
def _getPage
Definition: html.py:587
def html.PageSet.addTable (   self,
  table 
)

Definition at line 616 of file html.py.

References html.PageSet._getPage().

617  def addTable(self, table):
618  if table is None:
619  return
620 
621  page = self._getPage(table.getPage(), Page)
622  page.addTable(table.getSection(), table)
def _getPage
Definition: html.py:587
def addTable
Definition: html.py:616
def html.PageSet.write (   self,
  baseDir 
)

Definition at line 623 of file html.py.

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

624  def write(self, baseDir):
625  #print "TrackingPageSet.write"
626  ret = []
627 
628  keys = self._orderPages(list(self._pages.keys()))
629  for key in keys:
630  page = self._pages[key]
631  if page.isEmpty():
632  continue
633 
634  fileName = "%s%s.html" % (self._prefix, key)
635  page.write(os.path.join(baseDir, fileName))
636  ret.append( (self._mapPagesName(key), fileName) )
637  return ret
def _orderPages
Definition: html.py:641
def write
Definition: html.py:623
def _mapPagesName
Definition: html.py:638

Member Data Documentation

html.PageSet._dqmSubFolderTranslatedToSectionName
private

Definition at line 566 of file html.py.

Referenced by html.PageSet.addPlotSet().

html.PageSet._pages
private

Definition at line 565 of file html.py.

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

html.PageSet._prefix
private

Definition at line 568 of file html.py.

Referenced by ntupleDataFormat._Object.__getattr__(), ntupleDataFormat.BeamSpot.__getattr__(), ntuplePrintersDiff._IndentPrinter._indent(), ntupleDataFormat._SimHitMatchAdaptor._nMatchedSimHits(), ntupleDataFormat._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntuplePrintersDiff._RecHitPrinter._printHits(), ntuplePrintersDiff.TrackingParticlePrinter._printMatchedSeeds0(), ntuplePrintersDiff.TrackingParticlePrinter._printMatchedSeedsHeader(), ntuplePrintersDiff.TrackingParticlePrinter._printMatchedTracks(), ntuplePrintersDiff.TrackingParticlePrinter._printMatchedTracksHeader(), ntuplePrintersDiff.TrackingParticlePrinter._printTP(), ntupleDataFormat._DetIdStrAdaptor.detIdStr(), ntuplePrintersDiff.SeedPrinter.diff(), ntuplePrintersDiff.TrackPrinter.diff(), ntuplePrintersDiff._IndentPrinter.indent(), ntupleDataFormat._DetIdStrAdaptor.layerStr(), ntupleDataFormat.TrackingParticle.matchedSeedInfos(), ntupleDataFormat._SimHitMatchAdaptor.matchedSimHitInfos(), ntupleDataFormat.TrackingParticle.matchedTrackInfos(), ntupleDataFormat._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntupleDataFormat._HitObject.nseeds(), ntupleDataFormat._HitObject.ntracks(), ntuplePrintersDiff.SeedPrinter.printHeader(), ntuplePrintersDiff.TrackPrinter.printHeader(), ntuplePrintersDiff.SeedPrinter.printHits(), ntuplePrintersDiff.TrackPrinter.printHits(), ntuplePrintersDiff.TrackingParticlePrinter.printHits(), ntuplePrintersDiff.SeedPrinter.printMatchedTrackingParticles(), ntuplePrintersDiff.TrackPrinter.printMatchedTrackingParticles(), ntuplePrintersDiff.TrackingParticlePrinter.printMatchedTracks(), ntuplePrintersDiff.TrackingParticlePrinter.printTrackingParticle(), ntuplePrintersDiff._IndentPrinter.restoreIndent(), ntupleDataFormat.SeedMatchInfo.seed(), ntupleDataFormat._HitObject.seeds(), ntuplePrintersDiff._IndentPrinter.setIndentFrom(), ntupleDataFormat.SimHitMatchInfo.simHit(), ntupleDataFormat.SimHit.trackingParticle(), ntupleDataFormat._HitObject.tracks(), and html.PageSet.write().

html.PageSet._sampleName
private

Definition at line 564 of file html.py.

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

html.PageSet._title
private

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