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.ValidationMetaClass 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)
 
- Public Member Functions inherited from genericValidation.ValidationMetaClass
def __new__ (cls, clsname, bases, dct)
 

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"}
 
- Static Public Attributes inherited from genericValidation.ValidationMetaClass
list dicts = ["defaults"]
 
list sets = ["mandatories", "optionals", "needpackages"]
 

Detailed Description

Definition at line 637 of file genericValidation.py.

Member Function Documentation

◆ getsummaryitems()

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

Reimplemented in genericValidation.ValidationWithPlotsSummary.

Definition at line 680 of file genericValidation.py.

680  def getsummaryitems(cls, folder):
681  """override with a classmethod that returns a list of SummaryItems
682  based on the plots saved in folder"""
683 

Referenced by genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

◆ printsummaryitems()

def genericValidation.ValidationWithPlotsSummaryBase.printsummaryitems (   cls,
args,
**  kwargs 
)

Definition at line 740 of file genericValidation.py.

740  def printsummaryitems(cls, *args, **kwargs):
741  print(cls.summaryitemsstring(*args, **kwargs))

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

◆ summaryitemsstring()

def genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring (   cls,
  folder = None,
  latex = False,
  transpose = True 
)

Definition at line 688 of file genericValidation.py.

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

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

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

◆ writesummaryitems()

def genericValidation.ValidationWithPlotsSummaryBase.writesummaryitems (   cls,
  filename,
args,
**  kwargs 
)

Definition at line 743 of file genericValidation.py.

743  def writesummaryitems(cls, filename, *args, **kwargs):
744  with open(filename, "w") as f:
745  f.write(cls.summaryitemsstring(*args, **kwargs)+"\n")
746 

References genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring().

Member Data Documentation

◆ __lastfolder

genericValidation.ValidationWithPlotsSummaryBase.__lastfolder = None
staticprivate

◆ __summaryitems

genericValidation.ValidationWithPlotsSummaryBase.__summaryitems = None
staticprivate
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
join
static std::string join(char **cmd)
Definition: RemoteFile.cc:17
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
format