test
CMS 3D CMS Logo

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

Classes

class  AK4PFJets
 
class  BTVLike
 
class  GeneralTracks
 
class  HighPurity
 

Public Member Functions

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

Private Attributes

 _collection
 
 _page
 
 _purpose
 
 _section
 

Detailed Description

Definition at line 832 of file trackingPlots.py.

Constructor & Destructor Documentation

def trackingPlots.TrackingSummaryTable.__init__ (   self,
  section,
  collection = GeneralTracks 
)

Member Function Documentation

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 853 of file trackingPlots.py.

References SequenceTypes._SequenceCollection._collection, trackingPlots.TrackingSummaryTable._collection, trackingPlots._mapCollectionToAlgoQuality(), plotting._th1ToOrderedDict(), and RecoJets_EventContent_cff.func.

854  def create(self, tdirectory):
855  def _getAlgoQuality(data, algo, quality):
856  for label, value in data.iteritems():
857  (a, q) = _mapCollectionToAlgoQuality(label)
858  if a == algo and q == quality:
859  return value[0] # value is (value, uncertainty) tuple
860  return None
861  def _getN(hname):
862  h = tdirectory.Get(hname)
863  if not h:
864  return None
867  return _getAlgoQuality(data, "ootb", "")
869  return _getAlgoQuality(data, "ootb", "highPurity")
871  return _getAlgoQuality(data, "btvLike", "")
873  return _getAlgoQuality(data, "ak4PFJets", "")
874  else:
875  raise Exception("Collection not recognized, %s" % str(self._collection))
876  def _formatOrNone(num, func):
877  if num is None:
878  return None
879  return func(num)
880 
881  n_tps = _formatOrNone(_getN("num_simul_coll"), int)
882  n_m_tps = _formatOrNone(_getN("num_assoc(simToReco)_coll"), int)
883 
884  n_tracks = _formatOrNone(_getN("num_reco_coll"), int)
885  n_true = _formatOrNone(_getN("num_assoc(recoToSim)_coll"), int)
886  if n_tracks is not None and n_true is not None:
887  n_fake = n_tracks-n_true
888  else:
889  n_fake = None
890  n_pileup = _formatOrNone(_getN("num_pileup_coll"), int)
891  n_duplicate = _formatOrNone(_getN("num_duplicate_coll"), int)
892 
893  eff = _formatOrNone(_getN("effic_vs_coll"), lambda n: "%.4f" % n)
894  eff_nopt = _formatOrNone(_getN("effic_vs_coll_allPt"), lambda n: "%.4f" % n)
895  fake = _formatOrNone(_getN("fakerate_vs_coll"), lambda n: "%.4f" % n)
896  duplicate = _formatOrNone(_getN("duplicatesRate_coll"), lambda n: "%.4f" % n)
897 
898  ret = [eff, n_tps, n_m_tps,
899  eff_nopt, fake, duplicate,
900  n_tracks, n_true, n_fake, n_pileup, n_duplicate]
901  if ret.count(None) == len(ret):
902  return None
903  return ret
def _th1ToOrderedDict
Definition: plotting.py:96
def _mapCollectionToAlgoQuality
def trackingPlots.TrackingSummaryTable.getPage (   self)

Definition at line 847 of file trackingPlots.py.

References html.Table._page, trackingPlots.TrackingSummaryTable._page, and plotting.PlotFolder._page.

848  def getPage(self):
849  return self._page
def trackingPlots.TrackingSummaryTable.getPurpose (   self)

Definition at line 844 of file trackingPlots.py.

References html.Table._purpose, trackingPlots.TrackingSummaryTable._purpose, and plotting.PlotFolder._purpose.

845  def getPurpose(self):
846  return self._purpose
def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 850 of file trackingPlots.py.

References html.Table._section, trackingPlots.TrackingSummaryTable._section, and plotting.PlotFolder._section.

851  def getSection(self, dqmSubFolder):
852  return self._section
def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 904 of file trackingPlots.py.

905  def headers(self):
906  return [
907  "Efficiency",
908  "Number of TrackingParticles (after cuts)",
909  "Number of matched TrackingParticles",
910  "Efficiency (w/o pT cut)",
911  "Fake rate",
912  "Duplicate rate",
913  "Number of tracks",
914  "Number of true tracks",
915  "Number of fake tracks",
916  "Number of pileup tracks",
917  "Number of duplicate tracks"
918  ]

Member Data Documentation

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 839 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

trackingPlots.TrackingSummaryTable._page
private

Definition at line 841 of file trackingPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPage(), trackingPlots.TrackingSummaryTable.getPage(), and trackingPlots.TrackingTimingTable.getPage().

trackingPlots.TrackingSummaryTable._purpose
private

Definition at line 840 of file trackingPlots.py.

Referenced by vertexPlots.VertexSummaryTable.getPurpose(), trackingPlots.TrackingSummaryTable.getPurpose(), and trackingPlots.TrackingTimingTable.getPurpose().

trackingPlots.TrackingSummaryTable._section
private

Definition at line 842 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.getSection(), and trackingPlots.TrackingTimingTable.getSection().