CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
html.HtmlReport Class Reference

Public Member Functions

def __init__
 
def addNote
 
def addPlots
 
def addTable
 
def beginSample
 
def write
 

Private Attributes

 _currentSection
 
 _index
 
 _newBaseDir
 
 _sections
 
 _title
 

Detailed Description

Definition at line 779 of file html.py.

Constructor & Destructor Documentation

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

Definition at line 780 of file html.py.

781  def __init__(self, validationName, newBaseDir):
782  self._title = "Tracking validation "+validationName
783  self._newBaseDir = newBaseDir
785  self._index = [
786  '<html>',
787  ' <head>',
788  ' <title>%s</title>' % self._title,
789  ' </head>',
790  ' <body>',
791  ]
793  self._sections = collections.OrderedDict()
def __init__
Definition: html.py:780

Member Function Documentation

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 794 of file html.py.

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

Definition at line 809 of file html.py.

810  def addPlots(self, *args, **kwargs):
811  self._currentSection.addPlots(*args, **kwargs)
def addPlots
Definition: html.py:809
def html.HtmlReport.addTable (   self,
  args,
  kwargs 
)

Definition at line 812 of file html.py.

813  def addTable(self, *args, **kwargs):
814  self._currentSection.addTable(*args, **kwargs)
def addTable
Definition: html.py:812
def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 797 of file html.py.

References html.HtmlReport._sections.

798  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
799  # Fast vs. Full becomes just after the corresponding Fast
800  # Same for PU
801  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
802 
803  key = (sample.digest(), rightAfterRefSample)
804  if key in self._sections:
805  self._currentSection = self._sections[key]
806  else:
807  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
808  self._sections[key] = self._currentSection
def beginSample
Definition: html.py:797
def html.HtmlReport.write (   self)

Definition at line 815 of file html.py.

References SeedingNode< DATA >._index, lhef::H5Handler._index, RPCMuonExtraStruct._index, python.cmstools.EventTree._index, python.cmstools.EventBranch._index, html.HtmlReport._index, html.HtmlReport._newBaseDir, and html.HtmlReport._sections.

816  def write(self):
817  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
818  keys = self._sections.keys()
819  newkeys = []
820  for key in keys:
821  if not key[1]:
822  newkeys.append(key)
823  continue
824  # is fast vs full
825  ind_fast = newkeys.index( (key[0], False) )
826  newkeys.insert(ind_fast+1, key)
827 
828  for key in newkeys:
829  section = self._sections[key]
830  self._index.extend(section.write(self._newBaseDir))
831 
832  self._index.extend([
833  " </body>",
834  "</html>",
835  ])
836 
837  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
838  for line in self._index:
839  f.write(line)
840  f.write("\n")
841  f.close()

Member Data Documentation

html.HtmlReport._currentSection
private

Definition at line 804 of file html.py.

html.HtmlReport._index
private

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

Definition at line 782 of file html.py.

Referenced by validation.Validation._doPlots(), validation.Validation._doPlotsFastFull(), validation.Validation._doPlotsPileup(), validation.Validation.createHtmlReport(), and html.HtmlReport.write().

html.HtmlReport._sections
private

Definition at line 792 of file html.py.

Referenced by html.HtmlReport.beginSample(), betterConfigParser.BetterConfigParser.items(), betterConfigParser.BetterConfigParser.write(), and html.HtmlReport.write().

html.HtmlReport._title
private

Definition at line 781 of file html.py.

Referenced by plotting.Subtract.create(), plotting.Transform.create(), plotting.FakeDuplicate.create(), plotting.CutEfficiency.create(), and plotting.Plot.create().