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
 
class  PixelPt09
 

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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 947 of file trackingPlots.py.

947  def __init__(self, section, collection=GeneralTracks):
948  self._collection = collection
949  self._purpose = PlotPurpose.TrackingSummary
950  self._page = "summary"
951  self._section = section
952 

Member Function Documentation

◆ create()

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 962 of file trackingPlots.py.

962  def create(self, tdirectory):
963  def _getAlgoQuality(data, algo, quality):
964  for label, value in data.items():
965  (a, q) = _mapCollectionToAlgoQuality(label)
966  if a == algo and q == quality:
967  return value[0] # value is (value, uncertainty) tuple
968  return None
969  def _getN(hname):
970  h = tdirectory.Get(hname)
971  if not h:
972  return None
974  if self._collection == TrackingSummaryTable.GeneralTracks:
975  return _getAlgoQuality(data, "ootb", "")
976  elif self._collection == TrackingSummaryTable.GeneralTracksPt09:
977  return _getAlgoQuality(data, "ootb", "Pt09")
978  elif self._collection == TrackingSummaryTable.HighPurity:
979  return _getAlgoQuality(data, "ootb", "highPurity")
980  elif self._collection == TrackingSummaryTable.HighPurityPt09:
981  return _getAlgoQuality(data, "ootb", "highPurityPt09")
982  elif self._collection == TrackingSummaryTable.BTVLike:
983  return _getAlgoQuality(data, "btvLike", "")
984  elif self._collection == TrackingSummaryTable.AK4PFJets:
985  return _getAlgoQuality(data, "ak4PFJets", "")
986  elif self._collection == TrackingSummaryTable.Pixel:
987  return _getAlgoQuality(data, "pixel", "")
988  elif self._collection == TrackingSummaryTable.PixelPt09:
989  return _getAlgoQuality(data, "pixel", "Pt09")
990  else:
991  raise Exception("Collection not recognized, %s" % str(self._collection))
992  def _formatOrNone(num, func):
993  if num is None:
994  return None
995  return func(num)
996 
997  n_tps = _formatOrNone(_getN("num_simul_coll"), int)
998  n_m_tps = _formatOrNone(_getN("num_assoc(simToReco)_coll"), int)
999 
1000  n_tracks = _formatOrNone(_getN("num_reco_coll"), int)
1001  n_true = _formatOrNone(_getN("num_assoc(recoToSim)_coll"), int)
1002  if n_tracks is not None and n_true is not None:
1003  n_fake = n_tracks-n_true
1004  else:
1005  n_fake = None
1006  n_pileup = _formatOrNone(_getN("num_pileup_coll"), int)
1007  n_duplicate = _formatOrNone(_getN("num_duplicate_coll"), int)
1008 
1009  eff = _formatOrNone(_getN("effic_vs_coll"), lambda n: "%.4f" % n)
1010  eff_nopt = _formatOrNone(_getN("effic_vs_coll_allPt"), lambda n: "%.4f" % n)
1011  fake = _formatOrNone(_getN("fakerate_vs_coll"), lambda n: "%.4f" % n)
1012  duplicate = _formatOrNone(_getN("duplicatesRate_coll"), lambda n: "%.4f" % n)
1013 
1014  ret = [eff, n_tps, n_m_tps,
1015  eff_nopt, fake, duplicate,
1016  n_tracks, n_true, n_fake, n_pileup, n_duplicate]
1017  if ret.count(None) == len(ret):
1018  return None
1019  return ret
1020 

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

◆ getPage()

def trackingPlots.TrackingSummaryTable.getPage (   self)

Definition at line 956 of file trackingPlots.py.

956  def getPage(self):
957  return self._page
958 

References html.Table._page, trackingPlots.TrackingSummaryTable._page, and plotting.PlotFolder._page.

◆ getPurpose()

def trackingPlots.TrackingSummaryTable.getPurpose (   self)

Definition at line 953 of file trackingPlots.py.

953  def getPurpose(self):
954  return self._purpose
955 

References html.Table._purpose, trackingPlots.TrackingSummaryTable._purpose, and plotting.PlotFolder._purpose.

◆ getSection()

def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 959 of file trackingPlots.py.

959  def getSection(self, dqmSubFolder):
960  return self._section
961 

References html.Table._section, trackingPlots.TrackingSummaryTable._section, and plotting.PlotFolder._section.

◆ headers()

def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 1021 of file trackingPlots.py.

1021  def headers(self):
1022  return [
1023  "Efficiency",
1024  "Number of TrackingParticles (after cuts)",
1025  "Number of matched TrackingParticles",
1026  "Efficiency (w/o pT cut)",
1027  "Fake rate",
1028  "Duplicate rate",
1029  "Number of tracks",
1030  "Number of true tracks",
1031  "Number of fake tracks",
1032  "Number of pileup tracks",
1033  "Number of duplicate tracks"
1034  ]
1035 
1036 # Provide a "PlotGroup" interface, but provide a html page

Member Data Documentation

◆ _collection

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 948 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

◆ _page

trackingPlots.TrackingSummaryTable._page
private

◆ _purpose

trackingPlots.TrackingSummaryTable._purpose
private

◆ _section

trackingPlots.TrackingSummaryTable._section
private
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
getRunAppsInfo.headers
headers
Definition: getRunAppsInfo.py:65
trackingPlots._mapCollectionToAlgoQuality
def _mapCollectionToAlgoQuality(collName)
Definition: trackingPlots.py:587
str
#define str(s)
Definition: TestProcessor.cc:53
Exception
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
plotting._th1ToOrderedDict
def _th1ToOrderedDict(th1, renameBin=None)
Definition: plotting.py:100