diff --git a/bin/Powheg/Templates/createTarBall_template.sh b/bin/Powheg/Templates/createTarBall_template.sh index 17b71fb61b3d..cc58f3482f79 100644 --- a/bin/Powheg/Templates/createTarBall_template.sh +++ b/bin/Powheg/Templates/createTarBall_template.sh @@ -15,14 +15,10 @@ if [ -e $$WORKDIR/$$folderName/pwg-0001-stat.dat ]; then cp -p $$WORKDIR/$$folderName/pwg-0001-stat.dat $$WORKDIR/$$folderName/pwg-stat.dat fi -FULLGRIDRM=`ls $${WORKDIR}/$${folderName} | grep fullgrid-rm | head -n 1` -FULLGRIDBTL=`ls $${WORKDIR}/$${folderName} | grep fullgrid-btl | head -n 1` -UBOUND=`ls $${WORKDIR}/$${folderName} | grep ubound | head -n 1` -PWGSTAT=`ls $${WORKDIR}/$${folderName} | grep st3-stat | head -n 1` -FULLGRIDRM=$${FULLGRIDRM%?} -FULLGRIDBTL=$${FULLGRIDBTL%?} -UBOUND=$${UBOUND%?} -PWGSTAT=$${PWGSTAT%?} +FULLGRIDRM=`ls *fullgrid-rm* | head -n 1` +FULLGRIDBTL=`ls *fullgrid-btl* | head -n 1` +UBOUND=`ls *ubound* | head -n 1` +PWGSTAT=`ls *st3-stat* | head -n 1` if [ $${#FULLGRIDRM} -gt 0 -a $${#FULLGRIDBTL} -gt 0 ]; then cp -p $$WORKDIR/$$folderName/$${FULLGRIDRM} $$WORKDIR/$$folderName/pwgfullgrid-rm.dat @@ -92,15 +88,6 @@ fi sed -i 's/pwggrid.dat ]]/pwggrid.dat ]] || [ -e $${WORKDIR}\/pwggrid-0001.dat ]/g' runcmsgrid.sh -if [ "$$process" = "WWJ" ]; then - cp -pr $${WORKDIR}/$${folderName}/POWHEG-BOX/WWJ/TWOLOOP_GRIDS_reg1 . - cp -pr $${WORKDIR}/$${folderName}/POWHEG-BOX/WWJ/TWOLOOP_GRIDS_reg2 . - cp -pr $${WORKDIR}/$${folderName}/POWHEG-BOX/WWJ/TWOLOOP_GRIDS_reg3 . - cp -pr $${WORKDIR}/$${folderName}/POWHEG-BOX/WWJ/TWOLOOP_GRIDS_reg4 . - #force keep top = 0 in this case - keepTop='0' -fi - sed -i s/SCRAM_ARCH_VERSION_REPLACE/$${SCRAM_ARCH}/g runcmsgrid.sh sed -i s/CMSSW_VERSION_REPLACE/$${CMSSW_VERSION}/g runcmsgrid.sh @@ -148,16 +135,28 @@ if [ "$$process" = "X0jj" ] ; then exclude_extra="--exclude=MG5_aMC*.tar.gz --exclude=pwgbtildeupb-*.dat --exclude=pwgremnupb-*.dat --exclude=pwgcounters-st1-*.dat --exclude=pwgcounters-st2-*.dat --exclude=pwgcounters-st3-*.dat --exclude=pwg-*-stat.dat" fi +if [ "$$process" = "WWJ" ] ; then + echo "Adding MATRIXStuff libs to folderName" + cd $${WORKDIR}/$${folderName} + mkdir $${WORKDIR}/$${folderName}/MATRIXStuff/external + cp -r $${WORKDIR}/$${folderName}/POWHEG-BOX/MATRIXStuff/external/*-install $${WORKDIR}/$${folderName}/MATRIXStuff/external/ + cp -r $${WORKDIR}/$${folderName}/POWHEG-BOX/MATRIXStuff/external/qqvvamp-1.1 $${WORKDIR}/$${folderName}/MATRIXStuff/external/ + cp -r $${WORKDIR}/$${folderName}/POWHEG-BOX/MATRIXStuff/lib $${WORKDIR}/$${folderName}/MATRIXStuff/ + cd - +fi + if [ $$keepTop == '1' ]; then echo 'Keeping validation plots.' echo 'Packing...' $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tgz' tar --exclude=POWHEG-BOX --exclude=powhegbox*.tar.gz --exclude=*.lhe --exclude=run_*.sh --exclude=*temp --exclude=pwgbtlupb-*.dat --exclude=pwgrmupb-*.dat --exclude=run_*.out --exclude=run_*.err --exclude=run_*.log --exclude=minlo-run --exclude=dynnlo* $$exclude_extra -zcf $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tgz' * else - if [ $$process == 'WWJ' ]; then + if [ $$process == "WWJ" ]; then echo 'Preparing WWJ gridpack' - echo 'Packing...' $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tar.xz' - tar --exclude=POWHEG-BOX --exclude=powhegbox*.tar.gz --exclude=*.top --exclude=*.lhe --exclude=run_*.sh --exclude=*temp --exclude=pwgbtlupb-*.dat --exclude=pwgrmupb-*.dat --exclude=run_*.out --exclude=run_*.err --exclude=run_*.log --exclude=minlo-run --exclude=dynnlo* -cJpsf $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tar.xz' * + echo 'Packing...' $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tgz' + tar --exclude=POWHEG-BOX --exclude=powhegbox*.tar.gz --exclude=*.top --exclude=*.lhe --exclude=run_*.sh --exclude=*temp --exclude=pwgbtlupb-*.dat --exclude=pwgrmupb-*.dat --exclude=run_*.out --exclude=run_*.err --exclude=run_*.log --exclude=minlo-run --exclude=dynnlo* -zcf $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tgz' * + echo 'Removing copy of MATRIXStuff' + rm -rf $${WORKDIR}/$${folderName}/MATRIXStuff/ else echo 'Packing...' $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tgz' tar --exclude=POWHEG-BOX --exclude=powhegbox*.tar.gz --exclude=*.top --exclude=*.lhe --exclude=run_*.sh --exclude=*temp --exclude=pwgbtlupb-*.dat --exclude=pwgrmupb-*.dat --exclude=run_*.out --exclude=run_*.err --exclude=run_*.log --exclude=minlo-run --exclude=dynnlo* $$exclude_extra -zcf $${WORKDIR}'/'$${process}'_'$${SCRAM_ARCH}'_'$${CMSSW_VERSION}'_'$${folderName}'.tgz' * diff --git a/bin/Powheg/Templates/runGetSource_template.sh b/bin/Powheg/Templates/runGetSource_template.sh index c18048a8ad6d..78f8175a9db8 100644 --- a/bin/Powheg/Templates/runGetSource_template.sh +++ b/bin/Powheg/Templates/runGetSource_template.sh @@ -46,10 +46,13 @@ forMiNNLO=0 grep -q "^minnlo\\s*1" powheg.input; test $$? -eq 1 || forMiNNLO=1 forX0jj=0 grep -q "MGcosa" powheg.input; test $$? -eq 1 || forX0jj=1 - +forWWJ=0 +if [[ $$process == "WWJ" ]]; then + forWWJ=1 +fi cd $$WORKDIR cd $${name} -python3 ../make_rwl.py $${is5FlavorScheme} $${defaultPDF} $${forMiNNLO} $${forX0jj} $${period} +python3 ../make_rwl.py $${is5FlavorScheme} $${defaultPDF} $${forMiNNLO} $${forX0jj} $${period} $${forWWJ} if [ -s ../JHUGen.input ]; then cp -p ../JHUGen.input JHUGen.input diff --git a/bin/Powheg/Utilities/helpers.py b/bin/Powheg/Utilities/helpers.py index 62bd9b63dd2b..86fd657f76bf 100644 --- a/bin/Powheg/Utilities/helpers.py +++ b/bin/Powheg/Utilities/helpers.py @@ -205,11 +205,13 @@ def runGetSource_patch_6(process) : cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \ ./matrix --minnlo_interface\n \ cd -\n \ -cd ${WORKDIR}/${name}/POWHEG-BOX/WWJ\n \ -wget --no-verbose --no-check-certificate https://wwwth.mpp.mpg.de/members/wieseman/download/codes/WW_MiNNLO/VVamp_interpolation_grids/WW_MiNNLO_2loop_grids_reduced1.tar.gz\n \ -tar xzf WW_MiNNLO_2loop_grids_reduced1.tar.gz\n \ +cd ${WORKDIR}/${name}\n \ +ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg1 TWOLOOP_GRIDS_reg1\n \ +ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg2 TWOLOOP_GRIDS_reg2\n \ +ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg3 TWOLOOP_GRIDS_reg3\n \ +ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg4 TWOLOOP_GRIDS_reg4\n \ cd -\n \ -source /cvmfs/cms.cern.ch/${SCRAM_ARCH}/external/cmake/3.10.0/etc/profile.d/init.sh", +source /cvmfs/cms.cern.ch/${SCRAM_ARCH}/external/cmake/3.17.2/etc/profile.d/init.sh", "ZZJ" : "cp Makefile Makefile.orig\n \ cat Makefile.orig | sed -e \"s#FASTJET_CONFIG=.\+#FASTJET_CONFIG=$(scram tool info fastjet | grep BASE | cut -d \"=\" -f2)/bin/fastjet-config#g\" | sed -e \"s#\#\ FASTJET_CONFIG#FASTJET_CONFIG#g\" > Makefile\n \ cd ${WORKDIR}/${name}/POWHEG-BOX/MATRIXStuff\n \ diff --git a/bin/Powheg/make_rwl.py b/bin/Powheg/make_rwl.py index 9ca80385c978..527c2cc7ae03 100644 --- a/bin/Powheg/make_rwl.py +++ b/bin/Powheg/make_rwl.py @@ -22,9 +22,10 @@ forMiNNLO = bool(int(sys.argv[3])) if len(sys.argv) > 3 else False forX0jj = bool(int(sys.argv[4])) if len(sys.argv) > 4 else False Period = str(sys.argv[5]) if len(sys.argv) > 5 else "Run3" +forWWJ = bool(int(sys.argv[6])) if len(sys.argv) > 6 else False -if forMiNNLO: +if forMiNNLO and not forWWJ: CentralPDF=306000 # is5FlavorScheme = True @@ -56,7 +57,7 @@ fout.write("\n") -if forMiNNLO: +if forMiNNLO and not forWWJ: # additional MiNNLO scale variations (NNPDF 3.0) fout.write("\n") @@ -119,6 +120,35 @@ [29400, 29400, 'MSHT20an3lo_as_smallrange', 7], ], } + +elif forWWJ: + print("WWJ: Going to use only Run 3 4FS central PDFs for generation speed") + # 4F PDF + pdf_sets = { + # weight id, LHAPDF id, name, replicas to be written + "PDF_variation1 , hessian" : + [ + [2000, 325500, 'NNPDF31_nnlo_as_0118_nf_4_mc_hessian', 101], + [2200, 320500, 'NNPDF31_nlo_as_0118_nf_4', 1], + [2500, 292000, 'NNPDF30_nlo_nf_4_pdfas', 1], + [2600, 335700, 'NNPDF40_nlo_nf_4_pdfas', 1], + [4000, 13091, 'CT14nnlo_NF4', 1], + [4001, 13191, 'CT14nlo_NF4', 1], + [5000, 27810, 'MSHT20nnlo_nf4', 1], + [5100, 27870, 'MSHT20nnlo_as_smallrange_nf4', 1], + [5200, 27610, 'MSHT20nlo_nf4', 1], + [6000, 93700, 'PDF4LHC21_40_pdfas_nf4', 1], + [7000, 42530, 'ABMP16_4_nnlo', 1], + [7100, 42930, 'ABMP16_4_nlo', 1], + ], + "PDF_variation2 , replica" : + [ + [3000, 320900, 'NNPDF31_nnlo_as_0118_nf_4', 1], + [3200, 292400, 'NNPDF30_nnlo_nf_4_pdfas', 1], + [3400, 335500, 'NNPDF40_nnlo_nf_4_pdfas', 1], + ], + } + elif forX0jj: # 5F PDF print("X0jj: PDF variations will be reduced for generation speed") diff --git a/bin/Powheg/run_pwg_condor.py b/bin/Powheg/run_pwg_condor.py index 0dd20f8a0dd8..4680d8667f6f 100755 --- a/bin/Powheg/run_pwg_condor.py +++ b/bin/Powheg/run_pwg_condor.py @@ -182,8 +182,10 @@ def runParallelXgrid(parstage, xgrid, folderName, nEvents, njobs, powInputName, if process == 'WWJ' : f.write('echo \"Copy TwoLoops grids\"\n') f.write('ls\n') - f.write('wget https://wwwth.mpp.mpg.de/members/wieseman/download/codes/WW_MiNNLO/VVamp_interpolation_grids/WW_MiNNLO_2loop_grids_reduced1.tar.gz\n') - f.write('tar xzf WW_MiNNLO_2loop_grids_reduced1.tar.gz\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg1 TWOLOOP_GRIDS_reg1\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg2 TWOLOOP_GRIDS_reg2\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg3 TWOLOOP_GRIDS_reg3\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg4 TWOLOOP_GRIDS_reg4\n') f.write('ls\n') f.write('cp -p ' + rootfolder + '/' + folderName + '/powheg.input.'+parstage+'_'+str(xgrid) + ' ./powheg.input' + '\n') # copy input file for this stage explicitly, needed by condor dag f.write('echo ' + str(i+1) + ' | ./pwhg_main \n') @@ -373,8 +375,10 @@ def runEvents(parstage, folderName, EOSfolder, njobs, powInputName, jobtag, proc if process == 'WWJ' : f.write('echo \"Copy TwoLoops grids\"\n') f.write('ls\n') - f.write('wget https://wwwth.mpp.mpg.de/members/wieseman/download/codes/WW_MiNNLO/VVamp_interpolation_grids/WW_MiNNLO_2loop_grids_reduced1.tar.gz\n') - f.write('tar xzf WW_MiNNLO_2loop_grids_reduced1.tar.gz\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg1 TWOLOOP_GRIDS_reg1\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg2 TWOLOOP_GRIDS_reg2\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg3 TWOLOOP_GRIDS_reg3\n') + f.write('ln -s /cvmfs/cms-griddata.cern.ch/gen/Run2UL_powheg_v2/WW_MiNNLO_2loop_grids_reduced1/TWOLOOP_GRIDS_reg4 TWOLOOP_GRIDS_reg4\n') f.write('ls\n') f.write('cp -p ' + rootfolder + '/' + folderName + '/powheg.input.' + parstage + ' ./powheg.input' + '\n') # copy input file for this stage explicitly, needed by condor dag f.write('echo ' + str (i+1) + ' | ./pwhg_main \n') diff --git a/bin/Powheg/runcmsgrid_powheg.sh b/bin/Powheg/runcmsgrid_powheg.sh index 919b46a0a581..02ce2d0d042d 100755 --- a/bin/Powheg/runcmsgrid_powheg.sh +++ b/bin/Powheg/runcmsgrid_powheg.sh @@ -104,6 +104,9 @@ if [[ -e ${myDir} ]]; then fi export LD_LIBRARY_PATH=`pwd`/lib/:`pwd`/lib64/:`pwd`/obj-gfortran/proclib/:${LD_LIBRARY_PATH} +if [[ "${process}" == "WWJ" ]]; then + export LD_LIBRARY_PATH=`pwd`/MATRIXStuff/external/ginac-install/lib/:`pwd`/MATRIXStuff/external/cln-install/lib/:`pwd`/MATRIXStuff/lib/ppllll24/:${LD_LIBRARY_PATH} +fi mkdir ${myDir}; cd ${myDir} ; export PYTHONPATH=.:${PYTHONPATH} @@ -190,7 +193,7 @@ if [ "$manyseeds" == "true" ]; then ../pwhg_main iwhichseed=1 2>&1 | tee log_${process}_${seed}.txt; test $? -eq 0 || fail_exit "pwhg_main error: exit code not 0" # Rename the produced LHE file to be what the rest of the script expects - mv pwgevents-0001.lhe pwgevents.lhe + mv pwgevents-00001.lhe pwgevents.lhe else cat powheg.input @@ -490,7 +493,7 @@ if [ -s pwgstat.dat ]; then fi if [ -s pwg-stat.dat ]; then - if [ "$process" = "b_bbar_4l" ] || [ "$process" = "HWJ_ew" ] || [ "$process" = "HW_ew" ] || [ "$process" = "HZJ_ew" ] || [ "$process" = "HZ_ew" ]; then + if [ "$process" = "b_bbar_4l" ] || [ "$process" = "HWJ_ew" ] || [ "$process" = "HW_ew" ] || [ "$process" = "HZJ_ew" ] || [ "$process" = "HZ_ew" ] || [ "$process" = "WWJ" ]; then XSECTION=`tac pwg-stat.dat | grep total\ total | awk '{ print $(NF-2) }'` XSECUNC=` tac pwg-stat.dat | grep total\ total | awk '{ print $(NF) }'` else