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

Constructor & Destructor Documentation

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

Definition at line 731 of file html.py.

731  def __init__(self, validationName, newBaseDir):
732  self._title = "Tracking validation "+validationName
733  self._newBaseDir = newBaseDir
734 
735  self._index = [
736  '<html>',
737  ' <head>',
738  ' <title>%s</title>' % self._title,
739  ' </head>',
740  ' <body>',
741  ]
742 
743  self._sections = collections.OrderedDict()
744 
def __init__(self, validationName, newBaseDir)
Definition: html.py:731

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 745 of file html.py.

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

Definition at line 760 of file html.py.

760  def addPlots(self, *args, **kwargs):
761  self._currentSection.addPlots(*args, **kwargs)
762 
def addPlots(self, args, kwargs)
Definition: html.py:760
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 763 of file html.py.

763  def addTable(self, *args, **kwargs):
764  self._currentSection.addTable(*args, **kwargs)
765 
def addTable(self, args, kwargs)
Definition: html.py:763
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 748 of file html.py.

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

748  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
749  # Fast vs. Full becomes just after the corresponding Fast
750  # Same for PU
751  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
752 
753  key = (sample.digest(), rightAfterRefSample)
754  if key in self._sections:
755  self._currentSection = self._sections[key]
756  else:
757  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
758  self._sections[key] = self._currentSection
759 
def beginSample(self, sample, fastVsFull=False, pileupComparison=None)
Definition: html.py:748
def html.HtmlReport.write (   self)

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

766  def write(self):
767  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
768  keys = self._sections.iterkeys()
769  newkeys = []
770  for key in keys:
771  if not key[1]:
772  newkeys.append(key)
773  continue
774  # is fast vs full
775  ind_fast = newkeys.index( (key[0], False) )
776  newkeys.insert(ind_fast+1, key)
777 
778  for key in newkeys:
779  section = self._sections[key]
780  self._index.extend(section.write(self._newBaseDir))
781 
782  self._index.extend([
783  " </body>",
784  "</html>",
785  ])
786 
787  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
788  for line in self._index:
789  f.write(line)
790  f.write("\n")
791  f.close()
792 
def write(self)
Definition: html.py:766

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 755 of file html.py.

html.HtmlReport._index
private

Definition at line 735 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.Seed.track(), 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