CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
trackingPlots.TrackingPlotFolder Class Reference
Inheritance diagram for trackingPlots.TrackingPlotFolder:
plotting.PlotFolder

Public Member Functions

def __init__ (self, *args, **kwargs)
 
def isAlgoIterative (self, algo)
 
def iterSelectionName (self, plotFolderName, translatedDqmSubFolder)
 
def limitSubFolder (self, limitOnlyTo, translatedDqmSubFolder)
 
def translateSubFolder (self, dqmSubFolderName)
 
- Public Member Functions inherited from plotting.PlotFolder
def append (self, plotGroup)
 
def create (self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False)
 
def draw (self, prefix=None, separate=False, saveFormat=".pdf", ratio=True, directory="")
 
def getNumberOfEventsHistogram (self)
 
def getPage (self)
 
def getPlotGroup (self, name)
 
def getPlotGroups (self)
 
def getPurpose (self)
 
def getSection (self)
 
def loopSubFolders (self)
 
def onlyForBHadron (self)
 
def onlyForConversion (self)
 
def onlyForElectron (self)
 
def onlyForPileup (self)
 
def set (self, plotGroups)
 

Private Attributes

 _fallbackRefFiles
 

Detailed Description

Definition at line 915 of file trackingPlots.py.

Constructor & Destructor Documentation

◆ __init__()

def trackingPlots.TrackingPlotFolder.__init__ (   self,
plotGroups,
**  kwargs 
)
Constructor.

Arguments:
plotGroups     -- List of PlotGroup objects

Keyword arguments
loopSubFolders -- Should the subfolders be looped over? (default: True)
onlyForPileup  -- Plots this folder only for pileup samples
onlyForElectron -- Plots this folder only for electron samples
onlyForConversion -- Plots this folder only for conversion samples
onlyForBHadron -- Plots this folder only for B-hadron samples
purpose        -- html.PlotPurpose member class for the purpose of the folder, used for grouping of the plots to the HTML pages
page           -- Optional string for the page in HTML generatin
section        -- Optional string for the section within a page in HTML generation
numberOfEventsHistogram -- Optional path to histogram filled once per event. Needed if there are any plots normalized by number of events. Path is relative to "possibleDqmFolders".

Reimplemented from plotting.PlotFolder.

Definition at line 916 of file trackingPlots.py.

916  def __init__(self, *args, **kwargs):
917  self._fallbackRefFiles = kwargs.pop("fallbackRefFiles", [])
918  PlotFolder.__init__(self, *args, **kwargs)
919 

Member Function Documentation

◆ isAlgoIterative()

def trackingPlots.TrackingPlotFolder.isAlgoIterative (   self,
  algo 
)

Definition at line 953 of file trackingPlots.py.

953  def isAlgoIterative(self, algo):
954  return algo not in _possibleTrackingNonIterationColls
955 

◆ iterSelectionName()

def trackingPlots.TrackingPlotFolder.iterSelectionName (   self,
  plotFolderName,
  translatedDqmSubFolder 
)
Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder

Reimplemented from plotting.PlotFolder.

Definition at line 927 of file trackingPlots.py.

927  def iterSelectionName(self, plotFolderName, translatedDqmSubFolder):
928  (algoOrig, quality) = translatedDqmSubFolder
929 
930  for fallback in [lambda n: n]+self._fallbackRefFiles:
931  algo = fallback(algoOrig)
932 
933  ret = ""
934  if plotFolderName != "":
935  ret += "_"+plotFolderName
936  if quality != "":
937  ret += "_"+quality
938  if not (algo == "ootb" and quality != ""):
939  ret += "_"+algo
940  yield ret
941 

References trackingPlots.TrackingPlotFolder._fallbackRefFiles, and trackingPlots.fallback.

◆ limitSubFolder()

def trackingPlots.TrackingPlotFolder.limitSubFolder (   self,
  limitOnlyTo,
  translatedDqmSubFolder 
)
Return True if this subfolder should be processed

Arguments:
limitOnlyTo            -- Function '(algo, quality) -> bool'
translatedDqmSubFolder -- Return value of translateSubFolder

Reimplemented from plotting.PlotFolder.

Definition at line 942 of file trackingPlots.py.

942  def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder):
943  """Return True if this subfolder should be processed
944 
945  Arguments:
946  limitOnlyTo -- Function '(algo, quality) -> bool'
947  translatedDqmSubFolder -- Return value of translateSubFolder
948  """
949  (algo, quality) = translatedDqmSubFolder
950  return limitOnlyTo(algo, quality)
951 

◆ translateSubFolder()

def trackingPlots.TrackingPlotFolder.translateSubFolder (   self,
  dqmSubFolderName 
)
Method called to (possibly) translate a subfolder name to more 'readable' form

The implementation in this (base) class just returns the
argument. The idea is that a deriving class might want to do
something more complex (like trackingPlots.TrackingPlotFolder
does)

Reimplemented from plotting.PlotFolder.

Definition at line 920 of file trackingPlots.py.

920  def translateSubFolder(self, dqmSubFolderName):
921  spl = dqmSubFolderName.split("_")
922  if len(spl) != 2:
923  return None
924  collName = spl[0]
925  return _mapCollectionToAlgoQuality(collName)
926 

References trackingPlots._mapCollectionToAlgoQuality().

Member Data Documentation

◆ _fallbackRefFiles

trackingPlots.TrackingPlotFolder._fallbackRefFiles
private
trackingPlots._mapCollectionToAlgoQuality
def _mapCollectionToAlgoQuality(collName)
Definition: trackingPlots.py:608
trackingPlots.fallback
fallback
Definition: trackingPlots.py:365