CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, plotGroups, kwargs)
 
def append (self, plotGroup)
 
def create (self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False)
 
def draw (self, prefix=None, separate=False, saveFormat=".pdf", ratio=True)
 
def getNumberOfEventsHistogram (self)
 
def getPage (self)
 
def getPlotGroup (self, name)
 
def getPlotGroups (self)
 
def getPurpose (self)
 
def getSection (self)
 
def iterSelectionName (self, plotFolderName, translatedDqmSubFolder)
 
def limitSubFolder (self, limitOnlyTo, translatedDqmSubFolder)
 
def loopSubFolders (self)
 
def onlyForConversion (self)
 
def onlyForElectron (self)
 
def onlyForPileup (self)
 
def set (self, plotGroups)
 
def translateSubFolder (self, dqmSubFolderName)
 

Private Attributes

 _labels
 
 _loopSubFolders
 
 _numberOfEventsHistogram
 
 _onlyForConversion
 
 _onlyForElectron
 
 _onlyForPileup
 
 _page
 
 _plotGroups
 
 _purpose
 
 _section
 

Detailed Description

Represents a collection of PlotGroups, produced from a single folder in a DQM file

Definition at line 2367 of file plotting.py.

Constructor & Destructor Documentation

def plotting.PlotFolder.__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
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".

Definition at line 2369 of file plotting.py.

2369  def __init__(self, *plotGroups, **kwargs):
2370  """Constructor.
2371 
2372  Arguments:
2373  plotGroups -- List of PlotGroup objects
2374 
2375  Keyword arguments
2376  loopSubFolders -- Should the subfolders be looped over? (default: True)
2377  onlyForPileup -- Plots this folder only for pileup samples
2378  onlyForElectron -- Plots this folder only for electron samples
2379  onlyForConversion -- Plots this folder only for conversion samples
2380  purpose -- html.PlotPurpose member class for the purpose of the folder, used for grouping of the plots to the HTML pages
2381  page -- Optional string for the page in HTML generatin
2382  section -- Optional string for the section within a page in HTML generation
2383  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".
2384  """
2385  self._plotGroups = list(plotGroups)
2386  self._loopSubFolders = kwargs.pop("loopSubFolders", True)
2387  self._onlyForPileup = kwargs.pop("onlyForPileup", False)
2388  self._onlyForElectron = kwargs.pop("onlyForElectron", False)
2389  self._onlyForConversion = kwargs.pop("onlyForConversion", False)
2390  self._purpose = kwargs.pop("purpose", None)
2391  self._page = kwargs.pop("page", None)
2392  self._section = kwargs.pop("section", None)
2393  self._numberOfEventsHistogram = kwargs.pop("numberOfEventsHistogram", None)
2394  if len(kwargs) > 0:
2395  raise Exception("Got unexpected keyword arguments: "+ ",".join(kwargs.keys()))
2396 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def __init__(self, plotGroups, kwargs)
Definition: plotting.py:2369
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Function Documentation

def plotting.PlotFolder.append (   self,
  plotGroup 
)

Definition at line 2423 of file plotting.py.

Referenced by diclist.diclist.add().

2423  def append(self, plotGroup):
2424  self._plotGroups.append(plotGroup)
2425 
def append(self, plotGroup)
Definition: plotting.py:2423
def plotting.PlotFolder.create (   self,
  dirsNEvents,
  labels,
  isPileupSample = True,
  requireAllHistograms = False 
)
Create histograms from a list of TFiles.

Arguments:
dirsNEvents   -- List of (TDirectory, nevents) pairs
labels -- List of strings for legend labels corresponding the files
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 2438 of file plotting.py.

2438  def create(self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False):
2439  """Create histograms from a list of TFiles.
2440 
2441  Arguments:
2442  dirsNEvents -- List of (TDirectory, nevents) pairs
2443  labels -- List of strings for legend labels corresponding the files
2444  isPileupSample -- Is sample pileup (some PlotGroups may limit themselves to pileup)
2445  requireAllHistograms -- If True, a plot is produced if histograms from all files are present (default: False)
2446  """
2447 
2448  if len(dirsNEvents) != len(labels):
2449  raise Exception("len(dirsNEvents) should be len(labels), now they are %d and %d" % (len(dirsNEvents), len(labels)))
2450 
2451  self._labels = labels
2452 
2453  for pg in self._plotGroups:
2454  if pg.onlyForPileup() and not isPileupSample:
2455  continue
2456  pg.create(dirsNEvents, requireAllHistograms)
2457 
def create(self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False)
Definition: plotting.py:2438
def plotting.PlotFolder.draw (   self,
  prefix = None,
  separate = False,
  saveFormat = ".pdf",
  ratio = True 
)
Draw and save all plots using settings of a given algorithm.

Arguments:
prefix   -- Optional string for file name prefix (default None)
separate -- Save the plots of a group to separate files instead of a file per group (default False)
saveFormat   -- String specifying the plot format (default '.pdf')
ratio    -- Add ratio to the plot (default True)

Definition at line 2458 of file plotting.py.

References DigiInvestigatorHistogramMaker._labels, SeedMultiplicityAnalyzer._labels, hitfit::Constraint_Intermed_Labels._labels, plotting.PlotFolder._labels, and plotting.PlotFolder._plotGroups.

2458  def draw(self, prefix=None, separate=False, saveFormat=".pdf", ratio=True):
2459  """Draw and save all plots using settings of a given algorithm.
2460 
2461  Arguments:
2462  prefix -- Optional string for file name prefix (default None)
2463  separate -- Save the plots of a group to separate files instead of a file per group (default False)
2464  saveFormat -- String specifying the plot format (default '.pdf')
2465  ratio -- Add ratio to the plot (default True)
2466  """
2467  ret = []
2468 
2469  for pg in self._plotGroups:
2470  ret.extend(pg.draw(self._labels, prefix=prefix, separate=separate, saveFormat=saveFormat, ratio=ratio))
2471  return ret
2472 
2473 
def draw(self, prefix=None, separate=False, saveFormat=".pdf", ratio=True)
Definition: plotting.py:2458
def plotting.PlotFolder.getNumberOfEventsHistogram (   self)

Definition at line 2420 of file plotting.py.

References plotting.PlotFolder._numberOfEventsHistogram.

2421  return self._numberOfEventsHistogram
2422 
def getNumberOfEventsHistogram(self)
Definition: plotting.py:2420
def plotting.PlotFolder.getPage (   self)

Definition at line 2414 of file plotting.py.

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

2414  def getPage(self):
2415  return self._page
2416 
def getPage(self)
Definition: plotting.py:2414
def plotting.PlotFolder.getPlotGroup (   self,
  name 
)

Definition at line 2432 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2432  def getPlotGroup(self, name):
2433  for pg in self._plotGroups:
2434  if pg.getName() == name:
2435  return pg
2436  raise Exception("No PlotGroup named '%s'" % name)
2437 
def getPlotGroup(self, name)
Definition: plotting.py:2432
def plotting.PlotFolder.getPlotGroups (   self)

Definition at line 2429 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2429  def getPlotGroups(self):
2430  return self._plotGroups
2431 
def getPlotGroups(self)
Definition: plotting.py:2429
def plotting.PlotFolder.getPurpose (   self)

Definition at line 2411 of file plotting.py.

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

2411  def getPurpose(self):
2412  return self._purpose
2413 
def getPurpose(self)
Definition: plotting.py:2411
def plotting.PlotFolder.getSection (   self)

Definition at line 2417 of file plotting.py.

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

2417  def getSection(self):
2418  return self._section
2419 
def getSection(self)
Definition: plotting.py:2417
def plotting.PlotFolder.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

Definition at line 2485 of file plotting.py.

2485  def iterSelectionName(self, plotFolderName, translatedDqmSubFolder):
2486  """Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder"""
2487  ret = ""
2488  if plotFolderName != "":
2489  ret += "_"+plotFolderName
2490  if translatedDqmSubFolder is not None:
2491  ret += "_"+translatedDqmSubFolder
2492  yield ret
2493 
def iterSelectionName(self, plotFolderName, translatedDqmSubFolder)
Definition: plotting.py:2485
def plotting.PlotFolder.limitSubFolder (   self,
  limitOnlyTo,
  translatedDqmSubFolder 
)
Return True if this subfolder should be processed

Arguments:
limitOnlyTo            -- List/set/similar containing the translatedDqmSubFolder 
translatedDqmSubFolder -- Return value of translateSubFolder

Definition at line 2494 of file plotting.py.

2494  def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder):
2495  """Return True if this subfolder should be processed
2496 
2497  Arguments:
2498  limitOnlyTo -- List/set/similar containing the translatedDqmSubFolder
2499  translatedDqmSubFolder -- Return value of translateSubFolder
2500  """
2501  return translatedDqmSubFolder in limitOnlyTo
2502 
def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder)
Definition: plotting.py:2494
def plotting.PlotFolder.loopSubFolders (   self)
Return True if the PlotGroups of this folder should be applied to the all subfolders

Definition at line 2397 of file plotting.py.

References plotting.PlotFolder._loopSubFolders.

2397  def loopSubFolders(self):
2398  """Return True if the PlotGroups of this folder should be applied to the all subfolders"""
2399  return self._loopSubFolders
2400 
def loopSubFolders(self)
Definition: plotting.py:2397
def plotting.PlotFolder.onlyForConversion (   self)

Definition at line 2408 of file plotting.py.

References plotting.PlotFolder._onlyForConversion.

2409  return self._onlyForConversion
2410 
def onlyForConversion(self)
Definition: plotting.py:2408
def plotting.PlotFolder.onlyForElectron (   self)

Definition at line 2405 of file plotting.py.

References plotting.PlotFolder._onlyForElectron.

2405  def onlyForElectron(self):
2406  return self._onlyForElectron
2407 
def onlyForElectron(self)
Definition: plotting.py:2405
def plotting.PlotFolder.onlyForPileup (   self)
Return True if the folder is intended only for pileup samples

Definition at line 2401 of file plotting.py.

References plotting.PlotFolder._onlyForPileup.

2401  def onlyForPileup(self):
2402  """Return True if the folder is intended only for pileup samples"""
2403  return self._onlyForPileup
2404 
def onlyForPileup(self)
Definition: plotting.py:2401
def plotting.PlotFolder.set (   self,
  plotGroups 
)

Definition at line 2426 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2426  def set(self, plotGroups):
2427  self._plotGroups = plotGroups
2428 
def set(self, plotGroups)
Definition: plotting.py:2426
def plotting.PlotFolder.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)

Definition at line 2475 of file plotting.py.

2475  def translateSubFolder(self, dqmSubFolderName):
2476  """Method called to (possibly) translate a subfolder name to more 'readable' form
2477 
2478  The implementation in this (base) class just returns the
2479  argument. The idea is that a deriving class might want to do
2480  something more complex (like trackingPlots.TrackingPlotFolder
2481  does)
2482  """
2483  return dqmSubFolderName
2484 
def translateSubFolder(self, dqmSubFolderName)
Definition: plotting.py:2475

Member Data Documentation

plotting.PlotFolder._labels
private

Definition at line 2451 of file plotting.py.

Referenced by validation.SimpleValidation._doPlots(), and plotting.PlotFolder.draw().

plotting.PlotFolder._loopSubFolders
private

Definition at line 2386 of file plotting.py.

Referenced by plotting.PlotFolder.loopSubFolders().

plotting.PlotFolder._numberOfEventsHistogram
private

Definition at line 2393 of file plotting.py.

Referenced by plotting.PlotFolder.getNumberOfEventsHistogram().

plotting.PlotFolder._onlyForConversion
private

Definition at line 2389 of file plotting.py.

Referenced by plotting.PlotFolder.onlyForConversion().

plotting.PlotFolder._onlyForElectron
private

Definition at line 2388 of file plotting.py.

Referenced by plotting.PlotFolder.onlyForElectron().

plotting.PlotFolder._onlyForPileup
private
plotting.PlotFolder._page
private
plotting.PlotFolder._plotGroups
private
plotting.PlotFolder._purpose
private
plotting.PlotFolder._section
private