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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 562 of file html.py.

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

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

◆ _mapPagesName()

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

Definition at line 638 of file html.py.

Referenced by html.PageSet.write().

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

◆ _orderPages()

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

Definition at line 641 of file html.py.

Referenced by html.PageSet.write().

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

◆ addPlotSet()

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

Definition at line 595 of file html.py.

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

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

◆ addTable()

def html.PageSet.addTable (   self,
  table 
)

Definition at line 616 of file html.py.

References html.PageSet._getPage().

616  def addTable(self, table):
617  if table is None:
618  return
619 
620  page = self._getPage(table.getPage(), Page)
621  page.addTable(table.getSection(), table)
622 

◆ write()

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, datamodel.Object._prefix, datamodel.Collection._prefix, html.PageSet._prefix, and relativeConstraints.keys.

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

Member Data Documentation

◆ _dqmSubFolderTranslatedToSectionName

html.PageSet._dqmSubFolderTranslatedToSectionName
private

Definition at line 566 of file html.py.

Referenced by html.PageSet.addPlotSet().

◆ _pages

html.PageSet._pages
private

Definition at line 565 of file html.py.

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

◆ _prefix

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

◆ _sampleName

html.PageSet._sampleName
private

Definition at line 564 of file html.py.

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

◆ _title

html.PageSet._title
private