CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
plotting.PlotterFolder Class Reference

Public Member Functions

def __init__
 
def create
 
def draw
 
def getDQMSubFolders
 
def getName
 
def getPage
 
def getPossibleDQMFolders
 
def getPurpose
 
def getSection
 
def getSelectionName
 
def getSelectionNameIterator
 
def onlyForPileup
 

Private Attributes

 _dqmSubFolders
 
 _fallbackNames
 
 _name
 
 _plotFolder
 
 _possibleDqmFolders
 

Detailed Description

Plotter for one DQM folder.

This class is supposed to be instantiated by the Plotter class (or
PlotterItem, to be more specific), and not used directly by the
user.

Definition at line 1751 of file plotting.py.

Constructor & Destructor Documentation

def plotting.PlotterFolder.__init__ (   self,
  name,
  possibleDqmFolders,
  dqmSubFolders,
  plotFolder,
  fallbackNames 
)
Constructor

Arguments:
name               -- Name of the folder (is used in the output directory naming)
possibleDqmFolders -- List of strings for possible directories of histograms in TFiles
dqmSubFolders      -- List of lists of strings for list of subfolders per input file, or None if no subfolders
plotFolder         -- PlotFolder object
fallbackNames      -- List of names for backward compatibility (can be empty). These are used only by validation.Validation (class responsible of the release validation workflow) in case the reference file pointed by 'name' does not exist.

Definition at line 1758 of file plotting.py.

1759  def __init__(self, name, possibleDqmFolders, dqmSubFolders, plotFolder, fallbackNames):
1760  """
1761  Constructor
1762 
1763  Arguments:
1764  name -- Name of the folder (is used in the output directory naming)
1765  possibleDqmFolders -- List of strings for possible directories of histograms in TFiles
1766  dqmSubFolders -- List of lists of strings for list of subfolders per input file, or None if no subfolders
1767  plotFolder -- PlotFolder object
1768  fallbackNames -- List of names for backward compatibility (can be empty). These are used only by validation.Validation (class responsible of the release validation workflow) in case the reference file pointed by 'name' does not exist.
1769  """
1770  self._name = name
1771  self._possibleDqmFolders = possibleDqmFolders
1772  self._plotFolder = plotFolder
1773  #self._dqmSubFolders = [map(lambda sf: DQMSubFolder(sf, self._plotFolder.translateSubFolder(sf)), lst) for lst in dqmSubFolders]
1774  if dqmSubFolders is None:
1775  self._dqmSubFolders = None
1776  else:
1777  self._dqmSubFolders = map(lambda sf: DQMSubFolder(sf, self._plotFolder.translateSubFolder(sf)), dqmSubFolders[0])
1778  self._dqmSubFolders = filter(lambda sf: sf.translated is not None, self._dqmSubFolders)
1780  self._fallbackNames = fallbackNames
1781 
1782  # TODO: matchmaking of dqmsubfolders in case of differences between files

Member Function Documentation

def plotting.PlotterFolder.create (   self,
  files,
  labels,
  dqmSubFolder,
  isPileupSample = True,
  requireAllHistograms = False 
)
Create histograms from a list of TFiles.
Arguments:
files  -- List of TFiles
labels -- List of strings for legend labels corresponding the files
dqmSubFolder -- DQMSubFolder object for a subfolder (or None for no subfolder)
isPileupSample -- Is sample pileup (some PlotGroups may limit themselves to pileup)
requireAllHistograms -- If True, a plot is produced if histograms from all files are present (default: False)

Definition at line 1824 of file plotting.py.

References plotting.PlotterFolder._possibleDqmFolders.

1825  def create(self, files, labels, dqmSubFolder, isPileupSample=True, requireAllHistograms=False):
1826  """Create histograms from a list of TFiles.
1827  Arguments:
1828  files -- List of TFiles
1829  labels -- List of strings for legend labels corresponding the files
1830  dqmSubFolder -- DQMSubFolder object for a subfolder (or None for no subfolder)
1831  isPileupSample -- Is sample pileup (some PlotGroups may limit themselves to pileup)
1832  requireAllHistograms -- If True, a plot is produced if histograms from all files are present (default: False)
1833  """
1834 
1835  # TODO: for cases of differently named subfolders, need to think something here
1836  self._plotFolder.create(files, labels, self._possibleDqmFolders, dqmSubFolder.subfolder if dqmSubFolder is not None else None, isPileupSample, requireAllHistograms)
def plotting.PlotterFolder.draw (   self,
  args,
  kwargs 
)
Draw and save all plots using settings of a given algorithm.

Definition at line 1837 of file plotting.py.

1838  def draw(self, *args, **kwargs):
1839  """Draw and save all plots using settings of a given algorithm."""
1840  return self._plotFolder.draw(*args, **kwargs)
def plotting.PlotterFolder.getDQMSubFolders (   self,
  limitOnlyTo = None 
)
Get list of subfolders, possibly limiting to some of them.

Keyword arguments:
limitOnlyTo -- Object depending on the PlotFolder type for limiting the set of subfolders to be processed

Definition at line 1801 of file plotting.py.

References plotting.PlotterFolder._dqmSubFolders, and alcazmumu_cfi.filter.

1802  def getDQMSubFolders(self, limitOnlyTo=None):
1803  """Get list of subfolders, possibly limiting to some of them.
1804 
1805  Keyword arguments:
1806  limitOnlyTo -- Object depending on the PlotFolder type for limiting the set of subfolders to be processed
1807  """
1808 
1809  if self._dqmSubFolders is None:
1810  return [None]
1811 
1812  if limitOnlyTo is None:
1813  return self._dqmSubFolders
1814 
1815  return filter(lambda s: self._plotFolder.limitSubFolder(limitOnlyTo, s.translated), self._dqmSubFolders)
def plotting.PlotterFolder.getName (   self)

Definition at line 1783 of file plotting.py.

References FP420HitsObject._name, TrackerHitsObject._name, PGeometricDet::Item._name, LikelihoodSpecies._name, LikelihoodPdfProduct._name, LikelihoodPdf._name, citk::IsolationConeDefinitionBase._name, DrellYanValidation._name, WValidation._name, HistoParams< T >._name, CutApplicatorBase._name, ElectronMVAEstimatorRun2Phys14NonTrig._name, PhotonMVAEstimatorRun2Spring15NonTrig._name, PhotonMVAEstimatorRun2Phys14NonTrig._name, GeometricDetExtra._name, ElectronMVAEstimatorRun2Spring15Trig._name, ElectronMVAEstimatorRun2Spring15NonTrig._name, HistoParams< TH2F >._name, plotting.Subtract._name, HistoParams< TProfile2D >._name, plotting.FakeDuplicate._name, plotting.AggregateBins._name, plotting.AggregateHistos._name, plotting.ROC._name, Vispa.Views.PropertyView.Property._name, SequenceTypes.SequencePlaceholder._name, plotting.Plot._name, plotting.PlotGroup._name, and plotting.PlotterFolder._name.

1784  def getName(self):
1785  return self._name
def plotting.PlotterFolder.getPage (   self)

Definition at line 1789 of file plotting.py.

1790  def getPage(self):
1791  return self._plotFolder.getPage()
def plotting.PlotterFolder.getPossibleDQMFolders (   self)

Definition at line 1798 of file plotting.py.

References plotting.PlotterFolder._possibleDqmFolders.

1799  def getPossibleDQMFolders(self):
1800  return self._possibleDqmFolders
def plotting.PlotterFolder.getPurpose (   self)

Definition at line 1786 of file plotting.py.

1787  def getPurpose(self):
1788  return self._plotFolder.getPurpose()
def plotting.PlotterFolder.getSection (   self)

Definition at line 1792 of file plotting.py.

1793  def getSection(self):
1794  return self._plotFolder.getSection()
def plotting.PlotterFolder.getSelectionName (   self,
  dqmSubFolder 
)

Definition at line 1821 of file plotting.py.

References plotting.PlotterFolder.getSelectionNameIterator(), and GetRecoTauVFromDQM_MC_cff.next.

1822  def getSelectionName(self, dqmSubFolder):
1823  return self.getSelectionNameIterator(dqmSubFolder).next()
def plotting.PlotterFolder.getSelectionNameIterator (   self,
  dqmSubFolder 
)
Get a generator for the 'selection name', looping over the name and fallbackNames

Definition at line 1816 of file plotting.py.

References plotting.PlotterFolder._fallbackNames, TrackerHitsObject._name, FP420HitsObject._name, PGeometricDet::Item._name, LikelihoodSpecies._name, LikelihoodPdfProduct._name, LikelihoodPdf._name, citk::IsolationConeDefinitionBase._name, DrellYanValidation._name, WValidation._name, HistoParams< T >._name, CutApplicatorBase._name, ElectronMVAEstimatorRun2Phys14NonTrig._name, PhotonMVAEstimatorRun2Spring15NonTrig._name, PhotonMVAEstimatorRun2Phys14NonTrig._name, GeometricDetExtra._name, ElectronMVAEstimatorRun2Spring15Trig._name, ElectronMVAEstimatorRun2Spring15NonTrig._name, HistoParams< TH2F >._name, plotting.Subtract._name, HistoParams< TProfile2D >._name, plotting.FakeDuplicate._name, plotting.AggregateBins._name, plotting.AggregateHistos._name, plotting.ROC._name, Vispa.Views.PropertyView.Property._name, SequenceTypes.SequencePlaceholder._name, plotting.Plot._name, plotting.PlotGroup._name, and plotting.PlotterFolder._name.

Referenced by plotting.PlotterFolder.getSelectionName().

1817  def getSelectionNameIterator(self, dqmSubFolder):
1818  """Get a generator for the 'selection name', looping over the name and fallbackNames"""
1819  for name in [self._name]+self._fallbackNames:
1820  yield self._plotFolder.getSelectionName(name, dqmSubFolder.translated if dqmSubFolder is not None else None)
def plotting.PlotterFolder.onlyForPileup (   self)

Definition at line 1795 of file plotting.py.

1796  def onlyForPileup(self):
1797  return self._plotFolder.onlyForPileup()

Member Data Documentation

plotting.PlotterFolder._dqmSubFolders
private

Definition at line 1774 of file plotting.py.

Referenced by plotting.PlotterFolder.getDQMSubFolders().

plotting.PlotterFolder._fallbackNames
private

Definition at line 1779 of file plotting.py.

Referenced by plotting.PlotterFolder.getSelectionNameIterator(), and plotting.PlotterItem.readDirs().

plotting.PlotterFolder._name
private

Definition at line 1769 of file plotting.py.

Referenced by plotting.PlotterFolder.getName(), plotting.PlotterFolder.getSelectionNameIterator(), validation.SimpleSample.name(), and plotting.PlotterItem.readDirs().

plotting.PlotterFolder._plotFolder
private

Definition at line 1771 of file plotting.py.

Referenced by plotting.PlotterItem.readDirs().

plotting.PlotterFolder._possibleDqmFolders
private

Definition at line 1770 of file plotting.py.

Referenced by plotting.PlotterFolder.create(), and plotting.PlotterFolder.getPossibleDQMFolders().