CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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__
 
def appendToExtendedValidation
 
def appendToMerge
 
def createConfiguration
 
def createCrabCfg
 
def createScript
 
def getRepMap
 
- Public Member Functions inherited from genericValidation.GenericValidationData
def __init__
 
def createCrabCfg
 
def createScript
 
def getRepMap
 
- Public Member Functions inherited from genericValidation.GenericValidation
def __init__
 
def createConfiguration
 
def createCrabCfg
 
def createFiles
 
def createScript
 
def getCompareStrings
 
def getRepMap
 

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

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().

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

118  def appendToMerge( self, validationsSoFar = "" ):
119  """
120  if no argument or "" is passed a string with an instantiation is returned,
121  else the validation is appended to the list
122  """
123  repMap = self.getRepMap()
124 
125  parameters = "root://eoscms//eos/cms" + ",root://eoscms//eos/cms".join(repMap["resultFiles"])
126 
127  mergedoutputfile = "root://eoscms//eos/cms%(finalResultFile)s"%repMap
128  validationsSoFar += ('root -x -b -q -l "TkAlOfflineJobsMerge.C(\\\"'
129  +parameters+'\\\",\\\"'+mergedoutputfile+'\\\")"'
130  +"\n")
131  return validationsSoFar
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
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(), entry.name, geometrydata.GeometryData.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 
46  def createConfiguration(self, path):
47  cfgName = "%s.%s.%s_cfg.py"%( self.configBaseName, self.name,
48  self.alignmentToValidate.name )
49  repMap = self.getRepMap()
50  if self.NJobs > 1 and self.general["offlineModuleLevelHistsTransient"] == "True":
51  msg = ("To be able to merge results when running parallel jobs,"
52  " set offlineModuleLevelHistsTransient to false.")
53  raise AllInOneError(msg)
54 
55  templateToUse = configTemplates.offlineTemplate
56  if self.AutoAlternates:
57  if "Cosmics" in self.general["trackcollection"]:
58  Bfield = self.dataset.magneticFieldForRun()
59  if Bfield > 3.3 and Bfield < 4.3: #Should never be 4.3, but this covers strings, which always compare bigger than ints
60  templateToUse = configTemplates.CosmicsOfflineValidation
61  print ("B field for %s = %sT. Using the template for cosmics at 3.8T.\n"
62  "To override this behavior, specify AutoAlternates = false in the [alternateTemplates] section") % (self.dataset.name(), Bfield)
63  elif Bfield < 0.5:
64  templateToUse = configTemplates.CosmicsAt0TOfflineValidation
65  print ("B field for %s = %sT. Using the template for cosmics at 0T.\n"
66  "To override this behavior, specify AutoAlternates = false in the [alternateTemplates] section") % (self.dataset.name(), Bfield)
67  else:
68  try:
69  if "unknown " in Bfield:
70  msg = Bfield.replace("unknown ","",1)
71  elif "Bfield" is "unknown":
72  msg = "Can't get the B field for %s." % self.dataset.name()
73  except TypeError:
74  msg = "B field for %s = %sT. This is not that close to 0T or 3.8T." % (self.dataset.name(), Bfield)
75  raise AllInOneError(msg + "\n"
76  "To use this data, turn off the automatic alternates using AutoAlternates = false\n"
77  "in the [alternateTemplates] section, and choose the alternate template yourself.")
78 
79  cfgs = {cfgName: templateToUse}
80  self.filesToCompare[
81  GenericValidationData.defaultReferenceName ] = repMap["finalResultFile"]
82  return GenericValidationData.createConfiguration(self, cfgs, path, repMap = repMap)
def offlineValidation.OfflineValidation.createCrabCfg (   self,
  path 
)

Definition at line 87 of file offlineValidation.py.

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

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

Definition at line 83 of file offlineValidation.py.

83 
84  def createScript(self, path):
85  return GenericValidationData.createScript(self, path)
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 
91  def getRepMap(self, alignment = None):
92  repMap = GenericValidationData.getRepMap(self, alignment)
93  repMap.update({
94  "nEvents": self.general["maxevents"],
95  "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
96  "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
97  "offlineValidationMode": "Standalone",
98  "offlineValidationFileOutput": configTemplates.offlineFileOutputTemplate,
99  "TrackCollection": self.general["trackcollection"],
100  })
101 
102  return repMap

Member Data Documentation

offlineValidation.OfflineValidation.configBaseName

Definition at line 30 of file offlineValidation.py.

Referenced by trackSplittingValidation.TrackSplittingValidation.createConfiguration(), primaryVertexValidation.PrimaryVertexValidation.createConfiguration(), offlineValidation.OfflineValidation.createConfiguration(), and zMuMuValidation.ZMuMuValidation.createConfiguration().

offlineValidation.OfflineValidation.crabCfgBaseName

Definition at line 32 of file offlineValidation.py.

Referenced by trackSplittingValidation.TrackSplittingValidation.createCrabCfg(), primaryVertexValidation.PrimaryVertexValidation.createCrabCfg(), zMuMuValidation.ZMuMuValidation.createCrabCfg(), and offlineValidation.OfflineValidation.createCrabCfg().

offlineValidation.OfflineValidation.needParentFiles

Definition at line 35 of file offlineValidation.py.

offlineValidation.OfflineValidation.outputBaseName

Definition at line 34 of file offlineValidation.py.

Referenced by primaryVertexValidation.PrimaryVertexValidation.getRepMap(), zMuMuValidation.ZMuMuValidation.getRepMap(), and genericValidation.GenericValidationData.getRepMap().

offlineValidation.OfflineValidation.resultBaseName

Definition at line 33 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.getRepMap().

offlineValidation.OfflineValidation.scriptBaseName

Definition at line 31 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.createScript().