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
 

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 917 of file trackingPlots.py.

Constructor & Destructor Documentation

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

Definition at line 925 of file trackingPlots.py.

Member Function Documentation

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 940 of file trackingPlots.py.

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

940  def create(self, tdirectory):
941  def _getAlgoQuality(data, algo, quality):
942  for label, value in data.iteritems():
943  (a, q) = _mapCollectionToAlgoQuality(label)
944  if a == algo and q == quality:
945  return value[0] # value is (value, uncertainty) tuple
946  return None
947  def _getN(hname):
948  h = tdirectory.Get(hname)
949  if not h:
950  return None
953  return _getAlgoQuality(data, "ootb", "")
955  return _getAlgoQuality(data, "ootb", "Pt09")
957  return _getAlgoQuality(data, "ootb", "highPurity")
959  return _getAlgoQuality(data, "ootb", "highPurityPt09")
961  return _getAlgoQuality(data, "btvLike", "")
963  return _getAlgoQuality(data, "ak4PFJets", "")
964  else:
965  raise Exception("Collection not recognized, %s" % str(self._collection))
966  def _formatOrNone(num, func):
967  if num is None:
968  return None
969  return func(num)
970 
971  n_tps = _formatOrNone(_getN("num_simul_coll"), int)
972  n_m_tps = _formatOrNone(_getN("num_assoc(simToReco)_coll"), int)
973 
974  n_tracks = _formatOrNone(_getN("num_reco_coll"), int)
975  n_true = _formatOrNone(_getN("num_assoc(recoToSim)_coll"), int)
976  if n_tracks is not None and n_true is not None:
977  n_fake = n_tracks-n_true
978  else:
979  n_fake = None
980  n_pileup = _formatOrNone(_getN("num_pileup_coll"), int)
981  n_duplicate = _formatOrNone(_getN("num_duplicate_coll"), int)
982 
983  eff = _formatOrNone(_getN("effic_vs_coll"), lambda n: "%.4f" % n)
984  eff_nopt = _formatOrNone(_getN("effic_vs_coll_allPt"), lambda n: "%.4f" % n)
985  fake = _formatOrNone(_getN("fakerate_vs_coll"), lambda n: "%.4f" % n)
986  duplicate = _formatOrNone(_getN("duplicatesRate_coll"), lambda n: "%.4f" % n)
987 
988  ret = [eff, n_tps, n_m_tps,
989  eff_nopt, fake, duplicate,
990  n_tracks, n_true, n_fake, n_pileup, n_duplicate]
991  if ret.count(None) == len(ret):
992  return None
993  return ret
994 
def _mapCollectionToAlgoQuality(collName)
def _th1ToOrderedDict(th1, renameBin=None)
Definition: plotting.py:97
def trackingPlots.TrackingSummaryTable.getPage (   self)
def trackingPlots.TrackingSummaryTable.getPurpose (   self)
def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)
def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 995 of file trackingPlots.py.

995  def headers(self):
996  return [
997  "Efficiency",
998  "Number of TrackingParticles (after cuts)",
999  "Number of matched TrackingParticles",
1000  "Efficiency (w/o pT cut)",
1001  "Fake rate",
1002  "Duplicate rate",
1003  "Number of tracks",
1004  "Number of true tracks",
1005  "Number of fake tracks",
1006  "Number of pileup tracks",
1007  "Number of duplicate tracks"
1008  ]
1009 
1010 # Provide a "PlotGroup" interface, but provide a html page

Member Data Documentation

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 926 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

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