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

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 950 of file trackingPlots.py.

950  def __init__(self, section, collection=GeneralTracks):
951  self._collection = collection
952  self._purpose = PlotPurpose.TrackingSummary
953  self._page = "summary"
954  self._section = section
955 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ create()

def trackingPlots.TrackingSummaryTable.create (   self,
  tdirectory 
)

Definition at line 965 of file trackingPlots.py.

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

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

◆ getPage()

def trackingPlots.TrackingSummaryTable.getPage (   self)

Definition at line 959 of file trackingPlots.py.

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

959  def getPage(self):
960  return self._page
961 

◆ getPurpose()

def trackingPlots.TrackingSummaryTable.getPurpose (   self)

Definition at line 956 of file trackingPlots.py.

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

956  def getPurpose(self):
957  return self._purpose
958 

◆ getSection()

def trackingPlots.TrackingSummaryTable.getSection (   self,
  dqmSubFolder 
)

Definition at line 962 of file trackingPlots.py.

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

962  def getSection(self, dqmSubFolder):
963  return self._section
964 

◆ headers()

def trackingPlots.TrackingSummaryTable.headers (   self)

Definition at line 1024 of file trackingPlots.py.

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

Member Data Documentation

◆ _collection

trackingPlots.TrackingSummaryTable._collection
private

Definition at line 951 of file trackingPlots.py.

Referenced by trackingPlots.TrackingSummaryTable.create().

◆ _page

trackingPlots.TrackingSummaryTable._page
private

◆ _purpose

trackingPlots.TrackingSummaryTable._purpose
private

◆ _section

trackingPlots.TrackingSummaryTable._section
private