CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
vertexPlots.VertexSummaryTable Class Reference

Public Member Functions

def __init__ (self, page="vertex")
 
def create (self, tdirectory)
 
def getPage (self)
 
def getPurpose (self)
 
def getSection (self, dqmSubFolder)
 
def headers (self)
 

Private Attributes

 _page
 
 _purpose
 

Detailed Description

Definition at line 365 of file vertexPlots.py.

Constructor & Destructor Documentation

def vertexPlots.VertexSummaryTable.__init__ (   self,
  page = "vertex" 
)

Definition at line 366 of file vertexPlots.py.

366  def __init__(self, page="vertex"):
367  self._purpose = PlotPurpose.Vertexing
368  self._page = page
369 
def __init__(self, page="vertex")
Definition: vertexPlots.py:366

Member Function Documentation

def vertexPlots.VertexSummaryTable.create (   self,
  tdirectory 
)

Definition at line 379 of file vertexPlots.py.

References objects.autophobj.float, RecoEcal_EventContent_cff.func, and createfilelist.int.

379  def create(self, tdirectory):
380  def _formatOrNone(num, func):
381  if num is None:
382  return None
383  return func(num)
384 
385  ret = []
386  h = tdirectory.Get("TruePVLocationIndexCumulative")
387  if h:
388  n_events = h.GetEntries()
389  n_pvtagged = h.GetBinContent(2)
390  ret.extend([int(n_events), "%.4f"%(float(n_pvtagged)/float(n_events))])
391  else:
392  ret.extend([None, None])
393 
394  h = tdirectory.Get("globalEfficiencies")
395  if h:
396  d = {}
397  for i in xrange(1, h.GetNbinsX()+1):
398  d[h.GetXaxis().GetBinLabel(i)] = h.GetBinContent(i)
399  ret.extend([
400  _formatOrNone(d.get("effic_vs_Z", None), lambda n: "%.4f"%n),
401  _formatOrNone(d.get("fakerate_vs_Z", None), lambda n: "%.4f"%n),
402  _formatOrNone(d.get("merged_vs_Z", None), lambda n: "%.4f"%n),
403  _formatOrNone(d.get("duplicate_vs_Z", None), lambda n: "%.4f"%n),
404  ])
405  else:
406  ret.extend([None]*4)
407 
408  if ret.count(None) == len(ret):
409  return None
410 
411  return ret
412 
def create(self, tdirectory)
Definition: vertexPlots.py:379
def vertexPlots.VertexSummaryTable.getPage (   self)
def vertexPlots.VertexSummaryTable.getPurpose (   self)
def vertexPlots.VertexSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 376 of file vertexPlots.py.

376  def getSection(self, dqmSubFolder):
377  return dqmSubFolder
378 
def getSection(self, dqmSubFolder)
Definition: vertexPlots.py:376
def vertexPlots.VertexSummaryTable.headers (   self)

Definition at line 413 of file vertexPlots.py.

413  def headers(self):
414  return [
415  "Events",
416  "PV reco+tag efficiency",
417  "Efficiency",
418  "Fake rate",
419  "Merge rate",
420  "Duplicate rate",
421  ]
422 

Member Data Documentation

vertexPlots.VertexSummaryTable._page
private

Definition at line 368 of file vertexPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPage().

vertexPlots.VertexSummaryTable._purpose
private

Definition at line 367 of file vertexPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPurpose().