test
CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def create
 
def getPage
 
def getPurpose
 
def getSection
 
def headers
 

Private Attributes

 _page
 
 _purpose
 

Detailed Description

Definition at line 146 of file vertexPlots.py.

Constructor & Destructor Documentation

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

Definition at line 147 of file vertexPlots.py.

148  def __init__(self, page="vertex"):
149  self._purpose = PlotPurpose.Vertexing
150  self._page = page

Member Function Documentation

def vertexPlots.VertexSummaryTable.create (   self,
  tdirectory 
)

Definition at line 160 of file vertexPlots.py.

References RecoJets_EventContent_cff.func.

161  def create(self, tdirectory):
162  def _formatOrNone(num, func):
163  if num is None:
164  return None
165  return func(num)
166 
167  ret = []
168  h = tdirectory.Get("TruePVLocationIndexCumulative")
169  if h:
170  n_events = h.GetEntries()
171  n_pvtagged = h.GetBinContent(2)
172  ret.extend([int(n_events), "%.4f"%(float(n_pvtagged)/float(n_events))])
173  else:
174  ret.extend([None, None])
175 
176  h = tdirectory.Get("globalEfficiencies")
177  if h:
178  d = {}
179  for i in xrange(1, h.GetNbinsX()+1):
180  d[h.GetXaxis().GetBinLabel(i)] = h.GetBinContent(i)
181  ret.extend([
182  _formatOrNone(d.get("effic_vs_Z", None), lambda n: "%.4f"%n),
183  _formatOrNone(d.get("fakerate_vs_Z", None), lambda n: "%.4f"%n),
184  _formatOrNone(d.get("merged_vs_Z", None), lambda n: "%.4f"%n),
185  _formatOrNone(d.get("duplicate_vs_Z", None), lambda n: "%.4f"%n),
186  ])
187  else:
188  ret.extend([None]*4)
189 
190  if ret.count(None) == len(ret):
191  return None
192 
193  return ret
def vertexPlots.VertexSummaryTable.getPage (   self)

Definition at line 154 of file vertexPlots.py.

References vertexPlots.VertexSummaryTable._page, html.Table._page, trackingPlots.TrackingSummaryTable._page, trackingPlots.TrackingTimingTable._page, and plotting.PlotFolder._page.

155  def getPage(self):
156  return self._page
def vertexPlots.VertexSummaryTable.getPurpose (   self)

Definition at line 151 of file vertexPlots.py.

References vertexPlots.VertexSummaryTable._purpose, html.Table._purpose, trackingPlots.TrackingSummaryTable._purpose, trackingPlots.TrackingTimingTable._purpose, and plotting.PlotFolder._purpose.

152  def getPurpose(self):
153  return self._purpose
def vertexPlots.VertexSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 157 of file vertexPlots.py.

158  def getSection(self, dqmSubFolder):
159  return dqmSubFolder
def vertexPlots.VertexSummaryTable.headers (   self)

Definition at line 194 of file vertexPlots.py.

195  def headers(self):
196  return [
197  "Events",
198  "PV reco+tag efficiency",
199  "Efficiency",
200  "Fake rate",
201  "Merge rate",
202  "Duplicate rate",
203  ]

Member Data Documentation

vertexPlots.VertexSummaryTable._page
private

Definition at line 149 of file vertexPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPage().

vertexPlots.VertexSummaryTable._purpose
private

Definition at line 148 of file vertexPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPurpose().