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

Constructor & Destructor Documentation

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

Definition at line 683 of file html.py.

683  def __init__(self, validationName, newBaseDir):
684  self._title = "Tracking validation "+validationName
685  self._newBaseDir = newBaseDir
686 
687  self._index = [
688  '<html>',
689  ' <head>',
690  ' <title>%s</title>' % self._title,
691  ' </head>',
692  ' <body>',
693  ]
694 
695  self._sections = collections.OrderedDict()
696 
def __init__(self, validationName, newBaseDir)
Definition: html.py:683

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 697 of file html.py.

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

Definition at line 712 of file html.py.

712  def addPlots(self, *args, **kwargs):
713  self._currentSection.addPlots(*args, **kwargs)
714 
def addPlots(self, args, kwargs)
Definition: html.py:712
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 715 of file html.py.

715  def addTable(self, *args, **kwargs):
716  self._currentSection.addTable(*args, **kwargs)
717 
def addTable(self, args, kwargs)
Definition: html.py:715
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 700 of file html.py.

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

700  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
701  # Fast vs. Full becomes just after the corresponding Fast
702  # Same for PU
703  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
704 
705  key = (sample.digest(), rightAfterRefSample)
706  if key in self._sections:
707  self._currentSection = self._sections[key]
708  else:
709  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
710  self._sections[key] = self._currentSection
711 
def beginSample(self, sample, fastVsFull=False, pileupComparison=None)
Definition: html.py:700
def html.HtmlReport.write (   self)

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

718  def write(self):
719  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
720  keys = self._sections.iterkeys()
721  newkeys = []
722  for key in keys:
723  if not key[1]:
724  newkeys.append(key)
725  continue
726  # is fast vs full
727  ind_fast = newkeys.index( (key[0], False) )
728  newkeys.insert(ind_fast+1, key)
729 
730  for key in newkeys:
731  section = self._sections[key]
732  self._index.extend(section.write(self._newBaseDir))
733 
734  self._index.extend([
735  " </body>",
736  "</html>",
737  ])
738 
739  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
740  for line in self._index:
741  f.write(line)
742  f.write("\n")
743  f.close()
744 
def write(self)
Definition: html.py:718

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 707 of file html.py.

html.HtmlReport._index
private

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