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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 780 of file html.py.

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

Member Function Documentation

◆ addNote()

def html.HtmlReport.addNote (   self,
  note 
)

Definition at line 794 of file html.py.

794  def addNote(self, note):
795  self._index.append(' <p>%s</p>'%note)
796 

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

809  def addPlots(self, *args, **kwargs):
810  self._currentSection.addPlots(*args, **kwargs)
811 

References html.HtmlReport._currentSection.

◆ addTable()

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

Definition at line 812 of file html.py.

812  def addTable(self, *args, **kwargs):
813  self._currentSection.addTable(*args, **kwargs)
814 

References html.HtmlReport._currentSection.

◆ beginSample()

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

Definition at line 797 of file html.py.

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

References html.HtmlReport._sections.

◆ write()

def html.HtmlReport.write (   self)

Definition at line 815 of file html.py.

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

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

Member Data Documentation

◆ _currentSection

html.HtmlReport._currentSection
private

Definition at line 804 of file html.py.

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

◆ _index

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(), 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
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
mps_setup.append
append
Definition: mps_setup.py:85
writeEcalDQMStatus.write
write
Definition: writeEcalDQMStatus.py:48