예제 #1
0
    
    cfgWrapper = CMSSWConfig()
    cfgInt = cfgWrapper.loadConfiguration(cmsCfg)
    cfgInt.validateForProduction()

    if nodeNumber:
        try:
            inputModules = chainedInputs[nodeNumber-1]
        except IndexError:
            inputModules = []
        maker.chainCmsRunNode(stageoutOutputs[nodeNumber-1], *inputModules)
            
    maker.setCMSSWVersion(versions[nodeNumber])
    maker.setConfiguration(cfgWrapper, Type = "instance")
    maker.setOriginalCfg(file(cfgFile).read())
    maker.setPSetHash(WorkflowTools.createPSetHash(cfgFile))

    nodeNumber += 1

#  //
# // Pileup sample?
#//
if pileupDS != None:
    maker.addPileupDataset(pileupDS, pileupFilesPerJob)

#  //
# // DataMix pileup sample?
#//
if dataMixDS:
     maker.addPileupDataset(dataMixDS, 1, 'DataMixingModule')
    cfgWrapper = CMSSWConfig()
    #cfgWrapper.originalCfg = file(cmsRunCfg).read()
    cfgInt = cfgWrapper.loadConfiguration(cmsCfg)
    cfgInt.validateForProduction()

    if nodeNumber:
        try:
            inputModules = chainedInputs[nodeNumber-1]
        except IndexError:
            inputModules = []
        maker.chainCmsRunNode(stageoutOutputs[nodeNumber-1], *inputModules)

    maker.setConfiguration(cfgWrapper, Type = "instance")
    maker.setCMSSWVersion(versions[nodeNumber])
    maker.setOriginalCfg(file(cmsRunCfg).read())
    maker.setPSetHash(WorkflowTools.createPSetHash(cmsRunCfg))

    nodeNumber += 1
    
maker.changeCategory(category)
maker.setNamingConventionParameters(acquisitionEra, processingString, processingVersion)
maker.workflow.parameters['Conditions'] = conditions
maker.setOutputDatasetDbsStatus(dbsStatus)
    

if selectionEfficiency != None:
    maker.addSelectionEfficiency(selectionEfficiency)
    maker.addCmsGenSelectionEfficiency(selectionEfficiency)

#  //
# // Pileup sample?
예제 #3
0
    RealPSetHash = None
    if not noRecreate:
        cfgFileContent = file(cfgFile).read()
        replacer=re.compile("\}[\s]*$")
        psetHackString = "\n  PSet psetHack = { string relval = \"%s\"  }\n}\n" % (
            prodName,
            )
        cfgFileContent = replacer.sub(psetHackString, cfgFileContent)
        handle = open(cfgFile, 'w')
        handle.write(cfgFileContent)
        handle.close()    
        #  //
        # // Generate PSet Hash
        #//
        print "generate PSet Hash for %s"%cfgFile
        RealPSetHash = WorkflowTools.createPSetHash(cfgFile)

        ## AF: need to recreate cfg parser since it's not stored in pycfg
        #  //
        # // cfg python parser from CMSSW
        #//
        print "CMSSW python parser on %s \n ....it can take a while..."%cfgFile
        from FWCore.ParameterSet.Config import include
        from FWCore.ParameterSet.parsecf.pyparsing import *
        try:
          cmsCfg = include(cfgFile)
        except ParseException, ex:
          print "Error in CMSSW python parser: ParseException \n %s \n"%ex
          continue
        except ParseFatalException, ex:
          print "Error in CMSSW python parser: ParseFatalException \n %s \n"%ex