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
 
 jobmode
 
 name
 
 NJobs
 
 randomWorkdirPart
 
 scramarch
 
 scriptFiles
 

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  "DMRMethod":"median,rmsNorm",
16  "DMRMinimum":"30",
17  "DMROptions":"",
18  "offlineModuleLevelHistsTransient":"False",
19  "offlineModuleLevelProfiles":"False",
20  "OfflineTreeBaseDir":"TrackHitFilter",
21  "SurfaceShapes":"none"
22  }
23  mandatories = [ "trackcollection" ]
24  defaults.update(addDefaults)
25  mandatories += addMandatories
26  self.configBaseName = configBaseName
27  self.scriptBaseName = scriptBaseName
28  self.crabCfgBaseName = crabCfgBaseName
29  self.resultBaseName = resultBaseName
30  self.outputBaseName = outputBaseName
31  self.needParentFiles = False
32  GenericValidationData.__init__(self, valName, alignment, config,
33  "offline", addDefaults=defaults,
34  addMandatories=mandatories)

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 93 of file offlineValidation.py.

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

93 
94  def appendToExtendedValidation( self, validationsSoFar = "" ):
95  """
96  if no argument or "" is passed a string with an instantiation is
97  returned, else the validation is appended to the list
98  """
99  repMap = self.getRepMap()
100  if validationsSoFar == "":
101  validationsSoFar = ('PlotAlignmentValidation p("root://eoscms//eos/cms%(finalResultFile)s",'
102  '"%(title)s", %(color)s, %(style)s);\n')%repMap
103  else:
104  validationsSoFar += (' p.loadFileList("root://eoscms//eos/cms%(finalResultFile)s", "%(title)s",'
105  '%(color)s, %(style)s);\n')%repMap
106  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 107 of file offlineValidation.py.

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

108  def appendToMerge( self, validationsSoFar = "" ):
109  """
110  if no argument or "" is passed a string with an instantiation is returned,
111  else the validation is appended to the list
112  """
113  repMap = self.getRepMap()
114 
115  parameters = "root://eoscms//eos/cms" + ",root://eoscms//eos/cms".join(repMap["resultFiles"])
116 
117  mergedoutputfile = "root://eoscms//eos/cms%(finalResultFile)s"%repMap
118  validationsSoFar += ('root -x -b -q -l "TkAlOfflineJobsMerge.C(\\\"'
119  +parameters+'\\\",\\\"'+mergedoutputfile+'\\\")"'
120  +"\n")
121  return validationsSoFar
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def offlineValidation.OfflineValidation.createConfiguration (   self,
  path 
)

Definition at line 35 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, genericValidation.GenericValidation.name, alignment.Alignment.name, MuonGeometrySanityCheckPoint.name, plotscripts.SawTeethFunction.name, and genericValidation.GenericValidation.NJobs.

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

Definition at line 77 of file offlineValidation.py.

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

77 
78  def createCrabCfg(self, path):
79  return GenericValidationData.createCrabCfg(self, path, self.crabCfgBaseName)
def offlineValidation.OfflineValidation.createScript (   self,
  path 
)

Definition at line 73 of file offlineValidation.py.

73 
74  def createScript(self, path):
75  return GenericValidationData.createScript(self, path)
76 
def offlineValidation.OfflineValidation.getRepMap (   self,
  alignment = None 
)

Definition at line 80 of file offlineValidation.py.

References genericValidation.GenericValidation.general.

80 
81  def getRepMap(self, alignment = None):
82  repMap = GenericValidationData.getRepMap(self, alignment)
83  repMap.update({
84  "nEvents": self.general["maxevents"],
85  "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
86  "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
87  "offlineValidationMode": "Standalone",
88  "offlineValidationFileOutput": configTemplates.offlineFileOutputTemplate,
89  "TrackCollection": self.general["trackcollection"],
90  })
91 
92  return repMap

Member Data Documentation

offlineValidation.OfflineValidation.configBaseName

Definition at line 25 of file offlineValidation.py.

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

offlineValidation.OfflineValidation.crabCfgBaseName

Definition at line 27 of file offlineValidation.py.

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

offlineValidation.OfflineValidation.needParentFiles

Definition at line 30 of file offlineValidation.py.

offlineValidation.OfflineValidation.outputBaseName

Definition at line 29 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.getRepMap().

offlineValidation.OfflineValidation.resultBaseName

Definition at line 28 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.getRepMap().

offlineValidation.OfflineValidation.scriptBaseName

Definition at line 26 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.createScript().