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

Constructor & Destructor Documentation

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

Definition at line 724 of file html.py.

724  def __init__(self, validationName, newBaseDir):
725  self._title = "Tracking validation "+validationName
726  self._newBaseDir = newBaseDir
727 
728  self._index = [
729  '<html>',
730  ' <head>',
731  ' <title>%s</title>' % self._title,
732  ' </head>',
733  ' <body>',
734  ]
735 
736  self._sections = collections.OrderedDict()
737 
def __init__(self, validationName, newBaseDir)
Definition: html.py:724

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 738 of file html.py.

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

Definition at line 753 of file html.py.

753  def addPlots(self, *args, **kwargs):
754  self._currentSection.addPlots(*args, **kwargs)
755 
def addPlots(self, args, kwargs)
Definition: html.py:753
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 756 of file html.py.

756  def addTable(self, *args, **kwargs):
757  self._currentSection.addTable(*args, **kwargs)
758 
def addTable(self, args, kwargs)
Definition: html.py:756
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 741 of file html.py.

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

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

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

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

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 748 of file html.py.

html.HtmlReport._index
private

Definition at line 728 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