Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing WWJ process (Run3) #3642

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions bin/Powheg/Templates/createTarBall_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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' *
Expand Down
7 changes: 5 additions & 2 deletions bin/Powheg/Templates/runGetSource_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions bin/Powheg/Utilities/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
34 changes: 32 additions & 2 deletions bin/Powheg/make_rwl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -56,7 +57,7 @@

fout.write("</weightgroup>\n")

if forMiNNLO:
if forMiNNLO and not forWWJ:
# additional MiNNLO scale variations (NNPDF 3.0)
fout.write("<weightgroup name='scale_variation_nnpdf30' combine='envelope' >\n")

Expand Down Expand Up @@ -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")
Expand Down
12 changes: 8 additions & 4 deletions bin/Powheg/run_pwg_condor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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')
Expand Down
7 changes: 5 additions & 2 deletions bin/Powheg/runcmsgrid_powheg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down