CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
html.HtmlReport Class Reference

Public Member Functions

def __init__
 
def addNote
 
def addPlots
 
def addTable
 
def beginSample
 
def write
 

Private Attributes

 _currentSection
 
 _index
 
 _newBaseDir
 
 _sections
 
 _title
 

Detailed Description

Definition at line 672 of file html.py.

Constructor & Destructor Documentation

def html.HtmlReport.__init__ (   self,
  validationName,
  newBaseDir 
)

Definition at line 673 of file html.py.

674  def __init__(self, validationName, newBaseDir):
675  self._title = "Tracking validation "+validationName
676  self._newBaseDir = newBaseDir
678  self._index = [
679  '<html>',
680  ' <head>',
681  ' <title>%s</title>' % self._title,
682  ' </head>',
683  ' <body>',
684  ]
686  self._sections = collections.OrderedDict()
def __init__
Definition: html.py:673

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 687 of file html.py.

688  def addNote(self, note):
689  self._index.append(' <p>%s</p>'%note)
def addNote
Definition: html.py:687
def html.HtmlReport.addPlots (   self,
  args,
  kwargs 
)

Definition at line 702 of file html.py.

703  def addPlots(self, *args, **kwargs):
704  self._currentSection.addPlots(*args, **kwargs)
def addPlots
Definition: html.py:702
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 705 of file html.py.

706  def addTable(self, *args, **kwargs):
707  self._currentSection.addTable(*args, **kwargs)
def addTable
Definition: html.py:705
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 690 of file html.py.

References Vispa.Main.SplitterTab.SplitterToolBar._sections, and html.HtmlReport._sections.

691  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
692  # Fast vs. Full becomes just after the corresponding Fast
693  # Same for PU
694  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
695 
696  key = (sample.digest(), rightAfterRefSample)
697  if key in self._sections:
698  self._currentSection = self._sections[key]
699  else:
700  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
701  self._sections[key] = self._currentSection
def beginSample
Definition: html.py:690
def html.HtmlReport.write (   self)

Definition at line 708 of file html.py.

References SeedingNode< DATA >._index, Vispa.Share.FindAlgorithm.FindAlgorithm._index, RPCMuonExtraStruct._index, python.cmstools.EventTree._index, python.cmstools.EventBranch._index, html.HtmlReport._index, html.HtmlReport._newBaseDir, Vispa.Main.SplitterTab.SplitterToolBar._sections, and html.HtmlReport._sections.

709  def write(self):
710  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
711  keys = self._sections.iterkeys()
712  newkeys = []
713  for key in keys:
714  if not key[1]:
715  newkeys.append(key)
716  continue
717  # is fast vs full
718  ind_fast = newkeys.index( (key[0], False) )
719  newkeys.insert(ind_fast+1, key)
720 
721  for key in newkeys:
722  section = self._sections[key]
723  self._index.extend(section.write(self._newBaseDir))
724 
725  self._index.extend([
726  " </body>",
727  "</html>",
728  ])
729 
730  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
731  for line in self._index:
732  f.write(line)
733  f.write("\n")
734  f.close()

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 697 of file html.py.

html.HtmlReport._index
private

Definition at line 677 of file html.py.

Referenced by ntuple._Object.__getattr__(), ntuple._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntuple.TrackingParticle._nMatchedTracks(), ntuple.TrackingVertex.daughterTrackingParticles(), ntuple.TrackingParticle.decayVertices(), ntuple._Object.index(), ntuple.Seed.indexWithinAlgo(), ntuple._Object.isValid(), ntuple._LayerStrAdaptor.layerStr(), ntuple.InvalidHit.layerStr(), ntuple.TrackingParticle.matchedTrackInfos(), ntuple._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntuple.GluedHit.monoHit(), ntuple.TrackingVertex.nDaughterTrackingParticles(), ntuple.SimHit.nRecHits(), ntuple._HitObject.nseeds(), ntuple.GluedHit.nseeds(), ntuple.TrackingVertex.nSourceTrackingParticles(), ntuple._HitObject.ntracks(), ntuple.Vertex.nTracks(), ntuple.TrackingParticle.parentVertex(), ntuple.Track.seed(), ntuple._HitObject.seeds(), ntuple.GluedHit.seeds(), ntuple.TrackingVertex.sourceTrackingParticles(), ntuple.GluedHit.stereoHit(), ntuple.TrackMatchInfo.track(), ntuple.Seed.track(), ntuple.TrackingParticleMatchInfo.trackingParticle(), ntuple.SimHit.trackingParticle(), ntuple._HitObject.tracks(), ntuple.Vertex.tracks(), ntuple.Track.vertex(), and html.HtmlReport.write().

html.HtmlReport._newBaseDir
private

Definition at line 675 of file html.py.

Referenced by validation.Validation._doPlots(), validation.Validation._doPlotsFastFull(), validation.Validation._doPlotsPileup(), validation.Validation.createHtmlReport(), and html.HtmlReport.write().

html.HtmlReport._sections
private

Definition at line 685 of file html.py.

Referenced by html.HtmlReport.beginSample(), betterConfigParser.BetterConfigParser.items(), betterConfigParser.BetterConfigParser.write(), and html.HtmlReport.write().

html.HtmlReport._title
private

Definition at line 674 of file html.py.

Referenced by plotting.Subtract.create(), plotting.Transform.create(), plotting.FakeDuplicate.create(), plotting.CutEfficiency.create(), and plotting.Plot.create().