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, directory="")
 
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 onlyForBHadron (self)
 
def onlyForConversion (self)
 
def onlyForElectron (self)
 
def onlyForPileup (self)
 
def set (self, plotGroups)
 
def translateSubFolder (self, dqmSubFolderName)
 

Private Attributes

 _labels
 
 _loopSubFolders
 
 _numberOfEventsHistogram
 
 _onlyForBHadron
 
 _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 2536 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
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".

Definition at line 2539 of file plotting.py.

2539  def __init__(self, *plotGroups, **kwargs):
2540  """Constructor.
2541 
2542  Arguments:
2543  plotGroups -- List of PlotGroup objects
2544 
2545  Keyword arguments
2546  loopSubFolders -- Should the subfolders be looped over? (default: True)
2547  onlyForPileup -- Plots this folder only for pileup samples
2548  onlyForElectron -- Plots this folder only for electron samples
2549  onlyForConversion -- Plots this folder only for conversion samples
2550  onlyForBHadron -- Plots this folder only for B-hadron samples
2551  purpose -- html.PlotPurpose member class for the purpose of the folder, used for grouping of the plots to the HTML pages
2552  page -- Optional string for the page in HTML generatin
2553  section -- Optional string for the section within a page in HTML generation
2554  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".
2555  """
2556  self._plotGroups = list(plotGroups)
2557  self._loopSubFolders = kwargs.pop("loopSubFolders", True)
2558  self._onlyForPileup = kwargs.pop("onlyForPileup", False)
2559  self._onlyForElectron = kwargs.pop("onlyForElectron", False)
2560  self._onlyForConversion = kwargs.pop("onlyForConversion", False)
2561  self._onlyForBHadron = kwargs.pop("onlyForBHadron", False)
2562  self._purpose = kwargs.pop("purpose", None)
2563  self._page = kwargs.pop("page", None)
2564  self._section = kwargs.pop("section", None)
2565  self._numberOfEventsHistogram = kwargs.pop("numberOfEventsHistogram", None)
2566  if len(kwargs) > 0:
2567  raise Exception("Got unexpected keyword arguments: "+ ",".join(kwargs.keys()))
2568 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def __init__(self, plotGroups, kwargs)
Definition: plotting.py:2539
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 2598 of file plotting.py.

Referenced by diclist.diclist.add().

2598  def append(self, plotGroup):
2599  self._plotGroups.append(plotGroup)
2600 
def append(self, plotGroup)
Definition: plotting.py:2598
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 2613 of file plotting.py.

2613  def create(self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False):
2614  """Create histograms from a list of TFiles.
2615 
2616  Arguments:
2617  dirsNEvents -- List of (TDirectory, nevents) pairs
2618  labels -- List of strings for legend labels corresponding the files
2619  isPileupSample -- Is sample pileup (some PlotGroups may limit themselves to pileup)
2620  requireAllHistograms -- If True, a plot is produced if histograms from all files are present (default: False)
2621  """
2622 
2623  if len(dirsNEvents) != len(labels):
2624  raise Exception("len(dirsNEvents) should be len(labels), now they are %d and %d" % (len(dirsNEvents), len(labels)))
2625 
2626  self._labels = labels
2627 
2628  for pg in self._plotGroups:
2629  if pg.onlyForPileup() and not isPileupSample:
2630  continue
2631  pg.create(dirsNEvents, requireAllHistograms)
2632 
def create(self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False)
Definition: plotting.py:2613
def plotting.PlotFolder.draw (   self,
  prefix = None,
  separate = False,
  saveFormat = ".pdf",
  ratio = True,
  directory = "" 
)
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)
directory -- Directory where to save the file (default "")

Definition at line 2633 of file plotting.py.

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

2633  def draw(self, prefix=None, separate=False, saveFormat=".pdf", ratio=True, directory=""):
2634  """Draw and save all plots using settings of a given algorithm.
2635 
2636  Arguments:
2637  prefix -- Optional string for file name prefix (default None)
2638  separate -- Save the plots of a group to separate files instead of a file per group (default False)
2639  saveFormat -- String specifying the plot format (default '.pdf')
2640  ratio -- Add ratio to the plot (default True)
2641  directory -- Directory where to save the file (default "")
2642  """
2643  ret = []
2644 
2645  for pg in self._plotGroups:
2646  ret.extend(pg.draw(self._labels, prefix=prefix, separate=separate, saveFormat=saveFormat, ratio=ratio, directory=directory))
2647  return ret
2648 
2649 
def draw(self, prefix=None, separate=False, saveFormat=".pdf", ratio=True, directory="")
Definition: plotting.py:2633
def plotting.PlotFolder.getNumberOfEventsHistogram (   self)

Definition at line 2595 of file plotting.py.

References plotting.PlotFolder._numberOfEventsHistogram.

2596  return self._numberOfEventsHistogram
2597 
def getNumberOfEventsHistogram(self)
Definition: plotting.py:2595
def plotting.PlotFolder.getPage (   self)

Definition at line 2589 of file plotting.py.

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

2589  def getPage(self):
2590  return self._page
2591 
def getPage(self)
Definition: plotting.py:2589
def plotting.PlotFolder.getPlotGroup (   self,
  name 
)

Definition at line 2607 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2607  def getPlotGroup(self, name):
2608  for pg in self._plotGroups:
2609  if pg.getName() == name:
2610  return pg
2611  raise Exception("No PlotGroup named '%s'" % name)
2612 
def getPlotGroup(self, name)
Definition: plotting.py:2607
def plotting.PlotFolder.getPlotGroups (   self)

Definition at line 2604 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2604  def getPlotGroups(self):
2605  return self._plotGroups
2606 
def getPlotGroups(self)
Definition: plotting.py:2604
def plotting.PlotFolder.getPurpose (   self)

Definition at line 2586 of file plotting.py.

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

2586  def getPurpose(self):
2587  return self._purpose
2588 
def getPurpose(self)
Definition: plotting.py:2586
def plotting.PlotFolder.getSection (   self)

Definition at line 2592 of file plotting.py.

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

2592  def getSection(self):
2593  return self._section
2594 
def getSection(self)
Definition: plotting.py:2592
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 2661 of file plotting.py.

2661  def iterSelectionName(self, plotFolderName, translatedDqmSubFolder):
2662  """Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder"""
2663  ret = ""
2664  if plotFolderName != "":
2665  ret += "_"+plotFolderName
2666  if translatedDqmSubFolder is not None:
2667  ret += "_"+translatedDqmSubFolder
2668  yield ret
2669 
def iterSelectionName(self, plotFolderName, translatedDqmSubFolder)
Definition: plotting.py:2661
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 2670 of file plotting.py.

2670  def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder):
2671  """Return True if this subfolder should be processed
2672 
2673  Arguments:
2674  limitOnlyTo -- List/set/similar containing the translatedDqmSubFolder
2675  translatedDqmSubFolder -- Return value of translateSubFolder
2676  """
2677  return translatedDqmSubFolder in limitOnlyTo
2678 
def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder)
Definition: plotting.py:2670
def plotting.PlotFolder.loopSubFolders (   self)
Return True if the PlotGroups of this folder should be applied to the all subfolders

Definition at line 2569 of file plotting.py.

References plotting.PlotFolder._loopSubFolders.

2569  def loopSubFolders(self):
2570  """Return True if the PlotGroups of this folder should be applied to the all subfolders"""
2571  return self._loopSubFolders
2572 
def loopSubFolders(self)
Definition: plotting.py:2569
def plotting.PlotFolder.onlyForBHadron (   self)

Definition at line 2583 of file plotting.py.

References plotting.PlotFolder._onlyForBHadron.

2583  def onlyForBHadron(self):
2584  return self._onlyForBHadron
2585 
def onlyForBHadron(self)
Definition: plotting.py:2583
def plotting.PlotFolder.onlyForConversion (   self)

Definition at line 2580 of file plotting.py.

References plotting.PlotFolder._onlyForConversion.

2581  return self._onlyForConversion
2582 
def onlyForConversion(self)
Definition: plotting.py:2580
def plotting.PlotFolder.onlyForElectron (   self)

Definition at line 2577 of file plotting.py.

References plotting.PlotFolder._onlyForElectron.

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

Definition at line 2573 of file plotting.py.

References plotting.PlotFolder._onlyForPileup.

2573  def onlyForPileup(self):
2574  """Return True if the folder is intended only for pileup samples"""
2575  return self._onlyForPileup
2576 
def onlyForPileup(self)
Definition: plotting.py:2573
def plotting.PlotFolder.set (   self,
  plotGroups 
)

Definition at line 2601 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2601  def set(self, plotGroups):
2602  self._plotGroups = plotGroups
2603 
def set(self, plotGroups)
Definition: plotting.py:2601
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 2651 of file plotting.py.

2651  def translateSubFolder(self, dqmSubFolderName):
2652  """Method called to (possibly) translate a subfolder name to more 'readable' form
2653 
2654  The implementation in this (base) class just returns the
2655  argument. The idea is that a deriving class might want to do
2656  something more complex (like trackingPlots.TrackingPlotFolder
2657  does)
2658  """
2659  return dqmSubFolderName
2660 
def translateSubFolder(self, dqmSubFolderName)
Definition: plotting.py:2651

Member Data Documentation

plotting.PlotFolder._labels
private

Definition at line 2626 of file plotting.py.

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

plotting.PlotFolder._loopSubFolders
private

Definition at line 2557 of file plotting.py.

Referenced by plotting.PlotFolder.loopSubFolders().

plotting.PlotFolder._numberOfEventsHistogram
private

Definition at line 2565 of file plotting.py.

Referenced by plotting.PlotFolder.getNumberOfEventsHistogram().

plotting.PlotFolder._onlyForBHadron
private

Definition at line 2561 of file plotting.py.

Referenced by plotting.PlotFolder.onlyForBHadron().

plotting.PlotFolder._onlyForConversion
private

Definition at line 2560 of file plotting.py.

Referenced by plotting.PlotFolder.onlyForConversion().

plotting.PlotFolder._onlyForElectron
private

Definition at line 2559 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