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
 

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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 965 of file trackingPlots.py.

965  def __init__(self, section, collection=GeneralTracks):
966  self._collection = collection
967  self._purpose = PlotPurpose.TrackingSummary
968  self._page = "summary"
969  self._section = section
970 

Member Function Documentation

◆ create()

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 980 of file trackingPlots.py.

980  def create(self, tdirectory):
981  def _getAlgoQuality(data, algo, quality):
982  for label, value in six.iteritems(data):
983  (a, q) = _mapCollectionToAlgoQuality(label)
984  if a == algo and q == quality:
985  return value[0] # value is (value, uncertainty) tuple
986  return None
987  def _getN(hname):
988  h = tdirectory.Get(hname)
989  if not h:
990  return None
992  if self._collection == TrackingSummaryTable.GeneralTracks:
993  return _getAlgoQuality(data, "ootb", "")
994  elif self._collection == TrackingSummaryTable.GeneralTracksPt09:
995  return _getAlgoQuality(data, "ootb", "Pt09")
996  elif self._collection == TrackingSummaryTable.HighPurity:
997  return _getAlgoQuality(data, "ootb", "highPurity")
998  elif self._collection == TrackingSummaryTable.HighPurityPt09:
999  return _getAlgoQuality(data, "ootb", "highPurityPt09")
1000  elif self._collection == TrackingSummaryTable.BTVLike:
1001  return _getAlgoQuality(data, "btvLike", "")
1002  elif self._collection == TrackingSummaryTable.AK4PFJets:
1003  return _getAlgoQuality(data, "ak4PFJets", "")
1004  elif self._collection == TrackingSummaryTable.Pixel:
1005  return _getAlgoQuality(data, "pixel", "")
1006  else:
1007  raise Exception("Collection not recognized, %s" % str(self._collection))
1008  def _formatOrNone(num, func):
1009  if num is None:
1010  return None
1011  return func(num)
1012 
1013  n_tps = _formatOrNone(_getN("num_simul_coll"), int)
1014  n_m_tps = _formatOrNone(_getN("num_assoc(simToReco)_coll"), int)
1015 
1016  n_tracks = _formatOrNone(_getN("num_reco_coll"), int)
1017  n_true = _formatOrNone(_getN("num_assoc(recoToSim)_coll"), int)
1018  if n_tracks is not None and n_true is not None:
1019  n_fake = n_tracks-n_true
1020  else:
1021  n_fake = None
1022  n_pileup = _formatOrNone(_getN("num_pileup_coll"), int)
1023  n_duplicate = _formatOrNone(_getN("num_duplicate_coll"), int)
1024 
1025  eff = _formatOrNone(_getN("effic_vs_coll"), lambda n: "%.4f" % n)
1026  eff_nopt = _formatOrNone(_getN("effic_vs_coll_allPt"), lambda n: "%.4f" % n)
1027  fake = _formatOrNone(_getN("fakerate_vs_coll"), lambda n: "%.4f" % n)
1028  duplicate = _formatOrNone(_getN("duplicatesRate_coll"), lambda n: "%.4f" % n)
1029 
1030  ret = [eff, n_tps, n_m_tps,
1031  eff_nopt, fake, duplicate,
1032  n_tracks, n_true, n_fake, n_pileup, n_duplicate]
1033  if ret.count(None) == len(ret):
1034  return None
1035  return ret
1036 

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

974  def getPage(self):
975  return self._page
976 

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

◆ getPurpose()

def trackingPlots.TrackingSummaryTable.getPurpose (   self)

Definition at line 971 of file trackingPlots.py.

971  def getPurpose(self):
972  return self._purpose
973 

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

◆ getSection()

def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 977 of file trackingPlots.py.

977  def getSection(self, dqmSubFolder):
978  return self._section
979 

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

◆ headers()

def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 1037 of file trackingPlots.py.

1037  def headers(self):
1038  return [
1039  "Efficiency",
1040  "Number of TrackingParticles (after cuts)",
1041  "Number of matched TrackingParticles",
1042  "Efficiency (w/o pT cut)",
1043  "Fake rate",
1044  "Duplicate rate",
1045  "Number of tracks",
1046  "Number of true tracks",
1047  "Number of fake tracks",
1048  "Number of pileup tracks",
1049  "Number of duplicate tracks"
1050  ]
1051 
1052 # Provide a "PlotGroup" interface, but provide a html page

Member Data Documentation

◆ _collection

trackingPlots.TrackingSummaryTable._collection
private

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