Hi Marco,
for the NLO+PS there are also these changes needed in srcPythia8:
diff -r ../Template/NLO/MCatNLO/srcPythia8/Pythia8.cc MCatNLO/srcPythia8/Pythia8.cc
24c24
< void pyabeg_(int&,char(*)[50]);
---
> void pyabeg_(int&,char(*)[80]);
33c33
< char cwgtinfo_weights_info[1024][50];
---
> char cwgtinfo_weights_info[1024][80];
diff -r ../Template/NLO/MCatNLO/srcPythia8/Pythia82.cc MCatNLO/srcPythia8/Pythia82.cc
25c25
< void pyabeg_(int&,char(*)[50]);
---
> void pyabeg_(int&,char(*)[80]);
34c34
< char cwgtinfo_weights_info[1024][50];
---
> char cwgtinfo_weights_info[1024][80];
With these changes, I have checked that the final plot_PYTHIA8_*.HwU is ok.
Best,
Ioannis
> On 27 Nov 2020, at 14:44, marco zaro wrote:
>
> You have been requested to review the proposed merge of lp:~maddevelopers/mg5amcnlo/3.0.3-betternlops into lp:~maddevelopers/mg5amcnlo/3.0.4.
>
> For more details, see:
> https://code.launchpad.net/~maddevelopers/mg5amcnlo/3.0.3-betternlops/+merge/394582
>
> better handling of the different coupling combinations at NLOPS. The various contributions are written as extra weights of the event file
>
> --
> You are requested to review the proposed merge of lp:~maddevelopers/mg5amcnlo/3.0.3-betternlops into lp:~maddevelopers/mg5amcnlo/3.0.4.
> === modified file 'Template/NLO/FixedOrderAnalysis/HwU.f'
> --- Template/NLO/FixedOrderAnalysis/HwU.f 2020-09-16 12:13:39 +0000
> +++ Template/NLO/FixedOrderAnalysis/HwU.f 2020-11-27 13:44:07 +0000
> @@ -10,16 +10,29 @@
> C C
> CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
>
> + module HwU_wgts_info_len
> + use iso_c_binding
> + integer, parameter :: wgts_info_len=80
> + contains
> + integer function get_wgts_info_len() bind(c,name="get_wgts_info_len")
> + get_wgts_info_len = wgts_info_len
> + return
> + end function get_wgts_info_len
> +
> + end module HwU_wgts_info_len
> +
> +
> c The module contains effectively the common block with allocatable
> c variables (something not possible in old fortran version)
> module HwU_variables
> + use HwU_wgts_info_len
> implicit none
> integer :: max_plots,max_points,max_bins,nwgts,np
> integer :: error_estimation=3
> logical, allocatable :: booked(:)
> integer, allocatable :: nbin(:),histi(:,:),p_bin(:),p_label(:)
> character(len=50), allocatable :: title(:)
> - character(len=50), allocatable :: wgts_info(:)
> + character(len=wgts_info_len), allocatable :: wgts_info(:)
> double precision, allocatable :: histy(:,:,:),histy_acc(:,:,:)
> $ ,histy2(:,:),histy_err(:,:),histxl(:,:),histxm(:,:)
> $ ,step(:),p_wgts(:,:)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_V.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_V.f 2017-02-02 08:59:42 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_V.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> real * 8 xm0,gam,xmlow,xmupp,bin
> @@ -49,7 +50,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_h.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_h.f 2016-03-21 08:45:42 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_h.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> c
> @@ -46,7 +47,7 @@
> integer nwgt,max_weight,nwgt_analysis,kk,l
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_hjj.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_hjj.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_hjj.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> c
> @@ -51,7 +52,7 @@
> common /to_veto_hist/vetomin,vetomax,nbinveto
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_leptons.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_leptons.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_leptons.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> c
> @@ -60,7 +61,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_lplm.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_lplm.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_lplm.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> real * 8 bin,xmi,xms,pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_lvl.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_lvl.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_lvl.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> real * 8 bin,xmi,xms,pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_taptam.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_taptam.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_taptam.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> c
> @@ -46,7 +47,7 @@
> integer nwgt,max_weight,nwgt_analysis,kk,l
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_tj.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_tj.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_tj.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -46,7 +47,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_ttx.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_ttx.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_ttx.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -46,7 +47,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_ttx_v2.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_ttx_v2.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_pp_ttx_v2.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -46,7 +47,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_rates.f'
> --- Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_rates.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/HWAnalyzer/hw6an_HwU_rates.f 2020-11-27 13:44:07 +0000
> @@ -23,6 +23,7 @@
> SUBROUTINE HWABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> include 'reweight0.inc'
> c
> @@ -42,7 +43,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/Makefile_MadFKS'
> --- Template/NLO/MCatNLO/Makefile_MadFKS 2018-07-06 13:15:54 +0000
> +++ Template/NLO/MCatNLO/Makefile_MadFKS 2020-11-27 13:44:07 +0000
> @@ -43,10 +43,10 @@
> PDFFILES=$(OBJDIR)/mcatnlo_pdftomlm.o $(OBJDIR)/mcatnlo_libofpdf.o $(OBJDIR)/dummies.o
> CPDFFILES=$(OBJDIR)/mcatnlo_mlmtopdf.o $(OBJDIR)/dummies.o
> LPDFFILES=$(OBJDIR)/mcatnlo_mlmtolha.o $(OBJDIR)/dummies.o
> -HWFILES=$(OBJDIR)/$(HERWIGVER) $(OBJDIR)/madfks_hwdriver.o $(OBJDIR)/madfks_hwlhin.o \
> - $(OBJDIR)/mcatnlo_str.o $(HWUTI)
> -PYFILES=$(OBJDIR)/$(PYTHIAVER) $(OBJDIR)/madfks_pydriver.o $(OBJDIR)/madfks_pylhin.o \
> - $(OBJDIR)/mcatnlo_str.o $(PYUTI)
> +HWFILES=$(HWUTI) $(OBJDIR)/$(HERWIGVER) $(OBJDIR)/madfks_hwdriver.o $(OBJDIR)/madfks_hwlhin.o \
> + $(OBJDIR)/mcatnlo_str.o
> +PYFILES=$(PYUTI) $(OBJDIR)/$(PYTHIAVER) $(OBJDIR)/madfks_pydriver.o $(OBJDIR)/madfks_pylhin.o \
> + $(OBJDIR)/mcatnlo_str.o
>
>
> HW_EXE_DEFAULT : $(HWFILES) $(PDFFILES)
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_V.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_V.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_V.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> real * 8 xm0,gam,xmlow,xmupp,bin
> @@ -48,7 +49,7 @@
> data cc/' ','Born '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_h.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_h.f 2016-07-21 14:37:54 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_h.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -45,7 +46,7 @@
> data HwUtype/'|T@NOCUT','|T@CUT '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_hjj.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_hjj.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_hjj.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -45,7 +46,7 @@
> data HwUtype/'|T@NOCUT','|T@CUT '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> character*8 cc(2)
> data cc/' ','vbfcuts '/
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_leptons.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_leptons.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_leptons.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> c
> @@ -43,7 +44,7 @@
> integer j,jpr
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> integer nsingle,ncorr,nlepton,nplots,ncuts
> common/cplots/nsingle,ncorr,nlepton,nplots,ncuts
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lplm.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lplm.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lplm.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> real * 8 bin,xmi,xms,pi
> @@ -47,7 +48,7 @@
> data cc/' ','Born '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f 2016-12-07 21:05:19 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_lvl.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> real * 8 bin,xmi,xms,pi
> @@ -47,7 +48,7 @@
> data cc/' ','Born '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_taptam.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_taptam.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_taptam.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> integer j,kk,l,i,nnn
> @@ -43,7 +44,7 @@
> data HwUtype/'|T@NOCUT','|T@CUT '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_tj.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_tj.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_tj.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -45,7 +46,7 @@
> data HwUtype/'|T@NOCUT','|T@CUT '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_ttx.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_ttx.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_ttx.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -45,7 +46,7 @@
> data HwUtype/'|T@NOCUT','|T@CUT '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_ttx_v2.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_ttx_v2.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_pp_ttx_v2.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> REAL*8 pi
> @@ -45,7 +46,7 @@
> data HwUtype/'|T@NOCUT','|T@CUT '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_rates.f'
> --- Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_rates.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PY8Analyzer/py8an_HwU_rates.f 2020-11-27 13:44:07 +0000
> @@ -23,6 +23,7 @@
> SUBROUTINE PYABEG(nnn,wwwi)
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HEPMC.INC'
> include 'reweight0.inc'
> c
> @@ -41,7 +42,7 @@
> data cc/' ','Born '/
> integer nwgt_analysis
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> $ ,wwwi(max_weight_shower)
> c
> do i=1,nnn
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_V.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_V.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_V.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit double precision(a-h, o-z)
> implicit integer(i-n)
> common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
> @@ -51,7 +52,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_h.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_h.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_h.f 2020-11-27 13:44:07 +0000
> @@ -28,6 +28,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> REAL*8 pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c
> c Initialize histograms
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_hjj.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_hjj.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_hjj.f 2020-11-27 13:44:07 +0000
> @@ -28,6 +28,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> c
> @@ -52,7 +53,7 @@
> common /to_veto_hist/vetomin,vetomax,nbinveto
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c
> c Initialize histograms
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_leptons.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_leptons.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_leptons.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> c
> @@ -59,7 +60,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_lplm.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_lplm.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_lplm.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> real * 8 bin,xmi,xms,pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_lvl.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_lvl.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_lvl.f 2020-11-27 13:44:07 +0000
> @@ -27,6 +27,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit double precision(a-h, o-z)
> implicit integer(i-n)
> common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
> @@ -50,7 +51,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_taptam.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_taptam.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_taptam.f 2020-11-27 13:44:07 +0000
> @@ -28,6 +28,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> integer j,kk,l,i
> @@ -46,7 +47,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c
> c Initialize histograms
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_tj.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_tj.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_tj.f 2020-11-27 13:44:07 +0000
> @@ -28,6 +28,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> REAL*8 pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c
> c Initialize histograms
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_ttx.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_ttx.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_ttx.f 2020-11-27 13:44:07 +0000
> @@ -28,6 +28,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> REAL*8 pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c
> c Initialize histograms
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_ttx_v2.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_ttx_v2.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_pp_ttx_v2.f 2020-11-27 13:44:07 +0000
> @@ -28,6 +28,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> REAL*8 pi
> @@ -48,7 +49,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c
> c Initialize histograms
>
> === modified file 'Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_rates.f'
> --- Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_rates.f 2016-02-23 10:48:46 +0000
> +++ Template/NLO/MCatNLO/PYAnalyzer/py6an_HwU_rates.f 2020-11-27 13:44:07 +0000
> @@ -23,6 +23,7 @@
> SUBROUTINE PYABEG
> C USER''S ROUTINE FOR INITIALIZATION
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> implicit none
> include 'reweight0.inc'
> c
> @@ -42,7 +43,7 @@
> integer nwgt,max_weight,nwgt_analysis
> common/cnwgt/nwgt
> common/c_analysis/nwgt_analysis
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> c Initialize histograms
> call HwU_inithist(nwgt,weights_info)
>
> === modified file 'Template/NLO/MCatNLO/include/LHEFRead.h'
> --- Template/NLO/MCatNLO/include/LHEFRead.h 2016-02-23 11:25:37 +0000
> +++ Template/NLO/MCatNLO/include/LHEFRead.h 2020-11-27 13:44:07 +0000
> @@ -2,6 +2,13 @@
> #include
> #include
>
> +
> +extern "C" {
> + int get_wgts_info_len(void);
> +}
> +
> +const int wgts_info_len_used = 80;
> +
> class MyReader {
>
> private:
> @@ -16,12 +23,22 @@
> LHEF::Reader reader;
>
>
> - void lhef_read_wgtsinfo_(int &cwgtinfo_nn, char (cwgtinfo_weights_info[1024][50])) {
> + void lhef_read_wgtsinfo_(int &cwgtinfo_nn, char (cwgtinfo_weights_info[1024][wgts_info_len_used])) {
> +
> + // check that wgts_info_len_used > wgts_info_len from the fortran module
> + if (wgts_info_len_used != get_wgts_info_len()) {
> + std::cout << " wgts_info_len_used is different from the corresponding quantity in HwU_wgts_info_len\n"
> + << " Please set wgts_info_len_used in LHEFRead.h to "<< get_wgts_info_len() <<"\n"
> + << " Program stopped.\n";
> + exit(1);
> + }
>
> // Read header of event file
> std::stringstream hss;
> std::string hs;
> - sprintf(cwgtinfo_weights_info[0], "%50s","central value");
> + std::stringstream format_str;
> + format_str <<"%"< + sprintf(cwgtinfo_weights_info[0],format_str.str().c_str(),"central value");
> cwgtinfo_nn=1;
> while (true){
> hss << reader.headerBlock;
> @@ -37,7 +54,7 @@
> if (hs.find(" std::string sRWGT = hs.substr(hs.find("'>")+2,hs.find(" sRWGT = sRWGT.substr(0,sRWGT.find("<"));
> - sprintf(cwgtinfo_weights_info[cwgtinfo_nn],"%50s",sRWGT.c_str());
> + sprintf(cwgtinfo_weights_info[cwgtinfo_nn],format_str.str().c_str(),sRWGT.c_str());
> ++cwgtinfo_nn;
> }
> }
>
> === modified file 'Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f'
> --- Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2017-06-19 14:46:09 +0000
> +++ Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2020-11-27 13:44:07 +0000
> @@ -125,6 +125,7 @@
> C Reads MC@NLO input headers and fills Les Houches run common HEPRUP
> C Event file is written by MadFKS
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> INCLUDE 'HERWIG65.INC'
> C--Les Houches Common Blocks
> INTEGER MAXPUP
> @@ -150,7 +151,7 @@
> include 'reweight0.inc'
> integer nwgt
> common/cnwgt/nwgt
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
>
> nwgt=1
>
> === modified file 'Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f'
> --- Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f 2017-06-19 14:46:09 +0000
> +++ Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f 2020-11-27 13:44:07 +0000
> @@ -124,6 +124,7 @@
> C Reads MC@NLO input headers and fills Les Houches run common HEPRUP
> C Event file is written by MadFKS
> C----------------------------------------------------------------------
> + use HwU_wgts_info_len
> C--Les Houches Common Blocks
> INTEGER MAXPUP
> PARAMETER(MAXPUP=100)
> @@ -149,7 +150,7 @@
> include 'reweight0.inc'
> integer nwgt
> common/cnwgt/nwgt
> - character*50 weights_info(max_weight_shower)
> + character*(wgts_info_len) weights_info(max_weight_shower)
> common/cwgtsinfo/weights_info
> C
> numscales=0
>
> === modified file 'Template/NLO/Source/extra_weights.f'
> --- Template/NLO/Source/extra_weights.f 2019-03-08 09:56:08 +0000
> +++ Template/NLO/Source/extra_weights.f 2020-11-27 13:44:07 +0000
> @@ -1,7 +1,7 @@
> module extra_weights
>
> integer,parameter :: iwgtinfo=-5,maxscales=9,maxPDFs=200
> - $ ,maxPDFsets=25,maxdynscales=10
> + $ ,maxPDFsets=25,maxdynscales=10,maxorders=10
> integer :: max_mom_str=1,max_mext=1,max_n_ctr=1
> logical :: doreweight,lscalevar(maxdynscales)
> $ ,lpdfvar(maxPDFsets)
> @@ -12,7 +12,7 @@
> double precision :: wgtdegrem_xi,wgtdegrem_lxi,wgtdegrem_muF
> $ ,wgtnstmp,wgtwnstmpmuf,wgtwnstmpmur,wgtnstmp_avgvirt
> $ ,wgtref,scalevarR(0:maxscales),scalevarF(0:maxscales)
> - $ ,wgtxsecmu(maxscales,maxscales,maxdynscales)
> + $ ,wgtxsecmu(maxorders,maxscales,maxscales,maxdynscales)
> $ ,wgtxsecPDF(0:maxPDFs,maxPDFsets),wgtbpower,wgtcpower
> $ ,veto_multiplier,H1_factor_virt,veto_compensating_factor
> $ ,born_wgt_veto
>
> === modified file 'Template/NLO/SubProcesses/collect_events.f'
> --- Template/NLO/SubProcesses/collect_events.f 2017-07-29 08:03:34 +0000
> +++ Template/NLO/SubProcesses/collect_events.f 2020-11-27 13:44:07 +0000
> @@ -53,6 +53,8 @@
> open(unit=10,file=basicfile,status='old')
> open(unit=98,file=nextbasicfile,status='unknown')
>
> + call get_orderstags_glob_infos()
> +
> c
> c First get the cross section from the res_1 files
> c
> @@ -253,6 +255,10 @@
> double precision xsec(100),xsecABS,xerr(100)
> logical get_xsec_from_res1
> common/total_xsec/xsec,xerr,xsecABS,proc_id_tot,get_xsec_from_res1
> +c Common blocks for the orders tags
> + integer n_orderstags,oo
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> c
> maxevt=0
> if (.not. get_xsec_from_res1) then
> @@ -420,18 +426,20 @@
> c reweighting
> evwgt_sign=dsign(evwgt,XWGTUP)
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do ii=1,nint(scalevarF(0))
> - do jj=1,nint(scalevarR(0))
> - wgtxsecmu(jj,ii,kk)=wgtxsecmu(jj,ii,kk)
> - $ *evwgt_sign/XWGTUP
> + do oo=0,n_orderstags
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do ii=1,nint(scalevarF(0))
> + do jj=1,nint(scalevarR(0))
> + wgtxsecmu(oo,jj,ii,kk)=wgtxsecmu(oo,jj,ii,kk)
> + $ *evwgt_sign/XWGTUP
> + enddo
> enddo
> - enddo
> - else
> - wgtxsecmu(1,1,kk)=wgtxsecmu(1,1,kk)
> - $ *evwgt_sign/XWGTUP
> - endif
> + else
> + wgtxsecmu(oo,1,1,kk)=wgtxsecmu(oo,1,1,kk)
> + $ *evwgt_sign/XWGTUP
> + endif
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
>
> === modified file 'Template/NLO/SubProcesses/driver_mintMC.f'
> --- Template/NLO/SubProcesses/driver_mintMC.f 2020-03-26 15:16:08 +0000
> +++ Template/NLO/SubProcesses/driver_mintMC.f 2020-11-27 13:44:07 +0000
> @@ -134,6 +134,7 @@
> call printout !Prints out a summary of paramaters
> call run_printout !Prints out a summary of the run settings
> call initcluster
> + call check_amp_split
> c
> c Get user input
> c
>
> === modified file 'Template/NLO/SubProcesses/fks_singular.f'
> --- Template/NLO/SubProcesses/fks_singular.f 2020-09-18 11:00:14 +0000
> +++ Template/NLO/SubProcesses/fks_singular.f 2020-11-27 13:44:07 +0000
> @@ -3163,6 +3163,8 @@
> endif
> enddo
> if (.not. Hevents) then
> +
> + ! MZ write also orderstag!!
> c For S-events, be careful to take all the IPROC that contribute to the
> c iproc_picked:
> ipro=eto(etoi(iproc_picked,nFKS(ict)),nFKS(ict))
> @@ -3200,6 +3202,7 @@
> & //trim(adjustl(procid))
>
> write (str_temp,30)
> + & orderstag(ict),
> & QCDpower(ict),
> & (bjx(j,ict),j=1,2),
> & (scales2(j,ict),j=1,3),
> @@ -3251,6 +3254,7 @@
> & //trim(adjustl(procid))
>
> write (str_temp,30)
> + & orderstag(ict),
> & QCDpower(ict),
> & (bjx(j,ict),j=1,2),
> & (scales2(j,ict),j=1,3),
> @@ -3271,7 +3275,7 @@
> endif
> enddo
> return
> - 30 format(i2,6(1x,d14.8),6(1x,i2),1x,i8,1x,d18.12,1x,d18.12)
> + 30 format(i15,i2,6(1x,d14.8),6(1x,i2),1x,i8,1x,d18.12,1x,d18.12)
> end
>
>
> @@ -5910,22 +5914,19 @@
> tOLP=tOLP+(tAfter-tBefore)
> virtual_over_born=virt_wgt/born_wgt
> if (ickkw.ne.-1) then
> - if (use_poly_virtual) then
> - virt_wgt=virt_wgt-polyfit(0)*born_wgt
> - else
> - virt_wgt=virt_wgt-average_virtual(0,ichan)*born_wgt
> - endif
> + virt_wgt = 0d0
> do iamp=1,amp_split_size
> if (amp_split_virt(iamp).eq.0d0) cycle
> if (use_poly_virtual) then
> amp_split_virt(iamp)=amp_split_virt(iamp)-
> $ polyfit(iamp)
> $ *amp_split_born_for_virt(iamp)
> - else
> - amp_split_virt(iamp)=amp_split_virt(iamp)-
> - $ average_virtual(iamp,ichan)
> - $ *amp_split_born_for_virt(iamp)
> + else
> + amp_split_virt(iamp)=amp_split_virt(iamp)-
> + $ average_virtual(iamp,ichan)
> + $ *amp_split_born_for_virt(iamp)
> endif
> + virt_wgt = virt_wgt + amp_split_virt(iamp)
> enddo
> endif
> if (abrv.ne.'virt') then
>
> === modified file 'Template/NLO/SubProcesses/handling_lhe_events.f'
> --- Template/NLO/SubProcesses/handling_lhe_events.f 2020-09-18 11:00:14 +0000
> +++ Template/NLO/SubProcesses/handling_lhe_events.f 2020-11-27 13:44:07 +0000
> @@ -21,6 +21,9 @@
> character*80 muR_id_str,muF1_id_str,muF2_id_str,QES_id_str
> common/cscales_id_string/muR_id_str,muF1_id_str,
> # muF2_id_str,QES_id_str
> + integer n_orderstags,oo,tag
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> c
> write(ifile,'(a)')
> # ''
> @@ -30,28 +33,38 @@
> write(ifile,'(a)') ' '
> idwgt=1000
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - write(ifile,'(a,i4,a)')
> - & " "
> - if (lscalevar(kk)) then
> - do ii=1,nint(scalevarF(0))
> - do jj=1,nint(scalevarR(0))
> - idwgt=idwgt+1
> - write(ifile,'(a,i4,a,i4,a,e11.5,a,e11.5,a)')
> - $ " dyn=",
> - $ dyn_scale(kk)," muR=",scalevarR(jj)," muF="
> + do oo=0,n_orderstags
> + if (oo.eq.0) then
> + tag = 0
> + else
> + tag = orderstags_glob(oo)
> + endif
> + do kk=1,dyn_scale(0)
> + write(ifile,'(a,i15,i4,a)')
> + & " "
> + if (lscalevar(kk)) then
> + do ii=1,nint(scalevarF(0))
> + do jj=1,nint(scalevarR(0))
> + idwgt=idwgt+1
> + write(ifile,
> + $ '(a,i4,a,i15,a,i4,a,e11.5,a,e11.5,a)')
> + $ " tag=" ,tag,
> + $ " dyn=",dyn_scale(kk),
> + $ " muR=",scalevarR(jj)," muF="
> $ ,scalevarF(ii)," "
> + enddo
> enddo
> - enddo
> - else
> - idwgt=idwgt+1
> - write(ifile,'(a,i4,a,i4,a,e11.5,a,e11.5,a)')
> - $ " dyn=",
> - $ dyn_scale(kk)," muR=",1d0 ," muF=",1d0
> - $ ," "
> - endif
> - write(ifile,'(a)') " "
> + else
> + idwgt=idwgt+1
> + write(ifile,'(a,i4,a,i15,a,i4,a,e11.5,a,e11.5,a)')
> + $ " tag=" ,tag,
> + $ " dyn=",dyn_scale(kk),
> + $ " muR=",1d0 ," muF=",1d0
> + $ ," "
> + endif
> + write(ifile,'(a)') " "
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
> @@ -126,6 +139,9 @@
> character*150 buffer,buffer_lc,buffer2
> integer event_id
> common /c_event_id/ event_id
> + integer n_orderstags,oo,tag
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
>
> c Set the event_id to 0. If 0 or positive, this value will be update
> c in write_lhe_event. It is set to -99 through a block data
> @@ -215,28 +231,38 @@
> write(ifile,'(a)') ' '
> idwgt=1000
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - write(ifile,'(a,i4,a)')
> - & " "
> - if (lscalevar(kk)) then
> - do ii=1,nint(scalevarF(0))
> - do jj=1,nint(scalevarR(0))
> - idwgt=idwgt+1
> - write(ifile,'(a,i4,a,i4,a,e11.5,a,e11.5,a)')
> - $ " dyn=",
> - $ dyn_scale(kk)," muR=",scalevarR(jj)," muF="
> + do oo=0,n_orderstags
> + if (oo.eq.0) then
> + tag = 0
> + else
> + tag = orderstags_glob(oo)
> + endif
> + do kk=1,dyn_scale(0)
> + write(ifile,'(a,i15,i4,a)')
> + & " "
> + if (lscalevar(kk)) then
> + do ii=1,nint(scalevarF(0))
> + do jj=1,nint(scalevarR(0))
> + idwgt=idwgt+1
> + write(ifile,
> + $ '(a,i4,a,i15,a,i4,a,e11.5,a,e11.5,a)')
> + $ " tag=" ,tag,
> + $ " dyn=",dyn_scale(kk),
> + $ " muR=",scalevarR(jj)," muF="
> $ ,scalevarF(ii)," "
> + enddo
> enddo
> - enddo
> - else
> - idwgt=idwgt+1
> - write(ifile,'(a,i4,a,i4,a,e11.5,a,e11.5,a)')
> - $ " dyn=",
> - $ dyn_scale(kk)," muR=",1d0 ," muF=",1d0
> - $ ," "
> - endif
> - write(ifile,'(a)') " "
> + else
> + idwgt=idwgt+1
> + write(ifile,'(a,i4,a,i15,a,i4,a,e11.5,a,e11.5,a)')
> + $ " tag=" ,tag,
> + $ " dyn=",dyn_scale(kk),
> + $ " muR=",1d0 ," muF=",1d0
> + $ ," "
> + endif
> + write(ifile,'(a)') " "
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
> @@ -648,7 +674,7 @@
> DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,
> # PUP(5,*),VTIMUP(*),SPINUP(*)
> character*140 buff
> - integer ifile,i,kk
> + integer ifile,i,kk,oo
> character*9 ch1
> integer isorh_lhe,ifks_lhe,jfks_lhe,fksfather_lhe,ipartner_lhe
> double precision scale1_lhe,scale2_lhe
> @@ -662,6 +688,9 @@
> common/event_attributes/nattr,npNLO,npLO
> include './run.inc'
> include 'unlops.inc'
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> c if event_id is zero or positive (that means that there was a call
> c to write_lhef_header_banner) update it and write it
> c RF: don't use the event_id:
> @@ -761,20 +790,23 @@
> write(ifile,'(a)') ' '
> idwgt=1000
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do i=1,nint(scalevarF(0))
> - do j=1,nint(scalevarR(0))
> - idwgt=idwgt+1
> - write(ifile,601) " "
> - $ ,wgtxsecmu(j,i,kk)," "
> + do oo=0,n_orderstags
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do i=1,nint(scalevarF(0))
> + do j=1,nint(scalevarR(0))
> + idwgt=idwgt+1
> + write(ifile,601)
> + $ " "
> + $ ,wgtxsecmu(oo,j,i,kk)," "
> + enddo
> enddo
> - enddo
> - else
> - idwgt=idwgt+1
> - write(ifile,601) " "
> - $ ,wgtxsecmu(1,1,kk)," "
> - endif
> + else
> + idwgt=idwgt+1
> + write(ifile,601) " "
> + $ ,wgtxsecmu(oo,1,1,kk)," "
> + endif
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
> @@ -821,7 +853,7 @@
> INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)
> DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,
> # PUP(5,*),VTIMUP(*),SPINUP(*)
> - integer ifile,i,kk
> + integer ifile,i,kk,oo
> character*140 buff
> character*80 string
> character*12 dummy12
> @@ -835,6 +867,9 @@
> common/c_i_process/i_process
> integer nattr,npNLO,npLO
> common/event_attributes/nattr,npNLO,npLO
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> include 'unlops.inc'
> include 'run.inc'
> c
> @@ -910,18 +945,20 @@
> read(ifile,'(a)')string
> wgtref=XWGTUP
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do i=1,nint(scalevarF(0))
> - do j=1,nint(scalevarR(0))
> - call read_rwgt_line(ifile,idwgt
> - $ ,wgtxsecmu(j,i,kk))
> + do oo=0,n_orderstags
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do i=1,nint(scalevarF(0))
> + do j=1,nint(scalevarR(0))
> + call read_rwgt_line(ifile,idwgt
> + $ ,wgtxsecmu(oo,j,i,kk))
> + enddo
> enddo
> - enddo
> - else
> - call read_rwgt_line(ifile,idwgt,wgtxsecmu(1,1
> + else
> + call read_rwgt_line(ifile,idwgt,wgtxsecmu(oo,1,1
> $ ,kk))
> - endif
> + endif
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
> @@ -968,7 +1005,7 @@
> INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)
> DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,
> # PUP(5,*),VTIMUP(*),SPINUP(*)
> - integer ifile,i,kk
> + integer ifile,i,kk,oo
> character*140 buff
> character*80 string
> character*12 dummy12
> @@ -982,6 +1019,9 @@
> common/c_i_process/i_process
> integer nattr,npNLO,npLO
> common/event_attributes/nattr,npNLO,npLO
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> include 'unlops.inc'
> include 'run.inc'
> c
> @@ -1066,18 +1106,20 @@
> read(ifile,'(a)')string
> wgtref=XWGTUP
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do i=1,nint(scalevarF(0))
> - do j=1,nint(scalevarR(0))
> - call read_rwgt_line(ifile,idwgt
> - $ ,wgtxsecmu(j,i,kk))
> + do oo=0,n_orderstags
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do i=1,nint(scalevarF(0))
> + do j=1,nint(scalevarR(0))
> + call read_rwgt_line(ifile,idwgt
> + $ ,wgtxsecmu(oo,j,i,kk))
> + enddo
> enddo
> - enddo
> - else
> - call read_rwgt_line(ifile,idwgt,wgtxsecmu(1,1
> + else
> + call read_rwgt_line(ifile,idwgt,wgtxsecmu(oo,1,1
> $ ,kk))
> - endif
> + endif
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
>
> === modified file 'Template/NLO/SubProcesses/makefile'
> --- Template/NLO/SubProcesses/makefile 2018-08-27 14:51:23 +0000
> +++ Template/NLO/SubProcesses/makefile 2020-11-27 13:44:07 +0000
> @@ -8,7 +8,7 @@
> READ40=read40.o
>
> # Files to collect all the events in the separate integration channels into a single file
> -COLLECT_EVENTS=collect_events.o handling_lhe_events.o fill_MC_mshell.o
> +COLLECT_EVENTS=collect_events.o handling_lhe_events.o fill_MC_mshell.o orderstags_glob.o
>
> %.o : %.f
> $(FC) $(FFLAGS) -c -I. -I$(LIBDIR) $<
>
> === modified file 'Template/NLO/SubProcesses/makefile_fks_dir'
> --- Template/NLO/SubProcesses/makefile_fks_dir 2020-11-23 16:35:02 +0000
> +++ Template/NLO/SubProcesses/makefile_fks_dir 2020-11-27 13:44:07 +0000
> @@ -66,7 +66,7 @@
> $(reweight_xsec_events_pdf_dummy) fill_MC_mshell.o cluster.o \
> reweight.o get_color.o iproc_map.o chooser_functions.o \
> pythia_unlops.o recluster.o splitorders_stuff.o reweight_xsec.o \
> - weight_lines.o
> + weight_lines.o orderstags_glob.o
>
> %.o: %.f
> $(FC) $(FFLAGS) -c -I. -I$(LIBDIR) $<
>
> === added file 'Template/NLO/SubProcesses/orderstags_glob.f'
> --- Template/NLO/SubProcesses/orderstags_glob.f 1970-01-01 00:00:00 +0000
> +++ Template/NLO/SubProcesses/orderstags_glob.f 2020-11-27 13:44:07 +0000
> @@ -0,0 +1,41 @@
> + subroutine get_orderstags_glob_infos()
> + use extra_weights
> + implicit none
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> + integer j
> +
> + open(unit=78,file="orderstags_glob.dat",status="old",err=101)
> + goto 99
> +101 open(unit=78,file="../orderstags_glob.dat",status="old",err=101)
> +
> +99 read(78,*) n_orderstags
> + write(*,*) 'get_orderstags_glob_infos: n_orderstags=', n_orderstags
> + read(78,*) (orderstags_glob(j), j=1, n_orderstags)
> + write(*,*) 'get_orderstags_glob_infos: orderstags_glob',
> + $ (orderstags_glob(j), j=1, n_orderstags)
> + return
> + end
> +
> +
> + integer function get_orderstags_glob_pos(tag)
> + use extra_weights
> + implicit none
> + integer tag
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> + integer j
> +
> + do j = 1, n_orderstags
> + if (orderstags_glob(j).eq.tag) then
> + get_orderstags_glob_pos = j
> + return
> + endif
> + enddo
> + write(*,*) 'ERROR, get_orderstags_glob_pos, not found', tag
> + stop 1
> + return
> + end
> +
>
> === modified file 'Template/NLO/SubProcesses/reweight_xsec_events.f'
> --- Template/NLO/SubProcesses/reweight_xsec_events.f 2017-09-28 15:13:09 +0000
> +++ Template/NLO/SubProcesses/reweight_xsec_events.f 2020-11-27 13:44:07 +0000
> @@ -8,7 +8,7 @@
> use extra_weights
> implicit none
> include "run.inc"
> - integer i,ii,jj,kk,isave,lef,ifile,maxevt,iSorH_lhe,ifks_lhe
> + integer i,oo,ii,jj,kk,isave,lef,ifile,maxevt,iSorH_lhe,ifks_lhe
> $ ,jfks_lhe,fksfather_lhe,ipartner_lhe,kwgtinfo,kexternal
> $ ,jwgtnumpartn,ofile,kf,kr,n,nn
> double precision scale1_lhe,scale2_lhe,wgtcentral,wgtmumin
> @@ -28,6 +28,10 @@
> character*7 pdlabel,epa_label
> integer lhaid
> common/to_pdf/lhaid,pdlabel,epa_label
> +c Common blocks for the orders tags
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> c Les Houches Event File info:
> integer IDBMUP(2),PDFGUP(2),PDFSUP(2),IDWTUP,NPRUP,LPRUP
> double precision EBMUP(2),XSECUP,XERRUP,XMAXUP
> @@ -154,6 +158,8 @@
>
> rewind(34)
>
> + call get_orderstags_glob_infos()
> +
> ofile=35
> open(unit=ofile,file=fname1,status='unknown')
>
> @@ -217,17 +223,19 @@
> c renormalize all the scale & PDF weights to have the same normalization
> c as XWGTUP
> if(do_rwgt_scale)then
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do ii=1,nint(scalevarF(0))
> - do jj=1,nint(scalevarR(0))
> - wgtxsecmu(jj,ii,kk)=
> - & wgtxsecmu(jj,ii,kk)/wgtref*XWGTUP
> + do oo=0,n_orderstags
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do ii=1,nint(scalevarF(0))
> + do jj=1,nint(scalevarR(0))
> + wgtxsecmu(oo,jj,ii,kk)=
> + & wgtxsecmu(oo,jj,ii,kk)/wgtref*XWGTUP
> + enddo
> enddo
> - enddo
> - else
> - wgtxsecmu(1,1,kk)=wgtxsecmu(1,1,kk)/wgtref*XWGTUP
> - endif
> + else
> + wgtxsecmu(oo,1,1,kk)=wgtxsecmu(oo,1,1,kk)/wgtref*XWGTUP
> + endif
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
> @@ -243,19 +251,21 @@
> endif
>
> c Keep track of the accumulated results:
> +C put in xsecScale_acc only the 0th entry of wgtxsecmu, ie
> +C the entry inclusive on the various orderstag
> if (do_rwgt_scale) then
> do kk=1,dyn_scale(0)
> if (lscalevar(kk)) then
> do ii=1,nint(scalevarF(0))
> do jj=1,nint(scalevarR(0))
> xsecScale_acc(jj,ii,kk)=xsecScale_acc(jj,ii,kk)
> - $ +wgtxsecmu(jj,ii,kk)
> + $ +wgtxsecmu(0,jj,ii,kk)
>
> enddo
> enddo
> else
> xsecScale_acc(1,1,kk)=xsecScale_acc(1,1,kk)
> - $ +wgtxsecmu(1,1,kk)
> + $ +wgtxsecmu(0,1,1,kk)
> endif
> enddo
> endif
> @@ -393,7 +403,7 @@
> do i=1,icontr
> write(*,*)n_ctr_str(i)
> read(n_ctr_str(i),*)(wgt(j,i),j=1,3),(wgt_ME_tree(j,i),j=1,2)
> - & ,idum,(pdg(j,i),j=1,nexternal),QCDpower(i),(bjx(j,i),j=1
> + & ,idum,(pdg(j,i),j=1,nexternal),orderstag(i),QCDpower(i),(bjx(j,i),j=1
> & ,2),(scales2(j,i),j=1,3),g_strong(i),(momenta_conf(j),j=1
> & ,2),itype(i),nFKS(i),idum,idum,idum,wgts(1,i),bias_wgt(i)
> do ii=1,2
> @@ -418,53 +428,68 @@
> implicit none
> include 'nexternal.inc'
> include 'run.inc'
> + include 'orders.inc'
> integer i,pd,lp,iwgt_save,kr,kf,dd
> double precision mu2_f(maxscales),mu2_r(maxscales),xlum(maxscales)
> $ ,pdg2pdf,mu2_q,rwgt_muR_dep_fac,g(maxscales),alphas,pi
> $ ,c_mu2_r,c_mu2_f
> parameter (pi=3.14159265358979323846d0)
> external pdg2pdf,rwgt_muR_dep_fac,alphas
> + integer orderstag_this, iamp
> + integer get_orders_tag_from_amp_pos
> + external get_orders_tag_from_amp_pos
> +
> iwgt_save=iwgt
> do i=1,icontr
> iwgt=iwgt_save
> mu2_q=scales2(1,i)
> - do dd=1,dyn_scale(0)
> - call set_mu_central(i,dd,c_mu2_r,c_mu2_f)
> - do kr=1,nint(scalevarR(0))
> - if ((.not. lscalevar(dd)) .and. kr.ne.1) exit
> - mu2_r(kr)=c_mu2_r*scalevarR(kr)**2
> -c Update the strong coupling
> - g(kr)=sqrt(4d0*pi*alphas(sqrt(mu2_r(kr))))
> - enddo
> - do kf=1,nint(scalevarF(0))
> - if ((.not. lscalevar(dd)) .and. kf.ne.1) exit
> - mu2_f(kf)=c_mu2_f*scalevarF(kf)**2
> -c call the PDFs
> - xlum(kf)=1d0
> - LP=SIGN(1,LPP(1))
> - pd=pdg(1,i)
> - if (pd.eq.21) pd=0
> - xlum(kf)=xlum(kf)*PDG2PDF(ABS(LPP(1)),pd*LP,bjx(1,i)
> - & ,DSQRT(mu2_f(kf)))
> - LP=SIGN(1,LPP(2))
> - pd=pdg(2,i)
> - if (pd.eq.21) pd=0
> - xlum(kf)=xlum(kf)*PDG2PDF(ABS(LPP(2)),pd*LP,bjx(2,i)
> - & ,DSQRT(mu2_f(kf)))
> - enddo
> - do kf=1,nint(scalevarF(0))
> - if ((.not. lscalevar(dd)) .and. kf.ne.1) exit
> +
> + do iamp=0, amp_split_size
> + ! loop over the various coupling combinations.
> + ! iamp=0 just keeps everything
> + if (iamp.ne.0) orderstag_this = get_orders_tag_from_amp_pos(iamp)
> + ! filter the weights with the correct order
> + if (iamp.ne.0.and.orderstag_this.ne.orderstag(i)) cycle
> +
> + do dd=1,dyn_scale(0)
> + call set_mu_central(i,dd,c_mu2_r,c_mu2_f)
> do kr=1,nint(scalevarR(0))
> if ((.not. lscalevar(dd)) .and. kr.ne.1) exit
> - iwgt=iwgt+1 ! increment the iwgt for the wgts() array
> - call weight_lines_allocated(nexternal,max_contr,iwgt
> - $ ,max_iproc)
> + mu2_r(kr)=c_mu2_r*scalevarR(kr)**2
> +c Update the strong coupling
> + g(kr)=sqrt(4d0*pi*alphas(sqrt(mu2_r(kr))))
> + enddo
> + do kf=1,nint(scalevarF(0))
> + if ((.not. lscalevar(dd)) .and. kf.ne.1) exit
> + mu2_f(kf)=c_mu2_f*scalevarF(kf)**2
> +c call the PDFs
> + xlum(kf)=1d0
> + LP=SIGN(1,LPP(1))
> + pd=pdg(1,i)
> + if (pd.eq.21) pd=0
> + xlum(kf)=xlum(kf)*PDG2PDF(ABS(LPP(1)),pd*LP,bjx(1,i)
> + & ,DSQRT(mu2_f(kf)))
> + LP=SIGN(1,LPP(2))
> + pd=pdg(2,i)
> + if (pd.eq.21) pd=0
> + xlum(kf)=xlum(kf)*PDG2PDF(ABS(LPP(2)),pd*LP,bjx(2,i)
> + & ,DSQRT(mu2_f(kf)))
> + enddo
> +
> + do kf=1,nint(scalevarF(0))
> + if ((.not. lscalevar(dd)) .and. kf.ne.1) exit
> + do kr=1,nint(scalevarR(0))
> + if ((.not. lscalevar(dd)) .and. kr.ne.1) exit
> + iwgt=iwgt+1 ! increment the iwgt for the wgts() array
> + call weight_lines_allocated(nexternal,max_contr,iwgt
> + $ ,max_iproc)
> c add the weights to the array
> - wgts(iwgt,i)=xlum(kf) * (wgt(1,i)+wgt(2,i)
> - $ *log(mu2_r(kr)/mu2_q)+wgt(3,i)*log(mu2_f(kf)
> - $ /mu2_q))*g(kr)**QCDpower(i)
> - wgts(iwgt,i)=wgts(iwgt,i)*rwgt_muR_dep_fac(
> + wgts(iwgt,i)=xlum(kf) * (wgt(1,i)+wgt(2,i)
> + $ *log(mu2_r(kr)/mu2_q)+wgt(3,i)*log(mu2_f(kf)
> + $ /mu2_q))*g(kr)**QCDpower(i)
> + wgts(iwgt,i)=wgts(iwgt,i)*rwgt_muR_dep_fac(
> & sqrt(mu2_r(kr)),sqrt(scales2(2,i)))
> + enddo
> enddo
> enddo
> enddo
> @@ -530,17 +555,24 @@
> implicit none
> include 'nexternal.inc'
> include 'run.inc'
> - integer ii,jj,kk,nn,n,iw,i
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do ii=1,nint(scalevarF(0))
> - do jj=1,nint(scalevarR(0))
> - wgtxsecmu(jj,ii,kk)=0d0
> + integer ii,jj,kk,oo,nn,n,iw,i
> + integer orderstag_this
> + integer n_orderstags
> + integer orderstags_glob(maxorders)
> + common /c_orderstags_glob/n_orderstags, orderstags_glob
> +
> + do oo=0,n_orderstags
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do ii=1,nint(scalevarF(0))
> + do jj=1,nint(scalevarR(0))
> + wgtxsecmu(oo,jj,ii,kk)=0d0
> + enddo
> enddo
> - enddo
> - else
> - wgtxsecmu(1,1,kk)=0d0
> - endif
> + else
> + wgtxsecmu(oo,1,1,kk)=0d0
> + endif
> + enddo
> enddo
> do nn=1,lhaPDFid(0)
> if (lpdfvar(nn)) then
> @@ -554,18 +586,23 @@
> do i=1,icontr
> iw=2
> if (do_rwgt_scale) then
> - do kk=1,dyn_scale(0)
> - if (lscalevar(kk)) then
> - do ii=1,nint(scalevarF(0))
> - do jj=1,nint(scalevarR(0))
> - wgtxsecmu(jj,ii,kk)=wgtxsecmu(jj,ii,kk)+wgts(iw,i)
> - iw=iw+1
> + do oo=0,n_orderstags
> + if (oo.ne.0) orderstag_this = orderstags_glob(oo)
> + ! filter the weights with the correct order
> + if (oo.ne.0.and.orderstag_this.ne.orderstag(i)) cycle
> + do kk=1,dyn_scale(0)
> + if (lscalevar(kk)) then
> + do ii=1,nint(scalevarF(0))
> + do jj=1,nint(scalevarR(0))
> + wgtxsecmu(oo,jj,ii,kk)=wgtxsecmu(oo,jj,ii,kk)+wgts(iw,i)
> + iw=iw+1
> + enddo
> enddo
> - enddo
> - else
> - wgtxsecmu(1,1,kk)=wgtxsecmu(1,1,kk)+wgts(iw,i)
> - iw=iw+1
> - endif
> + else
> + wgtxsecmu(oo,1,1,kk)=wgtxsecmu(oo,1,1,kk)+wgts(iw,i)
> + iw=iw+1
> + endif
> + enddo
> enddo
> endif
> if (do_rwgt_pdf) then
>
> === modified file 'Template/NLO/SubProcesses/splitorders_stuff.f'
> --- Template/NLO/SubProcesses/splitorders_stuff.f 2020-06-26 09:32:02 +0000
> +++ Template/NLO/SubProcesses/splitorders_stuff.f 2020-11-27 13:44:07 +0000
> @@ -65,6 +65,22 @@
>
> return
> end
> +
> +
> + integer function get_orders_tag_from_amp_pos(iamp)
> +C calls get_orders_tag for the orders corresponding to
> +C the iamp-th amp_split
> + implicit none
> + integer iamp
> + include 'orders.inc'
> + integer ord(nsplitorders)
> + integer get_orders_tag
> +
> + call amp_split_pos_to_orders(iamp, ord)
> + get_orders_tag_from_amp_pos = get_orders_tag(ord)
> +
> + return
> + end
>
>
> integer function orders_to_amp_split_pos(ord)
> @@ -149,6 +165,7 @@
> subroutine check_amp_split()
> C check that amp_split_pos_to_orders and orders_to_amp_split_pos behave
> C as expected (one the inverse of the other)
> +C Check also get_orders_tag vs get_orders_tag_from_amp_pos
> C Stop the code if anything wrong is found
> C Also, print on screen a summary of the orders in amp_split
> implicit none
> @@ -156,19 +173,30 @@
> integer orders_to_amp_split_pos
> integer i, pos
> integer ord(nsplitorders)
> + integer get_orders_tag, get_orders_tag_from_amp_pos
>
> do i = 1, amp_split_size
> call amp_split_pos_to_orders(i, ord)
> pos = orders_to_amp_split_pos(ord)
> +
> if (pos.ne.i) then
> - write(*,*) 'ERROR in check amp_split', pos, i
> + write(*,*) 'ERROR#1 in check amp_split', pos, i
> write(*,*) 'ORD is ', ord
> stop 1
> endif
> +
> + if (get_orders_tag(ord).ne.get_orders_tag_from_amp_pos(i)) then
> + write(*,*) 'ERROR#2 in check amp_split', get_orders_tag(ord),
> + $ get_orders_tag_from_amp_pos(i)
> + write(*,*) 'I, ORD ', i, ord
> + stop 1
> + endif
> +
> write(*,*) 'AMP_SPLIT: ', i, 'correspond to S.O.', ord
> enddo
>
> return
> end
>
> -
> +
> +
>
> === modified file 'UpdateNotes.txt'
> --- UpdateNotes.txt 2020-11-27 13:24:05 +0000
> +++ UpdateNotes.txt 2020-11-27 13:44:07 +0000
> @@ -13,6 +13,8 @@
> Squared-amplitude constraints can be imposed by using the usual squared-order
> syntax, e.g.:
> QCD^2<=X, QED^2<=Y (constrained at the diagram squared level).
> + MZ: Different coupling combinations and their scale variations are written in the
> + event file as extra weights
> OM: Some aliases have been added for the orders constraints:
> - aEW<=X / aS<=Y is equivalent to QCD^2<=2X / QED^2<=2Y
> - EW<=X / EW^2<=X is equivalent to QED<=X / QED^2<=X
>
> === modified file 'madgraph/interface/amcatnlo_run_interface.py'
> --- madgraph/interface/amcatnlo_run_interface.py 2020-11-23 16:35:02 +0000
> +++ madgraph/interface/amcatnlo_run_interface.py 2020-11-27 13:44:07 +0000
> @@ -2015,8 +2015,43 @@
> time.sleep(10)
>
> event_norm=self.run_card['event_norm']
> + # gather the various orders tag and write include files
> + self.write_orders_tag_info()
> +
> return self.reweight_and_collect_events(options, mode, nevents, event_norm)
>
> +
> + def write_orders_tag_info(self):
> + """Collects the informations on the orders_tag variable from the
> + different channels and writes a file, linked to the P0 dirs
> + """
> + log = pjoin(self.me_dir, 'Events', self.run_name, 'alllogs_0.html')
> + content = open(log).read()
> + taglines = [l for l in content.split('\n') if 'orders_tag_plot=' in l]
> + orderstags = []
> + for l in taglines:
> + tag = int(l.split()[1])
> + if not tag in orderstags:
> + orderstags.append(tag)
> + # now write a fortran include file with all the informations
> + content = '%d\n' % len(orderstags)
> + content+= '%s\n' % ' '.join(['%d' % v for v in orderstags])
> + outfile = open(pjoin(self.me_dir, 'SubProcesses', 'orderstags_glob.dat'), 'w')
> + outfile.write(content)
> + outfile.close()
> +
> + # finally link it into the p dirs
> + p_dirs = [d for d in \
> + open(pjoin(self.me_dir, 'SubProcesses', 'subproc.mg')).read().split('\n') if d]
> +
> + for p_dir in p_dirs:
> + if not os.path.isfile(pjoin(self.me_dir, 'SubProcesses', p_dir, 'orderstags_glob.dat')):
> + files.ln(pjoin(self.me_dir, 'SubProcesses', 'orderstags_glob.dat'),
> + pjoin(self.me_dir, 'SubProcesses', p_dir))
> +
> + return
> +
> +
> def create_jobs_to_run(self,options,p_dirs,req_acc,run_mode,\
> integration_step,mode,fixed_order=True):
> """Creates a list of dictionaries with all the jobs to be run"""
>
> === modified file 'madgraph/iolibs/export_fks.py'
> --- madgraph/iolibs/export_fks.py 2020-11-27 13:24:05 +0000
> +++ madgraph/iolibs/export_fks.py 2020-11-27 13:44:07 +0000
> @@ -674,6 +674,7 @@
> 'fks_powers.inc',
> 'fks_singular.f',
> 'splitorders_stuff.f',
> + 'orderstags_glob.f',
> 'chooser_functions.f',
> 'veto_xsec.f',
> 'veto_xsec.inc',
>