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  HighPurity
 

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

Constructor & Destructor Documentation

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

Definition at line 838 of file trackingPlots.py.

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(), RecoEcal_EventContent_cff.func, and harvestTrackValidationPlots.str.

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

Definition at line 904 of file trackingPlots.py.

904  def headers(self):
905  return [
906  "Efficiency",
907  "Number of TrackingParticles (after cuts)",
908  "Number of matched TrackingParticles",
909  "Efficiency (w/o pT cut)",
910  "Fake rate",
911  "Duplicate rate",
912  "Number of tracks",
913  "Number of true tracks",
914  "Number of fake tracks",
915  "Number of pileup tracks",
916  "Number of duplicate tracks"
917  ]
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
trackingPlots.TrackingSummaryTable._purpose
private
trackingPlots.TrackingSummaryTable._section
private