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__ (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 827 of file trackingPlots.py.

Constructor & Destructor Documentation

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

Definition at line 833 of file trackingPlots.py.

Member Function Documentation

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 848 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.

848  def create(self, tdirectory):
849  def _getAlgoQuality(data, algo, quality):
850  for label, value in data.iteritems():
851  (a, q) = _mapCollectionToAlgoQuality(label)
852  if a == algo and q == quality:
853  return value[0] # value is (value, uncertainty) tuple
854  return None
855  def _getN(hname):
856  h = tdirectory.Get(hname)
857  if not h:
858  return None
861  return _getAlgoQuality(data, "ootb", "")
863  return _getAlgoQuality(data, "ootb", "highPurity")
865  return _getAlgoQuality(data, "btvLike", "")
867  return _getAlgoQuality(data, "ak4PFJets", "")
868  else:
869  raise Exception("Collection not recognized, %s" % str(self._collection))
870  def _formatOrNone(num, func):
871  if num is None:
872  return None
873  return func(num)
874 
875  n_tps = _formatOrNone(_getN("num_simul_coll"), int)
876  n_m_tps = _formatOrNone(_getN("num_assoc(simToReco)_coll"), int)
877 
878  n_tracks = _formatOrNone(_getN("num_reco_coll"), int)
879  n_true = _formatOrNone(_getN("num_assoc(recoToSim)_coll"), int)
880  if n_tracks is not None and n_true is not None:
881  n_fake = n_tracks-n_true
882  else:
883  n_fake = None
884  n_pileup = _formatOrNone(_getN("num_pileup_coll"), int)
885  n_duplicate = _formatOrNone(_getN("num_duplicate_coll"), int)
886 
887  eff = _formatOrNone(_getN("effic_vs_coll"), lambda n: "%.4f" % n)
888  eff_nopt = _formatOrNone(_getN("effic_vs_coll_allPt"), lambda n: "%.4f" % n)
889  fake = _formatOrNone(_getN("fakerate_vs_coll"), lambda n: "%.4f" % n)
890  duplicate = _formatOrNone(_getN("duplicatesRate_coll"), lambda n: "%.4f" % n)
891 
892  ret = [eff, n_tps, n_m_tps,
893  eff_nopt, fake, duplicate,
894  n_tracks, n_true, n_fake, n_pileup, n_duplicate]
895  if ret.count(None) == len(ret):
896  return None
897  return ret
898 
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 899 of file trackingPlots.py.

899  def headers(self):
900  return [
901  "Efficiency",
902  "Number of TrackingParticles (after cuts)",
903  "Number of matched TrackingParticles",
904  "Efficiency (w/o pT cut)",
905  "Fake rate",
906  "Duplicate rate",
907  "Number of tracks",
908  "Number of true tracks",
909  "Number of fake tracks",
910  "Number of pileup tracks",
911  "Number of duplicate tracks"
912  ]
913 

Member Data Documentation

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 834 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

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