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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 740 of file html.py.

740  def __init__(self, validationName, newBaseDir):
741  self._title = "Tracking validation "+validationName
742  self._newBaseDir = newBaseDir
743 
744  self._index = [
745  '<html>',
746  ' <head>',
747  ' <title>%s</title>' % self._title,
748  ' </head>',
749  ' <body>',
750  ]
751 
752  self._sections = collections.OrderedDict()
753 

Member Function Documentation

◆ addNote()

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 754 of file html.py.

754  def addNote(self, note):
755  self._index.append(' <p>%s</p>'%note)
756 

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

◆ addPlots()

def html.HtmlReport.addPlots (   self,
args,
**  kwargs 
)

Definition at line 769 of file html.py.

769  def addPlots(self, *args, **kwargs):
770  self._currentSection.addPlots(*args, **kwargs)
771 

References html.HtmlReport._currentSection.

◆ addTable()

def html.HtmlReport.addTable (   self,
args,
**  kwargs 
)

Definition at line 772 of file html.py.

772  def addTable(self, *args, **kwargs):
773  self._currentSection.addTable(*args, **kwargs)
774 

References html.HtmlReport._currentSection.

◆ beginSample()

def html.HtmlReport.beginSample (   self,
  sample,
  fastVsFull = False,
  pileupComparison = None 
)

Definition at line 757 of file html.py.

757  def beginSample(self, sample, fastVsFull=False, pileupComparison=None):
758  # Fast vs. Full becomes just after the corresponding Fast
759  # Same for PU
760  rightAfterRefSample = fastVsFull or (pileupComparison is not None)
761 
762  key = (sample.digest(), rightAfterRefSample)
763  if key in self._sections:
764  self._currentSection = self._sections[key]
765  else:
766  self._currentSection = IndexSection(sample, self._title, fastVsFull, pileupComparison)
767  self._sections[key] = self._currentSection
768 

References html.HtmlReport._sections.

◆ write()

def html.HtmlReport.write (   self)

Definition at line 775 of file html.py.

775  def write(self):
776  # Reorder sections such that Fast vs. Full becomes just after the corresponding Fast
777  keys = self._sections.iterkeys()
778  newkeys = []
779  for key in keys:
780  if not key[1]:
781  newkeys.append(key)
782  continue
783  # is fast vs full
784  ind_fast = newkeys.index( (key[0], False) )
785  newkeys.insert(ind_fast+1, key)
786 
787  for key in newkeys:
788  section = self._sections[key]
789  self._index.extend(section.write(self._newBaseDir))
790 
791  self._index.extend([
792  " </body>",
793  "</html>",
794  ])
795 
796  f = open(os.path.join(self._newBaseDir, "index.html"), "w")
797  for line in self._index:
798  f.write(line)
799  f.write("\n")
800  f.close()
801 

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.

Member Data Documentation

◆ _currentSection

html.HtmlReport._currentSection
private

Definition at line 764 of file html.py.

Referenced by html.HtmlReport.addPlots(), and html.HtmlReport.addTable().

◆ _index

html.HtmlReport._index
private

Definition at line 744 of file html.py.

Referenced by ntupleDataFormat._Object.__getattr__(), ntupleDataFormat.TrackingParticle._nMatchedSeeds(), ntupleDataFormat._SimHitMatchAdaptor._nMatchedSimHits(), ntupleDataFormat._TrackingParticleMatchAdaptor._nMatchedTrackingParticles(), ntupleDataFormat.TrackingParticle._nMatchedTracks(), html.HtmlReport.addNote(), 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().

◆ _newBaseDir

html.HtmlReport._newBaseDir
private

◆ _sections

html.HtmlReport._sections
private

◆ _title

html.HtmlReport._title
private
mps_setup.append
append
Definition: mps_setup.py:85
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48