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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 946 of file trackingPlots.py.

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

Member Function Documentation

◆ create()

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 961 of file trackingPlots.py.

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

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

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

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

◆ getPurpose()

def trackingPlots.TrackingSummaryTable.getPurpose (   self)

Definition at line 952 of file trackingPlots.py.

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

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

◆ getSection()

def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 958 of file trackingPlots.py.

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

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

◆ headers()

def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 1020 of file trackingPlots.py.

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

Member Data Documentation

◆ _collection

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 947 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:586
str
#define str(s)
Definition: TestProcessor.cc:52
Exception
TrackCollections2monitor_cff.func
func
Definition: TrackCollections2monitor_cff.py:359
plotting._th1ToOrderedDict
def _th1ToOrderedDict(th1, renameBin=None)
Definition: plotting.py:101