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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 563 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
568 
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 
587 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)
#define str(s)

Member Function Documentation

◆ _getPage()

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

Definition at line 588 of file html.py.

References html.PageSet._pages, html.PageSet._sampleName, HistoParams< T >._title, HistoParams< TH2F >._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
595 

◆ _mapPagesName()

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

Definition at line 639 of file html.py.

Referenced by html.PageSet.write().

639  def _mapPagesName(self, name):
640  return _pageNameMap.get(name, name)
641 

◆ _orderPages()

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

Definition at line 642 of file html.py.

Referenced by html.PageSet.write().

642  def _orderPages(self, keys):
643  return keys
644 
645 
646 

◆ addPlotSet()

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

Definition at line 596 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)
616 

◆ addTable()

def html.PageSet.addTable (   self,
  table 
)

Definition at line 617 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)
623 

◆ write()

def html.PageSet.write (   self,
  baseDir 
)

Definition at line 624 of file html.py.

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

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
638 

Member Data Documentation

◆ _dqmSubFolderTranslatedToSectionName

html.PageSet._dqmSubFolderTranslatedToSectionName
private

Definition at line 567 of file html.py.

Referenced by html.PageSet.addPlotSet().

◆ _pages

html.PageSet._pages
private

Definition at line 566 of file html.py.

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

◆ _prefix

html.PageSet._prefix
private

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

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

◆ _title

html.PageSet._title
private