CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Private Attributes
genericValidation.ValidationWithPlotsSummaryBase Class Reference
Inheritance diagram for genericValidation.ValidationWithPlotsSummaryBase:
genericValidation.ValidationWithPlots genericValidation.GenericValidation genericValidation.ValidationWithPlotsSummary offlineValidation.OfflineValidation trackSplittingValidation.TrackSplittingValidation offlineValidation.OfflineValidationDQM preexistingValidation.PreexistingOfflineValidation preexistingValidation.PreexistingTrackSplittingValidation

Classes

class  SummaryItem
 

Public Member Functions

def getsummaryitems (cls, folder)
 
def printsummaryitems (cls, args, kwargs)
 
def summaryitemsstring (cls, folder=None, latex=False, transpose=True)
 
def writesummaryitems (cls, filename, args, kwargs)
 
- Public Member Functions inherited from genericValidation.ValidationWithPlots
def appendToPlots (self)
 
def createPlottingScript (cls, validations)
 
def doRunPlots (cls, validations)
 
def plotsdirname (cls)
 
def plottingscriptname (cls)
 
def plottingscripttemplate (cls)
 
def runPlots (cls, validations)
 
- Public Member Functions inherited from genericValidation.GenericValidation
def __init__ (self, valName, alignment, config)
 
def createConfiguration (self, fileContents, path, schedule=None, repMap=None, repMaps=None)
 
def createCrabCfg (self, fileContents, path)
 
def createFiles (self, fileContents, path, repMap=None, repMaps=None)
 
def createScript (self, fileContents, path, downloadFiles=[], repMap=None, repMaps=None)
 
def filesToCompare (self)
 
def getCompareStrings (self, requestId=None, plain=False)
 
def getRepMap (self, alignment=None)
 

Static Private Attributes

 __lastfolder = None
 
 __summaryitems = None
 

Additional Inherited Members

- Public Attributes inherited from genericValidation.GenericValidation
 alignmentToValidate
 
 AutoAlternates
 
 cmssw
 
 cmsswreleasebase
 
 config
 
 configFiles
 
 crabConfigFiles
 
 general
 
 jobid
 
 jobmode
 
 name
 
 needsproxy
 
 NJobs
 
 packages
 
 randomWorkdirPart
 
 scramarch
 
 scriptFiles
 
- Static Public Attributes inherited from genericValidation.GenericValidation
string defaultReferenceName = "DEFAULT"
 
dictionary defaults
 
 mandatories = set()
 
dictionary needpackages = {"Alignment/OfflineValidation"}
 
dictionary optionals = {"jobmode"}
 

Detailed Description

Definition at line 628 of file genericValidation.py.

Member Function Documentation

def genericValidation.ValidationWithPlotsSummaryBase.getsummaryitems (   cls,
  folder 
)
override with a classmethod that returns a list of SummaryItems
   based on the plots saved in folder

Definition at line 671 of file genericValidation.py.

Referenced by genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

671  def getsummaryitems(cls, folder):
672  """override with a classmethod that returns a list of SummaryItems
673  based on the plots saved in folder"""
674 
def genericValidation.ValidationWithPlotsSummaryBase.printsummaryitems (   cls,
  args,
  kwargs 
)

Definition at line 731 of file genericValidation.py.

References genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

731  def printsummaryitems(cls, *args, **kwargs):
732  print cls.summaryitemsstring(*args, **kwargs)
def summaryitemsstring(cls, folder=None, latex=False, transpose=True)
def genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring (   cls,
  folder = None,
  latex = False,
  transpose = True 
)

Definition at line 679 of file genericValidation.py.

References genericValidation.ValidationWithPlotsSummaryBase.__lastfolder, genericValidation.ValidationWithPlotsSummaryBase.__summaryitems, genericValidation.ValidationWithPlotsSummaryBase.getsummaryitems(), join(), SiStripPI.max, and genericValidation.ValidationWithPlots.plotsdirname().

Referenced by genericValidation.ValidationWithPlotsSummaryBase.printsummaryitems(), and genericValidation.ValidationWithPlotsSummaryBase.writesummaryitems().

679  def summaryitemsstring(cls, folder=None, latex=False, transpose=True):
680  if folder is None: folder = cls.plotsdirname()
681  if folder.startswith( "/castor/" ):
682  folder = "rfio:%(file)s"%repMap
683  elif folder.startswith( "/store/" ):
684  folder = "root://eoscms.cern.ch//eos/cms%(file)s"%repMap
685 
686  if cls.__summaryitems is None or cls.__lastfolder != folder:
687  cls.__lastfolder = folder
688  cls.__summaryitems = cls.getsummaryitems(folder)
689 
690  summaryitems = cls.__summaryitems
691 
692  if not summaryitems:
693  raise AllInOneError("No summary items!")
694  size = {len(_.values(latex)) for _ in summaryitems}
695  if len(size) != 1:
696  raise AllInOneError("Some summary items have different numbers of values\n{}".format(size))
697  size = size.pop()
698 
699  if transpose:
700  columnwidths = ([max(len(_.name(latex)) for _ in summaryitems)]
701  + [max(len(_.value(i, latex)) for _ in summaryitems) for i in range(size)])
702  else:
703  columnwidths = [max(len(entry) for entry in [_.name(latex)] + _.values(latex)) for _ in summaryitems]
704 
705  if latex:
706  join = " & "
707  else:
708  join = " "
709  row = join.join("{{:{}}}".format(width) for width in columnwidths)
710 
711  if transpose:
712  rows = [row.format(*[_.name(latex)]+_.values(latex)) for _ in summaryitems]
713  else:
714  rows = []
715  rows.append(row.format(*(_.name for _ in summaryitems)))
716  for i in range(size):
717  rows.append(row.format(*(_.value(i, latex) for _ in summaryitems)))
718 
719  if latex:
720  join = " \\\\\n"
721  else:
722  join = "\n"
723  result = join.join(rows)
724  if latex:
725  result = (r"\begin{{tabular}}{{{}}}".format("|" + "|".join("c"*(len(columnwidths))) + "|") + "\n"
726  + result + "\n"
727  + r"\end{tabular}")
728  return result
729 
def summaryitemsstring(cls, folder=None, latex=False, transpose=True)
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def genericValidation.ValidationWithPlotsSummaryBase.writesummaryitems (   cls,
  filename,
  args,
  kwargs 
)

Definition at line 734 of file genericValidation.py.

References genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

734  def writesummaryitems(cls, filename, *args, **kwargs):
735  with open(filename, "w") as f:
736  f.write(cls.summaryitemsstring(*args, **kwargs)+"\n")
737 
def writesummaryitems(cls, filename, args, kwargs)
def summaryitemsstring(cls, folder=None, latex=False, transpose=True)

Member Data Documentation

genericValidation.ValidationWithPlotsSummaryBase.__lastfolder = None
staticprivate
genericValidation.ValidationWithPlotsSummaryBase.__summaryitems = None
staticprivate