CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes

validateAlignments::GenericValidation Class Reference

Inheritance diagram for validateAlignments::GenericValidation:
validateAlignments::GeometryComparison validateAlignments::MonteCarloValidation validateAlignments::OfflineValidation validateAlignments::TrackSplittingValidation validateAlignments::ZMuMuValidation validateAlignments::OfflineValidationDQM validateAlignments::OfflineValidationParallel

List of all members.

Public Member Functions

def __init__
def createConfiguration
def createCrabCfg
def createFiles
def createScript
def getCompareStrings
def getRepMap

Public Attributes

 alignmentToValidate
 configFiles
 crabConfigurationFiles
 filesToCompare
 general
 jobmode
 name
 randomWorkdirPart
 scriptFiles

Static Public Attributes

string defaultReferenceName = "DEFAULT"

Detailed Description

Definition at line 272 of file validateAlignments.py.


Constructor & Destructor Documentation

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

Reimplemented in validateAlignments::OfflineValidation, validateAlignments::OfflineValidationParallel, validateAlignments::OfflineValidationDQM, validateAlignments::MonteCarloValidation, validateAlignments::TrackSplittingValidation, and validateAlignments::ZMuMuValidation.

Definition at line 274 of file validateAlignments.py.

00275                                                   :
00276         import random
00277         self.name = valName
00278         self.alignmentToValidate = alignment
00279         self.general = config.getGeneral()
00280         self.randomWorkdirPart = "%0i"%random.randint(1,10e9)
00281         self.configFiles = []
00282         self.filesToCompare = {}
00283         self.jobmode = self.general["jobmode"]


Member Function Documentation

def validateAlignments::GenericValidation::createConfiguration (   self,
  fileContents,
  path,
  schedule = None 
)

Definition at line 333 of file validateAlignments.py.

00334                                                                      :
00335         self.configFiles = GenericValidation.createFiles( self, fileContents, path ) 
00336         if not schedule == None:
00337             schedule = [  os.path.join( path, cfgName) for cfgName in schedule]
00338             for cfgName in schedule:
00339                 if not cfgName in self.configFiles:
00340                     raise StandardError, "scheduled %s missing in generated configfiles: %s"% (cfgName, self.configFiles)
00341             for cfgName in self.configFiles:
00342                 if not cfgName in schedule:
00343                     raise StandardError, "generated configuration %s not scheduled: %s"% (cfgName, schedule)
00344             self.configFiles = schedule
00345         return self.configFiles

def validateAlignments::GenericValidation::createCrabCfg (   self,
  fileContents,
  path 
)

Reimplemented in validateAlignments::OfflineValidation, validateAlignments::MonteCarloValidation, validateAlignments::TrackSplittingValidation, and validateAlignments::ZMuMuValidation.

Definition at line 352 of file validateAlignments.py.

00352                                                 :        
00353         self.crabConfigurationFiles =  GenericValidation.createFiles( self, fileContents, path )
00354         return self.crabConfigurationFiles
00355 
def validateAlignments::GenericValidation::createFiles (   self,
  fileContents,
  path 
)

Definition at line 323 of file validateAlignments.py.

00324                                                :
00325         result = []
00326         for fileName in fileContents:
00327             filePath = os.path.join( path, fileName)
00328             theFile = open( filePath, "w" )
00329             theFile.write( fileContents[ fileName ] )
00330             theFile.close()
00331             result.append( filePath )
00332         return result

def validateAlignments::GenericValidation::createScript (   self,
  fileContents,
  path,
  downloadFiles = [] 
)

Definition at line 346 of file validateAlignments.py.

00346                                                                  :        
00347         self.scriptFiles =  GenericValidation.createFiles( self, fileContents, path )
00348         for script in self.scriptFiles:
00349             os.chmod(script,0755)
00350         return self.scriptFiles
00351 
def validateAlignments::GenericValidation::getCompareStrings (   self,
  requestId = None 
)

Definition at line 306 of file validateAlignments.py.

00307                                                    :
00308         result = {}
00309         repMap = self.alignmentToValidate.getRepMap()
00310         for validationId in self.filesToCompare:
00311             repMap["file"] = self.filesToCompare[ validationId ]
00312             if repMap["file"].startswith( "/castor/" ):
00313                 repMap["file"] = "rfio:%(file)s"%repMap
00314             result[ validationId ]=  "%(file)s=%(name)s|%(color)s|%(style)s"%repMap 
00315         if requestId == None:
00316             return result
00317         else:
00318             if not "." in requestId:
00319                 requestId += ".%s"%GenericValidation.defaultReferenceName
00320             if not requestId.split(".")[-1] in result:
00321                 raise StandardError, "could not find %s in reference Objects!"%requestId.split(".")[-1]
00322             return result[ requestId.split(".")[-1] ]

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

Reimplemented in validateAlignments::GeometryComparison, validateAlignments::OfflineValidation, validateAlignments::OfflineValidationParallel, validateAlignments::OfflineValidationDQM, validateAlignments::MonteCarloValidation, validateAlignments::TrackSplittingValidation, and validateAlignments::ZMuMuValidation.

Definition at line 284 of file validateAlignments.py.

00285                                          :
00286         if alignment == None:
00287             alignment = self.alignmentToValidate
00288         result = alignment.getRepMap()
00289         result.update( self.general )
00290         result.update({
00291                 "workdir": os.path.join( self.general["workdir"],
00292                                          self.randomWorkdirPart ),
00293                 "datadir": self.general["datadir"],
00294                 "logdir": self.general["logdir"],
00295                 "dbLoad": alignment.getLoadTemplate(),
00296                 "APE": alignment.getAPETemplate(),
00297                 "CommandLineTemplate": ("#run configfile and post-proccess it\n"
00298                                         "cmsRun %(cfgFile)s\n"
00299                                         "%(postProcess)s "),
00300                 "CMSSW_BASE": os.environ['CMSSW_BASE'],
00301                 "SCRAM_ARCH": os.environ['SCRAM_ARCH'],
00302                 "alignmentName": alignment.name,
00303                 "condLoad": alignment.getConditions()
00304                 })
00305         return result


Member Data Documentation

Definition at line 274 of file validateAlignments.py.

Definition at line 274 of file validateAlignments.py.

Definition at line 352 of file validateAlignments.py.

Definition at line 273 of file validateAlignments.py.

Definition at line 274 of file validateAlignments.py.

Definition at line 274 of file validateAlignments.py.

Definition at line 274 of file validateAlignments.py.

Reimplemented in validateAlignments::GeometryComparison.

Definition at line 274 of file validateAlignments.py.

Definition at line 346 of file validateAlignments.py.