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 185 of file vertexPlots.py.

Constructor & Destructor Documentation

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

Definition at line 186 of file vertexPlots.py.

187  def __init__(self, page="vertex"):
188  self._purpose = PlotPurpose.Vertexing
189  self._page = page

Member Function Documentation

def vertexPlots.VertexSummaryTable.create (   self,
  tdirectory 
)

Definition at line 199 of file vertexPlots.py.

References RecoJets_EventContent_cff.func.

200  def create(self, tdirectory):
201  def _formatOrNone(num, func):
202  if num is None:
203  return None
204  return func(num)
205 
206  ret = []
207  h = tdirectory.Get("TruePVLocationIndexCumulative")
208  if h:
209  n_events = h.GetEntries()
210  n_pvtagged = h.GetBinContent(2)
211  ret.extend([int(n_events), "%.4f"%(float(n_pvtagged)/float(n_events))])
212  else:
213  ret.extend([None, None])
214 
215  h = tdirectory.Get("globalEfficiencies")
216  if h:
217  d = {}
218  for i in xrange(1, h.GetNbinsX()+1):
219  d[h.GetXaxis().GetBinLabel(i)] = h.GetBinContent(i)
220  ret.extend([
221  _formatOrNone(d.get("effic_vs_Z", None), lambda n: "%.4f"%n),
222  _formatOrNone(d.get("fakerate_vs_Z", None), lambda n: "%.4f"%n),
223  _formatOrNone(d.get("merged_vs_Z", None), lambda n: "%.4f"%n),
224  _formatOrNone(d.get("duplicate_vs_Z", None), lambda n: "%.4f"%n),
225  ])
226  else:
227  ret.extend([None]*4)
228 
229  if ret.count(None) == len(ret):
230  return None
231 
232  return ret
def vertexPlots.VertexSummaryTable.getPage (   self)

Definition at line 193 of file vertexPlots.py.

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

194  def getPage(self):
195  return self._page
def vertexPlots.VertexSummaryTable.getPurpose (   self)

Definition at line 190 of file vertexPlots.py.

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

191  def getPurpose(self):
192  return self._purpose
def vertexPlots.VertexSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 196 of file vertexPlots.py.

197  def getSection(self, dqmSubFolder):
198  return dqmSubFolder
def vertexPlots.VertexSummaryTable.headers (   self)

Definition at line 233 of file vertexPlots.py.

234  def headers(self):
235  return [
236  "Events",
237  "PV reco+tag efficiency",
238  "Efficiency",
239  "Fake rate",
240  "Merge rate",
241  "Duplicate rate",
242  ]

Member Data Documentation

vertexPlots.VertexSummaryTable._page
private

Definition at line 188 of file vertexPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPage().

vertexPlots.VertexSummaryTable._purpose
private

Definition at line 187 of file vertexPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPurpose().