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

Constructor & Destructor Documentation

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

Definition at line 673 of file html.py.

673  def __init__(self, validationName, newBaseDir):
674  self._title = "Tracking validation "+validationName
675  self._newBaseDir = newBaseDir
676 
677  self._index = [
678  '<html>',
679  ' <head>',
680  ' <title>%s</title>' % self._title,
681  ' </head>',
682  ' <body>',
683  ]
684 
685  self._sections = collections.OrderedDict()
686 
def __init__(self, validationName, newBaseDir)
Definition: html.py:673

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 687 of file html.py.

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

Definition at line 702 of file html.py.

702  def addPlots(self, *args, **kwargs):
703  self._currentSection.addPlots(*args, **kwargs)
704 
def addPlots(self, args, kwargs)
Definition: html.py:702
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 705 of file html.py.

705  def addTable(self, *args, **kwargs):
706  self._currentSection.addTable(*args, **kwargs)
707 
def addTable(self, args, kwargs)
Definition: html.py:705
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 690 of file html.py.

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

690  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
691  # Fast vs. Full becomes just after the corresponding Fast
692  # Same for PU
693  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
694 
695  key = (sample.digest(), rightAfterRefSample)
696  if key in self._sections:
697  self._currentSection = self._sections[key]
698  else:
699  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
700  self._sections[key] = self._currentSection
701 
def beginSample(self, sample, fastVsFull=False, pileupComparison=None)
Definition: html.py:690
def html.HtmlReport.write (   self)

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

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

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 697 of file html.py.

html.HtmlReport._index
private
html.HtmlReport._newBaseDir
private
html.HtmlReport._sections
private
html.HtmlReport._title
private