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

Constructor & Destructor Documentation

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

Definition at line 682 of file html.py.

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

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 696 of file html.py.

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

Definition at line 711 of file html.py.

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

Definition at line 714 of file html.py.

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

Definition at line 699 of file html.py.

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

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

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

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

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 706 of file html.py.

html.HtmlReport._index
private

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