Exemplo n.º 1
0
def createTarBall(parstage, folderName, prcName, keepTop, seed, scriptName) :
    print 'Creating tarball distribution for '+args.folderName+'_'+prcName+'.tgz'
    print

    #inputName = folderName + "/powheg.input"

    filename = scriptName

    #if filename = "" :
    #    f = subprocess.Popen(['/bin/sh', '-c'])

    template_dict = {
        "folderName" : folderName,
        "process" : prcName,
        "keepTop" : keepTop,
        "rootfolder" : rootfolder,
        "seed" : seed,
    }

    template_file = "%s/Templates/createTarBall_template.sh" % rootfolder
    helpers.fillTemplatedFile(template_file, filename, template_dict)
    
    if prcName in ['Zj', 'Wj']:
        if os.path.isfile(folderName + '/DYNNLO_mur1_muf1_3D.top'):
            make_nnlo_rwl(folderName)

    os.chmod(filename, 0o755)
Exemplo n.º 2
0
def rundynnlo(folderName, njobs, QUEUE):

    template_dict = {
        "rootfolder" : rootfolder,
        "folderName" : folderName,
    }

    scales = ["1", "2", "0.5"]
    baseconfig = "DYNNLO.input"
    for mur in scales:
        for muf in scales:
            config = "DYNNLO_mur%s_muf%s.input" % (mur, muf)
            makedynnloconfig(folderName, baseconfig, config, float(mur), float(muf))
            subfolderName = "dynnlo_mur%s_muf%s" % (mur, muf)
            template_dict["subfolderName"] = subfolderName

            os.system('mkdir -p ' + folderName + "/" + subfolderName)
            filename = folderName+"/"+subfolderName+"/launch_NNLO.sh"

            template_file = "%s/Templates/rundynnlo_template.sh" % rootfolder
            helpers.fillTemplatedFile(template_file, filename, template_dict, "w")
            os.chmod(filename, 0o755)

            print 'Submitting to condor queues \n'
            condorfile = prepareCondorScript(subfolderName, 'dynnlo', folderName, QUEUE, subfolderName, runInBatchDir=True) 
            runCommand ('condor_submit ' + condorfile + ' -queue '+ str(njobs), TESTING == 0)
Exemplo n.º 3
0
def runhnnlo(folderName, njobs, QUEUE):

    template_dict = {
        "rootfolder": rootfolder,
        "folderName": folderName,
    }

    scales = ["11", "22", "0505"]
    for scale in scales:
        os.system('rm -rf ' + folderName + "/" + scale)
        os.system('mkdir -p ' + folderName + "/" + scale)
        filename = folderName + "/" + scale + "/launch_NNLO.sh"

        template_dict["scale"] = scale

        template_file = "%s/Templates/runhnnlo_template.sh" % rootfolder
        helpers.fillTemplatedFile(template_file, filename, template_dict, "w")
        os.chmod(filename, 0o755)

        print 'Submitting to condor queues \n'
        tagName = 'hnnlo_%s' % scale
        condorfile = prepareCondorScript(tagName, 'hnnlo', folderName, QUEUE,
                                         scale)
        runCommand('condor_submit ' + condorfile + ' -queue ' + str(njobs),
                   TESTING == 0)
Exemplo n.º 4
0
def runGetSource(parstage, xgrid, folderName, powInputName, process,
                 noPdfCheck, tagName, svnRev):
    # parstage, xgrid are strings!

    print 'Getting and compiling POWHEG source...'

    #prepareJob(tagName, '', '.')

    filename = './run_%s.sh' % tagName

    template_dict = {
        "folderName": folderName,
        "powInputName": powInputName,
        "process": process,
        "noPdfCheck": noPdfCheck,
        "rootfolder": rootfolder,
        "patches_dir":
        os.path.dirname(os.path.realpath(__file__)) + "/patches",
        "patch_0": helpers.runGetSource_patch_0(process),
        "patch_1": helpers.runGetSource_patch_1(process),
        "patch_2": helpers.runGetSource_patch_2(process),
        "patch_3": helpers.runGetSource_patch_3(process),
        "patch_4": helpers.runGetSource_patch_4(process),
        "patch_5": helpers.runGetSource_patch_5(process),
        "patch_6": helpers.runGetSource_patch_6(process),
        "patch_7": helpers.runGetSource_patch_7(process),
        "patch_8": helpers.runGetSource_patch_8(process),
    }

    fourFlavorProcesses = ["ST_tch_4f", "bbH", "Wbb_dec", "Wbbj", "WWJ"]
    template_dict["isFiveFlavor"] = int(process not in fourFlavorProcesses)
    template_dict[
        "defaultPDF"] = 325300 if template_dict["isFiveFlavor"] else 325500

    powhegResProcesses = [
        "b_bbar_4l", "HWJ_ew", "HW_ew", "HZJ_ew", "HZ_ew", "vbs-ssww-nloew"
    ]
    if process in powhegResProcesses:
        template_dict["powhegSrc"] = POWHEGRES_SOURCE
        template_dict[
            "svnRepo"] = "svn://powhegbox.mib.infn.it/trunk/POWHEG-BOX-RES"
        template_dict[
            "svnProc"] = "svn://powhegbox.mib.infn.it/trunk/User-Processes-RES"
        template_dict["svnRev"] = svnRev
    else:
        template_dict["powhegSrc"] = POWHEG_SOURCE
        template_dict[
            "svnRepo"] = "svn://powhegbox.mib.infn.it/trunk/POWHEG-BOX-V2"
        template_dict[
            "svnProc"] = "svn://powhegbox.mib.infn.it/trunk/User-Processes-V2"
        template_dict["svnRev"] = svnRev

    template_file = "%s/Templates/runGetSource_template.sh" % rootfolder
    helpers.fillTemplatedFile(template_file, filename, template_dict)
    os.chmod(filename, 0o755)

    return
Exemplo n.º 5
0
def prepareJob(tag, i, folderName) :
    filename = folderName+'/run_%s.sh' % tag

    template_dict = {
        "folderName" : folderName,
        "rootfolder" : rootfolder,
    }

    template_file = "%s/Templates/prepareJob_template.sh" % rootfolder
    helpers.fillTemplatedFile(template_file, filename, template_dict, "w")

    return filename
Exemplo n.º 6
0
def dynnlops_runminlo(folderName, njobs, QUEUE, eosdir):
    if 'NONE' in eosdir:
        print(
            'WARNING: using workdir for output files, you may run out of disk space'
        )
        eosdir = os.getcwd() + "/" + folderName

    os.system('rm -rf ' + folderName + "/minlo-run")
    os.system('mkdir -p ' + folderName + "/minlo-run")
    os.system('rm -rf ' + eosdir + "/minlo-run")
    os.system('mkdir -p ' + eosdir + "/minlo-run")

    m_outfile = folderName + '/pwg-rwl-scalesonly.dat'
    m_factor = ['1d0', '2d0', '0.5d0']
    m_idx = 1001
    fout = open(m_outfile, 'w')
    fout.write("<initrwgt>\n")
    fout.write("<weightgroup name='scale_variation' combine='envelope' >\n")
    for m_rensc in m_factor:
        for m_facsc in m_factor:
            fout.write("<weight id='" + str(m_idx) + "'> renscfact=" +
                       m_rensc + " facscfact=" + m_facsc + " </weight>\n")
            m_idx = m_idx + 1
    fout.write("</weightgroup>\n")
    fout.write("</initrwgt>\n")
    fout.close()

    filename = folderName + "/minlo-run/launch_minlo.sh"

    template_dict = {
        "rootfolder": rootfolder,
        "folderName": folderName,
        "eosdir": eosdir,
    }

    template_file = "%s/Templates/dynnlops_runminlo_template.sh" % rootfolder
    helpers.fillTemplatedFile(template_file, filename, template_dict, "w")
    os.chmod(filename, 0o755)

    print 'Submitting to condor queues \n'
    condorfile = prepareCondorScript(folderName + '_minlo',
                                     'minlo',
                                     folderName,
                                     QUEUE,
                                     runInBatchDir=True)
    runCommand('condor_submit ' + condorfile + ' -queue ' + str(njobs),
               TESTING == 0)
Exemplo n.º 7
0
def prepareJobForEvents (tag, i, folderName, EOSfolder) :
    runCommand('rm ' + rootfolder + '/' + folderName + '/log_' + tag + '.log')
    filename = 'run_%s.sh' % tag

    prepareJob(tag, i, folderName)

    template_dict = {
        "folderName" : folderName,
        "rootfolder" : rootfolder,
        "iJob"       : i,
        "tag"        : tag,
    }

    template_file = "%s/Templates/prepareJobForEvents_template.sh" % rootfolder
    helpers.fillTemplatedFile(template_file, filename, template_dict)

    return filename
Exemplo n.º 8
0
def runGetSource(parstage, xgrid, folderName, powInputName, process,
                 noPdfCheck, tagName):
    # parstage, xgrid are strings!

    print 'Getting and compiling POWHEG source...'

    #prepareJob(tagName, '', '.')

    filename = './run_%s.sh' % tagName

    template_dict = {
        "folderName": folderName,
        "powInputName": powInputName,
        "process": process,
        "noPdfCheck": noPdfCheck,
        "rootfolder": rootfolder,
    }
    template_dict["patches_dir"] = os.path.dirname(
        os.path.realpath(__file__)) + "/patches"

    fourFlavorProcesses = ["ST_tch_4f", "bbH", "Wbb_dec", "Wbbj", "WWJ"]
    template_dict["isFiveFlavor"] = int(process not in fourFlavorProcesses)
    template_dict[
        "defaultPDF"] = 325300 if template_dict["isFiveFlavor"] else 325500

    DYNNLOPS = ["Zj", "Wj"]
    if process in DYNNLOPS:
        template_dict["forDYNNLOPS"] = 1
    else:
        template_dict["forDYNNLOPS"] = 0

    powhegResProcesses = [
        "b_bbar_4l", "HWJ_ew", "HW_ew", "HZJ_ew", "HZ_ew", "vbs-ssww-nloew"
    ]
    if process in powhegResProcesses:
        template_dict["powhegSrc"] = POWHEGRES_SOURCE
    else:
        template_dict["powhegSrc"] = POWHEG_SOURCE

    template_file = "%s/Templates/runGetSource_template.sh" % rootfolder
    helpers.fillTemplatedFile(template_file, filename, template_dict)
    os.chmod(filename, 0o755)

    return