CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

validateAlignments::GeometryComparison Class Reference

Inheritance diagram for validateAlignments::GeometryComparison:
validateAlignments::GenericValidation

List of all members.

Public Member Functions

def __init__
def createConfiguration
def createCrabCfg
def createScript
def getRepMap

Public Attributes

 copyImages
 jobmode
 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 357 of file validateAlignments.py.


Constructor & Destructor Documentation

def validateAlignments::GeometryComparison::__init__ (   self,
  valName,
  alignment,
  referenceAlignment,
  config,
  copyImages = True,
  randomWorkdirPart = None 
)

Definition at line 364 of file validateAlignments.py.

00366                                                                       :
00367         GenericValidation.__init__(self, valName, alignment, config)
00368         if not randomWorkdirPart == None:
00369             self.randomWorkdirPart = randomWorkdirPart
00370         self.referenceAlignment = referenceAlignment
00371         try:
00372             self.jobmode = config.get( "compare:"+self.name, "jobmode" )
00373         except ConfigParser.NoOptionError:
00374             pass
00375         referenceName = "IDEAL"
00376         if not self.referenceAlignment == "IDEAL":
00377             referenceName = self.referenceAlignment.name
00378 
00379         allCompares = config.getCompares()
00380         self.__compares = {}
00381         if valName in allCompares:
00382             self.__compares[valName] = allCompares[valName]
00383         else:
00384             raise StandardError, "Could not find compare section '%s' in '%s'"%(valName, allCompares)
00385         self.copyImages = copyImages
    

Member Function Documentation

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

Definition at line 407 of file validateAlignments.py.

00408                                         :
00409         # self.__compares
00410         repMap = self.getRepMap()
00411         cfgs = { "TkAlCompareToNTuple.%s.%s_cfg.py"%(
00412             self.alignmentToValidate.name, self.randomWorkdirPart ):
00413                 replaceByMap( configTemplates.intoNTuplesTemplate, repMap)}
00414         if not self.referenceAlignment == "IDEAL":
00415             referenceRepMap = self.getRepMap( self.referenceAlignment )
00416             cfgFileName = "TkAlCompareToNTuple.%s.%s_cfg.py"%(
00417                 self.referenceAlignment.name, self.randomWorkdirPart )
00418             cfgs[ cfgFileName ] = replaceByMap( configTemplates.intoNTuplesTemplate, referenceRepMap)
00419 
00420         cfgSchedule = cfgs.keys()
00421         for common in self.__compares:
00422             repMap.update({"common": common,
00423                            "levels": self.__compares[common][0],
00424                            "dbOutput": self.__compares[common][1]
00425                            })
00426             if self.__compares[common][1].split()[0] == "true":
00427                 repMap["dbOutputService"] = configTemplates.dbOutputTemplate
00428             else:
00429                 repMap["dbOutputService"] = ""
00430             cfgName = replaceByMap("TkAlCompareCommon.oO[common]Oo...oO[name]Oo._cfg.py",repMap)
00431             cfgs[ cfgName ] = replaceByMap(configTemplates.compareTemplate, repMap)
00432             
00433             cfgSchedule.append( cfgName )
00434         GenericValidation.createConfiguration(self, cfgs, path, cfgSchedule)

def validateAlignments::GeometryComparison::createCrabCfg (   self)

Definition at line 473 of file validateAlignments.py.

00474                              :
00475         raise StandardError, ("Parallelization not supported for geometry "
00476                               "comparison. Please choose another 'jobmode'.")
00477 
        
def validateAlignments::GeometryComparison::createScript (   self,
  path 
)

Definition at line 435 of file validateAlignments.py.

00435                                 :    
00436         repMap = self.getRepMap()    
00437         repMap["runComparisonScripts"] = ""
00438         scriptName = replaceByMap( "TkAlGeomCompare.%s..oO[name]Oo..sh"%( self.name ),
00439                                    repMap)
00440         for name in self.__compares:
00441             if  '"DetUnit"' in self.__compares[name][0].split(","):
00442                 repMap["runComparisonScripts"] += "root -b -q 'comparisonScript.C(\".oO[workdir]Oo./.oO[name]Oo..Comparison_common"+name+".root\",\".oO[workdir]Oo./\")'\n"
00443                 if  self.copyImages:
00444                    repMap["runComparisonScripts"] += "rfmkdir -p .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images\n"
00445                    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"
00446                    repMap["runComparisonScripts"] += "find .oO[workdir]Oo. -maxdepth 1 -name \"plot*.pdf\" -print | xargs -I {} bash -c \"rfcp {} .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images/\" \n"
00447                    repMap["runComparisonScripts"] += "rfmkdir -p .oO[workdir]Oo./.oO[name]Oo.."+name+"_ArrowPlots\n"
00448                    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"
00449                    repMap["runComparisonScripts"] += "rfmkdir -p .oO[datadir]Oo./.oO[name]Oo..Comparison_common"+name+"_Images/ArrowPlots\n"
00450                    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"
00451                    
00452                 resultingFile = replaceByMap(".oO[datadir]Oo./compared%s_.oO[name]Oo..root"%name,repMap)
00453                 resultingFile = os.path.expandvars( resultingFile )
00454                 resultingFile = os.path.abspath( resultingFile )
00455                 repMap["runComparisonScripts"] += "rfcp .oO[workdir]Oo./OUTPUT_comparison.root %s\n"%resultingFile
00456                 self.filesToCompare[ name ] = resultingFile
00457                 
00458         repMap["CommandLine"]=""
00459 
00460         for cfg in self.configFiles:
00461             postProcess = "rfcp .oO[workdir]Oo./*.db .oO[datadir]Oo.\n"
00462             repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfg,
00463                                                                    "postProcess":postProcess
00464                                                                    }
00465         repMap["CommandLine"]+= """# overall postprocessing
00466 cd .oO[CMSSW_BASE]Oo./src/Alignment/OfflineValidation/scripts/
00467 .oO[runComparisonScripts]Oo.
00468 cd .oO[workdir]Oo.
00469 """
00470         scripts = {scriptName: replaceByMap( configTemplates.scriptTemplate, repMap ) }  
00471         return GenericValidation.createScript(self, scripts, path)
00472 
def validateAlignments::GeometryComparison::getRepMap (   self,
  alignment = None 
)

Reimplemented from validateAlignments::GenericValidation.

Definition at line 386 of file validateAlignments.py.

00387                                          :
00388         if alignment == None:
00389             alignment = self.alignmentToValidate
00390         repMap = GenericValidation.getRepMap( self, alignment )
00391         referenceName = "IDEAL"
00392         if not self.referenceAlignment == "IDEAL":
00393             referenceName = self.referenceAlignment.name
00394         
00395         repMap.update({
00396             "comparedGeometry": (".oO[workdir]Oo./.oO[alignmentName]Oo."
00397                                  "ROOTGeometry.root"),
00398             "referenceGeometry": "IDEAL", # will be replaced later
00399                                           #  if not compared to IDEAL
00400             "reference": referenceName
00401             })
00402         if not referenceName == "IDEAL":
00403             repMap["referenceGeometry"] = (".oO[workdir]Oo./.oO[reference]Oo."
00404                                            "ROOTGeometry.root")
00405         repMap["name"] += "_vs_.oO[reference]Oo."
00406         return repMap


Member Data Documentation

Definition at line 364 of file validateAlignments.py.

Definition at line 364 of file validateAlignments.py.

Reimplemented from validateAlignments::GenericValidation.

Definition at line 364 of file validateAlignments.py.

Reimplemented from validateAlignments::GenericValidation.

Definition at line 364 of file validateAlignments.py.

Definition at line 364 of file validateAlignments.py.