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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 781 of file html.py.

781  def __init__(self, validationName, newBaseDir):
782  self._title = "Tracking validation "+validationName
783  self._newBaseDir = newBaseDir
784 
785  self._index = [
786  '<html>',
787  ' <head>',
788  ' <title>%s</title>' % self._title,
789  ' </head>',
790  ' <body>',
791  ]
792 
793  self._sections = collections.OrderedDict()
794 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ addNote()

def html.HtmlReport.addNote (   self,
  note 
)

◆ addPlots()

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

Definition at line 810 of file html.py.

References html.HtmlReport._currentSection.

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

◆ addTable()

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

Definition at line 813 of file html.py.

References html.HtmlReport._currentSection.

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

◆ beginSample()

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

Definition at line 798 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
809 

◆ write()

def html.HtmlReport.write (   self)

Definition at line 816 of file html.py.

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

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()
842 

Member Data Documentation

◆ _currentSection

html.HtmlReport._currentSection
private

Definition at line 805 of file html.py.

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

◆ _index

html.HtmlReport._index
private

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