コード例 #1
0
def prepareRequest(rawdataset, options):
    requests = []
    for dataset in rawdataset:
        PD = dataset.split('/')[1]

        dsparameters = copy.copy(requestDefault)
        dsparameters["InputDataset"] = dataset
        dsparameters["RequestString"] += PD
        if options.lastRun > 0:
            if options.firstRun > 0:
                dsparameters["RunWhitelist"] = runlistfromdbs(
                    'dataset = %s and run.number<=%s and run.number>=%s' %
                    (dataset, options.lastRun, options.firstRun))
            else:
                dsparameters["RunWhitelist"] = runlistfromdbs(
                    'dataset = %s and run.number<=%s' %
                    (dataset, options.lastRun))

        #find the reprocessing configuration
        scenario, reprocfg = getReproCfg(PD)
        cfgid = wma.upload_to_couch(reprocfg, dsparameters["RequestString"],
                                    dsparameters["RequestString"], g_dry_run)
        if cfgid:
            dsparameters["ProcConfigCacheID"] = cfgid
            dsparameters["Scenario"] = scenario
        else:
            raise Exception("no id for" + PD + " " + reprocfg)
        dsparameters['NR_cfg'] = reprocfg
        #find the skimming configuration
        skim = getSkimCfg(PD)
        if skim:
            addSkimToRequest(dsparameters, skim)

        requests.append(dsparameters)
    return requests
コード例 #2
0
ファイル: full_rereco.py プロジェクト: bajarang/wmcontrol
def prepareRequest(rawdataset,options):
    requests=[]
    for dataset in rawdataset:
        PD=dataset.split('/')[1]

        dsparameters=copy.copy(requestDefault)
        dsparameters["InputDataset"] = dataset
        dsparameters["RequestString"]+=PD
        if options.lastRun>0:
            if options.firstRun>0:
                dsparameters["RunWhitelist"]=runlistfromdbs('dataset = %s and run.number<=%s and run.number>=%s'%(dataset,options.lastRun,options.firstRun))
            else:
                dsparameters["RunWhitelist"]=runlistfromdbs('dataset = %s and run.number<=%s'%(dataset,options.lastRun))
            
        #find the reprocessing configuration
        scenario,reprocfg=getReproCfg(PD)
        cfgid=wma.upload_to_couch(reprocfg,dsparameters["RequestString"],dsparameters["RequestString"],g_dry_run)
        if cfgid:
            dsparameters["ProcConfigCacheID"]=cfgid
            dsparameters["Scenario"]=scenario
        else:
            raise Exception("no id for"+PD+" "+reprocfg)
        dsparameters['NR_cfg']=reprocfg
        #find the skimming configuration
        skim=getSkimCfg(PD)
        if skim:
            addSkimToRequest(dsparameters,skim)
        
        requests.append(dsparameters)
    return requests
コード例 #3
0
ファイル: full_rereco.py プロジェクト: bajarang/wmcontrol
def addSkimToRequest(params,cfg):
    nextIndex=1
    while 'SkimName%d'%(nextIndex,) in params.keys():
        nextIndex+=1
    params['SkimName%d'%(nextIndex,)] = params["RequestString"]+'Skim'
    params['SkimInput%d'%(nextIndex,)] = 'RECOoutput'
    cfgid=wma.upload_to_couch(cfg,params["RequestString"]+'Skim',params["RequestString"]+'Skim',g_dry_run)
    if cfgid==None:
        print "no id for",cfg
        sys.exit()
    params['Skim%dConfigCacheID'%(nextIndex,)] = cfgid
    params["nskims"] = nextIndex
    params['NR_skim']=cfg
コード例 #4
0
def addSkimToRequest(params, cfg):
    nextIndex = 1
    while 'SkimName%d' % (nextIndex, ) in params.keys():
        nextIndex += 1
    params['SkimName%d' % (nextIndex, )] = params["RequestString"] + 'Skim'
    params['SkimInput%d' % (nextIndex, )] = 'RECOoutput'
    cfgid = wma.upload_to_couch(cfg, params["RequestString"] + 'Skim',
                                params["RequestString"] + 'Skim', g_dry_run)
    if cfgid == None:
        print "no id for", cfg
        sys.exit()
    params['Skim%dConfigCacheID' % (nextIndex, )] = cfgid
    params["nskims"] = nextIndex
    params['NR_skim'] = cfg