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 503 of file html.py.

Constructor & Destructor Documentation

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

Definition at line 504 of file html.py.

504  def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison, dqmSubFolderTranslatedToSectionName=None):
505  self._title = title
506  self._sampleName = sampleName
507  self._pages = collections.OrderedDict()
508  self._dqmSubFolderTranslatedToSectionName = dqmSubFolderTranslatedToSectionName
509 
510  self._prefix = ""
511  if sample.fastsim():
512  self._prefix += "fast_"
513  if fastVsFull:
514  self._prefix += "full_"
515 
516  self._prefix += _sampleFileName.get(sample.label(), sample.label())+"_"
517  if hasattr(sample, "hasScenario") and sample.hasScenario():
518  self._prefix += sample.scenario()+"_"
519 
520  if hasattr(sample, "hasPileup"):
521  if sample.hasPileup():
522  self._prefix += "pu"+str(sample.pileupNumber())+"_"+sample.pileupType()+"_"
523  else:
524  self._prefix += "nopu_"
525  if pileupComparison:
526  self._prefix += "vspu_"
527 
528 
_dqmSubFolderTranslatedToSectionName
Definition: html.py:508
def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison, dqmSubFolderTranslatedToSectionName=None)
Definition: html.py:504

Member Function Documentation

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

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

529  def _getPage(self, key, pageClass):
530  if key not in self._pages:
531  page = pageClass(self._title, self._sampleName)
532  self._pages[key] = page
533  else:
534  page = self._pages[key]
535  return page
536 
def _getPage(self, key, pageClass)
Definition: html.py:529
def html.PageSet._mapPagesName (   self,
  name 
)
private

Definition at line 580 of file html.py.

Referenced by html.PageSet.write().

580  def _mapPagesName(self, name):
581  return _pageNameMap.get(name, name)
582 
def _mapPagesName(self, name)
Definition: html.py:580
def html.PageSet._orderPages (   self,
  keys 
)
private

Definition at line 583 of file html.py.

Referenced by html.PageSet.write().

583  def _orderPages(self, keys):
584  return keys
585 
586 
587 
def _orderPages(self, keys)
Definition: html.py:583
def html.PageSet.addPlotSet (   self,
  plotterFolder,
  dqmSubFolder,
  plotFiles 
)

Definition at line 537 of file html.py.

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

537  def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles):
538  pageKey = plotterFolder.getPage()
539  if pageKey is None:
540  if dqmSubFolder is not None:
541  pageKey = dqmSubFolder.translated
542  else:
543  pageKey = plotterFolder.getName()
544 
545  page = self._getPage(pageKey, Page)
546  sectionName = plotterFolder.getSection()
547  if sectionName is None:
548  if plotterFolder.getPage() is not None and dqmSubFolder is not None:
549  if self._dqmSubFolderTranslatedToSectionName is not None:
550  sectionName = self._dqmSubFolderTranslatedToSectionName(dqmSubFolder.translated)
551  else:
552  sectionName = dqmSubFolder.translated
553  else:
554  sectionName = ""
555 
556  page.addPlotSet(sectionName, plotFiles)
557 
_dqmSubFolderTranslatedToSectionName
Definition: html.py:508
def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles)
Definition: html.py:537
def _getPage(self, key, pageClass)
Definition: html.py:529
def html.PageSet.addTable (   self,
  table 
)

Definition at line 558 of file html.py.

References html.PageSet._getPage().

558  def addTable(self, table):
559  if table is None:
560  return
561 
562  page = self._getPage(table.getPage(), Page)
563  page.addTable(table.getSection(), table)
564 
def addTable(self, table)
Definition: html.py:558
def _getPage(self, key, pageClass)
Definition: html.py:529
def html.PageSet.write (   self,
  baseDir 
)

Definition at line 565 of file html.py.

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

565  def write(self, baseDir):
566  #print "TrackingPageSet.write"
567  ret = []
568 
569  keys = self._orderPages(self._pages.keys())
570  for key in keys:
571  page = self._pages[key]
572  if page.isEmpty():
573  continue
574 
575  fileName = "%s%s.html" % (self._prefix, key)
576  page.write(os.path.join(baseDir, fileName))
577  ret.append( (self._mapPagesName(key), fileName) )
578  return ret
579 
def _mapPagesName(self, name)
Definition: html.py:580
def _orderPages(self, keys)
Definition: html.py:583
def write(self, baseDir)
Definition: html.py:565

Member Data Documentation

html.PageSet._dqmSubFolderTranslatedToSectionName
private

Definition at line 508 of file html.py.

Referenced by html.PageSet.addPlotSet().

html.PageSet._pages
private

Definition at line 507 of file html.py.

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

html.PageSet._prefix
private

Definition at line 510 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.TrackMatchInfo.track(), ntupleDataFormat.TrackingParticleMatchInfo.trackingParticle(), ntupleDataFormat.SimHit.trackingParticle(), ntupleDataFormat._HitObject.tracks(), and html.PageSet.write().

html.PageSet._sampleName
private

Definition at line 506 of file html.py.

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

html.PageSet._title
private