Merge lp:~maddevelopers/mg5amcnlo/2.3.3 into lp:mg5amcnlo/lts
- 2.3.3
- Merge into series2.0
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rikkert Frederix | Approve | ||
Review via email: mp+275027@code.launchpad.net |
Commit message
Description of the change
I think this is time to merge.
Any objection?
Olivier
Rikkert Frederix (frederix) wrote : | # |
- 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]
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
Rikkert Frederix (frederix) wrote : | # |
Hi Olivier,
I'm okay with releasing this version.
Cheers,
Rik
- 330. By marco zaro
-
fix for having LOonly running also with processes without colored particles
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:/
> Your team MadDevelopers is subscribed to branch lp:~maddevelopers/mg5amcnlo/2.3.3.
Rikkert Frederix (frederix) wrote : | # |
Hi Marco,
I just checked your last push and I think it is all okay.
Cheers,
Rik
- 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
1 | === modified file 'MadSpin/__init__.py' (properties changed: -x to +x) | |||
2 | === modified file 'MadSpin/decay.py' | |||
3 | --- MadSpin/decay.py 2015-08-20 10:00:00 +0000 | |||
4 | +++ MadSpin/decay.py 2015-10-25 15:32:18 +0000 | |||
5 | @@ -906,7 +906,7 @@ | |||
6 | 906 | if init[0] in self.banner.param_card['decay'].decay_table: | 906 | if init[0] in self.banner.param_card['decay'].decay_table: |
7 | 907 | br *= self.banner.param_card['decay'].decay_table[init[0]].get(lhaid).value | 907 | br *= self.banner.param_card['decay'].decay_table[init[0]].get(lhaid).value |
8 | 908 | br *= self.get_br(decay) | 908 | br *= self.get_br(decay) |
10 | 909 | else: | 909 | elif -init[0] in self.banner.param_card['decay'].decay_table: |
11 | 910 | init = -init[0] | 910 | init = -init[0] |
12 | 911 | lhaid=[x if self.model.get_particle(x)['self_antipart'] else -x | 911 | lhaid=[x if self.model.get_particle(x)['self_antipart'] else -x |
13 | 912 | for x in final] | 912 | for x in final] |
14 | @@ -914,6 +914,13 @@ | |||
15 | 914 | lhaid = tuple([len(final)] + lhaid) | 914 | lhaid = tuple([len(final)] + lhaid) |
16 | 915 | br *= self.banner.param_card['decay'].decay_table[init].get(lhaid).value | 915 | br *= self.banner.param_card['decay'].decay_table[init].get(lhaid).value |
17 | 916 | br *= self.get_br(decay) | 916 | br *= self.get_br(decay) |
18 | 917 | elif init[0] not in self.decay_ids and -init[0] not in self.decay_ids: | ||
19 | 918 | logger.warning("No Branching ratio applied for %s. Please check if this is expected" % init[0]) | ||
20 | 919 | br *= self.get_br(decay) | ||
21 | 920 | else: | ||
22 | 921 | raise MadGraph5Error,"No valid decay for %s. No 2 body decay for that particle. (three body are not supported by MadSpin)" % init[0] | ||
23 | 922 | |||
24 | 923 | |||
25 | 917 | 924 | ||
26 | 918 | for decays in ids.values(): | 925 | for decays in ids.values(): |
27 | 919 | if len(decays) == 1: | 926 | if len(decays) == 1: |
28 | @@ -929,7 +936,7 @@ | |||
29 | 929 | except ValueError: | 936 | except ValueError: |
30 | 930 | break | 937 | break |
31 | 931 | br /= math.factorial(nb) | 938 | br /= math.factorial(nb) |
33 | 932 | 939 | ||
34 | 933 | return br | 940 | return br |
35 | 934 | 941 | ||
36 | 935 | 942 | ||
37 | @@ -1013,7 +1020,7 @@ | |||
38 | 1013 | self[tag]['decaying'] = tuple(decaying) | 1020 | self[tag]['decaying'] = tuple(decaying) |
39 | 1014 | 1021 | ||
40 | 1015 | # sanity check | 1022 | # sanity check |
42 | 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']) |
43 | 1017 | 1024 | ||
44 | 1018 | 1025 | ||
45 | 1019 | 1026 | ||
46 | 1020 | 1027 | ||
47 | === modified file 'MadSpin/interface_madspin.py' (properties changed: -x to +x) | |||
48 | --- MadSpin/interface_madspin.py 2015-08-04 14:28:22 +0000 | |||
49 | +++ MadSpin/interface_madspin.py 2015-10-25 15:32:18 +0000 | |||
50 | @@ -34,6 +34,7 @@ | |||
51 | 34 | import madgraph.interface.master_interface as master_interface | 34 | import madgraph.interface.master_interface as master_interface |
52 | 35 | import madgraph.various.misc as misc | 35 | import madgraph.various.misc as misc |
53 | 36 | import madgraph.iolibs.files as files | 36 | import madgraph.iolibs.files as files |
54 | 37 | import madgraph.iolibs.export_v4 as export_v4 | ||
55 | 37 | import madgraph.various.banner as banner | 38 | import madgraph.various.banner as banner |
56 | 38 | import madgraph.various.lhe_parser as lhe_parser | 39 | import madgraph.various.lhe_parser as lhe_parser |
57 | 39 | 40 | ||
58 | @@ -229,15 +230,24 @@ | |||
59 | 229 | args.remove('--bypass_check') | 230 | args.remove('--bypass_check') |
60 | 230 | bypass_check = True | 231 | bypass_check = True |
61 | 231 | 232 | ||
63 | 232 | if len(args) != 2: | 233 | if len(args) == 1: |
64 | 234 | logger.warning("""No param_card defined for the new model. We will use the default one but this might completely wrong.""") | ||
65 | 235 | elif len(args) != 2: | ||
66 | 233 | return self.InvalidCmd, 'import model requires two arguments' | 236 | return self.InvalidCmd, 'import model requires two arguments' |
67 | 234 | 237 | ||
68 | 235 | model_name = args[0] | 238 | model_name = args[0] |
69 | 236 | card = args[1] | ||
70 | 237 | if not os.path.exists(card): | ||
71 | 238 | raise self.InvalidCmd('%s: no such file' % card) | ||
72 | 239 | |||
73 | 240 | self.load_model(model_name, False, False) | 239 | self.load_model(model_name, False, False) |
74 | 240 | |||
75 | 241 | if len(args) == 2: | ||
76 | 242 | card = args[1] | ||
77 | 243 | if not os.path.exists(card): | ||
78 | 244 | raise self.InvalidCmd('%s: no such file' % card) | ||
79 | 245 | else: | ||
80 | 246 | card = "madspin_param_card.dat" | ||
81 | 247 | export_v4.UFO_model_to_mg4.create_param_card_static(self.model, | ||
82 | 248 | card, rule_card_path=None) | ||
83 | 249 | |||
84 | 250 | |||
85 | 241 | 251 | ||
86 | 242 | #Check the param_card | 252 | #Check the param_card |
87 | 243 | if not bypass_check: | 253 | if not bypass_check: |
88 | @@ -255,11 +265,15 @@ | |||
89 | 255 | if diff: | 265 | if diff: |
90 | 256 | raise self.InvalidCmd('''Original param_card differs on some parameters: | 266 | raise self.InvalidCmd('''Original param_card differs on some parameters: |
91 | 257 | %s | 267 | %s |
93 | 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, |
94 | 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\'''' |
95 | 260 | % diff.replace('\n','\n ')) | 270 | % diff.replace('\n','\n ')) |
96 | 271 | |||
97 | 272 | |||
98 | 261 | 273 | ||
100 | 262 | #OK load the new param_card | 274 | #OK load the new param_card (but back up the old one) |
101 | 275 | if 'slha' in self.banner: | ||
102 | 276 | self.banner['slha_original'] = self.banner['slha'] | ||
103 | 263 | self.banner['slha'] = open(card).read() | 277 | self.banner['slha'] = open(card).read() |
104 | 264 | if hasattr(self.banner, 'param_card'): | 278 | if hasattr(self.banner, 'param_card'): |
105 | 265 | del self.banner.param_card | 279 | del self.banner.param_card |
106 | @@ -749,7 +763,7 @@ | |||
107 | 749 | # 2. Generate the events requested | 763 | # 2. Generate the events requested |
108 | 750 | with misc.MuteLogger(["madgraph", "madevent", "ALOHA", "cmdprint"], [50,50,50,50]): | 764 | with misc.MuteLogger(["madgraph", "madevent", "ALOHA", "cmdprint"], [50,50,50,50]): |
109 | 751 | mg5 = self.mg5cmd | 765 | mg5 = self.mg5cmd |
111 | 752 | modelpath = self.model.get('modelpath') | 766 | modelpath = self.model.get('modelpath+restriction') |
112 | 753 | mg5.exec_cmd("import model %s" % modelpath) | 767 | mg5.exec_cmd("import model %s" % modelpath) |
113 | 754 | to_event = {} | 768 | to_event = {} |
114 | 755 | for pdg, nb_needed in to_decay.items(): | 769 | for pdg, nb_needed in to_decay.items(): |
115 | @@ -923,12 +937,11 @@ | |||
116 | 923 | #base_model = import_ufo.import_model(model_path) | 937 | #base_model = import_ufo.import_model(model_path) |
117 | 924 | 938 | ||
118 | 925 | # Import model | 939 | # Import model |
120 | 926 | base_model = import_ufo.import_model(name, decay=True) | 940 | base_model = import_ufo.import_model(name, decay=True, |
121 | 941 | complex_mass_scheme=complex_mass) | ||
122 | 927 | 942 | ||
123 | 928 | if use_mg_default: | 943 | if use_mg_default: |
124 | 929 | base_model.pass_particles_name_in_mg_default() | 944 | base_model.pass_particles_name_in_mg_default() |
125 | 930 | if complex_mass: | ||
126 | 931 | base_model.change_mass_to_complex_scheme() | ||
127 | 932 | 945 | ||
128 | 933 | self.model = base_model | 946 | self.model = base_model |
129 | 934 | self.mg5cmd._curr_model = self.model | 947 | self.mg5cmd._curr_model = self.model |
130 | 935 | 948 | ||
131 | === modified file 'Template/LO/Source/dsample.f' | |||
132 | --- Template/LO/Source/dsample.f 2015-06-08 16:01:11 +0000 | |||
133 | +++ Template/LO/Source/dsample.f 2015-10-25 15:32:18 +0000 | |||
134 | @@ -1608,7 +1608,7 @@ | |||
135 | 1608 | if (iteration .eq. cur_it) then | 1608 | if (iteration .eq. cur_it) then |
136 | 1609 | c Add the current point to the DiscreteSamplerGrid | 1609 | c Add the current point to the DiscreteSamplerGrid |
137 | 1610 | call add_entry_to_discrete_dimensions(wgt) | 1610 | call add_entry_to_discrete_dimensions(wgt) |
139 | 1611 | if (kn.eq.0) then | 1611 | if (kn.eq.0.and.(iteration.eq.1.or.use_cut.eq.-2)) then |
140 | 1612 | ! ensure that all cumulative variable are at zero (usefull for reset) | 1612 | ! ensure that all cumulative variable are at zero (usefull for reset) |
141 | 1613 | twgt1 = 0d0 ! | 1613 | twgt1 = 0d0 ! |
142 | 1614 | iavg = 0 !Vars for averging to increase err estimate | 1614 | iavg = 0 !Vars for averging to increase err estimate |
143 | @@ -2156,7 +2156,7 @@ | |||
144 | 2156 | c $ access='append',err=129) | 2156 | c $ access='append',err=129) |
145 | 2157 | c write(22, 80) real(tmean), real(tsigma), real(chi2) | 2157 | c write(22, 80) real(tmean), real(tsigma), real(chi2) |
146 | 2158 | c 129 close(22) | 2158 | c 129 close(22) |
148 | 2159 | tsigma = tsigma*sqrt(chi2) !This gives the 68% confidence cross section | 2159 | tsigma = tsigma*sqrt(max(0d0,chi2)) !This gives the 68% confidence cross section |
149 | 2160 | cur_it = itm+20 | 2160 | cur_it = itm+20 |
150 | 2161 | return | 2161 | return |
151 | 2162 | endif | 2162 | endif |
152 | 2163 | 2163 | ||
153 | === modified file 'Template/LO/Source/kin_functions.f' | |||
154 | --- Template/LO/Source/kin_functions.f 2014-09-11 15:22:26 +0000 | |||
155 | +++ Template/LO/Source/kin_functions.f 2015-10-25 15:32:18 +0000 | |||
156 | @@ -127,7 +127,11 @@ | |||
157 | 127 | c pm=dsqrt(p(1)**2+p(2)**2+p(3)**2) | 127 | c pm=dsqrt(p(1)**2+p(2)**2+p(3)**2) |
158 | 128 | 128 | ||
159 | 129 | pm = p(0) | 129 | pm = p(0) |
161 | 130 | rap = .5d0*dlog((pm+p(3))/(pm-p(3)))+cm_rap | 130 | if (pm.gt.p(3)) then |
162 | 131 | rap = .5d0*dlog((pm+p(3))/(pm-p(3)))+cm_rap | ||
163 | 132 | else | ||
164 | 133 | rap = -1d99 | ||
165 | 134 | endif | ||
166 | 131 | end | 135 | end |
167 | 132 | DOUBLE PRECISION FUNCTION rap2(p) | 136 | DOUBLE PRECISION FUNCTION rap2(p) |
168 | 133 | c************************************************************************ | 137 | c************************************************************************ |
169 | 134 | 138 | ||
170 | === modified file 'Template/LO/bin/generate_events' | |||
171 | --- Template/LO/bin/generate_events 2013-11-14 21:10:30 +0000 | |||
172 | +++ Template/LO/bin/generate_events 2015-10-25 15:32:18 +0000 | |||
173 | @@ -149,13 +149,13 @@ | |||
174 | 149 | argument = sys.argv | 149 | argument = sys.argv |
175 | 150 | try: | 150 | try: |
176 | 151 | if '-h' in argument or '--help' in argument: | 151 | if '-h' in argument or '--help' in argument: |
178 | 152 | launch = ME.MadEventCmd(me_dir=root_path) | 152 | launch = ME.MadEventCmdShell(me_dir=root_path) |
179 | 153 | launch.exec_cmd('help generate_events') | 153 | launch.exec_cmd('help generate_events') |
180 | 154 | sys.exit() | 154 | sys.exit() |
181 | 155 | elif len(argument) > 1 and argument[1] in ['0', '1', '2']: | 155 | elif len(argument) > 1 and argument[1] in ['0', '1', '2']: |
182 | 156 | argument = treat_old_argument(argument) | 156 | argument = treat_old_argument(argument) |
183 | 157 | 157 | ||
185 | 158 | launch = ME.MadEventCmd(me_dir=root_path) | 158 | launch = ME.MadEventCmdShell(me_dir=root_path) |
186 | 159 | launch.run_cmd('generate_events %s' % ' '.join(argument[1:])) | 159 | launch.run_cmd('generate_events %s' % ' '.join(argument[1:])) |
187 | 160 | launch.run_cmd('quit') | 160 | launch.run_cmd('quit') |
188 | 161 | except KeyboardInterrupt: | 161 | except KeyboardInterrupt: |
189 | 162 | 162 | ||
190 | === modified file 'Template/LO/bin/internal/Gridpack/compile' | |||
191 | --- Template/LO/bin/internal/Gridpack/compile 2013-11-13 02:21:10 +0000 | |||
192 | +++ Template/LO/bin/internal/Gridpack/compile 2015-10-25 15:32:18 +0000 | |||
193 | @@ -37,8 +37,8 @@ | |||
194 | 37 | fi | 37 | fi |
195 | 38 | 38 | ||
196 | 39 | # Check for LHAPDF | 39 | # Check for LHAPDF |
199 | 40 | c=`awk '/^[^#].*=.*pdlabel/{print $1}' Cards/run_card.dat` | 40 | c=`awk '/^[^#].*=[^#!]*pdlabel/{print $1}' Cards/run_card.dat` |
200 | 41 | if [[ $c == "'lhapdf'" ]]; then | 41 | if [[ $c == "'lhapdf'" || $c == "lhapdf" ]]; then |
201 | 42 | echo Using LHAPDF interface! | 42 | echo Using LHAPDF interface! |
202 | 43 | export lhapdf=true | 43 | export lhapdf=true |
203 | 44 | else | 44 | else |
204 | 45 | 45 | ||
205 | === renamed file 'Template/LO/bin/internal/addmasses.py' => 'Template/LO/bin/internal/addmasses_optional.py' | |||
206 | === modified file 'Template/LO/bin/internal/create_matching_plots.C' | |||
207 | --- Template/LO/bin/internal/create_matching_plots.C 2011-06-29 14:15:21 +0000 | |||
208 | +++ Template/LO/bin/internal/create_matching_plots.C 2015-10-25 15:32:18 +0000 | |||
209 | @@ -1,4 +1,14 @@ | |||
210 | 1 | { | 1 | { |
211 | 2 | const char* file="pythia.root"; | ||
212 | 3 | TFile *f = new TFile(file,"RECREATE"); | ||
213 | 4 | TTree *events = new TTree("events","Events"); | ||
214 | 5 | Long64_t nlines1 = events->ReadFile("events.tree","Npart:DJR1:DJR2:DJR3:DJR4:PTISR:PTFSR:PT2MX:NCJET:IFILE"); | ||
215 | 6 | cout << "Found "<< nlines1 << " events"<<endl; | ||
216 | 7 | TTree *xsecs = new TTree("xsecs","Xsecs"); | ||
217 | 8 | Long64_t nlines2 = xsecs->ReadFile("xsecs.tree","Xsecfact"); | ||
218 | 9 | cout << "Found "<< nlines2 << " files"<<endl; | ||
219 | 10 | f->Write(); | ||
220 | 11 | |||
221 | 2 | gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR1\")"); | 12 | gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR1\")"); |
222 | 3 | gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR2\")"); | 13 | gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR2\")"); |
223 | 4 | gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR3\")"); | 14 | gROOT->ProcessLine(".x ../bin/internal/plot_tree.C(\"DJR3\")"); |
224 | 5 | 15 | ||
225 | === modified file 'Template/LO/bin/internal/create_matching_plots.sh' | |||
226 | --- Template/LO/bin/internal/create_matching_plots.sh 2012-07-20 06:20:21 +0000 | |||
227 | +++ Template/LO/bin/internal/create_matching_plots.sh 2015-10-25 15:32:18 +0000 | |||
228 | @@ -24,9 +24,7 @@ | |||
229 | 24 | exit | 24 | exit |
230 | 25 | fi | 25 | fi |
231 | 26 | 26 | ||
235 | 27 | echo Running root | 27 | echo Creating matching plots |
233 | 28 | root -q -b -l ../bin/internal/read_tree_files.C &> /dev/null | ||
234 | 29 | echo Creating plots | ||
236 | 30 | root -q -b -l ../bin/internal/create_matching_plots.C &> /dev/null | 28 | root -q -b -l ../bin/internal/create_matching_plots.C &> /dev/null |
237 | 31 | mv pythia.root $1/$2_pythia.root | 29 | mv pythia.root $1/$2_pythia.root |
238 | 32 | 30 | ||
239 | 33 | 31 | ||
240 | === modified file 'Template/LO/bin/internal/plot_tree.C' | |||
241 | --- Template/LO/bin/internal/plot_tree.C 2014-09-24 19:41:18 +0000 | |||
242 | +++ Template/LO/bin/internal/plot_tree.C 2015-10-25 15:32:18 +0000 | |||
243 | @@ -1,7 +1,11 @@ | |||
244 | 1 | #include <string> | 1 | #include <string> |
245 | 2 | 2 | ||
247 | 3 | bool plot_tree(char* quantity,char* plotdim="(100,0.,3.)",bool log=true) | 3 | bool plot_tree(const char* quantity, const char* plotdim = 0, bool log = true) |
248 | 4 | { | 4 | { |
249 | 5 | const char* plotdim_default = "(100,0.,3.)"; | ||
250 | 6 | if(plotdim == 0){ | ||
251 | 7 | plotdim = plotdim_default; | ||
252 | 8 | } | ||
253 | 5 | char tmp1[250]; | 9 | char tmp1[250]; |
254 | 6 | char tmp2[300]; | 10 | char tmp2[300]; |
255 | 7 | char tmp3[100]; | 11 | char tmp3[100]; |
256 | 8 | 12 | ||
257 | === removed file 'Template/LO/bin/internal/read_tree_files.C' | |||
258 | --- Template/LO/bin/internal/read_tree_files.C 2011-06-29 14:15:21 +0000 | |||
259 | +++ Template/LO/bin/internal/read_tree_files.C 1970-01-01 00:00:00 +0000 | |||
260 | @@ -1,12 +0,0 @@ | |||
261 | 1 | { | ||
262 | 2 | char* file="pythia.root"; | ||
263 | 3 | TFile *f = new TFile(file,"RECREATE"); | ||
264 | 4 | TTree *events = new TTree("events","Events"); | ||
265 | 5 | Long64_t nlines1 = events->ReadFile("events.tree","Npart:DJR1:DJR2:DJR3:DJR4:PTISR:PTFSR:PT2MX:NCJET:IFILE"); | ||
266 | 6 | cout << "Found "<< nlines1 << " events"<<endl; | ||
267 | 7 | TTree *xsecs = new TTree("xsecs","Xsecs"); | ||
268 | 8 | Long64_t nlines2 = xsecs->ReadFile("xsecs.tree","Xsecfact"); | ||
269 | 9 | cout << "Found "<< nlines2 << " files"<<endl; | ||
270 | 10 | |||
271 | 11 | f->Write(); | ||
272 | 12 | } | ||
273 | 13 | 0 | ||
274 | === modified file 'Template/MadWeight/Python/Info.py' | |||
275 | --- Template/MadWeight/Python/Info.py 2011-10-25 14:42:02 +0000 | |||
276 | +++ Template/MadWeight/Python/Info.py 2015-10-25 15:32:18 +0000 | |||
277 | @@ -1,11 +1,11 @@ | |||
278 | 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
279 | 2 | 2 | ||
280 | 3 | def giveInfo(class_): | 3 | def giveInfo(class_): |
286 | 4 | if type(class_)!=str: | 4 | if type(class_)!=str: |
287 | 5 | class_=class_.__class__.__name__ | 5 | class_=class_.__class__.__name__ |
288 | 6 | for info in dir(eval(class_)): | 6 | for info in dir(eval(class_)): |
289 | 7 | 7 | ||
290 | 8 | print class_+'.'+info+' : ',eval(class_+'.'+info+'.__doc__') | 8 | print class_+'.'+info+' : ',eval(class_+'.'+info+'.__doc__') |
291 | 9 | 9 | ||
292 | 10 | 10 | ||
293 | 11 | 11 | ||
294 | 12 | 12 | ||
295 | === modified file 'Template/MadWeight/Python/clean.py' | |||
296 | --- Template/MadWeight/Python/clean.py 2011-10-25 14:42:02 +0000 | |||
297 | +++ Template/MadWeight/Python/clean.py 2015-10-25 15:32:18 +0000 | |||
298 | @@ -70,7 +70,7 @@ | |||
299 | 70 | ls=os.listdir('.') | 70 | ls=os.listdir('.') |
300 | 71 | for element in ls: | 71 | for element in ls: |
301 | 72 | if os.path.isdir(element) and element[0]=='P': | 72 | if os.path.isdir(element) and element[0]=='P': |
303 | 73 | status,mess=clean.suppress_dir(os.path.join(element,run_name)) | 73 | status,mess=clean.suppress_dir(os.path.join(element,run_name)) |
304 | 74 | #if not status: | 74 | #if not status: |
305 | 75 | # print 'supress ',element,' failed:' | 75 | # print 'supress ',element,' failed:' |
306 | 76 | # print mess | 76 | # print mess |
307 | @@ -93,7 +93,7 @@ | |||
308 | 93 | ls=os.listdir('.') | 93 | ls=os.listdir('.') |
309 | 94 | for element in ls: | 94 | for element in ls: |
310 | 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': |
312 | 96 | status,mess=clean.suppress_dir(os.path.join(element,run_name)) | 96 | status,mess=clean.suppress_dir(os.path.join(element,run_name)) |
313 | 97 | #if not status: | 97 | #if not status: |
314 | 98 | # print 'supress ',element,' failed:' | 98 | # print 'supress ',element,' failed:' |
315 | 99 | # print mess | 99 | # print mess |
316 | 100 | 100 | ||
317 | === modified file 'Template/NLO/Cards/run_card.dat' | |||
318 | --- Template/NLO/Cards/run_card.dat 2015-07-30 15:57:44 +0000 | |||
319 | +++ Template/NLO/Cards/run_card.dat 2015-10-25 15:32:18 +0000 | |||
320 | @@ -66,6 +66,8 @@ | |||
321 | 66 | # WARNING: PYTHIA6PT works only for processes without FSR!!!! * | 66 | # WARNING: PYTHIA6PT works only for processes without FSR!!!! * |
322 | 67 | #*********************************************************************** | 67 | #*********************************************************************** |
323 | 68 | %(parton_shower)s = parton_shower | 68 | %(parton_shower)s = parton_shower |
324 | 69 | %(shower_scale_factor)s = shower_scale_factor ! multiply default shower starting | ||
325 | 70 | ! scale by this factor | ||
326 | 69 | #*********************************************************************** | 71 | #*********************************************************************** |
327 | 70 | # Renormalization and factorization scales * | 72 | # Renormalization and factorization scales * |
328 | 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 * |
329 | 72 | 74 | ||
330 | === modified file 'Template/NLO/Cards/shower_card.dat' | |||
331 | --- Template/NLO/Cards/shower_card.dat 2015-03-09 17:19:46 +0000 | |||
332 | +++ Template/NLO/Cards/shower_card.dat 2015-10-25 15:32:18 +0000 | |||
333 | @@ -85,15 +85,15 @@ | |||
334 | 85 | # * | 85 | # * |
335 | 86 | # Examples of syntax: * | 86 | # Examples of syntax: * |
336 | 87 | # Z -> e+ e- or mu+ mu- with BR = 0.5 each * | 87 | # Z -> e+ e- or mu+ mu- with BR = 0.5 each * |
339 | 88 | # DM_1 = 23 > -11 11 @ 0.5d0 @ 100 * | 88 | # DM_1 = 23 > -11 11 @ 0.5d0 @ 100 |
340 | 89 | # DM_2 = 23 > -13 13 @ 0.5d0 @ 100 * | 89 | # DM_2 = 23 > -13 13 @ 0.5d0 @ 100 |
341 | 90 | # H -> tau+ tau- with BR = 1 * | 90 | # H -> tau+ tau- with BR = 1 * |
343 | 91 | # DM_3 = 25 > -15 15 @ 1.0d0 @ 0 * | 91 | # DM_3 = 25 > -15 15 @ 1.0d0 @ 0 |
344 | 92 | # t -> nu_e e+ b with BR = 1 (HERWIG) * | 92 | # t -> nu_e e+ b with BR = 1 (HERWIG) * |
346 | 93 | # DM_4 = 6 > 12 -11 5 @ 1d0 @ 100 * | 93 | # DM_4 = 6 > 12 -11 5 @ 1d0 @ 100 |
347 | 94 | # t -> nu_e e+ b with BR = 1 (PYTHIA) * | 94 | # t -> nu_e e+ b with BR = 1 (PYTHIA) * |
350 | 95 | # DM_5 = 6 > 24 5 @ 1d0 @ 100 * | 95 | # DM_5 = 6 > 24 5 @ 1d0 @ 100 |
351 | 96 | # DM_6 = 24 > 12 -11 @ 1d0 @ 100 * | 96 | # DM_6 = 24 > 12 -11 @ 1d0 @ 100 |
352 | 97 | #*********************************************************************** | 97 | #*********************************************************************** |
353 | 98 | # Extra Libraries/analyses * | 98 | # Extra Libraries/analyses * |
354 | 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 * |
355 | 100 | 100 | ||
356 | === modified file 'Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script' | |||
357 | --- Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script 2015-04-24 09:57:53 +0000 | |||
358 | +++ Template/NLO/MCatNLO/Scripts/MCatNLO_MadFKS_PYTHIA8.Script 2015-10-25 15:32:18 +0000 | |||
359 | @@ -517,6 +517,7 @@ | |||
360 | 517 | TimeShower:MEafterFirst = off ! No Matrix-element corrections after first emission | 517 | TimeShower:MEafterFirst = off ! No Matrix-element corrections after first emission |
361 | 518 | TimeShower:phiPolAsym = on ! Azimuthal asymmetry induced by gluon polarization | 518 | TimeShower:phiPolAsym = on ! Azimuthal asymmetry induced by gluon polarization |
362 | 519 | TimeShower:alphaSuseCMW = false ! Use the CMW prescription in FSR | 519 | TimeShower:alphaSuseCMW = false ! Use the CMW prescription in FSR |
363 | 520 | TimeShower:weightGluonToQuark = 1 ! Use normal Altarelli-Parisi kernels for g -> q qbar | ||
364 | 520 | 521 | ||
365 | 521 | ! 6) Initial-state shower. | 522 | ! 6) Initial-state shower. |
366 | 522 | SpaceShower:pTmaxMatch = 1 ! Use scalup (re-check) | 523 | SpaceShower:pTmaxMatch = 1 ! Use scalup (re-check) |
367 | 523 | 524 | ||
368 | === modified file 'Template/NLO/Source/PDF/pdg2pdf.f' | |||
369 | --- Template/NLO/Source/PDF/pdg2pdf.f 2015-08-07 08:57:55 +0000 | |||
370 | +++ Template/NLO/Source/PDF/pdg2pdf.f 2015-10-25 15:32:18 +0000 | |||
371 | @@ -47,7 +47,11 @@ | |||
372 | 47 | data pdlabellast/20*'abcdefg'/ | 47 | data pdlabellast/20*'abcdefg'/ |
373 | 48 | data ihlast/20*-99/ | 48 | data ihlast/20*-99/ |
374 | 49 | data i_replace/20/ | 49 | data i_replace/20/ |
376 | 50 | 50 | if (ih.eq.0) then | |
377 | 51 | c Lepton collisions (no PDF). | ||
378 | 52 | pdg2pdf=1d0 | ||
379 | 53 | return | ||
380 | 54 | endif | ||
381 | 51 | c Make sure we have a reasonable Bjorken x. Note that even though | 55 | c Make sure we have a reasonable Bjorken x. Note that even though |
382 | 52 | c x=0 is not reasonable, we prefer to simply return pdg2pdf=0 | 56 | c x=0 is not reasonable, we prefer to simply return pdg2pdf=0 |
383 | 53 | c instead of stopping the code, as this might accidentally happen. | 57 | c instead of stopping the code, as this might accidentally happen. |
384 | 54 | 58 | ||
385 | === modified file 'Template/NLO/Source/PDF/pdg2pdf_lhapdf.f' | |||
386 | --- Template/NLO/Source/PDF/pdg2pdf_lhapdf.f 2014-12-19 08:08:03 +0000 | |||
387 | +++ Template/NLO/Source/PDF/pdg2pdf_lhapdf.f 2015-10-25 15:32:18 +0000 | |||
388 | @@ -45,6 +45,12 @@ | |||
389 | 45 | data imemlast/20*-99/ | 45 | data imemlast/20*-99/ |
390 | 46 | data i_replace/20/ | 46 | data i_replace/20/ |
391 | 47 | 47 | ||
392 | 48 | if (ih.eq.0) then | ||
393 | 49 | c Lepton collisions (no PDF). | ||
394 | 50 | pdg2pdf=1d0 | ||
395 | 51 | return | ||
396 | 52 | endif | ||
397 | 53 | |||
398 | 48 | c Make sure we have a reasonable Bjorken x. Note that even though | 54 | c Make sure we have a reasonable Bjorken x. Note that even though |
399 | 49 | c x=0 is not reasonable, we prefer to simply return pdg2pdf=0 | 55 | c x=0 is not reasonable, we prefer to simply return pdg2pdf=0 |
400 | 50 | c instead of stopping the code, as this might accidentally happen. | 56 | c instead of stopping the code, as this might accidentally happen. |
401 | 51 | 57 | ||
402 | === modified file 'Template/NLO/Source/run.inc' | |||
403 | --- Template/NLO/Source/run.inc 2015-04-02 22:56:24 +0000 | |||
404 | +++ Template/NLO/Source/run.inc 2015-10-25 15:32:18 +0000 | |||
405 | @@ -39,6 +39,9 @@ | |||
406 | 39 | common/cscales_current_values/muR2_current,muF12_current, | 39 | common/cscales_current_values/muR2_current,muF12_current, |
407 | 40 | # muF22_current,QES2_current | 40 | # muF22_current,QES2_current |
408 | 41 | 41 | ||
409 | 42 | c Re-scale of the shower starting scale | ||
410 | 43 | double precision shower_scale_factor | ||
411 | 44 | common/cshower_scale_factor/shower_scale_factor | ||
412 | 42 | c | 45 | c |
413 | 43 | c Collider | 46 | c Collider |
414 | 44 | c | 47 | c |
415 | 45 | 48 | ||
416 | === modified file 'Template/NLO/Source/run_config.inc' | |||
417 | --- Template/NLO/Source/run_config.inc 2012-08-28 21:06:34 +0000 | |||
418 | +++ Template/NLO/Source/run_config.inc 2015-10-25 15:32:18 +0000 | |||
419 | @@ -34,7 +34,7 @@ | |||
420 | 34 | parameter (PBS_QUE = 'madgraph') | 34 | parameter (PBS_QUE = 'madgraph') |
421 | 35 | 35 | ||
422 | 36 | integer ChanPerJob | 36 | integer ChanPerJob |
424 | 37 | parameter (ChanPerJob=1) !Number of channels / job for survey | 37 | parameter (ChanPerJob=100000000) !Number of channels / job for survey |
425 | 38 | 38 | ||
426 | 39 | c integer max_np | 39 | c integer max_np |
427 | 40 | c parameter (max_np=1) !Number of channels / job for refine | 40 | c parameter (max_np=1) !Number of channels / job for refine |
428 | 41 | 41 | ||
429 | === modified file 'Template/NLO/SubProcesses/ajob_template' | |||
430 | --- Template/NLO/SubProcesses/ajob_template 2015-03-18 14:50:37 +0000 | |||
431 | +++ Template/NLO/SubProcesses/ajob_template 2015-10-25 15:32:18 +0000 | |||
432 | @@ -26,57 +26,38 @@ | |||
433 | 26 | exit | 26 | exit |
434 | 27 | fi | 27 | fi |
435 | 28 | 28 | ||
436 | 29 | channel=$1 | ||
437 | 30 | run_mode=$2 | ||
438 | 31 | runnumber=$3 | ||
439 | 32 | integration_step=$4 | ||
440 | 33 | |||
441 | 29 | TAGTAGTAGTAGTAGTAGTAG for i in 1 ; do | 34 | TAGTAGTAGTAGTAGTAGTAG for i in 1 ; do |
442 | 30 | 35 | ||
492 | 31 | runnumber=0 | 36 | if [[ $run_mode == 'all' || $run_mode == 'born' ]] ; then |
493 | 32 | if [[ $1 == '0' ]]; then | 37 | j=$run_mode\_G$i |
494 | 33 | j=$2\_G$i | 38 | else |
495 | 34 | if [[ ! -e $j ]]; then | 39 | if [[ $runnumber == '0' ]] ; then |
496 | 35 | mkdir $j | 40 | j=G$run_mode$i |
497 | 36 | fi | 41 | else |
498 | 37 | cd $j | 42 | j=G$run_mode$i\_$runnumber |
499 | 38 | if [[ "$4" != "" ]]; then | 43 | fi |
500 | 39 | if [[ -e ../$4\_G$i ]]; then | 44 | fi |
501 | 40 | if [[ $1 == '0' ]]; then | 45 | cd $j |
502 | 41 | cp -f ../$4\_G$i/mint_grids . >/dev/null 2>&1 | 46 | |
503 | 42 | cp -f ../$4\_G$i/grid.MC_integer . >/dev/null 2>&1 | 47 | if [[ -e res.dat ]] ; then |
504 | 43 | elif [[ $1 == '1' ]]; then | 48 | rm -f res.dat |
505 | 44 | cp -f ../$4\_G$i/mint_grids . >/dev/null 2>&1 | 49 | fi |
506 | 45 | cp -f ../$4\_G$i/grid.MC_integer . >/dev/null 2>&1 | 50 | if [[ -e log.txt ]] ; then |
507 | 46 | fi | 51 | rm -f log.txt |
508 | 47 | else | 52 | fi |
509 | 48 | echo "Cannot find directory ../$4\_G$i/" > log.txt | 53 | if [[ -e MADatNLO.top ]] ; then |
510 | 49 | exit | 54 | rm -f MADatNLO.top |
511 | 50 | fi | 55 | fi |
512 | 51 | fi | 56 | if [[ -e MADatNLO.HwU ]] ; then |
513 | 52 | elif [[ $1 == '2' ]]; then | 57 | rm -f MADatNLO.HwU |
514 | 53 | j=G$2$i | 58 | fi |
515 | 54 | if [[ ! -e $j ]]; then | 59 | if [[ -e MADatNLO.root ]] ; then |
516 | 55 | mkdir $j | 60 | rm -f MADatNLO.root |
468 | 56 | fi | ||
469 | 57 | |||
470 | 58 | cd $j | ||
471 | 59 | if [[ "$4" != "" ]]; then | ||
472 | 60 | if [[ "$4" == "H" ||"$4" == "S" || "$4" == "V" || "$4" == "B" || "$4" == "F" ]]; then | ||
473 | 61 | if [[ -e ../G$4$i ]]; then | ||
474 | 62 | cp -f ../G$4$i/mint_grids ./preset_mint_grids >/dev/null 2>&1 | ||
475 | 63 | cp -f ../G$4$i/grid.MC_integer . >/dev/null 2>&1 | ||
476 | 64 | else | ||
477 | 65 | echo "Cannot find direcotry ../G$4$i/" > log.txt | ||
478 | 66 | exit | ||
479 | 67 | fi | ||
480 | 68 | else | ||
481 | 69 | runnumber=$4 | ||
482 | 70 | if [[ ! -e ../${j}_$4 ]]; then | ||
483 | 71 | mkdir ../${j}_$4 | ||
484 | 72 | fi | ||
485 | 73 | cd ../${j}_$4 | ||
486 | 74 | ln -sf ../${j}/mint_grids | ||
487 | 75 | ln -sf ../${j}/mint_grids_NLO | ||
488 | 76 | ln -sf ../${j}/grid.MC_integer | ||
489 | 77 | ln -sf ../${j}/res_1 | ||
490 | 78 | fi | ||
491 | 79 | fi | ||
517 | 80 | fi | 61 | fi |
518 | 81 | if [[ -e randinit ]] ; then | 62 | if [[ -e randinit ]] ; then |
519 | 82 | rm -f randinit | 63 | rm -f randinit |
520 | @@ -97,67 +78,25 @@ | |||
521 | 97 | link1up FKS_params.dat | 78 | link1up FKS_params.dat |
522 | 98 | link1up configs_and_props_info.dat | 79 | link1up configs_and_props_info.dat |
523 | 99 | link1up leshouche_info.dat | 80 | link1up leshouche_info.dat |
524 | 100 | # Not necessary anymore | ||
525 | 101 | # link1up MadLoop5_resources | ||
526 | 102 | link1up OLE_order.olc | 81 | link1up OLE_order.olc |
527 | 103 | link1up param_card.dat | 82 | link1up param_card.dat |
528 | 104 | link1up initial_states_map.dat | 83 | link1up initial_states_map.dat |
529 | 105 | 84 | ||
530 | 106 | # check where is the basic file for the creation of input_app.txt | ||
531 | 107 | # | ||
532 | 108 | if [[ $1 == '0' ]]; then | ||
533 | 109 | if [[ $3 == '-1' && -e ./madinM1 ]] ; then | ||
534 | 110 | input_template=./madinM1 | ||
535 | 111 | else | ||
536 | 112 | if [[ -e ../madin.$2 ]] ; then | ||
537 | 113 | input_template=../madin.$2 | ||
538 | 114 | else | ||
539 | 115 | input_template=../../madin.$2 | ||
540 | 116 | fi | ||
541 | 117 | fi | ||
542 | 118 | elif [[ $1 == '2' ]]; then | ||
543 | 119 | if [[ $3 == '0' || $3 == '2' ]]; then | ||
544 | 120 | if [[ -e ../madinMMC_$2.2 ]] ; then | ||
545 | 121 | input_template=../madinMMC_$2.2 | ||
546 | 122 | else | ||
547 | 123 | input_template=../../madinMMC_$2.2 | ||
548 | 124 | fi | ||
549 | 125 | else | ||
550 | 126 | input_template=./madinM1 | ||
551 | 127 | fi | ||
552 | 128 | fi | ||
553 | 129 | 85 | ||
559 | 130 | if [[ $1 == '0' ]]; then | 86 | T="$(date +%s)" |
560 | 131 | head -n 5 $input_template >& input_app.txt | 87 | if [[ $run_mode == 'all' || $run_mode == 'born' ]]; then |
556 | 132 | echo $i >> input_app.txt | ||
557 | 133 | tail -n 4 $input_template >> input_app.txt | ||
558 | 134 | T="$(date +%s)" | ||
561 | 135 | ../madevent_mintFO > log.txt <input_app.txt 2>&1 | 88 | ../madevent_mintFO > log.txt <input_app.txt 2>&1 |
566 | 136 | status=$? | 89 | else |
563 | 137 | T="$(($(date +%s)-T))" | ||
564 | 138 | echo "Time in seconds: ${T}" >>log.txt | ||
565 | 139 | elif [[ $1 == '2' ]]; then | ||
567 | 140 | if [[ $runnumber != 0 ]]; then | 90 | if [[ $runnumber != 0 ]]; then |
568 | 141 | tar --extract --file=../nevents.tar nevts_${j}_$runnumber | ||
569 | 142 | mv nevts_${j}_$runnumber nevts | ||
570 | 143 | echo "$runnumber" >& moffset.dat | 91 | echo "$runnumber" >& moffset.dat |
571 | 144 | fi | 92 | fi |
572 | 145 | if [[ $3 == '0' || $3 == '2' ]]; then | ||
573 | 146 | head -n 6 $input_template > input_app.txt | ||
574 | 147 | echo $i >> input_app.txt | ||
575 | 148 | tail -n 3 $input_template >> input_app.txt | ||
576 | 149 | elif [[ $3 == '1' ]]; then | ||
577 | 150 | head -n 6 $input_template > input_app.txt | ||
578 | 151 | echo $i >> input_app.txt | ||
579 | 152 | tail -n 3 $input_template >> input_app.txt | ||
580 | 153 | fi | ||
581 | 154 | T="$(date +%s)" | ||
582 | 155 | ../madevent_mintMC > log.txt <input_app.txt 2>&1 | 93 | ../madevent_mintMC > log.txt <input_app.txt 2>&1 |
583 | 156 | status=$? | ||
584 | 157 | T="$(($(date +%s)-T))" | ||
585 | 158 | echo "Time in seconds: ${T}" >>log.txt | ||
586 | 159 | cp -f log.txt log_MINT$3.txt >/dev/null 2>&1 | ||
587 | 160 | fi | 94 | fi |
588 | 95 | status=$? | ||
589 | 96 | T="$(($(date +%s)-T))" | ||
590 | 97 | echo "Time in seconds: ${T}" >>log.txt | ||
591 | 98 | cp -f log.txt log_MINT$integration_step.txt >/dev/null 2>&1 | ||
592 | 99 | cp -f res.dat res_$integration_step.dat >/dev/null 2>&1 | ||
593 | 161 | exit $status | 100 | exit $status |
594 | 162 | done | 101 | done |
595 | 163 | 102 | ||
596 | 164 | 103 | ||
597 | === modified file 'Template/NLO/SubProcesses/check_poles.f' | |||
598 | --- Template/NLO/SubProcesses/check_poles.f 2014-11-03 10:50:20 +0000 | |||
599 | +++ Template/NLO/SubProcesses/check_poles.f 2015-10-25 15:32:18 +0000 | |||
600 | @@ -108,7 +108,7 @@ | |||
601 | 108 | enddo | 108 | enddo |
602 | 109 | call fks_inc_chooser() | 109 | call fks_inc_chooser() |
603 | 110 | call leshouche_inc_chooser() | 110 | call leshouche_inc_chooser() |
605 | 111 | call setfksfactor(1) | 111 | call setfksfactor(1,.false.) |
606 | 112 | 112 | ||
607 | 113 | nfail = 0 | 113 | nfail = 0 |
608 | 114 | npointsChecked = 0 | 114 | npointsChecked = 0 |
609 | 115 | 115 | ||
610 | === removed file 'Template/NLO/SubProcesses/combine_results.sh' | |||
611 | --- Template/NLO/SubProcesses/combine_results.sh 2013-06-28 13:57:17 +0000 | |||
612 | +++ Template/NLO/SubProcesses/combine_results.sh 1970-01-01 00:00:00 +0000 | |||
613 | @@ -1,55 +0,0 @@ | |||
614 | 1 | #!/bin/bash | ||
615 | 2 | |||
616 | 3 | # find the correct directory | ||
617 | 4 | if [[ ! -d ./SubProcesses ]]; then | ||
618 | 5 | cd ../ | ||
619 | 6 | fi | ||
620 | 7 | if [[ -d ./SubProcesses ]]; then | ||
621 | 8 | cd SubProcesses | ||
622 | 9 | fi | ||
623 | 10 | |||
624 | 11 | if [[ -e res.txt ]]; then | ||
625 | 12 | rm -f res.txt | ||
626 | 13 | fi | ||
627 | 14 | if [[ -e dirs.txt ]]; then | ||
628 | 15 | rm -f dirs.txt | ||
629 | 16 | fi | ||
630 | 17 | if [[ -e nevents_unweighted ]]; then | ||
631 | 18 | rm -f nevents_unweighted | ||
632 | 19 | fi | ||
633 | 20 | |||
634 | 21 | arg1=$1 | ||
635 | 22 | arg2=$2 | ||
636 | 23 | arg3=$3 | ||
637 | 24 | # shift the list of arguments by 3 | ||
638 | 25 | shift | ||
639 | 26 | shift | ||
640 | 27 | shift | ||
641 | 28 | if [[ "$@" == "" ]]; then | ||
642 | 29 | echo "Please give the G directories that should be combined," | ||
643 | 30 | echo "e.g. 'GF* GV*', as final arguments of this script" | ||
644 | 31 | exit | ||
645 | 32 | fi | ||
646 | 33 | |||
647 | 34 | touch res.txt | ||
648 | 35 | touch dirs.txt | ||
649 | 36 | NTOT=0 | ||
650 | 37 | for dir in "$@" ; do | ||
651 | 38 | N=`ls -d P*/$dir | wc -l` | ||
652 | 39 | NTOT=`expr $NTOT + $N` | ||
653 | 40 | ls -d P*/$dir >> dirs.txt | ||
654 | 41 | grep -H 'Final result' P*/$dir/res_$arg1 >> res.txt | ||
655 | 42 | done | ||
656 | 43 | echo N of directories: $NTOT | ||
657 | 44 | if [[ $arg1 == '0' ]] ; then | ||
658 | 45 | echo 'Determining the number of unweighted events per channel' | ||
659 | 46 | elif [[ $arg1 == '1' ]] ; then | ||
660 | 47 | echo 'Updating the number of unweighted events per channel' | ||
661 | 48 | fi | ||
662 | 49 | ./sumres.py $NTOT $arg2 $arg3 | ||
663 | 50 | |||
664 | 51 | echo 'Integrated abs(cross-section)' | ||
665 | 52 | tail -n2 res.txt | head -n1 | ||
666 | 53 | echo 'Integrated cross-section' | ||
667 | 54 | tail -n1 res.txt | ||
668 | 55 | mv res.txt res_$arg1.txt | ||
669 | 56 | 0 | ||
670 | === removed file 'Template/NLO/SubProcesses/combine_results_FO.sh' | |||
671 | --- Template/NLO/SubProcesses/combine_results_FO.sh 2013-06-28 13:57:17 +0000 | |||
672 | +++ Template/NLO/SubProcesses/combine_results_FO.sh 1970-01-01 00:00:00 +0000 | |||
673 | @@ -1,52 +0,0 @@ | |||
674 | 1 | #!/bin/bash | ||
675 | 2 | |||
676 | 3 | # find the correct directory | ||
677 | 4 | if [[ ! -d ./SubProcesses ]]; then | ||
678 | 5 | cd ../ | ||
679 | 6 | fi | ||
680 | 7 | if [[ -d ./SubProcesses ]]; then | ||
681 | 8 | cd SubProcesses | ||
682 | 9 | fi | ||
683 | 10 | |||
684 | 11 | if [[ $1 == "0" ]] ; then | ||
685 | 12 | mint_mode=0 | ||
686 | 13 | shift | ||
687 | 14 | elif [[ $1 == "1" ]] ; then | ||
688 | 15 | mint_mode=1 | ||
689 | 16 | shift | ||
690 | 17 | elif [[ $1 == "2" ]] ; then | ||
691 | 18 | echo "Cannot combine results for mint_mode 2" | ||
692 | 19 | exit | ||
693 | 20 | else | ||
694 | 21 | mint_mode=0 | ||
695 | 22 | fi | ||
696 | 23 | |||
697 | 24 | if [[ -e res.txt ]]; then | ||
698 | 25 | rm -f res.txt | ||
699 | 26 | fi | ||
700 | 27 | if [[ -e dirs.txt ]]; then | ||
701 | 28 | rm -f dirs.txt | ||
702 | 29 | fi | ||
703 | 30 | |||
704 | 31 | req_acc=$1 | ||
705 | 32 | shift | ||
706 | 33 | |||
707 | 34 | touch res.txt | ||
708 | 35 | touch dirs.txt | ||
709 | 36 | NTOT=0 | ||
710 | 37 | for dir in "$@" ; do | ||
711 | 38 | N=`ls -d P*/$dir | wc -l` | ||
712 | 39 | NTOT=`expr $NTOT + $N` | ||
713 | 40 | ls -d P*/$dir >> dirs.txt | ||
714 | 41 | grep -H 'Final result' P*/$dir/res_$mint_mode >> res.txt | ||
715 | 42 | done | ||
716 | 43 | |||
717 | 44 | sed -i.bak s/"\+\/\-"/" \+\/\-"/ res.txt | ||
718 | 45 | |||
719 | 46 | echo N of directories: $NTOT | ||
720 | 47 | |||
721 | 48 | ./sumres.py $NTOT -1 $req_acc | ||
722 | 49 | |||
723 | 50 | rm -r res.txt.bak | ||
724 | 51 | |||
725 | 52 | tail -n1 res.txt | ||
726 | 53 | 0 | ||
727 | === modified file 'Template/NLO/SubProcesses/combine_root.sh' | |||
728 | --- Template/NLO/SubProcesses/combine_root.sh 2013-12-09 10:15:28 +0000 | |||
729 | +++ Template/NLO/SubProcesses/combine_root.sh 2015-10-25 15:32:18 +0000 | |||
730 | @@ -65,7 +65,7 @@ | |||
731 | 65 | echo ".x combine_root.C" >> rootinput.txt | 65 | echo ".x combine_root.C" >> rootinput.txt |
732 | 66 | echo ".q" >> rootinput.txt | 66 | echo ".q" >> rootinput.txt |
733 | 67 | 67 | ||
735 | 68 | root < rootinput.txt | 68 | root -b < rootinput.txt |
736 | 69 | 69 | ||
737 | 70 | rm -f rootinput.txt | 70 | rm -f rootinput.txt |
738 | 71 | } | 71 | } |
739 | 72 | 72 | ||
740 | === modified file 'Template/NLO/SubProcesses/driver_mintFO.f' | |||
741 | --- Template/NLO/SubProcesses/driver_mintFO.f 2015-03-09 18:27:17 +0000 | |||
742 | +++ Template/NLO/SubProcesses/driver_mintFO.f 2015-10-25 15:32:18 +0000 | |||
743 | @@ -18,7 +18,6 @@ | |||
744 | 18 | C LOCAL | 18 | C LOCAL |
745 | 19 | C | 19 | C |
746 | 20 | integer i,j,l,l1,l2,ndim | 20 | integer i,j,l,l1,l2,ndim |
747 | 21 | integer npoints | ||
748 | 22 | character*130 buf | 21 | character*130 buf |
749 | 23 | c | 22 | c |
750 | 24 | c Global | 23 | c Global |
751 | @@ -171,7 +170,7 @@ | |||
752 | 171 | else | 170 | else |
753 | 172 | flat_grid=.false. | 171 | flat_grid=.false. |
754 | 173 | endif | 172 | endif |
756 | 174 | ndim = 3*(nexternal-2)-4 | 173 | ndim = 3*(nexternal-nincoming)-4 |
757 | 175 | if (abs(lpp(1)) .ge. 1) ndim=ndim+1 | 174 | if (abs(lpp(1)) .ge. 1) ndim=ndim+1 |
758 | 176 | if (abs(lpp(2)) .ge. 1) ndim=ndim+1 | 175 | if (abs(lpp(2)) .ge. 1) ndim=ndim+1 |
759 | 177 | c Don't proceed if muF1#muF2 (we need to work out the relevant formulae | 176 | c Don't proceed if muF1#muF2 (we need to work out the relevant formulae |
760 | @@ -219,23 +218,7 @@ | |||
761 | 219 | do j=1,nintervals_virt | 218 | do j=1,nintervals_virt |
762 | 220 | read (12,*) (ave_virt(j,i),i=1,ndim) | 219 | read (12,*) (ave_virt(j,i),i=1,ndim) |
763 | 221 | enddo | 220 | enddo |
781 | 222 | if (ncall.gt.0 .and. accuracy.ne.0d0) then | 221 | read (12,*) ans(1),unc(1),dummy,dummy |
765 | 223 | read (12,*) ans(1),unc(1),ncall,itmax | ||
766 | 224 | c Update the number of PS points based on unc(1), ncall and accuracy | ||
767 | 225 | itmax_fl=itmax*(unc(1)/accuracy)**2 | ||
768 | 226 | if (itmax_fl.le.4d0) then | ||
769 | 227 | itmax=max(nint(itmax_fl),2) | ||
770 | 228 | elseif (itmax_fl.gt.4d0 .and. itmax_fl.le.16d0) then | ||
771 | 229 | ncall=nint(ncall*itmax_fl/4d0) | ||
772 | 230 | itmax=4 | ||
773 | 231 | else | ||
774 | 232 | itmax=nint(sqrt(itmax_fl)) | ||
775 | 233 | ncall=nint(ncall*itmax_fl/nint(sqrt(itmax_fl))) | ||
776 | 234 | endif | ||
777 | 235 | accuracy=accuracy/ans(1) ! relative accuracy on the ABS X-section | ||
778 | 236 | else | ||
779 | 237 | read (12,*) ans(1),unc(1),dummy,dummy | ||
780 | 238 | endif | ||
782 | 239 | read (12,*) virtual_fraction,average_virtual | 222 | read (12,*) virtual_fraction,average_virtual |
783 | 240 | close (12) | 223 | close (12) |
784 | 241 | write (*,*) "Update iterations and points to",itmax,ncall | 224 | write (*,*) "Update iterations and points to",itmax,ncall |
785 | @@ -253,10 +236,6 @@ | |||
786 | 253 | call mint(sigint,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt | 236 | call mint(sigint,ndim,ncall,itmax,imode,xgrid,ymax,ymax_virt |
787 | 254 | $ ,ans,unc,chi2) | 237 | $ ,ans,unc,chi2) |
788 | 255 | call topout | 238 | call topout |
789 | 256 | open(unit=58,file='res_0',status='unknown') | ||
790 | 257 | write(58,*)'Final result [ABS]:',ans(1),' +/-',unc(1) | ||
791 | 258 | write(58,*)'Final result:',ans(2),' +/-',unc(2) | ||
792 | 259 | close(58) | ||
793 | 260 | write(*,*)'Final result [ABS]:',ans(1),' +/-',unc(1) | 239 | write(*,*)'Final result [ABS]:',ans(1),' +/-',unc(1) |
794 | 261 | write(*,*)'Final result:',ans(2),' +/-',unc(2) | 240 | write(*,*)'Final result:',ans(2),' +/-',unc(2) |
795 | 262 | write(*,*)'chi**2 per D.o.F.:',chi2(1) | 241 | write(*,*)'chi**2 per D.o.F.:',chi2(1) |
796 | @@ -337,6 +316,11 @@ | |||
797 | 337 | write(*,*) 'Time spent in Other_tasks : ',tOther | 316 | write(*,*) 'Time spent in Other_tasks : ',tOther |
798 | 338 | write(*,*) 'Time spent in Total : ',tTot | 317 | write(*,*) 'Time spent in Total : ',tTot |
799 | 339 | 318 | ||
800 | 319 | open (unit=12, file='res.dat',status='unknown') | ||
801 | 320 | write (12,*)ans(1),unc(1),ans(2),unc(2),itmax,ncall,tTot | ||
802 | 321 | close(12) | ||
803 | 322 | |||
804 | 323 | |||
805 | 340 | if(i_momcmp_count.ne.0)then | 324 | if(i_momcmp_count.ne.0)then |
806 | 341 | write(*,*)' ' | 325 | write(*,*)' ' |
807 | 342 | write(*,*)'WARNING: genps_fks code 555555' | 326 | write(*,*)'WARNING: genps_fks code 555555' |
808 | @@ -538,7 +522,7 @@ | |||
809 | 538 | call fks_inc_chooser() | 522 | call fks_inc_chooser() |
810 | 539 | call leshouche_inc_chooser() | 523 | call leshouche_inc_chooser() |
811 | 540 | call setcuts | 524 | call setcuts |
813 | 541 | call setfksfactor(iconfig) | 525 | call setfksfactor(iconfig,.false.) |
814 | 542 | return | 526 | return |
815 | 543 | end | 527 | end |
816 | 544 | 528 | ||
817 | @@ -680,8 +664,6 @@ | |||
818 | 680 | character * 70 idstring | 664 | character * 70 idstring |
819 | 681 | logical savegrid | 665 | logical savegrid |
820 | 682 | 666 | ||
821 | 683 | character * 80 runstr | ||
822 | 684 | common/runstr/runstr | ||
823 | 685 | logical usexinteg,mint | 667 | logical usexinteg,mint |
824 | 686 | common/cusexinteg/usexinteg,mint | 668 | common/cusexinteg/usexinteg,mint |
825 | 687 | logical unwgt | 669 | logical unwgt |
826 | @@ -692,84 +674,98 @@ | |||
827 | 692 | double precision volh | 674 | double precision volh |
828 | 693 | common/mc_int2/volh,mc_hel,ihel,fillh | 675 | common/mc_int2/volh,mc_hel,ihel,fillh |
829 | 694 | 676 | ||
831 | 695 | 677 | logical done | |
832 | 678 | character*100 buffer | ||
833 | 696 | c----- | 679 | c----- |
834 | 697 | c Begin Code | 680 | c Begin Code |
835 | 698 | c----- | 681 | c----- |
836 | 699 | mint=.true. | 682 | mint=.true. |
837 | 700 | unwgt=.false. | 683 | unwgt=.false. |
880 | 701 | write(*,'(a)') 'Enter number of events and iterations: ' | 684 | open (unit=83,file='input_app.txt',status='old') |
881 | 702 | read(*,*) ncall,itmax | 685 | done=.false. |
882 | 703 | write(*,*) 'Number of events and iterations ',ncall,itmax | 686 | do while (.not. done) |
883 | 704 | write(*,'(a)') 'Enter desired accuracy: ' | 687 | read(83,'(a)',err=222,end=222) buffer |
884 | 705 | read(*,*) accuracy | 688 | if (buffer(1:7).eq.'NPOINTS') then |
885 | 706 | write(*,*) 'Desired absolute accuracy: ',accuracy | 689 | buffer=buffer(10:100) |
886 | 707 | 690 | read(buffer,*) ncall | |
887 | 708 | write(*,'(a)') 'Enter 0 for fixed, 2 for adjustable grid: ' | 691 | write (*,*) 'Number of phase-space points per iteration:',ncall |
888 | 709 | read(*,*) use_cut | 692 | elseif(buffer(1:11).eq.'NITERATIONS') then |
889 | 710 | if (use_cut .lt. 0 .or. use_cut .gt. 2) then | 693 | read(buffer(14:),*) itmax |
890 | 711 | write(*,*) 'Bad choice, using 2',use_cut | 694 | write (*,*) 'Maximum number of iterations is:',itmax |
891 | 712 | use_cut = 2 | 695 | elseif(buffer(1:8).eq.'ACCURACY') then |
892 | 713 | endif | 696 | read(buffer(11:),*) accuracy |
893 | 714 | 697 | write (*,*) 'Desired accuracy is:',accuracy | |
894 | 715 | write(*,10) 'Suppress amplitude (0 no, 1 yes)? ' | 698 | elseif(buffer(1:10).eq.'ADAPT_GRID') then |
895 | 716 | read(*,*) i | 699 | read(buffer(13:),*) use_cut |
896 | 717 | if (i .eq. 1) then | 700 | write (*,*) 'Using adaptive grids:',use_cut |
897 | 718 | multi_channel = .true. | 701 | elseif(buffer(1:12).eq.'MULTICHANNEL') then |
898 | 719 | write(*,*) 'Using suppressed amplitude.' | 702 | read(buffer(15:),*) i |
899 | 720 | else | 703 | if (i.eq.1) then |
900 | 721 | multi_channel = .false. | 704 | multi_channel=.true. |
901 | 722 | write(*,*) 'Using full amplitude.' | 705 | write (*,*) 'Using Multi-channel integration' |
902 | 723 | endif | 706 | else |
903 | 724 | 707 | multi_channel=.false. | |
904 | 725 | write(*,10) 'Exact helicity sum (0 yes, n = number/event)? ' | 708 | write (*,*) 'Not using Multi-channel integration' |
905 | 726 | read(*,*) i | 709 | endif |
906 | 727 | if (i .eq. 0) then | 710 | elseif(buffer(1:12).eq.'SUM_HELICITY') then |
907 | 728 | mc_hel = 0 | 711 | read(buffer(15:),*) i |
908 | 729 | write(*,*) 'Explicitly summing over helicities for virt' | 712 | if (nincoming.eq.1) then |
909 | 730 | else | 713 | write (*,*) 'Sum over helicities in the virtuals'/ |
910 | 731 | mc_hel= i | 714 | $ /' for decay process' |
911 | 732 | write(*,*) 'Summing over',i,' helicities/event for virt' | 715 | mc_hel=0 |
912 | 733 | endif | 716 | elseif (i.eq.0) then |
913 | 734 | isum_hel=0 | 717 | mc_hel=0 |
914 | 735 | 718 | write (*,*) 'Explicitly summing over helicities'/ | |
915 | 736 | write(*,10) 'Enter Configuration Number: ' | 719 | $ /' for the virtuals' |
916 | 737 | read(*,*) dconfig | 720 | else |
917 | 738 | iconfig = int(dconfig) | 721 | mc_hel=1 |
918 | 739 | do i=1,mapconfig(0) | 722 | write(*,*) 'Do MC over helicities for the virtuals' |
919 | 740 | if (iconfig.eq.mapconfig(i)) then | 723 | endif |
920 | 741 | iconfig=i | 724 | isum_hel=0 |
921 | 742 | exit | 725 | elseif(buffer(1:7).eq.'CHANNEL') then |
922 | 726 | read(buffer(10:),*) dconfig | ||
923 | 727 | iconfig = int(dconfig) | ||
924 | 728 | do i=1,mapconfig(0) | ||
925 | 729 | if (iconfig.eq.mapconfig(i)) then | ||
926 | 730 | iconfig=i | ||
927 | 731 | exit | ||
928 | 732 | endif | ||
929 | 733 | enddo | ||
930 | 734 | write(*,12) 'Running Configuration Number: ',iconfig | ||
931 | 735 | elseif(buffer(1:5).eq.'SPLIT') then | ||
932 | 736 | read(buffer(8:),*) i | ||
933 | 737 | write (*,*) 'Splitting channel:',i | ||
934 | 738 | elseif(buffer(1:8).eq.'RUN_MODE') then | ||
935 | 739 | read(buffer(11:),*) abrvinput | ||
936 | 740 | if(abrvinput(5:5).eq.'0')then | ||
937 | 741 | nbody=.true. | ||
938 | 742 | else | ||
939 | 743 | nbody=.false. | ||
940 | 744 | endif | ||
941 | 745 | abrv=abrvinput(1:4) | ||
942 | 746 | write (*,*) "doing the ",abrv," of this channel" | ||
943 | 747 | if(nbody)then | ||
944 | 748 | write (*,*) "integration Born/virtual with Sfunction=1" | ||
945 | 749 | else | ||
946 | 750 | write (*,*) "Normal integration (Sfunction != 1)" | ||
947 | 751 | endif | ||
948 | 752 | elseif(buffer(1:7).eq.'RESTART') then | ||
949 | 753 | read(buffer(10:),*) irestart | ||
950 | 754 | if (irestart.eq.0) then | ||
951 | 755 | write (*,*) 'RESTART: Fresh run' | ||
952 | 756 | elseif(irestart.eq.-1) then | ||
953 | 757 | write (*,*) 'RESTART: Use old grids, but refil plots' | ||
954 | 758 | elseif(irestart.eq.1) then | ||
955 | 759 | write (*,*) 'RESTART: continue with existing run' | ||
956 | 760 | else | ||
957 | 761 | write (*,*) 'RESTART:',irestart | ||
958 | 762 | endif | ||
959 | 743 | endif | 763 | endif |
960 | 764 | cycle | ||
961 | 765 | 222 done=.true. | ||
962 | 744 | enddo | 766 | enddo |
979 | 745 | write(*,12) 'Running Configuration Number: ',iconfig | 767 | close(83) |
964 | 746 | c | ||
965 | 747 | c Enter parameters that control Vegas grids | ||
966 | 748 | c | ||
967 | 749 | write(*,*)'enter id string for this run' | ||
968 | 750 | read(*,*) idstring | ||
969 | 751 | runstr=idstring | ||
970 | 752 | write(*,*)'enter 1 if you want restart files' | ||
971 | 753 | read (*,*) itmp | ||
972 | 754 | if(itmp.eq.1) then | ||
973 | 755 | savegrid = .true. | ||
974 | 756 | else | ||
975 | 757 | savegrid = .false. | ||
976 | 758 | endif | ||
977 | 759 | write(*,*)'enter 0 to exclude, 1 for new run, 2 to restart' | ||
978 | 760 | read(5,*)irestart | ||
980 | 761 | 768 | ||
981 | 762 | abrvinput=' ' | ||
982 | 763 | write (*,*) "'all ', 'born', 'real', 'virt', 'novi' or 'grid'?" | ||
983 | 764 | write (*,*) "Enter 'born0' or 'virt0' to perform" | ||
984 | 765 | write (*,*) " a pure n-body integration (no S functions)" | ||
985 | 766 | read(5,*) abrvinput | ||
986 | 767 | if(abrvinput(5:5).eq.'0')then | ||
987 | 768 | nbody=.true. | ||
988 | 769 | else | ||
989 | 770 | nbody=.false. | ||
990 | 771 | endif | ||
991 | 772 | abrv=abrvinput(1:4) | ||
992 | 773 | if (fks_configs.eq.1) then | 769 | if (fks_configs.eq.1) then |
993 | 774 | if (pdg_type_d(1,fks_i_d(1)).eq.-21) then | 770 | if (pdg_type_d(1,fks_i_d(1)).eq.-21) then |
994 | 775 | write (*,*) 'Process generated with [LOonly=QCD]. '/ | 771 | write (*,*) 'Process generated with [LOonly=QCD]. '/ |
995 | @@ -782,26 +778,6 @@ | |||
996 | 782 | endif | 778 | endif |
997 | 783 | endif | 779 | endif |
998 | 784 | endif | 780 | endif |
999 | 785 | c Options are way too many: make sure we understand all of them | ||
1000 | 786 | if ( abrv.ne.'all '.and.abrv.ne.'born'.and.abrv.ne.'real'.and. | ||
1001 | 787 | & abrv.ne.'virt'.and. | ||
1002 | 788 | & abrv.ne.'viSC'.and.abrv.ne.'viLC'.and.abrv.ne.'novA'.and. | ||
1003 | 789 | & abrv.ne.'novB'.and.abrv.ne.'viSA'.and.abrv.ne.'viSB') then | ||
1004 | 790 | write(*,*)'Error in input: abrv is:',abrv | ||
1005 | 791 | stop | ||
1006 | 792 | endif | ||
1007 | 793 | if(nbody.and.abrv.ne.'born'.and.abrv(1:2).ne.'vi' | ||
1008 | 794 | & .and. abrv.ne.'grid')then | ||
1009 | 795 | write(*,*)'Error in driver: inconsistent input',abrvinput | ||
1010 | 796 | stop | ||
1011 | 797 | endif | ||
1012 | 798 | |||
1013 | 799 | write (*,*) "doing the ",abrv," of this channel" | ||
1014 | 800 | if(nbody)then | ||
1015 | 801 | write (*,*) "integration Born/virtual with Sfunction=1" | ||
1016 | 802 | else | ||
1017 | 803 | write (*,*) "Normal integration (Sfunction != 1)" | ||
1018 | 804 | endif | ||
1019 | 805 | c | 781 | c |
1020 | 806 | c | 782 | c |
1021 | 807 | c Here I want to set up with B.W. we map and which we don't | 783 | c Here I want to set up with B.W. we map and which we don't |
1022 | 808 | 784 | ||
1023 | === modified file 'Template/NLO/SubProcesses/driver_mintMC.f' | |||
1024 | --- Template/NLO/SubProcesses/driver_mintMC.f 2015-08-13 12:43:02 +0000 | |||
1025 | +++ Template/NLO/SubProcesses/driver_mintMC.f 2015-10-25 15:32:18 +0000 | |||
1026 | @@ -108,6 +108,11 @@ | |||
1027 | 108 | call cpu_time(tBefore) | 108 | call cpu_time(tBefore) |
1028 | 109 | fixed_order=.false. | 109 | fixed_order=.false. |
1029 | 110 | nlo_ps=.true. | 110 | nlo_ps=.true. |
1030 | 111 | if (nincoming.ne.2) then | ||
1031 | 112 | write (*,*) 'Decay processes not supported for'/ | ||
1032 | 113 | & /' event generation' | ||
1033 | 114 | stop 1 | ||
1034 | 115 | endif | ||
1035 | 111 | 116 | ||
1036 | 112 | c Read general MadFKS parameters | 117 | c Read general MadFKS parameters |
1037 | 113 | c | 118 | c |
1038 | @@ -158,7 +163,7 @@ | |||
1039 | 158 | else | 163 | else |
1040 | 159 | flat_grid=.false. | 164 | flat_grid=.false. |
1041 | 160 | endif | 165 | endif |
1043 | 161 | ndim = 3*(nexternal-2)-4 | 166 | ndim = 3*(nexternal-nincoming)-4 |
1044 | 162 | if (abs(lpp(1)) .ge. 1) ndim=ndim+1 | 167 | if (abs(lpp(1)) .ge. 1) ndim=ndim+1 |
1045 | 163 | if (abs(lpp(2)) .ge. 1) ndim=ndim+1 | 168 | if (abs(lpp(2)) .ge. 1) ndim=ndim+1 |
1046 | 164 | c Don''t proceed if muF1#muF2 (we need to work out the relevant formulae | 169 | c Don''t proceed if muF1#muF2 (we need to work out the relevant formulae |
1047 | @@ -189,7 +194,7 @@ | |||
1048 | 189 | enddo | 194 | enddo |
1049 | 190 | else | 195 | else |
1050 | 191 | c to restore grids: | 196 | c to restore grids: |
1052 | 192 | open (unit=12, file='preset_mint_grids',status='old') | 197 | open (unit=12, file='mint_grids',status='old') |
1053 | 193 | do j=0,nintervals | 198 | do j=0,nintervals |
1054 | 194 | read (12,*) (xgrid(j,i),i=1,ndim) | 199 | read (12,*) (xgrid(j,i),i=1,ndim) |
1055 | 195 | enddo | 200 | enddo |
1056 | @@ -285,7 +290,7 @@ | |||
1057 | 285 | close(58) | 290 | close(58) |
1058 | 286 | 291 | ||
1059 | 287 | c to save grids: | 292 | c to save grids: |
1061 | 288 | open (unit=12, file='mint_grids_NLO',status='unknown') | 293 | open (unit=12, file='mint_grids',status='unknown') |
1062 | 289 | write (12,*) (xgrid(0,i),i=1,ndim) | 294 | write (12,*) (xgrid(0,i),i=1,ndim) |
1063 | 290 | do j=1,nintervals | 295 | do j=1,nintervals |
1064 | 291 | write (12,*) (xgrid(j,i),i=1,ndim) | 296 | write (12,*) (xgrid(j,i),i=1,ndim) |
1065 | @@ -301,7 +306,6 @@ | |||
1066 | 301 | write (12,*) virtual_fraction,average_virtual | 306 | write (12,*) virtual_fraction,average_virtual |
1067 | 302 | close (12) | 307 | close (12) |
1068 | 303 | 308 | ||
1069 | 304 | |||
1070 | 305 | c************************************************************* | 309 | c************************************************************* |
1071 | 306 | c event generation | 310 | c event generation |
1072 | 307 | c************************************************************* | 311 | c************************************************************* |
1073 | @@ -323,7 +327,7 @@ | |||
1074 | 323 | ncall=nevts ! Update ncall with the number found in 'nevts' | 327 | ncall=nevts ! Update ncall with the number found in 'nevts' |
1075 | 324 | 328 | ||
1076 | 325 | c to restore grids: | 329 | c to restore grids: |
1078 | 326 | open (unit=12, file='mint_grids_NLO',status='unknown') | 330 | open (unit=12, file='mint_grids',status='unknown') |
1079 | 327 | read (12,*) (xgrid(0,i),i=1,ndim) | 331 | read (12,*) (xgrid(0,i),i=1,ndim) |
1080 | 328 | do j=1,nintervals | 332 | do j=1,nintervals |
1081 | 329 | read (12,*) (xgrid(j,i),i=1,ndim) | 333 | read (12,*) (xgrid(j,i),i=1,ndim) |
1082 | @@ -468,6 +472,15 @@ | |||
1083 | 468 | write(*,*) 'Time spent in Other_tasks : ',tOther | 472 | write(*,*) 'Time spent in Other_tasks : ',tOther |
1084 | 469 | write(*,*) 'Time spent in Total : ',tTot | 473 | write(*,*) 'Time spent in Total : ',tTot |
1085 | 470 | 474 | ||
1086 | 475 | open (unit=12, file='res.dat',status='unknown') | ||
1087 | 476 | if (imode.eq.0) then | ||
1088 | 477 | write (12,*)ans(1),unc(1),ans(2),unc(2),itmax,ncall,tTot | ||
1089 | 478 | else | ||
1090 | 479 | write (12,*)ans(1)+ans(5),sqrt(unc(1)**2+unc(5)**2),ans(2) | ||
1091 | 480 | $ ,unc(2),itmax,ncall,tTot | ||
1092 | 481 | endif | ||
1093 | 482 | close(12) | ||
1094 | 483 | |||
1095 | 471 | return | 484 | return |
1096 | 472 | 999 write (*,*) 'nevts file not found' | 485 | 999 write (*,*) 'nevts file not found' |
1097 | 473 | stop | 486 | stop |
1098 | @@ -630,12 +643,17 @@ | |||
1099 | 630 | 643 | ||
1100 | 631 | write(*,10) 'Exact helicity sum (0 yes, n = number/event)? ' | 644 | write(*,10) 'Exact helicity sum (0 yes, n = number/event)? ' |
1101 | 632 | read(*,*) i | 645 | read(*,*) i |
1105 | 633 | if (i .eq. 0) then | 646 | if (nincoming.eq.1) then |
1106 | 634 | mc_hel= 0 | 647 | write (*,*) 'Sum over helicities in the virtuals'/ |
1107 | 635 | write(*,*) 'Explicitly summing over helicities for virt' | 648 | $ /' for decay process' |
1108 | 649 | mc_hel=0 | ||
1109 | 650 | elseif (i.eq.0) then | ||
1110 | 651 | mc_hel=0 | ||
1111 | 652 | write (*,*) 'Explicitly summing over helicities'/ | ||
1112 | 653 | $ /' for the virtuals' | ||
1113 | 636 | else | 654 | else |
1116 | 637 | mc_hel= i | 655 | mc_hel=1 |
1117 | 638 | write(*,*) 'Summing over',i,' helicities/event for virt' | 656 | write(*,*) 'Do MC over helicities for the virtuals' |
1118 | 639 | endif | 657 | endif |
1119 | 640 | isum_hel = 0 | 658 | isum_hel = 0 |
1120 | 641 | 659 | ||
1121 | @@ -1204,7 +1222,7 @@ | |||
1122 | 1204 | call fks_inc_chooser() | 1222 | call fks_inc_chooser() |
1123 | 1205 | call leshouche_inc_chooser() | 1223 | call leshouche_inc_chooser() |
1124 | 1206 | call setcuts | 1224 | call setcuts |
1126 | 1207 | call setfksfactor(iconfig) | 1225 | call setfksfactor(iconfig,.true.) |
1127 | 1208 | return | 1226 | return |
1128 | 1209 | end | 1227 | end |
1129 | 1210 | 1228 | ||
1130 | 1211 | 1229 | ||
1131 | === modified file 'Template/NLO/SubProcesses/fks_Sij.f' | |||
1132 | --- Template/NLO/SubProcesses/fks_Sij.f 2012-08-28 21:06:34 +0000 | |||
1133 | +++ Template/NLO/SubProcesses/fks_Sij.f 2015-10-25 15:32:18 +0000 | |||
1134 | @@ -90,9 +90,13 @@ | |||
1135 | 90 | 90 | ||
1136 | 91 | c Consistency check -- call to set_cms_stuff() must be done prior to | 91 | c Consistency check -- call to set_cms_stuff() must be done prior to |
1137 | 92 | c entering this function | 92 | c entering this function |
1139 | 93 | shattmp=2d0*dot(p(0,1),p(0,2)) | 93 | if (nincoming.eq.2) then |
1140 | 94 | shattmp=2d0*dot(p(0,1),p(0,2)) | ||
1141 | 95 | else | ||
1142 | 96 | shattmp=p(0,1)**2 | ||
1143 | 97 | endif | ||
1144 | 94 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then | 98 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then |
1146 | 95 | write(*,*)'Error in fks_Sij: inconsistent shat' | 99 | write(*,*)'Error in fks_Sij: inconsistent shat #1' |
1147 | 96 | write(*,*)shattmp,shat | 100 | write(*,*)shattmp,shat |
1148 | 97 | stop | 101 | stop |
1149 | 98 | endif | 102 | endif |
1150 | @@ -148,6 +152,7 @@ | |||
1151 | 148 | do j=1,fks_j_from_i(i,0) | 152 | do j=1,fks_j_from_i(i,0) |
1152 | 149 | kk = i | 153 | kk = i |
1153 | 150 | ll = fks_j_from_i(i,j) | 154 | ll = fks_j_from_i(i,j) |
1154 | 155 | if (nincoming.ne.2 .and. ll.le.nincoming) cycle | ||
1155 | 151 | if ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.0 ) then | 156 | if ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.0 ) then |
1156 | 152 | ijskip(kk,ll) = 1 | 157 | ijskip(kk,ll) = 1 |
1157 | 153 | elseif ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.1 ) then | 158 | elseif ( ijskip(kk,ll).eq.0 .and. ijskip(ll,kk).eq.1 ) then |
1158 | @@ -178,6 +183,7 @@ | |||
1159 | 178 | do j=1,fks_j_from_i(i,0) | 183 | do j=1,fks_j_from_i(i,0) |
1160 | 179 | kk = i | 184 | kk = i |
1161 | 180 | ll = fks_j_from_i(i,j) | 185 | ll = fks_j_from_i(i,j) |
1162 | 186 | if (nincoming.ne.2 .and. ll.le.nincoming) cycle | ||
1163 | 181 | if(ijskip(kk,ll).ne.1)goto 222 | 187 | if(ijskip(kk,ll).ne.1)goto 222 |
1164 | 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. |
1165 | 183 | # ll.gt.nincoming)then | 189 | # ll.gt.nincoming)then |
1166 | @@ -567,7 +573,11 @@ | |||
1167 | 567 | 573 | ||
1168 | 568 | c Consistency check -- call to set_cms_stuff() must be done prior to | 574 | c Consistency check -- call to set_cms_stuff() must be done prior to |
1169 | 569 | c entering this function | 575 | c entering this function |
1171 | 570 | shattmp=2d0*dot(p(0,1),p(0,2)) | 576 | if (nincoming.eq.2) then |
1172 | 577 | shattmp=2d0*dot(p(0,1),p(0,2)) | ||
1173 | 578 | else | ||
1174 | 579 | shattmp=p(0,1)**2 | ||
1175 | 580 | endif | ||
1176 | 571 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then | 581 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then |
1177 | 572 | write(*,*)'Error in fks_Hij: inconsistent shat' | 582 | write(*,*)'Error in fks_Hij: inconsistent shat' |
1178 | 573 | write(*,*)shattmp,shat | 583 | write(*,*)shattmp,shat |
1179 | 574 | 584 | ||
1180 | === modified file 'Template/NLO/SubProcesses/fks_inc_chooser.f' | |||
1181 | --- Template/NLO/SubProcesses/fks_inc_chooser.f 2012-08-28 21:06:34 +0000 | |||
1182 | +++ Template/NLO/SubProcesses/fks_inc_chooser.f 2015-10-25 15:32:18 +0000 | |||
1183 | @@ -32,7 +32,6 @@ | |||
1184 | 32 | pdg_type(i)=pdg_type_D(nFKSprocess,i) | 32 | pdg_type(i)=pdg_type_D(nFKSprocess,i) |
1185 | 33 | enddo | 33 | enddo |
1186 | 34 | do i=1,nexternal | 34 | do i=1,nexternal |
1187 | 35 | |||
1188 | 36 | if (i.lt.min(i_fks,j_fks)) then | 35 | if (i.lt.min(i_fks,j_fks)) then |
1189 | 37 | particle_type_born(i)=particle_type(i) | 36 | particle_type_born(i)=particle_type(i) |
1190 | 38 | elseif (i.gt.max(i_fks,j_fks)) then | 37 | elseif (i.gt.max(i_fks,j_fks)) then |
1191 | @@ -63,6 +62,9 @@ | |||
1192 | 63 | else | 62 | else |
1193 | 64 | m_type=j_type | 63 | m_type=j_type |
1194 | 65 | endif | 64 | endif |
1195 | 65 | elseif(i_type.eq.8.and.j_type.eq.1.and.pdg_type(i_fks).eq.-21)then | ||
1196 | 66 | ! dirty trick for LOonly processes without colored legs | ||
1197 | 67 | m_type=j_type | ||
1198 | 66 | else | 68 | else |
1199 | 67 | write(*,*)'Flavour mismatch #2 in fks_inc_chooser', | 69 | write(*,*)'Flavour mismatch #2 in fks_inc_chooser', |
1200 | 68 | & i_type,j_type,m_type | 70 | & i_type,j_type,m_type |
1201 | 69 | 71 | ||
1202 | === modified file 'Template/NLO/SubProcesses/fks_singular.f' | |||
1203 | --- Template/NLO/SubProcesses/fks_singular.f 2015-08-19 12:50:52 +0000 | |||
1204 | +++ Template/NLO/SubProcesses/fks_singular.f 2015-10-25 15:32:18 +0000 | |||
1205 | @@ -1034,6 +1034,10 @@ | |||
1206 | 1034 | $ ,pswgt_cnt(-2:2),jac_cnt(-2:2) | 1034 | $ ,pswgt_cnt(-2:2),jac_cnt(-2:2) |
1207 | 1035 | common/counterevnts/p1_cnt,wgt_cnt,pswgt_cnt,jac_cnt | 1035 | common/counterevnts/p1_cnt,wgt_cnt,pswgt_cnt,jac_cnt |
1208 | 1036 | if (wgt1.eq.0d0 .and. wgt2.eq.0d0 .and. wgt3.eq.0d0) return | 1036 | if (wgt1.eq.0d0 .and. wgt2.eq.0d0 .and. wgt3.eq.0d0) return |
1209 | 1037 | c Check for NaN's and INF's. Simply skip the contribution | ||
1210 | 1038 | if (wgt1.ne.wgt1) return | ||
1211 | 1039 | if (wgt2.ne.wgt2) return | ||
1212 | 1040 | if (wgt3.ne.wgt3) return | ||
1213 | 1037 | icontr=icontr+1 | 1041 | icontr=icontr+1 |
1214 | 1038 | if (icontr.gt.max_contr) then | 1042 | if (icontr.gt.max_contr) then |
1215 | 1039 | write (*,*) 'ERROR in add_wgt: too many contributions' | 1043 | write (*,*) 'ERROR in add_wgt: too many contributions' |
1216 | @@ -1226,7 +1230,12 @@ | |||
1217 | 1226 | c PDG codes | 1230 | c PDG codes |
1218 | 1227 | niproc(ict)=iproc | 1231 | niproc(ict)=iproc |
1219 | 1228 | do j=1,iproc | 1232 | do j=1,iproc |
1221 | 1229 | parton_iproc(j,ict)=pd(j)*conv | 1233 | if (nincoming.eq.2) then |
1222 | 1234 | parton_iproc(j,ict)=pd(j)*conv | ||
1223 | 1235 | else | ||
1224 | 1236 | c Keep GeV's for decay processes (no conv. factor needed) | ||
1225 | 1237 | parton_iproc(j,ict)=pd(j) | ||
1226 | 1238 | endif | ||
1227 | 1230 | do k=1,nexternal | 1239 | do k=1,nexternal |
1228 | 1231 | parton_pdg(k,j,ict)=idup_d(iFKS,k,j) | 1240 | parton_pdg(k,j,ict)=idup_d(iFKS,k,j) |
1229 | 1232 | if (k.lt.fks_j_d(iFKS)) then | 1241 | if (k.lt.fks_j_d(iFKS)) then |
1230 | @@ -2195,9 +2204,15 @@ | |||
1231 | 2195 | do ii=1,iproc_save(nFKS(ict)) | 2204 | do ii=1,iproc_save(nFKS(ict)) |
1232 | 2196 | if (eto(ii,nFKS(ict)).ne.ipr) cycle | 2205 | if (eto(ii,nFKS(ict)).ne.ipr) cycle |
1233 | 2197 | n_ctr_found=n_ctr_found+1 | 2206 | n_ctr_found=n_ctr_found+1 |
1237 | 2198 | write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)') | 2207 | if (nincoming.eq.2) then |
1238 | 2199 | & (wgt(j,ict)*conv,j=1,3), | 2208 | write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)') |
1239 | 2200 | & nexternal | 2209 | & (wgt(j,ict)*conv,j=1,3), |
1240 | 2210 | & nexternal | ||
1241 | 2211 | else | ||
1242 | 2212 | write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)') | ||
1243 | 2213 | & (wgt(j,ict),j=1,3), | ||
1244 | 2214 | & nexternal | ||
1245 | 2215 | endif | ||
1246 | 2201 | procid='' | 2216 | procid='' |
1247 | 2202 | do j=1,nexternal | 2217 | do j=1,nexternal |
1248 | 2203 | write (str_temp,*) parton_pdg(j,ii,ict) | 2218 | write (str_temp,*) parton_pdg(j,ii,ict) |
1249 | @@ -2223,9 +2238,15 @@ | |||
1250 | 2223 | c H-event | 2238 | c H-event |
1251 | 2224 | ipr=iproc_picked | 2239 | ipr=iproc_picked |
1252 | 2225 | n_ctr_found=n_ctr_found+1 | 2240 | n_ctr_found=n_ctr_found+1 |
1256 | 2226 | write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)') | 2241 | if (nincoming.eq.2) then |
1257 | 2227 | & (wgt(j,ict)*conv,j=1,3), | 2242 | write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)') |
1258 | 2228 | & nexternal | 2243 | & (wgt(j,ict)*conv,j=1,3), |
1259 | 2244 | & nexternal | ||
1260 | 2245 | else | ||
1261 | 2246 | write (n_ctr_str(n_ctr_found),'(3(1x,d18.12),1x,i2)') | ||
1262 | 2247 | & (wgt(j,ict),j=1,3), | ||
1263 | 2248 | & nexternal | ||
1264 | 2249 | endif | ||
1265 | 2229 | procid='' | 2250 | procid='' |
1266 | 2230 | do j=1,nexternal | 2251 | do j=1,nexternal |
1267 | 2231 | write (str_temp,*) parton_pdg(j,ipr,ict) | 2252 | write (str_temp,*) parton_pdg(j,ipr,ict) |
1268 | @@ -2338,7 +2359,7 @@ | |||
1269 | 2338 | do i=0,3 | 2359 | do i=0,3 |
1270 | 2339 | xsum(i)=0.d0 | 2360 | xsum(i)=0.d0 |
1271 | 2340 | xsuma(i)=0.d0 | 2361 | xsuma(i)=0.d0 |
1273 | 2341 | do j=3,npart | 2362 | do j=nincoming+1,npart |
1274 | 2342 | xsum(i)=xsum(i)+xmom(i,j) | 2363 | xsum(i)=xsum(i)+xmom(i,j) |
1275 | 2343 | xsuma(i)=xsuma(i)+abs(xmom(i,j)) | 2364 | xsuma(i)=xsuma(i)+abs(xmom(i,j)) |
1276 | 2344 | enddo | 2365 | enddo |
1277 | @@ -2405,9 +2426,14 @@ | |||
1278 | 2405 | pass=.true. | 2426 | pass=.true. |
1279 | 2406 | jflag=0 | 2427 | jflag=0 |
1280 | 2407 | do i=0,3 | 2428 | do i=0,3 |
1284 | 2408 | xsum(i)=-xmom(i,1)-xmom(i,2) | 2429 | if (nincoming.eq.2) then |
1285 | 2409 | xsuma(i)=abs(xmom(i,1))+abs(xmom(i,2)) | 2430 | xsum(i)=-xmom(i,1)-xmom(i,2) |
1286 | 2410 | do j=3,npart | 2431 | xsuma(i)=abs(xmom(i,1))+abs(xmom(i,2)) |
1287 | 2432 | elseif(nincoming.eq.1) then | ||
1288 | 2433 | xsum(i)=-xmom(i,1) | ||
1289 | 2434 | xsuma(i)=abs(xmom(i,1)) | ||
1290 | 2435 | endif | ||
1291 | 2436 | do j=nincoming+1,npart | ||
1292 | 2411 | xsum(i)=xsum(i)+xmom(i,j) | 2437 | xsum(i)=xsum(i)+xmom(i,j) |
1293 | 2412 | xsuma(i)=xsuma(i)+abs(xmom(i,j)) | 2438 | xsuma(i)=xsuma(i)+abs(xmom(i,j)) |
1294 | 2413 | enddo | 2439 | enddo |
1295 | @@ -2420,14 +2446,14 @@ | |||
1296 | 2420 | write(*,*)'Momentum is not conserved [nocms]' | 2446 | write(*,*)'Momentum is not conserved [nocms]' |
1297 | 2421 | write(*,*)'i=',i | 2447 | write(*,*)'i=',i |
1298 | 2422 | do j=1,npart | 2448 | do j=1,npart |
1300 | 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) |
1301 | 2424 | enddo | 2450 | enddo |
1302 | 2425 | jflag=1 | 2451 | jflag=1 |
1303 | 2426 | endif | 2452 | endif |
1304 | 2427 | enddo | 2453 | enddo |
1305 | 2428 | if(jflag.eq.1)then | 2454 | if(jflag.eq.1)then |
1308 | 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) |
1309 | 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) |
1310 | 2431 | pass=.false. | 2457 | pass=.false. |
1311 | 2432 | return | 2458 | return |
1312 | 2433 | endif | 2459 | endif |
1313 | @@ -2454,7 +2480,11 @@ | |||
1314 | 2454 | endif | 2480 | endif |
1315 | 2455 | enddo | 2481 | enddo |
1316 | 2456 | c | 2482 | c |
1318 | 2457 | ecmtmp=sqrt(2d0*dot(xmom(0,1),xmom(0,2))) | 2483 | if (nincoming.eq.2) then |
1319 | 2484 | ecmtmp=sqrt(2d0*dot(xmom(0,1),xmom(0,2))) | ||
1320 | 2485 | elseif (nincoming.eq.1) then | ||
1321 | 2486 | ecmtmp=xmom(0,1) | ||
1322 | 2487 | endif | ||
1323 | 2458 | if(abs(ecm-ecmtmp).gt.vtiny)then | 2488 | if(abs(ecm-ecmtmp).gt.vtiny)then |
1324 | 2459 | write(*,*)'Inconsistent shat [nocms]' | 2489 | write(*,*)'Inconsistent shat [nocms]' |
1325 | 2460 | write(*,*)'ecm given= ',ecm | 2490 | write(*,*)'ecm given= ',ecm |
1326 | @@ -2687,6 +2717,9 @@ | |||
1327 | 2687 | 2717 | ||
1328 | 2688 | double precision zero,tiny | 2718 | double precision zero,tiny |
1329 | 2689 | parameter (zero=0d0) | 2719 | parameter (zero=0d0) |
1330 | 2720 | |||
1331 | 2721 | integer icount | ||
1332 | 2722 | data icount /0/ | ||
1333 | 2690 | 2723 | ||
1334 | 2691 | c Particle types (=color) of i_fks, j_fks and fks_mother | 2724 | c Particle types (=color) of i_fks, j_fks and fks_mother |
1335 | 2692 | integer i_type,j_type,m_type | 2725 | integer i_type,j_type,m_type |
1336 | @@ -2709,7 +2742,11 @@ | |||
1337 | 2709 | 2742 | ||
1338 | 2710 | c Consistency check -- call to set_cms_stuff() must be done prior to | 2743 | c Consistency check -- call to set_cms_stuff() must be done prior to |
1339 | 2711 | c entering this function | 2744 | c entering this function |
1341 | 2712 | shattmp=2d0*dot(pp(0,1),pp(0,2)) | 2745 | if (nincoming.eq.2) then |
1342 | 2746 | shattmp=2d0*dot(pp(0,1),pp(0,2)) | ||
1343 | 2747 | else | ||
1344 | 2748 | shattmp=pp(0,1)**2 | ||
1345 | 2749 | endif | ||
1346 | 2713 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then | 2750 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then |
1347 | 2714 | write(*,*)'Error in sreal: inconsistent shat' | 2751 | write(*,*)'Error in sreal: inconsistent shat' |
1348 | 2715 | write(*,*)shattmp,shat | 2752 | write(*,*)shattmp,shat |
1349 | @@ -2717,9 +2754,9 @@ | |||
1350 | 2717 | endif | 2754 | endif |
1351 | 2718 | 2755 | ||
1352 | 2719 | if (1d0-y_ij_fks.lt.tiny)then | 2756 | if (1d0-y_ij_fks.lt.tiny)then |
1354 | 2720 | if (pmass(j_fks).eq.zero.and.j_fks.le.2)then | 2757 | if (pmass(j_fks).eq.zero.and.j_fks.le.nincoming)then |
1355 | 2721 | call sborncol_isr(pp,xi_i_fks,y_ij_fks,wgt) | 2758 | call sborncol_isr(pp,xi_i_fks,y_ij_fks,wgt) |
1357 | 2722 | elseif (pmass(j_fks).eq.zero.and.j_fks.ge.3)then | 2759 | elseif (pmass(j_fks).eq.zero.and.j_fks.ge.nincoming+1)then |
1358 | 2723 | call sborncol_fsr(pp,xi_i_fks,y_ij_fks,wgt) | 2760 | call sborncol_fsr(pp,xi_i_fks,y_ij_fks,wgt) |
1359 | 2724 | else | 2761 | else |
1360 | 2725 | wgt=0d0 | 2762 | wgt=0d0 |
1361 | @@ -2741,11 +2778,20 @@ | |||
1362 | 2741 | endif | 2778 | endif |
1363 | 2742 | 2779 | ||
1364 | 2743 | if(wgt.lt.0.d0)then | 2780 | if(wgt.lt.0.d0)then |
1370 | 2744 | write(*,*) 'Fatal error #2 in sreal',wgt,xi_i_fks,y_ij_fks | 2781 | icount=icount+1 |
1371 | 2745 | do i=1,nexternal | 2782 | if (icount.le.10) then |
1372 | 2746 | write(*,*) 'particle ',i,', ',(pp(j,i),j=0,3) | 2783 | write(*,*) 'Warning, numerical problem found in sreal. '/ |
1373 | 2747 | enddo | 2784 | $ /'Setting weight to zero',wgt,xi_i_fks,y_ij_fks |
1374 | 2748 | stop | 2785 | do i=1,nexternal |
1375 | 2786 | write(*,*) 'particle ',i,', ',(pp(j,i),j=0,3) | ||
1376 | 2787 | enddo | ||
1377 | 2788 | if (icount.eq.25) then | ||
1378 | 2789 | write (*,*) 'ERROR 25 problems found... '/ | ||
1379 | 2790 | $ /'stopping the code' | ||
1380 | 2791 | stop | ||
1381 | 2792 | endif | ||
1382 | 2793 | endif | ||
1383 | 2794 | wgt=0d0 | ||
1384 | 2749 | endif | 2795 | endif |
1385 | 2750 | 2796 | ||
1386 | 2751 | return | 2797 | return |
1387 | @@ -2814,7 +2860,7 @@ | |||
1388 | 2814 | E_i_fks = p(0,i_fks) | 2860 | E_i_fks = p(0,i_fks) |
1389 | 2815 | z = 1d0 - E_i_fks/(E_i_fks+E_j_fks) | 2861 | z = 1d0 - E_i_fks/(E_i_fks+E_j_fks) |
1390 | 2816 | t = z * shat/4d0 | 2862 | t = z * shat/4d0 |
1392 | 2817 | if(rotategranny .and. nexternal-1.ne.3)then | 2863 | if(rotategranny .and. nexternal-1.ne.3 .and. nincoming.eq.2)then |
1393 | 2818 | c Exclude 2->1 (at the Born level) processes: matrix elements are | 2864 | c Exclude 2->1 (at the Born level) processes: matrix elements are |
1394 | 2819 | c independent of the PS point, but non-zero helicity configurations | 2865 | c independent of the PS point, but non-zero helicity configurations |
1395 | 2820 | c might flip when rotating the momenta. | 2866 | c might flip when rotating the momenta. |
1396 | @@ -2934,7 +2980,7 @@ | |||
1397 | 2934 | c Thus, an extra factor z (implicit in the flux of the reduced Born | 2980 | c Thus, an extra factor z (implicit in the flux of the reduced Born |
1398 | 2935 | c in FKS) has to be inserted here | 2981 | c in FKS) has to be inserted here |
1399 | 2936 | t = z*shat/4d0 | 2982 | t = z*shat/4d0 |
1401 | 2937 | if(j_fks.eq.2 .and. nexternal-1.ne.3)then | 2983 | if(j_fks.eq.2 .and. nexternal-1.ne.3 .and. nincoming.eq.2)then |
1402 | 2938 | c Rotation according to innerpin.m. Use rotate_invar() if a more | 2984 | c Rotation according to innerpin.m. Use rotate_invar() if a more |
1403 | 2939 | c general rotation is needed. | 2985 | c general rotation is needed. |
1404 | 2940 | c Exclude 2->1 (at the Born level) processes: matrix elements are | 2986 | c Exclude 2->1 (at the Born level) processes: matrix elements are |
1405 | @@ -2965,7 +3011,7 @@ | |||
1406 | 2965 | pi(i)=p_i_fks_ev(i) | 3011 | pi(i)=p_i_fks_ev(i) |
1407 | 2966 | pj(i)=p(i,j_fks) | 3012 | pj(i)=p(i,j_fks) |
1408 | 2967 | enddo | 3013 | enddo |
1410 | 2968 | if(j_fks.eq.2)then | 3014 | if(j_fks.eq.2 .and. nincoming.eq.2)then |
1411 | 2969 | c Rotation according to innerpin.m. Use rotate_invar() if a more | 3015 | c Rotation according to innerpin.m. Use rotate_invar() if a more |
1412 | 2970 | c general rotation is needed | 3016 | c general rotation is needed |
1413 | 2971 | pi(1)=-pi(1) | 3017 | pi(1)=-pi(1) |
1414 | @@ -2986,7 +3032,7 @@ | |||
1415 | 2986 | azifact=Wij_angle/Wij_recta | 3032 | azifact=Wij_angle/Wij_recta |
1416 | 2987 | endif | 3033 | endif |
1417 | 2988 | c Insert the extra factor due to Madgraph convention for polarization vectors | 3034 | c Insert the extra factor due to Madgraph convention for polarization vectors |
1419 | 2989 | if(j_fks.eq.2)then | 3035 | if(j_fks.eq.2 .and. nincoming.eq.2)then |
1420 | 2990 | cphi_mother=-1.d0 | 3036 | cphi_mother=-1.d0 |
1421 | 2991 | sphi_mother=0.d0 | 3037 | sphi_mother=0.d0 |
1422 | 2992 | else | 3038 | else |
1423 | @@ -3461,7 +3507,11 @@ | |||
1424 | 3461 | 3507 | ||
1425 | 3462 | c Consistency check -- call to set_cms_stuff() must be done prior to | 3508 | c Consistency check -- call to set_cms_stuff() must be done prior to |
1426 | 3463 | c entering this function | 3509 | c entering this function |
1428 | 3464 | shattmp=2d0*dot(p(0,1),p(0,2)) | 3510 | if (nincoming.eq.2) then |
1429 | 3511 | shattmp=2d0*dot(p(0,1),p(0,2)) | ||
1430 | 3512 | else | ||
1431 | 3513 | shattmp=p(0,1)**2 | ||
1432 | 3514 | endif | ||
1433 | 3465 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then | 3515 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then |
1434 | 3466 | write(*,*)'Error in sreal: inconsistent shat' | 3516 | write(*,*)'Error in sreal: inconsistent shat' |
1435 | 3467 | write(*,*)shattmp,shat | 3517 | write(*,*)shattmp,shat |
1436 | @@ -3770,7 +3820,7 @@ | |||
1437 | 3770 | enddo | 3820 | enddo |
1438 | 3771 | enddo | 3821 | enddo |
1439 | 3772 | do i=0,3 | 3822 | do i=0,3 |
1441 | 3773 | if(j_fks.gt.2)then | 3823 | if(j_fks.gt.nincoming)then |
1442 | 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) |
1443 | 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) |
1444 | 3776 | else | 3826 | else |
1445 | @@ -4370,7 +4420,11 @@ | |||
1446 | 4370 | 4420 | ||
1447 | 4371 | c Consistency check -- call to set_cms_stuff() must be done prior to | 4421 | c Consistency check -- call to set_cms_stuff() must be done prior to |
1448 | 4372 | c entering this function | 4422 | c entering this function |
1450 | 4373 | shattmp=2d0*dot(p(0,1),p(0,2)) | 4423 | if (nincoming.eq.2) then |
1451 | 4424 | shattmp=2d0*dot(p(0,1),p(0,2)) | ||
1452 | 4425 | else | ||
1453 | 4426 | shattmp=p(0,1)**2 | ||
1454 | 4427 | endif | ||
1455 | 4374 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then | 4428 | if(abs(shattmp/shat-1.d0).gt.1.d-5)then |
1456 | 4375 | write(*,*)'Error in sreal: inconsistent shat' | 4429 | write(*,*)'Error in sreal: inconsistent shat' |
1457 | 4376 | write(*,*)shattmp,shat | 4430 | write(*,*)shattmp,shat |
1458 | @@ -4447,7 +4501,7 @@ | |||
1459 | 4447 | enddo | 4501 | enddo |
1460 | 4448 | c | 4502 | c |
1461 | 4449 | do i=1,nincoming | 4503 | do i=1,nincoming |
1463 | 4450 | if (particle_type(i).ne.1)then | 4504 | if (particle_type(i).ne.1 .and. pmass(i).eq.ZERO) then |
1464 | 4451 | if (particle_type(i).eq.8) then | 4505 | if (particle_type(i).eq.8) then |
1465 | 4452 | aj=0 | 4506 | aj=0 |
1466 | 4453 | elseif(abs(particle_type(i)).eq.3) then | 4507 | elseif(abs(particle_type(i)).eq.3) then |
1467 | @@ -4972,8 +5026,13 @@ | |||
1468 | 4972 | elseif(abrv.ne.'virt' .and. abrv.ne.'viSC' .and. | 5026 | elseif(abrv.ne.'virt' .and. abrv.ne.'viSC' .and. |
1469 | 4973 | # abrv.ne.'viLC')then | 5027 | # abrv.ne.'viLC')then |
1470 | 4974 | c 1+2+3+4 | 5028 | c 1+2+3+4 |
1473 | 4975 | tmp=dlog(xicut_used**2*shat/QES2)- | 5029 | if (betai.gt.1d-6) then |
1474 | 4976 | # 1/betai*dlog((1+betai)/(1-betai)) | 5030 | tmp=dlog(xicut_used**2*shat/QES2)- |
1475 | 5031 | & 1/betai*dlog((1+betai)/(1-betai)) | ||
1476 | 5032 | else | ||
1477 | 5033 | tmp=dlog(xicut_used**2*shat/QES2)- | ||
1478 | 5034 | & 2d0*(1d0+betai**2/3d0+betai**4/5d0) | ||
1479 | 5035 | endif | ||
1480 | 4977 | else | 5036 | else |
1481 | 4978 | write(*,*)'Error #14 in eikonal_Ireg',abrv | 5037 | write(*,*)'Error #14 in eikonal_Ireg',abrv |
1482 | 4979 | stop | 5038 | stop |
1483 | @@ -5200,7 +5259,11 @@ | |||
1484 | 5200 | elseif(pmass(m).ne.zero.and.pmass(n).ne.zero)then | 5259 | elseif(pmass(m).ne.zero.and.pmass(n).ne.zero)then |
1485 | 5201 | kikj=dot(p(0,n),p(0,m)) | 5260 | kikj=dot(p(0,n),p(0,m)) |
1486 | 5202 | vij=sqrt(1-(pmass(n)*pmass(m)/kikj)**2) | 5261 | vij=sqrt(1-(pmass(n)*pmass(m)/kikj)**2) |
1488 | 5203 | single=single+0.5d0*1/vij*log((1+vij)/(1-vij))*wgt | 5262 | if (vij .gt. 1d-6) then |
1489 | 5263 | single=single+0.5d0*1/vij*log((1+vij)/(1-vij))*wgt | ||
1490 | 5264 | else | ||
1491 | 5265 | single=single+(1d0+vij**2/3d0+vij**4/5d0)*wgt | ||
1492 | 5266 | endif | ||
1493 | 5204 | else | 5267 | else |
1494 | 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) |
1495 | 5206 | stop | 5269 | stop |
1496 | @@ -5284,7 +5347,7 @@ | |||
1497 | 5284 | end | 5347 | end |
1498 | 5285 | 5348 | ||
1499 | 5286 | 5349 | ||
1501 | 5287 | subroutine setfksfactor(iconfig) | 5350 | subroutine setfksfactor(iconfig,match_to_shower) |
1502 | 5288 | implicit none | 5351 | implicit none |
1503 | 5289 | 5352 | ||
1504 | 5290 | double precision CA,CF, PI | 5353 | double precision CA,CF, PI |
1505 | @@ -5301,6 +5364,7 @@ | |||
1506 | 5301 | common/sctests/softtest,colltest | 5364 | common/sctests/softtest,colltest |
1507 | 5302 | 5365 | ||
1508 | 5303 | integer config_fks,i,j,iconfig,fac1,fac2 | 5366 | integer config_fks,i,j,iconfig,fac1,fac2 |
1509 | 5367 | logical match_to_shower | ||
1510 | 5304 | 5368 | ||
1511 | 5305 | double precision fkssymmetryfactor,fkssymmetryfactorBorn, | 5369 | double precision fkssymmetryfactor,fkssymmetryfactorBorn, |
1512 | 5306 | & fkssymmetryfactorDeg | 5370 | & fkssymmetryfactorDeg |
1513 | @@ -5519,6 +5583,9 @@ | |||
1514 | 5519 | else | 5583 | else |
1515 | 5520 | m_type=j_type | 5584 | m_type=j_type |
1516 | 5521 | endif | 5585 | endif |
1517 | 5586 | elseif(i_type.eq.8.and.j_type.eq.1.and.pdg_type(i_fks).eq.-21)then | ||
1518 | 5587 | ! dirty trick for LOonly processes without colored legs | ||
1519 | 5588 | m_type=j_type | ||
1520 | 5522 | else | 5589 | else |
1521 | 5523 | write(*,*)'Flavour mismatch #2 in setfksfactor', | 5590 | write(*,*)'Flavour mismatch #2 in setfksfactor', |
1522 | 5524 | & i_type,j_type,m_type | 5591 | & i_type,j_type,m_type |
1523 | @@ -5534,7 +5601,7 @@ | |||
1524 | 5534 | m_type=m_type_FKS(nFKSprocess) | 5601 | m_type=m_type_FKS(nFKSprocess) |
1525 | 5535 | 5602 | ||
1526 | 5536 | c Set matrices used by MC counterterms | 5603 | c Set matrices used by MC counterterms |
1528 | 5537 | call set_mc_matrices | 5604 | if (match_to_shower) call set_mc_matrices |
1529 | 5538 | 5605 | ||
1530 | 5539 | fac_i=fac_i_FKS(nFKSprocess) | 5606 | fac_i=fac_i_FKS(nFKSprocess) |
1531 | 5540 | fac_j=fac_j_FKS(nFKSprocess) | 5607 | fac_j=fac_j_FKS(nFKSprocess) |
1532 | 5541 | 5608 | ||
1533 | === modified file 'Template/NLO/SubProcesses/genps_fks.f' | |||
1534 | --- Template/NLO/SubProcesses/genps_fks.f 2015-02-04 13:26:19 +0000 | |||
1535 | +++ Template/NLO/SubProcesses/genps_fks.f 2015-10-25 15:32:18 +0000 | |||
1536 | @@ -182,15 +182,19 @@ | |||
1537 | 182 | endif | 182 | endif |
1538 | 183 | enddo | 183 | enddo |
1539 | 184 | if( firsttime .or. iconfig0.ne.iconfigsave ) then | 184 | if( firsttime .or. iconfig0.ne.iconfigsave ) then |
1541 | 185 | stot = 4d0*ebeam(1)*ebeam(2) | 185 | if (nincoming.eq.2) then |
1542 | 186 | stot = 4d0*ebeam(1)*ebeam(2) | ||
1543 | 187 | else | ||
1544 | 188 | stot=pmass(1)**2 | ||
1545 | 189 | endif | ||
1546 | 186 | c Make sure have enough mass for external particles | 190 | c Make sure have enough mass for external particles |
1547 | 187 | totmassin=0d0 | 191 | totmassin=0d0 |
1549 | 188 | do i=3-nincoming,2 | 192 | do i=1,nincoming |
1550 | 189 | totmassin=totmassin+m(i) | 193 | totmassin=totmassin+m(i) |
1551 | 190 | enddo | 194 | enddo |
1552 | 191 | totmass=0d0 | 195 | totmass=0d0 |
1553 | 192 | nbranch = nexternal-3 ! nexternal is for n+1-body, while itree uses n-body | 196 | nbranch = nexternal-3 ! nexternal is for n+1-body, while itree uses n-body |
1555 | 193 | do i=3,nbranch+2 | 197 | do i=nincoming+1,nexternal-1 |
1556 | 194 | totmass=totmass+m(i) | 198 | totmass=totmass+m(i) |
1557 | 195 | enddo | 199 | enddo |
1558 | 196 | fksmass=totmass | 200 | fksmass=totmass |
1559 | @@ -294,7 +298,7 @@ | |||
1560 | 294 | else | 298 | else |
1561 | 295 | pb(0,1)=sqrtshat_born | 299 | pb(0,1)=sqrtshat_born |
1562 | 296 | do i=1,2 | 300 | do i=1,2 |
1564 | 297 | pb(0,1)=0d0 | 301 | pb(i,1)=0d0 |
1565 | 298 | enddo | 302 | enddo |
1566 | 299 | p(3,1)=1e-14 ! For HELAS routine ixxxxx for neg. mass | 303 | p(3,1)=1e-14 ! For HELAS routine ixxxxx for neg. mass |
1567 | 300 | endif | 304 | endif |
1568 | @@ -453,22 +457,22 @@ | |||
1569 | 453 | isolsign=1 | 457 | isolsign=1 |
1570 | 454 | call generate_momenta_massless_final(icountevts,i_fks,j_fks | 458 | call generate_momenta_massless_final(icountevts,i_fks,j_fks |
1571 | 455 | & ,p_born(0,imother),shat,sqrtshat ,x(ixEi),xmrec2,xp | 459 | & ,p_born(0,imother),shat,sqrtshat ,x(ixEi),xmrec2,xp |
1573 | 456 | & ,phi_i_fks, xiimax,xinorm,xi_i_fks,y_ij_fks,p_i_fks | 460 | & ,phi_i_fks,xiimax,xinorm,xi_i_fks,y_ij_fks,p_i_fks |
1574 | 457 | & ,xjac,xpswgt,pass) | 461 | & ,xjac,xpswgt,pass) |
1575 | 458 | if (.not.pass) goto 112 | 462 | if (.not.pass) goto 112 |
1576 | 459 | elseif(m_j_fks.gt.0d0) then | 463 | elseif(m_j_fks.gt.0d0) then |
1577 | 460 | call generate_momenta_massive_final(icountevts,isolsign | 464 | call generate_momenta_massive_final(icountevts,isolsign |
1580 | 461 | & ,i_fks,j_fks,p_born(0,imother),shat,sqrtshat ,m_j_fks | 465 | & ,i_fks,j_fks,p_born(0,imother),shat,sqrtshat,m_j_fks |
1581 | 462 | & ,x(ixEi),xmrec2,xp,phi_i_fks, xiimax,xinorm | 466 | & ,x(ixEi),xmrec2,xp,phi_i_fks,xiimax,xinorm |
1582 | 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) |
1583 | 464 | if (.not.pass) goto 112 | 468 | if (.not.pass) goto 112 |
1584 | 465 | endif | 469 | endif |
1585 | 466 | elseif(j_fks.le.nincoming) then | 470 | elseif(j_fks.le.nincoming) then |
1586 | 467 | isolsign=1 | 471 | isolsign=1 |
1587 | 468 | call generate_momenta_initial(icountevts,i_fks,j_fks,xbjrk_born | 472 | call generate_momenta_initial(icountevts,i_fks,j_fks,xbjrk_born |
1591 | 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) |
1592 | 470 | & ,shat,stot ,sqrtshat,tau,ycm,xbjrk ,p_i_fks,xiimax,xinorm | 474 | & ,shat,stot,sqrtshat,tau,ycm,xbjrk,p_i_fks,xiimax,xinorm |
1593 | 471 | & ,xi_i_fks,y_ij_fks ,xpswgt,xjac ,pass) | 475 | & ,xi_i_fks,y_ij_fks ,xpswgt,xjac,pass) |
1594 | 472 | if (.not.pass) goto 112 | 476 | if (.not.pass) goto 112 |
1595 | 473 | else | 477 | else |
1596 | 474 | write (*,*) 'Error #2 in genps_fks.f',j_fks | 478 | write (*,*) 'Error #2 in genps_fks.f',j_fks |
1597 | @@ -750,6 +754,7 @@ | |||
1598 | 750 | c remove the following if no importance sampling towards soft | 754 | c remove the following if no importance sampling towards soft |
1599 | 751 | c singularity is performed when integrating over xi_i_hat | 755 | c singularity is performed when integrating over xi_i_hat |
1600 | 752 | xjac=xjac*2d0*x(1) | 756 | xjac=xjac*2d0*x(1) |
1601 | 757 | |||
1602 | 753 | c Check that xii is in the allowed range | 758 | c Check that xii is in the allowed range |
1603 | 754 | if( icountevts.eq.-100 .or. abs(icountevts).eq.1 )then | 759 | if( icountevts.eq.-100 .or. abs(icountevts).eq.1 )then |
1604 | 755 | if(xi_i_fks.gt.(1-xmrec2/shat))then | 760 | if(xi_i_fks.gt.(1-xmrec2/shat))then |
1605 | @@ -829,7 +834,11 @@ | |||
1606 | 829 | c mother four momenta | 834 | c mother four momenta |
1607 | 830 | do i=0,3 | 835 | do i=0,3 |
1608 | 831 | xp_mother(i)=xp(i,i_fks)+xp(i,j_fks) | 836 | xp_mother(i)=xp(i,i_fks)+xp(i,j_fks) |
1610 | 832 | recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i) | 837 | if (nincoming.eq.2) then |
1611 | 838 | recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i) | ||
1612 | 839 | else | ||
1613 | 840 | recoil(i)=xp(i,1)-xp_mother(i) | ||
1614 | 841 | endif | ||
1615 | 833 | enddo | 842 | enddo |
1616 | 834 | sumrec=recoil(0)+rho(recoil) | 843 | sumrec=recoil(0)+rho(recoil) |
1617 | 835 | sumrec2=sumrec**2 | 844 | sumrec2=sumrec**2 |
1618 | @@ -843,7 +852,7 @@ | |||
1619 | 843 | xdir(j)=xp_mother(j)/x3len_fks_mother | 852 | xdir(j)=xp_mother(j)/x3len_fks_mother |
1620 | 844 | enddo | 853 | enddo |
1621 | 845 | c Perform the boost here | 854 | c Perform the boost here |
1623 | 846 | do i=3,nexternal | 855 | do i=nincoming+1,nexternal |
1624 | 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) |
1625 | 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)) |
1626 | 849 | enddo | 858 | enddo |
1627 | @@ -1145,7 +1154,11 @@ | |||
1628 | 1145 | c mother four momenta | 1154 | c mother four momenta |
1629 | 1146 | do i=0,3 | 1155 | do i=0,3 |
1630 | 1147 | xp_mother(i)=xp(i,i_fks)+xp(i,j_fks) | 1156 | xp_mother(i)=xp(i,i_fks)+xp(i,j_fks) |
1632 | 1148 | recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i) | 1157 | if (nincoming.eq.2) then |
1633 | 1158 | recoil(i)=xp(i,1)+xp(i,2)-xp_mother(i) | ||
1634 | 1159 | else | ||
1635 | 1160 | recoil(i)=xp(i,1)-xp_mother(i) | ||
1636 | 1161 | endif | ||
1637 | 1149 | enddo | 1162 | enddo |
1638 | 1150 | c | 1163 | c |
1639 | 1151 | sumrec=recoil(0)+rho(recoil) | 1164 | sumrec=recoil(0)+rho(recoil) |
1640 | @@ -1168,7 +1181,7 @@ | |||
1641 | 1168 | xdir(j)=xp_mother(j)/x3len_fks_mother | 1181 | xdir(j)=xp_mother(j)/x3len_fks_mother |
1642 | 1169 | enddo | 1182 | enddo |
1643 | 1170 | c Boost the momenta | 1183 | c Boost the momenta |
1645 | 1171 | do i=3,nexternal | 1184 | do i=nincoming+1,nexternal |
1646 | 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) |
1647 | 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)) |
1648 | 1174 | enddo | 1187 | enddo |
1649 | @@ -2357,7 +2370,11 @@ | |||
1650 | 2357 | external dot | 2370 | external dot |
1651 | 2358 | pass=.true. | 2371 | pass=.true. |
1652 | 2359 | do i=0,3 | 2372 | do i=0,3 |
1654 | 2360 | recoilbar(i)=p_born(i,1)+p_born(i,2)-p_born(i,imother) | 2373 | if (nincoming.eq.2) then |
1655 | 2374 | recoilbar(i)=p_born(i,1)+p_born(i,2)-p_born(i,imother) | ||
1656 | 2375 | else | ||
1657 | 2376 | recoilbar(i)=p_born(i,1)-p_born(i,imother) | ||
1658 | 2377 | endif | ||
1659 | 2361 | enddo | 2378 | enddo |
1660 | 2362 | xmrec2=dot(recoilbar,recoilbar) | 2379 | xmrec2=dot(recoilbar,recoilbar) |
1661 | 2363 | if(xmrec2.lt.0.d0)then | 2380 | if(xmrec2.lt.0.d0)then |
1662 | 2364 | 2381 | ||
1663 | === modified file 'Template/NLO/SubProcesses/iproc_map.f' | |||
1664 | --- Template/NLO/SubProcesses/iproc_map.f 2015-03-09 18:27:17 +0000 | |||
1665 | +++ Template/NLO/SubProcesses/iproc_map.f 2015-10-25 15:32:18 +0000 | |||
1666 | @@ -211,7 +211,8 @@ | |||
1667 | 211 | include "appl_common.inc" | 211 | include "appl_common.inc" |
1668 | 212 | * | 212 | * |
1669 | 213 | character*200 buffer | 213 | character*200 buffer |
1671 | 214 | integer procnum,found,i,l,j,ll | 214 | integer procnum,i,l,j,ll,found_a,found_m |
1672 | 215 | logical found_appl(mxpdflumi),found_mg(maxproc) | ||
1673 | 215 | integer nmatch_total | 216 | integer nmatch_total |
1674 | 216 | 217 | ||
1675 | 217 | * npdflumi is the number of pdf luminosities in this particular process | 218 | * npdflumi is the number of pdf luminosities in this particular process |
1676 | @@ -296,7 +297,7 @@ | |||
1677 | 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)) |
1678 | 297 | * | 298 | * |
1679 | 298 | if(kpdflumi.le.0.or.kpdflumi.gt.mxpdflumi) then | 299 | if(kpdflumi.le.0.or.kpdflumi.gt.mxpdflumi) then |
1681 | 299 | write(6,*) "In fks_singular.f" | 300 | write(6,*) "In iproc_map.f" |
1682 | 300 | write(6,*) "Invalid value of kpdflumi = ",kpdflumi | 301 | write(6,*) "Invalid value of kpdflumi = ",kpdflumi |
1683 | 301 | stop | 302 | stop |
1684 | 302 | endif | 303 | endif |
1685 | @@ -341,33 +342,29 @@ | |||
1686 | 341 | * Be careful with all possible permutations in initial_parton_map! | 342 | * Be careful with all possible permutations in initial_parton_map! |
1687 | 342 | * Check all possible npdflumi conbinations until a match is found | 343 | * Check all possible npdflumi conbinations until a match is found |
1688 | 343 | do kpdflumi=1,npdflumi | 344 | do kpdflumi=1,npdflumi |
1702 | 344 | * First, check that the same number of | 345 | |
1690 | 345 | * parton subprocesses is used | ||
1691 | 346 | if(maxproc_used.ne.nproc(kpdflumi)) continue | ||
1692 | 347 | if(flav_map_debug) then | ||
1693 | 348 | write(6,*) " " | ||
1694 | 349 | write(6,*) " kpdflumi = ",kpdflumi | ||
1695 | 350 | write(6,*) " nproc(kpdflumi) = ",nproc(kpdflumi) | ||
1696 | 351 | do l=1,nproc(kpdflumi) | ||
1697 | 352 | write(6,*) l,pdgs(1,l,kpdflumi),pdgs(2,l,kpdflumi) | ||
1698 | 353 | enddo | ||
1699 | 354 | write(6,*) " " | ||
1700 | 355 | endif | ||
1701 | 356 | |||
1703 | 357 | * Initialization | 346 | * Initialization |
1705 | 358 | found = 0 | 347 | do l=1,nproc(kpdflumi) |
1706 | 348 | found_appl(l) = .false. | ||
1707 | 349 | enddo | ||
1708 | 350 | do ll=1,maxproc_used | ||
1709 | 351 | found_mg(ll) = .false. | ||
1710 | 352 | enddo | ||
1711 | 353 | found_a=0 | ||
1712 | 354 | found_m=0 | ||
1713 | 359 | 355 | ||
1714 | 360 | * Look for all possible pairs of | 356 | * Look for all possible pairs of |
1715 | 361 | * a) pdgs(1,l,kpdflumi),pdgs(2,l,kpdflumi) and | 357 | * a) pdgs(1,l,kpdflumi),pdgs(2,l,kpdflumi) and |
1716 | 362 | * b) IDUP(1,ll), IDUP(2,ll) | 358 | * b) IDUP(1,ll), IDUP(2,ll) |
1717 | 363 | * with kpdflumi fixed | 359 | * with kpdflumi fixed |
1718 | 364 | do l=1,nproc(kpdflumi) | 360 | do l=1,nproc(kpdflumi) |
1720 | 365 | do ll=1,nproc(kpdflumi) | 361 | do ll=1,maxproc_used |
1721 | 366 | if ( ( pdgs(1,l,kpdflumi).eq. | 362 | if ( ( pdgs(1,l,kpdflumi).eq. |
1722 | 367 | 1 IDUP(1,ll).and.pdgs(2,l,kpdflumi). | 363 | 1 IDUP(1,ll).and.pdgs(2,l,kpdflumi). |
1723 | 368 | 2 eq.IDUP(2,ll) ) ) | 364 | 2 eq.IDUP(2,ll) ) ) |
1724 | 369 | 4 then | 365 | 4 then |
1726 | 370 | found = found + 1 | 366 | found_appl(l)=.true. |
1727 | 367 | found_mg(ll)=.true. | ||
1728 | 371 | if(flav_map_debug) then | 368 | if(flav_map_debug) then |
1729 | 372 | write(6,*) "match found!" | 369 | write(6,*) "match found!" |
1730 | 373 | write(6,*) "pdgs = ",pdgs(1,l,kpdflumi), | 370 | write(6,*) "pdgs = ",pdgs(1,l,kpdflumi), |
1731 | @@ -377,8 +374,15 @@ | |||
1732 | 377 | endif | 374 | endif |
1733 | 378 | enddo | 375 | enddo |
1734 | 379 | enddo | 376 | enddo |
1735 | 377 | do l=1,nproc(kpdflumi) | ||
1736 | 378 | if (found_appl(l)) found_a=found_a+1 | ||
1737 | 379 | enddo | ||
1738 | 380 | do ll=1,maxproc_used | ||
1739 | 381 | if (found_mg(ll)) found_m=found_m+1 | ||
1740 | 382 | enddo | ||
1741 | 380 | * | 383 | * |
1743 | 381 | if (found.eq.nproc(kpdflumi)) then | 384 | if ( found_a.eq.nproc(kpdflumi) .and. |
1744 | 385 | & found_m.eq.maxproc_used ) then | ||
1745 | 382 | if(flav_map_debug) then | 386 | if(flav_map_debug) then |
1746 | 383 | write(6,*) " ------------------------------- " | 387 | write(6,*) " ------------------------------- " |
1747 | 384 | write(6,*) " Match found!" | 388 | write(6,*) " Match found!" |
1748 | @@ -389,9 +393,9 @@ | |||
1749 | 389 | nmatch_total = nmatch_total+1 | 393 | nmatch_total = nmatch_total+1 |
1750 | 390 | endif | 394 | endif |
1751 | 391 | enddo | 395 | enddo |
1753 | 392 | if(flavour_map(nFKSprocess).eq.0) then | 396 | if (nmatch_total.ne.nFKSprocess) then |
1754 | 393 | write(6,*) | 397 | write(6,*) |
1756 | 394 | 1 "Problem with setup_flavourmap in fks_singular.f" | 398 | 1 "Problem with setup_flavourmap in iproc_map.f" |
1757 | 395 | write(6,*) "nFKSprocess = ",nFKSprocess | 399 | write(6,*) "nFKSprocess = ",nFKSprocess |
1758 | 396 | write(6,*)" flavour_map(nFKSprocess)= ", | 400 | write(6,*)" flavour_map(nFKSprocess)= ", |
1759 | 397 | 1 flavour_map(nFKSprocess) | 401 | 1 flavour_map(nFKSprocess) |
1760 | @@ -399,17 +403,6 @@ | |||
1761 | 399 | endif | 403 | endif |
1762 | 400 | enddo | 404 | enddo |
1763 | 401 | 405 | ||
1764 | 402 | * write(6,*) " " | ||
1765 | 403 | * write(6,*) " nmatch_total = ", nmatch_total | ||
1766 | 404 | * write(6,*) " " | ||
1767 | 405 | if( nmatch_total.ne.fks_configs) then | ||
1768 | 406 | write(6,*) | ||
1769 | 407 | 1 "Problem with setup_flavourmap in fks_singular.f" | ||
1770 | 408 | write(6,*) "nmatch_total, fks_configs" | ||
1771 | 409 | write(6,*) nmatch_total, fks_configs | ||
1772 | 410 | stop | ||
1773 | 411 | endif | ||
1774 | 412 | |||
1775 | 413 | * Check flavor map properly initialized | 406 | * Check flavor map properly initialized |
1776 | 414 | * All the entries of flavour_map(1:nFKSprocess) must be from | 407 | * All the entries of flavour_map(1:nFKSprocess) must be from |
1777 | 415 | * 1 to npdflumi | 408 | * 1 to npdflumi |
1778 | 416 | 409 | ||
1779 | === modified file 'Template/NLO/SubProcesses/leshouche_inc_chooser.f' | |||
1780 | --- Template/NLO/SubProcesses/leshouche_inc_chooser.f 2015-03-09 18:27:17 +0000 | |||
1781 | +++ Template/NLO/SubProcesses/leshouche_inc_chooser.f 2015-10-25 15:32:18 +0000 | |||
1782 | @@ -91,8 +91,8 @@ | |||
1783 | 91 | icolup_d(1,1,nexternal,j)=-99999 ! should not be used | 91 | icolup_d(1,1,nexternal,j)=-99999 ! should not be used |
1784 | 92 | icolup_d(1,2,nexternal,j)=-99999 | 92 | icolup_d(1,2,nexternal,j)=-99999 |
1785 | 93 | enddo | 93 | enddo |
1786 | 94 | return | ||
1787 | 94 | endif | 95 | endif |
1788 | 95 | return | ||
1789 | 96 | endif | 96 | endif |
1790 | 97 | 97 | ||
1791 | 98 | open(unit=78, file='leshouche_info.dat', status='old') | 98 | open(unit=78, file='leshouche_info.dat', status='old') |
1792 | 99 | 99 | ||
1793 | === modified file 'Template/NLO/SubProcesses/montecarlocounter.f' | |||
1794 | --- Template/NLO/SubProcesses/montecarlocounter.f 2014-10-06 16:45:08 +0000 | |||
1795 | +++ Template/NLO/SubProcesses/montecarlocounter.f 2015-10-25 15:32:18 +0000 | |||
1796 | @@ -2549,8 +2549,9 @@ | |||
1797 | 2549 | common/to_abrv/abrv | 2549 | common/to_abrv/abrv |
1798 | 2550 | 2550 | ||
1799 | 2551 | ref_scale=sqrt((1-xi)*shat) | 2551 | ref_scale=sqrt((1-xi)*shat) |
1802 | 2552 | xscalemin=max(frac_low*ref_scale,scaleMClow) | 2552 | xscalemin=max(shower_scale_factor*frac_low*ref_scale,scaleMClow) |
1803 | 2553 | xscalemax=max(frac_upp*ref_scale,xscalemin+scaleMCdelta) | 2553 | xscalemax=max(shower_scale_factor*frac_upp*ref_scale, |
1804 | 2554 | & xscalemin+scaleMCdelta) | ||
1805 | 2554 | xscalemax=min(xscalemax,2d0*sqrt(ebeam(1)*ebeam(2))) | 2555 | xscalemax=min(xscalemax,2d0*sqrt(ebeam(1)*ebeam(2))) |
1806 | 2555 | xscalemin=min(xscalemin,xscalemax) | 2556 | xscalemin=min(xscalemin,xscalemax) |
1807 | 2556 | c | 2557 | c |
1808 | 2557 | 2558 | ||
1809 | === modified file 'Template/NLO/SubProcesses/setcuts.f' | |||
1810 | --- Template/NLO/SubProcesses/setcuts.f 2015-07-24 18:59:18 +0000 | |||
1811 | +++ Template/NLO/SubProcesses/setcuts.f 2015-10-25 15:32:18 +0000 | |||
1812 | @@ -91,8 +91,6 @@ | |||
1813 | 91 | lpp(2)=0 | 91 | lpp(2)=0 |
1814 | 92 | ebeam(1)=pmass(1)/2d0 | 92 | ebeam(1)=pmass(1)/2d0 |
1815 | 93 | ebeam(2)=pmass(1)/2d0 | 93 | ebeam(2)=pmass(1)/2d0 |
1816 | 94 | scale=pmass(1) | ||
1817 | 95 | fixed_ren_scale=.true. | ||
1818 | 96 | endif | 94 | endif |
1819 | 97 | c-check consistency of maxjetflavor in the run_card and with Nf | 95 | c-check consistency of maxjetflavor in the run_card and with Nf |
1820 | 98 | c specified in coupl.inc | 96 | c specified in coupl.inc |
1821 | 99 | 97 | ||
1822 | === modified file 'Template/NLO/SubProcesses/setscales.f' | |||
1823 | --- Template/NLO/SubProcesses/setscales.f 2015-07-30 15:57:44 +0000 | |||
1824 | +++ Template/NLO/SubProcesses/setscales.f 2015-10-25 15:32:18 +0000 | |||
1825 | @@ -237,7 +237,10 @@ | |||
1826 | 237 | $ ,FxFx_fac_scale | 237 | $ ,FxFx_fac_scale |
1827 | 238 | c | 238 | c |
1828 | 239 | tmp=0 | 239 | tmp=0 |
1830 | 240 | if(ickkw.eq.3)then | 240 | if (nincoming.eq.1) then |
1831 | 241 | tmp=pp(0,1) ! mass of the decaying particle | ||
1832 | 242 | temp_scale_id='Mass of decaying particle' | ||
1833 | 243 | elseif(ickkw.eq.3)then | ||
1834 | 241 | c FxFx merging scale: | 244 | c FxFx merging scale: |
1835 | 242 | c Note that nFxFx_ren_scales includes the one scale that corresponds | 245 | c Note that nFxFx_ren_scales includes the one scale that corresponds |
1836 | 243 | c to the real-emission one (and is zero for the n-body conf.). Skip | 246 | c to the real-emission one (and is zero for the n-body conf.). Skip |
1837 | @@ -411,7 +414,7 @@ | |||
1838 | 411 | tmp=0 | 414 | tmp=0 |
1839 | 412 | if(ickkw.eq.3)then | 415 | if(ickkw.eq.3)then |
1840 | 413 | c FxFx merging scale: | 416 | c FxFx merging scale: |
1842 | 414 | tmp=min(FxFx_fac_scale(1),FxFx_fac_scale(2)) | 417 | tmp=(FxFx_fac_scale(1)+FxFx_fac_scale(2))/2d0 |
1843 | 415 | temp_scale_id='FxFx merging scale' | 418 | temp_scale_id='FxFx merging scale' |
1844 | 416 | elseif(imuftype.eq.1)then | 419 | elseif(imuftype.eq.1)then |
1845 | 417 | tmp=scale_global_reference(pp) | 420 | tmp=scale_global_reference(pp) |
1846 | @@ -490,7 +493,10 @@ | |||
1847 | 490 | parameter (iQEStype=1) | 493 | parameter (iQEStype=1) |
1848 | 491 | c | 494 | c |
1849 | 492 | tmp=0 | 495 | tmp=0 |
1851 | 493 | if(iQEStype.eq.1)then | 496 | if (nincoming.eq.1) then |
1852 | 497 | tmp=pp(0,1) ! mass of the decaying particle | ||
1853 | 498 | temp_scale_id='Mass of decaying particle' | ||
1854 | 499 | elseif(iQEStype.eq.1)then | ||
1855 | 494 | tmp=scale_global_reference(pp) | 500 | tmp=scale_global_reference(pp) |
1856 | 495 | elseif(iQEStype.eq.2)then | 501 | elseif(iQEStype.eq.2)then |
1857 | 496 | do i=nincoming+1,nexternal | 502 | do i=nincoming+1,nexternal |
1858 | 497 | 503 | ||
1859 | === removed file 'Template/NLO/SubProcesses/sumres.py' | |||
1860 | --- Template/NLO/SubProcesses/sumres.py 2014-07-23 10:33:38 +0000 | |||
1861 | +++ Template/NLO/SubProcesses/sumres.py 1970-01-01 00:00:00 +0000 | |||
1862 | @@ -1,241 +0,0 @@ | |||
1863 | 1 | #!/usr/bin/env python | ||
1864 | 2 | |||
1865 | 3 | #script to combine reults and tell the number of events that need | ||
1866 | 4 | # to be generated in each channel. | ||
1867 | 5 | # Replaces the sumres.f and sumres2.f files | ||
1868 | 6 | # MZ, 2011-10-22 | ||
1869 | 7 | |||
1870 | 8 | from __future__ import division | ||
1871 | 9 | import math | ||
1872 | 10 | import sys | ||
1873 | 11 | import random | ||
1874 | 12 | import os | ||
1875 | 13 | |||
1876 | 14 | nexpected=int(sys.argv[1]) | ||
1877 | 15 | nevents=int(sys.argv[2]) | ||
1878 | 16 | req_acc=float(sys.argv[3]) | ||
1879 | 17 | # if nevents is >=0 the script will also determine the | ||
1880 | 18 | # number of events required for each process | ||
1881 | 19 | |||
1882 | 20 | |||
1883 | 21 | def Mirrorprocs(p1, p2): | ||
1884 | 22 | """determine if the folder names p1, p2 (with the _N already taken out) | ||
1885 | 23 | correspond to the same process with | ||
1886 | 24 | mirrror initial state. Returns true/false""" | ||
1887 | 25 | return False | ||
1888 | 26 | |||
1889 | 27 | file=open("res.txt") | ||
1890 | 28 | content = file.read() | ||
1891 | 29 | file.close() | ||
1892 | 30 | lines = content.split("\n") | ||
1893 | 31 | processes=[] | ||
1894 | 32 | tot=0 | ||
1895 | 33 | err=0 | ||
1896 | 34 | totABS=0 | ||
1897 | 35 | errABS=0 | ||
1898 | 36 | |||
1899 | 37 | # open the file containing the list of directories | ||
1900 | 38 | file=open("dirs.txt") | ||
1901 | 39 | dirs = file.read().split("\n") | ||
1902 | 40 | file.close() | ||
1903 | 41 | dirs.remove('') | ||
1904 | 42 | |||
1905 | 43 | # The syntax of lines should be first the ABS cross section for the | ||
1906 | 44 | # channel and the line after that the cross section for the same | ||
1907 | 45 | # channel. | ||
1908 | 46 | for line in range(0,len(lines),2): | ||
1909 | 47 | list = lines[line].split() | ||
1910 | 48 | if list: | ||
1911 | 49 | proc={} | ||
1912 | 50 | proc['folder'] = list[0].split('/')[0] | ||
1913 | 51 | proc['subproc'] = proc['folder'][0:proc['folder'].rfind('_')] | ||
1914 | 52 | proc['channel'] = list[0].split('/')[1] | ||
1915 | 53 | dirs.remove(os.path.join(proc['folder'], proc['channel'])) | ||
1916 | 54 | proc['resultABS'] = float(list[4]) | ||
1917 | 55 | proc['errorABS'] = float(list[6]) | ||
1918 | 56 | proc['err_percABS'] = proc['errorABS']/proc['resultABS']*100. | ||
1919 | 57 | processes.append(proc) | ||
1920 | 58 | totABS+= proc['resultABS'] | ||
1921 | 59 | errABS+= math.pow(proc['errorABS'],2) | ||
1922 | 60 | list = lines[line+1].split() | ||
1923 | 61 | if list: | ||
1924 | 62 | proc['result'] = float(list[3]) | ||
1925 | 63 | proc['error'] = float(list[5]) | ||
1926 | 64 | proc['err_perc'] = proc['error']/proc['result']*100. | ||
1927 | 65 | tot+= proc['result'] | ||
1928 | 66 | err+= math.pow(proc['error'],2) | ||
1929 | 67 | if dirs: | ||
1930 | 68 | print "%d jobs did not terminate correctly: " % len(dirs) | ||
1931 | 69 | print '\n'.join(dirs) | ||
1932 | 70 | print "The results are probably not correct. Please check the relevant log files corresponding to the above jobs for more information." | ||
1933 | 71 | |||
1934 | 72 | processes.sort(key = lambda proc: -proc['errorABS']) | ||
1935 | 73 | |||
1936 | 74 | correct = len(processes) == nexpected | ||
1937 | 75 | print "Found %d correctly terminated jobs " %len(processes) | ||
1938 | 76 | if not len(processes)==nexpected: | ||
1939 | 77 | print len(processes), nexpected | ||
1940 | 78 | |||
1941 | 79 | subprocs_string=[] | ||
1942 | 80 | for proc in processes: | ||
1943 | 81 | subprocs_string.append(proc['subproc']) | ||
1944 | 82 | subprocs_string=set(subprocs_string) | ||
1945 | 83 | |||
1946 | 84 | content+='\n\nCross-section per integration channel:\n' | ||
1947 | 85 | for proc in processes: | ||
1948 | 86 | content+='%(folder)20s %(channel)15s %(result)10.8e %(error)6.4e %(err_perc)6.4f%% \n' % proc | ||
1949 | 87 | |||
1950 | 88 | content+='\n\nABS cross-section per integration channel:\n' | ||
1951 | 89 | for proc in processes: | ||
1952 | 90 | content+='%(folder)20s %(channel)15s %(resultABS)10.8e %(errorABS)6.4e %(err_percABS)6.4f%% \n' % proc | ||
1953 | 91 | |||
1954 | 92 | content+='\n\nCross-section per subprocess:\n' | ||
1955 | 93 | #for subpr in sorted(set(subprocs)): | ||
1956 | 94 | subprocesses=[] | ||
1957 | 95 | for sub in subprocs_string: | ||
1958 | 96 | subpr={} | ||
1959 | 97 | subpr['subproc']=sub | ||
1960 | 98 | subpr['xsect']=0. | ||
1961 | 99 | subpr['err']=0. | ||
1962 | 100 | for proc in processes: | ||
1963 | 101 | if proc['subproc'] == sub: | ||
1964 | 102 | subpr['xsect'] += proc['result'] | ||
1965 | 103 | subpr['err'] += math.pow(proc['error'],2) | ||
1966 | 104 | subpr['err']=math.sqrt(subpr['err']) | ||
1967 | 105 | subprocesses.append(subpr) | ||
1968 | 106 | |||
1969 | 107 | |||
1970 | 108 | #find and combine mirror configurations (if in v4) | ||
1971 | 109 | for i1, s1 in enumerate(subprocesses): | ||
1972 | 110 | for i2, s2 in enumerate(subprocesses): | ||
1973 | 111 | if Mirrorprocs(s1['subproc'], s2['subproc']) and i1 >= i2: | ||
1974 | 112 | s1['xsect'] += s2['xsect'] | ||
1975 | 113 | s1['err'] = math.sqrt(math.pow(s1['err'],2)+ math.pow(s2['err'],2)) | ||
1976 | 114 | s2['toremove'] = True | ||
1977 | 115 | |||
1978 | 116 | new = [] | ||
1979 | 117 | for s in subprocesses: | ||
1980 | 118 | try: | ||
1981 | 119 | a= s['toremove'] | ||
1982 | 120 | except KeyError: | ||
1983 | 121 | new.append(s) | ||
1984 | 122 | subprocesses= new | ||
1985 | 123 | |||
1986 | 124 | |||
1987 | 125 | subprocesses.sort(key = lambda proc: -proc['xsect']) | ||
1988 | 126 | for subpr in subprocesses: | ||
1989 | 127 | content+= '%(subproc)20s %(xsect)10.8e %(err)6.4e\n' % subpr | ||
1990 | 128 | |||
1991 | 129 | |||
1992 | 130 | content+='\nTotal ABS and \nTotal: \n %10.8e +- %6.4e (%6.4e%%)\n %10.8e +- %6.4e (%6.4e%%)\n' %\ | ||
1993 | 131 | (totABS, math.sqrt(errABS), math.sqrt(errABS)/totABS *100.,tot, math.sqrt(err), math.sqrt(err)/tot *100.) | ||
1994 | 132 | |||
1995 | 133 | if not correct: | ||
1996 | 134 | sys.exit('ERROR: not all jobs terminated correctly\n') | ||
1997 | 135 | |||
1998 | 136 | file=open("res.txt", 'w') | ||
1999 | 137 | |||
2000 | 138 | file.write(content) | ||
2001 | 139 | file.close() | ||
2002 | 140 | |||
2003 | 141 | #determine the events for each process: | ||
2004 | 142 | if nevents>=0: | ||
2005 | 143 | if req_acc<0: | ||
2006 | 144 | req_acc2_inv=nevents | ||
2007 | 145 | else: | ||
2008 | 146 | req_acc2_inv=1/(req_acc*req_acc) | ||
2009 | 147 | #get the random number seed from the randinit file | ||
2010 | 148 | file=open("randinit") | ||
2011 | 149 | exec file | ||
2012 | 150 | file.close | ||
2013 | 151 | print "random seed found in 'randinit' is", r | ||
2014 | 152 | random.seed(r) | ||
2015 | 153 | totevts=nevents | ||
2016 | 154 | for proc in processes: | ||
2017 | 155 | proc['lhefile'] = os.path.join(proc['folder'], proc['channel'], 'events.lhe') | ||
2018 | 156 | proc['nevents'] = 0 | ||
2019 | 157 | while totevts : | ||
2020 | 158 | target = random.random() * totABS | ||
2021 | 159 | crosssum = 0. | ||
2022 | 160 | i = 0 | ||
2023 | 161 | while i<len(processes) and crosssum < target: | ||
2024 | 162 | proc = processes[i] | ||
2025 | 163 | crosssum += proc['resultABS'] | ||
2026 | 164 | i += 1 | ||
2027 | 165 | totevts -= 1 | ||
2028 | 166 | i -= 1 | ||
2029 | 167 | processes[i]['nevents'] += 1 | ||
2030 | 168 | |||
2031 | 169 | #check that we now have all the events in the channels | ||
2032 | 170 | totevents = sum(proc['nevents'] for proc in processes) | ||
2033 | 171 | if totevents != nevents: | ||
2034 | 172 | sys.exit('failed to obtain the correct number of events. Required: %d, Obtained: %d' \ | ||
2035 | 173 | % (nevents, totevents)) | ||
2036 | 174 | |||
2037 | 175 | content_evts = '' | ||
2038 | 176 | for proc in processes: | ||
2039 | 177 | content_evts+= ' '+proc['lhefile']+' %(nevents)10d %(resultABS)10.8e 1.0 \n' % proc | ||
2040 | 178 | nevts_file = open(os.path.join(proc['folder'], proc['channel'], 'nevts'),'w') | ||
2041 | 179 | nevts_file.write('%10d\n' % proc['nevents']) | ||
2042 | 180 | nevts_file.close() | ||
2043 | 181 | if proc['channel'][1] == 'B': | ||
2044 | 182 | fileinputs = open("madinMMC_B.2") | ||
2045 | 183 | elif proc['channel'][1] == 'F': | ||
2046 | 184 | fileinputs = open("madinMMC_F.2") | ||
2047 | 185 | elif proc['channel'][1] == 'V': | ||
2048 | 186 | fileinputs = open("madinMMC_V.2") | ||
2049 | 187 | else: | ||
2050 | 188 | sys.exit("ERROR, DONT KNOW WHICH INPUTS TO USE") | ||
2051 | 189 | fileinputschannel = open(os.path.join(proc['folder'], proc['channel'], 'madinM1'),'w') | ||
2052 | 190 | i=0 | ||
2053 | 191 | for line in fileinputs: | ||
2054 | 192 | i += 1 | ||
2055 | 193 | if i == 2: | ||
2056 | 194 | accuracy=min(math.sqrt(totABS/(req_acc2_inv*proc['resultABS'])),0.2) | ||
2057 | 195 | fileinputschannel.write('%10.8e\n' % accuracy) | ||
2058 | 196 | elif i == 8: | ||
2059 | 197 | fileinputschannel.write('1 ! MINT mode\n') | ||
2060 | 198 | else: | ||
2061 | 199 | fileinputschannel.write(line) | ||
2062 | 200 | fileinputschannel.close() | ||
2063 | 201 | fileinputs.close() | ||
2064 | 202 | |||
2065 | 203 | evts_file = open('nevents_unweighted', 'w') | ||
2066 | 204 | evts_file.write(content_evts) | ||
2067 | 205 | evts_file.close() | ||
2068 | 206 | |||
2069 | 207 | # if nevents = -1 and req_acc >= 0, we need to determine the required | ||
2070 | 208 | # accuracy in each of the channels: this is for fixed order running! | ||
2071 | 209 | elif req_acc>=0 and nevents==-1: | ||
2072 | 210 | req_accABS=req_acc*abs(tot)/totABS | ||
2073 | 211 | content_evts = '' | ||
2074 | 212 | for proc in processes: | ||
2075 | 213 | if proc['channel'][0:3] == 'all': | ||
2076 | 214 | fileinputs = open("madin.all") | ||
2077 | 215 | elif proc['channel'][0:4] == 'novB': | ||
2078 | 216 | fileinputs = open("madin.novB") | ||
2079 | 217 | elif proc['channel'][0:4] == 'born': | ||
2080 | 218 | fileinputs = open("madin.born") | ||
2081 | 219 | elif proc['channel'][0:4] == 'grid': | ||
2082 | 220 | fileinputs = open("madin.grid") | ||
2083 | 221 | elif proc['channel'][0:4] == 'viSB': | ||
2084 | 222 | fileinputs = open("madin.viSB") | ||
2085 | 223 | elif proc['channel'][0:4] == 'virt': | ||
2086 | 224 | fileinputs = open("madin.virt") | ||
2087 | 225 | elif proc['channel'][0:4] == 'novi': | ||
2088 | 226 | fileinputs = open("madin.novi") | ||
2089 | 227 | else: | ||
2090 | 228 | sys.exit("ERROR, DONT KNOW WHICH INPUTS TO USE") | ||
2091 | 229 | fileinputschannel = open(os.path.join(proc['folder'], proc['channel'], 'madinM1'),'w') | ||
2092 | 230 | i=0 | ||
2093 | 231 | for line in fileinputs: | ||
2094 | 232 | i += 1 | ||
2095 | 233 | if i == 2: | ||
2096 | 234 | accuracy=req_accABS*math.sqrt(totABS*proc['resultABS']) | ||
2097 | 235 | fileinputschannel.write('%10.8e\n' % accuracy) | ||
2098 | 236 | elif i == 9: | ||
2099 | 237 | fileinputschannel.write('-1 ! restart from existing grids\n') | ||
2100 | 238 | else: | ||
2101 | 239 | fileinputschannel.write(line) | ||
2102 | 240 | fileinputschannel.close() | ||
2103 | 241 | fileinputs.close() | ||
2104 | 242 | 0 | ||
2105 | === modified file 'Template/NLO/SubProcesses/symmetry_fks_test_ME.f' | |||
2106 | --- Template/NLO/SubProcesses/symmetry_fks_test_ME.f 2015-06-30 14:50:39 +0000 | |||
2107 | +++ Template/NLO/SubProcesses/symmetry_fks_test_ME.f 2015-10-25 15:32:18 +0000 | |||
2108 | @@ -268,7 +268,7 @@ | |||
2109 | 268 | 268 | ||
2110 | 269 | do iconfig=bs_min,bs_max ! Born configurations | 269 | do iconfig=bs_min,bs_max ! Born configurations |
2111 | 270 | call setcuts | 270 | call setcuts |
2113 | 271 | call setfksfactor(iconfig) | 271 | call setfksfactor(iconfig,.false.) |
2114 | 272 | wgt=1d0 | 272 | wgt=1d0 |
2115 | 273 | ntry=1 | 273 | ntry=1 |
2116 | 274 | 274 | ||
2117 | 275 | 275 | ||
2118 | === modified file 'Template/NLO/SubProcesses/symmetry_fks_v3.f' | |||
2119 | --- Template/NLO/SubProcesses/symmetry_fks_v3.f 2014-06-26 08:45:41 +0000 | |||
2120 | +++ Template/NLO/SubProcesses/symmetry_fks_v3.f 2015-10-25 15:32:18 +0000 | |||
2121 | @@ -177,7 +177,7 @@ | |||
2122 | 177 | call printout | 177 | call printout |
2123 | 178 | call run_printout | 178 | call run_printout |
2124 | 179 | iconfig=1 | 179 | iconfig=1 |
2126 | 180 | call setfksfactor(iconfig) | 180 | call setfksfactor(iconfig,.false.) |
2127 | 181 | c | 181 | c |
2128 | 182 | ndim = 55 | 182 | ndim = 55 |
2129 | 183 | ncall = 10000 | 183 | ncall = 10000 |
2130 | @@ -541,6 +541,8 @@ | |||
2131 | 541 | lname=4 | 541 | lname=4 |
2132 | 542 | mname='mg' | 542 | mname='mg' |
2133 | 543 | call open_bash_file(26,fname,lname,mname) | 543 | call open_bash_file(26,fname,lname,mname) |
2134 | 544 | call close_bash_file(26) | ||
2135 | 545 | open(unit=26,file='channels.txt',status='unknown') | ||
2136 | 544 | ic = 0 | 546 | ic = 0 |
2137 | 545 | do i=1,mapconfig(0) | 547 | do i=1,mapconfig(0) |
2138 | 546 | if (use_config(i) .gt. 0) then | 548 | if (use_config(i) .gt. 0) then |
2139 | @@ -567,15 +569,6 @@ | |||
2140 | 567 | done = .false. | 569 | done = .false. |
2141 | 568 | do while (.not. done) | 570 | do while (.not. done) |
2142 | 569 | call enCode(icode,iarray,ibase,imax) | 571 | call enCode(icode,iarray,ibase,imax) |
2143 | 570 | ic=ic+1 | ||
2144 | 571 | if (ic .gt. ChanPerJob) then | ||
2145 | 572 | call close_bash_file(26) | ||
2146 | 573 | fname='ajob' | ||
2147 | 574 | lname=4 | ||
2148 | 575 | mname='mg' | ||
2149 | 576 | call open_bash_file(26,fname,lname,mname) | ||
2150 | 577 | ic = 1 | ||
2151 | 578 | endif | ||
2152 | 579 | c write(*,*) 'mapping',ic,mapconfig(i) | 572 | c write(*,*) 'mapping',ic,mapconfig(i) |
2153 | 580 | c$$$ if (r_from_b(mapconfig(i)) .lt. 10) then | 573 | c$$$ if (r_from_b(mapconfig(i)) .lt. 10) then |
2154 | 581 | c$$$ write(26,'(i1$)') r_from_b(mapconfig(i)) | 574 | c$$$ write(26,'(i1$)') r_from_b(mapconfig(i)) |
2155 | @@ -611,7 +604,7 @@ | |||
2156 | 611 | enddo | 604 | enddo |
2157 | 612 | endif | 605 | endif |
2158 | 613 | enddo | 606 | enddo |
2160 | 614 | call close_bash_file(26) | 607 | close(26) |
2161 | 615 | if (mapconfig(0) .gt. 9999) then | 608 | if (mapconfig(0) .gt. 9999) then |
2162 | 616 | write(*,*) 'Only writing first 9999 jobs',mapconfig(0) | 609 | write(*,*) 'Only writing first 9999 jobs',mapconfig(0) |
2163 | 617 | endif | 610 | endif |
2164 | 618 | 611 | ||
2165 | === modified file 'Template/NLO/SubProcesses/write_ajob.f' | |||
2166 | --- Template/NLO/SubProcesses/write_ajob.f 2012-10-18 06:17:30 +0000 | |||
2167 | +++ Template/NLO/SubProcesses/write_ajob.f 2015-10-25 15:32:18 +0000 | |||
2168 | @@ -53,7 +53,7 @@ | |||
2169 | 53 | if (index(buff,'TAGTAGTAGTAGTAG').ne.0) exit | 53 | if (index(buff,'TAGTAGTAGTAGTAG').ne.0) exit |
2170 | 54 | write(lun,15) buff | 54 | write(lun,15) buff |
2171 | 55 | enddo | 55 | enddo |
2173 | 56 | write(lun,'(a$)') 'for i in ' | 56 | write(lun,'(a$)') 'for i in $channel ' |
2174 | 57 | return | 57 | return |
2175 | 58 | 99 write (*,*) 'ajob_template or ajob_template_cluster '/ | 58 | 99 write (*,*) 'ajob_template or ajob_template_cluster '/ |
2176 | 59 | & /'does not have the correct format' | 59 | & /'does not have the correct format' |
2177 | 60 | 60 | ||
2178 | === modified file 'Template/loop_material/StandAlone/Cards/MadLoopParams.dat' | |||
2179 | --- Template/loop_material/StandAlone/Cards/MadLoopParams.dat 2014-10-27 08:40:30 +0000 | |||
2180 | +++ Template/loop_material/StandAlone/Cards/MadLoopParams.dat 2015-10-25 15:32:18 +0000 | |||
2181 | @@ -4,8 +4,8 @@ | |||
2182 | 4 | 4 | ||
2183 | 5 | ! | 5 | ! |
2184 | 6 | #MLReductionLib | 6 | #MLReductionLib |
2187 | 7 | !1|4|3|2 | 7 | !1|3|2 |
2188 | 8 | ! Default :: 1|4|3|2 | 8 | ! Default :: 1|3|2 |
2189 | 9 | ! The tensor integral reduction library.The current choices are: | 9 | ! The tensor integral reduction library.The current choices are: |
2190 | 10 | ! 1 | CutTools | 10 | ! 1 | CutTools |
2191 | 11 | ! 2 | PJFry++ | 11 | ! 2 | PJFry++ |
2192 | 12 | 12 | ||
2193 | === modified file 'UpdateNotes.txt' | |||
2194 | --- UpdateNotes.txt 2015-09-07 18:05:30 +0000 | |||
2195 | +++ UpdateNotes.txt 2015-10-25 15:32:18 +0000 | |||
2196 | @@ -1,6 +1,28 @@ | |||
2197 | 1 | Update notes for MadGraph5_aMC@NLO (in reverse time order) | 1 | Update notes for MadGraph5_aMC@NLO (in reverse time order) |
2198 | 2 | 2 | ||
2200 | 3 | 2.3.2.2 (06/09/15) | 3 | <<<<<<< TREE |
2201 | 4 | 2.3.2.2 (06/09/15) | ||
2202 | 5 | ======= | ||
2203 | 6 | 2.3.3(XX/XX/XX) | ||
2204 | 7 | OM: Allow new syntax for the param_card: instead of an entry you can enter scan:[val1, val2,...] | ||
2205 | 8 | To perform a scan on this parameter. | ||
2206 | 9 | OM: Having two mode for "output pythia8" one (default) for pythia8.2 and one for pythia8.1 (with --version=8.1) | ||
2207 | 10 | RF: Rewriting of job-control for NLO processes. Better accuracy estimates for FO processes | ||
2208 | 11 | RF: Fix for factorisation scale setting in FxFx merging when very large difference in scale in the | ||
2209 | 12 | non-QCD part of a process. | ||
2210 | 13 | RF: Better discarding of numerical instabilities in the real-emission matrix elements. Only of interested for | ||
2211 | 14 | processes which have jets at Born level, but do not require generation cut (like t-channel single-top). | ||
2212 | 15 | RF: Added an option to the run_card to allow for easier variation of the shower starting scale (NLO only). | ||
2213 | 16 | RF: Fixed a problem in the setting of the flavour map used for runs with iAPPL >= 1. | ||
2214 | 17 | RF: Allow for decay processes to compute (partial) decay widths at NLO accuracy (fixed order only). | ||
2215 | 18 | OM: (SysCalc interface) Allow to bypass the pdf reweighting/alpsfact reweighting | ||
2216 | 19 | MZ: fixed bug related to slurm clusters | ||
2217 | 20 | OM: remove the addmasses.py script of running by default on gridpack mode. | ||
2218 | 21 | if you want to have it running, you just have to rename the file madevent/bin/internal/addmasses_optional.py to | ||
2219 | 22 | madevent/bin/internal/addmasses_optional.py and it will work as before. (Do not work with SysCalc tag) | ||
2220 | 23 | |||
2221 | 24 | 2.3.2.2 (06/09/15) | ||
2222 | 25 | >>>>>>> MERGE-SOURCE | ||
2223 | 4 | VH: Finalized the MG5aMC-GoSam interface | 26 | VH: Finalized the MG5aMC-GoSam interface |
2224 | 5 | 27 | ||
2225 | 6 | 2.3.2(20/08/15) | 28 | 2.3.2(20/08/15) |
2226 | 7 | 29 | ||
2227 | === modified file 'VERSION' | |||
2228 | --- VERSION 2015-09-07 18:04:08 +0000 | |||
2229 | +++ VERSION 2015-10-25 15:32:18 +0000 | |||
2230 | @@ -1,5 +1,10 @@ | |||
2231 | 1 | <<<<<<< TREE | ||
2232 | 1 | version = 2.3.2.2 | 2 | version = 2.3.2.2 |
2233 | 2 | date = 2015-09-06 | 3 | date = 2015-09-06 |
2234 | 4 | ======= | ||
2235 | 5 | version = 2.3.3 | ||
2236 | 6 | date = 2015-10-20 | ||
2237 | 7 | >>>>>>> MERGE-SOURCE | ||
2238 | 3 | 8 | ||
2239 | 4 | 9 | ||
2240 | 5 | 10 | ||
2241 | 6 | 11 | ||
2242 | === modified file 'aloha/__init__.py' (properties changed: -x to +x) | |||
2243 | === modified file 'aloha/aloha_fct.py' (properties changed: -x to +x) | |||
2244 | === modified file 'aloha/aloha_lib.py' (properties changed: -x to +x) | |||
2245 | --- aloha/aloha_lib.py 2015-07-30 15:43:54 +0000 | |||
2246 | +++ aloha/aloha_lib.py 2015-10-25 15:32:18 +0000 | |||
2247 | @@ -1073,9 +1073,9 @@ | |||
2248 | 1073 | self[(0,)] = representation[(0,)] | 1073 | self[(0,)] = representation[(0,)] |
2249 | 1074 | except Exception: | 1074 | except Exception: |
2250 | 1075 | if representation: | 1075 | if representation: |
2252 | 1076 | raise LorentzObjectRepresentation.LorentzObjectRepresentationError("There is no key of (0,) in representation.") | 1076 | raise LorentzObjectRepresentation.LorentzObjectRepresentationError("There is no key of (0,) in representation.") |
2253 | 1077 | else: | 1077 | else: |
2255 | 1078 | self[(0,)] = 0 | 1078 | self[(0,)] = 0 |
2256 | 1079 | else: | 1079 | else: |
2257 | 1080 | self[(0,)] = representation | 1080 | self[(0,)] = representation |
2258 | 1081 | 1081 | ||
2259 | 1082 | 1082 | ||
2260 | === modified file 'aloha/aloha_object.py' (properties changed: -x to +x) | |||
2261 | --- aloha/aloha_object.py 2014-02-18 21:45:48 +0000 | |||
2262 | +++ aloha/aloha_object.py 2015-10-25 15:32:18 +0000 | |||
2263 | @@ -434,12 +434,12 @@ | |||
2264 | 434 | self.sub11 = aloha_lib.Variable('T%s_6' % self.particle) | 434 | self.sub11 = aloha_lib.Variable('T%s_6' % self.particle) |
2265 | 435 | self.sub12 = aloha_lib.Variable('T%s_7' % self.particle) | 435 | self.sub12 = aloha_lib.Variable('T%s_7' % self.particle) |
2266 | 436 | self.sub13 = aloha_lib.Variable('T%s_8' % self.particle) | 436 | self.sub13 = aloha_lib.Variable('T%s_8' % self.particle) |
2268 | 437 | 437 | ||
2269 | 438 | self.sub20 = aloha_lib.Variable('T%s_9' % self.particle) | 438 | self.sub20 = aloha_lib.Variable('T%s_9' % self.particle) |
2270 | 439 | self.sub21 = aloha_lib.Variable('T%s_10' % self.particle) | 439 | self.sub21 = aloha_lib.Variable('T%s_10' % self.particle) |
2271 | 440 | self.sub22 = aloha_lib.Variable('T%s_11' % self.particle) | 440 | self.sub22 = aloha_lib.Variable('T%s_11' % self.particle) |
2272 | 441 | self.sub23 = aloha_lib.Variable('T%s_12' % self.particle) | 441 | self.sub23 = aloha_lib.Variable('T%s_12' % self.particle) |
2274 | 442 | 442 | ||
2275 | 443 | self.sub30 = aloha_lib.Variable('T%s_13' % self.particle) | 443 | self.sub30 = aloha_lib.Variable('T%s_13' % self.particle) |
2276 | 444 | self.sub31 = aloha_lib.Variable('T%s_14' % self.particle) | 444 | self.sub31 = aloha_lib.Variable('T%s_14' % self.particle) |
2277 | 445 | self.sub32 = aloha_lib.Variable('T%s_15' % self.particle) | 445 | self.sub32 = aloha_lib.Variable('T%s_15' % self.particle) |
2278 | 446 | 446 | ||
2279 | === modified file 'aloha/aloha_parsers.py' (properties changed: -x to +x) | |||
2280 | === modified file 'aloha/aloha_writers.py' (properties changed: -x to +x) | |||
2281 | --- aloha/aloha_writers.py 2014-12-11 15:23:43 +0000 | |||
2282 | +++ aloha/aloha_writers.py 2015-10-25 15:32:18 +0000 | |||
2283 | @@ -689,7 +689,7 @@ | |||
2284 | 689 | if number.imag == 1: | 689 | if number.imag == 1: |
2285 | 690 | out = 'CI' | 690 | out = 'CI' |
2286 | 691 | elif number.imag == -1: | 691 | elif number.imag == -1: |
2288 | 692 | out = '-CI' | 692 | out = '-CI' |
2289 | 693 | else: | 693 | else: |
2290 | 694 | out = '%s * CI' % self.change_number_format(number.imag) | 694 | out = '%s * CI' % self.change_number_format(number.imag) |
2291 | 695 | else: | 695 | else: |
2292 | 696 | 696 | ||
2293 | === modified file 'aloha/create_aloha.py' (properties changed: -x to +x) | |||
2294 | --- aloha/create_aloha.py 2015-06-28 14:44:22 +0000 | |||
2295 | +++ aloha/create_aloha.py 2015-10-25 15:32:18 +0000 | |||
2296 | @@ -854,7 +854,7 @@ | |||
2297 | 854 | # reorganize the data (in order to use optimization for a given lorentz | 854 | # reorganize the data (in order to use optimization for a given lorentz |
2298 | 855 | #structure | 855 | #structure |
2299 | 856 | aloha.loop_mode = False | 856 | aloha.loop_mode = False |
2301 | 857 | # self.explicit_combine = False | 857 | # self.explicit_combine = False |
2302 | 858 | request = {} | 858 | request = {} |
2303 | 859 | 859 | ||
2304 | 860 | for list_l_name, tag, outgoing in data: | 860 | for list_l_name, tag, outgoing in data: |
2305 | 861 | 861 | ||
2306 | === modified file 'aloha/template_files/__init__.py' (properties changed: -x to +x) | |||
2307 | === modified file 'aloha/template_files/aloha_functions_loop.f' | |||
2308 | --- aloha/template_files/aloha_functions_loop.f 2013-11-29 07:28:53 +0000 | |||
2309 | +++ aloha/template_files/aloha_functions_loop.f 2015-10-25 15:32:18 +0000 | |||
2310 | @@ -86,6 +86,7 @@ | |||
2311 | 86 | 86 | ||
2312 | 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)) |
2313 | 88 | 88 | ||
2314 | 89 | |||
2315 | 89 | if ( pp.eq.rZero ) then | 90 | if ( pp.eq.rZero ) then |
2316 | 90 | 91 | ||
2317 | 91 | sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses | 92 | sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses |
2318 | @@ -477,13 +478,13 @@ | |||
2319 | 477 | 478 | ||
2320 | 478 | sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses | 479 | sqm(0) = dsqrt(abs(fmass)) ! possibility of negative fermion masses |
2321 | 479 | sqm(1) = sign(sqm(0),fmass) ! possibility of negative fermion masses | 480 | sqm(1) = sign(sqm(0),fmass) ! possibility of negative fermion masses |
2322 | 480 | ip = -((1+nh)/2) | ||
2323 | 481 | im = (1-nh)/2 | ||
2324 | 482 | 481 | ||
2329 | 483 | fo(5) = im * sqm(im) | 482 | im = nhel * (1+nh)/2 |
2330 | 484 | fo(6) = ip*nsf * sqm(im) | 483 | ip = nhel * -1 * ((1-nh)/2) |
2331 | 485 | fo(7) = im*nsf * sqm(-ip) | 484 | fo(5) = im * sqm(abs(ip)) |
2332 | 486 | fo(8) = ip * sqm(-ip) | 485 | fo(6) = ip*nsf * sqm(abs(ip)) |
2333 | 486 | fo(7) = im*nsf * sqm(abs(im)) | ||
2334 | 487 | fo(8) = ip * sqm(abs(im)) | ||
2335 | 487 | 488 | ||
2336 | 488 | else | 489 | else |
2337 | 489 | 490 | ||
2338 | 490 | 491 | ||
2339 | === modified file 'aloha/template_files/wavefunctions.py' (properties changed: -x to +x) | |||
2340 | --- aloha/template_files/wavefunctions.py 2013-07-23 16:48:52 +0000 | |||
2341 | +++ aloha/template_files/wavefunctions.py 2015-10-25 15:32:18 +0000 | |||
2342 | @@ -316,7 +316,7 @@ | |||
2343 | 316 | elif nhel == 1: | 316 | elif nhel == 1: |
2344 | 317 | for j in range(4): | 317 | for j in range(4): |
2345 | 318 | for i in range(4): | 318 | for i in range(4): |
2347 | 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] ) |
2348 | 320 | elif nhel == 0: | 320 | elif nhel == 0: |
2349 | 321 | for j in range(4): | 321 | for j in range(4): |
2350 | 322 | for i in range(4): | 322 | for i in range(4): |
2351 | @@ -324,10 +324,10 @@ | |||
2352 | 324 | elif nhel == -1: | 324 | elif nhel == -1: |
2353 | 325 | for j in range(4): | 325 | for j in range(4): |
2354 | 326 | for i in range(4): | 326 | for i in range(4): |
2356 | 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] ) |
2357 | 328 | 328 | ||
2358 | 329 | else: | 329 | else: |
2360 | 330 | raise Exception, 'invalid helicity TXXXXXX' | 330 | raise Exception, 'invalid helicity TXXXXXX' |
2361 | 331 | 331 | ||
2362 | 332 | 332 | ||
2363 | 333 | 333 | ||
2364 | 334 | 334 | ||
2365 | === modified file 'bin/mg5' | |||
2366 | --- bin/mg5 2014-07-17 13:34:15 +0000 | |||
2367 | +++ bin/mg5 2015-10-25 15:32:18 +0000 | |||
2368 | @@ -28,6 +28,6 @@ | |||
2369 | 28 | 28 | ||
2370 | 29 | sys.argv.pop(0) | 29 | sys.argv.pop(0) |
2371 | 30 | if __debug__: | 30 | if __debug__: |
2373 | 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) )) |
2374 | 32 | else: | 32 | else: |
2375 | 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) )) |
2376 | 34 | 34 | ||
2377 | === modified file 'input/.mg5_configuration_default.txt' | |||
2378 | --- input/.mg5_configuration_default.txt 2015-08-14 13:56:58 +0000 | |||
2379 | +++ input/.mg5_configuration_default.txt 2015-10-25 15:32:18 +0000 | |||
2380 | @@ -84,6 +84,9 @@ | |||
2381 | 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) |
2382 | 85 | #! when launching MadEvent [True/False] | 85 | #! when launching MadEvent [True/False] |
2383 | 86 | # automatic_html_opening = True | 86 | # automatic_html_opening = True |
2384 | 87 | #! allow notification of finished job in the notification center (Mac Only) | ||
2385 | 88 | # notification_center = True | ||
2386 | 89 | |||
2387 | 87 | 90 | ||
2388 | 88 | #! Default Running mode | 91 | #! Default Running mode |
2389 | 89 | #! 0: single machine/ 1: cluster / 2: multicore | 92 | #! 0: single machine/ 1: cluster / 2: multicore |
2390 | 90 | 93 | ||
2391 | === modified file 'madgraph/__init__.py' (properties changed: -x to +x) | |||
2392 | === modified file 'madgraph/core/__init__.py' (properties changed: -x to +x) | |||
2393 | === modified file 'madgraph/core/base_objects.py' (properties changed: -x to +x) | |||
2394 | --- madgraph/core/base_objects.py 2015-08-16 22:19:30 +0000 | |||
2395 | +++ madgraph/core/base_objects.py 2015-10-25 15:32:18 +0000 | |||
2396 | @@ -202,8 +202,8 @@ | |||
2397 | 202 | 202 | ||
2398 | 203 | sorted_keys = ['name', 'antiname', 'spin', 'color', | 203 | sorted_keys = ['name', 'antiname', 'spin', 'color', |
2399 | 204 | 'charge', 'mass', 'width', 'pdg_code', | 204 | 'charge', 'mass', 'width', 'pdg_code', |
2402 | 205 | 'texname', 'antitexname', 'line', 'propagating', 'propagator', | 205 | 'line', 'propagator', |
2403 | 206 | 'is_part', 'self_antipart', 'ghost', 'counterterm'] | 206 | 'is_part', 'self_antipart', 'type', 'counterterm'] |
2404 | 207 | 207 | ||
2405 | 208 | def default_setup(self): | 208 | def default_setup(self): |
2406 | 209 | """Default values for all properties""" | 209 | """Default values for all properties""" |
2407 | @@ -216,19 +216,55 @@ | |||
2408 | 216 | self['mass'] = 'ZERO' | 216 | self['mass'] = 'ZERO' |
2409 | 217 | self['width'] = 'ZERO' | 217 | self['width'] = 'ZERO' |
2410 | 218 | self['pdg_code'] = 0 | 218 | self['pdg_code'] = 0 |
2413 | 219 | self['texname'] = 'none' | 219 | #self['texname'] = 'none' |
2414 | 220 | self['antitexname'] = 'none' | 220 | #self['antitexname'] = 'none' |
2415 | 221 | self['line'] = 'dashed' | 221 | self['line'] = 'dashed' |
2417 | 222 | self['propagating'] = True | 222 | #self['propagating'] = True -> removed in favor or 'line' = None |
2418 | 223 | self['propagator'] = '' | 223 | self['propagator'] = '' |
2419 | 224 | self['is_part'] = True | 224 | self['is_part'] = True |
2420 | 225 | self['self_antipart'] = False | 225 | self['self_antipart'] = False |
2421 | 226 | # True if ghost, False otherwise | 226 | # True if ghost, False otherwise |
2423 | 227 | self['ghost'] = False | 227 | #self['ghost'] = False |
2424 | 228 | self['type'] = '' # empty means normal can also be ghost or goldstone | ||
2425 | 228 | # Counterterm defined as a dictionary with format: | 229 | # Counterterm defined as a dictionary with format: |
2426 | 229 | # ('ORDER_OF_COUNTERTERM',((Particle_list_PDG))):{laurent_order:CTCouplingName} | 230 | # ('ORDER_OF_COUNTERTERM',((Particle_list_PDG))):{laurent_order:CTCouplingName} |
2427 | 230 | self['counterterm'] = {} | 231 | self['counterterm'] = {} |
2428 | 231 | 232 | ||
2429 | 233 | def get(self, name): | ||
2430 | 234 | |||
2431 | 235 | if name == 'ghost': | ||
2432 | 236 | return self['type'] == 'ghost' | ||
2433 | 237 | elif name == 'goldstone': | ||
2434 | 238 | return self['type'] == 'goldstone' | ||
2435 | 239 | elif name == 'propagating': | ||
2436 | 240 | return self['line'] is not None | ||
2437 | 241 | else: | ||
2438 | 242 | return super(Particle, self).get(name) | ||
2439 | 243 | |||
2440 | 244 | def set(self, name, value, force=False): | ||
2441 | 245 | |||
2442 | 246 | if name in ['texname', 'antitexname']: | ||
2443 | 247 | return True | ||
2444 | 248 | elif name == 'propagating': | ||
2445 | 249 | if not value: | ||
2446 | 250 | return self.set('line', None, force=force) | ||
2447 | 251 | elif not self.get('line'): | ||
2448 | 252 | return self.set('line', 'dashed',force=force) | ||
2449 | 253 | return True | ||
2450 | 254 | elif name in ['ghost', 'goldstone']: | ||
2451 | 255 | if self.get('type') == name: | ||
2452 | 256 | if value: | ||
2453 | 257 | return True | ||
2454 | 258 | else: | ||
2455 | 259 | return self.set('type', '', force=force) | ||
2456 | 260 | else: | ||
2457 | 261 | if value: | ||
2458 | 262 | return self.set('type', name, force=force) | ||
2459 | 263 | else: | ||
2460 | 264 | return True | ||
2461 | 265 | return super(Particle, self).set(name, value,force=force) | ||
2462 | 266 | |||
2463 | 267 | |||
2464 | 232 | def filter(self, name, value): | 268 | def filter(self, name, value): |
2465 | 233 | """Filter for valid particle property values.""" | 269 | """Filter for valid particle property values.""" |
2466 | 234 | 270 | ||
2467 | @@ -1213,7 +1249,7 @@ | |||
2468 | 1213 | if isinstance(id, int): | 1249 | if isinstance(id, int): |
2469 | 1214 | try: | 1250 | try: |
2470 | 1215 | return self.get("particle_dict")[id] | 1251 | return self.get("particle_dict")[id] |
2472 | 1216 | except Exception: | 1252 | except Exception,error: |
2473 | 1217 | return None | 1253 | return None |
2474 | 1218 | else: | 1254 | else: |
2475 | 1219 | if not hasattr(self, 'name2part'): | 1255 | if not hasattr(self, 'name2part'): |
2476 | @@ -1547,9 +1583,9 @@ | |||
2477 | 1547 | def write_param_card(self): | 1583 | def write_param_card(self): |
2478 | 1548 | """Write out the param_card, and return as string.""" | 1584 | """Write out the param_card, and return as string.""" |
2479 | 1549 | 1585 | ||
2481 | 1550 | import models.write_param_card as writter | 1586 | import models.write_param_card as writer |
2482 | 1551 | out = StringIO.StringIO() # it's suppose to be written in a file | 1587 | out = StringIO.StringIO() # it's suppose to be written in a file |
2484 | 1552 | param = writter.ParamCardWriter(self) | 1588 | param = writer.ParamCardWriter(self) |
2485 | 1553 | param.define_output_file(out) | 1589 | param.define_output_file(out) |
2486 | 1554 | param.write_card() | 1590 | param.write_card() |
2487 | 1555 | return out.getvalue() | 1591 | return out.getvalue() |
2488 | @@ -1577,55 +1613,118 @@ | |||
2489 | 1577 | def change_electroweak_mode(self, mode): | 1613 | def change_electroweak_mode(self, mode): |
2490 | 1578 | """Change the electroweak mode. The only valid mode now is external. | 1614 | """Change the electroweak mode. The only valid mode now is external. |
2491 | 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.""" |
2494 | 1580 | 1616 | ||
2495 | 1581 | assert mode == "external" | 1617 | assert mode in ["external",set(['mz','mw','alpha'])] |
2496 | 1582 | 1618 | ||
2497 | 1583 | try: | 1619 | try: |
2498 | 1584 | W = self.get('particle_dict')[24] | 1620 | W = self.get('particle_dict')[24] |
2499 | 1585 | except KeyError: | 1621 | except KeyError: |
2501 | 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 '+ |
2502 | 1623 | 'change the EW scheme!') | ||
2503 | 1587 | 1624 | ||
2518 | 1588 | MW = self.get_parameter(W.get('mass')) | 1625 | if mode=='external': |
2519 | 1589 | if not isinstance(MW, ParamCardVariable): | 1626 | MW = self.get_parameter(W.get('mass')) |
2520 | 1590 | newMW = ParamCardVariable(MW.name, MW.value, 'MASS', [24]) | 1627 | if not isinstance(MW, ParamCardVariable): |
2521 | 1591 | if not newMW.value: | 1628 | newMW = ParamCardVariable(MW.name, MW.value, 'MASS', [24]) |
2522 | 1592 | newMW.value = 80.385 | 1629 | if not newMW.value: |
2523 | 1593 | #remove the old definition | 1630 | newMW.value = 80.385 |
2524 | 1594 | self.get('parameters')[MW.depend].remove(MW) | 1631 | #remove the old definition |
2525 | 1595 | # add the new one | 1632 | self.get('parameters')[MW.depend].remove(MW) |
2526 | 1596 | self.add_param(newMW, ['external']) | 1633 | # add the new one |
2527 | 1597 | 1634 | self.add_param(newMW, ['external']) | |
2528 | 1598 | # Now check for sw2. if not define bypass this | 1635 | |
2529 | 1599 | try: | 1636 | # Now check for sw2. if not define bypass this |
2516 | 1600 | sw2 = self.get_parameter('sw2') | ||
2517 | 1601 | except KeyError: | ||
2530 | 1602 | try: | 1637 | try: |
2532 | 1603 | sw2 = self.get_parameter('mdl_sw2') | 1638 | sw2 = self.get_parameter('sw2') |
2533 | 1604 | except KeyError: | 1639 | except KeyError: |
2546 | 1605 | sw2=None | 1640 | try: |
2547 | 1606 | 1641 | sw2 = self.get_parameter('mdl_sw2') | |
2548 | 1607 | if sw2: | 1642 | except KeyError: |
2549 | 1608 | newsw2 = ParamCardVariable(sw2.name,sw2.value, 'SMINPUTS', [4]) | 1643 | sw2=None |
2550 | 1609 | if not newsw2.value: | 1644 | |
2551 | 1610 | newsw2.value = 0.222246485786 | 1645 | if sw2: |
2552 | 1611 | #remove the old definition | 1646 | newsw2 = ParamCardVariable(sw2.name,sw2.value, 'SMINPUTS', [4]) |
2553 | 1612 | self.get('parameters')[sw2.depend].remove(sw2) | 1647 | if not newsw2.value: |
2554 | 1613 | # add the new one | 1648 | newsw2.value = 0.222246485786 |
2555 | 1614 | self.add_param(newsw2, ['external']) | 1649 | #remove the old definition |
2556 | 1615 | 1650 | self.get('parameters')[sw2.depend].remove(sw2) | |
2557 | 1616 | def change_mass_to_complex_scheme(self): | 1651 | # add the new one |
2558 | 1652 | self.add_param(newsw2, ['external']) | ||
2559 | 1653 | # Force a refresh of the parameter dictionary | ||
2560 | 1654 | self.parameters_dict = None | ||
2561 | 1655 | return true | ||
2562 | 1656 | |||
2563 | 1657 | elif mode==set(['mz','mw','alpha']): | ||
2564 | 1658 | # For now, all we support is to go from mz, Gf, alpha to mz, mw, alpha | ||
2565 | 1659 | W = self.get('particle_dict')[24] | ||
2566 | 1660 | mass = self.get_parameter(W.get('mass')) | ||
2567 | 1661 | mass_expr = 'cmath.sqrt(%(prefix)sMZ__exp__2/2. + cmath.sqrt('+\ | ||
2568 | 1662 | '%(prefix)sMZ__exp__4/4. - (%(prefix)saEW*cmath.pi*%(prefix)s'+\ | ||
2569 | 1663 | 'MZ__exp__2)/(%(prefix)sGf*%(prefix)ssqrt__2)))' | ||
2570 | 1664 | if 'external' in mass.depend: | ||
2571 | 1665 | # Nothing to be done | ||
2572 | 1666 | return True | ||
2573 | 1667 | match = False | ||
2574 | 1668 | if mass.expr == mass_expr%{'prefix':''}: | ||
2575 | 1669 | prefix = '' | ||
2576 | 1670 | match = True | ||
2577 | 1671 | elif mass.expr == mass_expr%{'prefix':'mdl_'}: | ||
2578 | 1672 | prefix = 'mdl_' | ||
2579 | 1673 | match = True | ||
2580 | 1674 | if match: | ||
2581 | 1675 | MW = ParamCardVariable(mass.name, mass.value, 'MASS', [24]) | ||
2582 | 1676 | if not MW.value: | ||
2583 | 1677 | MW.value = 80.385 | ||
2584 | 1678 | self.get('parameters')[('external',)].append(MW) | ||
2585 | 1679 | self.get('parameters')[mass.depend].remove(mass) | ||
2586 | 1680 | # Make Gf an internal parameter | ||
2587 | 1681 | new_param = ModelVariable('Gf', | ||
2588 | 1682 | '-%(prefix)saEW*%(prefix)sMZ**2*cmath.pi/(cmath.sqrt(2)*%(MW)s**2*(%(MW)s**2 - %(prefix)sMZ**2))' %\ | ||
2589 | 1683 | {'MW': mass.name,'prefix':prefix}, 'complex', mass.depend) | ||
2590 | 1684 | Gf = self.get_parameter('%sGf'%prefix) | ||
2591 | 1685 | self.get('parameters')[('external',)].remove(Gf) | ||
2592 | 1686 | self.add_param(new_param, ['%saEW'%prefix]) | ||
2593 | 1687 | # Force a refresh of the parameter dictionary | ||
2594 | 1688 | self.parameters_dict = None | ||
2595 | 1689 | return True | ||
2596 | 1690 | else: | ||
2597 | 1691 | return False | ||
2598 | 1692 | |||
2599 | 1693 | def change_mass_to_complex_scheme(self, toCMS=True): | ||
2600 | 1617 | """modify the expression changing the mass to complex mass scheme""" | 1694 | """modify the expression changing the mass to complex mass scheme""" |
2601 | 1618 | 1695 | ||
2603 | 1619 | # 1) Find All input parameter mass and width associated | 1696 | # 1) Change the 'CMSParam' of loop_qcd_qed model to 1.0 so as to remove |
2604 | 1697 | # the 'real' prefix fromall UVCT wf renormalization expressions. | ||
2605 | 1698 | # If toCMS is False, then it makes sure CMSParam is 0.0 and returns | ||
2606 | 1699 | # immediatly. | ||
2607 | 1700 | # 2) Find All input parameter mass and width associated | ||
2608 | 1620 | # Add a internal parameter and replace mass with that param | 1701 | # Add a internal parameter and replace mass with that param |
2610 | 1621 | # 2) Find All mass fixed by the model and width associated | 1702 | # 3) Find All mass fixed by the model and width associated |
2611 | 1622 | # -> Both need to be fixed with a real() /Imag() | 1703 | # -> Both need to be fixed with a real() /Imag() |
2616 | 1623 | # 3) Find All width fixed by the model | 1704 | # 4) Find All width set by the model |
2617 | 1624 | # -> Need to be fixed with a real() | 1705 | # -> Need to be set with a real() |
2618 | 1625 | # 4) Fix the Yukawa mass to the value of the complex mass/ real mass | 1706 | # 5) Fix the Yukawa mass to the value of the complex mass/ real mass |
2619 | 1626 | # 5) Loop through all expression and modify those accordingly | 1707 | # 6) Loop through all expression and modify those accordingly |
2620 | 1627 | # Including all parameter expression as complex | 1708 | # Including all parameter expression as complex |
2622 | 1628 | 1709 | ||
2623 | 1710 | try: | ||
2624 | 1711 | CMSParam = self.get_parameter('CMSParam') | ||
2625 | 1712 | except KeyError: | ||
2626 | 1713 | try: | ||
2627 | 1714 | CMSParam = self.get_parameter('mdl_CMSParam') | ||
2628 | 1715 | except KeyError: | ||
2629 | 1716 | CMSParam = None | ||
2630 | 1717 | |||
2631 | 1718 | # Handle the case where we want to make sure the CMS is turned off | ||
2632 | 1719 | if not toCMS: | ||
2633 | 1720 | if CMSParam: | ||
2634 | 1721 | CMSParam.expr = '0.0' | ||
2635 | 1722 | return | ||
2636 | 1723 | |||
2637 | 1724 | # Now handle the case where we want to turn to CMS. | ||
2638 | 1725 | if CMSParam: | ||
2639 | 1726 | CMSParam.expr = '1.0' | ||
2640 | 1727 | |||
2641 | 1629 | to_change = {} | 1728 | to_change = {} |
2642 | 1630 | mass_widths = [] # parameter which should stay real | 1729 | mass_widths = [] # parameter which should stay real |
2643 | 1631 | for particle in self.get('particles'): | 1730 | for particle in self.get('particles'): |
2644 | @@ -1634,52 +1733,29 @@ | |||
2645 | 1634 | continue | 1733 | continue |
2646 | 1635 | mass_widths.append(particle.get('width')) | 1734 | mass_widths.append(particle.get('width')) |
2647 | 1636 | mass_widths.append(particle.get('mass')) | 1735 | mass_widths.append(particle.get('mass')) |
2649 | 1637 | if particle.get('width') == 'ZERO': | 1736 | width = self.get_parameter(particle.get('width')) |
2650 | 1737 | if (isinstance(width.value, (complex,float)) and abs(width.value)==0.0) or \ | ||
2651 | 1738 | width.name.lower() =='zero': | ||
2652 | 1638 | #everything is fine since the width is zero | 1739 | #everything is fine since the width is zero |
2653 | 1639 | continue | 1740 | continue |
2654 | 1640 | width = self.get_parameter(particle.get('width')) | ||
2655 | 1641 | if not isinstance(width, ParamCardVariable): | 1741 | if not isinstance(width, ParamCardVariable): |
2656 | 1642 | width.expr = 're(%s)' % width.expr | 1742 | width.expr = 're(%s)' % width.expr |
2659 | 1643 | if particle.get('mass') != 'ZERO': | 1743 | mass = self.get_parameter(particle.get('mass')) |
2660 | 1644 | mass = self.get_parameter(particle.get('mass')) | 1744 | if (isinstance(width.value, (complex,float)) and abs(width.value)!=0.0) or \ |
2661 | 1745 | mass.name.lower() != 'zero': | ||
2662 | 1645 | # special SM treatment to change the gauge scheme automatically. | 1746 | # special SM treatment to change the gauge scheme automatically. |
2700 | 1646 | if particle.get('pdg_code') == 24: | 1747 | if particle.get('pdg_code') == 24 and isinstance(mass, |
2701 | 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): |
2702 | 1648 | # Make MW an external parameter | 1749 | status = self.change_electroweak_mode( |
2703 | 1649 | MW = ParamCardVariable(mass.name, mass.value, 'MASS', [24]) | 1750 | set(['mz','mw','alpha'])) |
2704 | 1650 | if not MW.value: | 1751 | # Use the newly defined parameter for the W mass |
2705 | 1651 | MW.value = 80.385 | 1752 | mass = self.get_parameter(particle.get('mass')) |
2706 | 1652 | self.get('parameters')[('external',)].append(MW) | 1753 | if not status: |
2707 | 1653 | self.get('parameters')[mass.depend].remove(mass) | 1754 | logger.warning('The W mass is not an external '+ |
2708 | 1654 | # Make Gf an internal parameter | 1755 | 'parameter in this model and the automatic change of'+ |
2709 | 1655 | new_param = ModelVariable('Gf', | 1756 | ' electroweak scheme changed. This is not advised for '+ |
2710 | 1656 | '-aEW*MZ**2*cmath.pi/(cmath.sqrt(2)*%(MW)s**2*(%(MW)s**2 - MZ**2))' %\ | 1757 | 'applying the complex mass scheme.') |
2711 | 1657 | {'MW': mass.name}, 'complex', mass.depend) | 1758 | |
2675 | 1658 | Gf = self.get_parameter('Gf') | ||
2676 | 1659 | self.get('parameters')[('external',)].remove(Gf) | ||
2677 | 1660 | self.add_param(new_param, ['aEW']) | ||
2678 | 1661 | # Use the new mass for the future modification | ||
2679 | 1662 | mass = MW | ||
2680 | 1663 | #option with prefixing | ||
2681 | 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)))': | ||
2682 | 1665 | # Make MW an external parameter | ||
2683 | 1666 | MW = ParamCardVariable(mass.name, mass.value, 'MASS', [24]) | ||
2684 | 1667 | if not MW.value: | ||
2685 | 1668 | MW.value = 80.385 | ||
2686 | 1669 | self.get('parameters')[('external',)].append(MW) | ||
2687 | 1670 | self.get('parameters')[mass.depend].remove(mass) | ||
2688 | 1671 | # Make Gf an internal parameter | ||
2689 | 1672 | new_param = ModelVariable('mdl_Gf', | ||
2690 | 1673 | '-mdl_aEW*mdl_MZ**2*cmath.pi/(cmath.sqrt(2)*%(MW)s**2*(%(MW)s**2 - mdl_MZ**2))' %\ | ||
2691 | 1674 | {'MW': mass.name}, 'complex', mass.depend) | ||
2692 | 1675 | Gf = self.get_parameter('mdl_Gf') | ||
2693 | 1676 | self.get('parameters')[('external',)].remove(Gf) | ||
2694 | 1677 | self.add_param(new_param, ['mdl_aEW']) | ||
2695 | 1678 | # Use the new mass for the future modification | ||
2696 | 1679 | mass = MW | ||
2697 | 1680 | elif isinstance(mass, ModelVariable): | ||
2698 | 1681 | logger.warning('W mass is not an external parameter. This is not adviced for the complex mass scheme.') | ||
2699 | 1682 | |||
2712 | 1683 | # Add A new parameter CMASS | 1759 | # Add A new parameter CMASS |
2713 | 1684 | #first compute the dependencies (as,...) | 1760 | #first compute the dependencies (as,...) |
2714 | 1685 | depend = list(set(mass.depend + width.depend)) | 1761 | depend = list(set(mass.depend + width.depend)) |
2715 | @@ -3638,7 +3714,7 @@ | |||
2716 | 3638 | my_isids = [leg.get('ids') for leg in self.get('legs') \ | 3714 | my_isids = [leg.get('ids') for leg in self.get('legs') \ |
2717 | 3639 | if not leg.get('state')] | 3715 | if not leg.get('state')] |
2718 | 3640 | my_fsids = [leg.get('ids') for leg in self.get('legs') \ | 3716 | my_fsids = [leg.get('ids') for leg in self.get('legs') \ |
2720 | 3641 | if leg.get('state')] | 3717 | if leg.get('state')] |
2721 | 3642 | for i, is_id in enumerate(initial_state_ids): | 3718 | for i, is_id in enumerate(initial_state_ids): |
2722 | 3643 | assert is_id in my_isids[i] | 3719 | assert is_id in my_isids[i] |
2723 | 3644 | for i, fs_id in enumerate(final_state_ids): | 3720 | for i, fs_id in enumerate(final_state_ids): |
2724 | 3645 | 3721 | ||
2725 | === modified file 'madgraph/core/color_algebra.py' (properties changed: -x to +x) | |||
2726 | === modified file 'madgraph/core/color_amp.py' (properties changed: -x to +x) | |||
2727 | === modified file 'madgraph/core/diagram_generation.py' (properties changed: -x to +x) | |||
2728 | --- madgraph/core/diagram_generation.py 2015-06-28 14:44:22 +0000 | |||
2729 | +++ madgraph/core/diagram_generation.py 2015-10-25 15:32:18 +0000 | |||
2730 | @@ -26,7 +26,8 @@ | |||
2731 | 26 | 26 | ||
2732 | 27 | import madgraph.core.base_objects as base_objects | 27 | import madgraph.core.base_objects as base_objects |
2733 | 28 | import madgraph.various.misc as misc | 28 | import madgraph.various.misc as misc |
2735 | 29 | from madgraph import InvalidCmd | 29 | from madgraph import InvalidCmd, MadGraph5Error |
2736 | 30 | |||
2737 | 30 | logger = logging.getLogger('madgraph.diagram_generation') | 31 | logger = logging.getLogger('madgraph.diagram_generation') |
2738 | 31 | 32 | ||
2739 | 32 | 33 | ||
2740 | @@ -1552,7 +1553,7 @@ | |||
2741 | 1552 | "%s is not a valid ProcessDefinitionList object" % str(value) | 1553 | "%s is not a valid ProcessDefinitionList object" % str(value) |
2742 | 1553 | 1554 | ||
2743 | 1554 | if name == 'amplitudes': | 1555 | if name == 'amplitudes': |
2745 | 1555 | if not isinstance(value, diagram_generation.AmplitudeList): | 1556 | if not isinstance(value, AmplitudeList): |
2746 | 1556 | raise self.PhysicsObjectError, \ | 1557 | raise self.PhysicsObjectError, \ |
2747 | 1557 | "%s is not a valid AmplitudeList object" % str(value) | 1558 | "%s is not a valid AmplitudeList object" % str(value) |
2748 | 1558 | 1559 | ||
2749 | 1559 | 1560 | ||
2750 | === modified file 'madgraph/core/drawing.py' (properties changed: -x to +x) | |||
2751 | --- madgraph/core/drawing.py 2014-10-07 05:52:01 +0000 | |||
2752 | +++ madgraph/core/drawing.py 2015-10-25 15:32:18 +0000 | |||
2753 | @@ -1131,8 +1131,8 @@ | |||
2754 | 1131 | return [] | 1131 | return [] |
2755 | 1132 | 1132 | ||
2756 | 1133 | assert self.min_level <= level <= self.max_level , \ | 1133 | assert self.min_level <= level <= self.max_level , \ |
2759 | 1134 | 'Incorrect value of min/max level: %s <= %s <= %s' % \ | 1134 | 'Incorrect value of min/max level: %s <= %s <= %s' % \ |
2760 | 1135 | (self.min_level, level, self.max_level) | 1135 | (self.min_level, level, self.max_level) |
2761 | 1136 | 1136 | ||
2762 | 1137 | 1137 | ||
2763 | 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 |
2764 | @@ -1188,7 +1188,7 @@ | |||
2765 | 1188 | # Assign position to each vertex | 1188 | # Assign position to each vertex |
2766 | 1189 | for i, vertex in enumerate(vertex_at_level): | 1189 | for i, vertex in enumerate(vertex_at_level): |
2767 | 1190 | vertex.def_position((level - self.min_level) / self.nb_level, | 1190 | vertex.def_position((level - self.min_level) / self.nb_level, |
2769 | 1191 | min + dist * (begin_gap + i)) | 1191 | min + dist * (begin_gap + i)) |
2770 | 1192 | 1192 | ||
2771 | 1193 | return vertex_at_level | 1193 | return vertex_at_level |
2772 | 1194 | 1194 | ||
2773 | 1195 | 1195 | ||
2774 | === modified file 'madgraph/core/helas_objects.py' (properties changed: -x to +x) | |||
2775 | --- madgraph/core/helas_objects.py 2015-07-02 02:29:22 +0000 | |||
2776 | +++ madgraph/core/helas_objects.py 2015-10-25 15:32:18 +0000 | |||
2777 | @@ -3164,7 +3164,7 @@ | |||
2778 | 3164 | """Calculate the actual coupling orders of this diagram""" | 3164 | """Calculate the actual coupling orders of this diagram""" |
2779 | 3165 | 3165 | ||
2780 | 3166 | wavefunctions = HelasWavefunctionList.extract_wavefunctions(\ | 3166 | wavefunctions = HelasWavefunctionList.extract_wavefunctions(\ |
2782 | 3167 | self.get('amplitudes')[0].get('mothers')) | 3167 | self.get('amplitudes')[0].get('mothers')) |
2783 | 3168 | 3168 | ||
2784 | 3169 | coupling_orders = {} | 3169 | coupling_orders = {} |
2785 | 3170 | for wf in wavefunctions + [self.get('amplitudes')[0]]: | 3170 | for wf in wavefunctions + [self.get('amplitudes')[0]]: |
2786 | 3171 | 3171 | ||
2787 | === modified file 'madgraph/fks/__init__.py' (properties changed: -x to +x) | |||
2788 | === modified file 'madgraph/fks/fks_base.py' (properties changed: -x to +x) | |||
2789 | --- madgraph/fks/fks_base.py 2015-05-25 20:43:18 +0000 | |||
2790 | +++ madgraph/fks/fks_base.py 2015-10-25 15:32:18 +0000 | |||
2791 | @@ -132,6 +132,9 @@ | |||
2792 | 132 | perturbation = [] | 132 | perturbation = [] |
2793 | 133 | for procdef in self['process_definitions']: | 133 | for procdef in self['process_definitions']: |
2794 | 134 | soft_particles = [] | 134 | soft_particles = [] |
2795 | 135 | # do not warn for decay processes | ||
2796 | 136 | if [ i['state'] for i in procdef['legs']].count(False) == 1: | ||
2797 | 137 | continue | ||
2798 | 135 | for pert in procdef['perturbation_couplings']: | 138 | for pert in procdef['perturbation_couplings']: |
2799 | 136 | if pert not in perturbation: | 139 | if pert not in perturbation: |
2800 | 137 | perturbation.append(pert) | 140 | perturbation.append(pert) |
2801 | @@ -550,10 +553,19 @@ | |||
2802 | 550 | """finds the FKS real configurations for a given process""" | 553 | """finds the FKS real configurations for a given process""" |
2803 | 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]: |
2804 | 552 | raise fks_common.FKSProcessError('Disordered numbers of leglist') | 555 | raise fks_common.FKSProcessError('Disordered numbers of leglist') |
2805 | 556 | |||
2806 | 557 | if [ i['state'] for i in self.leglist].count(False) == 1: | ||
2807 | 558 | decay_process=True | ||
2808 | 559 | else: | ||
2809 | 560 | decay_process=False | ||
2810 | 561 | |||
2811 | 553 | for i in self.leglist: | 562 | for i in self.leglist: |
2812 | 554 | i_i = i['number'] - 1 | 563 | i_i = i['number'] - 1 |
2813 | 555 | self.reals.append([]) | 564 | self.reals.append([]) |
2815 | 556 | self.splittings[i_i] = fks_common.find_splittings(i, self.born_proc['model'], {}, pert_order) | 565 | if decay_process and not i['state']: |
2816 | 566 | self.splittings[i_i]=[] | ||
2817 | 567 | else: | ||
2818 | 568 | self.splittings[i_i] = fks_common.find_splittings(i, self.born_proc['model'], {}, pert_order) | ||
2819 | 557 | for split in self.splittings[i_i]: | 569 | for split in self.splittings[i_i]: |
2820 | 558 | self.reals[i_i].append( | 570 | self.reals[i_i].append( |
2821 | 559 | fks_common.insert_legs(self.leglist, i, split,pert=pert_order)) | 571 | fks_common.insert_legs(self.leglist, i, split,pert=pert_order)) |
2822 | 560 | 572 | ||
2823 | === modified file 'madgraph/fks/fks_common.py' (properties changed: -x to +x) | |||
2824 | === modified file 'madgraph/fks/fks_helas_objects.py' (properties changed: -x to +x) | |||
2825 | === modified file 'madgraph/interface/__init__.py' (properties changed: -x to +x) | |||
2826 | === modified file 'madgraph/interface/amcatnlo_interface.py' (properties changed: -x to +x) | |||
2827 | --- madgraph/interface/amcatnlo_interface.py 2015-08-12 20:50:38 +0000 | |||
2828 | +++ madgraph/interface/amcatnlo_interface.py 2015-10-25 15:32:18 +0000 | |||
2829 | @@ -30,6 +30,7 @@ | |||
2830 | 30 | import madgraph.interface.extended_cmd as cmd | 30 | import madgraph.interface.extended_cmd as cmd |
2831 | 31 | import madgraph.interface.madgraph_interface as mg_interface | 31 | import madgraph.interface.madgraph_interface as mg_interface |
2832 | 32 | import madgraph.interface.madevent_interface as me_interface | 32 | import madgraph.interface.madevent_interface as me_interface |
2833 | 33 | import madgraph.interface.extended_cmd as extended_cmd | ||
2834 | 33 | import madgraph.interface.amcatnlo_run_interface as run_interface | 34 | import madgraph.interface.amcatnlo_run_interface as run_interface |
2835 | 34 | import madgraph.interface.launch_ext_program as launch_ext | 35 | import madgraph.interface.launch_ext_program as launch_ext |
2836 | 35 | import madgraph.interface.loop_interface as Loop_interface | 36 | import madgraph.interface.loop_interface as Loop_interface |
2837 | @@ -540,10 +541,22 @@ | |||
2838 | 540 | for me in self._curr_matrix_elements.get_matrix_elements(): | 541 | for me in self._curr_matrix_elements.get_matrix_elements(): |
2839 | 541 | uid += 1 # update the identification number | 542 | uid += 1 # update the identification number |
2840 | 542 | me.get('processes')[0].set('uid', uid) | 543 | me.get('processes')[0].set('uid', uid) |
2841 | 544 | try: | ||
2842 | 545 | initial_states.append(sorted(list(set((p.get_initial_pdg(1),p.get_initial_pdg(2)) for \ | ||
2843 | 546 | p in me.born_matrix_element.get('processes'))))) | ||
2844 | 547 | except IndexError: | ||
2845 | 548 | initial_states.append(sorted(list(set((p.get_initial_pdg(1)) for \ | ||
2846 | 549 | p in me.born_matrix_element.get('processes'))))) | ||
2847 | 550 | |||
2848 | 543 | for fksreal in me.real_processes: | 551 | for fksreal in me.real_processes: |
2849 | 544 | # Pick out all initial state particles for the two beams | 552 | # Pick out all initial state particles for the two beams |
2852 | 545 | initial_states.append(sorted(list(set((p.get_initial_pdg(1),p.get_initial_pdg(2)) for \ | 553 | try: |
2853 | 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 \ |
2854 | 555 | p in fksreal.matrix_element.get('processes'))))) | ||
2855 | 556 | except IndexError: | ||
2856 | 557 | initial_states.append(sorted(list(set((p.get_initial_pdg(1)) for \ | ||
2857 | 558 | p in fksreal.matrix_element.get('processes'))))) | ||
2858 | 559 | |||
2859 | 547 | 560 | ||
2860 | 548 | # remove doubles from the list | 561 | # remove doubles from the list |
2861 | 549 | checked = [] | 562 | checked = [] |
2862 | @@ -569,10 +582,10 @@ | |||
2863 | 569 | 582 | ||
2864 | 570 | #_curr_matrix_element is a FKSHelasMultiProcess Object | 583 | #_curr_matrix_element is a FKSHelasMultiProcess Object |
2865 | 571 | self._fks_directories = [] | 584 | self._fks_directories = [] |
2867 | 572 | proc_charac = banner_mod.ProcCharacteristic() | 585 | proc_charac = self._curr_exporter.proc_characteristic |
2868 | 573 | for charac in ['has_isr', 'has_fsr', 'has_loops']: | 586 | for charac in ['has_isr', 'has_fsr', 'has_loops']: |
2869 | 574 | proc_charac[charac] = self._curr_matrix_elements[charac] | 587 | proc_charac[charac] = self._curr_matrix_elements[charac] |
2871 | 575 | proc_charac.write(pjoin(path, 'proc_characteristics')) | 588 | |
2872 | 576 | 589 | ||
2873 | 577 | for ime, me in \ | 590 | for ime, me in \ |
2874 | 578 | enumerate(self._curr_matrix_elements.get('matrix_elements')): | 591 | enumerate(self._curr_matrix_elements.get('matrix_elements')): |
2875 | @@ -624,7 +637,7 @@ | |||
2876 | 624 | # self.options['automatic_html_opening'] = False | 637 | # self.options['automatic_html_opening'] = False |
2877 | 625 | 638 | ||
2878 | 626 | if options['interactive']: | 639 | if options['interactive']: |
2880 | 627 | if hasattr(self, 'do_shell'): | 640 | if isinstance(self, extended_cmd.CmdShell): |
2881 | 628 | ME = run_interface.aMCatNLOCmdShell(me_dir=argss[0], options=self.options) | 641 | ME = run_interface.aMCatNLOCmdShell(me_dir=argss[0], options=self.options) |
2882 | 629 | else: | 642 | else: |
2883 | 630 | ME = run_interface.aMCatNLOCmd(me_dir=argss[0],options=self.options) | 643 | ME = run_interface.aMCatNLOCmd(me_dir=argss[0],options=self.options) |
2884 | @@ -636,7 +649,9 @@ | |||
2885 | 636 | stop = self.define_child_cmd_interface(ME) | 649 | stop = self.define_child_cmd_interface(ME) |
2886 | 637 | return stop | 650 | return stop |
2887 | 638 | 651 | ||
2889 | 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], |
2890 | 653 | shell = isinstance(self, extended_cmd.CmdShell), | ||
2891 | 654 | **options) | ||
2892 | 640 | ext_program.run() | 655 | ext_program.run() |
2893 | 641 | 656 | ||
2894 | 642 | 657 | ||
2895 | 643 | 658 | ||
2896 | === modified file 'madgraph/interface/amcatnlo_run_interface.py' (properties changed: -x to +x) | |||
2897 | --- madgraph/interface/amcatnlo_run_interface.py 2015-09-05 17:49:40 +0000 | |||
2898 | +++ madgraph/interface/amcatnlo_run_interface.py 2015-10-25 15:32:18 +0000 | |||
2899 | @@ -119,6 +119,11 @@ | |||
2900 | 119 | #this can be improved/better written to handle the output | 119 | #this can be improved/better written to handle the output |
2901 | 120 | misc.call(['./%s' % (test)], cwd=this_dir, | 120 | misc.call(['./%s' % (test)], cwd=this_dir, |
2902 | 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')) |
2903 | 122 | if test == 'check_poles' and os.path.exists(pjoin(this_dir,'MadLoop5_resources')) : | ||
2904 | 123 | tf=tarfile.open(pjoin(this_dir,'MadLoop5_resources.tar.gz'),'w:gz', | ||
2905 | 124 | dereference=True) | ||
2906 | 125 | tf.add(pjoin(this_dir,'MadLoop5_resources'),arcname='MadLoop5_resources') | ||
2907 | 126 | tf.close() | ||
2908 | 122 | 127 | ||
2909 | 123 | if not options['reweightonly']: | 128 | if not options['reweightonly']: |
2910 | 124 | misc.compile(['gensym'], cwd=this_dir, job_specs = False) | 129 | misc.compile(['gensym'], cwd=this_dir, job_specs = False) |
2911 | @@ -1155,7 +1160,7 @@ | |||
2912 | 1155 | functions, such as generate_events or calculate_xsect | 1160 | functions, such as generate_events or calculate_xsect |
2913 | 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) |
2914 | 1157 | """ | 1162 | """ |
2916 | 1158 | 1163 | ||
2917 | 1159 | if not argss and not options: | 1164 | if not argss and not options: |
2918 | 1160 | self.start_time = time.time() | 1165 | self.start_time = time.time() |
2919 | 1161 | argss = self.split_arg(line) | 1166 | argss = self.split_arg(line) |
2920 | @@ -1164,6 +1169,7 @@ | |||
2921 | 1164 | options = options.__dict__ | 1169 | options = options.__dict__ |
2922 | 1165 | self.check_launch(argss, options) | 1170 | self.check_launch(argss, options) |
2923 | 1166 | 1171 | ||
2924 | 1172 | |||
2925 | 1167 | if 'run_name' in options.keys() and options['run_name']: | 1173 | if 'run_name' in options.keys() and options['run_name']: |
2926 | 1168 | self.run_name = options['run_name'] | 1174 | self.run_name = options['run_name'] |
2927 | 1169 | # if a dir with the given run_name already exists | 1175 | # if a dir with the given run_name already exists |
2928 | @@ -1183,6 +1189,7 @@ | |||
2929 | 1183 | 1189 | ||
2930 | 1184 | if not switch: | 1190 | if not switch: |
2931 | 1185 | mode = argss[0] | 1191 | mode = argss[0] |
2932 | 1192 | |||
2933 | 1186 | if mode in ['LO', 'NLO']: | 1193 | if mode in ['LO', 'NLO']: |
2934 | 1187 | options['parton'] = True | 1194 | options['parton'] = True |
2935 | 1188 | mode = self.ask_run_configuration(mode, options) | 1195 | mode = self.ask_run_configuration(mode, options) |
2936 | @@ -1202,7 +1209,7 @@ | |||
2937 | 1202 | self.compile(mode, options) | 1209 | self.compile(mode, options) |
2938 | 1203 | evt_file = self.run(mode, options) | 1210 | evt_file = self.run(mode, options) |
2939 | 1204 | 1211 | ||
2941 | 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']: |
2942 | 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 '\ |
2943 | 1207 | 'relative precision of %s' % self.run_card['req_acc']) | 1214 | 'relative precision of %s' % self.run_card['req_acc']) |
2944 | 1208 | return | 1215 | return |
2945 | @@ -1222,14 +1229,48 @@ | |||
2946 | 1222 | 1229 | ||
2947 | 1223 | 1230 | ||
2948 | 1224 | self.update_status('', level='all', update_results=True) | 1231 | self.update_status('', level='all', update_results=True) |
2950 | 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']: |
2951 | 1226 | logger.warning("""You are running with FxFx merging enabled. | 1233 | logger.warning("""You are running with FxFx merging enabled. |
2952 | 1227 | To be able to merge samples of various multiplicities without double counting, | 1234 | To be able to merge samples of various multiplicities without double counting, |
2953 | 1228 | you have to remove some events after showering 'by hand'. | 1235 | you have to remove some events after showering 'by hand'. |
2954 | 1229 | Please read http://amcatnlo.cern.ch/FxFx_merging.htm for more details.""") | 1236 | Please read http://amcatnlo.cern.ch/FxFx_merging.htm for more details.""") |
2955 | 1230 | 1237 | ||
2956 | 1231 | 1238 | ||
2958 | 1232 | 1239 | #check if the param_card defines a scan. | |
2959 | 1240 | if self.param_card_iterator: | ||
2960 | 1241 | param_card_iterator = self.param_card_iterator | ||
2961 | 1242 | self.param_card_iterator = [] #avoid to next generate go trough here | ||
2962 | 1243 | param_card_iterator.store_entry(self.run_name, self.results.current['cross']) | ||
2963 | 1244 | orig_name = self.run_name | ||
2964 | 1245 | #go trough the scal | ||
2965 | 1246 | with misc.TMP_variable(self, 'allow_notification_center', False): | ||
2966 | 1247 | for i,card in enumerate(param_card_iterator): | ||
2967 | 1248 | card.write(pjoin(self.me_dir,'Cards','param_card.dat')) | ||
2968 | 1249 | if not options['force']: | ||
2969 | 1250 | options['force'] = True | ||
2970 | 1251 | if options['run_name']: | ||
2971 | 1252 | options['run_name'] = '%s_%s' % (orig_name, i+1) | ||
2972 | 1253 | if not argss: | ||
2973 | 1254 | argss = [mode, "-f"] | ||
2974 | 1255 | elif argss[0] == "auto": | ||
2975 | 1256 | argss[0] = mode | ||
2976 | 1257 | self.do_launch("", options=options, argss=argss, switch=switch) | ||
2977 | 1258 | #self.exec_cmd("launch -f ",precmd=True, postcmd=True,errorhandling=False) | ||
2978 | 1259 | param_card_iterator.store_entry(self.run_name, self.results.current['cross']) | ||
2979 | 1260 | #restore original param_card | ||
2980 | 1261 | param_card_iterator.write(pjoin(self.me_dir,'Cards','param_card.dat')) | ||
2981 | 1262 | name = misc.get_scan_name(orig_name, self.run_name) | ||
2982 | 1263 | path = pjoin(self.me_dir, 'Events','scan_%s.txt' % name) | ||
2983 | 1264 | logger.info("write all cross-section results in %s" % path, '$MG:color:BLACK') | ||
2984 | 1265 | param_card_iterator.write_summary(path) | ||
2985 | 1266 | |||
2986 | 1267 | if self.allow_notification_center: | ||
2987 | 1268 | misc.apple_notify('Run %s finished' % os.path.basename(self.me_dir), | ||
2988 | 1269 | '%s: %s +- %s ' % (self.results.current['run_name'], | ||
2989 | 1270 | self.results.current['cross'], | ||
2990 | 1271 | self.results.current['error'])) | ||
2991 | 1272 | |||
2992 | 1273 | |||
2993 | 1233 | ############################################################################ | 1274 | ############################################################################ |
2994 | 1234 | def do_compile(self, line): | 1275 | def do_compile(self, line): |
2995 | 1235 | """Advanced commands: just compile the executables """ | 1276 | """Advanced commands: just compile the executables """ |
2996 | @@ -1248,59 +1289,11 @@ | |||
2997 | 1248 | 1289 | ||
2998 | 1249 | self.update_status('', level='all', update_results=True) | 1290 | self.update_status('', level='all', update_results=True) |
2999 | 1250 | 1291 | ||
3000 | 1251 | def print_results_in_shell(self, data): | ||
3001 | 1252 | """Have a nice results prints in the shell, | ||
3002 | 1253 | data should be of type: gen_crossxhtml.OneTagResults""" | ||
3003 | 1254 | if not data: | ||
3004 | 1255 | return | ||
3005 | 1256 | logger.info(" === Results Summary for run: %s tag: %s ===\n" % (data['run_name'],data['tag'])) | ||
3006 | 1257 | if self.ninitial == 1: | ||
3007 | 1258 | logger.info(" Width : %.4g +- %.4g GeV" % (data['cross'], data['error'])) | ||
3008 | 1259 | else: | ||
3009 | 1260 | logger.info(" Cross-section : %.4g +- %.4g pb" % (data['cross'], data['error'])) | ||
3010 | 1261 | logger.info(" Nb of events : %s" % data['nb_event'] ) | ||
3011 | 1262 | #if data['cross_pythia'] and data['nb_event_pythia']: | ||
3012 | 1263 | # if self.ninitial == 1: | ||
3013 | 1264 | # logger.info(" Matched Width : %.4g +- %.4g GeV" % (data['cross_pythia'], data['error_pythia'])) | ||
3014 | 1265 | # else: | ||
3015 | 1266 | # logger.info(" Matched Cross-section : %.4g +- %.4g pb" % (data['cross_pythia'], data['error_pythia'])) | ||
3016 | 1267 | # logger.info(" Nb of events after Matching : %s" % data['nb_event_pythia']) | ||
3017 | 1268 | # if self.run_card['use_syst'] in self.true: | ||
3018 | 1269 | # logger.info(" Be carefull that matched information are here NOT for the central value. Refer to SysCalc output for it") | ||
3019 | 1270 | logger.info(" " ) | ||
3020 | 1271 | |||
3021 | 1272 | def print_results_in_file(self, data, path, mode='w'): | ||
3022 | 1273 | """Have a nice results prints in the shell, | ||
3023 | 1274 | data should be of type: gen_crossxhtml.OneTagResults""" | ||
3024 | 1275 | if not data: | ||
3025 | 1276 | return | ||
3026 | 1277 | |||
3027 | 1278 | fsock = open(path, mode) | ||
3028 | 1279 | |||
3029 | 1280 | fsock.write(" === Results Summary for run: %s tag: %s process: %s ===\n" % \ | ||
3030 | 1281 | (data['run_name'],data['tag'], os.path.basename(self.me_dir))) | ||
3031 | 1282 | |||
3032 | 1283 | if self.ninitial == 1: | ||
3033 | 1284 | fsock.write(" Width : %.4g +- %.4g GeV\n" % (data['cross'], data['error'])) | ||
3034 | 1285 | else: | ||
3035 | 1286 | fsock.write(" Cross-section : %.4g +- %.4g pb\n" % (data['cross'], data['error'])) | ||
3036 | 1287 | fsock.write(" Nb of events : %s\n" % data['nb_event'] ) | ||
3037 | 1288 | #if data['cross_pythia'] and data['nb_event_pythia']: | ||
3038 | 1289 | # if self.ninitial == 1: | ||
3039 | 1290 | # fsock.write(" Matched Width : %.4g +- %.4g GeV\n" % (data['cross_pythia'], data['error_pythia'])) | ||
3040 | 1291 | # else: | ||
3041 | 1292 | # fsock.write(" Matched Cross-section : %.4g +- %.4g pb\n" % (data['cross_pythia'], data['error_pythia'])) | ||
3042 | 1293 | # fsock.write(" Nb of events after Matching : %s\n" % data['nb_event_pythia']) | ||
3043 | 1294 | fsock.write(" \n" ) | ||
3044 | 1295 | |||
3045 | 1296 | |||
3046 | 1297 | |||
3047 | 1298 | |||
3048 | 1299 | 1292 | ||
3049 | 1300 | def update_random_seed(self): | 1293 | def update_random_seed(self): |
3050 | 1301 | """Update random number seed with the value from the run_card. | 1294 | """Update random number seed with the value from the run_card. |
3051 | 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""" |
3053 | 1303 | iseed = int(self.run_card['iseed']) | 1296 | iseed = self.run_card['iseed'] |
3054 | 1304 | if iseed == 0: | 1297 | if iseed == 0: |
3055 | 1305 | randinit = open(pjoin(self.me_dir, 'SubProcesses', 'randinit')) | 1298 | randinit = open(pjoin(self.me_dir, 'SubProcesses', 'randinit')) |
3056 | 1306 | iseed = int(randinit.read()[2:]) + 1 | 1299 | iseed = int(randinit.read()[2:]) + 1 |
3057 | @@ -1317,206 +1310,95 @@ | |||
3058 | 1317 | if not 'only_generation' in options.keys(): | 1310 | if not 'only_generation' in options.keys(): |
3059 | 1318 | options['only_generation'] = False | 1311 | options['only_generation'] = False |
3060 | 1319 | 1312 | ||
3061 | 1313 | # for second step in applgrid mode, do only the event generation step | ||
3062 | 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']: |
3063 | 1321 | options['only_generation'] = True | 1315 | options['only_generation'] = True |
3064 | 1322 | self.get_characteristics(pjoin(self.me_dir, 'SubProcesses', 'proc_characteristics')) | 1316 | self.get_characteristics(pjoin(self.me_dir, 'SubProcesses', 'proc_characteristics')) |
3085 | 1323 | 1317 | self.setup_cluster_or_multicore() | |
3066 | 1324 | if self.cluster_mode == 1: | ||
3067 | 1325 | cluster_name = self.options['cluster_type'] | ||
3068 | 1326 | self.cluster = cluster.from_name[cluster_name](**self.options) | ||
3069 | 1327 | if self.cluster_mode == 2: | ||
3070 | 1328 | try: | ||
3071 | 1329 | import multiprocessing | ||
3072 | 1330 | if not self.nb_core: | ||
3073 | 1331 | try: | ||
3074 | 1332 | self.nb_core = int(self.options['nb_core']) | ||
3075 | 1333 | except TypeError: | ||
3076 | 1334 | self.nb_core = multiprocessing.cpu_count() | ||
3077 | 1335 | logger.info('Using %d cores' % self.nb_core) | ||
3078 | 1336 | except ImportError: | ||
3079 | 1337 | self.nb_core = 1 | ||
3080 | 1338 | logger.warning('Impossible to detect the number of cores => Using One.\n'+ | ||
3081 | 1339 | 'Use set nb_core X in order to set this number and be able to'+ | ||
3082 | 1340 | 'run in multicore.') | ||
3083 | 1341 | |||
3084 | 1342 | self.cluster = cluster.MultiCore(**self.options) | ||
3086 | 1343 | self.update_random_seed() | 1318 | self.update_random_seed() |
3087 | 1344 | #find and keep track of all the jobs | 1319 | #find and keep track of all the jobs |
3088 | 1345 | folder_names = {'LO': ['born_G*'], 'NLO': ['all_G*'], | 1320 | folder_names = {'LO': ['born_G*'], 'NLO': ['all_G*'], |
3089 | 1346 | 'aMC@LO': ['GB*'], 'aMC@NLO': ['GF*']} | 1321 | 'aMC@LO': ['GB*'], 'aMC@NLO': ['GF*']} |
3090 | 1347 | folder_names['noshower'] = folder_names['aMC@NLO'] | 1322 | folder_names['noshower'] = folder_names['aMC@NLO'] |
3091 | 1348 | folder_names['noshowerLO'] = folder_names['aMC@LO'] | 1323 | folder_names['noshowerLO'] = folder_names['aMC@LO'] |
3092 | 1349 | job_dict = {} | ||
3093 | 1350 | p_dirs = [d for d in \ | 1324 | p_dirs = [d for d in \ |
3094 | 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] |
3129 | 1352 | #find jobs and clean previous results | 1326 | #Clean previous results |
3130 | 1353 | if not options['only_generation'] and not options['reweightonly']: | 1327 | self.clean_previous_results(options,p_dirs,folder_names[mode]) |
3131 | 1354 | self.update_status('Cleaning previous results', level=None) | 1328 | |
3132 | 1355 | for dir in p_dirs: | 1329 | mcatnlo_status = ['Setting up grids', 'Computing upper envelope', 'Generating events'] |
3133 | 1356 | job_dict[dir] = [file for file in \ | 1330 | |
3100 | 1357 | os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \ | ||
3101 | 1358 | if file.startswith('ajob')] | ||
3102 | 1359 | #find old folders to be removed | ||
3103 | 1360 | for obj in folder_names[mode]: | ||
3104 | 1361 | to_rm = [file for file in \ | ||
3105 | 1362 | os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \ | ||
3106 | 1363 | if file.startswith(obj[:-1]) and \ | ||
3107 | 1364 | (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \ | ||
3108 | 1365 | os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))] | ||
3109 | 1366 | #always clean dirs for the splitted event generation | ||
3110 | 1367 | # do not include the born_G/ grid_G which should be kept when | ||
3111 | 1368 | # doing a f.o. run keeping old grids | ||
3112 | 1369 | to_always_rm = [file for file in \ | ||
3113 | 1370 | os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \ | ||
3114 | 1371 | if file.startswith(obj[:-1]) and | ||
3115 | 1372 | '_' in file and not '_G' in file and \ | ||
3116 | 1373 | (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \ | ||
3117 | 1374 | os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))] | ||
3118 | 1375 | |||
3119 | 1376 | if not options['only_generation'] and not options['reweightonly']: | ||
3120 | 1377 | to_always_rm.extend(to_rm) | ||
3121 | 1378 | if os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz')): | ||
3122 | 1379 | to_always_rm.append(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz')) | ||
3123 | 1380 | files.rm([pjoin(self.me_dir, 'SubProcesses', dir, d) for d in to_always_rm]) | ||
3124 | 1381 | |||
3125 | 1382 | mcatnlo_status = ['Setting up grid', 'Computing upper envelope', 'Generating events'] | ||
3126 | 1383 | |||
3127 | 1384 | if self.run_card['iappl'] == 2: | ||
3128 | 1385 | self.applgrid_distribute(options,mode,p_dirs) | ||
3134 | 1386 | 1331 | ||
3135 | 1387 | if options['reweightonly']: | 1332 | if options['reweightonly']: |
3136 | 1388 | event_norm=self.run_card['event_norm'] | 1333 | event_norm=self.run_card['event_norm'] |
3138 | 1389 | nevents=int(self.run_card['nevents']) | 1334 | nevents=self.run_card['nevents'] |
3139 | 1390 | return self.reweight_and_collect_events(options, mode, nevents, event_norm) | 1335 | return self.reweight_and_collect_events(options, mode, nevents, event_norm) |
3140 | 1391 | 1336 | ||
3141 | 1392 | devnull = os.open(os.devnull, os.O_RDWR) | 1337 | devnull = os.open(os.devnull, os.O_RDWR) |
3142 | 1338 | |||
3143 | 1393 | if mode in ['LO', 'NLO']: | 1339 | if mode in ['LO', 'NLO']: |
3144 | 1394 | # this is for fixed order runs | 1340 | # this is for fixed order runs |
3145 | 1395 | mode_dict = {'NLO': 'all', 'LO': 'born'} | 1341 | mode_dict = {'NLO': 'all', 'LO': 'born'} |
3146 | 1396 | logger.info('Doing fixed order %s' % mode) | 1342 | logger.info('Doing fixed order %s' % mode) |
3147 | 1397 | req_acc = self.run_card['req_acc_FO'] | 1343 | req_acc = self.run_card['req_acc_FO'] |
3245 | 1398 | if not options['only_generation'] and req_acc != -1: | 1344 | |
3246 | 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 |
3247 | 1400 | self.update_status('Setting up grids', level=None) | 1346 | # running |
3248 | 1401 | self.run_all(job_dict, [['0', mode_dict[mode], '0']], 'Setting up grids') | 1347 | if self.run_card['iappl'] == 2: |
3249 | 1402 | elif not options['only_generation']: | 1348 | self.applgrid_distribute(options,mode_dict[mode],p_dirs) |
3250 | 1403 | npoints = self.run_card['npoints_FO_grid'] | 1349 | |
3251 | 1404 | niters = self.run_card['niters_FO_grid'] | 1350 | # create a list of dictionaries "jobs_to_run" with all the |
3252 | 1405 | self.write_madin_file(pjoin(self.me_dir, 'SubProcesses'), mode_dict[mode], 0, npoints, niters) | 1351 | # jobs that need to be run |
3253 | 1406 | self.update_status('Setting up grids', level=None) | 1352 | integration_step=-1 |
3254 | 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, \ |
3255 | 1408 | 1354 | req_acc,mode_dict[mode],integration_step,mode,fixed_order=True) | |
3256 | 1409 | npoints = self.run_card['npoints_FO'] | 1355 | self.prepare_directories(jobs_to_run,mode) |
3257 | 1410 | niters = self.run_card['niters_FO'] | 1356 | |
3258 | 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 |
3259 | 1412 | # collect the results and logs | 1358 | # if we have the required accuracy. If this is the case, |
3260 | 1413 | self.collect_log_files(folder_names[mode], 0) | 1359 | # stop running, else do another step. |
3261 | 1414 | p = misc.Popen(['./combine_results_FO.sh', str(req_acc), '%s_G*' % mode_dict[mode]], \ | 1360 | while True: |
3262 | 1415 | stdout=subprocess.PIPE, \ | 1361 | integration_step=integration_step+1 |
3263 | 1416 | cwd=pjoin(self.me_dir, 'SubProcesses')) | 1362 | self.run_all_jobs(jobs_to_run,integration_step) |
3264 | 1417 | output = p.communicate() | 1363 | self.collect_log_files(jobs_to_run,integration_step) |
3265 | 1418 | 1364 | jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run, \ | |
3266 | 1419 | self.cross_sect_dict = self.read_results(output, mode) | 1365 | jobs_to_collect,integration_step,mode,mode_dict[mode]) |
3267 | 1420 | self.print_summary(options, 0, mode) | 1366 | if not jobs_to_run: |
3268 | 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) |
3269 | 1422 | self.results.add_detail('cross', cross) | 1368 | break |
3270 | 1423 | self.results.add_detail('error', error) | 1369 | # We are done. |
3271 | 1424 | 1370 | self.finalise_run_FO(folder_names[mode],jobs_to_collect) | |
3175 | 1425 | self.update_status('Computing cross-section', level=None) | ||
3176 | 1426 | self.run_all(job_dict, [['0', mode_dict[mode], '0', mode_dict[mode]]], 'Computing cross-section') | ||
3177 | 1427 | |||
3178 | 1428 | # collect the results and logs | ||
3179 | 1429 | self.collect_log_files(folder_names[mode], 1) | ||
3180 | 1430 | p = misc.Popen(['./combine_results_FO.sh', '-1'] + folder_names[mode], \ | ||
3181 | 1431 | stdout=subprocess.PIPE, | ||
3182 | 1432 | cwd=pjoin(self.me_dir, 'SubProcesses')) | ||
3183 | 1433 | output = p.communicate() | ||
3184 | 1434 | self.cross_sect_dict = self.read_results(output, mode) | ||
3185 | 1435 | |||
3186 | 1436 | # collect the scale and PDF uncertainties | ||
3187 | 1437 | scale_pdf_info={} | ||
3188 | 1438 | if self.run_card['reweight_scale'] or self.run_card['reweight_PDF']: | ||
3189 | 1439 | data_files=[] | ||
3190 | 1440 | for dir in p_dirs: | ||
3191 | 1441 | for obj in folder_names[mode]: | ||
3192 | 1442 | for file in os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)): | ||
3193 | 1443 | if file.startswith(obj[:-1]) and \ | ||
3194 | 1444 | (os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file,'scale_pdf_dependence.dat'))): | ||
3195 | 1445 | data_files.append(pjoin(dir,file,'scale_pdf_dependence.dat')) | ||
3196 | 1446 | scale_pdf_info = self.pdf_scale_from_reweighting(data_files) | ||
3197 | 1447 | # print the results: | ||
3198 | 1448 | self.print_summary(options, 1, mode, scale_pdf_info) | ||
3199 | 1449 | |||
3200 | 1450 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'res.txt'), | ||
3201 | 1451 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3202 | 1452 | |||
3203 | 1453 | if self.analyse_card['fo_analysis_format'].lower() == 'topdrawer': | ||
3204 | 1454 | misc.call(['./combine_plots_FO.sh'] + folder_names[mode], \ | ||
3205 | 1455 | stdout=devnull, | ||
3206 | 1456 | cwd=pjoin(self.me_dir, 'SubProcesses')) | ||
3207 | 1457 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.top'), | ||
3208 | 1458 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3209 | 1459 | logger.info('The results of this run and the TopDrawer file with the plots' + \ | ||
3210 | 1460 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3211 | 1461 | elif self.analyse_card['fo_analysis_format'].lower() == 'hwu': | ||
3212 | 1462 | self.combine_plots_HwU(folder_names[mode]) | ||
3213 | 1463 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.HwU'), | ||
3214 | 1464 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3215 | 1465 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.gnuplot'), | ||
3216 | 1466 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3217 | 1467 | try: | ||
3218 | 1468 | misc.call(['gnuplot','MADatNLO.gnuplot'],\ | ||
3219 | 1469 | stdout=os.open(os.devnull, os.O_RDWR),\ | ||
3220 | 1470 | stderr=os.open(os.devnull, os.O_RDWR),\ | ||
3221 | 1471 | cwd=pjoin(self.me_dir, 'Events', self.run_name)) | ||
3222 | 1472 | except Exception: | ||
3223 | 1473 | pass | ||
3224 | 1474 | |||
3225 | 1475 | |||
3226 | 1476 | logger.info('The results of this run and the HwU and GnuPlot files with the plots' + \ | ||
3227 | 1477 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3228 | 1478 | elif self.analyse_card['fo_analysis_format'].lower() == 'root': | ||
3229 | 1479 | misc.call(['./combine_root.sh'] + folder_names[mode], \ | ||
3230 | 1480 | stdout=devnull, | ||
3231 | 1481 | cwd=pjoin(self.me_dir, 'SubProcesses')) | ||
3232 | 1482 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.root'), | ||
3233 | 1483 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3234 | 1484 | logger.info('The results of this run and the ROOT file with the plots' + \ | ||
3235 | 1485 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3236 | 1486 | else: | ||
3237 | 1487 | logger.info('The results of this run' + \ | ||
3238 | 1488 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3239 | 1489 | |||
3240 | 1490 | cross, error = sum_html.make_all_html_results(self, folder_names[mode]) | ||
3241 | 1491 | self.results.add_detail('cross', cross) | ||
3242 | 1492 | self.results.add_detail('error', error) | ||
3243 | 1493 | if self.run_card['iappl'] != 0: | ||
3244 | 1494 | self.applgrid_combine(cross,error) | ||
3272 | 1495 | self.update_status('Run complete', level='parton', update_results=True) | 1371 | self.update_status('Run complete', level='parton', update_results=True) |
3273 | 1496 | |||
3274 | 1497 | return | 1372 | return |
3275 | 1498 | 1373 | ||
3276 | 1499 | elif mode in ['aMC@NLO','aMC@LO','noshower','noshowerLO']: | 1374 | elif mode in ['aMC@NLO','aMC@LO','noshower','noshowerLO']: |
3277 | 1375 | if self.ninitial == 1: | ||
3278 | 1376 | raise aMCatNLOError('Decay processes can only be run at fixed order.') | ||
3279 | 1377 | mode_dict = {'aMC@NLO': 'all', 'aMC@LO': 'born',\ | ||
3280 | 1378 | 'noshower': 'all', 'noshowerLO': 'born'} | ||
3281 | 1500 | shower = self.run_card['parton_shower'].upper() | 1379 | shower = self.run_card['parton_shower'].upper() |
3283 | 1501 | nevents = int(self.run_card['nevents']) | 1380 | nevents = self.run_card['nevents'] |
3284 | 1502 | req_acc = self.run_card['req_acc'] | 1381 | req_acc = self.run_card['req_acc'] |
3286 | 1503 | if nevents == 0 and float(req_acc) < 0 : | 1382 | if nevents == 0 and req_acc < 0 : |
3287 | 1504 | raise aMCatNLOError('Cannot determine the required accuracy from the number '\ | 1383 | raise aMCatNLOError('Cannot determine the required accuracy from the number '\ |
3288 | 1505 | 'of events, because 0 events requested. Please set '\ | 1384 | 'of events, because 0 events requested. Please set '\ |
3291 | 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 '\ |
3292 | 1507 | elif float(req_acc) >1 or float(req_acc) == 0 : | 1386 | 'between 0 and 1') |
3293 | 1387 | elif req_acc >1 or req_acc == 0 : | ||
3294 | 1508 | raise aMCatNLOError('Required accuracy ("req_acc" in the run_card) should '\ | 1388 | raise aMCatNLOError('Required accuracy ("req_acc" in the run_card) should '\ |
3295 | 1509 | 'be between larger than 0 and smaller than 1, '\ | 1389 | 'be between larger than 0 and smaller than 1, '\ |
3297 | 1510 | 'or set to -1 for automatic determination. Current value is %s' % req_acc) | 1390 | 'or set to -1 for automatic determination. Current '\ |
3298 | 1391 | 'value is %f' % req_acc) | ||
3299 | 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) |
3302 | 1512 | elif float(req_acc) < 0 and nevents > 1000000 : | 1393 | elif req_acc < 0 and nevents > 1000000 : |
3303 | 1513 | req_acc='0.001' | 1394 | req_acc=0.001 |
3304 | 1514 | 1395 | ||
3305 | 1515 | shower_list = ['HERWIG6', 'HERWIGPP', 'PYTHIA6Q', 'PYTHIA6PT', 'PYTHIA8'] | 1396 | shower_list = ['HERWIG6', 'HERWIGPP', 'PYTHIA6Q', 'PYTHIA6PT', 'PYTHIA8'] |
3306 | 1516 | 1397 | ||
3307 | 1517 | if not shower in shower_list: | 1398 | if not shower in shower_list: |
3310 | 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. '\ |
3311 | 1519 | % (shower, ', '.join(shower_list))) | 1400 | 'Please use one of the following: %s' \ |
3312 | 1401 | % (shower, ', '.join(shower_list))) | ||
3313 | 1520 | 1402 | ||
3314 | 1521 | # check that PYTHIA6PT is not used for processes with FSR | 1403 | # check that PYTHIA6PT is not used for processes with FSR |
3315 | 1522 | if shower == 'PYTHIA6PT' and self.proc_characteristics['has_fsr']: | 1404 | if shower == 'PYTHIA6PT' and self.proc_characteristics['has_fsr']: |
3316 | @@ -1529,98 +1411,556 @@ | |||
3317 | 1529 | elif options['only_generation']: | 1411 | elif options['only_generation']: |
3318 | 1530 | logger.info('Generating events starting from existing results') | 1412 | logger.info('Generating events starting from existing results') |
3319 | 1531 | 1413 | ||
3388 | 1532 | 1414 | jobs_to_run,jobs_to_collect,integration_step = self.create_jobs_to_run(options,p_dirs, \ | |
3389 | 1533 | for i, status in enumerate(mcatnlo_status): | 1415 | req_acc,mode_dict[mode],1,mode,fixed_order=False) |
3390 | 1534 | #check if need to split jobs | 1416 | |
3391 | 1535 | # at least one channel must have enough events | 1417 | # Make sure to update all the jobs to be ready for the event generation step |
3392 | 1536 | try: | 1418 | if options['only_generation']: |
3393 | 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, \ |
3394 | 1538 | 'SubProcesses', | 1420 | jobs_to_collect,1,mode,mode_dict[mode],fixed_order=False) |
3395 | 1539 | 'nevents_unweighted')).read().split('\n') | 1421 | else: |
3396 | 1540 | except IOError: | 1422 | self.prepare_directories(jobs_to_run,mode,fixed_order=False) |
3397 | 1541 | nevents_unweighted = [] | 1423 | |
3398 | 1542 | 1424 | ||
3399 | 1543 | split = i == 2 and \ | 1425 | # Main loop over the three MINT generation steps: |
3400 | 1544 | int(self.run_card['nevt_job']) > 0 | 1426 | for mint_step, status in enumerate(mcatnlo_status): |
3401 | 1545 | 1427 | if options['only_generation'] and mint_step < 2: | |
3402 | 1546 | if i == 2 or not options['only_generation']: | 1428 | continue |
3403 | 1547 | # if the number of events requested is zero, | 1429 | self.update_status(status, level='parton') |
3404 | 1548 | # skip mint step 2 | 1430 | self.run_all_jobs(jobs_to_run,mint_step,fixed_order=False) |
3405 | 1549 | if i==2 and nevents==0: | 1431 | self.collect_log_files(jobs_to_run,mint_step) |
3406 | 1550 | self.print_summary(options, 2,mode) | 1432 | if mint_step+1==2 and nevents==0: |
3407 | 1551 | return | 1433 | self.print_summary(options,2,mode) |
3408 | 1552 | 1434 | return | |
3409 | 1553 | if split: | 1435 | jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run, \ |
3410 | 1554 | # split the event generation | 1436 | jobs_to_collect,mint_step,mode,mode_dict[mode],fixed_order=False) |
3411 | 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 |
3412 | 1556 | [str(self.run_card['nevt_job'])], | 1438 | self.check_event_files(jobs_to_collect) |
3413 | 1557 | stdout = devnull, | 1439 | |
3414 | 1558 | cwd = pjoin(self.me_dir, 'SubProcesses')) | 1440 | if self.cluster_mode == 1: |
3415 | 1559 | assert os.path.exists(pjoin(self.me_dir, 'SubProcesses', | 1441 | #if cluster run, wait 10 sec so that event files are transferred back |
3416 | 1560 | 'nevents_unweighted_splitted')) | 1442 | self.update_status( |
3349 | 1561 | |||
3350 | 1562 | self.update_status(status, level='parton') | ||
3351 | 1563 | if mode in ['aMC@NLO', 'noshower']: | ||
3352 | 1564 | self.write_madinMMC_file(pjoin(self.me_dir, 'SubProcesses'), 'all', i) | ||
3353 | 1565 | self.run_all(job_dict, [['2', 'F', '%d' % i]], status, split_jobs = split) | ||
3354 | 1566 | |||
3355 | 1567 | elif mode in ['aMC@LO', 'noshowerLO']: | ||
3356 | 1568 | self.write_madinMMC_file( | ||
3357 | 1569 | pjoin(self.me_dir, 'SubProcesses'), 'born', i) | ||
3358 | 1570 | self.run_all(job_dict, | ||
3359 | 1571 | [['2', 'B', '%d' % i]], | ||
3360 | 1572 | '%s at LO' % status, split_jobs = split) | ||
3361 | 1573 | |||
3362 | 1574 | if (i < 2 and not options['only_generation']) or i == 1 : | ||
3363 | 1575 | # collect the results and logs | ||
3364 | 1576 | self.collect_log_files(folder_names[mode], i) | ||
3365 | 1577 | p = misc.Popen(['./combine_results.sh'] + \ | ||
3366 | 1578 | ['%d' % i,'%d' % nevents, '%s' % req_acc ] + \ | ||
3367 | 1579 | folder_names[mode], | ||
3368 | 1580 | stdout=subprocess.PIPE, | ||
3369 | 1581 | cwd = pjoin(self.me_dir, 'SubProcesses')) | ||
3370 | 1582 | output = p.communicate() | ||
3371 | 1583 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'res_%d.txt' % i), \ | ||
3372 | 1584 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3373 | 1585 | |||
3374 | 1586 | self.cross_sect_dict = self.read_results(output, mode) | ||
3375 | 1587 | self.print_summary(options, i, mode) | ||
3376 | 1588 | |||
3377 | 1589 | cross, error = sum_html.make_all_html_results(self, folder_names[mode]) | ||
3378 | 1590 | self.results.add_detail('cross', cross) | ||
3379 | 1591 | self.results.add_detail('error', error) | ||
3380 | 1592 | |||
3381 | 1593 | #check that split jobs are all correctly terminated | ||
3382 | 1594 | if split: | ||
3383 | 1595 | self.check_event_files() | ||
3384 | 1596 | |||
3385 | 1597 | if self.cluster_mode == 1: | ||
3386 | 1598 | #if cluster run, wait 15 sec so that event files are transferred back | ||
3387 | 1599 | self.update_status( | ||
3417 | 1600 | 'Waiting while files are transferred back from the cluster nodes', | 1443 | 'Waiting while files are transferred back from the cluster nodes', |
3418 | 1601 | level='parton') | 1444 | level='parton') |
3430 | 1602 | time.sleep(10) | 1445 | time.sleep(10) |
3431 | 1603 | if split: | 1446 | |
3432 | 1604 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'nevents_unweighted_splitted'), \ | 1447 | event_norm=self.run_card['event_norm'] |
3433 | 1605 | pjoin(self.me_dir, 'SubProcesses', 'nevents_unweighted')) | 1448 | return self.reweight_and_collect_events(options, mode, nevents, event_norm) |
3434 | 1606 | 1449 | ||
3435 | 1607 | 1450 | def create_jobs_to_run(self,options,p_dirs,req_acc,run_mode,\ | |
3436 | 1608 | event_norm=self.run_card['event_norm'] | 1451 | integration_step,mode,fixed_order=True): |
3437 | 1609 | self.collect_log_files(folder_names[mode], 2) | 1452 | """Creates a list of dictionaries with all the jobs to be run""" |
3438 | 1610 | return self.reweight_and_collect_events(options, mode, nevents, event_norm) | 1453 | jobs_to_run=[] |
3439 | 1611 | 1454 | if not options['only_generation']: | |
3440 | 1612 | def combine_plots_HwU(self,folder_names): | 1455 | # Fresh, new run. Check all the P*/channels.txt files |
3441 | 1456 | # (created by the 'gensym' executable) to set-up all the | ||
3442 | 1457 | # jobs using the default inputs. | ||
3443 | 1458 | npoints = self.run_card['npoints_FO_grid'] | ||
3444 | 1459 | niters = self.run_card['niters_FO_grid'] | ||
3445 | 1460 | for p_dir in p_dirs: | ||
3446 | 1461 | try: | ||
3447 | 1462 | with open(pjoin(self.me_dir,'SubProcesses',p_dir,'channels.txt')) as chan_file: | ||
3448 | 1463 | channels=chan_file.readline().split() | ||
3449 | 1464 | except IOError: | ||
3450 | 1465 | logger.warning('No integration channels found for contribution %s' % p_dir) | ||
3451 | 1466 | continue | ||
3452 | 1467 | for channel in channels: | ||
3453 | 1468 | job={} | ||
3454 | 1469 | job['p_dir']=p_dir | ||
3455 | 1470 | job['channel']=channel | ||
3456 | 1471 | job['split']=0 | ||
3457 | 1472 | if fixed_order and req_acc == -1: | ||
3458 | 1473 | job['accuracy']=0 | ||
3459 | 1474 | job['niters']=niters | ||
3460 | 1475 | job['npoints']=npoints | ||
3461 | 1476 | elif fixed_order and req_acc > 0: | ||
3462 | 1477 | job['accuracy']=0.10 | ||
3463 | 1478 | job['niters']=6 | ||
3464 | 1479 | job['npoints']=-1 | ||
3465 | 1480 | elif not fixed_order: | ||
3466 | 1481 | job['accuracy']=0.03 | ||
3467 | 1482 | job['niters']=12 | ||
3468 | 1483 | job['npoints']=-1 | ||
3469 | 1484 | else: | ||
3470 | 1485 | raise aMCatNLOError('No consistent "req_acc_FO" set. Use a value '+ | ||
3471 | 1486 | 'between 0 and 1 or set it equal to -1.') | ||
3472 | 1487 | job['mint_mode']=0 | ||
3473 | 1488 | job['run_mode']=run_mode | ||
3474 | 1489 | job['wgt_frac']=1.0 | ||
3475 | 1490 | jobs_to_run.append(job) | ||
3476 | 1491 | jobs_to_collect=copy.copy(jobs_to_run) # These are all jobs | ||
3477 | 1492 | else: | ||
3478 | 1493 | # if options['only_generation'] is true, we need to loop | ||
3479 | 1494 | # over all the existing G* directories and create the jobs | ||
3480 | 1495 | # from there. | ||
3481 | 1496 | name_suffix={'born' :'B', 'all':'F'} | ||
3482 | 1497 | for p_dir in p_dirs: | ||
3483 | 1498 | for chan_dir in os.listdir(pjoin(self.me_dir,'SubProcesses',p_dir)): | ||
3484 | 1499 | if ((chan_dir.startswith(run_mode+'_G') and fixed_order) or\ | ||
3485 | 1500 | (chan_dir.startswith('G'+name_suffix[run_mode]) and (not fixed_order))) and \ | ||
3486 | 1501 | (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', p_dir, chan_dir)) or \ | ||
3487 | 1502 | os.path.exists(pjoin(self.me_dir, 'SubProcesses', p_dir, chan_dir))): | ||
3488 | 1503 | job={} | ||
3489 | 1504 | job['p_dir']=p_dir | ||
3490 | 1505 | if fixed_order: | ||
3491 | 1506 | channel=chan_dir.split('_')[1] | ||
3492 | 1507 | job['channel']=channel[1:] # remove the 'G' | ||
3493 | 1508 | if len(chan_dir.split('_')) == 3: | ||
3494 | 1509 | split=int(chan_dir.split('_')[2]) | ||
3495 | 1510 | else: | ||
3496 | 1511 | split=0 | ||
3497 | 1512 | else: | ||
3498 | 1513 | if len(chan_dir.split('_')) == 2: | ||
3499 | 1514 | split=int(chan_dir.split('_')[1]) | ||
3500 | 1515 | channel=chan_dir.split('_')[0] | ||
3501 | 1516 | job['channel']=channel[2:] # remove the 'G' | ||
3502 | 1517 | else: | ||
3503 | 1518 | job['channel']=chan_dir[2:] # remove the 'G' | ||
3504 | 1519 | split=0 | ||
3505 | 1520 | job['split']=split | ||
3506 | 1521 | job['run_mode']=run_mode | ||
3507 | 1522 | job['dirname']=pjoin(self.me_dir, 'SubProcesses', p_dir, chan_dir) | ||
3508 | 1523 | job['wgt_frac']=1.0 | ||
3509 | 1524 | if not fixed_order: job['mint_mode']=1 | ||
3510 | 1525 | jobs_to_run.append(job) | ||
3511 | 1526 | jobs_to_collect=copy.copy(jobs_to_run) # These are all jobs | ||
3512 | 1527 | if fixed_order: | ||
3513 | 1528 | jobs_to_run,jobs_to_collect=self.collect_the_results(options,req_acc,jobs_to_run, | ||
3514 | 1529 | jobs_to_collect,integration_step,mode,run_mode) | ||
3515 | 1530 | # Update the integration_step to make sure that nothing will be overwritten | ||
3516 | 1531 | integration_step=1 | ||
3517 | 1532 | for job in jobs_to_run: | ||
3518 | 1533 | while os.path.exists(pjoin(job['dirname'],'res_%s.dat' % integration_step)): | ||
3519 | 1534 | integration_step=integration_step+1 | ||
3520 | 1535 | integration_step=integration_step-1 | ||
3521 | 1536 | else: | ||
3522 | 1537 | self.append_the_results(jobs_to_collect,integration_step) | ||
3523 | 1538 | return jobs_to_run,jobs_to_collect,integration_step | ||
3524 | 1539 | |||
3525 | 1540 | def prepare_directories(self,jobs_to_run,mode,fixed_order=True): | ||
3526 | 1541 | """Set-up the G* directories for running""" | ||
3527 | 1542 | name_suffix={'born' :'B' , 'all':'F'} | ||
3528 | 1543 | for job in jobs_to_run: | ||
3529 | 1544 | if job['split'] == 0: | ||
3530 | 1545 | if fixed_order : | ||
3531 | 1546 | dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'], | ||
3532 | 1547 | job['run_mode']+'_G'+job['channel']) | ||
3533 | 1548 | else: | ||
3534 | 1549 | dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'], | ||
3535 | 1550 | 'G'+name_suffix[job['run_mode']]+job['channel']) | ||
3536 | 1551 | else: | ||
3537 | 1552 | if fixed_order : | ||
3538 | 1553 | dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'], | ||
3539 | 1554 | job['run_mode']+'_G'+job['channel']+'_'+str(job['split'])) | ||
3540 | 1555 | else: | ||
3541 | 1556 | dirname=pjoin(self.me_dir,'SubProcesses',job['p_dir'], | ||
3542 | 1557 | 'G'+name_suffix[job['run_mode']]+job['channel']+'_'+str(job['split'])) | ||
3543 | 1558 | job['dirname']=dirname | ||
3544 | 1559 | if not os.path.isdir(dirname): | ||
3545 | 1560 | os.makedirs(dirname) | ||
3546 | 1561 | self.write_input_file(job,fixed_order) | ||
3547 | 1562 | if not fixed_order: | ||
3548 | 1563 | # copy the grids from the base directory to the split directory: | ||
3549 | 1564 | if job['split'] != 0: | ||
3550 | 1565 | for f in ['grid.MC_integer','mint_grids','res_1']: | ||
3551 | 1566 | if not os.path.isfile(pjoin(job['dirname'],f)): | ||
3552 | 1567 | files.ln(pjoin(job['dirname'].rsplit("_",1)[0],f),job['dirname']) | ||
3553 | 1568 | |||
3554 | 1569 | |||
3555 | 1570 | def write_input_file(self,job,fixed_order): | ||
3556 | 1571 | """write the input file for the madevent_mint* executable in the appropriate directory""" | ||
3557 | 1572 | if fixed_order: | ||
3558 | 1573 | content= \ | ||
3559 | 1574 | """NPOINTS = %(npoints)s | ||
3560 | 1575 | NITERATIONS = %(niters)s | ||
3561 | 1576 | ACCURACY = %(accuracy)s | ||
3562 | 1577 | ADAPT_GRID = 2 | ||
3563 | 1578 | MULTICHANNEL = 1 | ||
3564 | 1579 | SUM_HELICITY = 1 | ||
3565 | 1580 | CHANNEL = %(channel)s | ||
3566 | 1581 | SPLIT = %(split)s | ||
3567 | 1582 | RUN_MODE = %(run_mode)s | ||
3568 | 1583 | RESTART = %(mint_mode)s | ||
3569 | 1584 | """ \ | ||
3570 | 1585 | % job | ||
3571 | 1586 | else: | ||
3572 | 1587 | content = \ | ||
3573 | 1588 | """-1 12 ! points, iterations | ||
3574 | 1589 | %(accuracy)s ! desired fractional accuracy | ||
3575 | 1590 | 1 -0.1 ! alpha, beta for Gsoft | ||
3576 | 1591 | -1 -0.1 ! alpha, beta for Gazi | ||
3577 | 1592 | 1 ! Suppress amplitude (0 no, 1 yes)? | ||
3578 | 1593 | 1 ! Exact helicity sum (0 yes, n = number/event)? | ||
3579 | 1594 | %(channel)s ! Enter Configuration Number: | ||
3580 | 1595 | %(mint_mode)s ! MINT imode: 0 to set-up grids, 1 to perform integral, 2 generate events | ||
3581 | 1596 | 1 1 1 ! if imode is 1: Folding parameters for xi_i, phi_i and y_ij | ||
3582 | 1597 | %(run_mode)s ! all, born, real, virt | ||
3583 | 1598 | """ \ | ||
3584 | 1599 | % job | ||
3585 | 1600 | with open(pjoin(job['dirname'], 'input_app.txt'), 'w') as input_file: | ||
3586 | 1601 | input_file.write(content) | ||
3587 | 1602 | |||
3588 | 1603 | |||
3589 | 1604 | def run_all_jobs(self,jobs_to_run,integration_step,fixed_order=True): | ||
3590 | 1605 | """Loops over the jobs_to_run and executes them using the function 'run_exe'""" | ||
3591 | 1606 | if fixed_order: | ||
3592 | 1607 | if integration_step == 0: | ||
3593 | 1608 | self.update_status('Setting up grids', level=None) | ||
3594 | 1609 | else: | ||
3595 | 1610 | self.update_status('Refining results, step %i' % integration_step, level=None) | ||
3596 | 1611 | self.ijob = 0 | ||
3597 | 1612 | name_suffix={'born' :'B', 'all':'F'} | ||
3598 | 1613 | if fixed_order: | ||
3599 | 1614 | run_type="Fixed order integration step %s" % integration_step | ||
3600 | 1615 | else: | ||
3601 | 1616 | run_type="MINT step %s" % integration_step | ||
3602 | 1617 | for job in jobs_to_run: | ||
3603 | 1618 | executable='ajob1' | ||
3604 | 1619 | if fixed_order: | ||
3605 | 1620 | arguments=[job['channel'],job['run_mode'], \ | ||
3606 | 1621 | str(job['split']),str(integration_step)] | ||
3607 | 1622 | else: | ||
3608 | 1623 | arguments=[job['channel'],name_suffix[job['run_mode']], \ | ||
3609 | 1624 | str(job['split']),str(integration_step)] | ||
3610 | 1625 | self.run_exe(executable,arguments,run_type, | ||
3611 | 1626 | cwd=pjoin(self.me_dir,'SubProcesses',job['p_dir'])) | ||
3612 | 1627 | |||
3613 | 1628 | if self.cluster_mode == 2: | ||
3614 | 1629 | time.sleep(1) # security to allow all jobs to be launched | ||
3615 | 1630 | self.njobs=len(jobs_to_run) | ||
3616 | 1631 | self.wait_for_complete(run_type) | ||
3617 | 1632 | |||
3618 | 1633 | |||
3619 | 1634 | def collect_the_results(self,options,req_acc,jobs_to_run,jobs_to_collect,\ | ||
3620 | 1635 | integration_step,mode,run_mode,fixed_order=True): | ||
3621 | 1636 | """Collect the results, make HTML pages, print the summary and | ||
3622 | 1637 | determine if there are more jobs to run. Returns the list | ||
3623 | 1638 | of the jobs that still need to be run, as well as the | ||
3624 | 1639 | complete list of jobs that need to be collected to get the | ||
3625 | 1640 | final answer. | ||
3626 | 1641 | """ | ||
3627 | 1642 | # Get the results of the current integration/MINT step | ||
3628 | 1643 | self.append_the_results(jobs_to_run,integration_step) | ||
3629 | 1644 | self.cross_sect_dict = self.write_res_txt_file(jobs_to_collect,integration_step) | ||
3630 | 1645 | # Update HTML pages | ||
3631 | 1646 | if fixed_order: | ||
3632 | 1647 | cross, error = sum_html.make_all_html_results(self, ['%s*' % run_mode]) | ||
3633 | 1648 | else: | ||
3634 | 1649 | name_suffix={'born' :'B' , 'all':'F'} | ||
3635 | 1650 | cross, error = sum_html.make_all_html_results(self, ['G%s*' % name_suffix[run_mode]]) | ||
3636 | 1651 | self.results.add_detail('cross', cross) | ||
3637 | 1652 | self.results.add_detail('error', error) | ||
3638 | 1653 | # Set-up jobs for the next iteration/MINT step | ||
3639 | 1654 | jobs_to_run_new=self.update_jobs_to_run(req_acc,integration_step,jobs_to_run,fixed_order) | ||
3640 | 1655 | # if there are no more jobs, we are done! | ||
3641 | 1656 | # Print summary | ||
3642 | 1657 | if (not jobs_to_run_new) and fixed_order: | ||
3643 | 1658 | # print final summary of results (for fixed order) | ||
3644 | 1659 | scale_pdf_info=self.collect_scale_pdf_info(options,jobs_to_collect) | ||
3645 | 1660 | self.print_summary(options,integration_step,mode,scale_pdf_info,done=True) | ||
3646 | 1661 | return jobs_to_run_new,jobs_to_collect | ||
3647 | 1662 | elif jobs_to_run_new: | ||
3648 | 1663 | # print intermediate summary of results | ||
3649 | 1664 | scale_pdf_info={} | ||
3650 | 1665 | self.print_summary(options,integration_step,mode,scale_pdf_info,done=False) | ||
3651 | 1666 | else: | ||
3652 | 1667 | # When we are done for (N)LO+PS runs, do not print | ||
3653 | 1668 | # anything yet. This will be done after the reweighting | ||
3654 | 1669 | # and collection of the events | ||
3655 | 1670 | scale_pdf_info={} | ||
3656 | 1671 | # Prepare for the next integration/MINT step | ||
3657 | 1672 | if (not fixed_order) and integration_step+1 == 2 : | ||
3658 | 1673 | # next step is event generation (mint_step 2) | ||
3659 | 1674 | jobs_to_run_new,jobs_to_collect_new= \ | ||
3660 | 1675 | self.check_the_need_to_split(jobs_to_run_new,jobs_to_collect) | ||
3661 | 1676 | self.prepare_directories(jobs_to_run_new,mode,fixed_order) | ||
3662 | 1677 | self.write_nevents_unweighted_file(jobs_to_collect_new) | ||
3663 | 1678 | self.write_nevts_files(jobs_to_run_new) | ||
3664 | 1679 | else: | ||
3665 | 1680 | self.prepare_directories(jobs_to_run_new,mode,fixed_order) | ||
3666 | 1681 | jobs_to_collect_new=jobs_to_collect | ||
3667 | 1682 | return jobs_to_run_new,jobs_to_collect_new | ||
3668 | 1683 | |||
3669 | 1684 | |||
3670 | 1685 | def write_nevents_unweighted_file(self,jobs): | ||
3671 | 1686 | """writes the nevents_unweighted file in the SubProcesses directory""" | ||
3672 | 1687 | content=[] | ||
3673 | 1688 | for job in jobs: | ||
3674 | 1689 | path=pjoin(job['dirname'].split('/')[-2],job['dirname'].split('/')[-1]) | ||
3675 | 1690 | lhefile=pjoin(path,'events.lhe') | ||
3676 | 1691 | content.append(' %s %d %9e %9e' % \ | ||
3677 | 1692 | (lhefile.ljust(40),job['nevents'],job['resultABS']*job['wgt_frac'],job['wgt_frac'])) | ||
3678 | 1693 | with open(pjoin(self.me_dir,'SubProcesses',"nevents_unweighted"),'w') as f: | ||
3679 | 1694 | f.write('\n'.join(content)+'\n') | ||
3680 | 1695 | |||
3681 | 1696 | def write_nevts_files(self,jobs): | ||
3682 | 1697 | """write the nevts files in the SubProcesses/P*/G*/ directories""" | ||
3683 | 1698 | for job in jobs: | ||
3684 | 1699 | with open(pjoin(job['dirname'],'nevts'),'w') as f: | ||
3685 | 1700 | f.write('%i\n' % job['nevents']) | ||
3686 | 1701 | |||
3687 | 1702 | def check_the_need_to_split(self,jobs_to_run,jobs_to_collect): | ||
3688 | 1703 | """Looks in the jobs_to_run to see if there is the need to split the | ||
3689 | 1704 | event generation step. Updates jobs_to_run and | ||
3690 | 1705 | jobs_to_collect to replace the split-job by its | ||
3691 | 1706 | splits. Also removes jobs that do not need any events. | ||
3692 | 1707 | """ | ||
3693 | 1708 | nevt_job=self.run_card['nevt_job'] | ||
3694 | 1709 | if nevt_job > 0: | ||
3695 | 1710 | jobs_to_collect_new=copy.copy(jobs_to_collect) | ||
3696 | 1711 | for job in jobs_to_run: | ||
3697 | 1712 | nevents=job['nevents'] | ||
3698 | 1713 | if nevents == 0: | ||
3699 | 1714 | jobs_to_collect_new.remove(job) | ||
3700 | 1715 | elif nevents > nevt_job: | ||
3701 | 1716 | jobs_to_collect_new.remove(job) | ||
3702 | 1717 | if nevents % nevt_job != 0 : | ||
3703 | 1718 | nsplit=int(nevents/nevt_job)+1 | ||
3704 | 1719 | else: | ||
3705 | 1720 | nsplit=int(nevents/nevt_job) | ||
3706 | 1721 | for i in range(1,nsplit+1): | ||
3707 | 1722 | job_new=copy.copy(job) | ||
3708 | 1723 | left_over=nevents % nsplit | ||
3709 | 1724 | if i <= left_over: | ||
3710 | 1725 | job_new['nevents']=int(nevents/nsplit)+1 | ||
3711 | 1726 | job_new['wgt_frac']=float(job_new['nevents'])/float(nevents) | ||
3712 | 1727 | else: | ||
3713 | 1728 | job_new['nevents']=int(nevents/nsplit) | ||
3714 | 1729 | job_new['wgt_frac']=float(job_new['nevents'])/float(nevents) | ||
3715 | 1730 | job_new['split']=i | ||
3716 | 1731 | job_new['dirname']=job['dirname']+'_%i' % job_new['split'] | ||
3717 | 1732 | jobs_to_collect_new.append(job_new) | ||
3718 | 1733 | jobs_to_run_new=copy.copy(jobs_to_collect_new) | ||
3719 | 1734 | else: | ||
3720 | 1735 | jobs_to_run_new=copy.copy(jobs_to_collect) | ||
3721 | 1736 | for job in jobs_to_collect: | ||
3722 | 1737 | if job['nevents'] == 0: | ||
3723 | 1738 | jobs_to_run_new.remove(job) | ||
3724 | 1739 | jobs_to_collect_new=copy.copy(jobs_to_run_new) | ||
3725 | 1740 | |||
3726 | 1741 | return jobs_to_run_new,jobs_to_collect_new | ||
3727 | 1742 | |||
3728 | 1743 | |||
3729 | 1744 | def update_jobs_to_run(self,req_acc,step,jobs,fixed_order=True): | ||
3730 | 1745 | """ | ||
3731 | 1746 | For (N)LO+PS: determines the number of events and/or the required | ||
3732 | 1747 | accuracy per job. | ||
3733 | 1748 | For fixed order: determines which jobs need higher precision and | ||
3734 | 1749 | returns those with the newly requested precision. | ||
3735 | 1750 | """ | ||
3736 | 1751 | err=self.cross_sect_dict['errt'] | ||
3737 | 1752 | tot=self.cross_sect_dict['xsect'] | ||
3738 | 1753 | errABS=self.cross_sect_dict['erra'] | ||
3739 | 1754 | totABS=self.cross_sect_dict['xseca'] | ||
3740 | 1755 | jobs_new=[] | ||
3741 | 1756 | if fixed_order: | ||
3742 | 1757 | if req_acc == -1: | ||
3743 | 1758 | if step+1 == 1: | ||
3744 | 1759 | npoints = self.run_card['npoints_FO'] | ||
3745 | 1760 | niters = self.run_card['niters_FO'] | ||
3746 | 1761 | for job in jobs: | ||
3747 | 1762 | job['mint_mode']=-1 | ||
3748 | 1763 | job['niters']=niters | ||
3749 | 1764 | job['npoints']=npoints | ||
3750 | 1765 | jobs_new.append(job) | ||
3751 | 1766 | elif step+1 == 2: | ||
3752 | 1767 | pass | ||
3753 | 1768 | elif step+1 > 2: | ||
3754 | 1769 | raise aMCatNLOError('Cannot determine number of iterations and PS points '+ | ||
3755 | 1770 | 'for integration step %i' % step ) | ||
3756 | 1771 | elif ( req_acc > 0 and err/tot > req_acc*1.2 ) or step == 0: | ||
3757 | 1772 | req_accABS=req_acc*abs(tot)/totABS # overal relative required accuracy on ABS Xsec. | ||
3758 | 1773 | for job in jobs: | ||
3759 | 1774 | job['mint_mode']=-1 | ||
3760 | 1775 | # Determine relative required accuracy on the ABS for this job | ||
3761 | 1776 | job['accuracy']=req_accABS*math.sqrt(totABS/job['resultABS']) | ||
3762 | 1777 | # If already accurate enough, skip running | ||
3763 | 1778 | if job['accuracy'] > job['errorABS']/job['resultABS'] and step != 0: | ||
3764 | 1779 | continue | ||
3765 | 1780 | # Update the number of PS points based on errorABS, ncall and accuracy | ||
3766 | 1781 | itmax_fl=job['niters_done']*math.pow(job['errorABS']/ | ||
3767 | 1782 | (job['accuracy']*job['resultABS']),2) | ||
3768 | 1783 | if itmax_fl <= 4.0 : | ||
3769 | 1784 | job['niters']=max(int(round(itmax_fl)),2) | ||
3770 | 1785 | job['npoints']=job['npoints_done']*2 | ||
3771 | 1786 | elif itmax_fl > 4.0 and itmax_fl <= 16.0 : | ||
3772 | 1787 | job['niters']=4 | ||
3773 | 1788 | job['npoints']=int(round(job['npoints_done']*itmax_fl/4.0))*2 | ||
3774 | 1789 | else: | ||
3775 | 1790 | if itmax_fl > 100.0 : itmax_fl=50.0 | ||
3776 | 1791 | job['niters']=int(round(math.sqrt(itmax_fl))) | ||
3777 | 1792 | job['npoints']=int(round(job['npoints_done']*itmax_fl/ | ||
3778 | 1793 | round(math.sqrt(itmax_fl))))*2 | ||
3779 | 1794 | # Add the job to the list of jobs that need to be run | ||
3780 | 1795 | jobs_new.append(job) | ||
3781 | 1796 | return jobs_new | ||
3782 | 1797 | elif step+1 <= 2: | ||
3783 | 1798 | nevents=self.run_card['nevents'] | ||
3784 | 1799 | # Total required accuracy for the upper bounding envelope | ||
3785 | 1800 | if req_acc<0: | ||
3786 | 1801 | req_acc2_inv=nevents | ||
3787 | 1802 | else: | ||
3788 | 1803 | req_acc2_inv=1/(req_acc*req_acc) | ||
3789 | 1804 | if step+1 == 1 or step+1 == 2 : | ||
3790 | 1805 | # determine the req. accuracy for each of the jobs for Mint-step = 1 | ||
3791 | 1806 | for job in jobs: | ||
3792 | 1807 | accuracy=min(math.sqrt(totABS/(req_acc2_inv*job['resultABS'])),0.2) | ||
3793 | 1808 | job['accuracy']=accuracy | ||
3794 | 1809 | if step+1 == 2: | ||
3795 | 1810 | # Randomly (based on the relative ABS Xsec of the job) determine the | ||
3796 | 1811 | # number of events each job needs to generate for MINT-step = 2. | ||
3797 | 1812 | r=self.get_randinit_seed() | ||
3798 | 1813 | random.seed(r) | ||
3799 | 1814 | totevts=nevents | ||
3800 | 1815 | for job in jobs: | ||
3801 | 1816 | job['nevents'] = 0 | ||
3802 | 1817 | while totevts : | ||
3803 | 1818 | target = random.random() * totABS | ||
3804 | 1819 | crosssum = 0. | ||
3805 | 1820 | i = 0 | ||
3806 | 1821 | while i<len(jobs) and crosssum < target: | ||
3807 | 1822 | job = jobs[i] | ||
3808 | 1823 | crosssum += job['resultABS'] | ||
3809 | 1824 | i += 1 | ||
3810 | 1825 | totevts -= 1 | ||
3811 | 1826 | i -= 1 | ||
3812 | 1827 | jobs[i]['nevents'] += 1 | ||
3813 | 1828 | for job in jobs: | ||
3814 | 1829 | job['mint_mode']=step+1 # next step | ||
3815 | 1830 | return jobs | ||
3816 | 1831 | else: | ||
3817 | 1832 | return [] | ||
3818 | 1833 | |||
3819 | 1834 | |||
3820 | 1835 | def get_randinit_seed(self): | ||
3821 | 1836 | """ Get the random number seed from the randinit file """ | ||
3822 | 1837 | with open(pjoin(self.me_dir,"SubProcesses","randinit")) as randinit: | ||
3823 | 1838 | # format of the file is "r=%d". | ||
3824 | 1839 | iseed = int(randinit.read()[2:]) | ||
3825 | 1840 | return iseed | ||
3826 | 1841 | |||
3827 | 1842 | |||
3828 | 1843 | def append_the_results(self,jobs,integration_step): | ||
3829 | 1844 | """Appends the results for each of the jobs in the job list""" | ||
3830 | 1845 | error_found=False | ||
3831 | 1846 | for job in jobs: | ||
3832 | 1847 | try: | ||
3833 | 1848 | if integration_step >= 0 : | ||
3834 | 1849 | with open(pjoin(job['dirname'],'res_%s.dat' % integration_step)) as res_file: | ||
3835 | 1850 | results=res_file.readline().split() | ||
3836 | 1851 | else: | ||
3837 | 1852 | # should only be here when doing fixed order with the 'only_generation' | ||
3838 | 1853 | # option equal to True. Take the results from the final run done. | ||
3839 | 1854 | with open(pjoin(job['dirname'],'res.dat')) as res_file: | ||
3840 | 1855 | results=res_file.readline().split() | ||
3841 | 1856 | except IOError: | ||
3842 | 1857 | if not error_found: | ||
3843 | 1858 | error_found=True | ||
3844 | 1859 | error_log=[] | ||
3845 | 1860 | error_log.append(pjoin(job['dirname'],'log.txt')) | ||
3846 | 1861 | continue | ||
3847 | 1862 | job['resultABS']=float(results[0]) | ||
3848 | 1863 | job['errorABS']=float(results[1]) | ||
3849 | 1864 | job['result']=float(results[2]) | ||
3850 | 1865 | job['error']=float(results[3]) | ||
3851 | 1866 | job['niters_done']=int(results[4]) | ||
3852 | 1867 | job['npoints_done']=int(results[5]) | ||
3853 | 1868 | job['time_spend']=float(results[6]) | ||
3854 | 1869 | job['err_percABS'] = job['errorABS']/job['resultABS']*100. | ||
3855 | 1870 | job['err_perc'] = job['error']/job['result']*100. | ||
3856 | 1871 | if error_found: | ||
3857 | 1872 | raise aMCatNLOError('An error occurred during the collection of results.\n' + | ||
3858 | 1873 | 'Please check the .log files inside the directories which failed:\n' + | ||
3859 | 1874 | '\n'.join(error_log)+'\n') | ||
3860 | 1875 | |||
3861 | 1876 | |||
3862 | 1877 | |||
3863 | 1878 | def write_res_txt_file(self,jobs,integration_step): | ||
3864 | 1879 | """writes the res.txt files in the SubProcess dir""" | ||
3865 | 1880 | jobs.sort(key = lambda job: -job['errorABS']) | ||
3866 | 1881 | content=[] | ||
3867 | 1882 | content.append('\n\nCross-section per integration channel:') | ||
3868 | 1883 | for job in jobs: | ||
3869 | 1884 | content.append('%(p_dir)20s %(channel)15s %(result)10.8e %(error)6.4e %(err_perc)6.4f%% ' % job) | ||
3870 | 1885 | content.append('\n\nABS cross-section per integration channel:') | ||
3871 | 1886 | for job in jobs: | ||
3872 | 1887 | content.append('%(p_dir)20s %(channel)15s %(resultABS)10.8e %(errorABS)6.4e %(err_percABS)6.4f%% ' % job) | ||
3873 | 1888 | totABS=0 | ||
3874 | 1889 | errABS=0 | ||
3875 | 1890 | tot=0 | ||
3876 | 1891 | err=0 | ||
3877 | 1892 | for job in jobs: | ||
3878 | 1893 | totABS+= job['resultABS'] | ||
3879 | 1894 | errABS+= math.pow(job['errorABS'],2) | ||
3880 | 1895 | tot+= job['result'] | ||
3881 | 1896 | err+= math.pow(job['error'],2) | ||
3882 | 1897 | if jobs: | ||
3883 | 1898 | content.append('\nTotal ABS and \nTotal: \n %10.8e +- %6.4e (%6.4e%%)\n %10.8e +- %6.4e (%6.4e%%) \n' %\ | ||
3884 | 1899 | (totABS, math.sqrt(errABS), math.sqrt(errABS)/totABS *100.,\ | ||
3885 | 1900 | tot, math.sqrt(err), math.sqrt(err)/tot *100.)) | ||
3886 | 1901 | with open(pjoin(self.me_dir,'SubProcesses','res_%s.txt' % integration_step),'w') as res_file: | ||
3887 | 1902 | res_file.write('\n'.join(content)) | ||
3888 | 1903 | randinit=self.get_randinit_seed() | ||
3889 | 1904 | return {'xsect':tot,'xseca':totABS,'errt':math.sqrt(err),\ | ||
3890 | 1905 | 'erra':math.sqrt(errABS),'randinit':randinit} | ||
3891 | 1906 | |||
3892 | 1907 | |||
3893 | 1908 | def collect_scale_pdf_info(self,options,jobs): | ||
3894 | 1909 | """read the scale_pdf_dependence.dat files and collects there results""" | ||
3895 | 1910 | scale_pdf_info={} | ||
3896 | 1911 | if self.run_card['reweight_scale'] or self.run_card['reweight_PDF']: | ||
3897 | 1912 | data_files=[] | ||
3898 | 1913 | for job in jobs: | ||
3899 | 1914 | data_files.append(pjoin(job['dirname'],'scale_pdf_dependence.dat')) | ||
3900 | 1915 | scale_pdf_info = self.pdf_scale_from_reweighting(data_files) | ||
3901 | 1916 | return scale_pdf_info | ||
3902 | 1917 | |||
3903 | 1918 | |||
3904 | 1919 | def combine_plots_FO(self,folder_name,jobs): | ||
3905 | 1920 | """combines the plots and puts then in the Events/run* directory""" | ||
3906 | 1921 | devnull = os.open(os.devnull, os.O_RDWR) | ||
3907 | 1922 | if self.analyse_card['fo_analysis_format'].lower() == 'topdrawer': | ||
3908 | 1923 | misc.call(['./combine_plots_FO.sh'] + folder_name, \ | ||
3909 | 1924 | stdout=devnull, | ||
3910 | 1925 | cwd=pjoin(self.me_dir, 'SubProcesses')) | ||
3911 | 1926 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.top'), | ||
3912 | 1927 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3913 | 1928 | logger.info('The results of this run and the TopDrawer file with the plots' + \ | ||
3914 | 1929 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3915 | 1930 | elif self.analyse_card['fo_analysis_format'].lower() == 'hwu': | ||
3916 | 1931 | self.combine_plots_HwU(jobs) | ||
3917 | 1932 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.HwU'), | ||
3918 | 1933 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3919 | 1934 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.gnuplot'), | ||
3920 | 1935 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3921 | 1936 | try: | ||
3922 | 1937 | misc.call(['gnuplot','MADatNLO.gnuplot'],\ | ||
3923 | 1938 | stdout=devnull,stderr=devnull,\ | ||
3924 | 1939 | cwd=pjoin(self.me_dir, 'Events', self.run_name)) | ||
3925 | 1940 | except Exception: | ||
3926 | 1941 | pass | ||
3927 | 1942 | logger.info('The results of this run and the HwU and GnuPlot files with the plots' + \ | ||
3928 | 1943 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3929 | 1944 | elif self.analyse_card['fo_analysis_format'].lower() == 'root': | ||
3930 | 1945 | misc.call(['./combine_root.sh'] + folder_name, \ | ||
3931 | 1946 | stdout=devnull, | ||
3932 | 1947 | cwd=pjoin(self.me_dir, 'SubProcesses')) | ||
3933 | 1948 | files.cp(pjoin(self.me_dir, 'SubProcesses', 'MADatNLO.root'), | ||
3934 | 1949 | pjoin(self.me_dir, 'Events', self.run_name)) | ||
3935 | 1950 | logger.info('The results of this run and the ROOT file with the plots' + \ | ||
3936 | 1951 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3937 | 1952 | else: | ||
3938 | 1953 | logger.info('The results of this run' + \ | ||
3939 | 1954 | ' have been saved in %s' % pjoin(self.me_dir, 'Events', self.run_name)) | ||
3940 | 1955 | |||
3941 | 1956 | |||
3942 | 1957 | def combine_plots_HwU(self,jobs): | ||
3943 | 1613 | """Sums all the plots in the HwU format.""" | 1958 | """Sums all the plots in the HwU format.""" |
3944 | 1614 | |||
3945 | 1615 | logger.debug('Combining HwU plots.') | 1959 | logger.debug('Combining HwU plots.') |
3952 | 1616 | 1960 | all_histo_paths=[] | |
3953 | 1617 | with open(pjoin(self.me_dir,'SubProcesses','dirs.txt')) as dirf: | 1961 | for job in jobs: |
3954 | 1618 | all_histo_paths = dirf.readlines() | 1962 | all_histo_paths.append(pjoin(job['dirname'],"MADatNLO.HwU")) |
3949 | 1619 | all_histo_paths = [pjoin(self.me_dir,'SubProcesses', | ||
3950 | 1620 | path.rstrip(),"MADatNLO.HwU") for path in all_histo_paths] | ||
3951 | 1621 | |||
3955 | 1622 | histogram_list = histograms.HwUList(all_histo_paths[0]) | 1963 | histogram_list = histograms.HwUList(all_histo_paths[0]) |
3956 | 1623 | |||
3957 | 1624 | for histo_path in all_histo_paths[1:]: | 1964 | for histo_path in all_histo_paths[1:]: |
3958 | 1625 | for i, histo in enumerate(histograms.HwUList(histo_path)): | 1965 | for i, histo in enumerate(histograms.HwUList(histo_path)): |
3959 | 1626 | # First make sure the plots have the same weight labels and such | 1966 | # First make sure the plots have the same weight labels and such |
3960 | @@ -1632,19 +1972,18 @@ | |||
3961 | 1632 | histogram_list.output(pjoin(self.me_dir,'SubProcesses',"MADatNLO"), | 1972 | histogram_list.output(pjoin(self.me_dir,'SubProcesses',"MADatNLO"), |
3962 | 1633 | format = 'gnuplot') | 1973 | format = 'gnuplot') |
3963 | 1634 | 1974 | ||
3965 | 1635 | def applgrid_combine(self,cross,error): | 1975 | def applgrid_combine(self,cross,error,jobs): |
3966 | 1636 | """Combines the APPLgrids in all the SubProcess/P*/all_G*/ directories""" | 1976 | """Combines the APPLgrids in all the SubProcess/P*/all_G*/ directories""" |
3967 | 1637 | logger.debug('Combining APPLgrids \n') | 1977 | logger.debug('Combining APPLgrids \n') |
3968 | 1638 | applcomb=pjoin(self.options['applgrid'].rstrip('applgrid-config'), | 1978 | applcomb=pjoin(self.options['applgrid'].rstrip('applgrid-config'), |
3969 | 1639 | 'applgrid-combine') | 1979 | 'applgrid-combine') |
3972 | 1640 | with open(pjoin(self.me_dir,'SubProcesses','dirs.txt')) as dirf: | 1980 | all_jobs=[] |
3973 | 1641 | all_jobs=dirf.readlines() | 1981 | for job in jobs: |
3974 | 1982 | all_jobs.append(job['dirname']) | ||
3975 | 1642 | ngrids=len(all_jobs) | 1983 | ngrids=len(all_jobs) |
3978 | 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")]) |
3977 | 1644 | all_jobs[0].rstrip())) if name.endswith("_out.root")]) | ||
3979 | 1645 | for obs in range(0,nobs): | 1985 | for obs in range(0,nobs): |
3982 | 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] |
3981 | 1647 | str(obs)+"_out.root") for job in all_jobs] | ||
3983 | 1648 | # combine APPLgrids from different channels for observable 'obs' | 1987 | # combine APPLgrids from different channels for observable 'obs' |
3984 | 1649 | if self.run_card["iappl"] == 1: | 1988 | if self.run_card["iappl"] == 1: |
3985 | 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, |
3986 | @@ -1656,8 +1995,7 @@ | |||
3987 | 1656 | self.run_name,"aMCfast_obs_"+str(obs)+".root"),'-s', | 1995 | self.run_name,"aMCfast_obs_"+str(obs)+".root"),'-s', |
3988 | 1657 | str(unc2_inv),'--weight',str(unc2_inv)]+ gdir) | 1996 | str(unc2_inv),'--weight',str(unc2_inv)]+ gdir) |
3989 | 1658 | for job in all_jobs: | 1997 | for job in all_jobs: |
3992 | 1659 | os.remove(pjoin(self.me_dir,'SubProcesses',job.rstrip(), | 1998 | os.remove(pjoin(job,"grid_obs_"+str(obs)+"_in.root")) |
3991 | 1660 | "grid_obs_"+str(obs)+"_in.root")) | ||
3993 | 1661 | else: | 1999 | else: |
3994 | 1662 | raise aMCatNLOError('iappl parameter can only be 0, 1 or 2') | 2000 | raise aMCatNLOError('iappl parameter can only be 0, 1 or 2') |
3995 | 1663 | # after combining, delete the original grids | 2001 | # after combining, delete the original grids |
3996 | @@ -1698,14 +2036,10 @@ | |||
3997 | 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: |
3998 | 1699 | raise self.InvalidCmd('No APPLgrid name currently defined.'+ | 2037 | raise self.InvalidCmd('No APPLgrid name currently defined.'+ |
3999 | 1700 | 'Please provide this information.') | 2038 | 'Please provide this information.') |
4000 | 1701 | if mode == 'NLO': | ||
4001 | 1702 | gdir='all_G' | ||
4002 | 1703 | elif mode == 'LO': | ||
4003 | 1704 | gdir='born_G' | ||
4004 | 1705 | #copy the grid to all relevant directories | 2039 | #copy the grid to all relevant directories |
4005 | 1706 | for pdir in p_dirs: | 2040 | for pdir in p_dirs: |
4006 | 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, |
4008 | 1708 | "SubProcesses",pdir)) if file.startswith(gdir) and | 2042 | "SubProcesses",pdir)) if file.startswith(mode+'_G') and |
4009 | 1709 | os.path.isdir(pjoin(self.me_dir,"SubProcesses",pdir, file))] | 2043 | os.path.isdir(pjoin(self.me_dir,"SubProcesses",pdir, file))] |
4010 | 1710 | for g_dir in g_dirs: | 2044 | for g_dir in g_dirs: |
4011 | 1711 | for grid in all_grids: | 2045 | for grid in all_grids: |
4012 | @@ -1714,28 +2048,20 @@ | |||
4013 | 1714 | 'grid_obs_'+obs+'_in.root')) | 2048 | 'grid_obs_'+obs+'_in.root')) |
4014 | 1715 | 2049 | ||
4015 | 1716 | 2050 | ||
4017 | 1717 | def collect_log_files(self, folders, istep): | 2051 | |
4018 | 2052 | |||
4019 | 2053 | def collect_log_files(self, jobs, integration_step): | ||
4020 | 1718 | """collect the log files and put them in a single, html-friendly file | 2054 | """collect the log files and put them in a single, html-friendly file |
4024 | 1719 | inside the run_... directory""" | 2055 | inside the Events/run_.../ directory""" |
4022 | 1720 | step_list = ['Grid setting', 'Cross-section computation', | ||
4023 | 1721 | 'Event generation'] | ||
4025 | 1722 | log_file = pjoin(self.me_dir, 'Events', self.run_name, | 2056 | log_file = pjoin(self.me_dir, 'Events', self.run_name, |
4033 | 1723 | 'alllogs_%d.html' % istep) | 2057 | 'alllogs_%d.html' % integration_step) |
4034 | 1724 | # this keeps track of which step has been computed for which channel | 2058 | outfile = open(log_file, 'w') |
4028 | 1725 | channel_dict = {} | ||
4029 | 1726 | log_files = [] | ||
4030 | 1727 | for folder in folders: | ||
4031 | 1728 | log_files += glob.glob(pjoin(self.me_dir, 'SubProcesses', 'P*', | ||
4032 | 1729 | folder, 'log.txt')) | ||
4035 | 1730 | 2059 | ||
4036 | 1731 | content = '' | 2060 | content = '' |
4037 | 1732 | |||
4038 | 1733 | outfile = open(log_file, 'w') | ||
4039 | 1734 | |||
4040 | 1735 | content += '<HTML><BODY>\n<font face="courier" size=2>' | 2061 | content += '<HTML><BODY>\n<font face="courier" size=2>' |
4043 | 1736 | for log in log_files: | 2062 | for job in jobs: |
4042 | 1737 | channel_dict[os.path.dirname(log)] = [istep] | ||
4044 | 1738 | # put an anchor | 2063 | # put an anchor |
4045 | 2064 | log=pjoin(job['dirname'],'log_MINT%s.txt' % integration_step) | ||
4046 | 1739 | content += '<a name=%s></a>\n' % (os.path.dirname(log).replace( | 2065 | content += '<a name=%s></a>\n' % (os.path.dirname(log).replace( |
4047 | 1740 | pjoin(self.me_dir,'SubProcesses'),'')) | 2066 | pjoin(self.me_dir,'SubProcesses'),'')) |
4048 | 1741 | # and put some nice header | 2067 | # and put some nice header |
4049 | @@ -1743,7 +2069,7 @@ | |||
4050 | 1743 | content += '<br>LOG file for integration channel %s, %s <br>' % \ | 2069 | content += '<br>LOG file for integration channel %s, %s <br>' % \ |
4051 | 1744 | (os.path.dirname(log).replace(pjoin(self.me_dir, | 2070 | (os.path.dirname(log).replace(pjoin(self.me_dir, |
4052 | 1745 | 'SubProcesses'), ''), | 2071 | 'SubProcesses'), ''), |
4054 | 1746 | step_list[istep]) | 2072 | integration_step) |
4055 | 1747 | content += '</font>\n' | 2073 | content += '</font>\n' |
4056 | 1748 | #then just flush the content of the small log inside the big log | 2074 | #then just flush the content of the small log inside the big log |
4057 | 1749 | #the PRE tag prints everything verbatim | 2075 | #the PRE tag prints everything verbatim |
4058 | @@ -1756,53 +2082,80 @@ | |||
4059 | 1756 | outfile.close() | 2082 | outfile.close() |
4060 | 1757 | 2083 | ||
4061 | 1758 | 2084 | ||
4109 | 1759 | def read_results(self, output, mode): | 2085 | def finalise_run_FO(self,folder_name,jobs): |
4110 | 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.""" |
4111 | 1761 | from output, which should be formatted as | 2087 | # Copy the res_*.txt files to the Events/run* folder |
4112 | 1762 | Found 4 correctly terminated jobs | 2088 | res_files=glob.glob(pjoin(self.me_dir, 'SubProcesses', 'res_*.txt')) |
4113 | 1763 | random seed found in 'randinit' is 33 | 2089 | for res_file in res_files: |
4114 | 1764 | Integrated abs(cross-section) | 2090 | files.mv(res_file,pjoin(self.me_dir, 'Events', self.run_name)) |
4115 | 1765 | 7.94473937e+03 +- 2.9953e+01 (3.7702e-01%) | 2091 | # Collect the plots and put them in the Events/run* folder |
4116 | 1766 | Integrated cross-section | 2092 | self.combine_plots_FO(folder_name,jobs) |
4117 | 1767 | 6.63392298e+03 +- 3.7669e+01 (5.6782e-01%) | 2093 | # If doing the applgrid-stuff, also combine those grids |
4118 | 1768 | for aMC@NLO/aMC@LO, and as | 2094 | # and put those in the Events/run* folder |
4119 | 1769 | 2095 | if self.run_card['iappl'] != 0: | |
4120 | 1770 | for NLO/LO | 2096 | cross=self.cross_sect_dict['xsect'] |
4121 | 1771 | The cross_sect_dict is returned""" | 2097 | error=self.cross_sect_dict['errt'] |
4122 | 1772 | res = {} | 2098 | self.applgrid_combine(cross,error,jobs) |
4123 | 1773 | if mode in ['aMC@LO', 'aMC@NLO', 'noshower', 'noshowerLO']: | 2099 | |
4124 | 1774 | pat = re.compile(\ | 2100 | |
4125 | 1775 | '''Found (\d+) correctly terminated jobs | 2101 | def setup_cluster_or_multicore(self): |
4126 | 1776 | random seed found in 'randinit' is (\d+) | 2102 | """setup the number of cores for multicore, and the cluster-type for cluster runs""" |
4127 | 1777 | Integrated abs\(cross-section\) | 2103 | if self.cluster_mode == 1: |
4128 | 1778 | \s*(\d+\.\d+e[+-]\d+) \+\- (\d+\.\d+e[+-]\d+) \((\d+\.\d+e[+-]\d+)\%\) | 2104 | cluster_name = self.options['cluster_type'] |
4129 | 1779 | Integrated cross-section | 2105 | self.cluster = cluster.from_name[cluster_name](**self.options) |
4130 | 1780 | \s*(\-?\d+\.\d+e[+-]\d+) \+\- (\d+\.\d+e[+-]\d+) \((\-?\d+\.\d+e[+-]\d+)\%\)''') | 2106 | if self.cluster_mode == 2: |
4131 | 1781 | else: | 2107 | try: |
4132 | 1782 | pat = re.compile(\ | 2108 | import multiprocessing |
4133 | 1783 | '''Found (\d+) correctly terminated jobs | 2109 | if not self.nb_core: |
4134 | 1784 | \s*(\-?\d+\.\d+e[+-]\d+) \+\- (\d+\.\d+e[+-]\d+) \((\-?\d+\.\d+e[+-]\d+)\%\)''') | 2110 | try: |
4135 | 1785 | pass | 2111 | self.nb_core = int(self.options['nb_core']) |
4136 | 1786 | 2112 | except TypeError: | |
4137 | 1787 | match = re.search(pat, output[0]) | 2113 | self.nb_core = multiprocessing.cpu_count() |
4138 | 1788 | if not match or output[1]: | 2114 | logger.info('Using %d cores' % self.nb_core) |
4139 | 1789 | logger.info('Return code of the event collection: '+str(output[1])) | 2115 | except ImportError: |
4140 | 1790 | logger.info('Output of the event collection:\n'+output[0]) | 2116 | self.nb_core = 1 |
4141 | 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'+ |
4142 | 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'+ |
4143 | 1793 | # if int(match.groups()[0]) != self.njobs: | 2119 | 'run in multicore.') |
4144 | 1794 | # raise aMCatNLOError('Not all jobs terminated successfully') | 2120 | |
4145 | 1795 | if mode in ['aMC@LO', 'aMC@NLO', 'noshower', 'noshowerLO']: | 2121 | self.cluster = cluster.MultiCore(**self.options) |
4146 | 1796 | return {'randinit' : int(match.groups()[1]), | 2122 | |
4147 | 1797 | 'xseca' : float(match.groups()[2]), | 2123 | |
4148 | 1798 | 'erra' : float(match.groups()[3]), | 2124 | def clean_previous_results(self,options,p_dirs,folder_name): |
4149 | 1799 | 'xsect' : float(match.groups()[5]), | 2125 | """Clean previous results. |
4150 | 1800 | 'errt' : float(match.groups()[6])} | 2126 | o. If doing only the reweighting step, do not delete anything and return directlty. |
4151 | 1801 | else: | 2127 | o. Always remove all the G*_* files (from split event generation). |
4152 | 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.""" |
4153 | 1803 | 'errt' : float(match.groups()[2])} | 2129 | if options['reweightonly']: |
4154 | 1804 | 2130 | return | |
4155 | 1805 | def print_summary(self, options, step, mode, scale_pdf_info={}): | 2131 | if not options['only_generation']: |
4156 | 2132 | self.update_status('Cleaning previous results', level=None) | ||
4157 | 2133 | for dir in p_dirs: | ||
4158 | 2134 | #find old folders to be removed | ||
4159 | 2135 | for obj in folder_name: | ||
4160 | 2136 | # list all the G* (or all_G* or born_G*) directories | ||
4161 | 2137 | to_rm = [file for file in \ | ||
4162 | 2138 | os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \ | ||
4163 | 2139 | if file.startswith(obj[:-1]) and \ | ||
4164 | 2140 | (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \ | ||
4165 | 2141 | os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))] | ||
4166 | 2142 | # list all the G*_* directories (from split event generation) | ||
4167 | 2143 | to_always_rm = [file for file in \ | ||
4168 | 2144 | os.listdir(pjoin(self.me_dir, 'SubProcesses', dir)) \ | ||
4169 | 2145 | if file.startswith(obj[:-1]) and | ||
4170 | 2146 | '_' in file and not '_G' in file and \ | ||
4171 | 2147 | (os.path.isdir(pjoin(self.me_dir, 'SubProcesses', dir, file)) or \ | ||
4172 | 2148 | os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir, file)))] | ||
4173 | 2149 | |||
4174 | 2150 | if not options['only_generation']: | ||
4175 | 2151 | to_always_rm.extend(to_rm) | ||
4176 | 2152 | if os.path.exists(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz')): | ||
4177 | 2153 | to_always_rm.append(pjoin(self.me_dir, 'SubProcesses', dir,'MadLoop5_resources.tar.gz')) | ||
4178 | 2154 | files.rm([pjoin(self.me_dir, 'SubProcesses', dir, d) for d in to_always_rm]) | ||
4179 | 2155 | return | ||
4180 | 2156 | |||
4181 | 2157 | |||
4182 | 2158 | def print_summary(self, options, step, mode, scale_pdf_info={}, done=True): | ||
4183 | 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. |
4184 | 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) |
4185 | 1808 | some additional infos are printed""" | 2161 | some additional infos are printed""" |
4186 | @@ -1813,25 +2166,35 @@ | |||
4187 | 1813 | if line.startswith('generate') or line.startswith('add process'): | 2166 | if line.startswith('generate') or line.startswith('add process'): |
4188 | 1814 | process = process+(line.replace('generate ', '')).replace('add process ','')+' ; ' | 2167 | process = process+(line.replace('generate ', '')).replace('add process ','')+' ; ' |
4189 | 1815 | lpp = {0:'l', 1:'p', -1:'pbar'} | 2168 | lpp = {0:'l', 1:'p', -1:'pbar'} |
4194 | 1816 | proc_info = '\n Process %s\n Run at %s-%s collider (%s + %s GeV)' % \ | 2169 | if self.ninitial == 1: |
4195 | 1817 | (process[:-3], lpp[self.run_card['lpp1']], lpp[self.run_card['lpp2']], | 2170 | proc_info = '\n Process %s' % process[:-3] |
4196 | 1818 | self.run_card['ebeam1'], self.run_card['ebeam2']) | 2171 | else: |
4197 | 1819 | 2172 | proc_info = '\n Process %s\n Run at %s-%s collider (%s + %s GeV)' % \ | |
4198 | 2173 | (process[:-3], lpp[self.run_card['lpp1']], lpp[self.run_card['lpp2']], | ||
4199 | 2174 | self.run_card['ebeam1'], self.run_card['ebeam2']) | ||
4200 | 2175 | |||
4201 | 2176 | if self.ninitial == 1: | ||
4202 | 2177 | self.cross_sect_dict['unit']='GeV' | ||
4203 | 2178 | self.cross_sect_dict['xsec_string']='(Partial) decay width' | ||
4204 | 2179 | self.cross_sect_dict['axsec_string']='(Partial) abs(decay width)' | ||
4205 | 2180 | else: | ||
4206 | 2181 | self.cross_sect_dict['unit']='pb' | ||
4207 | 2182 | self.cross_sect_dict['xsec_string']='Total cross-section' | ||
4208 | 2183 | self.cross_sect_dict['axsec_string']='Total abs(cross-section)' | ||
4209 | 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. |
4210 | 1821 | if mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']: | 2185 | if mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO']: |
4211 | 1822 | log_GV_files = glob.glob(pjoin(self.me_dir, \ | 2186 | log_GV_files = glob.glob(pjoin(self.me_dir, \ |
4212 | 1823 | 'SubProcesses', 'P*','G*','log_MINT*.txt')) | 2187 | 'SubProcesses', 'P*','G*','log_MINT*.txt')) |
4215 | 1824 | all_log_files = glob.glob(pjoin(self.me_dir, \ | 2188 | all_log_files = log_GV_files |
4214 | 1825 | 'SubProcesses', 'P*','G*','log*.txt')) | ||
4216 | 1826 | elif mode == 'NLO': | 2189 | elif mode == 'NLO': |
4217 | 1827 | log_GV_files = glob.glob(pjoin(self.me_dir, \ | 2190 | log_GV_files = glob.glob(pjoin(self.me_dir, \ |
4221 | 1828 | 'SubProcesses', 'P*','all_G*','log*.txt')) | 2191 | 'SubProcesses', 'P*','all_G*','log_MINT*.txt')) |
4222 | 1829 | all_log_files = sum([glob.glob(pjoin(self.me_dir,'SubProcesses', 'P*', | 2192 | all_log_files = log_GV_files |
4223 | 1830 | '%sG*'%foldName,'log*.txt')) for foldName in ['all_']],[]) | 2193 | |
4224 | 1831 | elif mode == 'LO': | 2194 | elif mode == 'LO': |
4225 | 1832 | log_GV_files = '' | 2195 | log_GV_files = '' |
4228 | 1833 | all_log_files = sum([glob.glob(pjoin(self.me_dir,'SubProcesses', 'P*', | 2196 | all_log_files = glob.glob(pjoin(self.me_dir, \ |
4229 | 1834 | '%sG*'%foldName,'log*.txt')) for foldName in ['born_']],[]) | 2197 | 'SubProcesses', 'P*','born_G*','log_MINT*.txt')) |
4230 | 1835 | else: | 2198 | else: |
4231 | 1836 | raise aMCatNLOError, 'Running mode %s not supported.'%mode | 2199 | raise aMCatNLOError, 'Running mode %s not supported.'%mode |
4232 | 1837 | 2200 | ||
4233 | @@ -1843,13 +2206,13 @@ | |||
4234 | 1843 | if step != 2: | 2206 | if step != 2: |
4235 | 1844 | message = status[step] + '\n\n Intermediate results:' + \ | 2207 | message = status[step] + '\n\n Intermediate results:' + \ |
4236 | 1845 | ('\n Random seed: %(randinit)d' + \ | 2208 | ('\n Random seed: %(randinit)d' + \ |
4239 | 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' + \ |
4240 | 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') \ |
4241 | 1848 | % self.cross_sect_dict | 2211 | % self.cross_sect_dict |
4242 | 1849 | else: | 2212 | else: |
4243 | 1850 | 2213 | ||
4244 | 1851 | message = '\n ' + status[step] + proc_info + \ | 2214 | message = '\n ' + status[step] + proc_info + \ |
4246 | 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' % \ |
4247 | 1853 | self.cross_sect_dict | 2216 | self.cross_sect_dict |
4248 | 1854 | 2217 | ||
4249 | 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']: |
4250 | @@ -1874,18 +2237,22 @@ | |||
4251 | 1874 | misc.format_timer(time.time()-self.start_time)) | 2237 | misc.format_timer(time.time()-self.start_time)) |
4252 | 1875 | 2238 | ||
4253 | 1876 | elif mode in ['NLO', 'LO']: | 2239 | elif mode in ['NLO', 'LO']: |
4255 | 1877 | status = ['Results after grid setup (cross-section is non-physical):', | 2240 | status = ['Results after grid setup:','Current results:', |
4256 | 1878 | 'Final results and run summary:'] | 2241 | 'Final results and run summary:'] |
4264 | 1879 | if step == 0: | 2242 | if (not done) and (step == 0): |
4265 | 1880 | message = '\n ' + status[step] + \ | 2243 | message = '\n ' + status[0] + \ |
4266 | 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' % \ |
4267 | 1882 | self.cross_sect_dict | 2245 | self.cross_sect_dict |
4268 | 1883 | elif step == 1: | 2246 | elif not done: |
4269 | 1884 | message = '\n ' + status[step] + proc_info + \ | 2247 | message = '\n ' + status[1] + \ |
4270 | 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' % \ |
4271 | 2249 | self.cross_sect_dict | ||
4272 | 2250 | elif done: | ||
4273 | 2251 | message = '\n ' + status[2] + proc_info + \ | ||
4274 | 2252 | '\n %(xsec_string)s: %(xsect)8.3e +- %(errt)6.1e %(unit)s' % \ | ||
4275 | 1886 | self.cross_sect_dict | 2253 | self.cross_sect_dict |
4276 | 1887 | if self.run_card['reweight_scale']: | 2254 | if self.run_card['reweight_scale']: |
4278 | 1888 | if int(self.run_card['ickkw'])!=-1: | 2255 | if self.run_card['ickkw'] != -1: |
4279 | 1889 | message = message + \ | 2256 | message = message + \ |
4280 | 1890 | ('\n Ren. and fac. scale uncertainty: +%0.1f%% -%0.1f%%') % \ | 2257 | ('\n Ren. and fac. scale uncertainty: +%0.1f%% -%0.1f%%') % \ |
4281 | 1891 | (scale_pdf_info['scale_upp'], scale_pdf_info['scale_low']) | 2258 | (scale_pdf_info['scale_upp'], scale_pdf_info['scale_low']) |
4282 | @@ -1898,7 +2265,7 @@ | |||
4283 | 1898 | ('\n PDF uncertainty: +%0.1f%% -%0.1f%%') % \ | 2265 | ('\n PDF uncertainty: +%0.1f%% -%0.1f%%') % \ |
4284 | 1899 | (scale_pdf_info['pdf_upp'], scale_pdf_info['pdf_low']) | 2266 | (scale_pdf_info['pdf_upp'], scale_pdf_info['pdf_low']) |
4285 | 1900 | 2267 | ||
4287 | 1901 | if (mode in ['NLO', 'LO'] and step!=1) or \ | 2268 | if (mode in ['NLO', 'LO'] and not done) or \ |
4288 | 1902 | (mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] and step!=2): | 2269 | (mode in ['aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] and step!=2): |
4289 | 1903 | logger.info(message+'\n') | 2270 | logger.info(message+'\n') |
4290 | 1904 | return | 2271 | return |
4291 | @@ -2359,7 +2726,6 @@ | |||
4292 | 2359 | scale_pdf_info={} | 2726 | scale_pdf_info={} |
4293 | 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'] : |
4294 | 2361 | scale_pdf_info = self.run_reweight(options['reweightonly']) | 2728 | scale_pdf_info = self.run_reweight(options['reweightonly']) |
4295 | 2362 | |||
4296 | 2363 | self.update_status('Collecting events', level='parton', update_results=True) | 2729 | self.update_status('Collecting events', level='parton', update_results=True) |
4297 | 2364 | misc.compile(['collect_events'], | 2730 | misc.compile(['collect_events'], |
4298 | 2365 | cwd=pjoin(self.me_dir, 'SubProcesses')) | 2731 | cwd=pjoin(self.me_dir, 'SubProcesses')) |
4299 | @@ -2383,6 +2749,10 @@ | |||
4300 | 2383 | misc.gzip(pjoin(self.me_dir, 'SubProcesses', filename), stdout=evt_file) | 2749 | misc.gzip(pjoin(self.me_dir, 'SubProcesses', filename), stdout=evt_file) |
4301 | 2384 | if not options['reweightonly']: | 2750 | if not options['reweightonly']: |
4302 | 2385 | self.print_summary(options, 2, mode, scale_pdf_info) | 2751 | self.print_summary(options, 2, mode, scale_pdf_info) |
4303 | 2752 | res_files=glob.glob(pjoin(self.me_dir, 'SubProcesses', 'res*.txt')) | ||
4304 | 2753 | for res_file in res_files: | ||
4305 | 2754 | files.mv(res_file,pjoin(self.me_dir, 'Events', self.run_name)) | ||
4306 | 2755 | |||
4307 | 2386 | logger.info('The %s file has been generated.\n' % (evt_file)) | 2756 | logger.info('The %s file has been generated.\n' % (evt_file)) |
4308 | 2387 | self.results.add_detail('nb_event', nevents) | 2757 | self.results.add_detail('nb_event', nevents) |
4309 | 2388 | self.update_status('Events generated', level='parton', update_results=True) | 2758 | self.update_status('Events generated', level='parton', update_results=True) |
4310 | @@ -2403,9 +2773,9 @@ | |||
4311 | 2403 | 2773 | ||
4312 | 2404 | #check that the number of split event files divides the number of | 2774 | #check that the number of split event files divides the number of |
4313 | 2405 | # events, otherwise set it to 1 | 2775 | # events, otherwise set it to 1 |
4315 | 2406 | if int(int(self.banner.get_detail('run_card', 'nevents')) / \ | 2776 | if int(self.banner.get_detail('run_card', 'nevents') / \ |
4316 | 2407 | self.shower_card['nsplit_jobs']) * self.shower_card['nsplit_jobs'] \ | 2777 | self.shower_card['nsplit_jobs']) * self.shower_card['nsplit_jobs'] \ |
4318 | 2408 | != int(self.banner.get_detail('run_card', 'nevents')): | 2778 | != self.banner.get_detail('run_card', 'nevents'): |
4319 | 2409 | logger.warning(\ | 2779 | logger.warning(\ |
4320 | 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' + \ |
4321 | 2411 | 'Setting it to 1.') | 2781 | 'Setting it to 1.') |
4322 | @@ -2413,7 +2783,7 @@ | |||
4323 | 2413 | 2783 | ||
4324 | 2414 | # don't split jobs if the user asks to shower only a part of the events | 2784 | # don't split jobs if the user asks to shower only a part of the events |
4325 | 2415 | if self.shower_card['nevents'] > 0 and \ | 2785 | if self.shower_card['nevents'] > 0 and \ |
4327 | 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 \ |
4328 | 2417 | self.shower_card['nsplit_jobs'] != 1: | 2787 | self.shower_card['nsplit_jobs'] != 1: |
4329 | 2418 | logger.warning(\ | 2788 | logger.warning(\ |
4330 | 2419 | 'Only a part of the events will be showered.\n' + \ | 2789 | 'Only a part of the events will be showered.\n' + \ |
4331 | @@ -2503,6 +2873,18 @@ | |||
4332 | 2503 | 2873 | ||
4333 | 2504 | mcatnlo_log = pjoin(self.me_dir, 'mcatnlo.log') | 2874 | mcatnlo_log = pjoin(self.me_dir, 'mcatnlo.log') |
4334 | 2505 | self.update_status('Compiling MCatNLO for %s...' % shower, level='shower') | 2875 | self.update_status('Compiling MCatNLO for %s...' % shower, level='shower') |
4335 | 2876 | |||
4336 | 2877 | |||
4337 | 2878 | # libdl may be needded for pythia 82xx | ||
4338 | 2879 | if shower == 'PYTHIA8' and not \ | ||
4339 | 2880 | os.path.exists(pjoin(self.options['pythia8_path'], 'xmldoc')) and \ | ||
4340 | 2881 | 'dl' not in self.shower_card['extralibs'].split(): | ||
4341 | 2882 | # 'dl' has to be linked with the extralibs | ||
4342 | 2883 | self.shower_card['extralibs'] += ' dl' | ||
4343 | 2884 | logger.warning("'dl' was added to extralibs from the shower_card.dat.\n" + \ | ||
4344 | 2885 | "It is needed for the correct running of PY8.2xx.\n" + \ | ||
4345 | 2886 | "If this library cannot be found on your system, a crash will occur.") | ||
4346 | 2887 | |||
4347 | 2506 | misc.call(['./MCatNLO_MadFKS.inputs'], stdout=open(mcatnlo_log, 'w'), | 2888 | misc.call(['./MCatNLO_MadFKS.inputs'], stdout=open(mcatnlo_log, 'w'), |
4348 | 2507 | stderr=open(mcatnlo_log, 'w'), | 2889 | stderr=open(mcatnlo_log, 'w'), |
4349 | 2508 | cwd=pjoin(self.me_dir, 'MCatNLO')) | 2890 | cwd=pjoin(self.me_dir, 'MCatNLO')) |
4350 | @@ -2554,10 +2936,10 @@ | |||
4351 | 2554 | # special treatment for pythia8 | 2936 | # special treatment for pythia8 |
4352 | 2555 | files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.cmd'), rundir) | 2937 | files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.cmd'), rundir) |
4353 | 2556 | files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.exe'), rundir) | 2938 | files.mv(pjoin(self.me_dir, 'MCatNLO', 'Pythia8.exe'), rundir) |
4355 | 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 |
4356 | 2558 | files.ln(pjoin(self.options['pythia8_path'], 'examples', 'config.sh'), rundir) | 2940 | files.ln(pjoin(self.options['pythia8_path'], 'examples', 'config.sh'), rundir) |
4357 | 2559 | files.ln(pjoin(self.options['pythia8_path'], 'xmldoc'), rundir) | 2941 | files.ln(pjoin(self.options['pythia8_path'], 'xmldoc'), rundir) |
4359 | 2560 | else: | 2942 | else: # this is PY8.2xxx |
4360 | 2561 | files.ln(pjoin(self.options['pythia8_path'], 'share/Pythia8/xmldoc'), rundir) | 2943 | files.ln(pjoin(self.options['pythia8_path'], 'share/Pythia8/xmldoc'), rundir) |
4361 | 2562 | #link the hwpp exe in the rundir | 2944 | #link the hwpp exe in the rundir |
4362 | 2563 | if shower == 'HERWIGPP': | 2945 | if shower == 'HERWIGPP': |
4363 | @@ -2987,8 +3369,8 @@ | |||
4364 | 2987 | init_dict = self.get_init_dict(evt_file) | 3369 | init_dict = self.get_init_dict(evt_file) |
4365 | 2988 | 3370 | ||
4366 | 2989 | if nevents < 0 or \ | 3371 | if nevents < 0 or \ |
4369 | 2990 | nevents > int(self.banner.get_detail('run_card', 'nevents')): | 3372 | nevents > self.banner.get_detail('run_card', 'nevents'): |
4370 | 2991 | nevents = int(self.banner.get_detail('run_card', 'nevents')) | 3373 | nevents = self.banner.get_detail('run_card', 'nevents') |
4371 | 2992 | 3374 | ||
4372 | 2993 | nevents = nevents / self.shower_card['nsplit_jobs'] | 3375 | nevents = nevents / self.shower_card['nsplit_jobs'] |
4373 | 2994 | 3376 | ||
4374 | @@ -3000,7 +3382,7 @@ | |||
4375 | 3000 | 3382 | ||
4376 | 3001 | content = 'EVPREFIX=%s\n' % pjoin(os.path.split(evt_file)[1]) | 3383 | content = 'EVPREFIX=%s\n' % pjoin(os.path.split(evt_file)[1]) |
4377 | 3002 | content += 'NEVENTS=%d\n' % nevents | 3384 | content += 'NEVENTS=%d\n' % nevents |
4379 | 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') /\ |
4380 | 3004 | self.shower_card['nsplit_jobs']) | 3386 | self.shower_card['nsplit_jobs']) |
4381 | 3005 | content += 'MCMODE=%s\n' % shower | 3387 | content += 'MCMODE=%s\n' % shower |
4382 | 3006 | content += 'PDLABEL=%s\n' % pdlabel | 3388 | content += 'PDLABEL=%s\n' % pdlabel |
4383 | @@ -3113,7 +3495,7 @@ | |||
4384 | 3113 | 3495 | ||
4385 | 3114 | 3496 | ||
4386 | 3115 | def run_reweight(self, only): | 3497 | def run_reweight(self, only): |
4388 | 3116 | """runs the reweight_xsec_events eecutables on each sub-event file generated | 3498 | """runs the reweight_xsec_events executables on each sub-event file generated |
4389 | 3117 | to compute on the fly scale and/or PDF uncertainities""" | 3499 | to compute on the fly scale and/or PDF uncertainities""" |
4390 | 3118 | logger.info(' Doing reweight') | 3500 | logger.info(' Doing reweight') |
4391 | 3119 | 3501 | ||
4392 | @@ -3231,7 +3613,7 @@ | |||
4393 | 3231 | scale_pdf_info['scale_low'] = 0.0 | 3613 | scale_pdf_info['scale_low'] = 0.0 |
4394 | 3232 | 3614 | ||
4395 | 3233 | # get the pdf uncertainty in percent (according to the Hessian method) | 3615 | # get the pdf uncertainty in percent (according to the Hessian method) |
4397 | 3234 | lhaid=int(self.run_card['lhaid']) | 3616 | lhaid=self.run_card['lhaid'] |
4398 | 3235 | pdf_upp=0.0 | 3617 | pdf_upp=0.0 |
4399 | 3236 | pdf_low=0.0 | 3618 | pdf_low=0.0 |
4400 | 3237 | if lhaid <= 90000: | 3619 | if lhaid <= 90000: |
4401 | @@ -3246,7 +3628,6 @@ | |||
4402 | 3246 | else: | 3628 | else: |
4403 | 3247 | scale_pdf_info['pdf_upp'] = 0.0 | 3629 | scale_pdf_info['pdf_upp'] = 0.0 |
4404 | 3248 | scale_pdf_info['pdf_low'] = 0.0 | 3630 | scale_pdf_info['pdf_low'] = 0.0 |
4405 | 3249 | |||
4406 | 3250 | else: | 3631 | else: |
4407 | 3251 | # use Gaussian method (NNPDF) | 3632 | # use Gaussian method (NNPDF) |
4408 | 3252 | pdf_stdev=0.0 | 3633 | pdf_stdev=0.0 |
4409 | @@ -3263,7 +3644,6 @@ | |||
4410 | 3263 | 3644 | ||
4411 | 3264 | def wait_for_complete(self, run_type): | 3645 | def wait_for_complete(self, run_type): |
4412 | 3265 | """this function waits for jobs on cluster to complete their run.""" | 3646 | """this function waits for jobs on cluster to complete their run.""" |
4413 | 3266 | |||
4414 | 3267 | starttime = time.time() | 3647 | starttime = time.time() |
4415 | 3268 | #logger.info(' Waiting for submitted jobs to complete') | 3648 | #logger.info(' Waiting for submitted jobs to complete') |
4416 | 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), |
4417 | @@ -3276,29 +3656,15 @@ | |||
4418 | 3276 | 3656 | ||
4419 | 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): |
4420 | 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""" |
4421 | 3279 | njob_split = 0 | ||
4422 | 3280 | self.ijob = 0 | 3659 | self.ijob = 0 |
4423 | 3281 | |||
4424 | 3282 | # this is to keep track, if splitting evt generation, of the various | ||
4425 | 3283 | # folders/args in order to resubmit the jobs if some of them fail | ||
4426 | 3284 | self.split_folders = {} | ||
4427 | 3285 | |||
4428 | 3286 | if run_type != 'shower': | 3660 | if run_type != 'shower': |
4429 | 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) |
4430 | 3288 | for args in arg_list: | 3662 | for args in arg_list: |
4431 | 3289 | for Pdir, jobs in job_dict.items(): | 3663 | for Pdir, jobs in job_dict.items(): |
4432 | 3290 | for job in jobs: | 3664 | for job in jobs: |
4440 | 3291 | if not split_jobs: | 3665 | self.run_exe(job, args, run_type, cwd=pjoin(self.me_dir, 'SubProcesses', Pdir) ) |
4434 | 3292 | self.run_exe(job, args, run_type, cwd=pjoin(self.me_dir, 'SubProcesses', Pdir) ) | ||
4435 | 3293 | else: | ||
4436 | 3294 | for n in self.find_jobs_to_split(Pdir, job, args[1]): | ||
4437 | 3295 | self.run_exe(job, args + [n], run_type, cwd=pjoin(self.me_dir, 'SubProcesses', Pdir) ) | ||
4438 | 3296 | njob_split += 1 | ||
4439 | 3297 | # print some statistics if running serially | ||
4441 | 3298 | if self.cluster_mode == 2: | 3666 | if self.cluster_mode == 2: |
4442 | 3299 | time.sleep(1) # security to allow all jobs to be launched | 3667 | time.sleep(1) # security to allow all jobs to be launched |
4443 | 3300 | if njob_split > 0: | ||
4444 | 3301 | self.njobs = njob_split | ||
4445 | 3302 | else: | 3668 | else: |
4446 | 3303 | self.njobs = len(arg_list) | 3669 | self.njobs = len(arg_list) |
4447 | 3304 | for args in arg_list: | 3670 | for args in arg_list: |
4448 | @@ -3309,37 +3675,27 @@ | |||
4449 | 3309 | 3675 | ||
4450 | 3310 | 3676 | ||
4451 | 3311 | 3677 | ||
4453 | 3312 | def check_event_files(self): | 3678 | def check_event_files(self,jobs): |
4454 | 3313 | """check the integrity of the event files after splitting, and resubmit | 3679 | """check the integrity of the event files after splitting, and resubmit |
4455 | 3314 | those which are not nicely terminated""" | 3680 | those which are not nicely terminated""" |
4458 | 3315 | to_resubmit = [] | 3681 | jobs_to_resubmit = [] |
4459 | 3316 | for dir in self.split_folders.keys(): | 3682 | for job in jobs: |
4460 | 3317 | last_line = '' | 3683 | last_line = '' |
4461 | 3318 | try: | 3684 | try: |
4462 | 3319 | last_line = subprocess.Popen( | 3685 | last_line = subprocess.Popen( |
4464 | 3320 | ['tail', '-n1', pjoin(dir, 'events.lhe')], \ | 3686 | ['tail', '-n1', pjoin(job['dirname'], 'events.lhe')], \ |
4465 | 3321 | stdout = subprocess.PIPE).stdout.read().strip() | 3687 | stdout = subprocess.PIPE).stdout.read().strip() |
4466 | 3322 | except IOError: | 3688 | except IOError: |
4467 | 3323 | pass | 3689 | pass |
4468 | 3324 | |||
4469 | 3325 | if last_line != "</LesHouchesEvents>": | 3690 | if last_line != "</LesHouchesEvents>": |
4472 | 3326 | to_resubmit.append(dir) | 3691 | jobs_to_resubmit.append(job) |
4471 | 3327 | |||
4473 | 3328 | self.njobs = 0 | 3692 | self.njobs = 0 |
4475 | 3329 | if to_resubmit: | 3693 | if jobs_to_resubmit: |
4476 | 3330 | run_type = 'Resubmitting broken jobs' | 3694 | run_type = 'Resubmitting broken jobs' |
4477 | 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.') |
4489 | 3332 | logger.debug('Resubmitting\n' + '\n'.join(to_resubmit) + '\n') | 3696 | for job in jobs_to_resubmit: |
4490 | 3333 | for dir in to_resubmit: | 3697 | logger.debug('Resubmitting ' + job['dirname'] + '\n') |
4491 | 3334 | files.rm([dir]) | 3698 | self.run_all_jobs(jobs_to_resubmit,2,fixed_order=False) |
4481 | 3335 | job = self.split_folders[dir][0] | ||
4482 | 3336 | args = self.split_folders[dir][1:] | ||
4483 | 3337 | run_type = 'monitor' | ||
4484 | 3338 | cwd = os.path.split(dir)[0] | ||
4485 | 3339 | self.run_exe(job, args, run_type, cwd=cwd ) | ||
4486 | 3340 | self.njobs +=1 | ||
4487 | 3341 | |||
4488 | 3342 | self.wait_for_complete(run_type) | ||
4492 | 3343 | 3699 | ||
4493 | 3344 | 3700 | ||
4494 | 3345 | def find_jobs_to_split(self, pdir, job, arg): | 3701 | def find_jobs_to_split(self, pdir, job, arg): |
4495 | @@ -3412,16 +3768,16 @@ | |||
4496 | 3412 | # the 'standard' amcatnlo job | 3768 | # the 'standard' amcatnlo job |
4497 | 3413 | # check if args is a list of string | 3769 | # check if args is a list of string |
4498 | 3414 | if type(args[0]) == str: | 3770 | if type(args[0]) == str: |
4500 | 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) |
4501 | 3416 | #submitting | 3772 | #submitting |
4502 | 3417 | self.cluster.submit2(exe, args, cwd=cwd, | 3773 | self.cluster.submit2(exe, args, cwd=cwd, |
4503 | 3418 | input_files=input_files, output_files=output_files, | 3774 | input_files=input_files, output_files=output_files, |
4504 | 3419 | required_output=required_output) | 3775 | required_output=required_output) |
4505 | 3420 | 3776 | ||
4510 | 3421 | # keep track of folders and arguments for splitted evt gen | 3777 | # # keep track of folders and arguments for splitted evt gen |
4511 | 3422 | subfolder=output_files[-1].split('/')[0] | 3778 | # subfolder=output_files[-1].split('/')[0] |
4512 | 3423 | if len(args) == 4 and '_' in subfolder: | 3779 | # if len(args) == 4 and '_' in subfolder: |
4513 | 3424 | self.split_folders[pjoin(cwd,subfolder)] = [exe] + args | 3780 | # self.split_folders[pjoin(cwd,subfolder)] = [exe] + args |
4514 | 3425 | 3781 | ||
4515 | 3426 | elif 'shower' in exe: | 3782 | elif 'shower' in exe: |
4516 | 3427 | # a shower job | 3783 | # a shower job |
4517 | @@ -3487,7 +3843,6 @@ | |||
4518 | 3487 | # use local disk if possible => need to stands what are the | 3843 | # use local disk if possible => need to stands what are the |
4519 | 3488 | # input/output files | 3844 | # input/output files |
4520 | 3489 | 3845 | ||
4521 | 3490 | keep_fourth_arg = False | ||
4522 | 3491 | output_files = [] | 3846 | output_files = [] |
4523 | 3492 | required_output = [] | 3847 | required_output = [] |
4524 | 3493 | input_files = [pjoin(self.me_dir, 'SubProcesses', 'randinit'), | 3848 | input_files = [pjoin(self.me_dir, 'SubProcesses', 'randinit'), |
4525 | @@ -3509,91 +3864,58 @@ | |||
4526 | 3509 | input_files.append(pjoin(cwd, 'OLE_order.olc')) | 3864 | input_files.append(pjoin(cwd, 'OLE_order.olc')) |
4527 | 3510 | 3865 | ||
4528 | 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) |
4530 | 3512 | if os.path.exists(pjoin(cwd,'MadLoop5_resources')) and \ | 3867 | if os.path.exists(pjoin(cwd,'MadLoop5_resources.tar.gz')) and \ |
4531 | 3513 | cluster.need_transfer(self.options): | 3868 | cluster.need_transfer(self.options): |
4532 | 3514 | input_files.append(pjoin(cwd, 'MadLoop5_resources.tar.gz')) | 3869 | input_files.append(pjoin(cwd, 'MadLoop5_resources.tar.gz')) |
4533 | 3870 | elif os.path.exists(pjoin(cwd,'MadLoop5_resources')) and \ | ||
4534 | 3871 | cluster.need_transfer(self.options): | ||
4535 | 3515 | tf=tarfile.open(pjoin(cwd,'MadLoop5_resources.tar.gz'),'w:gz', | 3872 | tf=tarfile.open(pjoin(cwd,'MadLoop5_resources.tar.gz'),'w:gz', |
4536 | 3516 | dereference=True) | 3873 | dereference=True) |
4537 | 3517 | tf.add(pjoin(cwd,'MadLoop5_resources'),arcname='MadLoop5_resources') | 3874 | tf.add(pjoin(cwd,'MadLoop5_resources'),arcname='MadLoop5_resources') |
4538 | 3518 | tf.close() | 3875 | tf.close() |
4548 | 3519 | 3876 | input_files.append(pjoin(cwd, 'MadLoop5_resources.tar.gz')) | |
4540 | 3520 | Ire = re.compile("for i in ([\d\s]*) ; do") | ||
4541 | 3521 | try : | ||
4542 | 3522 | fsock = open(exe) | ||
4543 | 3523 | except IOError: | ||
4544 | 3524 | fsock = open(pjoin(cwd,exe)) | ||
4545 | 3525 | text = fsock.read() | ||
4546 | 3526 | data = Ire.findall(text) | ||
4547 | 3527 | subdir = ' '.join(data).split() | ||
4549 | 3528 | 3877 | ||
4551 | 3529 | if args[0] == '0': | 3878 | if args[1] == 'born' or args[1] == 'all': |
4552 | 3530 | # MADEVENT MINT FO MODE | 3879 | # MADEVENT MINT FO MODE |
4553 | 3531 | input_files.append(pjoin(cwd, 'madevent_mintFO')) | 3880 | input_files.append(pjoin(cwd, 'madevent_mintFO')) |
4561 | 3532 | input_files.append(pjoin(self.me_dir, 'SubProcesses','madin.%s' % args[1])) | 3881 | if args[2] == '0': |
4562 | 3533 | #j=$2\_G$i | 3882 | current = '%s_G%s' % (args[1],args[0]) |
4563 | 3534 | for i in subdir: | 3883 | else: |
4564 | 3535 | current = '%s_G%s' % (args[1],i) | 3884 | current = '%s_G%s_%s' % (args[1],args[0],args[2]) |
4565 | 3536 | if os.path.exists(pjoin(cwd,current)): | 3885 | if os.path.exists(pjoin(cwd,current)): |
4566 | 3537 | input_files.append(pjoin(cwd, current)) | 3886 | input_files.append(pjoin(cwd, current)) |
4567 | 3538 | output_files.append(current) | 3887 | output_files.append(current) |
4568 | 3539 | 3888 | ||
4595 | 3540 | required_output.append('%s/results.dat' % current) | 3889 | required_output.append('%s/results.dat' % current) |
4596 | 3541 | required_output.append('%s/log.txt' % current) | 3890 | required_output.append('%s/res_%s.dat' % (current,args[3])) |
4597 | 3542 | required_output.append('%s/mint_grids' % current) | 3891 | required_output.append('%s/log_MINT%s.txt' % (current,args[3])) |
4598 | 3543 | required_output.append('%s/grid.MC_integer' % current) | 3892 | required_output.append('%s/mint_grids' % current) |
4599 | 3544 | if len(args) == 4: | 3893 | required_output.append('%s/grid.MC_integer' % current) |
4600 | 3545 | required_output.append('%s/scale_pdf_dependence.dat' % current) | 3894 | if args[3] != '0': |
4601 | 3546 | args[2] = '-1' | 3895 | required_output.append('%s/scale_pdf_dependence.dat' % current) |
4576 | 3547 | # use a grid train on another part | ||
4577 | 3548 | base = '%s_G%s' % (args[3],i) | ||
4578 | 3549 | if args[0] == '0': | ||
4579 | 3550 | to_move = ['grid.MC_integer','mint_grids'] | ||
4580 | 3551 | elif args[0] == '1': | ||
4581 | 3552 | to_move = ['mint_grids', 'grid.MC_integer'] | ||
4582 | 3553 | else: | ||
4583 | 3554 | to_move = [] | ||
4584 | 3555 | if self.run_card['iappl'] == 2: | ||
4585 | 3556 | for grid in glob.glob(pjoin(cwd,base,'grid_obs_*_in.root')): | ||
4586 | 3557 | to_move.append(grid) | ||
4587 | 3558 | if not os.path.exists(pjoin(cwd,current)): | ||
4588 | 3559 | os.mkdir(pjoin(cwd,current)) | ||
4589 | 3560 | input_files.append(pjoin(cwd, current)) | ||
4590 | 3561 | for name in to_move: | ||
4591 | 3562 | files.cp(pjoin(cwd,base, name), | ||
4592 | 3563 | pjoin(cwd,current)) | ||
4593 | 3564 | files.cp(pjoin(cwd,base, 'grid.MC_integer'), | ||
4594 | 3565 | pjoin(cwd,current)) | ||
4602 | 3566 | 3896 | ||
4604 | 3567 | elif args[0] == '2': | 3897 | elif args[1] == 'F' or args[1] == 'B': |
4605 | 3568 | # MINTMC MODE | 3898 | # MINTMC MODE |
4606 | 3569 | input_files.append(pjoin(cwd, 'madevent_mintMC')) | 3899 | input_files.append(pjoin(cwd, 'madevent_mintMC')) |
4634 | 3570 | if args[2] in ['0','2']: | 3900 | |
4635 | 3571 | input_files.append(pjoin(self.me_dir, 'SubProcesses','madinMMC_%s.2' % args[1])) | 3901 | if args[2] == '0': |
4636 | 3572 | 3902 | current = 'G%s%s' % (args[1],args[0]) | |
4637 | 3573 | for i in subdir: | 3903 | else: |
4638 | 3574 | current = 'G%s%s' % (args[1], i) | 3904 | current = 'G%s%s_%s' % (args[1],args[0],args[2]) |
4639 | 3575 | if os.path.exists(pjoin(cwd,current)): | 3905 | if os.path.exists(pjoin(cwd,current)): |
4640 | 3576 | input_files.append(pjoin(cwd, current)) | 3906 | input_files.append(pjoin(cwd, current)) |
4641 | 3577 | output_files.append(current) | 3907 | output_files.append(current) |
4642 | 3578 | if len(args) == 4 and args[3] in ['H','S','V','B','F']: | 3908 | if args[2] > '0': |
4643 | 3579 | # use a grid train on another part | 3909 | # this is for the split event generation |
4644 | 3580 | base = '%s_%s' % (args[3],i) | 3910 | output_files.append('G%s%s_%s' % (args[1], args[0], args[2])) |
4645 | 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])) |
4646 | 3582 | starting_dir=pjoin(cwd,current)) | 3912 | |
4647 | 3583 | files.ln(pjoin(cwd,base,'grid.MC_integer'), | 3913 | else: |
4648 | 3584 | starting_dir=pjoin(cwd,current)) | 3914 | required_output.append('%s/log_MINT%s.txt' % (current,args[3])) |
4649 | 3585 | elif len(args) ==4: | 3915 | if args[3] in ['0','1']: |
4650 | 3586 | keep_fourth_arg = True | 3916 | required_output.append('%s/results.dat' % current) |
4651 | 3587 | # this is for the split event generation | 3917 | if args[3] == '1': |
4652 | 3588 | output_files.append('G%s%s_%s' % (args[1], i, args[3])) | 3918 | output_files.append('%s/results.dat' % current) |
4626 | 3589 | required_output.append('G%s%s_%s/log_MINT%s.txt' % (args[1], i, args[3],args[2])) | ||
4627 | 3590 | |||
4628 | 3591 | else: | ||
4629 | 3592 | required_output.append('%s/log_MINT%s.txt' % (current,args[2])) | ||
4630 | 3593 | if args[2] in ['0','1']: | ||
4631 | 3594 | required_output.append('%s/results.dat' % current) | ||
4632 | 3595 | if args[2] == '1': | ||
4633 | 3596 | output_files.append('%s/results.dat' % current) | ||
4653 | 3597 | 3919 | ||
4654 | 3598 | else: | 3920 | else: |
4655 | 3599 | raise aMCatNLOError, 'not valid arguments: %s' %(', '.join(args)) | 3921 | raise aMCatNLOError, 'not valid arguments: %s' %(', '.join(args)) |
4656 | @@ -3601,73 +3923,9 @@ | |||
4657 | 3601 | #Find the correct PDF input file | 3923 | #Find the correct PDF input file |
4658 | 3602 | pdfinput = self.get_pdf_input_filename() | 3924 | pdfinput = self.get_pdf_input_filename() |
4659 | 3603 | if os.path.exists(pdfinput): | 3925 | if os.path.exists(pdfinput): |
4665 | 3604 | input_files.append(pdfinput) | 3926 | input_files.append(pdfinput) |
4661 | 3605 | |||
4662 | 3606 | if len(args) == 4 and not keep_fourth_arg: | ||
4663 | 3607 | args = args[:3] | ||
4664 | 3608 | |||
4666 | 3609 | return input_files, output_files, required_output, args | 3927 | return input_files, output_files, required_output, args |
4728 | 3610 | 3928 | ||
4668 | 3611 | def write_madinMMC_file(self, path, run_mode, mint_mode): | ||
4669 | 3612 | """writes the madinMMC_?.2 file""" | ||
4670 | 3613 | #check the validity of the arguments | ||
4671 | 3614 | run_modes = ['born', 'virt', 'novi', 'all', 'viSB', 'novB'] | ||
4672 | 3615 | if run_mode not in run_modes: | ||
4673 | 3616 | raise aMCatNLOError('%s is not a valid mode for run. Please use one of the following: %s' \ | ||
4674 | 3617 | % (run_mode, ', '.join(run_modes))) | ||
4675 | 3618 | mint_modes = [0, 1, 2] | ||
4676 | 3619 | if mint_mode not in mint_modes: | ||
4677 | 3620 | raise aMCatNLOError('%s is not a valid mode for mintMC. Please use one of the following: %s' \ | ||
4678 | 3621 | % (mint_mode, ', '.join(mint_modes))) | ||
4679 | 3622 | if run_mode in ['born']: | ||
4680 | 3623 | name_suffix = 'B' | ||
4681 | 3624 | elif run_mode in ['virt', 'viSB']: | ||
4682 | 3625 | name_suffix = 'V' | ||
4683 | 3626 | else: | ||
4684 | 3627 | name_suffix = 'F' | ||
4685 | 3628 | |||
4686 | 3629 | content = \ | ||
4687 | 3630 | """-1 12 ! points, iterations | ||
4688 | 3631 | 0.03 ! desired fractional accuracy | ||
4689 | 3632 | 1 -0.1 ! alpha, beta for Gsoft | ||
4690 | 3633 | -1 -0.1 ! alpha, beta for Gazi | ||
4691 | 3634 | 1 ! Suppress amplitude (0 no, 1 yes)? | ||
4692 | 3635 | 1 ! Exact helicity sum (0 yes, n = number/event)? | ||
4693 | 3636 | 1 ! Enter Configuration Number: | ||
4694 | 3637 | %1d ! MINT imode: 0 to set-up grids, 1 to perform integral, 2 generate events | ||
4695 | 3638 | 1 1 1 ! if imode is 1: Folding parameters for xi_i, phi_i and y_ij | ||
4696 | 3639 | %s ! all, born, real, virt | ||
4697 | 3640 | """ \ | ||
4698 | 3641 | % (mint_mode, run_mode) | ||
4699 | 3642 | file = open(pjoin(path, 'madinMMC_%s.2' % name_suffix), 'w') | ||
4700 | 3643 | file.write(content) | ||
4701 | 3644 | file.close() | ||
4702 | 3645 | |||
4703 | 3646 | def write_madin_file(self, path, run_mode, vegas_mode, npoints, niters, accuracy='0'): | ||
4704 | 3647 | """writes the madin.run_mode file""" | ||
4705 | 3648 | #check the validity of the arguments | ||
4706 | 3649 | run_modes = ['born', 'virt', 'novi', 'all', 'viSB', 'novB', 'grid'] | ||
4707 | 3650 | if run_mode not in run_modes: | ||
4708 | 3651 | raise aMCatNLOError('%s is not a valid mode for run. Please use one of the following: %s' \ | ||
4709 | 3652 | % (run_mode, ', '.join(run_modes))) | ||
4710 | 3653 | name_suffix = run_mode | ||
4711 | 3654 | |||
4712 | 3655 | content = \ | ||
4713 | 3656 | """%s %s ! points, iterations | ||
4714 | 3657 | %s ! accuracy | ||
4715 | 3658 | 2 ! 0 fixed grid 2 adjust | ||
4716 | 3659 | 1 ! 1 suppress amp, 0 doesnt | ||
4717 | 3660 | 1 ! 0 for exact hel sum | ||
4718 | 3661 | 1 ! hel configuration numb | ||
4719 | 3662 | 'test' | ||
4720 | 3663 | 1 ! 1 to save grids | ||
4721 | 3664 | %s ! 0 to exclude, 1 for new run, 2 to restart, 3 to reset w/ keeping grid | ||
4722 | 3665 | %s ! all, born, real, virt | ||
4723 | 3666 | """ \ | ||
4724 | 3667 | % (npoints,niters,accuracy,vegas_mode,run_mode) | ||
4725 | 3668 | file = open(pjoin(path, 'madin.%s' % name_suffix), 'w') | ||
4726 | 3669 | file.write(content) | ||
4727 | 3670 | file.close() | ||
4729 | 3671 | 3929 | ||
4730 | 3672 | def compile(self, mode, options): | 3930 | def compile(self, mode, options): |
4731 | 3673 | """compiles aMC@NLO to compute either NLO or NLO matched to shower, as | 3931 | """compiles aMC@NLO to compute either NLO or NLO matched to shower, as |
4732 | @@ -3730,10 +3988,10 @@ | |||
4733 | 3730 | 3988 | ||
4734 | 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]) |
4735 | 3732 | pdfsetsdir = self.get_lhapdf_pdfsetsdir() | 3990 | pdfsetsdir = self.get_lhapdf_pdfsetsdir() |
4737 | 3733 | lhaid_list = [int(self.run_card['lhaid'])] | 3991 | lhaid_list = [self.run_card['lhaid']] |
4738 | 3734 | if self.run_card['reweight_PDF']: | 3992 | if self.run_card['reweight_PDF']: |
4741 | 3735 | lhaid_list.append(int(self.run_card['PDF_set_min'])) | 3993 | lhaid_list.append(self.run_card['PDF_set_min']) |
4742 | 3736 | lhaid_list.append(int(self.run_card['PDF_set_max'])) | 3994 | lhaid_list.append(self.run_card['PDF_set_max']) |
4743 | 3737 | self.copy_lhapdf_set(lhaid_list, pdfsetsdir) | 3995 | self.copy_lhapdf_set(lhaid_list, pdfsetsdir) |
4744 | 3738 | 3996 | ||
4745 | 3739 | else: | 3997 | else: |
4746 | @@ -4045,18 +4303,23 @@ | |||
4747 | 4045 | void = 'NOT INSTALLED' | 4303 | void = 'NOT INSTALLED' |
4748 | 4046 | switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight'] | 4304 | switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight'] |
4749 | 4047 | switch_default = {'order': 'NLO', 'fixed_order': 'OFF', 'shower': void, | 4305 | switch_default = {'order': 'NLO', 'fixed_order': 'OFF', 'shower': void, |
4751 | 4048 | 'madspin': void} | 4306 | 'madspin': void,'reweight':'OFF'} |
4752 | 4049 | if not switch: | 4307 | if not switch: |
4753 | 4050 | switch = switch_default | 4308 | switch = switch_default |
4754 | 4051 | else: | 4309 | else: |
4755 | 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)) |
4756 | 4053 | |||
4757 | 4054 | default_switch = ['ON', 'OFF'] | 4311 | default_switch = ['ON', 'OFF'] |
4758 | 4312 | |||
4759 | 4313 | |||
4760 | 4055 | allowed_switch_value = {'order': ['LO', 'NLO'], | 4314 | allowed_switch_value = {'order': ['LO', 'NLO'], |
4761 | 4056 | 'fixed_order': default_switch, | 4315 | 'fixed_order': default_switch, |
4762 | 4057 | 'shower': default_switch, | 4316 | 'shower': default_switch, |
4763 | 4058 | 'madspin': default_switch, | 4317 | 'madspin': default_switch, |
4764 | 4059 | 'reweight': default_switch} | 4318 | 'reweight': default_switch} |
4765 | 4319 | |||
4766 | 4320 | |||
4767 | 4321 | |||
4768 | 4322 | |||
4769 | 4060 | 4323 | ||
4770 | 4061 | description = {'order': 'Perturbative order of the calculation:', | 4324 | description = {'order': 'Perturbative order of the calculation:', |
4771 | 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):', |
4772 | @@ -4072,22 +4335,35 @@ | |||
4773 | 4072 | special_values = ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] | 4335 | special_values = ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] |
4774 | 4073 | 4336 | ||
4775 | 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 ) |
4777 | 4075 | 4338 | ||
4778 | 4339 | if self.proc_characteristics['ninitial'] == 1: | ||
4779 | 4340 | switch['fixed_order'] = 'ON' | ||
4780 | 4341 | switch['shower'] = 'Not available for decay' | ||
4781 | 4342 | switch['madspin'] = 'Not available for decay' | ||
4782 | 4343 | switch['reweight'] = 'Not available for decay' | ||
4783 | 4344 | allowed_switch_value['fixed_order'] = ['ON'] | ||
4784 | 4345 | allowed_switch_value['shower'] = ['OFF'] | ||
4785 | 4346 | allowed_switch_value['madspin'] = ['OFF'] | ||
4786 | 4347 | allowed_switch_value['reweight'] = ['OFF'] | ||
4787 | 4348 | available_mode = ['0','1'] | ||
4788 | 4349 | special_values = ['LO', 'NLO'] | ||
4789 | 4350 | else: | ||
4790 | 4351 | # Init the switch value according to the current status | ||
4791 | 4352 | available_mode = ['0', '1', '2','3'] | ||
4792 | 4076 | 4353 | ||
4793 | 4077 | if mode == 'auto': | 4354 | if mode == 'auto': |
4794 | 4078 | mode = None | 4355 | mode = None |
4795 | 4079 | if not mode and (options['parton'] or options['reweightonly']): | 4356 | if not mode and (options['parton'] or options['reweightonly']): |
4796 | 4080 | mode = 'noshower' | 4357 | mode = 'noshower' |
4797 | 4081 | 4358 | ||
4805 | 4082 | # Init the switch value according to the current status | 4359 | |
4806 | 4083 | available_mode = ['0', '1', '2'] | 4360 | if '3' in available_mode: |
4807 | 4084 | available_mode.append('3') | 4361 | if os.path.exists(pjoin(self.me_dir, 'Cards', 'shower_card.dat')): |
4808 | 4085 | if os.path.exists(pjoin(self.me_dir, 'Cards', 'shower_card.dat')): | 4362 | switch['shower'] = 'ON' |
4809 | 4086 | switch['shower'] = 'ON' | 4363 | else: |
4810 | 4087 | else: | 4364 | switch['shower'] = 'OFF' |
4804 | 4088 | switch['shower'] = 'OFF' | ||
4811 | 4089 | 4365 | ||
4813 | 4090 | if not aMCatNLO or self.options['mg5_path']: | 4366 | if (not aMCatNLO or self.options['mg5_path']) and '3' in available_mode: |
4814 | 4091 | available_mode.append('4') | 4367 | available_mode.append('4') |
4815 | 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')): |
4816 | 4093 | switch['madspin'] = 'ON' | 4369 | switch['madspin'] = 'ON' |
4817 | @@ -4102,8 +4378,7 @@ | |||
4818 | 4102 | else: | 4378 | else: |
4819 | 4103 | switch['reweight'] = 'Not available (requires NumPy)' | 4379 | switch['reweight'] = 'Not available (requires NumPy)' |
4820 | 4104 | 4380 | ||
4823 | 4105 | 4381 | if 'do_reweight' in options and options['do_reweight'] and '3' in available_mode: | |
4822 | 4106 | if 'do_reweight' in options and options['do_reweight']: | ||
4824 | 4107 | if switch['reweight'] == "OFF": | 4382 | if switch['reweight'] == "OFF": |
4825 | 4108 | switch['reweight'] = "ON" | 4383 | switch['reweight'] = "ON" |
4826 | 4109 | elif switch['reweight'] != "ON": | 4384 | elif switch['reweight'] != "ON": |
4827 | @@ -4113,12 +4388,12 @@ | |||
4828 | 4113 | switch['madspin'] = 'ON' | 4388 | switch['madspin'] = 'ON' |
4829 | 4114 | elif switch['madspin'] != "ON": | 4389 | elif switch['madspin'] != "ON": |
4830 | 4115 | logger.critical("Cannot run MadSpin module: %s" % switch['reweight']) | 4390 | logger.critical("Cannot run MadSpin module: %s" % switch['reweight']) |
4833 | 4116 | 4391 | ||
4832 | 4117 | |||
4834 | 4118 | answers = list(available_mode) + ['auto', 'done'] | 4392 | answers = list(available_mode) + ['auto', 'done'] |
4835 | 4119 | alias = {} | 4393 | alias = {} |
4836 | 4120 | for id, key in enumerate(switch_order): | 4394 | for id, key in enumerate(switch_order): |
4838 | 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 \ |
4839 | 4396 | len(allowed_switch_value[key]) >1: | ||
4840 | 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]] |
4841 | 4123 | #allow lower case for on/off | 4398 | #allow lower case for on/off |
4842 | 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)) |
4843 | @@ -4149,7 +4424,7 @@ | |||
4844 | 4149 | elif answer in ['0', 'auto', 'done']: | 4424 | elif answer in ['0', 'auto', 'done']: |
4845 | 4150 | return | 4425 | return |
4846 | 4151 | elif answer in special_values: | 4426 | elif answer in special_values: |
4848 | 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') |
4849 | 4153 | #assign_switch('reweight', 'OFF') | 4428 | #assign_switch('reweight', 'OFF') |
4850 | 4154 | #assign_switch('madspin', 'OFF') | 4429 | #assign_switch('madspin', 'OFF') |
4851 | 4155 | if answer == 'LO': | 4430 | if answer == 'LO': |
4852 | @@ -4180,7 +4455,6 @@ | |||
4853 | 4180 | return | 4455 | return |
4854 | 4181 | return switch | 4456 | return switch |
4855 | 4182 | 4457 | ||
4856 | 4183 | |||
4857 | 4184 | modify_switch(mode, self.last_mode, switch) | 4458 | modify_switch(mode, self.last_mode, switch) |
4858 | 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')): |
4859 | 4186 | assign_switch('madspin', 'ON') | 4460 | assign_switch('madspin', 'ON') |
4860 | @@ -4272,9 +4546,9 @@ | |||
4861 | 4272 | if mode in ['LO','aMC@LO','noshowerLO']: | 4546 | if mode in ['LO','aMC@LO','noshowerLO']: |
4862 | 4273 | self.run_name += '_LO' | 4547 | self.run_name += '_LO' |
4863 | 4274 | self.set_run_name(self.run_name, self.run_tag, 'parton') | 4548 | self.set_run_name(self.run_name, self.run_tag, 'parton') |
4865 | 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']: |
4866 | 4276 | raise self.InvalidCmd("""FxFx merging (ickkw=3) not allowed at LO""") | 4550 | raise self.InvalidCmd("""FxFx merging (ickkw=3) not allowed at LO""") |
4868 | 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']: |
4869 | 4278 | logger.warning("""You are running with FxFx merging enabled. To be able to merge | 4552 | logger.warning("""You are running with FxFx merging enabled. To be able to merge |
4870 | 4279 | samples of various multiplicities without double counting, you | 4553 | samples of various multiplicities without double counting, you |
4871 | 4280 | have to remove some events after showering 'by hand'. Please | 4554 | have to remove some events after showering 'by hand'. Please |
4872 | @@ -4290,7 +4564,7 @@ | |||
4873 | 4290 | error = '''Stop opertation''' | 4564 | error = '''Stop opertation''' |
4874 | 4291 | self.ask_run_configuration(mode, options) | 4565 | self.ask_run_configuration(mode, options) |
4875 | 4292 | # raise aMCatNLOError(error) | 4566 | # raise aMCatNLOError(error) |
4877 | 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']: |
4878 | 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. |
4879 | 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.""") |
4880 | 4296 | if 'aMC@' in mode or mode == 'onlyshower': | 4570 | if 'aMC@' in mode or mode == 'onlyshower': |
4881 | 4297 | 4571 | ||
4882 | === modified file 'madgraph/interface/coloring_logging.py' (properties changed: -x to +x) | |||
4883 | === modified file 'madgraph/interface/common_run_interface.py' (properties changed: -x to +x) | |||
4884 | --- madgraph/interface/common_run_interface.py 2015-08-27 19:32:34 +0000 | |||
4885 | +++ madgraph/interface/common_run_interface.py 2015-10-25 15:32:18 +0000 | |||
4886 | @@ -221,19 +221,17 @@ | |||
4887 | 221 | #restrict_file = None | 221 | #restrict_file = None |
4888 | 222 | #if os.path.exists(pjoin(ufo_path, 'restrict_default.dat')): | 222 | #if os.path.exists(pjoin(ufo_path, 'restrict_default.dat')): |
4889 | 223 | # restrict_file = pjoin(ufo_path, 'restrict_default.dat') | 223 | # restrict_file = pjoin(ufo_path, 'restrict_default.dat') |
4890 | 224 | |||
4891 | 225 | force_CMS = self.mother and self.mother.options['complex_mass_scheme'] | ||
4892 | 224 | model = import_ufo.import_model(modelname, decay=True, | 226 | model = import_ufo.import_model(modelname, decay=True, |
4896 | 225 | restrict=True) | 227 | restrict=True, complex_mass_scheme=force_CMS) |
4894 | 226 | if self.mother and self.mother.options['complex_mass_scheme']: | ||
4895 | 227 | model.change_mass_to_complex_scheme() | ||
4897 | 228 | else: | 228 | else: |
4898 | 229 | model = import_ufo.import_model(pjoin( | ||
4899 | 230 | self.me_dir,'bin','internal', 'ufomodel'),decay=True) | ||
4900 | 231 | #pattern for checking complex mass scheme. | 229 | #pattern for checking complex mass scheme. |
4901 | 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|$|;)''') |
4906 | 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', |
4907 | 234 | ).read()): | 232 | 'proc_card_mg5.dat')).read()) |
4908 | 235 | model.change_mass_to_complex_scheme() | 233 | model = import_ufo.import_model(pjoin(self.me_dir,'bin','internal', |
4909 | 236 | 234 | 'ufomodel'), decay=True, complex_mass_scheme=force_CMS) | |
4910 | 237 | 235 | ||
4911 | 238 | # if not hasattr(model.get('particles')[0], 'partial_widths'): | 236 | # if not hasattr(model.get('particles')[0], 'partial_widths'): |
4912 | 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' |
4913 | @@ -508,6 +506,7 @@ | |||
4914 | 508 | options_madgraph= {'stdout_level':None} | 506 | options_madgraph= {'stdout_level':None} |
4915 | 509 | 507 | ||
4916 | 510 | options_madevent = {'automatic_html_opening':True, | 508 | options_madevent = {'automatic_html_opening':True, |
4917 | 509 | 'notification_center':True, | ||
4918 | 511 | 'run_mode':2, | 510 | 'run_mode':2, |
4919 | 512 | 'cluster_queue':'madgraph', | 511 | 'cluster_queue':'madgraph', |
4920 | 513 | 'cluster_time':None, | 512 | 'cluster_time':None, |
4921 | @@ -527,6 +526,8 @@ | |||
4922 | 527 | 526 | ||
4923 | 528 | self.me_dir = me_dir | 527 | self.me_dir = me_dir |
4924 | 529 | self.options = options | 528 | self.options = options |
4925 | 529 | |||
4926 | 530 | self.param_card_iterator = [] #an placeholder containing a generator of paramcard for scanning | ||
4927 | 530 | 531 | ||
4928 | 531 | # usefull shortcut | 532 | # usefull shortcut |
4929 | 532 | self.status = pjoin(self.me_dir, 'status') | 533 | self.status = pjoin(self.me_dir, 'status') |
4930 | @@ -658,7 +659,7 @@ | |||
4931 | 658 | 659 | ||
4932 | 659 | if amcatnlo and not keepwidth: | 660 | if amcatnlo and not keepwidth: |
4933 | 660 | # force particle in final states to have zero width | 661 | # force particle in final states to have zero width |
4935 | 661 | pids = self.get_pid_final_states() | 662 | pids = self.get_pid_final_initial_states() |
4936 | 662 | # check those which are charged under qcd | 663 | # check those which are charged under qcd |
4937 | 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: |
4938 | 664 | sys.path.insert(0,pjoin(self.me_dir,'bin','internal')) | 665 | sys.path.insert(0,pjoin(self.me_dir,'bin','internal')) |
4939 | @@ -780,11 +781,11 @@ | |||
4940 | 780 | if fulltext == '': | 781 | if fulltext == '': |
4941 | 781 | logger.warning('File %s is empty' % path) | 782 | logger.warning('File %s is empty' % path) |
4942 | 782 | return 'unknown' | 783 | return 'unknown' |
4944 | 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) |
4945 | 784 | text = [t.lower() for t in text] | 785 | text = [t.lower() for t in text] |
4946 | 785 | if '<mgversion>' in text or '<mg5proccard>' in text: | 786 | if '<mgversion>' in text or '<mg5proccard>' in text: |
4947 | 786 | return 'banner' | 787 | return 'banner' |
4949 | 787 | elif 'particlepropagator' in text: | 788 | elif 'particlepropagator' in text or 'executionpath' in text or 'treewriter' in text: |
4950 | 788 | return 'delphes_card.dat' | 789 | return 'delphes_card.dat' |
4951 | 789 | elif 'cen_max_tracker' in text: | 790 | elif 'cen_max_tracker' in text: |
4952 | 790 | return 'delphes_card.dat' | 791 | return 'delphes_card.dat' |
4953 | @@ -1351,8 +1352,8 @@ | |||
4954 | 1351 | self.update_status('delphes done', level='delphes', makehtml=False) | 1352 | self.update_status('delphes done', level='delphes', makehtml=False) |
4955 | 1352 | 1353 | ||
4956 | 1353 | ############################################################################ | 1354 | ############################################################################ |
4959 | 1354 | def get_pid_final_states(self): | 1355 | def get_pid_final_initial_states(self): |
4960 | 1355 | """Find the pid of all particles in the final states""" | 1356 | """Find the pid of all particles in the final and initial states""" |
4961 | 1356 | pids = set() | 1357 | pids = set() |
4962 | 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', |
4963 | 1358 | 'subproc.mg'))] | 1359 | 'subproc.mg'))] |
4964 | @@ -1363,7 +1364,7 @@ | |||
4965 | 1363 | group = pat.findall(text) | 1364 | group = pat.findall(text) |
4966 | 1364 | for particles in group: | 1365 | for particles in group: |
4967 | 1365 | particles = particles.split(',') | 1366 | particles = particles.split(',') |
4969 | 1366 | pids.update(set(particles[nb_init:])) | 1367 | pids.update(set(particles)) |
4970 | 1367 | 1368 | ||
4971 | 1368 | return pids | 1369 | return pids |
4972 | 1369 | 1370 | ||
4973 | @@ -1532,6 +1533,12 @@ | |||
4974 | 1532 | first, second = args[1:3] | 1533 | first, second = args[1:3] |
4975 | 1533 | 1534 | ||
4976 | 1534 | self.options[args[0]] = (int(first), int(second)) | 1535 | self.options[args[0]] = (int(first), int(second)) |
4977 | 1536 | elif args[0] == 'notification_center': | ||
4978 | 1537 | if args[1] in ['None','True','False']: | ||
4979 | 1538 | self.allow_notification_center = eval(args[1]) | ||
4980 | 1539 | self.options[args[0]] = eval(args[1]) | ||
4981 | 1540 | else: | ||
4982 | 1541 | raise self.InvalidCmd('Not a valid value for notification_center') | ||
4983 | 1535 | elif args[0] in self.options: | 1542 | elif args[0] in self.options: |
4984 | 1536 | if args[1] in ['None','True','False']: | 1543 | if args[1] in ['None','True','False']: |
4985 | 1537 | self.options[args[0]] = eval(args[1]) | 1544 | self.options[args[0]] = eval(args[1]) |
4986 | @@ -1594,12 +1601,29 @@ | |||
4987 | 1594 | 1601 | ||
4988 | 1595 | 1602 | ||
4989 | 1596 | def check_param_card(self, path, run=True): | 1603 | def check_param_card(self, path, run=True): |
4992 | 1597 | """Check that all the width are define in the param_card. | 1604 | """ |
4993 | 1598 | If some width are set on 'Auto', call the computation tools.""" | 1605 | 1) Check that no scan parameter are present |
4994 | 1606 | 2) Check that all the width are define in the param_card. | ||
4995 | 1607 | - If a scan parameter is define. create the iterator and recall this fonction | ||
4996 | 1608 | on the first element. | ||
4997 | 1609 | - If some width are set on 'Auto', call the computation tools.""" | ||
4998 | 1599 | 1610 | ||
5000 | 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) |
Hi Olivier,
yeah, it's definitely time.
There seems to be many text conflicts, though. Strange...
Cheers,
Rik