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

Constructor & Destructor Documentation

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

Definition at line 725 of file html.py.

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

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 739 of file html.py.

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

Definition at line 754 of file html.py.

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

Definition at line 757 of file html.py.

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

Definition at line 742 of file html.py.

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

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

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

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

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 749 of file html.py.

html.HtmlReport._index
private

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