CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
html.HtmlReport Class Reference

Public Member Functions

def __init__ (self, validationName, newBaseDir)
 
def addNote (self, note)
 
def addPlots (self, args, kwargs)
 
def addTable (self, args, kwargs)
 
def beginSample (self, sample, fastVsFull=False, pileupComparison=None)
 
def write (self)
 

Private Attributes

 _currentSection
 
 _index
 
 _newBaseDir
 
 _sections
 
 _title
 

Detailed Description

Definition at line 717 of file html.py.

Constructor & Destructor Documentation

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

Definition at line 718 of file html.py.

718  def __init__(self, validationName, newBaseDir):
719  self._title = "Tracking validation "+validationName
720  self._newBaseDir = newBaseDir
721 
722  self._index = [
723  '<html>',
724  ' <head>',
725  ' <title>%s</title>' % self._title,
726  ' </head>',
727  ' <body>',
728  ]
729 
730  self._sections = collections.OrderedDict()
731 
def __init__(self, validationName, newBaseDir)
Definition: html.py:718

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 732 of file html.py.

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

Definition at line 747 of file html.py.

747  def addPlots(self, *args, **kwargs):
748  self._currentSection.addPlots(*args, **kwargs)
749 
def addPlots(self, args, kwargs)
Definition: html.py:747
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 750 of file html.py.

750  def addTable(self, *args, **kwargs):
751  self._currentSection.addTable(*args, **kwargs)
752 
def addTable(self, args, kwargs)
Definition: html.py:750
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 735 of file html.py.

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

735  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
736  # Fast vs. Full becomes just after the corresponding Fast
737  # Same for PU
738  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
739 
740  key = (sample.digest(), rightAfterRefSample)
741  if key in self._sections:
742  self._currentSection = self._sections[key]
743  else:
744  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
745  self._sections[key] = self._currentSection
746 
def beginSample(self, sample, fastVsFull=False, pileupComparison=None)
Definition: html.py:735
def html.HtmlReport.write (   self)

Definition at line 753 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.

753  def write(self):
754  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
755  keys = self._sections.iterkeys()
756  newkeys = []
757  for key in keys:
758  if not key[1]:
759  newkeys.append(key)
760  continue
761  # is fast vs full
762  ind_fast = newkeys.index( (key[0], False) )
763  newkeys.insert(ind_fast+1, key)
764 
765  for key in newkeys:
766  section = self._sections[key]
767  self._index.extend(section.write(self._newBaseDir))
768 
769  self._index.extend([
770  " </body>",
771  "</html>",
772  ])
773 
774  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
775  for line in self._index:
776  f.write(line)
777  f.write("\n")
778  f.close()
779 
def write(self)
Definition: html.py:753

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 742 of file html.py.

html.HtmlReport._index
private

Definition at line 722 of file html.py.

Referenced by ntupleDataFormat._Object.__getattr__(), ntupleDataFormat.TrackingParticle._nMatchedSeeds(), ntupleDataFormat._SimHitMatchAdaptor._nMatchedSimHits(), ntupleDataFormat._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntupleDataFormat.TrackingParticle._nMatchedTracks(), ntupleDataFormat.TrackingVertex.daughterTrackingParticles(), ntupleDataFormat.TrackingParticle.decayVertices(), ntupleDataFormat._DetIdStrAdaptor.detIdStr(), ntupleDataFormat._Object.index(), ntupleDataFormat.Seed.indexWithinAlgo(), ntupleDataFormat._Object.isValid(), ntupleDataFormat._DetIdStrAdaptor.layerStr(), ntupleDataFormat.InvalidHit.layerStr(), ntupleDataFormat.TrackingParticle.matchedSeedInfos(), ntupleDataFormat._SimHitMatchAdaptor.matchedSimHitInfos(), ntupleDataFormat.TrackingParticle.matchedTrackInfos(), ntupleDataFormat._TrackingParticleMatchAdaptor.matchedTrackingParticleInfos(), ntupleDataFormat.GluedHit.monoHit(), ntupleDataFormat.TrackingVertex.nDaughterTrackingParticles(), ntupleDataFormat.SimHit.nRecHits(), ntupleDataFormat._HitObject.nseeds(), ntupleDataFormat.GluedHit.nseeds(), ntupleDataFormat.TrackingVertex.nSourceTrackingParticles(), ntupleDataFormat._HitObject.ntracks(), ntupleDataFormat.Vertex.nTracks(), ntupleDataFormat.TrackingParticle.parentVertex(), ntupleDataFormat.SeedMatchInfo.seed(), ntupleDataFormat.Track.seed(), ntupleDataFormat._HitObject.seeds(), ntupleDataFormat.GluedHit.seeds(), ntupleDataFormat.SimHitMatchInfo.simHit(), ntupleDataFormat.TrackingVertex.sourceTrackingParticles(), ntupleDataFormat.GluedHit.stereoHit(), ntupleDataFormat.TrackMatchInfo.track(), ntupleDataFormat.Seed.track(), ntupleDataFormat.TrackingParticleMatchInfo.trackingParticle(), ntupleDataFormat.SimHit.trackingParticle(), ntupleDataFormat._HitObject.tracks(), ntupleDataFormat.Vertex.tracks(), ntupleDataFormat.Track.vertex(), and html.HtmlReport.write().

html.HtmlReport._newBaseDir
private
html.HtmlReport._sections
private
html.HtmlReport._title
private