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, dqmSubFolderTranslatedToSectionName=None)
 
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

 _dqmSubFolderTranslatedToSectionName
 
 _pages
 
 _prefix
 
 _sampleName
 
 _title
 

Detailed Description

Definition at line 514 of file html.py.

Constructor & Destructor Documentation

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

Definition at line 515 of file html.py.

515  def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison, dqmSubFolderTranslatedToSectionName=None):
516  self._title = title
517  self._sampleName = sampleName
518  self._pages = collections.OrderedDict()
519  self._dqmSubFolderTranslatedToSectionName = dqmSubFolderTranslatedToSectionName
520 
521  self._prefix = ""
522  if sample.fastsim():
523  self._prefix += "fast_"
524  if fastVsFull:
525  self._prefix += "full_"
526 
527  self._prefix += _sampleFileName.get(sample.label(), sample.label())+"_"
528  if hasattr(sample, "hasScenario") and sample.hasScenario():
529  self._prefix += sample.scenario()+"_"
530 
531  if hasattr(sample, "hasPileup"):
532  if sample.hasPileup():
533  self._prefix += "pu"+str(sample.pileupNumber())+"_"+sample.pileupType()+"_"
534  else:
535  self._prefix += "nopu_"
536  if pileupComparison:
537  self._prefix += "vspu_"
538 
539 
_dqmSubFolderTranslatedToSectionName
Definition: html.py:519
def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison, dqmSubFolderTranslatedToSectionName=None)
Definition: html.py:515
#define str(s)

Member Function Documentation

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

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

540  def _getPage(self, key, pageClass):
541  if key not in self._pages:
542  page = pageClass(self._title, self._sampleName)
543  self._pages[key] = page
544  else:
545  page = self._pages[key]
546  return page
547 
def _getPage(self, key, pageClass)
Definition: html.py:540
def html.PageSet._mapPagesName (   self,
  name 
)
private

Definition at line 591 of file html.py.

Referenced by html.PageSet.write().

591  def _mapPagesName(self, name):
592  return _pageNameMap.get(name, name)
593 
def _mapPagesName(self, name)
Definition: html.py:591
def html.PageSet._orderPages (   self,
  keys 
)
private

Definition at line 594 of file html.py.

Referenced by html.PageSet.write().

594  def _orderPages(self, keys):
595  return keys
596 
597 
598 
def _orderPages(self, keys)
Definition: html.py:594
def html.PageSet.addPlotSet (   self,
  plotterFolder,
  dqmSubFolder,
  plotFiles 
)

Definition at line 548 of file html.py.

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

548  def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles):
549  pageKey = plotterFolder.getPage()
550  if pageKey is None:
551  if dqmSubFolder is not None:
552  pageKey = dqmSubFolder.translated
553  else:
554  pageKey = plotterFolder.getName()
555 
556  page = self._getPage(pageKey, Page)
557  sectionName = plotterFolder.getSection()
558  if sectionName is None:
559  if plotterFolder.getPage() is not None and dqmSubFolder is not None:
560  if self._dqmSubFolderTranslatedToSectionName is not None:
561  sectionName = self._dqmSubFolderTranslatedToSectionName(dqmSubFolder.translated)
562  else:
563  sectionName = dqmSubFolder.translated
564  else:
565  sectionName = ""
566 
567  page.addPlotSet(sectionName, plotFiles)
568 
_dqmSubFolderTranslatedToSectionName
Definition: html.py:519
def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles)
Definition: html.py:548
def _getPage(self, key, pageClass)
Definition: html.py:540
def html.PageSet.addTable (   self,
  table 
)

Definition at line 569 of file html.py.

References html.PageSet._getPage().

569  def addTable(self, table):
570  if table is None:
571  return
572 
573  page = self._getPage(table.getPage(), Page)
574  page.addTable(table.getSection(), table)
575 
def addTable(self, table)
Definition: html.py:569
def _getPage(self, key, pageClass)
Definition: html.py:540
def html.PageSet.write (   self,
  baseDir 
)

Definition at line 576 of file html.py.

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

576  def write(self, baseDir):
577  #print "TrackingPageSet.write"
578  ret = []
579 
580  keys = self._orderPages(self._pages.keys())
581  for key in keys:
582  page = self._pages[key]
583  if page.isEmpty():
584  continue
585 
586  fileName = "%s%s.html" % (self._prefix, key)
587  page.write(os.path.join(baseDir, fileName))
588  ret.append( (self._mapPagesName(key), fileName) )
589  return ret
590 
def _mapPagesName(self, name)
Definition: html.py:591
def _orderPages(self, keys)
Definition: html.py:594
def write(self, baseDir)
Definition: html.py:576

Member Data Documentation

html.PageSet._dqmSubFolderTranslatedToSectionName
private

Definition at line 519 of file html.py.

Referenced by html.PageSet.addPlotSet().

html.PageSet._pages
private

Definition at line 518 of file html.py.

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

html.PageSet._prefix
private

Definition at line 521 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 517 of file html.py.

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

html.PageSet._title
private