Merge lp:~mg5core1/mg5amcnlo/2.5.6 into lp:mg5amcnlo/lts

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 274
Proposed branch: lp:~mg5core1/mg5amcnlo/2.5.6
Merge into: lp:mg5amcnlo/lts
Diff against target: 30012 lines (+12931/-7078)
292 files modified
MadSpin/decay.py (+9/-4)
MadSpin/src/driver.f (+1/-0)
Template/LO/Cards/run_card.dat (+1/-1)
Template/LO/Source/.make_opts (+22/-8)
Template/LO/Source/PDF/pdf.f (+1/-1)
Template/LO/Source/PDF/pdg2pdf.f (+5/-0)
Template/LO/Source/PDF/pdg2pdf_lhapdf.f (+5/-0)
Template/LO/Source/dsample.f (+39/-8)
Template/LO/SubProcesses/dummy_fct.f (+47/-0)
Template/LO/SubProcesses/genps.f (+184/-94)
Template/LO/SubProcesses/makefile (+2/-1)
Template/LO/SubProcesses/refine.sh (+1/-1)
Template/LO/SubProcesses/unwgt.f (+1/-1)
Template/NLO/Cards/run_card.dat (+1/-1)
Template/NLO/Cards/shower_card.dat (+1/-1)
Template/NLO/FixedOrderAnalysis/HwU.f (+199/-59)
Template/NLO/FixedOrderAnalysis/HwU.inc (+0/-22)
Template/NLO/FixedOrderAnalysis/analysis_HwU_template.f (+2/-2)
Template/NLO/MCatNLO/include/reweight0.inc (+3/-0)
Template/NLO/MCatNLO/srcHerwig/madfks_hwdriver.f (+19/-1)
Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f (+0/-1)
Template/NLO/MCatNLO/srcPythia/madfks_pydriver.f (+1/-1)
Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f (+0/-1)
Template/NLO/MCatNLO/srcPythia8/Pythia8.cc (+2/-2)
Template/NLO/MCatNLO/srcPythia8/Pythia82.cc (+2/-2)
Template/NLO/MCatNLO/srcPythia8/Pythia82_hep.cc (+2/-2)
Template/NLO/MCatNLO/srcPythia8/Pythia8_hep.cc (+2/-2)
Template/NLO/Source/alfas_functions_lhapdf.f (+1/-1)
Template/NLO/Source/extra_weights.f (+43/-0)
Template/NLO/Source/getissud.f (+0/-201)
Template/NLO/Source/make_opts.inc (+12/-5)
Template/NLO/Source/makefile (+5/-9)
Template/NLO/Source/run.inc (+0/-5)
Template/NLO/Source/run_config.inc (+0/-54)
Template/NLO/Source/setrun.f (+60/-177)
Template/NLO/Source/sudgrid.inc (+0/-4)
Template/NLO/SubProcesses/add_write_info.f (+0/-1)
Template/NLO/SubProcesses/analysis_lhe.f (+6/-5)
Template/NLO/SubProcesses/c_weight.inc (+0/-24)
Template/NLO/SubProcesses/check_poles.f (+1/-0)
Template/NLO/SubProcesses/collect_events.f (+7/-14)
Template/NLO/SubProcesses/combine_root.C (+5/-4)
Template/NLO/SubProcesses/cuts.f (+39/-24)
Template/NLO/SubProcesses/driver_mintFO.f (+11/-10)
Template/NLO/SubProcesses/driver_mintMC.f (+30/-27)
Template/NLO/SubProcesses/fks_singular.f (+267/-933)
Template/NLO/SubProcesses/genps_fks.f (+22/-92)
Template/NLO/SubProcesses/handling_lhe_events.f (+52/-30)
Template/NLO/SubProcesses/madfks_plot.f (+20/-11)
Template/NLO/SubProcesses/makefile (+7/-6)
Template/NLO/SubProcesses/makefile_fks_dir (+18/-16)
Template/NLO/SubProcesses/mirror.f (+0/-27)
Template/NLO/SubProcesses/montecarlocounter.f (+50/-22)
Template/NLO/SubProcesses/reweight.f (+14/-14)
Template/NLO/SubProcesses/reweight.inc (+0/-39)
Template/NLO/SubProcesses/reweight0.inc (+0/-155)
Template/NLO/SubProcesses/reweight1.inc (+0/-13)
Template/NLO/SubProcesses/reweightNLO.inc (+0/-16)
Template/NLO/SubProcesses/reweight_all.inc (+0/-74)
Template/NLO/SubProcesses/reweight_xsec.f (+1/-1063)
Template/NLO/SubProcesses/reweight_xsec_events.f (+28/-32)
Template/NLO/SubProcesses/setcuts.f (+1/-39)
Template/NLO/SubProcesses/setscales.f (+1/-5)
Template/NLO/SubProcesses/symmetry_fks_test_MC.f (+0/-673)
Template/NLO/SubProcesses/symmetry_fks_test_ME.f (+0/-596)
Template/NLO/SubProcesses/symmetry_fks_v3.f (+76/-310)
Template/NLO/SubProcesses/test_soft_col_limits.f (+542/-0)
Template/NLO/SubProcesses/timing_variables.inc (+3/-4)
Template/NLO/SubProcesses/trapfpe_secure.c (+0/-86)
Template/NLO/SubProcesses/weight_lines.f (+251/-0)
Template/NLO/SubProcesses/write_event.f (+7/-53)
Template/NLO/Utilities/check_events.f (+164/-92)
Template/NLO/Utilities/makefile (+3/-2)
Template/RWGTNLO/makefile (+1/-1)
Template/loop_material/StandAlone/SubProcesses/makefile (+10/-1)
UpdateNotes.txt (+51/-0)
VERSION (+2/-1)
aloha/create_aloha.py (+10/-7)
madgraph/core/base_objects.py (+16/-2)
madgraph/core/diagram_generation.py (+3/-4)
madgraph/core/helas_objects.py (+2/-2)
madgraph/interface/amcatnlo_run_interface.py (+40/-24)
madgraph/interface/common_run_interface.py (+101/-56)
madgraph/interface/extended_cmd.py (+24/-9)
madgraph/interface/loop_interface.py (+26/-9)
madgraph/interface/madevent_interface.py (+94/-22)
madgraph/interface/madgraph_interface.py (+22/-16)
madgraph/interface/madweight_interface.py (+1/-1)
madgraph/interface/reweight_interface.py (+745/-638)
madgraph/iolibs/export_cpp.py (+3/-2)
madgraph/iolibs/export_fks.py (+15/-18)
madgraph/iolibs/export_v4.py (+219/-56)
madgraph/iolibs/file_writers.py (+52/-0)
madgraph/iolibs/files.py (+6/-2)
madgraph/iolibs/template_files/born_fks.inc (+33/-10)
madgraph/iolibs/template_files/loop/improve_ps.inc (+22/-3)
madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc (+9/-0)
madgraph/iolibs/template_files/loop_optimized/check_py.f.inc (+40/-5)
madgraph/iolibs/template_files/loop_optimized/check_sa.py.inc (+2/-2)
madgraph/iolibs/template_files/loop_optimized/check_sa_all.py.inc (+139/-0)
madgraph/iolibs/template_files/loop_optimized/helas_calls_split.inc (+2/-2)
madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc (+21/-2)
madgraph/iolibs/template_files/loop_optimized/mp_compute_loop_coefs.inc (+20/-4)
madgraph/iolibs/template_files/loop_optimized/mp_helas_calls_split.inc (+2/-2)
madgraph/iolibs/template_files/madevent_combine_events.f (+16/-5)
madgraph/iolibs/template_files/madevent_makefile_source (+5/-5)
madgraph/iolibs/template_files/makefile_sa_f2py (+23/-0)
madgraph/iolibs/template_files/makefile_sa_f_sp (+1/-1)
madgraph/iolibs/template_files/matrix_standalone_splitOrders_v4.inc (+5/-4)
madgraph/iolibs/template_files/matrix_standalone_v4.inc (+7/-4)
madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc (+2/-0)
madgraph/loop/loop_diagram_generation.py (+9/-1)
madgraph/loop/loop_exporters.py (+144/-4)
madgraph/loop/loop_helas_objects.py (+8/-2)
madgraph/madevent/combine_runs.py (+7/-4)
madgraph/madevent/gen_crossxhtml.py (+12/-3)
madgraph/madevent/gen_ximprove.py (+61/-12)
madgraph/madevent/sum_html.py (+30/-7)
madgraph/various/banner.py (+31/-17)
madgraph/various/cluster.py (+20/-9)
madgraph/various/lhe_parser.py (+496/-99)
madgraph/various/misc.py (+37/-3)
madgraph/various/systematics.py (+149/-18)
mg5decay/decay_objects.py (+3/-0)
models/check_param_card.py (+5/-3)
models/import_ufo.py (+3/-4)
models/template_files/fortran/lha_read.f (+2/-2)
models/template_files/fortran/lha_read_mp.f (+2/-2)
models/usermod.py (+21/-0)
tests/acceptance_tests/test_cmd_reweight.py (+268/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f (+35/-11)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%genps.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%born.f (+35/-11)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%genps.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%born.f (+35/-11)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%genps.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f (+37/-13)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%born.f (+37/-13)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%born.f (+37/-13)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f (+5/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%born.f (+35/-11)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%genps.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f (+5/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%born.f (+35/-11)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%genps.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born.f (+37/-13)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%genps.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%parton_lum_chooser.f (+0/-4)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f (+11/-9)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f (+7/-4)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f (+25/-3)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f (+25/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f (+5/-4)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_NoSQSO.f (+7/-4)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_QCDsq_le_6.f (+5/-4)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_ampOrderQED2_eq_2_WGTsq_le_14_QCDsq_gt_4.f (+5/-4)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f (+10/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f (+10/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/mp_helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/mp_helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f (+10/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f (+10/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f (+10/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/mp_helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f (+7/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/f2py_wrapper.f (+37/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/helas_calls_uvct_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/improve_ps.f (+24/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_CT_calls_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f (+25/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/mp_coef_construction_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/mp_compute_loop_coefs.f (+23/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/mp_helas_calls_ampb_1.f (+3/-3)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/mp_helas_calls_uvct_1.f (+3/-3)
tests/input_files/loop_smgrav/.restrict_parallel_test.dat (+59/-0)
tests/input_files/loop_smgrav/CT_couplings.py (+738/-0)
tests/input_files/loop_smgrav/CT_parameters.py (+167/-0)
tests/input_files/loop_smgrav/CT_vertices.py (+968/-0)
tests/input_files/loop_smgrav/__init__.py (+27/-0)
tests/input_files/loop_smgrav/coupling_orders.py (+16/-0)
tests/input_files/loop_smgrav/couplings.py (+449/-0)
tests/input_files/loop_smgrav/function_library.py (+64/-0)
tests/input_files/loop_smgrav/lorentz.py (+194/-0)
tests/input_files/loop_smgrav/object_library.py (+333/-0)
tests/input_files/loop_smgrav/parameters.py (+829/-0)
tests/input_files/loop_smgrav/particles.py (+357/-0)
tests/input_files/loop_smgrav/restrict_default.dat (+59/-0)
tests/input_files/loop_smgrav/restrict_parallel_test.dat (+59/-0)
tests/input_files/loop_smgrav/restrict_test.dat (+61/-0)
tests/input_files/loop_smgrav/vertices.py (+830/-0)
tests/input_files/loop_smgrav/write_param_card.py (+181/-0)
tests/parallel_tests/test_cmd_amcatnlo.py (+1/-1)
tests/time_db (+260/-257)
tests/unit_tests/interface/test_edit_card.py (+33/-2)
tests/unit_tests/iolibs/test_export_fks_EW.py (+1/-5)
vendor/DiscreteSampler/DiscreteSampler.f (+1/-1)
To merge this branch: bzr merge lp:~mg5core1/mg5amcnlo/2.5.6
Reviewer Review Type Date Requested Status
MadTeam Pending
Review via email: mp+328650@code.launchpad.net

Description of the change

Hi guys,

With Rikkert and Stefano, we agreed to release 2.5.6 this friday.
They are two branch that need to be merged before that:
1) bias_function ( which i need to finish the review --already started--)
2) reweight_mass ( Which both Valentin and Rikkert have started to review)

Two branch have actually already been approved for merging but (as far as I know where not merged already):
HwU_allocated -> Rikkert can you merge it (if you want)
mg5hpc -> That's for me.

I would like to see if it is possible to merge:
maddm_dev (would be review by Valentin)
but if that does not make it, it is not critical.

Anything else that you want to include in this version?
I would actually propose to call it 2.6.0 since this version includes a lot of new features.

Cheers,

Olivier

To post a comment you must log in.
Revision history for this message
Stefano Frixione (stefano-frixione) wrote :

Hi Olivier,

> I would actually propose to call it 2.6.0 since this version includes a
> lot of new features.
I think we have advertised a few times that 2.6.0 would contain
EW corrections, so I personally prefer 2.5.6 (not a vry strong
feeling; I'll be happy to go with the majority).

Concerning the review: after the MS bug, I've kept on testing the NLO
bias stuff with cases more involved than single V, and I didn't
find any issues.

Cheers, Stefano.

>
> Cheers,
>
> Olivier
> --
> The attached diff has been truncated due to its size.
> Your team MadTeam is requested to review the proposed merge of lp:~mg5core1/mg5amcnlo/2.5.6 into lp:mg5amcnlo.
>

Revision history for this message
Rikkert Frederix (frederix) wrote :

Hi Olivier, Stefano,

I think EW should be 3.0.0.

I don't mind calling it 2.6.0, but 2.5.6 is also fine for me. No strong feelings either way.

HwU_allocated has already been merged a couple of versions ago.

I'm currently testing the reweight_mass with the complete H+2j FxFx. I've got ~500k events. It seems to be a bit faster as the old hand-written reweighting. I'll make some plots this afternoon and check with our previous results.

Cheers,
Rik

lp:~mg5core1/mg5amcnlo/2.5.6 updated
317. By Rikkert Frederix

removed the s-hat as dynamical-scale-choice option 4. This is not IR safe.

318. By Rikkert Frederix

merge with the bias_function branch

319. By Rikkert Frederix

Fixed a problem with the bias in split-event generation and the cross
section printed to the screen at the end of the run.

320. By olivier-mattelaer

merge reweight_mass

321. By olivier-mattelaer

allow syntax set nevents 100k and 1M (in general for all integer variable)

322. By marco zaro

fix in combine_root.C; variables were declared inside loops but
used also outside

323. By olivier-mattelaer

update iotest

324. By olivier-mattelaer

fix to put support for lhapdf6.2

325. By olivier-mattelaer

merge maddm_dev (v.298)

326. By olivier-mattelaer

merge 2.5.6_cflow_fix

327. By olivier-mattelaer

update Update note and documentation

328. By olivier-mattelaer

fixing tests

329. By olivier-mattelaer

do the reweigthing always in the center of mass frame to avoid loop stability issue

330. By olivier-mattelaer

fixing test issue + one bug in the re-weighting in output mode 2.0

331. By Valentin Hirschi

1. Fixed issue in the PY8 histogramming related to
         https://bugs.launchpad.net/mg5amcnlo/+bug/1706139
2. Updated ninja tarball.

332. By olivier-mattelaer

fixing one parralel test

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MadSpin/decay.py'
--- MadSpin/decay.py 2017-05-22 08:05:00 +0000
+++ MadSpin/decay.py 2017-08-16 21:26:30 +0000
@@ -207,6 +207,7 @@
207 line+="\n"207 line+="\n"
208 return line208 return line
209209
210
210 def reshuffle_resonances(self,mother):211 def reshuffle_resonances(self,mother):
211 """ reset the momentum of each resonance in the production event212 """ reset the momentum of each resonance in the production event
212 to the sum of momenta of the daughters213 to the sum of momenta of the daughters
@@ -222,9 +223,9 @@
222 if self.resonance[index]["mothup1"]==mother:223 if self.resonance[index]["mothup1"]==mother:
223 daughters.append(index)224 daughters.append(index)
224225
225 if len(daughters)!=2:226# if len(daughters)!=2:
226 logger.info("Got more than 2 (%s) daughters for one particles" % len(daughters))227# logger.info("Got more than 2 (%s) daughters for one particles" % len(daughters))
227 logger.info("in one production event (before decay)")228# logger.info("in one production event (before decay)")
228229
229230
230 if daughters[0]>0:231 if daughters[0]>0:
@@ -1633,11 +1634,15 @@
1633 self.ask_edit_cards(['param_card'],[], plot=False)1634 self.ask_edit_cards(['param_card'],[], plot=False)
1634 1635
1635 1636
1637 commandline = 'import model %s' % model.get('modelpath+restriction')
1638 if not model.mg5_name:
1639 commandline += ' --modelname'
1640 cmd.exec_cmd(commandline)
1641
1636 line = 'compute_widths %s %s' % \1642 line = 'compute_widths %s %s' % \
1637 (' '.join([str(i) for i in opts['particles']]),1643 (' '.join([str(i) for i in opts['particles']]),
1638 ' '.join('--%s=%s' % (key,value) for (key,value) in opts.items()1644 ' '.join('--%s=%s' % (key,value) for (key,value) in opts.items()
1639 if key not in ['model', 'force', 'particles'] and value))1645 if key not in ['model', 'force', 'particles'] and value))
1640 cmd.exec_cmd('import model %s' % model.get('modelpath+restriction'))
16411646
1642 #pattern for checking complex mass scheme.1647 #pattern for checking complex mass scheme.
1643 has_cms = re.compile(r'''set\s+complex_mass_scheme\s*(True|T|1|true|$|;)''', re.M)1648 has_cms = re.compile(r'''set\s+complex_mass_scheme\s*(True|T|1|true|$|;)''', re.M)
16441649
=== modified file 'MadSpin/src/driver.f'
--- MadSpin/src/driver.f 2017-03-13 14:10:42 +0000
+++ MadSpin/src/driver.f 2017-08-16 21:26:30 +0000
@@ -384,6 +384,7 @@
384 do k=1,nb_mc_masses384 do k=1,nb_mc_masses
385 m(indices_mc_masses(k))=values_mc_masses(k)385 m(indices_mc_masses(k))=values_mc_masses(k)
386 enddo386 enddo
387 ivar=0
387 call generate_momenta_conf(jac,x,itree,qmass,qwidth,ptrial,pprod,map_external2res) 388 call generate_momenta_conf(jac,x,itree,qmass,qwidth,ptrial,pprod,map_external2res)
388 389
389 if (jac.lt.0d0) then390 if (jac.lt.0d0) then
390391
=== modified file 'Template/LO/Cards/run_card.dat'
--- Template/LO/Cards/run_card.dat 2016-11-21 14:12:27 +0000
+++ Template/LO/Cards/run_card.dat 2017-08-16 21:26:30 +0000
@@ -114,7 +114,6 @@
114 %(pta)s = pta ! minimum pt for the photons 114 %(pta)s = pta ! minimum pt for the photons
115 %(ptl)s = ptl ! minimum pt for the charged leptons 115 %(ptl)s = ptl ! minimum pt for the charged leptons
116 %(misset)s = misset ! minimum missing Et (sum of neutrino's momenta)116 %(misset)s = misset ! minimum missing Et (sum of neutrino's momenta)
117 %(ptheavy)s = ptheavy ! minimum pt for one heavy final state
118 %(ptjmax)s = ptjmax ! maximum pt for the jets117 %(ptjmax)s = ptjmax ! maximum pt for the jets
119 %(ptbmax)s = ptbmax ! maximum pt for the b118 %(ptbmax)s = ptbmax ! maximum pt for the b
120 %(ptamax)s = ptamax ! maximum pt for the photons119 %(ptamax)s = ptamax ! maximum pt for the photons
@@ -191,6 +190,7 @@
191#*********************************************************************190#*********************************************************************
192# Inclusive cuts *191# Inclusive cuts *
193#*********************************************************************192#*********************************************************************
193 %(ptheavy)s = ptheavy ! minimum pt for at least one heavy final state
194 %(xptj)s = xptj ! minimum pt for at least one jet 194 %(xptj)s = xptj ! minimum pt for at least one jet
195 %(xptb)s = xptb ! minimum pt for at least one b 195 %(xptb)s = xptb ! minimum pt for at least one b
196 %(xpta)s = xpta ! minimum pt for at least one photon 196 %(xpta)s = xpta ! minimum pt for at least one photon
197197
=== modified file 'Template/LO/Source/.make_opts'
--- Template/LO/Source/.make_opts 2016-12-02 21:56:34 +0000
+++ Template/LO/Source/.make_opts 2017-08-16 21:26:30 +0000
@@ -37,9 +37,6 @@
37CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)37CFLAGS= -O $(STDLIB_FLAG) $(MACFLAG)
38endif38endif
3939
40# Increase the number of allowed charcters in a Fortran line
41FFLAGS+= -ffixed-line-length-132
42
43# Set FC unless it's defined by an environment variable40# Set FC unless it's defined by an environment variable
44ifeq ($(origin FC),default)41ifeq ($(origin FC),default)
45FC=$(DEFAULT_F_COMPILER)42FC=$(DEFAULT_F_COMPILER)
@@ -48,6 +45,15 @@
48F2PY=$(DEFAULT_F2PY_COMPILER)45F2PY=$(DEFAULT_F2PY_COMPILER)
49endif46endif
5047
48# Increase the number of allowed charcters in a Fortran line
49ifeq ($(FC), ftn)
50FFLAGS+= -extend-source # for ifort type of compiler
51else
52FFLAGS+= -ffixed-line-length-132
53endif
54
55
56
51UNAME := $(shell uname -s)57UNAME := $(shell uname -s)
52ifeq ($(origin LDFLAGS), undefined)58ifeq ($(origin LDFLAGS), undefined)
53LDFLAGS=$(STDLIB) $(MACFLAG)59LDFLAGS=$(STDLIB) $(MACFLAG)
@@ -89,12 +95,20 @@
89# Option lhapdf95# Option lhapdf
9096
91ifneq ($(lhapdf),)97ifneq ($(lhapdf),)
92CXXFLAGS += $(shell $(lhapdf) --cppflags)98 CXXFLAGS += $(shell $(lhapdf) --cppflags)
93alfas_functions=alfas_functions_lhapdf99 alfas_functions=alfas_functions_lhapdf
94llhapdf+= -lLHAPDF100 llhapdf+= $(shell $(lhapdf) --cflags --libs) -lLHAPDF
101# check if we need to activate c++11 (for lhapdf6.2)
102 ifeq ($(origin CXX),default)
103 ifeq ($lhapdfversion$lhapdfsubversion,62)
104 CXX=$(DEFAULT_CPP_COMPILER) -std=c++11
105 else
106 CXX=$(DEFAULT_CPP_COMPILER)
107 endif
108 endif
95else109else
96alfas_functions=alfas_functions110 alfas_functions=alfas_functions
97llhapdf=111 llhapdf=
98endif112endif
99113
100# Helper function to check MG5 version114# Helper function to check MG5 version
101115
=== modified file 'Template/LO/Source/PDF/pdf.f'
--- Template/LO/Source/PDF/pdf.f 2014-10-20 07:53:19 +0000
+++ Template/LO/Source/PDF/pdf.f 2017-08-16 21:26:30 +0000
@@ -14,7 +14,7 @@
14 include 'pdf.inc'14 include 'pdf.inc'
15C 15C
16 call fdist(ih,x, q, pdf)16 call fdist(ih,x, q, pdf)
17 17
18 return 18 return
19 end19 end
2020
2121
=== modified file 'Template/LO/Source/PDF/pdg2pdf.f'
--- Template/LO/Source/PDF/pdg2pdf.f 2014-01-07 10:50:42 +0000
+++ Template/LO/Source/PDF/pdg2pdf.f 2017-08-16 21:26:30 +0000
@@ -26,6 +26,11 @@
26 data pdlabellast/2*'abcdefg'/26 data pdlabellast/2*'abcdefg'/
27 data ihlast/2*-99/27 data ihlast/2*-99/
2828
29 if (ih.eq.9) then
30 pdg2pdf = 1d0
31 return
32 endif
33
29c Make sure we have a reasonable Bjorken x. Note that even though34c Make sure we have a reasonable Bjorken x. Note that even though
30c x=0 is not reasonable, we prefer to simply return pdg2pdf=035c x=0 is not reasonable, we prefer to simply return pdg2pdf=0
31c instead of stopping the code, as this might accidentally happen.36c instead of stopping the code, as this might accidentally happen.
3237
=== modified file 'Template/LO/Source/PDF/pdg2pdf_lhapdf.f'
--- Template/LO/Source/PDF/pdg2pdf_lhapdf.f 2013-12-09 11:12:33 +0000
+++ Template/LO/Source/PDF/pdg2pdf_lhapdf.f 2017-08-16 21:26:30 +0000
@@ -22,6 +22,11 @@
22 data pdflast/30*-99d9/22 data pdflast/30*-99d9/
23 data imemlast/2*-99/23 data imemlast/2*-99/
2424
25 if (ih.eq.9) then
26 pdg2pdf =1d0
27 return
28 endif
29
25c Make sure we have a reasonable Bjorken x. Note that even though30c Make sure we have a reasonable Bjorken x. Note that even though
26c x=0 is not reasonable, we prefer to simply return pdg2pdf=031c x=0 is not reasonable, we prefer to simply return pdg2pdf=0
27c instead of stopping the code, as this might accidentally happen.32c instead of stopping the code, as this might accidentally happen.
2833
=== modified file 'Template/LO/Source/dsample.f'
--- Template/LO/Source/dsample.f 2015-10-01 10:08:45 +0000
+++ Template/LO/Source/dsample.f 2017-08-16 21:26:30 +0000
@@ -997,6 +997,43 @@
997997
998 end subroutine write_discrete_grids998 end subroutine write_discrete_grids
999999
1000 subroutine write_grid(name)
1001c************************************************************************
1002c Write out the grid
1003c************************************************************************
1004 implicit none
1005
1006 character*(*) name
1007
1008 include 'genps.inc'
1009
1010 double precision tmean, trmean, tsigma
1011 integer dim, events, itm, kn, cur_it, invar, configs
1012 common /sample_common/
1013 . tmean, trmean, tsigma, dim, events, itm, kn, cur_it, invar, configs
1014
1015 double precision twgt, maxwgt,swgt(maxevents)
1016 integer lun, nw, itmin
1017 common/to_unwgt/twgt, maxwgt, swgt, lun, nw, itmin
1018
1019 double precision grid(2, ng, 0:maxinvar)
1020 common /data_grid/ grid
1021
1022 double precision force_max_wgt
1023 common/unwgt_secondary_max/force_max_wgt
1024
1025 integer i,j
1026
1027 open(26, file='ftn26',status='unknown')
1028 write(26,fmt='(4f21.17)') ((grid(2,i,j),i=1,ng),j=1,invar)
1029 write(26,*) twgt, force_max_wgt
1030c write(26,fmt='(4f21.16)') (alpha(i),i=1,maxconfigs)
1031 call write_discrete_grids(26,'ref')
1032 close(26)
1033 return
1034 end
1035
1036
1000 subroutine read_discrete_grids(stream_id)1037 subroutine read_discrete_grids(stream_id)
1001c************************************************************************1038c************************************************************************
1002c Write out the grid using the DiscreteSampler module1039c Write out the grid using the DiscreteSampler module
@@ -1714,7 +1751,7 @@
1714 if (kn .ge. max_events .and. non_zero .le. 5) then1751 if (kn .ge. max_events .and. non_zero .le. 5) then
1715 call none_pass(max_events)1752 call none_pass(max_events)
1716 endif1753 endif
1717 if (non_zero .eq. events .or. (kn .gt. 200*events .and.1754 if (non_zero .ge. events .or. (kn .gt. 200*events .and.
1718 $ non_zero .gt. 5)) then1755 $ non_zero .gt. 5)) then
17191756
1720c # special mode where we store information to combine them1757c # special mode where we store information to combine them
@@ -2179,13 +2216,7 @@
2179 . /23X,11HCross sec =,e12.4/2216 . /23X,11HCross sec =,e12.4/
2180 . 13X,21HChi**2 per DoF. =,f12.4/1X,79(1H-))2217 . 13X,21HChi**2 per DoF. =,f12.4/1X,79(1H-))
2181 if (use_cut .ne. 0) then2218 if (use_cut .ne. 0) then
2182 open(26, file='ftn26',status='unknown')2219 call write_grid('ftn26')
2183 write(26,fmt='(4f21.17)')
2184 $ ((grid(2,i,j),i=1,ng),j=1,invar)
2185 write(26,*) twgt, force_max_wgt
2186 call write_discrete_grids(26,'ref')
2187c write(26,fmt='(4f21.17)') (alpha(i),i=1,maxconfigs)
2188 close(26)
2189 endif2220 endif
2190 call sample_writehtm()2221 call sample_writehtm()
2191c open(unit=22,file=result_file,status='old',2222c open(unit=22,file=result_file,status='old',
21922223
=== added file 'Template/LO/SubProcesses/dummy_fct.f'
--- Template/LO/SubProcesses/dummy_fct.f 1970-01-01 00:00:00 +0000
+++ Template/LO/SubProcesses/dummy_fct.f 2017-08-16 21:26:30 +0000
@@ -0,0 +1,47 @@
1 subroutine get_dummy_x1(sjac, X1, R, pbeam1, pbeam2, stot, shat)
2 implicit none
3 include 'maxparticles.inc'
4 include 'run.inc'
5c include 'genps.inc'
6 double precision sjac ! jacobian. should be updated not reinit
7 double precision X1 ! bjorken X. output
8 double precision R ! random value after grid transfrormation. between 0 and 1
9 double precision pbeam1(0:3) ! momentum of the first beam (input and/or output)
10 double precision pbeam2(0:3) ! momentum of the second beam (input and/or output)
11 double precision stot ! total energy (input and /or output)
12 double precision shat ! output
13
14c global variable to set (or not)
15 double precision cm_rap
16 logical set_cm_rap
17 common/to_cm_rap/set_cm_rap,cm_rap
18
19 set_cm_rap=.false. ! then cm_rap will be set as .5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
20 ! ebeam(1) and ebeam(2) are defined here thanks to 'run.inc'
21 shat = x1*ebeam(1)*ebeam(2)
22 return
23 end
24
25 subroutine get_dummy_x1_x2(sjac, X, R, pbeam1, pbeam2, stot,shat)
26 implicit none
27 include 'maxparticles.inc'
28 include 'run.inc'
29c include 'genps.inc'
30 double precision sjac ! jacobian. should be updated not reinit
31 double precision X(2) ! bjorken X. output
32 double precision R(2) ! random value after grid transfrormation. between 0 and 1
33 double precision pbeam1(0:3) ! momentum of the first beam
34 double precision pbeam2(0:3) ! momentum of the second beam
35 double precision stot ! total energy
36 double precision shat ! output
37
38c global variable to set (or not)
39 double precision cm_rap
40 logical set_cm_rap
41 common/to_cm_rap/set_cm_rap,cm_rap
42
43 set_cm_rap=.false. ! then cm_rap will be set as .5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
44 ! ebeam(1) and ebeam(2) are defined here thanks to 'run.inc'
45 shat = x(1)*x(2)*ebeam(1)*ebeam(2)
46 return
47 end
048
=== modified file 'Template/LO/SubProcesses/genps.f'
--- Template/LO/SubProcesses/genps.f 2016-09-06 15:01:18 +0000
+++ Template/LO/SubProcesses/genps.f 2017-08-16 21:26:30 +0000
@@ -124,7 +124,6 @@
124 integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)124 integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)
125 integer tprid(-max_branch:-1,lmaxconfigs)125 integer tprid(-max_branch:-1,lmaxconfigs)
126 common/to_sprop/sprop,tprid126 common/to_sprop/sprop,tprid
127 integer lwgt(0:maxconfigs,maxinvar)
128 logical firsttime127 logical firsttime
129128
130 double precision xprop(3,nexternal),tprop(3,nexternal)129 double precision xprop(3,nexternal),tprop(3,nexternal)
@@ -132,7 +131,7 @@
132 integer imatch131 integer imatch
133 save maxwgt132 save maxwgt
134133
135 integer ninvar, nconfigs134 integer ninvar
136 135
137c136c
138c External137c External
@@ -142,6 +141,9 @@
142c141c
143c Global142c Global
144c143c
144 integer lwgt(0:maxconfigs,maxinvar)
145 common/to_lwgt/lwgt
146
145 double precision pmass(nexternal)147 double precision pmass(nexternal)
146 common/to_mass/ pmass148 common/to_mass/ pmass
147149
@@ -172,7 +174,6 @@
172 double precision stot,m1,m2174 double precision stot,m1,m2
173 common/to_stot/stot,m1,m2175 common/to_stot/stot,m1,m2
174176
175 save lwgt
176 save ndim,nfinal,nbranch,nparticles177 save ndim,nfinal,nbranch,nparticles
177178
178 integer jfig,k179 integer jfig,k
@@ -200,40 +201,7 @@
200c write(*,*) 'using iconfig',iconfig201c write(*,*) 'using iconfig',iconfig
201 if (firsttime) then202 if (firsttime) then
202 firsttime=.false.203 firsttime=.false.
203 do i=1,nexternal204 call configure_integral(this_config,mincfig, maxcfig, invar,maxwgt)
204 m(i)=pmass(i)
205 enddo
206c Set stot
207 if (nincoming.eq.1) then
208 stot=m(1)**2
209 else
210 m1=m(1)
211 m2=m(2)
212 if (abs(lpp(1)) .eq. 1 .or. abs(lpp(1)) .eq. 2) m1 = 0.938d0
213 if (abs(lpp(2)) .eq. 1 .or. abs(lpp(2)) .eq. 2) m2 = 0.938d0
214 if (abs(lpp(1)) .eq. 3) m1 = 0.000511d0
215 if (abs(lpp(2)) .eq. 3) m2 = 0.000511d0
216 if(ebeam(1).lt.m1) ebeam(1)=m1
217 if(ebeam(2).lt.m2) ebeam(2)=m2
218 pi1(0)=ebeam(1)
219 pi1(3)=sqrt(max(ebeam(1)**2-m1**2, 0d0))
220 pi2(0)=ebeam(2)
221 pi2(3)=-sqrt(max(ebeam(2)**2-m2**2, 0d0))
222 stot=m1**2+m2**2+2*(pi1(0)*pi2(0)-pi1(3)*pi2(3))
223 endif
224 write(*,'(x,a,f13.2)') 'Set CM energy to ',sqrt(stot)
225c Start graph mapping
226 do i=1,mapconfig(0)
227 if (mapconfig(i) .eq. iconfig) this_config=i
228 enddo
229 write(*,*) 'Mapping Graph',iconfig,' to config',this_config
230 iconfig = this_config
231 nconfigs = 1
232 mincfig=iconfig
233 maxcfig=iconfig
234 call map_invarients(minvar,nconfigs,ninvar,mincfig,maxcfig,nexternal,nincoming)
235 maxwgt=0d0
236c write(*,'(a,12i4)') 'Summing configs',(isym(i),i=1,isym(0))
237 nparticles = nexternal205 nparticles = nexternal
238 nfinal = nparticles-nincoming206 nfinal = nparticles-nincoming
239 nbranch = nparticles-2207 nbranch = nparticles-2
@@ -241,51 +209,10 @@
241 if (ndim .lt. 0) ndim = 0 !For 2->1 processes tjs 5/24/2010209 if (ndim .lt. 0) ndim = 0 !For 2->1 processes tjs 5/24/2010
242 if (abs(lpp(1)) .ge. 1) ndim=ndim+1210 if (abs(lpp(1)) .ge. 1) ndim=ndim+1
243 if (abs(lpp(2)) .ge. 1) ndim=ndim+1211 if (abs(lpp(2)) .ge. 1) ndim=ndim+1
244 call set_peaks212 do i=1,nexternal
245 if (.false. ) then213 m(i)=pmass(i)
246 call find_matches(iconfig,isym(0))214 enddo
247 write(*,'(a,12i4)') 'Summing configs',(isym(i),i=1,isym(0))
248 endif
249 if (.false.) then
250 i=1
251 do while (mapconfig(i) .ne. iconfig
252 $ .and. i .lt. mapconfig(0))
253 i=i+1
254 enddo
255 endif
256
257 write(*,'(a,12e10.3)') ' Masses:',(m(i),i=1,nparticles)215 write(*,'(a,12e10.3)') ' Masses:',(m(i),i=1,nparticles)
258 do j=1,invar
259 lwgt(0,j)=0
260 enddo
261c
262c Here we set up which diagrams contribute to each variable
263c in principle more than 1 diagram can contribute to a variable
264c if we believe they will have identical structure.
265c
266c do i=1,mapconfig(0)
267 do i=mincfig,maxcfig
268c do k=1,isym(0)
269c i = isym(k)
270 write(*,'(15i4)') i,(minvar(j,i),j=1,ndim)
271 do j=1,ndim
272 ipole = minvar(j,i)
273 if (ipole .ne. 0) then
274 n = lwgt(0,ipole)+1
275 lwgt(n,ipole)=mapconfig(i)
276 lwgt(0,ipole)=n
277 endif
278 enddo
279 enddo
280
281c Initialize dsig (needed for subprocess group running mode)
282 dum=dsig(0,0,1)
283
284 else
285 do i=1,11
286c swidth(i)=-5d0 !tells us to use the same point over again
287 enddo
288c swidth(10)=0d0
289 endif !First_time216 endif !First_time
290217
291 if (.false.) then218 if (.false.) then
@@ -301,24 +228,48 @@
301 xbk(2) = 1d0228 xbk(2) = 1d0
302 sjac = 1d0229 sjac = 1d0
303 if (abs(lpp(1)) .ge. 1 .and. abs(lpp(2)) .ge. 1) then230 if (abs(lpp(1)) .ge. 1 .and. abs(lpp(2)) .ge. 1) then
304 call sample_get_x(sjac,x(ndim-1),ndim-1,mincfig,0d0,1d0)231 if (abs(lpp(1)).eq.9.or.abs(lpp(2)).eq.9)then
232 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)
233 call sample_get_x(sjac,x(ndim-1),ndim-1,mincfig,0d0,1d0)
234 call get_dummy_x1_x2(sjac, Xbk(1), x(ndim-1),pi1, pi2, stot, s(-nbranch))
235 if (.not.set_cm_rap)then
236 cm_rap=.5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
237 set_cm_rap=.true.
238 endif
239 else
240 call sample_get_x(sjac,x(ndim-1),ndim-1,mincfig,0d0,1d0)
305c-----241c-----
306c tjs 5/24/2010 for 2->1 process242c tjs 5/24/2010 for 2->1 process
307c-------243c-------
308 xtau = x(ndim-1)244 xtau = x(ndim-1)
309 if(nexternal .eq. 3) then245 if(nexternal .eq. 3) then
310 x(ndim-1) = pmass(3)*pmass(3)/stot246 x(ndim-1) = pmass(3)*pmass(3)/stot
311 sjac=1 / stot !for delta function in d_tau247 sjac=1 / stot !for delta function in d_tau
248 endif
249
250 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)
251 CALL GENCMS(STOT,Xbk(1),Xbk(2),X(ndim-1), SMIN,SJAC)
252 x(ndim-1) = xtau !Fix for 2->1 process
253c Set CM rapidity for use in the rap() function
254 cm_rap=.5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
255 set_cm_rap=.true.
256c Set shat
257 s(-nbranch) = xbk(1)*xbk(2)*stot
312 endif258 endif
313259
260 elseif (lpp(1).eq.9.or.lpp(2).eq.9) then
314 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)261 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)
315 CALL GENCMS(STOT,Xbk(1),Xbk(2),X(ndim-1), SMIN,SJAC)262 if (lpp(1).eq.9)then
316 x(ndim-1) = xtau !Fix for 2->1 process263 call get_dummy_x1(sjac, xbk(1), x(ndim), pi1, pi2, stot, s(-nbranch))
317c Set CM rapidity for use in the rap() function264 xbk(2) = 1d0
318 cm_rap=.5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))265 else
319 set_cm_rap=.true.266 call get_dummy_x1(sjac, xbk(2), x(ndim), pi1, pi2, stot, s(-nbranch))
320c Set shat267 xbk(1) = 1d0
321 s(-nbranch) = xbk(1)*xbk(2)*stot268 endif
269 if (.not.set_cm_rap)then
270 cm_rap=.5d0*dlog(xbk(1)*ebeam(1)/(xbk(2)*ebeam(2)))
271 set_cm_rap=.true.
272 endif
322 elseif (abs(lpp(1)) .ge. 1) then273 elseif (abs(lpp(1)) .ge. 1) then
323 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)274 call sample_get_x(sjac,x(ndim),ndim,mincfig,0d0,1d0)
324 xbk(1) = x(ndim)275 xbk(1) = x(ndim)
@@ -360,7 +311,10 @@
360c311c
361c First Generate Momentum for initial state particles312c First Generate Momentum for initial state particles
362c313c
363 if(nincoming.eq.2) then314 if (lpp(1).eq.9.or.lpp(2).eq.9)then
315 p(:,1) = pi1(:)
316 p(:,2) = pi2(:)
317 else if(nincoming.eq.2) then
364 call mom2cx(m(-nbranch),m(1),m(2),1d0,0d0,p(0,1),p(0,2))318 call mom2cx(m(-nbranch),m(1),m(2),1d0,0d0,p(0,1),p(0,2))
365 else319 else
366 do i=0,3320 do i=0,3
@@ -548,6 +502,138 @@
548 end502 end
549503
550504
505 subroutine configure_integral(iconfig,mincfig,maxcfig,invar,maxwgt)
506c**************************************************************************
507c inputs iconfig == Current configuration working on
508c output m
509c**************************************************************************
510
511 implicit none
512
513 include 'genps.inc'
514 include 'maxconfigs.inc'
515 include 'nexternal.inc'
516 include 'maxamps.inc'
517 include 'run.inc'
518
519c local
520 double precision pi1(0:3),pi2(0:3),p0,p3
521 double precision dum
522 integer i,j,ipole,n
523 integer nbranch,ndim,nconfigs
524 integer ninvar
525 integer nparticles,nfinal
526
527
528c
529c Arguments
530c
531 integer iconfig,mincfig,maxcfig,invar
532 double precision maxwgt
533c
534c External
535c
536 double precision lambda,dot,dsig
537 logical passcuts
538
539
540 logical firsttime
541 data firsttime/.true./
542 save firsttime
543c
544c global
545c
546 double precision M(-max_branch:max_particles)
547
548 double precision pmass(nexternal)
549 common/to_mass/ pmass
550
551 double precision stot,m1,m2
552 common/to_stot/stot,m1,m2
553
554 integer mapconfig(0:lmaxconfigs), this_config
555 common/to_mconfigs/mapconfig, this_config
556
557 integer Minvar(maxdim,lmaxconfigs)
558 common /to_invar/ Minvar
559
560 integer lwgt(0:maxconfigs,maxinvar)
561 common/to_lwgt/lwgt
562
563 if (firsttime)then
564 firsttime=.false.
565 do i=1,nexternal
566 m(i)=pmass(i)
567 enddo
568c Set stot
569 if (nincoming.eq.1) then
570 stot=m(1)**2
571 else
572 m1=m(1)
573 m2=m(2)
574 if (abs(lpp(1)) .eq. 1 .or. abs(lpp(1)) .eq. 2) m1 = 0.938d0
575 if (abs(lpp(2)) .eq. 1 .or. abs(lpp(2)) .eq. 2) m2 = 0.938d0
576 if (abs(lpp(1)) .eq. 3) m1 = 0.000511d0
577 if (abs(lpp(2)) .eq. 3) m2 = 0.000511d0
578 if(ebeam(1).lt.m1.and.lpp(1).ne.9) ebeam(1)=m1
579 if(ebeam(2).lt.m2.and.lpp(2).ne.9) ebeam(2)=m2
580 pi1(0)=ebeam(1)
581 pi1(3)=sqrt(max(ebeam(1)**2-m1**2, 0d0))
582 pi2(0)=ebeam(2)
583 pi2(3)=-sqrt(max(ebeam(2)**2-m2**2, 0d0))
584 stot=m1**2+m2**2+2*(pi1(0)*pi2(0)-pi1(3)*pi2(3))
585 endif
586 write(*,'(x,a,f13.2)') 'Set CM energy to ',sqrt(stot)
587 endif
588c Start graph mapping
589 do i=1,mapconfig(0)
590 if (mapconfig(i) .eq. iconfig) this_config=i
591 enddo
592 write(*,*) 'Mapping Graph',iconfig,' to config',this_config
593 iconfig = this_config
594 nconfigs = 1
595 mincfig=iconfig
596 maxcfig=iconfig
597 call map_invarients(minvar,nconfigs,ninvar,mincfig,maxcfig,nexternal,nincoming)
598 maxwgt=0d0
599c write(*,'(a,12i4)') 'Summing configs',(isym(i),i=1,isym(0))
600 nparticles = nexternal
601 nfinal = nparticles-nincoming
602 nbranch = nparticles-2
603 ndim = 3*nfinal-4
604 if (ndim .lt. 0) ndim = 0 !For 2->1 processes tjs 5/24/2010
605 if (abs(lpp(1)) .ge. 1) ndim=ndim+1
606 if (abs(lpp(2)) .ge. 1) ndim=ndim+1
607 call set_peaks
608 do j=1,invar
609 lwgt(0,j)=0
610 enddo
611c
612c Here we set up which diagrams contribute to each variable
613c in principle more than 1 diagram can contribute to a variable
614c if we believe they will have identical structure.
615c
616c do i=1,mapconfig(0)
617 do i=mincfig,maxcfig
618c do k=1,isym(0)
619c i = isym(k)
620 write(*,'(15i4)') i,(minvar(j,i),j=1,ndim)
621 do j=1,ndim
622 ipole = minvar(j,i)
623 if (ipole .ne. 0) then
624 n = lwgt(0,ipole)+1
625 lwgt(n,ipole)=mapconfig(i)
626 lwgt(0,ipole)=n
627 endif
628 enddo
629 enddo
630
631c Initialize dsig (needed for subprocess group running mode)
632 dum=dsig(0,0,1)
633
634 return
635 end
636
551 subroutine one_tree(itree,iconfig,nbranch,P,M,S,X,jac,pswgt)637 subroutine one_tree(itree,iconfig,nbranch,P,M,S,X,jac,pswgt)
552c************************************************************************638c************************************************************************
553c Calculates the momentum for everything below in the tree until639c Calculates the momentum for everything below in the tree until
@@ -1180,3 +1266,7 @@
1180 X2 = SQRT(TAU)*EXP(-ETA)1266 X2 = SQRT(TAU)*EXP(-ETA)
11811267
1182 END1268 END
1269
1270
1271
1272
11831273
=== modified file 'Template/LO/SubProcesses/makefile'
--- Template/LO/SubProcesses/makefile 2017-03-13 20:27:08 +0000
+++ Template/LO/SubProcesses/makefile 2017-08-16 21:26:30 +0000
@@ -32,7 +32,7 @@
3232
33PROCESS= driver.o myamp.o genps.o unwgt.o setcuts.o get_color.o \33PROCESS= driver.o myamp.o genps.o unwgt.o setcuts.o get_color.o \
34 cuts.o cluster.o reweight.o initcluster.o addmothers.o setscales.o \34 cuts.o cluster.o reweight.o initcluster.o addmothers.o setscales.o \
35 idenparts.o \35 idenparts.o dummy_fct.o \
36 $(patsubst %.f,%.o,$(wildcard auto_dsig*.f)) \36 $(patsubst %.f,%.o,$(wildcard auto_dsig*.f)) \
37 $(patsubst %.f,%.o,$(wildcard matrix*.f))37 $(patsubst %.f,%.o,$(wildcard matrix*.f))
3838
@@ -64,6 +64,7 @@
64driver.f: genps.inc64driver.f: genps.inc
65symmetry.o: genps.inc nexternal.inc configs.inc run_config.inc65symmetry.o: genps.inc nexternal.inc configs.inc run_config.inc
66genps.o: genps.inc nexternal.inc configs.inc66genps.o: genps.inc nexternal.inc configs.inc
67dummy_fct.0: run.inc genps.inc
67cuts.o: genps.inc nexternal.inc pmass.inc68cuts.o: genps.inc nexternal.inc pmass.inc
68setcuts.o: genps.inc run_config.inc69setcuts.o: genps.inc run_config.inc
69invarients.o: genps.inc nexternal.inc70invarients.o: genps.inc nexternal.inc
7071
=== modified file 'Template/LO/SubProcesses/refine.sh'
--- Template/LO/SubProcesses/refine.sh 2016-06-12 00:01:23 +0000
+++ Template/LO/SubProcesses/refine.sh 2017-08-16 21:26:30 +0000
@@ -89,7 +89,7 @@
89 if [ "$keeplog" = true ] ; then89 if [ "$keeplog" = true ] ; then
90 echo "" >> $k; echo "ls status:" >> $k; ls >> $k 90 echo "" >> $k; echo "ls status:" >> $k; ls >> $k
91 else91 else
92 rm ftn26 > /dev/null92 rm ftn26 &> /dev/null
93 fi93 fi
9494
9595
9696
=== modified file 'Template/LO/SubProcesses/unwgt.f'
--- Template/LO/SubProcesses/unwgt.f 2016-09-03 13:26:00 +0000
+++ Template/LO/SubProcesses/unwgt.f 2017-08-16 21:26:30 +0000
@@ -603,7 +603,7 @@
603 if (nincoming.eq.2) then603 if (nincoming.eq.2) then
604 if (xbk(1) .gt. 0d0 .and. xbk(1) .le. 1d0 .and.604 if (xbk(1) .gt. 0d0 .and. xbk(1) .le. 1d0 .and.
605 $ xbk(2) .gt. 0d0 .and. xbk(2) .le. 1d0) then605 $ xbk(2) .gt. 0d0 .and. xbk(2) .le. 1d0) then
606 if(xbk(1).eq.1d0.or.pmass(1).eq.0d0) then606 if(lpp(2).ne.0.and.(xbk(1).eq.1d0.or.pmass(1).eq.0d0)) then
607 ! construct the beam momenta in each frame and compute the related (z)boost607 ! construct the beam momenta in each frame and compute the related (z)boost
608 ebi(0) = p(0,1)/xbk(1) ! this assumes that particle 1 is massless or mass equal to beam608 ebi(0) = p(0,1)/xbk(1) ! this assumes that particle 1 is massless or mass equal to beam
609 ebi(1) = 0609 ebi(1) = 0
610610
=== modified file 'Template/NLO/Cards/run_card.dat'
--- Template/NLO/Cards/run_card.dat 2016-09-08 23:15:34 +0000
+++ Template/NLO/Cards/run_card.dat 2017-08-16 21:26:30 +0000
@@ -36,7 +36,7 @@
36# Normalize the weights of LHE events such that they sum or average to *36# Normalize the weights of LHE events such that they sum or average to *
37# the total cross section *37# the total cross section *
38#***********************************************************************38#***********************************************************************
39 %(event_norm)s = event_norm ! average or sum39 %(event_norm)s = event_norm ! valid settings: average, sum, bias
40#***********************************************************************40#***********************************************************************
41# Number of points per itegration channel (ignored for aMC@NLO runs) *41# Number of points per itegration channel (ignored for aMC@NLO runs) *
42#***********************************************************************42#***********************************************************************
4343
=== modified file 'Template/NLO/Cards/shower_card.dat'
--- Template/NLO/Cards/shower_card.dat 2016-02-19 13:21:36 +0000
+++ Template/NLO/Cards/shower_card.dat 2017-08-16 21:26:30 +0000
@@ -27,7 +27,7 @@
27#***********************************************************************27#***********************************************************************
28# PDFs and non-perturbative modelling *28# PDFs and non-perturbative modelling *
29#***********************************************************************29#***********************************************************************
30pdfcode = 0 # 0 = internal, 1 = same as NLO, other = lhaglue30pdfcode = 1 # 0 = internal, 1 = same as NLO, other = lhaglue
31ue_enabled = F # underlying event31ue_enabled = F # underlying event
32hadronize = T # hadronisation on/off !IGNORED BY HERWIG6!32hadronize = T # hadronisation on/off !IGNORED BY HERWIG6!
33lambda_5 = -1 # Lambda_5 (< 0 = default) !IGNORED BY PYTHIA8!33lambda_5 = -1 # Lambda_5 (< 0 = default) !IGNORED BY PYTHIA8!
3434
=== modified file 'Template/NLO/FixedOrderAnalysis/HwU.f'
--- Template/NLO/FixedOrderAnalysis/HwU.f 2017-02-03 13:37:36 +0000
+++ Template/NLO/FixedOrderAnalysis/HwU.f 2017-08-16 21:26:30 +0000
@@ -1,7 +1,7 @@
1CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC1CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
2C C2C C
3C HwU: Histograms with Uncertainties C3C HwU: Histograms with Uncertainties C
4C By Rikkert Frederix, Dec. 2014 C4C By Rikkert Frederix, 12-2014--05-2017 C
5C C5C C
6C Book, fill and write out histograms. Particularly suited for NLO C6C Book, fill and write out histograms. Particularly suited for NLO C
7C computations with correlations between points (ie. event and C7C computations with correlations between points (ie. event and C
@@ -9,26 +9,41 @@
9C and PDF uncertainties through reweighting). C9C and PDF uncertainties through reweighting). C
10C C10C C
11CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC11CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
12
13c The module contains effectively the common block with allocatable
14c variables (something not possible in old fortran version)
15 module HwU_variables
16 implicit none
17 integer :: max_plots,max_points,max_bins,nwgts,np
18 integer :: error_estimation=3
19 logical, allocatable :: booked(:)
20 integer, allocatable :: nbin(:),histi(:,:),p_bin(:),p_label(:)
21 character(len=50), allocatable :: title(:)
22 character(len=50), allocatable :: wgts_info(:)
23 double precision, allocatable :: histy(:,:,:),histy_acc(:,:,:)
24 $ ,histy2(:,:),histy_err(:,:),histxl(:,:),histxm(:,:)
25 $ ,step(:),p_wgts(:,:)
26 save
27 end module HwU_variables
28
12 29
13c To be called once at the start of each run. Initialises the packages30c To be called once at the start of each run. Initialises the packages
14c and sets the number of weights that need to be included for each point.31c and sets the number of weights that need to be included for each point.
15 subroutine HwU_inithist(nweights,wgt_info)32 subroutine HwU_inithist(nweights,wgt_info)
33 use HwU_variables
16 implicit none34 implicit none
17 include "HwU.inc"
18 integer i,nweights35 integer i,nweights
19 character*(*) wgt_info(*)36 character*(*) wgt_info(*)
20 do i=1,max_plots37 call HwU_deallocate_all
21 booked(i)=.false.38 max_plots=0
22 enddo39 max_points=0
40 max_bins=0
41 np=0
23c Number of weights associated to each point. Note that the first42c Number of weights associated to each point. Note that the first
24c weight should always be the 'central value' and it should not be43c weight should always be the 'central value' and it should not be
25c zero if any of the other weights are non-zero.44c zero if any of the other weights are non-zero.
26 nwgts=nweights45 nwgts=nweights
27 if (nwgts.gt.max_wgts) then46 allocate(wgts_info(nwgts))
28 write (*,*) 'ERROR: increase max_wgts in HwU histogramming'
29 $ ,max_wgts,nwgts
30 stop 1
31 endif
32 do i=1,nwgts47 do i=1,nwgts
33 wgts_info(i)=wgt_info(i)48 wgts_info(i)=wgt_info(i)
34 enddo49 enddo
@@ -48,10 +63,9 @@
48c square root of the sum of the squares. Perform a weighted average63c square root of the sum of the squares. Perform a weighted average
49c iteration-by-iteration64c iteration-by-iteration
50c input 3: Same as input 2, but weighted average is same as from MINT65c input 3: Same as input 2, but weighted average is same as from MINT
66 use HwU_variables
51 implicit none67 implicit none
52 integer input68 integer input
53 integer error_estimation
54 common /HwU_common2/ error_estimation
55 if (input.ge.0 .and. input.le.3) then69 if (input.ge.0 .and. input.le.3) then
56 error_estimation=input70 error_estimation=input
57 else71 else
@@ -60,39 +74,20 @@
60 endif74 endif
61 return75 return
62 end76 end
63 77
64 block data HwU
65c set the default for the error estimation method. To reduce the size of
66c the executable, put the error_estimation variable in a separate common
67c block. If we would have included the 'HwU.inc' file here, that
68c complete common block seems to be included in the size executable
69c (approx. 110 MB).
70 integer error_estimation
71 common /HwU_common2/ error_estimation
72 data error_estimation /3/
73 end
74
75c Book the histograms at the start of the run. Give a 'label' (an78c Book the histograms at the start of the run. Give a 'label' (an
76c integer) that identifies the plot when filling it and a title79c integer) that identifies the plot when filling it and a title
77c ('title_l') for each plot. Also the number of bins ('nbin_l') and the80c ('title_l') for each plot. Also the number of bins ('nbin_l') and the
78c plot range (from 'xmin' to 'xmax') should be given.81c plot range (from 'xmin' to 'xmax') should be given.
79 subroutine HwU_book(label,title_l,nbin_l,xmin,xmax)82 subroutine HwU_book(label,title_l,nbin_l,xmin,xmax)
83 use HwU_variables
80 implicit none84 implicit none
81 include "HwU.inc"
82 integer label,nbin_l,i,j85 integer label,nbin_l,i,j
83 character*(*) title_l86 character*(*) title_l
84 double precision xmin,xmax87 double precision xmin,xmax
85c Check that label and number of bins are reasonable88c Allocate space for new histograms if needed
86 if (label.gt.max_plots) then89 call HwU_allocate_histo(label,nbin_l)
87 write (*,*) 'ERROR: increase max_plots in HwU histogramming'90c Setup the histogram
88 $ ,max_plots, label
89 stop 1
90 endif
91 if (nbin_l.gt.max_bins) then
92 write (*,*) 'ERROR: increase max_bins in HwU histogramming'
93 $ ,max_bins,nbin_l
94 stop 1
95 endif
96 booked(label)=.true.91 booked(label)=.true.
97 title(label)=title_l92 title(label)=title_l
98 nbin(label)=nbin_l93 nbin(label)=nbin_l
@@ -111,7 +106,6 @@
111 histy2(label,i)=0d0106 histy2(label,i)=0d0
112 histy_err(label,i)=0d0107 histy_err(label,i)=0d0
113 enddo108 enddo
114 np=0
115 return109 return
116 end110 end
117 111
@@ -121,8 +115,8 @@
121c the 'HwU_inithist' subroutine. That means that each point should have115c the 'HwU_inithist' subroutine. That means that each point should have
122c the same number of weights.116c the same number of weights.
123 subroutine HwU_fill(label,x,wgts)117 subroutine HwU_fill(label,x,wgts)
118 use HwU_variables
124 implicit none119 implicit none
125 include "HwU.inc"
126 integer label,i,j,bin120 integer label,i,j,bin
127 double precision x, wgts(*)121 double precision x, wgts(*)
128c If central weight is zero do not add this point.122c If central weight is zero do not add this point.
@@ -147,11 +141,7 @@
147 enddo141 enddo
148c If a new bin, add it to the list of points142c If a new bin, add it to the list of points
149 np=np+1143 np=np+1
150 if (np.gt.max_points) then144 call HwU_allocate_p
151 write (*,*) 'ERROR: increase max_points in HwU histogramming'
152 $ ,max_points
153 stop 1
154 endif
155 p_label(np)=label145 p_label(np)=label
156 p_bin(np)=bin146 p_bin(np)=bin
157 do j=1,nwgts147 do j=1,nwgts
@@ -159,7 +149,7 @@
159 enddo149 enddo
160 return150 return
161 end151 end
162152
163c Call after all correlated contributions for a give phase-space153c Call after all correlated contributions for a give phase-space
164c point. I.e., every time you get a new set of random numbers from154c point. I.e., every time you get a new set of random numbers from
165c MINT/VEGAS. It adds the current list of points to the histograms. Add155c MINT/VEGAS. It adds the current list of points to the histograms. Add
@@ -168,8 +158,8 @@
168c this way, correlations between events and counter-events can be158c this way, correlations between events and counter-events can be
169c correctly taken into account.159c correctly taken into account.
170 subroutine HwU_add_points160 subroutine HwU_add_points
161 use HwU_variables
171 implicit none162 implicit none
172 include "HwU.inc"
173 integer i,j163 integer i,j
174 do i=1,np164 do i=1,np
175 do j=1,nwgts165 do j=1,nwgts
@@ -192,12 +182,11 @@
192c the current iteration so that they can be filled with the next182c the current iteration so that they can be filled with the next
193c iteration.183c iteration.
194 subroutine HwU_accum_iter(inclde,nPSpoints,values)184 subroutine HwU_accum_iter(inclde,nPSpoints,values)
185 use HwU_variables
195 implicit none186 implicit none
196 include "HwU.inc"
197 logical inclde187 logical inclde
198 integer nPSpoints,label,i,j188 integer nPSpoints,label,i,j
199 double precision nPSinv,etot,vtot(max_wgts),niter,y_squared189 double precision nPSinv,etot,niter,y_squared,values(2)
200 $ ,values(2)
201 data niter /0d0/190 data niter /0d0/
202 nPSinv = 1d0/dble(nPSpoints)191 nPSinv = 1d0/dble(nPSpoints)
203 if (inclde) niter = niter+1d0192 if (inclde) niter = niter+1d0
@@ -226,8 +215,8 @@
226c intermediate stages this function can be called (together with215c intermediate stages this function can be called (together with
227c HwU_output) to write intermediate plots to disk.216c HwU_output) to write intermediate plots to disk.
228 subroutine finalize_histograms(nPSpoints)217 subroutine finalize_histograms(nPSpoints)
218 use HwU_variables
229 implicit none219 implicit none
230 include "HwU.inc"
231 integer label,nPSpoints,i,j220 integer label,nPSpoints,i,j
232 double precision nPSinv,niter,dummy(2)221 double precision nPSinv,niter,dummy(2)
233 nPSinv=1d0/dble(nPSpoints)222 nPSinv=1d0/dble(nPSpoints)
@@ -257,13 +246,13 @@
257c histograms the central value should not be zero if any of the other246c histograms the central value should not be zero if any of the other
258c weights are non-zero.247c weights are non-zero.
259 subroutine accumulate_results(label,nPSinv,niter,values)248 subroutine accumulate_results(label,nPSinv,niter,values)
249 use HwU_variables
260 implicit none250 implicit none
261 include "HwU.inc"
262 integer label,i,j251 integer label,i,j
263 double precision nPSinv,etot,vtot(max_wgts),niter,y_squared252 double precision nPSinv,etot,niter,y_squared
264 $ ,values(2),a1,a2253 $ ,values(2),a1,a2
265 integer error_estimation254 double precision,allocatable :: vtot(:)
266 common /HwU_common2/ error_estimation255 if (.not. allocated(vtot)) allocate(vtot(nwgts))
267 if (error_estimation.eq.2) then256 if (error_estimation.eq.2) then
268c Use the weighted average bin-by-bin. This is not really justified257c Use the weighted average bin-by-bin. This is not really justified
269c for fNLO computations, because for bins with low statistics, the258c for fNLO computations, because for bins with low statistics, the
@@ -395,14 +384,15 @@
395c Write the histograms to disk at the end of the run, multiplying the384c Write the histograms to disk at the end of the run, multiplying the
396c output by 'xnorm'385c output by 'xnorm'
397 subroutine HwU_output(unit,xnorm)386 subroutine HwU_output(unit,xnorm)
387 use HwU_variables
398 implicit none388 implicit none
399 include "HwU.inc"
400 integer unit,i,j,label389 integer unit,i,j,label
401 integer max_length390 integer max_length
402 parameter (max_length=(max_wgts+3)*17)391 character(len=:), allocatable :: buffer
403 character*(max_length) buffer
404 character*4 str_nbin392 character*4 str_nbin
405 double precision xnorm393 double precision xnorm
394 if (.not. allocated(buffer))
395 & allocate(character(len=(nwgts+3)*17) :: buffer)
406c column info: x_min, x_max, y (central value), dy, {extra396c column info: x_min, x_max, y (central value), dy, {extra
407c weights}.397c weights}.
408 write (unit,'(a$)') '##& xmin'398 write (unit,'(a$)') '##& xmin'
@@ -440,9 +430,156 @@
440 write (unit,'(a)') ''430 write (unit,'(a)') ''
441 write (unit,'(a)') '' 431 write (unit,'(a)') ''
442 enddo432 enddo
443 return433 deallocate(buffer)
444 end434 return
445435 end
436
437c Clean all the allocatable variables:
438 subroutine HwU_deallocate_all
439 use HwU_variables
440 implicit none
441 if (allocated(wgts_info)) deallocate(wgts_info)
442 if (allocated(booked)) deallocate(booked)
443 if (allocated(title)) deallocate(title)
444 if (allocated(nbin)) deallocate(nbin)
445 if (allocated(step)) deallocate(step)
446 if (allocated(histxl)) deallocate(histxl)
447 if (allocated(histxm)) deallocate(histxm)
448 if (allocated(histy)) deallocate(histy)
449 if (allocated(histy_acc)) deallocate(histy_acc)
450 if (allocated(histi)) deallocate(histi)
451 if (allocated(histy2)) deallocate(histy2)
452 if (allocated(histy_err)) deallocate(histy_err)
453 if (allocated(p_bin)) deallocate(p_bin)
454 if (allocated(p_label)) deallocate(p_label)
455 if (allocated(p_wgts)) deallocate(p_wgts)
456 return
457 end
458
459
460 subroutine HwU_allocate_p
461 use HwU_variables
462 implicit none
463 integer,allocatable :: itemp1(:)
464 double precision, allocatable :: temp2(:,:)
465 if (.not. allocated(p_bin)) then
466 allocate(p_bin(max_plots))
467 allocate(p_label(max_plots))
468 allocate(p_wgts(nwgts,max_plots))
469 max_points=max_plots
470 else
471 if (np.gt.max_points) then
472c p_bin
473 allocate(itemp1(np+max_plots))
474 itemp1(1:max_points)=p_bin
475 call move_alloc(itemp1,p_bin)
476
477c p_label
478 allocate(itemp1(np+max_plots))
479 itemp1(1:max_points)=p_label
480 call move_alloc(itemp1,p_label)
481c p_wgts
482 allocate(temp2(nwgts,np+max_plots))
483 temp2(1:nwgts,1:max_points)=p_wgts
484 call move_alloc(temp2,p_wgts)
485 max_points=np+max_plots
486 endif
487 endif
488 return
489 end
490
491 subroutine HwU_allocate_histo(label,nbin_l)
492 use HwU_variables
493 implicit none
494 logical,allocatable :: ltemp(:)
495 integer,allocatable :: itemp1(:),itemp2(:,:)
496 character(len=50),allocatable :: ctemp(:)
497 double precision, allocatable :: temp1(:),temp2(:,:),temp3(:,:,:)
498 integer label,i,nbin_l,label_max,nbin_max
499 logical debug
500 parameter (debug=.true.)
501c Check if variables are already allocated. If not, simply allocate a
502c single histogram
503 if (.not. allocated(booked)) then
504 allocate(booked(1))
505 booked(1)=.false.
506 allocate(title(1))
507 allocate(nbin(1))
508 allocate(step(1))
509 allocate(histxl(1,nbin_l))
510 allocate(histxm(1,nbin_l))
511 allocate(histy(nwgts,1,nbin_l))
512 allocate(histy_acc(nwgts,1,nbin_l))
513 allocate(histi(1,nbin_l))
514 allocate(histy2(1,nbin_l))
515 allocate(histy_err(1,nbin_l))
516 max_plots=1
517 max_bins=nbin_l
518 endif
519c If current label is greater than the plots already allocated, increase
520c the size of the allocated arrays. This is kind of slow, but shouldn't
521c really matter since it's only done at the start of a run.
522 if (label.gt.max_plots .or. nbin_l.gt.max_bins) then
523 label_max=max(label,max_plots)
524 nbin_max=max(nbin_l,max_bins)
525c booked
526 allocate(ltemp(label_max))
527 ltemp(1:max_plots)=booked
528 call move_alloc(ltemp,booked)
529 do i=max_plots+1,label_max
530 booked(i)=.false. ! histos have not yet been setup
531 enddo
532c title
533 allocate(ctemp(label_max))
534 ctemp(1:max_plots)=title
535 call move_alloc(ctemp,title)
536c nbin
537 allocate(itemp1(label_max))
538 itemp1(1:max_plots)=nbin
539 call move_alloc(itemp1,nbin)
540c step
541 allocate(temp1(label_max))
542 temp1(1:max_plots)=step
543 call move_alloc(temp1,step)
544c histxl
545 allocate(temp2(label_max,nbin_max))
546 temp2(1:max_plots,1:max_bins)=histxl
547 call move_alloc(temp2,histxl)
548c histxm
549 allocate(temp2(label_max,nbin_max))
550 temp2(1:max_plots,1:max_bins)=histxm
551 call move_alloc(temp2,histxm)
552c histy
553 allocate(temp3(nwgts,label_max,nbin_max))
554 temp3(1:nwgts,1:max_plots,1:max_bins)=histy
555 call move_alloc(temp3,histy)
556c histy_acc
557 allocate(temp3(nwgts,label_max,nbin_max))
558 temp3(1:nwgts,1:max_plots,1:max_bins)=histy_acc
559 call move_alloc(temp3,histy_acc)
560c histi
561 allocate(itemp2(label_max,nbin_max))
562 itemp2(1:max_plots,1:max_bins)=histi
563 call move_alloc(itemp2,histi)
564c histy2
565 allocate(temp2(label_max,nbin_max))
566 temp2(1:max_plots,1:max_bins)=histy2
567 call move_alloc(temp2,histy2)
568c histy_err
569 allocate(temp2(label_max,nbin_max))
570 temp2(1:max_plots,1:max_bins)=histy_err
571 call move_alloc(temp2,histy_err)
572c Update maximums
573 max_plots=label_max
574 max_bins=nbin_max
575 elseif (booked(label)) then
576 write (*,*) 'ERROR in HwU.f: histogram already booked',label
577 stop
578 endif
579 return
580 end
581
582
446c dummy subroutine583c dummy subroutine
447 subroutine accum(idummy)584 subroutine accum(idummy)
448 integer idummy585 integer idummy
@@ -451,3 +588,6 @@
451 subroutine addfil(string)588 subroutine addfil(string)
452 character*(*) string589 character*(*) string
453 end590 end
591
592
593
454594
=== removed file 'Template/NLO/FixedOrderAnalysis/HwU.inc'
--- Template/NLO/FixedOrderAnalysis/HwU.inc 2016-02-18 14:05:45 +0000
+++ Template/NLO/FixedOrderAnalysis/HwU.inc 1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
1* -*-fortran-*-
2
3 integer max_plots,max_bins,max_wgts,max_points
4 parameter (max_plots=200)
5 parameter (max_bins=100)
6 parameter (max_wgts=1024)
7 parameter (max_points=max_plots*40)
8
9 logical booked(max_plots)
10 integer nbin(max_plots),nwgts,np,p_bin(max_points)
11 & ,p_label(max_points),histi(max_plots,max_bins)
12 character*50 title(max_plots)
13 character*50 wgts_info(max_wgts)
14 double precision histy(max_wgts,max_plots,max_bins)
15 $ ,histy_acc(max_wgts,max_plots,max_bins),histy2(max_plots
16 $ ,max_bins),histy_err(max_plots,max_bins),histxl(max_plots
17 $ ,max_bins),histxm(max_plots,max_bins),step(max_plots)
18 $ ,p_wgts(max_wgts,max_points)
19
20 common/HwU_common/histy,histy_acc,histy2,histy_err,histxl,histxm
21 & ,p_wgts,step,histi,nbin,p_bin,p_label,np,nwgts
22 & ,booked,title,wgts_info
230
=== modified file 'Template/NLO/FixedOrderAnalysis/analysis_HwU_template.f'
--- Template/NLO/FixedOrderAnalysis/analysis_HwU_template.f 2014-12-03 11:51:14 +0000
+++ Template/NLO/FixedOrderAnalysis/analysis_HwU_template.f 2017-08-16 21:26:30 +0000
@@ -17,12 +17,12 @@
17c o) The first argument is an integer that labels the histogram. In17c o) The first argument is an integer that labels the histogram. In
18c the analysis_end and analysis_fill subroutines this label is used18c the analysis_end and analysis_fill subroutines this label is used
19c to keep track of the histogram. The label should be a number19c to keep track of the histogram. The label should be a number
20c between 1 and max_plots=200 (can be increased in HwU.inc).20c starting at 1 and be increased for each plot.
21c o) The second argument is a string that will apear above the21c o) The second argument is a string that will apear above the
22c histogram. Do not use brackets "(" or ")" inside this string.22c histogram. Do not use brackets "(" or ")" inside this string.
23c o) The third, forth and fifth arguments are the number of bis, the23c o) The third, forth and fifth arguments are the number of bis, the
24c lower edge of the first bin and the upper edge of the last24c lower edge of the first bin and the upper edge of the last
25c bin. There is a maximum of 100 bins per histogram.25c bin.
26c o) When including scale and/or PDF uncertainties, declare a26c o) When including scale and/or PDF uncertainties, declare a
27c histogram for each weight, and compute the uncertainties from the27c histogram for each weight, and compute the uncertainties from the
28c final set of histograms28c final set of histograms
2929
=== removed symlink 'Template/NLO/MCatNLO/include/HwU.inc'
=== target was u'../../FixedOrderAnalysis/HwU.inc'
=== modified symlink 'Template/NLO/MCatNLO/include/reweight0.inc'
=== target was u'../../SubProcesses/reweight0.inc'
--- Template/NLO/MCatNLO/include/reweight0.inc 1970-01-01 00:00:00 +0000
+++ Template/NLO/MCatNLO/include/reweight0.inc 2017-08-16 21:26:30 +0000
@@ -0,0 +1,3 @@
1 integer max_weight_shower,maxscales,maxPDFs
2 parameter (max_weight_shower=1024,maxscales=9,maxPDFs=200)
3 integer iwgtnumpartn,jwgtinfo,mexternal
04
=== modified file 'Template/NLO/MCatNLO/srcHerwig/madfks_hwdriver.f'
--- Template/NLO/MCatNLO/srcHerwig/madfks_hwdriver.f 2014-12-09 10:04:28 +0000
+++ Template/NLO/MCatNLO/srcHerwig/madfks_hwdriver.f 2017-08-16 21:26:30 +0000
@@ -323,7 +323,7 @@
323C---EVENTS ARE NORMALIZED TO SUM OR AVERAGE TO THE TOTAL CROSS SECTION323C---EVENTS ARE NORMALIZED TO SUM OR AVERAGE TO THE TOTAL CROSS SECTION
324 WRITE(*,*)'How are the events normalized ("average" or "sum")?'324 WRITE(*,*)'How are the events normalized ("average" or "sum")?'
325 READ(*,*)NORM_EVENT325 READ(*,*)NORM_EVENT
326 if (NORM_EVENT.eq.'average')MQQ=1326 if (NORM_EVENT(1:3).ne.'sum')MQQ=1
327327
328 MSFLAG=0328 MSFLAG=0
329 IF (LHSOFT) THEN329 IF (LHSOFT) THEN
@@ -397,3 +397,21 @@
397 CALL RCLOS()397 CALL RCLOS()
398 999 STOP398 999 STOP
399 END399 END
400
401
402c dummy routines for stdhep
403 SUBROUTINE PYERRM(MERR,CHMESS)
404 implicit none
405 integer MERR
406 CHARACTER CHMESS*(*)
407 write(*,*)'dummy PYERRM should never be called from HW6'
408 stop
409 end
410
411
412 FUNCTION PYCOMP(KF)
413 implicit none
414 integer KF,PYCOMP
415 write(*,*)'dummy PYCOMP should never be called from HW6'
416 stop
417 end
400418
=== modified file 'Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f'
--- Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2017-01-17 07:54:00 +0000
+++ Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2017-08-16 21:26:30 +0000
@@ -80,7 +80,6 @@
80 read(iunit,'(a)')string ! <rwgt>80 read(iunit,'(a)')string ! <rwgt>
81 enddo81 enddo
82 if(index(string,'</event>').eq.0)then82 if(index(string,'</event>').eq.0)then
83 wgtref=XWGTUP/MQQ
84 do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights83 do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights
85 call read_rwgt_line_wgt(iunit,ww(iww))84 call read_rwgt_line_wgt(iunit,ww(iww))
86 enddo85 enddo
8786
=== modified file 'Template/NLO/MCatNLO/srcPythia/madfks_pydriver.f'
--- Template/NLO/MCatNLO/srcPythia/madfks_pydriver.f 2014-11-27 15:36:48 +0000
+++ Template/NLO/MCatNLO/srcPythia/madfks_pydriver.f 2017-08-16 21:26:30 +0000
@@ -318,7 +318,7 @@
318C---EVENTS ARE NORMALIZED TO SUM OR AVERAGE TO THE TOTAL CROSS SECTION318C---EVENTS ARE NORMALIZED TO SUM OR AVERAGE TO THE TOTAL CROSS SECTION
319 WRITE(*,*)'How are the events normalized ("average" or "sum")?'319 WRITE(*,*)'How are the events normalized ("average" or "sum")?'
320 READ(*,*)NORM_EVENT320 READ(*,*)NORM_EVENT
321 if (NORM_EVENT.eq.'average')MQQ=1321 if (NORM_EVENT(1:3).ne.'sum')MQQ=1
322322
323C---USER'S INITIAL CALCULATIONS323C---USER'S INITIAL CALCULATIONS
324 CALL PYABEG324 CALL PYABEG
325325
=== modified file 'Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f'
--- Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f 2016-03-21 08:45:42 +0000
+++ Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f 2017-08-16 21:26:30 +0000
@@ -80,7 +80,6 @@
80 if(jwgtinfo.eq.9)then80 if(jwgtinfo.eq.9)then
81 if (nwgt.gt.1) then81 if (nwgt.gt.1) then
82 read(iunit,'(a)')string ! <rwgt>82 read(iunit,'(a)')string ! <rwgt>
83 wgtref=XWGTUP/MQQ
84 do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights83 do iww=2,nwgt ! start at 2, because 'central value' is not part of the extra weights
85 call read_rwgt_line_wgt(iunit,ww(iww))84 call read_rwgt_line_wgt(iunit,ww(iww))
86 enddo85 enddo
8786
=== modified file 'Template/NLO/MCatNLO/srcPythia8/Pythia8.cc'
--- Template/NLO/MCatNLO/srcPythia8/Pythia8.cc 2016-02-23 11:25:37 +0000
+++ Template/NLO/MCatNLO/srcPythia8/Pythia8.cc 2017-08-16 21:26:30 +0000
@@ -58,7 +58,7 @@
58 int iEventshower=pythia.mode("Main:spareMode1");58 int iEventshower=pythia.mode("Main:spareMode1");
59 string evt_norm=pythia.word("Main:spareWord1");59 string evt_norm=pythia.word("Main:spareWord1");
60 int iEventtot_norm=iEventtot;60 int iEventtot_norm=iEventtot;
61 if (evt_norm == "average"){61 if (evt_norm != "sum"){
62 iEventtot_norm=1;62 iEventtot_norm=1;
63 }63 }
6464
@@ -112,7 +112,7 @@
112 double normhepmc;112 double normhepmc;
113 // Add the weight of the current event to the cross section.113 // Add the weight of the current event to the cross section.
114 normhepmc = 1. / double(iEventshower);114 normhepmc = 1. / double(iEventshower);
115 if (evt_norm == "average") {115 if (evt_norm != "sum") {
116 sigmaTotal += evtweight*normhepmc;116 sigmaTotal += evtweight*normhepmc;
117 } else {117 } else {
118 sigmaTotal += evtweight*normhepmc*iEventtot;118 sigmaTotal += evtweight*normhepmc*iEventtot;
119119
=== modified file 'Template/NLO/MCatNLO/srcPythia8/Pythia82.cc'
--- Template/NLO/MCatNLO/srcPythia8/Pythia82.cc 2016-02-23 11:25:37 +0000
+++ Template/NLO/MCatNLO/srcPythia8/Pythia82.cc 2017-08-16 21:26:30 +0000
@@ -57,7 +57,7 @@
57 int iEventshower=pythia.mode("Main:spareMode1");57 int iEventshower=pythia.mode("Main:spareMode1");
58 string evt_norm=pythia.word("Main:spareWord1");58 string evt_norm=pythia.word("Main:spareWord1");
59 int iEventtot_norm=iEventtot;59 int iEventtot_norm=iEventtot;
60 if (evt_norm == "average"){60 if (evt_norm != "sum"){
61 iEventtot_norm=1;61 iEventtot_norm=1;
62 }62 }
6363
@@ -118,7 +118,7 @@
118 double normhepmc;118 double normhepmc;
119 // Add the weight of the current event to the cross section.119 // Add the weight of the current event to the cross section.
120 normhepmc = 1. / double(iEventshower);120 normhepmc = 1. / double(iEventshower);
121 if (evt_norm == "average") {121 if (evt_norm != "sum") {
122 sigmaTotal += evtweight*normhepmc;122 sigmaTotal += evtweight*normhepmc;
123 } else {123 } else {
124 sigmaTotal += evtweight*normhepmc*iEventtot;124 sigmaTotal += evtweight*normhepmc*iEventtot;
125125
=== modified file 'Template/NLO/MCatNLO/srcPythia8/Pythia82_hep.cc'
--- Template/NLO/MCatNLO/srcPythia8/Pythia82_hep.cc 2015-03-19 11:57:06 +0000
+++ Template/NLO/MCatNLO/srcPythia8/Pythia82_hep.cc 2017-08-16 21:26:30 +0000
@@ -70,7 +70,7 @@
70 // the number of events read by Pythia so far70 // the number of events read by Pythia so far
71 int nSelected=pythia.info.nSelected();71 int nSelected=pythia.info.nSelected();
7272
73 if (nSelected >= iEventshower) break;73 if (nSelected > iEventshower) break;
74 if (pythia.info.isLHA() && iPrintLHA < nPrintLHA) {74 if (pythia.info.isLHA() && iPrintLHA < nPrintLHA) {
75 pythia.LHAeventList();75 pythia.LHAeventList();
76 pythia.info.list();76 pythia.info.list();
@@ -83,7 +83,7 @@
83 double evtweight = pythia.info.weight();83 double evtweight = pythia.info.weight();
84 double normhepmc;84 double normhepmc;
85 // ALWAYS NORMALISE HEPMC WEIGHTS TO SUM TO THE CROSS SECTION85 // ALWAYS NORMALISE HEPMC WEIGHTS TO SUM TO THE CROSS SECTION
86 if (evt_norm == "average") {86 if (evt_norm != "sum") {
87 normhepmc = 1. / double(iEventshower);87 normhepmc = 1. / double(iEventshower);
88 } else {88 } else {
89 normhepmc = double(iEventtot) / double(iEventshower);89 normhepmc = double(iEventtot) / double(iEventshower);
9090
=== modified file 'Template/NLO/MCatNLO/srcPythia8/Pythia8_hep.cc'
--- Template/NLO/MCatNLO/srcPythia8/Pythia8_hep.cc 2015-03-19 12:02:08 +0000
+++ Template/NLO/MCatNLO/srcPythia8/Pythia8_hep.cc 2017-08-16 21:26:30 +0000
@@ -64,7 +64,7 @@
64 // the number of events read by Pythia so far64 // the number of events read by Pythia so far
65 int nSelected=pythia.info.nSelected();65 int nSelected=pythia.info.nSelected();
6666
67 if (nSelected >= iEventshower) break;67 if (nSelected > iEventshower) break;
68 if (pythia.info.isLHA() && iPrintLHA < nPrintLHA) {68 if (pythia.info.isLHA() && iPrintLHA < nPrintLHA) {
69 pythia.LHAeventList();69 pythia.LHAeventList();
70 pythia.info.list();70 pythia.info.list();
@@ -77,7 +77,7 @@
77 double evtweight = pythia.info.weight();77 double evtweight = pythia.info.weight();
78 double normhepmc;78 double normhepmc;
79 // ALWAYS NORMALISE HEPMC WEIGHTS TO SUM TO THE CROSS SECTION79 // ALWAYS NORMALISE HEPMC WEIGHTS TO SUM TO THE CROSS SECTION
80 if (evt_norm == "average") {80 if (evt_norm != "sum") {
81 normhepmc = 1. / double(iEventshower);81 normhepmc = 1. / double(iEventshower);
82 } else {82 } else {
83 normhepmc = double(iEventtot) / double(iEventshower);83 normhepmc = double(iEventtot) / double(iEventshower);
8484
=== modified file 'Template/NLO/Source/alfas_functions_lhapdf.f'
--- Template/NLO/Source/alfas_functions_lhapdf.f 2013-12-20 05:39:24 +0000
+++ Template/NLO/Source/alfas_functions_lhapdf.f 2017-08-16 21:26:30 +0000
@@ -89,7 +89,7 @@
89 ALPHAS=alphasPDF(Q)89 ALPHAS=alphasPDF(Q)
90 call cpu_time(tAfter)90 call cpu_time(tAfter)
91 91
92 tPDF = tPDF + (tAfter-tBefore)92c tPDF = tPDF + (tAfter-tBefore)
9393
94 RETURN94 RETURN
95 END95 END
9696
=== added file 'Template/NLO/Source/extra_weights.f'
--- Template/NLO/Source/extra_weights.f 1970-01-01 00:00:00 +0000
+++ Template/NLO/Source/extra_weights.f 2017-08-16 21:26:30 +0000
@@ -0,0 +1,43 @@
1 module extra_weights
2
3 integer,parameter :: iwgtinfo=-5,maxscales=9,maxPDFs=200
4 $ ,maxPDFsets=25,maxdynscales=10
5 integer :: max_mom_str=1,max_mext=1,max_n_ctr=1
6 logical :: doreweight,lscalevar(maxdynscales)
7 $ ,lpdfvar(maxPDFsets)
8 integer :: iwgtnumpartn,jwgtinfo,mexternal
9 $ ,lhaPDFid(0:maxPDFsets),nmemPDF(maxPDFsets)
10 $ ,dyn_scale(0:maxdynscales),n_ctr_found,n_mom_conf
11 double precision :: wgtdegrem_xi,wgtdegrem_lxi,wgtdegrem_muF
12 $ ,wgtnstmp,wgtwnstmpmuf,wgtwnstmpmur,wgtnstmp_avgvirt
13 $ ,wgtref,scalevarR(0:maxscales),scalevarF(0:maxscales)
14 $ ,wgtxsecmu(maxscales,maxscales,maxdynscales)
15 $ ,wgtxsecPDF(0:maxPDFs,maxPDFsets),wgtbpower,wgtcpower
16 $ ,veto_multiplier,H1_factor_virt,veto_compensating_factor
17 $ ,born_wgt_veto
18 double precision,allocatable :: momenta_str(:,:,:)
19 character(len= 100) :: LHAPDFsetname(maxPDFsets)
20 character(len=1024),allocatable :: n_ctr_str(:)
21
22c input of cpower (checked against calculated value)
23 double precision,parameter :: cpowerinput=0d0
24c switch for running muR-dependent factor runfac=1(running)/0(fixed)
25 integer,parameter :: runfac=0
26c WARNING: If you set runfac=1 to include a muR-dependent factor
27c make sure you modified the function rwgt_muR_dep_fac in
28c reweight_xsec.f and compute_cpower in fks_singular.f
29c appropiately to include all muR dependent overall factors
30c (except for alpha_s) in the calculation. This procedure
31c will be incorrect, if you miss one of the muR dependent
32c factors or if there is a not factorizing muR dependent term.
33c You also have to set ren_group_coeff_in and cpowerinput
34c to the proper values.
35
36c first order coefficient of renormalization group equation of the
37c muR-dependent factor,
38c e.g. for masses: ren_group_coeff = gamma0 = 3/2*C_F,
39c i.e. also for Yukawa: ren_group_coeff = gamma0
40 integer,parameter :: ren_group_coeff_in=0d0
41
42 save
43 end module extra_weights
044
=== removed file 'Template/NLO/Source/getissud.f'
--- Template/NLO/Source/getissud.f 2012-12-04 16:52:45 +0000
+++ Template/NLO/Source/getissud.f 1970-01-01 00:00:00 +0000
@@ -1,201 +0,0 @@
1C...GETISSUD performs an interpolation/extrapolation in 3 dimensions by
2C...fitting quadratic splines using 4 points in each dimension
3 double precision function getissud(ibeam,kfl,x1,x2,pt2)
4 implicit none
5
6 include 'sudgrid.inc'
7
8c Arguments
9 integer ibeam,kfl
10 double precision x1,x2,pt2
11c Storing values for the interpolation
12 double precision smallgrid(4,4),minigrid(4) ! pt2,x1
13c Local variables
14 integer ipt2,ix1,ix2,ilo,ihi,i,j,k,kkfl,ipoints
15 double precision pt2i,x2i,x1i,minpoint,maxpoint,x(3)
16 integer nerr
17 data nerr/0/
18
19 getissud=0
20
21 x(1)=log(x2)
22 x(2)=x1
23 x(3)=log(pt2)
24
25 kkfl=kfl
26 if(ibeam.lt.0) kkfl=-kkfl
27 if(kkfl.lt.-2) kkfl=iabs(kfl)
28 if(iabs(kkfl).eq.21) kkfl=0
29 if(kkfl.eq.5) then
30 ipoints=2
31 else
32 ipoints=1
33 endif
34 if(kkfl.gt.5) then
35 if(nerr.lt.10)
36 $ write(*,*)'GETISSUD Warning: flavor ',kfl,' not supported'
37 nerr=nerr+1
38 getissud=1
39 return
40 endif
41
42 if(x(1).lt.points(1,ipoints).or.
43 $ x(1).gt.points(nx2,ipoints).and.nerr.lt.10)
44 $ then
45 write(*,*) 'GETISSUD Warning: extrapolation in x2: ',x2
46 nerr=nerr+1
47 endif
48
49 if(x(2).lt.points(nx2+1,ipoints).or.
50 $ x(2).gt.points(nx2+nx1,ipoints)
51 $ .and.nerr.lt.10) then
52 write(*,*) 'GETISSUD Warning: extrapolation in x1: ',x1
53 nerr=nerr+1
54 endif
55
56 if(kkfl.eq.5.and.pt2.lt.22.3109)then
57 getissud=1d0
58 return
59 endif
60
61 if(kkfl.eq.5.and.x1.gt.0.6)then
62 getissud=0d0
63 return
64 endif
65
66 if(x(3).lt.points(nx2+nx1+1,ipoints)) then
67 write(*,*) 'GETISSUD Error! pt2 = ',exp(x(3)),' < ',
68 $ exp(points(nx2+nx1+1,ipoints)),' = min(pt2). Not allowed!'
69 write(*,*) 'You need to regenerate grid with new pt2min.'
70 stop
71 endif
72
73 if(x(3).lt.points(nx2+nx1+1,ipoints).or.
74 $ x(3).gt.points(nx2+nx1+npt2,ipoints)
75 $ .and.nerr.lt.10) then
76 write(*,*) 'GETISSUD Warning: extrapolation in pt2: ',pt2
77 nerr=nerr+1
78 endif
79
80
81c Find nearest points by binary method
82c x2
83 ilo=1
84 ihi=nx2
85 do while(ihi.gt.ilo+1)
86 ix2=ilo+(ihi-ilo)/2
87 if(x(1).gt.points(ix2,ipoints))then
88 ilo=ix2
89 else
90 ihi=ix2
91 endif
92 enddo
93 if(x(1).lt.points(ix2,ipoints))
94 $ ix2=ix2-1
95 ix2=max(2,min(ix2,nx2-2))
96
97c print *,'x2: ',ix2,x(1),(points(i,ipoints),i=ix2-1,ix2+2)
98
99c x1
100 ilo=1
101 ihi=nx1
102 do while(ihi.gt.ilo+1)
103 ix1=ilo+(ihi-ilo)/2
104 if(x(2).gt.points(nx2+ix1,ipoints))then
105 ilo=ix1
106 else
107 ihi=ix1
108 endif
109 enddo
110 if(x(2).lt.points(nx2+ix1,ipoints))
111 $ ix1=ix1-1
112 ix1=max(2,min(ix1,nx1-2))
113
114 do while(kkfl.eq.5.and.
115 $ points(nx2+ix1+2,ipoints).gt.0.6)
116 ix1=ix1-1
117 enddo
118
119c print *,'x1: ',ix1,x(2),(points(nx2+i,ipoints),i=ix1-1,ix1+2)
120
121c pt2
122 ilo=1
123 ihi=npt2
124 do while(ihi.gt.ilo+1)
125 ipt2=ilo+(ihi-ilo)/2
126 if(x(3).gt.points(nx2+nx1+ipt2,ipoints))then
127 ilo=ipt2
128 else
129 ihi=ipt2
130 endif
131 enddo
132 if(x(3).lt.points(nx2+nx1+ipt2,ipoints))
133 $ ipt2=ipt2-1
134 ipt2=max(2,min(ipt2,npt2-2))
135
136 do while(kkfl.eq.5.and.
137 $ exp(points(nx2+nx1+ipt2-1,ipoints)).lt.22.3109)
138 ipt2=ipt2+1
139 enddo
140c print *,'pt2: ',ipt2,x(3),(points(nx2+nx1+i,ipoints),i=ipt2-1,ipt2+2)
141c print *,'pt: ',ipt2,exp(x(3)/2),
142c $ (exp(points(nx2+nx1+i,ipoints)/2),i=ipt2-1,ipt2+2)
143
144C Now perform inter-/extra-polation
145
146C Start with x2, which should have the flattest distribution
147C Calculate sud(x2,ax1,apt2) for the 4x4 apt2 and ax1
148C Then continue with pt2 and calculate sud(x2,ax1,pt2)
149C for the 4 ax1
150C Finally calculate sud(x2,x1,pt2)
151
152 do i=1,4
153 do j=1,4
154c print *,'x1,pt:',points(nx2+ix1-2+i,ipoints),
155c $ exp(points(nx2+nx1+ipt2-2+j,ipoints)/2)
156 call splint2(sudgrid(ix2-1,ix1-2+i,ipt2-2+j,kkfl),
157 $ points(ix2-1,ipoints),4,x(1),smallgrid(j,i))
158 smallgrid(j,i)=max(0d0,min(1d0,smallgrid(j,i)))
159 enddo
160 enddo
161
162 do i=1,4
163 call splint2(smallgrid(1,i),
164 $ points(nx2+nx1+ipt2-1,ipoints),4,x(3),minigrid(i))
165 minigrid(i)=max(0d0,min(1d0,minigrid(i)))
166 enddo
167
168 call splint2(minigrid,
169 $ points(nx2+ix1-1,ipoints),4,x(2),getissud)
170 getissud=max(0d0,min(1d0,getissud))
171
172c print *,'Result: ',getissud
173
174 return
175 end
176
177
178 subroutine splint2(ypoints,xpoints,npoints,x,ans)
179 implicit none
180
181C arguments
182 integer npoints
183 double precision ypoints(npoints),xpoints(npoints)
184 double precision x,ans
185C local variables
186 double precision a0,a1,a2,sd
187 integer ifail,i
188
189 CALL DLSQP2(npoints,xpoints,ypoints,a0,a1,a2,sd,ifail)
190
191c print *,'Point, interpolation:'
192c do i=1,npoints
193c print *,exp(xpoints(i)),ypoints(i),
194c $ a0+a1*xpoints(i)+a2*xpoints(i)**2
195c enddo
196
197 ans=a0+a1*x+a2*x**2
198c print *,x,ans
199
200 return
201 end
2020
=== modified file 'Template/NLO/Source/make_opts.inc'
--- Template/NLO/Source/make_opts.inc 2016-06-28 14:44:52 +0000
+++ Template/NLO/Source/make_opts.inc 2017-08-16 21:26:30 +0000
@@ -48,11 +48,6 @@
48 F2PY=$(DEFAULT_F2PY_COMPILER)48 F2PY=$(DEFAULT_F2PY_COMPILER)
49endif49endif
5050
51# Set CXX unless it's defined by an environment variable
52ifeq ($(origin CXX),default)
53 CXX=$(DEFAULT_CPP_COMPILER)
54endif
55
56UNAME := $(shell uname -s)51UNAME := $(shell uname -s)
57ifeq ($(origin LDFLAGS), undefined)52ifeq ($(origin LDFLAGS), undefined)
58 LDFLAGS=$(STDLIB) $(MACFLAG)53 LDFLAGS=$(STDLIB) $(MACFLAG)
@@ -94,10 +89,22 @@
94 alfas_functions=alfas_functions_lhapdf89 alfas_functions=alfas_functions_lhapdf
95 llhapdf = $(shell $(lhapdf) --libs)90 llhapdf = $(shell $(lhapdf) --libs)
96 reweight_xsec_events_pdf_dummy=91 reweight_xsec_events_pdf_dummy=
92 # check if we need to activate c++11 (for lhapdf6.2)
93 ifeq ($(origin CXX),default)
94 ifeq ($lhapdfversion$lhapdfsubversion,62)
95 CXX=$(DEFAULT_CPP_COMPILER) -std=c++11
96 else
97 CXX=$(DEFAULT_CPP_COMPILER)
98 endif
99 endif
97else100else
98 alfas_functions=alfas_functions101 alfas_functions=alfas_functions
99 llhapdf=102 llhapdf=
100 reweight_xsec_events_pdf_dummy=reweight_xsec_events_pdf_dummy.o103 reweight_xsec_events_pdf_dummy=reweight_xsec_events_pdf_dummy.o
104 # Set CXX unless it's defined by an environment variable
105 ifeq ($(origin CXX),default)
106 CXX=$(DEFAULT_CPP_COMPILER)
107 endif
101endif108endif
102109
103# Option APPLGrid110# Option APPLGrid
104111
=== modified file 'Template/NLO/Source/makefile'
--- Template/NLO/Source/makefile 2017-05-09 13:28:25 +0000
+++ Template/NLO/Source/makefile 2017-08-16 21:26:30 +0000
@@ -8,12 +8,8 @@
8IREGIDIR= ./IREGI/src/8IREGIDIR= ./IREGI/src/
9STDHEPDIR= ./StdHEP/9STDHEPDIR= ./StdHEP/
1010
11PROCESS= matrix.o myamp.o 11GENERIC = $(alfas_functions).o rw_routines.o kin_functions.o \
1212 run_printout.o dgauss.o ranmar.o setrun.o
13GENERIC = $(alfas_functions).o rw_routines.o kin_functions.o setrun.o \
14 run_printout.o dgauss.o ranmar.o getissud.o
15
16INCLUDEF = coupl.inc pmass.inc cluster.inc
1713
18.f.o: ; $(FC) $(FFLAGS) -c $*.f14.f.o: ; $(FC) $(FFLAGS) -c $*.f
1915
@@ -21,19 +17,19 @@
21 $(LIBDIR)libmodel.a $(LIBDIR)libcernlib.a param_card.inc17 $(LIBDIR)libmodel.a $(LIBDIR)libcernlib.a param_card.inc
22 rm -f PDF/*.o18 rm -f PDF/*.o
2319
24
25$(LIBDIR)libdhelas.a: DHELAS20$(LIBDIR)libdhelas.a: DHELAS
26 rm -f $(LIBDIR)libdhelas.a21 rm -f $(LIBDIR)libdhelas.a
27 cd DHELAS; make22 cd DHELAS; make
2823
29$(LIBDIR)libgeneric.a: $(GENERIC)24$(LIBDIR)libgeneric.a: $(GENERIC)
30 rm -f $(LIBDIR)libgeneric.a25 rm -f $(LIBDIR)libgeneric.a
31 ar cru libgeneric.a $(GENERIC)26 ar cru libgeneric.a $(GENERIC) extra_weights.o
32 ranlib libgeneric.a27 ranlib libgeneric.a
33 mv libgeneric.a $(LIBDIR)28 mv libgeneric.a $(LIBDIR)
29 cp -f extra_weights.mod $(LIBDIR)
34 rm -f $(alfas_functions).o 30 rm -f $(alfas_functions).o
3531
36setrun.o: run_card.inc 32setrun.o: run_card.inc extra_weights.o
37 $(FC) $(FFLAGS) -c -o setrun.o setrun.f33 $(FC) $(FFLAGS) -c -o setrun.o setrun.f
3834
39$(LIBDIR)libpdf.a: PDF35$(LIBDIR)libpdf.a: PDF
4036
=== modified file 'Template/NLO/Source/run.inc'
--- Template/NLO/Source/run.inc 2017-01-13 15:01:41 +0000
+++ Template/NLO/Source/run.inc 2017-08-16 21:26:30 +0000
@@ -54,11 +54,6 @@
54 double precision bwcutoff54 double precision bwcutoff
55 common/to_bwcutoff/ bwcutoff55 common/to_bwcutoff/ bwcutoff
56c56c
57c Sudakov grid file name
58c
59 character*130 issgridfile
60 common/to_sgridfile/issgridfile
61c
62c kT/pT scheme for xqcut, clustering according to channel57c kT/pT scheme for xqcut, clustering according to channel
63c58c
64 integer ktscheme59 integer ktscheme
6560
=== removed file 'Template/NLO/Source/run_config.inc'
--- Template/NLO/Source/run_config.inc 2015-09-24 16:36:04 +0000
+++ Template/NLO/Source/run_config.inc 1970-01-01 00:00:00 +0000
@@ -1,54 +0,0 @@
1c*********************************************************************
2c Parameters to configure running information for MadEvent
3c The default values of these parameters should not need to be
4c changed, unless there is a special need for optimization
5c*********************************************************************
6c
7c The following parameters are used by symmetry.f in setting up the survey
8c
9 integer icomp
10 parameter (icomp = 3) !BW + Symmetry compression 0 == none
11 integer min_events_subprocess !Minimum number of events
12 parameter (min_events_subprocess = 2000) !per iteration in each subprocess
13 integer min_events_channel !Minimum number of events
14 parameter (min_events_channel = 1000) !per iteration in each channel
15 integer iter_survey !Number of iterations for survey
16 parameter (iter_survey=4)
17 integer nhel_survey !Number of helicities to sum for each
18 parameter (nhel_survey=0) !phase space point. (0 = sum_all)
19c
20c The following parameters are used by gen_ximprove.f in running refine
21c
22 integer min_events !Minimum number of events/iteration
23 parameter (min_events = 2000) !to refine a channel
24 integer max_events !Maximum number of events/iteration
25 parameter (max_events = 2000) !to refine a channel
26 integer max_iter !Maximum number of iterations
27 parameter (max_iter = 9) !during refinement
28 integer nhel_refine !Number of helicities to sum for each
29 parameter (nhel_refine=0) !phase space point. (0 = sum_all)
30c
31c The following are used for parallel running
32c
33 character*(20) PBS_QUE
34 parameter (PBS_QUE = 'madgraph')
35
36 integer ChanPerJob
37 parameter (ChanPerJob=100000000) !Number of channels / job for survey
38
39c integer max_np
40c parameter (max_np=1) !Number of channels / job for refine
41c
42c
43c
44 double precision trunc_max
45 parameter (trunc_max=0.01)
46c
47c The following are used for grid type running
48c
49 double precision acc_wu
50 parameter (acc_wu = 0.01) !Desired accuracy from warmup run
51 integer npoints_wu, itmax_wu !warmup # points/iterations
52 parameter (npoints_wu = 4000, itmax_wu = 8)
53 integer min_gevents_wu
54 parameter (min_gevents_wu=1000) !Minumum # unweighted events to generate from channel
550
=== modified file 'Template/NLO/Source/setrun.f'
--- Template/NLO/Source/setrun.f 2017-05-09 11:54:11 +0000
+++ Template/NLO/Source/setrun.f 2017-08-16 21:26:30 +0000
@@ -6,47 +6,16 @@
6c 2. Collider parameters6c 2. Collider parameters
7c 3. cuts7c 3. cuts
8c---------------------------------------------------------------------- 8c----------------------------------------------------------------------
9 use extra_weights
9 implicit none10 implicit none
10c
11c parameters
12c
13 integer maxpara
14 parameter (maxpara=1000)
15c
16c local
17c
18 integer npara
19 character*20 param(maxpara),value(maxpara)
20c
21c include
22c
23 include 'PDF/pdf.inc'11 include 'PDF/pdf.inc'
24 include 'run.inc'12 include 'run.inc'
25 include 'alfas.inc'13 include 'alfas.inc'
26 include 'MODEL/coupl.inc'14 include 'MODEL/coupl.inc'
27 include '../SubProcesses/reweight0.inc'15 integer k,i
28
29 double precision D
30 common/to_dj/D
31c
32c local
33c
34 character*20 ctemp
35 integer k,i,l1,l2
36 character*132 buff16 character*132 buff
37C
38C input cuts
39C
40 include 'cuts.inc'17 include 'cuts.inc'
41C18c Les Houches init block (for the <init> info)
42C BEAM POLARIZATION
43C
44 REAL*8 POL(2)
45 common/to_polarization/ POL
46 data POL/1d0,1d0/
47c
48c Les Houches init block (for the <init> info)
49c
50 integer maxpup19 integer maxpup
51 parameter(maxpup=100)20 parameter(maxpup=100)
52 integer idbmup,pdfgup,pdfsup,idwtup,nprup,lprup21 integer idbmup,pdfgup,pdfsup,idwtup,nprup,lprup
@@ -55,7 +24,6 @@
55 & idwtup,nprup,xsecup(maxpup),xerrup(maxpup),24 & idwtup,nprup,xsecup(maxpup),xerrup(maxpup),
56 & xmaxup(maxpup),lprup(maxpup)25 & xmaxup(maxpup),lprup(maxpup)
57c26c
58 logical gridrun,gridpack
59 integer iseed27 integer iseed
60 common /to_seed/ iseed28 common /to_seed/ iseed
61 integer nevents29 integer nevents
@@ -64,17 +32,13 @@
64 integer iappl32 integer iappl
65 common /for_applgrid/ iappl33 common /for_applgrid/ iappl
66 integer idum34 integer idum
67C 35c jet-rate distance. To be set to 1 for FxFx
68c36 double precision D
69c----------37 common/to_dj/D
70c start38c Include all the parameters set in the run_card.dat
71c----------
72 include 'run_card.inc'39 include 'run_card.inc'
73 40c Change shower_MC string to upper case
74c MZ add the possibility to have shower_MC input lowercase
75 call to_upper(shower_MC)41 call to_upper(shower_MC)
76C
77
78c Determine if there is a need to do scale and/or PDF reweighting42c Determine if there is a need to do scale and/or PDF reweighting
79 do_rwgt_scale=.false.43 do_rwgt_scale=.false.
80 do i=1,dyn_scale(0)44 do i=1,dyn_scale(0)
@@ -90,69 +54,41 @@
90 exit54 exit
91 endif55 endif
92 enddo56 enddo
93
94c Default scale and PDF choice used for the actual run57c Default scale and PDF choice used for the actual run
95 dynamical_scale_choice=dyn_scale(1)58 dynamical_scale_choice=dyn_scale(1)
96 lhaid=lhaPDFid(1)59 lhaid=lhaPDFid(1)
97
98c merging cuts
99 xqcut=0d0
100 xmtc=0d0
101 d=1d0
102
103c*********************************************************************
104c Random Number Seed *
105c*********************************************************************
106
107 gridrun=.false.
108 gridpack=.false.
109
110c************************************************************************
111c Renormalization and factorization scales *
112c************************************************************************
113c
114
115c For backward compatibility60c For backward compatibility
116 scale = muR_ref_fixed61 scale = muR_ref_fixed
117 q2fact(1) = muF1_ref_fixed**2 ! fact scale**2 for pdf162 q2fact(1) = muF1_ref_fixed**2 ! fact scale**2 for pdf1
118 q2fact(2) = muF2_ref_fixed**2 ! fact scale**2 for pdf2 63 q2fact(2) = muF2_ref_fixed**2 ! fact scale**2 for pdf2
119 scalefact=muR_over_ref64 scalefact=muR_over_ref
120 ellissextonfact=QES_over_ref65 ellissextonfact=QES_over_ref
121
122c check that the event normalization input is reasoble66c check that the event normalization input is reasoble
123 buff = event_norm 67 buff = event_norm
124 call case_trap2(buff) ! requires a string of length 20 at least68 call case_trap2(buff) ! requires a string of length 20 at least
125 event_norm=buff 69 event_norm=buff
126 if (event_norm(1:7).ne.'average' .and. event_norm(1:3).ne.'sum'70 if ( event_norm(1:7).ne.'average' .and.
127 $ .and. event_norm(1:5).ne.'unity')then71 $ event_norm(1:3).ne.'sum' .and.
72 $ event_norm(1:5).ne.'unity'.and.
73 $ event_norm(1:4).ne.'bias')then
128 write (*,*) 'Do not understand the event_norm parameter'/74 write (*,*) 'Do not understand the event_norm parameter'/
129 & /' in the run_card.dat. Possible options are'/75 & /' in the run_card.dat. Possible options are'/
130 & /' "average", "sum" or "unity". Current input is: ',76 & /' "average", "sum", "unity" or "bias". '/
131 & event_norm77 & /'Current input is: ', event_norm
132 open(unit=26,file='../../error',status='unknown')
133 write (26,*) 'Do not understand the event_norm parameter'/
134 & /' in the run_card.dat. Possible options are'/
135 & /' "average", "sum" or "unity". Current input is: ',
136 & event_norm
137
138 stop 178 stop 1
139 endif79 endif
14080c Check parameters for FxFx/UNLOPS/NNLL-veto
141c info for reweight
142
143 if ( ickkw.ne.0 .and. ickkw.ne.4 .and. ickkw.ne.3 .and.81 if ( ickkw.ne.0 .and. ickkw.ne.4 .and. ickkw.ne.3 .and.
144 & ickkw.ne.-1) then82 & ickkw.ne.-1) then
145 write (*,*) 'ickkw parameter not known. ickkw=',ickkw83 write (*,*) 'ickkw parameter not known. ickkw=',ickkw
146 stop84 stop
147 endif85 endif
148c$$$ ickkw=0
149 chcluster=.false.86 chcluster=.false.
150 ktscheme=187 ktscheme=1
15188 xqcut=0d0
152c !!! Default behavior changed (MH, Aug. 07) !!!89 xmtc=0d0
153c If no pdf, read the param_card and use the value from there and90 D=1d0
154c order of alfas running = 291c Set alphaS(mZ)
155
156 if(lpp(1).ne.0.or.lpp(2).ne.0) then92 if(lpp(1).ne.0.or.lpp(2).ne.0) then
157 write(*,*) 'A PDF is used, so alpha_s(MZ)'/93 write(*,*) 'A PDF is used, so alpha_s(MZ)'/
158 & /' is going to be modified'94 & /' is going to be modified'
@@ -172,33 +108,29 @@
172 write(*,*) 'The default order of alpha_s running is fixed to '108 write(*,*) 'The default order of alpha_s running is fixed to '
173 & ,nloop109 & ,nloop
174 endif110 endif
175c !!! end of modification !!!111C Fill common block for Les Houches init info
176
177C Fill common block for Les Houches init info
178 do i=1,2112 do i=1,2
179 if(lpp(i).eq.1.or.lpp(i).eq.2) then113 if(lpp(i).eq.1.or.lpp(i).eq.2) then
180 idbmup(i)=2212114 idbmup(i)=2212
181 elseif(lpp(i).eq.-1.or.lpp(i).eq.-2) then115 elseif(lpp(i).eq.-1.or.lpp(i).eq.-2) then
182 idbmup(i)=-2212116 idbmup(i)=-2212
183 elseif(lpp(i).eq.3) then117 elseif(lpp(i).eq.3) then
184 idbmup(i)=11118 idbmup(i)=11
185 elseif(lpp(i).eq.-3) then119 elseif(lpp(i).eq.-3) then
186 idbmup(i)=-11120 idbmup(i)=-11
187 elseif(lpp(i).eq.0) then121 elseif(lpp(i).eq.0) then
188 open (unit=71,status='old',file='initial_states_map.dat')122 open (unit=71,status='old',file='initial_states_map.dat')
189 read (71,*,err=100)idum,idum,idbmup(1),idbmup(2)123 read (71,*,err=100)idum,idum,idbmup(1),idbmup(2)
190 close (71)124 close (71)
191c idbmup(i)=idup(i,1)125 else
192 else126 idbmup(i)=lpp(i)
193 idbmup(i)=lpp(i)127 endif
194 endif
195 ebmup(i)=ebeam(i)128 ebmup(i)=ebeam(i)
196 enddo129 enddo
197 call get_pdfup(pdlabel,pdfgup,pdfsup,lhaid)130 call get_pdfup(pdlabel,pdfgup,pdfsup,lhaid)
198131c Fill the nmemPDF(i) array with the number of PDF error set. This we
132c get from LHAPDF.
199 if (lpdfvar(1) .and. (lpp(1).ne.0.or.lpp(2).ne.0) ) then133 if (lpdfvar(1) .and. (lpp(1).ne.0.or.lpp(2).ne.0) ) then
200c fill the nmemPDF(i) array with the number of PDF error set. This we
201c get from LHAPDF.
202 call numberPDFm(1,nmemPDF(1))134 call numberPDFm(1,nmemPDF(1))
203 if (nmemPDF(1).eq.1) then135 if (nmemPDF(1).eq.1) then
204 nmemPDF(1)=0136 nmemPDF(1)=0
@@ -207,100 +139,51 @@
207 else139 else
208 nmemPDF(1)=0140 nmemPDF(1)=0
209 endif141 endif
210
211 return
212 99 write(*,*) 'error in reading'
213 return142 return
214 100 write(*,*) '"initial_states_map.dat" not found (or incorrect'/143 100 write(*,*) '"initial_states_map.dat" not found (or incorrect'/
215 $ /' format) by "Source/setrun"'144 $ /' format) by "Source/setrun"'
216 stop 1145 stop 1
217 end146 end
218147
219C-------------------------------------------------
220C GET_PDFUP
221C Convert MadEvent pdf name to LHAPDF number
222C-------------------------------------------------
223
224 subroutine get_pdfup(pdfin,pdfgup,pdfsup,lhaid)148 subroutine get_pdfup(pdfin,pdfgup,pdfsup,lhaid)
149C Convert internal pdf name to LHAPDF number
225 implicit none150 implicit none
226
227 character*(*) pdfin151 character*(*) pdfin
228 integer mpdf152 integer mpdf
229 integer npdfs,i,pdfgup(2),pdfsup(2),lhaid153 integer npdfs,i,pdfgup(2),pdfsup(2),lhaid
230
231 parameter (npdfs=16)154 parameter (npdfs=16)
232 character*7 pdflabs(npdfs)155 character*7 pdflabs(npdfs)
233 data pdflabs/156 data pdflabs/ 'none', 'mrs02nl', 'mrs02nn', 'cteq4_m', 'cteq4_l',
234 $ 'none',157 $ 'cteq4_d', 'cteq5_m', 'cteq5_d', 'cteq5_l', 'cteq5m1',
235 $ 'mrs02nl',158 $ 'cteq6_m', 'cteq6_l', 'cteq6l1', 'nn23lo', 'nn23lo1',
236 $ 'mrs02nn',159 $ 'nn23nlo'/
237 $ 'cteq4_m',
238 $ 'cteq4_l',
239 $ 'cteq4_d',
240 $ 'cteq5_m',
241 $ 'cteq5_d',
242 $ 'cteq5_l',
243 $ 'cteq5m1',
244 $ 'cteq6_m',
245 $ 'cteq6_l',
246 $ 'cteq6l1',
247 $ 'nn23lo',
248 $ 'nn23lo1',
249 $ 'nn23nlo'/
250 integer numspdf(npdfs)160 integer numspdf(npdfs)
251 data numspdf/161 data numspdf/ 00000, 20250, 20270, 19150, 19170, 19160, 19050,
252 $ 00000,162 $ 19060, 19070, 19051, 10000, 10041, 10042, 246800, 247000,
253 $ 20250,163 $ 244800/
254 $ 20270,
255 $ 19150,
256 $ 19170,
257 $ 19160,
258 $ 19050,
259 $ 19060,
260 $ 19070,
261 $ 19051,
262 $ 10000,
263 $ 10041,
264 $ 10042,
265 $ 246800,
266 $ 247000,
267 $ 244800/
268
269
270 if(pdfin.eq."lhapdf") then164 if(pdfin.eq."lhapdf") then
271 write(*,*)'using LHAPDF'165 write(*,*)'using LHAPDF'
272 do i=1,2166 do i=1,2
273 pdfgup(i)=-1167 pdfgup(i)=-1
274 pdfsup(i)=lhaid168 pdfsup(i)=lhaid
275 enddo169 enddo
276 return170 return
277 endif171 endif
278
279
280 mpdf=-1172 mpdf=-1
281 do i=1,npdfs173 do i=1,npdfs
282 if(pdfin(1:len_trim(pdfin)) .eq. pdflabs(i))then174 if(pdfin(1:len_trim(pdfin)) .eq. pdflabs(i))then
283 mpdf=numspdf(i)175 mpdf=numspdf(i)
284 endif176 endif
285 enddo177 enddo
286
287 if(mpdf.eq.-1) then178 if(mpdf.eq.-1) then
288 write(*,*)'ERROR: pdf ',pdfin,' not implemented in get_pdfup.'179 write(*,*)'ERROR: pdf ',pdfin,' not implemented in get_pdfup.'
289 write(*,*)'known pdfs are'180 write(*,*)'known pdfs are'
290 write(*,*) pdflabs181 write(*,*) pdflabs
291 open(unit=26,file='../../error',status='unknown')182 stop 1
292 write(26,*)'ERROR: pdf ',pdfin,' not implemented in get_pdfup.'
293 write(26,*)'known pdfs are'
294 write(26,*) pdflabs
295 stop 1
296c$$$ write(*,*)'using ',pdflabs(12)
297c$$$ mpdf=numspdf(12)
298 endif183 endif
299
300 do i=1,2184 do i=1,2
301 pdfgup(i)=-1185 pdfgup(i)=-1
302 pdfsup(i)=mpdf186 pdfsup(i)=mpdf
303 enddo187 enddo
304
305 return188 return
306 end189 end
307190
=== removed file 'Template/NLO/Source/sudgrid.inc'
--- Template/NLO/Source/sudgrid.inc 2012-08-28 21:06:34 +0000
+++ Template/NLO/Source/sudgrid.inc 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1 integer npt2,nx1,nx2
2 parameter(npt2=40,nx1=80,nx2=20)
3 double precision points(nx2+nx1+npt2,2),sudgrid(nx2,nx1,npt2,-2:5)
4 common/sudgrid/points,sudgrid
50
=== modified file 'Template/NLO/SubProcesses/add_write_info.f'
--- Template/NLO/SubProcesses/add_write_info.f 2017-05-16 08:15:12 +0000
+++ Template/NLO/SubProcesses/add_write_info.f 2017-08-16 21:26:30 +0000
@@ -7,7 +7,6 @@
7 include "nexternal.inc"7 include "nexternal.inc"
8 include "born_nhel.inc"8 include "born_nhel.inc"
9 include "coloramps.inc"9 include "coloramps.inc"
10 include "reweight0.inc"
11 include "nFKSconfigs.inc"10 include "nFKSconfigs.inc"
12 include "leshouche_decl.inc"11 include "leshouche_decl.inc"
13 include "run.inc"12 include "run.inc"
1413
=== modified file 'Template/NLO/SubProcesses/analysis_lhe.f'
--- Template/NLO/SubProcesses/analysis_lhe.f 2017-02-14 15:57:59 +0000
+++ Template/NLO/SubProcesses/analysis_lhe.f 2017-08-16 21:26:30 +0000
@@ -30,29 +30,30 @@
30 integer npoints30 integer npoints
31 double precision cross_section31 double precision cross_section
32 common /for_FixedOrder_lhe/ cross_section,npoints32 common /for_FixedOrder_lhe/ cross_section,npoints
33 character*10 MonteCarlo
33 inquire(41,OPENED=lopen) ! safety34 inquire(41,OPENED=lopen) ! safety
34 if (lopen) then35 if (lopen) then
35 backspace(41) ! overwrite the final </eventgroup> tag36 backspace(41) ! overwrite the final </eventgroup> tag
36 write (41,*) nevents,sum_of_wgts,cross_section37 write (41,*) nevents,sum_of_wgts,cross_section
37 close(41)38 close(41)
38 open(41, file='header.txt')39 open(41, file='header.txt')
39 call write_lhef_header(41, 0, 'FO')40 MonteCarlo='FO'
41 call write_lhef_header(41, 0, MonteCarlo)
40 close(41)42 close(41)
41 endif43 endif
42 end44 end
4345
44 subroutine analysis_fill(p,istatus,ipdg,wgts,ibody)46 subroutine analysis_fill(p,istatus,ipdg,wgts,ibody)
47 use extra_weights
45 implicit none48 implicit none
46 include 'nexternal.inc'49 include 'nexternal.inc'
47 include 'reweight.inc'
48 include 'run.inc'50 include 'run.inc'
49 integer nwgt,max_weight51 integer nwgt
50 parameter (max_weight=maxscales*maxscales+maxpdfs+1)
51c include 'genps.inc'52c include 'genps.inc'
52 integer istatus(nexternal)53 integer istatus(nexternal)
53 integer iPDG(nexternal)54 integer iPDG(nexternal)
54 double precision p(0:4,nexternal)55 double precision p(0:4,nexternal)
55 double precision wgts(max_weight)56 double precision wgts(*)
56 integer ibody57 integer ibody
57 integer nwgts,nevents58 integer nwgts,nevents
58 double precision sum_of_wgts59 double precision sum_of_wgts
5960
=== removed file 'Template/NLO/SubProcesses/c_weight.inc'
--- Template/NLO/SubProcesses/c_weight.inc 2016-03-21 08:45:42 +0000
+++ Template/NLO/SubProcesses/c_weight.inc 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
1* -*-fortran-*-
2
3 integer max_contr,max_wgt,max_iproc
4 parameter (max_contr=128,max_wgt=1024,max_iproc=100)
5 logical H_event(max_contr)
6 integer nFKS(max_contr),itype(max_contr),QCDpower(max_contr)
7 $ ,pdg(nexternal,0:max_contr),pdg_uborn(nexternal,0:max_contr)
8 $ ,parton_pdg_uborn(nexternal,max_iproc,max_contr)
9 $ ,parton_pdg(nexternal,max_iproc,max_contr),icontr,iwgt
10 $ ,plot_id(max_contr),niproc(max_contr),parton_pdf(nexternal
11 $ ,max_iproc,max_contr),icontr_sum(0:max_iproc,max_contr)
12 $ ,icontr_picked,iproc_picked
13 double precision momenta(0:3,nexternal,max_contr),momenta_m(0:3
14 $ ,nexternal,2,max_contr),wgt(3,max_contr),wgt_ME_tree(2
15 $ ,max_contr),bjx(2,max_contr),scales2(3,max_contr)
16 $ ,g_strong(max_contr),wgts(max_wgt,max_contr)
17 $ ,parton_iproc(max_iproc,max_contr),y_bst(max_contr)
18 $ ,plot_wgts(max_wgt,max_contr),shower_scale(max_contr)
19 $ ,unwgt(max_iproc,max_contr)
20 common /c_weights/momenta,momenta_m,wgt,wgt_ME_tree,wgts,plot_wgts
21 $ ,parton_iproc,bjx,scales2,g_strong,y_bst,shower_scale,unwgt
22 $ ,parton_pdg,nFKS,itype,QCDpower,pdg,pdg_uborn
23 $ ,parton_pdg_uborn,plot_id,niproc,icontr,iwgt,icontr_sum
24 $ ,icontr_picked,iproc_picked,H_event
250
=== modified file 'Template/NLO/SubProcesses/check_poles.f'
--- Template/NLO/SubProcesses/check_poles.f 2017-04-13 09:51:06 +0000
+++ Template/NLO/SubProcesses/check_poles.f 2017-08-16 21:26:30 +0000
@@ -183,6 +183,7 @@
183 enddo183 enddo
184 enddo184 enddo
185185
186 CALL UPDATE_AS_PARAM()
186 call sborn(p_born, born)187 call sborn(p_born, born)
187 call sloopmatrix_thres(p_born,virt_wgts,tolerance,188 call sloopmatrix_thres(p_born,virt_wgts,tolerance,
188 1 accuracies,return_code)189 1 accuracies,return_code)
189190
=== modified file 'Template/NLO/SubProcesses/collect_events.f'
--- Template/NLO/SubProcesses/collect_events.f 2016-02-24 12:45:15 +0000
+++ Template/NLO/SubProcesses/collect_events.f 2017-08-16 21:26:30 +0000
@@ -1,6 +1,6 @@
1 program collect_events1 program collect_events
2 implicit none2 implicit none
3 character*120 string120,eventfile3 character*512 string512,eventfile
4 character*19 basicfile,nextbasicfile4 character*19 basicfile,nextbasicfile
5 character*15 outputfile5 character*15 outputfile
6 integer istep,i,numoffiles,nbunches,nevents,ievents,junit(80)6 integer istep,i,numoffiles,nbunches,nevents,ievents,junit(80)
@@ -65,9 +65,9 @@
65 nevents=065 nevents=0
66 xtotal=0.d066 xtotal=0.d0
67 do while (.true.)67 do while (.true.)
68 read(10,'(120a)',err=2,end=2) string12068 read(10,'(512a)',err=2,end=2) string512
69 eventfile=string120(2:index(string120,' '))69 eventfile=string512(2:index(string512,' '))
70 read(string120(index(string120,' '):120),*)70 read(string512(index(string512,' '):512),*)
71 $ ievents,absxsec,xsecfrac71 $ ievents,absxsec,xsecfrac
72 if (ievents.eq.0) cycle72 if (ievents.eq.0) cycle
73 nevents=nevents+ievents73 nevents=nevents+ievents
@@ -209,8 +209,9 @@
209 end209 end
210210
211211
212 subroutine collect_all_evfiles(ioutput,numoffiles,junit,212 subroutine collect_all_evfiles(ioutput,numoffiles,junit,imaxevt
213 # imaxevt,evwgt)213 $ ,evwgt)
214 use extra_weights
214 implicit none215 implicit none
215 integer i_orig216 integer i_orig
216 common /c_i_orig/i_orig217 common /c_i_orig/i_orig
@@ -237,8 +238,6 @@
237 data iseed/1/238 data iseed/1/
238 double precision rnd,fk88random239 double precision rnd,fk88random
239 external fk88random240 external fk88random
240 logical debug
241 parameter (debug=.false.)
242 integer nevents_file(80),proc_id(80)241 integer nevents_file(80),proc_id(80)
243 common /to_nevents_file/nevents_file,proc_id242 common /to_nevents_file/nevents_file,proc_id
244 double precision xsecfrac_all(80)243 double precision xsecfrac_all(80)
@@ -249,18 +248,12 @@
249 double precision xsecup_l(100),xerrup_l(100)248 double precision xsecup_l(100),xerrup_l(100)
250 integer lprup_l(100),nproc_l249 integer lprup_l(100),nproc_l
251 logical found_proc250 logical found_proc
252 include 'reweight_all.inc'
253 include 'run.inc'251 include 'run.inc'
254 integer proc_id_tot(0:100)252 integer proc_id_tot(0:100)
255 double precision xsec(100),xsecABS,xerr(100)253 double precision xsec(100),xsecABS,xerr(100)
256 logical get_xsec_from_res1254 logical get_xsec_from_res1
257 common/total_xsec/xsec,xerr,xsecABS,proc_id_tot,get_xsec_from_res1255 common/total_xsec/xsec,xerr,xsecABS,proc_id_tot,get_xsec_from_res1
258c256c
259 if(debug) then
260 write (*,*) ioutput,numoffiles,(junit(ii),ii=1,numoffiles)
261 write(ioutput,*)'test test test'
262 return
263 endif
264 maxevt=0257 maxevt=0
265 if (.not. get_xsec_from_res1) then258 if (.not. get_xsec_from_res1) then
266 do i=1,100259 do i=1,100
267260
=== modified file 'Template/NLO/SubProcesses/combine_root.C'
--- Template/NLO/SubProcesses/combine_root.C 2013-12-02 16:53:51 +0000
+++ Template/NLO/SubProcesses/combine_root.C 2017-08-16 21:26:30 +0000
@@ -44,11 +44,13 @@
44 //can be easily lifted44 //can be easily lifted
45 int maxfiles=1000;45 int maxfiles=1000;
4646
47 int numoffiles;
48 string filenames[maxfiles];
49 string currentdir;
50
47 if(fileoffiles.is_open())51 if(fileoffiles.is_open())
48 {52 {
49 string filenames[maxfiles];
5053
51 int numoffiles;
52 fileoffiles >> numoffiles;54 fileoffiles >> numoffiles;
5355
54 if(numoffiles>maxfiles){56 if(numoffiles>maxfiles){
@@ -56,7 +58,6 @@
56 return;58 return;
57 }59 }
5860
59 string currentdir;
60 fileoffiles >> currentdir;61 fileoffiles >> currentdir;
6162
62 for(int i = 0; i < numoffiles; ++i)63 for(int i = 0; i < numoffiles; ++i)
@@ -122,8 +123,8 @@
122 int llength = HistoContents.size();123 int llength = HistoContents.size();
123 if(myverbose)cout << "Total number of histograms: " << llength << endl;124 if(myverbose)cout << "Total number of histograms: " << llength << endl;
124125
126 int llength0 = llength;
125 if(i==0){127 if(i==0){
126 int llength0 = llength;
127 for(int j = 0; j < llength; j++){128 for(int j = 0; j < llength; j++){
128 TString histname = HistoContents[j]->GetName();129 TString histname = HistoContents[j]->GetName();
129 if(myverbose){130 if(myverbose){
130131
=== modified file 'Template/NLO/SubProcesses/cuts.f'
--- Template/NLO/SubProcesses/cuts.f 2017-05-09 12:37:07 +0000
+++ Template/NLO/SubProcesses/cuts.f 2017-08-16 21:26:30 +0000
@@ -898,32 +898,47 @@
898 end898 end
899899
900900
901 subroutine unweight_function(p_born,unwgtfun)901 subroutine bias_weight_function(p,ipdg,bias_wgt)
902c This is a user-defined function to which to unweight the events902c This is a user-defined function to which to bias the event generation.
903c A non-flat distribution will generate events with a certain903c A non-flat distribution will generate events with a certain weight
904c weight. This is particularly useful to generate more events904c inversely proportinal to the bias_wgt. This is particularly useful to
905c (with smaller weight) in tails of distributions.905c generate more events (with smaller weight) in tails of distributions.
906c It computes the unwgt factor from the momenta and multiplies906c It computes the bias_wgt factor from the momenta and multiplies the
907c the weight that goes into MINT (or vegas) with this factor.907c weight that goes into MINT (or vegas) with this factor. Before
908c Before writing out the events (or making the plots), this factor908c writing out the events (or making the plots), this factor is again
909c is again divided out.909c divided out. A value different from 1 makes that MINT (or vegas) does
910c This function should be called with the Born momenta to be sure910c not list the correct cross section, but the cross section can still be
911c that it stays the same for the events, counter-events, etc.911c computed from summing all the weights of the events (and dividing by
912c A value different from 1 makes that MINT (or vegas) does not list912c the number of events). Since the weights of the events are no longer
913c the correct cross section.913c identical for all events, the statistical uncertainty on this total
914c cross section can be much larger than without including the bias.
915c
916c The 'bias_wgt' should be a IR-safe function of the momenta.
917c
918c For this to be used, the 'event_norm' option in the run_card should be
919c set to
920c 'bias' = event_norm
921c
914 implicit none922 implicit none
915 include 'nexternal.inc'923 include 'nexternal.inc'
916 double precision unwgtfun,p_born(0:3,nexternal-1),shat,sumdot924 double precision bias_wgt,p(0:3,nexternal),H_T
917 external sumdot925 integer ipdg(nexternal),i
918926
919 unwgtfun=1d0927 bias_wgt=1d0
920928
921c How to enhance the tails is very process dependent. But, it is929c How to enhance the tails is very process dependent. For example for
922c probably easiest to enhance the tails using shat, e.g.:930c top quark production one could use:
923c shat=sumdot(p_born(0,1),p_born(0,2),1d0)931c do i=1,nexternal
924c unwgtfun=max(100d0**2,shat)/100d0**2932c if (ipdg(i).eq.6) then
925c unwgtfun=unwgtfun**2933c bias_wgt=sqrt(p(1,i)**2+p(2,i)**2)**3
926934c endif
935c enddo
936c Or to use H_T^2 one does
937c H_T=0d0
938c do i=3,nexternal
939c H_T=H_T+sqrt(max(0d0,(p(0,i)+p(3,i))*(p(0,i)-p(3,i))))
940c enddo
941c bias_wgt=H_T**2
927 return942 return
928 end943 end
929944
930945
=== modified file 'Template/NLO/SubProcesses/driver_mintFO.f'
--- Template/NLO/SubProcesses/driver_mintFO.f 2017-05-09 11:54:11 +0000
+++ Template/NLO/SubProcesses/driver_mintFO.f 2017-08-16 21:26:30 +0000
@@ -2,6 +2,7 @@
2c**************************************************************************2c**************************************************************************
3c This is the driver for the whole calculation3c This is the driver for the whole calculation
4c**************************************************************************4c**************************************************************************
5 use extra_weights
5 implicit none6 implicit none
6C7C
7C CONSTANTS8C CONSTANTS
@@ -10,14 +11,13 @@
10 parameter (ZERO = 0d0)11 parameter (ZERO = 0d0)
11 include 'nexternal.inc'12 include 'nexternal.inc'
12 include 'genps.inc'13 include 'genps.inc'
13 include 'reweight.inc'
14 INTEGER ITMAX, NCALL14 INTEGER ITMAX, NCALL
1515
16 common/citmax/itmax,ncall16 common/citmax/itmax,ncall
17C17C
18C LOCAL18C LOCAL
19C19C
20 integer i,j,l,l1,l2,ndim20 integer i,j,l,l1,l2
21 character*130 buf21 character*130 buf
22c22c
23c Global23c Global
@@ -26,7 +26,8 @@
26 include 'run.inc'26 include 'run.inc'
27 include 'coupl.inc'27 include 'coupl.inc'
28 28
29c Vegas stuff29c Vegas stuff
30 integer ndim
30 common/tosigint/ndim31 common/tosigint/ndim
3132
32 real*8 sigint33 real*8 sigint
@@ -175,6 +176,8 @@
175 if(imode.eq.0)then176 if(imode.eq.0)then
176c Don't safe the reweight information when just setting up the grids.177c Don't safe the reweight information when just setting up the grids.
177 doreweight=.false.178 doreweight=.false.
179 do_rwgt_scale=.false.
180 do_rwgt_pdf=.false.
178 do kchan=1,nchans181 do kchan=1,nchans
179 do i=1,ndimmax182 do i=1,ndimmax
180 do j=0,nintervals183 do j=0,nintervals
@@ -210,10 +213,10 @@
210 endif213 endif
211c214c
212c Setup for parton-level NLO reweighting215c Setup for parton-level NLO reweighting
213 if(do_rwgt_scale.or.do_rwgt_pdf) call setup_fill_rwgt_NLOplot()
214 call mint(sigint,ndim,ncall,itmax,imode,xgrid,ymax216 call mint(sigint,ndim,ncall,itmax,imode,xgrid,ymax
215 $ ,ymax_virt,ans,unc,chi2,nhits_in_grids)217 $ ,ymax_virt,ans,unc,chi2,nhits_in_grids)
216 call topout218 call topout
219 call deallocate_weight_lines
217 write(*,*)'Final result [ABS]:',ans(1,0),' +/-',unc(1,0)220 write(*,*)'Final result [ABS]:',ans(1,0),' +/-',unc(1,0)
218 write(*,*)'Final result:',ans(2,0),' +/-',unc(2,0)221 write(*,*)'Final result:',ans(2,0),' +/-',unc(2,0)
219 write(*,*)'chi**2 per D.o.F.:',chi2(1,0)222 write(*,*)'chi**2 per D.o.F.:',chi2(1,0)
@@ -320,10 +323,6 @@
320c timing statistics323c timing statistics
321 include "timing_variables.inc"324 include "timing_variables.inc"
322 data tOLP/0.0/325 data tOLP/0.0/
323 data tFastJet/0.0/
324 data tPDF/0.0/
325 data tDSigI/0.0/
326 data tDSigR/0.0/
327 data tGenPS/0.0/326 data tGenPS/0.0/
328 data tBorn/0.0/327 data tBorn/0.0/
329 data tIS/0.0/328 data tIS/0.0/
@@ -345,12 +344,12 @@
345344
346345
347 double precision function sigint(xx,vegas_wgt,ifl,f)346 double precision function sigint(xx,vegas_wgt,ifl,f)
347 use weight_lines
348 use extra_weights
348 implicit none349 implicit none
349 include 'nexternal.inc'350 include 'nexternal.inc'
350 include 'mint.inc'351 include 'mint.inc'
351 include 'nFKSconfigs.inc'352 include 'nFKSconfigs.inc'
352 include 'c_weight.inc'
353 include 'reweight.inc'
354 include 'run.inc'353 include 'run.inc'
355 double precision xx(ndimmax),vegas_wgt,f(nintegrals),jac,p(0:3354 double precision xx(ndimmax),vegas_wgt,f(nintegrals),jac,p(0:3
356 $ ,nexternal),rwgt,vol,sig,x(99),MC_int_wgt355 $ ,nexternal),rwgt,vol,sig,x(99),MC_int_wgt
@@ -505,6 +504,7 @@
505504
506 subroutine update_fks_dir(nFKS)505 subroutine update_fks_dir(nFKS)
507 implicit none506 implicit none
507 include 'run.inc'
508 integer nFKS508 integer nFKS
509 integer nFKSprocess509 integer nFKSprocess
510 common/c_nFKSprocess/nFKSprocess510 common/c_nFKSprocess/nFKSprocess
@@ -513,6 +513,7 @@
513 call leshouche_inc_chooser()513 call leshouche_inc_chooser()
514 call setcuts514 call setcuts
515 call setfksfactor(.false.)515 call setfksfactor(.false.)
516 if (ickkw.eq.3) call configs_and_props_inc_chooser()
516 return517 return
517 end518 end
518 519
519520
=== modified file 'Template/NLO/SubProcesses/driver_mintMC.f'
--- Template/NLO/SubProcesses/driver_mintMC.f 2017-05-09 12:41:29 +0000
+++ Template/NLO/SubProcesses/driver_mintMC.f 2017-08-16 21:26:30 +0000
@@ -2,6 +2,7 @@
2c**************************************************************************2c**************************************************************************
3c This is the driver for the whole calculation3c This is the driver for the whole calculation
4c**************************************************************************4c**************************************************************************
5 use extra_weights
5 implicit none6 implicit none
6C7C
7C CONSTANTS8C CONSTANTS
@@ -10,7 +11,6 @@
10 parameter (ZERO = 0d0)11 parameter (ZERO = 0d0)
11 include 'nexternal.inc'12 include 'nexternal.inc'
12 include 'genps.inc'13 include 'genps.inc'
13 include 'reweight.inc'
14 INTEGER ITMAX, NCALL14 INTEGER ITMAX, NCALL
1515
16 common/citmax/itmax,ncall16 common/citmax/itmax,ncall
@@ -50,7 +50,9 @@
50 double precision average_virtual(maxchannels),virtual_fraction(maxchannels)50 double precision average_virtual(maxchannels),virtual_fraction(maxchannels)
51 common/c_avg_virt/average_virtual,virtual_fraction51 common/c_avg_virt/average_virtual,virtual_fraction
5252
53 double precision weight53 double precision weight,event_weight,inv_bias
54 character*7 event_norm
55 common /event_normalisation/event_norm
54c For MINT:56c For MINT:
55 real* 8 xgrid(0:nintervals,ndimmax,maxchannels),ymax(nintervals57 real* 8 xgrid(0:nintervals,ndimmax,maxchannels),ymax(nintervals
56 $ ,ndimmax,maxchannels),ymax_virt(maxchannels),ans(nintegrals58 $ ,ndimmax,maxchannels),ymax_virt(maxchannels),ans(nintegrals
@@ -142,6 +144,8 @@
142 doreweight=do_rwgt_scale.or.do_rwgt_pdf144 doreweight=do_rwgt_scale.or.do_rwgt_pdf
143 else145 else
144 doreweight=.false.146 doreweight=.false.
147 do_rwgt_scale=.false.
148 do_rwgt_pdf=.false.
145 endif149 endif
146 if (abrv(1:4).eq.'virt') then150 if (abrv(1:4).eq.'virt') then
147 only_virt=.true.151 only_virt=.true.
@@ -201,6 +205,7 @@
201 write (*,*) 'imode is ',imode205 write (*,*) 'imode is ',imode
202 call mint(sigintF,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt206 call mint(sigintF,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt
203 $ ,ans,unc,chi2,nhits_in_grids)207 $ ,ans,unc,chi2,nhits_in_grids)
208 call deallocate_weight_lines
204 open(unit=58,file='res_0',status='unknown')209 open(unit=58,file='res_0',status='unknown')
205 write(58,*)'Final result [ABS]:',ans(1,1),' +/-',unc(1,1)210 write(58,*)'Final result [ABS]:',ans(1,1),' +/-',unc(1,1)
206 write(58,*)'Final result:',ans(2,1),' +/-',unc(2,1)211 write(58,*)'Final result:',ans(2,1),' +/-',unc(2,1)
@@ -257,6 +262,7 @@
257 write (*,*) 'imode is ',imode262 write (*,*) 'imode is ',imode
258 call mint(sigintF,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt263 call mint(sigintF,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt
259 $ ,ans,unc,chi2,nhits_in_grids)264 $ ,ans,unc,chi2,nhits_in_grids)
265 call deallocate_weight_lines
260 266
261c If integrating the virtuals alone, we include the virtuals in267c If integrating the virtuals alone, we include the virtuals in
262c ans(1). Therefore, no need to have them in ans(5) and we have to set268c ans(1). Therefore, no need to have them in ans(5) and we have to set
@@ -307,7 +313,11 @@
307 if (ickkw.eq.-1) putonshell=.false.313 if (ickkw.eq.-1) putonshell=.false.
308 unwgt=.true.314 unwgt=.true.
309 open (unit=99,file='nevts',status='old',err=999)315 open (unit=99,file='nevts',status='old',err=999)
310 read (99,*) nevts316 if (event_norm(1:4).ne.'bias') then
317 read (99,*) nevts
318 else
319 read (99,*) nevts,event_weight
320 endif
311 close(99)321 close(99)
312 write(*,*) 'Generating ', nevts, ' events'322 write(*,*) 'Generating ', nevts, ' events'
313 if(nevts.eq.0) then323 if(nevts.eq.0) then
@@ -350,7 +360,11 @@
350 absint=ans(1,1)+ans(5,1)360 absint=ans(1,1)+ans(5,1)
351 uncer=unc(2,1)361 uncer=unc(2,1)
352362
353 weight=(ans(1,1)+ans(5,1))/ncall363 if (event_norm(1:4).ne.'bias') then
364 weight=(ans(1,1)+ans(5,1))/ncall
365 else
366 weight=event_weight
367 endif
354368
355 if (abrv(1:3).ne.'all' .and. abrv(1:4).ne.'born' .and.369 if (abrv(1:3).ne.'all' .and. abrv(1:4).ne.'born' .and.
356 $ abrv(1:4).ne.'virt') then370 $ abrv(1:4).ne.'virt') then
@@ -385,8 +399,13 @@
385 call pick_unweight_contr(iFKS_picked)399 call pick_unweight_contr(iFKS_picked)
386 call update_fks_dir(iFKS_picked)400 call update_fks_dir(iFKS_picked)
387 call fill_rwgt_lines401 call fill_rwgt_lines
402 if (event_norm(1:4).eq.'bias') then
403 call include_inverse_bias_wgt(inv_bias)
404 weight=event_weight*inv_bias
405 endif
388 call finalize_event(x,weight,lunlhe,putonshell)406 call finalize_event(x,weight,lunlhe,putonshell)
389 enddo407 enddo
408 call deallocate_weight_lines
390 vn=-1409 vn=-1
391 call gen(sigintF,ndim,xgrid,ymax,ymax_virt,3,x,vn)410 call gen(sigintF,ndim,xgrid,ymax,ymax_virt,3,x,vn)
392 write (*,*) 'Generation efficiencies:',x(1),x(4)411 write (*,*) 'Generation efficiencies:',x(1),x(4)
@@ -482,10 +501,6 @@
482c timing statistics501c timing statistics
483 include "timing_variables.inc"502 include "timing_variables.inc"
484 data tOLP/0.0/503 data tOLP/0.0/
485 data tFastJet/0.0/
486 data tPDF/0.0/
487 data tDSigI/0.0/
488 data tDSigR/0.0/
489 data tGenPS/0.0/504 data tGenPS/0.0/
490 data tBorn/0.0/505 data tBorn/0.0/
491 data tIS/0.0/506 data tIS/0.0/
@@ -719,14 +734,7 @@
719c734c
720c Here I want to set up with B.W. we map and which we don't735c Here I want to set up with B.W. we map and which we don't
721c736c
722 dconfig = dconfig-iconfig737 lbw(0)=0
723 if (dconfig .eq. 0) then
724 write(*,*) 'Not subdividing B.W.'
725 lbw(0)=0
726 else
727 write(*,*) 'Error BW setting: not supported at NLO'
728 stop 1
729 endif
730 10 format( a)738 10 format( a)
731 12 format( a,i4)739 12 format( a,i4)
732 end740 end
@@ -739,12 +747,11 @@
739747
740748
741 function sigintF(xx,vegas_wgt,ifl,f)749 function sigintF(xx,vegas_wgt,ifl,f)
742c From dsample_fks750 use weight_lines
743 implicit none751 implicit none
744 include 'mint.inc'752 include 'mint.inc'
745 include 'nexternal.inc'753 include 'nexternal.inc'
746 include 'nFKSconfigs.inc'754 include 'nFKSconfigs.inc'
747 include 'c_weight.inc'
748 include 'run.inc'755 include 'run.inc'
749 logical firsttime,passcuts,passcuts_nbody,passcuts_n1body756 logical firsttime,passcuts,passcuts_nbody,passcuts_n1body
750 integer i,ifl,proc_map(0:fks_configs,0:fks_configs)757 integer i,ifl,proc_map(0:fks_configs,0:fks_configs)
@@ -952,9 +959,11 @@
952 call include_shape_in_shower_scale(p,iFKS)959 call include_shape_in_shower_scale(p,iFKS)
953 enddo960 enddo
954 12 continue961 12 continue
955962
956c Include PDFs and alpha_S and reweight to include the uncertainties963c Include PDFs and alpha_S and reweight to include the uncertainties
957 call include_PDF_and_alphas964 call include_PDF_and_alphas
965c Include the weight from the bias_function
966 call include_bias_wgt
958c Sum the contributions that can be summed before taking the ABS value967c Sum the contributions that can be summed before taking the ABS value
959 call sum_identical_contributions968 call sum_identical_contributions
960c Update the shower starting scale for the S-events after we have969c Update the shower starting scale for the S-events after we have
@@ -979,7 +988,6 @@
979 include 'nexternal.inc'988 include 'nexternal.inc'
980 include 'run.inc'989 include 'run.inc'
981 include 'genps.inc'990 include 'genps.inc'
982 include 'reweight_all.inc'
983 include 'nFKSconfigs.inc'991 include 'nFKSconfigs.inc'
984 double precision lum,dlum992 double precision lum,dlum
985 external dlum993 external dlum
@@ -1003,19 +1011,12 @@
1003 write (*,*)'Using ickkw=4, include only 1 FKS dir per'/1011 write (*,*)'Using ickkw=4, include only 1 FKS dir per'/
1004 $ /' Born PS point (sum=0)'1012 $ /' Born PS point (sum=0)'
1005 endif1013 endif
1006 maxproc_save=0
1007 do nFKSprocess=1,fks_configs1014 do nFKSprocess=1,fks_configs
1008 call fks_inc_chooser()1015 call fks_inc_chooser()
1009c Set Bjorken x's to some random value before calling the dlum() function1016c Set Bjorken x's to some random value before calling the dlum() function
1010 xbk(1)=0.5d01017 xbk(1)=0.5d0
1011 xbk(2)=0.5d01018 xbk(2)=0.5d0
1012 lum=dlum() ! updates IPROC1019 lum=dlum() ! updates IPROC
1013 maxproc_save=max(maxproc_save,IPROC)
1014 if (doreweight) then
1015 call reweight_settozero()
1016 call reweight_settozero_all(nFKSprocess*2,.true.)
1017 call reweight_settozero_all(nFKSprocess*2-1,.true.)
1018 endif
1019 enddo1020 enddo
1020 write (*,*) 'Total number of FKS directories is', fks_configs1021 write (*,*) 'Total number of FKS directories is', fks_configs
1021c For sum over identical FKS pairs, need to find the identical structures1022c For sum over identical FKS pairs, need to find the identical structures
@@ -1207,6 +1208,7 @@
12071208
1208 subroutine update_fks_dir(nFKS)1209 subroutine update_fks_dir(nFKS)
1209 implicit none1210 implicit none
1211 include 'run.inc'
1210 integer nFKS1212 integer nFKS
1211 integer nFKSprocess1213 integer nFKSprocess
1212 common/c_nFKSprocess/nFKSprocess1214 common/c_nFKSprocess/nFKSprocess
@@ -1215,6 +1217,7 @@
1215 call leshouche_inc_chooser()1217 call leshouche_inc_chooser()
1216 call setcuts1218 call setcuts
1217 call setfksfactor(.true.)1219 call setfksfactor(.true.)
1220 if (ickkw.eq.3) call configs_and_props_inc_chooser()
1218 return1221 return
1219 end1222 end
12201223
12211224
=== modified file 'Template/NLO/SubProcesses/fks_singular.f'
--- Template/NLO/SubProcesses/fks_singular.f 2017-05-09 13:42:19 +0000
+++ Template/NLO/SubProcesses/fks_singular.f 2017-08-16 21:26:30 +0000
@@ -1,9 +1,9 @@
1 subroutine compute_born1 subroutine compute_born
2c This subroutine computes the Born matrix elements and adds its value2c This subroutine computes the Born matrix elements and adds its value
3c to the list of weights using the add_wgt subroutine3c to the list of weights using the add_wgt subroutine
4 use extra_weights
4 implicit none5 implicit none
5 include 'nexternal.inc'6 include 'nexternal.inc'
6 include 'reweight0.inc'
7 include 'coupl.inc'7 include 'coupl.inc'
8 include 'timing_variables.inc'8 include 'timing_variables.inc'
9 double complex wgt_c(2)9 double complex wgt_c(2)
@@ -31,9 +31,9 @@
31 subroutine compute_nbody_noborn31 subroutine compute_nbody_noborn
32c This subroutine computes the soft-virtual matrix elements and adds its32c This subroutine computes the soft-virtual matrix elements and adds its
33c value to the list of weights using the add_wgt subroutine33c value to the list of weights using the add_wgt subroutine
34 use extra_weights
34 implicit none35 implicit none
35 include 'nexternal.inc'36 include 'nexternal.inc'
36 include 'reweight.inc'
37 include 'coupl.inc'37 include 'coupl.inc'
38 include 'run.inc'38 include 'run.inc'
39 include 'timing_variables.inc'39 include 'timing_variables.inc'
@@ -94,10 +94,10 @@
94 subroutine compute_real_emission(p,sudakov_damp)94 subroutine compute_real_emission(p,sudakov_damp)
95c This subroutine computes the real-emission matrix elements and adds95c This subroutine computes the real-emission matrix elements and adds
96c its value to the list of weights using the add_wgt subroutine96c its value to the list of weights using the add_wgt subroutine
97 use extra_weights
97 implicit none98 implicit none
98 include 'nexternal.inc'99 include 'nexternal.inc'
99 include 'coupl.inc'100 include 'coupl.inc'
100 include 'reweight0.inc'
101 include 'timing_variables.inc'101 include 'timing_variables.inc'
102 double precision x,dot,f_damp,ffact,s_ev,fks_Sij,p(0:3,nexternal)102 double precision x,dot,f_damp,ffact,s_ev,fks_Sij,p(0:3,nexternal)
103 $ ,wgt1,fx_ev,sudakov_damp103 $ ,wgt1,fx_ev,sudakov_damp
@@ -134,10 +134,10 @@
134 subroutine compute_soft_counter_term(replace_MC_subt)134 subroutine compute_soft_counter_term(replace_MC_subt)
135c This subroutine computes the soft counter term and adds its value to135c This subroutine computes the soft counter term and adds its value to
136c the list of weights using the add_wgt subroutine136c the list of weights using the add_wgt subroutine
137 use extra_weights
137 implicit none138 implicit none
138 include 'nexternal.inc'139 include 'nexternal.inc'
139 include 'coupl.inc'140 include 'coupl.inc'
140 include 'reweight0.inc'
141 include 'timing_variables.inc'141 include 'timing_variables.inc'
142 double precision wgt1,s_s,fks_Sij,fx_s,zero,replace_MC_subt,g22142 double precision wgt1,s_s,fks_Sij,fx_s,zero,replace_MC_subt,g22
143 parameter (zero=0d0)143 parameter (zero=0d0)
@@ -185,11 +185,11 @@
185 subroutine compute_collinear_counter_term(replace_MC_subt)185 subroutine compute_collinear_counter_term(replace_MC_subt)
186c This subroutine computes the collinear counter term and adds its value186c This subroutine computes the collinear counter term and adds its value
187c to the list of weights using the add_wgt subroutine187c to the list of weights using the add_wgt subroutine
188 use extra_weights
188 implicit none189 implicit none
189 include 'nexternal.inc'190 include 'nexternal.inc'
190 include 'coupl.inc'191 include 'coupl.inc'
191 include 'fks_powers.inc'192 include 'fks_powers.inc'
192 include 'reweight.inc'
193 include 'timing_variables.inc'193 include 'timing_variables.inc'
194 double precision zero,one,s_c,fks_Sij,fx_c,deg_xi_c,deg_lxi_c,wgt1194 double precision zero,one,s_c,fks_Sij,fx_c,deg_xi_c,deg_lxi_c,wgt1
195 & ,wgt3,g22,replace_MC_subt195 & ,wgt3,g22,replace_MC_subt
@@ -248,10 +248,10 @@
248 subroutine compute_soft_collinear_counter_term(replace_MC_subt)248 subroutine compute_soft_collinear_counter_term(replace_MC_subt)
249c This subroutine computes the soft-collinear counter term and adds its249c This subroutine computes the soft-collinear counter term and adds its
250c value to the list of weights using the add_wgt subroutine250c value to the list of weights using the add_wgt subroutine
251 use extra_weights
251 implicit none252 implicit none
252 include 'nexternal.inc'253 include 'nexternal.inc'
253 include 'coupl.inc'254 include 'coupl.inc'
254 include 'reweight.inc'
255 include 'fks_powers.inc'255 include 'fks_powers.inc'
256 include 'timing_variables.inc'256 include 'timing_variables.inc'
257 double precision zero,one,s_sc,fks_Sij,fx_sc,wgt1,wgt3,deg_xi_sc257 double precision zero,one,s_sc,fks_Sij,fx_sc,wgt1,wgt3,deg_xi_sc
@@ -314,6 +314,7 @@
314 end314 end
315315
316 subroutine compute_MC_subt_term(p,gfactsf,gfactcl,probne)316 subroutine compute_MC_subt_term(p,gfactsf,gfactcl,probne)
317 use extra_weights
317 implicit none318 implicit none
318c This subroutine computes the MonteCarlo subtraction terms and adds319c This subroutine computes the MonteCarlo subtraction terms and adds
319c their values to the list of weights using the add_wgt subroutine. It320c their values to the list of weights using the add_wgt subroutine. It
@@ -324,7 +325,6 @@
324 include 'nexternal.inc'325 include 'nexternal.inc'
325 include 'madfks_mcatnlo.inc'326 include 'madfks_mcatnlo.inc'
326 include 'timing_variables.inc'327 include 'timing_variables.inc'
327 include 'reweight.inc'
328 include 'coupl.inc'328 include 'coupl.inc'
329 integer nofpartners,i329 integer nofpartners,i
330 double precision p(0:3,nexternal),gfactsf,gfactcl,probne,x,dot330 double precision p(0:3,nexternal),gfactsf,gfactcl,probne,x,dot
@@ -613,13 +613,13 @@
613c Compute all the relevant prefactors for the Born and the soft-virtual,613c Compute all the relevant prefactors for the Born and the soft-virtual,
614c i.e. all the nbody contributions. Also initialises the plots and614c i.e. all the nbody contributions. Also initialises the plots and
615c bpower.615c bpower.
616 use extra_weights
616 implicit none617 implicit none
617 include 'nexternal.inc'618 include 'nexternal.inc'
618 include 'run.inc'619 include 'run.inc'
619 include 'genps.inc'620 include 'genps.inc'
620 include 'reweight0.inc'
621 include 'timing_variables.inc'621 include 'timing_variables.inc'
622 double precision pi,unwgtfun,vegas_wgt,enhance,xnoborn_cnt,xtot622 double precision pi,vegas_wgt,enhance,xnoborn_cnt,xtot
623 $ ,bpower,cpower,tiny623 $ ,bpower,cpower,tiny
624 data xnoborn_cnt /0d0/624 data xnoborn_cnt /0d0/
625 integer inoborn_cnt,i625 integer inoborn_cnt,i
@@ -694,7 +694,7 @@
694 if(wgtcpower.ne.cpowerinput.and.dabs(cpower+1d0).gt.tiny)then694 if(wgtcpower.ne.cpowerinput.and.dabs(cpower+1d0).gt.tiny)then
695 write(*,*)'Inconsistency in the computation of cpower',695 write(*,*)'Inconsistency in the computation of cpower',
696 # wgtcpower,cpowerinput696 # wgtcpower,cpowerinput
697 write(*,*)'Check value in reweight0.inc'697 write(*,*)'Check value in extra_weights.f'
698 stop698 stop
699 endif699 endif
700 firsttime=.false.700 firsttime=.false.
@@ -732,11 +732,10 @@
732 enhance=0d0732 enhance=0d0
733 endif733 endif
734 endif734 endif
735 call unweight_function(p_born,unwgtfun)
736 call set_cms_stuff(0)735 call set_cms_stuff(0)
737c f_* multiplication factors for Born and nbody736c f_* multiplication factors for Born and nbody
738 f_b=jac_cnt(0)*xinorm_ev/(min(xiimax_ev,xiBSVcut_used)*shat/(16737 f_b=jac_cnt(0)*xinorm_ev/(min(xiimax_ev,xiBSVcut_used)*shat/(16
739 $ *pi**2))*enhance*unwgtfun *fkssymmetryfactorBorn*vegas_wgt738 $ *pi**2))*enhance*fkssymmetryfactorBorn*vegas_wgt
740 f_nb=f_b739 f_nb=f_b
741 call cpu_time(tAfter)740 call cpu_time(tAfter)
742 tf_nb=tf_nb+(tAfter-tBefore)741 tf_nb=tf_nb+(tAfter-tBefore)
@@ -753,7 +752,7 @@
753 include 'fks_powers.inc'752 include 'fks_powers.inc'
754 include 'coupl.inc'753 include 'coupl.inc'
755 include 'timing_variables.inc'754 include 'timing_variables.inc'
756 double precision unwgtfun,vegas_wgt,enhance,xnoborn_cnt,xtot755 double precision vegas_wgt,enhance,xnoborn_cnt,xtot
757 & ,prefact,prefact_cnt_ssc,prefact_deg,prefact_c,prefact_coll756 & ,prefact,prefact_cnt_ssc,prefact_deg,prefact_c,prefact_coll
758 & ,jac_ev,pi,prefact_cnt_ssc_c,prefact_coll_c,prefact_deg_slxi757 & ,jac_ev,pi,prefact_cnt_ssc_c,prefact_coll_c,prefact_deg_slxi
759 & ,prefact_deg_sxi,zero758 & ,prefact_deg_sxi,zero
@@ -845,11 +844,10 @@
845 enhance=0d0844 enhance=0d0
846 endif845 endif
847 endif846 endif
848 call unweight_function(p_born,unwgtfun)
849 prefact=xinorm_ev/xi_i_fks_ev/(1-y_ij_fks_ev)847 prefact=xinorm_ev/xi_i_fks_ev/(1-y_ij_fks_ev)
850848
851c f_* multiplication factors for real-emission, soft counter, ... etc. 849c f_* multiplication factors for real-emission, soft counter, ... etc.
852 f_r=prefact*jac_ev*enhance*unwgtfun*fkssymmetryfactor*vegas_wgt850 f_r=prefact*jac_ev*enhance*fkssymmetryfactor*vegas_wgt
853 f_MC_S=f_r851 f_MC_S=f_r
854 f_MC_H=f_r852 f_MC_H=f_r
855 if (.not.nocntevents) then853 if (.not.nocntevents) then
@@ -857,9 +855,9 @@
857 & log(xicut_used/min(xiimax_ev,xiScut_used))/(1855 & log(xicut_used/min(xiimax_ev,xiScut_used))/(1
858 & -y_ij_fks_ev)856 & -y_ij_fks_ev)
859 f_s=(prefact+prefact_cnt_ssc)*jac_cnt(0)*enhance857 f_s=(prefact+prefact_cnt_ssc)*jac_cnt(0)*enhance
860 $ *unwgtfun*fkssymmetryfactor*vegas_wgt858 $ *fkssymmetryfactor*vegas_wgt
861 f_s_MC_S=prefact*jac_cnt(0)*enhance859 f_s_MC_S=prefact*jac_cnt(0)*enhance
862 $ *unwgtfun*fkssymmetryfactor*vegas_wgt860 $ *fkssymmetryfactor*vegas_wgt
863 f_s_MC_H=f_s_MC_S861 f_s_MC_H=f_s_MC_S
864862
865 if (pmass(j_fks).eq.0d0) then863 if (pmass(j_fks).eq.0d0) then
@@ -867,9 +865,9 @@
867 prefact_coll=xinorm_cnt(1)/xi_i_fks_cnt(1)*log(delta_used865 prefact_coll=xinorm_cnt(1)/xi_i_fks_cnt(1)*log(delta_used
868 $ /deltaS)/deltaS866 $ /deltaS)/deltaS
869 f_c=(prefact_c+prefact_coll)*jac_cnt(1)867 f_c=(prefact_c+prefact_coll)*jac_cnt(1)
870 $ *enhance*unwgtfun*fkssymmetryfactor*vegas_wgt868 $ *enhance*fkssymmetryfactor*vegas_wgt
871 f_c_MC_S=prefact_c*jac_cnt(1)869 f_c_MC_S=prefact_c*jac_cnt(1)
872 $ *enhance*unwgtfun*fkssymmetryfactor*vegas_wgt870 $ *enhance*fkssymmetryfactor*vegas_wgt
873 f_c_MC_H=f_c_MC_S871 f_c_MC_H=f_c_MC_S
874872
875 call set_cms_stuff(1)873 call set_cms_stuff(1)
@@ -881,12 +879,12 @@
881 $ *log(xicut_used/min(xiimax_cnt(1),xiScut_used))879 $ *log(xicut_used/min(xiimax_cnt(1),xiScut_used))
882 $ *log(delta_used/deltaS)/deltaS880 $ *log(delta_used/deltaS)/deltaS
883 f_dc=jac_cnt(1)*prefact_deg/(shat/(32*pi**2))*enhance881 f_dc=jac_cnt(1)*prefact_deg/(shat/(32*pi**2))*enhance
884 $ *unwgtfun*fkssymmetryfactorDeg*vegas_wgt882 $ *fkssymmetryfactorDeg*vegas_wgt
885 f_sc=(prefact_c+prefact_coll+prefact_cnt_ssc_c883 f_sc=(prefact_c+prefact_coll+prefact_cnt_ssc_c
886 & +prefact_coll_c)*jac_cnt(2)*enhance*unwgtfun884 & +prefact_coll_c)*jac_cnt(2)*enhance
887 & *fkssymmetryfactorDeg*vegas_wgt885 & *fkssymmetryfactorDeg*vegas_wgt
888 f_sc_MC_S=prefact_c*jac_cnt(2)886 f_sc_MC_S=prefact_c*jac_cnt(2)
889 $ *enhance*unwgtfun*fkssymmetryfactor*vegas_wgt887 $ *enhance*fkssymmetryfactor*vegas_wgt
890 f_sc_MC_H=f_sc_MC_S888 f_sc_MC_H=f_sc_MC_S
891889
892 call set_cms_stuff(2)890 call set_cms_stuff(2)
@@ -898,13 +896,13 @@
898 & -log(min(xiimax_cnt(1),xiScut_used))**2 )*1/(2.d0896 & -log(min(xiimax_cnt(1),xiScut_used))**2 )*1/(2.d0
899 & *deltaS)897 & *deltaS)
900 f_dsc(1)=prefact_deg*jac_cnt(2)/(shat/(32*pi**2))*enhance898 f_dsc(1)=prefact_deg*jac_cnt(2)/(shat/(32*pi**2))*enhance
901 & *unwgtfun*fkssymmetryfactorDeg*vegas_wgt899 & *fkssymmetryfactorDeg*vegas_wgt
902 f_dsc(2)=prefact_deg_sxi*jac_cnt(2)/(shat/(32*pi**2))900 f_dsc(2)=prefact_deg_sxi*jac_cnt(2)/(shat/(32*pi**2))
903 & *enhance*unwgtfun*fkssymmetryfactorDeg*vegas_wgt901 & *enhance*fkssymmetryfactorDeg*vegas_wgt
904 f_dsc(3)=prefact_deg_slxi*jac_cnt(2)/(shat/(32*pi**2))902 f_dsc(3)=prefact_deg_slxi*jac_cnt(2)/(shat/(32*pi**2))
905 & *enhance*unwgtfun*fkssymmetryfactorDeg*vegas_wgt903 & *enhance*fkssymmetryfactorDeg*vegas_wgt
906 f_dsc(4)=( prefact_deg+prefact_deg_sxi )*jac_cnt(2)/(shat904 f_dsc(4)=( prefact_deg+prefact_deg_sxi )*jac_cnt(2)/(shat
907 & /(32*pi**2))*enhance*unwgtfun*fkssymmetryfactorDeg905 & /(32*pi**2))*enhance*fkssymmetryfactorDeg
908 & *vegas_wgt906 & *vegas_wgt
909 else907 else
910 f_c=0d0908 f_c=0d0
@@ -940,7 +938,7 @@
940938
941 939
942 subroutine add_wgt(type,wgt1,wgt2,wgt3)940 subroutine add_wgt(type,wgt1,wgt2,wgt3)
943c Adds a contribution to the list in c_weight.inc. 'type' sets the type941c Adds a contribution to the list in weight_lines. 'type' sets the type
944c of the contribution and wgt1..wgt3 are the coefficients multiplying942c of the contribution and wgt1..wgt3 are the coefficients multiplying
945c the logs. The arguments are:943c the logs. The arguments are:
946c type=1 : real-emission944c type=1 : real-emission
@@ -997,7 +995,7 @@
997c corresponding to this contribution: wgt_ME_tree. This weight does995c corresponding to this contribution: wgt_ME_tree. This weight does
998c include the 'ngluon' correction factor for the Born.996c include the 'ngluon' correction factor for the Born.
999c997c
1000c Not set in this subroutine, but included in the c_weights common block998c Not set in this subroutine, but included in the weight_lines module
1001c are the999c are the
1002c wgts(iwgt,icontr) : weights including scale/PDFs/logs. These are1000c wgts(iwgt,icontr) : weights including scale/PDFs/logs. These are
1003c normalised so that they can be used directly to compute cross1001c normalised so that they can be used directly to compute cross
@@ -1016,16 +1014,16 @@
1016c parton_iproc(iproc,icontr) : value of the PDF for the iproc1014c parton_iproc(iproc,icontr) : value of the PDF for the iproc
1017c contribution1015c contribution
1018c parton_pdg(nexternal,iproc,icontr) : value of the PDG codes for1016c parton_pdg(nexternal,iproc,icontr) : value of the PDG codes for
1019c the iproc contribution1017c the iproc contribution
1018 use weight_lines
1019 use extra_weights
1020 implicit none1020 implicit none
1021 include 'nexternal.inc'1021 include 'nexternal.inc'
1022 include 'run.inc'1022 include 'run.inc'
1023 include 'genps.inc'1023 include 'genps.inc'
1024 include 'coupl.inc'1024 include 'coupl.inc'
1025 include 'fks_info.inc'1025 include 'fks_info.inc'
1026 include 'c_weight.inc'
1027 include 'q_es.inc'1026 include 'q_es.inc'
1028 include 'reweight0.inc'
1029 integer type,i,j1027 integer type,i,j
1030 double precision wgt1,wgt2,wgt31028 double precision wgt1,wgt2,wgt3
1031 integer nFKSprocess1029 integer nFKSprocess
@@ -1054,11 +1052,7 @@
1054 if (wgt2.ne.wgt2) return1052 if (wgt2.ne.wgt2) return
1055 if (wgt3.ne.wgt3) return1053 if (wgt3.ne.wgt3) return
1056 icontr=icontr+11054 icontr=icontr+1
1057 if (icontr.gt.max_contr) then1055 call weight_lines_allocated(nexternal,icontr,max_wgt,max_iproc)
1058 write (*,*) 'ERROR in add_wgt: too many contributions'
1059 & ,max_contr
1060 stop 1
1061 endif
1062 itype(icontr)=type1056 itype(icontr)=type
1063 wgt(1,icontr)=wgt11057 wgt(1,icontr)=wgt1
1064 wgt(2,icontr)=wgt21058 wgt(2,icontr)=wgt2
@@ -1133,12 +1127,12 @@
1133 end1127 end
11341128
1135 subroutine include_veto_multiplier1129 subroutine include_veto_multiplier
1130 use weight_lines
1131 use extra_weights
1136 implicit none1132 implicit none
1137c Multiply all the weights by the NNLL-NLO jet veto Sudakov factors,1133c Multiply all the weights by the NNLL-NLO jet veto Sudakov factors,
1138c i.e., the term on the 2nd line of Eq.(20) of arXiv:1412.8408.1134c i.e., the term on the 2nd line of Eq.(20) of arXiv:1412.8408.
1139 include 'nexternal.inc'1135 include 'nexternal.inc'
1140 include 'c_weight.inc'
1141 include 'reweight.inc'
1142 integer i,j1136 integer i,j
1143 if (H1_factor_virt.ne.0d0) then1137 if (H1_factor_virt.ne.0d0) then
1144 call compute_veto_multiplier(H1_factor_virt,1d0,1d01138 call compute_veto_multiplier(H1_factor_virt,1d0,1d0
@@ -1158,10 +1152,10 @@
1158c dependence and saves the weights in the wgts() array. The weights in1152c dependence and saves the weights in the wgts() array. The weights in
1159c this array are now correctly normalised to compute the cross section1153c this array are now correctly normalised to compute the cross section
1160c or to fill histograms.1154c or to fill histograms.
1155 use weight_lines
1161 implicit none1156 implicit none
1162 include 'nexternal.inc'1157 include 'nexternal.inc'
1163 include 'run.inc'1158 include 'run.inc'
1164 include 'c_weight.inc'
1165 include 'coupl.inc'1159 include 'coupl.inc'
1166 include 'timing_variables.inc'1160 include 'timing_variables.inc'
1167 include 'genps.inc'1161 include 'genps.inc'
@@ -1191,14 +1185,11 @@
1191 q2fact(2)=mu2_f1185 q2fact(2)=mu2_f
1192c call the PDFs1186c call the PDFs
1193 xlum = dlum()1187 xlum = dlum()
1194 if (iproc.gt.max_iproc) then1188 iwgt=1
1195 write (*,*) 'ERROR iproc too large',iproc,max_iproc1189 call weight_lines_allocated(nexternal,max_contr,iwgt,iproc)
1196 stop 1
1197 endif
1198c set_pdg_codes fills the niproc, parton_iproc, parton_pdg and parton_pdg_uborn1190c set_pdg_codes fills the niproc, parton_iproc, parton_pdg and parton_pdg_uborn
1199 call set_pdg_codes(iproc,pd,nFKSprocess,i)1191 call set_pdg_codes(iproc,pd,nFKSprocess,i)
1200c iwgt=1 is the central value (i.e. no scale/PDF reweighting).1192c iwgt=1 is the central value (i.e. no scale/PDF reweighting).
1201 iwgt=1
1202 wgt_wo_pdf=(wgt(1,i) + wgt(2,i)*log(mu2_r/mu2_q) + wgt(3,i)1193 wgt_wo_pdf=(wgt(1,i) + wgt(2,i)*log(mu2_r/mu2_q) + wgt(3,i)
1203 & *log(mu2_f/mu2_q))*g_strong(i)**QCDpower(i)1194 & *log(mu2_f/mu2_q))*g_strong(i)**QCDpower(i)
1204 & *rwgt_muR_dep_fac(sqrt(mu2_r),sqrt(mu2_r))1195 & *rwgt_muR_dep_fac(sqrt(mu2_r),sqrt(mu2_r))
@@ -1221,12 +1212,123 @@
1221 return1212 return
1222 end1213 end
12231214
1215 subroutine include_bias_wgt
1216c Include the weight from the bias_wgt_function to all the contributions
1217c in icontr. This only changes the weight of the central value (after
1218c inclusion of alphaS and parton luminosity). Both for 'wgts(1,icontr)'
1219c as well as the the 'parton_iproc(1:niproc(icontr),icontr)', since
1220c these are the ones used in MINT as well as for unweighting. Also the
1221c 'virt_wgt_mint' and 'born_wgt_mint' are updated. Furthermore, to
1222c include the weight also in the 'wgt' array that contain the
1223c coefficients for PDF and scale computations.
1224 use weight_lines
1225 implicit none
1226 integer i,j
1227 double precision bias
1228 character*7 event_norm
1229 common /event_normalisation/event_norm
1230 double precision virt_wgt_mint,born_wgt_mint
1231 common /virt_born_wgt_mint/virt_wgt_mint,born_wgt_mint
1232c Set the bias_wgt to 1 in case we do not have to do any biassing
1233 if (event_norm(1:4).ne.'bias') then
1234 do i=1,icontr
1235 bias_wgt(i)=1d0
1236 enddo
1237 return
1238 endif
1239c loop over all contributions
1240 do i=1,icontr
1241 if (itype(i).eq.1) then
1242 ! use (n+1)-body momenta for the real emission. Pick the
1243 ! first IPROC for parton PDGs.
1244 call bias_weight_function(momenta_m(0,1,2,i),parton_pdg(1,1
1245 $ ,i),bias)
1246 else
1247 ! use n-body momenta for all the other contributions. Pick
1248 ! the first IPROC for parton PDGs.
1249 call bias_weight_function(momenta_m(0,1,1,i),parton_pdg(1,1
1250 $ ,i),bias)
1251 endif
1252 bias_wgt(i)=bias
1253c Update the weights:
1254 wgts(1,i)=wgts(1,i)*bias_wgt(i)
1255 do j=1,niproc(i)
1256 parton_iproc(j,i)=parton_iproc(j,i)*bias_wgt(i)
1257 enddo
1258 do j=1,3
1259 wgt(j,i)=wgt(j,i)*bias_wgt(i)
1260 enddo
1261 if (itype(i).eq.14) then
1262 virt_wgt_mint=virt_wgt_mint*bias_wgt(i)
1263 born_wgt_mint=born_wgt_mint*bias_wgt(i)
1264 endif
1265 enddo
1266 return
1267 end
1268
1269 subroutine include_inverse_bias_wgt(inv_bias)
1270c Update the inverse of the bias in the event weight. All information in
1271c the rwgt_lines is NOT updated.
1272 use weight_lines
1273 use extra_weights
1274 implicit none
1275 include 'genps.inc'
1276 include 'nFKSconfigs.inc'
1277 integer i,ict,ipr,ii
1278 double precision wgt_num,wgt_denom,inv_bias
1279 character*7 event_norm
1280 common /event_normalisation/event_norm
1281 integer iproc_save(fks_configs),eto(maxproc,fks_configs)
1282 $ ,etoi(maxproc,fks_configs),maxproc_found
1283 common/cproc_combination/iproc_save,eto,etoi,maxproc_found
1284 logical Hevents
1285 common/SHevents/Hevents
1286 if (event_norm(1:4).ne.'bias') then
1287 inv_bias=1d0
1288 return
1289 endif
1290 wgt_num=0d0
1291 wgt_denom=0d0
1292 do i=1,icontr_sum(0,icontr_picked)
1293 ict=icontr_sum(i,icontr_picked)
1294 if (bias_wgt(ict).eq.0d0) then
1295 write (*,*) "ERROR in include_inverse_bias_wgt: "/
1296 $ /"bias_wgt is equal to zero",ict,bias_wgt
1297 stop 1
1298 endif
1299c for all the rwgt_lines, remove the bias-wgt contribution from the
1300c weights there. Note that the wgtref (also written in the event file)
1301c keeps its contribution from the bias_wgt.
1302 if (.not. Hevents) then
1303 ipr=eto(etoi(iproc_picked,nFKS(ict)),nFKS(ict))
1304 do ii=1,iproc_save(nFKS(ict))
1305 if (eto(ii,nFKS(ict)).ne.ipr) cycle
1306 wgt_denom=wgt_denom+parton_iproc(ii,ict)
1307 wgt_num=wgt_num+parton_iproc(ii,ict)/bias_wgt(ict)
1308 enddo
1309 else
1310 ipr=iproc_picked
1311 wgt_denom=wgt_denom+parton_iproc(ipr,ict)
1312 wgt_num=wgt_num+parton_iproc(ipr,ict)/bias_wgt(ict)
1313 endif
1314 enddo
1315 if (abs((wgtref-wgt_denom)/(wgtref+wgt_denom)).gt.1d-10) then
1316 write (*,*) "ERROR in include_inverse_bias_wgt: "/
1317 $ /"reference weight not equal to recomputed weight",wgtref
1318 $ ,wgt_denom
1319 stop 1
1320 endif
1321c update the event weight to be written in the file
1322 inv_bias=wgt_num/wgt_denom
1323 return
1324 end
1325
12241326
1225 subroutine set_pdg_codes(iproc,pd,iFKS,ict)1327 subroutine set_pdg_codes(iproc,pd,iFKS,ict)
1328 use weight_lines
1226 implicit none1329 implicit none
1227 include 'nexternal.inc'1330 include 'nexternal.inc'
1228 include 'genps.inc'1331 include 'genps.inc'
1229 include 'c_weight.inc'
1230 include 'fks_info.inc'1332 include 'fks_info.inc'
1231 integer j,k,iproc,ict,iFKS1333 integer j,k,iproc,ict,iFKS
1232 double precision pd(0:maxproc),conv1334 double precision pd(0:maxproc),conv
@@ -1274,14 +1376,13 @@
1274 1376
1275 1377
1276 subroutine reweight_scale1378 subroutine reweight_scale
1277c Use the saved c_weight info to perform scale reweighting. Extends the1379c Use the saved weight_lines info to perform scale reweighting. Extends the
1278c wgts() array to include the weights.1380c wgts() array to include the weights.
1381 use weight_lines
1382 use extra_weights
1279 implicit none1383 implicit none
1280 include 'nexternal.inc'1384 include 'nexternal.inc'
1281 include 'run.inc'1385 include 'run.inc'
1282 include 'c_weight.inc'
1283 include 'reweight.inc'
1284 include 'reweightNLO.inc'
1285 include 'timing_variables.inc'1386 include 'timing_variables.inc'
1286 integer i,kr,kf,iwgt_save,dd1387 integer i,kr,kf,iwgt_save,dd
1287 double precision xlum(maxscales),dlum,pi,mu2_r(maxscales),c_mu2_r1388 double precision xlum(maxscales),dlum,pi,mu2_r(maxscales),c_mu2_r
@@ -1298,7 +1399,7 @@
1298 if (icontr.eq.0) return1399 if (icontr.eq.0) return
1299c currently we have 'iwgt' weights in the wgts() array.1400c currently we have 'iwgt' weights in the wgts() array.
1300 iwgt_save=iwgt1401 iwgt_save=iwgt
1301c loop over all the contributions in the c_weights common block1402c loop over all the contributions in the weight lines module
1302 do i=1,icontr1403 do i=1,icontr
1303 iwgt=iwgt_save1404 iwgt=iwgt_save
1304 nFKSprocess=nFKS(i)1405 nFKSprocess=nFKS(i)
@@ -1328,11 +1429,8 @@
1328 do kr=1,nint(scalevarR(0))1429 do kr=1,nint(scalevarR(0))
1329 if ((.not. lscalevar(dd)) .and. kr.ne.1) exit1430 if ((.not. lscalevar(dd)) .and. kr.ne.1) exit
1330 iwgt=iwgt+1 ! increment the iwgt for the wgts() array1431 iwgt=iwgt+1 ! increment the iwgt for the wgts() array
1331 if (iwgt.gt.max_wgt) then1432 call weight_lines_allocated(nexternal,max_contr,iwgt
1332 write (*,*) 'ERROR too many weights in '/1433 $ ,max_iproc)
1333 $ /'reweight_scale',iwgt,max_wgt
1334 stop 1
1335 endif
1336c add the weights to the array1434c add the weights to the array
1337 wgts(iwgt,i)=xlum(kf) * (wgt(1,i)+wgt(2,i)1435 wgts(iwgt,i)=xlum(kf) * (wgt(1,i)+wgt(2,i)
1338 $ *log(mu2_r(kr)/mu2_q)+wgt(3,i)*log(mu2_f(kf)1436 $ *log(mu2_r(kr)/mu2_q)+wgt(3,i)*log(mu2_f(kf)
@@ -1349,15 +1447,14 @@
1349 end1447 end
13501448
1351 subroutine reweight_scale_NNLL1449 subroutine reweight_scale_NNLL
1352c Use the saved c_weight info to perform scale reweighting. Extends the1450c Use the saved weight lines info to perform scale reweighting. Extends the
1353c wgts() array to include the weights. Special for the NNLL+NLO jet-veto1451c wgts() array to include the weights. Special for the NNLL+NLO jet-veto
1354c computations (ickkw.eq.-1).1452c computations (ickkw.eq.-1).
1453 use weight_lines
1454 use extra_weights
1355 implicit none1455 implicit none
1356 include 'nexternal.inc'1456 include 'nexternal.inc'
1357 include 'run.inc'1457 include 'run.inc'
1358 include 'c_weight.inc'
1359 include 'reweight.inc'
1360 include 'reweightNLO.inc'
1361 include 'timing_variables.inc'1458 include 'timing_variables.inc'
1362 integer i,ks,kh,iwgt_save1459 integer i,ks,kh,iwgt_save
1363 double precision xlum(maxscales),dlum,pi,mu2_r(maxscales)1460 double precision xlum(maxscales),dlum,pi,mu2_r(maxscales)
@@ -1394,7 +1491,7 @@
1394 endif1491 endif
1395 enddo1492 enddo
1396 enddo1493 enddo
1397c loop over all the contributions in the c_weights common block1494c loop over all the contributions in the weight lines module
1398 do i=1,icontr1495 do i=1,icontr
1399 iwgt=iwgt_save1496 iwgt=iwgt_save
1400 nFKSprocess=nFKS(i)1497 nFKSprocess=nFKS(i)
@@ -1414,11 +1511,8 @@
1414 q2fact(2)=mu2_f(ks)1511 q2fact(2)=mu2_f(ks)
1415 xlum(ks) = dlum()1512 xlum(ks) = dlum()
1416 iwgt=iwgt+1 ! increment the iwgt for the wgts() array1513 iwgt=iwgt+1 ! increment the iwgt for the wgts() array
1417 if (iwgt.gt.max_wgt) then1514 call weight_lines_allocated(nexternal,max_contr,iwgt
1418 write (*,*) 'ERROR too many weights in reweight_scale'1515 $ ,max_iproc)
1419 & ,iwgt,max_wgt
1420 stop 1
1421 endif
1422c add the weights to the array1516c add the weights to the array
1423 if (itype(i).ne.7) then1517 if (itype(i).ne.7) then
1424 wgts(iwgt,i)=xlum(ks) * (wgt(1,i)+wgt(2,i)1518 wgts(iwgt,i)=xlum(ks) * (wgt(1,i)+wgt(2,i)
@@ -1445,14 +1539,13 @@
1445 end1539 end
14461540
1447 subroutine reweight_pdf1541 subroutine reweight_pdf
1448c Use the saved c_weight info to perform PDF reweighting. Extends the1542c Use the saved weight_lines info to perform PDF reweighting. Extends the
1449c wgts() array to include the weights.1543c wgts() array to include the weights.
1544 use weight_lines
1545 use extra_weights
1450 implicit none1546 implicit none
1451 include 'nexternal.inc'1547 include 'nexternal.inc'
1452 include 'run.inc'1548 include 'run.inc'
1453 include 'c_weight.inc'
1454 include 'reweight.inc'
1455 include 'reweightNLO.inc'
1456 include 'timing_variables.inc'1549 include 'timing_variables.inc'
1457 integer n,i,nn1550 integer n,i,nn
1458 double precision xlum,dlum,pi,mu2_r,mu2_f,mu2_q,rwgt_muR_dep_fac,g1551 double precision xlum,dlum,pi,mu2_r,mu2_f,mu2_q,rwgt_muR_dep_fac,g
@@ -1470,11 +1563,8 @@
1470c allows for better caching of the PDFs1563c allows for better caching of the PDFs
1471 do n=0,nmemPDF(nn)1564 do n=0,nmemPDF(nn)
1472 iwgt=iwgt+11565 iwgt=iwgt+1
1473 if (iwgt.gt.max_wgt) then1566 call weight_lines_allocated(nexternal,max_contr,iwgt
1474 write (*,*) 'ERROR too many weights in reweight_pdf',iwgt1567 $ ,max_iproc)
1475 & ,max_wgt
1476 stop 1
1477 endif
1478 call InitPDFm(nn,n)1568 call InitPDFm(nn,n)
1479 do i=1,icontr1569 do i=1,icontr
1480 nFKSprocess=nFKS(i)1570 nFKSprocess=nFKS(i)
@@ -1508,9 +1598,9 @@
1508c that there is an unique PS configuration: at most one Born, one real1598c that there is an unique PS configuration: at most one Born, one real
1509c and one set of counter terms. Among other things, this means that one1599c and one set of counter terms. Among other things, this means that one
1510c must do MC over FKS directories.1600c must do MC over FKS directories.
1601 use weight_lines
1511 implicit none1602 implicit none
1512 include 'nexternal.inc'1603 include 'nexternal.inc'
1513 include 'c_weight.inc'
1514 include 'appl_common.inc'1604 include 'appl_common.inc'
1515 include 'nFKSconfigs.inc'1605 include 'nFKSconfigs.inc'
1516 include 'genps.inc'1606 include 'genps.inc'
@@ -1606,9 +1696,9 @@
1606c the pdg_uborn (the PDG codes for the underlying Born process) the PDG1696c the pdg_uborn (the PDG codes for the underlying Born process) the PDG
1607c codes of i_fks and j_fks are combined to give the PDG code of the1697c codes of i_fks and j_fks are combined to give the PDG code of the
1608c mother and the extra (n+1) parton is given the PDG code of the gluon.1698c mother and the extra (n+1) parton is given the PDG code of the gluon.
1699 use weight_lines
1609 implicit none1700 implicit none
1610 include 'nexternal.inc'1701 include 'nexternal.inc'
1611 include 'c_weight.inc'
1612 include 'fks_info.inc'1702 include 'fks_info.inc'
1613 include 'genps.inc'1703 include 'genps.inc'
1614 integer k,ict,iFKS1704 integer k,ict,iFKS
@@ -1651,9 +1741,9 @@
1651 subroutine get_wgt_nbody(sig)1741 subroutine get_wgt_nbody(sig)
1652c Sums all the central weights that contribution to the nbody cross1742c Sums all the central weights that contribution to the nbody cross
1653c section1743c section
1744 use weight_lines
1654 implicit none1745 implicit none
1655 include 'nexternal.inc'1746 include 'nexternal.inc'
1656 include 'c_weight.inc'
1657 double precision sig1747 double precision sig
1658 integer i1748 integer i
1659 sig=0d01749 sig=0d0
@@ -1670,9 +1760,9 @@
1670 subroutine get_wgt_no_nbody(sig)1760 subroutine get_wgt_no_nbody(sig)
1671c Sums all the central weights that contribution to the cross section1761c Sums all the central weights that contribution to the cross section
1672c excluding the nbody contributions.1762c excluding the nbody contributions.
1763 use weight_lines
1673 implicit none1764 implicit none
1674 include 'nexternal.inc'1765 include 'nexternal.inc'
1675 include 'c_weight.inc'
1676 double precision sig1766 double precision sig
1677 integer i1767 integer i
1678 sig=0d01768 sig=0d0
@@ -1688,20 +1778,20 @@
16881778
1689 subroutine fill_plots1779 subroutine fill_plots
1690c Calls the analysis routine (which fill plots) for all the1780c Calls the analysis routine (which fill plots) for all the
1691c contributions in the c_weight common block. Instead of really calling1781c contributions in the weight_lines module. Instead of really calling
1692c it for all, it first checks if weights can be summed (i.e. they have1782c it for all, it first checks if weights can be summed (i.e. they have
1693c the same PDG codes and the same momenta) before calling the analysis1783c the same PDG codes and the same momenta) before calling the analysis
1694c to greatly reduce the calls to the analysis routines.1784c to greatly reduce the calls to the analysis routines.
1785 use weight_lines
1786 use extra_weights
1695 implicit none1787 implicit none
1696 include 'nexternal.inc'1788 include 'nexternal.inc'
1697 include 'c_weight.inc'
1698 include 'reweight0.inc'
1699 include 'timing_variables.inc'1789 include 'timing_variables.inc'
1700 integer i,ii,j,max_weight1790 integer i,ii,j,max_weight
1701 logical momenta_equal,pdg_equal1791 logical momenta_equal,pdg_equal
1702 external momenta_equal,pdg_equal1792 external momenta_equal,pdg_equal
1703 parameter (max_weight=maxscales*maxscales+maxpdfs+1)1793 double precision,allocatable :: www(:)
1704 double precision www(max_weight)1794 save max_weight
1705 call cpu_time(tBefore)1795 call cpu_time(tBefore)
1706 if (icontr.eq.0) return1796 if (icontr.eq.0) return
1707c fill the plots_wgts. Check if we can sum weights together before1797c fill the plots_wgts. Check if we can sum weights together before
@@ -1739,10 +1829,14 @@
1739 enddo1829 enddo
1740 do i=1,icontr1830 do i=1,icontr
1741 if (plot_wgts(1,i).ne.0d0) then1831 if (plot_wgts(1,i).ne.0d0) then
1742 if (iwgt.gt.max_weight) then1832 if (.not.allocated(www)) then
1743 write (*,*) 'ERROR too many weights in fill_plots',iwgt1833 allocate(www(iwgt))
1744 & ,max_weight1834 max_weight=iwgt
1745 stop 11835 elseif(iwgt.ne.max_weight) then
1836 write (*,*) 'Error in fill_plots (fks_singular.f): '/
1837 $ /'number of weights should not vary between PS '/
1838 $ /'points',iwgt,max_weight
1839 stop
1746 endif1840 endif
1747 do j=1,iwgt1841 do j=1,iwgt
1748 www(j)=plot_wgts(j,i)1842 www(j)=plot_wgts(j,i)
@@ -1758,19 +1852,32 @@
17581852
1759 subroutine fill_mint_function(f)1853 subroutine fill_mint_function(f)
1760c Fills the function that is returned to the MINT integrator1854c Fills the function that is returned to the MINT integrator
1855 use weight_lines
1761 implicit none1856 implicit none
1762 include 'nexternal.inc'1857 include 'nexternal.inc'
1763 include 'c_weight.inc'
1764 include 'mint.inc'1858 include 'mint.inc'
1765 integer i1859 integer i
1766 double precision f(nintegrals),sigint1860 double precision f(nintegrals),sigint,bias
1767 double precision virt_wgt_mint,born_wgt_mint1861 double precision virt_wgt_mint,born_wgt_mint
1768 common /virt_born_wgt_mint/virt_wgt_mint,born_wgt_mint1862 common /virt_born_wgt_mint/virt_wgt_mint,born_wgt_mint
1769 double precision virtual_over_born1863 double precision virtual_over_born
1770 common /c_vob/ virtual_over_born1864 common /c_vob/ virtual_over_born
1865 character*7 event_norm
1866 common /event_normalisation/event_norm
1771 sigint=0d01867 sigint=0d0
1772 do i=1,icontr1868 do i=1,icontr
1773 sigint=sigint+wgts(1,i)1869 if (event_norm(1:4).ne.'bias') then
1870 sigint=sigint+wgts(1,i)
1871 else
1872 if (itype(i).eq.1) then
1873 call bias_weight_function(momenta_m(0,1,2,i),parton_pdg(1
1874 $ ,1,i),bias)
1875 else
1876 call bias_weight_function(momenta_m(0,1,1,i),parton_pdg(1
1877 $ ,1,i),bias)
1878 endif
1879 sigint=sigint+wgts(1,i)*bias
1880 endif
1774 enddo1881 enddo
1775 f(1)=abs(sigint)1882 f(1)=abs(sigint)
1776 f(2)=sigint1883 f(2)=sigint
@@ -1786,10 +1893,10 @@
1786c Includes the shape function from the MC counter terms in the shower1893c Includes the shape function from the MC counter terms in the shower
1787c starting scale. This function needs to be called (at least) once per1894c starting scale. This function needs to be called (at least) once per
1788c FKS configuration that is included in the current PS point.1895c FKS configuration that is included in the current PS point.
1896 use weight_lines
1789 implicit none1897 implicit none
1790 include 'nexternal.inc'1898 include 'nexternal.inc'
1791 include 'run.inc'1899 include 'run.inc'
1792 include 'c_weight.inc'
1793 include 'nFKSconfigs.inc'1900 include 'nFKSconfigs.inc'
1794 integer i,iFKS,Hevents,izero,mohdr1901 integer i,iFKS,Hevents,izero,mohdr
1795 double precision ddum(6),p(0:3,nexternal)1902 double precision ddum(6),p(0:3,nexternal)
@@ -1847,9 +1954,9 @@
1847c the MC counter terms for the H-events FKS configuration by FKS1954c the MC counter terms for the H-events FKS configuration by FKS
1848c configuration, while for the S-events also contributions from the1955c configuration, while for the S-events also contributions from the
1849c various FKS configurations can be summed together.1956c various FKS configurations can be summed together.
1957 use weight_lines
1850 implicit none1958 implicit none
1851 include 'nexternal.inc'1959 include 'nexternal.inc'
1852 include 'c_weight.inc'
1853 include 'genps.inc'1960 include 'genps.inc'
1854 include 'nFKSconfigs.inc'1961 include 'nFKSconfigs.inc'
1855 include 'fks_info.inc'1962 include 'fks_info.inc'
@@ -1953,9 +2060,9 @@
1953c necessarily the same for all of these summed FKS configurations). Take2060c necessarily the same for all of these summed FKS configurations). Take
1954c the weighted average over the FKS configurations as the shower scale2061c the weighted average over the FKS configurations as the shower scale
1955c for the summed contribution.2062c for the summed contribution.
2063 use weight_lines
1956 implicit none2064 implicit none
1957 include 'nexternal.inc'2065 include 'nexternal.inc'
1958 include 'c_weight.inc'
1959 include 'nFKSconfigs.inc'2066 include 'nFKSconfigs.inc'
1960 integer i,j,ict2067 integer i,j,ict
1961 double precision tmp_wgt(fks_configs),showerscale(fks_configs)2068 double precision tmp_wgt(fks_configs),showerscale(fks_configs)
@@ -2009,9 +2116,9 @@
2009 subroutine fill_mint_function_NLOPS(f,n1body_wgt)2116 subroutine fill_mint_function_NLOPS(f,n1body_wgt)
2010c Fills the function that is returned to the MINT integrator. Depending2117c Fills the function that is returned to the MINT integrator. Depending
2011c on the imode we should or should not include the virtual corrections.2118c on the imode we should or should not include the virtual corrections.
2119 use weight_lines
2012 implicit none2120 implicit none
2013 include 'nexternal.inc'2121 include 'nexternal.inc'
2014 include 'c_weight.inc'
2015 include 'mint.inc'2122 include 'mint.inc'
2016 integer i,j,ict2123 integer i,j,ict
2017 double precision f(nintegrals),sigint,sigint1,sigint_ABS2124 double precision f(nintegrals),sigint,sigint1,sigint_ABS
@@ -2099,9 +2206,9 @@
2099 subroutine pick_unweight_contr(iFKS_picked)2206 subroutine pick_unweight_contr(iFKS_picked)
2100c Randomly pick (weighted by the ABS values) the contribution to a given2207c Randomly pick (weighted by the ABS values) the contribution to a given
2101c PS point that should be written in the event file.2208c PS point that should be written in the event file.
2209 use weight_lines
2102 implicit none2210 implicit none
2103 include 'nexternal.inc'2211 include 'nexternal.inc'
2104 include 'c_weight.inc'
2105 include 'genps.inc'2212 include 'genps.inc'
2106 include 'nFKSconfigs.inc'2213 include 'nFKSconfigs.inc'
2107 include 'fks_info.inc'2214 include 'fks_info.inc'
@@ -2179,19 +2286,21 @@
2179c Fills the lines, n_ctr_str, to be written in an event file with the2286c Fills the lines, n_ctr_str, to be written in an event file with the
2180c (internal) information to perform scale and/or PDF reweighting. All2287c (internal) information to perform scale and/or PDF reweighting. All
2181c information is available in each line to do the reweighting, apart2288c information is available in each line to do the reweighting, apart
2182c from the momenta: these are put in the momenta_str_l() array, and a2289c from the momenta: these are put in the momenta_str() array, and a
2183c label in each of the n_ctr_str refers to a corresponding set of2290c label in each of the n_ctr_str refers to a corresponding set of
2184c momenta in the momenta_str_l() array.2291c momenta in the momenta_str() array.
2292 use weight_lines
2293 use extra_weights
2185 implicit none2294 implicit none
2186 include 'nexternal.inc'2295 include 'nexternal.inc'
2187 include 'c_weight.inc'
2188 include 'reweight0.inc'
2189 include 'genps.inc'2296 include 'genps.inc'
2190 include 'nFKSconfigs.inc'2297 include 'nFKSconfigs.inc'
2191 include 'fks_info.inc'2298 include 'fks_info.inc'
2192 integer k,i,ii,j,jj,ict,ipr,momenta_conf(2)2299 integer k,i,ii,j,jj,ict,ipr,momenta_conf(2)
2193 logical momenta_equal,found2300 logical momenta_equal,found
2194 double precision conv,momenta_str_l(0:3,nexternal,max_n_ctr)2301 double precision conv
2302 double precision,allocatable :: temp3(:,:,:)
2303 character(len=1024),allocatable :: ctemp(:)
2195 external momenta_equal2304 external momenta_equal
2196 character*512 procid,str_temp2305 character*512 procid,str_temp
2197 parameter (conv=389379660d0) ! conversion to picobarns2306 parameter (conv=389379660d0) ! conversion to picobarns
@@ -2200,15 +2309,17 @@
2200 common/cproc_combination/iproc_save,eto,etoi,maxproc_found2309 common/cproc_combination/iproc_save,eto,etoi,maxproc_found
2201 logical Hevents2310 logical Hevents
2202 common/SHevents/Hevents2311 common/SHevents/Hevents
2312 if (.not.allocated(momenta_str)) allocate(momenta_str(0:3
2313 $ ,max_mext,max_mom_str))
2203 wgtref=unwgt(iproc_picked,icontr_picked)2314 wgtref=unwgt(iproc_picked,icontr_picked)
2204 n_ctr_found=02315 n_ctr_found=0
2205 n_mom_conf=02316 n_mom_conf=0
2206c Loop over all the contributions in the picked contribution (the latter2317c Loop over all the contributions in the picked contribution (the latter
2207c is chosen in the pick_unweight_cont() subroutine)2318c is chosen in the pick_unweight_contr() subroutine)
2208 do i=1,icontr_sum(0,icontr_picked)2319 do i=1,icontr_sum(0,icontr_picked)
2209 ict=icontr_sum(i,icontr_picked)2320 ict=icontr_sum(i,icontr_picked)
2210c Check if the current set of momenta are already available in the2321c Check if the current set of momenta are already available in the
2211c momenta_str_l array. If not, add it.2322c momenta_str array. If not, add it.
2212 found=.false.2323 found=.false.
2213 do k=1,22324 do k=1,2
2214 do j=1,n_mom_conf2325 do j=1,n_mom_conf
@@ -2216,7 +2327,7 @@
2216 momenta_conf(k)=02327 momenta_conf(k)=0
2217 cycle2328 cycle
2218 endif2329 endif
2219 if (momenta_equal(momenta_str_l(0,1,j),2330 if (momenta_equal(momenta_str(0,1,j),
2220 & momenta_m(0,1,k,ict))) then2331 & momenta_m(0,1,k,ict))) then
2221 momenta_conf(k)=j2332 momenta_conf(k)=j
2222 found=.true.2333 found=.true.
@@ -2225,12 +2336,20 @@
2225 enddo2336 enddo
2226 if (.not. found) then2337 if (.not. found) then
2227 n_mom_conf=n_mom_conf+12338 n_mom_conf=n_mom_conf+1
2339 if (n_mom_conf.gt.max_mom_str .or. nexternal.gt.max_mext)
2340 $ then
2341 allocate(temp3(0:3,max(nexternal,max_mext)
2342 $ ,max(n_mom_conf,max_mom_str)))
2343 temp3(0:3,1:min(nexternal,max_mext)
2344 $ ,1:min(max_mom_str,n_mom_conf))=momenta_str
2345 call move_alloc(temp3,momenta_str)
2346 max_mom_str=max(n_mom_conf,max_mom_str)
2347 max_mext=max(nexternal,max_mext)
2348 endif
2228 do ii=1,nexternal2349 do ii=1,nexternal
2229 do jj=0,32350 do jj=0,3
2230 momenta_str(jj,ii,n_mom_conf)=2351 momenta_str(jj,ii,n_mom_conf)=
2231 & momenta_m(jj,ii,k,ict)2352 & momenta_m(jj,ii,k,ict)
2232 momenta_str_l(jj,ii,n_mom_conf)=
2233 & momenta_m(jj,ii,k,ict)
2234 enddo2353 enddo
2235 enddo2354 enddo
2236 momenta_conf(k)=n_mom_conf2355 momenta_conf(k)=n_mom_conf
@@ -2244,6 +2363,15 @@
2244 if (eto(ii,nFKS(ict)).ne.ipr) cycle2363 if (eto(ii,nFKS(ict)).ne.ipr) cycle
2245 n_ctr_found=n_ctr_found+12364 n_ctr_found=n_ctr_found+1
22462365
2366 if (.not.allocated(n_ctr_str))
2367 $ allocate(n_ctr_str(max_n_ctr))
2368 if (n_ctr_found.gt.max_n_ctr) then
2369 allocate(ctemp(n_ctr_found))
2370 ctemp(1:max_n_ctr)=n_ctr_str
2371 call move_alloc(ctemp,n_ctr_str)
2372 max_n_ctr=n_ctr_found
2373 endif
2374
2247 if (nincoming.eq.2) then2375 if (nincoming.eq.2) then
2248 write (n_ctr_str(n_ctr_found),'(5(1x,d18.12),1x,i2)')2376 write (n_ctr_str(n_ctr_found),'(5(1x,d18.12),1x,i2)')
2249 & (wgt(j,ict)*conv,j=1,3),(wgt_me_tree(j,ict),j=1,2),2377 & (wgt(j,ict)*conv,j=1,3),(wgt_me_tree(j,ict),j=1,2),
@@ -2264,8 +2392,7 @@
2264 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '2392 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '
2265 & //trim(adjustl(procid))2393 & //trim(adjustl(procid))
22662394
2267 write (str_temp,2395 write (str_temp,30)
2268 & '(i2,6(1x,d14.8),6(1x,i2),1x,i8,1x,d18.12)')
2269 & QCDpower(ict),2396 & QCDpower(ict),
2270 & (bjx(j,ict),j=1,2),2397 & (bjx(j,ict),j=1,2),
2271 & (scales2(j,ict),j=1,3),2398 & (scales2(j,ict),j=1,3),
@@ -2276,7 +2403,8 @@
2276 & fks_i_d(nFKS(ict)),2403 & fks_i_d(nFKS(ict)),
2277 & fks_j_d(nFKS(ict)),2404 & fks_j_d(nFKS(ict)),
2278 & parton_pdg_uborn(fks_j_d(nFKS(ict)),ii,ict),2405 & parton_pdg_uborn(fks_j_d(nFKS(ict)),ii,ict),
2279 & parton_iproc(ii,ict)2406 & parton_iproc(ii,ict),
2407 & bias_wgt(ict)
2280 n_ctr_str(n_ctr_found) =2408 n_ctr_str(n_ctr_found) =
2281 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '2409 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '
2282 & //trim(adjustl(str_temp))2410 & //trim(adjustl(str_temp))
@@ -2286,6 +2414,15 @@
2286 ipr=iproc_picked2414 ipr=iproc_picked
2287 n_ctr_found=n_ctr_found+12415 n_ctr_found=n_ctr_found+1
22882416
2417 if (.not.allocated(n_ctr_str))
2418 $ allocate(n_ctr_str(max_n_ctr))
2419 if (n_ctr_found.gt.max_n_ctr) then
2420 allocate(ctemp(n_ctr_found))
2421 ctemp(1:max_n_ctr)=n_ctr_str
2422 call move_alloc(ctemp,n_ctr_str)
2423 max_n_ctr=n_ctr_found
2424 endif
2425
2289 if (nincoming.eq.2) then2426 if (nincoming.eq.2) then
2290 write (n_ctr_str(n_ctr_found),'(5(1x,d18.12),1x,i2)')2427 write (n_ctr_str(n_ctr_found),'(5(1x,d18.12),1x,i2)')
2291 & (wgt(j,ict)*conv,j=1,3),(wgt_me_tree(j,ict),j=1,2),2428 & (wgt(j,ict)*conv,j=1,3),(wgt_me_tree(j,ict),j=1,2),
@@ -2306,7 +2443,7 @@
2306 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '2443 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '
2307 & //trim(adjustl(procid))2444 & //trim(adjustl(procid))
23082445
2309 write (str_temp,'(i2,6(1x,d14.8),6(1x,i2),1x,i8,1x,d18.12)')2446 write (str_temp,30)
2310 & QCDpower(ict),2447 & QCDpower(ict),
2311 & (bjx(j,ict),j=1,2),2448 & (bjx(j,ict),j=1,2),
2312 & (scales2(j,ict),j=1,3),2449 & (scales2(j,ict),j=1,3),
@@ -2317,18 +2454,17 @@
2317 & fks_i_d(nFKS(ict)),2454 & fks_i_d(nFKS(ict)),
2318 & fks_j_d(nFKS(ict)),2455 & fks_j_d(nFKS(ict)),
2319 & parton_pdg_uborn(fks_j_d(nFKS(ict)),ipr,ict),2456 & parton_pdg_uborn(fks_j_d(nFKS(ict)),ipr,ict),
2320 & parton_iproc(ipr,ict)2457 & parton_iproc(ipr,ict),
2458 & bias_wgt(ict)
2321 n_ctr_str(n_ctr_found) =2459 n_ctr_str(n_ctr_found) =
2322 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '2460 & trim(adjustl(n_ctr_str(n_ctr_found)))//' '
2323 & //trim(adjustl(str_temp))2461 & //trim(adjustl(str_temp))
23242462
23252463
2326 endif2464 endif
2327 if (n_ctr_found.ge.max_n_ctr) then
2328 write (*,*) 'ERROR: too many contributions in <rwgt>'
2329 stop1
2330 endif
2331 enddo2465 enddo
2466 return
2467 30 format(i2,6(1x,d14.8),6(1x,i2),1x,i8,1x,d18.12,1x,d18.12)
2332 end2468 end
2333 2469
2334 2470
@@ -2878,9 +3014,6 @@
2878 double complex xij_aor3014 double complex xij_aor
2879 common/cxij_aor/xij_aor3015 common/cxij_aor/xij_aor
28803016
2881 logical rotategranny
2882 common/crotategranny/rotategranny
2883
2884 double precision cthbe,sthbe,cphibe,sphibe3017 double precision cthbe,sthbe,cphibe,sphibe
2885 common/cbeangles/cthbe,sthbe,cphibe,sphibe3018 common/cbeangles/cthbe,sthbe,cphibe,sphibe
28863019
@@ -2918,20 +3051,7 @@
2918 E_i_fks = p(0,i_fks)3051 E_i_fks = p(0,i_fks)
2919 z = 1d0 - E_i_fks/(E_i_fks+E_j_fks)3052 z = 1d0 - E_i_fks/(E_i_fks+E_j_fks)
2920 t = z * shat/4d03053 t = z * shat/4d0
2921 if(rotategranny .and. nexternal-1.ne.3 .and. nincoming.eq.2)then3054 call sborn(p_born,wgt1)
2922c Exclude 2->1 (at the Born level) processes: matrix elements are
2923c independent of the PS point, but non-zero helicity configurations
2924c might flip when rotating the momenta.
2925 do i=1,nexternal-1
2926 call trp_rotate_invar(p_born(0,i),p_born_rot(0,i),
2927 # cthbe,sthbe,cphibe,sphibe)
2928 enddo
2929 CalculatedBorn=.false.
2930 call sborn(p_born_rot,wgt1)
2931 CalculatedBorn=.false.
2932 else
2933 call sborn(p_born,wgt1)
2934 endif
2935 call AP_reduced(j_type,i_type,t,z,ap)3055 call AP_reduced(j_type,i_type,t,z,ap)
2936 if (abs(j_type).eq.3 .and. i_type.eq.8) then3056 if (abs(j_type).eq.3 .and. i_type.eq.8) then
2937 Q=0d03057 Q=0d0
@@ -2945,10 +3065,6 @@
2945 pi(i)=p_i_fks_ev(i)3065 pi(i)=p_i_fks_ev(i)
2946 pj(i)=p(i,j_fks)3066 pj(i)=p(i,j_fks)
2947 enddo3067 enddo
2948 if(rotategranny)then
2949 call trp_rotate_invar(pi,pi,cthbe,sthbe,cphibe,sphibe)
2950 call trp_rotate_invar(pj,pj,cthbe,sthbe,cphibe,sphibe)
2951 endif
2952 CALL IXXXSO(pi ,ZERO ,+1,+1,W1) 3068 CALL IXXXSO(pi ,ZERO ,+1,+1,W1)
2953 CALL OXXXSO(pj ,ZERO ,-1,+1,W2) 3069 CALL OXXXSO(pj ,ZERO ,-1,+1,W2)
2954 CALL IXXXSO(pi ,ZERO ,-1,+1,W3) 3070 CALL IXXXSO(pi ,ZERO ,-1,+1,W3)
@@ -2963,13 +3079,8 @@
2963 endif3079 endif
2964c Insert the extra factor due to Madgraph convention for polarization vectors3080c Insert the extra factor due to Madgraph convention for polarization vectors
2965 imother_fks=min(i_fks,j_fks)3081 imother_fks=min(i_fks,j_fks)
2966 if(rotategranny)then3082 call getaziangles(p_born(0,imother_fks),
2967 call getaziangles(p_born_rot(0,imother_fks),3083 # cphi_mother,sphi_mother)
2968 # cphi_mother,sphi_mother)
2969 else
2970 call getaziangles(p_born(0,imother_fks),
2971 # cphi_mother,sphi_mother)
2972 endif
2973 wgt1(2) = -(cphi_mother-ximag*sphi_mother)**2 *3084 wgt1(2) = -(cphi_mother-ximag*sphi_mother)**2 *
2974 # wgt1(2) * azifact3085 # wgt1(2) * azifact
2975 call Qterms_reduced_timelike(j_type, i_type, t, z, Q)3086 call Qterms_reduced_timelike(j_type, i_type, t, z, Q)
@@ -3040,24 +3151,7 @@
3040c Thus, an extra factor z (implicit in the flux of the reduced Born3151c Thus, an extra factor z (implicit in the flux of the reduced Born
3041c in FKS) has to be inserted here3152c in FKS) has to be inserted here
3042 t = z*shat/4d03153 t = z*shat/4d0
3043 if(j_fks.eq.2 .and. nexternal-1.ne.3 .and. nincoming.eq.2)then3154 call sborn(p_born,wgt1)
3044c Rotation according to innerpin.m. Use rotate_invar() if a more
3045c general rotation is needed.
3046c Exclude 2->1 (at the Born level) processes: matrix elements are
3047c independent of the PS point, but non-zero helicity configurations
3048c might flip when rotating the momenta.
3049 do i=1,nexternal-1
3050 p_born_rot(0,i)=p_born(0,i)
3051 p_born_rot(1,i)=-p_born(1,i)
3052 p_born_rot(2,i)=p_born(2,i)
3053 p_born_rot(3,i)=-p_born(3,i)
3054 enddo
3055 CalculatedBorn=.false.
3056 call sborn(p_born_rot,wgt1)
3057 CalculatedBorn=.false.
3058 else
3059 call sborn(p_born,wgt1)
3060 endif
3061 call AP_reduced(m_type,i_type,t,z,ap)3155 call AP_reduced(m_type,i_type,t,z,ap)
3062 if (abs(m_type).eq.3) then3156 if (abs(m_type).eq.3) then
3063 Q=0d03157 Q=0d0
@@ -3071,14 +3165,6 @@
3071 pi(i)=p_i_fks_ev(i)3165 pi(i)=p_i_fks_ev(i)
3072 pj(i)=p(i,j_fks)3166 pj(i)=p(i,j_fks)
3073 enddo3167 enddo
3074 if(j_fks.eq.2 .and. nincoming.eq.2)then
3075c Rotation according to innerpin.m. Use rotate_invar() if a more
3076c general rotation is needed
3077 pi(1)=-pi(1)
3078 pi(3)=-pi(3)
3079 pj(1)=-pj(1)
3080 pj(3)=-pj(3)
3081 endif
3082 CALL IXXXSO(pi ,ZERO ,+1,+1,W1) 3168 CALL IXXXSO(pi ,ZERO ,+1,+1,W1)
3083 CALL OXXXSO(pj ,ZERO ,-1,+1,W2) 3169 CALL OXXXSO(pj ,ZERO ,-1,+1,W2)
3084 CALL IXXXSO(pi ,ZERO ,-1,+1,W3) 3170 CALL IXXXSO(pi ,ZERO ,-1,+1,W3)
@@ -3092,13 +3178,8 @@
3092 azifact=Wij_angle/Wij_recta3178 azifact=Wij_angle/Wij_recta
3093 endif3179 endif
3094c Insert the extra factor due to Madgraph convention for polarization vectors3180c Insert the extra factor due to Madgraph convention for polarization vectors
3095 if(j_fks.eq.2 .and. nincoming.eq.2)then3181 cphi_mother=1.d0
3096 cphi_mother=-1.d03182 sphi_mother=0.d0
3097 sphi_mother=0.d0
3098 else
3099 cphi_mother=1.d0
3100 sphi_mother=0.d0
3101 endif
3102 wgt1(2) = -(cphi_mother+ximag*sphi_mother)**2 *3183 wgt1(2) = -(cphi_mother+ximag*sphi_mother)**2 *
3103 # wgt1(2) * dconjg(azifact)3184 # wgt1(2) * dconjg(azifact)
3104 call Qterms_reduced_spacelike(m_type, i_type, t, z, Q)3185 call Qterms_reduced_spacelike(m_type, i_type, t, z, Q)
@@ -3508,13 +3589,13 @@
35083589
3509 subroutine sreal_deg(p,xi_i_fks,y_ij_fks,3590 subroutine sreal_deg(p,xi_i_fks,y_ij_fks,
3510 # collrem_xi,collrem_lxi)3591 # collrem_xi,collrem_lxi)
3592 use extra_weights
3511 implicit none3593 implicit none
3512 include "genps.inc"3594 include "genps.inc"
3513 include 'nexternal.inc'3595 include 'nexternal.inc'
3514 include "coupl.inc"3596 include "coupl.inc"
3515 include 'q_es.inc'3597 include 'q_es.inc'
3516 include "run.inc"3598 include "run.inc"
3517 include 'reweight.inc'
35183599
3519 double precision p(0:3,nexternal),collrem_xi,collrem_lxi3600 double precision p(0:3,nexternal),collrem_xi,collrem_lxi
3520 double precision xi_i_fks,y_ij_fks3601 double precision xi_i_fks,y_ij_fks
@@ -3679,8 +3760,6 @@
3679 include "run.inc"3760 include "run.inc"
3680 include "nexternal.inc"3761 include "nexternal.inc"
3681 integer j_fks3762 integer j_fks
3682 double precision dlum
3683 external dlum
3684 double precision zhw_used,xi_i_fks,xlum_mc_fact3763 double precision zhw_used,xi_i_fks,xlum_mc_fact
3685 double precision xbjrk_ev(2),xbjrk_cnt(2,-2:2)3764 double precision xbjrk_ev(2),xbjrk_cnt(2,-2:2)
3686 common/cbjorkenx/xbjrk_ev,xbjrk_cnt3765 common/cbjorkenx/xbjrk_ev,xbjrk_cnt
@@ -3808,15 +3887,6 @@
3808 endif3887 endif
3809 if(.not.pass)i_momcmp_count=i_momcmp_count +13888 if(.not.pass)i_momcmp_count=i_momcmp_count +1
3810c3889c
3811 if(jac_cnt(0).gt.0.d0.and.jac.gt.0.d0)
3812 # call p_ev_vs_cnt(izero,i_fks,j_fks,p,p1_cnt,
3813 # p_i_fks_ev,p_i_fks_cnt,
3814 # xi_i_fks_ev,y_ij_fks_ev)
3815 if(jac_cnt(1).gt.0.d0.and.jac.gt.0.d0)
3816 # call p_ev_vs_cnt(ione,i_fks,j_fks,p,p1_cnt,
3817 # p_i_fks_ev,p_i_fks_cnt,
3818 # xi_i_fks_ev,y_ij_fks_ev)
3819c
3820 return3890 return
3821 end3891 end
38223892
@@ -3915,72 +3985,6 @@
3915 end3985 end
39163986
39173987
3918 subroutine xmcompare_fsr(verbose,inum,iden,i_fks,j_fks,p,p1_cnt)
3919 implicit none
3920 include 'genps.inc'
3921 include 'nexternal.inc'
3922 logical verbose
3923 integer inum,iden,i_fks,j_fks,iunit,ipart,i
3924 double precision tiny,xnum,xden,xrat
3925 double precision p(0:3,-max_branch:max_particles)
3926 double precision p1_cnt(0:3,nexternal,-2:2)
3927 parameter (iunit=6)
3928 parameter (tiny=1.d-4)
3929c
3930 do ipart=1,nexternal
3931 do i=0,3
3932 xnum=p1_cnt(i,ipart,inum)
3933 xden=p1_cnt(i,ipart,iden)
3934 if(verbose)then
3935 if(i.eq.0)then
3936 write(iunit,*)' '
3937 write(iunit,*)'part=',ipart
3938 endif
3939 call xprintout(iunit,xnum,xden)
3940 else
3941 if(ipart.ne.i_fks.and.ipart.ne.j_fks)then
3942 if(xden.ne.0.d0)then
3943 xrat=abs(1-xnum/xden)
3944 else
3945 xrat=abs(xnum)
3946 endif
3947 if(xrat.gt.tiny)then
3948 write(*,*)'Kinematics of counterevents'
3949 write(*,*)inum,iden
3950 write(*,*)'is different. Particle:',ipart
3951 stop
3952 endif
3953 endif
3954 endif
3955 enddo
3956 enddo
3957 do i=0,3
3958 xnum=p1_cnt(i,i_fks,inum)+p1_cnt(i,j_fks,inum)
3959 xden=p1_cnt(i,i_fks,iden)+p1_cnt(i,j_fks,iden)
3960 if(verbose)then
3961 if(i.eq.0)then
3962 write(iunit,*)' '
3963 write(iunit,*)'part=i+j'
3964 endif
3965 call xprintout(iunit,xnum,xden)
3966 else
3967 if(xden.ne.0.d0)then
3968 xrat=abs(1-xnum/xden)
3969 else
3970 xrat=abs(xnum)
3971 endif
3972 if(xrat.gt.tiny)then
3973 write(*,*)'Kinematics of counterevents'
3974 write(*,*)inum,iden
3975 write(*,*)'is different. Particle i+j'
3976 stop
3977 endif
3978 endif
3979 enddo
3980 return
3981 end
3982
3983
3984 subroutine xprintout(iunit,xv,xlim)3988 subroutine xprintout(iunit,xv,xlim)
3985 implicit real*8(a-h,o-z)3989 implicit real*8(a-h,o-z)
3986c3990c
@@ -3993,70 +3997,6 @@
3993 end3997 end
39943998
39953999
3996 subroutine p_ev_vs_cnt(icnt,i_fks,j_fks,p,p1_cnt,
3997 # p_i_fks_ev,p_i_fks_cnt,
3998 # xi_i_fks_ev,y_ij_fks_ev)
3999 implicit none
4000 include 'genps.inc'
4001 include 'nexternal.inc'
4002 integer icnt,i_fks,j_fks,ipart,i
4003 double precision p(0:3,-max_branch:max_particles)
4004 double precision p1_cnt(0:3,nexternal,-2:2)
4005 double precision p_i_fks_ev(0:3),p_i_fks_cnt(0:3,-2:2)
4006 double precision xi_i_fks_ev,y_ij_fks_ev,tiny
4007 double precision rat(0:3,nexternal+3),den(0:3,nexternal+3)
4008 integer maxrat
4009c
4010c This routine is obsolete; the convergence checks are done elsewhere
4011 return
4012
4013 do ipart=1,nexternal
4014 do i=0,3
4015 den(i,ipart)=p1_cnt(i,ipart,icnt)
4016 if(den(i,ipart).ne.0.d0)then
4017 rat(i,ipart)=p(i,ipart)/den(i,ipart)
4018 else
4019 rat(i,ipart)=p(i,ipart)
4020 endif
4021 enddo
4022 enddo
4023c
4024 do i=0,3
4025 den(i,nexternal+1)=p1_cnt(i,i_fks,icnt)+p1_cnt(i,j_fks,icnt)
4026 if(den(i,nexternal+1).ne.0.d0)then
4027 rat(i,nexternal+1)=(p(i,i_fks)+p(i,j_fks))/den(i,nexternal+1)
4028 else
4029 rat(i,nexternal+1)=p(i,i_fks)+p(i,j_fks)
4030 endif
4031 enddo
4032c
4033 if(icnt.eq.0)then
4034 tiny=4*xi_i_fks_ev
4035 maxrat=nexternal+3
4036 do i=0,3
4037 den(i,nexternal+2)=p_i_fks_cnt(i,0)
4038 if(den(i,nexternal+2).ne.0.d0)then
4039 rat(i,nexternal+2)=p_i_fks_ev(i)/den(i,nexternal+2)
4040 else
4041 rat(i,nexternal+2)=p_i_fks_ev(i)
4042 endif
4043 enddo
4044 do i=0,3
4045 den(i,nexternal+3)=p_i_fks_cnt(i,0)
4046 if(den(i,nexternal+3).ne.0.d0)then
4047 rat(i,nexternal+3)=p(i,i_fks)/den(i,nexternal+3)
4048 else
4049 rat(i,nexternal+3)=p(i,i_fks)
4050 endif
4051 enddo
4052 else
4053 tiny=2*sqrt(1-y_ij_fks_ev)
4054 maxrat=nexternal+1
4055 endif
4056c
4057 return
4058 end
4059
40604000
4061c The following has been derived with minor modifications from the4001c The following has been derived with minor modifications from the
4062c analogous routine written for VBF4002c analogous routine written for VBF
@@ -4213,183 +4153,8 @@
42134153
42144154
42154155
4216
4217 subroutine checksij(xsijvc,xsijlvc,xsijlim,
4218 # xsumvc,xsumlvc,xsumlim,
4219 # check,checkl,tolerance,
4220 # iflag,imax,iev,ki,kk,ll,
4221 # i_fks,j_fks,ilim,iret)
4222c Analogous to checkres. Relevant to S functions
4223 implicit none
4224 real*8 xsijvc(15),xsijlvc,xsumvc(15),xsumlvc,check(15),checkl
4225 real*8 xsijlim,xsumlim,tolerance
4226 real*8 xsecvc(15),xseclvc
4227 real*8 ckc(15),rckc(15),rat
4228 logical found
4229 integer iflag,imax,iev,ki,kk,ll,i_fks,j_fks,ilim,iret,ithrs,
4230 # istop,iwrite,i,imin,icount,itype
4231 parameter (ithrs=3)
4232 parameter (istop=0)
4233 parameter (iwrite=1)
4234c
4235 if(imax.gt.15)then
4236 write(6,*)'Error in checksij: imax is too large',imax
4237 stop
4238 endif
4239 itype=1
4240 iret=0
4241 100 continue
4242 if(itype.eq.1)then
4243 do i=1,imax
4244 xsecvc(i)=xsijvc(i)
4245 enddo
4246 xseclvc=xsijlvc
4247 elseif(itype.eq.2)then
4248 do i=1,imax
4249 xsecvc(i)=xsumvc(i)
4250 enddo
4251 xseclvc=xsumlvc
4252 else
4253 write(6,*)'Error in checksij: itype=',itype
4254 stop
4255 endif
4256 do i=1,imax
4257 if(xseclvc.eq.0.d0)then
4258 ckc(i)=abs(xsecvc(i))
4259 else
4260 ckc(i)=abs(xsecvc(i)/xseclvc-1.d0)
4261 endif
4262 enddo
4263 if(iflag.eq.0)then
4264 rat=8.d0
4265 elseif(iflag.eq.1)then
4266 rat=2.d0
4267 else
4268 write(6,*)'Error in checksij: iflag=',iflag
4269 write(6,*)' Must be 0 for soft, 1 for collinear'
4270 stop
4271 endif
4272c
4273 i=1
4274 dowhile(ckc(i).gt.0.1d0)
4275 i=i+1
4276 enddo
4277 imin=i
4278 do i=imin,imax-1
4279 if(ckc(i+1).gt.1.d-8)then
4280c If this condition is replaced by .eq.0, the test will fail if the series
4281c is made of elements all equal to the limit
4282 rckc(i)=ckc(i)/ckc(i+1)
4283 else
4284c Element #i+1 of series equal to the limit, so it must pass the test
4285 rckc(i)=rat*1.1d0
4286 endif
4287 enddo
4288 icount=0
4289 i=imin
4290 dowhile(icount.lt.ithrs.and.i.lt.imax)
4291 if(rckc(i).gt.rat)then
4292 icount=icount+1
4293 else
4294 icount=0
4295 endif
4296 i=i+1
4297 enddo
4298c
4299 if(icount.ne.ithrs)then
4300 iret=iret+itype
4301 if(istop.eq.1)then
4302 write(6,*)'Test failed',iflag
4303 write(6,*)'Event #',iev
4304 stop
4305 endif
4306 endif
4307 if(itype.eq.1.and.ki.eq.1.and.iflag.eq.0)then
4308 itype=2
4309 goto 100
4310 endif
4311c
4312 if(ki.eq.1.and.ilim.eq.1)then
4313 found=.false.
4314 i=0
4315 do while ((.not.found).and.i.lt.imax)
4316 i=i+1
4317 if(abs(check(i)-1.d0).gt.tolerance)then
4318 found=.true.
4319 itype=4
4320 endif
4321 enddo
4322 if(.not.found)then
4323 if(abs(checkl-1.d0).gt.tolerance)itype=4
4324 endif
4325 if(itype.eq.4)iret=iret+itype
4326 endif
4327c
4328 if( iwrite.eq.1 .and.
4329 # iret.eq.1 .or.(iret.gt.1.and.ki.eq.1) )then
4330 if(iret.gt.7)then
4331 write(6,*)'Error in checksij: iret=',iret
4332 stop
4333 endif
4334 write(77,*)' '
4335 if(iflag.eq.0)then
4336 write(77,*)'Soft #',iev
4337 elseif(iflag.eq.1)then
4338 write(77,*)'Collinear #',iev
4339 endif
4340 write(77,*)'iret:',iret
4341 write(77,*)'i_fks,j_fks:',i_fks,j_fks
4342 if(iret.eq.1.or.iret.eq.3.or.iret.eq.5.or.iret.eq.7)then
4343 write(77,*)'S_kl'
4344 write(77,*)'k,kk,ll',ki,kk,ll
4345 do i=1,imax
4346 call xprintout(77,xsijvc(i),xsijlvc)
4347 enddo
4348 endif
4349 if(iret.eq.2.or.iret.eq.3.or.iret.eq.6.or.iret.eq.7)then
4350 write(77,*)'sum of S'
4351 do i=1,imax
4352 call xprintout(77,xsumvc(i),xsumlvc)
4353 enddo
4354 endif
4355 if(iret.eq.4.or.iret.eq.5.or.iret.eq.6.or.iret.eq.7)then
4356 write(77,*)'check to one'
4357 do i=1,imax
4358 call xprintout(77,check(i),checkl)
4359 enddo
4360 endif
4361 endif
4362c
4363 if(ilim.eq.1)then
4364 if( abs(xsijlvc-xsijlim).gt.1.d-6 .and.
4365 # xsijlim.ne.-1.d0 )iret=iret+10
4366 if( abs(xsumlvc-xsumlim).gt.1.d-6 .and.
4367 # xsumlim.ne.-1.d0 .and. iflag.eq.0)iret=iret+20
4368 if(iwrite.eq.1.and.iret.ge.10)then
4369 write(77,*)' '
4370 if(iflag.eq.0)then
4371 write(77,*)'Soft #',iev
4372 elseif(iflag.eq.1)then
4373 write(77,*)'Collinear #',iev
4374 endif
4375 write(77,*)'iret:',iret
4376 write(77,*)'i_fks,j_fks:',i_fks,j_fks
4377 if((iret.ge.10.and.iret.lt.20).or.iret.ge.30)then
4378 write(77,*)'limit of S_kl'
4379 write(77,*)'k,kk,ll',ki,kk,ll
4380 write(77,*)xsijlvc,xsijlim
4381 endif
4382 if(iret.ge.20)then
4383 write(77,*)'limit of sum_j S_ij'
4384 write(77,*)xsumlvc,xsumlim
4385 endif
4386 endif
4387 endif
4388 return
4389 end
4390
4391
4392 subroutine bornsoftvirtual(p,bsv_wgt,virt_wgt,born_wgt)4156 subroutine bornsoftvirtual(p,bsv_wgt,virt_wgt,born_wgt)
4157 use extra_weights
4393 implicit none4158 implicit none
4394 include "genps.inc"4159 include "genps.inc"
4395 include 'nexternal.inc'4160 include 'nexternal.inc'
@@ -4401,7 +4166,6 @@
4401 common /c_fks_inc/fks_j_from_i,particle_type,pdg_type4166 common /c_fks_inc/fks_j_from_i,particle_type,pdg_type
4402 include "run.inc"4167 include "run.inc"
4403 include "fks_powers.inc"4168 include "fks_powers.inc"
4404 include 'reweight.inc'
4405 include "mint.inc"4169 include "mint.inc"
4406 double precision p(0:3,nexternal),bsv_wgt,born_wgt,avv_wgt4170 double precision p(0:3,nexternal),bsv_wgt,born_wgt,avv_wgt
4407 double precision pp(0:3,nexternal)4171 double precision pp(0:3,nexternal)
@@ -4755,10 +4519,6 @@
4755 double precision bpower,born_wgt4519 double precision bpower,born_wgt
4756 double complex wgt1(2)4520 double complex wgt1(2)
47574521
4758 integer isum_hel
4759 logical multi_channel
4760 common/to_matrix/isum_hel, multi_channel
4761 integer isum_hel_orig
4762 integer i_fks,j_fks4522 integer i_fks,j_fks
4763 common/fks_indices/i_fks,j_fks4523 common/fks_indices/i_fks,j_fks
47644524
@@ -4767,13 +4527,6 @@
47674527
4768 double precision tiny4528 double precision tiny
4769 parameter (tiny=1d-6)4529 parameter (tiny=1d-6)
4770
4771c Make sure that we sum over helicities (such that we do get a
4772c non-zero Born)
4773 isum_hel_orig = isum_hel
4774 isum_hel=0
4775 call get_helicity(i_fks,j_fks)
4776
4777 calculatedBorn=.false.4530 calculatedBorn=.false.
4778 call sborn(p_born,wgt1)4531 call sborn(p_born,wgt1)
4779c Born contribution:4532c Born contribution:
@@ -4815,7 +4568,6 @@
4815c nothing funny happens later on4568c nothing funny happens later on
4816 g=g/10d04569 g=g/10d0
4817 call update_as_param()4570 call update_as_param()
4818 isum_hel=isum_hel_orig
4819 calculatedBorn=.false.4571 calculatedBorn=.false.
4820 call sborn(p_born,wgt1)4572 call sborn(p_born,wgt1)
48214573
@@ -4825,25 +4577,21 @@
4825c This function computes the power of a muR-dependent factor which4577c This function computes the power of a muR-dependent factor which
4826c is stored in cpower. You need to modify it when you try to 4578c is stored in cpower. You need to modify it when you try to
4827c reweight your cross section with a muR-dependent factor4579c reweight your cross section with a muR-dependent factor
4828c (runfac=1 in reweight0.inc)4580c (runfac=1 in extra_weights.f)
4829c Note: The implementation below only works for the Bottom Yukawa in4581c Note: The implementation below only works for the Bottom Yukawa in
4830c the SM where "GC_33" contains the Yukawa, for other models4582c the SM where "GC_33" contains the Yukawa, for other models
4831c or general muR-dependent factors you need to change GC_334583c or general muR-dependent factors you need to change GC_33
4832c to the corresponding coupling.4584c to the corresponding coupling.
4833 subroutine compute_cpower(p_born,cpower)4585 subroutine compute_cpower(p_born,cpower)
4586 use extra_weights
4834 implicit none4587 implicit none
4835 include "nexternal.inc"4588 include "nexternal.inc"
4836 include "coupl.inc"4589 include "coupl.inc"
4837 include 'reweight.inc'
48384590
4839 double precision p_born(0:3,nexternal-1)4591 double precision p_born(0:3,nexternal-1)
4840 double precision cpower,born_wgt4592 double precision cpower,born_wgt
4841 double complex wgt1(2)4593 double complex wgt1(2)
48424594
4843 integer isum_hel
4844 logical multi_channel
4845 common/to_matrix/isum_hel, multi_channel
4846 integer isum_hel_orig
4847 integer i_fks,j_fks4595 integer i_fks,j_fks
4848 common/fks_indices/i_fks,j_fks4596 common/fks_indices/i_fks,j_fks
48494597
@@ -4859,12 +4607,6 @@
48594607
4860c The following is relevant for a muR-dependent bottom-mass in Yukawa.4608c The following is relevant for a muR-dependent bottom-mass in Yukawa.
4861c$$$4609c$$$
4862c$$$c Make sure that we sum over helicities (such that we do get a
4863c$$$c non-zero Born)
4864c$$$ isum_hel_orig = isum_hel
4865c$$$ isum_hel=0
4866c$$$ call get_helicity(i_fks,j_fks)
4867c$$$
4868c$$$ calculatedBorn=.false.4610c$$$ calculatedBorn=.false.
4869c$$$ call sborn(p_born,wgt1)4611c$$$ call sborn(p_born,wgt1)
4870c$$$c Born contribution:4612c$$$c Born contribution:
@@ -4900,7 +4642,7 @@
4900c$$$ cpower=dble(nint(cpower))4642c$$$ cpower=dble(nint(cpower))
4901c$$$ write(*,*)'cpower is', cpower4643c$$$ write(*,*)'cpower is', cpower
4902c$$$c Check consistency with value used in reweighting4644c$$$c Check consistency with value used in reweighting
4903c$$$c$$$ if( (doreweight.or.doNLOreweight) .and.4645c$$$c$$$ if( doreweight .and.
4904c$$$c$$$ & abs(cpower-wgtcpower).gt.tiny )then4646c$$$c$$$ & abs(cpower-wgtcpower).gt.tiny )then
4905c$$$c$$$ write(*,*)'Error in compute_cpower'4647c$$$c$$$ write(*,*)'Error in compute_cpower'
4906c$$$c$$$ write(*,*)'cpower(s) are:',cpower,wgtcpower4648c$$$c$$$ write(*,*)'cpower(s) are:',cpower,wgtcpower
@@ -4911,7 +4653,6 @@
4911c$$$c Change couplings back and recompute the Born to make sure that 4653c$$$c Change couplings back and recompute the Born to make sure that
4912c$$$c nothing funny happens later on4654c$$$c nothing funny happens later on
4913c$$$ GC_33 = GC_33 / 10d04655c$$$ GC_33 = GC_33 / 10d0
4914c$$$ isum_hel=isum_hel_orig
4915c$$$ calculatedBorn=.false.4656c$$$ calculatedBorn=.false.
4916c$$$ call sborn(p_born,wgt1)4657c$$$ call sborn(p_born,wgt1)
4917c$$$4658c$$$
@@ -5348,73 +5089,9 @@
5348 end5089 end
53495090
53505091
5351 function m1l_finite_CDR(p,born)
5352c Returns the finite part of virtual contribution, according to the
5353c definitions given in (B.1) and (B.2). This function must include
5354c the factor as/(2*pi)
5355 implicit none
5356 include "genps.inc"
5357 include 'nexternal.inc'
5358c include "fks.inc"
5359 integer fks_j_from_i(nexternal,0:nexternal)
5360 & ,particle_type(nexternal),pdg_type(nexternal)
5361 common /c_fks_inc/fks_j_from_i,particle_type,pdg_type
5362 include 'coupl.inc'
5363 include 'q_es.inc'
5364 double precision p(0:3,nexternal-1),m1l_finite_CDR,born
5365 double precision CF,pi,aso2pi,shat,dot,xlgq2os
5366 parameter (CF=4d0/3d0)
5367 parameter (pi=3.1415926535897932385d0)
5368c
5369 aso2pi=g**2/(8*pi**2)
5370c This is relevant to e+e- --> qqbar
5371 shat=2d0*dot(p(0,1),p(0,2))
5372 xlgq2os=log(QES2/shat)
5373 m1l_finite_CDR=-aso2pi*CF*(xlgq2os**2+3*xlgq2os-pi**2+8.d0)*born
5374 return
5375 end
5376
5377
5378 function m1l_W_finite_CDR(p,born)
5379c Returns the finite part of virtual contribution, according to the
5380c definitions given in (B.1) and (B.2). This function must include
5381c the factor as/(2*pi)
5382 implicit none
5383 include "genps.inc"
5384 include 'nexternal.inc'
5385c include "fks.inc"
5386 integer fks_j_from_i(nexternal,0:nexternal)
5387 & ,particle_type(nexternal),pdg_type(nexternal)
5388 common /c_fks_inc/fks_j_from_i,particle_type,pdg_type
5389 include 'coupl.inc'
5390 include 'q_es.inc'
5391 double precision p(0:3,nexternal-1),m1l_W_finite_CDR,born
5392 double precision CF,pi,aso2pi,shat,dot,xlgq2os
5393 parameter (CF=4d0/3d0)
5394 parameter (pi=3.1415926535897932385d0)
5395c
5396 aso2pi=g**2/(8*pi**2)
5397 shat=2d0*dot(p(0,1),p(0,2))
5398 xlgq2os=log(QES2/shat)
5399
5400c This is relevant to qqbar -> W
5401 m1l_W_finite_CDR=aso2pi*CF*(-xlgq2os**2-3d0*xlgq2os+pi**2-8d0)
5402 m1l_W_finite_CDR=m1l_W_finite_CDR*born
5403
5404c This is relevant to gg -> H
5405c$$$ m1l_W_finite_CDR=aso2pi*(-3d0*xlgq2os**2+11d0+3d0*pi**2)
5406c$$$ m1l_W_finite_CDR=m1l_W_finite_CDR*born
5407
5408c This is relevant to bbbar -> H
5409c$$$ m1l_W_finite_CDR=aso2pi
5410c$$$ f * (-4d0/3d0*xlgq2os**2
5411c$$$ f -8d0/3d0+(16d0/3d0+8d0/3d0)*pi**2/6d0)
5412c$$$ m1l_W_finite_CDR=m1l_W_finite_CDR*born
5413 return
5414 end
5415
5416
5417 subroutine setfksfactor(match_to_shower)5092 subroutine setfksfactor(match_to_shower)
5093 use weight_lines
5094 use extra_weights
5418 implicit none5095 implicit none
54195096
5420 include 'mint.inc'5097 include 'mint.inc'
@@ -5449,11 +5126,9 @@
5449 include 'nexternal.inc'5126 include 'nexternal.inc'
5450 include 'fks_powers.inc'5127 include 'fks_powers.inc'
5451 include 'nFKSconfigs.inc'5128 include 'nFKSconfigs.inc'
5452 include 'c_weight.inc'
5453 integer fks_j_from_i(nexternal,0:nexternal)5129 integer fks_j_from_i(nexternal,0:nexternal)
5454 & ,particle_type(nexternal),pdg_type(nexternal)5130 & ,particle_type(nexternal),pdg_type(nexternal)
5455 common /c_fks_inc/fks_j_from_i,particle_type,pdg_type5131 common /c_fks_inc/fks_j_from_i,particle_type,pdg_type
5456 include 'reweight0.inc'
5457 include 'run.inc'5132 include 'run.inc'
5458 INTEGER NFKSPROCESS5133 INTEGER NFKSPROCESS
5459 COMMON/C_NFKSPROCESS/NFKSPROCESS5134 COMMON/C_NFKSPROCESS/NFKSPROCESS
@@ -5473,8 +5148,6 @@
5473 common /cdelta_used/delta_used5148 common /cdelta_used/delta_used
5474 double precision xiScut_used,xiBSVcut_used5149 double precision xiScut_used,xiBSVcut_used
5475 common /cxiScut_used/xiScut_used,xiBSVcut_used5150 common /cxiScut_used/xiScut_used,xiBSVcut_used
5476 logical rotategranny
5477 common/crotategranny/rotategranny
5478 double precision diagramsymmetryfactor_save(maxchannels)5151 double precision diagramsymmetryfactor_save(maxchannels)
5479 save diagramsymmetryfactor_save5152 save diagramsymmetryfactor_save
5480 double precision diagramsymmetryfactor5153 double precision diagramsymmetryfactor
@@ -5511,10 +5184,6 @@
5511 integer i_type,j_type,m_type5184 integer i_type,j_type,m_type
5512 common/cparticle_types/i_type,j_type,m_type5185 common/cparticle_types/i_type,j_type,m_type
55135186
5514c The value of rotategranny may be superseded later if phase space
5515c parametrization allows it
5516 rotategranny=.false.
5517
5518 softtest=.false.5187 softtest=.false.
5519 colltest=.false.5188 colltest=.false.
5520 fold=05189 fold=0
@@ -5691,6 +5360,8 @@
5691c Compute the identical particle symmetry factor that is in the5360c Compute the identical particle symmetry factor that is in the
5692c Born matrix elements.5361c Born matrix elements.
5693 iden_born_FKS(nFKSprocess)=15362 iden_born_FKS(nFKSprocess)=1
5363 call weight_lines_allocated(nexternal,max_contr,max_wgt
5364 $ ,max_iproc)
5694 call set_pdg(0,nFKSprocess)5365 call set_pdg(0,nFKSprocess)
5695 do i=1,nexternal5366 do i=1,nexternal
5696 iden(i)=15367 iden(i)=1
@@ -5800,349 +5471,12 @@
5800 end5471 end
58015472
58025473
5803 subroutine get_helicity(i_fks,j_fks)
5804 implicit none
5805 include "nexternal.inc"
5806 include "born_nhel.inc"
5807 include "madfks_mcatnlo.inc"
5808 integer NHEL(nexternal,max_bhel*2),IHEL
5809chel include "helicities.inc"
5810 include 'nFKSconfigs.inc'
5811 double precision hel_fac
5812 integer get_hel,skip(fks_configs)
5813 common/cBorn/hel_fac,get_hel,skip
5814 logical calculatedBorn
5815 common/ccalculatedBorn/calculatedBorn
5816 integer hel_wgt,hel_wgt_born,hel_wgt_real
5817 integer nhelreal(nexternal,4),goodhelreal(4)
5818 integer nhelrealall(nexternal,max_bhel*2)
5819 common /c_nhelreal/ nhelreal,nhelrealall,goodhelreal,hel_wgt_real
5820 integer nhelborn(nexternal-1,2),goodhelborn(2)
5821 integer nhelbornall(nexternal-1,max_bhel)
5822 common /c_nhelborn/ nhelborn,nhelbornall,goodhelborn,hel_wgt_born
5823
5824 integer isum_hel
5825 logical multi_channel
5826 common/to_matrix/isum_hel, multi_channel
5827
5828 integer i,nexthel,j,i_fks,j_fks,ngood,k
5829 data nexthel /0/
5830 data ngood /0/
5831 logical done,firsttime,all_set,chckr
5832 data firsttime/.true./
5833 integer goodhelr(0:4,max_bhel/2),goodhelb(0:2,max_bhel/2)
5834 save goodhelr,goodhelb,all_set,chckr
5835 double precision rnd,ran2
5836 external ran2
5837
5838 character*4 abrv
5839 common /to_abrv/ abrv
5840 logical Hevents
5841 common/SHevents/Hevents
5842 logical usexinteg,mint
5843 common/cusexinteg/usexinteg,mint
5844
5845c Do not change these two lines, because ./bin/compile_madfks.sh might
5846c need to change them automatically
5847 logical HelSum
5848 parameter (HelSum=.true.)
5849
5850c************
5851c goodhelr=2, real emission matrix element not yet calculated
5852c for this helicity
5853c goodhelr=1, real emission matrix element calculated and non-zero
5854c goodhelr=0, real emission matrix element calculated and zero,
5855c so can be skipped next time.
5856c************
5857 if (HelSum) return
5858
5859 if (isum_hel.ne.0) then ! MC over helicities
5860c First, set the goodhelr and goodhelb to their starting values
5861 if (firsttime) then
5862 if ((mint .and. (.not.Hevents) .and. (abrv(1:2).eq.'vi' .or.
5863 & abrv.eq.'born' .or. abrv.eq.'grid' .or.
5864 & (.not.UseSudakov))) .or. (.not.mint .and. (abrv.eq.'born'
5865 & .or. abrv.eq.'grid' .or. abrv(1:2).eq.'vi'))) then
5866c if computing only the Born diagrams, should not
5867c consider real emission helicities
5868 chckr=.false.
5869 else
5870 chckr=.true.
5871 endif
5872 do i=1,fks_configs
5873 skip(i)=1
5874 enddo
5875c read from file if possible
5876 open(unit=65,file='goodhel.dat',status='old',err=532)
5877 all_set=.true.
5878 do j=0,4
5879 read (65,*,err=532) (goodhelr(j,i),i=1,max_bhel/2)
5880 enddo
5881 do j=0,2
5882 read (65,*,err=532) (goodhelb(j,i),i=1,max_bhel/2)
5883 enddo
5884 read(65,*,err=532) hel_wgt
5885 hel_wgt_born=hel_wgt
5886 hel_wgt_real=hel_wgt
5887 do i=1,max_bhel/2
5888 if ((chckr .and.
5889 & (goodhelb(0,i).eq.2 .or. goodhelr(0,i).eq.2)) .or.
5890 & (.not.chckr.and.goodhelb(0,i).eq.2)) all_set=.false.
5891 enddo
5892 close(65)
5893 goto 533
5894c if file does not exist or has wrong format, set all to 2
5895 532 close(65)
5896 write (*,*) 'Good helicities not found in file'
5897 all_set=.false.
5898 do j=0,4
5899 do i=1,max_bhel/2
5900 goodhelr(j,i)=2
5901 enddo
5902 enddo
5903 do j=0,2
5904 do i=1,max_bhel/2
5905 goodhelb(j,i)=2
5906 enddo
5907 enddo
5908 hel_wgt=max_bhel/2
5909 hel_wgt_born=hel_wgt
5910 hel_wgt_real=hel_wgt
5911 533 continue
5912 firsttime=.false.
5913 goto 534 ! no previous event, so skip to the next helicity
5914 endif
5915
5916c From previous event, check if there is an update
5917 if (.not.all_set) then
5918c real emission
5919 if(goodhelr(0,ngood).eq.2) then
5920 if ( goodhelreal(1).eq.0 .and.
5921 & goodhelreal(2).eq.0 .and.
5922 & goodhelreal(3).eq.0 .and.
5923 & goodhelreal(4).eq.0 ) then
5924 do j=0,4
5925 goodhelr(j,ngood)=0
5926 enddo
5927 elseif( goodhelreal(1).le.1 .and.
5928 & goodhelreal(2).le.1 .and.
5929 & goodhelreal(3).le.1 .and.
5930 & goodhelreal(4).le.1 ) then
5931 goodhelr(0,ngood)=1
5932 do j=1,4
5933 goodhelr(j,ngood)=goodhelreal(j)
5934 enddo
5935 elseif (.not.(goodhelreal(1).eq.2 .and.
5936 & goodhelreal(2).eq.2 .and.
5937 & goodhelreal(2).eq.2 .and.
5938 & goodhelreal(2).eq.2) ) then
5939 write (*,*) 'Error #2 in get_helicities',
5940 & ngood,(goodhelr(j,ngood),j=0,4)
5941 stop
5942 endif
5943 endif
5944c Born and counter events
5945 if(goodhelb(0,ngood).eq.2) then
5946 if ( goodhelborn(1).eq.0 .and.
5947 & goodhelborn(2).eq.0 ) then
5948 do j=0,2
5949 goodhelb(j,ngood)=0
5950 enddo
5951 elseif( goodhelborn(1).le.1 .and.
5952 & goodhelborn(2).le.1 ) then
5953 goodhelb(0,ngood)=1
5954 do j=1,2
5955 goodhelb(j,ngood)=goodhelborn(j)
5956 enddo
5957 elseif (.not.(goodhelborn(1).eq.2 .and.
5958 & goodhelborn(2).eq.2) ) then
5959 write (*,*) 'Error #3 in get_helicities',
5960 & nexthel,(goodhelb(j,ngood),j=0,2)
5961 stop
5962 endif
5963 endif
5964
5965c Calculate new hel_wgt
5966 hel_wgt=0
5967 do i=1,max_bhel/2
5968 if((chckr .and.
5969 & (goodhelb(0,i).ge.1.or.goodhelr(0,i).ge.1)) .or.
5970 & (.not.chckr .and. goodhelb(0,i).ge.1)) then
5971 hel_wgt=hel_wgt+1
5972 endif
5973 enddo
5974 hel_wgt_born=hel_wgt
5975 hel_wgt_real=hel_wgt
5976
5977c check if all have been set, if so -> write to file
5978 all_set=.true.
5979 do i=1,max_bhel/2
5980 if ((chckr .and.
5981 & (goodhelb(0,i).eq.2 .or. goodhelr(0,i).eq.2)) .or.
5982 & (.not.chckr.and.goodhelb(0,i).eq.2)) all_set=.false.
5983 enddo
5984 if (all_set) then
5985 write (*,*) 'All good helicities have been found.',hel_wgt
5986 open(unit=65,file='goodhel.dat',status='unknown')
5987 do j=0,4
5988 write (65,*) (goodhelr(j,i),i=1,max_bhel/2)
5989 enddo
5990 do j=0,2
5991 write (65,*) (goodhelb(j,i),i=1,max_bhel/2)
5992 enddo
5993 write(65,*) hel_wgt
5994 close(65)
5995 endif
5996 else
5997 do i=1,4
5998 if (goodhelr(i,ngood).ne.goodhelreal(i)) then
5999 write (*,*)'Error #4 in get_helicities',i,ngood
6000 stop
6001 endif
6002 enddo
6003 do i=1,2
6004 if (goodhelb(i,ngood).ne.goodhelborn(i)) then
6005 write (*,*)'Error #5 in get_helicities',i,ngood
6006 stop
6007 endif
6008 enddo
6009 endif
6010
6011c Get the next helicity
6012 534 continue
6013 done=.false.
6014 do while (.not.done)
6015 if (nexthel.eq.max_bhel*2) nexthel=0
6016 nexthel=nexthel+1
6017 if(nhel(i_fks,nexthel).eq.1.and.nhel(j_fks,nexthel).eq.1) then
6018 if (ngood.eq.max_bhel/2) ngood=0
6019 ngood=ngood+1
6020 if((chckr .and.
6021 & (goodhelr(0,ngood).ge.1.or.goodhelb(0,ngood).ge.1)).or.
6022 & (.not.chckr .and. goodhelb(0,ngood).ge.1)) then
6023c Using random number to see if we have to go to the next.
6024c Probably this is an overkill, but have to make sure that there is
6025c no bias considering the *semi*-random numbers from VEGAS.
6026 rnd=ran2()
6027 if (rnd.le.1d0/dble(hel_wgt)) then
6028 done=.true.
6029 endif
6030 endif
6031 endif
6032 enddo
6033
6034 do i=1,nexternal
6035 if (i.eq.i_fks) then
6036 nhelreal(i,1)=1
6037 nhelreal(i,2)=1
6038 nhelreal(i,3)=-1
6039 nhelreal(i,4)=-1
6040 elseif (i.eq.j_fks) then
6041 nhelreal(i,1)=1
6042 nhelreal(i,2)=-1
6043 nhelreal(i,3)=1
6044 nhelreal(i,4)=-1
6045 else
6046 nhelreal(i,1)=nhel(i,nexthel)
6047 nhelreal(i,2)=nhel(i,nexthel)
6048 nhelreal(i,3)=nhel(i,nexthel)
6049 nhelreal(i,4)=nhel(i,nexthel)
6050 endif
6051 enddo
6052 do j=1,4
6053 goodhelreal(j)=goodhelr(j,ngood)
6054 enddo
6055
6056 do i=1,nexternal-1
6057 if (i.eq.min(i_fks,j_fks)) then
6058 nhelborn(i,1)=1
6059 nhelborn(i,2)=-1
6060 elseif(i.lt.max(i_fks,j_fks)) then
6061 nhelborn(i,1)=nhel(i,nexthel)
6062 nhelborn(i,2)=nhel(i,nexthel)
6063 else
6064 nhelborn(i,1)=nhel(i+1,nexthel)
6065 nhelborn(i,2)=nhel(i+1,nexthel)
6066 endif
6067 enddo
6068 do j=1,2
6069 goodhelborn(j)=goodhelb(j,ngood)
6070 enddo
6071
6072 else !isum_hel is zero, sum explicitly over helicities
6073
6074 do i=1,nexternal
6075 do j=1,max_bhel*2
6076 nhelrealall(i,j)=nhel(i,j)
6077 enddo
6078 enddo
6079 do i=1,nexternal-1
6080 k=0
6081 do j=1,max_bhel*2
6082 if (nhel(i_fks,j).eq.-1) then
6083 k=k+1
6084 if (i.lt.i_fks) then
6085 nhelbornall(i,k)=nhel(i,j)
6086 elseif(i.ge.i_fks) then
6087 nhelbornall(i,k)=nhel(i+1,j)
6088 endif
6089 endif
6090 enddo
6091 enddo
6092
6093 endif
6094 return
6095 end
6096
6097 function get_ptrel(pp,i_fks,j_fks)
6098 implicit none
6099 include 'nexternal.inc'
6100 double precision get_ptrel,pp(0:3,nexternal)
6101 integer i_fks,j_fks
6102 double precision tmp,psum(3)
6103 integer i
6104c
6105 if(j_fks.le.2)then
6106 tmp=sqrt(pp(1,i_fks)**2+pp(2,i_fks)**2)
6107 else
6108 do i=1,3
6109 psum(i)=pp(i,i_fks)+pp(i,j_fks)
6110 enddo
6111 tmp=( pp(2,i_fks)*psum(1)-pp(1,i_fks)*psum(2) )**2+
6112 # ( pp(3,i_fks)*psum(1)-pp(1,i_fks)*psum(3) )**2+
6113 # ( pp(3,i_fks)*psum(2)-pp(2,i_fks)*psum(3) )**2
6114 if(tmp.ne.0.d0)tmp=sqrt( tmp/
6115 # (psum(1)**2+psum(2)**2+psum(3)**2) )
6116 endif
6117 get_ptrel=tmp
6118 return
6119 end
6120
6121
6122
6123 FUNCTION FK88RANDOM(SEED)
6124* -----------------
6125* Ref.: K. Park and K.W. Miller, Comm. of the ACM 31 (1988) p.1192
6126* Use seed = 1 as first value.
6127*
6128 IMPLICIT INTEGER(A-Z)
6129 REAL*8 MINV,FK88RANDOM
6130 SAVE
6131 PARAMETER(M=2147483647,A=16807,Q=127773,R=2836)
6132 PARAMETER(MINV=0.46566128752458d-09)
6133 HI = SEED/Q
6134 LO = MOD(SEED,Q)
6135 SEED = A*LO - R*HI
6136 IF(SEED.LE.0) SEED = SEED + M
6137 FK88RANDOM = SEED*MINV
6138 END
6139
61405474
6141 subroutine set_mu_central(ic,dd,c_mu2_r,c_mu2_f)5475 subroutine set_mu_central(ic,dd,c_mu2_r,c_mu2_f)
5476 use weight_lines
5477 use extra_weights
6142 implicit none5478 implicit none
6143 include 'nexternal.inc'5479 include 'nexternal.inc'
6144 include 'c_weight.inc'
6145 include 'reweight0.inc'
6146 include 'run.inc'5480 include 'run.inc'
6147 integer ic,dd,i,j5481 integer ic,dd,i,j
6148 double precision c_mu2_r,c_mu2_f,muR,muF,pp(0:3,nexternal)5482 double precision c_mu2_r,c_mu2_f,muR,muF,pp(0:3,nexternal)
61495483
=== modified file 'Template/NLO/SubProcesses/genps_fks.f'
--- Template/NLO/SubProcesses/genps_fks.f 2017-05-16 14:24:36 +0000
+++ Template/NLO/SubProcesses/genps_fks.f 2017-08-16 21:26:30 +0000
@@ -2,8 +2,6 @@
2 implicit none2 implicit none
3 include 'genps.inc'3 include 'genps.inc'
4 include 'nexternal.inc'4 include 'nexternal.inc'
5c Timing profile statistics
6 include 'timing_variables.inc'
7 integer ndim,iconfig5 integer ndim,iconfig
8 double precision wgt,x(99),p(0:3,nexternal)6 double precision wgt,x(99),p(0:3,nexternal)
9 integer iforest(2,-max_branch:-1,lmaxconfigs)7 integer iforest(2,-max_branch:-1,lmaxconfigs)
@@ -32,8 +30,6 @@
32 include 'coupl.inc'30 include 'coupl.inc'
33 include 'born_props.inc'31 include 'born_props.inc'
34c 32c
35 call cpu_time(tBefore)
36c
37 this_config=iconfig33 this_config=iconfig
38 iconf=iconfig34 iconf=iconfig
39 iconfig0=iconfig35 iconfig0=iconfig
@@ -56,8 +52,6 @@
56 enddo52 enddo
57 wgt=wgt*jac53 wgt=wgt*jac
58c54c
59 call cpu_time(tAfter)
60 tGenPS = tGenPS + (tAfter-tBefore)
61 return55 return
62 end 56 end
63 57
@@ -313,8 +307,7 @@
313c307c
314c Start by generating all the invariant masses of the s-channels308c Start by generating all the invariant masses of the s-channels
315 call generate_inv_mass_sch(ns_channel,itree,m,sqrtshat_born309 call generate_inv_mass_sch(ns_channel,itree,m,sqrtshat_born
316 $ ,totmass,qwidth,qmass,cBW,cBW_level,cBW_mass,cBW_width,s,x310 $ ,totmass,qwidth,qmass,cBW,cBW_mass,cBW_width,s,x,xjac0,pass)
317 $ ,xjac0,pass)
318 if (.not.pass) goto 222311 if (.not.pass) goto 222
319c If only s-channels, also set the p1+p2 s-channel312c If only s-channels, also set the p1+p2 s-channel
320 if (nt_channel .eq. 0 .and. nincoming .eq. 2) then313 if (nt_channel .eq. 0 .and. nincoming .eq. 2) then
@@ -1215,7 +1208,7 @@
1215 integer icountevts,i_fks,j_fks1208 integer icountevts,i_fks,j_fks
1216 double precision xbjrk_born(2),tau_born,ycm_born,ycmhat,shat_born1209 double precision xbjrk_born(2),tau_born,ycm_born,ycmhat,shat_born
1217 & ,phi_i_fks,xpswgt,xjac,xiimax,xinorm,xp(0:3,nexternal),stot1210 & ,phi_i_fks,xpswgt,xjac,xiimax,xinorm,xp(0:3,nexternal),stot
1218 & ,x(2) ,y_ij_fks1211 & ,x(2),y_ij_fks
1219 double precision shat,sqrtshat,tau,ycm,xbjrk(2),p_i_fks(0:3)1212 double precision shat,sqrtshat,tau,ycm,xbjrk(2),p_i_fks(0:3)
1220 logical pass1213 logical pass
1221c common blocks1214c common blocks
@@ -1575,40 +1568,6 @@
1575 return1568 return
1576 end1569 end
15771570
1578
1579 function bwfunc(s,xm02,gah)
1580c Returns the Breit Wigner function, normalized in such a way that
1581c its integral in the range (-inf,inf) is one
1582 implicit none
1583 real*8 bwfunc,s,xm02,gah
1584 real*8 pi,xm0
1585 parameter (pi=3.1415926535897932d0)
1586c
1587 xm0=sqrt(xm02)
1588 bwfunc=xm0*gah/(pi*((s-xm02)**2+xm02*gah**2))
1589 return
1590 end
1591
1592
1593 function xbwmass3(t,xm02,ga,bwdelf,bwfmmn)
1594c Returns the boson mass squared, given 0<t<1, the nominal mass (xm0),
1595c and the mass range (implicit in bwdelf and bwfmmn). This function
1596c is the inverse of F(M^2), where
1597c F(M^2)=\int_{xmlow2}^{M^2} ds BW(sqrt(s),M0,Ga)
1598c BW(M,M0,Ga)=M0 Ga/pi 1/((M^2-M0^2)^2+M0^2 Ga^2
1599c and therefore eats up the Breit-Wigner when changing integration
1600c variable M^2 --> t
1601 implicit none
1602 real*8 xbwmass3,t,xm02,ga,bwdelf,bwfmmn
1603 real*8 pi,xm0
1604 parameter (pi=3.1415926535897932d0)
1605c
1606 xm0=sqrt(xm02)
1607 xbwmass3=xm02+xm0*ga*tan(pi*bwdelf*t-bwfmmn)
1608 return
1609 end
1610
1611
1612 subroutine gentcms(pa,pb,t,phi,m1,m2,p1,pr,jac)1571 subroutine gentcms(pa,pb,t,phi,m1,m2,p1,pr,jac)
1613c*************************************************************************1572c*************************************************************************
1614c Generates 4 momentum for particle 1, and remainder pr1573c Generates 4 momentum for particle 1, and remainder pr
@@ -1774,21 +1733,10 @@
1774 subroutine generate_tau_BW(stot,idim,x,mass,width,cBW,BWmass1733 subroutine generate_tau_BW(stot,idim,x,mass,width,cBW,BWmass
1775 $ ,BWwidth,tau,jac)1734 $ ,BWwidth,tau,jac)
1776 implicit none1735 implicit none
1777 real*8 pi1736 integer cBW,idim
1778 parameter (pi=3.1415926535897932d0)1737 double precision stot,x,tau,jac,mass,width,BWmass(-1:1),BWwidth(
1779 integer nsamp1738 $ -1:1),s_mass,s
1780 parameter (nsamp=1)1739 double precision smax,smin
1781 include 'run.inc'
1782 include 'genps.inc'
1783 integer cBW,icount,idim
1784 data icount /0/
1785 double precision stot,x,tau,jac,mass,width,m,w,a,b,BWmass(-1:1)
1786 $ ,BWwidth(-1:1),s,s_mass
1787 double precision smax,smin,xm02,stemp,bwmdpl,bwmdmn,bwfmpl,bwfmmn
1788 double precision bwdelf,xbwmass3,bwfunc,x0
1789 external xmwmass3,bwfunc
1790 double precision tau_Born_lower_bound_save
1791 $ ,tau_lower_bound_resonance_save,tau_lower_bound_save
1792 double precision tau_Born_lower_bound,tau_lower_bound_resonance1740 double precision tau_Born_lower_bound,tau_lower_bound_resonance
1793 & ,tau_lower_bound1741 & ,tau_lower_bound
1794 common/ctau_lower_bound/tau_Born_lower_bound1742 common/ctau_lower_bound/tau_Born_lower_bound
@@ -1815,18 +1763,15 @@
18151763
18161764
1817 subroutine generate_tau(stot,idim,x,tau,jac)1765 subroutine generate_tau(stot,idim,x,tau,jac)
1818 double precision x,tau,jac1766 implicit none
1819 double precision roH,roHs,fract,ximax0,ximin0,tmp,fract1,fract21767 integer idim
1820 & ,roHj,stot,s,dum,dum3(-1:1),smin,smax,s_mass1768 double precision x,tau,jac,smin,smax,s_mass,s,tiny,dum,dum3(-1:1)
1821 integer nsamp,idim1769 $ ,stot
1822 parameter (nsamp=1)1770 parameter (tiny=1d-8)
1823 double precision tau_Born_lower_bound,tau_lower_bound_resonance1771 double precision tau_Born_lower_bound,tau_lower_bound_resonance
1824 & ,tau_lower_bound,tiny1772 $ ,tau_lower_bound
1825 parameter (tiny=1d-8)
1826 common/ctau_lower_bound/tau_Born_lower_bound1773 common/ctau_lower_bound/tau_Born_lower_bound
1827 & ,tau_lower_bound_resonance,tau_lower_bound1774 $ ,tau_lower_bound_resonance,tau_lower_bound
1828 character*4 abrv
1829 common /to_abrv/ abrv
1830 smin=tau_born_lower_bound*stot1775 smin=tau_born_lower_bound*stot
1831 smax=stot1776 smax=stot
1832 s_mass=tau_lower_bound_resonance*stot1777 s_mass=tau_lower_bound_resonance*stot
@@ -1887,11 +1832,8 @@
18871832
1888 1833
1889 subroutine generate_inv_mass_sch(ns_channel,itree,m,sqrtshat_born1834 subroutine generate_inv_mass_sch(ns_channel,itree,m,sqrtshat_born
1890 $ ,totmass,qwidth,qmass,cBW,cBW_level,cBW_mass,cBW_width,s,x1835 $ ,totmass,qwidth,qmass,cBW,cBW_mass,cBW_width,s,x,xjac0,pass)
1891 $ ,xjac0,pass)
1892 implicit none1836 implicit none
1893 real*8 pi
1894 parameter (pi=3.1415926535897932d0)
1895 include 'genps.inc'1837 include 'genps.inc'
1896 include 'nexternal.inc'1838 include 'nexternal.inc'
1897 integer ns_channel1839 integer ns_channel
@@ -1901,18 +1843,12 @@
1901 double precision sqrtshat_born,totmass,xjac01843 double precision sqrtshat_born,totmass,xjac0
1902 integer itree(2,-max_branch:-1)1844 integer itree(2,-max_branch:-1)
1903 integer i,j,ii,order(-nexternal:0)1845 integer i,j,ii,order(-nexternal:0)
1904 double precision smin,smax,xm02,bwmdpl,bwmdmn,bwfmpl,bwfmmn,bwdelf1846 double precision smin,smax,totalmass
1905 & ,totalmass,tmp,ximin0,ximax0
1906 double precision xbwmass3,bwfunc
1907 external xbwmass3,bwfunc
1908 logical pass1847 logical pass
1909 integer cBW_level_max,cBW(-nexternal:-1),cBW_level(-nexternal:-1)1848 integer cBW(-nexternal:-1)
1910 double precision cBW_mass(-1:1,-nexternal:-1),1849 double precision cBW_mass(-1:1,-nexternal:-1),cBW_width(-1:1,
1911 & cBW_width(-1:1,-nexternal:-1)1850 $ -nexternal:-1)
1912 double precision b(-1:1),x01851 double precision s_mass(-nexternal:nexternal)
1913 double precision s_mass(-nexternal:nexternal),xi,fract,vol_new
1914 $ ,shat,x_new
1915 parameter (fract=0.1d0)
1916 common/to_phase_space_s_channel/s_mass1852 common/to_phase_space_s_channel/s_mass
1917 pass=.true.1853 pass=.true.
1918 totalmass=totmass1854 totalmass=totmass
@@ -2233,9 +2169,8 @@
2233 include 'nexternal.inc'2169 include 'nexternal.inc'
2234 double precision p_born(0:3,nexternal-1),xmrec2,shat_born2170 double precision p_born(0:3,nexternal-1),xmrec2,shat_born
2235 logical pass2171 logical pass
2236 integer imother2172 integer imother,i
2237 integer i2173 double precision recoilbar(0:3),dot
2238 double precision recoilbar(0:3),dot,tmp
2239 external dot2174 external dot
2240 pass=.true.2175 pass=.true.
2241 do i=0,32176 do i=0,3
@@ -2280,15 +2215,10 @@
2280c itype=6: Conflicting BW on both sides2215c itype=6: Conflicting BW on both sides
2281c2216c
2282 implicit none2217 implicit none
2283 include 'nexternal.inc'
2284 include 'run.inc' ! ebeam
2285c ARGUMENTS
2286 integer itype,idim2218 integer itype,idim
2287 double precision x,smin,smax,s_mass,qmass,qwidth,cBW_mass(-1:1)2219 double precision x,smin,smax,s_mass,qmass,qwidth,cBW_mass(-1:1)
2288 $ ,cBW_width(-1:1),jac,s2220 $ ,cBW_width(-1:1),jac,s
2289c LOCAL 2221 double precision fract,A,B,C,D,E,F,G,bs(-1:1),maxi,mini
2290 double precision tmp,vol_new,x_min,x_max,x_new,fract,x_mass,xg,A
2291 $ ,B,C,D,E,F,G,bs(-1:1),maxi,mini
2292 integer j2222 integer j
2293c2223c
2294 if (itype.eq.1) then2224 if (itype.eq.1) then
22952225
=== modified file 'Template/NLO/SubProcesses/handling_lhe_events.f'
--- Template/NLO/SubProcesses/handling_lhe_events.f 2016-11-03 15:21:05 +0000
+++ Template/NLO/SubProcesses/handling_lhe_events.f 2017-08-16 21:26:30 +0000
@@ -1,14 +1,4 @@
1c Utility routines for LHEF. Originally taken from collect_events.f1c Utility routines for LHEF. Originally taken from collect_events.f
2c
3c Note: the routines read_lhef_event and write_lhef_event use the common
4c blocks in reweight0.inc, relevant to reweight information. This is
5c independent of the process, and in particular of process-related
6c parameters such as nexternal, which is replaced here by (its supposed)
7c upper bound maxparticles. The arrays which have one dimension defined
8c by maxparticles may have a correspondence with process-specific ones,
9c and the dimensions of the latter are typically defined by nexternal.
10c Hence, one may need an explicit copy of one onto the other
11c
122
13 block data3 block data
14 integer event_id4 integer event_id
@@ -20,9 +10,9 @@
20 end10 end
2111
22 subroutine write_lhef_header(ifile,nevents,MonteCarlo)12 subroutine write_lhef_header(ifile,nevents,MonteCarlo)
13 use extra_weights
23 implicit none 14 implicit none
24 include 'run.inc'15 include 'run.inc'
25 include 'reweight0.inc'
26 integer idwgt,kk,ii,jj,nn,n16 integer idwgt,kk,ii,jj,nn,n
27 integer ifile,nevents17 integer ifile,nevents
28 character*10 MonteCarlo18 character*10 MonteCarlo
@@ -114,6 +104,7 @@
114104
115105
116 subroutine write_lhef_header_banner(ifile,nevents,MonteCarlo,path)106 subroutine write_lhef_header_banner(ifile,nevents,MonteCarlo,path)
107 use extra_weights
117 implicit none 108 implicit none
118 integer ifile, i, idwgt, nevents,iseed,ii,jj,kk,nn,n109 integer ifile, i, idwgt, nevents,iseed,ii,jj,kk,nn,n
119 double precision mcmass(-16:21)110 double precision mcmass(-16:21)
@@ -135,7 +126,6 @@
135 character*150 buffer,buffer_lc,buffer2126 character*150 buffer,buffer_lc,buffer2
136 integer event_id127 integer event_id
137 common /c_event_id/ event_id128 common /c_event_id/ event_id
138 include 'reweight_all.inc'
139129
140c Set the event_id to 0. If 0 or positive, this value will be update130c Set the event_id to 0. If 0 or positive, this value will be update
141c in write_lhe_event. It is set to -99 through a block data131c in write_lhe_event. It is set to -99 through a block data
@@ -297,8 +287,8 @@
297287
298288
299 subroutine read_lhef_header(ifile,nevents,MonteCarlo)289 subroutine read_lhef_header(ifile,nevents,MonteCarlo)
290 use extra_weights
300 implicit none 291 implicit none
301 include 'reweight0.inc'
302 include './run.inc'292 include './run.inc'
303 logical already_found293 logical already_found
304 integer ifile,nevents,i,ii,ii2,iistr,itemp294 integer ifile,nevents,i,ii,ii2,iistr,itemp
@@ -435,8 +425,8 @@
435c Avoid overloading read_lhef_header, meant to be used in utilities425c Avoid overloading read_lhef_header, meant to be used in utilities
436 subroutine read_lhef_header_full(ifile,nevents,itempsc,itempPDF,426 subroutine read_lhef_header_full(ifile,nevents,itempsc,itempPDF,
437 # MonteCarlo)427 # MonteCarlo)
428 use extra_weights
438 implicit none429 implicit none
439 include 'reweight0.inc'
440 include 'run.inc'430 include 'run.inc'
441 logical already_found431 logical already_found
442 integer ifile,nevents,i,ii,ii2,iistr,ipart,itempsc,itempPDF432 integer ifile,nevents,i,ii,ii2,iistr,ipart,itempsc,itempPDF
@@ -652,6 +642,7 @@
652 subroutine write_lhef_event(ifile,642 subroutine write_lhef_event(ifile,
653 # NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,643 # NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
654 # IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)644 # IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)
645 use extra_weights
655 implicit none646 implicit none
656 INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)647 INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)
657 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,648 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,
@@ -669,7 +660,6 @@
669 common/c_i_process/i_process660 common/c_i_process/i_process
670 integer nattr,npNLO,npLO661 integer nattr,npNLO,npLO
671 common/event_attributes/nattr,npNLO,npLO662 common/event_attributes/nattr,npNLO,npLO
672 include 'reweight_all.inc'
673 include './run.inc'663 include './run.inc'
674 include 'unlops.inc'664 include 'unlops.inc'
675c if event_id is zero or positive (that means that there was a call665c if event_id is zero or positive (that means that there was a call
@@ -824,6 +814,7 @@
824 subroutine read_lhef_event(ifile,814 subroutine read_lhef_event(ifile,
825 # NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,815 # NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
826 # IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)816 # IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)
817 use extra_weights
827 implicit none818 implicit none
828 INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)819 INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)
829 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,820 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,
@@ -842,7 +833,6 @@
842 common/c_i_process/i_process833 common/c_i_process/i_process
843 integer nattr,npNLO,npLO834 integer nattr,npNLO,npLO
844 common/event_attributes/nattr,npNLO,npLO835 common/event_attributes/nattr,npNLO,npLO
845 include 'reweight_all.inc'
846 include 'unlops.inc'836 include 'unlops.inc'
847 include 'run.inc'837 include 'run.inc'
848c838c
@@ -876,11 +866,27 @@
876 if(jwgtinfo.eq.-5 .or. jwgtinfo.eq.-9) then866 if(jwgtinfo.eq.-5 .or. jwgtinfo.eq.-9) then
877 read(ifile,'(a)')string867 read(ifile,'(a)')string
878 read(ifile,*) wgtref,n_ctr_found,n_mom_conf,wgtcpower868 read(ifile,*) wgtref,n_ctr_found,n_mom_conf,wgtcpower
869 if (.not.allocated(momenta_str)) allocate(momenta_str(0:3
870 $ ,max_mext,max_mom_str))
871 if (n_mom_conf.gt.max_mom_str .or. mexternal.gt.max_mext)
872 $ then
873 deallocate(momenta_str)
874 max_mom_str=max(n_mom_conf,max_mom_str)
875 max_mext=max(mexternal,max_mext)
876 allocate(momenta_str(0:3,max_mext,max_mom_str))
877 endif
879 do i=1,n_mom_conf878 do i=1,n_mom_conf
880 do j=1,mexternal879 do j=1,mexternal
881 read (ifile,*) (momenta_str(ii,j,i),ii=0,3)880 read (ifile,*) (momenta_str(ii,j,i),ii=0,3)
882 enddo881 enddo
883 enddo882 enddo
883 if (.not.allocated(n_ctr_str))
884 $ allocate(n_ctr_str(max_n_ctr))
885 if (n_ctr_found.gt.max_n_ctr) then
886 deallocate(n_ctr_str)
887 max_n_ctr=n_ctr_found
888 allocate(n_ctr_str(max_n_ctr))
889 endif
884 do i=1,n_ctr_found890 do i=1,n_ctr_found
885 read (ifile,'(a)') n_ctr_str(i)891 read (ifile,'(a)') n_ctr_str(i)
886 enddo892 enddo
@@ -955,6 +961,7 @@
955 subroutine read_lhef_event_catch(ifile,961 subroutine read_lhef_event_catch(ifile,
956 # NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,962 # NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
957 # IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)963 # IDUP,ISTUP,MOTHUP,ICOLUP,PUP,VTIMUP,SPINUP,buff)
964 use extra_weights
958 implicit none965 implicit none
959 INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)966 INTEGER NUP,IDPRUP,IDUP(*),ISTUP(*),MOTHUP(2,*),ICOLUP(2,*)
960 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,967 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,
@@ -973,7 +980,6 @@
973 common/c_i_process/i_process980 common/c_i_process/i_process
974 integer nattr,npNLO,npLO981 integer nattr,npNLO,npLO
975 common/event_attributes/nattr,npNLO,npLO982 common/event_attributes/nattr,npNLO,npLO
976 include 'reweight_all.inc'
977 include 'unlops.inc'983 include 'unlops.inc'
978 include 'run.inc'984 include 'run.inc'
979c985c
@@ -1008,23 +1014,39 @@
1008 enddo1014 enddo
1009 read(ifile,'(a)')buff1015 read(ifile,'(a)')buff
1010 if(buff(1:1).eq.'#')then1016 if(buff(1:1).eq.'#')then
1011 read(buff,*)ch1,iSorH_lhe,ifks_lhe,jfks_lhe,1017 read(buff,*)ch1,iSorH_lhe,ifks_lhe,jfks_lhe,
1012 # fksfather_lhe,ipartner_lhe,1018 # fksfather_lhe,ipartner_lhe,
1013 # scale1_lhe,scale2_lhe,1019 # scale1_lhe,scale2_lhe,
1014 # jwgtinfo,mexternal,iwgtnumpartn,1020 # jwgtinfo,mexternal,iwgtnumpartn,
1015 # wgtcentral,wgtmumin,wgtmumax,wgtpdfmin,wgtpdfmax1021 # wgtcentral,wgtmumin,wgtmumax,wgtpdfmin,wgtpdfmax
1016 if(jwgtinfo.eq.-5 .or. jwgtinfo.eq.-9) then
1017 read(ifile,'(a)')string
1018 read(ifile,*) wgtref,n_ctr_found,n_mom_conf,wgtcpower
1019 do i=1,n_mom_conf
1020 do j=1,mexternal
1021 read (ifile,*) (momenta_str(ii,j,i),ii=0,3)
1022 enddo
1023 enddo
1024 do i=1,n_ctr_found
1025 read (ifile,'(a)') n_ctr_str(i)
1026 enddo
1027 read(ifile,'(a)')string
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: