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

Proposed by Olivier Mattelaer
Status: Merged
Merged at revision: 288
Proposed branch: lp:~mg5core1/mg5amcnlo/2.7.3
Merge into: lp:mg5amcnlo/lts
Diff against target: 12761 lines (+4246/-1996)
162 files modified
MadSpin/decay.py (+11/-4)
MadSpin/interface_madspin.py (+29/-21)
Template/Common/Cards/madspin_card_default.dat (+1/-1)
Template/LO/Cards/run_card.dat (+2/-1)
Template/LO/Source/PDF/PhotonFlux.f (+2/-1)
Template/LO/Source/PDF/makefile (+7/-2)
Template/LO/Source/PDF/pdf_lhapdf62.cc (+1569/-0)
Template/LO/Source/dsample.f (+2/-2)
Template/LO/SubProcesses/cuts.f (+2/-2)
Template/LO/SubProcesses/genps.f (+13/-5)
Template/LO/SubProcesses/reweight.f (+6/-0)
Template/LO/SubProcesses/unwgt.f (+23/-11)
Template/LO/bin/internal/merge.pl (+2/-2)
Template/LO/bin/internal/restore_data (+13/-3)
Template/NLO/MCatNLO/include/LHEF.h (+1/-1)
Template/NLO/SubProcesses/cuts.f (+2/-2)
Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc (+41/-9)
UpdateNotes.txt (+19/-0)
VERSION (+2/-2)
aloha/create_aloha.py (+1/-1)
aloha/template_files/aloha_functions_loop.f (+2/-2)
bin/mg5_aMC (+9/-1)
madgraph/core/base_objects.py (+22/-9)
madgraph/core/diagram_generation.py (+3/-2)
madgraph/core/helas_objects.py (+12/-1)
madgraph/interface/amcatnlo_run_interface.py (+8/-2)
madgraph/interface/common_run_interface.py (+63/-15)
madgraph/interface/extended_cmd.py (+4/-0)
madgraph/interface/madevent_interface.py (+65/-24)
madgraph/interface/madgraph_interface.py (+36/-15)
madgraph/interface/master_interface.py (+2/-0)
madgraph/interface/reweight_interface.py (+99/-82)
madgraph/iolibs/export_v4.py (+58/-5)
madgraph/iolibs/file_writers.py (+16/-7)
madgraph/iolibs/template_files/madevent_symmetry.f (+1/-1)
madgraph/loop/loop_exporters.py (+40/-1)
madgraph/madevent/gen_crossxhtml.py (+3/-0)
madgraph/madevent/gen_ximprove.py (+18/-6)
madgraph/various/banner.py (+3/-4)
madgraph/various/lhe_parser.py (+13/-4)
madgraph/various/misc.py (+7/-4)
madgraph/various/process_checks.py (+1/-1)
models/model_reader.py (+5/-0)
tests/acceptance_tests/test_cmd_reweight.py (+20/-8)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f (+13/-12)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f (+2/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f (+4/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa_born_splitOrders.f (+2/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f (+49/-43)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f (+6/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f (+4/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%COLLIER_interface.f (+13/-12)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%CT_interface.f (+2/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f (+4/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%check_sa_born_splitOrders.f (+2/-2)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f (+49/-43)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f (+6/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f (+4/-4)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f (+12/-10)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f (+4/-4)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f (+56/-49)
tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f (+56/-49)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f (+42/-9)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%COLLIER_interface.f (+15/-14)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%CT_interface.f (+10/-10)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f (+10/-10)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%check_sa_born_splitOrders.f (+2/-2)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f (+56/-49)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_compute_loop_coefs.f (+12/-9)
tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%polynomial.f (+14/-12)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_QCDsq_le_6.f (+4/-4)
tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_ampOrderQED2_eq_2_WGTsq_le_14_QCDsq_gt_4.f (+4/-4)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%COLLIER_interface.f (+15/-14)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%CT_interface.f (+6/-6)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%born_matrix.f (+8/-8)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%check_sa_born_splitOrders.f (+2/-2)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f (+56/-49)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%mp_compute_loop_coefs.f (+12/-9)
tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%polynomial.f (+14/-12)
tests/input_files/IOTestsComparison/TestMadWeight/modification_to_cuts/cuts.f (+2/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%mp_input.inc (+5/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%mp_intparam_definition.inc (+6/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f (+15/-10)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_num.f (+6/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/mp_born_amps_and_wfs.f (+6/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%mp_couplings2.f (+6/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%mp_input.inc (+28/-27)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%mp_intparam_definition.inc (+12/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f (+15/-10)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_num.f (+6/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/mp_born_amps_and_wfs.f (+6/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%mp_input.inc (+5/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%mp_intparam_definition.inc (+6/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/CT_interface.f (+6/-6)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f (+56/-49)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/mp_compute_loop_coefs.f (+12/-9)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/polynomial.f (+14/-12)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%mp_couplings2.f (+6/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%mp_input.inc (+28/-27)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%mp_intparam_definition.inc (+12/-8)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/CT_interface.f (+14/-14)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_CT_calls_1.f (+2/-2)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f (+56/-49)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/mp_compute_loop_coefs.f (+12/-9)
tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/polynomial.f (+14/-12)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%mp_input.inc (+21/-20)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%mp_intparam_definition.inc (+6/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f (+15/-10)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_num.f (+6/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/mp_born_amps_and_wfs.f (+6/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f (+15/-10)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_num.f (+6/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/mp_born_amps_and_wfs.f (+6/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%mp_couplings2.f (+3/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%mp_input.inc (+18/-18)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%mp_intparam_definition.inc (+9/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f (+15/-10)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_num.f (+6/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/mp_born_amps_and_wfs.f (+6/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/CT_interface.f (+6/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f (+56/-49)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/mp_compute_loop_coefs.f (+12/-9)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/polynomial.f (+14/-12)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%model_functions.f (+8/-8)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%mp_couplings2.f (+3/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%mp_input.inc (+18/-18)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%mp_intparam_definition.inc (+9/-6)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/CT_interface.f (+10/-10)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/TIR_interface.f (+5/-4)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f (+2/-2)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f (+56/-49)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/mp_compute_loop_coefs.f (+12/-9)
tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/polynomial.f (+14/-12)
tests/parallel_tests/compare_with_old_mg5_version.py (+1/-1)
tests/time_db (+264/-263)
vendor/IREGI/src/mis_warp.f90 (+1/-1)
To merge this branch: bzr merge lp:~mg5core1/mg5amcnlo/2.7.3
Reviewer Review Type Date Requested Status
MadTeam Pending
Review via email: mp+385288@code.launchpad.net

Commit message

I think that this is time to merge this. (and then update one by one our four release with those fixes).

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

Wait... we have four different releases of our code? Shouldn't we try to get those in line? B.t.w., what's the 4th release: there is the 2.7.2, 3.0.1 and python3, right? Note that PY8meetsMG5aMC_release has not been released: that is still very much a development branch that is being made ready to be merged with 2.7.2 or 2.7.3.

Best,
Rikkert

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

The four versions are

2.7.2
2.7.2.py3
3.0.2
3.0.2.py3

I guess that we should soon be able to drop the non ".py3" branches (Remember that they do support python2.7, but that's a discussion for our meeting).

Cheers,

Olivier

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

Hi Olivier,
the py3 versions can be still run with python2?
If so, I agree we can drop the others (we should remember to upgrade all the various plugins to py3)…

Cheers,

Marco

> On 8 Jun 2020, at 18:03, Olivier Mattelaer <email address hidden> wrote:
>
> The four versions are
>
> 2.7.2
> 2.7.2.py3
> 3.0.2
> 3.0.2.py3
>
> I guess that we should soon be able to drop the non ".py3" branches (Remember that they do support python2.7, but that's a discussion for our meeting).
>
> Cheers,
>
> Olivier
> --
> https://code.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/+merge/385288
> Your team mg5core1 is subscribed to branch lp:~mg5core1/mg5amcnlo/2.7.3.

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

Yes,

the releases:
>> 2.7.2 and 3.02
can run with python 2.6 and 2.7

while
>> 2.7.2.py3 and 3.0.2.py3

can run with python 2.7, 3.7 and 3.8

Cheers,

Olivier

> On 8 Jun 2020, at 18:09, marco zaro <email address hidden> wrote:
>
> Hi Olivier,
> the py3 versions can be still run with python2?
> If so, I agree we can drop the others (we should remember to upgrade all the various plugins to py3)…
>
> Cheers,
>
> Marco
>
>> On 8 Jun 2020, at 18:03, Olivier Mattelaer <email address hidden> wrote:
>>
>> The four versions are
>>
>> 2.7.2
>> 2.7.2.py3
>> 3.0.2
>> 3.0.2.py3
>>
>> I guess that we should soon be able to drop the non ".py3" branches (Remember that they do support python2.7, but that's a discussion for our meeting).
>>
>> Cheers,
>>
>> Olivier
>> --
>> https://code.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/+merge/385288
>> Your team mg5core1 is subscribed to branch lp:~mg5core1/mg5amcnlo/2.7.3.
>
>
> --
> https://code.launchpad.net/~mg5core1/mg5amcnlo/2.7.3/+merge/385288
> Your team mg5core1 is subscribed to branch lp:~mg5core1/mg5amcnlo/2.7.3.

lp:~mg5core1/mg5amcnlo/2.7.3 updated
331. By olivier-mattelaer

fix numerical stability issue for T-channel

332. By olivier-mattelaer

add the install option for the MadSTR plugin

333. By olivier-mattelaer

allow new function for standalone f2py mode

334. By olivier-mattelaer

fix an issue with alphas runninng

335. By olivier-mattelaer

fix gcc version issue

336. By olivier-mattelaer

fix a bug introduce in the wrong merging of feature for increase numerical stability

337. By olivier-mattelaer

change default lhef version for merge.pl (from 1 to 3)

338. By olivier-mattelaer

change a comment referencing a wrong parameter

339. By olivier-mattelaer

add global_order_coupling option for MadSPin

340. By olivier-mattelaer

fix an issue for auto width when the path contains a equal sign

341. By olivier-mattelaer

merge with rwgt_fix to support multi-thread reweighting

342. By olivier-mattelaer

remove a debug raise Exception that should not have been committed

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

Hi Olivier,

I just learned that python 2.7 was released in July 2010 -- that's 10 years ago! I think it's okay to assume that users have upgraded from 2.6 to 2.7 (if they do not want to use 3.X).

Cheers,
Rikkert

lp:~mg5core1/mg5amcnlo/2.7.3 updated
343. By olivier-mattelaer

fix an issue for gridpack in readonly

344. By olivier-mattelaer

fixing a test for one-loop reweighting (change rwgt model without card now use default model param)

345. By olivier-mattelaer

1. Fixing some iotest (changing of the fortranwriter)
2. changing diagram filter function at LO
3. fixing some issue with re-weighting

346. By olivier-mattelaer

update tests

347. By olivier-mattelaer

update version/update note for release

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MadSpin/decay.py'
--- MadSpin/decay.py 2020-01-08 14:13:32 +0000
+++ MadSpin/decay.py 2020-06-21 12:17:46 +0000
@@ -544,7 +544,7 @@
544 # record the mass for the reshuffling phase, 544 # record the mass for the reshuffling phase,
545 # in case the point passes the reweighting creteria545 # in case the point passes the reweighting creteria
546 tree[tag]["mass"] = m546 tree[tag]["mass"] = m
547 #update the weigth of the phase-space point547 #update the weight of the phase-space point
548 weight=weight*jac548 weight=weight*jac
549 # for checking conservation of energy549 # for checking conservation of energy
550 mass_sum -= m550 mass_sum -= m
@@ -2749,7 +2749,7 @@
2749 for proc in processes:2749 for proc in processes:
2750 if not proc.strip().startswith(('add','generate')):2750 if not proc.strip().startswith(('add','generate')):
2751 proc = 'add process %s' % proc2751 proc = 'add process %s' % proc
2752 commandline += self.get_proc_with_decay(proc, decay_text, mgcmd._curr_model)2752 commandline += self.get_proc_with_decay(proc, decay_text, mgcmd._curr_model, self.options)
2753 2753
2754 commandline = commandline.replace('add process', 'generate',1)2754 commandline = commandline.replace('add process', 'generate',1)
2755 logger.info(commandline)2755 logger.info(commandline)
@@ -2835,7 +2835,7 @@
2835# assert decay.shell_string() in self.all_decay2835# assert decay.shell_string() in self.all_decay
2836 2836
2837 @staticmethod2837 @staticmethod
2838 def get_proc_with_decay(proc, decay_text, model):2838 def get_proc_with_decay(proc, decay_text, model, msoptions=None):
2839 2839
2840 commands = []2840 commands = []
2841 if '[' in proc:2841 if '[' in proc:
@@ -2880,6 +2880,13 @@
2880 else:2880 else:
2881 baseproc = new_proc2881 baseproc = new_proc
2882 proc_nb = '' 2882 proc_nb = ''
2883
2884 if msoptions and msoptions['global_order_coupling']:
2885 if '@' in proc_nb:
2886 proc_nb += " %s" % msoptions['global_order_coupling']
2887 else:
2888 proc_nb += " @0 %s" % msoptions['global_order_coupling']
2889
2883 nb_comma = baseproc.count(',')2890 nb_comma = baseproc.count(',')
2884 if nb_comma == 0:2891 if nb_comma == 0:
2885 commands.append("%s, %s %s %s" % (baseproc, decay_text, proc_nb, options))2892 commands.append("%s, %s %s %s" % (baseproc, decay_text, proc_nb, options))
@@ -3087,7 +3094,7 @@
3087 for production in self.all_ME.values():3094 for production in self.all_ME.values():
3088 decay_set.add(production['decaying'])3095 decay_set.add(production['decaying'])
30893096
3090 numberev = self.options['Nevents_for_max_weigth'] # number of events3097 numberev = self.options['Nevents_for_max_weight'] # number of events
3091 numberps = self.options['max_weight_ps_point'] # number of phase pace points per event3098 numberps = self.options['max_weight_ps_point'] # number of phase pace points per event
3092 3099
3093 logger.info(' ')3100 logger.info(' ')
30943101
=== modified file 'MadSpin/interface_madspin.py'
--- MadSpin/interface_madspin.py 2020-02-25 14:05:36 +0000
+++ MadSpin/interface_madspin.py 2020-06-21 12:17:46 +0000
@@ -60,14 +60,14 @@
6060
61 self.add_param("max_weight", -1)61 self.add_param("max_weight", -1)
62 self.add_param('curr_dir', os.path.realpath(os.getcwd()))62 self.add_param('curr_dir', os.path.realpath(os.getcwd()))
63 self.add_param('Nevents_for_max_weigth', 0)63 self.add_param('Nevents_for_max_weight', 0)
64 self.add_param("max_weight_ps_point", 400)64 self.add_param("max_weight_ps_point", 400)
65 self.add_param('BW_cut', -1)65 self.add_param('BW_cut', -1)
66 self.add_param('nb_sigma', 0.)66 self.add_param('nb_sigma', 0.)
67 self.add_param('ms_dir', '')67 self.add_param('ms_dir', '')
68 self.add_param('max_running_process', 100)68 self.add_param('max_running_process', 100)
69 self.add_param('onlyhelicity', False)69 self.add_param('onlyhelicity', False)
70 self.add_param('spinmode', "madspin", allowed=['madspin','none','onshell'])70 self.add_param('spinmode', "madspin", allowed=['full','madspin','none','onshell'])
71 self.add_param('use_old_dir', False, comment='should be use only for faster debugging')71 self.add_param('use_old_dir', False, comment='should be use only for faster debugging')
72 self.add_param('run_card', '' , comment='define cut for spinmode==none. Path to run_card to use')72 self.add_param('run_card', '' , comment='define cut for spinmode==none. Path to run_card to use')
73 self.add_param('fixed_order', False, comment='to activate fixed order handling of counter-event')73 self.add_param('fixed_order', False, comment='to activate fixed order handling of counter-event')
@@ -76,6 +76,7 @@
76 self.add_param('new_wgt', 'cross-section' ,allowed=['cross-section', 'BR'], comment="if not consistent number of particles, choose what to do for the weight. (BR: means local according to number of part, cross use the force cross-section")76 self.add_param('new_wgt', 'cross-section' ,allowed=['cross-section', 'BR'], comment="if not consistent number of particles, choose what to do for the weight. (BR: means local according to number of part, cross use the force cross-section")
77 self.add_param('input_format', 'auto', allowed=['auto','lhe', 'hepmc', 'lhe_no_banner'])77 self.add_param('input_format', 'auto', allowed=['auto','lhe', 'hepmc', 'lhe_no_banner'])
78 self.add_param('frame_id', 6)78 self.add_param('frame_id', 6)
79 self.add_param('global_order_coupling', '')
79 80
80 ############################################################################81 ############################################################################
81 ## Special post-processing of the options ## 82 ## Special post-processing of the options ##
@@ -137,8 +138,8 @@
137 138
138 self.decay = madspin.decay_misc()139 self.decay = madspin.decay_misc()
139 self.model = None140 self.model = None
140 self.mode = "madspin" # can be flat/bridge change the way the decay is done.141 #self.mode = "madspin" # can be flat/bridge change the way the decay is done.
141 # note amc@nlo does not support bridge.142 # # note amc@nlo does not support bridge.
142 143
143 self.options = MadSpinOptions()144 self.options = MadSpinOptions()
144 145
@@ -227,10 +228,10 @@
227 228
228 if 'mgruncard' in self.banner:229 if 'mgruncard' in self.banner:
229 run_card = self.banner.charge_card('run_card')230 run_card = self.banner.charge_card('run_card')
230 if not self.options['Nevents_for_max_weigth']:231 if not self.options['Nevents_for_max_weight']:
231 nevents = run_card['nevents']232 nevents = run_card['nevents']
232 N_weight = max([75, int(3*nevents**(1/3))])233 N_weight = max([75, int(3*nevents**(1/3))])
233 self.options['Nevents_for_max_weigth'] = N_weight234 self.options['Nevents_for_max_weight'] = N_weight
234 N_sigma = max(4.5, math.log(nevents,7.7))235 N_sigma = max(4.5, math.log(nevents,7.7))
235 self.options['nb_sigma'] = N_sigma236 self.options['nb_sigma'] = N_sigma
236 if self.options['BW_cut'] == -1:237 if self.options['BW_cut'] == -1:
@@ -242,8 +243,8 @@
242 else:243 else:
243 self.options['frame_id'] = 6244 self.options['frame_id'] = 6
244 else:245 else:
245 if not self.options['Nevents_for_max_weigth']:246 if not self.options['Nevents_for_max_weight']:
246 self.options['Nevents_for_max_weigth'] = 75247 self.options['Nevents_for_max_weight'] = 75
247 self.options['nb_sigma'] = 4.5248 self.options['nb_sigma'] = 4.5
248 if self.options['BW_cut'] == -1:249 if self.options['BW_cut'] == -1:
249 self.options['BW_cut'] = 15.0250 self.options['BW_cut'] = 15.0
@@ -314,7 +315,7 @@
314 key = line.split()[1]315 key = line.split()[1]
315 if key in self.multiparticles_ms:316 if key in self.multiparticles_ms:
316 del self.multiparticles_ms[key] 317 del self.multiparticles_ms[key]
317 elif line.startswith('set'):318 elif line.startswith('set') and not line.startswith('set gauge'):
318 self.mg5cmd.exec_cmd(line, printcmd=False, precmd=False, postcmd=False)319 self.mg5cmd.exec_cmd(line, printcmd=False, precmd=False, postcmd=False)
319 elif line.startswith('import model'):320 elif line.startswith('import model'):
320 if model_name in line:321 if model_name in line:
@@ -458,7 +459,7 @@
458 raise self.InvalidCmd('second argument should be a path to a existing directory')459 raise self.InvalidCmd('second argument should be a path to a existing directory')
459 460
460 elif args[0] == "spinmode":461 elif args[0] == "spinmode":
461 if args[1].lower() not in ["full", "onshell", "none"]:462 if args[1].lower() not in ["full", "onshell", "none", "madspin"]:
462 raise self.InvalidCmd("spinmode can only take one of those 3 value: full/onshell/none")463 raise self.InvalidCmd("spinmode can only take one of those 3 value: full/onshell/none")
463 464
464 elif args[0] == "run_card":465 elif args[0] == "run_card":
@@ -471,6 +472,8 @@
471 arg, value = data.split("=")472 arg, value = data.split("=")
472 args.append(arg)473 args.append(arg)
473 args.append(value)474 args.append(value)
475 elif args[0] == 'Nevents_for_max_weigth':
476 args[0] = 'Nevents_for_max_weight'
474 477
475 def do_set(self, line):478 def do_set(self, line):
476 """ add one of the options """479 """ add one of the options """
@@ -1204,7 +1207,6 @@
1204 run_card = self.run_card1207 run_card = self.run_card
1205 else:1208 else:
1206 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat")) 1209 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat"))
1207
1208 run_card["iseed"] = self.options['seed']1210 run_card["iseed"] = self.options['seed']
1209 run_card['gridpack'] = True1211 run_card['gridpack'] = True
1210 run_card['systematics_program'] = 'False'1212 run_card['systematics_program'] = 'False'
@@ -1213,6 +1215,7 @@
1213 param_card = self.banner['slha']1215 param_card = self.banner['slha']
1214 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)1216 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)
1215 self.options['seed'] += 11217 self.options['seed'] += 1
1218 self.seed = self.options['seed']
1216 # actually creation1219 # actually creation
1217 me5_cmd.exec_cmd("generate_events run_01 -f")1220 me5_cmd.exec_cmd("generate_events run_01 -f")
1218 if output_width:1221 if output_width:
@@ -1222,9 +1225,11 @@
1222 width *= me5_cmd.results.current['cross']1225 width *= me5_cmd.results.current['cross']
1223 me5_cmd.exec_cmd("exit") 1226 me5_cmd.exec_cmd("exit")
1224 #remove pointless informat1227 #remove pointless informat
1225 misc.call(["rm", "Cards", "bin", 'Source', 'SubProcesses'], cwd=decay_dir)1228 if not os.path.exists(pjoin(decay_dir, 'run.sh')):
1226 misc.call(['tar', '-xzpvf', 'run_01_gridpack.tar.gz'], cwd=decay_dir)1229 devnull = open('/dev/null','w')
1227 1230 misc.call(["rm", "Cards", "bin", 'Source', 'SubProcesses'], cwd=decay_dir,stdout=devnull, stderr=-2)
1231 misc.call(['tar', '-xzpvf', 'run_01_gridpack.tar.gz'], cwd=decay_dir,stdout=devnull, stderr=-2)
1232 devnull.close()
1228 # Now generate the events1233 # Now generate the events
1229 if not self.options['ms_dir']:1234 if not self.options['ms_dir']:
1230 if decay_dir in self.me_int:1235 if decay_dir in self.me_int:
@@ -1364,7 +1369,7 @@
13641369
13651370
1366 # 2. Generate the events requested1371 # 2. Generate the events requested
1367 nevents_for_max = self.options['Nevents_for_max_weigth']1372 nevents_for_max = self.options['Nevents_for_max_weight']
1368 if nevents_for_max == 0 :1373 if nevents_for_max == 0 :
1369 nevents_for_max = 751374 nevents_for_max = 75
1370 nevents_for_max *= self.options['max_weight_ps_point']1375 nevents_for_max *= self.options['max_weight_ps_point']
@@ -1460,8 +1465,8 @@
1460 production, counterevt= production[0], production[1:]1465 production, counterevt= production[0], production[1:]
1461 if curr_event and self.efficiency and curr_event % 10 == 0 and float(str(curr_event)[1:]) ==0:1466 if curr_event and self.efficiency and curr_event % 10 == 0 and float(str(curr_event)[1:]) ==0:
1462 logger.info("decaying event number %s. Efficiency: %s [%s s]" % (curr_event, 1/self.efficiency, time.time()-start))1467 logger.info("decaying event number %s. Efficiency: %s [%s s]" % (curr_event, 1/self.efficiency, time.time()-start))
1463 else:1468 #else:
1464 logger.info("next event [%s]", time.time()-start)1469 # logger.info("next event [%s]", time.time()-start)
1465 while 1:1470 while 1:
1466 nb_try +=11471 nb_try +=1
1467 decays = self.get_decay_from_file(production, evt_decayfile, nb_event-curr_event)1472 decays = self.get_decay_from_file(production, evt_decayfile, nb_event-curr_event)
@@ -1559,7 +1564,7 @@
1559 if self.options['ms_dir'] and os.path.exists(pjoin(self.options['ms_dir'], 'max_wgt')):1564 if self.options['ms_dir'] and os.path.exists(pjoin(self.options['ms_dir'], 'max_wgt')):
1560 return float(open(pjoin(self.options['ms_dir'], 'max_wgt'),'r').read())1565 return float(open(pjoin(self.options['ms_dir'], 'max_wgt'),'r').read())
1561 1566
1562 nevents = self.options['Nevents_for_max_weigth']1567 nevents = self.options['Nevents_for_max_weight']
1563 if nevents == 0 :1568 if nevents == 0 :
1564 nevents = 751569 nevents = 75
1565 1570
@@ -1700,7 +1705,7 @@
1700 decay_text.append('(%s)' % decay)1705 decay_text.append('(%s)' % decay)
1701 else:1706 else:
1702 decay_text.append(decay)1707 decay_text.append(decay)
1703 processes_decay.append(decay)1708 processes_decay.append(decay)
1704 decay_text = ', '.join(decay_text)1709 decay_text = ', '.join(decay_text)
1705 processes += []1710 processes += []
1706 1711
@@ -1715,12 +1720,15 @@
1715 except ValueError:1720 except ValueError:
1716 raise MadSpinError, 'MadSpin didn\'t allow order restriction after the @ comment: \"%s\" not valid' % proc_nb1721 raise MadSpinError, 'MadSpin didn\'t allow order restriction after the @ comment: \"%s\" not valid' % proc_nb
1717 proc_nb = '@ %i' % proc_nb 1722 proc_nb = '@ %i' % proc_nb
1723 if self.options['global_order_coupling']:
1724 proc_nb = '%s %s' % (proc_nb, self.options['global_order_coupling'])
1718 else:1725 else:
1719 proc_nb = '' 1726 if self.options['global_order_coupling']:
1727 proc_nb = '@0 %s ' % self.options['global_order_coupling']
1720 1728
1721 rwgt_interface.ReweightInterface.get_LO_definition_from_NLO() 1729 rwgt_interface.ReweightInterface.get_LO_definition_from_NLO()
1722 1730
17231731 raise Exception
17241732
1725if __name__ == '__main__':1733if __name__ == '__main__':
1726 1734
17271735
=== modified file 'Template/Common/Cards/madspin_card_default.dat'
--- Template/Common/Cards/madspin_card_default.dat 2017-01-13 09:56:03 +0000
+++ Template/Common/Cards/madspin_card_default.dat 2020-06-21 12:17:46 +0000
@@ -14,7 +14,7 @@
14#Some options (uncomment to apply)14#Some options (uncomment to apply)
15#15#
16# set seed 116# set seed 1
17# set Nevents_for_max_weigth 75 # number of events for the estimate of the max. weight17# set Nevents_for_max_weight 75 # number of events for the estimate of the max. weight
18# set BW_cut 15 # cut on how far the particle can be off-shell18# set BW_cut 15 # cut on how far the particle can be off-shell
19# set spinmode onshell # Use one of the madspin special mode19# set spinmode onshell # Use one of the madspin special mode
20 set max_weight_ps_point 400 # number of PS to estimate the maximum for each event20 set max_weight_ps_point 400 # number of PS to estimate the maximum for each event
2121
=== modified file 'Template/LO/Cards/run_card.dat'
--- Template/LO/Cards/run_card.dat 2020-01-10 20:02:44 +0000
+++ Template/LO/Cards/run_card.dat 2020-06-21 12:17:46 +0000
@@ -165,7 +165,8 @@
165 %(mmnl)s = mmnl ! min invariant mass for all letpons (l+- and vl) 165 %(mmnl)s = mmnl ! min invariant mass for all letpons (l+- and vl)
166 %(mmnlmax)s = mmnlmax ! max invariant mass for all letpons (l+- and vl) 166 %(mmnlmax)s = mmnlmax ! max invariant mass for all letpons (l+- and vl)
167#IF(LL)# #*********************************************************************167#IF(LL)# #*********************************************************************
168#IF(LL)# # Minimum and maximum pt for 4-momenta sum of leptons *168#IF(LL)# # Minimum and maximum pt for 4-momenta sum of leptons / neutrino *
169#IF(LL)# # for pair of lepton includes only same flavor, opposite charge
169#IF(LL)# #*********************************************************************170#IF(LL)# #*********************************************************************
170 %(ptllmin)s = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)171 %(ptllmin)s = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)
171 %(ptllmax)s = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)172 %(ptllmax)s = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)
172173
=== modified file 'Template/LO/Source/PDF/PhotonFlux.f'
--- Template/LO/Source/PDF/PhotonFlux.f 2019-12-04 21:34:25 +0000
+++ Template/LO/Source/PDF/PhotonFlux.f 2020-06-21 12:17:46 +0000
@@ -1,7 +1,8 @@
1c/* ********************************************************* */1c/* ********************************************************* */
2c/* Equivalent photon approximation structure function. * */2c/* Equivalent photon approximation structure function. * */
3c/* V.M.Budnev et al., Phys.Rep. 15C (1975) 181 * */
3c/* Improved Weizsaecker-Williams formula * */4c/* Improved Weizsaecker-Williams formula * */
4c/* V.M.Budnev et al., Phys.Rep. 15C (1975) 181 * */5c/* http://inspirehep.net/record/359425 * */
5c/* ********************************************************* */6c/* ********************************************************* */
6c provided by Tomasz Pierzchala - UCL7c provided by Tomasz Pierzchala - UCL
78
89
=== modified file 'Template/LO/Source/PDF/makefile'
--- Template/LO/Source/PDF/makefile 2018-01-26 23:06:46 +0000
+++ Template/LO/Source/PDF/makefile 2020-06-21 12:17:46 +0000
@@ -12,9 +12,14 @@
1212
13ifdef lhapdf13ifdef lhapdf
14 ifeq ($(lhapdfversion),5)14 ifeq ($(lhapdfversion),5)
15 PDF = pdfwrap_lhapdf.o pdf_lhapdf.o pdg2pdf_lhapdf.o opendata.o PhotonFlux.o15 $(error Bad lhadpfversion version 6 is now required)
16 else16 else
17 PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o17 ifeq ($(lhapdfsubversion),1) # 6.1.X
18 PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
19 else # 6.2.X
20 CXXFLAGS+=-std=c++11
21 PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
22 endif
18 endif23 endif
19else24else
20 PDF = Ctq6Pdf.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o25 PDF = Ctq6Pdf.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o
2126
=== added file 'Template/LO/Source/PDF/pdf_lhapdf62.cc'
--- Template/LO/Source/PDF/pdf_lhapdf62.cc 1970-01-01 00:00:00 +0000
+++ Template/LO/Source/PDF/pdf_lhapdf62.cc 2020-06-21 12:17:46 +0000
@@ -0,0 +1,1569 @@
1// -*- C++ -*-
2//
3// This file is part of LHAPDF
4// Copyright (C) 2012-2016 The LHAPDF collaboration (see AUTHORS for details)
5//
6#include "LHAPDF/PDF.h"
7#include "LHAPDF/PDFSet.h"
8#include "LHAPDF/PDFIndex.h"
9#include "LHAPDF/Factories.h"
10#include "LHAPDF/Utils.h"
11#include "LHAPDF/Paths.h"
12#include "LHAPDF/Version.h"
13#include "LHAPDF/LHAGlue.h"
14#include <cstring>
15
16using namespace std;
17
18
19// We have to create and initialise some common blocks here for backwards compatibility
20struct w50512 {
21 double qcdl4, qcdl5;
22};
23w50512 w50512_;
24
25struct w50513 {
26 double xmin, xmax, q2min, q2max;
27};
28w50513 w50513_;
29
30struct lhapdfr {
31 double qcdlha4, qcdlha5;
32 int nfllha;
33};
34lhapdfr lhapdfr_;
35
36
37
38namespace { //< Unnamed namespace to restrict visibility to this file
39
40
41 /// @brief PDF object storage here is a smart pointer to ensure deletion of created PDFs
42 typedef std::shared_ptr<LHAPDF::PDF> PDFPtr;
43
44
45 /// @brief A struct for handling the active PDFs for the Fortran interface.
46 ///
47 /// We operate in a string-based way, since maybe there will be sets with names, but no
48 /// index entry in pdfsets.index.
49 ///
50 /// @todo Can we avoid the strings and just work via the LHAPDF ID and factory construction?
51 ///
52 /// Smart pointers are used in the native map used for PDF member storage so
53 /// that they auto-delete if the PDFSetHandler that holds them goes out of
54 /// scope (i.e. is overwritten).
55 struct PDFSetHandler {
56
57 /// Default constructor
58 ///
59 /// It'll be stored in a map so we need one of these...
60 PDFSetHandler() : currentmem(0)
61 { }
62
63 /// Constructor from a PDF set name
64 ///
65 /// @note If the set name contains a member specification, i.e. myname/2,
66 /// that member rather than the central one will be initialised and made
67 /// current.
68 PDFSetHandler(const string& name) {
69 pair<string, int> set_mem = LHAPDF::lookupPDF(name);
70 // First check that the lookup was successful, i.e. it was a valid ID for the LHAPDF6 set collection
71 if (set_mem.first.empty() || set_mem.second < 0)
72 throw LHAPDF::UserError("Could not find a valid PDF with string = " + name);
73 // Try to load this PDF
74 setname = set_mem.first;
75 loadMember(set_mem.second);
76 }
77
78 /// Constructor from a PDF set's LHAPDF ID code
79 ///
80 /// @note The set member given by the ID (rather than the central one) will
81 /// be initialised and made current.
82 PDFSetHandler(int lhaid) {
83 pair<string,int> set_mem = LHAPDF::lookupPDF(lhaid);
84 // First check that the lookup was successful, i.e. it was a valid ID for the LHAPDF6 set collection
85 if (set_mem.first.empty() || set_mem.second < 0)
86 throw LHAPDF::UserError("Could not find a valid PDF with LHAPDF ID = " + LHAPDF::to_str(lhaid));
87 // Try to load this PDF
88 setname = set_mem.first;
89 loadMember(set_mem.second);
90 }
91
92 /// @brief Load a new PDF member, set it to be active
93 ///
94 /// If it's already loaded, the existing object will not be reloaded.
95 void loadMember(int mem) {
96 if (mem < 0)
97 throw LHAPDF::UserError("Tried to load a negative PDF member ID: " + LHAPDF::to_str(mem) + " in set " + setname);
98 if (members.find(mem) == members.end())
99 members[mem] = PDFPtr(LHAPDF::mkPDF(setname, mem));
100 currentmem = mem;
101 //return members[mem];
102 }
103
104 /// Actively delete a PDF member to save memory, set the active member to be the next available, or 0
105 void unloadMember(int mem) {
106 members.erase(mem);
107 const int nextmem = (!members.empty()) ? members.begin()->first : 0;
108 loadMember(nextmem);
109 }
110
111 /// @brief Get a PDF member, making it active
112 ///
113 /// Non-const because it can secretly load the member. Not that constness
114 /// matters in a Fortran interface utility function!
115 const PDFPtr member(int mem) {
116 loadMember(mem);
117 return members.find(mem)->second;
118 }
119
120 /// Get the currently active PDF member
121 ///
122 /// Non-const because it can secretly load the member. Not that constness
123 /// matters in a Fortran interface utility function!
124 const PDFPtr activeMember() {
125 return member(currentmem);
126 }
127
128 /// Get the currently active PDF member
129 ///
130 /// Non-const because it can secretly load the member. Not that constness
131 /// matters in a Fortran interface utility function!
132 void setActiveMember(int mem) {
133 loadMember(mem);
134 }
135
136 /// The currently active member in this set
137 int currentmem;
138
139 /// Name of this set
140 string setname;
141
142 /// Map of pointers to selected member PDFs
143 ///
144 // /// It's mutable so that a "const" member-getting operation can implicitly
145 // /// load a new PDF object. Good idea / bad idea? Disabled for now.
146 // mutable map<int, PDFPtr> members;
147 map<int, PDFPtr> members;
148 };
149
150
151 /// Collection of active sets
152 static map<int, PDFSetHandler> ACTIVESETS;
153
154 /// The currently active set
155 int CURRENTSET = 0;
156
157}
158
159
160
161string lhaglue_get_current_pdf(int nset) {
162 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
163 return "NONE";
164 CURRENTSET = nset;
165 return ACTIVESETS[nset].activeMember()->set().name() + " (" +
166 LHAPDF::to_str(ACTIVESETS[nset].activeMember()->lhapdfID()) + ")";
167}
168
169
170
171namespace {
172
173
174 /// C-string -> Fortran-string converter
175 ///
176 /// Credit: https://stackoverflow.com/questions/10163485/passing-char-arrays-from-c-to-fortran
177 void cstr_to_fstr(const char* cstring, char* fstring, std::size_t fstring_len) {
178 std::size_t inlen = std::strlen(cstring);
179 std::size_t cpylen = std::min(inlen, fstring_len);
180 // TODO: truncation error or warning
181 //if (inlen > fstring_len) FOOOOO();
182 std::copy(cstring, cstring+cpylen, fstring);
183 std::fill(fstring+cpylen, fstring+fstring_len, ' ');
184 }
185
186
187 /// C++-string -> Fortran-string converter
188 void ccstr_to_fstr(const string& ccstring, char* fstring, std::size_t fstring_len) {
189 const char* cstring = ccstring.c_str();
190 cstr_to_fstr(cstring, fstring, fstring_len);
191 }
192
193
194 /// Fortran-string -> C++-string converter
195 string fstr_to_ccstr(const char* fstring, const std::size_t fstring_len, bool spcpad=false) {
196 // Allocate space for an equivalent C-string (with an extra terminating null byte)
197 char* s = new char[fstring_len+1];
198 // Copy all characters and add the terminating null byte
199 strncpy(s, fstring, fstring_len);
200 s[fstring_len] = '\0';
201 // Replace all trailing spaces with null bytes unless explicitly stopped
202 if (!spcpad) {
203 for (int i = fstring_len-1; i >= 0; --i) {
204 if (s[i] != ' ') break;
205 s[i] = '\0';
206 }
207 }
208 string rtn(s); //< copy the result to a C++ string
209 delete[] s; //< clean up the dynamic array
210 return rtn;
211 }
212
213
214}
215
216
217extern "C" {
218
219
220 // NEW FORTRAN INTERFACE FUNCTIONS
221
222 /// Get the LHAPDF library version as a string
223 void lhapdf_getversion_(char* s, size_t len) {
224 cstr_to_fstr(LHAPDF_VERSION, s, len);
225 }
226
227
228 /// List of available PDF sets, returned as a space-separated string
229 void lhapdf_getpdfsetlist_(char* s, size_t len) {
230 string liststr;
231 for (const string& setname : LHAPDF::availablePDFSets()) {
232 if (!liststr.empty()) liststr += " ";
233 liststr += setname;
234 }
235 ccstr_to_fstr(liststr, s, len);
236 }
237
238
239 /// Get PDF data path (colon-separated if there is more than one element)
240 void lhapdf_getdatapath_(char* s, size_t len) {
241 string pathstr;
242 for (const string& path : LHAPDF::paths()) {
243 if (!pathstr.empty()) pathstr += ":";
244 pathstr += path;
245 }
246 ccstr_to_fstr(pathstr, s, len);
247 }
248
249 /// Set PDF data path(s)
250 void lhapdf_setdatapath_(const char* s, size_t len) {
251 LHAPDF::setPaths(fstr_to_ccstr(s, len));
252 }
253
254 /// Prepend to PDF data path
255 void lhapdf_prependdatapath_(const char* s, size_t len) {
256 LHAPDF::pathsPrepend(fstr_to_ccstr(s, len));
257 }
258
259 /// Append to PDF data path
260 void lhapdf_appenddatapath_(const char* s, size_t len) {
261 LHAPDF::pathsAppend(fstr_to_ccstr(s, len));
262 }
263
264
265 //------------------
266
267
268 void lhapdf_initpdfset_byname_(const int& nset, const char* name, int namelength) {
269 const string cname = fstr_to_ccstr(name, namelength);
270 ACTIVESETS[nset] = PDFSetHandler(cname);
271 CURRENTSET = nset;
272 }
273
274 void lhapdf_initpdfset_byid_(const int& nset, const int& lhaid) {
275 ACTIVESETS[nset] = PDFSetHandler(lhaid);
276 CURRENTSET = nset;
277 }
278
279 void lhapdf_delpdfset_(const int& nset) {
280 ACTIVESETS.erase(nset);
281 CURRENTSET = 0;
282 }
283
284 void lhapdf_delpdf_(const int& nset, const int& nmem) {
285 CURRENTSET = nset;
286 ACTIVESETS[CURRENTSET].unloadMember(nmem);
287 }
288
289
290 //------------------
291
292
293 void lhapdf_hasflavor(const int& nset, const int& nmem, const int& pid, int& rtn) {
294 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
295 throw LHAPDF::UserError("Trying to use set slot " + LHAPDF::to_str(nset) + " but it is not initialised");
296 rtn = ACTIVESETS[nset].member(nmem)->hasFlavor(pid) ? 1 : 0;
297 // Update current set focus
298 CURRENTSET = nset;
299 }
300
301
302 void lhapdf_xfxq2_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q2, double& xf) {
303 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
304 throw LHAPDF::UserError("Trying to use set slot " + LHAPDF::to_str(nset) + " but it is not initialised");
305 try {
306 xf = ACTIVESETS[nset].member(nmem)->xfxQ2(pid, x, q2);
307 } catch (const exception& e) {
308 xf = 0;
309 }
310 // Update current set focus
311 CURRENTSET = nset;
312 }
313
314 void lhapdf_xfxq_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q, double& xf) {
315 const double q2 = q*q;
316 lhapdf_xfxq2_(nset, nmem, pid, x, q2, xf);
317 }
318
319
320 void lhapdf_xfxq2_stdpartons_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q2, double* xfs) {
321 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
322 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
323 // Evaluate for the 13 LHAPDF5 standard partons (-6..6)
324 for (size_t i = 0; i < 13; ++i) {
325 try {
326 xfs[i] = ACTIVESETS[nset].member(nmem)->xfxQ2(i-6, x, q2);
327 } catch (const exception& e) {
328 xfs[i] = 0;
329 }
330 }
331 // Update current set focus
332 CURRENTSET = nset;
333 }
334
335 void lhapdf_xfxq_stdpartons_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q, double* xfs) {
336 const double q2 = q*q;
337 lhapdf_xfxq2_stdpartons_(nset, nmem, pid, x, q2, xfs);
338 }
339
340
341 //-----------------
342
343
344 /// Get the alpha_s order for the set
345 void lhapdf_getorderas_(const int& nset, const int& nmem, int& oas) {
346 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
347 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
348 oas = ACTIVESETS[nset].member(nmem)->info().get_entry_as<int>("AlphaS_OrderQCD");
349 // Update current set focus
350 CURRENTSET = nset;
351 }
352
353 /// Get the alpha_s(Q2) value for set nset
354 void lhapdf_alphasq2_(const int& nset, const int& nmem, const double& q2, double& alphas) {
355 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
356 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
357 alphas = ACTIVESETS[nset].member(nmem)->alphasQ2(q2);
358 // Update current set focus
359 CURRENTSET = nset;
360 }
361
362 /// Get the alpha_s(Q) value for set nset
363 /// @todo Return value rather than return arg? Can we do that elsewhere, too, e.g. single-value PDF xf functions?
364 void lhapdf_alphasq_(const int& nset, const int& nmem, const double& q, double& alphas) {
365 const double q2 = q*q;
366 lhapdf_alphasq2_(nset, nmem, q2, alphas);
367 }
368
369
370 // Metadata functions
371
372 // /// Get the number of error members in the set (with special treatment for single member sets)
373 // void numberpdfm_(const int& nset, int& numpdf) {
374 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
375 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
376 // // Set equal to the number of members for the requested set
377 // numpdf= ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumMembers");
378 // // Update current set focus
379 // CURRENTSET = nset;
380 // }
381
382 // /// Get the max number of active flavours
383 // void getnfm_(const int& nset, int& nf) {
384 // //nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_NumFlavors");
385 // nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumFlavors");
386 // // Update current set focus
387 // CURRENTSET = nset;
388 // }
389
390 // /// Get nf'th quark mass
391 // void getqmassm_(const int& nset, const int& nf, double& mass) {
392 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
393 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
394 // if (nf*nf == 1) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MDown");
395 // else if (nf*nf == 4) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MUp");
396 // else if (nf*nf == 9) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MStrange");
397 // else if (nf*nf == 16) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MCharm");
398 // else if (nf*nf == 25) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MBottom");
399 // else if (nf*nf == 36) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MTop");
400 // else throw LHAPDF::UserError("Trying to get quark mass for invalid quark ID #" + LHAPDF::to_str(nf));
401 // // Update current set focus
402 // CURRENTSET = nset;
403 // }
404
405 // /// Get the nf'th quark threshold
406 // void getthresholdm_(const int& nset, const int& nf, double& Q) {
407 // try {
408 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
409 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
410 // if (nf*nf == 1) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdDown");
411 // else if (nf*nf == 4) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdUp");
412 // else if (nf*nf == 9) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdStrange");
413 // else if (nf*nf == 16) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdCharm");
414 // else if (nf*nf == 25) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdBottom");
415 // else if (nf*nf == 36) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdTop");
416 // //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf));
417 // } catch (...) {
418 // getqmassm_(nset, nf, Q);
419 // }
420 // // Update current set focus
421 // CURRENTSET = nset;
422 // }
423
424 // void getxminm_(const int& nset, const int& nmem, double& xmin) {
425 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
426 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
427 // const int activemem = ACTIVESETS[nset].currentmem;
428 // ACTIVESETS[nset].loadMember(nmem);
429 // xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
430 // ACTIVESETS[nset].loadMember(activemem);
431 // // Update current set focus
432 // CURRENTSET = nset;
433 // }
434
435 // void getxmaxm_(const int& nset, const int& nmem, double& xmax) {
436 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
437 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
438 // const int activemem = ACTIVESETS[nset].currentmem;
439 // ACTIVESETS[nset].loadMember(nmem);
440 // xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
441 // ACTIVESETS[nset].loadMember(activemem);
442 // // Update current set focus
443 // CURRENTSET = nset;
444 // }
445
446 // void getq2minm_(const int& nset, const int& nmem, double& q2min) {
447 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
448 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
449 // const int activemem = ACTIVESETS[nset].currentmem;
450 // ACTIVESETS[nset].loadMember(nmem);
451 // q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
452 // ACTIVESETS[nset].loadMember(activemem);
453 // // Update current set focus
454 // CURRENTSET = nset;
455 // }
456
457 // void getq2maxm_(const int& nset, const int& nmem, double& q2max) {
458 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
459 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
460 // const int activemem = ACTIVESETS[nset].currentmem;
461 // ACTIVESETS[nset].loadMember(nmem);
462 // q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
463 // ACTIVESETS[nset].loadMember(activemem);
464 // // Update current set focus
465 // CURRENTSET = nset;
466 // }
467
468 // void getminmaxm_(const int& nset, const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) {
469 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
470 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
471 // const int activemem = ACTIVESETS[nset].currentmem;
472 // ACTIVESETS[nset].loadMember(nmem);
473 // xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
474 // xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
475 // q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
476 // q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
477 // ACTIVESETS[nset].loadMember(activemem);
478 // // Update current set focus
479 // CURRENTSET = nset;
480 // }
481
482
483 // /// Backwards compatibility functions for LHAPDF5 calculations of
484 // /// PDF uncertainties and PDF correlations (G. Watt, March 2014).
485
486 // // subroutine GetPDFUncTypeM(nset,lMonteCarlo,lSymmetric)
487 // void getpdfunctypem_(const int& nset, int& lmontecarlo, int& lsymmetric) {
488 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
489 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
490 // const string errorType = ACTIVESETS[nset].activeMember()->set().errorType();
491 // if (errorType == "replicas") { // Monte Carlo PDF sets
492 // lmontecarlo = 1;
493 // lsymmetric = 1;
494 // } else if (errorType == "symmhessian") { // symmetric eigenvector PDF sets
495 // lmontecarlo = 0;
496 // lsymmetric = 1;
497 // } else { // default: assume asymmetric Hessian eigenvector PDF sets
498 // lmontecarlo = 0;
499 // lsymmetric = 0;
500 // }
501 // // Update current set focus
502 // CURRENTSET = nset;
503 // }
504 // // subroutine GetPDFUncType(lMonteCarlo,lSymmetric)
505 // void getpdfunctype_(int& lmontecarlo, int& lsymmetric) {
506 // int nset1 = 1;
507 // getpdfunctypem_(nset1, lmontecarlo, lsymmetric);
508 // }
509
510
511 // // subroutine GetPDFuncertaintyM(nset,values,central,errplus,errminus,errsym)
512 // void getpdfuncertaintym_(const int& nset, const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
513 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
514 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
515 // const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
516 // const vector<double> vecvalues(values, values + nmem + 1);
517 // LHAPDF::PDFUncertainty err = ACTIVESETS[nset].activeMember()->set().uncertainty(vecvalues, -1);
518 // central = err.central;
519 // errplus = err.errplus;
520 // errminus = err.errminus;
521 // errsymm = err.errsymm;
522 // // Update current set focus
523 // CURRENTSET = nset;
524 // }
525 // // subroutine GetPDFuncertainty(values,central,errplus,errminus,errsym)
526 // void getpdfuncertainty_(const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
527 // int nset1 = 1;
528 // getpdfuncertaintym_(nset1, values, central, errplus, errminus, errsymm);
529 // }
530
531
532 // // subroutine GetPDFcorrelationM(nset,valuesA,valuesB,correlation)
533 // void getpdfcorrelationm_(const int& nset, const double* valuesA, const double* valuesB, double& correlation) {
534 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
535 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
536 // const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
537 // const vector<double> vecvaluesA(valuesA, valuesA + nmem + 1);
538 // const vector<double> vecvaluesB(valuesB, valuesB + nmem + 1);
539 // correlation = ACTIVESETS[nset].activeMember()->set().correlation(vecvaluesA,vecvaluesB);
540 // // Update current set focus
541 // CURRENTSET = nset;
542 // }
543 // // subroutine GetPDFcorrelation(valuesA,valuesB,correlation)
544 // void getpdfcorrelation_(const double* valuesA, const double* valuesB, double& correlation) {
545 // int nset1 = 1;
546 // getpdfcorrelationm_(nset1, valuesA, valuesB, correlation);
547 // }
548
549
550
551
552
553 //////////////////
554
555 // LHAPDF5 / PDFLIB COMPATIBILITY INTERFACE FUNCTIONS
556
557
558 // System-level info
559
560 /// LHAPDF library version
561 void getlhapdfversion_(char* s, size_t len) {
562 // strncpy(s, LHAPDF_VERSION, len);
563 cstr_to_fstr(LHAPDF_VERSION, s, len);
564 }
565
566
567 /// Does nothing, only provided for backward compatibility
568 void lhaprint_(int& a) { }
569
570
571 /// Set LHAPDF parameters
572 ///
573 /// @note Only the verbosity parameters have any effect: PDF behaviour is not
574 /// controlled globally in LHAPDF6.
575 void setlhaparm_(const char* par, int parlength) {
576 const string cpar = LHAPDF::to_upper(fstr_to_ccstr(par, parlength));
577 if (cpar == "NOSTAT" || cpar == "16") {
578 cerr << "WARNING: Fortran call to control LHAPDF statistics collection has no effect" << endl;
579 } else if (cpar == "LHAPDF" || cpar == "17") {
580 cerr << "WARNING: Fortran call to globally control alpha_s calculation has no effect" << endl;
581 } else if (cpar == "EXTRAPOLATE" || cpar == "18") {
582 cerr << "WARNING: Fortran call to globally control PDF extrapolation has no effect" << endl;
583 } else if (cpar == "SILENT" || cpar == "LOWKEY") {
584 LHAPDF::setVerbosity(0);
585 } else if (cpar == "19") {
586 LHAPDF::setVerbosity(1);
587 }
588 }
589 /// Get LHAPDF parameters -- does nothing in LHAPDF6!
590 void getlhaparm_(int dummy, char* par, int parlength) {
591 cstr_to_fstr("", par, parlength);
592 }
593
594
595 /// Return a dummy max number of sets (there is no limitation now)
596 void getmaxnumsets_(int& nmax) {
597 nmax = 1000;
598 }
599
600
601 /// Set PDF data path
602 void setpdfpath_(const char* s, size_t len) {
603 /// @todo Works? Need to check C-string copying, null termination
604 char s2[1024];
605 s2[len] = '\0';
606 strncpy(s2, s, len);
607 LHAPDF::pathsPrepend(s2);
608 }
609
610 /// Get PDF data path (colon-separated if there is more than one element)
611 void getdatapath_(char* s, size_t len) {
612 /// @todo Works? Need to check Fortran string return, string macro treatment, etc.
613 string pathstr;
614 for (const string& path : LHAPDF::paths()) {
615 if (!pathstr.empty()) pathstr += ":";
616 pathstr += path;
617 }
618 // strncpy(s, pathstr.c_str(), len);
619 cstr_to_fstr(pathstr.c_str(), s, len);
620 }
621
622
623 // PDF initialisation and focus-switching
624
625 /// Load a PDF set
626 ///
627 /// @todo Does this version actually take a *path*? What to do?
628 void initpdfsetm_(const int& nset, const char* setpath, int setpathlength) {
629 // Strip file extension for backward compatibility
630 string fullp = string(setpath, setpathlength);
631 // Remove trailing whitespace
632 fullp.erase( std::remove_if( fullp.begin(), fullp.end(), ::isspace ), fullp.end() );
633 // Use only items after the last /
634 const string pap = LHAPDF::dirname(fullp);
635 const string p = LHAPDF::basename(fullp);
636 // Prepend path to search area
637 LHAPDF::pathsPrepend(pap);
638 // Handle extensions
639 string path = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p);
640 /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case.
641 if (LHAPDF::to_lower(path) == "cteq6ll") path = "cteq6l1";
642 // Create the PDF set with index nset
643 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
644 if (path != ACTIVESETS[nset].setname)
645 ACTIVESETS[nset] = PDFSetHandler(path); ///< @todo Will be wrong if a structured path is given
646 CURRENTSET = nset;
647 }
648 /// Load a PDF set (non-multiset version)
649 void initpdfset_(const char* setpath, int setpathlength) {
650 int nset1 = 1;
651 initpdfsetm_(nset1, setpath, setpathlength);
652 }
653
654
655 /// Load a PDF set by name
656 void initpdfsetbynamem_(const int& nset, const char* setname, int setnamelength) {
657 // Truncate input to size setnamelength
658 string p = setname;
659 p.erase(setnamelength, std::string::npos);
660 // Strip file extension for backward compatibility
661 string name = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p);
662 // Remove trailing whitespace
663 name.erase( std::remove_if( name.begin(), name.end(), ::isspace ), name.end() );
664 /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case.
665 if (LHAPDF::to_lower(name) == "cteq6ll") name = "cteq6l1";
666 // Create the PDF set with index nset
667 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
668 if (name != ACTIVESETS[nset].setname)
669 ACTIVESETS[nset] = PDFSetHandler(name);
670 // Update current set focus
671 CURRENTSET = nset;
672 }
673 /// Load a PDF set by name (non-multiset version)
674 void initpdfsetbyname_(const char* setname, int setnamelength) {
675 int nset1 = 1;
676 initpdfsetbynamem_(nset1, setname, setnamelength);
677 }
678
679
680 /// Load a PDF in current set
681 void initpdfm_(const int& nset, const int& nmember) {
682 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
683 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
684 ACTIVESETS[nset].loadMember(nmember);
685 // Update current set focus
686 CURRENTSET = nset;
687 }
688 /// Load a PDF in current set (non-multiset version)
689 void initpdf_(const int& nmember) {
690 int nset1 = 1;
691 initpdfm_(nset1, nmember);
692 }
693
694
695 /// Get the current set number (i.e. allocation slot index)
696 void getnset_(int& nset) {
697 nset = CURRENTSET;
698 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
699 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
700 }
701
702 /// Explicitly set the current set number (i.e. allocation slot index)
703 void setnset_(const int& nset) {
704 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
705 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
706 CURRENTSET = nset;
707 }
708
709
710 /// Get the current member number in slot nset
711 void getnmem_(int& nset, int& nmem) {
712 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
713 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
714 nmem = ACTIVESETS[nset].currentmem;
715 // Update current set focus
716 CURRENTSET = nset;
717 }
718
719 /// Set the current member number in slot nset
720 void setnmem_(const int& nset, const int& nmem) {
721 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
722 throw LHAPDF::UserError("Trying to use LHAGLUE set #" +
723 LHAPDF::to_str(nset) + " but it is not initialised");
724 ACTIVESETS[nset].loadMember(nmem);
725 // Update current set focus
726 CURRENTSET = nset;
727 }
728
729
730
731 // PDF evolution functions
732
733 // NEW BY MZ to evolve one single parton
734
735 /// Get xf(x) values for common partons from current PDF
736 void evolvepartm_(const int& nset, const int& ipart, const double& x, const double& q, double& fxq) {
737 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
738 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
739 int ipart_copy; // this is to deal with photons, which are labeled 7 in MG5aMC
740 ipart_copy = ipart;
741 if (ipart==7) ipart_copy = 22;
742 try {
743 fxq = ACTIVESETS[nset].activeMember()->xfxQ(ipart_copy, x, q);
744 } catch (const exception& e) {
745 fxq = 0;
746 }
747 // Update current set focus
748 CURRENTSET = nset;
749 }
750 /// Get xf(x) values for common partons from current PDF (non-multiset version)
751 void evolvepart_( const int& ipart, const double& x, const double& q, double& fxq) {
752 int nset1 = 1;
753 evolvepartm_(nset1, ipart, x, q, fxq);
754 }
755
756 /// Get xf(x) values for common partons from current PDF
757 void evolvepdfm_(const int& nset, const double& x, const double& q, double* fxq) {
758 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
759 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
760 // Evaluate for the 13 LHAPDF5 standard partons (-6..6)
761 for (size_t i = 0; i < 13; ++i) {
762 try {
763 fxq[i] = ACTIVESETS[nset].activeMember()->xfxQ(i-6, x, q);
764 } catch (const exception& e) {
765 fxq[i] = 0;
766 }
767 }
768 // Update current set focus
769 CURRENTSET = nset;
770 }
771 /// Get xf(x) values for common partons from current PDF (non-multiset version)
772 void evolvepdf_(const double& x, const double& q, double* fxq) {
773 int nset1 = 1;
774 evolvepdfm_(nset1, x, q, fxq);
775 }
776
777
778 /// Determine if the current PDF has a photon flavour (historically only MRST2004QED)
779 /// @todo Function rather than subroutine?
780 /// @note There is no multiset version. has_photon will respect the current set slot.
781 bool has_photon_() {
782 return ACTIVESETS[CURRENTSET].activeMember()->hasFlavor(22);
783 }
784
785
786 /// Get xfx values from current PDF, including an extra photon flavour
787 void evolvepdfphotonm_(const int& nset, const double& x, const double& q, double* fxq, double& photonfxq) {
788 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
789 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
790 // First evaluate the "normal" partons
791 evolvepdfm_(nset, x, q, fxq);
792 // Then evaluate the photon flavor (historically only for MRST2004QED)
793 try {
794 photonfxq = ACTIVESETS[nset].activeMember()->xfxQ(22, x, q);
795 } catch (const exception& e) {
796 photonfxq = 0;
797 }
798 // Update current set focus
799 CURRENTSET = nset;
800 }
801 /// Get xfx values from current PDF, including an extra photon flavour (non-multiset version)
802 void evolvepdfphoton_(const double& x, const double& q, double* fxq, double& photonfxq) {
803 int nset1 = 1;
804 evolvepdfphotonm_(nset1, x, q, fxq, photonfxq);
805 }
806
807
808 /// Get xf(x) values for common partons from a photon PDF
809 void evolvepdfpm_(const int& nset, const double& x, const double& q, const double& p2, const int& ip2, double& fxq) {
810 // Update current set focus
811 CURRENTSET = nset;
812 throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported in LHAPDF6");
813 }
814 /// Get xf(x) values for common partons from a photon PDF (non-multiset version)
815 void evolvepdfp_(const double& x, const double& q, const double& p2, const int& ip2, double& fxq) {
816 int nset1 = 1;
817 evolvepdfpm_(nset1, x, q, p2, ip2, fxq);
818 }
819
820
821 // alpha_s evolution
822
823 /// Get the alpha_s order for the set
824 void getorderasm_(const int& nset, int& oas) {
825 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
826 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
827 // Set equal to the number of members for the requested set
828 oas = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_OrderQCD");
829 // Update current set focus
830 CURRENTSET = nset;
831 }
832 /// Get the alpha_s order for the set (non-multiset version)
833 void getorderas_(int& oas) {
834 int nset1 = 1;
835 getorderasm_(nset1, oas);
836 }
837
838
839 /// Get the alpha_s(Q) value for set nset
840 double alphaspdfm_(const int& nset, const double& Q){
841 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
842 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
843 return ACTIVESETS[nset].activeMember()->alphasQ(Q);
844 // Update current set focus
845 CURRENTSET = nset;
846 }
847 /// Get the alpha_s(Q) value for the set (non-multiset version)
848 double alphaspdf_(const double& Q){
849 int nset1 = 1;
850 return alphaspdfm_(nset1, Q);
851 }
852
853
854 // Metadata functions
855
856 /// Get the number of error members in the set
857 void numberpdfm_(const int& nset, int& numpdf) {
858 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
859 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
860 // Set equal to the number of members for the requested set
861 numpdf= ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumMembers");
862 // Reproduce old LHAPDF v5 behaviour, i.e. subtract 1
863 numpdf -= 1;
864 // Update current set focus
865 CURRENTSET = nset;
866 }
867 /// Get the number of error members in the set (non-multiset version)
868 void numberpdf_(int& numpdf) {
869 int nset1 = 1;
870 numberpdfm_(nset1, numpdf);
871 }
872
873
874 /// Get the max number of active flavours
875 void getnfm_(const int& nset, int& nf) {
876 //nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_NumFlavors");
877 nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumFlavors");
878 // Update current set focus
879 CURRENTSET = nset;
880 }
881 /// Get the max number of active flavours (non-multiset version)
882 void getnf_(int& nf) {
883 int nset1 = 1;
884 getnfm_(nset1, nf);
885 }
886
887
888 /// Get nf'th quark mass
889 void getqmassm_(const int& nset, const int& nf, double& mass) {
890 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
891 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
892 if (nf*nf == 1) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MDown");
893 else if (nf*nf == 4) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MUp");
894 else if (nf*nf == 9) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MStrange");
895 else if (nf*nf == 16) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MCharm");
896 else if (nf*nf == 25) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MBottom");
897 else if (nf*nf == 36) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MTop");
898 else throw LHAPDF::UserError("Trying to get quark mass for invalid quark ID #" + LHAPDF::to_str(nf));
899 // Update current set focus
900 CURRENTSET = nset;
901 }
902 /// Get nf'th quark mass (non-multiset version)
903 void getqmass_(const int& nf, double& mass) {
904 int nset1 = 1;
905 getqmassm_(nset1, nf, mass);
906 }
907
908
909 /// Get the nf'th quark threshold
910 void getthresholdm_(const int& nset, const int& nf, double& Q) {
911 try {
912 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
913 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
914 if (nf*nf == 1) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdDown");
915 else if (nf*nf == 4) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdUp");
916 else if (nf*nf == 9) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdStrange");
917 else if (nf*nf == 16) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdCharm");
918 else if (nf*nf == 25) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdBottom");
919 else if (nf*nf == 36) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdTop");
920 //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf));
921 } catch (...) {
922 getqmassm_(nset, nf, Q);
923 }
924 // Update current set focus
925 CURRENTSET = nset;
926 }
927 /// Get the nf'th quark threshold
928 void getthreshold_(const int& nf, double& Q) {
929 int nset1 = 1;
930 getthresholdm_(nset1, nf, Q);
931 }
932
933
934 /// Print PDF set's description to stdout
935 void getdescm_(const int& nset) {
936 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
937 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
938 cout << ACTIVESETS[nset].activeMember()->description() << endl;
939 // Update current set focus
940 CURRENTSET = nset;
941 }
942 void getdesc_() {
943 int nset1 = 1;
944 getdescm_(nset1);
945 }
946
947
948 void getxminm_(const int& nset, const int& nmem, double& xmin) {
949 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
950 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
951 const int activemem = ACTIVESETS[nset].currentmem;
952 ACTIVESETS[nset].loadMember(nmem);
953 xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
954 ACTIVESETS[nset].loadMember(activemem);
955 // Update current set focus
956 CURRENTSET = nset;
957 }
958 void getxmin_(const int& nmem, double& xmin) {
959 int nset1 = 1;
960 getxminm_(nset1, nmem, xmin);
961 }
962
963
964 void getxmaxm_(const int& nset, const int& nmem, double& xmax) {
965 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
966 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
967 const int activemem = ACTIVESETS[nset].currentmem;
968 ACTIVESETS[nset].loadMember(nmem);
969 xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
970 ACTIVESETS[nset].loadMember(activemem);
971 // Update current set focus
972 CURRENTSET = nset;
973 }
974 void getxmax_(const int& nmem, double& xmax) {
975 int nset1 = 1;
976 getxmaxm_(nset1, nmem, xmax);
977 }
978
979
980 void getq2minm_(const int& nset, const int& nmem, double& q2min) {
981 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
982 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
983 const int activemem = ACTIVESETS[nset].currentmem;
984 ACTIVESETS[nset].loadMember(nmem);
985 q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
986 ACTIVESETS[nset].loadMember(activemem);
987 // Update current set focus
988 CURRENTSET = nset;
989 }
990 void getq2min_(const int& nmem, double& q2min) {
991 int nset1 = 1;
992 getq2minm_(nset1, nmem, q2min);
993 }
994
995
996 void getq2maxm_(const int& nset, const int& nmem, double& q2max) {
997 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
998 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
999 const int activemem = ACTIVESETS[nset].currentmem;
1000 ACTIVESETS[nset].loadMember(nmem);
1001 q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
1002 ACTIVESETS[nset].loadMember(activemem);
1003 // Update current set focus
1004 CURRENTSET = nset;
1005 }
1006 void getq2max_(const int& nmem, double& q2max) {
1007 int nset1 = 1;
1008 getq2maxm_(nset1, nmem, q2max);
1009 }
1010
1011
1012 void getminmaxm_(const int& nset, const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) {
1013 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1014 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1015 const int activemem = ACTIVESETS[nset].currentmem;
1016 ACTIVESETS[nset].loadMember(nmem);
1017 xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
1018 xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
1019 q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
1020 q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
1021 ACTIVESETS[nset].loadMember(activemem);
1022 // Update current set focus
1023 CURRENTSET = nset;
1024 }
1025 void getminmax_(const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) {
1026 int nset1 = 1;
1027 getminmaxm_(nset1, nmem, xmin, xmax, q2min, q2max);
1028 }
1029
1030
1031
1032 void getlam4m_(const int& nset, const int& nmem, double& qcdl4) {
1033 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1034 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1035 CURRENTSET = nset;
1036 ACTIVESETS[nset].loadMember(nmem);
1037 qcdl4 = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda4", -1.0);
1038 }
1039 void getlam4_(const int& nmem, double& qcdl4) {
1040 int nset1 = 1;
1041 getlam4m_(nset1, nmem, qcdl4);
1042 }
1043
1044
1045 void getlam5m_(const int& nset, const int& nmem, double& qcdl5) {
1046 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1047 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1048 CURRENTSET = nset;
1049 ACTIVESETS[nset].loadMember(nmem);
1050 qcdl5 = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda5", -1.0);
1051 }
1052 void getlam5_(const int& nmem, double& qcdl5) {
1053 int nset1 = 1;
1054 getlam5m_(nset1, nmem, qcdl5);
1055 }
1056
1057
1058
1059
1060
1061 /// Backwards compatibility functions for LHAPDF5 calculations of
1062 /// PDF uncertainties and PDF correlations (G. Watt, March 2014).
1063
1064 // subroutine GetPDFUncTypeM(nset,lMonteCarlo,lSymmetric)
1065 void getpdfunctypem_(const int& nset, int& lmontecarlo, int& lsymmetric) {
1066 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1067 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1068 const string errorType = ACTIVESETS[nset].activeMember()->set().errorType();
1069 if (LHAPDF::startswith(errorType, "replicas")) { // Monte Carlo PDF sets
1070 lmontecarlo = 1;
1071 lsymmetric = 1;
1072 } else if (LHAPDF::startswith(errorType, "symmhessian")) { // symmetric eigenvector PDF sets
1073 lmontecarlo = 0;
1074 lsymmetric = 1;
1075 } else { // default: assume asymmetric Hessian eigenvector PDF sets
1076 lmontecarlo = 0;
1077 lsymmetric = 0;
1078 }
1079 // Update current set focus
1080 CURRENTSET = nset;
1081 }
1082 // subroutine GetPDFUncType(lMonteCarlo,lSymmetric)
1083 void getpdfunctype_(int& lmontecarlo, int& lsymmetric) {
1084 int nset1 = 1;
1085 getpdfunctypem_(nset1, lmontecarlo, lsymmetric);
1086 }
1087
1088
1089 // subroutine GetPDFuncertaintyM(nset,values,central,errplus,errminus,errsym)
1090 void getpdfuncertaintym_(const int& nset, const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
1091 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1092 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1093 const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
1094 const vector<double> vecvalues(values, values + nmem + 1);
1095 LHAPDF::PDFUncertainty err = ACTIVESETS[nset].activeMember()->set().uncertainty(vecvalues, -1);
1096 central = err.central;
1097 // For a combined set, the PDF and parameter variation uncertainties will be added in quadrature.
1098 errplus = err.errplus;
1099 errminus = err.errminus;
1100 errsymm = err.errsymm;
1101 // Update current set focus
1102 CURRENTSET = nset;
1103 }
1104 // subroutine GetPDFuncertainty(values,central,errplus,errminus,errsym)
1105 void getpdfuncertainty_(const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
1106 int nset1 = 1;
1107 getpdfuncertaintym_(nset1, values, central, errplus, errminus, errsymm);
1108 }
1109
1110
1111 // subroutine GetPDFcorrelationM(nset,valuesA,valuesB,correlation)
1112 void getpdfcorrelationm_(const int& nset, const double* valuesA, const double* valuesB, double& correlation) {
1113 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1114 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1115 const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
1116 const vector<double> vecvaluesA(valuesA, valuesA + nmem + 1);
1117 const vector<double> vecvaluesB(valuesB, valuesB + nmem + 1);
1118 correlation = ACTIVESETS[nset].activeMember()->set().correlation(vecvaluesA,vecvaluesB);
1119 // Update current set focus
1120 CURRENTSET = nset;
1121 }
1122 // subroutine GetPDFcorrelation(valuesA,valuesB,correlation)
1123 void getpdfcorrelation_(const double* valuesA, const double* valuesB, double& correlation) {
1124 int nset1 = 1;
1125 getpdfcorrelationm_(nset1, valuesA, valuesB, correlation);
1126 }
1127
1128
1129 ///////////////////////////////////////
1130
1131
1132 /// REALLY OLD PDFLIB COMPATIBILITY FUNCTIONS
1133
1134 /// PDFLIB initialisation function
1135 void pdfset_(const char* par, const double* value, int parlength) {
1136
1137 string my_par(par), message;
1138 int id;
1139 // Identify the calling program (yuck!)
1140 if (my_par.find("NPTYPE") != string::npos) {
1141 message = "==== LHAPDF6 USING PYTHIA-TYPE LHAGLUE INTERFACE ====";
1142 // Take PDF ID from value[2]
1143 id = value[2]+1000*value[1];
1144 } else if (my_par.find("HWLHAPDF") != string::npos) {
1145 message = "==== LHAPDF6 USING HERWIG-TYPE LHAGLUE INTERFACE ====";
1146 // Take PDF ID from value[0]
1147 id = value[0];
1148 } else if (my_par.find("DEFAULT") != string::npos) {
1149 message = "==== LHAPDF6 USING DEFAULT-TYPE LHAGLUE INTERFACE ====";
1150 // Take PDF ID from value[0]
1151 id = value[0];
1152 } else {
1153 message = "==== LHAPDF6 USING PDFLIB-TYPE LHAGLUE INTERFACE ====";
1154 // Take PDF ID from value[2]
1155 id = value[2]+1000*value[1];
1156 }
1157 pair<string, int> set_id = LHAPDF::lookupPDF(id);
1158 if (set_id.first != ACTIVESETS[1].setname || set_id.second != ACTIVESETS[1].currentmem) {
1159 if (LHAPDF::verbosity() > 0) cout << message << endl;
1160 ACTIVESETS[1] = PDFSetHandler(id);
1161 }
1162
1163 CURRENTSET = 1;
1164
1165 // Extract parameters for common blocks (with sensible fallback values)
1166 PDFPtr pdf = ACTIVESETS[1].activeMember();
1167 w50513_.xmin = pdf->info().get_entry_as<double>("XMin", 0.0);
1168 w50513_.xmax = pdf->info().get_entry_as<double>("XMax", 1.0);
1169 w50513_.q2min = LHAPDF::sqr(pdf->info().get_entry_as<double>("QMin", 1.0));
1170 w50513_.q2max = LHAPDF::sqr(pdf->info().get_entry_as<double>("QMax", 1.0e5));
1171 w50512_.qcdl4 = pdf->info().get_entry_as<double>("AlphaS_Lambda4", 0.0);
1172 w50512_.qcdl5 = pdf->info().get_entry_as<double>("AlphaS_Lambda5", 0.0);
1173 lhapdfr_.qcdlha4 = pdf->info().get_entry_as<double>("AlphaS_Lambda4", 0.0);
1174 lhapdfr_.qcdlha5 = pdf->info().get_entry_as<double>("AlphaS_Lambda5", 0.0);
1175 lhapdfr_.nfllha = 4;
1176 // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values
1177 if (pdf->info().get_entry_as<bool>("Pythia6LambdaV5Compat", true)) {
1178 w50512_.qcdl4 = 0.192;
1179 w50512_.qcdl5 = 0.192;
1180 lhapdfr_.qcdlha4 = 0.192;
1181 lhapdfr_.qcdlha5 = 0.192;
1182 }
1183 }
1184
1185 /// PDFLIB nucleon structure function querying
1186 void structm_(const double& x, const double& q,
1187 double& upv, double& dnv, double& usea, double& dsea,
1188 double& str, double& chm, double& bot, double& top, double& glu) {
1189 CURRENTSET = 1;
1190 /// Fill (partial) parton return variables
1191 PDFPtr pdf = ACTIVESETS[1].activeMember();
1192 dsea = pdf->xfxQ(-1, x, q);
1193 usea = pdf->xfxQ(-2, x, q);
1194 dnv = pdf->xfxQ(1, x, q) - dsea;
1195 upv = pdf->xfxQ(2, x, q) - usea;
1196 str = pdf->xfxQ(3, x, q);
1197 chm = (pdf->hasFlavor(4)) ? pdf->xfxQ(4, x, q) : 0;
1198 bot = (pdf->hasFlavor(5)) ? pdf->xfxQ(5, x, q) : 0;
1199 top = (pdf->hasFlavor(6)) ? pdf->xfxQ(6, x, q) : 0;
1200 glu = pdf->xfxQ(21, x, q);
1201 }
1202
1203 /// PDFLIB photon structure function querying
1204 void structp_(const double& x, const double& q2, const double& p2, const double& ip2,
1205 double& upv, double& dnv, double& usea, double& dsea,
1206 double& str, double& chm, double& bot, double& top, double& glu) {
1207 throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported");
1208 }
1209
1210 /// PDFLIB statistics on PDF under/overflows
1211 void pdfsta_() {
1212 /// @note Can't do anything...
1213 }
1214
1215
1216}
1217
1218
1219// LHAPDF namespace C++ compatibility code
1220#ifdef ENABLE_LHAGLUE_CXX
1221
1222
1223void LHAPDF::setVerbosity(LHAPDF::Verbosity noiselevel) {
1224 LHAPDF::setVerbosity((int) noiselevel);
1225}
1226
1227void LHAPDF::setPDFPath(const string& path) {
1228 pathsPrepend(path);
1229}
1230
1231string LHAPDF::pdfsetsPath() {
1232 return paths()[0];
1233}
1234
1235int LHAPDF::numberPDF() {
1236 int nmem;
1237 numberpdf_(nmem);
1238 return nmem;
1239}
1240int LHAPDF::numberPDF(int nset) {
1241 int nmem;
1242 numberpdfm_(nset,nmem);
1243 return nmem;
1244}
1245
1246void LHAPDF::initPDF( int memset) {
1247 int nset1 = 1;
1248 initpdfm_(nset1, memset);
1249}
1250void LHAPDF::initPDF(int nset, int memset) {
1251 initpdfm_(nset, memset);
1252}
1253
1254
1255double LHAPDF::xfx(double x, double Q, int fl) {
1256 vector<double> r(13);
1257 evolvepdf_(x, Q, &r[0]);
1258 return r[fl+6];
1259}
1260double LHAPDF::xfx(int nset, double x, double Q, int fl) {
1261 vector<double> r(13);
1262 evolvepdfm_(nset, x, Q, &r[0]);
1263 return r[fl+6];
1264}
1265
1266vector<double> LHAPDF::xfx(double x, double Q) {
1267 vector<double> r(13);
1268 evolvepdf_(x, Q, &r[0]);
1269 return r;
1270}
1271vector<double> LHAPDF::xfx(int nset, double x, double Q) {
1272 vector<double> r(13);
1273 evolvepdfm_(nset, x, Q, &r[0]);
1274 return r;
1275}
1276
1277void LHAPDF::xfx(double x, double Q, double* results) {
1278 evolvepdf_(x, Q, results);
1279}
1280void LHAPDF::xfx(int nset, double x, double Q, double* results) {
1281 evolvepdfm_(nset, x, Q, results);
1282}
1283
1284
1285vector<double> LHAPDF::xfxphoton(double x, double Q) {
1286 vector<double> r(13);
1287 double mphoton;
1288 evolvepdfphoton_(x, Q, &r[0], mphoton);
1289 r.push_back(mphoton);
1290 return r;
1291}
1292vector<double> LHAPDF::xfxphoton(int nset, double x, double Q) {
1293 vector<double> r(13);
1294 double mphoton;
1295 evolvepdfphotonm_(nset, x, Q, &r[0], mphoton);
1296 r.push_back(mphoton);
1297 return r;
1298}
1299
1300void LHAPDF::xfxphoton(double x, double Q, double* results) {
1301 evolvepdfphoton_(x, Q, results, results[13]);
1302}
1303void LHAPDF::xfxphoton(int nset, double x, double Q, double* results) {
1304 evolvepdfphotonm_(nset, x, Q, results, results[13]);
1305}
1306
1307double LHAPDF::xfxphoton(double x, double Q, int fl) {
1308 vector<double> r(13);
1309 double mphoton;
1310 evolvepdfphoton_(x, Q, &r[0], mphoton);
1311 if (fl == 7) return mphoton;
1312 return r[fl+6];
1313}
1314double LHAPDF::xfxphoton(int nset, double x, double Q, int fl) {
1315 vector<double> r(13);
1316 double mphoton;
1317 evolvepdfphotonm_(nset, x, Q, &r[0], mphoton);
1318 if ( fl == 7 ) return mphoton;
1319 return r[fl+6];
1320}
1321
1322
1323void LHAPDF::initPDFSet(const string& filename, int nmem) {
1324 initPDFSet(1,filename, nmem);
1325}
1326
1327void LHAPDF::initPDFSet(int nset, const string& filename, int nmem) {
1328 initPDFSetByName(nset,filename);
1329 ACTIVESETS[nset].loadMember(nmem);
1330 CURRENTSET = nset;
1331}
1332
1333
1334void LHAPDF::initPDFSet(const string& filename, SetType type, int nmem) {
1335 // silently ignore type
1336 initPDFSet(1,filename, nmem);
1337}
1338
1339void LHAPDF::initPDFSet(int nset, const string& filename, SetType type, int nmem) {
1340 // silently ignore type
1341 initPDFSetByName(nset,filename);
1342 ACTIVESETS[nset].loadMember(nmem);
1343 CURRENTSET = nset;
1344}
1345
1346void LHAPDF::initPDFSet(int nset, int setid, int nmem) {
1347 pair<string, int> set_id = LHAPDF::lookupPDF(setid+nmem);
1348 if (set_id.second != nmem)
1349 throw LHAPDF::UserError("Inconsistent member numbers: " + LHAPDF::to_str(set_id.second) + " != " + LHAPDF::to_str(nmem));
1350 if (set_id.first != ACTIVESETS[nset].setname || nmem != ACTIVESETS[nset].currentmem)
1351 ACTIVESETS[nset] = PDFSetHandler(setid+nmem);
1352 CURRENTSET = nset;
1353}
1354
1355void LHAPDF::initPDFSet(int setid, int nmem) {
1356 initPDFSet(1,setid,nmem);
1357}
1358
1359#define SIZE 999
1360void LHAPDF::initPDFSetByName(const string& filename) {
1361 std::cout << "initPDFSetByName: " << filename << std::endl;
1362 char cfilename[SIZE+1];
1363 strncpy(cfilename, filename.c_str(), SIZE);
1364 initpdfsetbyname_(cfilename, filename.length());
1365}
1366
1367void LHAPDF::initPDFSetByName(int nset, const string& filename) {
1368 char cfilename[SIZE+1];
1369 strncpy(cfilename, filename.c_str(), SIZE);
1370 initpdfsetbynamem_(nset, cfilename, filename.length());
1371}
1372
1373void LHAPDF::initPDFSetByName(const string& filename, SetType type) {
1374 //silently ignore type
1375 std::cout << "initPDFSetByName: " << filename << std::endl;
1376 char cfilename[SIZE+1];
1377 strncpy(cfilename, filename.c_str(), SIZE);
1378 initpdfsetbyname_(cfilename, filename.length());
1379}
1380
1381void LHAPDF::initPDFSetByName(int nset, const string& filename, SetType type) {
1382 //silently ignore type
1383 char cfilename[SIZE+1];
1384 strncpy(cfilename, filename.c_str(), SIZE);
1385 initpdfsetbynamem_(nset, cfilename, filename.length());
1386}
1387
1388
1389void LHAPDF::getDescription() {
1390 getDescription(1);
1391}
1392
1393void LHAPDF::getDescription(int nset) {
1394 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1395 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1396 cout << ACTIVESETS[nset].activeMember()->set().description() << endl;
1397}
1398
1399
1400double LHAPDF::alphasPDF(double Q) {
1401 return LHAPDF::alphasPDF(1, Q) ;
1402}
1403
1404double LHAPDF::alphasPDF(int nset, double Q) {
1405 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1406 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1407 CURRENTSET = nset;
1408 // return alphaS for the requested set
1409 return ACTIVESETS[nset].activeMember()->alphasQ(Q);
1410}
1411
1412
1413bool LHAPDF::hasPhoton(){
1414 return has_photon_();
1415}
1416
1417
1418int LHAPDF::getOrderAlphaS() {
1419 return LHAPDF::getOrderAlphaS(1) ;
1420}
1421
1422int LHAPDF::getOrderAlphaS(int nset) {
1423 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1424 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1425 CURRENTSET = nset;
1426 // return alphaS Order for the requested set
1427 return ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_OrderQCD", -1);
1428}
1429
1430
1431int LHAPDF::getOrderPDF() {
1432 return LHAPDF::getOrderPDF(1) ;
1433}
1434
1435int LHAPDF::getOrderPDF(int nset) {
1436 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1437 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1438 CURRENTSET = nset;
1439 // return PDF order for the requested set
1440 return ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("OrderQCD", -1);
1441}
1442
1443
1444double LHAPDF::getLam4(int nmem) {
1445 return LHAPDF::getLam4(1, nmem) ;
1446}
1447
1448double LHAPDF::getLam4(int nset, int nmem) {
1449 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1450 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1451 // CURRENTSET = nset;
1452 // ACTIVESETS[nset].loadMember(nmem);
1453 // return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda4", -1.0);
1454 double qcdl4;
1455 getlam4m_(nset, nmem, qcdl4);
1456 return qcdl4;
1457}
1458
1459
1460double LHAPDF::getLam5(int nmem) {
1461 return LHAPDF::getLam5(1, nmem) ;
1462}
1463
1464double LHAPDF::getLam5(int nset, int nmem) {
1465 // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1466 // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1467 // CURRENTSET = nset;
1468 // ACTIVESETS[nset].loadMember(nmem);
1469 // return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda5", -1.0);
1470 double qcdl5;
1471 getlam5m_(nset, nmem, qcdl5);
1472 return qcdl5;
1473}
1474
1475
1476int LHAPDF::getNf() {
1477 return LHAPDF::getNf(1) ;
1478}
1479
1480int LHAPDF::getNf(int nset) {
1481 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1482 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1483 CURRENTSET = nset;
1484 // return alphaS Order for the requested set
1485 return ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumFlavors");
1486}
1487
1488
1489double LHAPDF::getXmin(int nmem) {
1490 return LHAPDF::getXmin(1, nmem) ;
1491}
1492
1493double LHAPDF::getXmin(int nset, int nmem) {
1494 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1495 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1496 CURRENTSET = nset;
1497 // return alphaS Order for the requested set
1498 ACTIVESETS[nset].loadMember(nmem);
1499 return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
1500}
1501
1502double LHAPDF::getXmax(int nmem) {
1503 return LHAPDF::getXmax(1, nmem) ;
1504}
1505
1506double LHAPDF::getXmax(int nset, int nmem) {
1507 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1508 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1509 CURRENTSET = nset;
1510 // return alphaS Order for the requested set
1511 ACTIVESETS[nset].loadMember(nmem);
1512 return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
1513}
1514
1515double LHAPDF::getQ2min(int nmem) {
1516 return LHAPDF::getQ2min(1, nmem) ;
1517}
1518
1519double LHAPDF::getQ2min(int nset, int nmem) {
1520 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1521 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1522 CURRENTSET = nset;
1523 // return alphaS Order for the requested set
1524 ACTIVESETS[nset].loadMember(nmem);
1525 return pow(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"),2);
1526}
1527
1528double LHAPDF::getQ2max(int nmem) {
1529 return LHAPDF::getQ2max(1,nmem) ;
1530}
1531
1532double LHAPDF::getQ2max(int nset, int nmem) {
1533 if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1534 throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1535 CURRENTSET = nset;
1536 // return alphaS Order for the requested set
1537 ACTIVESETS[nset].loadMember(nmem);
1538 return pow(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"),2);
1539}
1540
1541double LHAPDF::getQMass(int nf) {
1542 return LHAPDF::getQMass(1, nf) ;
1543}
1544
1545double LHAPDF::getQMass(int nset, int nf) {
1546 double mass;
1547 getqmassm_(nset, nf, mass);
1548 return mass;
1549}
1550
1551double LHAPDF::getThreshold(int nf) {
1552 return LHAPDF::getThreshold(1, nf) ;
1553}
1554
1555double LHAPDF::getThreshold(int nset, int nf) {
1556 double thres;
1557 getthresholdm_(nset, nf, thres);
1558 return thres;
1559}
1560
1561void LHAPDF::usePDFMember(int member) {
1562 initpdf_(member);
1563}
1564
1565void LHAPDF::usePDFMember(int nset, int member) {
1566 initpdfm_(nset, member);
1567}
1568
1569#endif // ENABLE_LHAGLUE_CXX
01570
=== modified file 'Template/LO/Source/dsample.f'
--- Template/LO/Source/dsample.f 2020-01-20 14:53:46 +0000
+++ Template/LO/Source/dsample.f 2020-06-21 12:17:46 +0000
@@ -141,7 +141,7 @@
141 fx =0d0141 fx =0d0
142 wgt=0d0142 wgt=0d0
143 endif143 endif
144 call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result144 call sample_put_point(wgt,x(1),iter,ipole) !Store result
145 endif145 endif
146 if (wgt .ne. 0d0) kevent=kevent+1 146 if (wgt .ne. 0d0) kevent=kevent+1
147c147c
@@ -318,7 +318,7 @@
318 endif318 endif
319 319
320 if (nzoom .le. 0) then320 if (nzoom .le. 0) then
321 call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result321 call sample_put_point(wgt,x(1),iter,ipole) !Store result
322 else322 else
323 nzoom = nzoom -1323 nzoom = nzoom -1
324 ievent=ievent-1324 ievent=ievent-1
325325
=== modified file 'Template/LO/SubProcesses/cuts.f'
--- Template/LO/SubProcesses/cuts.f 2019-07-30 13:51:02 +0000
+++ Template/LO/SubProcesses/cuts.f 2020-06-21 12:17:46 +0000
@@ -1394,10 +1394,10 @@
1394C1394C
1395 2 IF (N.EQ.1) RETURN1395 2 IF (N.EQ.1) RETURN
1396 IF (MODE) 10,20,301396 IF (MODE) 10,20,30
1397 10 CALL SORTTI (A,INDEX,N)1397 10 STOP 5 ! CALL SORTTI (A,INDEX,N)
1398 GO TO 401398 GO TO 40
1399C1399C
1400 20 CALL SORTTC(A,INDEX,N)1400 20 STOP 5 ! CALL SSORTTC(A,INDEX,N)
1401 GO TO 401401 GO TO 40
1402C1402C
1403 30 CALL SORTTF (A,INDEX,N)1403 30 CALL SORTTF (A,INDEX,N)
14041404
=== modified file 'Template/LO/SubProcesses/genps.f'
--- Template/LO/SubProcesses/genps.f 2019-09-26 11:09:58 +0000
+++ Template/LO/SubProcesses/genps.f 2020-06-21 12:17:46 +0000
@@ -666,7 +666,8 @@
666c data nerr/0/666c data nerr/0/
667 double precision smin,smax,totmass,totmassin,xa2,xb2,wgt667 double precision smin,smax,totmass,totmassin,xa2,xb2,wgt
668 double precision costh,phi,tmin,tmax,t668 double precision costh,phi,tmin,tmax,t
669 double precision ma2,mb2,m12,mn2,s1669 double precision ma2,mb2,m12,mn2,s1, mi2
670 double precision tmass(-max_branch:-1)
670c671c
671c External672c External
672c673c
@@ -864,7 +865,7 @@
864c and not to be block by numerical inacuracy865c and not to be block by numerical inacuracy
865c tmax = max(tmax,0d0) !This line if want really t freedom866c tmax = max(tmax,0d0) !This line if want really t freedom
866 call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig,867 call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig,
867 $ 0, -tmin/stot)868 $ 0d0, -tmin/stot)
868 t = stot*(-x(-ibranch))869 t = stot*(-x(-ibranch))
869870
870 else871 else
@@ -893,7 +894,14 @@
893c pa+pb -> p1+ p2; t=(pa-p1)**2; pr = pa-p1894c pa+pb -> p1+ p2; t=(pa-p1)**2; pr = pa-p1
894c gentcms(pa,pb,t,phi,m1,m2,p1,pr) 895c gentcms(pa,pb,t,phi,m1,m2,p1,pr)
895c896c
896 call gentcms(p(0,itree(1,ibranch)),p(0,2),t,phi,897
898 if (itree(1,ibranch).gt.-ns_channel-1)then
899 mi2 = m(itree(1,ibranch))**2
900 else
901 mi2 = tmass(itree(1,ibranch))
902 endif
903 tmass(ibranch) = t
904 call gentcms(p(0,itree(1,ibranch)),p(0,2),t,phi, mi2,
897 & m(itree(2,ibranch)),m(ibranch-1),p(0,itree(2,ibranch)),905 & m(itree(2,ibranch)),m(ibranch-1),p(0,itree(2,ibranch)),
898 & p(0,ibranch),jac)906 & p(0,ibranch),jac)
899907
@@ -1002,7 +1010,7 @@
1002 endif1010 endif
1003 end1011 end
10041012
1005 subroutine gentcms(pa,pb,t,phi,m1,m2,p1,pr,jac)1013 subroutine gentcms(pa,pb,t,phi,ma2,m1,m2,p1,pr,jac)
1006c*************************************************************************1014c*************************************************************************
1007c Generates 4 momentum for particle 1, and remainder pr1015c Generates 4 momentum for particle 1, and remainder pr
1008c given the values t, and phi1016c given the values t, and phi
@@ -1038,7 +1046,7 @@
1038 ptotm(i) = ptot(i)1046 ptotm(i) = ptot(i)
1039 endif1047 endif
1040 enddo1048 enddo
1041 ma2 = dot(pa,pa)1049c ma2 = dot(pa,pa)
1042c1050c
1043c determine magnitude of p1 in cms frame (from dhelas routine mom2cx)1051c determine magnitude of p1 in cms frame (from dhelas routine mom2cx)
1044c1052c
10451053
=== modified file 'Template/LO/SubProcesses/reweight.f'
--- Template/LO/SubProcesses/reweight.f 2020-03-08 20:49:57 +0000
+++ Template/LO/SubProcesses/reweight.f 2020-06-21 12:17:46 +0000
@@ -417,6 +417,12 @@
417 ipart(1,imo)=ipart(1,ida2)417 ipart(1,imo)=ipart(1,ida2)
418 ipart(2,imo)=ipart(1,ida1)418 ipart(2,imo)=ipart(1,ida1)
419 endif419 endif
420 else if (abs(get_color(idmo)).eq.8.and.abs(get_color(idda1)).eq.1.and.abs(get_color(idda2)).eq.8)then
421 ipart(1,imo)=ipart(1,ida2)
422 ipart(2,imo)=ipart(2,ida2)
423 else if (abs(get_color(idmo)).eq.8.and.abs(get_color(idda1)).eq.8.and.abs(get_color(idda2)).eq.1)then
424 ipart(1,imo)=ipart(1,ida1)
425 ipart(2,imo)=ipart(2,ida1)
420 else426 else
421 write(*,*) idmo,'>', idda1, idda2, 'color', get_color(idmo),'>', get_color(idda1), get_color(idda2)427 write(*,*) idmo,'>', idda1, idda2, 'color', get_color(idmo),'>', get_color(idda1), get_color(idda2)
422 write(*,*) "failed for ipartupdate. Please retry without MLM/default dynamical scale"428 write(*,*) "failed for ipartupdate. Please retry without MLM/default dynamical scale"
423429
=== modified file 'Template/LO/SubProcesses/unwgt.f'
--- Template/LO/SubProcesses/unwgt.f 2018-06-20 11:54:42 +0000
+++ Template/LO/SubProcesses/unwgt.f 2020-06-21 12:17:46 +0000
@@ -478,7 +478,8 @@
478 double precision beta, get_betaz478 double precision beta, get_betaz
479 double precision ebi(0:3), ebo(0:3)479 double precision ebi(0:3), ebo(0:3)
480 double precision ptcltmp(nexternal), pdum(0:3)480 double precision ptcltmp(nexternal), pdum(0:3)
481481 integer beam_number
482
482 integer idup(nexternal,maxproc,maxsproc)483 integer idup(nexternal,maxproc,maxsproc)
483 integer mothup(2,nexternal)484 integer mothup(2,nexternal)
484 integer icolup(2,nexternal,maxflow,maxsproc)485 integer icolup(2,nexternal,maxflow,maxsproc)
@@ -705,31 +706,42 @@
705 else706 else
706 write(s_buff(3), '(a)') '<asrwt>0</asrwt>'707 write(s_buff(3), '(a)') '<asrwt>0</asrwt>'
707 endif708 endif
708 if(n_pdfrw(1).gt.0)then709 beam_number = 1
710 if (flip) then
711 beam_number =2
712 endif
713
714 if(n_pdfrw(1).gt.0.and.abs(lpp(1)).eq.1)then
709 if(2*n_pdfrw(1).lt.10) then715 if(2*n_pdfrw(1).lt.10) then
710 write(cfmt,'(a,I1,a,I1,a)') '(a,I3,',716 write(cfmt,'(a,I1,a,I1,a)') '(a,I1,a,I3,',
711 $ n_pdfrw(1),'I9,',2*n_pdfrw(1),'E15.8,a)'717 $ n_pdfrw(1),'I9,',2*n_pdfrw(1),'E15.8,a)'
712 else718 else
713 write(cfmt,'(a,I1,a,I2,a)') '(a,I3,',719 write(cfmt,'(a,I1,a,I2,a)') '(a,I1,a,I3,',
714 $ n_pdfrw(1),'I9,',2*n_pdfrw(1),'E15.8,a)'720 $ n_pdfrw(1),'I9,',2*n_pdfrw(1),'E15.8,a)'
715 endif721 endif
716 write(s_buff(4), cfmt) '<pdfrwt beam="1">',722
723 write(s_buff(4), cfmt) '<pdfrwt beam="', beam_number, '">',
717 $ n_pdfrw(1),(i_pdgpdf(i,1),i=1,n_pdfrw(1)),724 $ n_pdfrw(1),(i_pdgpdf(i,1),i=1,n_pdfrw(1)),
718 $ (s_xpdf(i,1),i=1,n_pdfrw(1)),725 $ (s_xpdf(i,1),i=1,n_pdfrw(1)),
719 $ (s_qpdf(i,1),i=1,n_pdfrw(1)),726 $ (s_qpdf(i,1),i=1,n_pdfrw(1)),
720 $ '</pdfrwt>'727 $ '</pdfrwt>'
721 else728 else
722 write(s_buff(4), '(a)') '<pdfrwt beam="1">0</pdfrwt>'729 write(s_buff(4), '(a,I1,a)') '<pdfrwt beam="',
723 endif730 $ beam_number,'">0</pdfrwt>'
724 if(n_pdfrw(2).gt.0)then731 endif
732 beam_number = 2
733 if (flip) then
734 beam_number = 1
735 endif
736 if(n_pdfrw(2).gt.0.and.abs(lpp(2)).eq.1)then
725 if(2*n_pdfrw(2).lt.10) then737 if(2*n_pdfrw(2).lt.10) then
726 write(cfmt,'(a,I1,a,I1,a)') '(a,I3,',738 write(cfmt,'(a,I1,a,I1,a)') '(a,I1,a,I3,',
727 $ n_pdfrw(2),'I9,',2*n_pdfrw(2),'E15.8,a)'739 $ n_pdfrw(2),'I9,',2*n_pdfrw(2),'E15.8,a)'
728 else740 else
729 write(cfmt,'(a,I1,a,I2,a)') '(a,I3,',741 write(cfmt,'(a,I1,a,I2,a)') '(a,I1,a,I3,',
730 $ n_pdfrw(2),'I9,',2*n_pdfrw(2),'E15.8,a)'742 $ n_pdfrw(2),'I9,',2*n_pdfrw(2),'E15.8,a)'
731 endif743 endif
732 write(s_buff(5), cfmt) '<pdfrwt beam="2">',744 write(s_buff(5), cfmt) '<pdfrwt beam="',beam_number,'">',
733 $ n_pdfrw(2),(i_pdgpdf(i,2),i=1,n_pdfrw(2)),745 $ n_pdfrw(2),(i_pdgpdf(i,2),i=1,n_pdfrw(2)),
734 $ (s_xpdf(i,2),i=1,n_pdfrw(2)),746 $ (s_xpdf(i,2),i=1,n_pdfrw(2)),
735 $ (s_qpdf(i,2),i=1,n_pdfrw(2)),747 $ (s_qpdf(i,2),i=1,n_pdfrw(2)),
736748
=== modified file 'Template/LO/bin/internal/merge.pl'
--- Template/LO/bin/internal/merge.pl 2014-08-07 12:08:24 +0000
+++ Template/LO/bin/internal/merge.pl 2020-06-21 12:17:46 +0000
@@ -52,8 +52,8 @@
52 # Keep track if we are in the init block or not52 # Keep track if we are in the init block or not
53 $initblock = 0;53 $initblock = 0;
5454
55 # LHE version extracted from current file ; 1 by default55 # LHE version extracted from current file ; 3 by default
56 $lhe_version = 1.0;56 $lhe_version = 3.0;
5757
58 while (1) {58 while (1) {
59 $gzbytes = $gzin->gzreadline($gzline);59 $gzbytes = $gzin->gzreadline($gzline);
6060
=== modified file 'Template/LO/bin/internal/restore_data'
--- Template/LO/bin/internal/restore_data 2011-06-29 14:15:21 +0000
+++ Template/LO/bin/internal/restore_data 2020-06-21 12:17:46 +0000
@@ -30,13 +30,21 @@
30 exit30 exit
31fi31fi
3232
3333if [[ -e $1_results.dat ]]; then
34cp $1_results.dat results.dat >& /dev/null34 cp $1_results.dat results.dat >& /dev/null
35else
36 cp results.dat $1_results.dat >& /dev/null
37fi
38
35for i in `cat subproc.mg` ; do39for i in `cat subproc.mg` ; do
36 cd $i40 cd $i
37 echo $i41 echo $i
38 rm -f ftn25 ftn26 >& /dev/null42 rm -f ftn25 ftn26 >& /dev/null
39 cp $1_results.dat results.dat >& /dev/null43 if [[ -e $1_results.dat ]]; then
44 cp $1_results.dat results.dat >& /dev/null
45 else
46 cp results.dat $1_results.dat >& /dev/null
47 fi
40 for k in G* ; do48 for k in G* ; do
41 if [[ ! -d $k ]]; then49 if [[ ! -d $k ]]; then
42 continue50 continue
@@ -45,6 +53,8 @@
45 for j in $1_results.dat ; do53 for j in $1_results.dat ; do
46 if [[ -e $j ]] ; then54 if [[ -e $j ]] ; then
47 cp $j results.dat55 cp $j results.dat
56 else
57 cp results.dat $j
48 fi58 fi
49 done59 done
50 for j in $1_ftn26.gz ; do60 for j in $1_ftn26.gz ; do
5161
=== modified file 'Template/NLO/MCatNLO/include/LHEF.h'
--- Template/NLO/MCatNLO/include/LHEF.h 2014-10-31 07:52:06 +0000
+++ Template/NLO/MCatNLO/include/LHEF.h 2020-06-21 12:17:46 +0000
@@ -1971,7 +1971,7 @@
1971 * Used internally to read a single line from the stream.1971 * Used internally to read a single line from the stream.
1972 */1972 */
1973 bool getline() {1973 bool getline() {
1974 return ( std::getline(file, currentLine) );1974 return ( (bool) std::getline(file, currentLine) );
1975 }1975 }
19761976
1977protected:1977protected:
19781978
=== modified file 'Template/NLO/SubProcesses/cuts.f'
--- Template/NLO/SubProcesses/cuts.f 2017-11-17 16:07:39 +0000
+++ Template/NLO/SubProcesses/cuts.f 2020-06-21 12:17:46 +0000
@@ -553,10 +553,10 @@
553C553C
554 2 IF (N.EQ.1) RETURN554 2 IF (N.EQ.1) RETURN
555 IF (MODE) 10,20,30555 IF (MODE) 10,20,30
556 10 CALL SORTTI (A,INDEX,N)556 10 STOP 5 ! CALL SORTTI (A,INDEX,N)
557 GO TO 40557 GO TO 40
558C558C
559 20 CALL SORTTC(A,INDEX,N)559 20 STOP 5 ! CALL SORTTC(A,INDEX,N)
560 GO TO 40560 GO TO 40
561C561C
562 30 CALL SORTTF (A,INDEX,N)562 30 CALL SORTTF (A,INDEX,N)
563563
=== removed directory 'Template/RWGTNLO'
=== removed file 'Template/RWGTNLO/__init__.py'
=== removed file 'Template/RWGTNLO/alfas.inc'
=== removed file 'Template/RWGTNLO/alfas_functions_lhapdf.f'
=== removed file 'Template/RWGTNLO/makefile'
=== removed file 'Template/RWGTNLO/rwgt.f'
=== removed file 'Template/RWGTNLO/setrun.f'
=== removed file 'Template/RWGTNLO/timing_variables.inc'
=== modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc'
--- Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-11-21 21:05:57 +0000
+++ Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2020-06-21 12:17:46 +0000
@@ -141,7 +141,8 @@
141141
142 character(512) path142 character(512) path
143 character(512) dummy 143 character(512) dummy
144144 character(512) epath ! path of the executable
145 integer pos
145 character(512) prefix,fpath146 character(512) prefix,fpath
146 character(17) nameToCheck147 character(17) nameToCheck
147 parameter (nameToCheck='MadLoopParams.dat')148 parameter (nameToCheck='MadLoopParams.dat')
@@ -185,11 +186,42 @@
185 close(1)186 close(1)
186 prefix='../MadLoop5_resources/'187 prefix='../MadLoop5_resources/'
187 call joinPath(prefix,nameToCheck,fpath)188 call joinPath(prefix,nameToCheck,fpath)
188 OPEN(1, FILE=fpath, ERR=66, STATUS='OLD',ACTION='READ')189 OPEN(1, FILE=fpath, ERR=3, STATUS='OLD',ACTION='READ')
189 MLPath=prefix190 MLPath=prefix
190 goto 10191 goto 10
19166 continue192 3 continue
192 close(1)193 close(1)
194c
195c Try to automatically find the path from the executable location
196c particularly usefull in gridpack readonly mode
197c
198 call getarg(0,path) !path is the PATH to the madevent executable (either global or from launching directory)
199 pos = index(path,'/',.true.)
200 prefix = path(:pos)
201 call joinPath(prefix,nameToCheck,fpath)
202 write(*,*) 'test', fpath
203 OPEN(1, FILE=fpath, ERR=4, STATUS='OLD',ACTION='READ')
204 MLPath=prefix
205 goto 10
2064 continue
207 close(1)
208 prefix= prefix // '/MadLoop5_resources/'
209 call joinPath(prefix,nameToCheck,fpath)
210 write(*,*) 'test', fpath
211 OPEN(1, FILE=fpath, ERR=5, STATUS='OLD',ACTION='READ')
212 MLPath=prefix
213 goto 10
2145 continue
215 close(1)
216 prefix= path(:pos) // '/../MadLoop5_resources/'
217 call joinPath(prefix,nameToCheck,fpath)
218 write(*,*) 'test', fpath
219 OPEN(1, FILE=fpath, ERR=6, STATUS='OLD',ACTION='READ')
220 MLPath=prefix
221 goto 10
222 6 continue
223 close(1)
224
193c We could not automatically find the auxiliary files225c We could not automatically find the auxiliary files
194 write(*,*) '==='226 write(*,*) '==='
195 write(*,*) 'ERROR: MadLoop5 could not automatically find the file MadLoopParams.dat.'227 write(*,*) 'ERROR: MadLoop5 could not automatically find the file MadLoopParams.dat.'
@@ -215,9 +247,9 @@
215247
216C Check that the FilePath set is correct248C Check that the FilePath set is correct
217 call joinPath(MLPath,nameToCheck,fpath)249 call joinPath(MLPath,nameToCheck,fpath)
218 OPEN(1, FILE=fpath, ERR=3, STATUS='OLD',ACTION='READ')250 OPEN(1, FILE=fpath, ERR=33, STATUS='OLD',ACTION='READ')
219 goto 11251 goto 11
2203 continue25233 continue
221 close(1)253 close(1)
222 write(*,*) '==='254 write(*,*) '==='
223 write(*,*) 'ERROR: The MadLoop5 auxiliary files could not be found in ',MLPath255 write(*,*) 'ERROR: The MadLoop5 auxiliary files could not be found in ',MLPath
@@ -606,7 +638,7 @@
606 IMPLICIT NONE638 IMPLICIT NONE
607 INTEGER MAXNREF_EVALS639 INTEGER MAXNREF_EVALS
608 PARAMETER (MAXNREF_EVALS=100)640 PARAMETER (MAXNREF_EVALS=100)
609 INTEGER, DIMENSION(MAXNREF_EVALS), INTENT(IN) :: x641 Double Precision, DIMENSION(MAXNREF_EVALS), INTENT(IN) :: x
610 INTEGER, INTENT(IN) :: mStart, mEnd642 INTEGER, INTENT(IN) :: mStart, mEnd
611 INTEGER :: Minimum643 INTEGER :: Minimum
612 INTEGER :: Location644 INTEGER :: Location
613645
=== modified file 'UpdateNotes.txt'
--- UpdateNotes.txt 2020-03-17 07:12:13 +0000
+++ UpdateNotes.txt 2020-06-21 12:17:46 +0000
@@ -1,5 +1,24 @@
1Update notes for MadGraph5_aMC@NLO (in reverse time order)1Update notes for MadGraph5_aMC@NLO (in reverse time order)
22
32.7.3(21/06/20)
4 OM: Fixing some bug for read-only LO gridpacks (wrong cross-section and shape when generating events).
5 Thanks to Congqiao Li for this
6 OM: Allowing loop-induced process to run on LO gridpack with read-only mode.
7 Thanks to Congqiao Li for this
8 OM: Fix a bug in the longitudinal polarization for off-shell effect, leading to deviation at large invariant mass.
9 OM: Adding more option to the run_card for fine tuning phase-space integration steps
10 All are hidden by default:
11 - hard_survey [default=1]: request for more points in survey (and subsequent refine)
12 - second_refine_treshold [default=1.5]: forbid second refine if cross section after first refine is
13 is smaller than cross-section of the survey times such treshold
14 OM: new command for the editions of the cards:
15 - set nodecay: remove all decay line from the madspin_card
16 - set BLOCKNAME all VALUE: set all entry of the param_card "BLOCKNAME" to VALUE
17 - edit CARDNAME --comment_line='<regular_expression>' : new syntax to comment all lines of a card
18 that are matching a given regular expression
19 OM: For Mac only, when running in script mode, MG5aMC will now prevent the computer to go to idle sleep.
20 You can prevent this by running with the '-s' option. like ./bin/mg5_aMC -s PATH_TO_CMD
21
32.7.2(17/03/20)222.7.2(17/03/20)
4 OM: Fix a Bug in pythia8 running on Ubuntu 18.04.4 machine23 OM: Fix a Bug in pythia8 running on Ubuntu 18.04.4 machine
5 OM: Speed up standalone_cpp code by changing compilation flag24 OM: Speed up standalone_cpp code by changing compilation flag
625
=== modified file 'VERSION'
--- VERSION 2020-03-17 07:12:13 +0000
+++ VERSION 2020-06-21 12:17:46 +0000
@@ -1,5 +1,5 @@
1version = 2.7.21version = 2.7.3
2date = 2020-03-172date = 2020-06-21
33
44
55
66
=== modified file 'aloha/create_aloha.py'
--- aloha/create_aloha.py 2020-01-09 16:39:38 +0000
+++ aloha/create_aloha.py 2020-06-21 12:17:46 +0000
@@ -443,7 +443,7 @@
443 denominator = propagator.denominator 443 denominator = propagator.denominator
444 elif propa == "1L":444 elif propa == "1L":
445 numerator = "EPSL(1,id) * EPSL(2,id)"445 numerator = "EPSL(1,id) * EPSL(2,id)"
446 denominator = "-1*PVec(-2,id)*PVec(-2,id)*Mass(id)**2 * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"446 denominator = "-1*PVec(-2,id)*PVec(-2,id)*P(-3,id)*P(-3,id) * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
447 elif propa == "1T":447 elif propa == "1T":
448 numerator = "-1*PVec(-2,id)*PVec(-2,id) * EPST2(1,id)*EPST2(2,id) + EPST1(1,id)*EPST1(2,id)"448 numerator = "-1*PVec(-2,id)*PVec(-2,id) * EPST2(1,id)*EPST2(2,id) + EPST1(1,id)*EPST1(2,id)"
449 denominator = "PVec(-2,id)*PVec(-2,id) * PT(-3,id)*PT(-3,id) * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"449 denominator = "PVec(-2,id)*PVec(-2,id) * PT(-3,id)*PT(-3,id) * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
450450
=== modified file 'aloha/template_files/aloha_functions_loop.f'
--- aloha/template_files/aloha_functions_loop.f 2016-01-27 01:59:42 +0000
+++ aloha/template_files/aloha_functions_loop.f 2020-06-21 12:17:46 +0000
@@ -2298,7 +2298,7 @@
2298 COMPLEX*16 Q(0:3)2298 COMPLEX*16 Q(0:3)
2299 INTEGER CFIG,J2299 INTEGER CFIG,J
2300 LOGICAL SCD2300 LOGICAL SCD
2301 COMPLEX*16 M2301 double precision M
2302 COMPLEX*16 W(20)2302 COMPLEX*16 W(20)
23032303
2304 IF (CFIG.EQ.1) THEN2304 IF (CFIG.EQ.1) THEN
@@ -2558,7 +2558,7 @@
2558 COMPLEX*16 Q(0:3)2558 COMPLEX*16 Q(0:3)
2559 INTEGER CFIG2559 INTEGER CFIG
2560 LOGICAL SCD2560 LOGICAL SCD
2561 COMPLEX*16 M2561 double precision M
2562 COMPLEX*16 W(20)2562 COMPLEX*16 W(20)
25632563
2564 IF (CFIG.EQ.1) THEN2564 IF (CFIG.EQ.1) THEN
25652565
=== modified file 'bin/mg5_aMC'
--- bin/mg5_aMC 2019-05-05 18:53:50 +0000
+++ bin/mg5_aMC 2020-06-21 12:17:46 +0000
@@ -49,7 +49,8 @@
49 help='force to launch debug mode')49 help='force to launch debug mode')
50parser.add_option("-m", "--mode", dest="plugin",50parser.add_option("-m", "--mode", dest="plugin",
51 help="Define some additional command provide by a PLUGIN")51 help="Define some additional command provide by a PLUGIN")
52 52parser.add_option("-s", "--nocaffeinate", action="store_false", default=True, dest='nosleep',
53 help='For mac user, forbids to use caffeinate when running with a script')
53(options, args) = parser.parse_args()54(options, args) = parser.parse_args()
54if len(args) == 0:55if len(args) == 0:
55 args = ''56 args = ''
@@ -66,6 +67,9 @@
66import logging.config67import logging.config
67import madgraph.interface.coloring_logging68import madgraph.interface.coloring_logging
6869
70if ' ' in os.getcwd():
71 logging.warning("Path does contains spaces. We advise that you change your current path to avoid to have space in the path.")
72
69try: 73try:
70 import readline74 import readline
71except ImportError:75except ImportError:
@@ -157,6 +161,10 @@
157# Call the cmd interface main loop161# Call the cmd interface main loop
158try:162try:
159 if options.file or args:163 if options.file or args:
164 if sys.platform == "darwin" and options.nosleep:
165 logging.getLogger('madgraph').warning("launching caffeinate to prevent idle sleep when MG5aMC is running. Run './bin/mg5_aMC -s' to prevent this.")
166 pid = os.getpid()
167 subprocess.Popen(['caffeinate', '-i', '-w', str(pid)])
160 # They are an input file 168 # They are an input file
161 if args:169 if args:
162 input_file = os.path.realpath(args[0])170 input_file = os.path.realpath(args[0])
163171
=== modified file 'madgraph/core/base_objects.py'
--- madgraph/core/base_objects.py 2020-03-04 20:39:24 +0000
+++ madgraph/core/base_objects.py 2020-06-21 12:17:46 +0000
@@ -3484,18 +3484,31 @@
3484 final.sort()3484 final.sort()
3485 return (tuple(initial), tuple(final))3485 return (tuple(initial), tuple(final))
3486 3486
3487 def get_final_ids_after_decay(self):3487 def get_initial_final_ids_after_decay(self, max_depth=-1):
3488 """return a tuple of two tuple containing the id of the initial/final
3489 state particles. Each list is ordered"""
3490
3491 initial = [l.get('id') for l in self.get('legs')\
3492 if not l.get('state')]
3493 final = self.get_final_ids_after_decay(max_depth=max_depth)
3494 initial.sort()
3495 final.sort()
3496 return (tuple(initial), tuple(final))
3497
3498
3499 def get_final_ids_after_decay(self, max_depth=-1):
3488 """Give the pdg code of the process including decay"""3500 """Give the pdg code of the process including decay"""
3489 3501
3490 finals = self.get_final_ids()3502 finals = self.get_final_ids()
3491 for proc in self.get('decay_chains'):3503 if max_depth !=0 :
3492 init = proc.get_initial_ids()[0]3504 for proc in self.get('decay_chains'):
3493 #while 1:3505 init = proc.get_initial_ids()[0]
3494 try:3506 #while 1:
3495 pos = finals.index(init)3507 try:
3496 except:3508 pos = finals.index(init)
3497 break3509 except:
3498 finals[pos] = proc.get_final_ids_after_decay()3510 break
3511 finals[pos] = proc.get_final_ids_after_decay(max_depth-1)
3499 output = []3512 output = []
3500 for d in finals:3513 for d in finals:
3501 if isinstance(d, list):3514 if isinstance(d, list):
35023515
=== modified file 'madgraph/core/diagram_generation.py'
--- madgraph/core/diagram_generation.py 2019-05-13 20:41:22 +0000
+++ madgraph/core/diagram_generation.py 2020-06-21 12:17:46 +0000
@@ -896,7 +896,7 @@
896 fcts=['remove_diag'])896 fcts=['remove_diag'])
897 else:897 else:
898 #example and simple tests898 #example and simple tests
899 def remove_diag(diag):899 def remove_diag(diag, model=None):
900 for vertex in diag['vertices']: #last 900 for vertex in diag['vertices']: #last
901 if vertex['id'] == 0: #special final vertex901 if vertex['id'] == 0: #special final vertex
902 continue 902 continue
@@ -907,8 +907,9 @@
907907
908 res = diag_list.__class__() 908 res = diag_list.__class__()
909 nb_removed = 0 909 nb_removed = 0
910 model = self['process']['model']
910 for diag in diag_list:911 for diag in diag_list:
911 if remove_diag(diag):912 if remove_diag(diag, model):
912 nb_removed +=1913 nb_removed +=1
913 else:914 else:
914 res.append(diag)915 res.append(diag)
915916
=== modified file 'madgraph/core/helas_objects.py'
--- madgraph/core/helas_objects.py 2020-03-09 09:27:32 +0000
+++ madgraph/core/helas_objects.py 2020-06-21 12:17:46 +0000
@@ -5871,6 +5871,7 @@
5871 # Identical matrix element found5871 # Identical matrix element found
5872 other_processes = identified_matrix_elements[me_index].\5872 other_processes = identified_matrix_elements[me_index].\
5873 get('processes')5873 get('processes')
5874
5874 other_processes.append(cls.reorder_process(\5875 other_processes.append(cls.reorder_process(\
5875 amplitude.get('process'),5876 amplitude.get('process'),
5876 permutations[me_index],5877 permutations[me_index],
@@ -5911,14 +5912,24 @@
5911 """Reorder the legs in the process according to the difference5912 """Reorder the legs in the process according to the difference
5912 between org_perm and proc_perm"""5913 between org_perm and proc_perm"""
59135914
5915
5916
5914 leglist = base_objects.LegList(\5917 leglist = base_objects.LegList(\
5915 [copy.copy(process.get('legs_with_decays')[i]) for i in \5918 [copy.copy(process.get('legs_with_decays')[i]) for i in \
5916 diagram_generation.DiagramTag.reorder_permutation(\5919 diagram_generation.DiagramTag.reorder_permutation(\
5917 proc_perm, org_perm)])5920 proc_perm, org_perm)])
5918 new_proc = copy.copy(process)5921 new_proc = copy.copy(process)
5922 if org_perm == proc_perm:
5923 return new_proc
5924
5925 if len(org_perm) != len(process.get('legs_with_decays')):
5926 raise Exception, "issue on symmetry between process"
5927
5919 new_proc.set('legs_with_decays', leglist)5928 new_proc.set('legs_with_decays', leglist)
59205929
5921 if not new_proc.get('decay_chains'):5930 if not new_proc.get('decay_chains'):
5922 new_proc.set('legs', leglist)5931 new_proc.set('legs', leglist)
5932 assert len(process.get('legs')) == len(leglist)
59235933
5934
5924 return new_proc5935 return new_proc
59255936
=== modified file 'madgraph/interface/amcatnlo_run_interface.py'
--- madgraph/interface/amcatnlo_run_interface.py 2020-03-07 20:56:41 +0000
+++ madgraph/interface/amcatnlo_run_interface.py 2020-06-21 12:17:46 +0000
@@ -174,7 +174,13 @@
174 logger.warning(msg % compiler)174 logger.warning(msg % compiler)
175 else:175 else:
176 curr_version = misc.get_gfortran_version(compiler)176 curr_version = misc.get_gfortran_version(compiler)
177 if not ''.join(curr_version.split('.')) >= '46':177 curr_version = curr_version.split('.')
178 if len(curr_version) == 1:
179 curr_version.append(0)
180
181 if int(curr_version[0]) < 5:
182 if int(curr_version[0]) == 4 and int(curr_version[1]) > 5:
183 return
178 if block:184 if block:
179 raise aMCatNLOError(msg % (compiler + ' ' + curr_version))185 raise aMCatNLOError(msg % (compiler + ' ' + curr_version))
180 else:186 else:
@@ -2785,7 +2791,7 @@
2785 """Sums all the plots in the HwU format."""2791 """Sums all the plots in the HwU format."""
2786 logger.debug('Combining HwU plots.')2792 logger.debug('Combining HwU plots.')
27872793
2788 command = []2794 command = [sys.executable]
2789 command.append(pjoin(self.me_dir, 'bin', 'internal','histograms.py'))2795 command.append(pjoin(self.me_dir, 'bin', 'internal','histograms.py'))
2790 for job in jobs:2796 for job in jobs:
2791 if job['dirname'].endswith('.HwU'):2797 if job['dirname'].endswith('.HwU'):
27922798
=== modified file 'madgraph/interface/common_run_interface.py'
--- madgraph/interface/common_run_interface.py 2020-03-04 09:57:24 +0000
+++ madgraph/interface/common_run_interface.py 2020-06-21 12:17:46 +0000
@@ -1036,7 +1036,11 @@
1036 out = ask(question, '0', possible_answer, timeout=int(1.5*timeout),1036 out = ask(question, '0', possible_answer, timeout=int(1.5*timeout),
1037 path_msg='enter path', ask_class = AskforEditCard,1037 path_msg='enter path', ask_class = AskforEditCard,
1038 cards=cards, mode=mode, **opt)1038 cards=cards, mode=mode, **opt)
10391039 if 'return_instance' in opt and opt['return_instance']:
1040 out, cmd = out
1041 if 'return_instance' in opt and opt['return_instance']:
1042 return (out, cmd)
1043 return out
10401044
1041 @staticmethod1045 @staticmethod
1042 def detect_card_type(path):1046 def detect_card_type(path):
@@ -2836,8 +2840,8 @@
2836 reco_output = pjoin(self.me_dir,2840 reco_output = pjoin(self.me_dir,
2837 'MA5_%s_ANALYSIS%s_%d'%(mode.upper(),MA5_runtag,i+1))2841 'MA5_%s_ANALYSIS%s_%d'%(mode.upper(),MA5_runtag,i+1))
2838 # Look for either a root or .lhe.gz output2842 # Look for either a root or .lhe.gz output
2839 reco_event_file = misc.glob('*.lhe.gz',pjoin(reco_output,'Output','_reco_events','lheEvents0_%d'%MA5_run_number))+\2843 reco_event_file = misc.glob('*.lhe.gz',pjoin(reco_output,'Output','SAF','_reco_events','lheEvents0_%d'%MA5_run_number))+\
2840 misc.glob('*.root',pjoin(reco_output,'Output','_reco_events', 'RecoEvents0_%d'%MA5_run_number))2844 misc.glob('*.root',pjoin(reco_output,'Output','SAF','_reco_events', 'RecoEvents0_%d'%MA5_run_number))
2841 if len(reco_event_file)==0:2845 if len(reco_event_file)==0:
2842 raise MadGraph5Error, "MadAnalysis5 failed to produce the "+\2846 raise MadGraph5Error, "MadAnalysis5 failed to produce the "+\
2843 "reconstructed event file for reconstruction '%s'."%MA5_runtag[6:]2847 "reconstructed event file for reconstruction '%s'."%MA5_runtag[6:]
@@ -2852,7 +2856,7 @@
2852 parent_dir_name = os.path.basename(os.path.dirname(reco_event_file))2856 parent_dir_name = os.path.basename(os.path.dirname(reco_event_file))
2853 files.ln(pjoin(self.me_dir,'HTML',self.run_name,2857 files.ln(pjoin(self.me_dir,'HTML',self.run_name,
2854 '%s_MA5_%s_ANALYSIS%s_%d'%(self.run_tag,mode.upper(),2858 '%s_MA5_%s_ANALYSIS%s_%d'%(self.run_tag,mode.upper(),
2855 MA5_runtag,i+1),'Output','_reco_events',parent_dir_name,links_created[-1]),2859 MA5_runtag,i+1),'Output','SAF','_reco_events',parent_dir_name,links_created[-1]),
2856 pjoin(self.me_dir,'Events',self.run_name))2860 pjoin(self.me_dir,'Events',self.run_name))
28572861
2858 logger.info("MadAnalysis5 successfully completed the reconstruction "+2862 logger.info("MadAnalysis5 successfully completed the reconstruction "+
@@ -3328,7 +3332,7 @@
3328 if mass and abs(width/mass) < 1e-12:3332 if mass and abs(width/mass) < 1e-12:
3329 if hasattr(interface, 'run_card') and isinstance(interface.run_card, banner_mod.RunCardLO):3333 if hasattr(interface, 'run_card') and isinstance(interface.run_card, banner_mod.RunCardLO):
3330 if interface.run_card['small_width_treatment'] < 1e-12:3334 if interface.run_card['small_width_treatment'] < 1e-12:
3331 logger.error('The width of particle %s is too small for an s-channel resonance (%s) and the small_width_paramer is too small to prevent numerical issues. If you have this particle in an s-channel, this is likely to create numerical instabilities .', param.lhacode[0], width)3335 logger.error('The width of particle %s is too small for an s-channel resonance (%s) and the small_width_treatment parameter is too small to prevent numerical issues. If you have this particle in an s-channel, this is likely to create numerical instabilities .', param.lhacode[0], width)
3332 else:3336 else:
3333 logger.error('The width of particle %s is too small for an s-channel resonance (%s). If you have this particle in an s-channel, this is likely to create numerical instabilities .', param.lhacode[0], width)3337 logger.error('The width of particle %s is too small for an s-channel resonance (%s). If you have this particle in an s-channel, this is likely to create numerical instabilities .', param.lhacode[0], width)
3334 if CommonRunCmd.sleep_for_error:3338 if CommonRunCmd.sleep_for_error:
@@ -4098,6 +4102,18 @@
4098 if not require_local and (os.path.exists(pjoin(pdfsets_dir, pdfset)) or \4102 if not require_local and (os.path.exists(pjoin(pdfsets_dir, pdfset)) or \
4099 os.path.isdir(pjoin(pdfsets_dir, pdfset))):4103 os.path.isdir(pjoin(pdfsets_dir, pdfset))):
4100 continue4104 continue
4105 if not require_local:
4106 if 'LHAPDF_DATA_PATH' in os.environ:
4107 found = False
4108 for path in os.environ['LHAPDF_DATA_PATH'].split(":"):
4109 if (os.path.exists(pjoin(path, pdfset)) or \
4110 os.path.isdir(pjoin(path, pdfset))):
4111 found =True
4112 break
4113 if found:
4114 continue
4115
4116
4101 #check that the pdfset is not already there4117 #check that the pdfset is not already there
4102 elif not os.path.exists(pjoin(self.me_dir, 'lib', 'PDFsets', pdfset)) and \4118 elif not os.path.exists(pjoin(self.me_dir, 'lib', 'PDFsets', pdfset)) and \
4103 not os.path.isdir(pjoin(self.me_dir, 'lib', 'PDFsets', pdfset)):4119 not os.path.isdir(pjoin(self.me_dir, 'lib', 'PDFsets', pdfset)):
@@ -4309,7 +4325,7 @@
4309 stdout = subprocess.PIPE).stdout.read().strip()4325 stdout = subprocess.PIPE).stdout.read().strip()
4310 except OSError, error:4326 except OSError, error:
4311 if error.errno == 2:4327 if error.errno == 2:
4312 raise Exception, 'lhapdf executable (%s) is not found on your system. Please install it and/or indicate the path to the correct executable in input/mg5_configuration.txt' % self.options['lhapdf']4328 raise Exception, 'lhapdf executable (%s) is not found on your system. Please install it and/or indicate the path to the correct executable in input/mg5_configuration.txt' % lhapdf_config
4313 else:4329 else:
4314 raise4330 raise
4315 4331
@@ -4495,7 +4511,12 @@
4495 self.modified_card = set() #set of cards not in sync with filesystem4511 self.modified_card = set() #set of cards not in sync with filesystem
4496 # need to sync them before editing/leaving4512 # need to sync them before editing/leaving
4497 self.init_from_banner(from_banner, banner)4513 self.init_from_banner(from_banner, banner)
4498 4514 self.writting_card = True
4515 if 'write_file' in opt:
4516 if not opt['write_file']:
4517 self.writting_card = False
4518 self.param_consistency = False
4519
4499 #update default path by custom one if specify in cards4520 #update default path by custom one if specify in cards
4500 for card in cards:4521 for card in cards:
4501 if os.path.exists(card) and os.path.sep in cards:4522 if os.path.exists(card) and os.path.sep in cards:
@@ -4773,10 +4794,12 @@
4773 return []4794 return []
4774 4795
4775 self.special_shortcut.update({4796 self.special_shortcut.update({
4776 'spinmode':([str], ['add madspin_card --before_line="launch" set spinmode %(0)s'])4797 'spinmode':([str], ['add madspin_card --before_line="launch" set spinmode %(0)s']),
4798 'nodecay':([], ['edit madspin_card --comment_line="decay"'])
4777 })4799 })
4778 self.special_shortcut_help.update({4800 self.special_shortcut_help.update({
4779 'spinmode' : 'full|none|onshell. Choose the mode of madspin.\n - full: spin-correlation and off-shell effect\n - onshell: only spin-correlation,]\n - none: no spin-correlation and not offshell effects.'4801 'spinmode' : 'full|none|onshell. Choose the mode of madspin.\n - full: spin-correlation and off-shell effect\n - onshell: only spin-correlation,]\n - none: no spin-correlation and not offshell effects.',
4802 'nodecay': 'remove all decay previously defined in madspin',
4780 })4803 })
4781 return []4804 return []
4782 4805
@@ -5241,7 +5264,7 @@
5241 def do_set(self, line):5264 def do_set(self, line):
5242 """ edit the value of one parameter in the card"""5265 """ edit the value of one parameter in the card"""
5243 5266
5244 5267
5245 args = self.split_arg(line)5268 args = self.split_arg(line)
5246 5269
5247 5270
@@ -5504,7 +5527,7 @@
5504 try:5527 try:
5505 key = tuple([int(i) for i in args[start+1:-1]])5528 key = tuple([int(i) for i in args[start+1:-1]])
5506 except ValueError:5529 except ValueError:
5507 if args[start] == 'decay' and args[start+1:-1] == ['all']:5530 if args[start+1:-1] == ['all']:
5508 for key in self.param_card[args[start]].param_dict:5531 for key in self.param_card[args[start]].param_dict:
5509 if (args[start], key) in self.restricted_value:5532 if (args[start], key) in self.restricted_value:
5510 continue5533 continue
@@ -5965,8 +5988,9 @@
5965 self.do_set('shower_card extrapaths None ') 5988 self.do_set('shower_card extrapaths None ')
5966 5989
5967 # ensure that all cards are in sync5990 # ensure that all cards are in sync
5968 for key in list(self.modified_card):5991 if self.writting_card:
5969 self.write_card(key)5992 for key in list(self.modified_card):
5993 self.write_card(key)
59705994
59715995
5972 def reask(self, *args, **opt):5996 def reask(self, *args, **opt):
@@ -6092,7 +6116,8 @@
6092 self.run_card.write(self.paths['run'], self.paths['run_default'])6116 self.run_card.write(self.paths['run'], self.paths['run_default'])
6093 6117
6094 def write_card_param(self):6118 def write_card_param(self):
6095 """ write the param_card """ 6119 """ write the param_card """
6120
6096 self.param_card.write(self.paths['param'])6121 self.param_card.write(self.paths['param'])
6097 6122
6098 @staticmethod6123 @staticmethod
@@ -6477,6 +6502,7 @@
6477 logger.info( ' --before_line="<regular-expression>" write the line before the first line matching the regular expression')6502 logger.info( ' --before_line="<regular-expression>" write the line before the first line matching the regular expression')
6478 logger.info( ' --replace_line="<regular-expression>" replace the line matching the regular expression')6503 logger.info( ' --replace_line="<regular-expression>" replace the line matching the regular expression')
6479 logger.info( ' --clean remove all previously existing line in the file')6504 logger.info( ' --clean remove all previously existing line in the file')
6505 logger.info( ' --comment_line="<regular-expression>" comment all lines matching the regular expression')
6480 logger.info('')6506 logger.info('')
6481 logger.info(' Note: all regular-expression will be prefixed by ^\s*')6507 logger.info(' Note: all regular-expression will be prefixed by ^\s*')
6482 logger.info('')6508 logger.info('')
@@ -6622,7 +6648,29 @@
6622 logger.info("Replacing the line \"%s\" [line %d of %s] by \"%s\"" %6648 logger.info("Replacing the line \"%s\" [line %d of %s] by \"%s\"" %
6623 (old_line, posline, card, new_line ),'$MG:BOLD') 6649 (old_line, posline, card, new_line ),'$MG:BOLD')
6624 self.last_editline_pos = posline 6650 self.last_editline_pos = posline
6625 6651
6652 elif args[1].startswith('--comment_line='):
6653 # catch the line/regular expression and replace the associate line
6654 # if no line match go to check if args[2] has other instruction starting with --
6655 text = open(path).read()
6656 split = text.split('\n')
6657 search_pattern=r'''comment_line=(?P<quote>["'])(?:(?=(\\?))\2.)*?\1'''
6658 pattern = '^\s*' + re.search(search_pattern, line).group()[14:-1]
6659 nb_mod = 0
6660 for posline,l in enumerate(split):
6661 if re.search(pattern, l):
6662 split[posline] = '#%s' % l
6663 nb_mod +=1
6664 logger.info("Commenting line \"%s\" [line %d of %s]" %
6665 (l, posline, card ),'$MG:BOLD')
6666 # overwrite the previous line
6667 if not nb_mod:
6668 logger.warning('no line commented (no line matching)')
6669 ff = open(path,'w')
6670 ff.write('\n'.join(split))
6671
6672 self.last_editline_pos = posline
6673
6626 6674
6627 elif args[1].startswith('--before_line='):6675 elif args[1].startswith('--before_line='):
6628 # catch the line/regular expression and write before that line6676 # catch the line/regular expression and write before that line
66296677
=== modified file 'madgraph/interface/extended_cmd.py'
--- madgraph/interface/extended_cmd.py 2020-02-25 14:05:36 +0000
+++ madgraph/interface/extended_cmd.py 2020-06-21 12:17:46 +0000
@@ -2586,6 +2586,8 @@
2586 elif line in 'auto':2586 elif line in 'auto':
2587 self.switch['dynamical'] = True2587 self.switch['dynamical'] = True
2588 return super(ControlSwitch, self).default(line)2588 return super(ControlSwitch, self).default(line)
2589 elif line.startswith('set ') and not hasattr(self.__class__, 'do_set'):
2590 raise NotValidInput('unknow command: %s. Did you mean \"%s\"' % (line, line[4:]))
2589 elif raise_error:2591 elif raise_error:
2590 raise NotValidInput('unknow command: %s' % line)2592 raise NotValidInput('unknow command: %s' % line)
2591 else:2593 else:
@@ -2601,6 +2603,8 @@
2601 getattr(self, 'ans_%s' % base)(value)2603 getattr(self, 'ans_%s' % base)(value)
2602 elif base in self.switch:2604 elif base in self.switch:
2603 self.set_switch(base, value)2605 self.set_switch(base, value)
2606 elif line.startswith('set ') and not hasattr(self.__class__, 'do_set'):
2607 raise NotValidInput('Not valid command: %s. Did you mean \"%s\"' % (line, line[4:]))
2604 elif raise_error:2608 elif raise_error:
2605 raise NotValidInput('Not valid command: %s' % line) 2609 raise NotValidInput('Not valid command: %s' % line)
2606 else:2610 else:
26072611
=== modified file 'madgraph/interface/madevent_interface.py'
--- madgraph/interface/madevent_interface.py 2020-03-16 08:37:10 +0000
+++ madgraph/interface/madevent_interface.py 2020-06-21 12:17:46 +0000
@@ -797,7 +797,7 @@
797 797
798 self.allowed_madspin = []798 self.allowed_madspin = []
799 if 'MadSpin' in self.available_module:799 if 'MadSpin' in self.available_module:
800 self.allowed_madspin = ['OFF',"ON",'onshell']800 self.allowed_madspin = ['OFF',"ON",'onshell',"full"]
801 return self.allowed_madspin801 return self.allowed_madspin
802 802
803 def check_value_madspin(self, value):803 def check_value_madspin(self, value):
@@ -834,7 +834,7 @@
834 if value == 'onshell':834 if value == 'onshell':
835 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode onshell"]835 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode onshell"]
836 elif value in ['full', 'madspin']:836 elif value in ['full', 'madspin']:
837 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode madspin"]837 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode full"]
838 elif value == 'none':838 elif value == 'none':
839 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode none"]839 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode none"]
840 else:840 else:
@@ -1291,7 +1291,6 @@
1291 raise self.InvalidCmd('No run_name currently define. Unable to run refine')1291 raise self.InvalidCmd('No run_name currently define. Unable to run refine')
12921292
1293 if len(args) > 2:1293 if len(args) > 2:
1294 self.help_refine()
1295 raise self.InvalidCmd('Too many argument for refine command')1294 raise self.InvalidCmd('Too many argument for refine command')
1296 else:1295 else:
1297 try:1296 try:
@@ -2497,7 +2496,8 @@
2497 postcmd=False)2496 postcmd=False)
2498 self.exec_cmd('combine_events', postcmd=False)2497 self.exec_cmd('combine_events', postcmd=False)
2499 self.exec_cmd('store_events', postcmd=False)2498 self.exec_cmd('store_events', postcmd=False)
2500 self.exec_cmd('decay_events -from_cards', postcmd=False)2499 with misc.TMP_variable(self, 'run_name', self.run_name):
2500 self.exec_cmd('decay_events -from_cards', postcmd=False)
2501 self.exec_cmd('create_gridpack', postcmd=False)2501 self.exec_cmd('create_gridpack', postcmd=False)
2502 else:2502 else:
2503 # Regular run mode2503 # Regular run mode
@@ -2526,7 +2526,8 @@
2526 2526
2527 #we can bypass the following if scan and first result is zero2527 #we can bypass the following if scan and first result is zero
2528 if not bypass_run:2528 if not bypass_run:
2529 self.exec_cmd('refine %s' % nb_event, postcmd=False)2529 self.exec_cmd('refine %s --treshold=%s' % (nb_event,self.run_card['second_refine_treshold'])
2530 , postcmd=False)
2530 2531
2531 self.exec_cmd('combine_events', postcmd=False,printcmd=False)2532 self.exec_cmd('combine_events', postcmd=False,printcmd=False)
2532 self.print_results_in_shell(self.results.current)2533 self.print_results_in_shell(self.results.current)
@@ -2882,7 +2883,7 @@
2882 particle = 02883 particle = 0
2883 # Read BRs for this decay2884 # Read BRs for this decay
2884 line = param_card[line_number]2885 line = param_card[line_number]
2885 while line.startswith('#') or line.startswith(' '):2886 while re.search('^(#|\s|\d)', line):
2886 line = param_card.pop(line_number)2887 line = param_card.pop(line_number)
2887 if not particle or line.startswith('#'):2888 if not particle or line.startswith('#'):
2888 line=param_card[line_number]2889 line=param_card[line_number]
@@ -3354,7 +3355,7 @@
3354 if float(self.run_card['mmjj']) > 0.01 * (float(self.run_card['ebeam1'])+float(self.run_card['ebeam2'])):3355 if float(self.run_card['mmjj']) > 0.01 * (float(self.run_card['ebeam1'])+float(self.run_card['ebeam2'])):
3355 self.pass_in_difficult_integration_mode()3356 self.pass_in_difficult_integration_mode()
3356 elif self.run_card['hard_survey']:3357 elif self.run_card['hard_survey']:
3357 self.pass_in_difficult_integration_mode()3358 self.pass_in_difficult_integration_mode(self.run_card['hard_survey'])
3358 3359
3359 jobs, P_zero_result = ajobcreator.launch()3360 jobs, P_zero_result = ajobcreator.launch()
3360 # Check if all or only some fails3361 # Check if all or only some fails
@@ -3382,24 +3383,26 @@
3382 self.update_status('End survey', 'parton', makehtml=False)3383 self.update_status('End survey', 'parton', makehtml=False)
33833384
3384 ############################################################################3385 ############################################################################
3385 def pass_in_difficult_integration_mode(self):3386 def pass_in_difficult_integration_mode(self, rate=1):
3386 """be more secure for the integration to not miss it due to strong cut"""3387 """be more secure for the integration to not miss it due to strong cut"""
3387 3388
3388 # improve survey options if default3389 # improve survey options if default
3389 if self.opts['points'] == self._survey_options['points'][1]:3390 if self.opts['points'] == self._survey_options['points'][1]:
3390 self.opts['points'] = 3 * self._survey_options['points'][1]3391 self.opts['points'] = (rate+2) * self._survey_options['points'][1]
3391 if self.opts['iterations'] == self._survey_options['iterations'][1]:3392 if self.opts['iterations'] == self._survey_options['iterations'][1]:
3392 self.opts['iterations'] = 2 + self._survey_options['iterations'][1]3393 self.opts['iterations'] = 1 + rate + self._survey_options['iterations'][1]
3393 if self.opts['accuracy'] == self._survey_options['accuracy'][1]:3394 if self.opts['accuracy'] == self._survey_options['accuracy'][1]:
3394 self.opts['accuracy'] = self._survey_options['accuracy'][1]/3 3395 self.opts['accuracy'] = self._survey_options['accuracy'][1]/(rate+2)
3395 3396
3396 # Modify run_config.inc in order to improve the refine3397 # Modify run_config.inc in order to improve the refine
3397 conf_path = pjoin(self.me_dir, 'Source','run_config.inc')3398 conf_path = pjoin(self.me_dir, 'Source','run_config.inc')
3398 files.cp(conf_path, conf_path + '.bk')3399 files.cp(conf_path, conf_path + '.bk')
3399 #3400 #
3400 text = open(conf_path).read()3401 text = open(conf_path).read()
3401 text = re.sub('''\(min_events = \d+\)''', '''(min_events = 7500 )''', text)3402 min_evt, max_evt = 2500 *(2+rate), 10000*(rate+1)
3402 text = re.sub('''\(max_events = \d+\)''', '''(max_events = 40000 )''', text)3403
3404 text = re.sub('''\(min_events = \d+\)''', '(min_events = %i )' % min_evt, text)
3405 text = re.sub('''\(max_events = \d+\)''', '(max_events = %i )' % max_evt, text)
3403 fsock = open(conf_path, 'w')3406 fsock = open(conf_path, 'w')
3404 fsock.write(text)3407 fsock.write(text)
3405 fsock.close()3408 fsock.close()
@@ -3415,6 +3418,18 @@
3415 devnull = open(os.devnull, 'w') 3418 devnull = open(os.devnull, 'w')
3416 self.nb_refine += 13419 self.nb_refine += 1
3417 args = self.split_arg(line)3420 args = self.split_arg(line)
3421 treshold=None
3422 for a in args:
3423 if a.startswith('--treshold='):
3424 treshold = float(a.split('=',1)[1])
3425 old_xsec = self.results.current['prev_cross']
3426 new_xsec = self.results.current['cross']
3427 if old_xsec > new_xsec * treshold:
3428 logger.info('No need for second refine due to stability of cross-section')
3429 return
3430 else:
3431 args.remove(a)
3432 break
3418 # Check argument's validity3433 # Check argument's validity
3419 self.check_refine(args)3434 self.check_refine(args)
3420 3435
@@ -3471,8 +3486,7 @@
3471 cross, error = x_improve.update_html() #update html results for survey3486 cross, error = x_improve.update_html() #update html results for survey
3472 if cross == 0:3487 if cross == 0:
3473 return3488 return
3474 logger.info("Current estimate of cross-section: %s +- %s" % (cross, error))3489 logger.info("- Current estimate of cross-section: %s +- %s" % (cross, error))
3475
3476 if isinstance(x_improve, gen_ximprove.gen_ximprove_v4):3490 if isinstance(x_improve, gen_ximprove.gen_ximprove_v4):
3477 # Non splitted mode is based on writting ajob so need to track them3491 # Non splitted mode is based on writting ajob so need to track them
3478 # Splitted mode handle the cluster submition internally.3492 # Splitted mode handle the cluster submition internally.
@@ -3811,6 +3825,17 @@
3811 self.update_status('Creating gridpack', level='parton')3825 self.update_status('Creating gridpack', level='parton')
3812 # compile gen_ximprove3826 # compile gen_ximprove
3813 misc.compile(['../bin/internal/gen_ximprove'], cwd=pjoin(self.me_dir, "Source"))3827 misc.compile(['../bin/internal/gen_ximprove'], cwd=pjoin(self.me_dir, "Source"))
3828
3829 Gdir = self.get_Gdir()
3830 Pdir = set([os.path.dirname(G) for G in Gdir])
3831 for P in Pdir:
3832 allG = misc.glob('G*', path=P)
3833 for G in allG:
3834 if pjoin(P, G) not in Gdir:
3835 logger.debug('removing %s', pjoin(P,G))
3836 shutil.rmtree(pjoin(P,G))
3837
3838
3814 args = self.split_arg(line)3839 args = self.split_arg(line)
3815 self.check_combine_events(args)3840 self.check_combine_events(args)
3816 if not self.run_tag: self.run_tag = 'tag_1'3841 if not self.run_tag: self.run_tag = 'tag_1'
@@ -4668,7 +4693,7 @@
4668 devnull.close()4693 devnull.close()
4669 if pid == 0:4694 if pid == 0:
4670 misc.call('head -n -1 %s | tail -n +%d > %s/tmpfile' %4695 misc.call('head -n -1 %s | tail -n +%d > %s/tmpfile' %
4671 (hepmc_file, n_head, os.path.dirname(hepmc_file)), shell=True)4696 (hepmc_file, n_head+1, os.path.dirname(hepmc_file)), shell=True)
4672 misc.call(['mv', 'tmpfile', os.path.basename(hepmc_file)], cwd=os.path.dirname(hepmc_file))4697 misc.call(['mv', 'tmpfile', os.path.basename(hepmc_file)], cwd=os.path.dirname(hepmc_file))
4673 elif sys.platform == 'darwin':4698 elif sys.platform == 'darwin':
4674 # sed on MAC has slightly different synthax than on4699 # sed on MAC has slightly different synthax than on
@@ -5967,10 +5992,16 @@
59675992
5968 eradir = self.options['exrootanalysis_path']5993 eradir = self.options['exrootanalysis_path']
5969 totar = False5994 totar = False
5995 torm = False
5970 if input.endswith('.gz'):5996 if input.endswith('.gz'):
5971 misc.gunzip(input, keep=True)5997 if not os.path.exists(input) and os.path.exists(input[:-3]):
5972 totar = True5998 totar = True
5973 input = input[:-3]5999 input = input[:-3]
6000 else:
6001 misc.gunzip(input, keep=True)
6002 totar = False
6003 torm = True
6004 input = input[:-3]
5974 6005
5975 try:6006 try:
5976 misc.call(['%s/ExRootLHEFConverter' % eradir, 6007 misc.call(['%s/ExRootLHEFConverter' % eradir,
@@ -5982,12 +6013,13 @@
5982 if totar:6013 if totar:
5983 if os.path.exists('%s.gz' % input):6014 if os.path.exists('%s.gz' % input):
5984 try:6015 try:
5985 os.remove(input)6016 os.remove('%s.gz' % input)
5986 except:6017 except:
5987 pass6018 pass
5988 else:6019 else:
5989 misc.gzip(input)6020 misc.gzip(input)
5990 6021 if torm:
6022 os.remove(input)
5991 6023
5992 def run_syscalc(self, mode='parton', event_path=None, output=None):6024 def run_syscalc(self, mode='parton', event_path=None, output=None):
5993 """create the syscalc output""" 6025 """create the syscalc output"""
@@ -6458,7 +6490,10 @@
6458 os.chdir(self.me_dir)6490 os.chdir(self.me_dir)
6459 else:6491 else:
6460 for line in open(pjoin(self.me_dir,'SubProcesses','subproc.mg')):6492 for line in open(pjoin(self.me_dir,'SubProcesses','subproc.mg')):
6461 os.mkdir(line.strip())6493 p = line.strip()
6494 os.mkdir(p)
6495 files.cp(pjoin(self.me_dir,'SubProcesses',p,'symfact.dat'),
6496 pjoin(p, 'symfact.dat'))
6462 6497
64636498
6464 def launch(self, nb_event, seed):6499 def launch(self, nb_event, seed):
@@ -6472,6 +6507,12 @@
6472 misc.call([pjoin(self.me_dir,'bin','internal','restore_data'),6507 misc.call([pjoin(self.me_dir,'bin','internal','restore_data'),
6473 'default'], cwd=self.me_dir)6508 'default'], cwd=self.me_dir)
64746509
6510 if self.run_card['python_seed'] == -2:
6511 import random
6512 random.seed(seed)
6513 elif self.run_card['python_seed'] > 0:
6514 import random
6515 random.seed(self.run_card['python_seed'])
6475 # 2) Run the refine for the grid6516 # 2) Run the refine for the grid
6476 self.update_status('Generating Events', level=None)6517 self.update_status('Generating Events', level=None)
6477 #misc.call([pjoin(self.me_dir,'bin','refine4grid'),6518 #misc.call([pjoin(self.me_dir,'bin','refine4grid'),
@@ -6649,11 +6690,11 @@
6649 sum_axsec += result.get('axsec')*gscalefact[Gdir]6690 sum_axsec += result.get('axsec')*gscalefact[Gdir]
6650 6691
6651 if len(AllEvent) >= 80: #perform a partial unweighting6692 if len(AllEvent) >= 80: #perform a partial unweighting
6652 AllEvent.unweight(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % partials),6693 AllEvent.unweight(pjoin(outdir, self.run_name, "partials%s.lhe.gz" % partials),
6653 get_wgt, log_level=5, trunc_error=1e-2, event_target=self.nb_event)6694 get_wgt, log_level=5, trunc_error=1e-2, event_target=self.nb_event)
6654 AllEvent = lhe_parser.MultiEventFile()6695 AllEvent = lhe_parser.MultiEventFile()
6655 AllEvent.banner = self.banner6696 AllEvent.banner = self.banner
6656 AllEvent.add(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % partials),6697 AllEvent.add(pjoin(outdir, self.run_name, "partials%s.lhe.gz" % partials),
6657 sum_xsec,6698 sum_xsec,
6658 math.sqrt(sum(x**2 for x in sum_xerru)),6699 math.sqrt(sum(x**2 for x in sum_xerru)),
6659 sum_axsec) 6700 sum_axsec)
66606701
=== modified file 'madgraph/interface/madgraph_interface.py'
--- madgraph/interface/madgraph_interface.py 2020-03-06 20:47:59 +0000
+++ madgraph/interface/madgraph_interface.py 2020-06-21 12:17:46 +0000
@@ -459,7 +459,7 @@
459 logger.info(" -d: specify other MG/ME directory")459 logger.info(" -d: specify other MG/ME directory")
460 logger.info(" -noclean: no cleaning performed in \"path\".")460 logger.info(" -noclean: no cleaning performed in \"path\".")
461 logger.info(" -nojpeg: no jpeg diagrams will be generated.")461 logger.info(" -nojpeg: no jpeg diagrams will be generated.")
462 logger.info(" -noeps: no jpeg and eps diagrams will be generated.")462 logger.info(" --noeps=True: no jpeg and eps diagrams will be generated.")
463 logger.info(" -name: the postfix of the main file in pythia8 mode.")463 logger.info(" -name: the postfix of the main file in pythia8 mode.")
464 logger.info(" Examples:",'$MG:color:GREEN')464 logger.info(" Examples:",'$MG:color:GREEN')
465 logger.info(" output",'$MG:color:GREEN')465 logger.info(" output",'$MG:color:GREEN')
@@ -530,6 +530,11 @@
530 logger.info(" > Except for the 'gauge' test, all checks above are also")530 logger.info(" > Except for the 'gauge' test, all checks above are also")
531 logger.info(" available for loop processes with ML5 ('virt=' mode)")531 logger.info(" available for loop processes with ML5 ('virt=' mode)")
532 logger.info("Example: check full p p > j j",'$MG:color:GREEN')532 logger.info("Example: check full p p > j j",'$MG:color:GREEN')
533 logger.info("Using leshouches file as input",'$MG:color:GREEN')
534 logger.info(" use the option --events=PATH")
535 logger.info(" zipped file are not supported")
536 logger.info(" to loop over the file use the option --skip_evt=X")
537 logger.info("")
533 logger.info("Options for loop processes only:",'$MG:BOLD')538 logger.info("Options for loop processes only:",'$MG:BOLD')
534 logger.info("o timing:",'$MG:color:GREEN')539 logger.info("o timing:",'$MG:color:GREEN')
535 logger.info(" Generate and output a process and returns detailed")540 logger.info(" Generate and output a process and returns detailed")
@@ -926,7 +931,9 @@
926 '--helicity':'-1','--seed':'-1','--collier_cache':'-1',931 '--helicity':'-1','--seed':'-1','--collier_cache':'-1',
927 '--collier_req_acc':'auto',932 '--collier_req_acc':'auto',
928 '--collier_internal_stability_test':'False',933 '--collier_internal_stability_test':'False',
929 '--collier_mode':'1'} 934 '--collier_mode':'1',
935 '--events': None,
936 '--skip_evt':0}
930937
931 if args[0] in ['cms'] or args[0].lower()=='cmsoptions':938 if args[0] in ['cms'] or args[0].lower()=='cmsoptions':
932 # increase the default energy to 5000939 # increase the default energy to 5000
@@ -1075,7 +1082,7 @@
1075 1082
1076 if '[' in process and '{' in process:1083 if '[' in process and '{' in process:
1077 valid = False1084 valid = False
1078 if 'noborn' in process:1085 if 'noborn' in process or 'sqrvirt' in process:
1079 valid = True1086 valid = True
1080 else:1087 else:
1081 raise self.InvalidCmd('Polarization restriction can not be used for NLO processes')1088 raise self.InvalidCmd('Polarization restriction can not be used for NLO processes')
@@ -1670,7 +1677,7 @@
1670 continue1677 continue
1671 elif not '=' in arg:1678 elif not '=' in arg:
1672 raise self.InvalidCmd('Options required an equal (and then the value)')1679 raise self.InvalidCmd('Options required an equal (and then the value)')
1673 arg, value = arg.split('=')1680 arg, value = arg.split('=',1)
1674 if arg[2:] not in options:1681 if arg[2:] not in options:
1675 raise self.InvalidCmd('%s not valid options' % arg)1682 raise self.InvalidCmd('%s not valid options' % arg)
1676 options[arg[2:]] = value1683 options[arg[2:]] = value
@@ -2832,7 +2839,7 @@
2832 _import_formats = ['model_v4', 'model', 'proc_v4', 'command', 'banner']2839 _import_formats = ['model_v4', 'model', 'proc_v4', 'command', 'banner']
2833 _install_opts = ['Delphes', 'MadAnalysis4', 'ExRootAnalysis',2840 _install_opts = ['Delphes', 'MadAnalysis4', 'ExRootAnalysis',
2834 'update', 'Golem95', 'QCDLoop', 'maddm', 'maddump',2841 'update', 'Golem95', 'QCDLoop', 'maddm', 'maddump',
2835 'looptools']2842 'looptools', 'MadSTR']
2836 2843
2837 # The targets below are installed using the HEPToolsInstaller.py script2844 # The targets below are installed using the HEPToolsInstaller.py script
2838 _advanced_install_opts = ['pythia8','zlib','boost','lhapdf6','lhapdf5','collier',2845 _advanced_install_opts = ['pythia8','zlib','boost','lhapdf6','lhapdf5','collier',
@@ -3869,6 +3876,15 @@
3869 option = args[i].split('=')3876 option = args[i].split('=')
3870 if option[0] =='--energy':3877 if option[0] =='--energy':
3871 options['energy']=float(option[1])3878 options['energy']=float(option[1])
3879 elif option[0] == '--events' and option[1]:
3880 if option[1] == 'None':
3881 options['events'] = None
3882 elif not os.path.exists(option[1]):
3883 raise Exception, 'path %s does not exists' % option[1]
3884 else:
3885 options['events'] = option[1]
3886 elif option[0] == '--skip_evt':
3887 options['skip_evt']=int(option[1])
3872 elif option[0]=='--split_orders':3888 elif option[0]=='--split_orders':
3873 options['split_orders']=int(option[1])3889 options['split_orders']=int(option[1])
3874 elif option[0]=='--helicity':3890 elif option[0]=='--helicity':
@@ -5615,7 +5631,7 @@
5615 #self.do_define(line)5631 #self.do_define(line)
5616 self.exec_cmd('define %s' % line, printcmd=False, precmd=True)5632 self.exec_cmd('define %s' % line, printcmd=False, precmd=True)
5617 except self.InvalidCmd, why:5633 except self.InvalidCmd, why:
5618 logger_stderr.warning('impossible to set default multiparticles %s because %s' %5634 logger.warning('impossible to set default multiparticles %s because %s' %
5619 (line.split()[0],why))5635 (line.split()[0],why))
5620 if self.history[-1] == 'define %s' % line.strip():5636 if self.history[-1] == 'define %s' % line.strip():
5621 self.history.pop(-1)5637 self.history.pop(-1)
@@ -5985,7 +6001,7 @@
5985 # Return true for successful installation6001 # Return true for successful installation
5986 return True6002 return True
59876003
5988 install_plugin = ['maddm', 'maddump']6004 install_plugin = ['maddm', 'maddump', 'MadSTR']
5989 install_ad = {'pythia-pgs':['arXiv:0603175'],6005 install_ad = {'pythia-pgs':['arXiv:0603175'],
5990 'Delphes':['arXiv:1307.6346'],6006 'Delphes':['arXiv:1307.6346'],
5991 'Delphes2':['arXiv:0903.2225'],6007 'Delphes2':['arXiv:0903.2225'],
@@ -6003,7 +6019,8 @@
6003 'collier':['arXiv:1604.06792'],6019 'collier':['arXiv:1604.06792'],
6004 'oneloop':['arXiv:1007.4716'],6020 'oneloop':['arXiv:1007.4716'],
6005 'maddm':['arXiv:1804.00444'],6021 'maddm':['arXiv:1804.00444'],
6006 'maddump':['arXiv:1812.06771']}6022 'maddump':['arXiv:1812.06771'],
6023 'MadSTR':['arXiv:1612.00440']}
6007 6024
6008 install_server = ['http://madgraph.phys.ucl.ac.be/package_info.dat',6025 install_server = ['http://madgraph.phys.ucl.ac.be/package_info.dat',
6009 'http://madgraph.physics.illinois.edu/package_info.dat']6026 'http://madgraph.physics.illinois.edu/package_info.dat']
@@ -6129,7 +6146,10 @@
6129 name = args[0]6146 name = args[0]
6130 if args[0] == 'MadAnalysis4':6147 if args[0] == 'MadAnalysis4':
6131 args[0] = 'MadAnalysis'6148 args[0] = 'MadAnalysis'
6132 6149 elif args[0] in ['madstr', 'madSTR']:
6150 args[0] = 'MadSTR'
6151 name = 'MadSTR'
6152
6133 if args[0] in self._advanced_install_opts:6153 if args[0] in self._advanced_install_opts:
6134 # Now launch the advanced installation of the tool args[0]6154 # Now launch the advanced installation of the tool args[0]
6135 # path['HEPToolsInstaller'] is the online adress where to downlaod6155 # path['HEPToolsInstaller'] is the online adress where to downlaod
@@ -6352,6 +6372,7 @@
6352 cwd = os.path.join(MG5DIR, name))6372 cwd = os.path.join(MG5DIR, name))
6353 else:6373 else:
6354 status = misc.call(['make']+make_flags, cwd = os.path.join(MG5DIR, name))6374 status = misc.call(['make']+make_flags, cwd = os.path.join(MG5DIR, name))
6375 devnull.close()
6355 else:6376 else:
6356 try:6377 try:
6357 misc.compile(['clean'], mode='', cwd = os.path.join(MG5DIR, name))6378 misc.compile(['clean'], mode='', cwd = os.path.join(MG5DIR, name))
@@ -6400,18 +6421,18 @@
64006421
6401 if sys.platform == "darwin":6422 if sys.platform == "darwin":
6402 logger.info('Downloading TD for Mac')6423 logger.info('Downloading TD for Mac')
6403 target = 'http://madgraph.phys.ucl.ac.be/Downloads/td_mac_intel.tar.gz'6424 target = 'https://home.fnal.gov/~parke/TD/td_mac_intel64.tar.gz'
6404 misc.wget(target, 'td.tgz', cwd=pjoin(MG5DIR,'td'))6425 misc.wget(target, 'td.tgz', cwd=pjoin(MG5DIR,'td'))
6405 misc.call(['tar', '-xzpvf', 'td.tgz'],6426 misc.call(['tar', '-xzpvf', 'td.tgz'],
6406 cwd=pjoin(MG5DIR,'td'))6427 cwd=pjoin(MG5DIR,'td'))
6407 files.mv(MG5DIR + '/td/td_mac_intel',MG5DIR+'/td/td')6428 files.mv(MG5DIR + '/td/td_intel_mac64',MG5DIR+'/td/td')
6408 else:6429 else:
6409 if sys.maxsize > 2**32:6430 if sys.maxsize > 2**32:
6410 logger.info('Downloading TD for Linux 64 bit')6431 logger.info('Downloading TD for Linux 64 bit')
6411 target = 'http://madgraph.phys.ucl.ac.be/Downloads/td64/td'6432 target = 'https://home.fnal.gov/~parke/TD/td_linux_64bit.tar.gz'
6412 logger.warning('''td program (needed by MadAnalysis) is not compile for 64 bit computer.6433 #logger.warning('''td program (needed by MadAnalysis) is not compile for 64 bit computer.
6413 In 99% of the case, this is perfectly fine. If you do not have plot, please follow 6434 #In 99% of the case, this is perfectly fine. If you do not have plot, please follow
6414 instruction in https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/TopDrawer .''')6435 #instruction in https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/TopDrawer .''')
6415 else: 6436 else:
6416 logger.info('Downloading TD for Linux 32 bit')6437 logger.info('Downloading TD for Linux 32 bit')
6417 target = 'http://madgraph.phys.ucl.ac.be/Downloads/td'6438 target = 'http://madgraph.phys.ucl.ac.be/Downloads/td'
64186439
=== modified file 'madgraph/interface/master_interface.py'
--- madgraph/interface/master_interface.py 2019-09-26 14:06:19 +0000
+++ madgraph/interface/master_interface.py 2020-06-21 12:17:46 +0000
@@ -215,6 +215,8 @@
215 elif nlo_mode in ['virt', 'sqrvirt']:215 elif nlo_mode in ['virt', 'sqrvirt']:
216 self.change_principal_cmd('MadLoop', allow_switch)216 self.change_principal_cmd('MadLoop', allow_switch)
217 elif nlo_mode == 'noborn': 217 elif nlo_mode == 'noborn':
218 if self.current_interface == "MadGraph":
219 allow_switch = True
218 self.change_principal_cmd('MadLoop', allow_switch)220 self.change_principal_cmd('MadLoop', allow_switch)
219 self.cmd.validate_model(self, loop_type=nlo_mode,221 self.cmd.validate_model(self, loop_type=nlo_mode,
220 coupling_type=orders)222 coupling_type=orders)
221223
=== modified file 'madgraph/interface/reweight_interface.py'
--- madgraph/interface/reweight_interface.py 2020-01-15 18:23:15 +0000
+++ madgraph/interface/reweight_interface.py 2020-06-21 12:17:46 +0000
@@ -58,7 +58,7 @@
58nb_f2py_module = 0 # each time the process/model is changed this number is modified to 58nb_f2py_module = 0 # each time the process/model is changed this number is modified to
59 # forced the python module to re-create an executable59 # forced the python module to re-create an executable
6060
61lhapdf = None61#lhapdf = None
6262
6363
64class ReweightInterface(extended_cmd.Cmd):64class ReweightInterface(extended_cmd.Cmd):
@@ -688,7 +688,8 @@
688 for i,card in enumerate(param_card_iterator):688 for i,card in enumerate(param_card_iterator):
689 if self.options['rwgt_name']:689 if self.options['rwgt_name']:
690 self.options['rwgt_name'] = '%s_%s' % (self.options['rwgt_name'].rsplit('_',1)[0], i+1)690 self.options['rwgt_name'] = '%s_%s' % (self.options['rwgt_name'].rsplit('_',1)[0], i+1)
691 card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))691 self.new_param_card = card
692 #card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
692 self.exec_cmd("launch --keep_card", printcmd=False, precmd=True)693 self.exec_cmd("launch --keep_card", printcmd=False, precmd=True)
693 694
694 self.options['rwgt_name'] = None695 self.options['rwgt_name'] = None
@@ -708,24 +709,23 @@
708 709
709 710
710 if not '--keep_card' in args:711 if not '--keep_card' in args:
711 ff = open(pjoin(rw_dir,'Cards', 'param_card.dat'), 'w')
712 ff.write(self.banner['slha'])
713 ff.close()
714 if self.has_nlo and self.rwgt_mode != "LO":712 if self.has_nlo and self.rwgt_mode != "LO":
715 rwdir_virt = rw_dir.replace('rw_me', 'rw_mevirt')713 rwdir_virt = rw_dir.replace('rw_me', 'rw_mevirt')
716 files.ln(ff.name, starting_dir=pjoin(rwdir_virt, 'Cards')) 714
717 ff = open(pjoin(path_me, 'rw_me','Cards', 'param_card_orig.dat'), 'w')715 out, cmd = common_run_interface.CommonRunCmd.ask_edit_card_static(cards=['param_card.dat'],
718 ff.write(self.banner['slha'])716 ask=self.ask, pwd=rw_dir, first_cmd=self.stored_line,
719 ff.close() 717 write_file=False, return_instance=True
720 if self.has_nlo and self.rwgt_mode != "LO":718 )
721 files.ln(ff.name, starting_dir=pjoin(path_me, 'rw_mevirt', 'Cards'))
722 cmd = common_run_interface.CommonRunCmd.ask_edit_card_static(cards=['param_card.dat'],
723 ask=self.ask, pwd=rw_dir, first_cmd=self.stored_line)
724 self.stored_line = None719 self.stored_line = None
725 720 card = cmd.param_card
721 new_card = card.write()
722 elif self.new_param_card:
723 new_card = self.new_param_card.write()
724 else:
725 new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()
726
726 # check for potential scan in the new card 727 # check for potential scan in the new card
727 new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()728 pattern_scan = re.compile(r'''^(decay)?[\s\d]*scan''', re.I+re.M)
728 pattern_scan = re.compile(r'''^[\s\d]*scan''', re.I+re.M)
729 param_card_iterator = []729 param_card_iterator = []
730 if pattern_scan.search(new_card):730 if pattern_scan.search(new_card):
731 try:731 try:
@@ -744,11 +744,19 @@
744 param_card_iterator = main_card744 param_card_iterator = main_card
745 first_card = param_card_iterator.next(autostart=True)745 first_card = param_card_iterator.next(autostart=True)
746 new_card = first_card.write()746 new_card = first_card.write()
747 first_card.write(pjoin(rw_dir, 'Cards', 'param_card.dat')) 747 self.new_param_card = first_card
748 748 #first_card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
749 # check if "Auto" is present for a width parameter749
750 # check if "Auto" is present for a width parameter)
750 tmp_card = new_card.lower().split('block',1)[1]751 tmp_card = new_card.lower().split('block',1)[1]
751 if "auto" in tmp_card: 752 if "auto" in tmp_card:
753 if param_card_iterator:
754 first_card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
755 else:
756 ff = open(pjoin(rw_dir, 'Cards', 'param_card.dat'),'w')
757 ff.write(new_card)
758 ff.close()
759
752 self.mother.check_param_card(pjoin(rw_dir, 'Cards', 'param_card.dat'))760 self.mother.check_param_card(pjoin(rw_dir, 'Cards', 'param_card.dat'))
753 new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()761 new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()
754762
@@ -795,6 +803,7 @@
795 # add the reweighting in the banner information:803 # add the reweighting in the banner information:
796 #starts by computing the difference in the cards.804 #starts by computing the difference in the cards.
797 s_orig = self.banner['slha']805 s_orig = self.banner['slha']
806 self.orig_param_card_text = s_orig
798 s_new = new_card807 s_new = new_card
799 self.new_param_card = check_param_card.ParamCard(s_new.splitlines())808 self.new_param_card = check_param_card.ParamCard(s_new.splitlines())
800 809
@@ -866,15 +875,25 @@
866 else:875 else:
867 tag_name = 'rwgt_%s' % rewgtid876 tag_name = 'rwgt_%s' % rewgtid
868877
878
869 #initialise module.879 #initialise module.
870 for (path,tag), module in self.f2pylib.items():880 for (path,tag), module in self.f2pylib.items():
871 with misc.chdir(pjoin(os.path.dirname(rw_dir), path)):881 with misc.chdir(pjoin(os.path.dirname(rw_dir), path)):
872 with misc.stdchannel_redirected(sys.stdout, os.devnull):882 with misc.stdchannel_redirected(sys.stdout, os.devnull):
873 if 'second' in path or tag == 3:883 if 'second' in path or tag == 3:
874 module.initialise(pjoin(rw_dir, 'Cards', 'param_card.dat'))884 param_card = self.new_param_card
875 else:885 else:
876 module.initialise(pjoin(path_me, 'rw_me', 'Cards', 'param_card_orig.dat'))886 param_card = check_param_card.ParamCard(self.orig_param_card_text)
887
888 for block in param_card:
877889
890 for param in param_card[block]:
891 lhacode = param.lhacode
892 value = param.value
893 name = '%s_%s' % (block.upper(), '_'.join([str(i) for i in lhacode]))
894 module.change_para(name, value)
895 module.update_all_coup()
896
878 return param_card_iterator, tag_name897 return param_card_iterator, tag_name
879898
880 899
@@ -961,8 +980,10 @@
961 def calculate_weight(self, event):980 def calculate_weight(self, event):
962 """space defines where to find the calculator (in multicore)"""981 """space defines where to find the calculator (in multicore)"""
963 982
964 global lhapdf983 if not hasattr(self,'pdf'):
965 984 lhapdf = misc.import_python_lhapdf(self.mg5cmd.options['lhapdf'])
985 self.pdf = lhapdf.mkPDF(self.banner.run_card.get_lhapdf_id())
986
966 if self.has_nlo and self.rwgt_mode != "LO":987 if self.has_nlo and self.rwgt_mode != "LO":
967 return self.calculate_nlo_weight(event)988 return self.calculate_nlo_weight(event)
968 989
@@ -1075,19 +1096,20 @@
1075 1096
1076 base_wgt.append(c_wgt.pwgt[:3])1097 base_wgt.append(c_wgt.pwgt[:3])
1077 1098
1078 #change the ordering to the fortran one:1099
1079 scales2 = self.invert_momenta(scales2)1100 orig_wgt_check, partial_check = self.combine_wgt_local(scales2, pdg, bjx, base_wgt, gs, qcdpower, self.pdf)
1080 pdg = self.invert_momenta(pdg)1101 #change the ordering to the fortran one:
1081 bjx = self.invert_momenta(bjx)1102 #scales2_i = self.invert_momenta(scales2)
1103 #pdg_i = self.invert_momenta(pdg)
1104 #bjx_i = self.invert_momenta(bjx)
1082 # re-compute original weight to reduce numerical inacurracy1105 # re-compute original weight to reduce numerical inacurracy
1083 base_wgt = self.invert_momenta(base_wgt)1106 #base_wgt_i = self.invert_momenta(base_wgt)
1084 1107 #orig_wgt_check, partial_check = self.combine_wgt(scales2_i, pdg_i, bjx_i, base_wgt_i, gs, qcdpower, 1., 1.)
1085 orig_wgt_check, partial_check = self.combine_wgt(scales2, pdg, bjx, base_wgt, gs, qcdpower, 1., 1.)
1086 1108
1087 if '_nlo' in type_nlo:1109 if '_nlo' in type_nlo:
1088 wgt = self.invert_momenta(wgt_virt)1110 #wgt = self.invert_momenta(wgt_virt)
1089 with misc.stdchannel_redirected(sys.stdout, os.devnull):1111 with misc.stdchannel_redirected(sys.stdout, os.devnull):
1090 new_out, partial = self.combine_wgt(scales2, pdg, bjx, wgt, gs, qcdpower, 1., 1.)1112 new_out, partial = self.combine_wgt_local(scales2, pdg, bjx, wgt_virt, gs, qcdpower, self.pdf)
1091 # try to correct for precision issue1113 # try to correct for precision issue
1092 avg = [partial_check[i]/ref_wgts[i] for i in range(len(ref_wgts))]1114 avg = [partial_check[i]/ref_wgts[i] for i in range(len(ref_wgts))]
1093 out = sum(partial[i]/avg[i] if 0.85<avg[i]<1.15 else 0 \1115 out = sum(partial[i]/avg[i] if 0.85<avg[i]<1.15 else 0 \
@@ -1096,9 +1118,9 @@
10961118
1097 1119
1098 if '_tree' in type_nlo:1120 if '_tree' in type_nlo:
1099 wgt = self.invert_momenta(wgt_tree)1121 #wgt = self.invert_momenta(wgt_tree)
1100 with misc.stdchannel_redirected(sys.stdout, os.devnull):1122 with misc.stdchannel_redirected(sys.stdout, os.devnull):
1101 out, partial = self.combine_wgt(scales2, pdg, bjx, wgt, gs, qcdpower, 1., 1.)1123 out, partial = self.combine_wgt_local(scales2, pdg, bjx, wgt_tree, gs, qcdpower, self.pdf)
1102 # try to correct for precision issue1124 # try to correct for precision issue
1103 avg = [partial_check[i]/ref_wgts[i] for i in range(len(ref_wgts))]1125 avg = [partial_check[i]/ref_wgts[i] for i in range(len(ref_wgts))]
1104 new_out = sum(partial[i]/avg[i] if 0.85<avg[i]<1.15 else partial[i] \1126 new_out = sum(partial[i]/avg[i] if 0.85<avg[i]<1.15 else partial[i] \
@@ -1126,7 +1148,25 @@
1126 assert not to_write1148 assert not to_write
1127 assert not wgt_tree1149 assert not wgt_tree
1128 return final_weight 1150 return final_weight
1151
1152
1153 def combine_wgt_local(self, scale2s, pdgs, bjxs, base_wgts, gss, qcdpowers, pdf):
1154
1155 wgt = 0.
1156 wgts = []
1157 for (scale2, pdg, bjx, base_wgt, gs, qcdpower) in zip(scale2s, pdgs, bjxs, base_wgts, gss, qcdpowers):
1158 Q2, mur2, muf2 = scale2 #Q2 is Ellis-Sexton scale
1159 #misc.sprint(Q2, mur2, muf2, base_wgt, gs, qcdpower)
1160 pdf1 = pdf.xfxQ2(pdg[0], bjx[0], muf2)/bjx[0]
1161 pdf2 = pdf.xfxQ2(pdg[1], bjx[1], muf2)/bjx[1]
1162 alphas = pdf.alphasQ2(mur2)
1163 tmp = base_wgt[0] + base_wgt[1] * math.log(mur2/Q2) + base_wgt[2] * math.log(muf2/Q2)
1164 tmp *= gs**qcdpower*pdf1*pdf2
1165 wgt += tmp
1166 wgts.append(tmp)
1167 return wgt, wgts
1129 1168
1169
1130 1170
1131 @staticmethod 1171 @staticmethod
1132 def invert_momenta(p):1172 def invert_momenta(p):
@@ -1450,10 +1490,9 @@
1450 commandline = re.sub('@\s*\d+', '', commandline)1490 commandline = re.sub('@\s*\d+', '', commandline)
1451 # deactivate golem since it creates troubles1491 # deactivate golem since it creates troubles
1452 old_options = dict(mgcmd.options)1492 old_options = dict(mgcmd.options)
1453 if mgcmd.options['golem'] or mgcmd.options['pjfry']:1493 if mgcmd.options['golem']:
1454 logger.info(" When doing NLO reweighting, MG5aMC cannot use the loop reduction algorithms Golem and/or PJFry++")1494 logger.info(" When doing NLO reweighting, MG5aMC cannot use the loop reduction algorithms Golem")
1455 mgcmd.options['golem'] = None 1495 mgcmd.options['golem'] = None
1456 mgcmd.options['pjfry'] = None
1457 commandline = commandline.replace('add process', 'generate',1)1496 commandline = commandline.replace('add process', 'generate',1)
1458 logger.info(commandline)1497 logger.info(commandline)
1459 mgcmd.exec_cmd(commandline, precmd=True)1498 mgcmd.exec_cmd(commandline, precmd=True)
@@ -1462,22 +1501,10 @@
1462 1501
1463 #put back golem to original value1502 #put back golem to original value
1464 mgcmd.options['golem'] = old_options['golem']1503 mgcmd.options['golem'] = old_options['golem']
1465 mgcmd.options['pjfry'] = old_options['pjfry']
1466 # update make_opts1504 # update make_opts
1467 m_opts = {}1505 if not mgcmd.options['lhapdf']:
1468 if mgcmd.options['lhapdf']:
1469 #lhapdfversion = subprocess.Popen([mgcmd.options['lhapdf'], '--version'],
1470 # stdout = subprocess.PIPE).stdout.read().strip()[0]
1471 m_opts['lhapdf'] = True
1472 m_opts['f2pymode'] = True
1473 m_opts['lhapdfversion'] = 5 # 6 always fail on my computer since 5 is compatible but slower always use 5
1474 m_opts['llhapdf'] = self.mother.get_lhapdf_libdir()
1475 else:
1476 raise Exception, "NLO reweighting requires LHAPDF to work correctly"1506 raise Exception, "NLO reweighting requires LHAPDF to work correctly"
14771507
1478 path = pjoin(path_me,data['paths'][1], 'Source', 'make_opts')
1479 common_run_interface.CommonRunCmd.update_make_opts_full(path, m_opts)
1480 logger.info('Done %.4g' % (time.time()-start))
14811508
14821509
1483 # Download LHAPDF SET1510 # Download LHAPDF SET
@@ -1635,7 +1662,7 @@
1635 elif has_nlo and 'NLO' in self.rwgt_mode:1662 elif has_nlo and 'NLO' in self.rwgt_mode:
1636 self.create_standalone_virt_directory(data, second)1663 self.create_standalone_virt_directory(data, second)
1637 1664
1638 if not second:1665 if False:#not second:
1639 #compile the module to combine the weight1666 #compile the module to combine the weight
1640 misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))1667 misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))
1641 #link it 1668 #link it
@@ -1666,8 +1693,7 @@
1666 commandline='import model loop_sm;generate g g > e+ ve [virt=QCD]'1693 commandline='import model loop_sm;generate g g > e+ ve [virt=QCD]'
1667 # deactivate golem since it creates troubles1694 # deactivate golem since it creates troubles
1668 old_options = dict(mgcmd.options)1695 old_options = dict(mgcmd.options)
1669 mgcmd.options['golem'] = None 1696 mgcmd.options['golem'] = None
1670 mgcmd.options['pjfry'] = None
1671 commandline = commandline.replace('add process', 'generate',1)1697 commandline = commandline.replace('add process', 'generate',1)
1672 logger.info(commandline)1698 logger.info(commandline)
1673 mgcmd.exec_cmd(commandline, precmd=True)1699 mgcmd.exec_cmd(commandline, precmd=True)
@@ -1675,41 +1701,30 @@
1675 mgcmd.exec_cmd(commandline, precmd=True) 1701 mgcmd.exec_cmd(commandline, precmd=True)
1676 #put back golem to original value1702 #put back golem to original value
1677 mgcmd.options['golem'] = old_options['golem']1703 mgcmd.options['golem'] = old_options['golem']
1678 mgcmd.options['pjfry'] = old_options['pjfry']
1679 # update make_opts1704 # update make_opts
1680 m_opts = {}1705 if not mgcmd.options['lhapdf']:
1681 if mgcmd.options['lhapdf']:
1682 #lhapdfversion = subprocess.Popen([mgcmd.options['lhapdf'], '--version'],
1683 # stdout = subprocess.PIPE).stdout.read().strip()[0]
1684 m_opts['lhapdf'] = True
1685 m_opts['f2pymode'] = True
1686 m_opts['lhapdfversion'] = 5 # 6 always fail on my computer since 5 is compatible but slower always use 5
1687 m_opts['llhapdf'] = self.mother.get_lhapdf_libdir()
1688 else:
1689 raise Exception, "NLO_tree reweighting requires LHAPDF to work correctly"1706 raise Exception, "NLO_tree reweighting requires LHAPDF to work correctly"
1690 1707
1691 path = pjoin(path_me,data['paths'][1], 'Source', 'make_opts')
1692 common_run_interface.CommonRunCmd.update_make_opts_full(path, m_opts)
1693 logger.info('Done %.4g' % (time.time()-start))
1694
1695 # Download LHAPDF SET1708 # Download LHAPDF SET
1696 common_run_interface.CommonRunCmd.install_lhapdf_pdfset_static(\1709 common_run_interface.CommonRunCmd.install_lhapdf_pdfset_static(\
1697 mgcmd.options['lhapdf'], None, self.banner.run_card.get_lhapdf_id())1710 mgcmd.options['lhapdf'], None, self.banner.run_card.get_lhapdf_id())
1698 1711
1699 #compile the module to combine the weight1712 #compile the module to combine the weight
1700 misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))1713 if False:
1701 #link it 1714 #use python module instead
1702 with misc.chdir(pjoin(path_me)):1715 misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))
1703 if path_me not in sys.path:1716 #link it
1704 sys.path.insert(0, path_me)1717 with misc.chdir(pjoin(path_me)):
1705 mymod = __import__('%s.Source.rwgt2py' % data['paths'][1], globals(), locals(), [],-1)1718 if path_me not in sys.path:
1706 mymod = mymod.Source.rwgt2py1719 sys.path.insert(0, path_me)
1707 with misc.stdchannel_redirected(sys.stdout, os.devnull):1720 mymod = __import__('%s.Source.rwgt2py' % data['paths'][1], globals(), locals(), [],-1)
1708 mymod.initialise([self.banner.run_card['lpp1'], 1721 mymod = mymod.Source.rwgt2py
1709 self.banner.run_card['lpp2']],1722 with misc.stdchannel_redirected(sys.stdout, os.devnull):
1710 self.banner.run_card.get_lhapdf_id())1723 mymod.initialise([self.banner.run_card['lpp1'],
1711 self.combine_wgt = mymod.get_wgt1724 self.banner.run_card['lpp2']],
1712 1725 self.banner.run_card.get_lhapdf_id())
1726 self.combine_wgt = mymod.get_wgt
1727
1713 1728
1714 # 6. If we need a new model/process-------------------------------------1729 # 6. If we need a new model/process-------------------------------------
1715 if (self.second_model or self.second_process or self.dedicated_path) and not second :1730 if (self.second_model or self.second_process or self.dedicated_path) and not second :
@@ -1895,6 +1910,7 @@
1895 to_save['has_nlo'] = self.has_nlo1910 to_save['has_nlo'] = self.has_nlo
1896 to_save['rwgt_mode'] = self.rwgt_mode1911 to_save['rwgt_mode'] = self.rwgt_mode
1897 to_save['rwgt_name'] = self.options['rwgt_name']1912 to_save['rwgt_name'] = self.options['rwgt_name']
1913 to_save['allow_missing_finalstate'] = self.options['allow_missing_finalstate']
18981914
1899 name = pjoin(self.rwgt_dir, 'rw_me', 'rwgt.pkl')1915 name = pjoin(self.rwgt_dir, 'rw_me', 'rwgt.pkl')
1900 save_load_object.save_to_file(name, to_save)1916 save_load_object.save_to_file(name, to_save)
@@ -1910,7 +1926,7 @@
1910 'rwgt_name': None}1926 'rwgt_name': None}
1911 if keep_name:1927 if keep_name:
1912 self.options['rwgt_name'] = obj['rwgt_name']1928 self.options['rwgt_name'] = obj['rwgt_name']
1913 1929 self.options['allow_missing_finalstate'] = obj['allow_missing_finalstate']
1914 old_rwgt = obj['rwgt_dir']1930 old_rwgt = obj['rwgt_dir']
1915 1931
1916 # path to fortran executable1932 # path to fortran executable
@@ -1933,7 +1949,8 @@
1933 if not self.rwgt_mode:1949 if not self.rwgt_mode:
1934 self.rwgt_mode = obj['rwgt_mode']1950 self.rwgt_mode = obj['rwgt_mode']
1935 logger.info("mode set to %s" % self.rwgt_mode)1951 logger.info("mode set to %s" % self.rwgt_mode)
1936 if self.has_nlo and 'NLO' in self.rwgt_mode:1952 if False:#self.has_nlo and 'NLO' in self.rwgt_mode:
1953 #use python version
1937 path = pjoin(obj['rwgt_dir'], 'rw_mevirt','Source')1954 path = pjoin(obj['rwgt_dir'], 'rw_mevirt','Source')
1938 sys.path.insert(0, path)1955 sys.path.insert(0, path)
1939 try:1956 try:
19401957
=== modified file 'madgraph/iolibs/export_v4.py'
--- madgraph/iolibs/export_v4.py 2020-03-10 15:07:48 +0000
+++ madgraph/iolibs/export_v4.py 2020-06-21 12:17:46 +0000
@@ -12,7 +12,6 @@
12# For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch12# For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch
13#13#
14################################################################################14################################################################################
15from madgraph.iolibs.helas_call_writers import HelasCallWriter
16"""Methods and classes to export matrix elements to v4 format."""15"""Methods and classes to export matrix elements to v4 format."""
1716
18import copy17import copy
@@ -881,7 +880,7 @@
881 # Make sure aloha is in quadruple precision if needed880 # Make sure aloha is in quadruple precision if needed
882 old_aloha_mp=aloha.mp_precision881 old_aloha_mp=aloha.mp_precision
883 aloha.mp_precision=self.opt['mp']882 aloha.mp_precision=self.opt['mp']
884883 self.model = model
885 # create the MODEL884 # create the MODEL
886 write_dir=pjoin(self.dir_path, 'Source', 'MODEL')885 write_dir=pjoin(self.dir_path, 'Source', 'MODEL')
887 model_builder = UFO_model_to_mg4(model, write_dir, self.opt + self.proc_characteristic)886 model_builder = UFO_model_to_mg4(model, write_dir, self.opt + self.proc_characteristic)
@@ -2035,7 +2034,7 @@
2035 open(pjoin(self.dir_path,'__init__.py'),'w')2034 open(pjoin(self.dir_path,'__init__.py'),'w')
2036 open(pjoin(self.dir_path,'SubProcesses','__init__.py'),'w')2035 open(pjoin(self.dir_path,'SubProcesses','__init__.py'),'w')
20372036
2038 if 'mode' in self.opt and self.opt['mode'] == "reweight":2037 if False:#'mode' in self.opt and self.opt['mode'] == "reweight":
2039 #add the module to hande the NLO weight2038 #add the module to hande the NLO weight
2040 files.copytree(pjoin(MG5DIR, 'Template', 'RWGTNLO'),2039 files.copytree(pjoin(MG5DIR, 'Template', 'RWGTNLO'),
2041 pjoin(self.dir_path, 'Source'))2040 pjoin(self.dir_path, 'Source'))
@@ -2043,7 +2042,7 @@
2043 pjoin(self.dir_path, 'Source', 'PDF'))2042 pjoin(self.dir_path, 'Source', 'PDF'))
2044 self.write_pdf_opendata()2043 self.write_pdf_opendata()
2045 2044
2046 if self.prefix_info:2045 if self.prefix_info:
2047 self.write_f2py_splitter()2046 self.write_f2py_splitter()
2048 self.write_f2py_makefile()2047 self.write_f2py_makefile()
2049 self.write_f2py_check_sa(matrix_elements,2048 self.write_f2py_check_sa(matrix_elements,
@@ -2100,6 +2099,34 @@
2100 CALL SETPARA(PATH) !first call to setup the paramaters2099 CALL SETPARA(PATH) !first call to setup the paramaters
2101 RETURN2100 RETURN
2102 END2101 END
2102
2103
2104 subroutine CHANGE_PARA(name, value)
2105 implicit none
2106CF2PY intent(in) :: name
2107CF2PY intent(in) :: value
2108
2109 character*512 name
2110 double precision value
2111
2112 include '../Source/MODEL/input.inc'
2113 include '../Source/MODEL/coupl.inc'
2114
2115 SELECT CASE (name)
2116 %(parameter_setup)s
2117 CASE DEFAULT
2118 write(*,*) 'no parameter matching', name, value
2119 END SELECT
2120
2121 return
2122 end
2123
2124 subroutine update_all_coup()
2125 implicit none
2126 call coup()
2127 return
2128 end
2129
21032130
2104 subroutine get_pdg_order(PDG)2131 subroutine get_pdg_order(PDG)
2105 IMPLICIT NONE2132 IMPLICIT NONE
@@ -2154,20 +2181,46 @@
2154 if min_nexternal != max_nexternal:2181 if min_nexternal != max_nexternal:
2155 text.append('endif')2182 text.append('endif')
21562183
2184 params = self.get_model_parameter(self.model)
2185 parameter_setup =[]
2186 for key, var in params.items():
2187 parameter_setup.append(' CASE ("%s")\n %s = value'
2188 % (key, var))
2189
2157 formatting = {'python_information':'\n'.join(info), 2190 formatting = {'python_information':'\n'.join(info),
2158 'smatrixhel': '\n'.join(text),2191 'smatrixhel': '\n'.join(text),
2159 'maxpart': max_nexternal,2192 'maxpart': max_nexternal,
2160 'nb_me': len(allids),2193 'nb_me': len(allids),
2161 'pdgs': ','.join(str(pdg[i]) if i<len(pdg) else '0' 2194 'pdgs': ','.join(str(pdg[i]) if i<len(pdg) else '0'
2162 for i in range(max_nexternal) for pdg in allids),2195 for i in range(max_nexternal) for pdg in allids),
2163 'prefix':'\',\''.join(allprefix)2196 'prefix':'\',\''.join(allprefix),
2197 'parameter_setup': '\n'.join(parameter_setup),
2164 }2198 }
2165 formatting['lenprefix'] = len(formatting['prefix'])2199 formatting['lenprefix'] = len(formatting['prefix'])
2166 text = template % formatting2200 text = template % formatting
2167 fsock = writers.FortranWriter(pjoin(self.dir_path, 'SubProcesses', 'all_matrix.f'),'w')2201 fsock = writers.FortranWriter(pjoin(self.dir_path, 'SubProcesses', 'all_matrix.f'),'w')
2168 fsock.writelines(text)2202 fsock.writelines(text)
2169 fsock.close()2203 fsock.close()
2204
2205 def get_model_parameter(self, model):
2206 """ returns all the model parameter
2207 """
2208 params = {}
2209 for p in model.get('parameters')[('external',)]:
2210 name = p.name
2211 nopref = name[4:] if name.startswith('mdl_') else name
2212 params[nopref] = name
2170 2213
2214 block = p.lhablock
2215 lha = '_'.join([str(i) for i in p.lhacode])
2216 params['%s_%s' % (block.upper(), lha)] = name
2217
2218 return params
2219
2220
2221
2222
2223
2171 def write_f2py_check_sa(self, matrix_element, writer):2224 def write_f2py_check_sa(self, matrix_element, writer):
2172 """ Write the general check_sa.py in SubProcesses that calls all processes successively."""2225 """ Write the general check_sa.py in SubProcesses that calls all processes successively."""
2173 # To be implemented. It is just an example file, i.e. not crucial.2226 # To be implemented. It is just an example file, i.e. not crucial.
21742227
=== modified file 'madgraph/iolibs/file_writers.py'
--- madgraph/iolibs/file_writers.py 2018-05-03 09:00:52 +0000
+++ madgraph/iolibs/file_writers.py 2020-06-21 12:17:46 +0000
@@ -342,19 +342,28 @@
342 columns. Split in preferential order according to342 columns. Split in preferential order according to
343 split_characters, and start each new line with line_start."""343 split_characters, and start each new line with line_start."""
344344
345 res_lines = [line]345 def get_split_index(line, max_length, max_split, split_characters):
346
347 while len(res_lines[-1]) > self.line_length:
348 split_at = 0346 split_at = 0
349 for character in split_characters:347 for character in split_characters:
350 index = res_lines[-1][(self.line_length - self.max_split): \348 index = line[(max_length - max_split): \
351 self.line_length].rfind(character)349 max_length].rfind(character)
352 if index >= 0:350 if index >= 0:
353 split_at_tmp = self.line_length - self.max_split + index351 split_at_tmp = max_length - max_split + index
354 if split_at_tmp > split_at:352 if split_at_tmp > split_at:
355 split_at = split_at_tmp353 split_at = split_at_tmp
354 return split_at
355
356
357 res_lines = [line]
358
359 while len(res_lines[-1]) > self.line_length:
360 split_at = get_split_index(res_lines[-1], self.line_length,
361 self.max_split, split_characters)
356 if split_at == 0:362 if split_at == 0:
357 split_at = self.line_length363 split_at = get_split_index(res_lines[-1], self.line_length,
364 self.max_split + 30, split_characters)
365 if split_at == 0:
366 split_at = self.line_length
358 367
359 newline = res_lines[-1][split_at:]368 newline = res_lines[-1][split_at:]
360 nquotes = self.count_number_of_quotes(newline)369 nquotes = self.count_number_of_quotes(newline)
361370
=== modified file 'madgraph/iolibs/template_files/madevent_symmetry.f'
--- madgraph/iolibs/template_files/madevent_symmetry.f 2018-03-16 12:13:34 +0000
+++ madgraph/iolibs/template_files/madevent_symmetry.f 2020-06-21 12:17:46 +0000
@@ -103,7 +103,7 @@
103 if (abs(lpp(1)) .eq. 3) m1 = 0.000511d0103 if (abs(lpp(1)) .eq. 3) m1 = 0.000511d0
104 if (abs(lpp(2)) .eq. 3) m2 = 0.000511d0104 if (abs(lpp(2)) .eq. 3) m2 = 0.000511d0
105 if (mass_ion(1).ge.0d0) m1 = mass_ion(1)105 if (mass_ion(1).ge.0d0) m1 = mass_ion(1)
106 if (mass_ion(2).ge.0d0) m1 = mass_ion(2)106 if (mass_ion(2).ge.0d0) m2 = mass_ion(2)
107 if(ebeam(1).lt.m1.and.lpp(1).ne.9) ebeam(1)=m1107 if(ebeam(1).lt.m1.and.lpp(1).ne.9) ebeam(1)=m1
108 if(ebeam(2).lt.m2.and.lpp(2).ne.9) ebeam(2)=m2108 if(ebeam(2).lt.m2.and.lpp(2).ne.9) ebeam(2)=m2
109 pi1(0)=ebeam(1)109 pi1(0)=ebeam(1)
110110
=== modified file 'madgraph/loop/loop_exporters.py'
--- madgraph/loop/loop_exporters.py 2019-06-05 11:03:48 +0000
+++ madgraph/loop/loop_exporters.py 2020-06-21 12:17:46 +0000
@@ -297,6 +297,36 @@
297 RETURN297 RETURN
298 END298 END
299299
300 subroutine CHANGE_PARA(name, value)
301 implicit none
302CF2PY intent(in) :: name
303CF2PY intent(in) :: value
304
305 character*512 name
306 double precision value
307
308 include '../Source/MODEL/input.inc'
309 include '../Source/MODEL/coupl.inc'
310 include '../Source/MODEL/mp_coupl.inc'
311 include '../Source/MODEL/mp_input.inc'
312
313 SELECT CASE (name)
314 %(parameter_setup)s
315 CASE DEFAULT
316 write(*,*) 'no parameter matching', name
317 END SELECT
318
319 return
320 end
321
322 subroutine update_all_coup()
323 implicit none
324 call coup()
325 call printout()
326 return
327 end
328
329
300 SUBROUTINE SET_MADLOOP_PATH(PATH)330 SUBROUTINE SET_MADLOOP_PATH(PATH)
301C Routine to set the path of the folder 'MadLoop5_resources' to MadLoop331C Routine to set the path of the folder 'MadLoop5_resources' to MadLoop
302 CHARACTER(512) PATH332 CHARACTER(512) PATH
@@ -377,6 +407,14 @@
377 #close the function407 #close the function
378 if min_nexternal != max_nexternal:408 if min_nexternal != max_nexternal:
379 text.append('endif')409 text.append('endif')
410
411 params = self.get_model_parameter(self.model)
412 parameter_setup =[]
413 for key, var in params.items():
414 parameter_setup.append(' CASE ("%s")\n %s = value\n MP__%s = value'
415 % (key, var, var))
416
417
380418
381 formatting = {'python_information':'\n'.join(info), 419 formatting = {'python_information':'\n'.join(info),
382 'smatrixhel': '\n'.join(text),420 'smatrixhel': '\n'.join(text),
@@ -385,7 +423,8 @@
385 'pdgs': ','.join([str(pdg[i]) if i<len(pdg) else '0' 423 'pdgs': ','.join([str(pdg[i]) if i<len(pdg) else '0'
386 for i in range(max_nexternal) \424 for i in range(max_nexternal) \
387 for pdg in allids]),425 for pdg in allids]),
388 'prefix':'\',\''.join(allprefix)426 'prefix':'\',\''.join(allprefix),
427 'parameter_setup': '\n'.join(parameter_setup),
389 }428 }
390 429
391 430
392431
=== modified file 'madgraph/madevent/gen_crossxhtml.py'
--- madgraph/madevent/gen_crossxhtml.py 2018-05-25 09:13:24 +0000
+++ madgraph/madevent/gen_crossxhtml.py 2020-06-21 12:17:46 +0000
@@ -375,6 +375,9 @@
375 run[name] = int(value)375 run[name] = int(value)
376 elif name in ['run_mode','run_statistics']:376 elif name in ['run_mode','run_statistics']:
377 run[name] = value377 run[name] = value
378 elif name == 'cross' and run[name] != 0:
379 run['prev_' + name] = run[name]
380 run[name] = float(value)
378 else: 381 else:
379 run[name] = float(value) 382 run[name] = float(value)
380 383
381384
=== modified file 'madgraph/madevent/gen_ximprove.py'
--- madgraph/madevent/gen_ximprove.py 2020-02-25 14:05:36 +0000
+++ madgraph/madevent/gen_ximprove.py 2020-06-21 12:17:46 +0000
@@ -108,6 +108,10 @@
108 self.splitted_grid = self.run_card['survey_splitting']108 self.splitted_grid = self.run_card['survey_splitting']
109 if self.run_card['survey_nchannel_per_job'] != -1:109 if self.run_card['survey_nchannel_per_job'] != -1:
110 self.combining_job = self.run_card['survey_nchannel_per_job'] 110 self.combining_job = self.run_card['survey_nchannel_per_job']
111 elif self.run_card['hard_survey'] > 1:
112 self.combining_job = 1
113
114
111 115
112 self.splitted_Pdir = {}116 self.splitted_Pdir = {}
113 self.splitted_for_dir = lambda x,y: self.splitted_grid117 self.splitted_for_dir = lambda x,y: self.splitted_grid
@@ -971,7 +975,7 @@
971 super(gen_ximprove_v4, self).__init__(cmd, opt)975 super(gen_ximprove_v4, self).__init__(cmd, opt)
972 976
973 if cmd.opts['accuracy'] < cmd._survey_options['accuracy'][1]:977 if cmd.opts['accuracy'] < cmd._survey_options['accuracy'][1]:
974 self.increase_precision()978 self.increase_precision(cmd._survey_options['accuracy'][1]/cmd.opts['accuracy'])
975979
976 def reset_multijob(self):980 def reset_multijob(self):
977981
@@ -986,15 +990,23 @@
986 f.write('%i\n' % nb_split)990 f.write('%i\n' % nb_split)
987 f.close()991 f.close()
988 992
989 def increase_precision(self):993 def increase_precision(self, rate=3):
990 994 misc.sprint(rate)
991 self.max_event_in_iter = 20000995 if rate < 3:
992 self.min_events = 7500996 self.max_event_in_iter = 20000
997 self.min_events = 7500
998 self.gen_events_security = 1.3
999 else:
1000 rate = rate -2
1001 self.max_event_in_iter = int((rate+1) * 10000)
1002 self.min_events = int(rate+2) * 2500
1003 self.gen_events_security = 1 + 0.1 * (rate+2)
1004
993 if int(self.nhel) == 1:1005 if int(self.nhel) == 1:
994 self.min_event_in_iter *= 2**(self.cmd.proc_characteristics['nexternal']//3)1006 self.min_event_in_iter *= 2**(self.cmd.proc_characteristics['nexternal']//3)
995 self.max_event_in_iter *= 2**(self.cmd.proc_characteristics['nexternal']//2)1007 self.max_event_in_iter *= 2**(self.cmd.proc_characteristics['nexternal']//2)
9961008
997 self.gen_events_security = 1.31009
998 1010
999 alphabet = "abcdefghijklmnopqrstuvwxyz"1011 alphabet = "abcdefghijklmnopqrstuvwxyz"
1000 def get_job_for_event(self):1012 def get_job_for_event(self):
10011013
=== modified file 'madgraph/various/banner.py'
--- madgraph/various/banner.py 2020-03-08 20:49:57 +0000
+++ madgraph/various/banner.py 2020-06-21 12:17:46 +0000
@@ -3091,7 +3091,8 @@
3091 self.add_param('issgridfile', '', hidden=True)3091 self.add_param('issgridfile', '', hidden=True)
3092 #job handling of the survey/ refine3092 #job handling of the survey/ refine
3093 self.add_param('job_strategy', 0, hidden=True, include=False, allowed=[0,1,2], comment='see appendix of 1507.00020 (page 26)')3093 self.add_param('job_strategy', 0, hidden=True, include=False, allowed=[0,1,2], comment='see appendix of 1507.00020 (page 26)')
3094 self.add_param('hard_survey', False, hidden=True, include=False, comment='force to have better estimate of the integral at survey for difficult mode like VBF')3094 self.add_param('hard_survey', 0, hidden=True, include=False, comment='force to have better estimate of the integral at survey for difficult mode like VBF')
3095 self.add_param("second_refine_treshold", 0.9, hidden=True, include=False, comment="set a treshold to bypass the use of a second refine. if the ratio of cross-section after survey by the one of the first refine is above the treshold, the second refine will not be done.")
3095 self.add_param('survey_splitting', -1, hidden=True, include=False, comment="for loop-induced control how many core are used at survey for the computation of a single iteration.")3096 self.add_param('survey_splitting', -1, hidden=True, include=False, comment="for loop-induced control how many core are used at survey for the computation of a single iteration.")
3096 self.add_param('survey_nchannel_per_job', 2, hidden=True, include=False, comment="control how many Channel are integrated inside a single job on cluster/multicore")3097 self.add_param('survey_nchannel_per_job', 2, hidden=True, include=False, comment="control how many Channel are integrated inside a single job on cluster/multicore")
3097 self.add_param('refine_evt_by_job', -1, hidden=True, include=False, comment="control the maximal number of events for the first iteration of the refine (larger means less jobs)")3098 self.add_param('refine_evt_by_job', -1, hidden=True, include=False, comment="control the maximal number of events for the first iteration of the refine (larger means less jobs)")
@@ -3195,8 +3196,6 @@
3195 if self['mmjj'] > self['xqcut']:3196 if self['mmjj'] > self['xqcut']:
3196 logger.warning('mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0')3197 logger.warning('mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0')
3197 self['mmjj'] = 0.0 3198 self['mmjj'] = 0.0
3198
3199
3200 3199
3201 # check validity of the pdf set3200 # check validity of the pdf set
3202 if self['pdlabel'] == 'lhapdf':3201 if self['pdlabel'] == 'lhapdf':
@@ -4067,7 +4066,7 @@
4067 super(RunCardNLO, self).check_validity()4066 super(RunCardNLO, self).check_validity()
40684067
4069 # for lepton-lepton collisions, ignore 'pdlabel' and 'lhaid'4068 # for lepton-lepton collisions, ignore 'pdlabel' and 'lhaid'
4070 if self['lpp1']!=1 or self['lpp2']!=1:4069 if abs(self['lpp1'])!=1 or abs(self['lpp2'])!=1:
4071 if self['lpp1'] == 1 or self['lpp2']==1:4070 if self['lpp1'] == 1 or self['lpp2']==1:
4072 raise InvalidRunCard('Process like Deep Inelastic scattering not supported at NLO accuracy.')4071 raise InvalidRunCard('Process like Deep Inelastic scattering not supported at NLO accuracy.')
4073 4072
40744073
=== modified file 'madgraph/various/lhe_parser.py'
--- madgraph/various/lhe_parser.py 2020-01-09 23:14:56 +0000
+++ madgraph/various/lhe_parser.py 2020-06-21 12:17:46 +0000
@@ -1449,8 +1449,8 @@
1449 if not hasattr(Event, 'loweight_pattern'):1449 if not hasattr(Event, 'loweight_pattern'):
1450 Event.loweight_pattern = re.compile('''<rscale>\s*(?P<nqcd>\d+)\s+(?P<ren_scale>[\d.e+-]+)\s*</rscale>\s*\n\s*1450 Event.loweight_pattern = re.compile('''<rscale>\s*(?P<nqcd>\d+)\s+(?P<ren_scale>[\d.e+-]+)\s*</rscale>\s*\n\s*
1451 <asrwt>\s*(?P<asrwt>[\s\d.+-e]+)\s*</asrwt>\s*\n\s*1451 <asrwt>\s*(?P<asrwt>[\s\d.+-e]+)\s*</asrwt>\s*\n\s*
1452 <pdfrwt\s+beam=["']?1["']?\>\s*(?P<beam1>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*1452 <pdfrwt\s+beam=["']?(?P<idb1>1|2)["']?\>\s*(?P<beam1>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*
1453 <pdfrwt\s+beam=["']?2["']?\>\s*(?P<beam2>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*1453 <pdfrwt\s+beam=["']?(?P<idb2>1|2)["']?\>\s*(?P<beam2>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*
1454 <totfact>\s*(?P<totfact>[\d.e+-]*)\s*</totfact>1454 <totfact>\s*(?P<totfact>[\d.e+-]*)\s*</totfact>
1455 ''',re.X+re.I+re.M)1455 ''',re.X+re.I+re.M)
1456 1456
@@ -1468,13 +1468,22 @@
1468 self.loweight['asrwt'] =[float(x) for x in info.group('asrwt').split()[1:]]1468 self.loweight['asrwt'] =[float(x) for x in info.group('asrwt').split()[1:]]
1469 self.loweight['tot_fact'] = float(info.group('totfact'))1469 self.loweight['tot_fact'] = float(info.group('totfact'))
1470 1470
1471 args = info.group('beam1').split()1471 if info.group('idb1') == info.group('idb2'):
1472 raise Exception, '%s not parsed'% text
1473
1474 if info.group('idb1') =="1":
1475 args = info.group('beam1').split()
1476 else:
1477 args = info.group('beam2').split()
1472 npdf = int(args[0])1478 npdf = int(args[0])
1473 self.loweight['n_pdfrw1'] = npdf1479 self.loweight['n_pdfrw1'] = npdf
1474 self.loweight['pdf_pdg_code1'] = [int(i) for i in args[1:1+npdf]]1480 self.loweight['pdf_pdg_code1'] = [int(i) for i in args[1:1+npdf]]
1475 self.loweight['pdf_x1'] = [float(i) for i in args[1+npdf:1+2*npdf]]1481 self.loweight['pdf_x1'] = [float(i) for i in args[1+npdf:1+2*npdf]]
1476 self.loweight['pdf_q1'] = [float(i) for i in args[1+2*npdf:1+3*npdf]]1482 self.loweight['pdf_q1'] = [float(i) for i in args[1+2*npdf:1+3*npdf]]
1477 args = info.group('beam2').split()1483 if info.group('idb2') =="2":
1484 args = info.group('beam2').split()
1485 else:
1486 args = info.group('beam1').split()
1478 npdf = int(args[0])1487 npdf = int(args[0])
1479 self.loweight['n_pdfrw2'] = npdf1488 self.loweight['n_pdfrw2'] = npdf
1480 self.loweight['pdf_pdg_code2'] = [int(i) for i in args[1:1+npdf]]1489 self.loweight['pdf_pdg_code2'] = [int(i) for i in args[1:1+npdf]]
14811490
=== modified file 'madgraph/various/misc.py'
--- madgraph/various/misc.py 2020-01-08 14:13:32 +0000
+++ madgraph/various/misc.py 2020-06-21 12:17:46 +0000
@@ -488,7 +488,7 @@
488 error_text += "In general this means that your computer is not able to compile."488 error_text += "In general this means that your computer is not able to compile."
489 if sys.platform == "darwin":489 if sys.platform == "darwin":
490 error_text += "Note that MacOSX doesn\'t have gmake/gfortan install by default.\n"490 error_text += "Note that MacOSX doesn\'t have gmake/gfortan install by default.\n"
491 error_text += "Xcode3 contains those required programs"491 error_text += "Xcode contains gmake. For gfortran we advise: http://hpc.sourceforge.net/"
492 raise MadGraph5Error, error_text492 raise MadGraph5Error, error_text
493493
494 if p.returncode:494 if p.returncode:
@@ -539,7 +539,7 @@
539 p = Popen([compiler, '-dumpversion'], stdout=subprocess.PIPE, 539 p = Popen([compiler, '-dumpversion'], stdout=subprocess.PIPE,
540 stderr=subprocess.PIPE)540 stderr=subprocess.PIPE)
541 output, error = p.communicate()541 output, error = p.communicate()
542 version_finder=re.compile(r"(?P<version>(\d.)*\d)")542 version_finder=re.compile(r"(?P<version>\d[\d.]*)")
543 version = version_finder.search(output).group('version')543 version = version_finder.search(output).group('version')
544 return version544 return version
545 except Exception:545 except Exception:
@@ -1772,7 +1772,8 @@
1772 import random1772 import random
1773 msg = choices[random.randint(0,len(choices)-2)]1773 msg = choices[random.randint(0,len(choices)-2)]
1774 EasterEgg.message_aprilfirst[msgtype].remove(msg)1774 EasterEgg.message_aprilfirst[msgtype].remove(msg)
1775 1775 else:
1776 return
1776 elif msgtype=='loading' and date in self.special_banner:1777 elif msgtype=='loading' and date in self.special_banner:
1777 self.change_banner(date)1778 self.change_banner(date)
1778 return1779 return
@@ -2065,7 +2066,9 @@
2065 logger.warning("Failed to access python version of LHAPDF: "\2066 logger.warning("Failed to access python version of LHAPDF: "\
2066 "If the python interface to LHAPDF is available on your system, try "\2067 "If the python interface to LHAPDF is available on your system, try "\
2067 "adding its location to the PYTHONPATH environment variable and the"\2068 "adding its location to the PYTHONPATH environment variable and the"\
2068 "LHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x).")2069 "LHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x)."\
2070 "The required LD_LIBRARY_PATH is "+ lhapdf_libdir
2071 )
2069 2072
2070 if use_lhapdf:2073 if use_lhapdf:
2071 python_lhapdf = lhapdf2074 python_lhapdf = lhapdf
20722075
=== modified file 'madgraph/various/process_checks.py'
--- madgraph/various/process_checks.py 2019-03-01 08:53:21 +0000
+++ madgraph/various/process_checks.py 2020-06-21 12:17:46 +0000
@@ -375,7 +375,7 @@
375 else:375 else:
376 energy = options['energy']376 energy = options['energy']
377 events = options['events']377 events = options['events']
378 to_skip = 0378 to_skip = options['skip_evt']
379 379
380 if not (isinstance(process, base_objects.Process) and \380 if not (isinstance(process, base_objects.Process) and \
381 isinstance(energy, (float,int))):381 isinstance(energy, (float,int))):
382382
=== modified file 'models/model_reader.py'
--- models/model_reader.py 2018-06-20 08:18:36 +0000
+++ models/model_reader.py 2020-06-21 12:17:46 +0000
@@ -181,6 +181,11 @@
181 value = 0.0181 value = 0.0
182 else:182 else:
183 raise183 raise
184 except OverflowError, err:
185 if scale < 1:
186 value = 0.0
187 else:
188 raise
184 exec("locals()[\'%s\'] = %s" % (parameter_dict[block][pid].name,189 exec("locals()[\'%s\'] = %s" % (parameter_dict[block][pid].name,
185 value))190 value))
186 parameter_dict[block][pid].value = float(value)191 parameter_dict[block][pid].value = float(value)
187192
=== modified file 'tests/acceptance_tests/test_cmd_reweight.py'
--- tests/acceptance_tests/test_cmd_reweight.py 2018-06-01 12:14:52 +0000
+++ tests/acceptance_tests/test_cmd_reweight.py 2020-06-21 12:17:46 +0000
@@ -136,16 +136,22 @@
136 ff.close()136 ff.close()
137 137
138138
139 with misc.stdchannel_redirected(sys.stdout, os.devnull):139 if logger.level <= 10:
140 me_cmd.run_cmd('reweight run_01 --from_cards')140 me_cmd.run_cmd('reweight run_01 --from_cards')
141 else:
142 with misc.stdchannel_redirected(sys.stdout, os.devnull):
143 me_cmd.run_cmd('reweight run_01 --from_cards')
141 144
142 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'unweighted_events.lhe.gz'))145 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'unweighted_events.lhe.gz'))
143 146
144 solutions = [12.905371, 12.271068, 12.271753, 12.436969, 12.330121, 12.441459, 12.290359, 12.406486, 12.352107, 11.862291, 12.346005, 12.603302, 12.483697, 12.597262, 12.352434, 11.841136, 12.559252, 12.693822, 12.073114, 12.080773, 12.088188, 12.169921, 12.36124, 12.620677, 12.641769]147 #solutions = [12.905371, 12.271068, 12.271753, 12.436969, 12.330121, 12.441459, 12.290359, 12.406486, 12.352107, 11.862291, 12.346005, 12.603302, 12.483697, 12.597262, 12.352434, 11.841136, 12.559252, 12.693822, 12.073114, 12.080773, 12.088188, 12.169921, 12.36124, 12.620677, 12.641769]
148 solutions = [14.288834, 13.551237, 13.564131, 13.745311, 13.620339, 13.750088, 13.611093, 13.709763, 13.670902, 13.071603, 13.658932, 13.939627, 13.827959, 13.932638, 13.669482, 13.045913, 13.888161, 14.045136, 13.319103, 13.327884, 13.336799, 13.430042, 13.658435, 13.959817, 13.984111]
149 #solutions = []
145 for i,event in enumerate(lhe):150 for i,event in enumerate(lhe):
146 151
147 rwgt_data = event.parse_reweight()152 rwgt_data = event.parse_reweight()
148 #solutions.append(rwgt_data['rwgt_1'])153 #solutions.append(rwgt_data['rwgt_1'])
154 #continue
149 self.assertTrue('rwgt_1' in rwgt_data)155 self.assertTrue('rwgt_1' in rwgt_data)
150 self.assertTrue(misc.equal(rwgt_data['rwgt_1'], solutions[i]))156 self.assertTrue(misc.equal(rwgt_data['rwgt_1'], solutions[i]))
151 #misc.sprint(solutions)157 #misc.sprint(solutions)
@@ -239,7 +245,8 @@
239 if 1: #with misc.stdchannel_redirected(sys.stdout, os.devnull):245 if 1: #with misc.stdchannel_redirected(sys.stdout, os.devnull):
240 me_cmd.run_cmd('reweight run_01 --from_cards')246 me_cmd.run_cmd('reweight run_01 --from_cards')
241 247
242 solutions = [41.511565, 41.930505, 41.511565, 41.511565, 41.586169, 41.511565, 41.511565, 41.511565, 41.511565, 42.046806, 41.511565, 44.164503, 41.511565, -41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.778368, 41.511565, 42.05448, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 42.115494, 41.511854, 41.511567, 41.511565, 42.00028, 42.120605, 41.514867, -41.511565, 41.511565, 45.125706, 41.511565, 42.180208, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.997509, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.513926, 41.511565, 41.882499, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 47.532736, 41.511565, 41.809063, 41.511565, 41.511565, 41.511565, 41.927695, 41.511565, 41.511565, 41.555692, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, -41.511565, 41.511565, 42.029675, 41.725129, 41.511565, 41.511565, 41.511778, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 42.050439, 41.511565, 41.511565, 41.511565, -41.511565, 42.071105, 41.511565, 41.511565]248 #solutions = [41.511565, 41.930505, 41.511565, 41.511565, 41.586169, 41.511565, 41.511565, 41.511565, 41.511565, 42.046806, 41.511565, 44.164503, 41.511565, -41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.778368, 41.511565, 42.05448, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 42.115494, 41.511854, 41.511567, 41.511565, 42.00028, 42.120605, 41.514867, -41.511565, 41.511565, 45.125706, 41.511565, 42.180208, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.997509, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.513926, 41.511565, 41.882499, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 47.532736, 41.511565, 41.809063, 41.511565, 41.511565, 41.511565, 41.927695, 41.511565, 41.511565, 41.555692, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, -41.511565, 41.511565, 42.029675, 41.725129, 41.511565, 41.511565, 41.511778, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 42.050439, 41.511565, 41.511565, 41.511565, -41.511565, 42.071105, 41.511565, 41.511565]
249 solutions = [41.511565, 41.75164, 41.511565, 41.511565, 41.557009, 41.511565, 41.511565, 41.511565, 41.511565, 41.759881, 41.511565, 44.717244, 41.511565, -41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 42.041827, 41.511565, 41.663092, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.920917, 41.511736, 41.511566, 41.511565, 205.29791, 42.538389, 41.513573, -41.511565, 41.511565, 44.650974, 41.511565, 42.549187, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.431553, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.513265, 41.511565, 43.902643, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 8853.0397, 41.511565, 333.38491, 41.511565, 41.511565, 41.511565, 75.701362, 41.511565, 41.511565, 41.54695, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, -41.511565, 41.511565, 41.454923, 41.53984, 41.511565, 41.511565, 41.511743, 41.511565, 41.511565, 41.511565, 41.511565, 41.511565, 41.732627, 41.511565, 41.511565, 41.511565, -41.511565, 41.395865, 41.511565, 41.511565]
243 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'rwgt_events_tree_rwgt_1.lhe.gz'))250 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'rwgt_events_tree_rwgt_1.lhe.gz'))
244 lhe_orig = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'events.lhe.gz'))251 lhe_orig = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'events.lhe.gz'))
245 from itertools import izip252 from itertools import izip
@@ -249,9 +256,9 @@
249 i+=1256 i+=1
250 rwgt_data = event_orig.parse_reweight()257 rwgt_data = event_orig.parse_reweight()
251 #solutions.append(rwgt_data['rwgt_1_tree'])258 #solutions.append(rwgt_data['rwgt_1_tree'])
259 #continue
252 self.assertTrue('rwgt_1_tree' in rwgt_data)260 self.assertTrue('rwgt_1_tree' in rwgt_data)
253 self.assertEqual(event.wgt, rwgt_data['rwgt_1_tree'])261 self.assertEqual(event.wgt, rwgt_data['rwgt_1_tree'])
254 #misc.sprint(abs(event.wgt))
255 self.assertTrue(misc.equal(event.wgt, solutions[i]))262 self.assertTrue(misc.equal(event.wgt, solutions[i]))
256 nlo1 = event.parse_nlo_weight()263 nlo1 = event.parse_nlo_weight()
257 nlo2 = event_orig.parse_nlo_weight()264 nlo2 = event_orig.parse_nlo_weight()
@@ -259,6 +266,7 @@
259 self.assertNotEqual(nlo1.total_wgt, nlo2.total_wgt)266 self.assertNotEqual(nlo1.total_wgt, nlo2.total_wgt)
260267
261 #misc.sprint(solutions)268 #misc.sprint(solutions)
269 #raise Exception
262270
263 def test_loop_improved_reweighting(self):271 def test_loop_improved_reweighting(self):
264 """ check identical re-weighting in ttbar 272 """ check identical re-weighting in ttbar
@@ -281,8 +289,11 @@
281 ff.write(cmd_lines)289 ff.write(cmd_lines)
282 ff.close()290 ff.close()
283 291
284 with misc.stdchannel_redirected(sys.stdout, os.devnull):292 if logger.level <=10:
285 me_cmd.run_cmd('reweight run_01 --from_cards')293 me_cmd.run_cmd('reweight run_01 --from_cards')
294 else:
295 with misc.stdchannel_redirected(sys.stdout, os.devnull):
296 me_cmd.run_cmd('reweight run_01 --from_cards')
286 297
287 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'events.lhe.gz'))298 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'events.lhe.gz'))
288 lhe2= lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'rwgt_events_tree_rwgt_1.lhe.gz'))299 lhe2= lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'rwgt_events_tree_rwgt_1.lhe.gz'))
@@ -335,11 +346,12 @@
335 self.assertTrue(misc.equal(rwgt_data['NAME_1'], solutions2[i]))346 self.assertTrue(misc.equal(rwgt_data['NAME_1'], solutions2[i]))
336 347
337348
338 def test_nlo_reweighting_comb(self):349 def old_test_nlo_reweighting_comb(self):
339 """check that nlo reweighting is working.350 """check that nlo reweighting is working.
340 The main point is to check the recombination of the weights351 The main point is to check the recombination of the weights
341 Since the rest should be either checked by the lhe_parser class352 Since the rest should be either checked by the lhe_parser class
342 or by the various check of the standalone checks353 or by the various check of the standalone checks.
354 This way of combining weights is now outdated
343 """355 """
344 356
345 # create a reweight directory 357 # create a reweight directory
346358
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f 2016-08-07 07:16:07 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f 2020-06-21 12:17:46 +0000
@@ -164,8 +164,9 @@
164 IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)164 IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)
165 $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.165 $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.
166 $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS166 $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS
167 $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2).EQ.0.AND.(NCALLS_IN_CACHE(167 $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2)
168 $I)/2).EQ.NCOLLIERCALLS(I) ) ) ) THEN168 $ .EQ.0.AND.(NCALLS_IN_CACHE(I)/2).EQ.NCOLLIERCALLS(I) ) ) )
169 $ THEN
169 WRITE(*,*) 'WARNING: A consistency check in MadLoop'170 WRITE(*,*) 'WARNING: A consistency check in MadLoop'
170 $ //' failed and, for safety, forced MadLoop to'171 $ //' failed and, for safety, forced MadLoop to'
171 $ //' reinitialize the global cache of COLLIER. Report'172 $ //' reinitialize the global cache of COLLIER. Report'
@@ -256,8 +257,8 @@
256C The expression below is like taking the absolute value257C The expression below is like taking the absolute value
257C when summing errors linearly258C when summing errors linearly
258C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxC259C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxC
259C oefForRank(CURR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K)))260C oefForRank(CURR_RANK))*DCMPLX(
260C ,ABS(DIMAG(TIRCOEFS(I,K))) )261C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
261C But empirically, I observed that retaining the262C But empirically, I observed that retaining the
262C original complex phase leads to slightly more263C original complex phase leads to slightly more
263C accurate estimates264C accurate estimates
@@ -479,8 +480,8 @@
479C The expression below is like taking the absolute value480C The expression below is like taking the absolute value
480C when summing errors linearly481C when summing errors linearly
481C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(C482C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(C
482C URR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIR483C URR_RANK))*DCMPLX(
483C COEFS(I,K))) ) 484C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
484C But empirically, I observed that retaining the original485C But empirically, I observed that retaining the original
485C complex phase leads to slightly more accurate estimates486C complex phase leads to slightly more accurate estimates
486 TIRCOEFSERRORS(I,K)=(TNTENERR(CURR_RANK)487 TIRCOEFSERRORS(I,K)=(TNTENERR(CURR_RANK)
@@ -592,8 +593,8 @@
592593
593C The common blocks below are to retrieve the necessary594C The common blocks below are to retrieve the necessary
594C information about595C information about
595C MadLoop running mode and store it in the sCOLLIER_CACHE_RELEVANT_596C MadLoop running mode and store it in the
596C PARAMS common block.597C sCOLLIER_CACHE_RELEVANT_PARAMS common block.
597598
598 INCLUDE 'MadLoopParams.inc'599 INCLUDE 'MadLoopParams.inc'
599 INCLUDE 'unique_id.inc'600 INCLUDE 'unique_id.inc'
@@ -662,8 +663,8 @@
662 USERHEL_BU = USERHEL663 USERHEL_BU = USERHEL
663 SQSO_TARGET_BU = SQSO_TARGET664 SQSO_TARGET_BU = SQSO_TARGET
664 COLLIERMODE_BU = COLLIERMODE665 COLLIERMODE_BU = COLLIERMODE
665 COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT666 COLLIERUSEINTERNALSTABILITYTEST_BU =
666 $YTEST667 $ COLLIERUSEINTERNALSTABILITYTEST
667 CTMODERUN_BU = CTMODERUN668 CTMODERUN_BU = CTMODERUN
668 CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)669 CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)
669 COLLIER_CACHE_ACTIVE = 1670 COLLIER_CACHE_ACTIVE = 1
@@ -710,8 +711,8 @@
710 USERHEL_BU = USERHEL711 USERHEL_BU = USERHEL
711 SQSO_TARGET_BU = SQSO_TARGET712 SQSO_TARGET_BU = SQSO_TARGET
712 COLLIERMODE_BU = COLLIERMODE713 COLLIERMODE_BU = COLLIERMODE
713 COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT714 COLLIERUSEINTERNALSTABILITYTEST_BU =
714 $YTEST715 $ COLLIERUSEINTERNALSTABILITYTEST
715 CTMODERUN_BU = CTMODERUN716 CTMODERUN_BU = CTMODERUN
716 IF (COLLIERGLOBALCACHE.EQ.-1) THEN717 IF (COLLIERGLOBALCACHE.EQ.-1) THEN
717 CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)718 CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
718719
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f 2016-08-07 07:16:07 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f 2020-06-21 12:17:46 +0000
@@ -663,8 +663,8 @@
663C Determine it uses qp or not663C Determine it uses qp or not
664 DOING_QP = (CTMODE.GE.4)664 DOING_QP = (CTMODE.GE.4)
665665
666 IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.GOODAMP(SQUAREDSOIND666 IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED)
667 $EX,LOOPNUM)) THEN667 $ .OR.GOODAMP(SQUAREDSOINDEX,LOOPNUM)) THEN
668 WE(1)=W1668 WE(1)=W1
669 WE(2)=W2669 WE(2)=W2
670 WE(3)=W3670 WE(3)=W3
671671
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f 2018-11-08 22:24:49 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f 2020-06-21 12:17:46 +0000
@@ -54,8 +54,8 @@
54 INTEGER LAST_LIB_USED54 INTEGER LAST_LIB_USED
55 DATA LAST_LIB_USED/-1/55 DATA LAST_LIB_USED/-1/
5656
57 COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3),TIRCOEFSERRORS(0:LOOPMAXC57 COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3)
58 $OEFS-1,3)58 $ ,TIRCOEFSERRORS(0:LOOPMAXCOEFS-1,3)
59 COMPLEX*16 PJCOEFS(0:LOOPMAXCOEFS-1,3)59 COMPLEX*16 PJCOEFS(0:LOOPMAXCOEFS-1,3)
60C 60C
61C EXTERNAL FUNCTIONS61C EXTERNAL FUNCTIONS
@@ -398,8 +398,9 @@
398C 398C
399 INCLUDE 'MadLoopParams.inc'399 INCLUDE 'MadLoopParams.inc'
400 INCLUDE 'process_info.inc'400 INCLUDE 'process_info.inc'
401C Change the list 'LOOPLIBS_QPAVAILABLE' in loop_matrix_standalone.401C Change the list 'LOOPLIBS_QPAVAILABLE' in
402C inc to change the list of QPTools availables402C loop_matrix_standalone.inc to change the list of QPTools
403C availables
403 LOGICAL QP_TOOLS_AVAILABLE404 LOGICAL QP_TOOLS_AVAILABLE
404 INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)405 INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)
405 COMMON/LOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS406 COMMON/LOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS
406407
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f 2018-05-18 12:22:47 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f 2020-06-21 12:17:46 +0000
@@ -461,8 +461,8 @@
461C BEGIN CODE461C BEGIN CODE
462C 462C
463 DO I=1,NSO463 DO I=1,NSO
464 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI464 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
465 $NDEXB,I)465 $ +AMPSPLITORDERS(ORDERINDEXB,I)
466 ENDDO466 ENDDO
467 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)467 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
468 END468 END
@@ -556,8 +556,8 @@
556 RETURN556 RETURN
557 ENDIF557 ENDIF
558558
559 WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'559 WRITE(*,*) 'ERROR:: Stopping function'
560 $ //'DEX'560 $ //' GET_SQUARED_ORDERS_FOR_SOINDEX'
561 WRITE(*,*) 'Could not find squared orders index ',SOINDEX561 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
562 STOP562 STOP
563563
564564
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa_born_splitOrders.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa_born_splitOrders.f 2016-03-31 10:53:12 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa_born_splitOrders.f 2020-06-21 12:17:46 +0000
@@ -170,8 +170,8 @@
170C CALL SMATRIX(P,MATELEM)170C CALL SMATRIX(P,MATELEM)
171C 171C
172C write (*,*) "-------------------------------------------------"172C write (*,*) "-------------------------------------------------"
173C write (*,*) "Matrix element = ", MATELEM, " GeV^",-(2*nexternal-8)173C write (*,*) "Matrix element = ", MATELEM, "
174C 174C GeV^",-(2*nexternal-8)
175C write (*,*) "-------------------------------------------------"175C write (*,*) "-------------------------------------------------"
176176
177 END177 END
178178
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f 2018-11-08 22:24:49 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f 2020-06-21 12:17:46 +0000
@@ -78,8 +78,8 @@
78 INTEGER NSQUAREDSOP178 INTEGER NSQUAREDSOP1
79 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)79 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
80C The total number of loop reduction libraries80C The total number of loop reduction libraries
81C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai81C At present, there are only
82C , Ninja and COLLIER82C CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
83 INTEGER NLOOPLIB83 INTEGER NLOOPLIB
84 PARAMETER (NLOOPLIB=7)84 PARAMETER (NLOOPLIB=7)
85C Only CutTools or possibly Ninja (if installed with qp support)85C Only CutTools or possibly Ninja (if installed with qp support)
@@ -404,14 +404,15 @@
404C reading the parameters404C reading the parameters
405 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,405 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
406 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION406 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
407 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU407 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
408 $TATION_CHOICE408 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
409 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION409 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION
410 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./410 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
411 COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_411 COMMON/COLLIERPOLESFORCEDCHOICE
412 $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION412 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
413 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_413 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
414 $CHOICE414 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
415 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
415416
416C This variable controls the general initialization which is417C This variable controls the general initialization which is
417C *common* between all MadLoop SubProcesses.418C *common* between all MadLoop SubProcesses.
@@ -880,8 +881,8 @@
880 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))881 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))
881882
882 CTCALL_REQ_SO_DONE=.FALSE.883 CTCALL_REQ_SO_DONE=.FALSE.
883 FILTER_SO = (.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.(SQSO_TARG884 FILTER_SO = (.NOT.CHECKPHASE)
884 $ET.NE.-1)885 $ .AND.HELDOUBLECHECKED.AND.(SQSO_TARGET.NE.-1)
885886
886 DO I=1,NLOOPGROUPS887 DO I=1,NLOOPGROUPS
887 DO J=0,LOOPMAXCOEFS-1888 DO J=0,LOOPMAXCOEFS-1
@@ -920,13 +921,14 @@
920 ENDIF921 ENDIF
921922
922 DO H=1,NCOMB923 DO H=1,NCOMB
923 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(924 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
924 $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)925 $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
925 $ .NE.0)))) THEN926 $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
926927
927C Handle the possible requirement of specific polarizations928C Handle the possible requirement of specific polarizations
928 IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(929 IF ((.NOT.CHECKPHASE)
929 $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN930 $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
931 $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
930 CYCLE932 CYCLE
931 ENDIF933 ENDIF
932934
@@ -1164,8 +1166,8 @@
1164C Of course if it is one, then we do not need to do1166C Of course if it is one, then we do not need to do
1165C anything (because with HELINITSTARTOVER=.FALSE. we only1167C anything (because with HELINITSTARTOVER=.FALSE. we only
1166C support exactly identical Hels.)1168C support exactly identical Hels.)
1167 IF(GOODHEL(HELPICKED).GT.-HELOFFSET.AND.GOODHEL(HELPICKED)1169 IF(GOODHEL(HELPICKED).GT.
1168 $ .NE.1) THEN1170 $ -HELOFFSET.AND.GOODHEL(HELPICKED).NE.1) THEN
1169 NEWHELREF=-11171 NEWHELREF=-1
1170 DO H=1,NCOMB1172 DO H=1,NCOMB
1171 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN1173 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN
@@ -1359,16 +1361,18 @@
13591361
1360 CTMODE=BASIC_CT_MODE1362 CTMODE=BASIC_CT_MODE
13611363
1362 IF(.NOT.EVAL_DONE(3).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE1364 IF(.NOT.EVAL_DONE(3).AND.
1363 $.1).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN1365 $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.1)
1366 $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
1364 EVAL_DONE(3)=.TRUE.1367 EVAL_DONE(3)=.TRUE.
1365 CALL ROTATE_PS(PS,P,1)1368 CALL ROTATE_PS(PS,P,1)
1366 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,1)1369 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,1)
1367 GOTO 2001370 GOTO 200
1368 ENDIF1371 ENDIF
13691372
1370 IF(.NOT.EVAL_DONE(4).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE1373 IF(.NOT.EVAL_DONE(4).AND.
1371 $.2).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN1374 $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.2)
1375 $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
1372 EVAL_DONE(4)=.TRUE.1376 EVAL_DONE(4)=.TRUE.
1373 CALL ROTATE_PS(PS,P,2)1377 CALL ROTATE_PS(PS,P,2)
1374 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,2)1378 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,2)
@@ -1924,8 +1928,8 @@
1924C When using COLLIER with the internal stability test, the first1928C When using COLLIER with the internal stability test, the first
1925C evaluation is typically more reliable so we do not want to1929C evaluation is typically more reliable so we do not want to
1926C use the average but rather the first evaluation.1930C use the average but rather the first evaluation.
1927 IF (MLREDUCTIONLIB(I_LIB).EQ.7.AND.COLLIERUSEINTERNALSTABILITYT1931 IF (MLREDUCTIONLIB(I_LIB)
1928 $EST) THEN1932 $ .EQ.7.AND.COLLIERUSEINTERNALSTABILITYTEST) THEN
1929 DO I=1,31933 DO I=1,3
1930 ESTIMATE(I,K) = FULLLIST(I,K,1)1934 ESTIMATE(I,K) = FULLLIST(I,K,1)
1931 ENDDO1935 ENDDO
@@ -2070,8 +2074,8 @@
2070 1009 CONTINUE2074 1009 CONTINUE
2071 ENDDO2075 ENDDO
20722076
2073 WRITE(*,*) 'ERROR:: Stopping function ML5SOINDEX_FOR_SQUARED_ORDE'2077 WRITE(*,*) 'ERROR:: Stopping function'
2074 $ //'RS'2078 $ //' ML5SOINDEX_FOR_SQUARED_ORDERS'
2075 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)2079 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)
2076 STOP2080 STOP
20772081
@@ -2170,8 +2174,8 @@
2170C BEGIN CODE2174C BEGIN CODE
2171C 2175C
2172 DO I=1,NSO2176 DO I=1,NSO
2173 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI2177 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
2174 $NDEXB,I)2178 $ +AMPSPLITORDERS(ORDERINDEXB,I)
2175 ENDDO2179 ENDDO
2176 ML5SQSOINDEX=ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)2180 ML5SQSOINDEX=ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
2177 END2181 END
@@ -2209,8 +2213,8 @@
2209 RETURN2213 RETURN
2210 ENDIF2214 ENDIF
22112215
2212 WRITE(*,*) 'ERROR:: Stopping function ML5GET_SQUARED_ORDERS_FOR_S'2216 WRITE(*,*) 'ERROR:: Stopping function'
2213 $ //'OINDEX'2217 $ //' ML5GET_SQUARED_ORDERS_FOR_SOINDEX'
2214 WRITE(*,*) 'Could not find squared orders index ',SOINDEX2218 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
2215 STOP2219 STOP
22162220
@@ -2249,8 +2253,8 @@
2249 RETURN2253 RETURN
2250 ENDIF2254 ENDIF
22512255
2252 WRITE(*,*) 'ERROR:: Stopping function ML5GET_ORDERS_FOR_AMPSOINDE'2256 WRITE(*,*) 'ERROR:: Stopping function'
2253 $ //'X'2257 $ //' ML5GET_ORDERS_FOR_AMPSOINDEX'
2254 WRITE(*,*) 'Could not find amplitude split orders index ',SOINDEX2258 WRITE(*,*) 'Could not find amplitude split orders index ',SOINDEX
2255 STOP2259 STOP
22562260
@@ -2315,12 +2319,13 @@
23152319
2316 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,2320 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2317 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2321 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2318 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU2322 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
2319 $TATION_CHOICE2323 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
2320 COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_2324 COMMON/COLLIERPOLESFORCEDCHOICE
2321 $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2325 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2322 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_2326 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2323 $CHOICE2327 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
2328 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
23242329
2325 COLLIERCOMPUTEUVPOLES = ONOFF2330 COLLIERCOMPUTEUVPOLES = ONOFF
2326C This is just so that if we read the param again, we don't2331C This is just so that if we read the param again, we don't
@@ -2342,12 +2347,13 @@
23422347
2343 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,2348 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2344 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2349 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2345 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU2350 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
2346 $TATION_CHOICE2351 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
2347 COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_2352 COMMON/COLLIERPOLESFORCEDCHOICE
2348 $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2353 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2349 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_2354 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2350 $CHOICE2355 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
2356 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
23512357
2352 COLLIERCOMPUTEIRPOLES = ONOFF2358 COLLIERCOMPUTEIRPOLES = ONOFF
2353C This is just so that if we read the param again, we don't2359C This is just so that if we read the param again, we don't
23542360
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f 2017-07-07 10:47:20 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f 2020-06-21 12:17:46 +0000
@@ -268,13 +268,14 @@
268268
269 DPW_COPIED = .FALSE.269 DPW_COPIED = .FALSE.
270 DO H=1,NCOMB270 DO H=1,NCOMB
271 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(271 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
272 $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)272 $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
273 $ .NE.0)))) THEN273 $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
274274
275C Handle the possible requirement of specific polarizations275C Handle the possible requirement of specific polarizations
276 IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(276 IF ((.NOT.CHECKPHASE)
277 $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN277 $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
278 $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
278 CYCLE279 CYCLE
279 ENDIF280 ENDIF
280281
281282
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f 2016-04-06 18:45:52 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f 2020-06-21 12:17:46 +0000
@@ -113,8 +113,8 @@
113 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO113 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
114 $ ,KIND=8)114 $ ,KIND=8)
115 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1115 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
116 CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP116 CONST(ML5SOINDEX_FOR_BORN_AMP(I))
117 $(I))+CFTOT*CONJG(AMP(I))117 $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
118 ENDDO118 ENDDO
119119
120 DO I=1,NAMPSO120 DO I=1,NAMPSO
@@ -232,8 +232,8 @@
232 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO232 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
233 $ ,KIND=16)233 $ ,KIND=16)
234 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1234 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
235 CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP235 CONST(ML5SOINDEX_FOR_BORN_AMP(I))
236 $(I))+CFTOT*CONJG(AMP(I))236 $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
237 ENDDO237 ENDDO
238238
239 DO I=1,NAMPSO239 DO I=1,NAMPSO
240240
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%COLLIER_interface.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%COLLIER_interface.f 2016-08-07 07:16:07 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%COLLIER_interface.f 2020-06-21 12:17:46 +0000
@@ -164,8 +164,9 @@
164 IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)164 IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)
165 $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.165 $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.
166 $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS166 $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS
167 $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2).EQ.0.AND.(NCALLS_IN_CACHE(167 $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2)
168 $I)/2).EQ.NCOLLIERCALLS(I) ) ) ) THEN168 $ .EQ.0.AND.(NCALLS_IN_CACHE(I)/2).EQ.NCOLLIERCALLS(I) ) ) )
169 $ THEN
169 WRITE(*,*) 'WARNING: A consistency check in MadLoop'170 WRITE(*,*) 'WARNING: A consistency check in MadLoop'
170 $ //' failed and, for safety, forced MadLoop to'171 $ //' failed and, for safety, forced MadLoop to'
171 $ //' reinitialize the global cache of COLLIER. Report'172 $ //' reinitialize the global cache of COLLIER. Report'
@@ -256,8 +257,8 @@
256C The expression below is like taking the absolute value257C The expression below is like taking the absolute value
257C when summing errors linearly258C when summing errors linearly
258C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxC259C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxC
259C oefForRank(CURR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K)))260C oefForRank(CURR_RANK))*DCMPLX(
260C ,ABS(DIMAG(TIRCOEFS(I,K))) )261C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
261C But empirically, I observed that retaining the262C But empirically, I observed that retaining the
262C original complex phase leads to slightly more263C original complex phase leads to slightly more
263C accurate estimates264C accurate estimates
@@ -479,8 +480,8 @@
479C The expression below is like taking the absolute value480C The expression below is like taking the absolute value
480C when summing errors linearly481C when summing errors linearly
481C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(C482C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(C
482C URR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIR483C URR_RANK))*DCMPLX(
483C COEFS(I,K))) ) 484C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
484C But empirically, I observed that retaining the original485C But empirically, I observed that retaining the original
485C complex phase leads to slightly more accurate estimates486C complex phase leads to slightly more accurate estimates
486 TIRCOEFSERRORS(I,K)=(TNTENERR(CURR_RANK)487 TIRCOEFSERRORS(I,K)=(TNTENERR(CURR_RANK)
@@ -592,8 +593,8 @@
592593
593C The common blocks below are to retrieve the necessary594C The common blocks below are to retrieve the necessary
594C information about595C information about
595C MadLoop running mode and store it in the sCOLLIER_CACHE_RELEVANT_596C MadLoop running mode and store it in the
596C PARAMS common block.597C sCOLLIER_CACHE_RELEVANT_PARAMS common block.
597598
598 INCLUDE 'MadLoopParams.inc'599 INCLUDE 'MadLoopParams.inc'
599 INCLUDE 'unique_id.inc'600 INCLUDE 'unique_id.inc'
@@ -662,8 +663,8 @@
662 USERHEL_BU = USERHEL663 USERHEL_BU = USERHEL
663 SQSO_TARGET_BU = SQSO_TARGET664 SQSO_TARGET_BU = SQSO_TARGET
664 COLLIERMODE_BU = COLLIERMODE665 COLLIERMODE_BU = COLLIERMODE
665 COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT666 COLLIERUSEINTERNALSTABILITYTEST_BU =
666 $YTEST667 $ COLLIERUSEINTERNALSTABILITYTEST
667 CTMODERUN_BU = CTMODERUN668 CTMODERUN_BU = CTMODERUN
668 CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)669 CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)
669 COLLIER_CACHE_ACTIVE = 1670 COLLIER_CACHE_ACTIVE = 1
@@ -710,8 +711,8 @@
710 USERHEL_BU = USERHEL711 USERHEL_BU = USERHEL
711 SQSO_TARGET_BU = SQSO_TARGET712 SQSO_TARGET_BU = SQSO_TARGET
712 COLLIERMODE_BU = COLLIERMODE713 COLLIERMODE_BU = COLLIERMODE
713 COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT714 COLLIERUSEINTERNALSTABILITYTEST_BU =
714 $YTEST715 $ COLLIERUSEINTERNALSTABILITYTEST
715 CTMODERUN_BU = CTMODERUN716 CTMODERUN_BU = CTMODERUN
716 IF (COLLIERGLOBALCACHE.EQ.-1) THEN717 IF (COLLIERGLOBALCACHE.EQ.-1) THEN
717 CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)718 CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
718719
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%CT_interface.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%CT_interface.f 2016-08-07 07:16:07 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%CT_interface.f 2020-06-21 12:17:46 +0000
@@ -663,8 +663,8 @@
663C Determine it uses qp or not663C Determine it uses qp or not
664 DOING_QP = (CTMODE.GE.4)664 DOING_QP = (CTMODE.GE.4)
665665
666 IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.GOODAMP(SQUAREDSOIND666 IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED)
667 $EX,LOOPNUM)) THEN667 $ .OR.GOODAMP(SQUAREDSOINDEX,LOOPNUM)) THEN
668 WE(1)=W1668 WE(1)=W1
669 WE(2)=W2669 WE(2)=W2
670 WE(3)=W3670 WE(3)=W3
671671
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%TIR_interface.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%TIR_interface.f 2018-11-08 22:24:49 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%TIR_interface.f 2020-06-21 12:17:46 +0000
@@ -54,8 +54,8 @@
54 INTEGER LAST_LIB_USED54 INTEGER LAST_LIB_USED
55 DATA LAST_LIB_USED/-1/55 DATA LAST_LIB_USED/-1/
5656
57 COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3),TIRCOEFSERRORS(0:LOOPMAXC57 COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3)
58 $OEFS-1,3)58 $ ,TIRCOEFSERRORS(0:LOOPMAXCOEFS-1,3)
59 COMPLEX*16 PJCOEFS(0:LOOPMAXCOEFS-1,3)59 COMPLEX*16 PJCOEFS(0:LOOPMAXCOEFS-1,3)
60C 60C
61C EXTERNAL FUNCTIONS61C EXTERNAL FUNCTIONS
@@ -398,8 +398,9 @@
398C 398C
399 INCLUDE 'MadLoopParams.inc'399 INCLUDE 'MadLoopParams.inc'
400 INCLUDE 'process_info.inc'400 INCLUDE 'process_info.inc'
401C Change the list 'LOOPLIBS_QPAVAILABLE' in loop_matrix_standalone.401C Change the list 'LOOPLIBS_QPAVAILABLE' in
402C inc to change the list of QPTools availables402C loop_matrix_standalone.inc to change the list of QPTools
403C availables
403 LOGICAL QP_TOOLS_AVAILABLE404 LOGICAL QP_TOOLS_AVAILABLE
404 INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)405 INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)
405 COMMON/LOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS406 COMMON/LOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS
406407
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f 2018-05-18 12:22:47 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f 2020-06-21 12:17:46 +0000
@@ -461,8 +461,8 @@
461C BEGIN CODE461C BEGIN CODE
462C 462C
463 DO I=1,NSO463 DO I=1,NSO
464 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI464 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
465 $NDEXB,I)465 $ +AMPSPLITORDERS(ORDERINDEXB,I)
466 ENDDO466 ENDDO
467 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)467 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
468 END468 END
@@ -556,8 +556,8 @@
556 RETURN556 RETURN
557 ENDIF557 ENDIF
558558
559 WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'559 WRITE(*,*) 'ERROR:: Stopping function'
560 $ //'DEX'560 $ //' GET_SQUARED_ORDERS_FOR_SOINDEX'
561 WRITE(*,*) 'Could not find squared orders index ',SOINDEX561 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
562 STOP562 STOP
563563
564564
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%check_sa_born_splitOrders.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%check_sa_born_splitOrders.f 2016-03-31 10:53:12 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%check_sa_born_splitOrders.f 2020-06-21 12:17:46 +0000
@@ -170,8 +170,8 @@
170C CALL SMATRIX(P,MATELEM)170C CALL SMATRIX(P,MATELEM)
171C 171C
172C write (*,*) "-------------------------------------------------"172C write (*,*) "-------------------------------------------------"
173C write (*,*) "Matrix element = ", MATELEM, " GeV^",-(2*nexternal-8)173C write (*,*) "Matrix element = ", MATELEM, "
174C 174C GeV^",-(2*nexternal-8)
175C write (*,*) "-------------------------------------------------"175C write (*,*) "-------------------------------------------------"
176176
177 END177 END
178178
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f 2018-11-08 22:24:49 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f 2020-06-21 12:17:46 +0000
@@ -78,8 +78,8 @@
78 INTEGER NSQUAREDSOP178 INTEGER NSQUAREDSOP1
79 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)79 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
80C The total number of loop reduction libraries80C The total number of loop reduction libraries
81C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai81C At present, there are only
82C , Ninja and COLLIER82C CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
83 INTEGER NLOOPLIB83 INTEGER NLOOPLIB
84 PARAMETER (NLOOPLIB=7)84 PARAMETER (NLOOPLIB=7)
85C Only CutTools or possibly Ninja (if installed with qp support)85C Only CutTools or possibly Ninja (if installed with qp support)
@@ -404,14 +404,15 @@
404C reading the parameters404C reading the parameters
405 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,405 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
406 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION406 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
407 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU407 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
408 $TATION_CHOICE408 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
409 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION409 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION
410 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./410 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
411 COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_411 COMMON/COLLIERPOLESFORCEDCHOICE
412 $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION412 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
413 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_413 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
414 $CHOICE414 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
415 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
415416
416C This variable controls the general initialization which is417C This variable controls the general initialization which is
417C *common* between all MadLoop SubProcesses.418C *common* between all MadLoop SubProcesses.
@@ -880,8 +881,8 @@
880 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))881 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))
881882
882 CTCALL_REQ_SO_DONE=.FALSE.883 CTCALL_REQ_SO_DONE=.FALSE.
883 FILTER_SO = (.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.(SQSO_TARG884 FILTER_SO = (.NOT.CHECKPHASE)
884 $ET.NE.-1)885 $ .AND.HELDOUBLECHECKED.AND.(SQSO_TARGET.NE.-1)
885886
886 DO I=1,NLOOPGROUPS887 DO I=1,NLOOPGROUPS
887 DO J=0,LOOPMAXCOEFS-1888 DO J=0,LOOPMAXCOEFS-1
@@ -920,13 +921,14 @@
920 ENDIF921 ENDIF
921922
922 DO H=1,NCOMB923 DO H=1,NCOMB
923 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(924 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
924 $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)925 $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
925 $ .NE.0)))) THEN926 $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
926927
927C Handle the possible requirement of specific polarizations928C Handle the possible requirement of specific polarizations
928 IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(929 IF ((.NOT.CHECKPHASE)
929 $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN930 $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
931 $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
930 CYCLE932 CYCLE
931 ENDIF933 ENDIF
932934
@@ -1164,8 +1166,8 @@
1164C Of course if it is one, then we do not need to do1166C Of course if it is one, then we do not need to do
1165C anything (because with HELINITSTARTOVER=.FALSE. we only1167C anything (because with HELINITSTARTOVER=.FALSE. we only
1166C support exactly identical Hels.)1168C support exactly identical Hels.)
1167 IF(GOODHEL(HELPICKED).GT.-HELOFFSET.AND.GOODHEL(HELPICKED)1169 IF(GOODHEL(HELPICKED).GT.
1168 $ .NE.1) THEN1170 $ -HELOFFSET.AND.GOODHEL(HELPICKED).NE.1) THEN
1169 NEWHELREF=-11171 NEWHELREF=-1
1170 DO H=1,NCOMB1172 DO H=1,NCOMB
1171 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN1173 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN
@@ -1359,16 +1361,18 @@
13591361
1360 CTMODE=BASIC_CT_MODE1362 CTMODE=BASIC_CT_MODE
13611363
1362 IF(.NOT.EVAL_DONE(3).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE1364 IF(.NOT.EVAL_DONE(3).AND.
1363 $.1).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN1365 $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.1)
1366 $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
1364 EVAL_DONE(3)=.TRUE.1367 EVAL_DONE(3)=.TRUE.
1365 CALL ROTATE_PS(PS,P,1)1368 CALL ROTATE_PS(PS,P,1)
1366 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,1)1369 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,1)
1367 GOTO 2001370 GOTO 200
1368 ENDIF1371 ENDIF
13691372
1370 IF(.NOT.EVAL_DONE(4).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE1373 IF(.NOT.EVAL_DONE(4).AND.
1371 $.2).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN1374 $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.2)
1375 $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
1372 EVAL_DONE(4)=.TRUE.1376 EVAL_DONE(4)=.TRUE.
1373 CALL ROTATE_PS(PS,P,2)1377 CALL ROTATE_PS(PS,P,2)
1374 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,2)1378 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,2)
@@ -1924,8 +1928,8 @@
1924C When using COLLIER with the internal stability test, the first1928C When using COLLIER with the internal stability test, the first
1925C evaluation is typically more reliable so we do not want to1929C evaluation is typically more reliable so we do not want to
1926C use the average but rather the first evaluation.1930C use the average but rather the first evaluation.
1927 IF (MLREDUCTIONLIB(I_LIB).EQ.7.AND.COLLIERUSEINTERNALSTABILITYT1931 IF (MLREDUCTIONLIB(I_LIB)
1928 $EST) THEN1932 $ .EQ.7.AND.COLLIERUSEINTERNALSTABILITYTEST) THEN
1929 DO I=1,31933 DO I=1,3
1930 ESTIMATE(I,K) = FULLLIST(I,K,1)1934 ESTIMATE(I,K) = FULLLIST(I,K,1)
1931 ENDDO1935 ENDDO
@@ -2070,8 +2074,8 @@
2070 1009 CONTINUE2074 1009 CONTINUE
2071 ENDDO2075 ENDDO
20722076
2073 WRITE(*,*) 'ERROR:: Stopping function ML5SOINDEX_FOR_SQUARED_ORDE'2077 WRITE(*,*) 'ERROR:: Stopping function'
2074 $ //'RS'2078 $ //' ML5SOINDEX_FOR_SQUARED_ORDERS'
2075 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)2079 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)
2076 STOP2080 STOP
20772081
@@ -2170,8 +2174,8 @@
2170C BEGIN CODE2174C BEGIN CODE
2171C 2175C
2172 DO I=1,NSO2176 DO I=1,NSO
2173 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI2177 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
2174 $NDEXB,I)2178 $ +AMPSPLITORDERS(ORDERINDEXB,I)
2175 ENDDO2179 ENDDO
2176 ML5SQSOINDEX=ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)2180 ML5SQSOINDEX=ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
2177 END2181 END
@@ -2209,8 +2213,8 @@
2209 RETURN2213 RETURN
2210 ENDIF2214 ENDIF
22112215
2212 WRITE(*,*) 'ERROR:: Stopping function ML5GET_SQUARED_ORDERS_FOR_S'2216 WRITE(*,*) 'ERROR:: Stopping function'
2213 $ //'OINDEX'2217 $ //' ML5GET_SQUARED_ORDERS_FOR_SOINDEX'
2214 WRITE(*,*) 'Could not find squared orders index ',SOINDEX2218 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
2215 STOP2219 STOP
22162220
@@ -2249,8 +2253,8 @@
2249 RETURN2253 RETURN
2250 ENDIF2254 ENDIF
22512255
2252 WRITE(*,*) 'ERROR:: Stopping function ML5GET_ORDERS_FOR_AMPSOINDE'2256 WRITE(*,*) 'ERROR:: Stopping function'
2253 $ //'X'2257 $ //' ML5GET_ORDERS_FOR_AMPSOINDEX'
2254 WRITE(*,*) 'Could not find amplitude split orders index ',SOINDEX2258 WRITE(*,*) 'Could not find amplitude split orders index ',SOINDEX
2255 STOP2259 STOP
22562260
@@ -2315,12 +2319,13 @@
23152319
2316 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,2320 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2317 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2321 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2318 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU2322 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
2319 $TATION_CHOICE2323 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
2320 COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_2324 COMMON/COLLIERPOLESFORCEDCHOICE
2321 $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2325 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2322 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_2326 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2323 $CHOICE2327 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
2328 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
23242329
2325 COLLIERCOMPUTEUVPOLES = ONOFF2330 COLLIERCOMPUTEUVPOLES = ONOFF
2326C This is just so that if we read the param again, we don't2331C This is just so that if we read the param again, we don't
@@ -2342,12 +2347,13 @@
23422347
2343 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,2348 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2344 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2349 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2345 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU2350 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
2346 $TATION_CHOICE2351 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
2347 COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_2352 COMMON/COLLIERPOLESFORCEDCHOICE
2348 $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION2353 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
2349 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_2354 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
2350 $CHOICE2355 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
2356 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
23512357
2352 COLLIERCOMPUTEIRPOLES = ONOFF2358 COLLIERCOMPUTEIRPOLES = ONOFF
2353C This is just so that if we read the param again, we don't2359C This is just so that if we read the param again, we don't
23542360
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f 2017-07-07 10:47:20 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f 2020-06-21 12:17:46 +0000
@@ -268,13 +268,14 @@
268268
269 DPW_COPIED = .FALSE.269 DPW_COPIED = .FALSE.
270 DO H=1,NCOMB270 DO H=1,NCOMB
271 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(271 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
272 $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)272 $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
273 $ .NE.0)))) THEN273 $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
274274
275C Handle the possible requirement of specific polarizations275C Handle the possible requirement of specific polarizations
276 IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(276 IF ((.NOT.CHECKPHASE)
277 $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN277 $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
278 $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
278 CYCLE279 CYCLE
279 ENDIF280 ENDIF
280281
281282
=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f'
--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f 2016-04-06 18:45:52 +0000
+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f 2020-06-21 12:17:46 +0000
@@ -113,8 +113,8 @@
113 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO113 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
114 $ ,KIND=8)114 $ ,KIND=8)
115 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1115 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
116 CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP116 CONST(ML5SOINDEX_FOR_BORN_AMP(I))
117 $(I))+CFTOT*CONJG(AMP(I))117 $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
118 ENDDO118 ENDDO
119119
120 DO I=1,NAMPSO120 DO I=1,NAMPSO
@@ -232,8 +232,8 @@
232 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO232 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
233 $ ,KIND=16)233 $ ,KIND=16)
234 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1234 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
235 CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP235 CONST(ML5SOINDEX_FOR_BORN_AMP(I))
236 $(I))+CFTOT*CONJG(AMP(I))236 $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
237 ENDDO237 ENDDO
238238
239 DO I=1,NAMPSO239 DO I=1,NAMPSO
240240
=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f'
--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2019-09-26 11:09:58 +0000
+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2020-06-21 12:17:46 +0000
@@ -142,11 +142,13 @@
142142
143 ! If the helicity grid status is 0, this means that it is not yet initialized.143 ! If the helicity grid status is 0, this means that it is not yet initialized.
144 ! If HEL_PICKED==-1, this means that calls to other matrix<i> where in initialization mode as well for the helicity.144 ! If HEL_PICKED==-1, this means that calls to other matrix<i> where in initialization mode as well for the helicity.
145 IF ((ISHEL(IMIRROR).EQ.0.AND.ISUM_HEL.EQ.0).OR.(DS_GET_DIM_STATUS145 IF ((ISHEL(IMIRROR).EQ.0.AND.ISUM_HEL.EQ.0)
146 $('Helicity').EQ.0).OR.(HEL_PICKED.EQ.-1)) THEN146 $ .OR.(DS_GET_DIM_STATUS('Helicity').EQ.0).OR.(HEL_PICKED.EQ.-1))
147 $ THEN
147 DO I=1,NCOMB148 DO I=1,NCOMB
148 IF (GOODHEL(I,IMIRROR) .OR. NTRY(IMIRROR).LE.MAXTRIES.OR.(ISU149 IF (GOODHEL(I,IMIRROR) .OR. NTRY(IMIRROR)
149 $M_HEL.NE.0).OR.THIS_NTRY(IMIRROR).LE.2) THEN150 $ .LE.MAXTRIES.OR.(ISUM_HEL.NE.0).OR.THIS_NTRY(IMIRROR).LE.2)
151 $ THEN
150 T=MATRIX1(P ,NHEL(1,I),JC(1))152 T=MATRIX1(P ,NHEL(1,I),JC(1))
151 DO JJ=1,NINCOMING153 DO JJ=1,NINCOMING
152 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))154 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))
@@ -174,8 +176,8 @@
174 HEL_JACOBIAN = 1.0D0176 HEL_JACOBIAN = 1.0D0
175 ! We don't want to re-update the helicity grid if it was already updated by another matrix<i>, so we make sure that the reference grid is empty.177 ! We don't want to re-update the helicity grid if it was already updated by another matrix<i>, so we make sure that the reference grid is empty.
176 REF_HELICITY_GRID = DS_GET_DIMENSION(REF_GRID,'Helicity')178 REF_HELICITY_GRID = DS_GET_DIMENSION(REF_GRID,'Helicity')
177 IF((DS_GET_DIM_STATUS('Helicity').EQ.1).AND.(REF_HELICITY_GRI179 IF((DS_GET_DIM_STATUS('Helicity').EQ.1)
178 $D%%N_TOT_ENTRIES.EQ.0)) THEN180 $ .AND.(REF_HELICITY_GRID%%N_TOT_ENTRIES.EQ.0)) THEN
179 ! If we finished the initialization we can update the grid so as to start sampling over it.181 ! If we finished the initialization we can update the grid so as to start sampling over it.
180 ! However the grid will now be filled by dsample with different kind of weights (including pdf, flux, etc...) so by setting the grid_mode of the reference grid to 'initialization' we make sure it will be overwritten (as opposed to 'combined') by the running grid at the next update.182 ! However the grid will now be filled by dsample with different kind of weights (including pdf, flux, etc...) so by setting the grid_mode of the reference grid to 'initialization' we make sure it will be overwritten (as opposed to 'combined') by the running grid at the next update.
181 CALL DS_UPDATE_GRID('Helicity')183 CALL DS_UPDATE_GRID('Helicity')
@@ -436,8 +438,8 @@
436C BEGIN CODE438C BEGIN CODE
437C 439C
438 DO I=1,NSO440 DO I=1,NSO
439 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI441 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
440 $NDEXB,I)442 $ +AMPSPLITORDERS(ORDERINDEXB,I)
441 ENDDO443 ENDDO
442 SQSOINDEX1=SOINDEX_FOR_SQUARED_ORDERS1(SQORDERS)444 SQSOINDEX1=SOINDEX_FOR_SQUARED_ORDERS1(SQORDERS)
443 END445 END
@@ -531,8 +533,8 @@
531 RETURN533 RETURN
532 ENDIF534 ENDIF
533535
534 WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'536 WRITE(*,*) 'ERROR:: Stopping function'
535 $ //'DEX1'537 $ //' GET_SQUARED_ORDERS_FOR_SOINDEX1'
536 WRITE(*,*) 'Could not find squared orders index ',SOINDEX538 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
537 STOP539 STOP
538540
539541
=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f'
--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2019-09-26 11:09:58 +0000
+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2020-06-21 12:17:46 +0000
@@ -387,8 +387,8 @@
387C BEGIN CODE387C BEGIN CODE
388C 388C
389 DO I=1,NSO389 DO I=1,NSO
390 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI390 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
391 $NDEXB,I)391 $ +AMPSPLITORDERS(ORDERINDEXB,I)
392 ENDDO392 ENDDO
393 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)393 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
394 END394 END
@@ -482,8 +482,8 @@
482 RETURN482 RETURN
483 ENDIF483 ENDIF
484484
485 WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'485 WRITE(*,*) 'ERROR:: Stopping function'
486 $ //'DEX'486 $ //' GET_SQUARED_ORDERS_FOR_SOINDEX'
487 WRITE(*,*) 'Could not find squared orders index ',SOINDEX487 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
488 STOP488 STOP
489489
490490
=== modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f'
--- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f 2018-05-25 09:13:24 +0000
+++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f 2020-06-21 12:17:46 +0000
@@ -83,8 +83,8 @@
83 INTEGER NSQUAREDSOP183 INTEGER NSQUAREDSOP1
84 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)84 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
85C The total number of loop reduction libraries85C The total number of loop reduction libraries
86C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai86C At present, there are only
87C , Ninja and COLLIER87C CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
88 INTEGER NLOOPLIB88 INTEGER NLOOPLIB
89 PARAMETER (NLOOPLIB=7)89 PARAMETER (NLOOPLIB=7)
90C Only CutTools or possibly Ninja (if installed with qp support)90C Only CutTools or possibly Ninja (if installed with qp support)
@@ -411,14 +411,15 @@
411C reading the parameters411C reading the parameters
412 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,412 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
413 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION413 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
414 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU414 LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
415 $TATION_CHOICE415 $ COLLIER_IR_POLE_COMPUTATION_CHOICE
416 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION416 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION
417 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./417 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
418 COMMON/ML5_0_COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV418 COMMON/ML5_0_COLLIERPOLESFORCEDCHOICE
419 $_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION419 $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
420 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_420 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
421 $CHOICE421 $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
422 $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
422423
423C This variable controls the general initialization which is424C This variable controls the general initialization which is
424C *common* between all MadLoop SubProcesses.425C *common* between all MadLoop SubProcesses.
@@ -888,8 +889,8 @@
888 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))889 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))
889890
890 CTCALL_REQ_SO_DONE=.FALSE.891 CTCALL_REQ_SO_DONE=.FALSE.
891 FILTER_SO = (.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.(SQSO_TARG892 FILTER_SO = (.NOT.CHECKPHASE)
892 $ET.NE.-1)893 $ .AND.HELDOUBLECHECKED.AND.(SQSO_TARGET.NE.-1)
893894
894 DO I=1,NLOOPGROUPS895 DO I=1,NLOOPGROUPS
895 DO J=0,LOOPMAXCOEFS-1896 DO J=0,LOOPMAXCOEFS-1
@@ -928,13 +929,14 @@
928 ENDIF929 ENDIF
929930
930 DO H=1,NCOMB931 DO H=1,NCOMB
931 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(932 IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
932 $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)933 $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
933 $ .NE.0)))) THEN934 $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
934935
935C Handle the possible requirement of specific polarizations936C Handle the possible requirement of specific polarizations
936 IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(937 IF ((.NOT.CHECKPHASE)
937 $0,0).EQ.0.AND.(.NOT.ML5_0_IS_HEL_SELECTED(H))) THEN938 $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
939 $ .EQ.0.AND.(.NOT.ML5_0_IS_HEL_SELECTED(H))) THEN
938 CYCLE940 CYCLE
939 ENDIF941 ENDIF
940942
@@ -975,8 +977,9 @@
975 DO I=1,NCTAMPS977 DO I=1,NCTAMPS
976 CFTOT=DCMPLX(CF_N(I,J)/DBLE(ABS(CF_D(I,J))),0.0D0)978 CFTOT=DCMPLX(CF_N(I,J)/DBLE(ABS(CF_D(I,J))),0.0D0)
977 IF(CF_D(I,J).LT.0) CFTOT=CFTOT*IMAG1979 IF(CF_D(I,J).LT.0) CFTOT=CFTOT*IMAG1
978 ITEMP = ML5_0_ML5SQSOINDEX(ML5_0_ML5SOINDEX_FOR_LOOP_AMP(980 ITEMP =
979 $I),ML5_0_ML5SOINDEX_FOR_BORN_AMP(J))981 $ ML5_0_ML5SQSOINDEX(ML5_0_ML5SOINDEX_FOR_LOOP_AMP(I)
982 $ ,ML5_0_ML5SOINDEX_FOR_BORN_AMP(J))
980 IF (.NOT.FILTER_SO.OR.SQSO_TARGET.EQ.ITEMP) THEN983 IF (.NOT.FILTER_SO.OR.SQSO_TARGET.EQ.ITEMP) THEN
981 DO K=1,3984 DO K=1,3
982 TEMP2 = DBLE(CFTOT*AMPL(K,I)*CTEMP)985 TEMP2 = DBLE(CFTOT*AMPL(K,I)*CTEMP)
@@ -1102,8 +1105,8 @@
1102 IF((USERHEL.EQ.-1).OR.(USERHEL.EQ.HELPICKED)) THEN1105 IF((USERHEL.EQ.-1).OR.(USERHEL.EQ.HELPICKED)) THEN
1103C Make sure that that no polarization constraint filters out1106C Make sure that that no polarization constraint filters out
1104C this helicity1107C this helicity
1105 IF (POLARIZATIONS(0,0).EQ.-1.OR.ML5_0_IS_HEL_SELECTED(HELPICK1108 IF (POLARIZATIONS(0,0).EQ.
1106 $ED)) THEN1109 $ -1.OR.ML5_0_IS_HEL_SELECTED(HELPICKED)) THEN
1107C TO KEEP TRACK OF THE FINAL ANSWER TO BE RETURNED DURING1110C TO KEEP TRACK OF THE FINAL ANSWER TO BE RETURNED DURING
1108C CHECK PHASE1111C CHECK PHASE
1109 DO I=0,NSQUAREDSO1112 DO I=0,NSQUAREDSO
@@ -1194,8 +1197,8 @@
1194C Of course if it is one, then we do not need to do1197C Of course if it is one, then we do not need to do
1195C anything (because with HELINITSTARTOVER=.FALSE. we only1198C anything (because with HELINITSTARTOVER=.FALSE. we only
1196C support exactly identical Hels.)1199C support exactly identical Hels.)
1197 IF(GOODHEL(HELPICKED).GT.-HELOFFSET.AND.GOODHEL(HELPICKED)1200 IF(GOODHEL(HELPICKED).GT.
1198 $ .NE.1) THEN1201 $ -HELOFFSET.AND.GOODHEL(HELPICKED).NE.1) THEN
1199 NEWHELREF=-11202 NEWHELREF=-1
1200 DO H=1,NCOMB1203 DO H=1,NCOMB
1201 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN1204 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN
@@ -1389,16 +1392,18 @@
13891392
1390 CTMODE=BASIC_CT_MODE1393 CTMODE=BASIC_CT_MODE
13911394
1392 IF(.NOT.EVAL_DONE(3).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE1395 IF(.NOT.EVAL_DONE(3).AND.
1393 $.1).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN1396 $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.1)
1397 $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
1394 EVAL_DONE(3)=.TRUE.1398 EVAL_DONE(3)=.TRUE.
1395 CALL ML5_0_ROTATE_PS(PS,P,1)1399 CALL ML5_0_ROTATE_PS(PS,P,1)
1396 IF (DOING_QP_EVALS) CALL ML5_0_MP_ROTATE_PS(MP_PS,MP_P,1)1400 IF (DOING_QP_EVALS) CALL ML5_0_MP_ROTATE_PS(MP_PS,MP_P,1)
1397 GOTO 2001401 GOTO 200
1398 ENDIF1402 ENDIF
13991403
1400 IF(.NOT.EVAL_DONE(4).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE1404 IF(.NOT.EVAL_DONE(4).AND.
1401 $.2).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN1405 $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.2)
1406 $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
1402 EVAL_DONE(4)=.TRUE.1407 EVAL_DONE(4)=.TRUE.
1403 CALL ML5_0_ROTATE_PS(PS,P,2)1408 CALL ML5_0_ROTATE_PS(PS,P,2)
1404 IF (DOING_QP_EVALS) CALL ML5_0_MP_ROTATE_PS(MP_PS,MP_P,2)1409 IF (DOING_QP_EVALS) CALL ML5_0_MP_ROTATE_PS(MP_PS,MP_P,2)
@@ -1957,8 +1962,8 @@
1957C When using COLLIER with the internal stability test, the first1962C When using COLLIER with the internal stability test, the first
1958C evaluation is typically more reliable so we do not want to1963C evaluation is typically more reliable so we do not want to
1959C use the average but rather the first evaluation.1964C use the average but rather the first evaluation.
1960 IF (MLREDUCTIONLIB(I_LIB).EQ.7.AND.COLLIERUSEINTERNALSTABILITYT1965 IF (MLREDUCTIONLIB(I_LIB)
1961 $EST) THEN1966 $ .EQ.7.AND.COLLIERUSEINTERNALSTABILITYTEST) THEN
1962 DO I=1,31967 DO I=1,3
1963 ESTIMATE(I,K) = FULLLIST(I,K,1)1968 ESTIMATE(I,K) = FULLLIST(I,K,1)
1964 ENDDO1969 ENDDO
@@ -2105,8 +2110,8 @@
2105 1009 CONTINUE2110 1009 CONTINUE
2106 ENDDO2111 ENDDO
21072112
2108 WRITE(*,*) 'ERROR:: Stopping function ML5_0_ML5SOINDEX_FOR_SQUARE'2113 WRITE(*,*) 'ERROR:: Stopping function'
2109 $ //'D_ORDERS'2114 $ //' ML5_0_ML5SOINDEX_FOR_SQUARED_ORDERS'
2110 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)2115 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)
2111 STOP2116 STOP
21122117
@@ -2233,8 +2238,8 @@
2233C BEGIN CODE2238C BEGIN CODE
2234C 2239C
2235 DO I=1,NSO2240 DO I=1,NSO
2236 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI2241 SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
2237 $NDEXB,I)2242 $ +AMPSPLITORDERS(ORDERINDEXB,I)
2238 ENDDO2243 ENDDO
2239 ML5_0_ML5SQSOINDEX=ML5_0_ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)2244 ML5_0_ML5SQSOINDEX=ML5_0_ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
2240 END2245 END
@@ -2273,8 +2278,8 @@
2273 RETURN2278 RETURN
2274 ENDIF2279 ENDIF
22752280
2276 WRITE(*,*) 'ERROR:: Stopping function ML5_0_ML5GET_SQUARED_ORDERS'2281 WRITE(*,*) 'ERROR:: Stopping function'
2277 $ //'_FOR_SOINDEX'2282 $ //' ML5_0_ML5GET_SQUARED_ORDERS_FOR_SOINDEX'
2278 WRITE(*,*) 'Could not find squared orders index ',SOINDEX2283 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
2279 STOP2284 STOP
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: