Merge lp:~maddevelopers/mg5amcnlo/2.3.3 into lp:mg5amcnlo/lts

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 262
Proposed branch: lp:~maddevelopers/mg5amcnlo/2.3.3
Merge into: lp:mg5amcnlo/lts
Diff against target: 57859 lines (+10511/-38335) (has conflicts)
287 files modified
MadSpin/decay.py (+10/-3)
MadSpin/interface_madspin.py (+24/-11)
Template/LO/Source/dsample.f (+2/-2)
Template/LO/Source/kin_functions.f (+5/-1)
Template/LO/bin/generate_events (+2/-2)
Template/LO/bin/internal/Gridpack/compile (+2/-2)
Template/LO/bin/internal/create_matching_plots.C (+10/-0)
Template/LO/bin/internal/create_matching_plots.sh (+1/-3)
Template/LO/bin/internal/plot_tree.C (+5/-1)
Template/LO/bin/internal/read_tree_files.C (+0/-12)
Template/MadWeight/Python/Info.py (+5/-5)
Template/MadWeight/Python/clean.py (+2/-2)
Template/NLO/Cards/run_card.dat (+2/-0)
Template/NLO/Cards/shower_card.dat (+6/-6)
Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script (+1/-0)
Template/NLO/Source/PDF/pdg2pdf.f (+5/-1)
Template/NLO/Source/PDF/pdg2pdf_lhapdf.f (+6/-0)
Template/NLO/Source/run.inc (+3/-0)
Template/NLO/Source/run_config.inc (+1/-1)
Template/NLO/SubProcesses/ajob_template (+38/-99)
Template/NLO/SubProcesses/check_poles.f (+1/-1)
Template/NLO/SubProcesses/combine_results.sh (+0/-55)
Template/NLO/SubProcesses/combine_results_FO.sh (+0/-52)
Template/NLO/SubProcesses/combine_root.sh (+1/-1)
Template/NLO/SubProcesses/driver_mintFO.f (+92/-116)
Template/NLO/SubProcesses/driver_mintMC.f (+29/-11)
Template/NLO/SubProcesses/fks_Sij.f (+13/-3)
Template/NLO/SubProcesses/fks_inc_chooser.f (+3/-1)
Template/NLO/SubProcesses/fks_singular.f (+103/-36)
Template/NLO/SubProcesses/genps_fks.f (+32/-15)
Template/NLO/SubProcesses/iproc_map.f (+25/-32)
Template/NLO/SubProcesses/leshouche_inc_chooser.f (+1/-1)
Template/NLO/SubProcesses/montecarlocounter.f (+3/-2)
Template/NLO/SubProcesses/setcuts.f (+0/-2)
Template/NLO/SubProcesses/setscales.f (+9/-3)
Template/NLO/SubProcesses/sumres.py (+0/-241)
Template/NLO/SubProcesses/symmetry_fks_test_ME.f (+1/-1)
Template/NLO/SubProcesses/symmetry_fks_v3.f (+4/-11)
Template/NLO/SubProcesses/write_ajob.f (+1/-1)
Template/loop_material/StandAlone/Cards/MadLoopParams.dat (+2/-2)
UpdateNotes.txt (+23/-1)
VERSION (+5/-0)
aloha/aloha_lib.py (+2/-2)
aloha/aloha_object.py (+2/-2)
aloha/aloha_writers.py (+1/-1)
aloha/create_aloha.py (+1/-1)
aloha/template_files/aloha_functions_loop.f (+7/-6)
aloha/template_files/wavefunctions.py (+3/-3)
bin/mg5 (+1/-1)
input/.mg5_configuration_default.txt (+3/-0)
madgraph/core/base_objects.py (+164/-88)
madgraph/core/diagram_generation.py (+3/-2)
madgraph/core/drawing.py (+3/-3)
madgraph/core/helas_objects.py (+1/-1)
madgraph/fks/fks_base.py (+13/-1)
madgraph/interface/amcatnlo_interface.py (+21/-6)
madgraph/interface/amcatnlo_run_interface.py (+894/-620)
madgraph/interface/common_run_interface.py (+71/-57)
madgraph/interface/extended_cmd.py (+34/-5)
madgraph/interface/launch_ext_program.py (+4/-3)
madgraph/interface/loop_interface.py (+13/-9)
madgraph/interface/madevent_interface.py (+58/-7)
madgraph/interface/madgraph_interface.py (+749/-133)
madgraph/interface/master_interface.py (+3/-2)
madgraph/interface/reweight_interface.py (+78/-48)
madgraph/iolibs/drawing_eps.py (+13/-13)
madgraph/iolibs/export_cpp.py (+92/-45)
madgraph/iolibs/export_fks.py (+14/-3)
madgraph/iolibs/export_v4.py (+130/-60)
madgraph/iolibs/import_v4.py (+2/-2)
madgraph/iolibs/template_files/check_sa.cpp (+1/-1)
madgraph/iolibs/template_files/loop/check_sa.inc (+1/-0)
madgraph/iolibs/template_files/loop/check_sa_loop_induced.inc (+1/-0)
madgraph/iolibs/template_files/matrix_standalone_splitOrders_v4.inc (+1/-1)
madgraph/iolibs/template_files/matrix_standalone_v4.inc (+1/-1)
madgraph/iolibs/template_files/parton_lum_n_fks.inc (+5/-1)
madgraph/iolibs/template_files/pythia8/pythia8.2_main_example_cc.inc (+63/-0)
madgraph/iolibs/template_files/pythia8/pythia8.2_main_makefile.inc (+36/-0)
madgraph/iolibs/template_files/pythia8/pythia8.2_makefile.inc (+104/-0)
madgraph/iolibs/template_files/pythia8/pythia8_main_example_cc.inc (+2/-2)
madgraph/iolibs/template_files/pythia8/pythia8_model_parameters_cc.inc (+1/-1)
madgraph/iolibs/template_files/pythia8/pythia8_model_parameters_h.inc (+3/-3)
madgraph/iolibs/template_files/pythia8/pythia8_process_h.inc (+1/-1)
madgraph/iolibs/template_files/pythia8/pythia8_process_hel_amp_h.inc (+1/-1)
madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc (+7/-4)
madgraph/iolibs/ufo_expression_parsers.py (+55/-10)
madgraph/loop/loop_base_objects.py (+1/-1)
madgraph/loop/loop_diagram_generation.py (+58/-13)
madgraph/loop/loop_exporters.py (+2/-2)
madgraph/madevent/gen_crossxhtml.py (+3/-4)
madgraph/madevent/gen_ximprove.py (+16/-1)
madgraph/madevent/sum_html.py (+21/-18)
madgraph/madweight/create_param.py (+3/-3)
madgraph/madweight/diagram_class.py (+3/-3)
madgraph/madweight/verif_event.py (+122/-122)
madgraph/various/banner.py (+55/-35)
madgraph/various/cluster.py (+154/-155)
madgraph/various/histograms.py (+2/-2)
madgraph/various/lhe_parser.py (+149/-22)
madgraph/various/misc.py (+128/-11)
madgraph/various/process_checks.py (+2240/-98)
mg5decay/decay_objects.py (+22/-6)
models/check_param_card.py (+236/-14)
models/import_ufo.py (+64/-11)
models/loop_qcd_qed_sm/.restrict_parallel_test_MB.dat (+65/-0)
models/loop_qcd_qed_sm/CT_couplings.py (+2/-2)
models/loop_qcd_qed_sm/CT_parameters.py (+113/-106)
models/loop_qcd_qed_sm/function_library.py (+19/-5)
models/loop_qcd_qed_sm/object_library.py (+2/-41)
models/loop_qcd_qed_sm/parameters.py (+7/-0)
models/loop_qcd_qed_sm/particles.py (+3/-3)
models/loop_qcd_qed_sm/restrict_with_b_mass.dat (+65/-0)
models/loop_qcd_qed_sm/restrict_with_b_mass_no_widths.dat (+65/-0)
models/loop_qcd_qed_sm_Gmu/CT_couplings.py (+13/-13)
models/loop_qcd_qed_sm_Gmu/CT_parameters.py (+222/-76)
models/loop_qcd_qed_sm_Gmu/function_library.py (+19/-4)
models/loop_qcd_qed_sm_Gmu/object_library.py (+5/-5)
models/loop_qcd_qed_sm_Gmu/parameters.py (+8/-1)
models/loop_qcd_qed_sm_Gmu/particles.py (+3/-3)
models/loop_qcd_qed_sm_Gmu/restrict_ckm.dat (+2/-2)
models/loop_qcd_qed_sm_Gmu/restrict_default.dat (+4/-4)
models/loop_qcd_qed_sm_Gmu/restrict_no_widths.dat (+1/-1)
models/loop_qcd_qed_sm_Gmu__CMS__/.restrict_parallel_test.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/.restrict_parallel_test_WW.dat (+0/-66)
models/loop_qcd_qed_sm_Gmu__CMS__/.restrict_parallel_test_WZ.dat (+0/-66)
models/loop_qcd_qed_sm_Gmu__CMS__/.restrict_parallel_test_ZZ.dat (+0/-66)
models/loop_qcd_qed_sm_Gmu__CMS__/CT_couplings.py (+0/-7213)
models/loop_qcd_qed_sm_Gmu__CMS__/CT_parameters.py (+0/-600)
models/loop_qcd_qed_sm_Gmu__CMS__/CT_vertices.py (+0/-4849)
models/loop_qcd_qed_sm_Gmu__CMS__/__init__.py (+0/-27)
models/loop_qcd_qed_sm_Gmu__CMS__/coupling_orders.py (+0/-16)
models/loop_qcd_qed_sm_Gmu__CMS__/couplings.py (+0/-539)
models/loop_qcd_qed_sm_Gmu__CMS__/function_library.py (+0/-81)
models/loop_qcd_qed_sm_Gmu__CMS__/lorentz.py (+0/-361)
models/loop_qcd_qed_sm_Gmu__CMS__/object_library.py (+0/-313)
models/loop_qcd_qed_sm_Gmu__CMS__/parameters.py (+0/-1211)
models/loop_qcd_qed_sm_Gmu__CMS__/particles.py (+0/-381)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_ckm.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_default.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_no_widths.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_parallel_test.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_parallel_test_WW.dat (+0/-66)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_parallel_test_WZ.dat (+0/-66)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_parallel_test_ZZ.dat (+0/-66)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_with_b_mass.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/restrict_with_b_mass_no_width.dat (+0/-65)
models/loop_qcd_qed_sm_Gmu__CMS__/vertices.py (+0/-1037)
models/loop_qcd_qed_sm_Gmu__CMS__/write_param_card.py (+0/-181)
models/loop_qcd_qed_sm__CMS__/.restrict_parallel_test.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/.restrict_parallel_test_MB.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/CT_couplings.py (+0/-7213)
models/loop_qcd_qed_sm__CMS__/CT_parameters.py (+0/-600)
models/loop_qcd_qed_sm__CMS__/CT_vertices.py (+0/-4849)
models/loop_qcd_qed_sm__CMS__/__init__.py (+0/-27)
models/loop_qcd_qed_sm__CMS__/coupling_orders.py (+0/-16)
models/loop_qcd_qed_sm__CMS__/couplings.py (+0/-539)
models/loop_qcd_qed_sm__CMS__/function_library.py (+0/-81)
models/loop_qcd_qed_sm__CMS__/lorentz.py (+0/-361)
models/loop_qcd_qed_sm__CMS__/object_library.py (+0/-366)
models/loop_qcd_qed_sm__CMS__/parameters.py (+0/-1225)
models/loop_qcd_qed_sm__CMS__/particles.py (+0/-381)
models/loop_qcd_qed_sm__CMS__/restrict_ckm.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/restrict_default.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/restrict_no_widths.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/restrict_parallel_test.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/restrict_with_b_mass.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/restrict_with_b_mass_no_widths.dat (+0/-65)
models/loop_qcd_qed_sm__CMS__/vertices.py (+0/-1037)
models/loop_qcd_qed_sm__CMS__/write_param_card.py (+0/-181)
models/model_reader.py (+11/-5)
models/write_param_card.py (+2/-2)
tests/acceptance_tests/test_cmd.py (+2/-1)
tests/acceptance_tests/test_cmd_amcatnlo.py (+22/-12)
tests/acceptance_tests/test_cmd_madevent.py (+21/-5)
tests/acceptance_tests/test_cmd_madloop.py (+228/-24)
tests/acceptance_tests/test_madweight.py (+1/-0)
tests/input_files/IOTestsComparison/ExportV4IOTest/export_matrix_element_v4_standalone/matrix.f (+1/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%parton_lum_0.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%parton_lum_0.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%parton_lum_0.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%parton_lum_1.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%parton_lum_2.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%parton_lum_3.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%parton_lum_4.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%parton_lum_5.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%parton_lum_1.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%parton_lum_2.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%parton_lum_3.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%parton_lum_1.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%parton_lum_2.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%parton_lum_3.f (+5/-1)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_001.f (+153/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_002.f (+153/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_003.f (+154/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_004.f (+154/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_005.f (+153/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_006.f (+154/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_007.f (+154/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%b_sf_008.f (+153/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born.f (+298/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_conf.inc (+8/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_decayBW.inc (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_hel.f (+151/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_leshouche.inc (+8/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_maxamps.inc (+3/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_ngraphs.inc (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_nhel.inc (+3/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born_props.inc (+6/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%coloramps.inc (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%config_subproc_map.inc (+1/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%configs_and_props_decl.inc (+12/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%fks_info.inc (+46/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%get_color.f (+54/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%leshouche_decl.inc (+6/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f (+194/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%nFKSconfigs.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%ncombs.inc (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%nexternal.inc (+4/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%ngraphs.inc (+2/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%parton_lum_1.f (+98/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%parton_lum_chooser.f (+21/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%pmass.inc (+5/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%real_from_born_configs.inc (+5/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%real_me_chooser.f (+20/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%sborn_sf.f (+45/-0)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%sborn_sf_dum.f (+13/-0)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f (+11/-5)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f (+1/-1)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f (+3/-3)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_NoSQSO.f (+1/-1)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_QCDsq_le_6.f (+1/-1)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_ampOrderQED2_eq_2_WGTsq_le_14_QCDsq_gt_4.f (+1/-1)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/check_sa.f (+1/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%model_functions.f (+41/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%model_functions.inc (+10/-0)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f (+1/-1)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/check_sa.f (+1/-0)
tests/input_files/LoopSMEWTest/CT_parameters.py (+3/-3)
tests/input_files/LoopSMEWTest/function_library.py (+2/-2)
tests/input_files/LoopSMEWTest/object_library.py (+27/-27)
tests/input_files/test_mssm_generation (+1/-0)
tests/parallel_tests/madevent_comparator.py (+1/-0)
tests/parallel_tests/me_comparator.py (+1/-0)
tests/parallel_tests/test_ML5EW.py (+112/-2)
tests/test_manager.py (+18/-4)
tests/time_db (+214/-211)
tests/unit_tests/core/test_base_objects.py (+13/-11)
tests/unit_tests/core/test_drawing.py (+5/-3)
tests/unit_tests/interface/test_cmd.py (+3/-0)
tests/unit_tests/interface/test_edit_card.py (+8/-2)
tests/unit_tests/iolibs/test_export_cpp.py (+2/-1)
tests/unit_tests/iolibs/test_export_fks.py (+4/-0)
tests/unit_tests/loop/test_import_LoopUFOModel.py (+10/-9)
tests/unit_tests/various/test_check_param_card.py (+47/-0)
tests/unit_tests/various/test_decay.py (+6/-6)
vendor/CutTools/src/avh/avh_olo.f90 (+1/-1)
vendor/SMWidth/param_card.dat (+0/-65)
vendor/SMWidth/param_card_Gmu.dat (+0/-65)
vendor/SMWidth/param_card_MZ.dat (+0/-65)
Text conflict in UpdateNotes.txt
Text conflict in VERSION
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/2.3.3
Reviewer Review Type Date Requested Status
Rikkert Frederix Approve
Review via email: mp+275027@code.launchpad.net

Description of the change

I think this is time to merge.
Any objection?

Olivier

To post a comment you must log in.
Revision history for this message
Rikkert Frederix (frederix) wrote :

Hi Olivier,

yeah, it's definitely time.
There seems to be many text conflicts, though. Strange...

Cheers,
Rik

lp:~maddevelopers/mg5amcnlo/2.3.3 updated
326. By Rikkert Frederix

only call the "set_mc_matrices" when actually including the
shower-subtraction terms.

327. By Hua-Sheng Shao

update the standalone files for IO test

328. By Olivier Mattelaer

merge with 2.3.2.2

329. By Rikkert Frederix

small fix for the applgrid stuff when running with [LOonly=QCD]

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Hi Rik,

Indeed that was weird, looks like it was related to the 2.3.2.2 release.

I merged that branch inside this branch and everything seems fine now.
(will run all the test to be sure)

Cheers,

Olivier

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

Hi Olivier,

I'm okay with releasing this version.

Cheers,
Rik

review: Approve
lp:~maddevelopers/mg5amcnlo/2.3.3 updated
330. By marco zaro

fix for having LOonly running also with processes without colored particles

Revision history for this message
marco zaro (marco-zaro) wrote :

guys
sorry, i did a last minute push, which enables people to do LOonly also for processes without
any QCD colored particle (e.g. a a > e+ e-).
I hope this could be included in the releaseā€¦
Thanks!

Marco

On 21 Oct 2015, at 10:54, Rikkert Frederix <email address hidden> wrote:

> Review: Approve
>
> Hi Olivier,
>
> I'm okay with releasing this version.
>
> Cheers,
> Rik
>
> --
> https://code.launchpad.net/~maddevelopers/mg5amcnlo/2.3.3/+merge/275027
> Your team MadDevelopers is subscribed to branch lp:~maddevelopers/mg5amcnlo/2.3.3.

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

Hi Marco,

I just checked your last push and I think it is all okay.

Cheers,
Rik

lp:~maddevelopers/mg5amcnlo/2.3.3 updated
331. By Olivier Mattelaer

allow some basic notification in the apple notification center

332. By Rikkert Frederix

fix for event reweighting in the case of lepton-lepton collisions (NLO processes)

333. By Olivier Mattelaer

improve compatibility with SysCalc/Delphes

334. By Rikkert Frederix

small trivial fix for the ApplGrid stuff

335. By Olivier Mattelaer

forbid test to use notification center + put notification at the end of the test + fix the scan from ./bin/generate_events

336. By Olivier Mattelaer

provent notification in parralel test+ fix a bug with some mac compiler

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MadSpin/__init__.py' (properties changed: -x to +x)
=== modified file 'MadSpin/decay.py'
--- MadSpin/decay.py 2015-08-20 10:00:00 +0000
+++ MadSpin/decay.py 2015-10-25 15:32:18 +0000
@@ -906,7 +906,7 @@
906 if init[0] in self.banner.param_card['decay'].decay_table:906 if init[0] in self.banner.param_card['decay'].decay_table:
907 br *= self.banner.param_card['decay'].decay_table[init[0]].get(lhaid).value907 br *= self.banner.param_card['decay'].decay_table[init[0]].get(lhaid).value
908 br *= self.get_br(decay)908 br *= self.get_br(decay)
909 else:909 elif -init[0] in self.banner.param_card['decay'].decay_table:
910 init = -init[0]910 init = -init[0]
911 lhaid=[x if self.model.get_particle(x)['self_antipart'] else -x911 lhaid=[x if self.model.get_particle(x)['self_antipart'] else -x
912 for x in final]912 for x in final]
@@ -914,6 +914,13 @@
914 lhaid = tuple([len(final)] + lhaid)914 lhaid = tuple([len(final)] + lhaid)
915 br *= self.banner.param_card['decay'].decay_table[init].get(lhaid).value915 br *= self.banner.param_card['decay'].decay_table[init].get(lhaid).value
916 br *= self.get_br(decay)916 br *= self.get_br(decay)
917 elif init[0] not in self.decay_ids and -init[0] not in self.decay_ids:
918 logger.warning("No Branching ratio applied for %s. Please check if this is expected" % init[0])
919 br *= self.get_br(decay)
920 else:
921 raise MadGraph5Error,"No valid decay for %s. No 2 body decay for that particle. (three body are not supported by MadSpin)" % init[0]
922
923
917924
918 for decays in ids.values():925 for decays in ids.values():
919 if len(decays) == 1:926 if len(decays) == 1:
@@ -929,7 +936,7 @@
929 except ValueError:936 except ValueError:
930 break937 break
931 br /= math.factorial(nb)938 br /= math.factorial(nb)
932939
933 return br940 return br
934941
935 942
@@ -1013,7 +1020,7 @@
1013 self[tag]['decaying'] = tuple(decaying)1020 self[tag]['decaying'] = tuple(decaying)
1014 1021
1015 # sanity check1022 # sanity check
1016 assert self[tag]['total_br'] <= 1.01, self[tag]['total_br']1023 assert self[tag]['total_br'] <= 1.01, "wrong BR for %s: %s " % (tag,self[tag]['total_br'])
10171024
10181025
1019 1026
10201027
=== modified file 'MadSpin/interface_madspin.py' (properties changed: -x to +x)
--- MadSpin/interface_madspin.py 2015-08-04 14:28:22 +0000
+++ MadSpin/interface_madspin.py 2015-10-25 15:32:18 +0000
@@ -34,6 +34,7 @@
34import madgraph.interface.master_interface as master_interface34import madgraph.interface.master_interface as master_interface
35import madgraph.various.misc as misc35import madgraph.various.misc as misc
36import madgraph.iolibs.files as files36import madgraph.iolibs.files as files
37import madgraph.iolibs.export_v4 as export_v4
37import madgraph.various.banner as banner38import madgraph.various.banner as banner
38import madgraph.various.lhe_parser as lhe_parser39import madgraph.various.lhe_parser as lhe_parser
3940
@@ -229,15 +230,24 @@
229 args.remove('--bypass_check')230 args.remove('--bypass_check')
230 bypass_check = True231 bypass_check = True
231 232
232 if len(args) != 2: 233 if len(args) == 1:
234 logger.warning("""No param_card defined for the new model. We will use the default one but this might completely wrong.""")
235 elif len(args) != 2:
233 return self.InvalidCmd, 'import model requires two arguments'236 return self.InvalidCmd, 'import model requires two arguments'
234 237
235 model_name = args[0]238 model_name = args[0]
236 card = args[1]
237 if not os.path.exists(card):
238 raise self.InvalidCmd('%s: no such file' % card)
239
240 self.load_model(model_name, False, False)239 self.load_model(model_name, False, False)
240
241 if len(args) == 2:
242 card = args[1]
243 if not os.path.exists(card):
244 raise self.InvalidCmd('%s: no such file' % card)
245 else:
246 card = "madspin_param_card.dat"
247 export_v4.UFO_model_to_mg4.create_param_card_static(self.model,
248 card, rule_card_path=None)
249
250
241251
242 #Check the param_card252 #Check the param_card
243 if not bypass_check:253 if not bypass_check:
@@ -255,11 +265,15 @@
255 if diff:265 if diff:
256 raise self.InvalidCmd('''Original param_card differs on some parameters:266 raise self.InvalidCmd('''Original param_card differs on some parameters:
257 %s267 %s
258 Due to those preferences, we prefer not to proceed. If you are sure about what you are doing, 268 Due to those differences, we prefer not to proceed. If you are sure about what you are doing,
259 you can use the command \'import model MODELNAME PARAM_CARD_PATH --bypass_check\''''269 you can use the command \'import model MODELNAME PARAM_CARD_PATH --bypass_check\''''
260 % diff.replace('\n','\n '))270 % diff.replace('\n','\n '))
271
272
261 273
262 #OK load the new param_card274 #OK load the new param_card (but back up the old one)
275 if 'slha' in self.banner:
276 self.banner['slha_original'] = self.banner['slha']
263 self.banner['slha'] = open(card).read()277 self.banner['slha'] = open(card).read()
264 if hasattr(self.banner, 'param_card'):278 if hasattr(self.banner, 'param_card'):
265 del self.banner.param_card279 del self.banner.param_card
@@ -749,7 +763,7 @@
749 # 2. Generate the events requested763 # 2. Generate the events requested
750 with misc.MuteLogger(["madgraph", "madevent", "ALOHA", "cmdprint"], [50,50,50,50]):764 with misc.MuteLogger(["madgraph", "madevent", "ALOHA", "cmdprint"], [50,50,50,50]):
751 mg5 = self.mg5cmd765 mg5 = self.mg5cmd
752 modelpath = self.model.get('modelpath')766 modelpath = self.model.get('modelpath+restriction')
753 mg5.exec_cmd("import model %s" % modelpath) 767 mg5.exec_cmd("import model %s" % modelpath)
754 to_event = {}768 to_event = {}
755 for pdg, nb_needed in to_decay.items():769 for pdg, nb_needed in to_decay.items():
@@ -923,12 +937,11 @@
923 #base_model = import_ufo.import_model(model_path)937 #base_model = import_ufo.import_model(model_path)
924938
925 # Import model939 # Import model
926 base_model = import_ufo.import_model(name, decay=True)940 base_model = import_ufo.import_model(name, decay=True,
941 complex_mass_scheme=complex_mass)
927942
928 if use_mg_default:943 if use_mg_default:
929 base_model.pass_particles_name_in_mg_default()944 base_model.pass_particles_name_in_mg_default()
930 if complex_mass:
931 base_model.change_mass_to_complex_scheme()
932 945
933 self.model = base_model946 self.model = base_model
934 self.mg5cmd._curr_model = self.model947 self.mg5cmd._curr_model = self.model
935948
=== modified file 'Template/LO/Source/dsample.f'
--- Template/LO/Source/dsample.f 2015-06-08 16:01:11 +0000
+++ Template/LO/Source/dsample.f 2015-10-25 15:32:18 +0000
@@ -1608,7 +1608,7 @@
1608 if (iteration .eq. cur_it) then1608 if (iteration .eq. cur_it) then
1609c Add the current point to the DiscreteSamplerGrid1609c Add the current point to the DiscreteSamplerGrid
1610 call add_entry_to_discrete_dimensions(wgt)1610 call add_entry_to_discrete_dimensions(wgt)
1611 if (kn.eq.0) then1611 if (kn.eq.0.and.(iteration.eq.1.or.use_cut.eq.-2)) then
1612 ! ensure that all cumulative variable are at zero (usefull for reset)1612 ! ensure that all cumulative variable are at zero (usefull for reset)
1613 twgt1 = 0d0 !1613 twgt1 = 0d0 !
1614 iavg = 0 !Vars for averging to increase err estimate1614 iavg = 0 !Vars for averging to increase err estimate
@@ -2156,7 +2156,7 @@
2156c $ access='append',err=129)2156c $ access='append',err=129)
2157c write(22, 80) real(tmean), real(tsigma), real(chi2)2157c write(22, 80) real(tmean), real(tsigma), real(chi2)
2158c 129 close(22)2158c 129 close(22)
2159 tsigma = tsigma*sqrt(chi2) !This gives the 68% confidence cross section2159 tsigma = tsigma*sqrt(max(0d0,chi2)) !This gives the 68% confidence cross section
2160 cur_it = itm+202160 cur_it = itm+20
2161 return2161 return
2162 endif2162 endif
21632163
=== modified file 'Template/LO/Source/kin_functions.f'
--- Template/LO/Source/kin_functions.f 2014-09-11 15:22:26 +0000
+++ Template/LO/Source/kin_functions.f 2015-10-25 15:32:18 +0000
@@ -127,7 +127,11 @@
127c pm=dsqrt(p(1)**2+p(2)**2+p(3)**2)127c pm=dsqrt(p(1)**2+p(2)**2+p(3)**2)
128 128
129 pm = p(0)129 pm = p(0)
130 rap = .5d0*dlog((pm+p(3))/(pm-p(3)))+cm_rap130 if (pm.gt.p(3)) then
131 rap = .5d0*dlog((pm+p(3))/(pm-p(3)))+cm_rap
132 else
133 rap = -1d99
134 endif
131 end135 end
132 DOUBLE PRECISION FUNCTION rap2(p)136 DOUBLE PRECISION FUNCTION rap2(p)
133c************************************************************************137c************************************************************************
134138
=== modified file 'Template/LO/bin/generate_events'
--- Template/LO/bin/generate_events 2013-11-14 21:10:30 +0000
+++ Template/LO/bin/generate_events 2015-10-25 15:32:18 +0000
@@ -149,13 +149,13 @@
149 argument = sys.argv149 argument = sys.argv
150 try:150 try:
151 if '-h' in argument or '--help' in argument:151 if '-h' in argument or '--help' in argument:
152 launch = ME.MadEventCmd(me_dir=root_path)152 launch = ME.MadEventCmdShell(me_dir=root_path)
153 launch.exec_cmd('help generate_events')153 launch.exec_cmd('help generate_events')
154 sys.exit()154 sys.exit()
155 elif len(argument) > 1 and argument[1] in ['0', '1', '2']:155 elif len(argument) > 1 and argument[1] in ['0', '1', '2']:
156 argument = treat_old_argument(argument)156 argument = treat_old_argument(argument)
157 157
158 launch = ME.MadEventCmd(me_dir=root_path)158 launch = ME.MadEventCmdShell(me_dir=root_path)
159 launch.run_cmd('generate_events %s' % ' '.join(argument[1:]))159 launch.run_cmd('generate_events %s' % ' '.join(argument[1:]))
160 launch.run_cmd('quit')160 launch.run_cmd('quit')
161 except KeyboardInterrupt:161 except KeyboardInterrupt:
162162
=== modified file 'Template/LO/bin/internal/Gridpack/compile'
--- Template/LO/bin/internal/Gridpack/compile 2013-11-13 02:21:10 +0000
+++ Template/LO/bin/internal/Gridpack/compile 2015-10-25 15:32:18 +0000
@@ -37,8 +37,8 @@
37fi37fi
3838
39# Check for LHAPDF39# Check for LHAPDF
40c=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat`40c=`awk '/^[^#].*=[^#!]*pdlabel/{print $1}' Cards/run_card.dat`
41if [[ $c == "'lhapdf'" ]]; then41if [[ $c == "'lhapdf'" || $c == "lhapdf" ]]; then
42 echo Using LHAPDF interface!42 echo Using LHAPDF interface!
43 export lhapdf=true43 export lhapdf=true
44else44else
4545
=== renamed file 'Template/LO/bin/internal/addmasses.py' => 'Template/LO/bin/internal/addmasses_optional.py'
=== modified file 'Template/LO/bin/internal/create_matching_plots.C'
--- Template/LO/bin/internal/create_matching_plots.C 2011-06-29 14:15:21 +0000
+++ Template/LO/bin/internal/create_matching_plots.C 2015-10-25 15:32:18 +0000
@@ -1,4 +1,14 @@
1{1{
2 const char* file="pythia.root";
3 TFile *f = new TFile(file,"RECREATE");
4 TTree *events = new TTree("events","Events");
5 Long64_t nlines1 = events->ReadFile("events.tree","Npart:DJR1:DJR2:DJR3:DJR4:PTISR:PTFSR:PT2MX:NCJET:IFILE");
6 cout << "Found "<< nlines1 << " events"<<endl;
7 TTree *xsecs = new TTree("xsecs","Xsecs");
8 Long64_t nlines2 = xsecs->ReadFile("xsecs.tree","Xsecfact");
9 cout << "Found "<< nlines2 << " files"<<endl;
10 f->Write();
11
2 gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR1\")");12 gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR1\")");
3 gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR2\")");13 gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR2\")");
4 gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR3\")");14 gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR3\")");
515
=== modified file 'Template/LO/bin/internal/create_matching_plots.sh'
--- Template/LO/bin/internal/create_matching_plots.sh 2012-07-20 06:20:21 +0000
+++ Template/LO/bin/internal/create_matching_plots.sh 2015-10-25 15:32:18 +0000
@@ -24,9 +24,7 @@
24 exit24 exit
25fi25fi
2626
27echo Running root27echo Creating matching plots
28root -q -b -l ../bin/internal/read_tree_files.C &> /dev/null
29echo Creating plots
30root -q -b -l ../bin/internal/create_matching_plots.C &> /dev/null28root -q -b -l ../bin/internal/create_matching_plots.C &> /dev/null
31mv pythia.root $1/$2_pythia.root29mv pythia.root $1/$2_pythia.root
3230
3331
=== modified file 'Template/LO/bin/internal/plot_tree.C'
--- Template/LO/bin/internal/plot_tree.C 2014-09-24 19:41:18 +0000
+++ Template/LO/bin/internal/plot_tree.C 2015-10-25 15:32:18 +0000
@@ -1,7 +1,11 @@
1#include <string>1#include <string>
22
3bool plot_tree(char* quantity,char* plotdim="(100,0.,3.)",bool log=true)3bool plot_tree(const char* quantity, const char* plotdim = 0, bool log = true)
4{4{
5 const char* plotdim_default = "(100,0.,3.)";
6 if(plotdim == 0){
7 plotdim = plotdim_default;
8 }
5 char tmp1[250];9 char tmp1[250];
6 char tmp2[300];10 char tmp2[300];
7 char tmp3[100];11 char tmp3[100];
812
=== removed file 'Template/LO/bin/internal/read_tree_files.C'
--- Template/LO/bin/internal/read_tree_files.C 2011-06-29 14:15:21 +0000
+++ Template/LO/bin/internal/read_tree_files.C 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1{
2 char* file="pythia.root";
3 TFile *f = new TFile(file,"RECREATE");
4 TTree *events = new TTree("events","Events");
5 Long64_t nlines1 = events->ReadFile("events.tree","Npart:DJR1:DJR2:DJR3:DJR4:PTISR:PTFSR:PT2MX:NCJET:IFILE");
6 cout << "Found "<< nlines1 << " events"<<endl;
7 TTree *xsecs = new TTree("xsecs","Xsecs");
8 Long64_t nlines2 = xsecs->ReadFile("xsecs.tree","Xsecfact");
9 cout << "Found "<< nlines2 << " files"<<endl;
10
11 f->Write();
12}
130
=== modified file 'Template/MadWeight/Python/Info.py'
--- Template/MadWeight/Python/Info.py 2011-10-25 14:42:02 +0000
+++ Template/MadWeight/Python/Info.py 2015-10-25 15:32:18 +0000
@@ -1,11 +1,11 @@
1#!/usr/bin/env python1#!/usr/bin/env python
22
3def giveInfo(class_):3def giveInfo(class_):
4 if type(class_)!=str:4 if type(class_)!=str:
5 class_=class_.__class__.__name__5 class_=class_.__class__.__name__
6 for info in dir(eval(class_)):6 for info in dir(eval(class_)):
7 7
8 print class_+'.'+info+' : ',eval(class_+'.'+info+'.__doc__')8 print class_+'.'+info+' : ',eval(class_+'.'+info+'.__doc__')
99
1010
1111
1212
=== modified file 'Template/MadWeight/Python/clean.py'
--- Template/MadWeight/Python/clean.py 2011-10-25 14:42:02 +0000
+++ Template/MadWeight/Python/clean.py 2015-10-25 15:32:18 +0000
@@ -70,7 +70,7 @@
70 ls=os.listdir('.')70 ls=os.listdir('.')
71 for element in ls:71 for element in ls:
72 if os.path.isdir(element) and element[0]=='P':72 if os.path.isdir(element) and element[0]=='P':
73 status,mess=clean.suppress_dir(os.path.join(element,run_name))73 status,mess=clean.suppress_dir(os.path.join(element,run_name))
74 #if not status:74 #if not status:
75 # print 'supress ',element,' failed:' 75 # print 'supress ',element,' failed:'
76 # print mess76 # print mess
@@ -93,7 +93,7 @@
93 ls=os.listdir('.')93 ls=os.listdir('.')
94 for element in ls:94 for element in ls:
95 if os.path.isdir(element) and len(element)>4 and element[:4]=='MW_P':95 if os.path.isdir(element) and len(element)>4 and element[:4]=='MW_P':
96 status,mess=clean.suppress_dir(os.path.join(element,run_name))96 status,mess=clean.suppress_dir(os.path.join(element,run_name))
97 #if not status:97 #if not status:
98 # print 'supress ',element,' failed:' 98 # print 'supress ',element,' failed:'
99 # print mess99 # print mess
100100
=== modified file 'Template/NLO/Cards/run_card.dat'
--- Template/NLO/Cards/run_card.dat 2015-07-30 15:57:44 +0000
+++ Template/NLO/Cards/run_card.dat 2015-10-25 15:32:18 +0000
@@ -66,6 +66,8 @@
66# WARNING: PYTHIA6PT works only for processes without FSR!!!! *66# WARNING: PYTHIA6PT works only for processes without FSR!!!! *
67#***********************************************************************67#***********************************************************************
68 %(parton_shower)s = parton_shower68 %(parton_shower)s = parton_shower
69 %(shower_scale_factor)s = shower_scale_factor ! multiply default shower starting
70 ! scale by this factor
69#***********************************************************************71#***********************************************************************
70# Renormalization and factorization scales *72# Renormalization and factorization scales *
71# (Default functional form for the non-fixed scales is the sum of *73# (Default functional form for the non-fixed scales is the sum of *
7274
=== modified file 'Template/NLO/Cards/shower_card.dat'
--- Template/NLO/Cards/shower_card.dat 2015-03-09 17:19:46 +0000
+++ Template/NLO/Cards/shower_card.dat 2015-10-25 15:32:18 +0000
@@ -85,15 +85,15 @@
85# *85# *
86# Examples of syntax: *86# Examples of syntax: *
87# Z -> e+ e- or mu+ mu- with BR = 0.5 each *87# Z -> e+ e- or mu+ mu- with BR = 0.5 each *
88# DM_1 = 23 > -11 11 @ 0.5d0 @ 100 *88# DM_1 = 23 > -11 11 @ 0.5d0 @ 100
89# DM_2 = 23 > -13 13 @ 0.5d0 @ 100 *89# DM_2 = 23 > -13 13 @ 0.5d0 @ 100
90# H -> tau+ tau- with BR = 1 *90# H -> tau+ tau- with BR = 1 *
91# DM_3 = 25 > -15 15 @ 1.0d0 @ 0 *91# DM_3 = 25 > -15 15 @ 1.0d0 @ 0
92# t -> nu_e e+ b with BR = 1 (HERWIG) *92# t -> nu_e e+ b with BR = 1 (HERWIG) *
93# DM_4 = 6 > 12 -11 5 @ 1d0 @ 100 *93# DM_4 = 6 > 12 -11 5 @ 1d0 @ 100
94# t -> nu_e e+ b with BR = 1 (PYTHIA) *94# t -> nu_e e+ b with BR = 1 (PYTHIA) *
95# DM_5 = 6 > 24 5 @ 1d0 @ 100 *95# DM_5 = 6 > 24 5 @ 1d0 @ 100
96# DM_6 = 24 > 12 -11 @ 1d0 @ 100 *96# DM_6 = 24 > 12 -11 @ 1d0 @ 100
97#***********************************************************************97#***********************************************************************
98# Extra Libraries/analyses *98# Extra Libraries/analyses *
99# The following lines need to be changed if the user does not want to *99# The following lines need to be changed if the user does not want to *
100100
=== modified file 'Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script'
--- Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script 2015-04-24 09:57:53 +0000
+++ Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script 2015-10-25 15:32:18 +0000
@@ -517,6 +517,7 @@
517TimeShower:MEafterFirst = off ! No Matrix-element corrections after first emission517TimeShower:MEafterFirst = off ! No Matrix-element corrections after first emission
518TimeShower:phiPolAsym = on ! Azimuthal asymmetry induced by gluon polarization518TimeShower:phiPolAsym = on ! Azimuthal asymmetry induced by gluon polarization
519TimeShower:alphaSuseCMW = false ! Use the CMW prescription in FSR519TimeShower:alphaSuseCMW = false ! Use the CMW prescription in FSR
520TimeShower:weightGluonToQuark = 1 ! Use normal Altarelli-Parisi kernels for g -> q qbar
520521
521! 6) Initial-state shower.522! 6) Initial-state shower.
522SpaceShower:pTmaxMatch = 1 ! Use scalup (re-check)523SpaceShower:pTmaxMatch = 1 ! Use scalup (re-check)
523524
=== modified file 'Template/NLO/Source/PDF/pdg2pdf.f'
--- Template/NLO/Source/PDF/pdg2pdf.f 2015-08-07 08:57:55 +0000
+++ Template/NLO/Source/PDF/pdg2pdf.f 2015-10-25 15:32:18 +0000
@@ -47,7 +47,11 @@
47 data pdlabellast/20*'abcdefg'/47 data pdlabellast/20*'abcdefg'/
48 data ihlast/20*-99/48 data ihlast/20*-99/
49 data i_replace/20/49 data i_replace/20/
5050 if (ih.eq.0) then
51c Lepton collisions (no PDF).
52 pdg2pdf=1d0
53 return
54 endif
51c Make sure we have a reasonable Bjorken x. Note that even though55c Make sure we have a reasonable Bjorken x. Note that even though
52c x=0 is not reasonable, we prefer to simply return pdg2pdf=056c x=0 is not reasonable, we prefer to simply return pdg2pdf=0
53c instead of stopping the code, as this might accidentally happen.57c instead of stopping the code, as this might accidentally happen.
5458
=== modified file 'Template/NLO/Source/PDF/pdg2pdf_lhapdf.f'
--- Template/NLO/Source/PDF/pdg2pdf_lhapdf.f 2014-12-19 08:08:03 +0000
+++ Template/NLO/Source/PDF/pdg2pdf_lhapdf.f 2015-10-25 15:32:18 +0000
@@ -45,6 +45,12 @@
45 data imemlast/20*-99/45 data imemlast/20*-99/
46 data i_replace/20/46 data i_replace/20/
4747
48 if (ih.eq.0) then
49c Lepton collisions (no PDF).
50 pdg2pdf=1d0
51 return
52 endif
53
48c Make sure we have a reasonable Bjorken x. Note that even though54c Make sure we have a reasonable Bjorken x. Note that even though
49c x=0 is not reasonable, we prefer to simply return pdg2pdf=055c x=0 is not reasonable, we prefer to simply return pdg2pdf=0
50c instead of stopping the code, as this might accidentally happen.56c instead of stopping the code, as this might accidentally happen.
5157
=== modified file 'Template/NLO/Source/run.inc'
--- Template/NLO/Source/run.inc 2015-04-02 22:56:24 +0000
+++ Template/NLO/Source/run.inc 2015-10-25 15:32:18 +0000
@@ -39,6 +39,9 @@
39 common/cscales_current_values/muR2_current,muF12_current,39 common/cscales_current_values/muR2_current,muF12_current,
40 # muF22_current,QES2_current40 # muF22_current,QES2_current
4141
42c Re-scale of the shower starting scale
43 double precision shower_scale_factor
44 common/cshower_scale_factor/shower_scale_factor
42c45c
43c Collider46c Collider
44c47c
4548
=== modified file 'Template/NLO/Source/run_config.inc'
--- Template/NLO/Source/run_config.inc 2012-08-28 21:06:34 +0000
+++ Template/NLO/Source/run_config.inc 2015-10-25 15:32:18 +0000
@@ -34,7 +34,7 @@
34 parameter (PBS_QUE = 'madgraph')34 parameter (PBS_QUE = 'madgraph')
3535
36 integer ChanPerJob36 integer ChanPerJob
37 parameter (ChanPerJob=1) !Number of channels / job for survey37 parameter (ChanPerJob=100000000) !Number of channels / job for survey
3838
39c integer max_np39c integer max_np
40c parameter (max_np=1) !Number of channels / job for refine40c parameter (max_np=1) !Number of channels / job for refine
4141
=== modified file 'Template/NLO/SubProcesses/ajob_template'
--- Template/NLO/SubProcesses/ajob_template 2015-03-18 14:50:37 +0000
+++ Template/NLO/SubProcesses/ajob_template 2015-10-25 15:32:18 +0000
@@ -26,57 +26,38 @@
26 exit26 exit
27fi27fi
2828
29channel=$1
30run_mode=$2
31runnumber=$3
32integration_step=$4
33
29TAGTAGTAGTAGTAGTAGTAG for i in 1 ; do34TAGTAGTAGTAGTAGTAGTAG for i in 1 ; do
30 35
31 runnumber=036 if [[ $run_mode == 'all' || $run_mode == 'born' ]] ; then
32 if [[ $1 == '0' ]]; then37 j=$run_mode\_G$i
33 j=$2\_G$i38 else
34 if [[ ! -e $j ]]; then39 if [[ $runnumber == '0' ]] ; then
35 mkdir $j40 j=G$run_mode$i
36 fi41 else
37 cd $j42 j=G$run_mode$i\_$runnumber
38 if [[ "$4" != "" ]]; then43 fi
39 if [[ -e ../$4\_G$i ]]; then44 fi
40 if [[ $1 == '0' ]]; then45 cd $j
41 cp -f ../$4\_G$i/mint_grids . >/dev/null 2>&146
42 cp -f ../$4\_G$i/grid.MC_integer . >/dev/null 2>&147 if [[ -e res.dat ]] ; then
43 elif [[ $1 == '1' ]]; then48 rm -f res.dat
44 cp -f ../$4\_G$i/mint_grids . >/dev/null 2>&149 fi
45 cp -f ../$4\_G$i/grid.MC_integer . >/dev/null 2>&150 if [[ -e log.txt ]] ; then
46 fi51 rm -f log.txt
47 else52 fi
48 echo "Cannot find directory ../$4\_G$i/" > log.txt53 if [[ -e MADatNLO.top ]] ; then
49 exit54 rm -f MADatNLO.top
50 fi55 fi
51 fi56 if [[ -e MADatNLO.HwU ]] ; then
52 elif [[ $1 == '2' ]]; then57 rm -f MADatNLO.HwU
53 j=G$2$i58 fi
54 if [[ ! -e $j ]]; then59 if [[ -e MADatNLO.root ]] ; then
55 mkdir $j60 rm -f MADatNLO.root
56 fi
57
58 cd $j
59 if [[ "$4" != "" ]]; then
60 if [[ "$4" == "H" ||"$4" == "S" || "$4" == "V" || "$4" == "B" || "$4" == "F" ]]; then
61 if [[ -e ../G$4$i ]]; then
62 cp -f ../G$4$i/mint_grids ./preset_mint_grids >/dev/null 2>&1
63 cp -f ../G$4$i/grid.MC_integer . >/dev/null 2>&1
64 else
65 echo "Cannot find direcotry ../G$4$i/" > log.txt
66 exit
67 fi
68 else
69 runnumber=$4
70 if [[ ! -e ../${j}_$4 ]]; then
71 mkdir ../${j}_$4
72 fi
73 cd ../${j}_$4
74 ln -sf ../${j}/mint_grids
75 ln -sf ../${j}/mint_grids_NLO
76 ln -sf ../${j}/grid.MC_integer
77 ln -sf ../${j}/res_1
78 fi
79 fi
80 fi61 fi
81 if [[ -e randinit ]] ; then62 if [[ -e randinit ]] ; then
82 rm -f randinit63 rm -f randinit
@@ -97,67 +78,25 @@
97 link1up FKS_params.dat78 link1up FKS_params.dat
98 link1up configs_and_props_info.dat79 link1up configs_and_props_info.dat
99 link1up leshouche_info.dat80 link1up leshouche_info.dat
100# Not necessary anymore
101# link1up MadLoop5_resources
102 link1up OLE_order.olc81 link1up OLE_order.olc
103 link1up param_card.dat82 link1up param_card.dat
104 link1up initial_states_map.dat83 link1up initial_states_map.dat
105 84
106# check where is the basic file for the creation of input_app.txt
107#
108 if [[ $1 == '0' ]]; then
109 if [[ $3 == '-1' && -e ./madinM1 ]] ; then
110 input_template=./madinM1
111 else
112 if [[ -e ../madin.$2 ]] ; then
113 input_template=../madin.$2
114 else
115 input_template=../../madin.$2
116 fi
117 fi
118 elif [[ $1 == '2' ]]; then
119 if [[ $3 == '0' || $3 == '2' ]]; then
120 if [[ -e ../madinMMC_$2.2 ]] ; then
121 input_template=../madinMMC_$2.2
122 else
123 input_template=../../madinMMC_$2.2
124 fi
125 else
126 input_template=./madinM1
127 fi
128 fi
129 85
130 if [[ $1 == '0' ]]; then86 T="$(date +%s)"
131 head -n 5 $input_template >& input_app.txt87 if [[ $run_mode == 'all' || $run_mode == 'born' ]]; then
132 echo $i >> input_app.txt
133 tail -n 4 $input_template >> input_app.txt
134 T="$(date +%s)"
135 ../madevent_mintFO > log.txt <input_app.txt 2>&188 ../madevent_mintFO > log.txt <input_app.txt 2>&1
136 status=$?89 else
137 T="$(($(date +%s)-T))"
138 echo "Time in seconds: ${T}" >>log.txt
139 elif [[ $1 == '2' ]]; then
140 if [[ $runnumber != 0 ]]; then90 if [[ $runnumber != 0 ]]; then
141 tar --extract --file=../nevents.tar nevts_${j}_$runnumber
142 mv nevts_${j}_$runnumber nevts
143 echo "$runnumber" >& moffset.dat91 echo "$runnumber" >& moffset.dat
144 fi92 fi
145 if [[ $3 == '0' || $3 == '2' ]]; then
146 head -n 6 $input_template > input_app.txt
147 echo $i >> input_app.txt
148 tail -n 3 $input_template >> input_app.txt
149 elif [[ $3 == '1' ]]; then
150 head -n 6 $input_template > input_app.txt
151 echo $i >> input_app.txt
152 tail -n 3 $input_template >> input_app.txt
153 fi
154 T="$(date +%s)"
155 ../madevent_mintMC > log.txt <input_app.txt 2>&193 ../madevent_mintMC > log.txt <input_app.txt 2>&1
156 status=$?
157 T="$(($(date +%s)-T))"
158 echo "Time in seconds: ${T}" >>log.txt
159 cp -f log.txt log_MINT$3.txt >/dev/null 2>&1
160 fi94 fi
95 status=$?
96 T="$(($(date +%s)-T))"
97 echo "Time in seconds: ${T}" >>log.txt
98 cp -f log.txt log_MINT$integration_step.txt >/dev/null 2>&1
99 cp -f res.dat res_$integration_step.dat >/dev/null 2>&1
161 exit $status100 exit $status
162done101done
163 102
164103
=== modified file 'Template/NLO/SubProcesses/check_poles.f'
--- Template/NLO/SubProcesses/check_poles.f 2014-11-03 10:50:20 +0000
+++ Template/NLO/SubProcesses/check_poles.f 2015-10-25 15:32:18 +0000
@@ -108,7 +108,7 @@
108 enddo108 enddo
109 call fks_inc_chooser()109 call fks_inc_chooser()
110 call leshouche_inc_chooser()110 call leshouche_inc_chooser()
111 call setfksfactor(1)111 call setfksfactor(1,.false.)
112112
113 nfail = 0113 nfail = 0
114 npointsChecked = 0114 npointsChecked = 0
115115
=== removed file 'Template/NLO/SubProcesses/combine_results.sh'
--- Template/NLO/SubProcesses/combine_results.sh 2013-06-28 13:57:17 +0000
+++ Template/NLO/SubProcesses/combine_results.sh 1970-01-01 00:00:00 +0000
@@ -1,55 +0,0 @@
1#!/bin/bash
2
3# find the correct directory
4if [[ ! -d ./SubProcesses ]]; then
5 cd ../
6fi
7if [[ -d ./SubProcesses ]]; then
8 cd SubProcesses
9fi
10
11if [[ -e res.txt ]]; then
12 rm -f res.txt
13fi
14if [[ -e dirs.txt ]]; then
15 rm -f dirs.txt
16fi
17if [[ -e nevents_unweighted ]]; then
18 rm -f nevents_unweighted
19fi
20
21arg1=$1
22arg2=$2
23arg3=$3
24# shift the list of arguments by 3
25shift
26shift
27shift
28if [[ "$@" == "" ]]; then
29 echo "Please give the G directories that should be combined,"
30 echo "e.g. 'GF* GV*', as final arguments of this script"
31 exit
32fi
33
34touch res.txt
35touch dirs.txt
36NTOT=0
37for dir in "$@" ; do
38 N=`ls -d P*/$dir | wc -l`
39 NTOT=`expr $NTOT + $N`
40 ls -d P*/$dir >> dirs.txt
41 grep -H 'Final result' P*/$dir/res_$arg1 >> res.txt
42done
43echo N of directories: $NTOT
44if [[ $arg1 == '0' ]] ; then
45 echo 'Determining the number of unweighted events per channel'
46elif [[ $arg1 == '1' ]] ; then
47 echo 'Updating the number of unweighted events per channel'
48fi
49./sumres.py $NTOT $arg2 $arg3
50
51echo 'Integrated abs(cross-section)'
52tail -n2 res.txt | head -n1
53echo 'Integrated cross-section'
54tail -n1 res.txt
55mv res.txt res_$arg1.txt
560
=== removed file 'Template/NLO/SubProcesses/combine_results_FO.sh'
--- Template/NLO/SubProcesses/combine_results_FO.sh 2013-06-28 13:57:17 +0000
+++ Template/NLO/SubProcesses/combine_results_FO.sh 1970-01-01 00:00:00 +0000
@@ -1,52 +0,0 @@
1#!/bin/bash
2
3# find the correct directory
4if [[ ! -d ./SubProcesses ]]; then
5 cd ../
6fi
7if [[ -d ./SubProcesses ]]; then
8 cd SubProcesses
9fi
10
11if [[ $1 == "0" ]] ; then
12 mint_mode=0
13 shift
14elif [[ $1 == "1" ]] ; then
15 mint_mode=1
16 shift
17elif [[ $1 == "2" ]] ; then
18 echo "Cannot combine results for mint_mode 2"
19 exit
20else
21 mint_mode=0
22fi
23
24if [[ -e res.txt ]]; then
25 rm -f res.txt
26fi
27if [[ -e dirs.txt ]]; then
28 rm -f dirs.txt
29fi
30
31req_acc=$1
32shift
33
34touch res.txt
35touch dirs.txt
36NTOT=0
37for dir in "$@" ; do
38 N=`ls -d P*/$dir | wc -l`
39 NTOT=`expr $NTOT + $N`
40 ls -d P*/$dir >> dirs.txt
41 grep -H 'Final result' P*/$dir/res_$mint_mode >> res.txt
42done
43
44sed -i.bak s/"\+\/\-"/" \+\/\-"/ res.txt
45
46echo N of directories: $NTOT
47
48./sumres.py $NTOT -1 $req_acc
49
50rm -r res.txt.bak
51
52tail -n1 res.txt
530
=== modified file 'Template/NLO/SubProcesses/combine_root.sh'
--- Template/NLO/SubProcesses/combine_root.sh 2013-12-09 10:15:28 +0000
+++ Template/NLO/SubProcesses/combine_root.sh 2015-10-25 15:32:18 +0000
@@ -65,7 +65,7 @@
65echo ".x combine_root.C" >> rootinput.txt65echo ".x combine_root.C" >> rootinput.txt
66echo ".q" >> rootinput.txt66echo ".q" >> rootinput.txt
6767
68root < rootinput.txt68root -b < rootinput.txt
6969
70rm -f rootinput.txt70rm -f rootinput.txt
71}71}
7272
=== modified file 'Template/NLO/SubProcesses/driver_mintFO.f'
--- Template/NLO/SubProcesses/driver_mintFO.f 2015-03-09 18:27:17 +0000
+++ Template/NLO/SubProcesses/driver_mintFO.f 2015-10-25 15:32:18 +0000
@@ -18,7 +18,6 @@
18C LOCAL18C LOCAL
19C19C
20 integer i,j,l,l1,l2,ndim20 integer i,j,l,l1,l2,ndim
21 integer npoints
22 character*130 buf21 character*130 buf
23c22c
24c Global23c Global
@@ -171,7 +170,7 @@
171 else170 else
172 flat_grid=.false.171 flat_grid=.false.
173 endif172 endif
174 ndim = 3*(nexternal-2)-4173 ndim = 3*(nexternal-nincoming)-4
175 if (abs(lpp(1)) .ge. 1) ndim=ndim+1174 if (abs(lpp(1)) .ge. 1) ndim=ndim+1
176 if (abs(lpp(2)) .ge. 1) ndim=ndim+1175 if (abs(lpp(2)) .ge. 1) ndim=ndim+1
177c Don't proceed if muF1#muF2 (we need to work out the relevant formulae176c Don't proceed if muF1#muF2 (we need to work out the relevant formulae
@@ -219,23 +218,7 @@
219 do j=1,nintervals_virt218 do j=1,nintervals_virt
220 read (12,*) (ave_virt(j,i),i=1,ndim)219 read (12,*) (ave_virt(j,i),i=1,ndim)
221 enddo220 enddo
222 if (ncall.gt.0 .and. accuracy.ne.0d0) then221 read (12,*) ans(1),unc(1),dummy,dummy
223 read (12,*) ans(1),unc(1),ncall,itmax
224c Update the number of PS points based on unc(1), ncall and accuracy
225 itmax_fl=itmax*(unc(1)/accuracy)**2
226 if (itmax_fl.le.4d0) then
227 itmax=max(nint(itmax_fl),2)
228 elseif (itmax_fl.gt.4d0 .and. itmax_fl.le.16d0) then
229 ncall=nint(ncall*itmax_fl/4d0)
230 itmax=4
231 else
232 itmax=nint(sqrt(itmax_fl))
233 ncall=nint(ncall*itmax_fl/nint(sqrt(itmax_fl)))
234 endif
235 accuracy=accuracy/ans(1) ! relative accuracy on the ABS X-section
236 else
237 read (12,*) ans(1),unc(1),dummy,dummy
238 endif
239 read (12,*) virtual_fraction,average_virtual222 read (12,*) virtual_fraction,average_virtual
240 close (12)223 close (12)
241 write (*,*) "Update iterations and points to",itmax,ncall224 write (*,*) "Update iterations and points to",itmax,ncall
@@ -253,10 +236,6 @@
253 call mint(sigint,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt236 call mint(sigint,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt
254 $ ,ans,unc,chi2)237 $ ,ans,unc,chi2)
255 call topout238 call topout
256 open(unit=58,file='res_0',status='unknown')
257 write(58,*)'Final result [ABS]:',ans(1),' +/-',unc(1)
258 write(58,*)'Final result:',ans(2),' +/-',unc(2)
259 close(58)
260 write(*,*)'Final result [ABS]:',ans(1),' +/-',unc(1)239 write(*,*)'Final result [ABS]:',ans(1),' +/-',unc(1)
261 write(*,*)'Final result:',ans(2),' +/-',unc(2)240 write(*,*)'Final result:',ans(2),' +/-',unc(2)
262 write(*,*)'chi**2 per D.o.F.:',chi2(1)241 write(*,*)'chi**2 per D.o.F.:',chi2(1)
@@ -337,6 +316,11 @@
337 write(*,*) 'Time spent in Other_tasks : ',tOther316 write(*,*) 'Time spent in Other_tasks : ',tOther
338 write(*,*) 'Time spent in Total : ',tTot317 write(*,*) 'Time spent in Total : ',tTot
339318
319 open (unit=12, file='res.dat',status='unknown')
320 write (12,*)ans(1),unc(1),ans(2),unc(2),itmax,ncall,tTot
321 close(12)
322
323
340 if(i_momcmp_count.ne.0)then324 if(i_momcmp_count.ne.0)then
341 write(*,*)' '325 write(*,*)' '
342 write(*,*)'WARNING: genps_fks code 555555'326 write(*,*)'WARNING: genps_fks code 555555'
@@ -538,7 +522,7 @@
538 call fks_inc_chooser()522 call fks_inc_chooser()
539 call leshouche_inc_chooser()523 call leshouche_inc_chooser()
540 call setcuts524 call setcuts
541 call setfksfactor(iconfig)525 call setfksfactor(iconfig,.false.)
542 return526 return
543 end527 end
544 528
@@ -680,8 +664,6 @@
680 character * 70 idstring664 character * 70 idstring
681 logical savegrid665 logical savegrid
682666
683 character * 80 runstr
684 common/runstr/runstr
685 logical usexinteg,mint667 logical usexinteg,mint
686 common/cusexinteg/usexinteg,mint668 common/cusexinteg/usexinteg,mint
687 logical unwgt669 logical unwgt
@@ -692,84 +674,98 @@
692 double precision volh674 double precision volh
693 common/mc_int2/volh,mc_hel,ihel,fillh675 common/mc_int2/volh,mc_hel,ihel,fillh
694676
695677 logical done
678 character*100 buffer
696c-----679c-----
697c Begin Code680c Begin Code
698c-----681c-----
699 mint=.true.682 mint=.true.
700 unwgt=.false.683 unwgt=.false.
701 write(*,'(a)') 'Enter number of events and iterations: '684 open (unit=83,file='input_app.txt',status='old')
702 read(*,*) ncall,itmax685 done=.false.
703 write(*,*) 'Number of events and iterations ',ncall,itmax686 do while (.not. done)
704 write(*,'(a)') 'Enter desired accuracy: '687 read(83,'(a)',err=222,end=222) buffer
705 read(*,*) accuracy688 if (buffer(1:7).eq.'NPOINTS') then
706 write(*,*) 'Desired absolute accuracy: ',accuracy689 buffer=buffer(10:100)
707690 read(buffer,*) ncall
708 write(*,'(a)') 'Enter 0 for fixed, 2 for adjustable grid: '691 write (*,*) 'Number of phase-space points per iteration:',ncall
709 read(*,*) use_cut692 elseif(buffer(1:11).eq.'NITERATIONS') then
710 if (use_cut .lt. 0 .or. use_cut .gt. 2) then693 read(buffer(14:),*) itmax
711 write(*,*) 'Bad choice, using 2',use_cut694 write (*,*) 'Maximum number of iterations is:',itmax
712 use_cut = 2695 elseif(buffer(1:8).eq.'ACCURACY') then
713 endif696 read(buffer(11:),*) accuracy
714697 write (*,*) 'Desired accuracy is:',accuracy
715 write(*,10) 'Suppress amplitude (0 no, 1 yes)? '698 elseif(buffer(1:10).eq.'ADAPT_GRID') then
716 read(*,*) i699 read(buffer(13:),*) use_cut
717 if (i .eq. 1) then700 write (*,*) 'Using adaptive grids:',use_cut
718 multi_channel = .true.701 elseif(buffer(1:12).eq.'MULTICHANNEL') then
719 write(*,*) 'Using suppressed amplitude.'702 read(buffer(15:),*) i
720 else703 if (i.eq.1) then
721 multi_channel = .false.704 multi_channel=.true.
722 write(*,*) 'Using full amplitude.'705 write (*,*) 'Using Multi-channel integration'
723 endif706 else
724707 multi_channel=.false.
725 write(*,10) 'Exact helicity sum (0 yes, n = number/event)? '708 write (*,*) 'Not using Multi-channel integration'
726 read(*,*) i709 endif
727 if (i .eq. 0) then710 elseif(buffer(1:12).eq.'SUM_HELICITY') then
728 mc_hel = 0711 read(buffer(15:),*) i
729 write(*,*) 'Explicitly summing over helicities for virt'712 if (nincoming.eq.1) then
730 else713 write (*,*) 'Sum over helicities in the virtuals'/
731 mc_hel= i714 $ /' for decay process'
732 write(*,*) 'Summing over',i,' helicities/event for virt'715 mc_hel=0
733 endif716 elseif (i.eq.0) then
734 isum_hel=0717 mc_hel=0
735718 write (*,*) 'Explicitly summing over helicities'/
736 write(*,10) 'Enter Configuration Number: '719 $ /' for the virtuals'
737 read(*,*) dconfig720 else
738 iconfig = int(dconfig)721 mc_hel=1
739 do i=1,mapconfig(0)722 write(*,*) 'Do MC over helicities for the virtuals'
740 if (iconfig.eq.mapconfig(i)) then723 endif
741 iconfig=i724 isum_hel=0
742 exit725 elseif(buffer(1:7).eq.'CHANNEL') then
726 read(buffer(10:),*) dconfig
727 iconfig = int(dconfig)
728 do i=1,mapconfig(0)
729 if (iconfig.eq.mapconfig(i)) then
730 iconfig=i
731 exit
732 endif
733 enddo
734 write(*,12) 'Running Configuration Number: ',iconfig
735 elseif(buffer(1:5).eq.'SPLIT') then
736 read(buffer(8:),*) i
737 write (*,*) 'Splitting channel:',i
738 elseif(buffer(1:8).eq.'RUN_MODE') then
739 read(buffer(11:),*) abrvinput
740 if(abrvinput(5:5).eq.'0')then
741 nbody=.true.
742 else
743 nbody=.false.
744 endif
745 abrv=abrvinput(1:4)
746 write (*,*) "doing the ",abrv," of this channel"
747 if(nbody)then
748 write (*,*) "integration Born/virtual with Sfunction=1"
749 else
750 write (*,*) "Normal integration (Sfunction != 1)"
751 endif
752 elseif(buffer(1:7).eq.'RESTART') then
753 read(buffer(10:),*) irestart
754 if (irestart.eq.0) then
755 write (*,*) 'RESTART: Fresh run'
756 elseif(irestart.eq.-1) then
757 write (*,*) 'RESTART: Use old grids, but refil plots'
758 elseif(irestart.eq.1) then
759 write (*,*) 'RESTART: continue with existing run'
760 else
761 write (*,*) 'RESTART:',irestart
762 endif
743 endif763 endif
764 cycle
765 222 done=.true.
744 enddo766 enddo
745 write(*,12) 'Running Configuration Number: ',iconfig767 close(83)
746c
747c Enter parameters that control Vegas grids
748c
749 write(*,*)'enter id string for this run'
750 read(*,*) idstring
751 runstr=idstring
752 write(*,*)'enter 1 if you want restart files'
753 read (*,*) itmp
754 if(itmp.eq.1) then
755 savegrid = .true.
756 else
757 savegrid = .false.
758 endif
759 write(*,*)'enter 0 to exclude, 1 for new run, 2 to restart'
760 read(5,*)irestart
761768
762 abrvinput=' '
763 write (*,*) "'all ', 'born', 'real', 'virt', 'novi' or 'grid'?"
764 write (*,*) "Enter 'born0' or 'virt0' to perform"
765 write (*,*) " a pure n-body integration (no S functions)"
766 read(5,*) abrvinput
767 if(abrvinput(5:5).eq.'0')then
768 nbody=.true.
769 else
770 nbody=.false.
771 endif
772 abrv=abrvinput(1:4)
773 if (fks_configs.eq.1) then769 if (fks_configs.eq.1) then
774 if (pdg_type_d(1,fks_i_d(1)).eq.-21) then770 if (pdg_type_d(1,fks_i_d(1)).eq.-21) then
775 write (*,*) 'Process generated with [LOonly=QCD]. '/771 write (*,*) 'Process generated with [LOonly=QCD]. '/
@@ -782,26 +778,6 @@
782 endif778 endif
783 endif779 endif
784 endif780 endif
785c Options are way too many: make sure we understand all of them
786 if ( abrv.ne.'all '.and.abrv.ne.'born'.and.abrv.ne.'real'.and.
787 & abrv.ne.'virt'.and.
788 & abrv.ne.'viSC'.and.abrv.ne.'viLC'.and.abrv.ne.'novA'.and.
789 & abrv.ne.'novB'.and.abrv.ne.'viSA'.and.abrv.ne.'viSB') then
790 write(*,*)'Error in input: abrv is:',abrv
791 stop
792 endif
793 if(nbody.and.abrv.ne.'born'.and.abrv(1:2).ne.'vi'
794 & .and. abrv.ne.'grid')then
795 write(*,*)'Error in driver: inconsistent input',abrvinput
796 stop
797 endif
798
799 write (*,*) "doing the ",abrv," of this channel"
800 if(nbody)then
801 write (*,*) "integration Born/virtual with Sfunction=1"
802 else
803 write (*,*) "Normal integration (Sfunction != 1)"
804 endif
805c781c
806c782c
807c Here I want to set up with B.W. we map and which we don't783c Here I want to set up with B.W. we map and which we don't
808784
=== modified file 'Template/NLO/SubProcesses/driver_mintMC.f'
--- Template/NLO/SubProcesses/driver_mintMC.f 2015-08-13 12:43:02 +0000
+++ Template/NLO/SubProcesses/driver_mintMC.f 2015-10-25 15:32:18 +0000
@@ -108,6 +108,11 @@
108 call cpu_time(tBefore)108 call cpu_time(tBefore)
109 fixed_order=.false.109 fixed_order=.false.
110 nlo_ps=.true.110 nlo_ps=.true.
111 if (nincoming.ne.2) then
112 write (*,*) 'Decay processes not supported for'/
113 & /' event generation'
114 stop 1
115 endif
111116
112c Read general MadFKS parameters117c Read general MadFKS parameters
113c118c
@@ -158,7 +163,7 @@
158 else163 else
159 flat_grid=.false.164 flat_grid=.false.
160 endif165 endif
161 ndim = 3*(nexternal-2)-4166 ndim = 3*(nexternal-nincoming)-4
162 if (abs(lpp(1)) .ge. 1) ndim=ndim+1167 if (abs(lpp(1)) .ge. 1) ndim=ndim+1
163 if (abs(lpp(2)) .ge. 1) ndim=ndim+1168 if (abs(lpp(2)) .ge. 1) ndim=ndim+1
164c Don''t proceed if muF1#muF2 (we need to work out the relevant formulae169c Don''t proceed if muF1#muF2 (we need to work out the relevant formulae
@@ -189,7 +194,7 @@
189 enddo194 enddo
190 else195 else
191c to restore grids:196c to restore grids:
192 open (unit=12, file='preset_mint_grids',status='old')197 open (unit=12, file='mint_grids',status='old')
193 do j=0,nintervals198 do j=0,nintervals
194 read (12,*) (xgrid(j,i),i=1,ndim)199 read (12,*) (xgrid(j,i),i=1,ndim)
195 enddo200 enddo
@@ -285,7 +290,7 @@
285 close(58)290 close(58)
286291
287c to save grids:292c to save grids:
288 open (unit=12, file='mint_grids_NLO',status='unknown')293 open (unit=12, file='mint_grids',status='unknown')
289 write (12,*) (xgrid(0,i),i=1,ndim)294 write (12,*) (xgrid(0,i),i=1,ndim)
290 do j=1,nintervals295 do j=1,nintervals
291 write (12,*) (xgrid(j,i),i=1,ndim)296 write (12,*) (xgrid(j,i),i=1,ndim)
@@ -301,7 +306,6 @@
301 write (12,*) virtual_fraction,average_virtual306 write (12,*) virtual_fraction,average_virtual
302 close (12)307 close (12)
303308
304
305c*************************************************************309c*************************************************************
306c event generation310c event generation
307c*************************************************************311c*************************************************************
@@ -323,7 +327,7 @@
323 ncall=nevts ! Update ncall with the number found in 'nevts'327 ncall=nevts ! Update ncall with the number found in 'nevts'
324328
325c to restore grids:329c to restore grids:
326 open (unit=12, file='mint_grids_NLO',status='unknown')330 open (unit=12, file='mint_grids',status='unknown')
327 read (12,*) (xgrid(0,i),i=1,ndim)331 read (12,*) (xgrid(0,i),i=1,ndim)
328 do j=1,nintervals332 do j=1,nintervals
329 read (12,*) (xgrid(j,i),i=1,ndim)333 read (12,*) (xgrid(j,i),i=1,ndim)
@@ -468,6 +472,15 @@
468 write(*,*) 'Time spent in Other_tasks : ',tOther472 write(*,*) 'Time spent in Other_tasks : ',tOther
469 write(*,*) 'Time spent in Total : ',tTot473 write(*,*) 'Time spent in Total : ',tTot
470474
475 open (unit=12, file='res.dat',status='unknown')
476 if (imode.eq.0) then
477 write (12,*)ans(1),unc(1),ans(2),unc(2),itmax,ncall,tTot
478 else
479 write (12,*)ans(1)+ans(5),sqrt(unc(1)**2+unc(5)**2),ans(2)
480 $ ,unc(2),itmax,ncall,tTot
481 endif
482 close(12)
483
471 return484 return
472 999 write (*,*) 'nevts file not found'485 999 write (*,*) 'nevts file not found'
473 stop486 stop
@@ -630,12 +643,17 @@
630643
631 write(*,10) 'Exact helicity sum (0 yes, n = number/event)? '644 write(*,10) 'Exact helicity sum (0 yes, n = number/event)? '
632 read(*,*) i645 read(*,*) i
633 if (i .eq. 0) then646 if (nincoming.eq.1) then
634 mc_hel= 0647 write (*,*) 'Sum over helicities in the virtuals'/
635 write(*,*) 'Explicitly summing over helicities for virt'648 $ /' for decay process'
649 mc_hel=0
650 elseif (i.eq.0) then
651 mc_hel=0
652 write (*,*) 'Explicitly summing over helicities'/
653 $ /' for the virtuals'
636 else654 else
637 mc_hel= i655 mc_hel=1
638 write(*,*) 'Summing over',i,' helicities/event for virt'656 write(*,*) 'Do MC over helicities for the virtuals'
639 endif657 endif
640 isum_hel = 0658 isum_hel = 0
641659
@@ -1204,7 +1222,7 @@
1204 call fks_inc_chooser()1222 call fks_inc_chooser()
1205 call leshouche_inc_chooser()1223 call leshouche_inc_chooser()
1206 call setcuts1224 call setcuts
1207 call setfksfactor(iconfig)1225 call setfksfactor(iconfig,.true.)
1208 return1226 return
1209 end1227 end
12101228
12111229
=== modified file 'Template/NLO/SubProcesses/fks_Sij.f'
--- Template/NLO/SubProcesses/fks_Sij.f 2012-08-28 21:06:34 +0000
+++ Template/NLO/SubProcesses/fks_Sij.f 2015-10-25 15:32:18 +0000
@@ -90,9 +90,13 @@
9090
91c Consistency check -- call to set_cms_stuff() must be done prior to91c Consistency check -- call to set_cms_stuff() must be done prior to
92c entering this function92c entering this function
93 shattmp=2d0*dot(p(0,1),p(0,2))93 if (nincoming.eq.2) then
94 shattmp=2d0*dot(p(0,1),p(0,2))
95 else
96 shattmp=p(0,1)**2
97 endif
94 if(abs(shattmp/shat-1.d0).gt.1.d-5)then98 if(abs(shattmp/shat-1.d0).gt.1.d-5)then
95 write(*,*)'Error in fks_Sij: inconsistent shat'99 write(*,*)'Error in fks_Sij: inconsistent shat #1'
96 write(*,*)shattmp,shat100 write(*,*)shattmp,shat
97 stop101 stop
98 endif102 endif
@@ -148,6 +152,7 @@
148 do j=1,fks_j_from_i(i,0)152 do j=1,fks_j_from_i(i,0)
149 kk = i153 kk = i
150 ll = fks_j_from_i(i,j)154 ll = fks_j_from_i(i,j)
155 if (nincoming.ne.2 .and. ll.le.nincoming) cycle
151 if ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.0 ) then156 if ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.0 ) then
152 ijskip(kk,ll) = 1157 ijskip(kk,ll) = 1
153 elseif ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.1 ) then158 elseif ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.1 ) then
@@ -178,6 +183,7 @@
178 do j=1,fks_j_from_i(i,0)183 do j=1,fks_j_from_i(i,0)
179 kk = i184 kk = i
180 ll = fks_j_from_i(i,j)185 ll = fks_j_from_i(i,j)
186 if (nincoming.ne.2 .and. ll.le.nincoming) cycle
181 if(ijskip(kk,ll).ne.1)goto 222187 if(ijskip(kk,ll).ne.1)goto 222
182 if(particle_type(ll).eq.8.and.particle_type(kk).ne.8.and.188 if(particle_type(ll).eq.8.and.particle_type(kk).ne.8.and.
183 # ll.gt.nincoming)then189 # ll.gt.nincoming)then
@@ -567,7 +573,11 @@
567573
568c Consistency check -- call to set_cms_stuff() must be done prior to574c Consistency check -- call to set_cms_stuff() must be done prior to
569c entering this function575c entering this function
570 shattmp=2d0*dot(p(0,1),p(0,2))576 if (nincoming.eq.2) then
577 shattmp=2d0*dot(p(0,1),p(0,2))
578 else
579 shattmp=p(0,1)**2
580 endif
571 if(abs(shattmp/shat-1.d0).gt.1.d-5)then581 if(abs(shattmp/shat-1.d0).gt.1.d-5)then
572 write(*,*)'Error in fks_Hij: inconsistent shat'582 write(*,*)'Error in fks_Hij: inconsistent shat'
573 write(*,*)shattmp,shat583 write(*,*)shattmp,shat
574584
=== modified file 'Template/NLO/SubProcesses/fks_inc_chooser.f'
--- Template/NLO/SubProcesses/fks_inc_chooser.f 2012-08-28 21:06:34 +0000
+++ Template/NLO/SubProcesses/fks_inc_chooser.f 2015-10-25 15:32:18 +0000
@@ -32,7 +32,6 @@
32 pdg_type(i)=pdg_type_D(nFKSprocess,i)32 pdg_type(i)=pdg_type_D(nFKSprocess,i)
33 enddo33 enddo
34 do i=1,nexternal34 do i=1,nexternal
35
36 if (i.lt.min(i_fks,j_fks)) then35 if (i.lt.min(i_fks,j_fks)) then
37 particle_type_born(i)=particle_type(i)36 particle_type_born(i)=particle_type(i)
38 elseif (i.gt.max(i_fks,j_fks)) then37 elseif (i.gt.max(i_fks,j_fks)) then
@@ -63,6 +62,9 @@
63 else62 else
64 m_type=j_type63 m_type=j_type
65 endif64 endif
65 elseif(i_type.eq.8.and.j_type.eq.1.and.pdg_type(i_fks).eq.-21)then
66 ! dirty trick for LOonly processes without colored legs
67 m_type=j_type
66 else68 else
67 write(*,*)'Flavour mismatch #2 in fks_inc_chooser',69 write(*,*)'Flavour mismatch #2 in fks_inc_chooser',
68 & i_type,j_type,m_type70 & i_type,j_type,m_type
6971
=== modified file 'Template/NLO/SubProcesses/fks_singular.f'
--- Template/NLO/SubProcesses/fks_singular.f 2015-08-19 12:50:52 +0000
+++ Template/NLO/SubProcesses/fks_singular.f 2015-10-25 15:32:18 +0000
@@ -1034,6 +1034,10 @@
1034 $ ,pswgt_cnt(-2:2),jac_cnt(-2:2)1034 $ ,pswgt_cnt(-2:2),jac_cnt(-2:2)
1035 common/counterevnts/p1_cnt,wgt_cnt,pswgt_cnt,jac_cnt1035 common/counterevnts/p1_cnt,wgt_cnt,pswgt_cnt,jac_cnt
1036 if (wgt1.eq.0d0 .and. wgt2.eq.0d0 .and. wgt3.eq.0d0) return1036 if (wgt1.eq.0d0 .and. wgt2.eq.0d0 .and. wgt3.eq.0d0) return
1037c Check for NaN's and INF's. Simply skip the contribution
1038 if (wgt1.ne.wgt1) return
1039 if (wgt2.ne.wgt2) return
1040 if (wgt3.ne.wgt3) return
1037 icontr=icontr+11041 icontr=icontr+1
1038 if (icontr.gt.max_contr) then1042 if (icontr.gt.max_contr) then
1039 write (*,*) 'ERROR in add_wgt: too many contributions'1043 write (*,*) 'ERROR in add_wgt: too many contributions'
@@ -1226,7 +1230,12 @@
1226c PDG codes1230c PDG codes
1227 niproc(ict)=iproc1231 niproc(ict)=iproc
1228 do j=1,iproc1232 do j=1,iproc
1229 parton_iproc(j,ict)=pd(j)*conv1233 if (nincoming.eq.2) then
1234 parton_iproc(j,ict)=pd(j)*conv
1235 else
1236c Keep GeV's for decay processes (no conv. factor needed)
1237 parton_iproc(j,ict)=pd(j)
1238 endif
1230 do k=1,nexternal1239 do k=1,nexternal
1231 parton_pdg(k,j,ict)=idup_d(iFKS,k,j)1240 parton_pdg(k,j,ict)=idup_d(iFKS,k,j)
1232 if (k.lt.fks_j_d(iFKS)) then1241 if (k.lt.fks_j_d(iFKS)) then
@@ -2195,9 +2204,15 @@
2195 do ii=1,iproc_save(nFKS(ict))2204 do ii=1,iproc_save(nFKS(ict))
2196 if (eto(ii,nFKS(ict)).ne.ipr) cycle2205 if (eto(ii,nFKS(ict)).ne.ipr) cycle
2197 n_ctr_found=n_ctr_found+12206 n_ctr_found=n_ctr_found+1
2198 write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)')2207 if (nincoming.eq.2) then
2199 & (wgt(j,ict)*conv,j=1,3),2208 write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)')
2200 & nexternal2209 & (wgt(j,ict)*conv,j=1,3),
2210 & nexternal
2211 else
2212 write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)')
2213 & (wgt(j,ict),j=1,3),
2214 & nexternal
2215 endif
2201 procid=''2216 procid=''
2202 do j=1,nexternal2217 do j=1,nexternal
2203 write (str_temp,*) parton_pdg(j,ii,ict)2218 write (str_temp,*) parton_pdg(j,ii,ict)
@@ -2223,9 +2238,15 @@
2223c H-event2238c H-event
2224 ipr=iproc_picked2239 ipr=iproc_picked
2225 n_ctr_found=n_ctr_found+12240 n_ctr_found=n_ctr_found+1
2226 write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)')2241 if (nincoming.eq.2) then
2227 & (wgt(j,ict)*conv,j=1,3),2242 write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)')
2228 & nexternal2243 & (wgt(j,ict)*conv,j=1,3),
2244 & nexternal
2245 else
2246 write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)')
2247 & (wgt(j,ict),j=1,3),
2248 & nexternal
2249 endif
2229 procid=''2250 procid=''
2230 do j=1,nexternal2251 do j=1,nexternal
2231 write (str_temp,*) parton_pdg(j,ipr,ict)2252 write (str_temp,*) parton_pdg(j,ipr,ict)
@@ -2338,7 +2359,7 @@
2338 do i=0,32359 do i=0,3
2339 xsum(i)=0.d02360 xsum(i)=0.d0
2340 xsuma(i)=0.d02361 xsuma(i)=0.d0
2341 do j=3,npart2362 do j=nincoming+1,npart
2342 xsum(i)=xsum(i)+xmom(i,j)2363 xsum(i)=xsum(i)+xmom(i,j)
2343 xsuma(i)=xsuma(i)+abs(xmom(i,j))2364 xsuma(i)=xsuma(i)+abs(xmom(i,j))
2344 enddo2365 enddo
@@ -2405,9 +2426,14 @@
2405 pass=.true.2426 pass=.true.
2406 jflag=02427 jflag=0
2407 do i=0,32428 do i=0,3
2408 xsum(i)=-xmom(i,1)-xmom(i,2)2429 if (nincoming.eq.2) then
2409 xsuma(i)=abs(xmom(i,1))+abs(xmom(i,2))2430 xsum(i)=-xmom(i,1)-xmom(i,2)
2410 do j=3,npart2431 xsuma(i)=abs(xmom(i,1))+abs(xmom(i,2))
2432 elseif(nincoming.eq.1) then
2433 xsum(i)=-xmom(i,1)
2434 xsuma(i)=abs(xmom(i,1))
2435 endif
2436 do j=nincoming+1,npart
2411 xsum(i)=xsum(i)+xmom(i,j)2437 xsum(i)=xsum(i)+xmom(i,j)
2412 xsuma(i)=xsuma(i)+abs(xmom(i,j))2438 xsuma(i)=xsuma(i)+abs(xmom(i,j))
2413 enddo2439 enddo
@@ -2420,14 +2446,14 @@
2420 write(*,*)'Momentum is not conserved [nocms]'2446 write(*,*)'Momentum is not conserved [nocms]'
2421 write(*,*)'i=',i2447 write(*,*)'i=',i
2422 do j=1,npart2448 do j=1,npart
2423 write(*,'(4(d14.8,1x))') (xmom(jj,j),jj=0,3)2449 write(*,'(i2,1x,4(d14.8,1x))') j,(xmom(jj,j),jj=0,3)
2424 enddo2450 enddo
2425 jflag=12451 jflag=1
2426 endif2452 endif
2427 enddo2453 enddo
2428 if(jflag.eq.1)then2454 if(jflag.eq.1)then
2429 write(*,'(4(d14.8,1x))') (xsum(jj),jj=0,3)2455 write(*,'(a3,1x,4(d14.8,1x))') 'sum',(xsum(jj),jj=0,3)
2430 write(*,'(4(d14.8,1x))') (xrat(jj),jj=0,3)2456 write(*,'(a3,1x,4(d14.8,1x))') 'rat',(xrat(jj),jj=0,3)
2431 pass=.false.2457 pass=.false.
2432 return2458 return
2433 endif2459 endif
@@ -2454,7 +2480,11 @@
2454 endif2480 endif
2455 enddo2481 enddo
2456c2482c
2457 ecmtmp=sqrt(2d0*dot(xmom(0,1),xmom(0,2)))2483 if (nincoming.eq.2) then
2484 ecmtmp=sqrt(2d0*dot(xmom(0,1),xmom(0,2)))
2485 elseif (nincoming.eq.1) then
2486 ecmtmp=xmom(0,1)
2487 endif
2458 if(abs(ecm-ecmtmp).gt.vtiny)then2488 if(abs(ecm-ecmtmp).gt.vtiny)then
2459 write(*,*)'Inconsistent shat [nocms]'2489 write(*,*)'Inconsistent shat [nocms]'
2460 write(*,*)'ecm given= ',ecm2490 write(*,*)'ecm given= ',ecm
@@ -2687,6 +2717,9 @@
26872717
2688 double precision zero,tiny2718 double precision zero,tiny
2689 parameter (zero=0d0)2719 parameter (zero=0d0)
2720
2721 integer icount
2722 data icount /0/
26902723
2691c Particle types (=color) of i_fks, j_fks and fks_mother2724c Particle types (=color) of i_fks, j_fks and fks_mother
2692 integer i_type,j_type,m_type2725 integer i_type,j_type,m_type
@@ -2709,7 +2742,11 @@
27092742
2710c Consistency check -- call to set_cms_stuff() must be done prior to2743c Consistency check -- call to set_cms_stuff() must be done prior to
2711c entering this function2744c entering this function
2712 shattmp=2d0*dot(pp(0,1),pp(0,2))2745 if (nincoming.eq.2) then
2746 shattmp=2d0*dot(pp(0,1),pp(0,2))
2747 else
2748 shattmp=pp(0,1)**2
2749 endif
2713 if(abs(shattmp/shat-1.d0).gt.1.d-5)then2750 if(abs(shattmp/shat-1.d0).gt.1.d-5)then
2714 write(*,*)'Error in sreal: inconsistent shat'2751 write(*,*)'Error in sreal: inconsistent shat'
2715 write(*,*)shattmp,shat2752 write(*,*)shattmp,shat
@@ -2717,9 +2754,9 @@
2717 endif2754 endif
27182755
2719 if (1d0-y_ij_fks.lt.tiny)then2756 if (1d0-y_ij_fks.lt.tiny)then
2720 if (pmass(j_fks).eq.zero.and.j_fks.le.2)then2757 if (pmass(j_fks).eq.zero.and.j_fks.le.nincoming)then
2721 call sborncol_isr(pp,xi_i_fks,y_ij_fks,wgt)2758 call sborncol_isr(pp,xi_i_fks,y_ij_fks,wgt)
2722 elseif (pmass(j_fks).eq.zero.and.j_fks.ge.3)then2759 elseif (pmass(j_fks).eq.zero.and.j_fks.ge.nincoming+1)then
2723 call sborncol_fsr(pp,xi_i_fks,y_ij_fks,wgt)2760 call sborncol_fsr(pp,xi_i_fks,y_ij_fks,wgt)
2724 else2761 else
2725 wgt=0d02762 wgt=0d0
@@ -2741,11 +2778,20 @@
2741 endif2778 endif
27422779
2743 if(wgt.lt.0.d0)then2780 if(wgt.lt.0.d0)then
2744 write(*,*) 'Fatal error #2 in sreal',wgt,xi_i_fks,y_ij_fks2781 icount=icount+1
2745 do i=1,nexternal2782 if (icount.le.10) then
2746 write(*,*) 'particle ',i,', ',(pp(j,i),j=0,3)2783 write(*,*) 'Warning, numerical problem found in sreal. '/
2747 enddo2784 $ /'Setting weight to zero',wgt,xi_i_fks,y_ij_fks
2748 stop2785 do i=1,nexternal
2786 write(*,*) 'particle ',i,', ',(pp(j,i),j=0,3)
2787 enddo
2788 if (icount.eq.25) then
2789 write (*,*) 'ERROR 25 problems found... '/
2790 $ /'stopping the code'
2791 stop
2792 endif
2793 endif
2794 wgt=0d0
2749 endif2795 endif
27502796
2751 return2797 return
@@ -2814,7 +2860,7 @@
2814 E_i_fks = p(0,i_fks)2860 E_i_fks = p(0,i_fks)
2815 z = 1d0 - E_i_fks/(E_i_fks+E_j_fks)2861 z = 1d0 - E_i_fks/(E_i_fks+E_j_fks)
2816 t = z * shat/4d02862 t = z * shat/4d0
2817 if(rotategranny .and. nexternal-1.ne.3)then2863 if(rotategranny .and. nexternal-1.ne.3 .and. nincoming.eq.2)then
2818c Exclude 2->1 (at the Born level) processes: matrix elements are2864c Exclude 2->1 (at the Born level) processes: matrix elements are
2819c independent of the PS point, but non-zero helicity configurations2865c independent of the PS point, but non-zero helicity configurations
2820c might flip when rotating the momenta.2866c might flip when rotating the momenta.
@@ -2934,7 +2980,7 @@
2934c Thus, an extra factor z (implicit in the flux of the reduced Born2980c Thus, an extra factor z (implicit in the flux of the reduced Born
2935c in FKS) has to be inserted here2981c in FKS) has to be inserted here
2936 t = z*shat/4d02982 t = z*shat/4d0
2937 if(j_fks.eq.2 .and. nexternal-1.ne.3)then2983 if(j_fks.eq.2 .and. nexternal-1.ne.3 .and. nincoming.eq.2)then
2938c Rotation according to innerpin.m. Use rotate_invar() if a more 2984c Rotation according to innerpin.m. Use rotate_invar() if a more
2939c general rotation is needed.2985c general rotation is needed.
2940c Exclude 2->1 (at the Born level) processes: matrix elements are2986c Exclude 2->1 (at the Born level) processes: matrix elements are
@@ -2965,7 +3011,7 @@
2965 pi(i)=p_i_fks_ev(i)3011 pi(i)=p_i_fks_ev(i)
2966 pj(i)=p(i,j_fks)3012 pj(i)=p(i,j_fks)
2967 enddo3013 enddo
2968 if(j_fks.eq.2)then3014 if(j_fks.eq.2 .and. nincoming.eq.2)then
2969c Rotation according to innerpin.m. Use rotate_invar() if a more 3015c Rotation according to innerpin.m. Use rotate_invar() if a more
2970c general rotation is needed3016c general rotation is needed
2971 pi(1)=-pi(1)3017 pi(1)=-pi(1)
@@ -2986,7 +3032,7 @@
2986 azifact=Wij_angle/Wij_recta3032 azifact=Wij_angle/Wij_recta
2987 endif3033 endif
2988c Insert the extra factor due to Madgraph convention for polarization vectors3034c Insert the extra factor due to Madgraph convention for polarization vectors
2989 if(j_fks.eq.2)then3035 if(j_fks.eq.2 .and. nincoming.eq.2)then
2990 cphi_mother=-1.d03036 cphi_mother=-1.d0
2991 sphi_mother=0.d03037 sphi_mother=0.d0
2992 else3038 else
@@ -3461,7 +3507,11 @@
34613507
3462c Consistency check -- call to set_cms_stuff() must be done prior to3508c Consistency check -- call to set_cms_stuff() must be done prior to
3463c entering this function3509c entering this function
3464 shattmp=2d0*dot(p(0,1),p(0,2))3510 if (nincoming.eq.2) then
3511 shattmp=2d0*dot(p(0,1),p(0,2))
3512 else
3513 shattmp=p(0,1)**2
3514 endif
3465 if(abs(shattmp/shat-1.d0).gt.1.d-5)then3515 if(abs(shattmp/shat-1.d0).gt.1.d-5)then
3466 write(*,*)'Error in sreal: inconsistent shat'3516 write(*,*)'Error in sreal: inconsistent shat'
3467 write(*,*)shattmp,shat3517 write(*,*)shattmp,shat
@@ -3770,7 +3820,7 @@
3770 enddo3820 enddo
3771 enddo3821 enddo
3772 do i=0,33822 do i=0,3
3773 if(j_fks.gt.2)then3823 if(j_fks.gt.nincoming)then
3774 xnum=p1_cnt(i,i_fks,inum)+p1_cnt(i,j_fks,inum)3824 xnum=p1_cnt(i,i_fks,inum)+p1_cnt(i,j_fks,inum)
3775 xden=p1_cnt(i,i_fks,iden)+p1_cnt(i,j_fks,iden)3825 xden=p1_cnt(i,i_fks,iden)+p1_cnt(i,j_fks,iden)
3776 else3826 else
@@ -4370,7 +4420,11 @@
43704420
4371c Consistency check -- call to set_cms_stuff() must be done prior to4421c Consistency check -- call to set_cms_stuff() must be done prior to
4372c entering this function4422c entering this function
4373 shattmp=2d0*dot(p(0,1),p(0,2))4423 if (nincoming.eq.2) then
4424 shattmp=2d0*dot(p(0,1),p(0,2))
4425 else
4426 shattmp=p(0,1)**2
4427 endif
4374 if(abs(shattmp/shat-1.d0).gt.1.d-5)then4428 if(abs(shattmp/shat-1.d0).gt.1.d-5)then
4375 write(*,*)'Error in sreal: inconsistent shat'4429 write(*,*)'Error in sreal: inconsistent shat'
4376 write(*,*)shattmp,shat4430 write(*,*)shattmp,shat
@@ -4447,7 +4501,7 @@
4447 enddo4501 enddo
4448c4502c
4449 do i=1,nincoming4503 do i=1,nincoming
4450 if (particle_type(i).ne.1)then4504 if (particle_type(i).ne.1 .and. pmass(i).eq.ZERO) then
4451 if (particle_type(i).eq.8) then4505 if (particle_type(i).eq.8) then
4452 aj=04506 aj=0
4453 elseif(abs(particle_type(i)).eq.3) then4507 elseif(abs(particle_type(i)).eq.3) then
@@ -4972,8 +5026,13 @@
4972 elseif(abrv.ne.'virt' .and. abrv.ne.'viSC' .and.5026 elseif(abrv.ne.'virt' .and. abrv.ne.'viSC' .and.
4973 # abrv.ne.'viLC')then5027 # abrv.ne.'viLC')then
4974c 1+2+3+45028c 1+2+3+4
4975 tmp=dlog(xicut_used**2*shat/QES2)-5029 if (betai.gt.1d-6) then
4976 # 1/betai*dlog((1+betai)/(1-betai))5030 tmp=dlog(xicut_used**2*shat/QES2)-
5031 & 1/betai*dlog((1+betai)/(1-betai))
5032 else
5033 tmp=dlog(xicut_used**2*shat/QES2)-
5034 & 2d0*(1d0+betai**2/3d0+betai**4/5d0)
5035 endif
4977 else5036 else
4978 write(*,*)'Error #14 in eikonal_Ireg',abrv5037 write(*,*)'Error #14 in eikonal_Ireg',abrv
4979 stop5038 stop
@@ -5200,7 +5259,11 @@
5200 elseif(pmass(m).ne.zero.and.pmass(n).ne.zero)then5259 elseif(pmass(m).ne.zero.and.pmass(n).ne.zero)then
5201 kikj=dot(p(0,n),p(0,m))5260 kikj=dot(p(0,n),p(0,m))
5202 vij=sqrt(1-(pmass(n)*pmass(m)/kikj)**2)5261 vij=sqrt(1-(pmass(n)*pmass(m)/kikj)**2)
5203 single=single+0.5d0*1/vij*log((1+vij)/(1-vij))*wgt5262 if (vij .gt. 1d-6) then
5263 single=single+0.5d0*1/vij*log((1+vij)/(1-vij))*wgt
5264 else
5265 single=single+(1d0+vij**2/3d0+vij**4/5d0)*wgt
5266 endif
5204 else5267 else
5205 write(*,*)'Error in getpoles',i,j,n,m,pmass(n),pmass(m)5268 write(*,*)'Error in getpoles',i,j,n,m,pmass(n),pmass(m)
5206 stop5269 stop
@@ -5284,7 +5347,7 @@
5284 end5347 end
52855348
52865349
5287 subroutine setfksfactor(iconfig)5350 subroutine setfksfactor(iconfig,match_to_shower)
5288 implicit none5351 implicit none
52895352
5290 double precision CA,CF, PI5353 double precision CA,CF, PI
@@ -5301,6 +5364,7 @@
5301 common/sctests/softtest,colltest5364 common/sctests/softtest,colltest
53025365
5303 integer config_fks,i,j,iconfig,fac1,fac25366 integer config_fks,i,j,iconfig,fac1,fac2
5367 logical match_to_shower
53045368
5305 double precision fkssymmetryfactor,fkssymmetryfactorBorn,5369 double precision fkssymmetryfactor,fkssymmetryfactorBorn,
5306 & fkssymmetryfactorDeg5370 & fkssymmetryfactorDeg
@@ -5519,6 +5583,9 @@
5519 else5583 else
5520 m_type=j_type5584 m_type=j_type
5521 endif5585 endif
5586 elseif(i_type.eq.8.and.j_type.eq.1.and.pdg_type(i_fks).eq.-21)then
5587 ! dirty trick for LOonly processes without colored legs
5588 m_type=j_type
5522 else5589 else
5523 write(*,*)'Flavour mismatch #2 in setfksfactor',5590 write(*,*)'Flavour mismatch #2 in setfksfactor',
5524 & i_type,j_type,m_type5591 & i_type,j_type,m_type
@@ -5534,7 +5601,7 @@
5534 m_type=m_type_FKS(nFKSprocess)5601 m_type=m_type_FKS(nFKSprocess)
55355602
5536c Set matrices used by MC counterterms5603c Set matrices used by MC counterterms
5537 call set_mc_matrices5604 if (match_to_shower) call set_mc_matrices
55385605
5539 fac_i=fac_i_FKS(nFKSprocess)5606 fac_i=fac_i_FKS(nFKSprocess)
5540 fac_j=fac_j_FKS(nFKSprocess)5607 fac_j=fac_j_FKS(nFKSprocess)
55415608
=== modified file 'Template/NLO/SubProcesses/genps_fks.f'
--- Template/NLO/SubProcesses/genps_fks.f 2015-02-04 13:26:19 +0000
+++ Template/NLO/SubProcesses/genps_fks.f 2015-10-25 15:32:18 +0000
@@ -182,15 +182,19 @@
182 endif182 endif
183 enddo183 enddo
184 if( firsttime .or. iconfig0.ne.iconfigsave ) then184 if( firsttime .or. iconfig0.ne.iconfigsave ) then
185 stot = 4d0*ebeam(1)*ebeam(2)185 if (nincoming.eq.2) then
186 stot = 4d0*ebeam(1)*ebeam(2)
187 else
188 stot=pmass(1)**2
189 endif
186c Make sure have enough mass for external particles190c Make sure have enough mass for external particles
187 totmassin=0d0191 totmassin=0d0
188 do i=3-nincoming,2192 do i=1,nincoming
189 totmassin=totmassin+m(i)193 totmassin=totmassin+m(i)
190 enddo194 enddo
191 totmass=0d0195 totmass=0d0
192 nbranch = nexternal-3 ! nexternal is for n+1-body, while itree uses n-body196 nbranch = nexternal-3 ! nexternal is for n+1-body, while itree uses n-body
193 do i=3,nbranch+2197 do i=nincoming+1,nexternal-1
194 totmass=totmass+m(i)198 totmass=totmass+m(i)
195 enddo199 enddo
196 fksmass=totmass200 fksmass=totmass
@@ -294,7 +298,7 @@
294 else298 else
295 pb(0,1)=sqrtshat_born299 pb(0,1)=sqrtshat_born
296 do i=1,2300 do i=1,2
297 pb(0,1)=0d0301 pb(i,1)=0d0
298 enddo302 enddo
299 p(3,1)=1e-14 ! For HELAS routine ixxxxx for neg. mass303 p(3,1)=1e-14 ! For HELAS routine ixxxxx for neg. mass
300 endif304 endif
@@ -453,22 +457,22 @@
453 isolsign=1457 isolsign=1
454 call generate_momenta_massless_final(icountevts,i_fks,j_fks458 call generate_momenta_massless_final(icountevts,i_fks,j_fks
455 & ,p_born(0,imother),shat,sqrtshat ,x(ixEi),xmrec2,xp459 & ,p_born(0,imother),shat,sqrtshat ,x(ixEi),xmrec2,xp
456 & ,phi_i_fks, xiimax,xinorm,xi_i_fks,y_ij_fks,p_i_fks460 & ,phi_i_fks,xiimax,xinorm,xi_i_fks,y_ij_fks,p_i_fks
457 & ,xjac,xpswgt,pass)461 & ,xjac,xpswgt,pass)
458 if (.not.pass) goto 112462 if (.not.pass) goto 112
459 elseif(m_j_fks.gt.0d0) then463 elseif(m_j_fks.gt.0d0) then
460 call generate_momenta_massive_final(icountevts,isolsign464 call generate_momenta_massive_final(icountevts,isolsign
461 & ,i_fks,j_fks,p_born(0,imother),shat,sqrtshat ,m_j_fks465 & ,i_fks,j_fks,p_born(0,imother),shat,sqrtshat,m_j_fks
462 & ,x(ixEi),xmrec2,xp,phi_i_fks, xiimax,xinorm466 & ,x(ixEi),xmrec2,xp,phi_i_fks,xiimax,xinorm
463 & ,xi_i_fks,y_ij_fks,p_i_fks,xjac,xpswgt,pass)467 & ,xi_i_fks,y_ij_fks,p_i_fks,xjac,xpswgt,pass)
464 if (.not.pass) goto 112468 if (.not.pass) goto 112
465 endif469 endif
466 elseif(j_fks.le.nincoming) then470 elseif(j_fks.le.nincoming) then
467 isolsign=1471 isolsign=1
468 call generate_momenta_initial(icountevts,i_fks,j_fks,xbjrk_born472 call generate_momenta_initial(icountevts,i_fks,j_fks,xbjrk_born
469 & ,tau_born,ycm_born,ycmhat,shat_born,phi_i_fks ,xp ,x(ixEi)473 & ,tau_born,ycm_born,ycmhat,shat_born,phi_i_fks,xp ,x(ixEi)
470 & ,shat,stot ,sqrtshat,tau,ycm,xbjrk ,p_i_fks,xiimax,xinorm474 & ,shat,stot,sqrtshat,tau,ycm,xbjrk,p_i_fks,xiimax,xinorm
471 & ,xi_i_fks,y_ij_fks ,xpswgt,xjac ,pass)475 & ,xi_i_fks,y_ij_fks ,xpswgt,xjac,pass)
472 if (.not.pass) goto 112476 if (.not.pass) goto 112
473 else477 else
474 write (*,*) 'Error #2 in genps_fks.f',j_fks478 write (*,*) 'Error #2 in genps_fks.f',j_fks
@@ -750,6 +754,7 @@
750c remove the following if no importance sampling towards soft754c remove the following if no importance sampling towards soft
751c singularity is performed when integrating over xi_i_hat755c singularity is performed when integrating over xi_i_hat
752 xjac=xjac*2d0*x(1)756 xjac=xjac*2d0*x(1)
757
753c Check that xii is in the allowed range758c Check that xii is in the allowed range
754 if( icountevts.eq.-100 .or. abs(icountevts).eq.1 )then759 if( icountevts.eq.-100 .or. abs(icountevts).eq.1 )then
755 if(xi_i_fks.gt.(1-xmrec2/shat))then760 if(xi_i_fks.gt.(1-xmrec2/shat))then
@@ -829,7 +834,11 @@
829c mother four momenta834c mother four momenta
830 do i=0,3835 do i=0,3
831 xp_mother(i)=xp(i,i_fks)+xp(i,j_fks)836 xp_mother(i)=xp(i,i_fks)+xp(i,j_fks)
832 recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i)837 if (nincoming.eq.2) then
838 recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i)
839 else
840 recoil(i)=xp(i,1)-xp_mother(i)
841 endif
833 enddo842 enddo
834 sumrec=recoil(0)+rho(recoil)843 sumrec=recoil(0)+rho(recoil)
835 sumrec2=sumrec**2844 sumrec2=sumrec**2
@@ -843,7 +852,7 @@
843 xdir(j)=xp_mother(j)/x3len_fks_mother852 xdir(j)=xp_mother(j)/x3len_fks_mother
844 enddo853 enddo
845c Perform the boost here854c Perform the boost here
846 do i=3,nexternal855 do i=nincoming+1,nexternal
847 if(i.ne.i_fks.and.i.ne.j_fks.and.shybst.ne.0.d0)856 if(i.ne.i_fks.and.i.ne.j_fks.and.shybst.ne.0.d0)
848 & call boostwdir2(chybst,shybst,chybstmo,xdir,xp(0,i),xp(0,i))857 & call boostwdir2(chybst,shybst,chybstmo,xdir,xp(0,i),xp(0,i))
849 enddo858 enddo
@@ -1145,7 +1154,11 @@
1145c mother four momenta1154c mother four momenta
1146 do i=0,31155 do i=0,3
1147 xp_mother(i)=xp(i,i_fks)+xp(i,j_fks)1156 xp_mother(i)=xp(i,i_fks)+xp(i,j_fks)
1148 recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i)1157 if (nincoming.eq.2) then
1158 recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i)
1159 else
1160 recoil(i)=xp(i,1)-xp_mother(i)
1161 endif
1149 enddo1162 enddo
1150c1163c
1151 sumrec=recoil(0)+rho(recoil)1164 sumrec=recoil(0)+rho(recoil)
@@ -1168,7 +1181,7 @@
1168 xdir(j)=xp_mother(j)/x3len_fks_mother1181 xdir(j)=xp_mother(j)/x3len_fks_mother
1169 enddo1182 enddo
1170c Boost the momenta1183c Boost the momenta
1171 do i=3,nexternal1184 do i=nincoming+1,nexternal
1172 if(i.ne.i_fks.and.i.ne.j_fks.and.shybst.ne.0.d0)1185 if(i.ne.i_fks.and.i.ne.j_fks.and.shybst.ne.0.d0)
1173 & call boostwdir2(chybst,shybst,chybstmo,xdir,xp(0,i),xp(0,i))1186 & call boostwdir2(chybst,shybst,chybstmo,xdir,xp(0,i),xp(0,i))
1174 enddo1187 enddo
@@ -2357,7 +2370,11 @@
2357 external dot2370 external dot
2358 pass=.true.2371 pass=.true.
2359 do i=0,32372 do i=0,3
2360 recoilbar(i)=p_born(i,1)+p_born(i,2)-p_born(i,imother)2373 if (nincoming.eq.2) then
2374 recoilbar(i)=p_born(i,1)+p_born(i,2)-p_born(i,imother)
2375 else
2376 recoilbar(i)=p_born(i,1)-p_born(i,imother)
2377 endif
2361 enddo2378 enddo
2362 xmrec2=dot(recoilbar,recoilbar)2379 xmrec2=dot(recoilbar,recoilbar)
2363 if(xmrec2.lt.0.d0)then2380 if(xmrec2.lt.0.d0)then
23642381
=== modified file 'Template/NLO/SubProcesses/iproc_map.f'
--- Template/NLO/SubProcesses/iproc_map.f 2015-03-09 18:27:17 +0000
+++ Template/NLO/SubProcesses/iproc_map.f 2015-10-25 15:32:18 +0000
@@ -211,7 +211,8 @@
211 include "appl_common.inc"211 include "appl_common.inc"
212*212*
213 character*200 buffer213 character*200 buffer
214 integer procnum,found,i,l,j,ll214 integer procnum,i,l,j,ll,found_a,found_m
215 logical found_appl(mxpdflumi),found_mg(maxproc)
215 integer nmatch_total216 integer nmatch_total
216217
217* npdflumi is the number of pdf luminosities in this particular process218* npdflumi is the number of pdf luminosities in this particular process
@@ -296,7 +297,7 @@
296 1 ((pdgs(i,j,kpdflumi),i=1,2),j=1,nproc(kpdflumi))297 1 ((pdgs(i,j,kpdflumi),i=1,2),j=1,nproc(kpdflumi))
297*298*
298 if(kpdflumi.le.0.or.kpdflumi.gt.mxpdflumi) then299 if(kpdflumi.le.0.or.kpdflumi.gt.mxpdflumi) then
299 write(6,*) "In fks_singular.f"300 write(6,*) "In iproc_map.f"
300 write(6,*) "Invalid value of kpdflumi = ",kpdflumi301 write(6,*) "Invalid value of kpdflumi = ",kpdflumi
301 stop302 stop
302 endif303 endif
@@ -341,33 +342,29 @@
341* Be careful with all possible permutations in initial_parton_map!342* Be careful with all possible permutations in initial_parton_map!
342* Check all possible npdflumi conbinations until a match is found343* Check all possible npdflumi conbinations until a match is found
343 do kpdflumi=1,npdflumi344 do kpdflumi=1,npdflumi
344* First, check that the same number of 345
345* parton subprocesses is used
346 if(maxproc_used.ne.nproc(kpdflumi)) continue
347 if(flav_map_debug) then
348 write(6,*) " "
349 write(6,*) " kpdflumi = ",kpdflumi
350 write(6,*) " nproc(kpdflumi) = ",nproc(kpdflumi)
351 do l=1,nproc(kpdflumi)
352 write(6,*) l,pdgs(1,l,kpdflumi),pdgs(2,l,kpdflumi)
353 enddo
354 write(6,*) " "
355 endif
356
357* Initialization346* Initialization
358 found = 0347 do l=1,nproc(kpdflumi)
348 found_appl(l) = .false.
349 enddo
350 do ll=1,maxproc_used
351 found_mg(ll) = .false.
352 enddo
353 found_a=0
354 found_m=0
359355
360* Look for all possible pairs of356* Look for all possible pairs of
361* a) pdgs(1,l,kpdflumi),pdgs(2,l,kpdflumi) and357* a) pdgs(1,l,kpdflumi),pdgs(2,l,kpdflumi) and
362* b) IDUP(1,ll), IDUP(2,ll)358* b) IDUP(1,ll), IDUP(2,ll)
363* with kpdflumi fixed359* with kpdflumi fixed
364 do l=1,nproc(kpdflumi)360 do l=1,nproc(kpdflumi)
365 do ll=1,nproc(kpdflumi)361 do ll=1,maxproc_used
366 if ( ( pdgs(1,l,kpdflumi).eq.362 if ( ( pdgs(1,l,kpdflumi).eq.
367 1 IDUP(1,ll).and.pdgs(2,l,kpdflumi).363 1 IDUP(1,ll).and.pdgs(2,l,kpdflumi).
368 2 eq.IDUP(2,ll) ) ) 364 2 eq.IDUP(2,ll) ) )
369 4 then365 4 then
370 found = found + 1366 found_appl(l)=.true.
367 found_mg(ll)=.true.
371 if(flav_map_debug) then368 if(flav_map_debug) then
372 write(6,*) "match found!"369 write(6,*) "match found!"
373 write(6,*) "pdgs = ",pdgs(1,l,kpdflumi),370 write(6,*) "pdgs = ",pdgs(1,l,kpdflumi),
@@ -377,8 +374,15 @@
377 endif374 endif
378 enddo375 enddo
379 enddo376 enddo
377 do l=1,nproc(kpdflumi)
378 if (found_appl(l)) found_a=found_a+1
379 enddo
380 do ll=1,maxproc_used
381 if (found_mg(ll)) found_m=found_m+1
382 enddo
380*383*
381 if (found.eq.nproc(kpdflumi)) then384 if ( found_a.eq.nproc(kpdflumi) .and.
385 & found_m.eq.maxproc_used ) then
382 if(flav_map_debug) then386 if(flav_map_debug) then
383 write(6,*) " ------------------------------- "387 write(6,*) " ------------------------------- "
384 write(6,*) " Match found!"388 write(6,*) " Match found!"
@@ -389,9 +393,9 @@
389 nmatch_total = nmatch_total+1393 nmatch_total = nmatch_total+1
390 endif394 endif
391 enddo395 enddo
392 if(flavour_map(nFKSprocess).eq.0) then396 if (nmatch_total.ne.nFKSprocess) then
393 write(6,*) 397 write(6,*)
394 1 "Problem with setup_flavourmap in fks_singular.f"398 1 "Problem with setup_flavourmap in iproc_map.f"
395 write(6,*) "nFKSprocess = ",nFKSprocess399 write(6,*) "nFKSprocess = ",nFKSprocess
396 write(6,*)" flavour_map(nFKSprocess)= ",400 write(6,*)" flavour_map(nFKSprocess)= ",
397 1 flavour_map(nFKSprocess)401 1 flavour_map(nFKSprocess)
@@ -399,17 +403,6 @@
399 endif403 endif
400 enddo404 enddo
401 405
402* write(6,*) " "
403* write(6,*) " nmatch_total = ", nmatch_total
404* write(6,*) " "
405 if( nmatch_total.ne.fks_configs) then
406 write(6,*)
407 1 "Problem with setup_flavourmap in fks_singular.f"
408 write(6,*) "nmatch_total, fks_configs"
409 write(6,*) nmatch_total, fks_configs
410 stop
411 endif
412
413* Check flavor map properly initialized406* Check flavor map properly initialized
414* All the entries of flavour_map(1:nFKSprocess) must be from407* All the entries of flavour_map(1:nFKSprocess) must be from
415* 1 to npdflumi408* 1 to npdflumi
416409
=== modified file 'Template/NLO/SubProcesses/leshouche_inc_chooser.f'
--- Template/NLO/SubProcesses/leshouche_inc_chooser.f 2015-03-09 18:27:17 +0000
+++ Template/NLO/SubProcesses/leshouche_inc_chooser.f 2015-10-25 15:32:18 +0000
@@ -91,8 +91,8 @@
91 icolup_d(1,1,nexternal,j)=-99999 ! should not be used91 icolup_d(1,1,nexternal,j)=-99999 ! should not be used
92 icolup_d(1,2,nexternal,j)=-9999992 icolup_d(1,2,nexternal,j)=-99999
93 enddo93 enddo
94 return
94 endif95 endif
95 return
96 endif96 endif
9797
98 open(unit=78, file='leshouche_info.dat', status='old')98 open(unit=78, file='leshouche_info.dat', status='old')
9999
=== modified file 'Template/NLO/SubProcesses/montecarlocounter.f'
--- Template/NLO/SubProcesses/montecarlocounter.f 2014-10-06 16:45:08 +0000
+++ Template/NLO/SubProcesses/montecarlocounter.f 2015-10-25 15:32:18 +0000
@@ -2549,8 +2549,9 @@
2549 common/to_abrv/abrv2549 common/to_abrv/abrv
25502550
2551 ref_scale=sqrt((1-xi)*shat)2551 ref_scale=sqrt((1-xi)*shat)
2552 xscalemin=max(frac_low*ref_scale,scaleMClow)2552 xscalemin=max(shower_scale_factor*frac_low*ref_scale,scaleMClow)
2553 xscalemax=max(frac_upp*ref_scale,xscalemin+scaleMCdelta)2553 xscalemax=max(shower_scale_factor*frac_upp*ref_scale,
2554 & xscalemin+scaleMCdelta)
2554 xscalemax=min(xscalemax,2d0*sqrt(ebeam(1)*ebeam(2)))2555 xscalemax=min(xscalemax,2d0*sqrt(ebeam(1)*ebeam(2)))
2555 xscalemin=min(xscalemin,xscalemax)2556 xscalemin=min(xscalemin,xscalemax)
2556c2557c
25572558
=== modified file 'Template/NLO/SubProcesses/setcuts.f'
--- Template/NLO/SubProcesses/setcuts.f 2015-07-24 18:59:18 +0000
+++ Template/NLO/SubProcesses/setcuts.f 2015-10-25 15:32:18 +0000
@@ -91,8 +91,6 @@
91 lpp(2)=091 lpp(2)=0
92 ebeam(1)=pmass(1)/2d092 ebeam(1)=pmass(1)/2d0
93 ebeam(2)=pmass(1)/2d093 ebeam(2)=pmass(1)/2d0
94 scale=pmass(1)
95 fixed_ren_scale=.true.
96 endif94 endif
97c-check consistency of maxjetflavor in the run_card and with Nf95c-check consistency of maxjetflavor in the run_card and with Nf
98c specified in coupl.inc96c specified in coupl.inc
9997
=== modified file 'Template/NLO/SubProcesses/setscales.f'
--- Template/NLO/SubProcesses/setscales.f 2015-07-30 15:57:44 +0000
+++ Template/NLO/SubProcesses/setscales.f 2015-10-25 15:32:18 +0000
@@ -237,7 +237,10 @@
237 $ ,FxFx_fac_scale237 $ ,FxFx_fac_scale
238c238c
239 tmp=0239 tmp=0
240 if(ickkw.eq.3)then240 if (nincoming.eq.1) then
241 tmp=pp(0,1) ! mass of the decaying particle
242 temp_scale_id='Mass of decaying particle'
243 elseif(ickkw.eq.3)then
241c FxFx merging scale:244c FxFx merging scale:
242c Note that nFxFx_ren_scales includes the one scale that corresponds245c Note that nFxFx_ren_scales includes the one scale that corresponds
243c to the real-emission one (and is zero for the n-body conf.). Skip246c to the real-emission one (and is zero for the n-body conf.). Skip
@@ -411,7 +414,7 @@
411 tmp=0414 tmp=0
412 if(ickkw.eq.3)then415 if(ickkw.eq.3)then
413c FxFx merging scale:416c FxFx merging scale:
414 tmp=min(FxFx_fac_scale(1),FxFx_fac_scale(2))417 tmp=(FxFx_fac_scale(1)+FxFx_fac_scale(2))/2d0
415 temp_scale_id='FxFx merging scale'418 temp_scale_id='FxFx merging scale'
416 elseif(imuftype.eq.1)then419 elseif(imuftype.eq.1)then
417 tmp=scale_global_reference(pp)420 tmp=scale_global_reference(pp)
@@ -490,7 +493,10 @@
490 parameter (iQEStype=1)493 parameter (iQEStype=1)
491c494c
492 tmp=0495 tmp=0
493 if(iQEStype.eq.1)then496 if (nincoming.eq.1) then
497 tmp=pp(0,1) ! mass of the decaying particle
498 temp_scale_id='Mass of decaying particle'
499 elseif(iQEStype.eq.1)then
494 tmp=scale_global_reference(pp)500 tmp=scale_global_reference(pp)
495 elseif(iQEStype.eq.2)then501 elseif(iQEStype.eq.2)then
496 do i=nincoming+1,nexternal502 do i=nincoming+1,nexternal
497503
=== removed file 'Template/NLO/SubProcesses/sumres.py'
--- Template/NLO/SubProcesses/sumres.py 2014-07-23 10:33:38 +0000
+++ Template/NLO/SubProcesses/sumres.py 1970-01-01 00:00:00 +0000
@@ -1,241 +0,0 @@
1#!/usr/bin/env python
2
3#script to combine reults and tell the number of events that need
4# to be generated in each channel.
5# Replaces the sumres.f and sumres2.f files
6# MZ, 2011-10-22
7
8from __future__ import division
9import math
10import sys
11import random
12import os
13
14nexpected=int(sys.argv[1])
15nevents=int(sys.argv[2])
16req_acc=float(sys.argv[3])
17# if nevents is >=0 the script will also determine the
18# number of events required for each process
19
20
21def Mirrorprocs(p1, p2):
22 """determine if the folder names p1, p2 (with the _N already taken out)
23 correspond to the same process with
24 mirrror initial state. Returns true/false"""
25 return False
26
27file=open("res.txt")
28content = file.read()
29file.close()
30lines = content.split("\n")
31processes=[]
32tot=0
33err=0
34totABS=0
35errABS=0
36
37# open the file containing the list of directories
38file=open("dirs.txt")
39dirs = file.read().split("\n")
40file.close()
41dirs.remove('')
42
43# The syntax of lines should be first the ABS cross section for the
44# channel and the line after that the cross section for the same
45# channel.
46for line in range(0,len(lines),2):
47 list = lines[line].split()
48 if list:
49 proc={}
50 proc['folder'] = list[0].split('/')[0]
51 proc['subproc'] = proc['folder'][0:proc['folder'].rfind('_')]
52 proc['channel'] = list[0].split('/')[1]
53 dirs.remove(os.path.join(proc['folder'], proc['channel']))
54 proc['resultABS'] = float(list[4])
55 proc['errorABS'] = float(list[6])
56 proc['err_percABS'] = proc['errorABS']/proc['resultABS']*100.
57 processes.append(proc)
58 totABS+= proc['resultABS']
59 errABS+= math.pow(proc['errorABS'],2)
60 list = lines[line+1].split()
61 if list:
62 proc['result'] = float(list[3])
63 proc['error'] = float(list[5])
64 proc['err_perc'] = proc['error']/proc['result']*100.
65 tot+= proc['result']
66 err+= math.pow(proc['error'],2)
67if dirs:
68 print "%d jobs did not terminate correctly: " % len(dirs)
69 print '\n'.join(dirs)
70 print "The results are probably not correct. Please check the relevant log files corresponding to the above jobs for more information."
71
72processes.sort(key = lambda proc: -proc['errorABS'])
73
74correct = len(processes) == nexpected
75print "Found %d correctly terminated jobs " %len(processes)
76if not len(processes)==nexpected:
77 print len(processes), nexpected
78
79subprocs_string=[]
80for proc in processes:
81 subprocs_string.append(proc['subproc'])
82subprocs_string=set(subprocs_string)
83
84content+='\n\nCross-section per integration channel:\n'
85for proc in processes:
86 content+='%(folder)20s %(channel)15s %(result)10.8e %(error)6.4e %(err_perc)6.4f%% \n' % proc
87
88content+='\n\nABS cross-section per integration channel:\n'
89for proc in processes:
90 content+='%(folder)20s %(channel)15s %(resultABS)10.8e %(errorABS)6.4e %(err_percABS)6.4f%% \n' % proc
91
92content+='\n\nCross-section per subprocess:\n'
93#for subpr in sorted(set(subprocs)):
94subprocesses=[]
95for sub in subprocs_string:
96 subpr={}
97 subpr['subproc']=sub
98 subpr['xsect']=0.
99 subpr['err']=0.
100 for proc in processes:
101 if proc['subproc'] == sub:
102 subpr['xsect'] += proc['result']
103 subpr['err'] += math.pow(proc['error'],2)
104 subpr['err']=math.sqrt(subpr['err'])
105 subprocesses.append(subpr)
106
107
108#find and combine mirror configurations (if in v4)
109for i1, s1 in enumerate(subprocesses):
110 for i2, s2 in enumerate(subprocesses):
111 if Mirrorprocs(s1['subproc'], s2['subproc']) and i1 >= i2:
112 s1['xsect'] += s2['xsect']
113 s1['err'] = math.sqrt(math.pow(s1['err'],2)+ math.pow(s2['err'],2))
114 s2['toremove'] = True
115
116new = []
117for s in subprocesses:
118 try:
119 a= s['toremove']
120 except KeyError:
121 new.append(s)
122subprocesses= new
123
124
125subprocesses.sort(key = lambda proc: -proc['xsect'])
126for subpr in subprocesses:
127 content+= '%(subproc)20s %(xsect)10.8e %(err)6.4e\n' % subpr
128
129
130content+='\nTotal ABS and \nTotal: \n %10.8e +- %6.4e (%6.4e%%)\n %10.8e +- %6.4e (%6.4e%%)\n' %\
131 (totABS, math.sqrt(errABS), math.sqrt(errABS)/totABS *100.,tot, math.sqrt(err), math.sqrt(err)/tot *100.)
132
133if not correct:
134 sys.exit('ERROR: not all jobs terminated correctly\n')
135
136file=open("res.txt", 'w')
137
138file.write(content)
139file.close()
140
141#determine the events for each process:
142if nevents>=0:
143 if req_acc<0:
144 req_acc2_inv=nevents
145 else:
146 req_acc2_inv=1/(req_acc*req_acc)
147 #get the random number seed from the randinit file
148 file=open("randinit")
149 exec file
150 file.close
151 print "random seed found in 'randinit' is", r
152 random.seed(r)
153 totevts=nevents
154 for proc in processes:
155 proc['lhefile'] = os.path.join(proc['folder'], proc['channel'], 'events.lhe')
156 proc['nevents'] = 0
157 while totevts :
158 target = random.random() * totABS
159 crosssum = 0.
160 i = 0
161 while i<len(processes) and crosssum < target:
162 proc = processes[i]
163 crosssum += proc['resultABS']
164 i += 1
165 totevts -= 1
166 i -= 1
167 processes[i]['nevents'] += 1
168
169#check that we now have all the events in the channels
170 totevents = sum(proc['nevents'] for proc in processes)
171 if totevents != nevents:
172 sys.exit('failed to obtain the correct number of events. Required: %d, Obtained: %d' \
173 % (nevents, totevents))
174
175 content_evts = ''
176 for proc in processes:
177 content_evts+= ' '+proc['lhefile']+' %(nevents)10d %(resultABS)10.8e 1.0 \n' % proc
178 nevts_file = open(os.path.join(proc['folder'], proc['channel'], 'nevts'),'w')
179 nevts_file.write('%10d\n' % proc['nevents'])
180 nevts_file.close()
181 if proc['channel'][1] == 'B':
182 fileinputs = open("madinMMC_B.2")
183 elif proc['channel'][1] == 'F':
184 fileinputs = open("madinMMC_F.2")
185 elif proc['channel'][1] == 'V':
186 fileinputs = open("madinMMC_V.2")
187 else:
188 sys.exit("ERROR, DONT KNOW WHICH INPUTS TO USE")
189 fileinputschannel = open(os.path.join(proc['folder'], proc['channel'], 'madinM1'),'w')
190 i=0
191 for line in fileinputs:
192 i += 1
193 if i == 2:
194 accuracy=min(math.sqrt(totABS/(req_acc2_inv*proc['resultABS'])),0.2)
195 fileinputschannel.write('%10.8e\n' % accuracy)
196 elif i == 8:
197 fileinputschannel.write('1 ! MINT mode\n')
198 else:
199 fileinputschannel.write(line)
200 fileinputschannel.close()
201 fileinputs.close()
202
203 evts_file = open('nevents_unweighted', 'w')
204 evts_file.write(content_evts)
205 evts_file.close()
206
207# if nevents = -1 and req_acc >= 0, we need to determine the required
208# accuracy in each of the channels: this is for fixed order running!
209elif req_acc>=0 and nevents==-1:
210 req_accABS=req_acc*abs(tot)/totABS
211 content_evts = ''
212 for proc in processes:
213 if proc['channel'][0:3] == 'all':
214 fileinputs = open("madin.all")
215 elif proc['channel'][0:4] == 'novB':
216 fileinputs = open("madin.novB")
217 elif proc['channel'][0:4] == 'born':
218 fileinputs = open("madin.born")
219 elif proc['channel'][0:4] == 'grid':
220 fileinputs = open("madin.grid")
221 elif proc['channel'][0:4] == 'viSB':
222 fileinputs = open("madin.viSB")
223 elif proc['channel'][0:4] == 'virt':
224 fileinputs = open("madin.virt")
225 elif proc['channel'][0:4] == 'novi':
226 fileinputs = open("madin.novi")
227 else:
228 sys.exit("ERROR, DONT KNOW WHICH INPUTS TO USE")
229 fileinputschannel = open(os.path.join(proc['folder'], proc['channel'], 'madinM1'),'w')
230 i=0
231 for line in fileinputs:
232 i += 1
233 if i == 2:
234 accuracy=req_accABS*math.sqrt(totABS*proc['resultABS'])
235 fileinputschannel.write('%10.8e\n' % accuracy)
236 elif i == 9:
237 fileinputschannel.write('-1 ! restart from existing grids\n')
238 else:
239 fileinputschannel.write(line)
240 fileinputschannel.close()
241 fileinputs.close()
2420
=== modified file 'Template/NLO/SubProcesses/symmetry_fks_test_ME.f'
--- Template/NLO/SubProcesses/symmetry_fks_test_ME.f 2015-06-30 14:50:39 +0000
+++ Template/NLO/SubProcesses/symmetry_fks_test_ME.f 2015-10-25 15:32:18 +0000
@@ -268,7 +268,7 @@
268268
269 do iconfig=bs_min,bs_max ! Born configurations269 do iconfig=bs_min,bs_max ! Born configurations
270 call setcuts270 call setcuts
271 call setfksfactor(iconfig)271 call setfksfactor(iconfig,.false.)
272 wgt=1d0272 wgt=1d0
273 ntry=1273 ntry=1
274274
275275
=== modified file 'Template/NLO/SubProcesses/symmetry_fks_v3.f'
--- Template/NLO/SubProcesses/symmetry_fks_v3.f 2014-06-26 08:45:41 +0000
+++ Template/NLO/SubProcesses/symmetry_fks_v3.f 2015-10-25 15:32:18 +0000
@@ -177,7 +177,7 @@
177 call printout177 call printout
178 call run_printout178 call run_printout
179 iconfig=1179 iconfig=1
180 call setfksfactor(iconfig)180 call setfksfactor(iconfig,.false.)
181c181c
182 ndim = 55182 ndim = 55
183 ncall = 10000183 ncall = 10000
@@ -541,6 +541,8 @@
541 lname=4541 lname=4
542 mname='mg'542 mname='mg'
543 call open_bash_file(26,fname,lname,mname)543 call open_bash_file(26,fname,lname,mname)
544 call close_bash_file(26)
545 open(unit=26,file='channels.txt',status='unknown')
544 ic = 0 546 ic = 0
545 do i=1,mapconfig(0)547 do i=1,mapconfig(0)
546 if (use_config(i) .gt. 0) then548 if (use_config(i) .gt. 0) then
@@ -567,15 +569,6 @@
567 done = .false.569 done = .false.
568 do while (.not. done)570 do while (.not. done)
569 call enCode(icode,iarray,ibase,imax)571 call enCode(icode,iarray,ibase,imax)
570 ic=ic+1
571 if (ic .gt. ChanPerJob) then
572 call close_bash_file(26)
573 fname='ajob'
574 lname=4
575 mname='mg'
576 call open_bash_file(26,fname,lname,mname)
577 ic = 1
578 endif
579c write(*,*) 'mapping',ic,mapconfig(i)572c write(*,*) 'mapping',ic,mapconfig(i)
580c$$$ if (r_from_b(mapconfig(i)) .lt. 10) then573c$$$ if (r_from_b(mapconfig(i)) .lt. 10) then
581c$$$ write(26,'(i1$)') r_from_b(mapconfig(i))574c$$$ write(26,'(i1$)') r_from_b(mapconfig(i))
@@ -611,7 +604,7 @@
611 enddo604 enddo
612 endif605 endif
613 enddo606 enddo
614 call close_bash_file(26)607 close(26)
615 if (mapconfig(0) .gt. 9999) then608 if (mapconfig(0) .gt. 9999) then
616 write(*,*) 'Only writing first 9999 jobs',mapconfig(0)609 write(*,*) 'Only writing first 9999 jobs',mapconfig(0)
617 endif610 endif
618611
=== modified file 'Template/NLO/SubProcesses/write_ajob.f'
--- Template/NLO/SubProcesses/write_ajob.f 2012-10-18 06:17:30 +0000
+++ Template/NLO/SubProcesses/write_ajob.f 2015-10-25 15:32:18 +0000
@@ -53,7 +53,7 @@
53 if (index(buff,'TAGTAGTAGTAGTAG').ne.0) exit53 if (index(buff,'TAGTAGTAGTAGTAG').ne.0) exit
54 write(lun,15) buff54 write(lun,15) buff
55 enddo55 enddo
56 write(lun,'(a$)') 'for i in '56 write(lun,'(a$)') 'for i in $channel '
57 return57 return
58 99 write (*,*) 'ajob_template or ajob_template_cluster '/58 99 write (*,*) 'ajob_template or ajob_template_cluster '/
59 & /'does not have the correct format'59 & /'does not have the correct format'
6060
=== modified file 'Template/loop_material/StandAlone/Cards/MadLoopParams.dat'
--- Template/loop_material/StandAlone/Cards/MadLoopParams.dat 2014-10-27 08:40:30 +0000
+++ Template/loop_material/StandAlone/Cards/MadLoopParams.dat 2015-10-25 15:32:18 +0000
@@ -4,8 +4,8 @@
44
5! 5!
6#MLReductionLib6#MLReductionLib
7!1|4|3|27!1|3|2
8! Default :: 1|4|3|28! Default :: 1|3|2
9! The tensor integral reduction library.The current choices are:9! The tensor integral reduction library.The current choices are:
10! 1 | CutTools10! 1 | CutTools
11! 2 | PJFry++11! 2 | PJFry++
1212
=== modified file 'UpdateNotes.txt'
--- UpdateNotes.txt 2015-09-07 18:05:30 +0000
+++ UpdateNotes.txt 2015-10-25 15:32:18 +0000
@@ -1,6 +1,28 @@
1Update notes for MadGraph5_aMC@NLO (in reverse time order)1Update notes for MadGraph5_aMC@NLO (in reverse time order)
22
32.3.2.2 (06/09/15)3<<<<<<< TREE
42.3.2.2 (06/09/15)
5=======
62.3.3(XX/XX/XX)
7 OM: Allow new syntax for the param_card: instead of an entry you can enter scan:[val1, val2,...]
8 To perform a scan on this parameter.
9 OM: Having two mode for "output pythia8" one (default) for pythia8.2 and one for pythia8.1 (with --version=8.1)
10 RF: Rewriting of job-control for NLO processes. Better accuracy estimates for FO processes
11 RF: Fix for factorisation scale setting in FxFx merging when very large difference in scale in the
12 non-QCD part of a process.
13 RF: Better discarding of numerical instabilities in the real-emission matrix elements. Only of interested for
14 processes which have jets at Born level, but do not require generation cut (like t-channel single-top).
15 RF: Added an option to the run_card to allow for easier variation of the shower starting scale (NLO only).
16 RF: Fixed a problem in the setting of the flavour map used for runs with iAPPL >= 1.
17 RF: Allow for decay processes to compute (partial) decay widths at NLO accuracy (fixed order only).
18 OM: (SysCalc interface) Allow to bypass the pdf reweighting/alpsfact reweighting
19 MZ: fixed bug related to slurm clusters
20 OM: remove the addmasses.py script of running by default on gridpack mode.
21 if you want to have it running, you just have to rename the file madevent/bin/internal/addmasses_optional.py to
22 madevent/bin/internal/addmasses_optional.py and it will work as before. (Do not work with SysCalc tag)
23
242.3.2.2 (06/09/15)
25>>>>>>> MERGE-SOURCE
4 VH: Finalized the MG5aMC-GoSam interface26 VH: Finalized the MG5aMC-GoSam interface
527
62.3.2(20/08/15) 282.3.2(20/08/15)
729
=== modified file 'VERSION'
--- VERSION 2015-09-07 18:04:08 +0000
+++ VERSION 2015-10-25 15:32:18 +0000
@@ -1,5 +1,10 @@
1<<<<<<< TREE
1version = 2.3.2.22version = 2.3.2.2
2date = 2015-09-063date = 2015-09-06
4=======
5version = 2.3.3
6date = 2015-10-20
7>>>>>>> MERGE-SOURCE
38
49
510
611
=== modified file 'aloha/__init__.py' (properties changed: -x to +x)
=== modified file 'aloha/aloha_fct.py' (properties changed: -x to +x)
=== modified file 'aloha/aloha_lib.py' (properties changed: -x to +x)
--- aloha/aloha_lib.py 2015-07-30 15:43:54 +0000
+++ aloha/aloha_lib.py 2015-10-25 15:32:18 +0000
@@ -1073,9 +1073,9 @@
1073 self[(0,)] = representation[(0,)]1073 self[(0,)] = representation[(0,)]
1074 except Exception:1074 except Exception:
1075 if representation:1075 if representation:
1076 raise LorentzObjectRepresentation.LorentzObjectRepresentationError("There is no key of (0,) in representation.")1076 raise LorentzObjectRepresentation.LorentzObjectRepresentationError("There is no key of (0,) in representation.")
1077 else:1077 else:
1078 self[(0,)] = 01078 self[(0,)] = 0
1079 else:1079 else:
1080 self[(0,)] = representation1080 self[(0,)] = representation
10811081
10821082
=== modified file 'aloha/aloha_object.py' (properties changed: -x to +x)
--- aloha/aloha_object.py 2014-02-18 21:45:48 +0000
+++ aloha/aloha_object.py 2015-10-25 15:32:18 +0000
@@ -434,12 +434,12 @@
434 self.sub11 = aloha_lib.Variable('T%s_6' % self.particle)434 self.sub11 = aloha_lib.Variable('T%s_6' % self.particle)
435 self.sub12 = aloha_lib.Variable('T%s_7' % self.particle)435 self.sub12 = aloha_lib.Variable('T%s_7' % self.particle)
436 self.sub13 = aloha_lib.Variable('T%s_8' % self.particle)436 self.sub13 = aloha_lib.Variable('T%s_8' % self.particle)
437 437
438 self.sub20 = aloha_lib.Variable('T%s_9' % self.particle)438 self.sub20 = aloha_lib.Variable('T%s_9' % self.particle)
439 self.sub21 = aloha_lib.Variable('T%s_10' % self.particle)439 self.sub21 = aloha_lib.Variable('T%s_10' % self.particle)
440 self.sub22 = aloha_lib.Variable('T%s_11' % self.particle)440 self.sub22 = aloha_lib.Variable('T%s_11' % self.particle)
441 self.sub23 = aloha_lib.Variable('T%s_12' % self.particle)441 self.sub23 = aloha_lib.Variable('T%s_12' % self.particle)
442 442
443 self.sub30 = aloha_lib.Variable('T%s_13' % self.particle)443 self.sub30 = aloha_lib.Variable('T%s_13' % self.particle)
444 self.sub31 = aloha_lib.Variable('T%s_14' % self.particle)444 self.sub31 = aloha_lib.Variable('T%s_14' % self.particle)
445 self.sub32 = aloha_lib.Variable('T%s_15' % self.particle)445 self.sub32 = aloha_lib.Variable('T%s_15' % self.particle)
446446
=== modified file 'aloha/aloha_parsers.py' (properties changed: -x to +x)
=== modified file 'aloha/aloha_writers.py' (properties changed: -x to +x)
--- aloha/aloha_writers.py 2014-12-11 15:23:43 +0000
+++ aloha/aloha_writers.py 2015-10-25 15:32:18 +0000
@@ -689,7 +689,7 @@
689 if number.imag == 1:689 if number.imag == 1:
690 out = 'CI'690 out = 'CI'
691 elif number.imag == -1:691 elif number.imag == -1:
692 out = '-CI'692 out = '-CI'
693 else: 693 else:
694 out = '%s * CI' % self.change_number_format(number.imag)694 out = '%s * CI' % self.change_number_format(number.imag)
695 else:695 else:
696696
=== modified file 'aloha/create_aloha.py' (properties changed: -x to +x)
--- aloha/create_aloha.py 2015-06-28 14:44:22 +0000
+++ aloha/create_aloha.py 2015-10-25 15:32:18 +0000
@@ -854,7 +854,7 @@
854 # reorganize the data (in order to use optimization for a given lorentz854 # reorganize the data (in order to use optimization for a given lorentz
855 #structure855 #structure
856 aloha.loop_mode = False856 aloha.loop_mode = False
857 # self.explicit_combine = False857 # self.explicit_combine = False
858 request = {}858 request = {}
859859
860 for list_l_name, tag, outgoing in data:860 for list_l_name, tag, outgoing in data:
861861
=== modified file 'aloha/template_files/__init__.py' (properties changed: -x to +x)
=== modified file 'aloha/template_files/aloha_functions_loop.f'
--- aloha/template_files/aloha_functions_loop.f 2013-11-29 07:28:53 +0000
+++ aloha/template_files/aloha_functions_loop.f 2015-10-25 15:32:18 +0000
@@ -86,6 +86,7 @@
8686
87 pp = min(p(0),dsqrt(p(1)**2+p(2)**2+p(3)**2))87 pp = min(p(0),dsqrt(p(1)**2+p(2)**2+p(3)**2))
8888
89
89 if ( pp.eq.rZero ) then90 if ( pp.eq.rZero ) then
9091
91 sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses92 sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses
@@ -477,13 +478,13 @@
477478
478 sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses479 sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses
479 sqm(1) = sign(sqm(0),fmass) ! possibility of negative fermion masses480 sqm(1) = sign(sqm(0),fmass) ! possibility of negative fermion masses
480 ip = -((1+nh)/2)
481 im = (1-nh)/2
482481
483 fo(5) = im * sqm(im)482 im = nhel * (1+nh)/2
484 fo(6) = ip*nsf * sqm(im)483 ip = nhel * -1 * ((1-nh)/2)
485 fo(7) = im*nsf * sqm(-ip)484 fo(5) = im * sqm(abs(ip))
486 fo(8) = ip * sqm(-ip)485 fo(6) = ip*nsf * sqm(abs(ip))
486 fo(7) = im*nsf * sqm(abs(im))
487 fo(8) = ip * sqm(abs(im))
487488
488 else489 else
489490
490491
=== modified file 'aloha/template_files/wavefunctions.py' (properties changed: -x to +x)
--- aloha/template_files/wavefunctions.py 2013-07-23 16:48:52 +0000
+++ aloha/template_files/wavefunctions.py 2015-10-25 15:32:18 +0000
@@ -316,7 +316,7 @@
316 elif nhel == 1:316 elif nhel == 1:
317 for j in range(4):317 for j in range(4):
318 for i in range(4): 318 for i in range(4):
319 ft[(i,j)] = sqh*( ep[i]*e0[j] + e0[i]*ep[j] )319 ft[(i,j)] = sqh*( ep[i]*e0[j] + e0[i]*ep[j] )
320 elif nhel == 0:320 elif nhel == 0:
321 for j in range(4):321 for j in range(4):
322 for i in range(4): 322 for i in range(4):
@@ -324,10 +324,10 @@
324 elif nhel == -1:324 elif nhel == -1:
325 for j in range(4):325 for j in range(4):
326 for i in range(4): 326 for i in range(4):
327 ft[(i,j)] = sqh*( em[i]*e0[j] + e0[i]*em[j] )327 ft[(i,j)] = sqh*( em[i]*e0[j] + e0[i]*em[j] )
328328
329 else:329 else:
330 raise Exception, 'invalid helicity TXXXXXX' 330 raise Exception, 'invalid helicity TXXXXXX'
331331
332332
333333
334334
=== modified file 'bin/mg5'
--- bin/mg5 2014-07-17 13:34:15 +0000
+++ bin/mg5 2015-10-25 15:32:18 +0000
@@ -28,6 +28,6 @@
2828
29sys.argv.pop(0)29sys.argv.pop(0)
30if __debug__:30if __debug__:
31 os.system('%s %s %s' %(sys.executable, str(exe_path) , ' '.join(sys.argv) ))31 os.system('%s -tt %s %s' %(sys.executable, str(exe_path) , ' '.join(sys.argv) ))
32else:32else:
33 os.system('%s -O %s %s' %(sys.executable, str(exe_path) , ' '.join(sys.argv) ))33 os.system('%s -O %s %s' %(sys.executable, str(exe_path) , ' '.join(sys.argv) ))
3434
=== modified file 'input/.mg5_configuration_default.txt'
--- input/.mg5_configuration_default.txt 2015-08-14 13:56:58 +0000
+++ input/.mg5_configuration_default.txt 2015-10-25 15:32:18 +0000
@@ -84,6 +84,9 @@
84#! Allow/Forbid the automatic opening of the web browser (on the status page)84#! Allow/Forbid the automatic opening of the web browser (on the status page)
85#! when launching MadEvent [True/False]85#! when launching MadEvent [True/False]
86# automatic_html_opening = True86# automatic_html_opening = True
87#! allow notification of finished job in the notification center (Mac Only)
88# notification_center = True
89
8790
88#! Default Running mode 91#! Default Running mode
89#! 0: single machine/ 1: cluster / 2: multicore92#! 0: single machine/ 1: cluster / 2: multicore
9093
=== modified file 'madgraph/__init__.py' (properties changed: -x to +x)
=== modified file 'madgraph/core/__init__.py' (properties changed: -x to +x)
=== modified file 'madgraph/core/base_objects.py' (properties changed: -x to +x)
--- madgraph/core/base_objects.py 2015-08-16 22:19:30 +0000
+++ madgraph/core/base_objects.py 2015-10-25 15:32:18 +0000
@@ -202,8 +202,8 @@
202202
203 sorted_keys = ['name', 'antiname', 'spin', 'color',203 sorted_keys = ['name', 'antiname', 'spin', 'color',
204 'charge', 'mass', 'width', 'pdg_code',204 'charge', 'mass', 'width', 'pdg_code',
205 'texname', 'antitexname', 'line', 'propagating', 'propagator',205 'line', 'propagator',
206 'is_part', 'self_antipart', 'ghost', 'counterterm']206 'is_part', 'self_antipart', 'type', 'counterterm']
207207
208 def default_setup(self):208 def default_setup(self):
209 """Default values for all properties"""209 """Default values for all properties"""
@@ -216,19 +216,55 @@
216 self['mass'] = 'ZERO'216 self['mass'] = 'ZERO'
217 self['width'] = 'ZERO'217 self['width'] = 'ZERO'
218 self['pdg_code'] = 0218 self['pdg_code'] = 0
219 self['texname'] = 'none'219 #self['texname'] = 'none'
220 self['antitexname'] = 'none'220 #self['antitexname'] = 'none'
221 self['line'] = 'dashed'221 self['line'] = 'dashed'
222 self['propagating'] = True222 #self['propagating'] = True -> removed in favor or 'line' = None
223 self['propagator'] = ''223 self['propagator'] = ''
224 self['is_part'] = True224 self['is_part'] = True
225 self['self_antipart'] = False225 self['self_antipart'] = False
226 # True if ghost, False otherwise226 # True if ghost, False otherwise
227 self['ghost'] = False227 #self['ghost'] = False
228 self['type'] = '' # empty means normal can also be ghost or goldstone
228 # Counterterm defined as a dictionary with format:229 # Counterterm defined as a dictionary with format:
229 # ('ORDER_OF_COUNTERTERM',((Particle_list_PDG))):{laurent_order:CTCouplingName}230 # ('ORDER_OF_COUNTERTERM',((Particle_list_PDG))):{laurent_order:CTCouplingName}
230 self['counterterm'] = {}231 self['counterterm'] = {}
231232
233 def get(self, name):
234
235 if name == 'ghost':
236 return self['type'] == 'ghost'
237 elif name == 'goldstone':
238 return self['type'] == 'goldstone'
239 elif name == 'propagating':
240 return self['line'] is not None
241 else:
242 return super(Particle, self).get(name)
243
244 def set(self, name, value, force=False):
245
246 if name in ['texname', 'antitexname']:
247 return True
248 elif name == 'propagating':
249 if not value:
250 return self.set('line', None, force=force)
251 elif not self.get('line'):
252 return self.set('line', 'dashed',force=force)
253 return True
254 elif name in ['ghost', 'goldstone']:
255 if self.get('type') == name:
256 if value:
257 return True
258 else:
259 return self.set('type', '', force=force)
260 else:
261 if value:
262 return self.set('type', name, force=force)
263 else:
264 return True
265 return super(Particle, self).set(name, value,force=force)
266
267
232 def filter(self, name, value):268 def filter(self, name, value):
233 """Filter for valid particle property values."""269 """Filter for valid particle property values."""
234270
@@ -1213,7 +1249,7 @@
1213 if isinstance(id, int):1249 if isinstance(id, int):
1214 try:1250 try:
1215 return self.get("particle_dict")[id]1251 return self.get("particle_dict")[id]
1216 except Exception:1252 except Exception,error:
1217 return None1253 return None
1218 else:1254 else:
1219 if not hasattr(self, 'name2part'):1255 if not hasattr(self, 'name2part'):
@@ -1547,9 +1583,9 @@
1547 def write_param_card(self):1583 def write_param_card(self):
1548 """Write out the param_card, and return as string."""1584 """Write out the param_card, and return as string."""
1549 1585
1550 import models.write_param_card as writter1586 import models.write_param_card as writer
1551 out = StringIO.StringIO() # it's suppose to be written in a file1587 out = StringIO.StringIO() # it's suppose to be written in a file
1552 param = writter.ParamCardWriter(self)1588 param = writer.ParamCardWriter(self)
1553 param.define_output_file(out)1589 param.define_output_file(out)
1554 param.write_card()1590 param.write_card()
1555 return out.getvalue()1591 return out.getvalue()
@@ -1577,55 +1613,118 @@
1577 def change_electroweak_mode(self, mode):1613 def change_electroweak_mode(self, mode):
1578 """Change the electroweak mode. The only valid mode now is external.1614 """Change the electroweak mode. The only valid mode now is external.
1579 Where in top of the default MW and sw2 are external parameters."""1615 Where in top of the default MW and sw2 are external parameters."""
1580 1616
1581 assert mode == "external"1617 assert mode in ["external",set(['mz','mw','alpha'])]
1582 1618
1583 try:1619 try:
1584 W = self.get('particle_dict')[24]1620 W = self.get('particle_dict')[24]
1585 except KeyError:1621 except KeyError:
1586 raise InvalidCmd('No W particle in the model impossible to change the EW scheme!')1622 raise InvalidCmd('No W particle in the model impossible to '+
1623 'change the EW scheme!')
1587 1624
1588 MW = self.get_parameter(W.get('mass'))1625 if mode=='external':
1589 if not isinstance(MW, ParamCardVariable):1626 MW = self.get_parameter(W.get('mass'))
1590 newMW = ParamCardVariable(MW.name, MW.value, 'MASS', [24])1627 if not isinstance(MW, ParamCardVariable):
1591 if not newMW.value:1628 newMW = ParamCardVariable(MW.name, MW.value, 'MASS', [24])
1592 newMW.value = 80.3851629 if not newMW.value:
1593 #remove the old definition1630 newMW.value = 80.385
1594 self.get('parameters')[MW.depend].remove(MW)1631 #remove the old definition
1595 # add the new one1632 self.get('parameters')[MW.depend].remove(MW)
1596 self.add_param(newMW, ['external'])1633 # add the new one
1597 1634 self.add_param(newMW, ['external'])
1598 # Now check for sw2. if not define bypass this1635
1599 try:1636 # Now check for sw2. if not define bypass this
1600 sw2 = self.get_parameter('sw2')
1601 except KeyError:
1602 try:1637 try:
1603 sw2 = self.get_parameter('mdl_sw2')1638 sw2 = self.get_parameter('sw2')
1604 except KeyError:1639 except KeyError:
1605 sw2=None1640 try:
1606 1641 sw2 = self.get_parameter('mdl_sw2')
1607 if sw2:1642 except KeyError:
1608 newsw2 = ParamCardVariable(sw2.name,sw2.value, 'SMINPUTS', [4])1643 sw2=None
1609 if not newsw2.value:1644
1610 newsw2.value = 0.2222464857861645 if sw2:
1611 #remove the old definition1646 newsw2 = ParamCardVariable(sw2.name,sw2.value, 'SMINPUTS', [4])
1612 self.get('parameters')[sw2.depend].remove(sw2)1647 if not newsw2.value:
1613 # add the new one1648 newsw2.value = 0.222246485786
1614 self.add_param(newsw2, ['external']) 1649 #remove the old definition
16151650 self.get('parameters')[sw2.depend].remove(sw2)
1616 def change_mass_to_complex_scheme(self):1651 # add the new one
1652 self.add_param(newsw2, ['external'])
1653 # Force a refresh of the parameter dictionary
1654 self.parameters_dict = None
1655 return true
1656
1657 elif mode==set(['mz','mw','alpha']):
1658 # For now, all we support is to go from mz, Gf, alpha to mz, mw, alpha
1659 W = self.get('particle_dict')[24]
1660 mass = self.get_parameter(W.get('mass'))
1661 mass_expr = 'cmath.sqrt(%(prefix)sMZ__exp__2/2. + cmath.sqrt('+\
1662 '%(prefix)sMZ__exp__4/4. - (%(prefix)saEW*cmath.pi*%(prefix)s'+\
1663 'MZ__exp__2)/(%(prefix)sGf*%(prefix)ssqrt__2)))'
1664 if 'external' in mass.depend:
1665 # Nothing to be done
1666 return True
1667 match = False
1668 if mass.expr == mass_expr%{'prefix':''}:
1669 prefix = ''
1670 match = True
1671 elif mass.expr == mass_expr%{'prefix':'mdl_'}:
1672 prefix = 'mdl_'
1673 match = True
1674 if match:
1675 MW = ParamCardVariable(mass.name, mass.value, 'MASS', [24])
1676 if not MW.value:
1677 MW.value = 80.385
1678 self.get('parameters')[('external',)].append(MW)
1679 self.get('parameters')[mass.depend].remove(mass)
1680 # Make Gf an internal parameter
1681 new_param = ModelVariable('Gf',
1682 '-%(prefix)saEW*%(prefix)sMZ**2*cmath.pi/(cmath.sqrt(2)*%(MW)s**2*(%(MW)s**2 - %(prefix)sMZ**2))' %\
1683 {'MW': mass.name,'prefix':prefix}, 'complex', mass.depend)
1684 Gf = self.get_parameter('%sGf'%prefix)
1685 self.get('parameters')[('external',)].remove(Gf)
1686 self.add_param(new_param, ['%saEW'%prefix])
1687 # Force a refresh of the parameter dictionary
1688 self.parameters_dict = None
1689 return True
1690 else:
1691 return False
1692
1693 def change_mass_to_complex_scheme(self, toCMS=True):
1617 """modify the expression changing the mass to complex mass scheme"""1694 """modify the expression changing the mass to complex mass scheme"""
1618 1695
1619 # 1) Find All input parameter mass and width associated1696 # 1) Change the 'CMSParam' of loop_qcd_qed model to 1.0 so as to remove
1697 # the 'real' prefix fromall UVCT wf renormalization expressions.
1698 # If toCMS is False, then it makes sure CMSParam is 0.0 and returns
1699 # immediatly.
1700 # 2) Find All input parameter mass and width associated
1620 # Add a internal parameter and replace mass with that param1701 # Add a internal parameter and replace mass with that param
1621 # 2) Find All mass fixed by the model and width associated1702 # 3) Find All mass fixed by the model and width associated
1622 # -> Both need to be fixed with a real() /Imag()1703 # -> Both need to be fixed with a real() /Imag()
1623 # 3) Find All width fixed by the model1704 # 4) Find All width set by the model
1624 # -> Need to be fixed with a real()1705 # -> Need to be set with a real()
1625 # 4) Fix the Yukawa mass to the value of the complex mass/ real mass1706 # 5) Fix the Yukawa mass to the value of the complex mass/ real mass
1626 # 5) Loop through all expression and modify those accordingly1707 # 6) Loop through all expression and modify those accordingly
1627 # Including all parameter expression as complex1708 # Including all parameter expression as complex
16281709
1710 try:
1711 CMSParam = self.get_parameter('CMSParam')
1712 except KeyError:
1713 try:
1714 CMSParam = self.get_parameter('mdl_CMSParam')
1715 except KeyError:
1716 CMSParam = None
1717
1718 # Handle the case where we want to make sure the CMS is turned off
1719 if not toCMS:
1720 if CMSParam:
1721 CMSParam.expr = '0.0'
1722 return
1723
1724 # Now handle the case where we want to turn to CMS.
1725 if CMSParam:
1726 CMSParam.expr = '1.0'
1727
1629 to_change = {}1728 to_change = {}
1630 mass_widths = [] # parameter which should stay real1729 mass_widths = [] # parameter which should stay real
1631 for particle in self.get('particles'):1730 for particle in self.get('particles'):
@@ -1634,52 +1733,29 @@
1634 continue1733 continue
1635 mass_widths.append(particle.get('width'))1734 mass_widths.append(particle.get('width'))
1636 mass_widths.append(particle.get('mass'))1735 mass_widths.append(particle.get('mass'))
1637 if particle.get('width') == 'ZERO':1736 width = self.get_parameter(particle.get('width'))
1737 if (isinstance(width.value, (complex,float)) and abs(width.value)==0.0) or \
1738 width.name.lower() =='zero':
1638 #everything is fine since the width is zero1739 #everything is fine since the width is zero
1639 continue1740 continue
1640 width = self.get_parameter(particle.get('width'))
1641 if not isinstance(width, ParamCardVariable):1741 if not isinstance(width, ParamCardVariable):
1642 width.expr = 're(%s)' % width.expr1742 width.expr = 're(%s)' % width.expr
1643 if particle.get('mass') != 'ZERO':1743 mass = self.get_parameter(particle.get('mass'))
1644 mass = self.get_parameter(particle.get('mass'))1744 if (isinstance(width.value, (complex,float)) and abs(width.value)!=0.0) or \
1745 mass.name.lower() != 'zero':
1645 # special SM treatment to change the gauge scheme automatically.1746 # special SM treatment to change the gauge scheme automatically.
1646 if particle.get('pdg_code') == 24:1747 if particle.get('pdg_code') == 24 and isinstance(mass,
1647 if hasattr(mass, 'expr') and mass.expr == 'cmath.sqrt(MZ__exp__2/2. + cmath.sqrt(MZ__exp__4/4. - (aEW*cmath.pi*MZ__exp__2)/(Gf*sqrt__2)))':1748 ModelVariable):
1648 # Make MW an external parameter1749 status = self.change_electroweak_mode(
1649 MW = ParamCardVariable(mass.name, mass.value, 'MASS', [24])1750 set(['mz','mw','alpha']))
1650 if not MW.value:1751 # Use the newly defined parameter for the W mass
1651 MW.value = 80.3851752 mass = self.get_parameter(particle.get('mass'))
1652 self.get('parameters')[('external',)].append(MW)1753 if not status:
1653 self.get('parameters')[mass.depend].remove(mass)1754 logger.warning('The W mass is not an external '+
1654 # Make Gf an internal parameter1755 'parameter in this model and the automatic change of'+
1655 new_param = ModelVariable('Gf',1756 ' electroweak scheme changed. This is not advised for '+
1656 '-aEW*MZ**2*cmath.pi/(cmath.sqrt(2)*%(MW)s**2*(%(MW)s**2 - MZ**2))' %\1757 'applying the complex mass scheme.')
1657 {'MW': mass.name}, 'complex', mass.depend)1758
1658 Gf = self.get_parameter('Gf')
1659 self.get('parameters')[('external',)].remove(Gf)
1660 self.add_param(new_param, ['aEW'])
1661 # Use the new mass for the future modification
1662 mass = MW
1663 #option with prefixing
1664 elif hasattr(mass, 'expr') and mass.expr == 'cmath.sqrt(mdl_MZ__exp__2/2. + cmath.sqrt(mdl_MZ__exp__4/4. - (mdl_aEW*cmath.pi*mdl_MZ__exp__2)/(mdl_Gf*mdl_sqrt__2)))':
1665 # Make MW an external parameter
1666 MW = ParamCardVariable(mass.name, mass.value, 'MASS', [24])
1667 if not MW.value:
1668 MW.value = 80.385
1669 self.get('parameters')[('external',)].append(MW)
1670 self.get('parameters')[mass.depend].remove(mass)
1671 # Make Gf an internal parameter
1672 new_param = ModelVariable('mdl_Gf',
1673 '-mdl_aEW*mdl_MZ**2*cmath.pi/(cmath.sqrt(2)*%(MW)s**2*(%(MW)s**2 - mdl_MZ**2))' %\
1674 {'MW': mass.name}, 'complex', mass.depend)
1675 Gf = self.get_parameter('mdl_Gf')
1676 self.get('parameters')[('external',)].remove(Gf)
1677 self.add_param(new_param, ['mdl_aEW'])
1678 # Use the new mass for the future modification
1679 mass = MW
1680 elif isinstance(mass, ModelVariable):
1681 logger.warning('W mass is not an external parameter. This is not adviced for the complex mass scheme.')
1682
1683 # Add A new parameter CMASS1759 # Add A new parameter CMASS
1684 #first compute the dependencies (as,...)1760 #first compute the dependencies (as,...)
1685 depend = list(set(mass.depend + width.depend))1761 depend = list(set(mass.depend + width.depend))
@@ -3638,7 +3714,7 @@
3638 my_isids = [leg.get('ids') for leg in self.get('legs') \3714 my_isids = [leg.get('ids') for leg in self.get('legs') \
3639 if not leg.get('state')]3715 if not leg.get('state')]
3640 my_fsids = [leg.get('ids') for leg in self.get('legs') \3716 my_fsids = [leg.get('ids') for leg in self.get('legs') \
3641 if leg.get('state')]3717 if leg.get('state')]
3642 for i, is_id in enumerate(initial_state_ids):3718 for i, is_id in enumerate(initial_state_ids):
3643 assert is_id in my_isids[i]3719 assert is_id in my_isids[i]
3644 for i, fs_id in enumerate(final_state_ids):3720 for i, fs_id in enumerate(final_state_ids):
36453721
=== modified file 'madgraph/core/color_algebra.py' (properties changed: -x to +x)
=== modified file 'madgraph/core/color_amp.py' (properties changed: -x to +x)
=== modified file 'madgraph/core/diagram_generation.py' (properties changed: -x to +x)
--- madgraph/core/diagram_generation.py 2015-06-28 14:44:22 +0000
+++ madgraph/core/diagram_generation.py 2015-10-25 15:32:18 +0000
@@ -26,7 +26,8 @@
2626
27import madgraph.core.base_objects as base_objects27import madgraph.core.base_objects as base_objects
28import madgraph.various.misc as misc28import madgraph.various.misc as misc
29from madgraph import InvalidCmd29from madgraph import InvalidCmd, MadGraph5Error
30
30logger = logging.getLogger('madgraph.diagram_generation')31logger = logging.getLogger('madgraph.diagram_generation')
3132
3233
@@ -1552,7 +1553,7 @@
1552 "%s is not a valid ProcessDefinitionList object" % str(value)1553 "%s is not a valid ProcessDefinitionList object" % str(value)
15531554
1554 if name == 'amplitudes':1555 if name == 'amplitudes':
1555 if not isinstance(value, diagram_generation.AmplitudeList):1556 if not isinstance(value, AmplitudeList):
1556 raise self.PhysicsObjectError, \1557 raise self.PhysicsObjectError, \
1557 "%s is not a valid AmplitudeList object" % str(value)1558 "%s is not a valid AmplitudeList object" % str(value)
15581559
15591560
=== modified file 'madgraph/core/drawing.py' (properties changed: -x to +x)
--- madgraph/core/drawing.py 2014-10-07 05:52:01 +0000
+++ madgraph/core/drawing.py 2015-10-25 15:32:18 +0000
@@ -1131,8 +1131,8 @@
1131 return []1131 return []
11321132
1133 assert self.min_level <= level <= self.max_level , \1133 assert self.min_level <= level <= self.max_level , \
1134 'Incorrect value of min/max level: %s <= %s <= %s' % \1134 'Incorrect value of min/max level: %s <= %s <= %s' % \
1135 (self.min_level, level, self.max_level) 1135 (self.min_level, level, self.max_level)
1136 1136
11371137
1138 # At final level we should authorize min=0 and max=1 position 1138 # At final level we should authorize min=0 and max=1 position
@@ -1188,7 +1188,7 @@
1188 # Assign position to each vertex1188 # Assign position to each vertex
1189 for i, vertex in enumerate(vertex_at_level):1189 for i, vertex in enumerate(vertex_at_level):
1190 vertex.def_position((level - self.min_level) / self.nb_level, 1190 vertex.def_position((level - self.min_level) / self.nb_level,
1191 min + dist * (begin_gap + i))1191 min + dist * (begin_gap + i))
11921192
1193 return vertex_at_level1193 return vertex_at_level
11941194
11951195
=== modified file 'madgraph/core/helas_objects.py' (properties changed: -x to +x)
--- madgraph/core/helas_objects.py 2015-07-02 02:29:22 +0000
+++ madgraph/core/helas_objects.py 2015-10-25 15:32:18 +0000
@@ -3164,7 +3164,7 @@
3164 """Calculate the actual coupling orders of this diagram"""3164 """Calculate the actual coupling orders of this diagram"""
31653165
3166 wavefunctions = HelasWavefunctionList.extract_wavefunctions(\3166 wavefunctions = HelasWavefunctionList.extract_wavefunctions(\
3167 self.get('amplitudes')[0].get('mothers'))3167 self.get('amplitudes')[0].get('mothers'))
31683168
3169 coupling_orders = {}3169 coupling_orders = {}
3170 for wf in wavefunctions + [self.get('amplitudes')[0]]:3170 for wf in wavefunctions + [self.get('amplitudes')[0]]:
31713171
=== modified file 'madgraph/fks/__init__.py' (properties changed: -x to +x)
=== modified file 'madgraph/fks/fks_base.py' (properties changed: -x to +x)
--- madgraph/fks/fks_base.py 2015-05-25 20:43:18 +0000
+++ madgraph/fks/fks_base.py 2015-10-25 15:32:18 +0000
@@ -132,6 +132,9 @@
132 perturbation = []132 perturbation = []
133 for procdef in self['process_definitions']:133 for procdef in self['process_definitions']:
134 soft_particles = []134 soft_particles = []
135 # do not warn for decay processes
136 if [ i['state'] for i in procdef['legs']].count(False) == 1:
137 continue
135 for pert in procdef['perturbation_couplings']:138 for pert in procdef['perturbation_couplings']:
136 if pert not in perturbation:139 if pert not in perturbation:
137 perturbation.append(pert)140 perturbation.append(pert)
@@ -550,10 +553,19 @@
550 """finds the FKS real configurations for a given process"""553 """finds the FKS real configurations for a given process"""
551 if range(len(self.leglist)) != [l['number']-1 for l in self.leglist]:554 if range(len(self.leglist)) != [l['number']-1 for l in self.leglist]:
552 raise fks_common.FKSProcessError('Disordered numbers of leglist')555 raise fks_common.FKSProcessError('Disordered numbers of leglist')
556
557 if [ i['state'] for i in self.leglist].count(False) == 1:
558 decay_process=True
559 else:
560 decay_process=False
561
553 for i in self.leglist:562 for i in self.leglist:
554 i_i = i['number'] - 1563 i_i = i['number'] - 1
555 self.reals.append([])564 self.reals.append([])
556 self.splittings[i_i] = fks_common.find_splittings(i, self.born_proc['model'], {}, pert_order)565 if decay_process and not i['state']:
566 self.splittings[i_i]=[]
567 else:
568 self.splittings[i_i] = fks_common.find_splittings(i, self.born_proc['model'], {}, pert_order)
557 for split in self.splittings[i_i]:569 for split in self.splittings[i_i]:
558 self.reals[i_i].append(570 self.reals[i_i].append(
559 fks_common.insert_legs(self.leglist, i, split,pert=pert_order))571 fks_common.insert_legs(self.leglist, i, split,pert=pert_order))
560572
=== modified file 'madgraph/fks/fks_common.py' (properties changed: -x to +x)
=== modified file 'madgraph/fks/fks_helas_objects.py' (properties changed: -x to +x)
=== modified file 'madgraph/interface/__init__.py' (properties changed: -x to +x)
=== modified file 'madgraph/interface/amcatnlo_interface.py' (properties changed: -x to +x)
--- madgraph/interface/amcatnlo_interface.py 2015-08-12 20:50:38 +0000
+++ madgraph/interface/amcatnlo_interface.py 2015-10-25 15:32:18 +0000
@@ -30,6 +30,7 @@
30import madgraph.interface.extended_cmd as cmd30import madgraph.interface.extended_cmd as cmd
31import madgraph.interface.madgraph_interface as mg_interface31import madgraph.interface.madgraph_interface as mg_interface
32import madgraph.interface.madevent_interface as me_interface32import madgraph.interface.madevent_interface as me_interface
33import madgraph.interface.extended_cmd as extended_cmd
33import madgraph.interface.amcatnlo_run_interface as run_interface34import madgraph.interface.amcatnlo_run_interface as run_interface
34import madgraph.interface.launch_ext_program as launch_ext35import madgraph.interface.launch_ext_program as launch_ext
35import madgraph.interface.loop_interface as Loop_interface36import madgraph.interface.loop_interface as Loop_interface
@@ -540,10 +541,22 @@
540 for me in self._curr_matrix_elements.get_matrix_elements():541 for me in self._curr_matrix_elements.get_matrix_elements():
541 uid += 1 # update the identification number542 uid += 1 # update the identification number
542 me.get('processes')[0].set('uid', uid)543 me.get('processes')[0].set('uid', uid)
544 try:
545 initial_states.append(sorted(list(set((p.get_initial_pdg(1),p.get_initial_pdg(2)) for \
546 p in me.born_matrix_element.get('processes')))))
547 except IndexError:
548 initial_states.append(sorted(list(set((p.get_initial_pdg(1)) for \
549 p in me.born_matrix_element.get('processes')))))
550
543 for fksreal in me.real_processes:551 for fksreal in me.real_processes:
544 # Pick out all initial state particles for the two beams552 # Pick out all initial state particles for the two beams
545 initial_states.append(sorted(list(set((p.get_initial_pdg(1),p.get_initial_pdg(2)) for \553 try:
546 p in fksreal.matrix_element.get('processes')))))554 initial_states.append(sorted(list(set((p.get_initial_pdg(1),p.get_initial_pdg(2)) for \
555 p in fksreal.matrix_element.get('processes')))))
556 except IndexError:
557 initial_states.append(sorted(list(set((p.get_initial_pdg(1)) for \
558 p in fksreal.matrix_element.get('processes')))))
559
547 560
548 # remove doubles from the list561 # remove doubles from the list
549 checked = []562 checked = []
@@ -569,10 +582,10 @@
569582
570 #_curr_matrix_element is a FKSHelasMultiProcess Object 583 #_curr_matrix_element is a FKSHelasMultiProcess Object
571 self._fks_directories = []584 self._fks_directories = []
572 proc_charac = banner_mod.ProcCharacteristic()585 proc_charac = self._curr_exporter.proc_characteristic
573 for charac in ['has_isr', 'has_fsr', 'has_loops']:586 for charac in ['has_isr', 'has_fsr', 'has_loops']:
574 proc_charac[charac] = self._curr_matrix_elements[charac]587 proc_charac[charac] = self._curr_matrix_elements[charac]
575 proc_charac.write(pjoin(path, 'proc_characteristics'))588
576589
577 for ime, me in \590 for ime, me in \
578 enumerate(self._curr_matrix_elements.get('matrix_elements')):591 enumerate(self._curr_matrix_elements.get('matrix_elements')):
@@ -624,7 +637,7 @@
624# self.options['automatic_html_opening'] = False637# self.options['automatic_html_opening'] = False
625638
626 if options['interactive']:639 if options['interactive']:
627 if hasattr(self, 'do_shell'):640 if isinstance(self, extended_cmd.CmdShell):
628 ME = run_interface.aMCatNLOCmdShell(me_dir=argss[0], options=self.options)641 ME = run_interface.aMCatNLOCmdShell(me_dir=argss[0], options=self.options)
629 else:642 else:
630 ME = run_interface.aMCatNLOCmd(me_dir=argss[0],options=self.options)643 ME = run_interface.aMCatNLOCmd(me_dir=argss[0],options=self.options)
@@ -636,7 +649,9 @@
636 stop = self.define_child_cmd_interface(ME) 649 stop = self.define_child_cmd_interface(ME)
637 return stop650 return stop
638651
639 ext_program = launch_ext.aMCatNLOLauncher(argss[0], self, run_mode=argss[1], **options)652 ext_program = launch_ext.aMCatNLOLauncher(argss[0], self, run_mode=argss[1],
653 shell = isinstance(self, extended_cmd.CmdShell),
654 **options)
640 ext_program.run()655 ext_program.run()
641 656
642 657
643658
=== modified file 'madgraph/interface/amcatnlo_run_interface.py' (properties changed: -x to +x)
--- madgraph/interface/amcatnlo_run_interface.py 2015-09-05 17:49:40 +0000
+++ madgraph/interface/amcatnlo_run_interface.py 2015-10-25 15:32:18 +0000
@@ -119,6 +119,11 @@
119 #this can be improved/better written to handle the output119 #this can be improved/better written to handle the output
120 misc.call(['./%s' % (test)], cwd=this_dir, 120 misc.call(['./%s' % (test)], cwd=this_dir,
121 stdin = open(input), stdout=open(pjoin(this_dir, '%s.log' % test), 'w'))121 stdin = open(input), stdout=open(pjoin(this_dir, '%s.log' % test), 'w'))
122 if test == 'check_poles' and os.path.exists(pjoin(this_dir,'MadLoop5_resources')) :
123 tf=tarfile.open(pjoin(this_dir,'MadLoop5_resources.tar.gz'),'w:gz',
124 dereference=True)
125 tf.add(pjoin(this_dir,'MadLoop5_resources'),arcname='MadLoop5_resources')
126 tf.close()
122 127
123 if not options['reweightonly']:128 if not options['reweightonly']:
124 misc.compile(['gensym'], cwd=this_dir, job_specs = False)129 misc.compile(['gensym'], cwd=this_dir, job_specs = False)
@@ -1155,7 +1160,7 @@
1155 functions, such as generate_events or calculate_xsect1160 functions, such as generate_events or calculate_xsect
1156 mode gives the list of switch needed for the computation (usefull for banner_run)1161 mode gives the list of switch needed for the computation (usefull for banner_run)
1157 """1162 """
1158 1163
1159 if not argss and not options:1164 if not argss and not options:
1160 self.start_time = time.time()1165 self.start_time = time.time()
1161 argss = self.split_arg(line)1166 argss = self.split_arg(line)
@@ -1164,6 +1169,7 @@
1164 options = options.__dict__1169 options = options.__dict__
1165 self.check_launch(argss, options)1170 self.check_launch(argss, options)
11661171
1172
1167 if 'run_name' in options.keys() and options['run_name']:1173 if 'run_name' in options.keys() and options['run_name']:
1168 self.run_name = options['run_name']1174 self.run_name = options['run_name']
1169 # if a dir with the given run_name already exists1175 # if a dir with the given run_name already exists
@@ -1183,6 +1189,7 @@
1183 1189
1184 if not switch:1190 if not switch:
1185 mode = argss[0]1191 mode = argss[0]
1192
1186 if mode in ['LO', 'NLO']:1193 if mode in ['LO', 'NLO']:
1187 options['parton'] = True1194 options['parton'] = True
1188 mode = self.ask_run_configuration(mode, options)1195 mode = self.ask_run_configuration(mode, options)
@@ -1202,7 +1209,7 @@
1202 self.compile(mode, options) 1209 self.compile(mode, options)
1203 evt_file = self.run(mode, options)1210 evt_file = self.run(mode, options)
1204 1211
1205 if int(self.run_card['nevents']) == 0 and not mode in ['LO', 'NLO']:1212 if self.run_card['nevents'] == 0 and not mode in ['LO', 'NLO']:
1206 logger.info('No event file generated: grids have been set-up with a '\1213 logger.info('No event file generated: grids have been set-up with a '\
1207 'relative precision of %s' % self.run_card['req_acc'])1214 'relative precision of %s' % self.run_card['req_acc'])
1208 return1215 return
@@ -1222,14 +1229,48 @@
12221229
12231230
1224 self.update_status('', level='all', update_results=True)1231 self.update_status('', level='all', update_results=True)
1225 if int(self.run_card['ickkw']) == 3 and mode in ['noshower', 'aMC@NLO']:1232 if self.run_card['ickkw'] == 3 and mode in ['noshower', 'aMC@NLO']:
1226 logger.warning("""You are running with FxFx merging enabled.1233 logger.warning("""You are running with FxFx merging enabled.
1227To be able to merge samples of various multiplicities without double counting,1234To be able to merge samples of various multiplicities without double counting,
1228you have to remove some events after showering 'by hand'.1235you have to remove some events after showering 'by hand'.
1229Please read http://amcatnlo.cern.ch/FxFx_merging.htm for more details.""")1236Please read http://amcatnlo.cern.ch/FxFx_merging.htm for more details.""")
12301237
12311238
12321239 #check if the param_card defines a scan.
1240 if self.param_card_iterator:
1241 param_card_iterator = self.param_card_iterator
1242 self.param_card_iterator = [] #avoid to next generate go trough here
1243 param_card_iterator.store_entry(self.run_name, self.results.current['cross'])
1244 orig_name = self.run_name
1245 #go trough the scal
1246 with misc.TMP_variable(self, 'allow_notification_center', False):
1247 for i,card in enumerate(param_card_iterator):
1248 card.write(pjoin(self.me_dir,'Cards','param_card.dat'))
1249 if not options['force']:
1250 options['force'] = True
1251 if options['run_name']:
1252 options['run_name'] = '%s_%s' % (orig_name, i+1)
1253 if not argss:
1254 argss = [mode, "-f"]
1255 elif argss[0] == "auto":
1256 argss[0] = mode
1257 self.do_launch("", options=options, argss=argss, switch=switch)
1258 #self.exec_cmd("launch -f ",precmd=True, postcmd=True,errorhandling=False)
1259 param_card_iterator.store_entry(self.run_name, self.results.current['cross'])
1260 #restore original param_card
1261 param_card_iterator.write(pjoin(self.me_dir,'Cards','param_card.dat'))
1262 name = misc.get_scan_name(orig_name, self.run_name)
1263 path = pjoin(self.me_dir, 'Events','scan_%s.txt' % name)
1264 logger.info("write all cross-section results in %s" % path, '$MG:color:BLACK')
1265 param_card_iterator.write_summary(path)
1266
1267 if self.allow_notification_center:
1268 misc.apple_notify('Run %s finished' % os.path.basename(self.me_dir),
1269 '%s: %s +- %s ' % (self.results.current['run_name'],
1270 self.results.current['cross'],
1271 self.results.current['error']))
1272
1273
1233 ############################################################################ 1274 ############################################################################
1234 def do_compile(self, line):1275 def do_compile(self, line):
1235 """Advanced commands: just compile the executables """1276 """Advanced commands: just compile the executables """
@@ -1248,59 +1289,11 @@
12481289
1249 self.update_status('', level='all', update_results=True)1290 self.update_status('', level='all', update_results=True)
12501291
1251 def print_results_in_shell(self, data):
1252 """Have a nice results prints in the shell,
1253 data should be of type: gen_crossxhtml.OneTagResults"""
1254 if not data:
1255 return
1256 logger.info(" === Results Summary for run: %s tag: %s ===\n" % (data['run_name'],data['tag']))
1257 if self.ninitial == 1:
1258 logger.info(" Width : %.4g +- %.4g GeV" % (data['cross'], data['error']))
1259 else:
1260 logger.info(" Cross-section : %.4g +- %.4g pb" % (data['cross'], data['error']))
1261 logger.info(" Nb of events : %s" % data['nb_event'] )
1262 #if data['cross_pythia'] and data['nb_event_pythia']:
1263 # if self.ninitial == 1:
1264 # logger.info(" Matched Width : %.4g +- %.4g GeV" % (data['cross_pythia'], data['error_pythia']))
1265 # else:
1266 # logger.info(" Matched Cross-section : %.4g +- %.4g pb" % (data['cross_pythia'], data['error_pythia']))
1267 # logger.info(" Nb of events after Matching : %s" % data['nb_event_pythia'])
1268 # if self.run_card['use_syst'] in self.true:
1269 # logger.info(" Be carefull that matched information are here NOT for the central value. Refer to SysCalc output for it")
1270 logger.info(" " )
1271
1272 def print_results_in_file(self, data, path, mode='w'):
1273 """Have a nice results prints in the shell,
1274 data should be of type: gen_crossxhtml.OneTagResults"""
1275 if not data:
1276 return
1277
1278 fsock = open(path, mode)
1279
1280 fsock.write(" === Results Summary for run: %s tag: %s process: %s ===\n" % \
1281 (data['run_name'],data['tag'], os.path.basename(self.me_dir)))
1282
1283 if self.ninitial == 1:
1284 fsock.write(" Width : %.4g +- %.4g GeV\n" % (data['cross'], data['error']))
1285 else:
1286 fsock.write(" Cross-section : %.4g +- %.4g pb\n" % (data['cross'], data['error']))
1287 fsock.write(" Nb of events : %s\n" % data['nb_event'] )
1288 #if data['cross_pythia'] and data['nb_event_pythia']:
1289 # if self.ninitial == 1:
1290 # fsock.write(" Matched Width : %.4g +- %.4g GeV\n" % (data['cross_pythia'], data['error_pythia']))
1291 # else:
1292 # fsock.write(" Matched Cross-section : %.4g +- %.4g pb\n" % (data['cross_pythia'], data['error_pythia']))
1293 # fsock.write(" Nb of events after Matching : %s\n" % data['nb_event_pythia'])
1294 fsock.write(" \n" )
1295
1296
1297
1298
12991292
1300 def update_random_seed(self):1293 def update_random_seed(self):
1301 """Update random number seed with the value from the run_card. 1294 """Update random number seed with the value from the run_card.
1302 If this is 0, update the number according to a fresh one"""1295 If this is 0, update the number according to a fresh one"""
1303 iseed = int(self.run_card['iseed'])1296 iseed = self.run_card['iseed']
1304 if iseed == 0:1297 if iseed == 0:
1305 randinit = open(pjoin(self.me_dir, 'SubProcesses', 'randinit'))1298 randinit = open(pjoin(self.me_dir, 'SubProcesses', 'randinit'))
1306 iseed = int(randinit.read()[2:]) + 11299 iseed = int(randinit.read()[2:]) + 1
@@ -1317,206 +1310,95 @@
1317 if not 'only_generation' in options.keys():1310 if not 'only_generation' in options.keys():
1318 options['only_generation'] = False1311 options['only_generation'] = False
13191312
1313 # for second step in applgrid mode, do only the event generation step
1320 if mode in ['LO', 'NLO'] and self.run_card['iappl'] == 2 and not options['only_generation']:1314 if mode in ['LO', 'NLO'] and self.run_card['iappl'] == 2 and not options['only_generation']:
1321 options['only_generation'] = True1315 options['only_generation'] = True
1322 self.get_characteristics(pjoin(self.me_dir, 'SubProcesses', 'proc_characteristics'))1316 self.get_characteristics(pjoin(self.me_dir, 'SubProcesses', 'proc_characteristics'))
13231317 self.setup_cluster_or_multicore()
1324 if self.cluster_mode == 1:
1325 cluster_name = self.options['cluster_type']
1326 self.cluster = cluster.from_name[cluster_name](**self.options)
1327 if self.cluster_mode == 2:
1328 try:
1329 import multiprocessing
1330 if not self.nb_core:
1331 try:
1332 self.nb_core = int(self.options['nb_core'])
1333 except TypeError:
1334 self.nb_core = multiprocessing.cpu_count()
1335 logger.info('Using %d cores' % self.nb_core)
1336 except ImportError:
1337 self.nb_core = 1
1338 logger.warning('Impossible to detect the number of cores => Using One.\n'+
1339 'Use set nb_core X in order to set this number and be able to'+
1340 'run in multicore.')
1341
1342 self.cluster = cluster.MultiCore(**self.options)
1343 self.update_random_seed()1318 self.update_random_seed()
1344 #find and keep track of all the jobs1319 #find and keep track of all the jobs
1345 folder_names = {'LO': ['born_G*'], 'NLO': ['all_G*'],1320 folder_names = {'LO': ['born_G*'], 'NLO': ['all_G*'],
1346 'aMC@LO': ['GB*'], 'aMC@NLO': ['GF*']}1321 'aMC@LO': ['GB*'], 'aMC@NLO': ['GF*']}
1347 folder_names['noshower'] = folder_names['aMC@NLO']1322 folder_names['noshower'] = folder_names['aMC@NLO']
1348 folder_names['noshowerLO'] = folder_names['aMC@LO']1323 folder_names['noshowerLO'] = folder_names['aMC@LO']
1349 job_dict = {}
1350 p_dirs = [d for d in \1324 p_dirs = [d for d in \
1351 open(pjoin(self.me_dir, 'SubProcesses', 'subproc.mg')).read().split('\n') if d]1325 open(pjoin(self.me_dir, 'SubProcesses', 'subproc.mg')).read().split('\n') if d]
1352 #find jobs and clean previous results1326 #Clean previous results
1353 if not options['only_generation'] and not options['reweightonly']:1327 self.clean_previous_results(options,p_dirs,folder_names[mode])
1354 self.update_status('Cleaning previous results', level=None)1328
1355 for dir in p_dirs:1329 mcatnlo_status = ['Setting up grids', 'Computing upper envelope', 'Generating events']
1356 job_dict[dir] = [file for file in \1330
1357 os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \
1358 if file.startswith('ajob')]
1359 #find old folders to be removed
1360 for obj in folder_names[mode]:
1361 to_rm = [file for file in \
1362 os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \
1363 if file.startswith(obj[:-1]) and \
1364 (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \
1365 os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))]
1366 #always clean dirs for the splitted event generation
1367 # do not include the born_G/ grid_G which should be kept when
1368 # doing a f.o. run keeping old grids
1369 to_always_rm = [file for file in \
1370 os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \
1371 if file.startswith(obj[:-1]) and
1372 '_' in file and not '_G' in file and \
1373 (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \
1374 os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))]
1375
1376 if not options['only_generation'] and not options['reweightonly']:
1377 to_always_rm.extend(to_rm)
1378 if os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz')):
1379 to_always_rm.append(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz'))
1380 files.rm([pjoin(self.me_dir, 'SubProcesses', dir, d) for d in to_always_rm])
1381
1382 mcatnlo_status = ['Setting up grid', 'Computing upper envelope', 'Generating events']
1383
1384 if self.run_card['iappl'] == 2:
1385 self.applgrid_distribute(options,mode,p_dirs)
13861331
1387 if options['reweightonly']:1332 if options['reweightonly']:
1388 event_norm=self.run_card['event_norm']1333 event_norm=self.run_card['event_norm']
1389 nevents=int(self.run_card['nevents'])1334 nevents=self.run_card['nevents']
1390 return self.reweight_and_collect_events(options, mode, nevents, event_norm)1335 return self.reweight_and_collect_events(options, mode, nevents, event_norm)
13911336
1392 devnull = os.open(os.devnull, os.O_RDWR) 1337 devnull = os.open(os.devnull, os.O_RDWR)
1338
1393 if mode in ['LO', 'NLO']:1339 if mode in ['LO', 'NLO']:
1394 # this is for fixed order runs1340 # this is for fixed order runs
1395 mode_dict = {'NLO': 'all', 'LO': 'born'}1341 mode_dict = {'NLO': 'all', 'LO': 'born'}
1396 logger.info('Doing fixed order %s' % mode)1342 logger.info('Doing fixed order %s' % mode)
1397 req_acc = self.run_card['req_acc_FO']1343 req_acc = self.run_card['req_acc_FO']
1398 if not options['only_generation'] and req_acc != -1:1344
1399 self.write_madin_file(pjoin(self.me_dir, 'SubProcesses'), mode_dict[mode], 0, '-1', '6','0.10') 1345 # Re-distribute the grids for the 2nd step of the applgrid
1400 self.update_status('Setting up grids', level=None)1346 # running
1401 self.run_all(job_dict, [['0', mode_dict[mode], '0']], 'Setting up grids')1347 if self.run_card['iappl'] == 2:
1402 elif not options['only_generation']:1348 self.applgrid_distribute(options,mode_dict[mode],p_dirs)
1403 npoints = self.run_card['npoints_FO_grid']1349
1404 niters = self.run_card['niters_FO_grid']1350 # create a list of dictionaries "jobs_to_run" with all the
1405 self.write_madin_file(pjoin(self.me_dir, 'SubProcesses'), mode_dict[mode], 0, npoints, niters) 1351 # jobs that need to be run
1406 self.update_status('Setting up grids', level=None)1352 integration_step=-1
1407 self.run_all(job_dict, [['0', mode_dict[mode], '0']], 'Setting up grids')1353 jobs_to_run,jobs_to_collect,integration_step = self.create_jobs_to_run(options,p_dirs, \
14081354 req_acc,mode_dict[mode],integration_step,mode,fixed_order=True)
1409 npoints = self.run_card['npoints_FO']1355 self.prepare_directories(jobs_to_run,mode)
1410 niters = self.run_card['niters_FO']1356
1411 self.write_madin_file(pjoin(self.me_dir, 'SubProcesses'), mode_dict[mode], -1, npoints, niters) 1357 # loop over the integration steps. After every step, check
1412 # collect the results and logs1358 # if we have the required accuracy. If this is the case,
1413 self.collect_log_files(folder_names[mode], 0)1359 # stop running, else do another step.
1414 p = misc.Popen(['./combine_results_FO.sh', str(req_acc), '%s_G*' % mode_dict[mode]], \1360 while True:
1415 stdout=subprocess.PIPE, \1361 integration_step=integration_step+1
1416 cwd=pjoin(self.me_dir, 'SubProcesses'))1362 self.run_all_jobs(jobs_to_run,integration_step)
1417 output = p.communicate()1363 self.collect_log_files(jobs_to_run,integration_step)
14181364 jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run, \
1419 self.cross_sect_dict = self.read_results(output, mode)1365 jobs_to_collect,integration_step,mode,mode_dict[mode])
1420 self.print_summary(options, 0, mode)1366 if not jobs_to_run:
1421 cross, error = sum_html.make_all_html_results(self, ['%s*' % mode_dict[mode]])1367 # there are no more jobs to run (jobs_to_run is empty)
1422 self.results.add_detail('cross', cross)1368 break
1423 self.results.add_detail('error', error) 1369 # We are done.
14241370 self.finalise_run_FO(folder_names[mode],jobs_to_collect)
1425 self.update_status('Computing cross-section', level=None)
1426 self.run_all(job_dict, [['0', mode_dict[mode], '0', mode_dict[mode]]], 'Computing cross-section')
1427
1428 # collect the results and logs
1429 self.collect_log_files(folder_names[mode], 1)
1430 p = misc.Popen(['./combine_results_FO.sh', '-1'] + folder_names[mode], \
1431 stdout=subprocess.PIPE,
1432 cwd=pjoin(self.me_dir, 'SubProcesses'))
1433 output = p.communicate()
1434 self.cross_sect_dict = self.read_results(output, mode)
1435
1436 # collect the scale and PDF uncertainties
1437 scale_pdf_info={}
1438 if self.run_card['reweight_scale'] or self.run_card['reweight_PDF']:
1439 data_files=[]
1440 for dir in p_dirs:
1441 for obj in folder_names[mode]:
1442 for file in os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)):
1443 if file.startswith(obj[:-1]) and \
1444 (os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file,'scale_pdf_dependence.dat'))):
1445 data_files.append(pjoin(dir,file,'scale_pdf_dependence.dat'))
1446 scale_pdf_info = self.pdf_scale_from_reweighting(data_files)
1447 # print the results:
1448 self.print_summary(options, 1, mode, scale_pdf_info)
1449
1450 files.cp(pjoin(self.me_dir, 'SubProcesses', 'res.txt'),
1451 pjoin(self.me_dir, 'Events', self.run_name))
1452
1453 if self.analyse_card['fo_analysis_format'].lower() == 'topdrawer':
1454 misc.call(['./combine_plots_FO.sh'] + folder_names[mode], \
1455 stdout=devnull,
1456 cwd=pjoin(self.me_dir, 'SubProcesses'))
1457 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.top'),
1458 pjoin(self.me_dir, 'Events', self.run_name))
1459 logger.info('The results of this run and the TopDrawer file with the plots' + \
1460 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1461 elif self.analyse_card['fo_analysis_format'].lower() == 'hwu':
1462 self.combine_plots_HwU(folder_names[mode])
1463 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.HwU'),
1464 pjoin(self.me_dir, 'Events', self.run_name))
1465 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.gnuplot'),
1466 pjoin(self.me_dir, 'Events', self.run_name))
1467 try:
1468 misc.call(['gnuplot','MADatNLO.gnuplot'],\
1469 stdout=os.open(os.devnull, os.O_RDWR),\
1470 stderr=os.open(os.devnull, os.O_RDWR),\
1471 cwd=pjoin(self.me_dir, 'Events', self.run_name))
1472 except Exception:
1473 pass
1474
1475
1476 logger.info('The results of this run and the HwU and GnuPlot files with the plots' + \
1477 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1478 elif self.analyse_card['fo_analysis_format'].lower() == 'root':
1479 misc.call(['./combine_root.sh'] + folder_names[mode], \
1480 stdout=devnull,
1481 cwd=pjoin(self.me_dir, 'SubProcesses'))
1482 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.root'),
1483 pjoin(self.me_dir, 'Events', self.run_name))
1484 logger.info('The results of this run and the ROOT file with the plots' + \
1485 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1486 else:
1487 logger.info('The results of this run' + \
1488 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1489
1490 cross, error = sum_html.make_all_html_results(self, folder_names[mode])
1491 self.results.add_detail('cross', cross)
1492 self.results.add_detail('error', error)
1493 if self.run_card['iappl'] != 0:
1494 self.applgrid_combine(cross,error)
1495 self.update_status('Run complete', level='parton', update_results=True)1371 self.update_status('Run complete', level='parton', update_results=True)
1496
1497 return1372 return
14981373
1499 elif mode in ['aMC@NLO','aMC@LO','noshower','noshowerLO']:1374 elif mode in ['aMC@NLO','aMC@LO','noshower','noshowerLO']:
1375 if self.ninitial == 1:
1376 raise aMCatNLOError('Decay processes can only be run at fixed order.')
1377 mode_dict = {'aMC@NLO': 'all', 'aMC@LO': 'born',\
1378 'noshower': 'all', 'noshowerLO': 'born'}
1500 shower = self.run_card['parton_shower'].upper()1379 shower = self.run_card['parton_shower'].upper()
1501 nevents = int(self.run_card['nevents'])1380 nevents = self.run_card['nevents']
1502 req_acc = self.run_card['req_acc']1381 req_acc = self.run_card['req_acc']
1503 if nevents == 0 and float(req_acc) < 0 :1382 if nevents == 0 and req_acc < 0 :
1504 raise aMCatNLOError('Cannot determine the required accuracy from the number '\1383 raise aMCatNLOError('Cannot determine the required accuracy from the number '\
1505 'of events, because 0 events requested. Please set '\1384 'of events, because 0 events requested. Please set '\
1506 'the "req_acc" parameter in the run_card to a value between 0 and 1')1385 'the "req_acc" parameter in the run_card to a value '\
1507 elif float(req_acc) >1 or float(req_acc) == 0 :1386 'between 0 and 1')
1387 elif req_acc >1 or req_acc == 0 :
1508 raise aMCatNLOError('Required accuracy ("req_acc" in the run_card) should '\1388 raise aMCatNLOError('Required accuracy ("req_acc" in the run_card) should '\
1509 'be between larger than 0 and smaller than 1, '\1389 'be between larger than 0 and smaller than 1, '\
1510 'or set to -1 for automatic determination. Current value is %s' % req_acc)1390 'or set to -1 for automatic determination. Current '\
1391 'value is %f' % req_acc)
1511# For more than 1M events, set req_acc to 0.001 (except when it was explicitly set in the run_card)1392# For more than 1M events, set req_acc to 0.001 (except when it was explicitly set in the run_card)
1512 elif float(req_acc) < 0 and nevents > 1000000 :1393 elif req_acc < 0 and nevents > 1000000 :
1513 req_acc='0.001'1394 req_acc=0.001
15141395
1515 shower_list = ['HERWIG6', 'HERWIGPP', 'PYTHIA6Q', 'PYTHIA6PT', 'PYTHIA8']1396 shower_list = ['HERWIG6', 'HERWIGPP', 'PYTHIA6Q', 'PYTHIA6PT', 'PYTHIA8']
15161397
1517 if not shower in shower_list:1398 if not shower in shower_list:
1518 raise aMCatNLOError('%s is not a valid parton shower. Please use one of the following: %s' \1399 raise aMCatNLOError('%s is not a valid parton shower. '\
1519 % (shower, ', '.join(shower_list)))1400 'Please use one of the following: %s' \
1401 % (shower, ', '.join(shower_list)))
15201402
1521# check that PYTHIA6PT is not used for processes with FSR1403# check that PYTHIA6PT is not used for processes with FSR
1522 if shower == 'PYTHIA6PT' and self.proc_characteristics['has_fsr']:1404 if shower == 'PYTHIA6PT' and self.proc_characteristics['has_fsr']:
@@ -1529,98 +1411,556 @@
1529 elif options['only_generation']:1411 elif options['only_generation']:
1530 logger.info('Generating events starting from existing results')1412 logger.info('Generating events starting from existing results')
1531 1413
15321414 jobs_to_run,jobs_to_collect,integration_step = self.create_jobs_to_run(options,p_dirs, \
1533 for i, status in enumerate(mcatnlo_status):1415 req_acc,mode_dict[mode],1,mode,fixed_order=False)
1534 #check if need to split jobs 1416
1535 # at least one channel must have enough events1417 # Make sure to update all the jobs to be ready for the event generation step
1536 try:1418 if options['only_generation']:
1537 nevents_unweighted = open(pjoin(self.me_dir, 1419 jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run, \
1538 'SubProcesses', 1420 jobs_to_collect,1,mode,mode_dict[mode],fixed_order=False)
1539 'nevents_unweighted')).read().split('\n')1421 else:
1540 except IOError:1422 self.prepare_directories(jobs_to_run,mode,fixed_order=False)
1541 nevents_unweighted = []1423
15421424
1543 split = i == 2 and \1425 # Main loop over the three MINT generation steps:
1544 int(self.run_card['nevt_job']) > 0 1426 for mint_step, status in enumerate(mcatnlo_status):
15451427 if options['only_generation'] and mint_step < 2:
1546 if i == 2 or not options['only_generation']:1428 continue
1547 # if the number of events requested is zero,1429 self.update_status(status, level='parton')
1548 # skip mint step 21430 self.run_all_jobs(jobs_to_run,mint_step,fixed_order=False)
1549 if i==2 and nevents==0:1431 self.collect_log_files(jobs_to_run,mint_step)
1550 self.print_summary(options, 2,mode)1432 if mint_step+1==2 and nevents==0:
1551 return1433 self.print_summary(options,2,mode)
15521434 return
1553 if split:1435 jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run, \
1554 # split the event generation1436 jobs_to_collect,mint_step,mode,mode_dict[mode],fixed_order=False)
1555 misc.call([pjoin(self.me_dir, 'bin', 'internal', 'split_jobs.py')] + \1437 # Sanity check on the event files. If error the jobs are resubmitted
1556 [str(self.run_card['nevt_job'])],1438 self.check_event_files(jobs_to_collect)
1557 stdout = devnull,1439
1558 cwd = pjoin(self.me_dir, 'SubProcesses'))1440 if self.cluster_mode == 1:
1559 assert os.path.exists(pjoin(self.me_dir, 'SubProcesses', 1441 #if cluster run, wait 10 sec so that event files are transferred back
1560 'nevents_unweighted_splitted'))1442 self.update_status(
1561
1562 self.update_status(status, level='parton')
1563 if mode in ['aMC@NLO', 'noshower']:
1564 self.write_madinMMC_file(pjoin(self.me_dir, 'SubProcesses'), 'all', i)
1565 self.run_all(job_dict, [['2', 'F', '%d' % i]], status, split_jobs = split)
1566
1567 elif mode in ['aMC@LO', 'noshowerLO']:
1568 self.write_madinMMC_file(
1569 pjoin(self.me_dir, 'SubProcesses'), 'born', i)
1570 self.run_all(job_dict,
1571 [['2', 'B', '%d' % i]],
1572 '%s at LO' % status, split_jobs = split)
1573
1574 if (i < 2 and not options['only_generation']) or i == 1 :
1575 # collect the results and logs
1576 self.collect_log_files(folder_names[mode], i)
1577 p = misc.Popen(['./combine_results.sh'] + \
1578 ['%d' % i,'%d' % nevents, '%s' % req_acc ] + \
1579 folder_names[mode],
1580 stdout=subprocess.PIPE,
1581 cwd = pjoin(self.me_dir, 'SubProcesses'))
1582 output = p.communicate()
1583 files.cp(pjoin(self.me_dir, 'SubProcesses', 'res_%d.txt' % i), \
1584 pjoin(self.me_dir, 'Events', self.run_name))
1585
1586 self.cross_sect_dict = self.read_results(output, mode)
1587 self.print_summary(options, i, mode)
1588
1589 cross, error = sum_html.make_all_html_results(self, folder_names[mode])
1590 self.results.add_detail('cross', cross)
1591 self.results.add_detail('error', error)
1592
1593 #check that split jobs are all correctly terminated
1594 if split:
1595 self.check_event_files()
1596
1597 if self.cluster_mode == 1:
1598 #if cluster run, wait 15 sec so that event files are transferred back
1599 self.update_status(
1600 'Waiting while files are transferred back from the cluster nodes',1443 'Waiting while files are transferred back from the cluster nodes',
1601 level='parton')1444 level='parton')
1602 time.sleep(10)1445 time.sleep(10)
1603 if split:1446
1604 files.cp(pjoin(self.me_dir, 'SubProcesses', 'nevents_unweighted_splitted'), \1447 event_norm=self.run_card['event_norm']
1605 pjoin(self.me_dir, 'SubProcesses', 'nevents_unweighted'))1448 return self.reweight_and_collect_events(options, mode, nevents, event_norm)
16061449
16071450 def create_jobs_to_run(self,options,p_dirs,req_acc,run_mode,\
1608 event_norm=self.run_card['event_norm']1451 integration_step,mode,fixed_order=True):
1609 self.collect_log_files(folder_names[mode], 2)1452 """Creates a list of dictionaries with all the jobs to be run"""
1610 return self.reweight_and_collect_events(options, mode, nevents, event_norm)1453 jobs_to_run=[]
16111454 if not options['only_generation']:
1612 def combine_plots_HwU(self,folder_names):1455 # Fresh, new run. Check all the P*/channels.txt files
1456 # (created by the 'gensym' executable) to set-up all the
1457 # jobs using the default inputs.
1458 npoints = self.run_card['npoints_FO_grid']
1459 niters = self.run_card['niters_FO_grid']
1460 for p_dir in p_dirs:
1461 try:
1462 with open(pjoin(self.me_dir,'SubProcesses',p_dir,'channels.txt')) as chan_file:
1463 channels=chan_file.readline().split()
1464 except IOError:
1465 logger.warning('No integration channels found for contribution %s' % p_dir)
1466 continue
1467 for channel in channels:
1468 job={}
1469 job['p_dir']=p_dir
1470 job['channel']=channel
1471 job['split']=0
1472 if fixed_order and req_acc == -1:
1473 job['accuracy']=0
1474 job['niters']=niters
1475 job['npoints']=npoints
1476 elif fixed_order and req_acc > 0:
1477 job['accuracy']=0.10
1478 job['niters']=6
1479 job['npoints']=-1
1480 elif not fixed_order:
1481 job['accuracy']=0.03
1482 job['niters']=12
1483 job['npoints']=-1
1484 else:
1485 raise aMCatNLOError('No consistent "req_acc_FO" set. Use a value '+
1486 'between 0 and 1 or set it equal to -1.')
1487 job['mint_mode']=0
1488 job['run_mode']=run_mode
1489 job['wgt_frac']=1.0
1490 jobs_to_run.append(job)
1491 jobs_to_collect=copy.copy(jobs_to_run) # These are all jobs
1492 else:
1493 # if options['only_generation'] is true, we need to loop
1494 # over all the existing G* directories and create the jobs
1495 # from there.
1496 name_suffix={'born' :'B', 'all':'F'}
1497 for p_dir in p_dirs:
1498 for chan_dir in os.listdir(pjoin(self.me_dir,'SubProcesses',p_dir)):
1499 if ((chan_dir.startswith(run_mode+'_G') and fixed_order) or\
1500 (chan_dir.startswith('G'+name_suffix[run_mode]) and (not fixed_order))) and \
1501 (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', p_dir, chan_dir)) or \
1502 os.path.exists(pjoin(self.me_dir, 'SubProcesses', p_dir, chan_dir))):
1503 job={}
1504 job['p_dir']=p_dir
1505 if fixed_order:
1506 channel=chan_dir.split('_')[1]
1507 job['channel']=channel[1:] # remove the 'G'
1508 if len(chan_dir.split('_')) == 3:
1509 split=int(chan_dir.split('_')[2])
1510 else:
1511 split=0
1512 else:
1513 if len(chan_dir.split('_')) == 2:
1514 split=int(chan_dir.split('_')[1])
1515 channel=chan_dir.split('_')[0]
1516 job['channel']=channel[2:] # remove the 'G'
1517 else:
1518 job['channel']=chan_dir[2:] # remove the 'G'
1519 split=0
1520 job['split']=split
1521 job['run_mode']=run_mode
1522 job['dirname']=pjoin(self.me_dir, 'SubProcesses', p_dir, chan_dir)
1523 job['wgt_frac']=1.0
1524 if not fixed_order: job['mint_mode']=1
1525 jobs_to_run.append(job)
1526 jobs_to_collect=copy.copy(jobs_to_run) # These are all jobs
1527 if fixed_order:
1528 jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run,
1529 jobs_to_collect,integration_step,mode,run_mode)
1530 # Update the integration_step to make sure that nothing will be overwritten
1531 integration_step=1
1532 for job in jobs_to_run:
1533 while os.path.exists(pjoin(job['dirname'],'res_%s.dat' % integration_step)):
1534 integration_step=integration_step+1
1535 integration_step=integration_step-1
1536 else:
1537 self.append_the_results(jobs_to_collect,integration_step)
1538 return jobs_to_run,jobs_to_collect,integration_step
1539
1540 def prepare_directories(self,jobs_to_run,mode,fixed_order=True):
1541 """Set-up the G* directories for running"""
1542 name_suffix={'born' :'B' , 'all':'F'}
1543 for job in jobs_to_run:
1544 if job['split'] == 0:
1545 if fixed_order :
1546 dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'],
1547 job['run_mode']+'_G'+job['channel'])
1548 else:
1549 dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'],
1550 'G'+name_suffix[job['run_mode']]+job['channel'])
1551 else:
1552 if fixed_order :
1553 dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'],
1554 job['run_mode']+'_G'+job['channel']+'_'+str(job['split']))
1555 else:
1556 dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'],
1557 'G'+name_suffix[job['run_mode']]+job['channel']+'_'+str(job['split']))
1558 job['dirname']=dirname
1559 if not os.path.isdir(dirname):
1560 os.makedirs(dirname)
1561 self.write_input_file(job,fixed_order)
1562 if not fixed_order:
1563 # copy the grids from the base directory to the split directory:
1564 if job['split'] != 0:
1565 for f in ['grid.MC_integer','mint_grids','res_1']:
1566 if not os.path.isfile(pjoin(job['dirname'],f)):
1567 files.ln(pjoin(job['dirname'].rsplit("_",1)[0],f),job['dirname'])
1568
1569
1570 def write_input_file(self,job,fixed_order):
1571 """write the input file for the madevent_mint* executable in the appropriate directory"""
1572 if fixed_order:
1573 content= \
1574"""NPOINTS = %(npoints)s
1575NITERATIONS = %(niters)s
1576ACCURACY = %(accuracy)s
1577ADAPT_GRID = 2
1578MULTICHANNEL = 1
1579SUM_HELICITY = 1
1580CHANNEL = %(channel)s
1581SPLIT = %(split)s
1582RUN_MODE = %(run_mode)s
1583RESTART = %(mint_mode)s
1584""" \
1585 % job
1586 else:
1587 content = \
1588"""-1 12 ! points, iterations
1589%(accuracy)s ! desired fractional accuracy
15901 -0.1 ! alpha, beta for Gsoft
1591-1 -0.1 ! alpha, beta for Gazi
15921 ! Suppress amplitude (0 no, 1 yes)?
15931 ! Exact helicity sum (0 yes, n = number/event)?
1594%(channel)s ! Enter Configuration Number:
1595%(mint_mode)s ! MINT imode: 0 to set-up grids, 1 to perform integral, 2 generate events
15961 1 1 ! if imode is 1: Folding parameters for xi_i, phi_i and y_ij
1597%(run_mode)s ! all, born, real, virt
1598""" \
1599 % job
1600 with open(pjoin(job['dirname'], 'input_app.txt'), 'w') as input_file:
1601 input_file.write(content)
1602
1603
1604 def run_all_jobs(self,jobs_to_run,integration_step,fixed_order=True):
1605 """Loops over the jobs_to_run and executes them using the function 'run_exe'"""
1606 if fixed_order:
1607 if integration_step == 0:
1608 self.update_status('Setting up grids', level=None)
1609 else:
1610 self.update_status('Refining results, step %i' % integration_step, level=None)
1611 self.ijob = 0
1612 name_suffix={'born' :'B', 'all':'F'}
1613 if fixed_order:
1614 run_type="Fixed order integration step %s" % integration_step
1615 else:
1616 run_type="MINT step %s" % integration_step
1617 for job in jobs_to_run:
1618 executable='ajob1'
1619 if fixed_order:
1620 arguments=[job['channel'],job['run_mode'], \
1621 str(job['split']),str(integration_step)]
1622 else:
1623 arguments=[job['channel'],name_suffix[job['run_mode']], \
1624 str(job['split']),str(integration_step)]
1625 self.run_exe(executable,arguments,run_type,
1626 cwd=pjoin(self.me_dir,'SubProcesses',job['p_dir']))
1627
1628 if self.cluster_mode == 2:
1629 time.sleep(1) # security to allow all jobs to be launched
1630 self.njobs=len(jobs_to_run)
1631 self.wait_for_complete(run_type)
1632
1633
1634 def collect_the_results(self,options,req_acc,jobs_to_run,jobs_to_collect,\
1635 integration_step,mode,run_mode,fixed_order=True):
1636 """Collect the results, make HTML pages, print the summary and
1637 determine if there are more jobs to run. Returns the list
1638 of the jobs that still need to be run, as well as the
1639 complete list of jobs that need to be collected to get the
1640 final answer.
1641 """
1642# Get the results of the current integration/MINT step
1643 self.append_the_results(jobs_to_run,integration_step)
1644 self.cross_sect_dict = self.write_res_txt_file(jobs_to_collect,integration_step)
1645# Update HTML pages
1646 if fixed_order:
1647 cross, error = sum_html.make_all_html_results(self, ['%s*' % run_mode])
1648 else:
1649 name_suffix={'born' :'B' , 'all':'F'}
1650 cross, error = sum_html.make_all_html_results(self, ['G%s*' % name_suffix[run_mode]])
1651 self.results.add_detail('cross', cross)
1652 self.results.add_detail('error', error)
1653# Set-up jobs for the next iteration/MINT step
1654 jobs_to_run_new=self.update_jobs_to_run(req_acc,integration_step,jobs_to_run,fixed_order)
1655 # if there are no more jobs, we are done!
1656# Print summary
1657 if (not jobs_to_run_new) and fixed_order:
1658 # print final summary of results (for fixed order)
1659 scale_pdf_info=self.collect_scale_pdf_info(options,jobs_to_collect)
1660 self.print_summary(options,integration_step,mode,scale_pdf_info,done=True)
1661 return jobs_to_run_new,jobs_to_collect
1662 elif jobs_to_run_new:
1663 # print intermediate summary of results
1664 scale_pdf_info={}
1665 self.print_summary(options,integration_step,mode,scale_pdf_info,done=False)
1666 else:
1667 # When we are done for (N)LO+PS runs, do not print
1668 # anything yet. This will be done after the reweighting
1669 # and collection of the events
1670 scale_pdf_info={}
1671# Prepare for the next integration/MINT step
1672 if (not fixed_order) and integration_step+1 == 2 :
1673 # next step is event generation (mint_step 2)
1674 jobs_to_run_new,jobs_to_collect_new= \
1675 self.check_the_need_to_split(jobs_to_run_new,jobs_to_collect)
1676 self.prepare_directories(jobs_to_run_new,mode,fixed_order)
1677 self.write_nevents_unweighted_file(jobs_to_collect_new)
1678 self.write_nevts_files(jobs_to_run_new)
1679 else:
1680 self.prepare_directories(jobs_to_run_new,mode,fixed_order)
1681 jobs_to_collect_new=jobs_to_collect
1682 return jobs_to_run_new,jobs_to_collect_new
1683
1684
1685 def write_nevents_unweighted_file(self,jobs):
1686 """writes the nevents_unweighted file in the SubProcesses directory"""
1687 content=[]
1688 for job in jobs:
1689 path=pjoin(job['dirname'].split('/')[-2],job['dirname'].split('/')[-1])
1690 lhefile=pjoin(path,'events.lhe')
1691 content.append(' %s %d %9e %9e' % \
1692 (lhefile.ljust(40),job['nevents'],job['resultABS']*job['wgt_frac'],job['wgt_frac']))
1693 with open(pjoin(self.me_dir,'SubProcesses',"nevents_unweighted"),'w') as f:
1694 f.write('\n'.join(content)+'\n')
1695
1696 def write_nevts_files(self,jobs):
1697 """write the nevts files in the SubProcesses/P*/G*/ directories"""
1698 for job in jobs:
1699 with open(pjoin(job['dirname'],'nevts'),'w') as f:
1700 f.write('%i\n' % job['nevents'])
1701
1702 def check_the_need_to_split(self,jobs_to_run,jobs_to_collect):
1703 """Looks in the jobs_to_run to see if there is the need to split the
1704 event generation step. Updates jobs_to_run and
1705 jobs_to_collect to replace the split-job by its
1706 splits. Also removes jobs that do not need any events.
1707 """
1708 nevt_job=self.run_card['nevt_job']
1709 if nevt_job > 0:
1710 jobs_to_collect_new=copy.copy(jobs_to_collect)
1711 for job in jobs_to_run:
1712 nevents=job['nevents']
1713 if nevents == 0:
1714 jobs_to_collect_new.remove(job)
1715 elif nevents > nevt_job:
1716 jobs_to_collect_new.remove(job)
1717 if nevents % nevt_job != 0 :
1718 nsplit=int(nevents/nevt_job)+1
1719 else:
1720 nsplit=int(nevents/nevt_job)
1721 for i in range(1,nsplit+1):
1722 job_new=copy.copy(job)
1723 left_over=nevents % nsplit
1724 if i <= left_over:
1725 job_new['nevents']=int(nevents/nsplit)+1
1726 job_new['wgt_frac']=float(job_new['nevents'])/float(nevents)
1727 else:
1728 job_new['nevents']=int(nevents/nsplit)
1729 job_new['wgt_frac']=float(job_new['nevents'])/float(nevents)
1730 job_new['split']=i
1731 job_new['dirname']=job['dirname']+'_%i' % job_new['split']
1732 jobs_to_collect_new.append(job_new)
1733 jobs_to_run_new=copy.copy(jobs_to_collect_new)
1734 else:
1735 jobs_to_run_new=copy.copy(jobs_to_collect)
1736 for job in jobs_to_collect:
1737 if job['nevents'] == 0:
1738 jobs_to_run_new.remove(job)
1739 jobs_to_collect_new=copy.copy(jobs_to_run_new)
1740
1741 return jobs_to_run_new,jobs_to_collect_new
1742
1743
1744 def update_jobs_to_run(self,req_acc,step,jobs,fixed_order=True):
1745 """
1746 For (N)LO+PS: determines the number of events and/or the required
1747 accuracy per job.
1748 For fixed order: determines which jobs need higher precision and
1749 returns those with the newly requested precision.
1750 """
1751 err=self.cross_sect_dict['errt']
1752 tot=self.cross_sect_dict['xsect']
1753 errABS=self.cross_sect_dict['erra']
1754 totABS=self.cross_sect_dict['xseca']
1755 jobs_new=[]
1756 if fixed_order:
1757 if req_acc == -1:
1758 if step+1 == 1:
1759 npoints = self.run_card['npoints_FO']
1760 niters = self.run_card['niters_FO']
1761 for job in jobs:
1762 job['mint_mode']=-1
1763 job['niters']=niters
1764 job['npoints']=npoints
1765 jobs_new.append(job)
1766 elif step+1 == 2:
1767 pass
1768 elif step+1 > 2:
1769 raise aMCatNLOError('Cannot determine number of iterations and PS points '+
1770 'for integration step %i' % step )
1771 elif ( req_acc > 0 and err/tot > req_acc*1.2 ) or step == 0:
1772 req_accABS=req_acc*abs(tot)/totABS # overal relative required accuracy on ABS Xsec.
1773 for job in jobs:
1774 job['mint_mode']=-1
1775 # Determine relative required accuracy on the ABS for this job
1776 job['accuracy']=req_accABS*math.sqrt(totABS/job['resultABS'])
1777 # If already accurate enough, skip running
1778 if job['accuracy'] > job['errorABS']/job['resultABS'] and step != 0:
1779 continue
1780 # Update the number of PS points based on errorABS, ncall and accuracy
1781 itmax_fl=job['niters_done']*math.pow(job['errorABS']/
1782 (job['accuracy']*job['resultABS']),2)
1783 if itmax_fl <= 4.0 :
1784 job['niters']=max(int(round(itmax_fl)),2)
1785 job['npoints']=job['npoints_done']*2
1786 elif itmax_fl > 4.0 and itmax_fl <= 16.0 :
1787 job['niters']=4
1788 job['npoints']=int(round(job['npoints_done']*itmax_fl/4.0))*2
1789 else:
1790 if itmax_fl > 100.0 : itmax_fl=50.0
1791 job['niters']=int(round(math.sqrt(itmax_fl)))
1792 job['npoints']=int(round(job['npoints_done']*itmax_fl/
1793 round(math.sqrt(itmax_fl))))*2
1794 # Add the job to the list of jobs that need to be run
1795 jobs_new.append(job)
1796 return jobs_new
1797 elif step+1 <= 2:
1798 nevents=self.run_card['nevents']
1799 # Total required accuracy for the upper bounding envelope
1800 if req_acc<0:
1801 req_acc2_inv=nevents
1802 else:
1803 req_acc2_inv=1/(req_acc*req_acc)
1804 if step+1 == 1 or step+1 == 2 :
1805 # determine the req. accuracy for each of the jobs for Mint-step = 1
1806 for job in jobs:
1807 accuracy=min(math.sqrt(totABS/(req_acc2_inv*job['resultABS'])),0.2)
1808 job['accuracy']=accuracy
1809 if step+1 == 2:
1810 # Randomly (based on the relative ABS Xsec of the job) determine the
1811 # number of events each job needs to generate for MINT-step = 2.
1812 r=self.get_randinit_seed()
1813 random.seed(r)
1814 totevts=nevents
1815 for job in jobs:
1816 job['nevents'] = 0
1817 while totevts :
1818 target = random.random() * totABS
1819 crosssum = 0.
1820 i = 0
1821 while i<len(jobs) and crosssum < target:
1822 job = jobs[i]
1823 crosssum += job['resultABS']
1824 i += 1
1825 totevts -= 1
1826 i -= 1
1827 jobs[i]['nevents'] += 1
1828 for job in jobs:
1829 job['mint_mode']=step+1 # next step
1830 return jobs
1831 else:
1832 return []
1833
1834
1835 def get_randinit_seed(self):
1836 """ Get the random number seed from the randinit file """
1837 with open(pjoin(self.me_dir,"SubProcesses","randinit")) as randinit:
1838 # format of the file is "r=%d".
1839 iseed = int(randinit.read()[2:])
1840 return iseed
1841
1842
1843 def append_the_results(self,jobs,integration_step):
1844 """Appends the results for each of the jobs in the job list"""
1845 error_found=False
1846 for job in jobs:
1847 try:
1848 if integration_step >= 0 :
1849 with open(pjoin(job['dirname'],'res_%s.dat' % integration_step)) as res_file:
1850 results=res_file.readline().split()
1851 else:
1852 # should only be here when doing fixed order with the 'only_generation'
1853 # option equal to True. Take the results from the final run done.
1854 with open(pjoin(job['dirname'],'res.dat')) as res_file:
1855 results=res_file.readline().split()
1856 except IOError:
1857 if not error_found:
1858 error_found=True
1859 error_log=[]
1860 error_log.append(pjoin(job['dirname'],'log.txt'))
1861 continue
1862 job['resultABS']=float(results[0])
1863 job['errorABS']=float(results[1])
1864 job['result']=float(results[2])
1865 job['error']=float(results[3])
1866 job['niters_done']=int(results[4])
1867 job['npoints_done']=int(results[5])
1868 job['time_spend']=float(results[6])
1869 job['err_percABS'] = job['errorABS']/job['resultABS']*100.
1870 job['err_perc'] = job['error']/job['result']*100.
1871 if error_found:
1872 raise aMCatNLOError('An error occurred during the collection of results.\n' +
1873 'Please check the .log files inside the directories which failed:\n' +
1874 '\n'.join(error_log)+'\n')
1875
1876
1877
1878 def write_res_txt_file(self,jobs,integration_step):
1879 """writes the res.txt files in the SubProcess dir"""
1880 jobs.sort(key = lambda job: -job['errorABS'])
1881 content=[]
1882 content.append('\n\nCross-section per integration channel:')
1883 for job in jobs:
1884 content.append('%(p_dir)20s %(channel)15s %(result)10.8e %(error)6.4e %(err_perc)6.4f%% ' % job)
1885 content.append('\n\nABS cross-section per integration channel:')
1886 for job in jobs:
1887 content.append('%(p_dir)20s %(channel)15s %(resultABS)10.8e %(errorABS)6.4e %(err_percABS)6.4f%% ' % job)
1888 totABS=0
1889 errABS=0
1890 tot=0
1891 err=0
1892 for job in jobs:
1893 totABS+= job['resultABS']
1894 errABS+= math.pow(job['errorABS'],2)
1895 tot+= job['result']
1896 err+= math.pow(job['error'],2)
1897 if jobs:
1898 content.append('\nTotal ABS and \nTotal: \n %10.8e +- %6.4e (%6.4e%%)\n %10.8e +- %6.4e (%6.4e%%) \n' %\
1899 (totABS, math.sqrt(errABS), math.sqrt(errABS)/totABS *100.,\
1900 tot, math.sqrt(err), math.sqrt(err)/tot *100.))
1901 with open(pjoin(self.me_dir,'SubProcesses','res_%s.txt' % integration_step),'w') as res_file:
1902 res_file.write('\n'.join(content))
1903 randinit=self.get_randinit_seed()
1904 return {'xsect':tot,'xseca':totABS,'errt':math.sqrt(err),\
1905 'erra':math.sqrt(errABS),'randinit':randinit}
1906
1907
1908 def collect_scale_pdf_info(self,options,jobs):
1909 """read the scale_pdf_dependence.dat files and collects there results"""
1910 scale_pdf_info={}
1911 if self.run_card['reweight_scale'] or self.run_card['reweight_PDF']:
1912 data_files=[]
1913 for job in jobs:
1914 data_files.append(pjoin(job['dirname'],'scale_pdf_dependence.dat'))
1915 scale_pdf_info = self.pdf_scale_from_reweighting(data_files)
1916 return scale_pdf_info
1917
1918
1919 def combine_plots_FO(self,folder_name,jobs):
1920 """combines the plots and puts then in the Events/run* directory"""
1921 devnull = os.open(os.devnull, os.O_RDWR)
1922 if self.analyse_card['fo_analysis_format'].lower() == 'topdrawer':
1923 misc.call(['./combine_plots_FO.sh'] + folder_name, \
1924 stdout=devnull,
1925 cwd=pjoin(self.me_dir, 'SubProcesses'))
1926 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.top'),
1927 pjoin(self.me_dir, 'Events', self.run_name))
1928 logger.info('The results of this run and the TopDrawer file with the plots' + \
1929 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1930 elif self.analyse_card['fo_analysis_format'].lower() == 'hwu':
1931 self.combine_plots_HwU(jobs)
1932 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.HwU'),
1933 pjoin(self.me_dir, 'Events', self.run_name))
1934 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.gnuplot'),
1935 pjoin(self.me_dir, 'Events', self.run_name))
1936 try:
1937 misc.call(['gnuplot','MADatNLO.gnuplot'],\
1938 stdout=devnull,stderr=devnull,\
1939 cwd=pjoin(self.me_dir, 'Events', self.run_name))
1940 except Exception:
1941 pass
1942 logger.info('The results of this run and the HwU and GnuPlot files with the plots' + \
1943 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1944 elif self.analyse_card['fo_analysis_format'].lower() == 'root':
1945 misc.call(['./combine_root.sh'] + folder_name, \
1946 stdout=devnull,
1947 cwd=pjoin(self.me_dir, 'SubProcesses'))
1948 files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.root'),
1949 pjoin(self.me_dir, 'Events', self.run_name))
1950 logger.info('The results of this run and the ROOT file with the plots' + \
1951 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1952 else:
1953 logger.info('The results of this run' + \
1954 ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name))
1955
1956
1957 def combine_plots_HwU(self,jobs):
1613 """Sums all the plots in the HwU format."""1958 """Sums all the plots in the HwU format."""
1614
1615 logger.debug('Combining HwU plots.')1959 logger.debug('Combining HwU plots.')
1616 1960 all_histo_paths=[]
1617 with open(pjoin(self.me_dir,'SubProcesses','dirs.txt')) as dirf:1961 for job in jobs:
1618 all_histo_paths = dirf.readlines()1962 all_histo_paths.append(pjoin(job['dirname'],"MADatNLO.HwU"))
1619 all_histo_paths = [pjoin(self.me_dir,'SubProcesses',
1620 path.rstrip(),"MADatNLO.HwU") for path in all_histo_paths]
1621
1622 histogram_list = histograms.HwUList(all_histo_paths[0])1963 histogram_list = histograms.HwUList(all_histo_paths[0])
1623
1624 for histo_path in all_histo_paths[1:]:1964 for histo_path in all_histo_paths[1:]:
1625 for i, histo in enumerate(histograms.HwUList(histo_path)):1965 for i, histo in enumerate(histograms.HwUList(histo_path)):
1626 # First make sure the plots have the same weight labels and such1966 # First make sure the plots have the same weight labels and such
@@ -1632,19 +1972,18 @@
1632 histogram_list.output(pjoin(self.me_dir,'SubProcesses',"MADatNLO"),1972 histogram_list.output(pjoin(self.me_dir,'SubProcesses',"MADatNLO"),
1633 format = 'gnuplot')1973 format = 'gnuplot')
16341974
1635 def applgrid_combine(self,cross,error):1975 def applgrid_combine(self,cross,error,jobs):
1636 """Combines the APPLgrids in all the SubProcess/P*/all_G*/ directories"""1976 """Combines the APPLgrids in all the SubProcess/P*/all_G*/ directories"""
1637 logger.debug('Combining APPLgrids \n')1977 logger.debug('Combining APPLgrids \n')
1638 applcomb=pjoin(self.options['applgrid'].rstrip('applgrid-config'),1978 applcomb=pjoin(self.options['applgrid'].rstrip('applgrid-config'),
1639 'applgrid-combine')1979 'applgrid-combine')
1640 with open(pjoin(self.me_dir,'SubProcesses','dirs.txt')) as dirf:1980 all_jobs=[]
1641 all_jobs=dirf.readlines()1981 for job in jobs:
1982 all_jobs.append(job['dirname'])
1642 ngrids=len(all_jobs)1983 ngrids=len(all_jobs)
1643 nobs =len([name for name in os.listdir(pjoin(self.me_dir,'SubProcesses',1984 nobs =len([name for name in os.listdir(all_jobs[0]) if name.endswith("_out.root")])
1644 all_jobs[0].rstrip())) if name.endswith("_out.root")])
1645 for obs in range(0,nobs):1985 for obs in range(0,nobs):
1646 gdir = [pjoin(self.me_dir,'SubProcesses',job.rstrip(),"grid_obs_"+1986 gdir = [pjoin(job,"grid_obs_"+str(obs)+"_out.root") for job in all_jobs]
1647 str(obs)+"_out.root") for job in all_jobs]
1648 # combine APPLgrids from different channels for observable 'obs'1987 # combine APPLgrids from different channels for observable 'obs'
1649 if self.run_card["iappl"] == 1:1988 if self.run_card["iappl"] == 1:
1650 misc.call([applcomb,'-o', pjoin(self.me_dir,"Events",self.run_name,1989 misc.call([applcomb,'-o', pjoin(self.me_dir,"Events",self.run_name,
@@ -1656,8 +1995,7 @@
1656 self.run_name,"aMCfast_obs_"+str(obs)+".root"),'-s',1995 self.run_name,"aMCfast_obs_"+str(obs)+".root"),'-s',
1657 str(unc2_inv),'--weight',str(unc2_inv)]+ gdir)1996 str(unc2_inv),'--weight',str(unc2_inv)]+ gdir)
1658 for job in all_jobs:1997 for job in all_jobs:
1659 os.remove(pjoin(self.me_dir,'SubProcesses',job.rstrip(),1998 os.remove(pjoin(job,"grid_obs_"+str(obs)+"_in.root"))
1660 "grid_obs_"+str(obs)+"_in.root"))
1661 else:1999 else:
1662 raise aMCatNLOError('iappl parameter can only be 0, 1 or 2')2000 raise aMCatNLOError('iappl parameter can only be 0, 1 or 2')
1663 # after combining, delete the original grids2001 # after combining, delete the original grids
@@ -1698,14 +2036,10 @@
1698 if not hasattr(self, 'appl_start_grid') or not self.appl_start_grid:2036 if not hasattr(self, 'appl_start_grid') or not self.appl_start_grid:
1699 raise self.InvalidCmd('No APPLgrid name currently defined.'+2037 raise self.InvalidCmd('No APPLgrid name currently defined.'+
1700 'Please provide this information.') 2038 'Please provide this information.')
1701 if mode == 'NLO':
1702 gdir='all_G'
1703 elif mode == 'LO':
1704 gdir='born_G'
1705 #copy the grid to all relevant directories2039 #copy the grid to all relevant directories
1706 for pdir in p_dirs:2040 for pdir in p_dirs:
1707 g_dirs = [file for file in os.listdir(pjoin(self.me_dir,2041 g_dirs = [file for file in os.listdir(pjoin(self.me_dir,
1708 "SubProcesses",pdir)) if file.startswith(gdir) and 2042 "SubProcesses",pdir)) if file.startswith(mode+'_G') and
1709 os.path.isdir(pjoin(self.me_dir,"SubProcesses",pdir, file))]2043 os.path.isdir(pjoin(self.me_dir,"SubProcesses",pdir, file))]
1710 for g_dir in g_dirs:2044 for g_dir in g_dirs:
1711 for grid in all_grids:2045 for grid in all_grids:
@@ -1714,28 +2048,20 @@
1714 'grid_obs_'+obs+'_in.root'))2048 'grid_obs_'+obs+'_in.root'))
17152049
17162050
1717 def collect_log_files(self, folders, istep):2051
2052
2053 def collect_log_files(self, jobs, integration_step):
1718 """collect the log files and put them in a single, html-friendly file2054 """collect the log files and put them in a single, html-friendly file
1719 inside the run_... directory"""2055 inside the Events/run_.../ directory"""
1720 step_list = ['Grid setting', 'Cross-section computation',
1721 'Event generation']
1722 log_file = pjoin(self.me_dir, 'Events', self.run_name, 2056 log_file = pjoin(self.me_dir, 'Events', self.run_name,
1723 'alllogs_%d.html' % istep)2057 'alllogs_%d.html' % integration_step)
1724 # this keeps track of which step has been computed for which channel2058 outfile = open(log_file, 'w')
1725 channel_dict = {}
1726 log_files = []
1727 for folder in folders:
1728 log_files += glob.glob(pjoin(self.me_dir, 'SubProcesses', 'P*',
1729 folder, 'log.txt'))
17302059
1731 content = ''2060 content = ''
1732
1733 outfile = open(log_file, 'w')
1734
1735 content += '<HTML><BODY>\n<font face="courier" size=2>'2061 content += '<HTML><BODY>\n<font face="courier" size=2>'
1736 for log in log_files:2062 for job in jobs:
1737 channel_dict[os.path.dirname(log)] = [istep]
1738 # put an anchor2063 # put an anchor
2064 log=pjoin(job['dirname'],'log_MINT%s.txt' % integration_step)
1739 content += '<a name=%s></a>\n' % (os.path.dirname(log).replace(2065 content += '<a name=%s></a>\n' % (os.path.dirname(log).replace(
1740 pjoin(self.me_dir,'SubProcesses'),''))2066 pjoin(self.me_dir,'SubProcesses'),''))
1741 # and put some nice header2067 # and put some nice header
@@ -1743,7 +2069,7 @@
1743 content += '<br>LOG file for integration channel %s, %s <br>' % \2069 content += '<br>LOG file for integration channel %s, %s <br>' % \
1744 (os.path.dirname(log).replace(pjoin(self.me_dir,2070 (os.path.dirname(log).replace(pjoin(self.me_dir,
1745 'SubProcesses'), ''), 2071 'SubProcesses'), ''),
1746 step_list[istep])2072 integration_step)
1747 content += '</font>\n'2073 content += '</font>\n'
1748 #then just flush the content of the small log inside the big log2074 #then just flush the content of the small log inside the big log
1749 #the PRE tag prints everything verbatim2075 #the PRE tag prints everything verbatim
@@ -1756,53 +2082,80 @@
1756 outfile.close()2082 outfile.close()
17572083
17582084
1759 def read_results(self, output, mode):2085 def finalise_run_FO(self,folder_name,jobs):
1760 """extract results (cross-section, absolute cross-section and errors)2086 """Combine the plots and put the res*.txt files in the Events/run.../ folder."""
1761 from output, which should be formatted as2087 # Copy the res_*.txt files to the Events/run* folder
1762 Found 4 correctly terminated jobs 2088 res_files=glob.glob(pjoin(self.me_dir, 'SubProcesses', 'res_*.txt'))
1763 random seed found in 'randinit' is 332089 for res_file in res_files:
1764 Integrated abs(cross-section)2090 files.mv(res_file,pjoin(self.me_dir, 'Events', self.run_name))
1765 7.94473937e+03 +- 2.9953e+01 (3.7702e-01%)2091 # Collect the plots and put them in the Events/run* folder
1766 Integrated cross-section2092 self.combine_plots_FO(folder_name,jobs)
1767 6.63392298e+03 +- 3.7669e+01 (5.6782e-01%)2093 # If doing the applgrid-stuff, also combine those grids
1768 for aMC@NLO/aMC@LO, and as2094 # and put those in the Events/run* folder
17692095 if self.run_card['iappl'] != 0:
1770 for NLO/LO2096 cross=self.cross_sect_dict['xsect']
1771 The cross_sect_dict is returned"""2097 error=self.cross_sect_dict['errt']
1772 res = {}2098 self.applgrid_combine(cross,error,jobs)
1773 if mode in ['aMC@LO', 'aMC@NLO', 'noshower', 'noshowerLO']:2099
1774 pat = re.compile(\2100
1775'''Found (\d+) correctly terminated jobs 2101 def setup_cluster_or_multicore(self):
1776random seed found in 'randinit' is (\d+)2102 """setup the number of cores for multicore, and the cluster-type for cluster runs"""
1777Integrated abs\(cross-section\)2103 if self.cluster_mode == 1:
1778\s*(\d+\.\d+e[+-]\d+) \+\- (\d+\.\d+e[+-]\d+) \((\d+\.\d+e[+-]\d+)\%\)2104 cluster_name = self.options['cluster_type']
1779Integrated cross-section2105 self.cluster = cluster.from_name[cluster_name](**self.options)
1780\s*(\-?\d+\.\d+e[+-]\d+) \+\- (\d+\.\d+e[+-]\d+) \((\-?\d+\.\d+e[+-]\d+)\%\)''')2106 if self.cluster_mode == 2:
1781 else:2107 try:
1782 pat = re.compile(\2108 import multiprocessing
1783'''Found (\d+) correctly terminated jobs 2109 if not self.nb_core:
1784\s*(\-?\d+\.\d+e[+-]\d+) \+\- (\d+\.\d+e[+-]\d+) \((\-?\d+\.\d+e[+-]\d+)\%\)''')2110 try:
1785 pass2111 self.nb_core = int(self.options['nb_core'])
17862112 except TypeError:
1787 match = re.search(pat, output[0])2113 self.nb_core = multiprocessing.cpu_count()
1788 if not match or output[1]:2114 logger.info('Using %d cores' % self.nb_core)
1789 logger.info('Return code of the event collection: '+str(output[1]))2115 except ImportError:
1790 logger.info('Output of the event collection:\n'+output[0])2116 self.nb_core = 1
1791 raise aMCatNLOError('An error occurred during the collection of results.\n' + 2117 logger.warning('Impossible to detect the number of cores => Using One.\n'+
1792 'Please check the .log files inside the directories which failed.')2118 'Use set nb_core X in order to set this number and be able to'+
1793# if int(match.groups()[0]) != self.njobs:2119 'run in multicore.')
1794# raise aMCatNLOError('Not all jobs terminated successfully')2120
1795 if mode in ['aMC@LO', 'aMC@NLO', 'noshower', 'noshowerLO']:2121 self.cluster = cluster.MultiCore(**self.options)
1796 return {'randinit' : int(match.groups()[1]),2122
1797 'xseca' : float(match.groups()[2]),2123
1798 'erra' : float(match.groups()[3]),2124 def clean_previous_results(self,options,p_dirs,folder_name):
1799 'xsect' : float(match.groups()[5]),2125 """Clean previous results.
1800 'errt' : float(match.groups()[6])}2126 o. If doing only the reweighting step, do not delete anything and return directlty.
1801 else:2127 o. Always remove all the G*_* files (from split event generation).
1802 return {'xsect' : float(match.groups()[1]),2128 o. Remove the G* (or born_G* or all_G*) only when NOT doing only_generation or reweight_only."""
1803 'errt' : float(match.groups()[2])}2129 if options['reweightonly']:
18042130 return
1805 def print_summary(self, options, step, mode, scale_pdf_info={}):2131 if not options['only_generation']:
2132 self.update_status('Cleaning previous results', level=None)
2133 for dir in p_dirs:
2134 #find old folders to be removed
2135 for obj in folder_name:
2136 # list all the G* (or all_G* or born_G*) directories
2137 to_rm = [file for file in \
2138 os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \
2139 if file.startswith(obj[:-1]) and \
2140 (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \
2141 os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))]
2142 # list all the G*_* directories (from split event generation)
2143 to_always_rm = [file for file in \
2144 os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \
2145 if file.startswith(obj[:-1]) and
2146 '_' in file and not '_G' in file and \
2147 (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \
2148 os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))]
2149
2150 if not options['only_generation']:
2151 to_always_rm.extend(to_rm)
2152 if os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz')):
2153 to_always_rm.append(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz'))
2154 files.rm([pjoin(self.me_dir, 'SubProcesses', dir, d) for d in to_always_rm])
2155 return
2156
2157
2158 def print_summary(self, options, step, mode, scale_pdf_info={}, done=True):
1806 """print a summary of the results contained in self.cross_sect_dict.2159 """print a summary of the results contained in self.cross_sect_dict.
1807 step corresponds to the mintMC step, if =2 (i.e. after event generation)2160 step corresponds to the mintMC step, if =2 (i.e. after event generation)
1808 some additional infos are printed"""2161 some additional infos are printed"""
@@ -1813,25 +2166,35 @@
1813 if line.startswith('generate') or line.startswith('add process'):2166 if line.startswith('generate') or line.startswith('add process'):
1814 process = process+(line.replace('generate ', '')).replace('add process ','')+' ; '2167 process = process+(line.replace('generate ', '')).replace('add process ','')+' ; '
1815 lpp = {0:'l', 1:'p', -1:'pbar'}2168 lpp = {0:'l', 1:'p', -1:'pbar'}
1816 proc_info = '\n Process %s\n Run at %s-%s collider (%s + %s GeV)' % \2169 if self.ninitial == 1:
1817 (process[:-3], lpp[self.run_card['lpp1']], lpp[self.run_card['lpp2']], 2170 proc_info = '\n Process %s' % process[:-3]
1818 self.run_card['ebeam1'], self.run_card['ebeam2'])2171 else:
1819 2172 proc_info = '\n Process %s\n Run at %s-%s collider (%s + %s GeV)' % \
2173 (process[:-3], lpp[self.run_card['lpp1']], lpp[self.run_card['lpp2']],
2174 self.run_card['ebeam1'], self.run_card['ebeam2'])
2175
2176 if self.ninitial == 1:
2177 self.cross_sect_dict['unit']='GeV'
2178 self.cross_sect_dict['xsec_string']='(Partial) decay width'
2179 self.cross_sect_dict['axsec_string']='(Partial) abs(decay width)'
2180 else:
2181 self.cross_sect_dict['unit']='pb'
2182 self.cross_sect_dict['xsec_string']='Total cross-section'
2183 self.cross_sect_dict['axsec_string']='Total abs(cross-section)'
1820 # Gather some basic statistics for the run and extracted from the log files.2184 # Gather some basic statistics for the run and extracted from the log files.
1821 if mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']: 2185 if mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']:
1822 log_GV_files = glob.glob(pjoin(self.me_dir, \2186 log_GV_files = glob.glob(pjoin(self.me_dir, \
1823 'SubProcesses', 'P*','G*','log_MINT*.txt'))2187 'SubProcesses', 'P*','G*','log_MINT*.txt'))
1824 all_log_files = glob.glob(pjoin(self.me_dir, \2188 all_log_files = log_GV_files
1825 'SubProcesses', 'P*','G*','log*.txt'))
1826 elif mode == 'NLO':2189 elif mode == 'NLO':
1827 log_GV_files = glob.glob(pjoin(self.me_dir, \2190 log_GV_files = glob.glob(pjoin(self.me_dir, \
1828 'SubProcesses', 'P*','all_G*','log*.txt'))2191 'SubProcesses', 'P*','all_G*','log_MINT*.txt'))
1829 all_log_files = sum([glob.glob(pjoin(self.me_dir,'SubProcesses', 'P*',2192 all_log_files = log_GV_files
1830 '%sG*'%foldName,'log*.txt')) for foldName in ['all_']],[])2193
1831 elif mode == 'LO':2194 elif mode == 'LO':
1832 log_GV_files = ''2195 log_GV_files = ''
1833 all_log_files = sum([glob.glob(pjoin(self.me_dir,'SubProcesses', 'P*',2196 all_log_files = glob.glob(pjoin(self.me_dir, \
1834 '%sG*'%foldName,'log*.txt')) for foldName in ['born_']],[])2197 'SubProcesses', 'P*','born_G*','log_MINT*.txt'))
1835 else:2198 else:
1836 raise aMCatNLOError, 'Running mode %s not supported.'%mode2199 raise aMCatNLOError, 'Running mode %s not supported.'%mode
1837 2200
@@ -1843,13 +2206,13 @@
1843 if step != 2:2206 if step != 2:
1844 message = status[step] + '\n\n Intermediate results:' + \2207 message = status[step] + '\n\n Intermediate results:' + \
1845 ('\n Random seed: %(randinit)d' + \2208 ('\n Random seed: %(randinit)d' + \
1846 '\n Total cross-section: %(xsect)8.3e +- %(errt)6.1e pb' + \2209 '\n %(xsec_string)s: %(xsect)8.3e +- %(errt)6.1e %(unit)s' + \
1847 '\n Total abs(cross-section): %(xseca)8.3e +- %(erra)6.1e pb \n') \2210 '\n %(axsec_string)s: %(xseca)8.3e +- %(erra)6.1e %(unit)s \n') \
1848 % self.cross_sect_dict2211 % self.cross_sect_dict
1849 else:2212 else:
1850 2213
1851 message = '\n ' + status[step] + proc_info + \2214 message = '\n ' + status[step] + proc_info + \
1852 '\n Total cross-section: %(xsect)8.3e +- %(errt)6.1e pb' % \2215 '\n %(xsec_string)s: %(xsect)8.3e +- %(errt)6.1e %(unit)s' % \
1853 self.cross_sect_dict2216 self.cross_sect_dict
18542217
1855 if self.run_card['nevents']>=10000 and self.run_card['reweight_scale']:2218 if self.run_card['nevents']>=10000 and self.run_card['reweight_scale']:
@@ -1874,18 +2237,22 @@
1874 misc.format_timer(time.time()-self.start_time))2237 misc.format_timer(time.time()-self.start_time))
18752238
1876 elif mode in ['NLO', 'LO']:2239 elif mode in ['NLO', 'LO']:
1877 status = ['Results after grid setup (cross-section is non-physical):',2240 status = ['Results after grid setup:','Current results:',
1878 'Final results and run summary:']2241 'Final results and run summary:']
1879 if step == 0:2242 if (not done) and (step == 0):
1880 message = '\n ' + status[step] + \2243 message = '\n ' + status[0] + \
1881 '\n Total cross-section: %(xsect)8.3e +- %(errt)6.1e pb' % \2244 '\n %(xsec_string)s: %(xsect)8.3e +- %(errt)6.1e %(unit)s' % \
1882 self.cross_sect_dict2245 self.cross_sect_dict
1883 elif step == 1:2246 elif not done:
1884 message = '\n ' + status[step] + proc_info + \2247 message = '\n ' + status[1] + \
1885 '\n Total cross-section: %(xsect)8.3e +- %(errt)6.1e pb' % \2248 '\n %(xsec_string)s: %(xsect)8.3e +- %(errt)6.1e %(unit)s' % \
2249 self.cross_sect_dict
2250 elif done:
2251 message = '\n ' + status[2] + proc_info + \
2252 '\n %(xsec_string)s: %(xsect)8.3e +- %(errt)6.1e %(unit)s' % \
1886 self.cross_sect_dict2253 self.cross_sect_dict
1887 if self.run_card['reweight_scale']:2254 if self.run_card['reweight_scale']:
1888 if int(self.run_card['ickkw'])!=-1:2255 if self.run_card['ickkw'] != -1:
1889 message = message + \2256 message = message + \
1890 ('\n Ren. and fac. scale uncertainty: +%0.1f%% -%0.1f%%') % \2257 ('\n Ren. and fac. scale uncertainty: +%0.1f%% -%0.1f%%') % \
1891 (scale_pdf_info['scale_upp'], scale_pdf_info['scale_low'])2258 (scale_pdf_info['scale_upp'], scale_pdf_info['scale_low'])
@@ -1898,7 +2265,7 @@
1898 ('\n PDF uncertainty: +%0.1f%% -%0.1f%%') % \2265 ('\n PDF uncertainty: +%0.1f%% -%0.1f%%') % \
1899 (scale_pdf_info['pdf_upp'], scale_pdf_info['pdf_low'])2266 (scale_pdf_info['pdf_upp'], scale_pdf_info['pdf_low'])
1900 2267
1901 if (mode in ['NLO', 'LO'] and step!=1) or \2268 if (mode in ['NLO', 'LO'] and not done) or \
1902 (mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] and step!=2):2269 (mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] and step!=2):
1903 logger.info(message+'\n')2270 logger.info(message+'\n')
1904 return2271 return
@@ -2359,7 +2726,6 @@
2359 scale_pdf_info={}2726 scale_pdf_info={}
2360 if self.run_card['reweight_scale'] or self.run_card['reweight_PDF'] :2727 if self.run_card['reweight_scale'] or self.run_card['reweight_PDF'] :
2361 scale_pdf_info = self.run_reweight(options['reweightonly'])2728 scale_pdf_info = self.run_reweight(options['reweightonly'])
2362
2363 self.update_status('Collecting events', level='parton', update_results=True)2729 self.update_status('Collecting events', level='parton', update_results=True)
2364 misc.compile(['collect_events'], 2730 misc.compile(['collect_events'],
2365 cwd=pjoin(self.me_dir, 'SubProcesses'))2731 cwd=pjoin(self.me_dir, 'SubProcesses'))
@@ -2383,6 +2749,10 @@
2383 misc.gzip(pjoin(self.me_dir, 'SubProcesses', filename), stdout=evt_file)2749 misc.gzip(pjoin(self.me_dir, 'SubProcesses', filename), stdout=evt_file)
2384 if not options['reweightonly']:2750 if not options['reweightonly']:
2385 self.print_summary(options, 2, mode, scale_pdf_info)2751 self.print_summary(options, 2, mode, scale_pdf_info)
2752 res_files=glob.glob(pjoin(self.me_dir, 'SubProcesses', 'res*.txt'))
2753 for res_file in res_files:
2754 files.mv(res_file,pjoin(self.me_dir, 'Events', self.run_name))
2755
2386 logger.info('The %s file has been generated.\n' % (evt_file))2756 logger.info('The %s file has been generated.\n' % (evt_file))
2387 self.results.add_detail('nb_event', nevents)2757 self.results.add_detail('nb_event', nevents)
2388 self.update_status('Events generated', level='parton', update_results=True)2758 self.update_status('Events generated', level='parton', update_results=True)
@@ -2403,9 +2773,9 @@
24032773
2404 #check that the number of split event files divides the number of2774 #check that the number of split event files divides the number of
2405 # events, otherwise set it to 12775 # events, otherwise set it to 1
2406 if int(int(self.banner.get_detail('run_card', 'nevents')) / \2776 if int(self.banner.get_detail('run_card', 'nevents') / \
2407 self.shower_card['nsplit_jobs']) * self.shower_card['nsplit_jobs'] \2777 self.shower_card['nsplit_jobs']) * self.shower_card['nsplit_jobs'] \
2408 != int(self.banner.get_detail('run_card', 'nevents')):2778 != self.banner.get_detail('run_card', 'nevents'):
2409 logger.warning(\2779 logger.warning(\
2410 'nsplit_jobs in the shower card is not a divisor of the number of events.\n' + \2780 'nsplit_jobs in the shower card is not a divisor of the number of events.\n' + \
2411 'Setting it to 1.')2781 'Setting it to 1.')
@@ -2413,7 +2783,7 @@
24132783
2414 # don't split jobs if the user asks to shower only a part of the events2784 # don't split jobs if the user asks to shower only a part of the events
2415 if self.shower_card['nevents'] > 0 and \2785 if self.shower_card['nevents'] > 0 and \
2416 self.shower_card['nevents'] < int(self.banner.get_detail('run_card', 'nevents')) and \2786 self.shower_card['nevents'] < self.banner.get_detail('run_card', 'nevents') and \
2417 self.shower_card['nsplit_jobs'] != 1:2787 self.shower_card['nsplit_jobs'] != 1:
2418 logger.warning(\2788 logger.warning(\
2419 'Only a part of the events will be showered.\n' + \2789 'Only a part of the events will be showered.\n' + \
@@ -2503,6 +2873,18 @@
2503 2873
2504 mcatnlo_log = pjoin(self.me_dir, 'mcatnlo.log')2874 mcatnlo_log = pjoin(self.me_dir, 'mcatnlo.log')
2505 self.update_status('Compiling MCatNLO for %s...' % shower, level='shower') 2875 self.update_status('Compiling MCatNLO for %s...' % shower, level='shower')
2876
2877
2878 # libdl may be needded for pythia 82xx
2879 if shower == 'PYTHIA8' and not \
2880 os.path.exists(pjoin(self.options['pythia8_path'], 'xmldoc')) and \
2881 'dl' not in self.shower_card['extralibs'].split():
2882 # 'dl' has to be linked with the extralibs
2883 self.shower_card['extralibs'] += ' dl'
2884 logger.warning("'dl' was added to extralibs from the shower_card.dat.\n" + \
2885 "It is needed for the correct running of PY8.2xx.\n" + \
2886 "If this library cannot be found on your system, a crash will occur.")
2887
2506 misc.call(['./MCatNLO_MadFKS.inputs'], stdout=open(mcatnlo_log, 'w'),2888 misc.call(['./MCatNLO_MadFKS.inputs'], stdout=open(mcatnlo_log, 'w'),
2507 stderr=open(mcatnlo_log, 'w'), 2889 stderr=open(mcatnlo_log, 'w'),
2508 cwd=pjoin(self.me_dir, 'MCatNLO'))2890 cwd=pjoin(self.me_dir, 'MCatNLO'))
@@ -2554,10 +2936,10 @@
2554 # special treatment for pythia82936 # special treatment for pythia8
2555 files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.cmd'), rundir)2937 files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.cmd'), rundir)
2556 files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.exe'), rundir)2938 files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.exe'), rundir)
2557 if os.path.exists(pjoin(self.options['pythia8_path'], 'xmldoc')):2939 if os.path.exists(pjoin(self.options['pythia8_path'], 'xmldoc')): # this is PY8.1xxx
2558 files.ln(pjoin(self.options['pythia8_path'], 'examples', 'config.sh'), rundir)2940 files.ln(pjoin(self.options['pythia8_path'], 'examples', 'config.sh'), rundir)
2559 files.ln(pjoin(self.options['pythia8_path'], 'xmldoc'), rundir)2941 files.ln(pjoin(self.options['pythia8_path'], 'xmldoc'), rundir)
2560 else:2942 else: # this is PY8.2xxx
2561 files.ln(pjoin(self.options['pythia8_path'], 'share/Pythia8/xmldoc'), rundir)2943 files.ln(pjoin(self.options['pythia8_path'], 'share/Pythia8/xmldoc'), rundir)
2562 #link the hwpp exe in the rundir2944 #link the hwpp exe in the rundir
2563 if shower == 'HERWIGPP':2945 if shower == 'HERWIGPP':
@@ -2987,8 +3369,8 @@
2987 init_dict = self.get_init_dict(evt_file)3369 init_dict = self.get_init_dict(evt_file)
29883370
2989 if nevents < 0 or \3371 if nevents < 0 or \
2990 nevents > int(self.banner.get_detail('run_card', 'nevents')):3372 nevents > self.banner.get_detail('run_card', 'nevents'):
2991 nevents = int(self.banner.get_detail('run_card', 'nevents'))3373 nevents = self.banner.get_detail('run_card', 'nevents')
29923374
2993 nevents = nevents / self.shower_card['nsplit_jobs']3375 nevents = nevents / self.shower_card['nsplit_jobs']
29943376
@@ -3000,7 +3382,7 @@
30003382
3001 content = 'EVPREFIX=%s\n' % pjoin(os.path.split(evt_file)[1])3383 content = 'EVPREFIX=%s\n' % pjoin(os.path.split(evt_file)[1])
3002 content += 'NEVENTS=%d\n' % nevents3384 content += 'NEVENTS=%d\n' % nevents
3003 content += 'NEVENTS_TOT=%d\n' % (int(self.banner.get_detail('run_card', 'nevents')) /\3385 content += 'NEVENTS_TOT=%d\n' % (self.banner.get_detail('run_card', 'nevents') /\
3004 self.shower_card['nsplit_jobs'])3386 self.shower_card['nsplit_jobs'])
3005 content += 'MCMODE=%s\n' % shower3387 content += 'MCMODE=%s\n' % shower
3006 content += 'PDLABEL=%s\n' % pdlabel3388 content += 'PDLABEL=%s\n' % pdlabel
@@ -3113,7 +3495,7 @@
31133495
31143496
3115 def run_reweight(self, only):3497 def run_reweight(self, only):
3116 """runs the reweight_xsec_events eecutables on each sub-event file generated3498 """runs the reweight_xsec_events executables on each sub-event file generated
3117 to compute on the fly scale and/or PDF uncertainities"""3499 to compute on the fly scale and/or PDF uncertainities"""
3118 logger.info(' Doing reweight')3500 logger.info(' Doing reweight')
31193501
@@ -3231,7 +3613,7 @@
3231 scale_pdf_info['scale_low'] = 0.03613 scale_pdf_info['scale_low'] = 0.0
32323614
3233 # get the pdf uncertainty in percent (according to the Hessian method)3615 # get the pdf uncertainty in percent (according to the Hessian method)
3234 lhaid=int(self.run_card['lhaid'])3616 lhaid=self.run_card['lhaid']
3235 pdf_upp=0.03617 pdf_upp=0.0
3236 pdf_low=0.03618 pdf_low=0.0
3237 if lhaid <= 90000:3619 if lhaid <= 90000:
@@ -3246,7 +3628,6 @@
3246 else:3628 else:
3247 scale_pdf_info['pdf_upp'] = 0.03629 scale_pdf_info['pdf_upp'] = 0.0
3248 scale_pdf_info['pdf_low'] = 0.03630 scale_pdf_info['pdf_low'] = 0.0
3249
3250 else:3631 else:
3251 # use Gaussian method (NNPDF)3632 # use Gaussian method (NNPDF)
3252 pdf_stdev=0.03633 pdf_stdev=0.0
@@ -3263,7 +3644,6 @@
32633644
3264 def wait_for_complete(self, run_type):3645 def wait_for_complete(self, run_type):
3265 """this function waits for jobs on cluster to complete their run."""3646 """this function waits for jobs on cluster to complete their run."""
3266
3267 starttime = time.time()3647 starttime = time.time()
3268 #logger.info(' Waiting for submitted jobs to complete')3648 #logger.info(' Waiting for submitted jobs to complete')
3269 update_status = lambda i, r, f: self.update_status((i, r, f, run_type), 3649 update_status = lambda i, r, f: self.update_status((i, r, f, run_type),
@@ -3276,29 +3656,15 @@
32763656
3277 def run_all(self, job_dict, arg_list, run_type='monitor', split_jobs = False):3657 def run_all(self, job_dict, arg_list, run_type='monitor', split_jobs = False):
3278 """runs the jobs in job_dict (organized as folder: [job_list]), with arguments args"""3658 """runs the jobs in job_dict (organized as folder: [job_list]), with arguments args"""
3279 njob_split = 0
3280 self.ijob = 03659 self.ijob = 0
3281
3282 # this is to keep track, if splitting evt generation, of the various
3283 # folders/args in order to resubmit the jobs if some of them fail
3284 self.split_folders = {}
3285
3286 if run_type != 'shower':3660 if run_type != 'shower':
3287 self.njobs = sum(len(jobs) for jobs in job_dict.values()) * len(arg_list)3661 self.njobs = sum(len(jobs) for jobs in job_dict.values()) * len(arg_list)
3288 for args in arg_list:3662 for args in arg_list:
3289 for Pdir, jobs in job_dict.items():3663 for Pdir, jobs in job_dict.items():
3290 for job in jobs:3664 for job in jobs:
3291 if not split_jobs:3665 self.run_exe(job, args, run_type, cwd=pjoin(self.me_dir, 'SubProcesses', Pdir) )
3292 self.run_exe(job, args, run_type, cwd=pjoin(self.me_dir, 'SubProcesses', Pdir) )
3293 else:
3294 for n in self.find_jobs_to_split(Pdir, job, args[1]):
3295 self.run_exe(job, args + [n], run_type, cwd=pjoin(self.me_dir, 'SubProcesses', Pdir) )
3296 njob_split += 1
3297 # print some statistics if running serially
3298 if self.cluster_mode == 2:3666 if self.cluster_mode == 2:
3299 time.sleep(1) # security to allow all jobs to be launched3667 time.sleep(1) # security to allow all jobs to be launched
3300 if njob_split > 0:
3301 self.njobs = njob_split
3302 else:3668 else:
3303 self.njobs = len(arg_list)3669 self.njobs = len(arg_list)
3304 for args in arg_list:3670 for args in arg_list:
@@ -3309,37 +3675,27 @@
33093675
33103676
33113677
3312 def check_event_files(self):3678 def check_event_files(self,jobs):
3313 """check the integrity of the event files after splitting, and resubmit 3679 """check the integrity of the event files after splitting, and resubmit
3314 those which are not nicely terminated"""3680 those which are not nicely terminated"""
3315 to_resubmit = []3681 jobs_to_resubmit = []
3316 for dir in self.split_folders.keys():3682 for job in jobs:
3317 last_line = ''3683 last_line = ''
3318 try:3684 try:
3319 last_line = subprocess.Popen(3685 last_line = subprocess.Popen(
3320 ['tail', '-n1', pjoin(dir, 'events.lhe')], \3686 ['tail', '-n1', pjoin(job['dirname'], 'events.lhe')], \
3321 stdout = subprocess.PIPE).stdout.read().strip()3687 stdout = subprocess.PIPE).stdout.read().strip()
3322 except IOError:3688 except IOError:
3323 pass3689 pass
3324
3325 if last_line != "</LesHouchesEvents>":3690 if last_line != "</LesHouchesEvents>":
3326 to_resubmit.append(dir)3691 jobs_to_resubmit.append(job)
3327
3328 self.njobs = 03692 self.njobs = 0
3329 if to_resubmit:3693 if jobs_to_resubmit:
3330 run_type = 'Resubmitting broken jobs'3694 run_type = 'Resubmitting broken jobs'
3331 logger.info('Some event files are broken, corresponding jobs will be resubmitted.')3695 logger.info('Some event files are broken, corresponding jobs will be resubmitted.')
3332 logger.debug('Resubmitting\n' + '\n'.join(to_resubmit) + '\n')3696 for job in jobs_to_resubmit:
3333 for dir in to_resubmit:3697 logger.debug('Resubmitting ' + job['dirname'] + '\n')
3334 files.rm([dir])3698 self.run_all_jobs(jobs_to_resubmit,2,fixed_order=False)
3335 job = self.split_folders[dir][0]
3336 args = self.split_folders[dir][1:]
3337 run_type = 'monitor'
3338 cwd = os.path.split(dir)[0]
3339 self.run_exe(job, args, run_type, cwd=cwd )
3340 self.njobs +=1
3341
3342 self.wait_for_complete(run_type)
33433699
33443700
3345 def find_jobs_to_split(self, pdir, job, arg):3701 def find_jobs_to_split(self, pdir, job, arg):
@@ -3412,16 +3768,16 @@
3412 # the 'standard' amcatnlo job3768 # the 'standard' amcatnlo job
3413 # check if args is a list of string 3769 # check if args is a list of string
3414 if type(args[0]) == str:3770 if type(args[0]) == str:
3415 input_files, output_files, required_output, args = self.getIO_ajob(exe,cwd, args)3771 input_files, output_files, required_output, args = self.getIO_ajob(exe,cwd,args)
3416 #submitting3772 #submitting
3417 self.cluster.submit2(exe, args, cwd=cwd, 3773 self.cluster.submit2(exe, args, cwd=cwd,
3418 input_files=input_files, output_files=output_files,3774 input_files=input_files, output_files=output_files,
3419 required_output=required_output)3775 required_output=required_output)
34203776
3421 # keep track of folders and arguments for splitted evt gen3777# # keep track of folders and arguments for splitted evt gen
3422 subfolder=output_files[-1].split('/')[0]3778# subfolder=output_files[-1].split('/')[0]
3423 if len(args) == 4 and '_' in subfolder:3779# if len(args) == 4 and '_' in subfolder:
3424 self.split_folders[pjoin(cwd,subfolder)] = [exe] + args3780# self.split_folders[pjoin(cwd,subfolder)] = [exe] + args
34253781
3426 elif 'shower' in exe:3782 elif 'shower' in exe:
3427 # a shower job3783 # a shower job
@@ -3487,7 +3843,6 @@
3487 # use local disk if possible => need to stands what are the 3843 # use local disk if possible => need to stands what are the
3488 # input/output files3844 # input/output files
3489 3845
3490 keep_fourth_arg = False
3491 output_files = []3846 output_files = []
3492 required_output = []3847 required_output = []
3493 input_files = [pjoin(self.me_dir, 'SubProcesses', 'randinit'),3848 input_files = [pjoin(self.me_dir, 'SubProcesses', 'randinit'),
@@ -3509,91 +3864,58 @@
3509 input_files.append(pjoin(cwd, 'OLE_order.olc'))3864 input_files.append(pjoin(cwd, 'OLE_order.olc'))
35103865
3511 # File for the loop (might not be present if MadLoop is not used)3866 # File for the loop (might not be present if MadLoop is not used)
3512 if os.path.exists(pjoin(cwd,'MadLoop5_resources')) and \3867 if os.path.exists(pjoin(cwd,'MadLoop5_resources.tar.gz')) and \
3513 cluster.need_transfer(self.options):3868 cluster.need_transfer(self.options):
3514 input_files.append(pjoin(cwd, 'MadLoop5_resources.tar.gz'))3869 input_files.append(pjoin(cwd, 'MadLoop5_resources.tar.gz'))
3870 elif os.path.exists(pjoin(cwd,'MadLoop5_resources')) and \
3871 cluster.need_transfer(self.options):
3515 tf=tarfile.open(pjoin(cwd,'MadLoop5_resources.tar.gz'),'w:gz',3872 tf=tarfile.open(pjoin(cwd,'MadLoop5_resources.tar.gz'),'w:gz',
3516 dereference=True)3873 dereference=True)
3517 tf.add(pjoin(cwd,'MadLoop5_resources'),arcname='MadLoop5_resources')3874 tf.add(pjoin(cwd,'MadLoop5_resources'),arcname='MadLoop5_resources')
3518 tf.close()3875 tf.close()
35193876 input_files.append(pjoin(cwd, 'MadLoop5_resources.tar.gz'))
3520 Ire = re.compile("for i in ([\d\s]*) ; do")
3521 try :
3522 fsock = open(exe)
3523 except IOError:
3524 fsock = open(pjoin(cwd,exe))
3525 text = fsock.read()
3526 data = Ire.findall(text)
3527 subdir = ' '.join(data).split()
3528 3877
3529 if args[0] == '0':3878 if args[1] == 'born' or args[1] == 'all':
3530 # MADEVENT MINT FO MODE3879 # MADEVENT MINT FO MODE
3531 input_files.append(pjoin(cwd, 'madevent_mintFO'))3880 input_files.append(pjoin(cwd, 'madevent_mintFO'))
3532 input_files.append(pjoin(self.me_dir, 'SubProcesses','madin.%s' % args[1]))3881 if args[2] == '0':
3533 #j=$2\_G$i3882 current = '%s_G%s' % (args[1],args[0])
3534 for i in subdir:3883 else:
3535 current = '%s_G%s' % (args[1],i)3884 current = '%s_G%s_%s' % (args[1],args[0],args[2])
3536 if os.path.exists(pjoin(cwd,current)):3885 if os.path.exists(pjoin(cwd,current)):
3537 input_files.append(pjoin(cwd, current))3886 input_files.append(pjoin(cwd, current))
3538 output_files.append(current)3887 output_files.append(current)
35393888
3540 required_output.append('%s/results.dat' % current)3889 required_output.append('%s/results.dat' % current)
3541 required_output.append('%s/log.txt' % current)3890 required_output.append('%s/res_%s.dat' % (current,args[3]))
3542 required_output.append('%s/mint_grids' % current)3891 required_output.append('%s/log_MINT%s.txt' % (current,args[3]))
3543 required_output.append('%s/grid.MC_integer' % current)3892 required_output.append('%s/mint_grids' % current)
3544 if len(args) == 4:3893 required_output.append('%s/grid.MC_integer' % current)
3545 required_output.append('%s/scale_pdf_dependence.dat' % current)3894 if args[3] != '0':
3546 args[2] = '-1'3895 required_output.append('%s/scale_pdf_dependence.dat' % current)
3547 # use a grid train on another part
3548 base = '%s_G%s' % (args[3],i)
3549 if args[0] == '0':
3550 to_move = ['grid.MC_integer','mint_grids']
3551 elif args[0] == '1':
3552 to_move = ['mint_grids', 'grid.MC_integer']
3553 else:
3554 to_move = []
3555 if self.run_card['iappl'] == 2:
3556 for grid in glob.glob(pjoin(cwd,base,'grid_obs_*_in.root')):
3557 to_move.append(grid)
3558 if not os.path.exists(pjoin(cwd,current)):
3559 os.mkdir(pjoin(cwd,current))
3560 input_files.append(pjoin(cwd, current))
3561 for name in to_move:
3562 files.cp(pjoin(cwd,base, name),
3563 pjoin(cwd,current))
3564 files.cp(pjoin(cwd,base, 'grid.MC_integer'),
3565 pjoin(cwd,current))
3566 3896
3567 elif args[0] == '2':3897 elif args[1] == 'F' or args[1] == 'B':
3568 # MINTMC MODE3898 # MINTMC MODE
3569 input_files.append(pjoin(cwd, 'madevent_mintMC'))3899 input_files.append(pjoin(cwd, 'madevent_mintMC'))
3570 if args[2] in ['0','2']:3900
3571 input_files.append(pjoin(self.me_dir, 'SubProcesses','madinMMC_%s.2' % args[1]))3901 if args[2] == '0':
35723902 current = 'G%s%s' % (args[1],args[0])
3573 for i in subdir:3903 else:
3574 current = 'G%s%s' % (args[1], i)3904 current = 'G%s%s_%s' % (args[1],args[0],args[2])
3575 if os.path.exists(pjoin(cwd,current)):3905 if os.path.exists(pjoin(cwd,current)):
3576 input_files.append(pjoin(cwd, current))3906 input_files.append(pjoin(cwd, current))
3577 output_files.append(current)3907 output_files.append(current)
3578 if len(args) == 4 and args[3] in ['H','S','V','B','F']:3908 if args[2] > '0':
3579 # use a grid train on another part3909 # this is for the split event generation
3580 base = '%s_%s' % (args[3],i)3910 output_files.append('G%s%s_%s' % (args[1], args[0], args[2]))
3581 files.ln(pjoin(cwd,base,'mint_grids'), name = 'preset_mint_grids', 3911 required_output.append('G%s%s_%s/log_MINT%s.txt' % (args[1],args[0],args[2],args[3]))
3582 starting_dir=pjoin(cwd,current))3912
3583 files.ln(pjoin(cwd,base,'grid.MC_integer'), 3913 else:
3584 starting_dir=pjoin(cwd,current))3914 required_output.append('%s/log_MINT%s.txt' % (current,args[3]))
3585 elif len(args) ==4:3915 if args[3] in ['0','1']:
3586 keep_fourth_arg = True3916 required_output.append('%s/results.dat' % current)
3587 # this is for the split event generation3917 if args[3] == '1':
3588 output_files.append('G%s%s_%s' % (args[1], i, args[3]))3918 output_files.append('%s/results.dat' % current)
3589 required_output.append('G%s%s_%s/log_MINT%s.txt' % (args[1], i, args[3],args[2]))
3590
3591 else:
3592 required_output.append('%s/log_MINT%s.txt' % (current,args[2]))
3593 if args[2] in ['0','1']:
3594 required_output.append('%s/results.dat' % current)
3595 if args[2] == '1':
3596 output_files.append('%s/results.dat' % current)
35973919
3598 else:3920 else:
3599 raise aMCatNLOError, 'not valid arguments: %s' %(', '.join(args))3921 raise aMCatNLOError, 'not valid arguments: %s' %(', '.join(args))
@@ -3601,73 +3923,9 @@
3601 #Find the correct PDF input file3923 #Find the correct PDF input file
3602 pdfinput = self.get_pdf_input_filename()3924 pdfinput = self.get_pdf_input_filename()
3603 if os.path.exists(pdfinput):3925 if os.path.exists(pdfinput):
3604 input_files.append(pdfinput)3926 input_files.append(pdfinput)
3605
3606 if len(args) == 4 and not keep_fourth_arg:
3607 args = args[:3]
3608
3609 return input_files, output_files, required_output, args3927 return input_files, output_files, required_output, args
3610 3928
3611 def write_madinMMC_file(self, path, run_mode, mint_mode):
3612 """writes the madinMMC_?.2 file"""
3613 #check the validity of the arguments
3614 run_modes = ['born', 'virt', 'novi', 'all', 'viSB', 'novB']
3615 if run_mode not in run_modes:
3616 raise aMCatNLOError('%s is not a valid mode for run. Please use one of the following: %s' \
3617 % (run_mode, ', '.join(run_modes)))
3618 mint_modes = [0, 1, 2]
3619 if mint_mode not in mint_modes:
3620 raise aMCatNLOError('%s is not a valid mode for mintMC. Please use one of the following: %s' \
3621 % (mint_mode, ', '.join(mint_modes)))
3622 if run_mode in ['born']:
3623 name_suffix = 'B'
3624 elif run_mode in ['virt', 'viSB']:
3625 name_suffix = 'V'
3626 else:
3627 name_suffix = 'F'
3628
3629 content = \
3630"""-1 12 ! points, iterations
36310.03 ! desired fractional accuracy
36321 -0.1 ! alpha, beta for Gsoft
3633-1 -0.1 ! alpha, beta for Gazi
36341 ! Suppress amplitude (0 no, 1 yes)?
36351 ! Exact helicity sum (0 yes, n = number/event)?
36361 ! Enter Configuration Number:
3637%1d ! MINT imode: 0 to set-up grids, 1 to perform integral, 2 generate events
36381 1 1 ! if imode is 1: Folding parameters for xi_i, phi_i and y_ij
3639%s ! all, born, real, virt
3640""" \
3641 % (mint_mode, run_mode)
3642 file = open(pjoin(path, 'madinMMC_%s.2' % name_suffix), 'w')
3643 file.write(content)
3644 file.close()
3645
3646 def write_madin_file(self, path, run_mode, vegas_mode, npoints, niters, accuracy='0'):
3647 """writes the madin.run_mode file"""
3648 #check the validity of the arguments
3649 run_modes = ['born', 'virt', 'novi', 'all', 'viSB', 'novB', 'grid']
3650 if run_mode not in run_modes:
3651 raise aMCatNLOError('%s is not a valid mode for run. Please use one of the following: %s' \
3652 % (run_mode, ', '.join(run_modes)))
3653 name_suffix = run_mode
3654
3655 content = \
3656"""%s %s ! points, iterations
3657%s ! accuracy
36582 ! 0 fixed grid 2 adjust
36591 ! 1 suppress amp, 0 doesnt
36601 ! 0 for exact hel sum
36611 ! hel configuration numb
3662'test'
36631 ! 1 to save grids
3664%s ! 0 to exclude, 1 for new run, 2 to restart, 3 to reset w/ keeping grid
3665%s ! all, born, real, virt
3666""" \
3667 % (npoints,niters,accuracy,vegas_mode,run_mode)
3668 file = open(pjoin(path, 'madin.%s' % name_suffix), 'w')
3669 file.write(content)
3670 file.close()
36713929
3672 def compile(self, mode, options):3930 def compile(self, mode, options):
3673 """compiles aMC@NLO to compute either NLO or NLO matched to shower, as3931 """compiles aMC@NLO to compute either NLO or NLO matched to shower, as
@@ -3730,10 +3988,10 @@
37303988
3731 self.link_lhapdf(libdir, [pjoin('SubProcesses', p) for p in p_dirs])3989 self.link_lhapdf(libdir, [pjoin('SubProcesses', p) for p in p_dirs])
3732 pdfsetsdir = self.get_lhapdf_pdfsetsdir()3990 pdfsetsdir = self.get_lhapdf_pdfsetsdir()
3733 lhaid_list = [int(self.run_card['lhaid'])]3991 lhaid_list = [self.run_card['lhaid']]
3734 if self.run_card['reweight_PDF']:3992 if self.run_card['reweight_PDF']:
3735 lhaid_list.append(int(self.run_card['PDF_set_min']))3993 lhaid_list.append(self.run_card['PDF_set_min'])
3736 lhaid_list.append(int(self.run_card['PDF_set_max']))3994 lhaid_list.append(self.run_card['PDF_set_max'])
3737 self.copy_lhapdf_set(lhaid_list, pdfsetsdir)3995 self.copy_lhapdf_set(lhaid_list, pdfsetsdir)
37383996
3739 else:3997 else:
@@ -4045,18 +4303,23 @@
4045 void = 'NOT INSTALLED'4303 void = 'NOT INSTALLED'
4046 switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight']4304 switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight']
4047 switch_default = {'order': 'NLO', 'fixed_order': 'OFF', 'shower': void,4305 switch_default = {'order': 'NLO', 'fixed_order': 'OFF', 'shower': void,
4048 'madspin': void}4306 'madspin': void,'reweight':'OFF'}
4049 if not switch:4307 if not switch:
4050 switch = switch_default4308 switch = switch_default
4051 else:4309 else:
4052 switch.update(dict((k,value) for k,v in switch_default.items() if k not in switch))4310 switch.update(dict((k,value) for k,v in switch_default.items() if k not in switch))
4053
4054 default_switch = ['ON', 'OFF']4311 default_switch = ['ON', 'OFF']
4312
4313
4055 allowed_switch_value = {'order': ['LO', 'NLO'],4314 allowed_switch_value = {'order': ['LO', 'NLO'],
4056 'fixed_order': default_switch,4315 'fixed_order': default_switch,
4057 'shower': default_switch,4316 'shower': default_switch,
4058 'madspin': default_switch,4317 'madspin': default_switch,
4059 'reweight': default_switch}4318 'reweight': default_switch}
4319
4320
4321
4322
4060 4323
4061 description = {'order': 'Perturbative order of the calculation:',4324 description = {'order': 'Perturbative order of the calculation:',
4062 'fixed_order': 'Fixed order (no event generation and no MC@[N]LO matching):',4325 'fixed_order': 'Fixed order (no event generation and no MC@[N]LO matching):',
@@ -4072,22 +4335,35 @@
4072 special_values = ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']4335 special_values = ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']
40734336
4074 assign_switch = lambda key, value: switch.__setitem__(key, value if switch[key] != void else void )4337 assign_switch = lambda key, value: switch.__setitem__(key, value if switch[key] != void else void )
4075 4338
4339 if self.proc_characteristics['ninitial'] == 1:
4340 switch['fixed_order'] = 'ON'
4341 switch['shower'] = 'Not available for decay'
4342 switch['madspin'] = 'Not available for decay'
4343 switch['reweight'] = 'Not available for decay'
4344 allowed_switch_value['fixed_order'] = ['ON']
4345 allowed_switch_value['shower'] = ['OFF']
4346 allowed_switch_value['madspin'] = ['OFF']
4347 allowed_switch_value['reweight'] = ['OFF']
4348 available_mode = ['0','1']
4349 special_values = ['LO', 'NLO']
4350 else:
4351 # Init the switch value according to the current status
4352 available_mode = ['0', '1', '2','3']
40764353
4077 if mode == 'auto': 4354 if mode == 'auto':
4078 mode = None4355 mode = None
4079 if not mode and (options['parton'] or options['reweightonly']):4356 if not mode and (options['parton'] or options['reweightonly']):
4080 mode = 'noshower' 4357 mode = 'noshower'
4081 4358
4082 # Init the switch value according to the current status4359
4083 available_mode = ['0', '1', '2']4360 if '3' in available_mode:
4084 available_mode.append('3')4361 if os.path.exists(pjoin(self.me_dir, 'Cards', 'shower_card.dat')):
4085 if os.path.exists(pjoin(self.me_dir, 'Cards', 'shower_card.dat')):4362 switch['shower'] = 'ON'
4086 switch['shower'] = 'ON'4363 else:
4087 else:4364 switch['shower'] = 'OFF'
4088 switch['shower'] = 'OFF'
4089 4365
4090 if not aMCatNLO or self.options['mg5_path']:4366 if (not aMCatNLO or self.options['mg5_path']) and '3' in available_mode:
4091 available_mode.append('4')4367 available_mode.append('4')
4092 if os.path.exists(pjoin(self.me_dir,'Cards','madspin_card.dat')):4368 if os.path.exists(pjoin(self.me_dir,'Cards','madspin_card.dat')):
4093 switch['madspin'] = 'ON'4369 switch['madspin'] = 'ON'
@@ -4102,8 +4378,7 @@
4102 else:4378 else:
4103 switch['reweight'] = 'Not available (requires NumPy)'4379 switch['reweight'] = 'Not available (requires NumPy)'
41044380
4105 4381 if 'do_reweight' in options and options['do_reweight'] and '3' in available_mode:
4106 if 'do_reweight' in options and options['do_reweight']:
4107 if switch['reweight'] == "OFF":4382 if switch['reweight'] == "OFF":
4108 switch['reweight'] = "ON"4383 switch['reweight'] = "ON"
4109 elif switch['reweight'] != "ON":4384 elif switch['reweight'] != "ON":
@@ -4113,12 +4388,12 @@
4113 switch['madspin'] = 'ON'4388 switch['madspin'] = 'ON'
4114 elif switch['madspin'] != "ON":4389 elif switch['madspin'] != "ON":
4115 logger.critical("Cannot run MadSpin module: %s" % switch['reweight'])4390 logger.critical("Cannot run MadSpin module: %s" % switch['reweight'])
4116 4391
4117
4118 answers = list(available_mode) + ['auto', 'done']4392 answers = list(available_mode) + ['auto', 'done']
4119 alias = {}4393 alias = {}
4120 for id, key in enumerate(switch_order):4394 for id, key in enumerate(switch_order):
4121 if switch[key] != void and switch[key] in allowed_switch_value[key]:4395 if switch[key] != void and switch[key] in allowed_switch_value[key] and \
4396 len(allowed_switch_value[key]) >1:
4122 answers += ['%s=%s' % (key, s) for s in allowed_switch_value[key]]4397 answers += ['%s=%s' % (key, s) for s in allowed_switch_value[key]]
4123 #allow lower case for on/off4398 #allow lower case for on/off
4124 alias.update(dict(('%s=%s' % (key, s.lower()), '%s=%s' % (key, s))4399 alias.update(dict(('%s=%s' % (key, s.lower()), '%s=%s' % (key, s))
@@ -4149,7 +4424,7 @@
4149 elif answer in ['0', 'auto', 'done']:4424 elif answer in ['0', 'auto', 'done']:
4150 return 4425 return
4151 elif answer in special_values:4426 elif answer in special_values:
4152 logger.info('Enter mode value: Go to the related mode', '$MG:color:BLACK')4427 logger.info('Enter mode value: %s. Go to the related mode' % answer, '$MG:color:BLACK')
4153 #assign_switch('reweight', 'OFF')4428 #assign_switch('reweight', 'OFF')
4154 #assign_switch('madspin', 'OFF')4429 #assign_switch('madspin', 'OFF')
4155 if answer == 'LO':4430 if answer == 'LO':
@@ -4180,7 +4455,6 @@
4180 return4455 return
4181 return switch4456 return switch
41824457
4183
4184 modify_switch(mode, self.last_mode, switch)4458 modify_switch(mode, self.last_mode, switch)
4185 if switch['madspin'] == 'OFF' and os.path.exists(pjoin(self.me_dir,'Cards','madspin_card.dat')):4459 if switch['madspin'] == 'OFF' and os.path.exists(pjoin(self.me_dir,'Cards','madspin_card.dat')):
4186 assign_switch('madspin', 'ON')4460 assign_switch('madspin', 'ON')
@@ -4272,9 +4546,9 @@
4272 if mode in ['LO','aMC@LO','noshowerLO']:4546 if mode in ['LO','aMC@LO','noshowerLO']:
4273 self.run_name += '_LO' 4547 self.run_name += '_LO'
4274 self.set_run_name(self.run_name, self.run_tag, 'parton')4548 self.set_run_name(self.run_name, self.run_tag, 'parton')
4275 if int(self.run_card['ickkw']) == 3 and mode in ['LO', 'aMC@LO', 'noshowerLO']:4549 if self.run_card['ickkw'] == 3 and mode in ['LO', 'aMC@LO', 'noshowerLO']:
4276 raise self.InvalidCmd("""FxFx merging (ickkw=3) not allowed at LO""")4550 raise self.InvalidCmd("""FxFx merging (ickkw=3) not allowed at LO""")
4277 elif int(self.run_card['ickkw']) == 3 and mode in ['aMC@NLO', 'noshower']:4551 elif self.run_card['ickkw'] == 3 and mode in ['aMC@NLO', 'noshower']:
4278 logger.warning("""You are running with FxFx merging enabled. To be able to merge4552 logger.warning("""You are running with FxFx merging enabled. To be able to merge
4279 samples of various multiplicities without double counting, you4553 samples of various multiplicities without double counting, you
4280 have to remove some events after showering 'by hand'. Please4554 have to remove some events after showering 'by hand'. Please
@@ -4290,7 +4564,7 @@
4290 error = '''Stop opertation'''4564 error = '''Stop opertation'''
4291 self.ask_run_configuration(mode, options)4565 self.ask_run_configuration(mode, options)
4292 # raise aMCatNLOError(error)4566 # raise aMCatNLOError(error)
4293 elif int(self.run_card['ickkw']) == -1 and mode in ['aMC@NLO', 'noshower']:4567 elif self.run_card['ickkw'] == -1 and mode in ['aMC@NLO', 'noshower']:
4294 # NNLL+NLO jet-veto only possible for LO event generation or fNLO runs.4568 # NNLL+NLO jet-veto only possible for LO event generation or fNLO runs.
4295 raise self.InvalidCmd("""NNLL+NLO jet veto runs (ickkw=-1) only possible for fNLO or LO.""")4569 raise self.InvalidCmd("""NNLL+NLO jet veto runs (ickkw=-1) only possible for fNLO or LO.""")
4296 if 'aMC@' in mode or mode == 'onlyshower':4570 if 'aMC@' in mode or mode == 'onlyshower':
42974571
=== modified file 'madgraph/interface/coloring_logging.py' (properties changed: -x to +x)
=== modified file 'madgraph/interface/common_run_interface.py' (properties changed: -x to +x)
--- madgraph/interface/common_run_interface.py 2015-08-27 19:32:34 +0000
+++ madgraph/interface/common_run_interface.py 2015-10-25 15:32:18 +0000
@@ -221,19 +221,17 @@
221 #restrict_file = None221 #restrict_file = None
222 #if os.path.exists(pjoin(ufo_path, 'restrict_default.dat')):222 #if os.path.exists(pjoin(ufo_path, 'restrict_default.dat')):
223 # restrict_file = pjoin(ufo_path, 'restrict_default.dat')223 # restrict_file = pjoin(ufo_path, 'restrict_default.dat')
224
225 force_CMS = self.mother and self.mother.options['complex_mass_scheme']
224 model = import_ufo.import_model(modelname, decay=True, 226 model = import_ufo.import_model(modelname, decay=True,
225 restrict=True)227 restrict=True, complex_mass_scheme=force_CMS)
226 if self.mother and self.mother.options['complex_mass_scheme']:
227 model.change_mass_to_complex_scheme()
228 else:228 else:
229 model = import_ufo.import_model(pjoin(
230 self.me_dir,'bin','internal', 'ufomodel'),decay=True)
231 #pattern for checking complex mass scheme.229 #pattern for checking complex mass scheme.
232 has_cms = re.compile(r'''set\s+complex_mass_scheme\s*(True|T|1|true|$|;)''')230 has_cms = re.compile(r'''set\s+complex_mass_scheme\s*(True|T|1|true|$|;)''')
233 if has_cms.search(open(pjoin(self.me_dir,'Cards','proc_card_mg5.dat')\231 force_CMS = has_cms.search(open(pjoin(self.me_dir,'Cards',
234 ).read()):232 'proc_card_mg5.dat')).read())
235 model.change_mass_to_complex_scheme()233 model = import_ufo.import_model(pjoin(self.me_dir,'bin','internal',
236 234 'ufomodel'), decay=True, complex_mass_scheme=force_CMS)
237 235
238# if not hasattr(model.get('particles')[0], 'partial_widths'):236# if not hasattr(model.get('particles')[0], 'partial_widths'):
239# raise self.InvalidCmd, 'The UFO model does not include partial widths information. Impossible to compute widths automatically'237# raise self.InvalidCmd, 'The UFO model does not include partial widths information. Impossible to compute widths automatically'
@@ -508,6 +506,7 @@
508 options_madgraph= {'stdout_level':None}506 options_madgraph= {'stdout_level':None}
509507
510 options_madevent = {'automatic_html_opening':True,508 options_madevent = {'automatic_html_opening':True,
509 'notification_center':True,
511 'run_mode':2,510 'run_mode':2,
512 'cluster_queue':'madgraph',511 'cluster_queue':'madgraph',
513 'cluster_time':None,512 'cluster_time':None,
@@ -527,6 +526,8 @@
527526
528 self.me_dir = me_dir527 self.me_dir = me_dir
529 self.options = options528 self.options = options
529
530 self.param_card_iterator = [] #an placeholder containing a generator of paramcard for scanning
530531
531 # usefull shortcut532 # usefull shortcut
532 self.status = pjoin(self.me_dir, 'status')533 self.status = pjoin(self.me_dir, 'status')
@@ -658,7 +659,7 @@
658659
659 if amcatnlo and not keepwidth:660 if amcatnlo and not keepwidth:
660 # force particle in final states to have zero width661 # force particle in final states to have zero width
661 pids = self.get_pid_final_states()662 pids = self.get_pid_final_initial_states()
662 # check those which are charged under qcd663 # check those which are charged under qcd
663 if not MADEVENT and pjoin(self.me_dir,'bin','internal') not in sys.path:664 if not MADEVENT and pjoin(self.me_dir,'bin','internal') not in sys.path:
664 sys.path.insert(0,pjoin(self.me_dir,'bin','internal'))665 sys.path.insert(0,pjoin(self.me_dir,'bin','internal'))
@@ -780,11 +781,11 @@
780 if fulltext == '':781 if fulltext == '':
781 logger.warning('File %s is empty' % path)782 logger.warning('File %s is empty' % path)
782 return 'unknown'783 return 'unknown'
783 text = re.findall('(<MGVersion>|ParticlePropagator|<mg5proccard>|CEN_max_tracker|#TRIGGER CARD|parameter set name|muon eta coverage|QES_over_ref|MSTP|b_stable|FO_ANALYSIS_FORMAT|MSTU|Begin Minpts|gridpack|ebeam1|block\s+mw_run|BLOCK|DECAY|launch|madspin|transfer_card\.dat|set)', fulltext, re.I)784 text = re.findall('(<MGVersion>|ParticlePropagator|ExecutionPath|Treewriter|<mg5proccard>|CEN_max_tracker|#TRIGGER CARD|parameter set name|muon eta coverage|QES_over_ref|MSTP|b_stable|FO_ANALYSIS_FORMAT|MSTU|Begin Minpts|gridpack|ebeam1|block\s+mw_run|BLOCK|DECAY|launch|madspin|transfer_card\.dat|set)', fulltext, re.I)
784 text = [t.lower() for t in text]785 text = [t.lower() for t in text]
785 if '<mgversion>' in text or '<mg5proccard>' in text:786 if '<mgversion>' in text or '<mg5proccard>' in text:
786 return 'banner'787 return 'banner'
787 elif 'particlepropagator' in text:788 elif 'particlepropagator' in text or 'executionpath' in text or 'treewriter' in text:
788 return 'delphes_card.dat'789 return 'delphes_card.dat'
789 elif 'cen_max_tracker' in text:790 elif 'cen_max_tracker' in text:
790 return 'delphes_card.dat'791 return 'delphes_card.dat'
@@ -1351,8 +1352,8 @@
1351 self.update_status('delphes done', level='delphes', makehtml=False)1352 self.update_status('delphes done', level='delphes', makehtml=False)
13521353
1353 ############################################################################1354 ############################################################################
1354 def get_pid_final_states(self):1355 def get_pid_final_initial_states(self):
1355 """Find the pid of all particles in the final states"""1356 """Find the pid of all particles in the final and initial states"""
1356 pids = set()1357 pids = set()
1357 subproc = [l.strip() for l in open(pjoin(self.me_dir,'SubProcesses',1358 subproc = [l.strip() for l in open(pjoin(self.me_dir,'SubProcesses',
1358 'subproc.mg'))]1359 'subproc.mg'))]
@@ -1363,7 +1364,7 @@
1363 group = pat.findall(text)1364 group = pat.findall(text)
1364 for particles in group:1365 for particles in group:
1365 particles = particles.split(',')1366 particles = particles.split(',')
1366 pids.update(set(particles[nb_init:]))1367 pids.update(set(particles))
13671368
1368 return pids1369 return pids
13691370
@@ -1532,6 +1533,12 @@
1532 first, second = args[1:3]1533 first, second = args[1:3]
15331534
1534 self.options[args[0]] = (int(first), int(second))1535 self.options[args[0]] = (int(first), int(second))
1536 elif args[0] == 'notification_center':
1537 if args[1] in ['None','True','False']:
1538 self.allow_notification_center = eval(args[1])
1539 self.options[args[0]] = eval(args[1])
1540 else:
1541 raise self.InvalidCmd('Not a valid value for notification_center')
1535 elif args[0] in self.options:1542 elif args[0] in self.options:
1536 if args[1] in ['None','True','False']:1543 if args[1] in ['None','True','False']:
1537 self.options[args[0]] = eval(args[1])1544 self.options[args[0]] = eval(args[1])
@@ -1594,12 +1601,29 @@
15941601
15951602
1596 def check_param_card(self, path, run=True):1603 def check_param_card(self, path, run=True):
1597 """Check that all the width are define in the param_card.1604 """
1598 If some width are set on 'Auto', call the computation tools."""1605 1) Check that no scan parameter are present
1606 2) Check that all the width are define in the param_card.
1607 - If a scan parameter is define. create the iterator and recall this fonction
1608 on the first element.
1609 - If some width are set on 'Auto', call the computation tools."""
1599 1610
1600 pattern = re.compile(r'''decay\s+(\+?\-?\d+)\s+auto(@NLO|)''',re.I)1611 pattern_scan = re.compile(r'''^(decay)?[\s\d]*scan''', re.I+re.M)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: