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
1=== modified file 'MadSpin/decay.py'
2--- MadSpin/decay.py 2020-01-08 14:13:32 +0000
3+++ MadSpin/decay.py 2020-06-21 12:17:46 +0000
4@@ -544,7 +544,7 @@
5 # record the mass for the reshuffling phase,
6 # in case the point passes the reweighting creteria
7 tree[tag]["mass"] = m
8- #update the weigth of the phase-space point
9+ #update the weight of the phase-space point
10 weight=weight*jac
11 # for checking conservation of energy
12 mass_sum -= m
13@@ -2749,7 +2749,7 @@
14 for proc in processes:
15 if not proc.strip().startswith(('add','generate')):
16 proc = 'add process %s' % proc
17- commandline += self.get_proc_with_decay(proc, decay_text, mgcmd._curr_model)
18+ commandline += self.get_proc_with_decay(proc, decay_text, mgcmd._curr_model, self.options)
19
20 commandline = commandline.replace('add process', 'generate',1)
21 logger.info(commandline)
22@@ -2835,7 +2835,7 @@
23 # assert decay.shell_string() in self.all_decay
24
25 @staticmethod
26- def get_proc_with_decay(proc, decay_text, model):
27+ def get_proc_with_decay(proc, decay_text, model, msoptions=None):
28
29 commands = []
30 if '[' in proc:
31@@ -2880,6 +2880,13 @@
32 else:
33 baseproc = new_proc
34 proc_nb = ''
35+
36+ if msoptions and msoptions['global_order_coupling']:
37+ if '@' in proc_nb:
38+ proc_nb += " %s" % msoptions['global_order_coupling']
39+ else:
40+ proc_nb += " @0 %s" % msoptions['global_order_coupling']
41+
42 nb_comma = baseproc.count(',')
43 if nb_comma == 0:
44 commands.append("%s, %s %s %s" % (baseproc, decay_text, proc_nb, options))
45@@ -3087,7 +3094,7 @@
46 for production in self.all_ME.values():
47 decay_set.add(production['decaying'])
48
49- numberev = self.options['Nevents_for_max_weigth'] # number of events
50+ numberev = self.options['Nevents_for_max_weight'] # number of events
51 numberps = self.options['max_weight_ps_point'] # number of phase pace points per event
52
53 logger.info(' ')
54
55=== modified file 'MadSpin/interface_madspin.py'
56--- MadSpin/interface_madspin.py 2020-02-25 14:05:36 +0000
57+++ MadSpin/interface_madspin.py 2020-06-21 12:17:46 +0000
58@@ -60,14 +60,14 @@
59
60 self.add_param("max_weight", -1)
61 self.add_param('curr_dir', os.path.realpath(os.getcwd()))
62- 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)
65 self.add_param('BW_cut', -1)
66 self.add_param('nb_sigma', 0.)
67 self.add_param('ms_dir', '')
68 self.add_param('max_running_process', 100)
69 self.add_param('onlyhelicity', False)
70- self.add_param('spinmode', "madspin", allowed=['madspin','none','onshell'])
71+ self.add_param('spinmode', "madspin", allowed=['full','madspin','none','onshell'])
72 self.add_param('use_old_dir', False, comment='should be use only for faster debugging')
73 self.add_param('run_card', '' , comment='define cut for spinmode==none. Path to run_card to use')
74 self.add_param('fixed_order', False, comment='to activate fixed order handling of counter-event')
75@@ -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")
77 self.add_param('input_format', 'auto', allowed=['auto','lhe', 'hepmc', 'lhe_no_banner'])
78 self.add_param('frame_id', 6)
79+ self.add_param('global_order_coupling', '')
80
81 ############################################################################
82 ## Special post-processing of the options ##
83@@ -137,8 +138,8 @@
84
85 self.decay = madspin.decay_misc()
86 self.model = None
87- self.mode = "madspin" # can be flat/bridge change the way the decay is done.
88- # note amc@nlo does not support bridge.
89+ #self.mode = "madspin" # can be flat/bridge change the way the decay is done.
90+ # # note amc@nlo does not support bridge.
91
92 self.options = MadSpinOptions()
93
94@@ -227,10 +228,10 @@
95
96 if 'mgruncard' in self.banner:
97 run_card = self.banner.charge_card('run_card')
98- if not self.options['Nevents_for_max_weigth']:
99+ if not self.options['Nevents_for_max_weight']:
100 nevents = run_card['nevents']
101 N_weight = max([75, int(3*nevents**(1/3))])
102- self.options['Nevents_for_max_weigth'] = N_weight
103+ self.options['Nevents_for_max_weight'] = N_weight
104 N_sigma = max(4.5, math.log(nevents,7.7))
105 self.options['nb_sigma'] = N_sigma
106 if self.options['BW_cut'] == -1:
107@@ -242,8 +243,8 @@
108 else:
109 self.options['frame_id'] = 6
110 else:
111- if not self.options['Nevents_for_max_weigth']:
112- self.options['Nevents_for_max_weigth'] = 75
113+ if not self.options['Nevents_for_max_weight']:
114+ self.options['Nevents_for_max_weight'] = 75
115 self.options['nb_sigma'] = 4.5
116 if self.options['BW_cut'] == -1:
117 self.options['BW_cut'] = 15.0
118@@ -314,7 +315,7 @@
119 key = line.split()[1]
120 if key in self.multiparticles_ms:
121 del self.multiparticles_ms[key]
122- elif line.startswith('set'):
123+ elif line.startswith('set') and not line.startswith('set gauge'):
124 self.mg5cmd.exec_cmd(line, printcmd=False, precmd=False, postcmd=False)
125 elif line.startswith('import model'):
126 if model_name in line:
127@@ -458,7 +459,7 @@
128 raise self.InvalidCmd('second argument should be a path to a existing directory')
129
130 elif args[0] == "spinmode":
131- if args[1].lower() not in ["full", "onshell", "none"]:
132+ if args[1].lower() not in ["full", "onshell", "none", "madspin"]:
133 raise self.InvalidCmd("spinmode can only take one of those 3 value: full/onshell/none")
134
135 elif args[0] == "run_card":
136@@ -471,6 +472,8 @@
137 arg, value = data.split("=")
138 args.append(arg)
139 args.append(value)
140+ elif args[0] == 'Nevents_for_max_weigth':
141+ args[0] = 'Nevents_for_max_weight'
142
143 def do_set(self, line):
144 """ add one of the options """
145@@ -1204,7 +1207,6 @@
146 run_card = self.run_card
147 else:
148 run_card = banner.RunCard(pjoin(decay_dir, "Cards", "run_card.dat"))
149-
150 run_card["iseed"] = self.options['seed']
151 run_card['gridpack'] = True
152 run_card['systematics_program'] = 'False'
153@@ -1213,6 +1215,7 @@
154 param_card = self.banner['slha']
155 open(pjoin(decay_dir, "Cards", "param_card.dat"),"w").write(param_card)
156 self.options['seed'] += 1
157+ self.seed = self.options['seed']
158 # actually creation
159 me5_cmd.exec_cmd("generate_events run_01 -f")
160 if output_width:
161@@ -1222,9 +1225,11 @@
162 width *= me5_cmd.results.current['cross']
163 me5_cmd.exec_cmd("exit")
164 #remove pointless informat
165- misc.call(["rm", "Cards", "bin", 'Source', 'SubProcesses'], cwd=decay_dir)
166- misc.call(['tar', '-xzpvf', 'run_01_gridpack.tar.gz'], cwd=decay_dir)
167-
168+ if not os.path.exists(pjoin(decay_dir, 'run.sh')):
169+ devnull = open('/dev/null','w')
170+ misc.call(["rm", "Cards", "bin", 'Source', 'SubProcesses'], cwd=decay_dir,stdout=devnull, stderr=-2)
171+ misc.call(['tar', '-xzpvf', 'run_01_gridpack.tar.gz'], cwd=decay_dir,stdout=devnull, stderr=-2)
172+ devnull.close()
173 # Now generate the events
174 if not self.options['ms_dir']:
175 if decay_dir in self.me_int:
176@@ -1364,7 +1369,7 @@
177
178
179 # 2. Generate the events requested
180- nevents_for_max = self.options['Nevents_for_max_weigth']
181+ nevents_for_max = self.options['Nevents_for_max_weight']
182 if nevents_for_max == 0 :
183 nevents_for_max = 75
184 nevents_for_max *= self.options['max_weight_ps_point']
185@@ -1460,8 +1465,8 @@
186 production, counterevt= production[0], production[1:]
187 if curr_event and self.efficiency and curr_event % 10 == 0 and float(str(curr_event)[1:]) ==0:
188 logger.info("decaying event number %s. Efficiency: %s [%s s]" % (curr_event, 1/self.efficiency, time.time()-start))
189- else:
190- logger.info("next event [%s]", time.time()-start)
191+ #else:
192+ # logger.info("next event [%s]", time.time()-start)
193 while 1:
194 nb_try +=1
195 decays = self.get_decay_from_file(production, evt_decayfile, nb_event-curr_event)
196@@ -1559,7 +1564,7 @@
197 if self.options['ms_dir'] and os.path.exists(pjoin(self.options['ms_dir'], 'max_wgt')):
198 return float(open(pjoin(self.options['ms_dir'], 'max_wgt'),'r').read())
199
200- nevents = self.options['Nevents_for_max_weigth']
201+ nevents = self.options['Nevents_for_max_weight']
202 if nevents == 0 :
203 nevents = 75
204
205@@ -1700,7 +1705,7 @@
206 decay_text.append('(%s)' % decay)
207 else:
208 decay_text.append(decay)
209- processes_decay.append(decay)
210+ processes_decay.append(decay)
211 decay_text = ', '.join(decay_text)
212 processes += []
213
214@@ -1715,12 +1720,15 @@
215 except ValueError:
216 raise MadSpinError, 'MadSpin didn\'t allow order restriction after the @ comment: \"%s\" not valid' % proc_nb
217 proc_nb = '@ %i' % proc_nb
218+ if self.options['global_order_coupling']:
219+ proc_nb = '%s %s' % (proc_nb, self.options['global_order_coupling'])
220 else:
221- proc_nb = ''
222+ if self.options['global_order_coupling']:
223+ proc_nb = '@0 %s ' % self.options['global_order_coupling']
224
225 rwgt_interface.ReweightInterface.get_LO_definition_from_NLO()
226
227-
228+ raise Exception
229
230 if __name__ == '__main__':
231
232
233=== modified file 'Template/Common/Cards/madspin_card_default.dat'
234--- Template/Common/Cards/madspin_card_default.dat 2017-01-13 09:56:03 +0000
235+++ Template/Common/Cards/madspin_card_default.dat 2020-06-21 12:17:46 +0000
236@@ -14,7 +14,7 @@
237 #Some options (uncomment to apply)
238 #
239 # set seed 1
240-# set Nevents_for_max_weigth 75 # number of events for the estimate of the max. weight
241+# set Nevents_for_max_weight 75 # number of events for the estimate of the max. weight
242 # set BW_cut 15 # cut on how far the particle can be off-shell
243 # set spinmode onshell # Use one of the madspin special mode
244 set max_weight_ps_point 400 # number of PS to estimate the maximum for each event
245
246=== modified file 'Template/LO/Cards/run_card.dat'
247--- Template/LO/Cards/run_card.dat 2020-01-10 20:02:44 +0000
248+++ Template/LO/Cards/run_card.dat 2020-06-21 12:17:46 +0000
249@@ -165,7 +165,8 @@
250 %(mmnl)s = mmnl ! min invariant mass for all letpons (l+- and vl)
251 %(mmnlmax)s = mmnlmax ! max invariant mass for all letpons (l+- and vl)
252 #IF(LL)# #*********************************************************************
253-#IF(LL)# # Minimum and maximum pt for 4-momenta sum of leptons *
254+#IF(LL)# # Minimum and maximum pt for 4-momenta sum of leptons / neutrino *
255+#IF(LL)# # for pair of lepton includes only same flavor, opposite charge
256 #IF(LL)# #*********************************************************************
257 %(ptllmin)s = ptllmin ! Minimum pt for 4-momenta sum of leptons(l and vl)
258 %(ptllmax)s = ptllmax ! Maximum pt for 4-momenta sum of leptons(l and vl)
259
260=== modified file 'Template/LO/Source/PDF/PhotonFlux.f'
261--- Template/LO/Source/PDF/PhotonFlux.f 2019-12-04 21:34:25 +0000
262+++ Template/LO/Source/PDF/PhotonFlux.f 2020-06-21 12:17:46 +0000
263@@ -1,7 +1,8 @@
264 c/* ********************************************************* */
265 c/* Equivalent photon approximation structure function. * */
266+c/* V.M.Budnev et al., Phys.Rep. 15C (1975) 181 * */
267 c/* Improved Weizsaecker-Williams formula * */
268-c/* V.M.Budnev et al., Phys.Rep. 15C (1975) 181 * */
269+c/* http://inspirehep.net/record/359425 * */
270 c/* ********************************************************* */
271 c provided by Tomasz Pierzchala - UCL
272
273
274=== modified file 'Template/LO/Source/PDF/makefile'
275--- Template/LO/Source/PDF/makefile 2018-01-26 23:06:46 +0000
276+++ Template/LO/Source/PDF/makefile 2020-06-21 12:17:46 +0000
277@@ -12,9 +12,14 @@
278
279 ifdef lhapdf
280 ifeq ($(lhapdfversion),5)
281- PDF = pdfwrap_lhapdf.o pdf_lhapdf.o pdg2pdf_lhapdf.o opendata.o PhotonFlux.o
282+ $(error Bad lhadpfversion version 6 is now required)
283 else
284- PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
285+ ifeq ($(lhapdfsubversion),1) # 6.1.X
286+ PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
287+ else # 6.2.X
288+ CXXFLAGS+=-std=c++11
289+ PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o PhotonFlux.o
290+ endif
291 endif
292 else
293 PDF = Ctq6Pdf.o pdfwrap.o opendata.o pdf.o PhotonFlux.o pdg2pdf.o NNPDFDriver.o
294
295=== added file 'Template/LO/Source/PDF/pdf_lhapdf62.cc'
296--- Template/LO/Source/PDF/pdf_lhapdf62.cc 1970-01-01 00:00:00 +0000
297+++ Template/LO/Source/PDF/pdf_lhapdf62.cc 2020-06-21 12:17:46 +0000
298@@ -0,0 +1,1569 @@
299+// -*- C++ -*-
300+//
301+// This file is part of LHAPDF
302+// Copyright (C) 2012-2016 The LHAPDF collaboration (see AUTHORS for details)
303+//
304+#include "LHAPDF/PDF.h"
305+#include "LHAPDF/PDFSet.h"
306+#include "LHAPDF/PDFIndex.h"
307+#include "LHAPDF/Factories.h"
308+#include "LHAPDF/Utils.h"
309+#include "LHAPDF/Paths.h"
310+#include "LHAPDF/Version.h"
311+#include "LHAPDF/LHAGlue.h"
312+#include <cstring>
313+
314+using namespace std;
315+
316+
317+// We have to create and initialise some common blocks here for backwards compatibility
318+struct w50512 {
319+ double qcdl4, qcdl5;
320+};
321+w50512 w50512_;
322+
323+struct w50513 {
324+ double xmin, xmax, q2min, q2max;
325+};
326+w50513 w50513_;
327+
328+struct lhapdfr {
329+ double qcdlha4, qcdlha5;
330+ int nfllha;
331+};
332+lhapdfr lhapdfr_;
333+
334+
335+
336+namespace { //< Unnamed namespace to restrict visibility to this file
337+
338+
339+ /// @brief PDF object storage here is a smart pointer to ensure deletion of created PDFs
340+ typedef std::shared_ptr<LHAPDF::PDF> PDFPtr;
341+
342+
343+ /// @brief A struct for handling the active PDFs for the Fortran interface.
344+ ///
345+ /// We operate in a string-based way, since maybe there will be sets with names, but no
346+ /// index entry in pdfsets.index.
347+ ///
348+ /// @todo Can we avoid the strings and just work via the LHAPDF ID and factory construction?
349+ ///
350+ /// Smart pointers are used in the native map used for PDF member storage so
351+ /// that they auto-delete if the PDFSetHandler that holds them goes out of
352+ /// scope (i.e. is overwritten).
353+ struct PDFSetHandler {
354+
355+ /// Default constructor
356+ ///
357+ /// It'll be stored in a map so we need one of these...
358+ PDFSetHandler() : currentmem(0)
359+ { }
360+
361+ /// Constructor from a PDF set name
362+ ///
363+ /// @note If the set name contains a member specification, i.e. myname/2,
364+ /// that member rather than the central one will be initialised and made
365+ /// current.
366+ PDFSetHandler(const string& name) {
367+ pair<string, int> set_mem = LHAPDF::lookupPDF(name);
368+ // First check that the lookup was successful, i.e. it was a valid ID for the LHAPDF6 set collection
369+ if (set_mem.first.empty() || set_mem.second < 0)
370+ throw LHAPDF::UserError("Could not find a valid PDF with string = " + name);
371+ // Try to load this PDF
372+ setname = set_mem.first;
373+ loadMember(set_mem.second);
374+ }
375+
376+ /// Constructor from a PDF set's LHAPDF ID code
377+ ///
378+ /// @note The set member given by the ID (rather than the central one) will
379+ /// be initialised and made current.
380+ PDFSetHandler(int lhaid) {
381+ pair<string,int> set_mem = LHAPDF::lookupPDF(lhaid);
382+ // First check that the lookup was successful, i.e. it was a valid ID for the LHAPDF6 set collection
383+ if (set_mem.first.empty() || set_mem.second < 0)
384+ throw LHAPDF::UserError("Could not find a valid PDF with LHAPDF ID = " + LHAPDF::to_str(lhaid));
385+ // Try to load this PDF
386+ setname = set_mem.first;
387+ loadMember(set_mem.second);
388+ }
389+
390+ /// @brief Load a new PDF member, set it to be active
391+ ///
392+ /// If it's already loaded, the existing object will not be reloaded.
393+ void loadMember(int mem) {
394+ if (mem < 0)
395+ throw LHAPDF::UserError("Tried to load a negative PDF member ID: " + LHAPDF::to_str(mem) + " in set " + setname);
396+ if (members.find(mem) == members.end())
397+ members[mem] = PDFPtr(LHAPDF::mkPDF(setname, mem));
398+ currentmem = mem;
399+ //return members[mem];
400+ }
401+
402+ /// Actively delete a PDF member to save memory, set the active member to be the next available, or 0
403+ void unloadMember(int mem) {
404+ members.erase(mem);
405+ const int nextmem = (!members.empty()) ? members.begin()->first : 0;
406+ loadMember(nextmem);
407+ }
408+
409+ /// @brief Get a PDF member, making it active
410+ ///
411+ /// Non-const because it can secretly load the member. Not that constness
412+ /// matters in a Fortran interface utility function!
413+ const PDFPtr member(int mem) {
414+ loadMember(mem);
415+ return members.find(mem)->second;
416+ }
417+
418+ /// Get the currently active PDF member
419+ ///
420+ /// Non-const because it can secretly load the member. Not that constness
421+ /// matters in a Fortran interface utility function!
422+ const PDFPtr activeMember() {
423+ return member(currentmem);
424+ }
425+
426+ /// Get the currently active PDF member
427+ ///
428+ /// Non-const because it can secretly load the member. Not that constness
429+ /// matters in a Fortran interface utility function!
430+ void setActiveMember(int mem) {
431+ loadMember(mem);
432+ }
433+
434+ /// The currently active member in this set
435+ int currentmem;
436+
437+ /// Name of this set
438+ string setname;
439+
440+ /// Map of pointers to selected member PDFs
441+ ///
442+ // /// It's mutable so that a "const" member-getting operation can implicitly
443+ // /// load a new PDF object. Good idea / bad idea? Disabled for now.
444+ // mutable map<int, PDFPtr> members;
445+ map<int, PDFPtr> members;
446+ };
447+
448+
449+ /// Collection of active sets
450+ static map<int, PDFSetHandler> ACTIVESETS;
451+
452+ /// The currently active set
453+ int CURRENTSET = 0;
454+
455+}
456+
457+
458+
459+string lhaglue_get_current_pdf(int nset) {
460+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
461+ return "NONE";
462+ CURRENTSET = nset;
463+ return ACTIVESETS[nset].activeMember()->set().name() + " (" +
464+ LHAPDF::to_str(ACTIVESETS[nset].activeMember()->lhapdfID()) + ")";
465+}
466+
467+
468+
469+namespace {
470+
471+
472+ /// C-string -> Fortran-string converter
473+ ///
474+ /// Credit: https://stackoverflow.com/questions/10163485/passing-char-arrays-from-c-to-fortran
475+ void cstr_to_fstr(const char* cstring, char* fstring, std::size_t fstring_len) {
476+ std::size_t inlen = std::strlen(cstring);
477+ std::size_t cpylen = std::min(inlen, fstring_len);
478+ // TODO: truncation error or warning
479+ //if (inlen > fstring_len) FOOOOO();
480+ std::copy(cstring, cstring+cpylen, fstring);
481+ std::fill(fstring+cpylen, fstring+fstring_len, ' ');
482+ }
483+
484+
485+ /// C++-string -> Fortran-string converter
486+ void ccstr_to_fstr(const string& ccstring, char* fstring, std::size_t fstring_len) {
487+ const char* cstring = ccstring.c_str();
488+ cstr_to_fstr(cstring, fstring, fstring_len);
489+ }
490+
491+
492+ /// Fortran-string -> C++-string converter
493+ string fstr_to_ccstr(const char* fstring, const std::size_t fstring_len, bool spcpad=false) {
494+ // Allocate space for an equivalent C-string (with an extra terminating null byte)
495+ char* s = new char[fstring_len+1];
496+ // Copy all characters and add the terminating null byte
497+ strncpy(s, fstring, fstring_len);
498+ s[fstring_len] = '\0';
499+ // Replace all trailing spaces with null bytes unless explicitly stopped
500+ if (!spcpad) {
501+ for (int i = fstring_len-1; i >= 0; --i) {
502+ if (s[i] != ' ') break;
503+ s[i] = '\0';
504+ }
505+ }
506+ string rtn(s); //< copy the result to a C++ string
507+ delete[] s; //< clean up the dynamic array
508+ return rtn;
509+ }
510+
511+
512+}
513+
514+
515+extern "C" {
516+
517+
518+ // NEW FORTRAN INTERFACE FUNCTIONS
519+
520+ /// Get the LHAPDF library version as a string
521+ void lhapdf_getversion_(char* s, size_t len) {
522+ cstr_to_fstr(LHAPDF_VERSION, s, len);
523+ }
524+
525+
526+ /// List of available PDF sets, returned as a space-separated string
527+ void lhapdf_getpdfsetlist_(char* s, size_t len) {
528+ string liststr;
529+ for (const string& setname : LHAPDF::availablePDFSets()) {
530+ if (!liststr.empty()) liststr += " ";
531+ liststr += setname;
532+ }
533+ ccstr_to_fstr(liststr, s, len);
534+ }
535+
536+
537+ /// Get PDF data path (colon-separated if there is more than one element)
538+ void lhapdf_getdatapath_(char* s, size_t len) {
539+ string pathstr;
540+ for (const string& path : LHAPDF::paths()) {
541+ if (!pathstr.empty()) pathstr += ":";
542+ pathstr += path;
543+ }
544+ ccstr_to_fstr(pathstr, s, len);
545+ }
546+
547+ /// Set PDF data path(s)
548+ void lhapdf_setdatapath_(const char* s, size_t len) {
549+ LHAPDF::setPaths(fstr_to_ccstr(s, len));
550+ }
551+
552+ /// Prepend to PDF data path
553+ void lhapdf_prependdatapath_(const char* s, size_t len) {
554+ LHAPDF::pathsPrepend(fstr_to_ccstr(s, len));
555+ }
556+
557+ /// Append to PDF data path
558+ void lhapdf_appenddatapath_(const char* s, size_t len) {
559+ LHAPDF::pathsAppend(fstr_to_ccstr(s, len));
560+ }
561+
562+
563+ //------------------
564+
565+
566+ void lhapdf_initpdfset_byname_(const int& nset, const char* name, int namelength) {
567+ const string cname = fstr_to_ccstr(name, namelength);
568+ ACTIVESETS[nset] = PDFSetHandler(cname);
569+ CURRENTSET = nset;
570+ }
571+
572+ void lhapdf_initpdfset_byid_(const int& nset, const int& lhaid) {
573+ ACTIVESETS[nset] = PDFSetHandler(lhaid);
574+ CURRENTSET = nset;
575+ }
576+
577+ void lhapdf_delpdfset_(const int& nset) {
578+ ACTIVESETS.erase(nset);
579+ CURRENTSET = 0;
580+ }
581+
582+ void lhapdf_delpdf_(const int& nset, const int& nmem) {
583+ CURRENTSET = nset;
584+ ACTIVESETS[CURRENTSET].unloadMember(nmem);
585+ }
586+
587+
588+ //------------------
589+
590+
591+ void lhapdf_hasflavor(const int& nset, const int& nmem, const int& pid, int& rtn) {
592+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
593+ throw LHAPDF::UserError("Trying to use set slot " + LHAPDF::to_str(nset) + " but it is not initialised");
594+ rtn = ACTIVESETS[nset].member(nmem)->hasFlavor(pid) ? 1 : 0;
595+ // Update current set focus
596+ CURRENTSET = nset;
597+ }
598+
599+
600+ void lhapdf_xfxq2_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q2, double& xf) {
601+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
602+ throw LHAPDF::UserError("Trying to use set slot " + LHAPDF::to_str(nset) + " but it is not initialised");
603+ try {
604+ xf = ACTIVESETS[nset].member(nmem)->xfxQ2(pid, x, q2);
605+ } catch (const exception& e) {
606+ xf = 0;
607+ }
608+ // Update current set focus
609+ CURRENTSET = nset;
610+ }
611+
612+ void lhapdf_xfxq_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q, double& xf) {
613+ const double q2 = q*q;
614+ lhapdf_xfxq2_(nset, nmem, pid, x, q2, xf);
615+ }
616+
617+
618+ void lhapdf_xfxq2_stdpartons_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q2, double* xfs) {
619+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
620+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
621+ // Evaluate for the 13 LHAPDF5 standard partons (-6..6)
622+ for (size_t i = 0; i < 13; ++i) {
623+ try {
624+ xfs[i] = ACTIVESETS[nset].member(nmem)->xfxQ2(i-6, x, q2);
625+ } catch (const exception& e) {
626+ xfs[i] = 0;
627+ }
628+ }
629+ // Update current set focus
630+ CURRENTSET = nset;
631+ }
632+
633+ void lhapdf_xfxq_stdpartons_(const int& nset, const int& nmem, const int& pid, const double& x, const double& q, double* xfs) {
634+ const double q2 = q*q;
635+ lhapdf_xfxq2_stdpartons_(nset, nmem, pid, x, q2, xfs);
636+ }
637+
638+
639+ //-----------------
640+
641+
642+ /// Get the alpha_s order for the set
643+ void lhapdf_getorderas_(const int& nset, const int& nmem, int& oas) {
644+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
645+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
646+ oas = ACTIVESETS[nset].member(nmem)->info().get_entry_as<int>("AlphaS_OrderQCD");
647+ // Update current set focus
648+ CURRENTSET = nset;
649+ }
650+
651+ /// Get the alpha_s(Q2) value for set nset
652+ void lhapdf_alphasq2_(const int& nset, const int& nmem, const double& q2, double& alphas) {
653+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
654+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
655+ alphas = ACTIVESETS[nset].member(nmem)->alphasQ2(q2);
656+ // Update current set focus
657+ CURRENTSET = nset;
658+ }
659+
660+ /// Get the alpha_s(Q) value for set nset
661+ /// @todo Return value rather than return arg? Can we do that elsewhere, too, e.g. single-value PDF xf functions?
662+ void lhapdf_alphasq_(const int& nset, const int& nmem, const double& q, double& alphas) {
663+ const double q2 = q*q;
664+ lhapdf_alphasq2_(nset, nmem, q2, alphas);
665+ }
666+
667+
668+ // Metadata functions
669+
670+ // /// Get the number of error members in the set (with special treatment for single member sets)
671+ // void numberpdfm_(const int& nset, int& numpdf) {
672+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
673+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
674+ // // Set equal to the number of members for the requested set
675+ // numpdf= ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumMembers");
676+ // // Update current set focus
677+ // CURRENTSET = nset;
678+ // }
679+
680+ // /// Get the max number of active flavours
681+ // void getnfm_(const int& nset, int& nf) {
682+ // //nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_NumFlavors");
683+ // nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumFlavors");
684+ // // Update current set focus
685+ // CURRENTSET = nset;
686+ // }
687+
688+ // /// Get nf'th quark mass
689+ // void getqmassm_(const int& nset, const int& nf, double& mass) {
690+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
691+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
692+ // if (nf*nf == 1) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MDown");
693+ // else if (nf*nf == 4) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MUp");
694+ // else if (nf*nf == 9) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MStrange");
695+ // else if (nf*nf == 16) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MCharm");
696+ // else if (nf*nf == 25) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MBottom");
697+ // else if (nf*nf == 36) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MTop");
698+ // else throw LHAPDF::UserError("Trying to get quark mass for invalid quark ID #" + LHAPDF::to_str(nf));
699+ // // Update current set focus
700+ // CURRENTSET = nset;
701+ // }
702+
703+ // /// Get the nf'th quark threshold
704+ // void getthresholdm_(const int& nset, const int& nf, double& Q) {
705+ // try {
706+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
707+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
708+ // if (nf*nf == 1) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdDown");
709+ // else if (nf*nf == 4) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdUp");
710+ // else if (nf*nf == 9) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdStrange");
711+ // else if (nf*nf == 16) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdCharm");
712+ // else if (nf*nf == 25) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdBottom");
713+ // else if (nf*nf == 36) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdTop");
714+ // //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf));
715+ // } catch (...) {
716+ // getqmassm_(nset, nf, Q);
717+ // }
718+ // // Update current set focus
719+ // CURRENTSET = nset;
720+ // }
721+
722+ // void getxminm_(const int& nset, const int& nmem, double& xmin) {
723+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
724+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
725+ // const int activemem = ACTIVESETS[nset].currentmem;
726+ // ACTIVESETS[nset].loadMember(nmem);
727+ // xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
728+ // ACTIVESETS[nset].loadMember(activemem);
729+ // // Update current set focus
730+ // CURRENTSET = nset;
731+ // }
732+
733+ // void getxmaxm_(const int& nset, const int& nmem, double& xmax) {
734+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
735+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
736+ // const int activemem = ACTIVESETS[nset].currentmem;
737+ // ACTIVESETS[nset].loadMember(nmem);
738+ // xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
739+ // ACTIVESETS[nset].loadMember(activemem);
740+ // // Update current set focus
741+ // CURRENTSET = nset;
742+ // }
743+
744+ // void getq2minm_(const int& nset, const int& nmem, double& q2min) {
745+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
746+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
747+ // const int activemem = ACTIVESETS[nset].currentmem;
748+ // ACTIVESETS[nset].loadMember(nmem);
749+ // q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
750+ // ACTIVESETS[nset].loadMember(activemem);
751+ // // Update current set focus
752+ // CURRENTSET = nset;
753+ // }
754+
755+ // void getq2maxm_(const int& nset, const int& nmem, double& q2max) {
756+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
757+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
758+ // const int activemem = ACTIVESETS[nset].currentmem;
759+ // ACTIVESETS[nset].loadMember(nmem);
760+ // q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
761+ // ACTIVESETS[nset].loadMember(activemem);
762+ // // Update current set focus
763+ // CURRENTSET = nset;
764+ // }
765+
766+ // void getminmaxm_(const int& nset, const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) {
767+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
768+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
769+ // const int activemem = ACTIVESETS[nset].currentmem;
770+ // ACTIVESETS[nset].loadMember(nmem);
771+ // xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
772+ // xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
773+ // q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
774+ // q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
775+ // ACTIVESETS[nset].loadMember(activemem);
776+ // // Update current set focus
777+ // CURRENTSET = nset;
778+ // }
779+
780+
781+ // /// Backwards compatibility functions for LHAPDF5 calculations of
782+ // /// PDF uncertainties and PDF correlations (G. Watt, March 2014).
783+
784+ // // subroutine GetPDFUncTypeM(nset,lMonteCarlo,lSymmetric)
785+ // void getpdfunctypem_(const int& nset, int& lmontecarlo, int& lsymmetric) {
786+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
787+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
788+ // const string errorType = ACTIVESETS[nset].activeMember()->set().errorType();
789+ // if (errorType == "replicas") { // Monte Carlo PDF sets
790+ // lmontecarlo = 1;
791+ // lsymmetric = 1;
792+ // } else if (errorType == "symmhessian") { // symmetric eigenvector PDF sets
793+ // lmontecarlo = 0;
794+ // lsymmetric = 1;
795+ // } else { // default: assume asymmetric Hessian eigenvector PDF sets
796+ // lmontecarlo = 0;
797+ // lsymmetric = 0;
798+ // }
799+ // // Update current set focus
800+ // CURRENTSET = nset;
801+ // }
802+ // // subroutine GetPDFUncType(lMonteCarlo,lSymmetric)
803+ // void getpdfunctype_(int& lmontecarlo, int& lsymmetric) {
804+ // int nset1 = 1;
805+ // getpdfunctypem_(nset1, lmontecarlo, lsymmetric);
806+ // }
807+
808+
809+ // // subroutine GetPDFuncertaintyM(nset,values,central,errplus,errminus,errsym)
810+ // void getpdfuncertaintym_(const int& nset, const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
811+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
812+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
813+ // const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
814+ // const vector<double> vecvalues(values, values + nmem + 1);
815+ // LHAPDF::PDFUncertainty err = ACTIVESETS[nset].activeMember()->set().uncertainty(vecvalues, -1);
816+ // central = err.central;
817+ // errplus = err.errplus;
818+ // errminus = err.errminus;
819+ // errsymm = err.errsymm;
820+ // // Update current set focus
821+ // CURRENTSET = nset;
822+ // }
823+ // // subroutine GetPDFuncertainty(values,central,errplus,errminus,errsym)
824+ // void getpdfuncertainty_(const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
825+ // int nset1 = 1;
826+ // getpdfuncertaintym_(nset1, values, central, errplus, errminus, errsymm);
827+ // }
828+
829+
830+ // // subroutine GetPDFcorrelationM(nset,valuesA,valuesB,correlation)
831+ // void getpdfcorrelationm_(const int& nset, const double* valuesA, const double* valuesB, double& correlation) {
832+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
833+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
834+ // const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
835+ // const vector<double> vecvaluesA(valuesA, valuesA + nmem + 1);
836+ // const vector<double> vecvaluesB(valuesB, valuesB + nmem + 1);
837+ // correlation = ACTIVESETS[nset].activeMember()->set().correlation(vecvaluesA,vecvaluesB);
838+ // // Update current set focus
839+ // CURRENTSET = nset;
840+ // }
841+ // // subroutine GetPDFcorrelation(valuesA,valuesB,correlation)
842+ // void getpdfcorrelation_(const double* valuesA, const double* valuesB, double& correlation) {
843+ // int nset1 = 1;
844+ // getpdfcorrelationm_(nset1, valuesA, valuesB, correlation);
845+ // }
846+
847+
848+
849+
850+
851+ //////////////////
852+
853+ // LHAPDF5 / PDFLIB COMPATIBILITY INTERFACE FUNCTIONS
854+
855+
856+ // System-level info
857+
858+ /// LHAPDF library version
859+ void getlhapdfversion_(char* s, size_t len) {
860+ // strncpy(s, LHAPDF_VERSION, len);
861+ cstr_to_fstr(LHAPDF_VERSION, s, len);
862+ }
863+
864+
865+ /// Does nothing, only provided for backward compatibility
866+ void lhaprint_(int& a) { }
867+
868+
869+ /// Set LHAPDF parameters
870+ ///
871+ /// @note Only the verbosity parameters have any effect: PDF behaviour is not
872+ /// controlled globally in LHAPDF6.
873+ void setlhaparm_(const char* par, int parlength) {
874+ const string cpar = LHAPDF::to_upper(fstr_to_ccstr(par, parlength));
875+ if (cpar == "NOSTAT" || cpar == "16") {
876+ cerr << "WARNING: Fortran call to control LHAPDF statistics collection has no effect" << endl;
877+ } else if (cpar == "LHAPDF" || cpar == "17") {
878+ cerr << "WARNING: Fortran call to globally control alpha_s calculation has no effect" << endl;
879+ } else if (cpar == "EXTRAPOLATE" || cpar == "18") {
880+ cerr << "WARNING: Fortran call to globally control PDF extrapolation has no effect" << endl;
881+ } else if (cpar == "SILENT" || cpar == "LOWKEY") {
882+ LHAPDF::setVerbosity(0);
883+ } else if (cpar == "19") {
884+ LHAPDF::setVerbosity(1);
885+ }
886+ }
887+ /// Get LHAPDF parameters -- does nothing in LHAPDF6!
888+ void getlhaparm_(int dummy, char* par, int parlength) {
889+ cstr_to_fstr("", par, parlength);
890+ }
891+
892+
893+ /// Return a dummy max number of sets (there is no limitation now)
894+ void getmaxnumsets_(int& nmax) {
895+ nmax = 1000;
896+ }
897+
898+
899+ /// Set PDF data path
900+ void setpdfpath_(const char* s, size_t len) {
901+ /// @todo Works? Need to check C-string copying, null termination
902+ char s2[1024];
903+ s2[len] = '\0';
904+ strncpy(s2, s, len);
905+ LHAPDF::pathsPrepend(s2);
906+ }
907+
908+ /// Get PDF data path (colon-separated if there is more than one element)
909+ void getdatapath_(char* s, size_t len) {
910+ /// @todo Works? Need to check Fortran string return, string macro treatment, etc.
911+ string pathstr;
912+ for (const string& path : LHAPDF::paths()) {
913+ if (!pathstr.empty()) pathstr += ":";
914+ pathstr += path;
915+ }
916+ // strncpy(s, pathstr.c_str(), len);
917+ cstr_to_fstr(pathstr.c_str(), s, len);
918+ }
919+
920+
921+ // PDF initialisation and focus-switching
922+
923+ /// Load a PDF set
924+ ///
925+ /// @todo Does this version actually take a *path*? What to do?
926+ void initpdfsetm_(const int& nset, const char* setpath, int setpathlength) {
927+ // Strip file extension for backward compatibility
928+ string fullp = string(setpath, setpathlength);
929+ // Remove trailing whitespace
930+ fullp.erase( std::remove_if( fullp.begin(), fullp.end(), ::isspace ), fullp.end() );
931+ // Use only items after the last /
932+ const string pap = LHAPDF::dirname(fullp);
933+ const string p = LHAPDF::basename(fullp);
934+ // Prepend path to search area
935+ LHAPDF::pathsPrepend(pap);
936+ // Handle extensions
937+ string path = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p);
938+ /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case.
939+ if (LHAPDF::to_lower(path) == "cteq6ll") path = "cteq6l1";
940+ // Create the PDF set with index nset
941+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
942+ if (path != ACTIVESETS[nset].setname)
943+ ACTIVESETS[nset] = PDFSetHandler(path); ///< @todo Will be wrong if a structured path is given
944+ CURRENTSET = nset;
945+ }
946+ /// Load a PDF set (non-multiset version)
947+ void initpdfset_(const char* setpath, int setpathlength) {
948+ int nset1 = 1;
949+ initpdfsetm_(nset1, setpath, setpathlength);
950+ }
951+
952+
953+ /// Load a PDF set by name
954+ void initpdfsetbynamem_(const int& nset, const char* setname, int setnamelength) {
955+ // Truncate input to size setnamelength
956+ string p = setname;
957+ p.erase(setnamelength, std::string::npos);
958+ // Strip file extension for backward compatibility
959+ string name = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p);
960+ // Remove trailing whitespace
961+ name.erase( std::remove_if( name.begin(), name.end(), ::isspace ), name.end() );
962+ /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case.
963+ if (LHAPDF::to_lower(name) == "cteq6ll") name = "cteq6l1";
964+ // Create the PDF set with index nset
965+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
966+ if (name != ACTIVESETS[nset].setname)
967+ ACTIVESETS[nset] = PDFSetHandler(name);
968+ // Update current set focus
969+ CURRENTSET = nset;
970+ }
971+ /// Load a PDF set by name (non-multiset version)
972+ void initpdfsetbyname_(const char* setname, int setnamelength) {
973+ int nset1 = 1;
974+ initpdfsetbynamem_(nset1, setname, setnamelength);
975+ }
976+
977+
978+ /// Load a PDF in current set
979+ void initpdfm_(const int& nset, const int& nmember) {
980+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
981+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
982+ ACTIVESETS[nset].loadMember(nmember);
983+ // Update current set focus
984+ CURRENTSET = nset;
985+ }
986+ /// Load a PDF in current set (non-multiset version)
987+ void initpdf_(const int& nmember) {
988+ int nset1 = 1;
989+ initpdfm_(nset1, nmember);
990+ }
991+
992+
993+ /// Get the current set number (i.e. allocation slot index)
994+ void getnset_(int& nset) {
995+ nset = CURRENTSET;
996+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
997+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
998+ }
999+
1000+ /// Explicitly set the current set number (i.e. allocation slot index)
1001+ void setnset_(const int& nset) {
1002+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1003+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1004+ CURRENTSET = nset;
1005+ }
1006+
1007+
1008+ /// Get the current member number in slot nset
1009+ void getnmem_(int& nset, int& nmem) {
1010+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1011+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1012+ nmem = ACTIVESETS[nset].currentmem;
1013+ // Update current set focus
1014+ CURRENTSET = nset;
1015+ }
1016+
1017+ /// Set the current member number in slot nset
1018+ void setnmem_(const int& nset, const int& nmem) {
1019+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1020+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" +
1021+ LHAPDF::to_str(nset) + " but it is not initialised");
1022+ ACTIVESETS[nset].loadMember(nmem);
1023+ // Update current set focus
1024+ CURRENTSET = nset;
1025+ }
1026+
1027+
1028+
1029+ // PDF evolution functions
1030+
1031+ // NEW BY MZ to evolve one single parton
1032+
1033+ /// Get xf(x) values for common partons from current PDF
1034+ void evolvepartm_(const int& nset, const int& ipart, const double& x, const double& q, double& fxq) {
1035+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1036+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1037+ int ipart_copy; // this is to deal with photons, which are labeled 7 in MG5aMC
1038+ ipart_copy = ipart;
1039+ if (ipart==7) ipart_copy = 22;
1040+ try {
1041+ fxq = ACTIVESETS[nset].activeMember()->xfxQ(ipart_copy, x, q);
1042+ } catch (const exception& e) {
1043+ fxq = 0;
1044+ }
1045+ // Update current set focus
1046+ CURRENTSET = nset;
1047+ }
1048+ /// Get xf(x) values for common partons from current PDF (non-multiset version)
1049+ void evolvepart_( const int& ipart, const double& x, const double& q, double& fxq) {
1050+ int nset1 = 1;
1051+ evolvepartm_(nset1, ipart, x, q, fxq);
1052+ }
1053+
1054+ /// Get xf(x) values for common partons from current PDF
1055+ void evolvepdfm_(const int& nset, const double& x, const double& q, double* fxq) {
1056+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1057+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1058+ // Evaluate for the 13 LHAPDF5 standard partons (-6..6)
1059+ for (size_t i = 0; i < 13; ++i) {
1060+ try {
1061+ fxq[i] = ACTIVESETS[nset].activeMember()->xfxQ(i-6, x, q);
1062+ } catch (const exception& e) {
1063+ fxq[i] = 0;
1064+ }
1065+ }
1066+ // Update current set focus
1067+ CURRENTSET = nset;
1068+ }
1069+ /// Get xf(x) values for common partons from current PDF (non-multiset version)
1070+ void evolvepdf_(const double& x, const double& q, double* fxq) {
1071+ int nset1 = 1;
1072+ evolvepdfm_(nset1, x, q, fxq);
1073+ }
1074+
1075+
1076+ /// Determine if the current PDF has a photon flavour (historically only MRST2004QED)
1077+ /// @todo Function rather than subroutine?
1078+ /// @note There is no multiset version. has_photon will respect the current set slot.
1079+ bool has_photon_() {
1080+ return ACTIVESETS[CURRENTSET].activeMember()->hasFlavor(22);
1081+ }
1082+
1083+
1084+ /// Get xfx values from current PDF, including an extra photon flavour
1085+ void evolvepdfphotonm_(const int& nset, const double& x, const double& q, double* fxq, double& photonfxq) {
1086+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1087+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1088+ // First evaluate the "normal" partons
1089+ evolvepdfm_(nset, x, q, fxq);
1090+ // Then evaluate the photon flavor (historically only for MRST2004QED)
1091+ try {
1092+ photonfxq = ACTIVESETS[nset].activeMember()->xfxQ(22, x, q);
1093+ } catch (const exception& e) {
1094+ photonfxq = 0;
1095+ }
1096+ // Update current set focus
1097+ CURRENTSET = nset;
1098+ }
1099+ /// Get xfx values from current PDF, including an extra photon flavour (non-multiset version)
1100+ void evolvepdfphoton_(const double& x, const double& q, double* fxq, double& photonfxq) {
1101+ int nset1 = 1;
1102+ evolvepdfphotonm_(nset1, x, q, fxq, photonfxq);
1103+ }
1104+
1105+
1106+ /// Get xf(x) values for common partons from a photon PDF
1107+ void evolvepdfpm_(const int& nset, const double& x, const double& q, const double& p2, const int& ip2, double& fxq) {
1108+ // Update current set focus
1109+ CURRENTSET = nset;
1110+ throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported in LHAPDF6");
1111+ }
1112+ /// Get xf(x) values for common partons from a photon PDF (non-multiset version)
1113+ void evolvepdfp_(const double& x, const double& q, const double& p2, const int& ip2, double& fxq) {
1114+ int nset1 = 1;
1115+ evolvepdfpm_(nset1, x, q, p2, ip2, fxq);
1116+ }
1117+
1118+
1119+ // alpha_s evolution
1120+
1121+ /// Get the alpha_s order for the set
1122+ void getorderasm_(const int& nset, int& oas) {
1123+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1124+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1125+ // Set equal to the number of members for the requested set
1126+ oas = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_OrderQCD");
1127+ // Update current set focus
1128+ CURRENTSET = nset;
1129+ }
1130+ /// Get the alpha_s order for the set (non-multiset version)
1131+ void getorderas_(int& oas) {
1132+ int nset1 = 1;
1133+ getorderasm_(nset1, oas);
1134+ }
1135+
1136+
1137+ /// Get the alpha_s(Q) value for set nset
1138+ double alphaspdfm_(const int& nset, const double& Q){
1139+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1140+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1141+ return ACTIVESETS[nset].activeMember()->alphasQ(Q);
1142+ // Update current set focus
1143+ CURRENTSET = nset;
1144+ }
1145+ /// Get the alpha_s(Q) value for the set (non-multiset version)
1146+ double alphaspdf_(const double& Q){
1147+ int nset1 = 1;
1148+ return alphaspdfm_(nset1, Q);
1149+ }
1150+
1151+
1152+ // Metadata functions
1153+
1154+ /// Get the number of error members in the set
1155+ void numberpdfm_(const int& nset, int& numpdf) {
1156+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1157+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1158+ // Set equal to the number of members for the requested set
1159+ numpdf= ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumMembers");
1160+ // Reproduce old LHAPDF v5 behaviour, i.e. subtract 1
1161+ numpdf -= 1;
1162+ // Update current set focus
1163+ CURRENTSET = nset;
1164+ }
1165+ /// Get the number of error members in the set (non-multiset version)
1166+ void numberpdf_(int& numpdf) {
1167+ int nset1 = 1;
1168+ numberpdfm_(nset1, numpdf);
1169+ }
1170+
1171+
1172+ /// Get the max number of active flavours
1173+ void getnfm_(const int& nset, int& nf) {
1174+ //nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_NumFlavors");
1175+ nf = ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumFlavors");
1176+ // Update current set focus
1177+ CURRENTSET = nset;
1178+ }
1179+ /// Get the max number of active flavours (non-multiset version)
1180+ void getnf_(int& nf) {
1181+ int nset1 = 1;
1182+ getnfm_(nset1, nf);
1183+ }
1184+
1185+
1186+ /// Get nf'th quark mass
1187+ void getqmassm_(const int& nset, const int& nf, double& mass) {
1188+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1189+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1190+ if (nf*nf == 1) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MDown");
1191+ else if (nf*nf == 4) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MUp");
1192+ else if (nf*nf == 9) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MStrange");
1193+ else if (nf*nf == 16) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MCharm");
1194+ else if (nf*nf == 25) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MBottom");
1195+ else if (nf*nf == 36) mass = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("MTop");
1196+ else throw LHAPDF::UserError("Trying to get quark mass for invalid quark ID #" + LHAPDF::to_str(nf));
1197+ // Update current set focus
1198+ CURRENTSET = nset;
1199+ }
1200+ /// Get nf'th quark mass (non-multiset version)
1201+ void getqmass_(const int& nf, double& mass) {
1202+ int nset1 = 1;
1203+ getqmassm_(nset1, nf, mass);
1204+ }
1205+
1206+
1207+ /// Get the nf'th quark threshold
1208+ void getthresholdm_(const int& nset, const int& nf, double& Q) {
1209+ try {
1210+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1211+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1212+ if (nf*nf == 1) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdDown");
1213+ else if (nf*nf == 4) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdUp");
1214+ else if (nf*nf == 9) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdStrange");
1215+ else if (nf*nf == 16) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdCharm");
1216+ else if (nf*nf == 25) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdBottom");
1217+ else if (nf*nf == 36) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("ThresholdTop");
1218+ //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf));
1219+ } catch (...) {
1220+ getqmassm_(nset, nf, Q);
1221+ }
1222+ // Update current set focus
1223+ CURRENTSET = nset;
1224+ }
1225+ /// Get the nf'th quark threshold
1226+ void getthreshold_(const int& nf, double& Q) {
1227+ int nset1 = 1;
1228+ getthresholdm_(nset1, nf, Q);
1229+ }
1230+
1231+
1232+ /// Print PDF set's description to stdout
1233+ void getdescm_(const int& nset) {
1234+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1235+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1236+ cout << ACTIVESETS[nset].activeMember()->description() << endl;
1237+ // Update current set focus
1238+ CURRENTSET = nset;
1239+ }
1240+ void getdesc_() {
1241+ int nset1 = 1;
1242+ getdescm_(nset1);
1243+ }
1244+
1245+
1246+ void getxminm_(const int& nset, const int& nmem, double& xmin) {
1247+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1248+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1249+ const int activemem = ACTIVESETS[nset].currentmem;
1250+ ACTIVESETS[nset].loadMember(nmem);
1251+ xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
1252+ ACTIVESETS[nset].loadMember(activemem);
1253+ // Update current set focus
1254+ CURRENTSET = nset;
1255+ }
1256+ void getxmin_(const int& nmem, double& xmin) {
1257+ int nset1 = 1;
1258+ getxminm_(nset1, nmem, xmin);
1259+ }
1260+
1261+
1262+ void getxmaxm_(const int& nset, const int& nmem, double& xmax) {
1263+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1264+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1265+ const int activemem = ACTIVESETS[nset].currentmem;
1266+ ACTIVESETS[nset].loadMember(nmem);
1267+ xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
1268+ ACTIVESETS[nset].loadMember(activemem);
1269+ // Update current set focus
1270+ CURRENTSET = nset;
1271+ }
1272+ void getxmax_(const int& nmem, double& xmax) {
1273+ int nset1 = 1;
1274+ getxmaxm_(nset1, nmem, xmax);
1275+ }
1276+
1277+
1278+ void getq2minm_(const int& nset, const int& nmem, double& q2min) {
1279+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1280+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1281+ const int activemem = ACTIVESETS[nset].currentmem;
1282+ ACTIVESETS[nset].loadMember(nmem);
1283+ q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
1284+ ACTIVESETS[nset].loadMember(activemem);
1285+ // Update current set focus
1286+ CURRENTSET = nset;
1287+ }
1288+ void getq2min_(const int& nmem, double& q2min) {
1289+ int nset1 = 1;
1290+ getq2minm_(nset1, nmem, q2min);
1291+ }
1292+
1293+
1294+ void getq2maxm_(const int& nset, const int& nmem, double& q2max) {
1295+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1296+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1297+ const int activemem = ACTIVESETS[nset].currentmem;
1298+ ACTIVESETS[nset].loadMember(nmem);
1299+ q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
1300+ ACTIVESETS[nset].loadMember(activemem);
1301+ // Update current set focus
1302+ CURRENTSET = nset;
1303+ }
1304+ void getq2max_(const int& nmem, double& q2max) {
1305+ int nset1 = 1;
1306+ getq2maxm_(nset1, nmem, q2max);
1307+ }
1308+
1309+
1310+ void getminmaxm_(const int& nset, const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) {
1311+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1312+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1313+ const int activemem = ACTIVESETS[nset].currentmem;
1314+ ACTIVESETS[nset].loadMember(nmem);
1315+ xmin = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
1316+ xmax = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
1317+ q2min = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"));
1318+ q2max = LHAPDF::sqr(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"));
1319+ ACTIVESETS[nset].loadMember(activemem);
1320+ // Update current set focus
1321+ CURRENTSET = nset;
1322+ }
1323+ void getminmax_(const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) {
1324+ int nset1 = 1;
1325+ getminmaxm_(nset1, nmem, xmin, xmax, q2min, q2max);
1326+ }
1327+
1328+
1329+
1330+ void getlam4m_(const int& nset, const int& nmem, double& qcdl4) {
1331+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1332+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1333+ CURRENTSET = nset;
1334+ ACTIVESETS[nset].loadMember(nmem);
1335+ qcdl4 = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda4", -1.0);
1336+ }
1337+ void getlam4_(const int& nmem, double& qcdl4) {
1338+ int nset1 = 1;
1339+ getlam4m_(nset1, nmem, qcdl4);
1340+ }
1341+
1342+
1343+ void getlam5m_(const int& nset, const int& nmem, double& qcdl5) {
1344+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1345+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1346+ CURRENTSET = nset;
1347+ ACTIVESETS[nset].loadMember(nmem);
1348+ qcdl5 = ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda5", -1.0);
1349+ }
1350+ void getlam5_(const int& nmem, double& qcdl5) {
1351+ int nset1 = 1;
1352+ getlam5m_(nset1, nmem, qcdl5);
1353+ }
1354+
1355+
1356+
1357+
1358+
1359+ /// Backwards compatibility functions for LHAPDF5 calculations of
1360+ /// PDF uncertainties and PDF correlations (G. Watt, March 2014).
1361+
1362+ // subroutine GetPDFUncTypeM(nset,lMonteCarlo,lSymmetric)
1363+ void getpdfunctypem_(const int& nset, int& lmontecarlo, int& lsymmetric) {
1364+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1365+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1366+ const string errorType = ACTIVESETS[nset].activeMember()->set().errorType();
1367+ if (LHAPDF::startswith(errorType, "replicas")) { // Monte Carlo PDF sets
1368+ lmontecarlo = 1;
1369+ lsymmetric = 1;
1370+ } else if (LHAPDF::startswith(errorType, "symmhessian")) { // symmetric eigenvector PDF sets
1371+ lmontecarlo = 0;
1372+ lsymmetric = 1;
1373+ } else { // default: assume asymmetric Hessian eigenvector PDF sets
1374+ lmontecarlo = 0;
1375+ lsymmetric = 0;
1376+ }
1377+ // Update current set focus
1378+ CURRENTSET = nset;
1379+ }
1380+ // subroutine GetPDFUncType(lMonteCarlo,lSymmetric)
1381+ void getpdfunctype_(int& lmontecarlo, int& lsymmetric) {
1382+ int nset1 = 1;
1383+ getpdfunctypem_(nset1, lmontecarlo, lsymmetric);
1384+ }
1385+
1386+
1387+ // subroutine GetPDFuncertaintyM(nset,values,central,errplus,errminus,errsym)
1388+ void getpdfuncertaintym_(const int& nset, const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
1389+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1390+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1391+ const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
1392+ const vector<double> vecvalues(values, values + nmem + 1);
1393+ LHAPDF::PDFUncertainty err = ACTIVESETS[nset].activeMember()->set().uncertainty(vecvalues, -1);
1394+ central = err.central;
1395+ // For a combined set, the PDF and parameter variation uncertainties will be added in quadrature.
1396+ errplus = err.errplus;
1397+ errminus = err.errminus;
1398+ errsymm = err.errsymm;
1399+ // Update current set focus
1400+ CURRENTSET = nset;
1401+ }
1402+ // subroutine GetPDFuncertainty(values,central,errplus,errminus,errsym)
1403+ void getpdfuncertainty_(const double* values, double& central, double& errplus, double& errminus, double& errsymm) {
1404+ int nset1 = 1;
1405+ getpdfuncertaintym_(nset1, values, central, errplus, errminus, errsymm);
1406+ }
1407+
1408+
1409+ // subroutine GetPDFcorrelationM(nset,valuesA,valuesB,correlation)
1410+ void getpdfcorrelationm_(const int& nset, const double* valuesA, const double* valuesB, double& correlation) {
1411+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1412+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1413+ const size_t nmem = ACTIVESETS[nset].activeMember()->set().size()-1;
1414+ const vector<double> vecvaluesA(valuesA, valuesA + nmem + 1);
1415+ const vector<double> vecvaluesB(valuesB, valuesB + nmem + 1);
1416+ correlation = ACTIVESETS[nset].activeMember()->set().correlation(vecvaluesA,vecvaluesB);
1417+ // Update current set focus
1418+ CURRENTSET = nset;
1419+ }
1420+ // subroutine GetPDFcorrelation(valuesA,valuesB,correlation)
1421+ void getpdfcorrelation_(const double* valuesA, const double* valuesB, double& correlation) {
1422+ int nset1 = 1;
1423+ getpdfcorrelationm_(nset1, valuesA, valuesB, correlation);
1424+ }
1425+
1426+
1427+ ///////////////////////////////////////
1428+
1429+
1430+ /// REALLY OLD PDFLIB COMPATIBILITY FUNCTIONS
1431+
1432+ /// PDFLIB initialisation function
1433+ void pdfset_(const char* par, const double* value, int parlength) {
1434+
1435+ string my_par(par), message;
1436+ int id;
1437+ // Identify the calling program (yuck!)
1438+ if (my_par.find("NPTYPE") != string::npos) {
1439+ message = "==== LHAPDF6 USING PYTHIA-TYPE LHAGLUE INTERFACE ====";
1440+ // Take PDF ID from value[2]
1441+ id = value[2]+1000*value[1];
1442+ } else if (my_par.find("HWLHAPDF") != string::npos) {
1443+ message = "==== LHAPDF6 USING HERWIG-TYPE LHAGLUE INTERFACE ====";
1444+ // Take PDF ID from value[0]
1445+ id = value[0];
1446+ } else if (my_par.find("DEFAULT") != string::npos) {
1447+ message = "==== LHAPDF6 USING DEFAULT-TYPE LHAGLUE INTERFACE ====";
1448+ // Take PDF ID from value[0]
1449+ id = value[0];
1450+ } else {
1451+ message = "==== LHAPDF6 USING PDFLIB-TYPE LHAGLUE INTERFACE ====";
1452+ // Take PDF ID from value[2]
1453+ id = value[2]+1000*value[1];
1454+ }
1455+ pair<string, int> set_id = LHAPDF::lookupPDF(id);
1456+ if (set_id.first != ACTIVESETS[1].setname || set_id.second != ACTIVESETS[1].currentmem) {
1457+ if (LHAPDF::verbosity() > 0) cout << message << endl;
1458+ ACTIVESETS[1] = PDFSetHandler(id);
1459+ }
1460+
1461+ CURRENTSET = 1;
1462+
1463+ // Extract parameters for common blocks (with sensible fallback values)
1464+ PDFPtr pdf = ACTIVESETS[1].activeMember();
1465+ w50513_.xmin = pdf->info().get_entry_as<double>("XMin", 0.0);
1466+ w50513_.xmax = pdf->info().get_entry_as<double>("XMax", 1.0);
1467+ w50513_.q2min = LHAPDF::sqr(pdf->info().get_entry_as<double>("QMin", 1.0));
1468+ w50513_.q2max = LHAPDF::sqr(pdf->info().get_entry_as<double>("QMax", 1.0e5));
1469+ w50512_.qcdl4 = pdf->info().get_entry_as<double>("AlphaS_Lambda4", 0.0);
1470+ w50512_.qcdl5 = pdf->info().get_entry_as<double>("AlphaS_Lambda5", 0.0);
1471+ lhapdfr_.qcdlha4 = pdf->info().get_entry_as<double>("AlphaS_Lambda4", 0.0);
1472+ lhapdfr_.qcdlha5 = pdf->info().get_entry_as<double>("AlphaS_Lambda5", 0.0);
1473+ lhapdfr_.nfllha = 4;
1474+ // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values
1475+ if (pdf->info().get_entry_as<bool>("Pythia6LambdaV5Compat", true)) {
1476+ w50512_.qcdl4 = 0.192;
1477+ w50512_.qcdl5 = 0.192;
1478+ lhapdfr_.qcdlha4 = 0.192;
1479+ lhapdfr_.qcdlha5 = 0.192;
1480+ }
1481+ }
1482+
1483+ /// PDFLIB nucleon structure function querying
1484+ void structm_(const double& x, const double& q,
1485+ double& upv, double& dnv, double& usea, double& dsea,
1486+ double& str, double& chm, double& bot, double& top, double& glu) {
1487+ CURRENTSET = 1;
1488+ /// Fill (partial) parton return variables
1489+ PDFPtr pdf = ACTIVESETS[1].activeMember();
1490+ dsea = pdf->xfxQ(-1, x, q);
1491+ usea = pdf->xfxQ(-2, x, q);
1492+ dnv = pdf->xfxQ(1, x, q) - dsea;
1493+ upv = pdf->xfxQ(2, x, q) - usea;
1494+ str = pdf->xfxQ(3, x, q);
1495+ chm = (pdf->hasFlavor(4)) ? pdf->xfxQ(4, x, q) : 0;
1496+ bot = (pdf->hasFlavor(5)) ? pdf->xfxQ(5, x, q) : 0;
1497+ top = (pdf->hasFlavor(6)) ? pdf->xfxQ(6, x, q) : 0;
1498+ glu = pdf->xfxQ(21, x, q);
1499+ }
1500+
1501+ /// PDFLIB photon structure function querying
1502+ void structp_(const double& x, const double& q2, const double& p2, const double& ip2,
1503+ double& upv, double& dnv, double& usea, double& dsea,
1504+ double& str, double& chm, double& bot, double& top, double& glu) {
1505+ throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported");
1506+ }
1507+
1508+ /// PDFLIB statistics on PDF under/overflows
1509+ void pdfsta_() {
1510+ /// @note Can't do anything...
1511+ }
1512+
1513+
1514+}
1515+
1516+
1517+// LHAPDF namespace C++ compatibility code
1518+#ifdef ENABLE_LHAGLUE_CXX
1519+
1520+
1521+void LHAPDF::setVerbosity(LHAPDF::Verbosity noiselevel) {
1522+ LHAPDF::setVerbosity((int) noiselevel);
1523+}
1524+
1525+void LHAPDF::setPDFPath(const string& path) {
1526+ pathsPrepend(path);
1527+}
1528+
1529+string LHAPDF::pdfsetsPath() {
1530+ return paths()[0];
1531+}
1532+
1533+int LHAPDF::numberPDF() {
1534+ int nmem;
1535+ numberpdf_(nmem);
1536+ return nmem;
1537+}
1538+int LHAPDF::numberPDF(int nset) {
1539+ int nmem;
1540+ numberpdfm_(nset,nmem);
1541+ return nmem;
1542+}
1543+
1544+void LHAPDF::initPDF( int memset) {
1545+ int nset1 = 1;
1546+ initpdfm_(nset1, memset);
1547+}
1548+void LHAPDF::initPDF(int nset, int memset) {
1549+ initpdfm_(nset, memset);
1550+}
1551+
1552+
1553+double LHAPDF::xfx(double x, double Q, int fl) {
1554+ vector<double> r(13);
1555+ evolvepdf_(x, Q, &r[0]);
1556+ return r[fl+6];
1557+}
1558+double LHAPDF::xfx(int nset, double x, double Q, int fl) {
1559+ vector<double> r(13);
1560+ evolvepdfm_(nset, x, Q, &r[0]);
1561+ return r[fl+6];
1562+}
1563+
1564+vector<double> LHAPDF::xfx(double x, double Q) {
1565+ vector<double> r(13);
1566+ evolvepdf_(x, Q, &r[0]);
1567+ return r;
1568+}
1569+vector<double> LHAPDF::xfx(int nset, double x, double Q) {
1570+ vector<double> r(13);
1571+ evolvepdfm_(nset, x, Q, &r[0]);
1572+ return r;
1573+}
1574+
1575+void LHAPDF::xfx(double x, double Q, double* results) {
1576+ evolvepdf_(x, Q, results);
1577+}
1578+void LHAPDF::xfx(int nset, double x, double Q, double* results) {
1579+ evolvepdfm_(nset, x, Q, results);
1580+}
1581+
1582+
1583+vector<double> LHAPDF::xfxphoton(double x, double Q) {
1584+ vector<double> r(13);
1585+ double mphoton;
1586+ evolvepdfphoton_(x, Q, &r[0], mphoton);
1587+ r.push_back(mphoton);
1588+ return r;
1589+}
1590+vector<double> LHAPDF::xfxphoton(int nset, double x, double Q) {
1591+ vector<double> r(13);
1592+ double mphoton;
1593+ evolvepdfphotonm_(nset, x, Q, &r[0], mphoton);
1594+ r.push_back(mphoton);
1595+ return r;
1596+}
1597+
1598+void LHAPDF::xfxphoton(double x, double Q, double* results) {
1599+ evolvepdfphoton_(x, Q, results, results[13]);
1600+}
1601+void LHAPDF::xfxphoton(int nset, double x, double Q, double* results) {
1602+ evolvepdfphotonm_(nset, x, Q, results, results[13]);
1603+}
1604+
1605+double LHAPDF::xfxphoton(double x, double Q, int fl) {
1606+ vector<double> r(13);
1607+ double mphoton;
1608+ evolvepdfphoton_(x, Q, &r[0], mphoton);
1609+ if (fl == 7) return mphoton;
1610+ return r[fl+6];
1611+}
1612+double LHAPDF::xfxphoton(int nset, double x, double Q, int fl) {
1613+ vector<double> r(13);
1614+ double mphoton;
1615+ evolvepdfphotonm_(nset, x, Q, &r[0], mphoton);
1616+ if ( fl == 7 ) return mphoton;
1617+ return r[fl+6];
1618+}
1619+
1620+
1621+void LHAPDF::initPDFSet(const string& filename, int nmem) {
1622+ initPDFSet(1,filename, nmem);
1623+}
1624+
1625+void LHAPDF::initPDFSet(int nset, const string& filename, int nmem) {
1626+ initPDFSetByName(nset,filename);
1627+ ACTIVESETS[nset].loadMember(nmem);
1628+ CURRENTSET = nset;
1629+}
1630+
1631+
1632+void LHAPDF::initPDFSet(const string& filename, SetType type, int nmem) {
1633+ // silently ignore type
1634+ initPDFSet(1,filename, nmem);
1635+}
1636+
1637+void LHAPDF::initPDFSet(int nset, const string& filename, SetType type, int nmem) {
1638+ // silently ignore type
1639+ initPDFSetByName(nset,filename);
1640+ ACTIVESETS[nset].loadMember(nmem);
1641+ CURRENTSET = nset;
1642+}
1643+
1644+void LHAPDF::initPDFSet(int nset, int setid, int nmem) {
1645+ pair<string, int> set_id = LHAPDF::lookupPDF(setid+nmem);
1646+ if (set_id.second != nmem)
1647+ throw LHAPDF::UserError("Inconsistent member numbers: " + LHAPDF::to_str(set_id.second) + " != " + LHAPDF::to_str(nmem));
1648+ if (set_id.first != ACTIVESETS[nset].setname || nmem != ACTIVESETS[nset].currentmem)
1649+ ACTIVESETS[nset] = PDFSetHandler(setid+nmem);
1650+ CURRENTSET = nset;
1651+}
1652+
1653+void LHAPDF::initPDFSet(int setid, int nmem) {
1654+ initPDFSet(1,setid,nmem);
1655+}
1656+
1657+#define SIZE 999
1658+void LHAPDF::initPDFSetByName(const string& filename) {
1659+ std::cout << "initPDFSetByName: " << filename << std::endl;
1660+ char cfilename[SIZE+1];
1661+ strncpy(cfilename, filename.c_str(), SIZE);
1662+ initpdfsetbyname_(cfilename, filename.length());
1663+}
1664+
1665+void LHAPDF::initPDFSetByName(int nset, const string& filename) {
1666+ char cfilename[SIZE+1];
1667+ strncpy(cfilename, filename.c_str(), SIZE);
1668+ initpdfsetbynamem_(nset, cfilename, filename.length());
1669+}
1670+
1671+void LHAPDF::initPDFSetByName(const string& filename, SetType type) {
1672+ //silently ignore type
1673+ std::cout << "initPDFSetByName: " << filename << std::endl;
1674+ char cfilename[SIZE+1];
1675+ strncpy(cfilename, filename.c_str(), SIZE);
1676+ initpdfsetbyname_(cfilename, filename.length());
1677+}
1678+
1679+void LHAPDF::initPDFSetByName(int nset, const string& filename, SetType type) {
1680+ //silently ignore type
1681+ char cfilename[SIZE+1];
1682+ strncpy(cfilename, filename.c_str(), SIZE);
1683+ initpdfsetbynamem_(nset, cfilename, filename.length());
1684+}
1685+
1686+
1687+void LHAPDF::getDescription() {
1688+ getDescription(1);
1689+}
1690+
1691+void LHAPDF::getDescription(int nset) {
1692+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1693+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1694+ cout << ACTIVESETS[nset].activeMember()->set().description() << endl;
1695+}
1696+
1697+
1698+double LHAPDF::alphasPDF(double Q) {
1699+ return LHAPDF::alphasPDF(1, Q) ;
1700+}
1701+
1702+double LHAPDF::alphasPDF(int nset, double Q) {
1703+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1704+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1705+ CURRENTSET = nset;
1706+ // return alphaS for the requested set
1707+ return ACTIVESETS[nset].activeMember()->alphasQ(Q);
1708+}
1709+
1710+
1711+bool LHAPDF::hasPhoton(){
1712+ return has_photon_();
1713+}
1714+
1715+
1716+int LHAPDF::getOrderAlphaS() {
1717+ return LHAPDF::getOrderAlphaS(1) ;
1718+}
1719+
1720+int LHAPDF::getOrderAlphaS(int nset) {
1721+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1722+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1723+ CURRENTSET = nset;
1724+ // return alphaS Order for the requested set
1725+ return ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("AlphaS_OrderQCD", -1);
1726+}
1727+
1728+
1729+int LHAPDF::getOrderPDF() {
1730+ return LHAPDF::getOrderPDF(1) ;
1731+}
1732+
1733+int LHAPDF::getOrderPDF(int nset) {
1734+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1735+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1736+ CURRENTSET = nset;
1737+ // return PDF order for the requested set
1738+ return ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("OrderQCD", -1);
1739+}
1740+
1741+
1742+double LHAPDF::getLam4(int nmem) {
1743+ return LHAPDF::getLam4(1, nmem) ;
1744+}
1745+
1746+double LHAPDF::getLam4(int nset, int nmem) {
1747+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1748+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1749+ // CURRENTSET = nset;
1750+ // ACTIVESETS[nset].loadMember(nmem);
1751+ // return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda4", -1.0);
1752+ double qcdl4;
1753+ getlam4m_(nset, nmem, qcdl4);
1754+ return qcdl4;
1755+}
1756+
1757+
1758+double LHAPDF::getLam5(int nmem) {
1759+ return LHAPDF::getLam5(1, nmem) ;
1760+}
1761+
1762+double LHAPDF::getLam5(int nset, int nmem) {
1763+ // if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1764+ // throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1765+ // CURRENTSET = nset;
1766+ // ACTIVESETS[nset].loadMember(nmem);
1767+ // return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("AlphaS_Lambda5", -1.0);
1768+ double qcdl5;
1769+ getlam5m_(nset, nmem, qcdl5);
1770+ return qcdl5;
1771+}
1772+
1773+
1774+int LHAPDF::getNf() {
1775+ return LHAPDF::getNf(1) ;
1776+}
1777+
1778+int LHAPDF::getNf(int nset) {
1779+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1780+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1781+ CURRENTSET = nset;
1782+ // return alphaS Order for the requested set
1783+ return ACTIVESETS[nset].activeMember()->info().get_entry_as<int>("NumFlavors");
1784+}
1785+
1786+
1787+double LHAPDF::getXmin(int nmem) {
1788+ return LHAPDF::getXmin(1, nmem) ;
1789+}
1790+
1791+double LHAPDF::getXmin(int nset, int nmem) {
1792+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1793+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1794+ CURRENTSET = nset;
1795+ // return alphaS Order for the requested set
1796+ ACTIVESETS[nset].loadMember(nmem);
1797+ return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMin");
1798+}
1799+
1800+double LHAPDF::getXmax(int nmem) {
1801+ return LHAPDF::getXmax(1, nmem) ;
1802+}
1803+
1804+double LHAPDF::getXmax(int nset, int nmem) {
1805+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1806+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1807+ CURRENTSET = nset;
1808+ // return alphaS Order for the requested set
1809+ ACTIVESETS[nset].loadMember(nmem);
1810+ return ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("XMax");
1811+}
1812+
1813+double LHAPDF::getQ2min(int nmem) {
1814+ return LHAPDF::getQ2min(1, nmem) ;
1815+}
1816+
1817+double LHAPDF::getQ2min(int nset, int nmem) {
1818+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1819+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1820+ CURRENTSET = nset;
1821+ // return alphaS Order for the requested set
1822+ ACTIVESETS[nset].loadMember(nmem);
1823+ return pow(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMin"),2);
1824+}
1825+
1826+double LHAPDF::getQ2max(int nmem) {
1827+ return LHAPDF::getQ2max(1,nmem) ;
1828+}
1829+
1830+double LHAPDF::getQ2max(int nset, int nmem) {
1831+ if (ACTIVESETS.find(nset) == ACTIVESETS.end())
1832+ throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised");
1833+ CURRENTSET = nset;
1834+ // return alphaS Order for the requested set
1835+ ACTIVESETS[nset].loadMember(nmem);
1836+ return pow(ACTIVESETS[nset].activeMember()->info().get_entry_as<double>("QMax"),2);
1837+}
1838+
1839+double LHAPDF::getQMass(int nf) {
1840+ return LHAPDF::getQMass(1, nf) ;
1841+}
1842+
1843+double LHAPDF::getQMass(int nset, int nf) {
1844+ double mass;
1845+ getqmassm_(nset, nf, mass);
1846+ return mass;
1847+}
1848+
1849+double LHAPDF::getThreshold(int nf) {
1850+ return LHAPDF::getThreshold(1, nf) ;
1851+}
1852+
1853+double LHAPDF::getThreshold(int nset, int nf) {
1854+ double thres;
1855+ getthresholdm_(nset, nf, thres);
1856+ return thres;
1857+}
1858+
1859+void LHAPDF::usePDFMember(int member) {
1860+ initpdf_(member);
1861+}
1862+
1863+void LHAPDF::usePDFMember(int nset, int member) {
1864+ initpdfm_(nset, member);
1865+}
1866+
1867+#endif // ENABLE_LHAGLUE_CXX
1868
1869=== modified file 'Template/LO/Source/dsample.f'
1870--- Template/LO/Source/dsample.f 2020-01-20 14:53:46 +0000
1871+++ Template/LO/Source/dsample.f 2020-06-21 12:17:46 +0000
1872@@ -141,7 +141,7 @@
1873 fx =0d0
1874 wgt=0d0
1875 endif
1876- call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
1877+ call sample_put_point(wgt,x(1),iter,ipole) !Store result
1878 endif
1879 if (wgt .ne. 0d0) kevent=kevent+1
1880 c
1881@@ -318,7 +318,7 @@
1882 endif
1883
1884 if (nzoom .le. 0) then
1885- call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
1886+ call sample_put_point(wgt,x(1),iter,ipole) !Store result
1887 else
1888 nzoom = nzoom -1
1889 ievent=ievent-1
1890
1891=== modified file 'Template/LO/SubProcesses/cuts.f'
1892--- Template/LO/SubProcesses/cuts.f 2019-07-30 13:51:02 +0000
1893+++ Template/LO/SubProcesses/cuts.f 2020-06-21 12:17:46 +0000
1894@@ -1394,10 +1394,10 @@
1895 C
1896 2 IF (N.EQ.1) RETURN
1897 IF (MODE) 10,20,30
1898- 10 CALL SORTTI (A,INDEX,N)
1899+ 10 STOP 5 ! CALL SORTTI (A,INDEX,N)
1900 GO TO 40
1901 C
1902- 20 CALL SORTTC(A,INDEX,N)
1903+ 20 STOP 5 ! CALL SSORTTC(A,INDEX,N)
1904 GO TO 40
1905 C
1906 30 CALL SORTTF (A,INDEX,N)
1907
1908=== modified file 'Template/LO/SubProcesses/genps.f'
1909--- Template/LO/SubProcesses/genps.f 2019-09-26 11:09:58 +0000
1910+++ Template/LO/SubProcesses/genps.f 2020-06-21 12:17:46 +0000
1911@@ -666,7 +666,8 @@
1912 c data nerr/0/
1913 double precision smin,smax,totmass,totmassin,xa2,xb2,wgt
1914 double precision costh,phi,tmin,tmax,t
1915- double precision ma2,mb2,m12,mn2,s1
1916+ double precision ma2,mb2,m12,mn2,s1, mi2
1917+ double precision tmass(-max_branch:-1)
1918 c
1919 c External
1920 c
1921@@ -864,7 +865,7 @@
1922 c and not to be block by numerical inacuracy
1923 c tmax = max(tmax,0d0) !This line if want really t freedom
1924 call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig,
1925- $ 0, -tmin/stot)
1926+ $ 0d0, -tmin/stot)
1927 t = stot*(-x(-ibranch))
1928
1929 else
1930@@ -893,7 +894,14 @@
1931 c pa+pb -> p1+ p2; t=(pa-p1)**2; pr = pa-p1
1932 c gentcms(pa,pb,t,phi,m1,m2,p1,pr)
1933 c
1934- call gentcms(p(0,itree(1,ibranch)),p(0,2),t,phi,
1935+
1936+ if (itree(1,ibranch).gt.-ns_channel-1)then
1937+ mi2 = m(itree(1,ibranch))**2
1938+ else
1939+ mi2 = tmass(itree(1,ibranch))
1940+ endif
1941+ tmass(ibranch) = t
1942+ call gentcms(p(0,itree(1,ibranch)),p(0,2),t,phi, mi2,
1943 & m(itree(2,ibranch)),m(ibranch-1),p(0,itree(2,ibranch)),
1944 & p(0,ibranch),jac)
1945
1946@@ -1002,7 +1010,7 @@
1947 endif
1948 end
1949
1950- subroutine gentcms(pa,pb,t,phi,m1,m2,p1,pr,jac)
1951+ subroutine gentcms(pa,pb,t,phi,ma2,m1,m2,p1,pr,jac)
1952 c*************************************************************************
1953 c Generates 4 momentum for particle 1, and remainder pr
1954 c given the values t, and phi
1955@@ -1038,7 +1046,7 @@
1956 ptotm(i) = ptot(i)
1957 endif
1958 enddo
1959- ma2 = dot(pa,pa)
1960+c ma2 = dot(pa,pa)
1961 c
1962 c determine magnitude of p1 in cms frame (from dhelas routine mom2cx)
1963 c
1964
1965=== modified file 'Template/LO/SubProcesses/reweight.f'
1966--- Template/LO/SubProcesses/reweight.f 2020-03-08 20:49:57 +0000
1967+++ Template/LO/SubProcesses/reweight.f 2020-06-21 12:17:46 +0000
1968@@ -417,6 +417,12 @@
1969 ipart(1,imo)=ipart(1,ida2)
1970 ipart(2,imo)=ipart(1,ida1)
1971 endif
1972+ else if (abs(get_color(idmo)).eq.8.and.abs(get_color(idda1)).eq.1.and.abs(get_color(idda2)).eq.8)then
1973+ ipart(1,imo)=ipart(1,ida2)
1974+ ipart(2,imo)=ipart(2,ida2)
1975+ else if (abs(get_color(idmo)).eq.8.and.abs(get_color(idda1)).eq.8.and.abs(get_color(idda2)).eq.1)then
1976+ ipart(1,imo)=ipart(1,ida1)
1977+ ipart(2,imo)=ipart(2,ida1)
1978 else
1979 write(*,*) idmo,'>', idda1, idda2, 'color', get_color(idmo),'>', get_color(idda1), get_color(idda2)
1980 write(*,*) "failed for ipartupdate. Please retry without MLM/default dynamical scale"
1981
1982=== modified file 'Template/LO/SubProcesses/unwgt.f'
1983--- Template/LO/SubProcesses/unwgt.f 2018-06-20 11:54:42 +0000
1984+++ Template/LO/SubProcesses/unwgt.f 2020-06-21 12:17:46 +0000
1985@@ -478,7 +478,8 @@
1986 double precision beta, get_betaz
1987 double precision ebi(0:3), ebo(0:3)
1988 double precision ptcltmp(nexternal), pdum(0:3)
1989-
1990+ integer beam_number
1991+
1992 integer idup(nexternal,maxproc,maxsproc)
1993 integer mothup(2,nexternal)
1994 integer icolup(2,nexternal,maxflow,maxsproc)
1995@@ -705,31 +706,42 @@
1996 else
1997 write(s_buff(3), '(a)') '<asrwt>0</asrwt>'
1998 endif
1999- if(n_pdfrw(1).gt.0)then
2000+ beam_number = 1
2001+ if (flip) then
2002+ beam_number =2
2003+ endif
2004+
2005+ if(n_pdfrw(1).gt.0.and.abs(lpp(1)).eq.1)then
2006 if(2*n_pdfrw(1).lt.10) then
2007- write(cfmt,'(a,I1,a,I1,a)') '(a,I3,',
2008+ write(cfmt,'(a,I1,a,I1,a)') '(a,I1,a,I3,',
2009 $ n_pdfrw(1),'I9,',2*n_pdfrw(1),'E15.8,a)'
2010 else
2011- write(cfmt,'(a,I1,a,I2,a)') '(a,I3,',
2012+ write(cfmt,'(a,I1,a,I2,a)') '(a,I1,a,I3,',
2013 $ n_pdfrw(1),'I9,',2*n_pdfrw(1),'E15.8,a)'
2014 endif
2015- write(s_buff(4), cfmt) '<pdfrwt beam="1">',
2016+
2017+ write(s_buff(4), cfmt) '<pdfrwt beam="', beam_number, '">',
2018 $ n_pdfrw(1),(i_pdgpdf(i,1),i=1,n_pdfrw(1)),
2019 $ (s_xpdf(i,1),i=1,n_pdfrw(1)),
2020 $ (s_qpdf(i,1),i=1,n_pdfrw(1)),
2021 $ '</pdfrwt>'
2022 else
2023- write(s_buff(4), '(a)') '<pdfrwt beam="1">0</pdfrwt>'
2024- endif
2025- if(n_pdfrw(2).gt.0)then
2026+ write(s_buff(4), '(a,I1,a)') '<pdfrwt beam="',
2027+ $ beam_number,'">0</pdfrwt>'
2028+ endif
2029+ beam_number = 2
2030+ if (flip) then
2031+ beam_number = 1
2032+ endif
2033+ if(n_pdfrw(2).gt.0.and.abs(lpp(2)).eq.1)then
2034 if(2*n_pdfrw(2).lt.10) then
2035- write(cfmt,'(a,I1,a,I1,a)') '(a,I3,',
2036+ write(cfmt,'(a,I1,a,I1,a)') '(a,I1,a,I3,',
2037 $ n_pdfrw(2),'I9,',2*n_pdfrw(2),'E15.8,a)'
2038 else
2039- write(cfmt,'(a,I1,a,I2,a)') '(a,I3,',
2040+ write(cfmt,'(a,I1,a,I2,a)') '(a,I1,a,I3,',
2041 $ n_pdfrw(2),'I9,',2*n_pdfrw(2),'E15.8,a)'
2042 endif
2043- write(s_buff(5), cfmt) '<pdfrwt beam="2">',
2044+ write(s_buff(5), cfmt) '<pdfrwt beam="',beam_number,'">',
2045 $ n_pdfrw(2),(i_pdgpdf(i,2),i=1,n_pdfrw(2)),
2046 $ (s_xpdf(i,2),i=1,n_pdfrw(2)),
2047 $ (s_qpdf(i,2),i=1,n_pdfrw(2)),
2048
2049=== modified file 'Template/LO/bin/internal/merge.pl'
2050--- Template/LO/bin/internal/merge.pl 2014-08-07 12:08:24 +0000
2051+++ Template/LO/bin/internal/merge.pl 2020-06-21 12:17:46 +0000
2052@@ -52,8 +52,8 @@
2053 # Keep track if we are in the init block or not
2054 $initblock = 0;
2055
2056- # LHE version extracted from current file ; 1 by default
2057- $lhe_version = 1.0;
2058+ # LHE version extracted from current file ; 3 by default
2059+ $lhe_version = 3.0;
2060
2061 while (1) {
2062 $gzbytes = $gzin->gzreadline($gzline);
2063
2064=== modified file 'Template/LO/bin/internal/restore_data'
2065--- Template/LO/bin/internal/restore_data 2011-06-29 14:15:21 +0000
2066+++ Template/LO/bin/internal/restore_data 2020-06-21 12:17:46 +0000
2067@@ -30,13 +30,21 @@
2068 exit
2069 fi
2070
2071-
2072-cp $1_results.dat results.dat >& /dev/null
2073+if [[ -e $1_results.dat ]]; then
2074+ cp $1_results.dat results.dat >& /dev/null
2075+else
2076+ cp results.dat $1_results.dat >& /dev/null
2077+fi
2078+
2079 for i in `cat subproc.mg` ; do
2080 cd $i
2081 echo $i
2082 rm -f ftn25 ftn26 >& /dev/null
2083- cp $1_results.dat results.dat >& /dev/null
2084+ if [[ -e $1_results.dat ]]; then
2085+ cp $1_results.dat results.dat >& /dev/null
2086+ else
2087+ cp results.dat $1_results.dat >& /dev/null
2088+ fi
2089 for k in G* ; do
2090 if [[ ! -d $k ]]; then
2091 continue
2092@@ -45,6 +53,8 @@
2093 for j in $1_results.dat ; do
2094 if [[ -e $j ]] ; then
2095 cp $j results.dat
2096+ else
2097+ cp results.dat $j
2098 fi
2099 done
2100 for j in $1_ftn26.gz ; do
2101
2102=== modified file 'Template/NLO/MCatNLO/include/LHEF.h'
2103--- Template/NLO/MCatNLO/include/LHEF.h 2014-10-31 07:52:06 +0000
2104+++ Template/NLO/MCatNLO/include/LHEF.h 2020-06-21 12:17:46 +0000
2105@@ -1971,7 +1971,7 @@
2106 * Used internally to read a single line from the stream.
2107 */
2108 bool getline() {
2109- return ( std::getline(file, currentLine) );
2110+ return ( (bool) std::getline(file, currentLine) );
2111 }
2112
2113 protected:
2114
2115=== modified file 'Template/NLO/SubProcesses/cuts.f'
2116--- Template/NLO/SubProcesses/cuts.f 2017-11-17 16:07:39 +0000
2117+++ Template/NLO/SubProcesses/cuts.f 2020-06-21 12:17:46 +0000
2118@@ -553,10 +553,10 @@
2119 C
2120 2 IF (N.EQ.1) RETURN
2121 IF (MODE) 10,20,30
2122- 10 CALL SORTTI (A,INDEX,N)
2123+ 10 STOP 5 ! CALL SORTTI (A,INDEX,N)
2124 GO TO 40
2125 C
2126- 20 CALL SORTTC(A,INDEX,N)
2127+ 20 STOP 5 ! CALL SORTTC(A,INDEX,N)
2128 GO TO 40
2129 C
2130 30 CALL SORTTF (A,INDEX,N)
2131
2132=== removed directory 'Template/RWGTNLO'
2133=== removed file 'Template/RWGTNLO/__init__.py'
2134=== removed file 'Template/RWGTNLO/alfas.inc'
2135=== removed file 'Template/RWGTNLO/alfas_functions_lhapdf.f'
2136=== removed file 'Template/RWGTNLO/makefile'
2137=== removed file 'Template/RWGTNLO/rwgt.f'
2138=== removed file 'Template/RWGTNLO/setrun.f'
2139=== removed file 'Template/RWGTNLO/timing_variables.inc'
2140=== modified file 'Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc'
2141--- Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2016-11-21 21:05:57 +0000
2142+++ Template/loop_material/StandAlone/SubProcesses/MadLoopCommons.inc 2020-06-21 12:17:46 +0000
2143@@ -141,7 +141,8 @@
2144
2145 character(512) path
2146 character(512) dummy
2147-
2148+ character(512) epath ! path of the executable
2149+ integer pos
2150 character(512) prefix,fpath
2151 character(17) nameToCheck
2152 parameter (nameToCheck='MadLoopParams.dat')
2153@@ -185,11 +186,42 @@
2154 close(1)
2155 prefix='../MadLoop5_resources/'
2156 call joinPath(prefix,nameToCheck,fpath)
2157- OPEN(1, FILE=fpath, ERR=66, STATUS='OLD',ACTION='READ')
2158- MLPath=prefix
2159- goto 10
2160-66 continue
2161- close(1)
2162+ OPEN(1, FILE=fpath, ERR=3, STATUS='OLD',ACTION='READ')
2163+ MLPath=prefix
2164+ goto 10
2165+ 3 continue
2166+ close(1)
2167+c
2168+c Try to automatically find the path from the executable location
2169+c particularly usefull in gridpack readonly mode
2170+c
2171+ call getarg(0,path) !path is the PATH to the madevent executable (either global or from launching directory)
2172+ pos = index(path,'/',.true.)
2173+ prefix = path(:pos)
2174+ call joinPath(prefix,nameToCheck,fpath)
2175+ write(*,*) 'test', fpath
2176+ OPEN(1, FILE=fpath, ERR=4, STATUS='OLD',ACTION='READ')
2177+ MLPath=prefix
2178+ goto 10
2179+4 continue
2180+ close(1)
2181+ prefix= prefix // '/MadLoop5_resources/'
2182+ call joinPath(prefix,nameToCheck,fpath)
2183+ write(*,*) 'test', fpath
2184+ OPEN(1, FILE=fpath, ERR=5, STATUS='OLD',ACTION='READ')
2185+ MLPath=prefix
2186+ goto 10
2187+5 continue
2188+ close(1)
2189+ prefix= path(:pos) // '/../MadLoop5_resources/'
2190+ call joinPath(prefix,nameToCheck,fpath)
2191+ write(*,*) 'test', fpath
2192+ OPEN(1, FILE=fpath, ERR=6, STATUS='OLD',ACTION='READ')
2193+ MLPath=prefix
2194+ goto 10
2195+ 6 continue
2196+ close(1)
2197+
2198 c We could not automatically find the auxiliary files
2199 write(*,*) '==='
2200 write(*,*) 'ERROR: MadLoop5 could not automatically find the file MadLoopParams.dat.'
2201@@ -215,9 +247,9 @@
2202
2203 C Check that the FilePath set is correct
2204 call joinPath(MLPath,nameToCheck,fpath)
2205- OPEN(1, FILE=fpath, ERR=3, STATUS='OLD',ACTION='READ')
2206+ OPEN(1, FILE=fpath, ERR=33, STATUS='OLD',ACTION='READ')
2207 goto 11
2208-3 continue
2209+33 continue
2210 close(1)
2211 write(*,*) '==='
2212 write(*,*) 'ERROR: The MadLoop5 auxiliary files could not be found in ',MLPath
2213@@ -606,7 +638,7 @@
2214 IMPLICIT NONE
2215 INTEGER MAXNREF_EVALS
2216 PARAMETER (MAXNREF_EVALS=100)
2217- INTEGER, DIMENSION(MAXNREF_EVALS), INTENT(IN) :: x
2218+ Double Precision, DIMENSION(MAXNREF_EVALS), INTENT(IN) :: x
2219 INTEGER, INTENT(IN) :: mStart, mEnd
2220 INTEGER :: Minimum
2221 INTEGER :: Location
2222
2223=== modified file 'UpdateNotes.txt'
2224--- UpdateNotes.txt 2020-03-17 07:12:13 +0000
2225+++ UpdateNotes.txt 2020-06-21 12:17:46 +0000
2226@@ -1,5 +1,24 @@
2227 Update notes for MadGraph5_aMC@NLO (in reverse time order)
2228
2229+2.7.3(21/06/20)
2230+ OM: Fixing some bug for read-only LO gridpacks (wrong cross-section and shape when generating events).
2231+ Thanks to Congqiao Li for this
2232+ OM: Allowing loop-induced process to run on LO gridpack with read-only mode.
2233+ Thanks to Congqiao Li for this
2234+ OM: Fix a bug in the longitudinal polarization for off-shell effect, leading to deviation at large invariant mass.
2235+ OM: Adding more option to the run_card for fine tuning phase-space integration steps
2236+ All are hidden by default:
2237+ - hard_survey [default=1]: request for more points in survey (and subsequent refine)
2238+ - second_refine_treshold [default=1.5]: forbid second refine if cross section after first refine is
2239+ is smaller than cross-section of the survey times such treshold
2240+ OM: new command for the editions of the cards:
2241+ - set nodecay: remove all decay line from the madspin_card
2242+ - set BLOCKNAME all VALUE: set all entry of the param_card "BLOCKNAME" to VALUE
2243+ - edit CARDNAME --comment_line='<regular_expression>' : new syntax to comment all lines of a card
2244+ that are matching a given regular expression
2245+ OM: For Mac only, when running in script mode, MG5aMC will now prevent the computer to go to idle sleep.
2246+ You can prevent this by running with the '-s' option. like ./bin/mg5_aMC -s PATH_TO_CMD
2247+
2248 2.7.2(17/03/20)
2249 OM: Fix a Bug in pythia8 running on Ubuntu 18.04.4 machine
2250 OM: Speed up standalone_cpp code by changing compilation flag
2251
2252=== modified file 'VERSION'
2253--- VERSION 2020-03-17 07:12:13 +0000
2254+++ VERSION 2020-06-21 12:17:46 +0000
2255@@ -1,5 +1,5 @@
2256-version = 2.7.2
2257-date = 2020-03-17
2258+version = 2.7.3
2259+date = 2020-06-21
2260
2261
2262
2263
2264=== modified file 'aloha/create_aloha.py'
2265--- aloha/create_aloha.py 2020-01-09 16:39:38 +0000
2266+++ aloha/create_aloha.py 2020-06-21 12:17:46 +0000
2267@@ -443,7 +443,7 @@
2268 denominator = propagator.denominator
2269 elif propa == "1L":
2270 numerator = "EPSL(1,id) * EPSL(2,id)"
2271- 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))"
2272+ 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))"
2273 elif propa == "1T":
2274 numerator = "-1*PVec(-2,id)*PVec(-2,id) * EPST2(1,id)*EPST2(2,id) + EPST1(1,id)*EPST1(2,id)"
2275 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))"
2276
2277=== modified file 'aloha/template_files/aloha_functions_loop.f'
2278--- aloha/template_files/aloha_functions_loop.f 2016-01-27 01:59:42 +0000
2279+++ aloha/template_files/aloha_functions_loop.f 2020-06-21 12:17:46 +0000
2280@@ -2298,7 +2298,7 @@
2281 COMPLEX*16 Q(0:3)
2282 INTEGER CFIG,J
2283 LOGICAL SCD
2284- COMPLEX*16 M
2285+ double precision M
2286 COMPLEX*16 W(20)
2287
2288 IF (CFIG.EQ.1) THEN
2289@@ -2558,7 +2558,7 @@
2290 COMPLEX*16 Q(0:3)
2291 INTEGER CFIG
2292 LOGICAL SCD
2293- COMPLEX*16 M
2294+ double precision M
2295 COMPLEX*16 W(20)
2296
2297 IF (CFIG.EQ.1) THEN
2298
2299=== modified file 'bin/mg5_aMC'
2300--- bin/mg5_aMC 2019-05-05 18:53:50 +0000
2301+++ bin/mg5_aMC 2020-06-21 12:17:46 +0000
2302@@ -49,7 +49,8 @@
2303 help='force to launch debug mode')
2304 parser.add_option("-m", "--mode", dest="plugin",
2305 help="Define some additional command provide by a PLUGIN")
2306-
2307+parser.add_option("-s", "--nocaffeinate", action="store_false", default=True, dest='nosleep',
2308+ help='For mac user, forbids to use caffeinate when running with a script')
2309 (options, args) = parser.parse_args()
2310 if len(args) == 0:
2311 args = ''
2312@@ -66,6 +67,9 @@
2313 import logging.config
2314 import madgraph.interface.coloring_logging
2315
2316+if ' ' in os.getcwd():
2317+ logging.warning("Path does contains spaces. We advise that you change your current path to avoid to have space in the path.")
2318+
2319 try:
2320 import readline
2321 except ImportError:
2322@@ -157,6 +161,10 @@
2323 # Call the cmd interface main loop
2324 try:
2325 if options.file or args:
2326+ if sys.platform == "darwin" and options.nosleep:
2327+ logging.getLogger('madgraph').warning("launching caffeinate to prevent idle sleep when MG5aMC is running. Run './bin/mg5_aMC -s' to prevent this.")
2328+ pid = os.getpid()
2329+ subprocess.Popen(['caffeinate', '-i', '-w', str(pid)])
2330 # They are an input file
2331 if args:
2332 input_file = os.path.realpath(args[0])
2333
2334=== modified file 'madgraph/core/base_objects.py'
2335--- madgraph/core/base_objects.py 2020-03-04 20:39:24 +0000
2336+++ madgraph/core/base_objects.py 2020-06-21 12:17:46 +0000
2337@@ -3484,18 +3484,31 @@
2338 final.sort()
2339 return (tuple(initial), tuple(final))
2340
2341- def get_final_ids_after_decay(self):
2342+ def get_initial_final_ids_after_decay(self, max_depth=-1):
2343+ """return a tuple of two tuple containing the id of the initial/final
2344+ state particles. Each list is ordered"""
2345+
2346+ initial = [l.get('id') for l in self.get('legs')\
2347+ if not l.get('state')]
2348+ final = self.get_final_ids_after_decay(max_depth=max_depth)
2349+ initial.sort()
2350+ final.sort()
2351+ return (tuple(initial), tuple(final))
2352+
2353+
2354+ def get_final_ids_after_decay(self, max_depth=-1):
2355 """Give the pdg code of the process including decay"""
2356
2357 finals = self.get_final_ids()
2358- for proc in self.get('decay_chains'):
2359- init = proc.get_initial_ids()[0]
2360- #while 1:
2361- try:
2362- pos = finals.index(init)
2363- except:
2364- break
2365- finals[pos] = proc.get_final_ids_after_decay()
2366+ if max_depth !=0 :
2367+ for proc in self.get('decay_chains'):
2368+ init = proc.get_initial_ids()[0]
2369+ #while 1:
2370+ try:
2371+ pos = finals.index(init)
2372+ except:
2373+ break
2374+ finals[pos] = proc.get_final_ids_after_decay(max_depth-1)
2375 output = []
2376 for d in finals:
2377 if isinstance(d, list):
2378
2379=== modified file 'madgraph/core/diagram_generation.py'
2380--- madgraph/core/diagram_generation.py 2019-05-13 20:41:22 +0000
2381+++ madgraph/core/diagram_generation.py 2020-06-21 12:17:46 +0000
2382@@ -896,7 +896,7 @@
2383 fcts=['remove_diag'])
2384 else:
2385 #example and simple tests
2386- def remove_diag(diag):
2387+ def remove_diag(diag, model=None):
2388 for vertex in diag['vertices']: #last
2389 if vertex['id'] == 0: #special final vertex
2390 continue
2391@@ -907,8 +907,9 @@
2392
2393 res = diag_list.__class__()
2394 nb_removed = 0
2395+ model = self['process']['model']
2396 for diag in diag_list:
2397- if remove_diag(diag):
2398+ if remove_diag(diag, model):
2399 nb_removed +=1
2400 else:
2401 res.append(diag)
2402
2403=== modified file 'madgraph/core/helas_objects.py'
2404--- madgraph/core/helas_objects.py 2020-03-09 09:27:32 +0000
2405+++ madgraph/core/helas_objects.py 2020-06-21 12:17:46 +0000
2406@@ -5871,6 +5871,7 @@
2407 # Identical matrix element found
2408 other_processes = identified_matrix_elements[me_index].\
2409 get('processes')
2410+
2411 other_processes.append(cls.reorder_process(\
2412 amplitude.get('process'),
2413 permutations[me_index],
2414@@ -5911,14 +5912,24 @@
2415 """Reorder the legs in the process according to the difference
2416 between org_perm and proc_perm"""
2417
2418+
2419+
2420 leglist = base_objects.LegList(\
2421 [copy.copy(process.get('legs_with_decays')[i]) for i in \
2422 diagram_generation.DiagramTag.reorder_permutation(\
2423 proc_perm, org_perm)])
2424 new_proc = copy.copy(process)
2425+ if org_perm == proc_perm:
2426+ return new_proc
2427+
2428+ if len(org_perm) != len(process.get('legs_with_decays')):
2429+ raise Exception, "issue on symmetry between process"
2430+
2431 new_proc.set('legs_with_decays', leglist)
2432-
2433+
2434 if not new_proc.get('decay_chains'):
2435 new_proc.set('legs', leglist)
2436+ assert len(process.get('legs')) == len(leglist)
2437
2438+
2439 return new_proc
2440
2441=== modified file 'madgraph/interface/amcatnlo_run_interface.py'
2442--- madgraph/interface/amcatnlo_run_interface.py 2020-03-07 20:56:41 +0000
2443+++ madgraph/interface/amcatnlo_run_interface.py 2020-06-21 12:17:46 +0000
2444@@ -174,7 +174,13 @@
2445 logger.warning(msg % compiler)
2446 else:
2447 curr_version = misc.get_gfortran_version(compiler)
2448- if not ''.join(curr_version.split('.')) >= '46':
2449+ curr_version = curr_version.split('.')
2450+ if len(curr_version) == 1:
2451+ curr_version.append(0)
2452+
2453+ if int(curr_version[0]) < 5:
2454+ if int(curr_version[0]) == 4 and int(curr_version[1]) > 5:
2455+ return
2456 if block:
2457 raise aMCatNLOError(msg % (compiler + ' ' + curr_version))
2458 else:
2459@@ -2785,7 +2791,7 @@
2460 """Sums all the plots in the HwU format."""
2461 logger.debug('Combining HwU plots.')
2462
2463- command = []
2464+ command = [sys.executable]
2465 command.append(pjoin(self.me_dir, 'bin', 'internal','histograms.py'))
2466 for job in jobs:
2467 if job['dirname'].endswith('.HwU'):
2468
2469=== modified file 'madgraph/interface/common_run_interface.py'
2470--- madgraph/interface/common_run_interface.py 2020-03-04 09:57:24 +0000
2471+++ madgraph/interface/common_run_interface.py 2020-06-21 12:17:46 +0000
2472@@ -1036,7 +1036,11 @@
2473 out = ask(question, '0', possible_answer, timeout=int(1.5*timeout),
2474 path_msg='enter path', ask_class = AskforEditCard,
2475 cards=cards, mode=mode, **opt)
2476-
2477+ if 'return_instance' in opt and opt['return_instance']:
2478+ out, cmd = out
2479+ if 'return_instance' in opt and opt['return_instance']:
2480+ return (out, cmd)
2481+ return out
2482
2483 @staticmethod
2484 def detect_card_type(path):
2485@@ -2836,8 +2840,8 @@
2486 reco_output = pjoin(self.me_dir,
2487 'MA5_%s_ANALYSIS%s_%d'%(mode.upper(),MA5_runtag,i+1))
2488 # Look for either a root or .lhe.gz output
2489- reco_event_file = misc.glob('*.lhe.gz',pjoin(reco_output,'Output','_reco_events','lheEvents0_%d'%MA5_run_number))+\
2490- misc.glob('*.root',pjoin(reco_output,'Output','_reco_events', 'RecoEvents0_%d'%MA5_run_number))
2491+ reco_event_file = misc.glob('*.lhe.gz',pjoin(reco_output,'Output','SAF','_reco_events','lheEvents0_%d'%MA5_run_number))+\
2492+ misc.glob('*.root',pjoin(reco_output,'Output','SAF','_reco_events', 'RecoEvents0_%d'%MA5_run_number))
2493 if len(reco_event_file)==0:
2494 raise MadGraph5Error, "MadAnalysis5 failed to produce the "+\
2495 "reconstructed event file for reconstruction '%s'."%MA5_runtag[6:]
2496@@ -2852,7 +2856,7 @@
2497 parent_dir_name = os.path.basename(os.path.dirname(reco_event_file))
2498 files.ln(pjoin(self.me_dir,'HTML',self.run_name,
2499 '%s_MA5_%s_ANALYSIS%s_%d'%(self.run_tag,mode.upper(),
2500- MA5_runtag,i+1),'Output','_reco_events',parent_dir_name,links_created[-1]),
2501+ MA5_runtag,i+1),'Output','SAF','_reco_events',parent_dir_name,links_created[-1]),
2502 pjoin(self.me_dir,'Events',self.run_name))
2503
2504 logger.info("MadAnalysis5 successfully completed the reconstruction "+
2505@@ -3328,7 +3332,7 @@
2506 if mass and abs(width/mass) < 1e-12:
2507 if hasattr(interface, 'run_card') and isinstance(interface.run_card, banner_mod.RunCardLO):
2508 if interface.run_card['small_width_treatment'] < 1e-12:
2509- 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)
2510+ 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)
2511 else:
2512 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)
2513 if CommonRunCmd.sleep_for_error:
2514@@ -4098,6 +4102,18 @@
2515 if not require_local and (os.path.exists(pjoin(pdfsets_dir, pdfset)) or \
2516 os.path.isdir(pjoin(pdfsets_dir, pdfset))):
2517 continue
2518+ if not require_local:
2519+ if 'LHAPDF_DATA_PATH' in os.environ:
2520+ found = False
2521+ for path in os.environ['LHAPDF_DATA_PATH'].split(":"):
2522+ if (os.path.exists(pjoin(path, pdfset)) or \
2523+ os.path.isdir(pjoin(path, pdfset))):
2524+ found =True
2525+ break
2526+ if found:
2527+ continue
2528+
2529+
2530 #check that the pdfset is not already there
2531 elif not os.path.exists(pjoin(self.me_dir, 'lib', 'PDFsets', pdfset)) and \
2532 not os.path.isdir(pjoin(self.me_dir, 'lib', 'PDFsets', pdfset)):
2533@@ -4309,7 +4325,7 @@
2534 stdout = subprocess.PIPE).stdout.read().strip()
2535 except OSError, error:
2536 if error.errno == 2:
2537- 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']
2538+ 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
2539 else:
2540 raise
2541
2542@@ -4495,7 +4511,12 @@
2543 self.modified_card = set() #set of cards not in sync with filesystem
2544 # need to sync them before editing/leaving
2545 self.init_from_banner(from_banner, banner)
2546-
2547+ self.writting_card = True
2548+ if 'write_file' in opt:
2549+ if not opt['write_file']:
2550+ self.writting_card = False
2551+ self.param_consistency = False
2552+
2553 #update default path by custom one if specify in cards
2554 for card in cards:
2555 if os.path.exists(card) and os.path.sep in cards:
2556@@ -4773,10 +4794,12 @@
2557 return []
2558
2559 self.special_shortcut.update({
2560- 'spinmode':([str], ['add madspin_card --before_line="launch" set spinmode %(0)s'])
2561+ 'spinmode':([str], ['add madspin_card --before_line="launch" set spinmode %(0)s']),
2562+ 'nodecay':([], ['edit madspin_card --comment_line="decay"'])
2563 })
2564 self.special_shortcut_help.update({
2565- '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.'
2566+ '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.',
2567+ 'nodecay': 'remove all decay previously defined in madspin',
2568 })
2569 return []
2570
2571@@ -5241,7 +5264,7 @@
2572 def do_set(self, line):
2573 """ edit the value of one parameter in the card"""
2574
2575-
2576+
2577 args = self.split_arg(line)
2578
2579
2580@@ -5504,7 +5527,7 @@
2581 try:
2582 key = tuple([int(i) for i in args[start+1:-1]])
2583 except ValueError:
2584- if args[start] == 'decay' and args[start+1:-1] == ['all']:
2585+ if args[start+1:-1] == ['all']:
2586 for key in self.param_card[args[start]].param_dict:
2587 if (args[start], key) in self.restricted_value:
2588 continue
2589@@ -5965,8 +5988,9 @@
2590 self.do_set('shower_card extrapaths None ')
2591
2592 # ensure that all cards are in sync
2593- for key in list(self.modified_card):
2594- self.write_card(key)
2595+ if self.writting_card:
2596+ for key in list(self.modified_card):
2597+ self.write_card(key)
2598
2599
2600 def reask(self, *args, **opt):
2601@@ -6092,7 +6116,8 @@
2602 self.run_card.write(self.paths['run'], self.paths['run_default'])
2603
2604 def write_card_param(self):
2605- """ write the param_card """
2606+ """ write the param_card """
2607+
2608 self.param_card.write(self.paths['param'])
2609
2610 @staticmethod
2611@@ -6477,6 +6502,7 @@
2612 logger.info( ' --before_line="<regular-expression>" write the line before the first line matching the regular expression')
2613 logger.info( ' --replace_line="<regular-expression>" replace the line matching the regular expression')
2614 logger.info( ' --clean remove all previously existing line in the file')
2615+ logger.info( ' --comment_line="<regular-expression>" comment all lines matching the regular expression')
2616 logger.info('')
2617 logger.info(' Note: all regular-expression will be prefixed by ^\s*')
2618 logger.info('')
2619@@ -6622,7 +6648,29 @@
2620 logger.info("Replacing the line \"%s\" [line %d of %s] by \"%s\"" %
2621 (old_line, posline, card, new_line ),'$MG:BOLD')
2622 self.last_editline_pos = posline
2623-
2624+
2625+ elif args[1].startswith('--comment_line='):
2626+ # catch the line/regular expression and replace the associate line
2627+ # if no line match go to check if args[2] has other instruction starting with --
2628+ text = open(path).read()
2629+ split = text.split('\n')
2630+ search_pattern=r'''comment_line=(?P<quote>["'])(?:(?=(\\?))\2.)*?\1'''
2631+ pattern = '^\s*' + re.search(search_pattern, line).group()[14:-1]
2632+ nb_mod = 0
2633+ for posline,l in enumerate(split):
2634+ if re.search(pattern, l):
2635+ split[posline] = '#%s' % l
2636+ nb_mod +=1
2637+ logger.info("Commenting line \"%s\" [line %d of %s]" %
2638+ (l, posline, card ),'$MG:BOLD')
2639+ # overwrite the previous line
2640+ if not nb_mod:
2641+ logger.warning('no line commented (no line matching)')
2642+ ff = open(path,'w')
2643+ ff.write('\n'.join(split))
2644+
2645+ self.last_editline_pos = posline
2646+
2647
2648 elif args[1].startswith('--before_line='):
2649 # catch the line/regular expression and write before that line
2650
2651=== modified file 'madgraph/interface/extended_cmd.py'
2652--- madgraph/interface/extended_cmd.py 2020-02-25 14:05:36 +0000
2653+++ madgraph/interface/extended_cmd.py 2020-06-21 12:17:46 +0000
2654@@ -2586,6 +2586,8 @@
2655 elif line in 'auto':
2656 self.switch['dynamical'] = True
2657 return super(ControlSwitch, self).default(line)
2658+ elif line.startswith('set ') and not hasattr(self.__class__, 'do_set'):
2659+ raise NotValidInput('unknow command: %s. Did you mean \"%s\"' % (line, line[4:]))
2660 elif raise_error:
2661 raise NotValidInput('unknow command: %s' % line)
2662 else:
2663@@ -2601,6 +2603,8 @@
2664 getattr(self, 'ans_%s' % base)(value)
2665 elif base in self.switch:
2666 self.set_switch(base, value)
2667+ elif line.startswith('set ') and not hasattr(self.__class__, 'do_set'):
2668+ raise NotValidInput('Not valid command: %s. Did you mean \"%s\"' % (line, line[4:]))
2669 elif raise_error:
2670 raise NotValidInput('Not valid command: %s' % line)
2671 else:
2672
2673=== modified file 'madgraph/interface/madevent_interface.py'
2674--- madgraph/interface/madevent_interface.py 2020-03-16 08:37:10 +0000
2675+++ madgraph/interface/madevent_interface.py 2020-06-21 12:17:46 +0000
2676@@ -797,7 +797,7 @@
2677
2678 self.allowed_madspin = []
2679 if 'MadSpin' in self.available_module:
2680- self.allowed_madspin = ['OFF',"ON",'onshell']
2681+ self.allowed_madspin = ['OFF',"ON",'onshell',"full"]
2682 return self.allowed_madspin
2683
2684 def check_value_madspin(self, value):
2685@@ -834,7 +834,7 @@
2686 if value == 'onshell':
2687 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode onshell"]
2688 elif value in ['full', 'madspin']:
2689- return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode madspin"]
2690+ return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode full"]
2691 elif value == 'none':
2692 return ["edit madspin_card --replace_line='set spinmode' --before_line='decay' set spinmode none"]
2693 else:
2694@@ -1291,7 +1291,6 @@
2695 raise self.InvalidCmd('No run_name currently define. Unable to run refine')
2696
2697 if len(args) > 2:
2698- self.help_refine()
2699 raise self.InvalidCmd('Too many argument for refine command')
2700 else:
2701 try:
2702@@ -2497,7 +2496,8 @@
2703 postcmd=False)
2704 self.exec_cmd('combine_events', postcmd=False)
2705 self.exec_cmd('store_events', postcmd=False)
2706- self.exec_cmd('decay_events -from_cards', postcmd=False)
2707+ with misc.TMP_variable(self, 'run_name', self.run_name):
2708+ self.exec_cmd('decay_events -from_cards', postcmd=False)
2709 self.exec_cmd('create_gridpack', postcmd=False)
2710 else:
2711 # Regular run mode
2712@@ -2526,7 +2526,8 @@
2713
2714 #we can bypass the following if scan and first result is zero
2715 if not bypass_run:
2716- self.exec_cmd('refine %s' % nb_event, postcmd=False)
2717+ self.exec_cmd('refine %s --treshold=%s' % (nb_event,self.run_card['second_refine_treshold'])
2718+ , postcmd=False)
2719
2720 self.exec_cmd('combine_events', postcmd=False,printcmd=False)
2721 self.print_results_in_shell(self.results.current)
2722@@ -2882,7 +2883,7 @@
2723 particle = 0
2724 # Read BRs for this decay
2725 line = param_card[line_number]
2726- while line.startswith('#') or line.startswith(' '):
2727+ while re.search('^(#|\s|\d)', line):
2728 line = param_card.pop(line_number)
2729 if not particle or line.startswith('#'):
2730 line=param_card[line_number]
2731@@ -3354,7 +3355,7 @@
2732 if float(self.run_card['mmjj']) > 0.01 * (float(self.run_card['ebeam1'])+float(self.run_card['ebeam2'])):
2733 self.pass_in_difficult_integration_mode()
2734 elif self.run_card['hard_survey']:
2735- self.pass_in_difficult_integration_mode()
2736+ self.pass_in_difficult_integration_mode(self.run_card['hard_survey'])
2737
2738 jobs, P_zero_result = ajobcreator.launch()
2739 # Check if all or only some fails
2740@@ -3382,24 +3383,26 @@
2741 self.update_status('End survey', 'parton', makehtml=False)
2742
2743 ############################################################################
2744- def pass_in_difficult_integration_mode(self):
2745+ def pass_in_difficult_integration_mode(self, rate=1):
2746 """be more secure for the integration to not miss it due to strong cut"""
2747
2748 # improve survey options if default
2749 if self.opts['points'] == self._survey_options['points'][1]:
2750- self.opts['points'] = 3 * self._survey_options['points'][1]
2751+ self.opts['points'] = (rate+2) * self._survey_options['points'][1]
2752 if self.opts['iterations'] == self._survey_options['iterations'][1]:
2753- self.opts['iterations'] = 2 + self._survey_options['iterations'][1]
2754+ self.opts['iterations'] = 1 + rate + self._survey_options['iterations'][1]
2755 if self.opts['accuracy'] == self._survey_options['accuracy'][1]:
2756- self.opts['accuracy'] = self._survey_options['accuracy'][1]/3
2757+ self.opts['accuracy'] = self._survey_options['accuracy'][1]/(rate+2)
2758
2759 # Modify run_config.inc in order to improve the refine
2760 conf_path = pjoin(self.me_dir, 'Source','run_config.inc')
2761 files.cp(conf_path, conf_path + '.bk')
2762 #
2763 text = open(conf_path).read()
2764- text = re.sub('''\(min_events = \d+\)''', '''(min_events = 7500 )''', text)
2765- text = re.sub('''\(max_events = \d+\)''', '''(max_events = 40000 )''', text)
2766+ min_evt, max_evt = 2500 *(2+rate), 10000*(rate+1)
2767+
2768+ text = re.sub('''\(min_events = \d+\)''', '(min_events = %i )' % min_evt, text)
2769+ text = re.sub('''\(max_events = \d+\)''', '(max_events = %i )' % max_evt, text)
2770 fsock = open(conf_path, 'w')
2771 fsock.write(text)
2772 fsock.close()
2773@@ -3415,6 +3418,18 @@
2774 devnull = open(os.devnull, 'w')
2775 self.nb_refine += 1
2776 args = self.split_arg(line)
2777+ treshold=None
2778+ for a in args:
2779+ if a.startswith('--treshold='):
2780+ treshold = float(a.split('=',1)[1])
2781+ old_xsec = self.results.current['prev_cross']
2782+ new_xsec = self.results.current['cross']
2783+ if old_xsec > new_xsec * treshold:
2784+ logger.info('No need for second refine due to stability of cross-section')
2785+ return
2786+ else:
2787+ args.remove(a)
2788+ break
2789 # Check argument's validity
2790 self.check_refine(args)
2791
2792@@ -3471,8 +3486,7 @@
2793 cross, error = x_improve.update_html() #update html results for survey
2794 if cross == 0:
2795 return
2796- logger.info("Current estimate of cross-section: %s +- %s" % (cross, error))
2797-
2798+ logger.info("- Current estimate of cross-section: %s +- %s" % (cross, error))
2799 if isinstance(x_improve, gen_ximprove.gen_ximprove_v4):
2800 # Non splitted mode is based on writting ajob so need to track them
2801 # Splitted mode handle the cluster submition internally.
2802@@ -3811,6 +3825,17 @@
2803 self.update_status('Creating gridpack', level='parton')
2804 # compile gen_ximprove
2805 misc.compile(['../bin/internal/gen_ximprove'], cwd=pjoin(self.me_dir, "Source"))
2806+
2807+ Gdir = self.get_Gdir()
2808+ Pdir = set([os.path.dirname(G) for G in Gdir])
2809+ for P in Pdir:
2810+ allG = misc.glob('G*', path=P)
2811+ for G in allG:
2812+ if pjoin(P, G) not in Gdir:
2813+ logger.debug('removing %s', pjoin(P,G))
2814+ shutil.rmtree(pjoin(P,G))
2815+
2816+
2817 args = self.split_arg(line)
2818 self.check_combine_events(args)
2819 if not self.run_tag: self.run_tag = 'tag_1'
2820@@ -4668,7 +4693,7 @@
2821 devnull.close()
2822 if pid == 0:
2823 misc.call('head -n -1 %s | tail -n +%d > %s/tmpfile' %
2824- (hepmc_file, n_head, os.path.dirname(hepmc_file)), shell=True)
2825+ (hepmc_file, n_head+1, os.path.dirname(hepmc_file)), shell=True)
2826 misc.call(['mv', 'tmpfile', os.path.basename(hepmc_file)], cwd=os.path.dirname(hepmc_file))
2827 elif sys.platform == 'darwin':
2828 # sed on MAC has slightly different synthax than on
2829@@ -5967,10 +5992,16 @@
2830
2831 eradir = self.options['exrootanalysis_path']
2832 totar = False
2833+ torm = False
2834 if input.endswith('.gz'):
2835- misc.gunzip(input, keep=True)
2836- totar = True
2837- input = input[:-3]
2838+ if not os.path.exists(input) and os.path.exists(input[:-3]):
2839+ totar = True
2840+ input = input[:-3]
2841+ else:
2842+ misc.gunzip(input, keep=True)
2843+ totar = False
2844+ torm = True
2845+ input = input[:-3]
2846
2847 try:
2848 misc.call(['%s/ExRootLHEFConverter' % eradir,
2849@@ -5982,12 +6013,13 @@
2850 if totar:
2851 if os.path.exists('%s.gz' % input):
2852 try:
2853- os.remove(input)
2854+ os.remove('%s.gz' % input)
2855 except:
2856 pass
2857 else:
2858 misc.gzip(input)
2859-
2860+ if torm:
2861+ os.remove(input)
2862
2863 def run_syscalc(self, mode='parton', event_path=None, output=None):
2864 """create the syscalc output"""
2865@@ -6458,7 +6490,10 @@
2866 os.chdir(self.me_dir)
2867 else:
2868 for line in open(pjoin(self.me_dir,'SubProcesses','subproc.mg')):
2869- os.mkdir(line.strip())
2870+ p = line.strip()
2871+ os.mkdir(p)
2872+ files.cp(pjoin(self.me_dir,'SubProcesses',p,'symfact.dat'),
2873+ pjoin(p, 'symfact.dat'))
2874
2875
2876 def launch(self, nb_event, seed):
2877@@ -6472,6 +6507,12 @@
2878 misc.call([pjoin(self.me_dir,'bin','internal','restore_data'),
2879 'default'], cwd=self.me_dir)
2880
2881+ if self.run_card['python_seed'] == -2:
2882+ import random
2883+ random.seed(seed)
2884+ elif self.run_card['python_seed'] > 0:
2885+ import random
2886+ random.seed(self.run_card['python_seed'])
2887 # 2) Run the refine for the grid
2888 self.update_status('Generating Events', level=None)
2889 #misc.call([pjoin(self.me_dir,'bin','refine4grid'),
2890@@ -6649,11 +6690,11 @@
2891 sum_axsec += result.get('axsec')*gscalefact[Gdir]
2892
2893 if len(AllEvent) >= 80: #perform a partial unweighting
2894- AllEvent.unweight(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % partials),
2895+ AllEvent.unweight(pjoin(outdir, self.run_name, "partials%s.lhe.gz" % partials),
2896 get_wgt, log_level=5, trunc_error=1e-2, event_target=self.nb_event)
2897 AllEvent = lhe_parser.MultiEventFile()
2898 AllEvent.banner = self.banner
2899- AllEvent.add(pjoin(self.me_dir, "Events", self.run_name, "partials%s.lhe.gz" % partials),
2900+ AllEvent.add(pjoin(outdir, self.run_name, "partials%s.lhe.gz" % partials),
2901 sum_xsec,
2902 math.sqrt(sum(x**2 for x in sum_xerru)),
2903 sum_axsec)
2904
2905=== modified file 'madgraph/interface/madgraph_interface.py'
2906--- madgraph/interface/madgraph_interface.py 2020-03-06 20:47:59 +0000
2907+++ madgraph/interface/madgraph_interface.py 2020-06-21 12:17:46 +0000
2908@@ -459,7 +459,7 @@
2909 logger.info(" -d: specify other MG/ME directory")
2910 logger.info(" -noclean: no cleaning performed in \"path\".")
2911 logger.info(" -nojpeg: no jpeg diagrams will be generated.")
2912- logger.info(" -noeps: no jpeg and eps diagrams will be generated.")
2913+ logger.info(" --noeps=True: no jpeg and eps diagrams will be generated.")
2914 logger.info(" -name: the postfix of the main file in pythia8 mode.")
2915 logger.info(" Examples:",'$MG:color:GREEN')
2916 logger.info(" output",'$MG:color:GREEN')
2917@@ -530,6 +530,11 @@
2918 logger.info(" > Except for the 'gauge' test, all checks above are also")
2919 logger.info(" available for loop processes with ML5 ('virt=' mode)")
2920 logger.info("Example: check full p p > j j",'$MG:color:GREEN')
2921+ logger.info("Using leshouches file as input",'$MG:color:GREEN')
2922+ logger.info(" use the option --events=PATH")
2923+ logger.info(" zipped file are not supported")
2924+ logger.info(" to loop over the file use the option --skip_evt=X")
2925+ logger.info("")
2926 logger.info("Options for loop processes only:",'$MG:BOLD')
2927 logger.info("o timing:",'$MG:color:GREEN')
2928 logger.info(" Generate and output a process and returns detailed")
2929@@ -926,7 +931,9 @@
2930 '--helicity':'-1','--seed':'-1','--collier_cache':'-1',
2931 '--collier_req_acc':'auto',
2932 '--collier_internal_stability_test':'False',
2933- '--collier_mode':'1'}
2934+ '--collier_mode':'1',
2935+ '--events': None,
2936+ '--skip_evt':0}
2937
2938 if args[0] in ['cms'] or args[0].lower()=='cmsoptions':
2939 # increase the default energy to 5000
2940@@ -1075,7 +1082,7 @@
2941
2942 if '[' in process and '{' in process:
2943 valid = False
2944- if 'noborn' in process:
2945+ if 'noborn' in process or 'sqrvirt' in process:
2946 valid = True
2947 else:
2948 raise self.InvalidCmd('Polarization restriction can not be used for NLO processes')
2949@@ -1670,7 +1677,7 @@
2950 continue
2951 elif not '=' in arg:
2952 raise self.InvalidCmd('Options required an equal (and then the value)')
2953- arg, value = arg.split('=')
2954+ arg, value = arg.split('=',1)
2955 if arg[2:] not in options:
2956 raise self.InvalidCmd('%s not valid options' % arg)
2957 options[arg[2:]] = value
2958@@ -2832,7 +2839,7 @@
2959 _import_formats = ['model_v4', 'model', 'proc_v4', 'command', 'banner']
2960 _install_opts = ['Delphes', 'MadAnalysis4', 'ExRootAnalysis',
2961 'update', 'Golem95', 'QCDLoop', 'maddm', 'maddump',
2962- 'looptools']
2963+ 'looptools', 'MadSTR']
2964
2965 # The targets below are installed using the HEPToolsInstaller.py script
2966 _advanced_install_opts = ['pythia8','zlib','boost','lhapdf6','lhapdf5','collier',
2967@@ -3869,6 +3876,15 @@
2968 option = args[i].split('=')
2969 if option[0] =='--energy':
2970 options['energy']=float(option[1])
2971+ elif option[0] == '--events' and option[1]:
2972+ if option[1] == 'None':
2973+ options['events'] = None
2974+ elif not os.path.exists(option[1]):
2975+ raise Exception, 'path %s does not exists' % option[1]
2976+ else:
2977+ options['events'] = option[1]
2978+ elif option[0] == '--skip_evt':
2979+ options['skip_evt']=int(option[1])
2980 elif option[0]=='--split_orders':
2981 options['split_orders']=int(option[1])
2982 elif option[0]=='--helicity':
2983@@ -5615,7 +5631,7 @@
2984 #self.do_define(line)
2985 self.exec_cmd('define %s' % line, printcmd=False, precmd=True)
2986 except self.InvalidCmd, why:
2987- logger_stderr.warning('impossible to set default multiparticles %s because %s' %
2988+ logger.warning('impossible to set default multiparticles %s because %s' %
2989 (line.split()[0],why))
2990 if self.history[-1] == 'define %s' % line.strip():
2991 self.history.pop(-1)
2992@@ -5985,7 +6001,7 @@
2993 # Return true for successful installation
2994 return True
2995
2996- install_plugin = ['maddm', 'maddump']
2997+ install_plugin = ['maddm', 'maddump', 'MadSTR']
2998 install_ad = {'pythia-pgs':['arXiv:0603175'],
2999 'Delphes':['arXiv:1307.6346'],
3000 'Delphes2':['arXiv:0903.2225'],
3001@@ -6003,7 +6019,8 @@
3002 'collier':['arXiv:1604.06792'],
3003 'oneloop':['arXiv:1007.4716'],
3004 'maddm':['arXiv:1804.00444'],
3005- 'maddump':['arXiv:1812.06771']}
3006+ 'maddump':['arXiv:1812.06771'],
3007+ 'MadSTR':['arXiv:1612.00440']}
3008
3009 install_server = ['http://madgraph.phys.ucl.ac.be/package_info.dat',
3010 'http://madgraph.physics.illinois.edu/package_info.dat']
3011@@ -6129,7 +6146,10 @@
3012 name = args[0]
3013 if args[0] == 'MadAnalysis4':
3014 args[0] = 'MadAnalysis'
3015-
3016+ elif args[0] in ['madstr', 'madSTR']:
3017+ args[0] = 'MadSTR'
3018+ name = 'MadSTR'
3019+
3020 if args[0] in self._advanced_install_opts:
3021 # Now launch the advanced installation of the tool args[0]
3022 # path['HEPToolsInstaller'] is the online adress where to downlaod
3023@@ -6352,6 +6372,7 @@
3024 cwd = os.path.join(MG5DIR, name))
3025 else:
3026 status = misc.call(['make']+make_flags, cwd = os.path.join(MG5DIR, name))
3027+ devnull.close()
3028 else:
3029 try:
3030 misc.compile(['clean'], mode='', cwd = os.path.join(MG5DIR, name))
3031@@ -6400,18 +6421,18 @@
3032
3033 if sys.platform == "darwin":
3034 logger.info('Downloading TD for Mac')
3035- target = 'http://madgraph.phys.ucl.ac.be/Downloads/td_mac_intel.tar.gz'
3036+ target = 'https://home.fnal.gov/~parke/TD/td_mac_intel64.tar.gz'
3037 misc.wget(target, 'td.tgz', cwd=pjoin(MG5DIR,'td'))
3038 misc.call(['tar', '-xzpvf', 'td.tgz'],
3039 cwd=pjoin(MG5DIR,'td'))
3040- files.mv(MG5DIR + '/td/td_mac_intel',MG5DIR+'/td/td')
3041+ files.mv(MG5DIR + '/td/td_intel_mac64',MG5DIR+'/td/td')
3042 else:
3043 if sys.maxsize > 2**32:
3044 logger.info('Downloading TD for Linux 64 bit')
3045- target = 'http://madgraph.phys.ucl.ac.be/Downloads/td64/td'
3046- logger.warning('''td program (needed by MadAnalysis) is not compile for 64 bit computer.
3047- In 99% of the case, this is perfectly fine. If you do not have plot, please follow
3048- instruction in https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/TopDrawer .''')
3049+ target = 'https://home.fnal.gov/~parke/TD/td_linux_64bit.tar.gz'
3050+ #logger.warning('''td program (needed by MadAnalysis) is not compile for 64 bit computer.
3051+ #In 99% of the case, this is perfectly fine. If you do not have plot, please follow
3052+ #instruction in https://cp3.irmp.ucl.ac.be/projects/madgraph/wiki/TopDrawer .''')
3053 else:
3054 logger.info('Downloading TD for Linux 32 bit')
3055 target = 'http://madgraph.phys.ucl.ac.be/Downloads/td'
3056
3057=== modified file 'madgraph/interface/master_interface.py'
3058--- madgraph/interface/master_interface.py 2019-09-26 14:06:19 +0000
3059+++ madgraph/interface/master_interface.py 2020-06-21 12:17:46 +0000
3060@@ -215,6 +215,8 @@
3061 elif nlo_mode in ['virt', 'sqrvirt']:
3062 self.change_principal_cmd('MadLoop', allow_switch)
3063 elif nlo_mode == 'noborn':
3064+ if self.current_interface == "MadGraph":
3065+ allow_switch = True
3066 self.change_principal_cmd('MadLoop', allow_switch)
3067 self.cmd.validate_model(self, loop_type=nlo_mode,
3068 coupling_type=orders)
3069
3070=== modified file 'madgraph/interface/reweight_interface.py'
3071--- madgraph/interface/reweight_interface.py 2020-01-15 18:23:15 +0000
3072+++ madgraph/interface/reweight_interface.py 2020-06-21 12:17:46 +0000
3073@@ -58,7 +58,7 @@
3074 nb_f2py_module = 0 # each time the process/model is changed this number is modified to
3075 # forced the python module to re-create an executable
3076
3077-lhapdf = None
3078+#lhapdf = None
3079
3080
3081 class ReweightInterface(extended_cmd.Cmd):
3082@@ -688,7 +688,8 @@
3083 for i,card in enumerate(param_card_iterator):
3084 if self.options['rwgt_name']:
3085 self.options['rwgt_name'] = '%s_%s' % (self.options['rwgt_name'].rsplit('_',1)[0], i+1)
3086- card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3087+ self.new_param_card = card
3088+ #card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3089 self.exec_cmd("launch --keep_card", printcmd=False, precmd=True)
3090
3091 self.options['rwgt_name'] = None
3092@@ -708,24 +709,23 @@
3093
3094
3095 if not '--keep_card' in args:
3096- ff = open(pjoin(rw_dir,'Cards', 'param_card.dat'), 'w')
3097- ff.write(self.banner['slha'])
3098- ff.close()
3099 if self.has_nlo and self.rwgt_mode != "LO":
3100 rwdir_virt = rw_dir.replace('rw_me', 'rw_mevirt')
3101- files.ln(ff.name, starting_dir=pjoin(rwdir_virt, 'Cards'))
3102- ff = open(pjoin(path_me, 'rw_me','Cards', 'param_card_orig.dat'), 'w')
3103- ff.write(self.banner['slha'])
3104- ff.close()
3105- if self.has_nlo and self.rwgt_mode != "LO":
3106- files.ln(ff.name, starting_dir=pjoin(path_me, 'rw_mevirt', 'Cards'))
3107- cmd = common_run_interface.CommonRunCmd.ask_edit_card_static(cards=['param_card.dat'],
3108- ask=self.ask, pwd=rw_dir, first_cmd=self.stored_line)
3109+
3110+ out, cmd = common_run_interface.CommonRunCmd.ask_edit_card_static(cards=['param_card.dat'],
3111+ ask=self.ask, pwd=rw_dir, first_cmd=self.stored_line,
3112+ write_file=False, return_instance=True
3113+ )
3114 self.stored_line = None
3115-
3116+ card = cmd.param_card
3117+ new_card = card.write()
3118+ elif self.new_param_card:
3119+ new_card = self.new_param_card.write()
3120+ else:
3121+ new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()
3122+
3123 # check for potential scan in the new card
3124- new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()
3125- pattern_scan = re.compile(r'''^[\s\d]*scan''', re.I+re.M)
3126+ pattern_scan = re.compile(r'''^(decay)?[\s\d]*scan''', re.I+re.M)
3127 param_card_iterator = []
3128 if pattern_scan.search(new_card):
3129 try:
3130@@ -744,11 +744,19 @@
3131 param_card_iterator = main_card
3132 first_card = param_card_iterator.next(autostart=True)
3133 new_card = first_card.write()
3134- first_card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3135-
3136- # check if "Auto" is present for a width parameter
3137+ self.new_param_card = first_card
3138+ #first_card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3139+
3140+ # check if "Auto" is present for a width parameter)
3141 tmp_card = new_card.lower().split('block',1)[1]
3142 if "auto" in tmp_card:
3143+ if param_card_iterator:
3144+ first_card.write(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3145+ else:
3146+ ff = open(pjoin(rw_dir, 'Cards', 'param_card.dat'),'w')
3147+ ff.write(new_card)
3148+ ff.close()
3149+
3150 self.mother.check_param_card(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3151 new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read()
3152
3153@@ -795,6 +803,7 @@
3154 # add the reweighting in the banner information:
3155 #starts by computing the difference in the cards.
3156 s_orig = self.banner['slha']
3157+ self.orig_param_card_text = s_orig
3158 s_new = new_card
3159 self.new_param_card = check_param_card.ParamCard(s_new.splitlines())
3160
3161@@ -866,15 +875,25 @@
3162 else:
3163 tag_name = 'rwgt_%s' % rewgtid
3164
3165+
3166 #initialise module.
3167 for (path,tag), module in self.f2pylib.items():
3168 with misc.chdir(pjoin(os.path.dirname(rw_dir), path)):
3169 with misc.stdchannel_redirected(sys.stdout, os.devnull):
3170 if 'second' in path or tag == 3:
3171- module.initialise(pjoin(rw_dir, 'Cards', 'param_card.dat'))
3172+ param_card = self.new_param_card
3173 else:
3174- module.initialise(pjoin(path_me, 'rw_me', 'Cards', 'param_card_orig.dat'))
3175+ param_card = check_param_card.ParamCard(self.orig_param_card_text)
3176+
3177+ for block in param_card:
3178
3179+ for param in param_card[block]:
3180+ lhacode = param.lhacode
3181+ value = param.value
3182+ name = '%s_%s' % (block.upper(), '_'.join([str(i) for i in lhacode]))
3183+ module.change_para(name, value)
3184+ module.update_all_coup()
3185+
3186 return param_card_iterator, tag_name
3187
3188
3189@@ -961,8 +980,10 @@
3190 def calculate_weight(self, event):
3191 """space defines where to find the calculator (in multicore)"""
3192
3193- global lhapdf
3194-
3195+ if not hasattr(self,'pdf'):
3196+ lhapdf = misc.import_python_lhapdf(self.mg5cmd.options['lhapdf'])
3197+ self.pdf = lhapdf.mkPDF(self.banner.run_card.get_lhapdf_id())
3198+
3199 if self.has_nlo and self.rwgt_mode != "LO":
3200 return self.calculate_nlo_weight(event)
3201
3202@@ -1075,19 +1096,20 @@
3203
3204 base_wgt.append(c_wgt.pwgt[:3])
3205
3206- #change the ordering to the fortran one:
3207- scales2 = self.invert_momenta(scales2)
3208- pdg = self.invert_momenta(pdg)
3209- bjx = self.invert_momenta(bjx)
3210+
3211+ orig_wgt_check, partial_check = self.combine_wgt_local(scales2, pdg, bjx, base_wgt, gs, qcdpower, self.pdf)
3212+ #change the ordering to the fortran one:
3213+ #scales2_i = self.invert_momenta(scales2)
3214+ #pdg_i = self.invert_momenta(pdg)
3215+ #bjx_i = self.invert_momenta(bjx)
3216 # re-compute original weight to reduce numerical inacurracy
3217- base_wgt = self.invert_momenta(base_wgt)
3218-
3219- orig_wgt_check, partial_check = self.combine_wgt(scales2, pdg, bjx, base_wgt, gs, qcdpower, 1., 1.)
3220+ #base_wgt_i = self.invert_momenta(base_wgt)
3221+ #orig_wgt_check, partial_check = self.combine_wgt(scales2_i, pdg_i, bjx_i, base_wgt_i, gs, qcdpower, 1., 1.)
3222
3223 if '_nlo' in type_nlo:
3224- wgt = self.invert_momenta(wgt_virt)
3225+ #wgt = self.invert_momenta(wgt_virt)
3226 with misc.stdchannel_redirected(sys.stdout, os.devnull):
3227- new_out, partial = self.combine_wgt(scales2, pdg, bjx, wgt, gs, qcdpower, 1., 1.)
3228+ new_out, partial = self.combine_wgt_local(scales2, pdg, bjx, wgt_virt, gs, qcdpower, self.pdf)
3229 # try to correct for precision issue
3230 avg = [partial_check[i]/ref_wgts[i] for i in range(len(ref_wgts))]
3231 out = sum(partial[i]/avg[i] if 0.85<avg[i]<1.15 else 0 \
3232@@ -1096,9 +1118,9 @@
3233
3234
3235 if '_tree' in type_nlo:
3236- wgt = self.invert_momenta(wgt_tree)
3237+ #wgt = self.invert_momenta(wgt_tree)
3238 with misc.stdchannel_redirected(sys.stdout, os.devnull):
3239- out, partial = self.combine_wgt(scales2, pdg, bjx, wgt, gs, qcdpower, 1., 1.)
3240+ out, partial = self.combine_wgt_local(scales2, pdg, bjx, wgt_tree, gs, qcdpower, self.pdf)
3241 # try to correct for precision issue
3242 avg = [partial_check[i]/ref_wgts[i] for i in range(len(ref_wgts))]
3243 new_out = sum(partial[i]/avg[i] if 0.85<avg[i]<1.15 else partial[i] \
3244@@ -1126,7 +1148,25 @@
3245 assert not to_write
3246 assert not wgt_tree
3247 return final_weight
3248+
3249+
3250+ def combine_wgt_local(self, scale2s, pdgs, bjxs, base_wgts, gss, qcdpowers, pdf):
3251+
3252+ wgt = 0.
3253+ wgts = []
3254+ for (scale2, pdg, bjx, base_wgt, gs, qcdpower) in zip(scale2s, pdgs, bjxs, base_wgts, gss, qcdpowers):
3255+ Q2, mur2, muf2 = scale2 #Q2 is Ellis-Sexton scale
3256+ #misc.sprint(Q2, mur2, muf2, base_wgt, gs, qcdpower)
3257+ pdf1 = pdf.xfxQ2(pdg[0], bjx[0], muf2)/bjx[0]
3258+ pdf2 = pdf.xfxQ2(pdg[1], bjx[1], muf2)/bjx[1]
3259+ alphas = pdf.alphasQ2(mur2)
3260+ tmp = base_wgt[0] + base_wgt[1] * math.log(mur2/Q2) + base_wgt[2] * math.log(muf2/Q2)
3261+ tmp *= gs**qcdpower*pdf1*pdf2
3262+ wgt += tmp
3263+ wgts.append(tmp)
3264+ return wgt, wgts
3265
3266+
3267
3268 @staticmethod
3269 def invert_momenta(p):
3270@@ -1450,10 +1490,9 @@
3271 commandline = re.sub('@\s*\d+', '', commandline)
3272 # deactivate golem since it creates troubles
3273 old_options = dict(mgcmd.options)
3274- if mgcmd.options['golem'] or mgcmd.options['pjfry']:
3275- logger.info(" When doing NLO reweighting, MG5aMC cannot use the loop reduction algorithms Golem and/or PJFry++")
3276+ if mgcmd.options['golem']:
3277+ logger.info(" When doing NLO reweighting, MG5aMC cannot use the loop reduction algorithms Golem")
3278 mgcmd.options['golem'] = None
3279- mgcmd.options['pjfry'] = None
3280 commandline = commandline.replace('add process', 'generate',1)
3281 logger.info(commandline)
3282 mgcmd.exec_cmd(commandline, precmd=True)
3283@@ -1462,22 +1501,10 @@
3284
3285 #put back golem to original value
3286 mgcmd.options['golem'] = old_options['golem']
3287- mgcmd.options['pjfry'] = old_options['pjfry']
3288 # update make_opts
3289- m_opts = {}
3290- if mgcmd.options['lhapdf']:
3291- #lhapdfversion = subprocess.Popen([mgcmd.options['lhapdf'], '--version'],
3292- # stdout = subprocess.PIPE).stdout.read().strip()[0]
3293- m_opts['lhapdf'] = True
3294- m_opts['f2pymode'] = True
3295- m_opts['lhapdfversion'] = 5 # 6 always fail on my computer since 5 is compatible but slower always use 5
3296- m_opts['llhapdf'] = self.mother.get_lhapdf_libdir()
3297- else:
3298+ if not mgcmd.options['lhapdf']:
3299 raise Exception, "NLO reweighting requires LHAPDF to work correctly"
3300
3301- path = pjoin(path_me,data['paths'][1], 'Source', 'make_opts')
3302- common_run_interface.CommonRunCmd.update_make_opts_full(path, m_opts)
3303- logger.info('Done %.4g' % (time.time()-start))
3304
3305
3306 # Download LHAPDF SET
3307@@ -1635,7 +1662,7 @@
3308 elif has_nlo and 'NLO' in self.rwgt_mode:
3309 self.create_standalone_virt_directory(data, second)
3310
3311- if not second:
3312+ if False:#not second:
3313 #compile the module to combine the weight
3314 misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))
3315 #link it
3316@@ -1666,8 +1693,7 @@
3317 commandline='import model loop_sm;generate g g > e+ ve [virt=QCD]'
3318 # deactivate golem since it creates troubles
3319 old_options = dict(mgcmd.options)
3320- mgcmd.options['golem'] = None
3321- mgcmd.options['pjfry'] = None
3322+ mgcmd.options['golem'] = None
3323 commandline = commandline.replace('add process', 'generate',1)
3324 logger.info(commandline)
3325 mgcmd.exec_cmd(commandline, precmd=True)
3326@@ -1675,41 +1701,30 @@
3327 mgcmd.exec_cmd(commandline, precmd=True)
3328 #put back golem to original value
3329 mgcmd.options['golem'] = old_options['golem']
3330- mgcmd.options['pjfry'] = old_options['pjfry']
3331 # update make_opts
3332- m_opts = {}
3333- if mgcmd.options['lhapdf']:
3334- #lhapdfversion = subprocess.Popen([mgcmd.options['lhapdf'], '--version'],
3335- # stdout = subprocess.PIPE).stdout.read().strip()[0]
3336- m_opts['lhapdf'] = True
3337- m_opts['f2pymode'] = True
3338- m_opts['lhapdfversion'] = 5 # 6 always fail on my computer since 5 is compatible but slower always use 5
3339- m_opts['llhapdf'] = self.mother.get_lhapdf_libdir()
3340- else:
3341+ if not mgcmd.options['lhapdf']:
3342 raise Exception, "NLO_tree reweighting requires LHAPDF to work correctly"
3343
3344- path = pjoin(path_me,data['paths'][1], 'Source', 'make_opts')
3345- common_run_interface.CommonRunCmd.update_make_opts_full(path, m_opts)
3346- logger.info('Done %.4g' % (time.time()-start))
3347-
3348 # Download LHAPDF SET
3349 common_run_interface.CommonRunCmd.install_lhapdf_pdfset_static(\
3350 mgcmd.options['lhapdf'], None, self.banner.run_card.get_lhapdf_id())
3351
3352 #compile the module to combine the weight
3353- misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))
3354- #link it
3355- with misc.chdir(pjoin(path_me)):
3356- if path_me not in sys.path:
3357- sys.path.insert(0, path_me)
3358- mymod = __import__('%s.Source.rwgt2py' % data['paths'][1], globals(), locals(), [],-1)
3359- mymod = mymod.Source.rwgt2py
3360- with misc.stdchannel_redirected(sys.stdout, os.devnull):
3361- mymod.initialise([self.banner.run_card['lpp1'],
3362- self.banner.run_card['lpp2']],
3363- self.banner.run_card.get_lhapdf_id())
3364- self.combine_wgt = mymod.get_wgt
3365-
3366+ if False:
3367+ #use python module instead
3368+ misc.compile(cwd=pjoin(path_me, data['paths'][1], 'Source'))
3369+ #link it
3370+ with misc.chdir(pjoin(path_me)):
3371+ if path_me not in sys.path:
3372+ sys.path.insert(0, path_me)
3373+ mymod = __import__('%s.Source.rwgt2py' % data['paths'][1], globals(), locals(), [],-1)
3374+ mymod = mymod.Source.rwgt2py
3375+ with misc.stdchannel_redirected(sys.stdout, os.devnull):
3376+ mymod.initialise([self.banner.run_card['lpp1'],
3377+ self.banner.run_card['lpp2']],
3378+ self.banner.run_card.get_lhapdf_id())
3379+ self.combine_wgt = mymod.get_wgt
3380+
3381
3382 # 6. If we need a new model/process-------------------------------------
3383 if (self.second_model or self.second_process or self.dedicated_path) and not second :
3384@@ -1895,6 +1910,7 @@
3385 to_save['has_nlo'] = self.has_nlo
3386 to_save['rwgt_mode'] = self.rwgt_mode
3387 to_save['rwgt_name'] = self.options['rwgt_name']
3388+ to_save['allow_missing_finalstate'] = self.options['allow_missing_finalstate']
3389
3390 name = pjoin(self.rwgt_dir, 'rw_me', 'rwgt.pkl')
3391 save_load_object.save_to_file(name, to_save)
3392@@ -1910,7 +1926,7 @@
3393 'rwgt_name': None}
3394 if keep_name:
3395 self.options['rwgt_name'] = obj['rwgt_name']
3396-
3397+ self.options['allow_missing_finalstate'] = obj['allow_missing_finalstate']
3398 old_rwgt = obj['rwgt_dir']
3399
3400 # path to fortran executable
3401@@ -1933,7 +1949,8 @@
3402 if not self.rwgt_mode:
3403 self.rwgt_mode = obj['rwgt_mode']
3404 logger.info("mode set to %s" % self.rwgt_mode)
3405- if self.has_nlo and 'NLO' in self.rwgt_mode:
3406+ if False:#self.has_nlo and 'NLO' in self.rwgt_mode:
3407+ #use python version
3408 path = pjoin(obj['rwgt_dir'], 'rw_mevirt','Source')
3409 sys.path.insert(0, path)
3410 try:
3411
3412=== modified file 'madgraph/iolibs/export_v4.py'
3413--- madgraph/iolibs/export_v4.py 2020-03-10 15:07:48 +0000
3414+++ madgraph/iolibs/export_v4.py 2020-06-21 12:17:46 +0000
3415@@ -12,7 +12,6 @@
3416 # For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch
3417 #
3418 ################################################################################
3419-from madgraph.iolibs.helas_call_writers import HelasCallWriter
3420 """Methods and classes to export matrix elements to v4 format."""
3421
3422 import copy
3423@@ -881,7 +880,7 @@
3424 # Make sure aloha is in quadruple precision if needed
3425 old_aloha_mp=aloha.mp_precision
3426 aloha.mp_precision=self.opt['mp']
3427-
3428+ self.model = model
3429 # create the MODEL
3430 write_dir=pjoin(self.dir_path, 'Source', 'MODEL')
3431 model_builder = UFO_model_to_mg4(model, write_dir, self.opt + self.proc_characteristic)
3432@@ -2035,7 +2034,7 @@
3433 open(pjoin(self.dir_path,'__init__.py'),'w')
3434 open(pjoin(self.dir_path,'SubProcesses','__init__.py'),'w')
3435
3436- if 'mode' in self.opt and self.opt['mode'] == "reweight":
3437+ if False:#'mode' in self.opt and self.opt['mode'] == "reweight":
3438 #add the module to hande the NLO weight
3439 files.copytree(pjoin(MG5DIR, 'Template', 'RWGTNLO'),
3440 pjoin(self.dir_path, 'Source'))
3441@@ -2043,7 +2042,7 @@
3442 pjoin(self.dir_path, 'Source', 'PDF'))
3443 self.write_pdf_opendata()
3444
3445- if self.prefix_info:
3446+ if self.prefix_info:
3447 self.write_f2py_splitter()
3448 self.write_f2py_makefile()
3449 self.write_f2py_check_sa(matrix_elements,
3450@@ -2100,6 +2099,34 @@
3451 CALL SETPARA(PATH) !first call to setup the paramaters
3452 RETURN
3453 END
3454+
3455+
3456+ subroutine CHANGE_PARA(name, value)
3457+ implicit none
3458+CF2PY intent(in) :: name
3459+CF2PY intent(in) :: value
3460+
3461+ character*512 name
3462+ double precision value
3463+
3464+ include '../Source/MODEL/input.inc'
3465+ include '../Source/MODEL/coupl.inc'
3466+
3467+ SELECT CASE (name)
3468+ %(parameter_setup)s
3469+ CASE DEFAULT
3470+ write(*,*) 'no parameter matching', name, value
3471+ END SELECT
3472+
3473+ return
3474+ end
3475+
3476+ subroutine update_all_coup()
3477+ implicit none
3478+ call coup()
3479+ return
3480+ end
3481+
3482
3483 subroutine get_pdg_order(PDG)
3484 IMPLICIT NONE
3485@@ -2154,20 +2181,46 @@
3486 if min_nexternal != max_nexternal:
3487 text.append('endif')
3488
3489+ params = self.get_model_parameter(self.model)
3490+ parameter_setup =[]
3491+ for key, var in params.items():
3492+ parameter_setup.append(' CASE ("%s")\n %s = value'
3493+ % (key, var))
3494+
3495 formatting = {'python_information':'\n'.join(info),
3496 'smatrixhel': '\n'.join(text),
3497 'maxpart': max_nexternal,
3498 'nb_me': len(allids),
3499 'pdgs': ','.join(str(pdg[i]) if i<len(pdg) else '0'
3500 for i in range(max_nexternal) for pdg in allids),
3501- 'prefix':'\',\''.join(allprefix)
3502+ 'prefix':'\',\''.join(allprefix),
3503+ 'parameter_setup': '\n'.join(parameter_setup),
3504 }
3505 formatting['lenprefix'] = len(formatting['prefix'])
3506 text = template % formatting
3507 fsock = writers.FortranWriter(pjoin(self.dir_path, 'SubProcesses', 'all_matrix.f'),'w')
3508 fsock.writelines(text)
3509 fsock.close()
3510+
3511+ def get_model_parameter(self, model):
3512+ """ returns all the model parameter
3513+ """
3514+ params = {}
3515+ for p in model.get('parameters')[('external',)]:
3516+ name = p.name
3517+ nopref = name[4:] if name.startswith('mdl_') else name
3518+ params[nopref] = name
3519
3520+ block = p.lhablock
3521+ lha = '_'.join([str(i) for i in p.lhacode])
3522+ params['%s_%s' % (block.upper(), lha)] = name
3523+
3524+ return params
3525+
3526+
3527+
3528+
3529+
3530 def write_f2py_check_sa(self, matrix_element, writer):
3531 """ Write the general check_sa.py in SubProcesses that calls all processes successively."""
3532 # To be implemented. It is just an example file, i.e. not crucial.
3533
3534=== modified file 'madgraph/iolibs/file_writers.py'
3535--- madgraph/iolibs/file_writers.py 2018-05-03 09:00:52 +0000
3536+++ madgraph/iolibs/file_writers.py 2020-06-21 12:17:46 +0000
3537@@ -342,19 +342,28 @@
3538 columns. Split in preferential order according to
3539 split_characters, and start each new line with line_start."""
3540
3541- res_lines = [line]
3542-
3543- while len(res_lines[-1]) > self.line_length:
3544+ def get_split_index(line, max_length, max_split, split_characters):
3545 split_at = 0
3546 for character in split_characters:
3547- index = res_lines[-1][(self.line_length - self.max_split): \
3548- self.line_length].rfind(character)
3549+ index = line[(max_length - max_split): \
3550+ max_length].rfind(character)
3551 if index >= 0:
3552- split_at_tmp = self.line_length - self.max_split + index
3553+ split_at_tmp = max_length - max_split + index
3554 if split_at_tmp > split_at:
3555 split_at = split_at_tmp
3556+ return split_at
3557+
3558+
3559+ res_lines = [line]
3560+
3561+ while len(res_lines[-1]) > self.line_length:
3562+ split_at = get_split_index(res_lines[-1], self.line_length,
3563+ self.max_split, split_characters)
3564 if split_at == 0:
3565- split_at = self.line_length
3566+ split_at = get_split_index(res_lines[-1], self.line_length,
3567+ self.max_split + 30, split_characters)
3568+ if split_at == 0:
3569+ split_at = self.line_length
3570
3571 newline = res_lines[-1][split_at:]
3572 nquotes = self.count_number_of_quotes(newline)
3573
3574=== modified file 'madgraph/iolibs/template_files/madevent_symmetry.f'
3575--- madgraph/iolibs/template_files/madevent_symmetry.f 2018-03-16 12:13:34 +0000
3576+++ madgraph/iolibs/template_files/madevent_symmetry.f 2020-06-21 12:17:46 +0000
3577@@ -103,7 +103,7 @@
3578 if (abs(lpp(1)) .eq. 3) m1 = 0.000511d0
3579 if (abs(lpp(2)) .eq. 3) m2 = 0.000511d0
3580 if (mass_ion(1).ge.0d0) m1 = mass_ion(1)
3581- if (mass_ion(2).ge.0d0) m1 = mass_ion(2)
3582+ if (mass_ion(2).ge.0d0) m2 = mass_ion(2)
3583 if(ebeam(1).lt.m1.and.lpp(1).ne.9) ebeam(1)=m1
3584 if(ebeam(2).lt.m2.and.lpp(2).ne.9) ebeam(2)=m2
3585 pi1(0)=ebeam(1)
3586
3587=== modified file 'madgraph/loop/loop_exporters.py'
3588--- madgraph/loop/loop_exporters.py 2019-06-05 11:03:48 +0000
3589+++ madgraph/loop/loop_exporters.py 2020-06-21 12:17:46 +0000
3590@@ -297,6 +297,36 @@
3591 RETURN
3592 END
3593
3594+ subroutine CHANGE_PARA(name, value)
3595+ implicit none
3596+CF2PY intent(in) :: name
3597+CF2PY intent(in) :: value
3598+
3599+ character*512 name
3600+ double precision value
3601+
3602+ include '../Source/MODEL/input.inc'
3603+ include '../Source/MODEL/coupl.inc'
3604+ include '../Source/MODEL/mp_coupl.inc'
3605+ include '../Source/MODEL/mp_input.inc'
3606+
3607+ SELECT CASE (name)
3608+ %(parameter_setup)s
3609+ CASE DEFAULT
3610+ write(*,*) 'no parameter matching', name
3611+ END SELECT
3612+
3613+ return
3614+ end
3615+
3616+ subroutine update_all_coup()
3617+ implicit none
3618+ call coup()
3619+ call printout()
3620+ return
3621+ end
3622+
3623+
3624 SUBROUTINE SET_MADLOOP_PATH(PATH)
3625 C Routine to set the path of the folder 'MadLoop5_resources' to MadLoop
3626 CHARACTER(512) PATH
3627@@ -377,6 +407,14 @@
3628 #close the function
3629 if min_nexternal != max_nexternal:
3630 text.append('endif')
3631+
3632+ params = self.get_model_parameter(self.model)
3633+ parameter_setup =[]
3634+ for key, var in params.items():
3635+ parameter_setup.append(' CASE ("%s")\n %s = value\n MP__%s = value'
3636+ % (key, var, var))
3637+
3638+
3639
3640 formatting = {'python_information':'\n'.join(info),
3641 'smatrixhel': '\n'.join(text),
3642@@ -385,7 +423,8 @@
3643 'pdgs': ','.join([str(pdg[i]) if i<len(pdg) else '0'
3644 for i in range(max_nexternal) \
3645 for pdg in allids]),
3646- 'prefix':'\',\''.join(allprefix)
3647+ 'prefix':'\',\''.join(allprefix),
3648+ 'parameter_setup': '\n'.join(parameter_setup),
3649 }
3650
3651
3652
3653=== modified file 'madgraph/madevent/gen_crossxhtml.py'
3654--- madgraph/madevent/gen_crossxhtml.py 2018-05-25 09:13:24 +0000
3655+++ madgraph/madevent/gen_crossxhtml.py 2020-06-21 12:17:46 +0000
3656@@ -375,6 +375,9 @@
3657 run[name] = int(value)
3658 elif name in ['run_mode','run_statistics']:
3659 run[name] = value
3660+ elif name == 'cross' and run[name] != 0:
3661+ run['prev_' + name] = run[name]
3662+ run[name] = float(value)
3663 else:
3664 run[name] = float(value)
3665
3666
3667=== modified file 'madgraph/madevent/gen_ximprove.py'
3668--- madgraph/madevent/gen_ximprove.py 2020-02-25 14:05:36 +0000
3669+++ madgraph/madevent/gen_ximprove.py 2020-06-21 12:17:46 +0000
3670@@ -108,6 +108,10 @@
3671 self.splitted_grid = self.run_card['survey_splitting']
3672 if self.run_card['survey_nchannel_per_job'] != -1:
3673 self.combining_job = self.run_card['survey_nchannel_per_job']
3674+ elif self.run_card['hard_survey'] > 1:
3675+ self.combining_job = 1
3676+
3677+
3678
3679 self.splitted_Pdir = {}
3680 self.splitted_for_dir = lambda x,y: self.splitted_grid
3681@@ -971,7 +975,7 @@
3682 super(gen_ximprove_v4, self).__init__(cmd, opt)
3683
3684 if cmd.opts['accuracy'] < cmd._survey_options['accuracy'][1]:
3685- self.increase_precision()
3686+ self.increase_precision(cmd._survey_options['accuracy'][1]/cmd.opts['accuracy'])
3687
3688 def reset_multijob(self):
3689
3690@@ -986,15 +990,23 @@
3691 f.write('%i\n' % nb_split)
3692 f.close()
3693
3694- def increase_precision(self):
3695-
3696- self.max_event_in_iter = 20000
3697- self.min_events = 7500
3698+ def increase_precision(self, rate=3):
3699+ misc.sprint(rate)
3700+ if rate < 3:
3701+ self.max_event_in_iter = 20000
3702+ self.min_events = 7500
3703+ self.gen_events_security = 1.3
3704+ else:
3705+ rate = rate -2
3706+ self.max_event_in_iter = int((rate+1) * 10000)
3707+ self.min_events = int(rate+2) * 2500
3708+ self.gen_events_security = 1 + 0.1 * (rate+2)
3709+
3710 if int(self.nhel) == 1:
3711 self.min_event_in_iter *= 2**(self.cmd.proc_characteristics['nexternal']//3)
3712 self.max_event_in_iter *= 2**(self.cmd.proc_characteristics['nexternal']//2)
3713
3714- self.gen_events_security = 1.3
3715+
3716
3717 alphabet = "abcdefghijklmnopqrstuvwxyz"
3718 def get_job_for_event(self):
3719
3720=== modified file 'madgraph/various/banner.py'
3721--- madgraph/various/banner.py 2020-03-08 20:49:57 +0000
3722+++ madgraph/various/banner.py 2020-06-21 12:17:46 +0000
3723@@ -3091,7 +3091,8 @@
3724 self.add_param('issgridfile', '', hidden=True)
3725 #job handling of the survey/ refine
3726 self.add_param('job_strategy', 0, hidden=True, include=False, allowed=[0,1,2], comment='see appendix of 1507.00020 (page 26)')
3727- 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')
3728+ 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')
3729+ 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.")
3730 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.")
3731 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")
3732 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)")
3733@@ -3195,8 +3196,6 @@
3734 if self['mmjj'] > self['xqcut']:
3735 logger.warning('mmjj > xqcut (and auto_ptj_mjj = F). MMJJ set to 0')
3736 self['mmjj'] = 0.0
3737-
3738-
3739
3740 # check validity of the pdf set
3741 if self['pdlabel'] == 'lhapdf':
3742@@ -4067,7 +4066,7 @@
3743 super(RunCardNLO, self).check_validity()
3744
3745 # for lepton-lepton collisions, ignore 'pdlabel' and 'lhaid'
3746- if self['lpp1']!=1 or self['lpp2']!=1:
3747+ if abs(self['lpp1'])!=1 or abs(self['lpp2'])!=1:
3748 if self['lpp1'] == 1 or self['lpp2']==1:
3749 raise InvalidRunCard('Process like Deep Inelastic scattering not supported at NLO accuracy.')
3750
3751
3752=== modified file 'madgraph/various/lhe_parser.py'
3753--- madgraph/various/lhe_parser.py 2020-01-09 23:14:56 +0000
3754+++ madgraph/various/lhe_parser.py 2020-06-21 12:17:46 +0000
3755@@ -1449,8 +1449,8 @@
3756 if not hasattr(Event, 'loweight_pattern'):
3757 Event.loweight_pattern = re.compile('''<rscale>\s*(?P<nqcd>\d+)\s+(?P<ren_scale>[\d.e+-]+)\s*</rscale>\s*\n\s*
3758 <asrwt>\s*(?P<asrwt>[\s\d.+-e]+)\s*</asrwt>\s*\n\s*
3759- <pdfrwt\s+beam=["']?1["']?\>\s*(?P<beam1>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*
3760- <pdfrwt\s+beam=["']?2["']?\>\s*(?P<beam2>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*
3761+ <pdfrwt\s+beam=["']?(?P<idb1>1|2)["']?\>\s*(?P<beam1>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*
3762+ <pdfrwt\s+beam=["']?(?P<idb2>1|2)["']?\>\s*(?P<beam2>[\s\d.e+-]*)\s*</pdfrwt>\s*\n\s*
3763 <totfact>\s*(?P<totfact>[\d.e+-]*)\s*</totfact>
3764 ''',re.X+re.I+re.M)
3765
3766@@ -1468,13 +1468,22 @@
3767 self.loweight['asrwt'] =[float(x) for x in info.group('asrwt').split()[1:]]
3768 self.loweight['tot_fact'] = float(info.group('totfact'))
3769
3770- args = info.group('beam1').split()
3771+ if info.group('idb1') == info.group('idb2'):
3772+ raise Exception, '%s not parsed'% text
3773+
3774+ if info.group('idb1') =="1":
3775+ args = info.group('beam1').split()
3776+ else:
3777+ args = info.group('beam2').split()
3778 npdf = int(args[0])
3779 self.loweight['n_pdfrw1'] = npdf
3780 self.loweight['pdf_pdg_code1'] = [int(i) for i in args[1:1+npdf]]
3781 self.loweight['pdf_x1'] = [float(i) for i in args[1+npdf:1+2*npdf]]
3782 self.loweight['pdf_q1'] = [float(i) for i in args[1+2*npdf:1+3*npdf]]
3783- args = info.group('beam2').split()
3784+ if info.group('idb2') =="2":
3785+ args = info.group('beam2').split()
3786+ else:
3787+ args = info.group('beam1').split()
3788 npdf = int(args[0])
3789 self.loweight['n_pdfrw2'] = npdf
3790 self.loweight['pdf_pdg_code2'] = [int(i) for i in args[1:1+npdf]]
3791
3792=== modified file 'madgraph/various/misc.py'
3793--- madgraph/various/misc.py 2020-01-08 14:13:32 +0000
3794+++ madgraph/various/misc.py 2020-06-21 12:17:46 +0000
3795@@ -488,7 +488,7 @@
3796 error_text += "In general this means that your computer is not able to compile."
3797 if sys.platform == "darwin":
3798 error_text += "Note that MacOSX doesn\'t have gmake/gfortan install by default.\n"
3799- error_text += "Xcode3 contains those required programs"
3800+ error_text += "Xcode contains gmake. For gfortran we advise: http://hpc.sourceforge.net/"
3801 raise MadGraph5Error, error_text
3802
3803 if p.returncode:
3804@@ -539,7 +539,7 @@
3805 p = Popen([compiler, '-dumpversion'], stdout=subprocess.PIPE,
3806 stderr=subprocess.PIPE)
3807 output, error = p.communicate()
3808- version_finder=re.compile(r"(?P<version>(\d.)*\d)")
3809+ version_finder=re.compile(r"(?P<version>\d[\d.]*)")
3810 version = version_finder.search(output).group('version')
3811 return version
3812 except Exception:
3813@@ -1772,7 +1772,8 @@
3814 import random
3815 msg = choices[random.randint(0,len(choices)-2)]
3816 EasterEgg.message_aprilfirst[msgtype].remove(msg)
3817-
3818+ else:
3819+ return
3820 elif msgtype=='loading' and date in self.special_banner:
3821 self.change_banner(date)
3822 return
3823@@ -2065,7 +2066,9 @@
3824 logger.warning("Failed to access python version of LHAPDF: "\
3825 "If the python interface to LHAPDF is available on your system, try "\
3826 "adding its location to the PYTHONPATH environment variable and the"\
3827- "LHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x).")
3828+ "LHAPDF library location to LD_LIBRARY_PATH (linux) or DYLD_LIBRARY_PATH (mac os x)."\
3829+ "The required LD_LIBRARY_PATH is "+ lhapdf_libdir
3830+ )
3831
3832 if use_lhapdf:
3833 python_lhapdf = lhapdf
3834
3835=== modified file 'madgraph/various/process_checks.py'
3836--- madgraph/various/process_checks.py 2019-03-01 08:53:21 +0000
3837+++ madgraph/various/process_checks.py 2020-06-21 12:17:46 +0000
3838@@ -375,7 +375,7 @@
3839 else:
3840 energy = options['energy']
3841 events = options['events']
3842- to_skip = 0
3843+ to_skip = options['skip_evt']
3844
3845 if not (isinstance(process, base_objects.Process) and \
3846 isinstance(energy, (float,int))):
3847
3848=== modified file 'models/model_reader.py'
3849--- models/model_reader.py 2018-06-20 08:18:36 +0000
3850+++ models/model_reader.py 2020-06-21 12:17:46 +0000
3851@@ -181,6 +181,11 @@
3852 value = 0.0
3853 else:
3854 raise
3855+ except OverflowError, err:
3856+ if scale < 1:
3857+ value = 0.0
3858+ else:
3859+ raise
3860 exec("locals()[\'%s\'] = %s" % (parameter_dict[block][pid].name,
3861 value))
3862 parameter_dict[block][pid].value = float(value)
3863
3864=== modified file 'tests/acceptance_tests/test_cmd_reweight.py'
3865--- tests/acceptance_tests/test_cmd_reweight.py 2018-06-01 12:14:52 +0000
3866+++ tests/acceptance_tests/test_cmd_reweight.py 2020-06-21 12:17:46 +0000
3867@@ -136,16 +136,22 @@
3868 ff.close()
3869
3870
3871- with misc.stdchannel_redirected(sys.stdout, os.devnull):
3872- me_cmd.run_cmd('reweight run_01 --from_cards')
3873+ if logger.level <= 10:
3874+ me_cmd.run_cmd('reweight run_01 --from_cards')
3875+ else:
3876+ with misc.stdchannel_redirected(sys.stdout, os.devnull):
3877+ me_cmd.run_cmd('reweight run_01 --from_cards')
3878
3879 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'unweighted_events.lhe.gz'))
3880
3881- 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]
3882+ #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]
3883+ 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]
3884+ #solutions = []
3885 for i,event in enumerate(lhe):
3886
3887 rwgt_data = event.parse_reweight()
3888 #solutions.append(rwgt_data['rwgt_1'])
3889+ #continue
3890 self.assertTrue('rwgt_1' in rwgt_data)
3891 self.assertTrue(misc.equal(rwgt_data['rwgt_1'], solutions[i]))
3892 #misc.sprint(solutions)
3893@@ -239,7 +245,8 @@
3894 if 1: #with misc.stdchannel_redirected(sys.stdout, os.devnull):
3895 me_cmd.run_cmd('reweight run_01 --from_cards')
3896
3897- 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]
3898+ #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]
3899+ 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]
3900 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'rwgt_events_tree_rwgt_1.lhe.gz'))
3901 lhe_orig = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'events.lhe.gz'))
3902 from itertools import izip
3903@@ -249,9 +256,9 @@
3904 i+=1
3905 rwgt_data = event_orig.parse_reweight()
3906 #solutions.append(rwgt_data['rwgt_1_tree'])
3907+ #continue
3908 self.assertTrue('rwgt_1_tree' in rwgt_data)
3909 self.assertEqual(event.wgt, rwgt_data['rwgt_1_tree'])
3910- #misc.sprint(abs(event.wgt))
3911 self.assertTrue(misc.equal(event.wgt, solutions[i]))
3912 nlo1 = event.parse_nlo_weight()
3913 nlo2 = event_orig.parse_nlo_weight()
3914@@ -259,6 +266,7 @@
3915 self.assertNotEqual(nlo1.total_wgt, nlo2.total_wgt)
3916
3917 #misc.sprint(solutions)
3918+ #raise Exception
3919
3920 def test_loop_improved_reweighting(self):
3921 """ check identical re-weighting in ttbar
3922@@ -281,8 +289,11 @@
3923 ff.write(cmd_lines)
3924 ff.close()
3925
3926- with misc.stdchannel_redirected(sys.stdout, os.devnull):
3927+ if logger.level <=10:
3928 me_cmd.run_cmd('reweight run_01 --from_cards')
3929+ else:
3930+ with misc.stdchannel_redirected(sys.stdout, os.devnull):
3931+ me_cmd.run_cmd('reweight run_01 --from_cards')
3932
3933 lhe = lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'events.lhe.gz'))
3934 lhe2= lhe_parser.EventFile(pjoin(self.run_dir,'Events','run_01', 'rwgt_events_tree_rwgt_1.lhe.gz'))
3935@@ -335,11 +346,12 @@
3936 self.assertTrue(misc.equal(rwgt_data['NAME_1'], solutions2[i]))
3937
3938
3939- def test_nlo_reweighting_comb(self):
3940+ def old_test_nlo_reweighting_comb(self):
3941 """check that nlo reweighting is working.
3942 The main point is to check the recombination of the weights
3943 Since the rest should be either checked by the lhe_parser class
3944- or by the various check of the standalone checks
3945+ or by the various check of the standalone checks.
3946+ This way of combining weights is now outdated
3947 """
3948
3949 # create a reweight directory
3950
3951=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%COLLIER_interface.f'
3952--- 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
3953+++ 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
3954@@ -164,8 +164,9 @@
3955 IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)
3956 $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.
3957 $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS
3958- $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2).EQ.0.AND.(NCALLS_IN_CACHE(
3959- $I)/2).EQ.NCOLLIERCALLS(I) ) ) ) THEN
3960+ $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2)
3961+ $ .EQ.0.AND.(NCALLS_IN_CACHE(I)/2).EQ.NCOLLIERCALLS(I) ) ) )
3962+ $ THEN
3963 WRITE(*,*) 'WARNING: A consistency check in MadLoop'
3964 $ //' failed and, for safety, forced MadLoop to'
3965 $ //' reinitialize the global cache of COLLIER. Report'
3966@@ -256,8 +257,8 @@
3967 C The expression below is like taking the absolute value
3968 C when summing errors linearly
3969 C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxC
3970-C oefForRank(CURR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K)))
3971-C ,ABS(DIMAG(TIRCOEFS(I,K))) )
3972+C oefForRank(CURR_RANK))*DCMPLX(
3973+C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
3974 C But empirically, I observed that retaining the
3975 C original complex phase leads to slightly more
3976 C accurate estimates
3977@@ -479,8 +480,8 @@
3978 C The expression below is like taking the absolute value
3979 C when summing errors linearly
3980 C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(C
3981-C URR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIR
3982-C COEFS(I,K))) )
3983+C URR_RANK))*DCMPLX(
3984+C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
3985 C But empirically, I observed that retaining the original
3986 C complex phase leads to slightly more accurate estimates
3987 TIRCOEFSERRORS(I,K)=(TNTENERR(CURR_RANK)
3988@@ -592,8 +593,8 @@
3989
3990 C The common blocks below are to retrieve the necessary
3991 C information about
3992-C MadLoop running mode and store it in the sCOLLIER_CACHE_RELEVANT_
3993-C PARAMS common block.
3994+C MadLoop running mode and store it in the
3995+C sCOLLIER_CACHE_RELEVANT_PARAMS common block.
3996
3997 INCLUDE 'MadLoopParams.inc'
3998 INCLUDE 'unique_id.inc'
3999@@ -662,8 +663,8 @@
4000 USERHEL_BU = USERHEL
4001 SQSO_TARGET_BU = SQSO_TARGET
4002 COLLIERMODE_BU = COLLIERMODE
4003- COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT
4004- $YTEST
4005+ COLLIERUSEINTERNALSTABILITYTEST_BU =
4006+ $ COLLIERUSEINTERNALSTABILITYTEST
4007 CTMODERUN_BU = CTMODERUN
4008 CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)
4009 COLLIER_CACHE_ACTIVE = 1
4010@@ -710,8 +711,8 @@
4011 USERHEL_BU = USERHEL
4012 SQSO_TARGET_BU = SQSO_TARGET
4013 COLLIERMODE_BU = COLLIERMODE
4014- COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT
4015- $YTEST
4016+ COLLIERUSEINTERNALSTABILITYTEST_BU =
4017+ $ COLLIERUSEINTERNALSTABILITYTEST
4018 CTMODERUN_BU = CTMODERUN
4019 IF (COLLIERGLOBALCACHE.EQ.-1) THEN
4020 CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
4021
4022=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%CT_interface.f'
4023--- 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
4024+++ 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
4025@@ -663,8 +663,8 @@
4026 C Determine it uses qp or not
4027 DOING_QP = (CTMODE.GE.4)
4028
4029- IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.GOODAMP(SQUAREDSOIND
4030- $EX,LOOPNUM)) THEN
4031+ IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED)
4032+ $ .OR.GOODAMP(SQUAREDSOINDEX,LOOPNUM)) THEN
4033 WE(1)=W1
4034 WE(2)=W2
4035 WE(3)=W3
4036
4037=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%TIR_interface.f'
4038--- 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
4039+++ 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
4040@@ -54,8 +54,8 @@
4041 INTEGER LAST_LIB_USED
4042 DATA LAST_LIB_USED/-1/
4043
4044- COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3),TIRCOEFSERRORS(0:LOOPMAXC
4045- $OEFS-1,3)
4046+ COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3)
4047+ $ ,TIRCOEFSERRORS(0:LOOPMAXCOEFS-1,3)
4048 COMPLEX*16 PJCOEFS(0:LOOPMAXCOEFS-1,3)
4049 C
4050 C EXTERNAL FUNCTIONS
4051@@ -398,8 +398,9 @@
4052 C
4053 INCLUDE 'MadLoopParams.inc'
4054 INCLUDE 'process_info.inc'
4055-C Change the list 'LOOPLIBS_QPAVAILABLE' in loop_matrix_standalone.
4056-C inc to change the list of QPTools availables
4057+C Change the list 'LOOPLIBS_QPAVAILABLE' in
4058+C loop_matrix_standalone.inc to change the list of QPTools
4059+C availables
4060 LOGICAL QP_TOOLS_AVAILABLE
4061 INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)
4062 COMMON/LOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS
4063
4064=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%born_matrix.f'
4065--- 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
4066+++ 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
4067@@ -461,8 +461,8 @@
4068 C BEGIN CODE
4069 C
4070 DO I=1,NSO
4071- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4072- $NDEXB,I)
4073+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4074+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4075 ENDDO
4076 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
4077 END
4078@@ -556,8 +556,8 @@
4079 RETURN
4080 ENDIF
4081
4082- WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'
4083- $ //'DEX'
4084+ WRITE(*,*) 'ERROR:: Stopping function'
4085+ $ //' GET_SQUARED_ORDERS_FOR_SOINDEX'
4086 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
4087 STOP
4088
4089
4090=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%check_sa_born_splitOrders.f'
4091--- 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
4092+++ 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
4093@@ -170,8 +170,8 @@
4094 C CALL SMATRIX(P,MATELEM)
4095 C
4096 C write (*,*) "-------------------------------------------------"
4097-C write (*,*) "Matrix element = ", MATELEM, " GeV^",-(2*nexternal-8)
4098-C
4099+C write (*,*) "Matrix element = ", MATELEM, "
4100+C GeV^",-(2*nexternal-8)
4101 C write (*,*) "-------------------------------------------------"
4102
4103 END
4104
4105=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f'
4106--- 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
4107+++ 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
4108@@ -78,8 +78,8 @@
4109 INTEGER NSQUAREDSOP1
4110 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
4111 C The total number of loop reduction libraries
4112-C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai
4113-C , Ninja and COLLIER
4114+C At present, there are only
4115+C CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
4116 INTEGER NLOOPLIB
4117 PARAMETER (NLOOPLIB=7)
4118 C Only CutTools or possibly Ninja (if installed with qp support)
4119@@ -404,14 +404,15 @@
4120 C reading the parameters
4121 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4122 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4123- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4124- $TATION_CHOICE
4125+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4126+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4127 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION
4128 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
4129- COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_
4130- $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4131- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4132- $CHOICE
4133+ COMMON/COLLIERPOLESFORCEDCHOICE
4134+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4135+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4136+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4137+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4138
4139 C This variable controls the general initialization which is
4140 C *common* between all MadLoop SubProcesses.
4141@@ -880,8 +881,8 @@
4142 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))
4143
4144 CTCALL_REQ_SO_DONE=.FALSE.
4145- FILTER_SO = (.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.(SQSO_TARG
4146- $ET.NE.-1)
4147+ FILTER_SO = (.NOT.CHECKPHASE)
4148+ $ .AND.HELDOUBLECHECKED.AND.(SQSO_TARGET.NE.-1)
4149
4150 DO I=1,NLOOPGROUPS
4151 DO J=0,LOOPMAXCOEFS-1
4152@@ -920,13 +921,14 @@
4153 ENDIF
4154
4155 DO H=1,NCOMB
4156- IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(
4157- $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)
4158- $ .NE.0)))) THEN
4159+ IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
4160+ $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
4161+ $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
4162
4163 C Handle the possible requirement of specific polarizations
4164- IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(
4165- $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4166+ IF ((.NOT.CHECKPHASE)
4167+ $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
4168+ $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4169 CYCLE
4170 ENDIF
4171
4172@@ -1164,8 +1166,8 @@
4173 C Of course if it is one, then we do not need to do
4174 C anything (because with HELINITSTARTOVER=.FALSE. we only
4175 C support exactly identical Hels.)
4176- IF(GOODHEL(HELPICKED).GT.-HELOFFSET.AND.GOODHEL(HELPICKED)
4177- $ .NE.1) THEN
4178+ IF(GOODHEL(HELPICKED).GT.
4179+ $ -HELOFFSET.AND.GOODHEL(HELPICKED).NE.1) THEN
4180 NEWHELREF=-1
4181 DO H=1,NCOMB
4182 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN
4183@@ -1359,16 +1361,18 @@
4184
4185 CTMODE=BASIC_CT_MODE
4186
4187- IF(.NOT.EVAL_DONE(3).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE
4188- $.1).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
4189+ IF(.NOT.EVAL_DONE(3).AND.
4190+ $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.1)
4191+ $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
4192 EVAL_DONE(3)=.TRUE.
4193 CALL ROTATE_PS(PS,P,1)
4194 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,1)
4195 GOTO 200
4196 ENDIF
4197
4198- IF(.NOT.EVAL_DONE(4).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE
4199- $.2).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
4200+ IF(.NOT.EVAL_DONE(4).AND.
4201+ $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.2)
4202+ $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
4203 EVAL_DONE(4)=.TRUE.
4204 CALL ROTATE_PS(PS,P,2)
4205 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,2)
4206@@ -1924,8 +1928,8 @@
4207 C When using COLLIER with the internal stability test, the first
4208 C evaluation is typically more reliable so we do not want to
4209 C use the average but rather the first evaluation.
4210- IF (MLREDUCTIONLIB(I_LIB).EQ.7.AND.COLLIERUSEINTERNALSTABILITYT
4211- $EST) THEN
4212+ IF (MLREDUCTIONLIB(I_LIB)
4213+ $ .EQ.7.AND.COLLIERUSEINTERNALSTABILITYTEST) THEN
4214 DO I=1,3
4215 ESTIMATE(I,K) = FULLLIST(I,K,1)
4216 ENDDO
4217@@ -2070,8 +2074,8 @@
4218 1009 CONTINUE
4219 ENDDO
4220
4221- WRITE(*,*) 'ERROR:: Stopping function ML5SOINDEX_FOR_SQUARED_ORDE'
4222- $ //'RS'
4223+ WRITE(*,*) 'ERROR:: Stopping function'
4224+ $ //' ML5SOINDEX_FOR_SQUARED_ORDERS'
4225 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)
4226 STOP
4227
4228@@ -2170,8 +2174,8 @@
4229 C BEGIN CODE
4230 C
4231 DO I=1,NSO
4232- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4233- $NDEXB,I)
4234+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4235+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4236 ENDDO
4237 ML5SQSOINDEX=ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
4238 END
4239@@ -2209,8 +2213,8 @@
4240 RETURN
4241 ENDIF
4242
4243- WRITE(*,*) 'ERROR:: Stopping function ML5GET_SQUARED_ORDERS_FOR_S'
4244- $ //'OINDEX'
4245+ WRITE(*,*) 'ERROR:: Stopping function'
4246+ $ //' ML5GET_SQUARED_ORDERS_FOR_SOINDEX'
4247 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
4248 STOP
4249
4250@@ -2249,8 +2253,8 @@
4251 RETURN
4252 ENDIF
4253
4254- WRITE(*,*) 'ERROR:: Stopping function ML5GET_ORDERS_FOR_AMPSOINDE'
4255- $ //'X'
4256+ WRITE(*,*) 'ERROR:: Stopping function'
4257+ $ //' ML5GET_ORDERS_FOR_AMPSOINDEX'
4258 WRITE(*,*) 'Could not find amplitude split orders index ',SOINDEX
4259 STOP
4260
4261@@ -2315,12 +2319,13 @@
4262
4263 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4264 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4265- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4266- $TATION_CHOICE
4267- COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_
4268- $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4269- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4270- $CHOICE
4271+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4272+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4273+ COMMON/COLLIERPOLESFORCEDCHOICE
4274+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4275+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4276+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4277+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4278
4279 COLLIERCOMPUTEUVPOLES = ONOFF
4280 C This is just so that if we read the param again, we don't
4281@@ -2342,12 +2347,13 @@
4282
4283 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4284 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4285- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4286- $TATION_CHOICE
4287- COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_
4288- $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4289- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4290- $CHOICE
4291+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4292+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4293+ COMMON/COLLIERPOLESFORCEDCHOICE
4294+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4295+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4296+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4297+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4298
4299 COLLIERCOMPUTEIRPOLES = ONOFF
4300 C This is just so that if we read the param again, we don't
4301
4302=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%mp_compute_loop_coefs.f'
4303--- 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
4304+++ 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
4305@@ -268,13 +268,14 @@
4306
4307 DPW_COPIED = .FALSE.
4308 DO H=1,NCOMB
4309- IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(
4310- $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)
4311- $ .NE.0)))) THEN
4312+ IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
4313+ $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
4314+ $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
4315
4316 C Handle the possible requirement of specific polarizations
4317- IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(
4318- $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4319+ IF ((.NOT.CHECKPHASE)
4320+ $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
4321+ $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4322 CYCLE
4323 ENDIF
4324
4325
4326=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f'
4327--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f 2016-04-06 18:45:52 +0000
4328+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%polynomial.f 2020-06-21 12:17:46 +0000
4329@@ -113,8 +113,8 @@
4330 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
4331 $ ,KIND=8)
4332 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
4333- CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP
4334- $(I))+CFTOT*CONJG(AMP(I))
4335+ CONST(ML5SOINDEX_FOR_BORN_AMP(I))
4336+ $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
4337 ENDDO
4338
4339 DO I=1,NAMPSO
4340@@ -232,8 +232,8 @@
4341 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
4342 $ ,KIND=16)
4343 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
4344- CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP
4345- $(I))+CFTOT*CONJG(AMP(I))
4346+ CONST(ML5SOINDEX_FOR_BORN_AMP(I))
4347+ $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
4348 ENDDO
4349
4350 DO I=1,NAMPSO
4351
4352=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%COLLIER_interface.f'
4353--- 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
4354+++ 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
4355@@ -164,8 +164,9 @@
4356 IF (NCALLS_IN_CACHE(I).NE.-1.AND..NOT. ( NCOLLIERCALLS(I)
4357 $ .EQ.NCALLS_IN_CACHE(I).OR. ( CTMODERUN.EQ.
4358 $ -1.AND..NOT.COLLIERUSEINTERNALSTABILITYTEST.AND.NROTATIONS
4359- $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2).EQ.0.AND.(NCALLS_IN_CACHE(
4360- $I)/2).EQ.NCOLLIERCALLS(I) ) ) ) THEN
4361+ $_DP.GT.0.AND.MOD(NCALLS_IN_CACHE(I),2)
4362+ $ .EQ.0.AND.(NCALLS_IN_CACHE(I)/2).EQ.NCOLLIERCALLS(I) ) ) )
4363+ $ THEN
4364 WRITE(*,*) 'WARNING: A consistency check in MadLoop'
4365 $ //' failed and, for safety, forced MadLoop to'
4366 $ //' reinitialize the global cache of COLLIER. Report'
4367@@ -256,8 +257,8 @@
4368 C The expression below is like taking the absolute value
4369 C when summing errors linearly
4370 C TIRCOEFSERRORS(I,K)=(TIR_COEFS_ERROR(CURR_RANK,ID)/MaxC
4371-C oefForRank(CURR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K)))
4372-C ,ABS(DIMAG(TIRCOEFS(I,K))) )
4373+C oefForRank(CURR_RANK))*DCMPLX(
4374+C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
4375 C But empirically, I observed that retaining the
4376 C original complex phase leads to slightly more
4377 C accurate estimates
4378@@ -479,8 +480,8 @@
4379 C The expression below is like taking the absolute value
4380 C when summing errors linearly
4381 C TIRCOEFSERRORS(I,K)=(TNtenerr(CURR_RANK)/MaxCoefForRank(C
4382-C URR_RANK))*DCMPLX( ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIR
4383-C COEFS(I,K))) )
4384+C URR_RANK))*DCMPLX(
4385+C ABS(DBLE(TIRCOEFS(I,K))),ABS(DIMAG(TIRCOEFS(I,K))) )
4386 C But empirically, I observed that retaining the original
4387 C complex phase leads to slightly more accurate estimates
4388 TIRCOEFSERRORS(I,K)=(TNTENERR(CURR_RANK)
4389@@ -592,8 +593,8 @@
4390
4391 C The common blocks below are to retrieve the necessary
4392 C information about
4393-C MadLoop running mode and store it in the sCOLLIER_CACHE_RELEVANT_
4394-C PARAMS common block.
4395+C MadLoop running mode and store it in the
4396+C sCOLLIER_CACHE_RELEVANT_PARAMS common block.
4397
4398 INCLUDE 'MadLoopParams.inc'
4399 INCLUDE 'unique_id.inc'
4400@@ -662,8 +663,8 @@
4401 USERHEL_BU = USERHEL
4402 SQSO_TARGET_BU = SQSO_TARGET
4403 COLLIERMODE_BU = COLLIERMODE
4404- COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT
4405- $YTEST
4406+ COLLIERUSEINTERNALSTABILITYTEST_BU =
4407+ $ COLLIERUSEINTERNALSTABILITYTEST
4408 CTMODERUN_BU = CTMODERUN
4409 CALL SWITCHONCACHE_CLL((UNIQUE_ID-1)*4+1)
4410 COLLIER_CACHE_ACTIVE = 1
4411@@ -710,8 +711,8 @@
4412 USERHEL_BU = USERHEL
4413 SQSO_TARGET_BU = SQSO_TARGET
4414 COLLIERMODE_BU = COLLIERMODE
4415- COLLIERUSEINTERNALSTABILITYTEST_BU = COLLIERUSEINTERNALSTABILIT
4416- $YTEST
4417+ COLLIERUSEINTERNALSTABILITYTEST_BU =
4418+ $ COLLIERUSEINTERNALSTABILITYTEST
4419 CTMODERUN_BU = CTMODERUN
4420 IF (COLLIERGLOBALCACHE.EQ.-1) THEN
4421 CALL INITCACHESYSTEM_CLL(N_CACHES*NPROCS,MAXNEXTERNAL)
4422
4423=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%CT_interface.f'
4424--- 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
4425+++ 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
4426@@ -663,8 +663,8 @@
4427 C Determine it uses qp or not
4428 DOING_QP = (CTMODE.GE.4)
4429
4430- IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.GOODAMP(SQUAREDSOIND
4431- $EX,LOOPNUM)) THEN
4432+ IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED)
4433+ $ .OR.GOODAMP(SQUAREDSOINDEX,LOOPNUM)) THEN
4434 WE(1)=W1
4435 WE(2)=W2
4436 WE(3)=W3
4437
4438=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%TIR_interface.f'
4439--- 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
4440+++ 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
4441@@ -54,8 +54,8 @@
4442 INTEGER LAST_LIB_USED
4443 DATA LAST_LIB_USED/-1/
4444
4445- COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3),TIRCOEFSERRORS(0:LOOPMAXC
4446- $OEFS-1,3)
4447+ COMPLEX*16 TIRCOEFS(0:LOOPMAXCOEFS-1,3)
4448+ $ ,TIRCOEFSERRORS(0:LOOPMAXCOEFS-1,3)
4449 COMPLEX*16 PJCOEFS(0:LOOPMAXCOEFS-1,3)
4450 C
4451 C EXTERNAL FUNCTIONS
4452@@ -398,8 +398,9 @@
4453 C
4454 INCLUDE 'MadLoopParams.inc'
4455 INCLUDE 'process_info.inc'
4456-C Change the list 'LOOPLIBS_QPAVAILABLE' in loop_matrix_standalone.
4457-C inc to change the list of QPTools availables
4458+C Change the list 'LOOPLIBS_QPAVAILABLE' in
4459+C loop_matrix_standalone.inc to change the list of QPTools
4460+C availables
4461 LOGICAL QP_TOOLS_AVAILABLE
4462 INTEGER INDEX_QP_TOOLS(QP_NLOOPLIB+1)
4463 COMMON/LOOP_TOOLS/QP_TOOLS_AVAILABLE,INDEX_QP_TOOLS
4464
4465=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%born_matrix.f'
4466--- 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
4467+++ 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
4468@@ -461,8 +461,8 @@
4469 C BEGIN CODE
4470 C
4471 DO I=1,NSO
4472- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4473- $NDEXB,I)
4474+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4475+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4476 ENDDO
4477 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
4478 END
4479@@ -556,8 +556,8 @@
4480 RETURN
4481 ENDIF
4482
4483- WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'
4484- $ //'DEX'
4485+ WRITE(*,*) 'ERROR:: Stopping function'
4486+ $ //' GET_SQUARED_ORDERS_FOR_SOINDEX'
4487 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
4488 STOP
4489
4490
4491=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%check_sa_born_splitOrders.f'
4492--- 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
4493+++ 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
4494@@ -170,8 +170,8 @@
4495 C CALL SMATRIX(P,MATELEM)
4496 C
4497 C write (*,*) "-------------------------------------------------"
4498-C write (*,*) "Matrix element = ", MATELEM, " GeV^",-(2*nexternal-8)
4499-C
4500+C write (*,*) "Matrix element = ", MATELEM, "
4501+C GeV^",-(2*nexternal-8)
4502 C write (*,*) "-------------------------------------------------"
4503
4504 END
4505
4506=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f'
4507--- 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
4508+++ 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
4509@@ -78,8 +78,8 @@
4510 INTEGER NSQUAREDSOP1
4511 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
4512 C The total number of loop reduction libraries
4513-C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai
4514-C , Ninja and COLLIER
4515+C At present, there are only
4516+C CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
4517 INTEGER NLOOPLIB
4518 PARAMETER (NLOOPLIB=7)
4519 C Only CutTools or possibly Ninja (if installed with qp support)
4520@@ -404,14 +404,15 @@
4521 C reading the parameters
4522 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4523 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4524- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4525- $TATION_CHOICE
4526+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4527+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4528 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION
4529 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
4530- COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_
4531- $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4532- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4533- $CHOICE
4534+ COMMON/COLLIERPOLESFORCEDCHOICE
4535+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4536+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4537+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4538+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4539
4540 C This variable controls the general initialization which is
4541 C *common* between all MadLoop SubProcesses.
4542@@ -880,8 +881,8 @@
4543 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))
4544
4545 CTCALL_REQ_SO_DONE=.FALSE.
4546- FILTER_SO = (.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.(SQSO_TARG
4547- $ET.NE.-1)
4548+ FILTER_SO = (.NOT.CHECKPHASE)
4549+ $ .AND.HELDOUBLECHECKED.AND.(SQSO_TARGET.NE.-1)
4550
4551 DO I=1,NLOOPGROUPS
4552 DO J=0,LOOPMAXCOEFS-1
4553@@ -920,13 +921,14 @@
4554 ENDIF
4555
4556 DO H=1,NCOMB
4557- IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(
4558- $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)
4559- $ .NE.0)))) THEN
4560+ IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
4561+ $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
4562+ $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
4563
4564 C Handle the possible requirement of specific polarizations
4565- IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(
4566- $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4567+ IF ((.NOT.CHECKPHASE)
4568+ $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
4569+ $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4570 CYCLE
4571 ENDIF
4572
4573@@ -1164,8 +1166,8 @@
4574 C Of course if it is one, then we do not need to do
4575 C anything (because with HELINITSTARTOVER=.FALSE. we only
4576 C support exactly identical Hels.)
4577- IF(GOODHEL(HELPICKED).GT.-HELOFFSET.AND.GOODHEL(HELPICKED)
4578- $ .NE.1) THEN
4579+ IF(GOODHEL(HELPICKED).GT.
4580+ $ -HELOFFSET.AND.GOODHEL(HELPICKED).NE.1) THEN
4581 NEWHELREF=-1
4582 DO H=1,NCOMB
4583 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN
4584@@ -1359,16 +1361,18 @@
4585
4586 CTMODE=BASIC_CT_MODE
4587
4588- IF(.NOT.EVAL_DONE(3).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE
4589- $.1).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
4590+ IF(.NOT.EVAL_DONE(3).AND.
4591+ $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.1)
4592+ $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
4593 EVAL_DONE(3)=.TRUE.
4594 CALL ROTATE_PS(PS,P,1)
4595 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,1)
4596 GOTO 200
4597 ENDIF
4598
4599- IF(.NOT.EVAL_DONE(4).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE
4600- $.2).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
4601+ IF(.NOT.EVAL_DONE(4).AND.
4602+ $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.2)
4603+ $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
4604 EVAL_DONE(4)=.TRUE.
4605 CALL ROTATE_PS(PS,P,2)
4606 IF (DOING_QP_EVALS) CALL MP_ROTATE_PS(MP_PS,MP_P,2)
4607@@ -1924,8 +1928,8 @@
4608 C When using COLLIER with the internal stability test, the first
4609 C evaluation is typically more reliable so we do not want to
4610 C use the average but rather the first evaluation.
4611- IF (MLREDUCTIONLIB(I_LIB).EQ.7.AND.COLLIERUSEINTERNALSTABILITYT
4612- $EST) THEN
4613+ IF (MLREDUCTIONLIB(I_LIB)
4614+ $ .EQ.7.AND.COLLIERUSEINTERNALSTABILITYTEST) THEN
4615 DO I=1,3
4616 ESTIMATE(I,K) = FULLLIST(I,K,1)
4617 ENDDO
4618@@ -2070,8 +2074,8 @@
4619 1009 CONTINUE
4620 ENDDO
4621
4622- WRITE(*,*) 'ERROR:: Stopping function ML5SOINDEX_FOR_SQUARED_ORDE'
4623- $ //'RS'
4624+ WRITE(*,*) 'ERROR:: Stopping function'
4625+ $ //' ML5SOINDEX_FOR_SQUARED_ORDERS'
4626 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)
4627 STOP
4628
4629@@ -2170,8 +2174,8 @@
4630 C BEGIN CODE
4631 C
4632 DO I=1,NSO
4633- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4634- $NDEXB,I)
4635+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4636+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4637 ENDDO
4638 ML5SQSOINDEX=ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
4639 END
4640@@ -2209,8 +2213,8 @@
4641 RETURN
4642 ENDIF
4643
4644- WRITE(*,*) 'ERROR:: Stopping function ML5GET_SQUARED_ORDERS_FOR_S'
4645- $ //'OINDEX'
4646+ WRITE(*,*) 'ERROR:: Stopping function'
4647+ $ //' ML5GET_SQUARED_ORDERS_FOR_SOINDEX'
4648 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
4649 STOP
4650
4651@@ -2249,8 +2253,8 @@
4652 RETURN
4653 ENDIF
4654
4655- WRITE(*,*) 'ERROR:: Stopping function ML5GET_ORDERS_FOR_AMPSOINDE'
4656- $ //'X'
4657+ WRITE(*,*) 'ERROR:: Stopping function'
4658+ $ //' ML5GET_ORDERS_FOR_AMPSOINDEX'
4659 WRITE(*,*) 'Could not find amplitude split orders index ',SOINDEX
4660 STOP
4661
4662@@ -2315,12 +2319,13 @@
4663
4664 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4665 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4666- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4667- $TATION_CHOICE
4668- COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_
4669- $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4670- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4671- $CHOICE
4672+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4673+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4674+ COMMON/COLLIERPOLESFORCEDCHOICE
4675+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4676+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4677+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4678+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4679
4680 COLLIERCOMPUTEUVPOLES = ONOFF
4681 C This is just so that if we read the param again, we don't
4682@@ -2342,12 +2347,13 @@
4683
4684 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4685 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4686- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4687- $TATION_CHOICE
4688- COMMON/COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV_POLE_
4689- $COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4690- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4691- $CHOICE
4692+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4693+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4694+ COMMON/COLLIERPOLESFORCEDCHOICE
4695+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4696+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4697+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4698+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4699
4700 COLLIERCOMPUTEIRPOLES = ONOFF
4701 C This is just so that if we read the param again, we don't
4702
4703=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%mp_compute_loop_coefs.f'
4704--- 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
4705+++ 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
4706@@ -268,13 +268,14 @@
4707
4708 DPW_COPIED = .FALSE.
4709 DO H=1,NCOMB
4710- IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(
4711- $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)
4712- $ .NE.0)))) THEN
4713+ IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
4714+ $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
4715+ $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
4716
4717 C Handle the possible requirement of specific polarizations
4718- IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(
4719- $0,0).EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4720+ IF ((.NOT.CHECKPHASE)
4721+ $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
4722+ $ .EQ.0.AND.(.NOT.IS_HEL_SELECTED(H))) THEN
4723 CYCLE
4724 ENDIF
4725
4726
4727=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f'
4728--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f 2016-04-06 18:45:52 +0000
4729+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%polynomial.f 2020-06-21 12:17:46 +0000
4730@@ -113,8 +113,8 @@
4731 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
4732 $ ,KIND=8)
4733 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
4734- CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP
4735- $(I))+CFTOT*CONJG(AMP(I))
4736+ CONST(ML5SOINDEX_FOR_BORN_AMP(I))
4737+ $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
4738 ENDDO
4739
4740 DO I=1,NAMPSO
4741@@ -232,8 +232,8 @@
4742 CFTOT=CMPLX(CF_N(COLOR_ID,I)/(ONE*ABS(CF_D(COLOR_ID,I))),ZERO
4743 $ ,KIND=16)
4744 IF(CF_D(COLOR_ID,I).LT.0) CFTOT=CFTOT*IMAG1
4745- CONST(ML5SOINDEX_FOR_BORN_AMP(I))=CONST(ML5SOINDEX_FOR_BORN_AMP
4746- $(I))+CFTOT*CONJG(AMP(I))
4747+ CONST(ML5SOINDEX_FOR_BORN_AMP(I))
4748+ $ =CONST(ML5SOINDEX_FOR_BORN_AMP(I))+CFTOT*CONJG(AMP(I))
4749 ENDDO
4750
4751 DO I=1,NAMPSO
4752
4753=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f'
4754--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2019-09-26 11:09:58 +0000
4755+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2020-06-21 12:17:46 +0000
4756@@ -142,11 +142,13 @@
4757
4758 ! If the helicity grid status is 0, this means that it is not yet initialized.
4759 ! If HEL_PICKED==-1, this means that calls to other matrix<i> where in initialization mode as well for the helicity.
4760- IF ((ISHEL(IMIRROR).EQ.0.AND.ISUM_HEL.EQ.0).OR.(DS_GET_DIM_STATUS
4761- $('Helicity').EQ.0).OR.(HEL_PICKED.EQ.-1)) THEN
4762+ IF ((ISHEL(IMIRROR).EQ.0.AND.ISUM_HEL.EQ.0)
4763+ $ .OR.(DS_GET_DIM_STATUS('Helicity').EQ.0).OR.(HEL_PICKED.EQ.-1))
4764+ $ THEN
4765 DO I=1,NCOMB
4766- IF (GOODHEL(I,IMIRROR) .OR. NTRY(IMIRROR).LE.MAXTRIES.OR.(ISU
4767- $M_HEL.NE.0).OR.THIS_NTRY(IMIRROR).LE.2) THEN
4768+ IF (GOODHEL(I,IMIRROR) .OR. NTRY(IMIRROR)
4769+ $ .LE.MAXTRIES.OR.(ISUM_HEL.NE.0).OR.THIS_NTRY(IMIRROR).LE.2)
4770+ $ THEN
4771 T=MATRIX1(P ,NHEL(1,I),JC(1))
4772 DO JJ=1,NINCOMING
4773 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))
4774@@ -174,8 +176,8 @@
4775 HEL_JACOBIAN = 1.0D0
4776 ! 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.
4777 REF_HELICITY_GRID = DS_GET_DIMENSION(REF_GRID,'Helicity')
4778- IF((DS_GET_DIM_STATUS('Helicity').EQ.1).AND.(REF_HELICITY_GRI
4779- $D%%N_TOT_ENTRIES.EQ.0)) THEN
4780+ IF((DS_GET_DIM_STATUS('Helicity').EQ.1)
4781+ $ .AND.(REF_HELICITY_GRID%%N_TOT_ENTRIES.EQ.0)) THEN
4782 ! If we finished the initialization we can update the grid so as to start sampling over it.
4783 ! 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.
4784 CALL DS_UPDATE_GRID('Helicity')
4785@@ -436,8 +438,8 @@
4786 C BEGIN CODE
4787 C
4788 DO I=1,NSO
4789- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4790- $NDEXB,I)
4791+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4792+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4793 ENDDO
4794 SQSOINDEX1=SOINDEX_FOR_SQUARED_ORDERS1(SQORDERS)
4795 END
4796@@ -531,8 +533,8 @@
4797 RETURN
4798 ENDIF
4799
4800- WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'
4801- $ //'DEX1'
4802+ WRITE(*,*) 'ERROR:: Stopping function'
4803+ $ //' GET_SQUARED_ORDERS_FOR_SOINDEX1'
4804 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
4805 STOP
4806
4807
4808=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f'
4809--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2019-09-26 11:09:58 +0000
4810+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2020-06-21 12:17:46 +0000
4811@@ -387,8 +387,8 @@
4812 C BEGIN CODE
4813 C
4814 DO I=1,NSO
4815- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4816- $NDEXB,I)
4817+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4818+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4819 ENDDO
4820 SQSOINDEX=SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
4821 END
4822@@ -482,8 +482,8 @@
4823 RETURN
4824 ENDIF
4825
4826- WRITE(*,*) 'ERROR:: Stopping function GET_SQUARED_ORDERS_FOR_SOIN'
4827- $ //'DEX'
4828+ WRITE(*,*) 'ERROR:: Stopping function'
4829+ $ //' GET_SQUARED_ORDERS_FOR_SOINDEX'
4830 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
4831 STOP
4832
4833
4834=== modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f'
4835--- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f 2018-05-25 09:13:24 +0000
4836+++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f 2020-06-21 12:17:46 +0000
4837@@ -83,8 +83,8 @@
4838 INTEGER NSQUAREDSOP1
4839 PARAMETER (NSQUAREDSOP1=NSQUAREDSO+1)
4840 C The total number of loop reduction libraries
4841-C At present, there are only CutTools,PJFry++,IREGI,Golem95,Samurai
4842-C , Ninja and COLLIER
4843+C At present, there are only
4844+C CutTools,PJFry++,IREGI,Golem95,Samurai, Ninja and COLLIER
4845 INTEGER NLOOPLIB
4846 PARAMETER (NLOOPLIB=7)
4847 C Only CutTools or possibly Ninja (if installed with qp support)
4848@@ -411,14 +411,15 @@
4849 C reading the parameters
4850 LOGICAL FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4851 $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4852- LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE, COLLIER_IR_POLE_COMPU
4853- $TATION_CHOICE
4854+ LOGICAL COLLIER_UV_POLE_COMPUTATION_CHOICE,
4855+ $ COLLIER_IR_POLE_COMPUTATION_CHOICE
4856 DATA FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION
4857 $ ,FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION/.FALSE.,.FALSE./
4858- COMMON/ML5_0_COLLIERPOLESFORCEDCHOICE/FORCED_CHOICE_OF_COLLIER_UV
4859- $_POLE_COMPUTATION, FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4860- $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE,COLLIER_IR_POLE_COMPUTATION_
4861- $CHOICE
4862+ COMMON/ML5_0_COLLIERPOLESFORCEDCHOICE
4863+ $ /FORCED_CHOICE_OF_COLLIER_UV_POLE_COMPUTATION,
4864+ $ FORCED_CHOICE_OF_COLLIER_IR_POLE_COMPUTATION
4865+ $ ,COLLIER_UV_POLE_COMPUTATION_CHOICE
4866+ $ ,COLLIER_IR_POLE_COMPUTATION_CHOICE
4867
4868 C This variable controls the general initialization which is
4869 C *common* between all MadLoop SubProcesses.
4870@@ -888,8 +889,8 @@
4871 $ +P(2,2))**2-(P(3,1)+P(3,2))**2))
4872
4873 CTCALL_REQ_SO_DONE=.FALSE.
4874- FILTER_SO = (.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.(SQSO_TARG
4875- $ET.NE.-1)
4876+ FILTER_SO = (.NOT.CHECKPHASE)
4877+ $ .AND.HELDOUBLECHECKED.AND.(SQSO_TARGET.NE.-1)
4878
4879 DO I=1,NLOOPGROUPS
4880 DO J=0,LOOPMAXCOEFS-1
4881@@ -928,13 +929,14 @@
4882 ENDIF
4883
4884 DO H=1,NCOMB
4885- IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1).AND.(CHECKPHASE.OR.(
4886- $.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H).GT.-HELOFFSET.AND.GOODHEL(H)
4887- $ .NE.0)))) THEN
4888+ IF ((HELPICKED.EQ.H).OR.((HELPICKED.EQ.-1)
4889+ $ .AND.(CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.(GOODHEL(H)
4890+ $ .GT.-HELOFFSET.AND.GOODHEL(H).NE.0)))) THEN
4891
4892 C Handle the possible requirement of specific polarizations
4893- IF ((.NOT.CHECKPHASE).AND.HELDOUBLECHECKED.AND.POLARIZATIONS(
4894- $0,0).EQ.0.AND.(.NOT.ML5_0_IS_HEL_SELECTED(H))) THEN
4895+ IF ((.NOT.CHECKPHASE)
4896+ $ .AND.HELDOUBLECHECKED.AND.POLARIZATIONS(0,0)
4897+ $ .EQ.0.AND.(.NOT.ML5_0_IS_HEL_SELECTED(H))) THEN
4898 CYCLE
4899 ENDIF
4900
4901@@ -975,8 +977,9 @@
4902 DO I=1,NCTAMPS
4903 CFTOT=DCMPLX(CF_N(I,J)/DBLE(ABS(CF_D(I,J))),0.0D0)
4904 IF(CF_D(I,J).LT.0) CFTOT=CFTOT*IMAG1
4905- ITEMP = ML5_0_ML5SQSOINDEX(ML5_0_ML5SOINDEX_FOR_LOOP_AMP(
4906- $I),ML5_0_ML5SOINDEX_FOR_BORN_AMP(J))
4907+ ITEMP =
4908+ $ ML5_0_ML5SQSOINDEX(ML5_0_ML5SOINDEX_FOR_LOOP_AMP(I)
4909+ $ ,ML5_0_ML5SOINDEX_FOR_BORN_AMP(J))
4910 IF (.NOT.FILTER_SO.OR.SQSO_TARGET.EQ.ITEMP) THEN
4911 DO K=1,3
4912 TEMP2 = DBLE(CFTOT*AMPL(K,I)*CTEMP)
4913@@ -1102,8 +1105,8 @@
4914 IF((USERHEL.EQ.-1).OR.(USERHEL.EQ.HELPICKED)) THEN
4915 C Make sure that that no polarization constraint filters out
4916 C this helicity
4917- IF (POLARIZATIONS(0,0).EQ.-1.OR.ML5_0_IS_HEL_SELECTED(HELPICK
4918- $ED)) THEN
4919+ IF (POLARIZATIONS(0,0).EQ.
4920+ $ -1.OR.ML5_0_IS_HEL_SELECTED(HELPICKED)) THEN
4921 C TO KEEP TRACK OF THE FINAL ANSWER TO BE RETURNED DURING
4922 C CHECK PHASE
4923 DO I=0,NSQUAREDSO
4924@@ -1194,8 +1197,8 @@
4925 C Of course if it is one, then we do not need to do
4926 C anything (because with HELINITSTARTOVER=.FALSE. we only
4927 C support exactly identical Hels.)
4928- IF(GOODHEL(HELPICKED).GT.-HELOFFSET.AND.GOODHEL(HELPICKED)
4929- $ .NE.1) THEN
4930+ IF(GOODHEL(HELPICKED).GT.
4931+ $ -HELOFFSET.AND.GOODHEL(HELPICKED).NE.1) THEN
4932 NEWHELREF=-1
4933 DO H=1,NCOMB
4934 IF (GOODHEL(H).EQ.(-HELOFFSET-HELPICKED)) THEN
4935@@ -1389,16 +1392,18 @@
4936
4937 CTMODE=BASIC_CT_MODE
4938
4939- IF(.NOT.EVAL_DONE(3).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE
4940- $.1).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
4941+ IF(.NOT.EVAL_DONE(3).AND.
4942+ $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.1)
4943+ $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.1)) ) THEN
4944 EVAL_DONE(3)=.TRUE.
4945 CALL ML5_0_ROTATE_PS(PS,P,1)
4946 IF (DOING_QP_EVALS) CALL ML5_0_MP_ROTATE_PS(MP_PS,MP_P,1)
4947 GOTO 200
4948 ENDIF
4949
4950- IF(.NOT.EVAL_DONE(4).AND. ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE
4951- $.2).OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
4952+ IF(.NOT.EVAL_DONE(4).AND.
4953+ $ ((DOING_QP_EVALS.AND.NROTATIONS_QP.GE.2)
4954+ $ .OR.((.NOT.DOING_QP_EVALS).AND.NROTATIONS_DP.GE.2)) ) THEN
4955 EVAL_DONE(4)=.TRUE.
4956 CALL ML5_0_ROTATE_PS(PS,P,2)
4957 IF (DOING_QP_EVALS) CALL ML5_0_MP_ROTATE_PS(MP_PS,MP_P,2)
4958@@ -1957,8 +1962,8 @@
4959 C When using COLLIER with the internal stability test, the first
4960 C evaluation is typically more reliable so we do not want to
4961 C use the average but rather the first evaluation.
4962- IF (MLREDUCTIONLIB(I_LIB).EQ.7.AND.COLLIERUSEINTERNALSTABILITYT
4963- $EST) THEN
4964+ IF (MLREDUCTIONLIB(I_LIB)
4965+ $ .EQ.7.AND.COLLIERUSEINTERNALSTABILITYTEST) THEN
4966 DO I=1,3
4967 ESTIMATE(I,K) = FULLLIST(I,K,1)
4968 ENDDO
4969@@ -2105,8 +2110,8 @@
4970 1009 CONTINUE
4971 ENDDO
4972
4973- WRITE(*,*) 'ERROR:: Stopping function ML5_0_ML5SOINDEX_FOR_SQUARE'
4974- $ //'D_ORDERS'
4975+ WRITE(*,*) 'ERROR:: Stopping function'
4976+ $ //' ML5_0_ML5SOINDEX_FOR_SQUARED_ORDERS'
4977 WRITE(*,*) 'Could not find squared orders ',(ORDERS(I),I=1,NSO)
4978 STOP
4979
4980@@ -2233,8 +2238,8 @@
4981 C BEGIN CODE
4982 C
4983 DO I=1,NSO
4984- SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)+AMPSPLITORDERS(ORDERI
4985- $NDEXB,I)
4986+ SQORDERS(I)=AMPSPLITORDERS(ORDERINDEXA,I)
4987+ $ +AMPSPLITORDERS(ORDERINDEXB,I)
4988 ENDDO
4989 ML5_0_ML5SQSOINDEX=ML5_0_ML5SOINDEX_FOR_SQUARED_ORDERS(SQORDERS)
4990 END
4991@@ -2273,8 +2278,8 @@
4992 RETURN
4993 ENDIF
4994
4995- WRITE(*,*) 'ERROR:: Stopping function ML5_0_ML5GET_SQUARED_ORDERS'
4996- $ //'_FOR_SOINDEX'
4997+ WRITE(*,*) 'ERROR:: Stopping function'
4998+ $ //' ML5_0_ML5GET_SQUARED_ORDERS_FOR_SOINDEX'
4999 WRITE(*,*) 'Could not find squared orders index ',SOINDEX
5000 STOP
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: