CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
plotting.PlotterItem Class Reference

Public Member Functions

def __init__ (self, name, possibleDirs, plotFolder, fallbackNames=[], fallbackDqmSubFolders=[])
 
def appendTableCreator (self, tc)
 
def getName (self)
 
def getPlotFolder (self)
 
def readDirs (self, files)
 

Private Attributes

 _fallbackDqmSubFolders
 
 _fallbackNames
 
 _name
 
 _plotFolder
 
 _possibleDirs
 
 _tableCreators
 

Detailed Description

Definition at line 2839 of file plotting.py.

Constructor & Destructor Documentation

def plotting.PlotterItem.__init__ (   self,
  name,
  possibleDirs,
  plotFolder,
  fallbackNames = [],
  fallbackDqmSubFolders = [] 
)
Constructor

Arguments:
name          -- Name of the folder (is used in the output directory naming)
possibleDirs  -- List of strings for possible directories of histograms in TFiles
plotFolder    -- PlotFolder object

Keyword arguments
fallbackNames -- Optional list of names for backward compatibility. 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.
fallbackDqmSubFolders -- Optional list of functions for (string->string) mapping the subfolder names found in the first file to another names (function should return None for no mapping). Use case is comparing files that have different iteration naming convention.

Definition at line 2840 of file plotting.py.

2840  def __init__(self, name, possibleDirs, plotFolder, fallbackNames=[], fallbackDqmSubFolders=[]):
2841  """ Constructor
2842 
2843  Arguments:
2844  name -- Name of the folder (is used in the output directory naming)
2845  possibleDirs -- List of strings for possible directories of histograms in TFiles
2846  plotFolder -- PlotFolder object
2847 
2848  Keyword arguments
2849  fallbackNames -- Optional list of names for backward compatibility. 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.
2850  fallbackDqmSubFolders -- Optional list of functions for (string->string) mapping the subfolder names found in the first file to another names (function should return None for no mapping). Use case is comparing files that have different iteration naming convention.
2851  """
2852  self._name = name
2853  self._possibleDirs = possibleDirs
2854  self._plotFolder = plotFolder
2855  self._fallbackNames = fallbackNames
2856  self._fallbackDqmSubFolders = fallbackDqmSubFolders
2857  self._tableCreators = []
2858 
def __init__(self, name, possibleDirs, plotFolder, fallbackNames=[], fallbackDqmSubFolders=[])
Definition: plotting.py:2840

Member Function Documentation

def plotting.PlotterItem.appendTableCreator (   self,
  tc 
)

Definition at line 2865 of file plotting.py.

2865  def appendTableCreator(self, tc):
2866  self._tableCreators.append(tc)
2867 
def appendTableCreator(self, tc)
Definition: plotting.py:2865
def plotting.PlotterItem.getName (   self)
def plotting.PlotterItem.getPlotFolder (   self)

Definition at line 2862 of file plotting.py.

References plotting.PlotterFolder._plotFolder, and plotting.PlotterItem._plotFolder.

2862  def getPlotFolder(self):
2863  return self._plotFolder
2864 
def getPlotFolder(self)
Definition: plotting.py:2862
def plotting.PlotterItem.readDirs (   self,
  files 
)
Read available subfolders from the files

Arguments:
files -- List of strings for paths to files, or list of TFiles

For each file, loop over 'possibleDirs', and read the
subfolders of first one that exists.

Returns a PlotterFolder if at least one file for which one of
'possibleDirs' exists. Otherwise, return None to signal that
there is nothing available for this PlotFolder.

Definition at line 2868 of file plotting.py.

References plotting.PlotterFolder._fallbackDqmSubFolders, plotting.PlotterItem._fallbackDqmSubFolders, plotting.PlotterFolder._fallbackNames, plotting.PlotterItem._fallbackNames, FP420HitsObject._name, TrackerHitsObject._name, PGeometricDet::Item._name, TrackingRecHitAlgorithm._name, LikelihoodSpecies._name, LikelihoodPdfProduct._name, LikelihoodPdf._name, citk::IsolationConeDefinitionBase._name, Logger._name, hcaldqm::DQModule._name, DrellYanValidation._name, WValidation._name, HistoParams< T >._name, hcaldqm::flag::Flag._name, hcaldqm::quantity::Quantity._name, ElectronMVAEstimatorRun2Phys14NonTrig._name, CutApplicatorBase._name, PhotonMVAEstimatorRun2Spring15NonTrig._name, PhotonMVAEstimatorRun2Phys14NonTrig._name, ElectronMVAEstimatorRun2Spring15Trig._name, ElectronMVAEstimatorRun2Spring15NonTrig._name, GeometricDetExtra._name, HistoParams< TH2F >._name, HistoParams< TProfile2D >._name, Vispa.Views.PropertyView.Property._name, SequenceTypes.SequencePlaceholder._name, plotting.Subtract._name, plotting.Transform._name, plotting.FakeDuplicate._name, plotting.CutEfficiency._name, plotting.AggregateBins._name, plotting.AggregateHistos._name, plotting.ROC._name, SequenceTypes.TaskPlaceholder._name, plotting.Plot._name, plotting.PlotGroup._name, plotting.PlotterFolder._name, plotting.PlotterItem._name, plotting.PlotterFolder._plotFolder, plotting.PlotterItem._plotFolder, plotting.PlotterItem._possibleDirs, plotting.PlotterFolder._tableCreators, and plotting.PlotterItem._tableCreators.

2868  def readDirs(self, files):
2869  """Read available subfolders from the files
2870 
2871  Arguments:
2872  files -- List of strings for paths to files, or list of TFiles
2873 
2874  For each file, loop over 'possibleDirs', and read the
2875  subfolders of first one that exists.
2876 
2877  Returns a PlotterFolder if at least one file for which one of
2878  'possibleDirs' exists. Otherwise, return None to signal that
2879  there is nothing available for this PlotFolder.
2880  """
2881  subFolders = None
2882  if self._plotFolder.loopSubFolders():
2883  subFolders = []
2884  possibleDirFound = False
2885  for fname in files:
2886  if fname is None:
2887  continue
2888 
2889  isOpenFile = isinstance(fname, ROOT.TFile)
2890  if isOpenFile:
2891  tfile = fname
2892  else:
2893  tfile = ROOT.TFile.Open(fname)
2894  for pd in self._possibleDirs:
2895  d = tfile.Get(pd)
2896  if d:
2897  possibleDirFound = True
2898  if subFolders is not None:
2899  subf = []
2900  for key in d.GetListOfKeys():
2901  if isinstance(key.ReadObj(), ROOT.TDirectory):
2902  subf.append(key.GetName())
2903  subFolders.append(subf)
2904  break
2905 
2906  if not isOpenFile:
2907  tfile.Close()
2908 
2909  if not possibleDirFound:
2910  return None
2911 
2912  return PlotterFolder(self._name, self._possibleDirs, subFolders, self._plotFolder, self._fallbackNames, self._fallbackDqmSubFolders, self._tableCreators)
2913 
def readDirs(self, files)
Definition: plotting.py:2868

Member Data Documentation

plotting.PlotterItem._fallbackDqmSubFolders
private

Definition at line 2856 of file plotting.py.

Referenced by plotting.PlotterItem.readDirs().

plotting.PlotterItem._fallbackNames
private

Definition at line 2855 of file plotting.py.

Referenced by plotting.PlotterItem.readDirs().

plotting.PlotterItem._name
private
plotting.PlotterItem._plotFolder
private
plotting.PlotterItem._possibleDirs
private
plotting.PlotterItem._tableCreators
private

Definition at line 2857 of file plotting.py.

Referenced by plotting.PlotterItem.readDirs().