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":"True",
20  "OfflineTreeBaseDir":"TrackHitFilter",
21  "SurfaceShapes":"coarse",
22  "stripYResiduals":"False",
23  }
24  mandatories = [ "trackcollection" ]
25  defaults.update(addDefaults)
26  mandatories += addMandatories
27  self.configBaseName = configBaseName
28  self.scriptBaseName = scriptBaseName
29  self.crabCfgBaseName = crabCfgBaseName
30  self.resultBaseName = resultBaseName
31  self.outputBaseName = outputBaseName
32  self.needParentFiles = False
33  GenericValidationData.__init__(self, valName, alignment, config,
34  "offline", addDefaults=defaults,
35  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 94 of file offlineValidation.py.

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

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

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

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

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

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

Definition at line 78 of file offlineValidation.py.

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

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

Definition at line 74 of file offlineValidation.py.

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

Definition at line 81 of file offlineValidation.py.

References genericValidation.GenericValidation.general.

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

Member Data Documentation

offlineValidation.OfflineValidation.configBaseName

Definition at line 26 of file offlineValidation.py.

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

offlineValidation.OfflineValidation.crabCfgBaseName

Definition at line 28 of file offlineValidation.py.

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

offlineValidation.OfflineValidation.needParentFiles

Definition at line 31 of file offlineValidation.py.

offlineValidation.OfflineValidation.outputBaseName

Definition at line 30 of file offlineValidation.py.

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

offlineValidation.OfflineValidation.resultBaseName

Definition at line 29 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.getRepMap().

offlineValidation.OfflineValidation.scriptBaseName

Definition at line 27 of file offlineValidation.py.

Referenced by genericValidation.GenericValidationData.createScript().