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 | Private Attributes
validateAlignments.GeometryComparision Class Reference
Inheritance diagram for validateAlignments.GeometryComparision:
validateAlignments.GenericValidation

Public Member Functions

def __init__
 
def createConfiguration
 
def createScript
 
def getRepMap
 
- Public Member Functions inherited from validateAlignments.GenericValidation
def __init__
 
def createConfiguration
 
def createFiles
 
def createScript
 
def getCompareStrings
 
def getRepMap
 

Public Attributes

 copyImages
 
 randomWorkdirPart
 
 referenceAlignment
 
- Public Attributes inherited from validateAlignments.GenericValidation
 alignmentToValidate
 
 configFiles
 
 filesToCompare
 
 randomWorkdirPart
 
 scriptFiles
 

Private Attributes

 __compares
 

Additional Inherited Members

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

Detailed Description

object representing a geometry comparison job
alignemnt is the alignment to analyse
config is the overall configuration
copyImages indicates wether plot*.eps files should be copied back from the farm

Definition at line 263 of file validateAlignments.py.

Constructor & Destructor Documentation

def validateAlignments.GeometryComparision.__init__ (   self,
  alignment,
  referenceAlignment,
  config,
  copyImages = True,
  randomWorkdirPart = None 
)

Definition at line 270 of file validateAlignments.py.

271  def __init__(self, alignment, referenceAlignment, config, copyImages = True, randomWorkdirPart = None):
272  GenericValidation.__init__(self, alignment, config)
273  if not randomWorkdirPart == None:
274  self.randomWorkdirPart = randomWorkdirPart
275  self.referenceAlignment = referenceAlignment
276  self.__compares = {}
277  allCompares = readCompare(config)
278  referenceName = "IDEAL"
279  if not self.referenceAlignment == "IDEAL":
280  referenceName = self.referenceAlignment.name
281 
282  #test if all compare sections are present
283  for compareName in self.alignmentToValidate.compareTo[ referenceName ]:
284  if compareName in allCompares:
285  self.__compares[compareName] = allCompares[compareName]
286  else:
287  raise StandardError, "could not find compare section '%s' in '%s'"%(compareName, allCompares)
288  self.copyImages = copyImages

Member Function Documentation

def validateAlignments.GeometryComparision.createConfiguration (   self,
  path 
)

Definition at line 307 of file validateAlignments.py.

References validateAlignments.GeometryComparision.__compares, validateAlignments.Alignment.getRepMap(), validateAlignments.GenericValidation.getRepMap(), validateAlignments.GenericValidation.randomWorkdirPart, validateAlignments.GeometryComparision.referenceAlignment, validateAlignments.replaceByMap(), and split.

308  def createConfiguration(self, path ):
309  # self.__compares
310  repMap = self.getRepMap()
311  cfgs = {"TkAlCompareToNTuple.%s_cfg.py"%self.alignmentToValidate.name:
312  replaceByMap( configTemplates.intoNTuplesTemplate, repMap)}
313  if not self.referenceAlignment == "IDEAL":
314  referenceRepMap = self.getRepMap( self.referenceAlignment )
315  cfgFileName = "TkAlCompareToNTuple.%s.%s_cfg.py"%(self.referenceAlignment.name, self.randomWorkdirPart)
316  cfgs[ cfgFileName ] = replaceByMap( configTemplates.intoNTuplesTemplate, referenceRepMap)
317 
318  cfgSchedule = cfgs.keys()
319  for common in self.__compares:
320  repMap.update({"common": common,
321  "levels": self.__compares[common][0],
322  "dbOutput": self.__compares[common][1]
323  })
324  if self.__compares[common][1].split()[0] == "true":
325  repMap["dbOutputService"] = configTemplates.dbOutputTemplate
326  else:
327  repMap["dbOutputService"] = ""
328  cfgName = replaceByMap("TkAlCompareCommon.oO[common]Oo...oO[name]Oo._cfg.py",repMap)
329  cfgs[ cfgName ] = replaceByMap(configTemplates.compareTemplate, repMap)
330 
331  cfgSchedule.append( cfgName )
332  GenericValidation.createConfiguration(self, cfgs, path, cfgSchedule)
def replaceByMap
— Helpers —############################ replaces .oO[id]Oo.
double split
Definition: MVATrainer.cc:139
def validateAlignments.GeometryComparision.createScript (   self,
  path 
)

Definition at line 333 of file validateAlignments.py.

References validateAlignments.GeometryComparision.__compares, validateAlignments.GenericValidation.configFiles, validateAlignments.GeometryComparision.copyImages, validateAlignments.GenericValidation.filesToCompare, validateAlignments.Alignment.getRepMap(), validateAlignments.GenericValidation.getRepMap(), validateAlignments.replaceByMap(), and split.

334  def createScript(self, path):
335  repMap = self.getRepMap()
336  repMap["runComparisonScripts"] = ""
337  scriptName = replaceByMap("TkAlGeomCompare..oO[name]Oo..sh",repMap)
338  for name in self.__compares:
339  if '"DetUnit"' in self.__compares[name][0].split(","):
340  repMap["runComparisonScripts"] += "root -b -q 'comparisonScript.C(\".oO[workdir]Oo./.oO[name]Oo..Comparison_common"+name+".root\",\".oO[workdir]Oo./\")'\n"
341  if self.copyImages:
342  repMap["runComparisonScripts"] += "rfmkdir -p .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images\n"
343  repMap["runComparisonScripts"] += "find .oO[workdir]Oo. -maxdepth 1 -name \"plot*.eps\" -print | xargs -I {} bash -c \"rfcp {} .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images/\" \n"
344  repMap["runComparisonScripts"] += "rfmkdir -p .oO[workdir]Oo./.oO[name]Oo.."+name+"_ArrowPlots\n"
345  repMap["runComparisonScripts"] += "root -b -q 'makeArrowPlots.C(\".oO[workdir]Oo./.oO[name]Oo..Comparison_common"+name+".root\",\".oO[workdir]Oo./.oO[name]Oo.."+name+"_ArrowPlots\")'\n"
346  repMap["runComparisonScripts"] += "rfmkdir -p .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images/ArrowPlots\n"
347  repMap["runComparisonScripts"] += "find .oO[workdir]Oo./.oO[name]Oo.."+name+"_ArrowPlots -maxdepth 1 -name \"*.png\" -print | xargs -I {} bash -c \"rfcp {} .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images/ArrowPlots\"\n"
348 
349  resultingFile = replaceByMap(".oO[datadir]Oo./compared%s_.oO[name]Oo..root"%name,repMap)
350  resultingFile = os.path.expandvars( resultingFile )
351  resultingFile = os.path.abspath( resultingFile )
352  repMap["runComparisonScripts"] += "rfcp .oO[workdir]Oo./OUTPUT_comparison.root %s\n"%resultingFile
353  self.filesToCompare[ name ] = resultingFile
354 
355  repMap["CommandLine"]=""
356 
357  for cfg in self.configFiles:
358 #find . -maxdepth 1 -name \"LOGFILE_*_.oO[name]Oo..log\" -print | xargs -I {} bash -c 'echo \"*** \";echo \"** {}\";echo \"***\" ; cat {}' > .oO[workdir]Oo./LOGFILE_GeomComparision_.oO[name]Oo..log
359 #cd .oO[workdir]Oo.
360  postProcess = "rfcp .oO[workdir]Oo./*.db .oO[datadir]Oo.\n"
361  repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfg,
362  "postProcess":postProcess
363  }
364  repMap["CommandLine"]+= """# overall postprocessing
365 cd .oO[CMSSW_BASE]Oo./src/Alignment/OfflineValidation/scripts/
366 .oO[runComparisonScripts]Oo.
367 cd .oO[workdir]Oo.
368 """
369  scripts = {scriptName: replaceByMap( configTemplates.scriptTemplate, repMap ) }
370  return GenericValidation.createScript(self, scripts, path)
def replaceByMap
— Helpers —############################ replaces .oO[id]Oo.
double split
Definition: MVATrainer.cc:139
def validateAlignments.GeometryComparision.getRepMap (   self,
  alignment = None 
)

Definition at line 289 of file validateAlignments.py.

References validateAlignments.GenericValidation.alignmentToValidate, and validateAlignments.GeometryComparision.referenceAlignment.

290  def getRepMap(self, alignment = None):
291  if alignment == None:
292  alignment = self.alignmentToValidate
293  repMap = GenericValidation.getRepMap( self, alignment )
294  referenceName = "IDEAL"
295  if not self.referenceAlignment == "IDEAL":
296  referenceName = self.referenceAlignment.name
297 
298  repMap.update({"comparedGeometry": ".oO[workdir]Oo./.oO[alignmentName]Oo.ROOTGeometry.root",
299  "referenceGeometry": "IDEAL",#will be replaced later if not compared to IDEAL
300  "reference": referenceName,
301  "APE": configTemplates.APETemplate
302  })
303  if not referenceName == "IDEAL":
304  repMap["referenceGeometry"] = ".oO[workdir]Oo./.oO[reference]Oo.ROOTGeometry.root"
305  repMap["name"] += "_vs_.oO[reference]Oo."
306  return repMap

Member Data Documentation

validateAlignments.GeometryComparision.__compares
private

Definition at line 275 of file validateAlignments.py.

Referenced by validateAlignments.GeometryComparision.createConfiguration(), and validateAlignments.GeometryComparision.createScript().

validateAlignments.GeometryComparision.copyImages

Definition at line 287 of file validateAlignments.py.

Referenced by validateAlignments.GeometryComparision.createScript().

validateAlignments.GeometryComparision.randomWorkdirPart

Definition at line 273 of file validateAlignments.py.

validateAlignments.GeometryComparision.referenceAlignment

Definition at line 274 of file validateAlignments.py.

Referenced by validateAlignments.GeometryComparision.createConfiguration(), and validateAlignments.GeometryComparision.getRepMap().