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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 963 of file trackingPlots.py.

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

Member Function Documentation

◆ create()

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 978 of file trackingPlots.py.

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

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

972  def getPage(self):
973  return self._page
974 

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

◆ getPurpose()

def trackingPlots.TrackingSummaryTable.getPurpose (   self)

Definition at line 969 of file trackingPlots.py.

969  def getPurpose(self):
970  return self._purpose
971 

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

◆ getSection()

def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 975 of file trackingPlots.py.

975  def getSection(self, dqmSubFolder):
976  return self._section
977 

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

◆ headers()

def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 1035 of file trackingPlots.py.

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

Member Data Documentation

◆ _collection

trackingPlots.TrackingSummaryTable._collection
private

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