CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

Classes

class  SummaryItem
 

Public Member Functions

def getsummaryitems
 
def printsummaryitems
 
def summaryitemsstring
 
def writesummaryitems
 
- Public Member Functions inherited from genericValidation.ValidationWithPlots
def appendToPlots
 
def createPlottingScript
 
def doRunPlots
 
def plotsdirname
 
def plottingscriptname
 
def plottingscripttemplate
 
def runPlots
 
- Public Member Functions inherited from genericValidation.GenericValidation
def __init__
 
def createConfiguration
 
def createCrabCfg
 
def createFiles
 
def createScript
 
def filesToCompare
 
def getCompareStrings
 
def getRepMap
 
- Public Member Functions inherited from genericValidation.ValidationMetaClass
def __new__
 

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
 
tuple 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

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

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

Definition at line 740 of file genericValidation.py.

References print().

741  def printsummaryitems(cls, *args, **kwargs):
print(cls.summaryitemsstring(*args, **kwargs))
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def genericValidation.ValidationWithPlotsSummaryBase.summaryitemsstring (   cls,
  folder = None,
  latex = False,
  transpose = True 
)

Definition at line 688 of file genericValidation.py.

References join(), SiStripPI.max, and sistrip::SpyUtilities.range().

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

Definition at line 743 of file genericValidation.py.

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

Member Data Documentation

genericValidation.ValidationWithPlotsSummaryBase.__lastfolder = None
staticprivate

Definition at line 685 of file genericValidation.py.

genericValidation.ValidationWithPlotsSummaryBase.__summaryitems = None
staticprivate

Definition at line 684 of file genericValidation.py.