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

Constructor & Destructor Documentation

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

Definition at line 830 of file trackingPlots.py.

Member Function Documentation

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

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

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

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

Member Data Documentation

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 831 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

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