CMS 3D CMS Logo

Public Member Functions | Public Attributes

validateAlignments::OfflineValidation Class Reference

Inheritance diagram for validateAlignments::OfflineValidation:
validateAlignments::GenericValidation validateAlignments::OfflineValidationDQM validateAlignments::OfflineValidationParallel

List of all members.

Public Member Functions

def __init__
def appendToExtendedValidation
def appendToMerge
def createConfiguration
def createCrabCfg
def createScript
def getRepMap

Public Attributes

 crabWorkingDir
 jobmode

Detailed Description

Definition at line 478 of file validateAlignments.py.


Constructor & Destructor Documentation

def validateAlignments::OfflineValidation::__init__ (   self,
  valName,
  alignment,
  config 
)

Reimplemented from validateAlignments::GenericValidation.

Reimplemented in validateAlignments::OfflineValidationParallel, and validateAlignments::OfflineValidationDQM.

Definition at line 479 of file validateAlignments.py.

00480                                                  :
00481         GenericValidation.__init__(self, valName, alignment, config)
00482         defaults = {
00483             "DMRMethod":"median",
00484             "DMRMinimum":"30",
00485             "DMROptions":"",
00486             "offlineModuleLevelHistsTransient":"False",
00487             "offlineModuleLevelProfiles":"False",
00488             "OfflineTreeBaseDir":"TrackHitFilter",
00489             "SurfaceShapes":"none",
00490             "jobmode":self.jobmode,
00491             "runRange":"",
00492             "JSON":""
00493             }
00494         mandatories = [ "dataset", "maxevents", "trackcollection" ]
00495         if not config.has_section( "offline:"+self.name ):
00496             offline = config.getResultingSection( "general",
00497                                                   defaultDict = defaults,
00498                                                   demandPars = mandatories )
00499         else:
00500             offline = config.getResultingSection( "offline:"+self.name, 
00501                                                   defaultDict = defaults,
00502                                                   demandPars = mandatories )
00503         self.general.update( offline )
00504         self.jobmode = self.general["jobmode"]
    

Member Function Documentation

def validateAlignments::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 573 of file validateAlignments.py.

00574                                                                  :
00575         """
00576         if no argument or "" is passed a string with an instantiation is
00577         returned, else the validation is appended to the list
00578         """
00579         repMap = self.getRepMap()
00580         if validationsSoFar == "":
00581             validationsSoFar = ('PlotAlignmentValidation p("%(resultFile)s",'
00582                                 '"%(name)s", %(color)s, %(style)s);\n')%repMap
00583         else:
00584             validationsSoFar += ('p.loadFileList("%(resultFile)s", "%(name)s",'
00585                                  '%(color)s, %(style)s);\n')%repMap
00586         return validationsSoFar

def validateAlignments::OfflineValidation::appendToMerge (   self,
  mergesSoFar = "" 
)
append all merges here

Definition at line 587 of file validateAlignments.py.

00588                                                :
00589         """
00590         append all merges here
00591         """
00592         repMap = self.getRepMap()
00593         mergesSoFar += replaceByMap( configTemplates.mergeOfflineParallelResults, repMap )
00594         return mergesSoFar

def validateAlignments::OfflineValidation::createConfiguration (   self,
  path,
  configBaseName = "TkAlOfflineValidation" 
)

Reimplemented in validateAlignments::OfflineValidationParallel.

Definition at line 505 of file validateAlignments.py.

00507                                                                       :
00508         cfgName = "%s.%s.%s_cfg.py"%( configBaseName, self.name,
00509                                       self.alignmentToValidate.name )
00510         repMap = self.getRepMap()
00511           
00512         cfgs = {cfgName:replaceByMap( configTemplates.offlineTemplate, repMap)}
00513         self.filesToCompare[
00514             GenericValidation.defaultReferenceName ] = repMap["resultFile"]
00515         GenericValidation.createConfiguration(self, cfgs, path)
        
def validateAlignments::OfflineValidation::createCrabCfg (   self,
  path,
  crabCfgBaseName = "TkAlOfflineValidation" 
)

Reimplemented from validateAlignments::GenericValidation.

Definition at line 529 of file validateAlignments.py.

00531                                                                    :
00532         crabCfgName = "crab.%s.%s.%s.cfg"%( crabCfgBaseName, self.name,
00533                                             self.alignmentToValidate.name )
00534         repMap = self.getRepMap()
00535         repMap["script"] = "dummy_script.sh"
00536         repMap["crabOutputDir"] = os.path.basename( path )
00537         repMap["crabWorkingDir"] = crabCfgName.split( '.cfg' )[0]
00538         self.crabWorkingDir = repMap["crabWorkingDir"]
00539         repMap["numberOfJobs"] = self.general["parallelJobs"]
00540         repMap["cfgFile"] = self.configFiles[0]
00541         repMap["queue"] = self.jobmode.split( ',' )[1].split( '-q' )[1]
00542         crabCfg = {crabCfgName: replaceByMap( configTemplates.crabCfgTemplate,
00543                                               repMap ) }
00544         return GenericValidation.createCrabCfg( self, crabCfg, path )

def validateAlignments::OfflineValidation::createScript (   self,
  path,
  scriptBaseName = "TkAlOfflineValidation" 
)

Reimplemented in validateAlignments::OfflineValidationParallel.

Definition at line 516 of file validateAlignments.py.

00517                                                                           :
00518         scriptName = "%s.%s.%s.sh"%( scriptBaseName, self.name,
00519                                      self.alignmentToValidate.name )
00520         repMap = GenericValidation.getRepMap(self)
00521         repMap["CommandLine"]=""
00522         for cfg in self.configFiles:
00523             repMap["CommandLine"]+= repMap["CommandLineTemplate"]%{"cfgFile":cfg,
00524                                                   "postProcess":""
00525                                                   }
00526         scripts = {scriptName: replaceByMap( configTemplates.scriptTemplate,
00527                                              repMap ) }
00528         return GenericValidation.createScript(self, scripts, path)

def validateAlignments::OfflineValidation::getRepMap (   self,
  alignment = None 
)

Reimplemented from validateAlignments::GenericValidation.

Reimplemented in validateAlignments::OfflineValidationParallel, and validateAlignments::OfflineValidationDQM.

Definition at line 545 of file validateAlignments.py.

00546                                          :
00547         repMap = GenericValidation.getRepMap(self, alignment)
00548         repMap.update({
00549             "nEvents": self.general["maxevents"],
00550             "outputFile": replaceByMap( (".oO[workdir]Oo./AlignmentValidation_"
00551                                          + self.name +
00552                                          "_.oO[name]Oo..root"), repMap ),
00553             "resultFile": replaceByMap( (".oO[datadir]Oo./AlignmentValidation_"
00554                                          + self.name +
00555                                          "_.oO[name]Oo..root"), repMap ),
00556             "TrackSelectionTemplate": configTemplates.TrackSelectionTemplate,
00557             "LorentzAngleTemplate": configTemplates.LorentzAngleTemplate,
00558             "offlineValidationMode": "Standalone",
00559             "offlineValidationFileOutput":
00560             configTemplates.offlineStandaloneFileOutputTemplate,
00561             # Keep the following parameters for backward compatibility
00562             "TrackCollection": self.general["trackcollection"]
00563             })
00564         repMap["outputFile"] = os.path.expandvars( repMap["outputFile"] )
00565         repMap["outputFile"] = os.path.abspath( repMap["outputFile"] )
00566         repMap["resultFile"] = os.path.expandvars( repMap["resultFile"] )
00567         repMap["resultFile"] = os.path.abspath( repMap["resultFile"] )
00568         if self.jobmode.split( ',' )[0] == "crab":
00569             repMap["outputFile"] = os.path.basename( repMap["outputFile"] )
00570             repMap["resultFile"] = os.path.basename( repMap["resultFile"] )
00571 
00572         return repMap


Member Data Documentation

Definition at line 529 of file validateAlignments.py.

Reimplemented from validateAlignments::GenericValidation.

Definition at line 479 of file validateAlignments.py.