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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 522 of file html.py.

522  def __init__(self, title, sampleName, sample, fastVsFull, pileupComparison, dqmSubFolderTranslatedToSectionName=None):
523  self._title = title
524  self._sampleName = sampleName
525  self._pages = collections.OrderedDict()
526  self._dqmSubFolderTranslatedToSectionName = dqmSubFolderTranslatedToSectionName
527 
528  self._prefix = ""
529  if sample.fastsim():
530  self._prefix += "fast_"
531  if fastVsFull:
532  self._prefix += "full_"
533 
534  self._prefix += _sampleFileName.get(sample.label(), sample.label())+"_"
535  if hasattr(sample, "hasScenario") and sample.hasScenario():
536  self._prefix += sample.scenario()+"_"
537 
538  if hasattr(sample, "hasPileup"):
539  if sample.hasPileup():
540  self._prefix += "pu"+str(sample.pileupNumber())+"_"+sample.pileupType()+"_"
541  else:
542  self._prefix += "nopu_"
543  if pileupComparison:
544  self._prefix += "vspu_"
545 
546 

Member Function Documentation

◆ _getPage()

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

Definition at line 547 of file html.py.

547  def _getPage(self, key, pageClass):
548  if key not in self._pages:
549  page = pageClass(self._title, self._sampleName)
550  self._pages[key] = page
551  else:
552  page = self._pages[key]
553  return page
554 

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

◆ _mapPagesName()

def html.PageSet._mapPagesName (   self,
  name 
)
private

Reimplemented in html.TrackingPageSet.

Definition at line 598 of file html.py.

598  def _mapPagesName(self, name):
599  return _pageNameMap.get(name, name)
600 

Referenced by html.PageSet.write().

◆ _orderPages()

def html.PageSet._orderPages (   self,
  keys 
)
private

Reimplemented in html.TrackingPageSet.

Definition at line 601 of file html.py.

601  def _orderPages(self, keys):
602  return keys
603 
604 
605 

Referenced by html.PageSet.write().

◆ addPlotSet()

def html.PageSet.addPlotSet (   self,
  plotterFolder,
  dqmSubFolder,
  plotFiles 
)

Reimplemented in html.TrackingPageSet.

Definition at line 555 of file html.py.

555  def addPlotSet(self, plotterFolder, dqmSubFolder, plotFiles):
556  pageKey = plotterFolder.getPage()
557  if pageKey is None:
558  if dqmSubFolder is not None:
559  pageKey = dqmSubFolder.translated
560  else:
561  pageKey = plotterFolder.getName()
562 
563  page = self._getPage(pageKey, Page)
564  sectionName = plotterFolder.getSection()
565  if sectionName is None:
566  if plotterFolder.getPage() is not None and dqmSubFolder is not None:
567  if self._dqmSubFolderTranslatedToSectionName is not None:
568  sectionName = self._dqmSubFolderTranslatedToSectionName(dqmSubFolder.translated)
569  else:
570  sectionName = dqmSubFolder.translated
571  else:
572  sectionName = ""
573 
574  page.addPlotSet(sectionName, plotFiles)
575 

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

◆ addTable()

def html.PageSet.addTable (   self,
  table 
)

Definition at line 576 of file html.py.

576  def addTable(self, table):
577  if table is None:
578  return
579 
580  page = self._getPage(table.getPage(), Page)
581  page.addTable(table.getSection(), table)
582 

References html.PageSet._getPage().

◆ write()

def html.PageSet.write (   self,
  baseDir 
)

Definition at line 583 of file html.py.

583  def write(self, baseDir):
584  #print "TrackingPageSet.write"
585  ret = []
586 
587  keys = self._orderPages(self._pages.keys())
588  for key in keys:
589  page = self._pages[key]
590  if page.isEmpty():
591  continue
592 
593  fileName = "%s%s.html" % (self._prefix, key)
594  page.write(os.path.join(baseDir, fileName))
595  ret.append( (self._mapPagesName(key), fileName) )
596  return ret
597 

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

Member Data Documentation

◆ _dqmSubFolderTranslatedToSectionName

html.PageSet._dqmSubFolderTranslatedToSectionName
private

Definition at line 526 of file html.py.

Referenced by html.PageSet.addPlotSet().

◆ _pages

html.PageSet._pages
private

Definition at line 525 of file html.py.

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

◆ _prefix

html.PageSet._prefix
private

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

◆ _sampleName

html.PageSet._sampleName
private

Definition at line 524 of file html.py.

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

◆ _title

html.PageSet._title
private
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
str
#define str(s)
Definition: TestProcessor.cc:51
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48