CMS 3D CMS Logo

Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes

validateAlignments::GenericValidation Class Reference

Inheritance diagram for validateAlignments::GenericValidation:
validateAlignments::GeometryComparision validateAlignments::MonteCarloValidation validateAlignments::OfflineValidation validateAlignments::TrackSplittingValidation validateAlignments::OfflineValidationDQM

List of all members.

Public Member Functions

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

Public Attributes

 alignmentToValidate
 configFiles
 filesToCompare
 randomWorkdirPart
 scriptFiles

Static Public Attributes

string defaultReferenceName = "DEFAULT"

Private Attributes

 __general

Detailed Description

Definition at line 178 of file validateAlignments.py.


Constructor & Destructor Documentation

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

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

Definition at line 181 of file validateAlignments.py.

00182                                          :
00183         import random
00184         self.alignmentToValidate = alignment
00185         self.__general = readGeneral( config )
00186         self.randomWorkdirPart = "%0i"%random.randint(1,10e9)
00187         self.configFiles = []
00188         self.filesToCompare = {}
00189 #        self.configFileSchedule = None


Member Function Documentation

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

Definition at line 243 of file validateAlignments.py.

00244                                                                      :
00245         self.configFiles = GenericValidation.createFiles( self, fileContents, path ) 
00246         if not schedule == None:
00247             schedule = [  os.path.join( path, cfgName) for cfgName in schedule]
00248             for cfgName in schedule:
00249                 if not cfgName in self.configFiles:
00250                     raise StandardError, "scheduled %s missing in generated configfiles: %s"% (cfgName, self.configFiles)
00251             for cfgName in self.configFiles:
00252                 if not cfgName in schedule:
00253                     raise StandardError, "generated configuration %s not scheduled: %s"% (cfgName, schedule)
00254             self.configFiles = schedule
00255         return self.configFiles

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

Definition at line 233 of file validateAlignments.py.

00234                                                :
00235         result = []
00236         for fileName in fileContents:
00237             filePath = os.path.join( path, fileName)
00238             theFile = open( filePath, "w" )
00239             theFile.write( fileContents[ fileName ] )
00240             theFile.close()
00241             result.append( filePath )
00242         return result

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

Definition at line 256 of file validateAlignments.py.

00256                                                                  :        
00257         self.scriptFiles =  GenericValidation.createFiles( self, fileContents, path )
00258         for script in self.scriptFiles:
00259             os.chmod(script,0755)
00260         return self.scriptFiles
00261 
def validateAlignments::GenericValidation::getCompareStrings (   self,
  requestId = None 
)

Definition at line 216 of file validateAlignments.py.

00217                                                    :
00218         result = {}
00219         repMap = self.alignmentToValidate.getRepMap()
00220         for validationId in self.filesToCompare:
00221             repMap["file"] = self.filesToCompare[ validationId ]
00222             if repMap["file"].startswith( "/castor/" ):
00223                 repMap["file"] = "rfio:%(file)s"%repMap
00224             result[ validationId ]=  "%(file)s=%(name)s|%(color)s|%(style)s"%repMap 
00225         if requestId == None:
00226             return result
00227         else:
00228             if not "." in requestId:
00229                 requestId += ".%s"%GenericValidation.defaultReferenceName
00230             if not requestId.split(".")[-1] in result:
00231                 raise StandardError, "could not find %s in reference Objects!"%requestId.split(".")[-1]
00232             return result[ requestId.split(".")[-1] ]

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

Reimplemented in validateAlignments::GeometryComparision, validateAlignments::OfflineValidation, and validateAlignments::OfflineValidationDQM.

Definition at line 190 of file validateAlignments.py.

00191                                          :
00192         if alignment == None:
00193             alignment = self.alignmentToValidate
00194         result = alignment.getRepMap()
00195         result.update({
00196                 "nEvents": str(self.__general["maxevents"]),
00197                 "dataset": str(self.__general["dataset"]),
00198                 "superPointingDataset": str(self.__general["superPointingDataset"]),
00199                 "RelValSample": self.__general["relvalsample"],
00200                 "TrackCollection": str(self.__general["trackcollection"]),
00201                 "workdir": str(os.path.join(self.__general["workdir"],self.randomWorkdirPart)),
00202                 "datadir": str(self.__general["datadir"]),
00203                 "logdir": str(self.__general["logdir"]),
00204                 "dbLoad": alignment.getLoadTemplate(),
00205                 "CommandLineTemplate": """#run configfile and post-proccess it
00206 cmsRun %(cfgFile)s
00207 %(postProcess)s """,
00208                 "GlobalTag": self.__general["globaltag"],
00209                 "CMSSW_BASE": os.environ['CMSSW_BASE'],
00210                 "alignmentName": alignment.name,
00211                 "offlineModuleLevelHistsTransient":  self.__general["offlineModuleLevelHistsTransient"]
00212                 })
00213         #TODO catch missing delcalration of i.e. dataset or relvalsample here and rethrow to be catched by 
00214         #     individual validation.
00215         return result


Member Data Documentation

Definition at line 181 of file validateAlignments.py.

Definition at line 181 of file validateAlignments.py.

Definition at line 181 of file validateAlignments.py.

Definition at line 179 of file validateAlignments.py.

Definition at line 181 of file validateAlignments.py.

Reimplemented in validateAlignments::GeometryComparision.

Definition at line 181 of file validateAlignments.py.

Definition at line 256 of file validateAlignments.py.