CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

validateAlignments::GeometryComparision Class Reference

Inheritance diagram for validateAlignments::GeometryComparision:
validateAlignments::GenericValidation

List of all members.

Public Member Functions

def __init__
def createConfiguration
def createScript
def getRepMap

Public Attributes

 copyImages
 randomWorkdirPart
 referenceAlignment

Private Attributes

 __compares

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.

00271                                                                                                           :
00272         GenericValidation.__init__(self, alignment, config)
00273         if not randomWorkdirPart == None:
00274             self.randomWorkdirPart = randomWorkdirPart
00275         self.referenceAlignment = referenceAlignment
00276         self.__compares = {}
00277         allCompares = readCompare(config)
00278         referenceName = "IDEAL"
00279         if not self.referenceAlignment == "IDEAL":
00280             referenceName = self.referenceAlignment.name
00281 
00282         #test if all compare sections are present
00283         for compareName in self.alignmentToValidate.compareTo[ referenceName ]:
00284             if compareName in allCompares:
00285                 self.__compares[compareName] = allCompares[compareName]
00286             else:
00287                 raise StandardError, "could not find compare section '%s' in '%s'"%(compareName, allCompares)                  
00288         self.copyImages = copyImages
    

Member Function Documentation

def validateAlignments::GeometryComparision::createConfiguration (   self,
  path 
)

Definition at line 307 of file validateAlignments.py.

00308                                         :
00309         # self.__compares
00310         repMap = self.getRepMap()
00311         cfgs = {"TkAlCompareToNTuple.%s_cfg.py"%self.alignmentToValidate.name:
00312                     replaceByMap( configTemplates.intoNTuplesTemplate, repMap)}
00313         if not self.referenceAlignment == "IDEAL":
00314             referenceRepMap = self.getRepMap( self.referenceAlignment )
00315             cfgFileName = "TkAlCompareToNTuple.%s.%s_cfg.py"%(self.referenceAlignment.name, self.randomWorkdirPart)
00316             cfgs[ cfgFileName ] = replaceByMap( configTemplates.intoNTuplesTemplate, referenceRepMap)
00317 
00318         cfgSchedule = cfgs.keys()
00319         for common in self.__compares:
00320             repMap.update({"common": common,
00321                            "levels": self.__compares[common][0],
00322                            "dbOutput": self.__compares[common][1]
00323                            })
00324             if self.__compares[common][1].split()[0] == "true":
00325                 repMap["dbOutputService"] = configTemplates.dbOutputTemplate
00326             else:
00327                 repMap["dbOutputService"] = ""
00328             cfgName = replaceByMap("TkAlCompareCommon.oO[common]Oo...oO[name]Oo._cfg.py",repMap)
00329             cfgs[ cfgName ] = replaceByMap(configTemplates.compareTemplate, repMap)
00330             
00331             cfgSchedule.append( cfgName )
00332         GenericValidation.createConfiguration(self, cfgs, path, cfgSchedule)

def validateAlignments::GeometryComparision::createScript (   self,
  path 
)

Definition at line 333 of file validateAlignments.py.

00333                                 :    
00334         repMap = self.getRepMap()    
00335         repMap["runComparisonScripts"] = ""
00336         scriptName = replaceByMap("TkAlGeomCompare..oO[name]Oo..sh",repMap)
00337         for name in self.__compares:
00338             if  '"DetUnit"' in self.__compares[name][0].split(","):
00339                 repMap["runComparisonScripts"] += "root -b -q 'comparisonScript.C(\".oO[workdir]Oo./.oO[name]Oo..Comparison_common"+name+".root\",\".oO[workdir]Oo./\")'\n"
00340                 if  self.copyImages:
00341                    repMap["runComparisonScripts"] += "rfmkdir -p .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images\n"
00342                    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"
00343                    repMap["runComparisonScripts"] += "rfmkdir -p .oO[workdir]Oo./.oO[name]Oo.."+name+"_ArrowPlots\n"
00344                    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"
00345                    repMap["runComparisonScripts"] += "rfmkdir -p .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images/ArrowPlots\n"
00346                    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"
00347                    
00348                 resultingFile = replaceByMap(".oO[datadir]Oo./compared%s_.oO[name]Oo..root"%name,repMap)
00349                 resultingFile = os.path.expandvars( resultingFile )
00350                 resultingFile = os.path.abspath( resultingFile )
00351                 repMap["runComparisonScripts"] += "rfcp .oO[workdir]Oo./OUTPUT_comparison.root %s\n"%resultingFile
00352                 self.filesToCompare[ name ] = resultingFile
00353                 
00354         repMap["CommandLine"]=""
00355 
00356         for cfg in self.configFiles:
00357 #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
00358 #cd .oO[workdir]Oo.
00359             postProcess = "rfcp .oO[workdir]Oo./*.db .oO[datadir]Oo.\n"
00360             repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfg,
00361                                                                    "postProcess":postProcess
00362                                                                    }
00363         repMap["CommandLine"]+= """# overall postprocessing
00364 cd .oO[CMSSW_BASE]Oo./src/Alignment/OfflineValidation/scripts/
00365 .oO[runComparisonScripts]Oo.
00366 cd .oO[workdir]Oo.
00367 """
00368         scripts = {scriptName: replaceByMap( configTemplates.scriptTemplate, repMap ) }  
00369         return GenericValidation.createScript(self, scripts, path)
00370         
def validateAlignments::GeometryComparision::getRepMap (   self,
  alignment = None 
)

Reimplemented from validateAlignments::GenericValidation.

Definition at line 289 of file validateAlignments.py.

00290                                          :
00291         if alignment == None:
00292             alignment = self.alignmentToValidate
00293         repMap = GenericValidation.getRepMap( self, alignment )
00294         referenceName = "IDEAL"
00295         if not self.referenceAlignment == "IDEAL":
00296             referenceName = self.referenceAlignment.name
00297         
00298         repMap.update({"comparedGeometry": ".oO[workdir]Oo./.oO[alignmentName]Oo.ROOTGeometry.root",
00299                        "referenceGeometry": "IDEAL",#will be replaced later if not compared to IDEAL
00300                        "reference": referenceName,
00301                        "APE": configTemplates.APETemplate
00302                        })
00303         if not referenceName == "IDEAL":
00304             repMap["referenceGeometry"] = ".oO[workdir]Oo./.oO[reference]Oo.ROOTGeometry.root"
00305         repMap["name"] += "_vs_.oO[reference]Oo."
00306         return repMap


Member Data Documentation

Definition at line 270 of file validateAlignments.py.

Definition at line 270 of file validateAlignments.py.

Reimplemented from validateAlignments::GenericValidation.

Definition at line 270 of file validateAlignments.py.

Definition at line 270 of file validateAlignments.py.