diff --git a/nnpdf31_proc/CMS_ZPT_8TEV/analysis.f b/nnpdf31_proc/CMS_ZPT_8TEV/analysis.f new file mode 100644 index 00000000..45cb2898 --- /dev/null +++ b/nnpdf31_proc/CMS_ZPT_8TEV/analysis.f @@ -0,0 +1,112 @@ +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + subroutine analysis_begin(nwgt,weights_info) +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + + implicit none + integer nwgt + character*(*) weights_info(*) + + call set_error_estimation(1) + call HwU_inithist(nwgt,weights_info) + call HwU_book(1,'Z pT', 50, 0d0, 50d0) + + return + end + +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + subroutine analysis_end(dummy) +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + + implicit none + double precision dummy + call HwU_write_file + return + end + +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + subroutine analysis_fill(p,istatus,ipdg,wgts,ibody) +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + + implicit none + include 'nexternal.inc' + include 'cuts.inc' + integer istatus(nexternal) + integer iPDG(nexternal) + integer ibody + integer i + double precision p(0:4,nexternal) + double precision wgts(*) + double precision ppl(0:3),pplb(0:3),ppv(0:3),ptv,xyll,xbin + double precision getabsy + external getabsy + + double precision p_reco(0:4,nexternal) + integer iPDG_reco(nexternal) + + call recombine_momenta(rphreco, etaphreco, lepphreco, quarkphreco, + $ p, iPDG, p_reco, iPDG_reco) + + do i = nincoming+1, nexternal + if (iPDG_reco(i).eq.13) ppl(0:3)=p_reco(0:3,i) + if (iPDG_reco(i).eq.-13) pplb(0:3)=p_reco(0:3,i) + enddo + do i=0,3 + ppv(i)=ppl(i)+pplb(i) + enddo + + xyll=getabsy(ppv(0),ppv(3)) + ptv=sqrt(ppv(1)**2+ppv(2)**2) + + if (xyll.lt.2d0) then + xbin = 10d0 * real(int(5d0 * xyll/2d0)) + else + write (*,*) "error: event outside bins", ptv, xyll + stop 1 + endif + + if (ptv.lt.20d0) then + xbin = xbin + 0.5d0 + elseif (ptv.lt.40d0) then + xbin = xbin + 1.5d0 + elseif (ptv.lt.60d0) then + xbin = xbin + 2.5d0 + elseif (ptv.lt.80d0) then + xbin = xbin + 3.5d0 + elseif (ptv.lt.100d0) then + xbin = xbin + 4.5d0 + elseif (ptv.lt.120d0) then + xbin = xbin + 5.5d0 + elseif (ptv.lt.140d0) then + xbin = xbin + 6.5d0 + elseif (ptv.lt.170d0) then + xbin = xbin + 7.5d0 + elseif (ptv.lt.200d0) then + xbin = xbin + 8.5d0 + elseif (ptv.lt.1000d0) then + xbin = xbin + 9.5d0 + else + write (*,*) "error: event outside bins", ptv, xyll + stop 1 + endif + + call HwU_fill(1,xbin,wgts) + + 999 return + end + +cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + + function getabsy(en,pl) + implicit none + real*8 getabsy,en,pl,tmp +c + tmp=pl/en + if(abs(tmp).lt.1d0)then + tmp=abs(atanh(tmp)) + else + write(*,*)'Attempt to compute atanh(x) with x > 1' + stop + endif + getabsy=tmp + return + end diff --git a/nnpdf31_proc/CMS_ZPT_8TEV/change_scale_to_ht2.patch b/nnpdf31_proc/CMS_ZPT_8TEV/change_scale_to_ht2.patch new file mode 100644 index 00000000..4877080e --- /dev/null +++ b/nnpdf31_proc/CMS_ZPT_8TEV/change_scale_to_ht2.patch @@ -0,0 +1,48 @@ +--- CMSDY2D11/SubProcesses/setscales.f 2020-05-21 17:23:55.126143088 +0200 ++++ CMSDY2D11/SubProcesses/setscales.f.new 2020-05-21 17:27:26.262700419 +0200 +@@ -527,6 +527,17 @@ + integer i,j + character*80 temp_scale_id + common/ctemp_scale_id/temp_scale_id ++ integer iPDG_reco(nexternal) ++ double precision ppl(0:3), pplb(0:3), ppv(0:3), xmll ++ double precision p_reco(0:4,nexternal), p_in(0:4,nexternal) ++c les houches accord stuff to identify particles ++c ++ integer idup(nexternal,maxproc),mothup(2,nexternal,maxproc), ++ & icolup(2,nexternal,maxflow),niprocs ++ common /c_leshouche_inc/idup,mothup,icolup,niprocs ++c Masses of external particles ++ double precision pmass(nexternal) ++ common/to_mass/pmass + c + tmp=0 + if(ickkw.eq.-1)then +@@ -568,10 +579,23 @@ + cc dynamical_scale_choice = 10 cc + cc in the run_card (run_card.dat) cc + ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc +- write(*,*) "User-defined scale not set" +- stop 1 +- temp_scale_id='User-defined dynamical scale' ! use a meaningful string +- tmp = 0d0 ++ temp_scale_id='CMS_Z_13TEV' ! use a meaningful string ++ do i=1,nexternal ++ p_in(0:3,i) = pp(0:3,i) ++ p_in(4,i) = pmass(i) ++ enddo ++ call recombine_momenta(rphreco, etaphreco, lepphreco, quarkphreco, ++ $ p_in, idup(1,1), p_reco, iPDG_reco) ++ ++ do j = nincoming+1, nexternal ++ if (iPDG_reco(j).eq.13) ppl(0:3)=p_reco(0:3,j) ++ if (iPDG_reco(j).eq.-13) pplb(0:3)=p_reco(0:3,j) ++ enddo ++ do i=0,3 ++ ppv(i)=ppl(i)+pplb(i) ++ enddo ++ ++ tmp=dsqrt(max(0d0,(ppv(0)+ppv(3))*(ppv(0)-ppv(3)))) + ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc + cc USER-DEFINED SCALE: END OF USER CODE cc + ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc diff --git a/nnpdf31_proc/CMS_ZPT_8TEV/launch.txt b/nnpdf31_proc/CMS_ZPT_8TEV/launch.txt new file mode 100644 index 00000000..b1067895 --- /dev/null +++ b/nnpdf31_proc/CMS_ZPT_8TEV/launch.txt @@ -0,0 +1,33 @@ +launch @OUTPUT@ +fixed_order = ON +set gf @GF@ +set mh @MH@ +set mt @MT@ +set mw @MW@ +set mz @MZ@ +set wh @WH@ +set wt @WT@ +set ww @WW@ +set wz @WZ@ +set ebeam1 4000 +set ebeam2 4000 +set pdlabel lhapdf +set lhaid 324900 +set dynamical_scale_choice 10 +set reweight_scale True +set ptl = 10.0 +set etal = 2.4 +#user_defined_cut set ptl1min = 25.0 +#user_defined_cut set etal1 = 2.1 +set ptj = 5.0 # ? +set jetradius = 0.5 # ? +set jetalgo = -1 +set mll_sf = 81.0 +#user_defined_cut set mmllmax = 101.0 +#user_defined_cut set ptzmin = 0.0 +#user_defined_cut set ptzmax = 1000.0 +#user_defined_cut set yz = 2.0 +set req_acc_FO 0.002 +set pineappl True +done +quit diff --git a/nnpdf31_proc/CMS_ZPT_8TEV/metadata.txt b/nnpdf31_proc/CMS_ZPT_8TEV/metadata.txt new file mode 100644 index 00000000..b96d3ca2 --- /dev/null +++ b/nnpdf31_proc/CMS_ZPT_8TEV/metadata.txt @@ -0,0 +1,13 @@ +arxiv=1504.03511v2 +description=CMS transverse momentum of the Z boson at 8 TeV +hepdata= +nnpdf_id=CMSZDIFF8TEV +x1_label=yll +x1_label_tex=$y_{\ell\bar{\ell}}$ +x1_unit= +x2_label=ptll +x2_label_tex=$p_{\mathrm{T},\ell\bar{\ell}}$ +x2_unit=GeV +y_label=d2sig/dyll/dptll +y_label_tex=$\frac{\mathrm{d}^2\sigma}{\mathrm{d}y_{\ell\bar{\ell}}\mathrm{d}p_{\mathrm{T},\ell\bar{\ell}}}$ +y_unit=pb/GeV diff --git a/nnpdf31_proc/CMS_ZPT_8TEV/output.txt b/nnpdf31_proc/CMS_ZPT_8TEV/output.txt new file mode 100644 index 00000000..d98fc1eb --- /dev/null +++ b/nnpdf31_proc/CMS_ZPT_8TEV/output.txt @@ -0,0 +1,7 @@ +set complex_mass_scheme True +import model loop_qcd_qed_sm_Gmu +define p = p b b~ +define j = p +generate p p > mu+ mu- j [QCD] # QCD^2<=2 QED^2<=6 +output @OUTPUT@ +quit diff --git a/nnpdf31_proc/CMS_ZPT_8TEV/postrun.sh b/nnpdf31_proc/CMS_ZPT_8TEV/postrun.sh new file mode 100755 index 00000000..ae2498e1 --- /dev/null +++ b/nnpdf31_proc/CMS_ZPT_8TEV/postrun.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +pineappl write --remap '0,0.4,0.8,1.2,1.6,2;0,20,40,60,80,100,120,140,170,200,1000' "${GRID}" "${GRID}".tmp +mv "${GRID}".tmp "${GRID}" diff --git a/run.sh b/run.sh index 56e19740..d6c19f3e 100755 --- a/run.sh +++ b/run.sh @@ -303,7 +303,7 @@ EOF merge() { # TODO: the following assumes that all observables belong to the same distribution - grid="${dataset}".pineappl + grid="${dataset}".pineappl.lz4 # sort the file we want to merge into an array properly (1 2 3 ... 10 11 instead of 1 10 11 ...) merge=() @@ -313,18 +313,18 @@ merge() { "${pineappl}" merge "${grid}" "${merge[@]}" # optimize the grids - "${pineappl}" optimize "${grid}" "${grid}".tmp + "${pineappl}" write --optimize "${grid}" "${grid}".tmp mv "${grid}".tmp "${grid}" # add metadata runcard=( "${dataset}"/Events/run_01*/run_01*_tag_1_banner.txt ) if [[ -f ../nnpdf31_proc/"${dataset}"/metadata.txt ]]; then - eval "$(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } - { printf \"--entry %s '%s' \", \$1, \$2 } - END { printf \"--entry_from_file runcard ${runcard[0]}\\n\" }" \ + eval "$(awk -F= "BEGIN { printf \"pineappl write ${grid} ${grid}.tmp \" } + { printf \"--set-key-value %s '%s' \", \$1, \$2 } + END { printf \"--set-key-file runcard ${runcard[0]}\\n\" }" \ ../nnpdf31_proc/"${dataset}"/metadata.txt)" else - "${pineappl}" set "${grid}" "${grid}".tmp --entry_from_file runcard "${runcard[0]}" + "${pineappl}" write "${grid}" "${grid}".tmp --set-key-file runcard "${runcard[0]}" fi mv "${grid}".tmp "${grid}" @@ -332,16 +332,16 @@ merge() { pdfstring=$(grep "set lhaid" "${launch_file}" | sed 's/set lhaid \([0-9]\+\)/\1/') # (re-)produce predictions - "${pineappl}" convolute "${grid}" "${pdfstring}" --scales 9 --absolute --integrated \ + "${pineappl}" --silence-lhapdf uncert "${grid}" "${pdfstring}" --scale-abs=9 --integrated \ > pineappl.convolute - "${pineappl}" orders "${grid}" "${pdfstring}" --absolute > pineappl.orders - "${pineappl}" pdf_uncertainty --threads=1 "${grid}" "${pdfstring}" > pineappl.pdf_uncertainty + "${pineappl}" --silence-lhapdf orders "${grid}" "${pdfstring}" --absolute > pineappl.orders + "${pineappl}" --silence-lhapdf uncert --pdf "${grid}" "${pdfstring}" > pineappl.pdf_uncertainty # extract the numerical results from mg5_aMC sed '/^ [+-]/!d' "${dataset}"/Events/run_01*/MADatNLO.HwU > results.mg5_aMC # extract the integrated results from the PineAPPL grid - head -n -2 pineappl.convolute | tail -n +5 | \ + tail -n +4 pineappl.convolute | \ awk '{ print $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 }' > results.grid # compare the results from the grid and from mg5_aMC @@ -405,12 +405,12 @@ merge() { mg5amc_repo="" fi - "${pineappl}" set "${grid}" "${grid}".tmp \ - --entry_from_file results results.log \ - --entry runcard_gitversion "${runcard_gitversion}" \ - --entry mg5amc_revno "${mg5amc_revno}" \ - --entry mg5amc_repo "${mg5amc_repo}" \ - --entry lumi_id_types pdg_mc_ids + "${pineappl}" write "${grid}" "${grid}".tmp \ + --set-key-file results results.log \ + --set-key-value runcard_gitversion "${runcard_gitversion}" \ + --set-key-value mg5amc_revno "${mg5amc_revno}" \ + --set-key-value mg5amc_repo "${mg5amc_repo}" \ + --set-key-value lumi_id_types pdg_mc_ids mv "${grid}".tmp "${grid}" # if there is anything to do after the run, do it! @@ -418,14 +418,6 @@ merge() { cp ../nnpdf31_proc/"${dataset}"/postrun.sh . GRID=$grid ./postrun.sh fi - - lz4=$(which lz4 2> /dev/null || true) - - # compress the grid with `lz4` if it's available - if [[ -x ${lz4} ]]; then - lz4 -9 "${grid}" - rm "${grid}" - fi } check_args_and_cd_output "$@" diff --git a/run_implement_user_defined_cuts.py b/run_implement_user_defined_cuts.py index 526f1eda..be045e8d 100755 --- a/run_implement_user_defined_cuts.py +++ b/run_implement_user_defined_cuts.py @@ -79,6 +79,21 @@ return endif +''', + 'etal1': '''c pseudo-rapidity cut for leading lepton + j = 0 + do i=1,nexternal + if (is_a_lm(i) .or. is_a_lp(i)) then + if (j.eq.0 .or. pt_04(p_reco(0,i)).ge.pt_04(p_reco(0,j))) then + j = i + endif + endif + enddo + if (abs(eta_04(p_reco(0,j))) .gt. {}) then + passcuts_user=.false. + return + endif + ''', 'ptj1min': '''c cut for ptl1min (leading jet) if (pt(pjet(0,1)) .lt. {}) then