CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Attributes
trackingPlots.TrackingSummaryTable Class Reference

Classes

class  AK4PFJets
 
class  BTVLike
 
class  GeneralTracks
 
class  GeneralTracksPt09
 
class  HighPurity
 
class  HighPurityPt09
 
class  Pixel
 

Public Member Functions

def __init__ (self, section, collection=GeneralTracks)
 
def create (self, tdirectory)
 
def getPage (self)
 
def getPurpose (self)
 
def getSection (self, dqmSubFolder)
 
def headers (self)
 

Private Attributes

 _collection
 
 _page
 
 _purpose
 
 _section
 

Detailed Description

Definition at line 931 of file trackingPlots.py.

Constructor & Destructor Documentation

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

Definition at line 940 of file trackingPlots.py.

Member Function Documentation

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 955 of file trackingPlots.py.

References SequenceTypes._SequenceCollection._collection, trackingPlots.TrackingSummaryTable._collection, SequenceTypes.Task._collection, trackingPlots._mapCollectionToAlgoQuality(), plotting._th1ToOrderedDict(), patCandidates_cff.func, and str.

955  def create(self, tdirectory):
956  def _getAlgoQuality(data, algo, quality):
957  for label, value in six.iteritems(data):
958  (a, q) = _mapCollectionToAlgoQuality(label)
959  if a == algo and q == quality:
960  return value[0] # value is (value, uncertainty) tuple
961  return None
962  def _getN(hname):
963  h = tdirectory.Get(hname)
964  if not h:
965  return None
968  return _getAlgoQuality(data, "ootb", "")
970  return _getAlgoQuality(data, "ootb", "Pt09")
972  return _getAlgoQuality(data, "ootb", "highPurity")
974  return _getAlgoQuality(data, "ootb", "highPurityPt09")
976  return _getAlgoQuality(data, "btvLike", "")
978  return _getAlgoQuality(data, "ak4PFJets", "")
980  return _getAlgoQuality(data, "pixel", "")
981  else:
982  raise Exception("Collection not recognized, %s" % str(self._collection))
983  def _formatOrNone(num, func):
984  if num is None:
985  return None
986  return func(num)
987 
988  n_tps = _formatOrNone(_getN("num_simul_coll"), int)
989  n_m_tps = _formatOrNone(_getN("num_assoc(simToReco)_coll"), int)
990 
991  n_tracks = _formatOrNone(_getN("num_reco_coll"), int)
992  n_true = _formatOrNone(_getN("num_assoc(recoToSim)_coll"), int)
993  if n_tracks is not None and n_true is not None:
994  n_fake = n_tracks-n_true
995  else:
996  n_fake = None
997  n_pileup = _formatOrNone(_getN("num_pileup_coll"), int)
998  n_duplicate = _formatOrNone(_getN("num_duplicate_coll"), int)
999 
1000  eff = _formatOrNone(_getN("effic_vs_coll"), lambda n: "%.4f" % n)
1001  eff_nopt = _formatOrNone(_getN("effic_vs_coll_allPt"), lambda n: "%.4f" % n)
1002  fake = _formatOrNone(_getN("fakerate_vs_coll"), lambda n: "%.4f" % n)
1003  duplicate = _formatOrNone(_getN("duplicatesRate_coll"), lambda n: "%.4f" % n)
1004 
1005  ret = [eff, n_tps, n_m_tps,
1006  eff_nopt, fake, duplicate,
1007  n_tracks, n_true, n_fake, n_pileup, n_duplicate]
1008  if ret.count(None) == len(ret):
1009  return None
1010  return ret
1011 
def _mapCollectionToAlgoQuality(collName)
#define str(s)
def _th1ToOrderedDict(th1, renameBin=None)
Definition: plotting.py:98
def trackingPlots.TrackingSummaryTable.getPage (   self)
def trackingPlots.TrackingSummaryTable.getPurpose (   self)
def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)
def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 1012 of file trackingPlots.py.

1012  def headers(self):
1013  return [
1014  "Efficiency",
1015  "Number of TrackingParticles (after cuts)",
1016  "Number of matched TrackingParticles",
1017  "Efficiency (w/o pT cut)",
1018  "Fake rate",
1019  "Duplicate rate",
1020  "Number of tracks",
1021  "Number of true tracks",
1022  "Number of fake tracks",
1023  "Number of pileup tracks",
1024  "Number of duplicate tracks"
1025  ]
1026 
1027 # Provide a "PlotGroup" interface, but provide a html page

Member Data Documentation

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 941 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

trackingPlots.TrackingSummaryTable._page
private
trackingPlots.TrackingSummaryTable._purpose
private
trackingPlots.TrackingSummaryTable._section
private