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.PlotFolder Class Reference
Inheritance diagram for plotting.PlotFolder:
trackingPlots.TrackingPlotFolder

Public Member Functions

def __init__
 
def append
 
def create
 
def draw
 
def getNumberOfEventsHistogram
 
def getPage
 
def getPlotGroup
 
def getPlotGroups
 
def getPurpose
 
def getSection
 
def iterSelectionName
 
def limitSubFolder
 
def loopSubFolders
 
def onlyForConversion
 
def onlyForElectron
 
def onlyForPileup
 
def set
 
def translateSubFolder
 

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 2359 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 2361 of file plotting.py.

2362  def __init__(self, *plotGroups, **kwargs):
2363  """Constructor.
2364 
2365  Arguments:
2366  plotGroups -- List of PlotGroup objects
2367 
2368  Keyword arguments
2369  loopSubFolders -- Should the subfolders be looped over? (default: True)
2370  onlyForPileup -- Plots this folder only for pileup samples
2371  onlyForElectron -- Plots this folder only for electron samples
2372  onlyForConversion -- Plots this folder only for conversion samples
2373  purpose -- html.PlotPurpose member class for the purpose of the folder, used for grouping of the plots to the HTML pages
2374  page -- Optional string for the page in HTML generatin
2375  section -- Optional string for the section within a page in HTML generation
2376  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".
2377  """
2378  self._plotGroups = list(plotGroups)
2379  self._loopSubFolders = kwargs.pop("loopSubFolders", True)
2380  self._onlyForPileup = kwargs.pop("onlyForPileup", False)
2381  self._onlyForElectron = kwargs.pop("onlyForElectron", False)
2382  self._onlyForConversion = kwargs.pop("onlyForConversion", False)
2383  self._purpose = kwargs.pop("purpose", None)
2384  self._page = kwargs.pop("page", None)
2385  self._section = kwargs.pop("section", None)
2386  self._numberOfEventsHistogram = kwargs.pop("numberOfEventsHistogram", None)
2387  if len(kwargs) > 0:
2388  raise Exception("Got unexpected keyword arguments: "+ ",".join(kwargs.keys()))
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
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 2415 of file plotting.py.

Referenced by diclist.diclist.add(), and BeautifulSoup.Tag.setString().

2416  def append(self, plotGroup):
2417  self._plotGroups.append(plotGroup)
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 2430 of file plotting.py.

2431  def create(self, dirsNEvents, labels, isPileupSample=True, requireAllHistograms=False):
2432  """Create histograms from a list of TFiles.
2433 
2434  Arguments:
2435  dirsNEvents -- List of (TDirectory, nevents) pairs
2436  labels -- List of strings for legend labels corresponding the files
2437  isPileupSample -- Is sample pileup (some PlotGroups may limit themselves to pileup)
2438  requireAllHistograms -- If True, a plot is produced if histograms from all files are present (default: False)
2439  """
2440 
2441  if len(dirsNEvents) != len(labels):
2442  raise Exception("len(dirsNEvents) should be len(labels), now they are %d and %d" % (len(dirsNEvents), len(labels)))
2444  self._labels = labels
2445 
2446  for pg in self._plotGroups:
2447  if pg.onlyForPileup() and not isPileupSample:
2448  continue
2449  pg.create(dirsNEvents, requireAllHistograms)
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 2450 of file plotting.py.

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

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

Definition at line 2412 of file plotting.py.

References plotting.PlotFolder._numberOfEventsHistogram.

2413  def getNumberOfEventsHistogram(self):
2414  return self._numberOfEventsHistogram
def getNumberOfEventsHistogram
Definition: plotting.py:2412
def plotting.PlotFolder.getPage (   self)

Definition at line 2406 of file plotting.py.

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

2407  def getPage(self):
2408  return self._page
def plotting.PlotFolder.getPlotGroup (   self,
  name 
)

Definition at line 2424 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2425  def getPlotGroup(self, name):
2426  for pg in self._plotGroups:
2427  if pg.getName() == name:
2428  return pg
2429  raise Exception("No PlotGroup named '%s'" % name)
def plotting.PlotFolder.getPlotGroups (   self)

Definition at line 2421 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2422  def getPlotGroups(self):
2423  return self._plotGroups
def plotting.PlotFolder.getPurpose (   self)

Definition at line 2403 of file plotting.py.

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

2404  def getPurpose(self):
2405  return self._purpose
def plotting.PlotFolder.getSection (   self)

Definition at line 2409 of file plotting.py.

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

2410  def getSection(self):
2411  return self._section
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 2477 of file plotting.py.

2478  def iterSelectionName(self, plotFolderName, translatedDqmSubFolder):
2479  """Iterate over possible selections name (used in output directory name and legend) from the name of PlotterFolder, and a return value of translateSubFolder"""
2480  ret = ""
2481  if plotFolderName != "":
2482  ret += "_"+plotFolderName
2483  if translatedDqmSubFolder is not None:
2484  ret += "_"+translatedDqmSubFolder
2485  yield ret
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 2486 of file plotting.py.

2487  def limitSubFolder(self, limitOnlyTo, translatedDqmSubFolder):
2488  """Return True if this subfolder should be processed
2489 
2490  Arguments:
2491  limitOnlyTo -- List/set/similar containing the translatedDqmSubFolder
2492  translatedDqmSubFolder -- Return value of translateSubFolder
2493  """
2494  return translatedDqmSubFolder in limitOnlyTo
def plotting.PlotFolder.loopSubFolders (   self)
Return True if the PlotGroups of this folder should be applied to the all subfolders

Definition at line 2389 of file plotting.py.

References plotting.PlotFolder._loopSubFolders.

2390  def loopSubFolders(self):
2391  """Return True if the PlotGroups of this folder should be applied to the all subfolders"""
2392  return self._loopSubFolders
def plotting.PlotFolder.onlyForConversion (   self)

Definition at line 2400 of file plotting.py.

References plotting.PlotFolder._onlyForConversion.

2401  def onlyForConversion(self):
2402  return self._onlyForConversion
def plotting.PlotFolder.onlyForElectron (   self)

Definition at line 2397 of file plotting.py.

References plotting.PlotFolder._onlyForElectron.

2398  def onlyForElectron(self):
2399  return self._onlyForElectron
def plotting.PlotFolder.onlyForPileup (   self)
Return True if the folder is intended only for pileup samples

Definition at line 2393 of file plotting.py.

References plotting.PlotFolder._onlyForPileup.

2394  def onlyForPileup(self):
2395  """Return True if the folder is intended only for pileup samples"""
2396  return self._onlyForPileup
def plotting.PlotFolder.set (   self,
  plotGroups 
)

Definition at line 2418 of file plotting.py.

References plotting.PlotFolder._plotGroups.

2419  def set(self, plotGroups):
2420  self._plotGroups = plotGroups
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 2467 of file plotting.py.

2468  def translateSubFolder(self, dqmSubFolderName):
2469  """Method called to (possibly) translate a subfolder name to more 'readable' form
2470 
2471  The implementation in this (base) class just returns the
2472  argument. The idea is that a deriving class might want to do
2473  something more complex (like trackingPlots.TrackingPlotFolder
2474  does)
2475  """
2476  return dqmSubFolderName

Member Data Documentation

plotting.PlotFolder._labels
private

Definition at line 2443 of file plotting.py.

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

plotting.PlotFolder._loopSubFolders
private

Definition at line 2378 of file plotting.py.

Referenced by plotting.PlotFolder.loopSubFolders().

plotting.PlotFolder._numberOfEventsHistogram
private

Definition at line 2385 of file plotting.py.

Referenced by plotting.PlotFolder.getNumberOfEventsHistogram().

plotting.PlotFolder._onlyForConversion
private

Definition at line 2381 of file plotting.py.

Referenced by plotting.PlotFolder.onlyForConversion().

plotting.PlotFolder._onlyForElectron
private

Definition at line 2380 of file plotting.py.

Referenced by plotting.PlotFolder.onlyForElectron().

plotting.PlotFolder._onlyForPileup
private

Definition at line 2379 of file plotting.py.

Referenced by plotting.PlotGroup.onlyForPileup(), and plotting.PlotFolder.onlyForPileup().

plotting.PlotFolder._page
private

Definition at line 2383 of file plotting.py.

Referenced by vertexPlots.VertexSummaryTable.getPage(), trackingPlots.TrackingSummaryTable.getPage(), trackingPlots.TrackingTimingTable.getPage(), and plotting.PlotFolder.getPage().

plotting.PlotFolder._plotGroups
private

Definition at line 2377 of file plotting.py.

Referenced by plotting.PlotFolder.draw(), plotting.PlotFolder.getPlotGroup(), plotting.PlotFolder.getPlotGroups(), and plotting.PlotFolder.set().

plotting.PlotFolder._purpose
private

Definition at line 2382 of file plotting.py.

Referenced by vertexPlots.VertexSummaryTable.getPurpose(), trackingPlots.TrackingSummaryTable.getPurpose(), trackingPlots.TrackingTimingTable.getPurpose(), and plotting.PlotFolder.getPurpose().

plotting.PlotFolder._section
private

Definition at line 2384 of file plotting.py.

Referenced by trackingPlots.TrackingSummaryTable.getSection(), trackingPlots.TrackingTimingTable.getSection(), and plotting.PlotFolder.getSection().