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 Member Functions | Private Attributes
validation.SimpleValidation Class Reference

Public Member Functions

def __init__
 
def createHtmlReport
 
def doPlots
 

Private Member Functions

def _doPlots
 

Private Attributes

 _files
 
 _labels
 
 _newdir
 
 _openFiles
 
 _plotterDrawArgs
 
 _subdirprefix
 

Detailed Description

Definition at line 767 of file validation.py.

Constructor & Destructor Documentation

def validation.SimpleValidation.__init__ (   self,
  files,
  labels,
  newdir 
)

Definition at line 768 of file validation.py.

769  def __init__(self, files, labels, newdir):
770  self._files = files
771  self._labels = labels
772  self._newdir = newdir

Member Function Documentation

def validation.SimpleValidation._doPlots (   self,
  plotterFolder,
  dqmSubFolder 
)
private

Definition at line 796 of file validation.py.

References DigiInvestigatorHistogramMaker._labels, SeedMultiplicityAnalyzer._labels, hitfit::Constraint_Intermed_Labels._labels, validation.SimpleValidation._labels, plotting.PlotFolder._labels, validation.SimpleValidation._newdir, validation.SimpleValidation._openFiles, validation.Validation._plotterDrawArgs, validation.SimpleValidation._plotterDrawArgs, validation.SimpleValidation._subdirprefix, and python.multivaluedict.map().

797  def _doPlots(self, plotterFolder, dqmSubFolder):
798  plotterFolder.create(self._openFiles, self._labels, dqmSubFolder)
799  fileList = plotterFolder.draw(**self._plotterDrawArgs)
800 
801  newsubdir = self._subdirprefix+plotterFolder.getSelectionName(dqmSubFolder)
802  newdir = os.path.join(self._newdir, newsubdir)
803 
804  print "Moving plots to %s" % newdir
805  if not os.path.exists(newdir):
806  os.makedirs(newdir)
807  for f in fileList:
808  shutil.move(f, os.path.join(newdir, f))
809  return map(lambda n: os.path.join(newsubdir, n), fileList)
def validation.SimpleValidation.createHtmlReport (   self,
  baseUrl = None,
  validationName = "" 
)

Definition at line 773 of file validation.py.

References validation.SimpleValidation._newdir.

774  def createHtmlReport(self, baseUrl=None, validationName=""):
775  return html.HtmlReport(validationName, self._newdir, baseUrl)
def validation.SimpleValidation.doPlots (   self,
  plotter,
  subdirprefix,
  plotterDrawArgs = {},
  htmlReport = html.HtmlReportDummy() 
)

Definition at line 776 of file validation.py.

777  def doPlots(self, plotter, subdirprefix, plotterDrawArgs={}, htmlReport=html.HtmlReportDummy()):
778  self._subdirprefix=subdirprefix
779  self._plotterDrawArgs = plotterDrawArgs
781  self._openFiles = []
782  for f in self._files:
783  if not os.path.exists(f):
784  print "File %s not found" % f
785  sys.exit(1)
786  self._openFiles.append(ROOT.TFile.Open(f))
787 
788  plotterInstance = plotter.readDirs(*self._openFiles)
789  for plotterFolder, dqmSubFolder in plotterInstance.iterFolders():
790  plotFiles = self._doPlots(plotterFolder, dqmSubFolder)
791  htmlReport.addPlots(plotterFolder, dqmSubFolder, plotFiles)
792 
793  for tf in self._openFiles:
794  tf.Close()
795  self._openFiles = []

Member Data Documentation

validation.SimpleValidation._files
private

Definition at line 769 of file validation.py.

validation.SimpleValidation._labels
private

Definition at line 770 of file validation.py.

Referenced by validation.SimpleValidation._doPlots().

validation.SimpleValidation._newdir
private

Definition at line 771 of file validation.py.

Referenced by validation.SimpleValidation._doPlots(), and validation.SimpleValidation.createHtmlReport().

validation.SimpleValidation._openFiles
private

Definition at line 780 of file validation.py.

Referenced by validation.SimpleValidation._doPlots().

validation.SimpleValidation._plotterDrawArgs
private

Definition at line 778 of file validation.py.

Referenced by validation.SimpleValidation._doPlots().

validation.SimpleValidation._subdirprefix
private

Definition at line 777 of file validation.py.

Referenced by validation.SimpleValidation._doPlots().