CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
offlineValidation.OfflineValidation Class Reference
Inheritance diagram for offlineValidation.OfflineValidation:
genericValidation.GenericValidationData genericValidation.GenericValidation offlineValidation.OfflineValidationDQM

Public Member Functions

def __init__ (self, valName, alignment, config, addDefaults={}, addMandatories=[], configBaseName="TkAlOfflineValidation", scriptBaseName="TkAlOfflineValidation", crabCfgBaseName="TkAlOfflineValidation", resultBaseName="AlignmentValidation", outputBaseName="AlignmentValidation")
 
def appendToExtendedValidation (self, validationsSoFar="")
 
def appendToMerge (self, validationsSoFar="")
 
def createConfiguration (self, path)
 
def createCrabCfg (self, path)
 
def createScript (self, path)
 
def getRepMap (self, alignment=None)
 
- Public Member Functions inherited from genericValidation.GenericValidationData
def __init__ (self, valName, alignment, config, valType, addDefaults={}, addMandatories=[], addneedpackages=[])
 
def createCrabCfg (self, path, crabCfgBaseName)
 
def createScript (self, path, template=configTemplates.scriptTemplate, downloadFiles=[], repMap=None, repMaps=None)
 
def getRepMap (self, alignment=None)
 
- Public Member Functions inherited from genericValidation.GenericValidation
def __init__ (self, valName, alignment, config, valType, addDefaults={}, addMandatories=[], addneedpackages=[])
 
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 getCompareStrings (self, requestId=None, plain=False)
 
def getRepMap (self, alignment=None)
 

Public Attributes

 configBaseName
 
 crabCfgBaseName
 
 needParentFiles
 
 outputBaseName
 
 resultBaseName
 
 scriptBaseName
 
- Public Attributes inherited from genericValidation.GenericValidationData
 crabWorkingDir
 
 dataset
 
- Public Attributes inherited from genericValidation.GenericValidation
 alignmentToValidate
 
 AutoAlternates
 
 cmssw
 
 cmsswreleasebase
 
 config
 
 configFiles
 
 crabConfigFiles
 
 filesToCompare
 
 general
 
 jobid
 
 jobmode
 
 name
 
 NJobs
 
 packages
 
 randomWorkdirPart
 
 scramarch
 
 scriptFiles
 
 valType
 

Additional Inherited Members

- Static Public Attributes inherited from genericValidation.GenericValidation
string defaultReferenceName = "DEFAULT"
 

Detailed Description

Definition at line 9 of file offlineValidation.py.

Constructor & Destructor Documentation

def offlineValidation.OfflineValidation.__init__ (   self,
  valName,
  alignment,
  config,
  addDefaults = {},
  addMandatories = [],
  configBaseName = "TkAlOfflineValidation",
  scriptBaseName = "TkAlOfflineValidation",
  crabCfgBaseName = "TkAlOfflineValidation",
  resultBaseName = "AlignmentValidation",
  outputBaseName = "AlignmentValidation" 
)

Definition at line 12 of file offlineValidation.py.

12  resultBaseName = "AlignmentValidation", outputBaseName = "AlignmentValidation"):
13  defaults = {
14  "offlineModuleLevelHistsTransient":"False",
15  "offlineModuleLevelProfiles":"True",
16  "stripYResiduals":"False",
17  }
18  deprecateddefaults = {
19  "DMRMethod":"",
20  "DMRMinimum":"",
21  "DMROptions":"",
22  "OfflineTreeBaseDir":"",
23  "SurfaceShapes":"",
24  }
25 
26  mandatories = [ "trackcollection" ]
27  defaults.update(deprecateddefaults)
28  defaults.update(addDefaults)
29  mandatories += addMandatories
30  self.configBaseName = configBaseName
31  self.scriptBaseName = scriptBaseName
32  self.crabCfgBaseName = crabCfgBaseName
33  self.resultBaseName = resultBaseName
34  self.outputBaseName = outputBaseName
35  self.needParentFiles = False
36  GenericValidationData.__init__(self, valName, alignment, config,
37  "offline", addDefaults=defaults,
38  addMandatories=mandatories)
39 
40  for option in deprecateddefaults:
41  if self.general[option]:
42  raise AllInOneError("The '%s' option has been moved to the [plots:offline] section. Please specify it there."%option)
43  del self.general[option]
44 

Member Function Documentation

def offlineValidation.OfflineValidation.appendToExtendedValidation (   self,
  validationsSoFar = "" 
)
if no argument or "" is passed a string with an instantiation is
returned, else the validation is appended to the list

Definition at line 103 of file offlineValidation.py.

References genericValidation.GenericValidation.getRepMap(), and alignment.Alignment.getRepMap().

103  def appendToExtendedValidation( self, validationsSoFar = "" ):
104  """
105  if no argument or "" is passed a string with an instantiation is
106  returned, else the validation is appended to the list
107  """
108  repMap = self.getRepMap()
109  if validationsSoFar == "":
110  validationsSoFar = ('PlotAlignmentValidation p("root://eoscms//eos/cms%(finalResultFile)s",'
111  '"%(title)s", %(color)s, %(style)s, .oO[bigtext]Oo.);\n')%repMap
112  else:
113  validationsSoFar += (' p.loadFileList("root://eoscms//eos/cms%(finalResultFile)s", "%(title)s",'
114  '%(color)s, %(style)s);\n')%repMap
115  return validationsSoFar
116 
def appendToExtendedValidation(self, validationsSoFar="")
def getRepMap(self, alignment=None)
def offlineValidation.OfflineValidation.appendToMerge (   self,
  validationsSoFar = "" 
)
if no argument or "" is passed a string with an instantiation is returned,
else the validation is appended to the list

Definition at line 117 of file offlineValidation.py.

References genericValidation.GenericValidation.getRepMap(), alignment.Alignment.getRepMap(), and join().

117  def appendToMerge( self, validationsSoFar = "" ):
118  """
119  if no argument or "" is passed a string with an instantiation is returned,
120  else the validation is appended to the list
121  """
122  repMap = self.getRepMap()
123 
124  parameters = "root://eoscms//eos/cms" + ",root://eoscms//eos/cms".join(repMap["resultFiles"])
125 
126  mergedoutputfile = "root://eoscms//eos/cms%(finalResultFile)s"%repMap
127  validationsSoFar += ('root -x -b -q -l "TkAlOfflineJobsMerge.C(\\\"'
128  +parameters+'\\\",\\\"'+mergedoutputfile+'\\\")"'
129  +"\n")
130  return validationsSoFar
131 
def appendToMerge(self, validationsSoFar="")
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def getRepMap(self, alignment=None)
def offlineValidation.OfflineValidation.createConfiguration (   self,
  path 
)

Definition at line 45 of file offlineValidation.py.

References genericValidation.GenericValidation.AutoAlternates, monteCarloValidation.MonteCarloValidation.configBaseName, offlineValidation.OfflineValidation.configBaseName, genericValidation.GenericValidation.filesToCompare, genericValidation.GenericValidation.general, genericValidation.GenericValidation.getRepMap(), alignment.Alignment.getRepMap(), geometrydata.GeometryData.name, AlignableObjectId::entry.name, genericValidation.GenericValidation.name, alignment.Alignment.name, TrackerSectorStruct.name, classes.MonitorData.name, MuonGeometrySanityCheckPoint.name, classes.OutputData.name, geometry.Structure.name, plotscripts.SawTeethFunction.name, and genericValidation.GenericValidation.NJobs.

45  def createConfiguration(self, path):
46  cfgName = "%s.%s.%s_cfg.py"%( self.configBaseName, self.name,
47  self.alignmentToValidate.name )
48  repMap = self.getRepMap()
49  if self.NJobs > 1 and self.general["offlineModuleLevelHistsTransient"] == "True":
50  msg = ("To be able to merge results when running parallel jobs,"
51  " set offlineModuleLevelHistsTransient to false.")
52  raise AllInOneError(msg)
53 
54  templateToUse = configTemplates.offlineTemplate
55  if self.AutoAlternates:
56  if "Cosmics" in self.general["trackcollection"]:
57  Bfield = self.dataset.magneticFieldForRun()
58  if Bfield > 3.3 and Bfield < 4.3: #Should never be 4.3, but this covers strings, which always compare bigger than ints
59  templateToUse = configTemplates.CosmicsOfflineValidation
60  print ("B field for %s = %sT. Using the template for cosmics at 3.8T.\n"
61  "To override this behavior, specify AutoAlternates = false in the [alternateTemplates] section") % (self.dataset.name(), Bfield)
62  elif Bfield < 0.5:
63  templateToUse = configTemplates.CosmicsAt0TOfflineValidation
64  print ("B field for %s = %sT. Using the template for cosmics at 0T.\n"
65  "To override this behavior, specify AutoAlternates = false in the [alternateTemplates] section") % (self.dataset.name(), Bfield)
66  else:
67  try:
68  if "unknown " in Bfield:
69  msg = Bfield.replace("unknown ","",1)
70  elif "Bfield" is "unknown":
71  msg = "Can't get the B field for %s." % self.dataset.name()
72  except TypeError:
73  msg = "B field for %s = %sT. This is not that close to 0T or 3.8T." % (self.dataset.name(), Bfield)
74  raise AllInOneError(msg + "\n"
75  "To use this data, turn off the automatic alternates using AutoAlternates = false\n"
76  "in the [alternateTemplates] section, and choose the alternate template yourself.")
77 
78  cfgs = {cfgName: templateToUse}
79  self.filesToCompare[
80  GenericValidationData.defaultReferenceName ] = repMap["finalResultFile"]
81  return GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
82 
def getRepMap(self, alignment=None)
def offlineValidation.OfflineValidation.createCrabCfg (   self,
  path 
)

Definition at line 87 of file offlineValidation.py.

References monteCarloValidation.MonteCarloValidation.crabCfgBaseName, and offlineValidation.OfflineValidation.crabCfgBaseName.

87  def createCrabCfg(self, path):
88  return GenericValidationData.createCrabCfg(self, path, self.crabCfgBaseName)
89 
def offlineValidation.OfflineValidation.createScript (   self,
  path 
)

Definition at line 83 of file offlineValidation.py.

83  def createScript(self, path):
84  return GenericValidationData.createScript(self, path)
85 
86 
def offlineValidation.OfflineValidation.getRepMap (   self,
  alignment = None 
)

Definition at line 90 of file offlineValidation.py.

References genericValidation.GenericValidation.general.

Referenced by plottingOptions.PlottingOptionsTrackSplitting.validsubdets().

90  def getRepMap(self, alignment = None):
91  repMap = GenericValidationData.getRepMap(self, alignment)
92  repMap.update({
93  "nEvents": self.general["maxevents"],
94  "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
95  "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
96  "offlineValidationMode": "Standalone",
97  "offlineValidationFileOutput": configTemplates.offlineFileOutputTemplate,
98  "TrackCollection": self.general["trackcollection"],
99  })
100 
101  return repMap
102 
def getRepMap(self, alignment=None)

Member Data Documentation

offlineValidation.OfflineValidation.configBaseName
offlineValidation.OfflineValidation.crabCfgBaseName
offlineValidation.OfflineValidation.needParentFiles

Definition at line 35 of file offlineValidation.py.

offlineValidation.OfflineValidation.outputBaseName
offlineValidation.OfflineValidation.resultBaseName
offlineValidation.OfflineValidation.scriptBaseName