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 636 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 679 of file genericValidation.py.

Referenced by genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

679  def getsummaryitems(cls, folder):
680  """override with a classmethod that returns a list of SummaryItems
681  based on the plots saved in folder"""
682 
def genericValidation.ValidationWithPlotsSummaryBase.printsummaryitems (   cls,
  args,
  kwargs 
)

Definition at line 739 of file genericValidation.py.

References edm.print(), and genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

739  def printsummaryitems(cls, *args, **kwargs):
740  print(cls.summaryitemsstring(*args, **kwargs))
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def summaryitemsstring(cls, folder=None, latex=False, transpose=True)
def genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring (   cls,
  folder = None,
  latex = False,
  transpose = True 
)

Definition at line 687 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().

687  def summaryitemsstring(cls, folder=None, latex=False, transpose=True):
688  if folder is None: folder = cls.plotsdirname()
689  if folder.startswith( "/castor/" ):
690  folder = "rfio:%(file)s"%repMap
691  elif folder.startswith( "/store/" ):
692  folder = "root://eoscms.cern.ch//eos/cms%(file)s"%repMap
693 
694  if cls.__summaryitems is None or cls.__lastfolder != folder:
695  cls.__lastfolder = folder
696  cls.__summaryitems = cls.getsummaryitems(folder)
697 
698  summaryitems = cls.__summaryitems
699 
700  if not summaryitems:
701  raise AllInOneError("No summary items!")
702  size = {len(_.values(latex)) for _ in summaryitems}
703  if len(size) != 1:
704  raise AllInOneError("Some summary items have different numbers of values\n{}".format(size))
705  size = size.pop()
706 
707  if transpose:
708  columnwidths = ([max(len(_.name(latex)) for _ in summaryitems)]
709  + [max(len(_.value(i, latex)) for _ in summaryitems) for i in range(size)])
710  else:
711  columnwidths = [max(len(entry) for entry in [_.name(latex)] + _.values(latex)) for _ in summaryitems]
712 
713  if latex:
714  join = " & "
715  else:
716  join = " "
717  row = join.join("{{:{}}}".format(width) for width in columnwidths)
718 
719  if transpose:
720  rows = [row.format(*[_.name(latex)]+_.values(latex)) for _ in summaryitems]
721  else:
722  rows = []
723  rows.append(row.format(*(_.name for _ in summaryitems)))
724  for i in range(size):
725  rows.append(row.format(*(_.value(i, latex) for _ in summaryitems)))
726 
727  if latex:
728  join = " \\\\\n"
729  else:
730  join = "\n"
731  result = join.join(rows)
732  if latex:
733  result = (r"\begin{{tabular}}{{{}}}".format("|" + "|".join("c"*(len(columnwidths))) + "|") + "\n"
734  + result + "\n"
735  + r"\end{tabular}")
736  return result
737 
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 742 of file genericValidation.py.

References genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

742  def writesummaryitems(cls, filename, *args, **kwargs):
743  with open(filename, "w") as f:
744  f.write(cls.summaryitemsstring(*args, **kwargs)+"\n")
745 
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