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

Add ATLAS_WJET_8TEV_PTW datasets #100

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
67 changes: 67 additions & 0 deletions nnpdf31_proc/ATLAS_WPJET_8TEV_PTW/analysis.f
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
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, 'W pT', 8, 0.0d0, 200.0d0)
call HwU_book(2, 'W pT', 6, 200.0d0, 500.0d0)
call HwU_book(3, 'W pT', 1, 500.0d0, 600.0d0)
call HwU_book(4, 'W pT', 1, 600.0d0, 800.0d0)

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
integer j
double precision p(0:4,nexternal)
double precision wgts(*)
double precision ppl(0:3), pplb(0:3), ppv(0:3), ptv

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 j = nincoming+1, nexternal
if (iPDG_reco(j).eq.14) 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

ptv=sqrt(ppv(1)**2+ppv(2)**2)

call HwU_fill(1,ptv,wgts)
call HwU_fill(2,ptv,wgts)
call HwU_fill(3,ptv,wgts)
call HwU_fill(4,ptv,wgts)

999 return
end
48 changes: 48 additions & 0 deletions nnpdf31_proc/ATLAS_WPJET_8TEV_PTW/change_etaj_to_rapj.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--- NLO/SubProcesses/fastjetfortran_madfks_core.cc.orig 2020-11-27 18:11:04.027146365 +0100
+++ NLO/SubProcesses/fastjetfortran_madfks_core.cc 2020-11-27 18:13:47.285826142 +0100
@@ -76,7 +76,7 @@
/// and the extraction of the jets
void amcatnlo_transfer_cluster_transfer(const double * p, const int & npart,
const JetDefinition & jet_def,
- const double & ptmin, const double & etamax,
+ const double & ptmin, const double & rapmax,
double * f77jets, int & njets, int * whichjet) {

// transfer p[4*ipart+0..3] -> input_particles[i]
@@ -90,9 +90,9 @@
jets = sorted_by_pt(cs->inclusive_jets(ptmin));

//apply the eta selector if etamax >0
- Selector select_eta = SelectorAbsEtaMax(etamax);
- if (etamax > 0.) {
- jets = select_eta(jets);
+ Selector select_rap = SelectorAbsRapMax(rapmax);
+ if (rapmax > 0.) {
+ jets = select_rap(jets);
}

// transfer jets -> f77jets[4*ijet+0..3]
--- NLO/SubProcesses/fastjetfortran_madfks_full.cc.orig 2020-11-27 18:11:12.687075955 +0100
+++ NLO/SubProcesses/fastjetfortran_madfks_full.cc 2020-11-27 18:13:47.289826110 +0100
@@ -79,7 +79,7 @@
/// and the extraction of the jets
void amcatnlo_transfer_cluster_transfer(const double * p, const int & npart,
const JetDefinition & jet_def,
- const double & ptmin, const double & etamax,
+ const double & ptmin, const double & rapmax,
double * f77jets, int & njets, int * whichjet,
const double & ghost_maxrap = 0.0,
const int & nrepeat = 0, const double & ghost_area = 0.0) {
@@ -101,9 +101,9 @@
jets = sorted_by_pt(cs->inclusive_jets(ptmin));

//apply the eta selector if etamax >0
- Selector select_eta = SelectorAbsEtaMax(etamax);
- if (etamax > 0.) {
- jets = select_eta(jets);
+ Selector select_rap = SelectorAbsRapMax(rapmax);
+ if (rapmax > 0.) {
+ jets = select_rap(jets);
}

// transfer jets -> f77jets[4*ijet+0..3]
98 changes: 98 additions & 0 deletions nnpdf31_proc/ATLAS_WPJET_8TEV_PTW/change_scale_to_ht_2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
--- CMS_2JET_7TEV/SubProcesses/setscales.f.orig 2020-11-30 09:45:53.669448000 +0100
+++ CMS_2JET_7TEV/SubProcesses/setscales.f 2020-12-09 15:04:10.610477654 +0100
@@ -527,6 +527,29 @@
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)
+ 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
+ double precision pQCD(0:3,nexternal),
+ $ pjet(0:3,nexternal),etajet(nexternal)
+ integer nQCD,jet(nexternal),njet
+ double precision ptjet(nexternal),yjet(nexternal)
+c For boosts
+ double precision ybst_til_tolab,ybst_til_tocm,sqrtshat,shat
+ common/parton_cms_stuff/ybst_til_tolab,ybst_til_tocm,
+ # sqrtshat,shat
+ double precision chybst,shybst,chybstmo
+ double precision xd(1:3)
+ data (xd(i),i=1,3)/0,0,1/
c
tmp=0
if(ickkw.eq.-1)then
@@ -562,16 +587,55 @@
tmp=muR_ref_fixed
temp_scale_id='fixed scale'
elseif(dynamical_scale_choice.eq.10) then
-ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-cc USER-DEFINED SCALE: ENTER YOUR CODE HERE cc
-cc to use this code you must set cc
-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=''
+
+ 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)
+
+ nQCD=0
+ chybst=cosh(ybst_til_tolab)
+ shybst=sinh(ybst_til_tolab)
+ chybstmo=chybst-1.d0
+ do j=nincoming+1,nexternal
+ if (abs(ipdg_reco(j)).le.5 .or. ipdg_reco(j).eq.21 .or.
+ $ ipdg_reco(j).eq.22) then
+ nQCD=nQCD+1
+ call boostwdir2(chybst,shybst,chybstmo,xd,
+ $ p_reco(0,j),pQCD(0,nQCD))
+ endif
+ enddo
+
+ do i=1,nexternal
+ do j=0,3
+ pjet(j,i)=0d0
+ enddo
+ jet(i)=0
+ enddo
+
+c recombine momenta
+ call amcatnlo_fastjetppgenkt_etamax(pQCD,nQCD,jetradius,ptj,
+ $ etaj,jetalgo,pjet,njet,jet)
+
+ do i=1,njet
+ ptjet(i)=sqrt(pjet(1,i)**2+pjet(2,i)**2)
+ enddo
+
+ if (njet .lt. 1) then
+c something is wrong with the cuts - they should check for at least one jet
+ tmp=4d0
+ write (*,*) "Error 4: scale couldn't find two jets"
+ else
+ tmp=sqrt(p_reco(1,3)**2+p_reco(2,3)**2)
+ tmp=tmp+sqrt(p_reco(1,4)**2+p_reco(2,4)**2)
+ do i=1,njet
+ tmp=tmp+ptjet(i)
+ end do
+ tmp=0.5*tmp
+ endif
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
cc USER-DEFINED SCALE: END OF USER CODE cc
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
32 changes: 32 additions & 0 deletions nnpdf31_proc/ATLAS_WPJET_8TEV_PTW/launch.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
launch @OUTPUT@
fixed_order = ON
set maxjetflavor 5
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 = 25.0
set etal = 2.5
#user_defined_cut set ptmiss = 25.0
#user_defined_cut set mtw = 40.0
set jetalgo = -1.0
set jetradius = 0.4
set ptj = 30.0
# `change_etaj_to_rapj.patch` changes the following to rapidity instead of pseudo-rapidity
set etaj = 4.4
#user_defined_cut set deltarjl = 0.4
set req_acc_FO 0.000075
set pineappl True
done
quit
10 changes: 10 additions & 0 deletions nnpdf31_proc/ATLAS_WPJET_8TEV_PTW/metadata.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
arxiv=1711.03296
description=ATLAS transverse momentum of the W+ boson at 8 TeV
hepdata=10.17182/hepdata.80076.v2/t13
nnpdf_id=ATLAS_WP_JET_8TEV_PT
x1_label=ptlv
x1_label_tex=$p_{\mathrm{T},\bar{\ell}\nu_\ell}$
x1_unit=GeV
y_label=dsig/dptlv
y_label_tex=$\frac{\mathrm{d}\sigma}{\mathrm{d}p_{\mathrm{T},\bar{\ell}\nu_\ell}}$
y_unit=pb/GeV
7 changes: 7 additions & 0 deletions nnpdf31_proc/ATLAS_WPJET_8TEV_PTW/output.txt
Original file line number Diff line number Diff line change
@@ -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+ vm j QCD^2<=2 QED^2<=6 [QCD]
output @OUTPUT@
quit
8 changes: 5 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

prefix=$(pwd)/.prefix

export LC_ALL=C

yesno() {
echo -n "$@" "[Y/n]"
read -r reply
Expand Down Expand Up @@ -200,10 +202,10 @@ output_and_launch() {
# create output folder
"${mg5amc}" "${output_file}" |& tee output.log

# copy patches if there are any; '+' errors out if patch fails
# copy patches if there are any; use xargs to properly signal failures
cd "${dataset}"
find ../../nnpdf31_proc/"${dataset}" -name '*.patch' -exec \
bash -c 'patch -p1 < "$1"' find-sh {} +
find ../../nnpdf31_proc/"${dataset}" -name '*.patch' -print0 | \
xargs -0 -I file sh -c 'patch -p1 < file'
cd -

# enforce proper analysis
Expand Down
13 changes: 13 additions & 0 deletions run_implement_user_defined_cuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,19 @@
enddo
enddo

''',
'deltarjl': '''c cut on the delta R distance of all lepton-jet pairs
do i=3,nexternal
if (is_a_lm(i) .or. is_a_lp(i)) then
do j=1,njet
if (r2_04(p_reco(0,i),pjet(0,j)).lt.{}**2) then
passcuts_user=.false.
return
endif
enddo
endif
enddo

''',
}

Expand Down