def prepareCrabCfg(dataset, crabCfgName, eventsPerJob, jsonFile, storage_element, publish_data_suffix, splitmethod): workdir = publish_data_suffix shortName = dataset.split("/")[1] if dataset.split("/")[2].find("Run2015")!=-1: shortName += "_"+dataset.split("/")[2] shortName = shortName.replace("-","_") shortName+="_"+publish_data_suffix ##Modify CRAB3 configuration config.General.requestName = shortName config.General.workArea = '/afs/cern.ch/work/m/molszews/CMSSW/Data/m2n/03' config.JobType.pluginName = 'Analysis' config.JobType.psetName = 'maxi2ntuples.py' config.JobType.allowUndistributedCMSSW = True config.Data.inputDBS = 'global' config.Data.splitting = splitmethod config.Data.unitsPerJob = eventsPerJob config.Data.totalUnits = -1 config.Data.inputDataset = dataset config.Data.outLFNDirBase = '/store/user/molszews/m2n/'+shortName config.Data.publication = False config.Data.outputDatasetTag = shortName config.Site.storageSite = storage_element if len(jsonFile): config.Data.lumiMask=jsonFile out = open('crabTmp.py','w') out.write(config.pythonise_()) out.close() os.system("crab submit -c crabTmp.py")
def submit(config): res = crabCommand('submit', config=config) #save crab config for the future with open( config.General.workArea + "/crab_" + config.General.requestName + "/crab_config.py", "w") as fi: fi.write(config.pythonise_())
def prepareCrabCfg(dataset, crabCfgName, eventsPerJob, jsonFile, storage_element, publish_data_suffix, splitmethod): workdir = publish_data_suffix shortName = dataset.split("/")[1] if dataset.split("/")[2].find("Run2015") != -1: shortName += "_" + dataset.split("/")[2] shortName = shortName.replace("-", "_") shortName += "_" + publish_data_suffix ##Modify CRAB3 configuration config.General.requestName = shortName config.General.workArea = '/afs/cern.ch/work/m/molszews/CMSSW/Data/m2n/03' config.JobType.pluginName = 'Analysis' config.JobType.psetName = 'maxi2ntuples.py' config.JobType.allowUndistributedCMSSW = True config.Data.inputDBS = 'global' config.Data.splitting = splitmethod config.Data.unitsPerJob = eventsPerJob config.Data.totalUnits = -1 config.Data.inputDataset = dataset config.Data.outLFNDirBase = '/store/user/molszews/m2n/' + shortName config.Data.publication = False config.Data.outputDatasetTag = shortName config.Site.storageSite = storage_element if len(jsonFile): config.Data.lumiMask = jsonFile out = open('crabTmp.py', 'w') out.write(config.pythonise_()) out.close() os.system("crab submit -c crabTmp.py")