def generateCmsGenConfig(self, jobSpecNode): """ _generateCmsGenConfig_ Process CmsGen type nodes to insert maxEvents and run numbers for cmsGen jobs """ if jobSpecNode.type != "CmsGen": return jobSpecNode.applicationControls["firstRun"] = self.count jobSpecNode.applicationControls["maxEvents"] = self.eventsPerJob jobSpecNode.applicationControls["randomSeed"] = randomSeed() jobSpecNode.applicationControls["fileName"] = "%s-%s.root" % (self.currentJob, jobSpecNode.name) jobSpecNode.applicationControls["logicalFileName"] = "%s-%s.root" % (self.currentJob, jobSpecNode.name) return
def generateCmsGenConfig(self, jobSpecNode): """ _generateCmsGenConfig_ Process CmsGen type nodes to insert maxEvents and run numbers for cmsGen jobs """ if jobSpecNode.type != "CmsGen": return jobSpecNode.applicationControls['firstRun'] = self.count jobSpecNode.applicationControls['maxEvents'] = self.eventsPerJob jobSpecNode.applicationControls['randomSeed'] = randomSeed() jobSpecNode.applicationControls['fileName'] = "%s-%s.root" % ( self.currentJob, jobSpecNode.name) jobSpecNode.applicationControls['logicalFileName'] = "%s-%s.root" % ( self.currentJob, jobSpecNode.name) return
def generateCmsGenConfig(self, jobSpecNode): """ _generateCmsGenConfig_ Process CmsGen type nodes to insert maxEvents and run numbers for cmsGen jobs """ if jobSpecNode.type != "CmsGen": return if self['RunNumber'] != None: jobSpecNode.applicationControls['firstRun'] = self['RunNumber'] if self['MaxEvents'] != None: jobSpecNode.applicationControls['maxEvents'] = self['MaxEvents'] jobSpecNode.applicationControls['randomSeed'] = randomSeed() jobSpecNode.applicationControls['fileName'] = "%s-%s.root" % ( jobSpecNode.jobName, jobSpecNode.name) jobSpecNode.applicationControls['logicalFileName'] = "%s-%s.root" % ( jobSpecNode.jobName, jobSpecNode.name) return
def generateCmsGenConfig(self,jobSpecNode): """ _generateCmsGenConfig_ Process CmsGen type nodes to insert maxEvents and run numbers for cmsGen jobs """ if jobSpecNode.type != "CmsGen": return if self['RunNumber'] != None: jobSpecNode.applicationControls['firstRun'] = self['RunNumber'] if self['MaxEvents'] != None: jobSpecNode.applicationControls['maxEvents'] = self['MaxEvents'] jobSpecNode.applicationControls['randomSeed'] = randomSeed() jobSpecNode.applicationControls['fileName'] = "%s-%s.root" % ( jobSpecNode.jobName, jobSpecNode.name) jobSpecNode.applicationControls['logicalFileName'] = "%s-%s.root" % ( jobSpecNode.jobName, jobSpecNode.name) return
def generateCmsGenConfig(self, jobSpecNode): """ _generateCmsGenConfig_ Process CmsGen type nodes to insert maxEvents and run numbers for cmsGen jobs """ if jobSpecNode.type != "CmsGen": return # this is intentional !!! jobSpecNode.applicationControls['firstRun'] = self.lumi jobSpecNode.applicationControls['maxEvents'] = self.eventsPerJob jobSpecNode.applicationControls['randomSeed'] = randomSeed() jobSpecNode.applicationControls['fileName'] = "%s-%s.root" % ( self.jobName, jobSpecNode.name) jobSpecNode.applicationControls['logicalFileName'] = "%s-%s.root" % ( self.jobName, jobSpecNode.name) return
def __call__(self, jobName, **args): """ _operator()_ Insert per job information into a copy of the template CMSSWConfig object and return it """ newCfg = self.template.lightweightClone() # // # // Output modules first, use the module name in the #// parameters in case of multiple modules # // # // #// for modName in newCfg.outputModules.keys(): outModule = newCfg.getOutputModule(modName) outModule['catalog'] = "%s-%s-Output.xml" % (jobName, modName) outModule['fileName'] = "%s-%s.root" % (jobName, modName) outModule['logicalFileName'] = "%s-%s.root" % (jobName, modName) if outModule.has_key('LFNBase'): outModule['logicalFileName'] = "%s/%s" % ( outModule['LFNBase'], outModule['logicalFileName'] ) maxEvents = args.get("maxEvents", None) if maxEvents != None: selectionEff = self.appControls.get("SelectionEfficiency", None) evMultiplier = self.appControls.get("EventMultiplier", None) # // # // Adjust number of events for selection efficiency #// if selectionEff != None: newMaxEv = float(maxEvents) / float(selectionEff) maxEvents = int(newMaxEv) # // If this node has an Event Multiplier, adjust maxEvents #// if evMultiplier != None: maxEvents = int(maxEvents) * int(evMultiplier) newCfg.setInputMaxEvents(maxEvents) maxOutputEvents = args.get("maxEventsWritten", None) if maxOutputEvents != None: newCfg.setOutputMaxEvents(maxOutputEvents) skipEvents = args.get("skipEvents", None) if skipEvents != None: newCfg.sourceParams['skipEvents'] = skipEvents firstEvent = args.get("firstEvent", None) if firstEvent != None: newCfg.sourceParams['firstEvent'] = firstEvent firstRun = args.get("firstRun", None) if firstRun != None: newCfg.sourceParams['firstRun'] = firstRun firstLumi = args.get("firstLumi", None) if firstLumi != None: newCfg.sourceParams['firstLuminosityBlock'] = firstLumi fileNames = args.get("fileNames", None) if fileNames != None: #newCfg.inputFiles.extend(fileNames) newCfg.inputFiles = fileNames seeds = [ randomSeed() for i in range(0, newCfg.requiredSeeds+1)] newCfg.seeds = seeds return newCfg
def __call__(self, jobName, **args): """ _operator()_ Insert per job information into a copy of the template CMSSWConfig object and return it """ newCfg = self.template.lightweightClone() # // # // Output modules first, use the module name in the #// parameters in case of multiple modules # // # // #// for modName in newCfg.outputModules.keys(): outModule = newCfg.getOutputModule(modName) outModule['catalog'] = "%s-%s-Output.xml" % (jobName, modName) outModule['fileName'] = "%s-%s.root" % (jobName, modName) outModule['logicalFileName'] = "%s-%s.root" % (jobName, modName) if outModule.has_key('LFNBase'): outModule['logicalFileName'] = "%s/%s" % ( outModule['LFNBase'], outModule['logicalFileName']) maxEvents = args.get("maxEvents", None) if maxEvents != None: selectionEff = self.appControls.get("SelectionEfficiency", None) evMultiplier = self.appControls.get("EventMultiplier", None) # // # // Adjust number of events for selection efficiency #// if selectionEff != None: newMaxEv = float(maxEvents) / float(selectionEff) maxEvents = int(newMaxEv) # // If this node has an Event Multiplier, adjust maxEvents #// if evMultiplier != None: maxEvents = int(maxEvents) * int(evMultiplier) newCfg.setInputMaxEvents(maxEvents) maxOutputEvents = args.get("maxEventsWritten", None) if maxOutputEvents != None: newCfg.setOutputMaxEvents(maxOutputEvents) skipEvents = args.get("skipEvents", None) if skipEvents != None: newCfg.sourceParams['skipEvents'] = skipEvents firstEvent = args.get("firstEvent", None) if firstEvent != None: newCfg.sourceParams['firstEvent'] = firstEvent firstRun = args.get("firstRun", None) if firstRun != None: newCfg.sourceParams['firstRun'] = firstRun firstLumi = args.get("firstLumi", None) if firstLumi != None: newCfg.sourceParams['firstLuminosityBlock'] = firstLumi fileNames = args.get("fileNames", None) if fileNames != None: #newCfg.inputFiles.extend(fileNames) newCfg.inputFiles = fileNames seeds = [randomSeed() for i in range(0, newCfg.requiredSeeds + 1)] newCfg.seeds = seeds return newCfg