Merge lp:~maddevelopers/mg5amcnlo/unleashed_reweighting into lp:~maddevelopers/mg5amcnlo/2.3.1
- unleashed_reweighting
- Merge into 2.3.1
Status: | Superseded |
---|---|
Proposed branch: | lp:~maddevelopers/mg5amcnlo/unleashed_reweighting |
Merge into: | lp:~maddevelopers/mg5amcnlo/2.3.1 |
Diff against target: |
13068 lines (+2899/-7288) (has conflicts) 74 files modified
Template/Common/Cards/reweight_card_default.dat (+39/-24) Template/NLO/MCatNLO/include/LHEFRead.h (+20/-3) Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f (+73/-9) Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f (+54/-2) Template/NLO/MCatNLO/srcPythia8/Pythia8.cc (+2/-2) Template/NLO/MCatNLO/srcPythia8/Pythia82.cc (+2/-2) Template/loop_material/StandAlone/SubProcesses/makefile (+21/-1) UpdateNotes.txt (+9/-0) madgraph/interface/amcatnlo_run_interface.py (+33/-16) madgraph/interface/common_run_interface.py (+67/-11) madgraph/interface/extended_cmd.py (+1/-1) madgraph/interface/loop_interface.py (+36/-23) madgraph/interface/madevent_interface.py (+8/-53) madgraph/interface/madgraph_interface.py (+4/-6) madgraph/interface/reweight_interface.py (+495/-134) madgraph/iolibs/export_v4.py (+17/-7) madgraph/iolibs/file_writers.py (+5/-1) madgraph/iolibs/template_files/driver_reweight.f (+0/-103) madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc (+12/-12) madgraph/iolibs/template_files/loop_optimized/check_py.f (+112/-0) madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc (+14/-14) madgraph/iolibs/template_files/makefile_sa_f_sp (+15/-2) madgraph/iolibs/template_files/matrix_standalone_v4.inc (+53/-4) madgraph/loop/loop_exporters.py (+7/-2) madgraph/madevent/gen_crossxhtml.py (+6/-2) madgraph/madevent/sum_html.py (+1/-0) madgraph/various/banner.py (+69/-4) madgraph/various/combine_plots.py (+4/-2) madgraph/various/lhe_parser.py (+50/-40) madgraph/various/misc.py (+81/-0) tests/acceptance_tests/test_cmd.py (+34/-8) tests/input_files/IOTestsComparison/ExportV4IOTest/export_matrix_element_v4_standalone/matrix.f (+272/-0) tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f (+272/-0) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f (+21/-14) tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f (+21/-14) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopParamReader.f (+0/-270) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%CT_interface.f (+0/-770) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%GOLEM_interface.f (+0/-834) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%TIR_interface.f (+0/-463) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f (+0/-514) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%check_sa_born_splitOrders.f (+0/-524) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%improve_ps.f (+0/-989) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_num.f (+0/-131) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%mp_compute_loop_coefs.f (+0/-882) tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%polynomial.f (+0/-861) tests/input_files/IOTestsComparison/SquaredOrder_IOTest/sqso_uux_uuxuuxx/matrix_NoSQSO.f (+50/-2) tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%TIR_interface.f (+3/-11) tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f (+25/-14) tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f (+16/-15) tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f (+16/-15) tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f (+21/-14) tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f (+21/-14) tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f (+16/-15) tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f (+16/-15) tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f (+16/-15) tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f (+21/-14) tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f (+52/-4) tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f (+21/-14) tests/time_db (+170/-18) tests/unit_tests/interface/test_madevent.py (+1/-1) tests/unit_tests/iolibs/test_export_v4.py (+14/-241) Text conflict in tests/acceptance_tests/test_cmd.py Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f Text conflict in tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f Contents conflict in tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f Contents conflict in tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%check_sa.f Contents conflict in tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f Text conflict in tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f Text conflict in tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f Text conflict in tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f Text conflict in tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f Text conflict in tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f Text conflict in tests/time_db |
To merge this branch: | bzr merge lp:~maddevelopers/mg5amcnlo/unleashed_reweighting |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Valentin Hirschi | Needs Fixing | ||
Olivier Mattelaer | Abstain | ||
Rikkert Frederix | Pending | ||
Review via email: mp+261735@code.launchpad.net |
This proposal has been superseded by a proposal from 2015-07-24.
Commit message
Description of the change
This contains all the modifications for the LO reweighting including
1) the possibility to change model at LO
2) the possibility to change the process definition at LO
3) the possibility to use Loop-induced definition for the process
4) the kamikaze reweighting
This introduces a new way to interface python and fortran which do not require to have a lot of running executables/ open files for communication.
This method is based on the f2py program which is part of numpy.
Therefore you need to check that you have numpy install (on mac easy-install numpy) in order to run this package.
Cheers,
Olivier
Olivier Mattelaer (olivier-mattelaer) : | # |
Valentin Hirschi (valentin-hirschi) wrote : | # |
- 327. By Olivier Mattelaer
-
Improve the code following the suggestion of Valentin
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
HI Valentin,
Thanks a lot for your comment.
That’s what I call a good review.
> A1) What does this question really imply when launching the process?
>
> 5 Add weight to events based on coupling parameters reweight=OFF
>
> I thought that you were multiplying/
You are correct this is multiplying/
This nomenclature is mainly to distinguish from SysCalc type of reweighing.
> I see the xml tag ‘<mgrwt>' added when turning this on, what is it used for?
je ne vois pas ce tag pour des events NLO. @LO, c’est le tag pour SysCalc. Donc rien a voir avec cette branche.
> A2) What is the status of the parrallelization? In the code it says that it’s unstable, but is it still the case with f2py?
The parrallelization needs to be handle in a completely different way for f2py. The first problem is the JIL that I’m not sure how he is going to handle f2py.
if it consider it as a standard python function, then we are basically in trouble. So it is not going to work.
> A3) What about adding the possibility of an ‘unweight <filename>' command to the reweight_card.dat to allow the user to decide to create a new event file with only the unweighted events corresponding to the new hypothesis?
The options exists to create a new weighted sample. (the command is “change output 2")
> A4) How is the indicative error computed?
This has two part:
1) the original statistical error (rescale by the ratio of the cross-section).
2) a component proportional to the variance of the weight factor (variance/
I combine those linearly.
> B1) Debug left at [common_
removed
> B2) INFO: storring files of Previous run -> INFO: Storing files of previous run
> INFO: Do remember that the reweighting -> INFO: Remember that the reweighting
thanks.
> change model loop_sm
> change process g g > h [virt=QCD]
> launch
> /Users/
>
> and it crashed in a weird way telling me that the param_card I used was identical to the older one.
for me it crash with the expected message:
Command "generate_events run_01" interrupted with error:
InvalidCmd : NLO processes can’t be reweight (for Loop induced reweighting use [sqrvirt =])
> But even then it crashed because the file:
> “template_
file added
> Even then, I would put a warning and let the code go on with the same card because it is a good check to make sure that with an identical card one recovers the same result, and users might want to do this to get confidence in the tool.
Ok, good point.
> B4) I tried NLO reweighting for p p > e+ ve [QCD] by changing the irrelevant top Yukawa with
> set ymt 200.0
> and it first crashed because my f2py is called f2py-2.7. The crash was not helpful to the lambda user:
ok now I run with the first of those three:
f2py, f2p...
- 328. By Olivier Mattelaer
-
additional change after skype comment with Valentin
Olivier Mattelaer (olivier-mattelaer) wrote : | # |
Hi Valentin,
I have added the two point that we speak about yesterday.
Cheers,
Olivier
- 329. By Olivier Mattelaer
-
merge with latest 2.3.2
- 330. By Olivier Mattelaer
-
remove border effect linked to f2py
- 331. By Olivier Mattelaer
-
fix small bugs
- 332. By Olivier Mattelaer
-
implement gridpack mode (similar to the MS one)
- 333. By Olivier Mattelaer
-
try to force the fortran compiler for f2py
- 334. By Olivier Mattelaer
-
add security for matrix3 if the simple replacement rule do not work
- 335. By Olivier Mattelaer
-
forcing the compilation to go trough
- 336. By Olivier Mattelaer
-
correct the default output type for [virt=QCD]
- 337. By Frederix <email address hidden>
-
changed the comments in the default reweight_card.dat
- 338. By Olivier Mattelaer
-
fixing the import of matrix3 on linux/change the line in the question interface
- 339. By Olivier Mattelaer
-
review of Rik
- 340. By Olivier Mattelaer
-
add launch automatically if found a path or 'set' command
- 341. By Olivier Mattelaer
-
allow f2py to be specify via the configuration file
- 342. By Olivier Mattelaer
-
make sure that if "-p -R" are use simulataneously it works
- 343. By Olivier Mattelaer
-
fix small bug in the question (option 5) was not supported anymore
- 344. By Olivier Mattelaer
-
fixing the output of ML standalone --problem with the compiler change
- 345. By Olivier Mattelaer
-
merge with latest 2.3.2
- 346. By Olivier Mattelaer
-
add entry in the update note
Unmerged revisions
- 346. By Olivier Mattelaer
-
add entry in the update note
- 345. By Olivier Mattelaer
-
merge with latest 2.3.2
- 344. By Olivier Mattelaer
-
fixing the output of ML standalone --problem with the compiler change
- 343. By Olivier Mattelaer
-
fix small bug in the question (option 5) was not supported anymore
- 342. By Olivier Mattelaer
-
make sure that if "-p -R" are use simulataneously it works
- 341. By Olivier Mattelaer
-
allow f2py to be specify via the configuration file
- 340. By Olivier Mattelaer
-
add launch automatically if found a path or 'set' command
- 339. By Olivier Mattelaer
-
review of Rik
- 338. By Olivier Mattelaer
-
fixing the import of matrix3 on linux/change the line in the question interface
- 337. By Frederix <email address hidden>
-
changed the comments in the default reweight_card.dat
Preview Diff
1 | === renamed file 'Template/LO/Cards/reweight_card_default.dat' => 'Template/Common/Cards/reweight_card_default.dat' |
2 | --- Template/LO/Cards/reweight_card_default.dat 2013-11-15 12:29:09 +0000 |
3 | +++ Template/Common/Cards/reweight_card_default.dat 2015-07-24 15:59:43 +0000 |
4 | @@ -1,25 +1,40 @@ |
5 | -#****************************************************************** |
6 | -# Reweight Module * |
7 | -#****************************************************************** |
8 | +#************************************************************************* |
9 | +# Reweight Module * |
10 | +#************************************************************************* |
11 | +# |
12 | +# Reweighting by Leading order (Tree level / loop-induced) |
13 | +# element |
14 | +# This is not (in general) NLO accurate |
15 | +# |
16 | +# Note: |
17 | +# 1) the value of alphas will be used from the event |
18 | +# so the value of the param_card is not taken into account. |
19 | +# 2) It is (in general) dangerous/wrong to change a particle's mass. |
20 | +# |
21 | +# Possible options: |
22 | +# You can enter one of the following line to customize the re-weighting |
23 | +# procedure |
24 | +# |
25 | +# change model NAME : use another model for the re-weighted matrix-element |
26 | +# In that case you need to provide the path to a correct param_card |
27 | +# change process DEF [-add]: change the process by which you re-weighted. |
28 | +# All the initial/final state of the original process needs to be |
29 | +# defined. |
30 | +# change helicity False: Make the reweighting by full matrix-element and |
31 | +# not by the one of the associate helicity |
32 | +# |
33 | +# Example of (standard) code -computing two weights: |
34 | +# |
35 | +# launch ! tag to start one computation of weight |
36 | +# set BLOCKNAME ID VALUE ! rule to modity the param_card |
37 | +# set BLOCKNAME ID VALUE ! rule to modity the param_card |
38 | +# launch ! start to compute a second weight |
39 | +# /home/Cards/param_card_2.dat ! you can also enter a path to a valid card |
40 | +# |
41 | +#************************************************************************* |
42 | +# ENTER YOUR COMMAND BELOW. |
43 | +#************************************************************************* |
44 | + |
45 | launch |
46 | -#* Use the set command to specify the new set of parameter |
47 | -#* Or specify a path to a valid param_card/banner |
48 | -#* Example of valid command: |
49 | -#* set aewm1 137 |
50 | -#* ~/param_card.dat |
51 | -#* |
52 | -#* Note: |
53 | -#* 1) the value of alphas will be used from the event |
54 | -#* so the value of the param_card is not taken into account. |
55 | -#* 2) It is dangerous to change a mass of any particle. |
56 | - |
57 | - |
58 | -#* If you want to compute the weight for more than one hyppothesis |
59 | -#* you need first to uncomment the following line: |
60 | -# launch |
61 | -# and then use the set command to specify your parameter. |
62 | -# All modification will start from the ORIGINAL card not from the |
63 | -# last define one. |
64 | -#* You can have as many weight as you want. |
65 | - |
66 | - |
67 | +# SPECIFY A PATH OR USE THE SET COMMAND like |
68 | +# set sminputs 1 130 # modify 1/alpha_EW |
69 | \ No newline at end of file |
70 | |
71 | === modified file 'Template/NLO/MCatNLO/include/LHEFRead.h' |
72 | --- Template/NLO/MCatNLO/include/LHEFRead.h 2014-01-23 17:04:40 +0000 |
73 | +++ Template/NLO/MCatNLO/include/LHEFRead.h 2015-07-24 15:59:43 +0000 |
74 | @@ -16,7 +16,7 @@ |
75 | LHEF::Reader reader; |
76 | |
77 | |
78 | - void lhef_read_wgtsinfo_(int &cwgtinfo_nn, char (cwgtinfo_weights_info[250][15])) { |
79 | + void lhef_read_wgtsinfo_(int &cwgtinfo_nn, char (cwgtinfo_weights_info[350][15])) { |
80 | |
81 | // Read header of event file |
82 | std::stringstream hss; |
83 | @@ -60,11 +60,27 @@ |
84 | ++cwgtinfo_nn; |
85 | } |
86 | } |
87 | + |
88 | + // Read the mg_reweighting block |
89 | + if (hs.find("<weightgroup type='mg_reweighting'") != std::string::npos) { |
90 | + while (true) { |
91 | + std::getline(hss,hs,'\n'); |
92 | + if (hs.find("</weightgroup>") != std::string::npos) break; |
93 | + if (hs.find("<weight id") != std::string::npos) { |
94 | + std::string sRWGT = hs.substr(hs.find("weight id")+11,hs.length()); |
95 | + sRWGT = sRWGT.substr(0,sRWGT.find("'>")); |
96 | + //store the reweight label |
97 | + sprintf(cwgtinfo_weights_info[cwgtinfo_nn], "%15s", sRWGT.c_str()); |
98 | + ++cwgtinfo_nn; |
99 | + } |
100 | + } |
101 | + } |
102 | + |
103 | } |
104 | } |
105 | |
106 | |
107 | - void lhef_read_wgts_(double (cwgt_ww[250])) { |
108 | + void lhef_read_wgts_(double (cwgt_ww[350])) { |
109 | |
110 | // Read events |
111 | if (reader.readEvent()) { |
112 | @@ -106,7 +122,8 @@ |
113 | std::getline(ss,s,'\n'); |
114 | if (s.find("</rwgt>") != std::string::npos) break; |
115 | if (s.find("id=") != std::string::npos) { |
116 | - std::string sww = s.substr(s.find("id=")+11,s.length()); |
117 | + int ioffs=s.find("'>")+2; |
118 | + std::string sww = s.substr(ioffs,s.length()); |
119 | sww = sww.substr(0,sww.find("</w")-1); |
120 | cwgt_ww[iww] = atof(sww.c_str()); |
121 | ++iww; |
122 | |
123 | === modified file 'Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f' |
124 | --- Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2014-06-17 08:36:10 +0000 |
125 | +++ Template/NLO/MCatNLO/srcHerwig/madfks_hwlhin.f 2015-07-24 15:59:43 +0000 |
126 | @@ -24,6 +24,7 @@ |
127 | PARAMETER (IUNIT=61) |
128 | CHARACTER*80 STRING |
129 | CHARACTER*140 BUFF |
130 | + character*20 cidwgt |
131 | character*12 dummy12 |
132 | character*2 dummy2 |
133 | CHARACTER*9 CH1 |
134 | @@ -35,9 +36,14 @@ |
135 | COMMON/CEVWGT_LH/EVWGT_LH |
136 | include 'reweight0.inc' |
137 | integer iww,max_weight |
138 | - parameter (max_weight=maxscales*maxscales+maxpdfs+1) |
139 | + integer maxRWGT |
140 | + parameter (maxRWGT=100) |
141 | + double precision wgtxsecRWGT(maxRWGT) |
142 | + parameter (max_weight=maxscales*maxscales+maxpdfs+maxRWGT+1) |
143 | double precision ww(max_weight) |
144 | common/cww/ww |
145 | + integer numRWGTS |
146 | + common/cnrwgts/numRWGTS |
147 | C |
148 | IF (IERROR.NE.0) RETURN |
149 | c |
150 | @@ -124,7 +130,8 @@ |
151 | elseif(jwgtinfo.eq.9)then |
152 | if (numscales.eq.0 .and. numPDFpairs.eq.0) then |
153 | write (*,*) 'event file not correct format' |
154 | - call HWWARN('UPEVNT',502) |
155 | + write(*,*)'FATAL ERROR #3 IN UPEVNT' |
156 | + stop |
157 | endif |
158 | read(iunit,'(a)')string |
159 | wgtref=XWGTUP/MQQ |
160 | @@ -160,6 +167,11 @@ |
161 | iww=iww+1 |
162 | ww(iww)=wgtxsecPDF(i) |
163 | enddo |
164 | + do i=1,numRWGTS |
165 | + call read_rwgt_line_RWGT(iunit,cidwgt,wgtxsecRWGT(i)) |
166 | + iww=iww+1 |
167 | + ww(iww)=wgtxsecRWGT(i) |
168 | + enddo |
169 | if (numscales.eq.0) then |
170 | wgtxsecmu(1,1)=wgtref |
171 | endif |
172 | @@ -176,7 +188,8 @@ |
173 | buff_tlh=' ' |
174 | endif |
175 | if(INDEX(STRING,'</event>').eq.0)then |
176 | - CALL HWWARN('UPEVNT',501) |
177 | + write(*,*)'FATAL ERROR #2 IN UPEVNT' |
178 | + stop |
179 | endif |
180 | c Modify what follows to set scale of H or S events in a different way |
181 | c$$$ IF(ISORH_LHE.EQ.2)THEN |
182 | @@ -230,10 +243,13 @@ |
183 | character*15 weights_info(max_weight) |
184 | common/cwgtsinfo/weights_info |
185 | double precision xmuR,xmuF |
186 | - integer iPDF,i |
187 | + integer iPDF,i,numRWGTS |
188 | + common/cnrwgts/numRWGTS |
189 | + character*20 sRWGT |
190 | C |
191 | numscales=0 |
192 | numPDFpairs=0 |
193 | + numRWGTS=0 |
194 | nwgt=1 |
195 | weights_info(nwgt)="central value " |
196 | IF (IERROR.NE.0) RETURN |
197 | @@ -277,6 +293,20 @@ |
198 | ENDDO |
199 | nwgt=nwgt+numPDFpairs |
200 | numPDFpairs=numPDFpairs/2 |
201 | + ELSEIF( INDEX(STRING,"<weightgroup type='mg_reweighting'").ne.0 |
202 | + $ .and.STRING(1:1).ne.'#') then |
203 | + DO WHILE (.TRUE.) |
204 | + READ(61,'(a)') STRING |
205 | + if (INDEX(STRING,"<weight id").ne.0 .and. |
206 | + $ STRING(1:1).ne.'#')then |
207 | + numRWGTS=numRWGTS+1 |
208 | + read(string(index(string,"weight id")+11:index(string,"'>")-1),*)sRWGT |
209 | + write(weights_info(numscales**2+2*numPDFpairs+numRWGTS+1),113)sRWGT |
210 | + endif |
211 | + if (INDEX(STRING,"</weightgroup>").ne.0 .and. |
212 | + $ STRING(1:1).ne.'#') exit |
213 | + ENDDO |
214 | + nwgt=nwgt+numRWGTS |
215 | ELSEIF ( INDEX(STRING,'</header>').ne.0 .and. |
216 | & STRING(1:1).ne.'#' ) then |
217 | EXIT |
218 | @@ -297,8 +327,10 @@ |
219 | enddo |
220 | 111 format(a4,f3.1,x,a4,f3.1) |
221 | 112 format(a4,i8,a3) |
222 | + 113 format(a15) |
223 | return |
224 | - 998 CALL HWWARN('UPINIT',500) |
225 | + 998 write(*,*)'FATAL ERROR #2 IN UPINIT' |
226 | + stop |
227 | 999 END |
228 | |
229 | |
230 | @@ -312,7 +344,10 @@ |
231 | DOUBLE PRECISION PP(5,*),P(5,20),P2(20),M2(20),SP(5), |
232 | & TINY,FAC,ECM,DCM,EP,STEP,FRT,HWUSQR |
233 | DATA TINY,NT/1D-9,20/ |
234 | - IF (NP.GT.20) CALL HWWARN('HWURSC',300+NP) |
235 | + IF (NP.GT.20)THEN |
236 | + write(*,*)'FATAL ERROR #1 IN HWURSC' |
237 | + stop |
238 | + ENDIF |
239 | C--COMPUTE CM MOMENTUM |
240 | CALL HWVZRO(4,SP) |
241 | DO IP=1,NP |
242 | @@ -337,15 +372,21 @@ |
243 | DCM=DCM+P2(IP)/EP |
244 | ENDIF |
245 | ENDDO |
246 | - IF (DCM.EQ.0D0) CALL HWWARN('HWURSC',390) |
247 | + IF (DCM.EQ.0D0)THEN |
248 | + write(*,*)'FATAL ERROR #2 IN HWURSC' |
249 | + stop |
250 | + ENDIF |
251 | STEP=2D0*(ECM-SP(5))/DCM |
252 | FAC=FAC-STEP |
253 | IF (ABS(STEP).LT.TINY) GOTO 100 |
254 | ENDDO |
255 | C--FAILED TO CONVERGE |
256 | - CALL HWWARN('HWURSC',1) |
257 | + write(*,*)'WARNING #1 IN HWURSC' |
258 | C--CONVERGED: RESCALE 3-MOMENTA AND BOOST BACK |
259 | - 100 IF (FAC.LT.0D0) CALL HWWARN('HWURSC',391) |
260 | + 100 IF (FAC.LT.0D0)THEN |
261 | + write(*,*)'FATAL ERROR #3 IN HWURSC' |
262 | + stop |
263 | + ENDIF |
264 | FRT=SQRT(FAC) |
265 | DO IP=1,NP |
266 | CALL HWVSCA(3,FRT,P(1,IP),P(1,IP)) |
267 | @@ -372,3 +413,26 @@ |
268 | read (buff(wgt_start:100),*) wgt |
269 | return |
270 | end |
271 | + |
272 | + |
273 | + subroutine read_rwgt_line_RWGT(unit,cid,wgt) |
274 | +c read a line in the <rwgt> tag. The syntax should be |
275 | +c <wgt id='1001'> 0.1234567e+01 </wgt> |
276 | +c The id should be exactly 4 digits long. |
277 | + implicit none |
278 | + integer unit,wgt_start,id_start,id_end |
279 | + double precision wgt |
280 | + character*100 buff |
281 | + character*20 cid |
282 | + read (unit,'(a)') buff |
283 | +c Use char() to make sure that the non-standard characters are compiler |
284 | +c independent (char(62)=">", char(61)="=", char(39)="'") |
285 | + wgt_start=index(buff,CHAR(39)//CHAR(62))+2 |
286 | + id_start=index(buff,'id'//CHAR(61)//CHAR(39))+4 |
287 | + id_end=wgt_start-3 |
288 | + |
289 | + read (buff(id_start:id_end),*) cid |
290 | + read (buff(wgt_start:100),*) wgt |
291 | + |
292 | + return |
293 | + end |
294 | |
295 | === modified file 'Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f' |
296 | --- Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f 2014-06-17 08:36:10 +0000 |
297 | +++ Template/NLO/MCatNLO/srcPythia/madfks_pylhin.f 2015-07-24 15:59:43 +0000 |
298 | @@ -23,6 +23,7 @@ |
299 | PARAMETER (IUNIT=61) |
300 | CHARACTER*80 STRING |
301 | CHARACTER*140 BUFF |
302 | + character*20 cidwgt |
303 | character*12 dummy12 |
304 | character*2 dummy2 |
305 | CHARACTER*9 CH1 |
306 | @@ -34,9 +35,14 @@ |
307 | COMMON/CEVWGT_LH/EVWGT_LH |
308 | include 'reweight0.inc' |
309 | integer iww,max_weight |
310 | - parameter (max_weight=maxscales*maxscales+maxpdfs+1) |
311 | + integer maxRWGT |
312 | + parameter (maxRWGT=100) |
313 | + double precision wgtxsecRWGT(maxRWGT) |
314 | + parameter (max_weight=maxscales*maxscales+maxpdfs+maxRWGT+1) |
315 | double precision ww(max_weight) |
316 | common/cww/ww |
317 | + integer numRWGTS |
318 | + common/cnrwgts/numRWGTS |
319 | C |
320 | COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200) |
321 | DOUBLE PRECISION EVWEIGHT |
322 | @@ -164,6 +170,11 @@ |
323 | iww=iww+1 |
324 | ww(iww)=wgtxsecPDF(i) |
325 | enddo |
326 | + do i=1,numRWGTS |
327 | + call read_rwgt_line_RWGT(iunit,cidwgt,wgtxsecRWGT(i)) |
328 | + iww=iww+1 |
329 | + ww(iww)=wgtxsecRWGT(i) |
330 | + enddo |
331 | if (numscales.eq.0) then |
332 | wgtxsecmu(1,1)=wgtref |
333 | endif |
334 | @@ -235,10 +246,13 @@ |
335 | character*15 weights_info(max_weight) |
336 | common/cwgtsinfo/weights_info |
337 | double precision xmuR,xmuF |
338 | - integer iPDF,i |
339 | + integer iPDF,i,numRWGTS |
340 | + common/cnrwgts/numRWGTS |
341 | + character*20 sRWGT |
342 | C |
343 | numscales=0 |
344 | numPDFpairs=0 |
345 | + numRWGTS=0 |
346 | nwgt=1 |
347 | weights_info(nwgt)="central value " |
348 | C--SET UP INPUT FILES |
349 | @@ -281,6 +295,20 @@ |
350 | ENDDO |
351 | nwgt=nwgt+numPDFpairs |
352 | numPDFpairs=numPDFpairs/2 |
353 | + ELSEIF( INDEX(STRING,"<weightgroup type='mg_reweighting'").ne.0 |
354 | + $ .and.STRING(1:1).ne.'#') then |
355 | + DO WHILE (.TRUE.) |
356 | + READ(61,'(a)') STRING |
357 | + if (INDEX(STRING,"<weight id").ne.0 .and. |
358 | + $ STRING(1:1).ne.'#')then |
359 | + numRWGTS=numRWGTS+1 |
360 | + read(string(index(string,"weight id")+11:index(string,"'>")-1),*)sRWGT |
361 | + write(weights_info(numscales**2+2*numPDFpairs+numRWGTS+1),113)sRWGT |
362 | + endif |
363 | + if (INDEX(STRING,"</weightgroup>").ne.0 .and. |
364 | + $ STRING(1:1).ne.'#') exit |
365 | + ENDDO |
366 | + nwgt=nwgt+numRWGTS |
367 | ELSEIF ( INDEX(STRING,'</header>').ne.0 .and. |
368 | & STRING(1:1).ne.'#' ) then |
369 | EXIT |
370 | @@ -301,6 +329,7 @@ |
371 | enddo |
372 | 111 format(a4,f3.1,x,a4,f3.1) |
373 | 112 format(a4,i8,a3) |
374 | + 113 format(a15) |
375 | return |
376 | 998 write(*,*)'FATAL ERROR #2 IN UPINIT' |
377 | stop |
378 | @@ -516,3 +545,26 @@ |
379 | read (buff(wgt_start:100),*) wgt |
380 | return |
381 | end |
382 | + |
383 | + |
384 | + subroutine read_rwgt_line_RWGT(unit,cid,wgt) |
385 | +c read a line in the <rwgt> tag. The syntax should be |
386 | +c <wgt id='1001'> 0.1234567e+01 </wgt> |
387 | +c The id should be exactly 4 digits long. |
388 | + implicit none |
389 | + integer unit,wgt_start,id_start,id_end |
390 | + double precision wgt |
391 | + character*100 buff |
392 | + character*20 cid |
393 | + read (unit,'(a)') buff |
394 | +c Use char() to make sure that the non-standard characters are compiler |
395 | +c independent (char(62)=">", char(61)="=", char(39)="'") |
396 | + wgt_start=index(buff,CHAR(39)//CHAR(62))+2 |
397 | + id_start=index(buff,'id'//CHAR(61)//CHAR(39))+4 |
398 | + id_end=wgt_start-3 |
399 | + |
400 | + read (buff(id_start:id_end),*) cid |
401 | + read (buff(wgt_start:100),*) wgt |
402 | + |
403 | + return |
404 | + end |
405 | |
406 | === modified file 'Template/NLO/MCatNLO/srcPythia8/Pythia8.cc' |
407 | --- Template/NLO/MCatNLO/srcPythia8/Pythia8.cc 2015-03-30 12:01:21 +0000 |
408 | +++ Template/NLO/MCatNLO/srcPythia8/Pythia8.cc 2015-07-24 15:59:43 +0000 |
409 | @@ -30,8 +30,8 @@ |
410 | Pythia pythia; |
411 | |
412 | int cwgtinfo_nn; |
413 | - char cwgtinfo_weights_info[250][15]; |
414 | - double cwgt_ww[250]; |
415 | + char cwgtinfo_weights_info[350][15]; |
416 | + double cwgt_ww[350]; |
417 | |
418 | string inputname="Pythia8.cmd",outputname="Pythia8.hep"; |
419 | |
420 | |
421 | === modified file 'Template/NLO/MCatNLO/srcPythia8/Pythia82.cc' |
422 | --- Template/NLO/MCatNLO/srcPythia8/Pythia82.cc 2015-03-30 12:01:21 +0000 |
423 | +++ Template/NLO/MCatNLO/srcPythia8/Pythia82.cc 2015-07-24 15:59:43 +0000 |
424 | @@ -31,8 +31,8 @@ |
425 | Pythia pythia; |
426 | |
427 | int cwgtinfo_nn; |
428 | - char cwgtinfo_weights_info[250][15]; |
429 | - double cwgt_ww[250]; |
430 | + char cwgtinfo_weights_info[350][15]; |
431 | + double cwgt_ww[350]; |
432 | |
433 | string inputname="Pythia8.cmd",outputname="Pythia8.hep"; |
434 | |
435 | |
436 | === modified file 'Template/loop_material/StandAlone/SubProcesses/makefile' |
437 | --- Template/loop_material/StandAlone/SubProcesses/makefile 2015-05-10 14:33:18 +0000 |
438 | +++ Template/loop_material/StandAlone/SubProcesses/makefile 2015-07-24 15:59:43 +0000 |
439 | @@ -11,6 +11,7 @@ |
440 | |
441 | include $(ROOT)/Source/make_opts |
442 | include $(ROOT)/SubProcesses/MadLoop_makefile_definitions |
443 | +SHELL = /bin/bash |
444 | |
445 | LIBDIR = $(ROOT)/lib/ |
446 | PROG = check |
447 | @@ -80,4 +81,23 @@ |
448 | mv libMadLoop.$(libext) $(MADLOOP_LIB) |
449 | |
450 | clean: |
451 | - @rm -f *.o |
452 | + @rm -f *.o *.so |
453 | + |
454 | +../$(OLP): |
455 | + cd ..; make $(OLP); cd - |
456 | + rm -f libMadLoop.dylib |
457 | + ln -s ../libMadLoop.dylib |
458 | + |
459 | +libMadLoop.dylib: ../$(OLP) |
460 | + |
461 | +matrix2py.so: ../$(OLP) |
462 | + touch __init__.py |
463 | + @ if [ -f `which f2py` ]; then \ |
464 | + f2py -L. -lMadLoop -m matrix2py -c check_sa.f;\ |
465 | + else \ |
466 | + if [ -f `which f2py-2.7` ]; then \ |
467 | + f2py-2.7 -L. -lMadLoop -m matrix2py -c check_sa.f;\ |
468 | + else \ |
469 | + f2py-2.6 -L. -lMadLoop -m matrix2py -c check_sa.f;\ |
470 | + fi; \ |
471 | + fi |
472 | \ No newline at end of file |
473 | |
474 | === modified file 'UpdateNotes.txt' |
475 | --- UpdateNotes.txt 2015-06-28 14:44:22 +0000 |
476 | +++ UpdateNotes.txt 2015-07-24 15:59:43 +0000 |
477 | @@ -70,6 +70,15 @@ |
478 | RF: For fNLO runs the virtuals were included twice in the setting of the integration grids. |
479 | This was not leading to any bias in previous version of the code. |
480 | |
481 | +2.2.3(XX/XX/XX) RF: If a NAN is found, the code now skips that PS point and continues. |
482 | + OM: Fix a bug in MadWeight (correlated param_card was not creating the correct input file) |
483 | + RF: For fNLO runs the virtuals were included twice in the setting of the integration grids. |
484 | + RF: When requiring more than 1M events for (N)LO+PS runs, do not go to higher precision than 0.001 |
485 | + for the grids and cross section (can be overwritten with the req_acc run_card parameter). |
486 | + RF: Make sure that reweight info (for PDF and scale uncertainties) also works for UNLOPS events. |
487 | + |
488 | + |
489 | + |
490 | 2.2.2(06/11/14) OM: Correct a bug in the integration grid (introduces in 2.1.2). This was biasing the cross-section of |
491 | processes like a a > mu+ mu- in the Effective Photon Approximation by three order of magnitude. |
492 | For LHC processes no sizeable effect have been observe so far. |
493 | |
494 | === modified file 'madgraph/interface/amcatnlo_run_interface.py' |
495 | --- madgraph/interface/amcatnlo_run_interface.py 2015-06-24 16:56:55 +0000 |
496 | +++ madgraph/interface/amcatnlo_run_interface.py 2015-07-24 15:59:43 +0000 |
497 | @@ -1209,6 +1209,7 @@ |
498 | |
499 | if not mode in ['LO', 'NLO']: |
500 | assert evt_file == pjoin(self.me_dir,'Events', self.run_name, 'events.lhe'), '%s != %s' %(evt_file, pjoin(self.me_dir,'Events', self.run_name, 'events.lhe.gz')) |
501 | + self.exec_cmd('reweight -from_cards', postcmd=False) |
502 | self.exec_cmd('decay_events -from_cards', postcmd=False) |
503 | evt_file = pjoin(self.me_dir,'Events', self.run_name, 'events.lhe') |
504 | |
505 | @@ -1851,7 +1852,7 @@ |
506 | '\n Total cross-section: %(xsect)8.3e +- %(errt)6.1e pb' % \ |
507 | self.cross_sect_dict |
508 | |
509 | - if int(self.run_card['nevents'])>=10000 and self.run_card['reweight_scale']: |
510 | + if self.run_card['nevents']>=10000 and self.run_card['reweight_scale']: |
511 | message = message + \ |
512 | ('\n Ren. and fac. scale uncertainty: +%0.1f%% -%0.1f%%') % \ |
513 | (scale_pdf_info['scale_upp'], scale_pdf_info['scale_low']) |
514 | @@ -2356,7 +2357,7 @@ |
515 | Event dir. Return the name of the event file created |
516 | """ |
517 | scale_pdf_info={} |
518 | - if (self.run_card['reweight_scale'] or self.run_card['reweight_PDF']): |
519 | + if self.run_card['reweight_scale'] or self.run_card['reweight_PDF'] : |
520 | scale_pdf_info = self.run_reweight(options['reweightonly']) |
521 | |
522 | self.update_status('Collecting events', level='parton', update_results=True) |
523 | @@ -4038,7 +4039,7 @@ |
524 | |
525 | |
526 | void = 'NOT INSTALLED' |
527 | - switch_order = ['order', 'fixed_order', 'shower','madspin'] |
528 | + switch_order = ['order', 'fixed_order', 'shower','madspin', 'reweight'] |
529 | switch_default = {'order': 'NLO', 'fixed_order': 'OFF', 'shower': void, |
530 | 'madspin': void} |
531 | if not switch: |
532 | @@ -4050,16 +4051,19 @@ |
533 | allowed_switch_value = {'order': ['LO', 'NLO'], |
534 | 'fixed_order': default_switch, |
535 | 'shower': default_switch, |
536 | - 'madspin': default_switch} |
537 | + 'madspin': default_switch, |
538 | + 'reweight': default_switch} |
539 | |
540 | description = {'order': 'Perturbative order of the calculation:', |
541 | 'fixed_order': 'Fixed order (no event generation and no MC@[N]LO matching):', |
542 | 'shower': 'Shower the generated events:', |
543 | - 'madspin': 'Decay particles with the MadSpin module:' } |
544 | + 'madspin': 'Decay particles with the MadSpin module:', |
545 | + 'reweight': 'Add weight to events based on coupling parameters'} |
546 | |
547 | force_switch = {('shower', 'ON'): {'fixed_order': 'OFF'}, |
548 | ('madspin', 'ON'): {'fixed_order':'OFF'}, |
549 | - ('fixed_order', 'ON'): {'shower': 'OFF', 'madspin': 'OFF'} |
550 | + ('reweight', 'ON'): {'fixed_order':'OFF'}, |
551 | + ('fixed_order', 'ON'): {'shower': 'OFF', 'madspin': 'OFF', 'reweight':'ON'} |
552 | } |
553 | special_values = ['LO', 'NLO', 'aMC@NLO', 'aMC@LO', 'noshower', 'noshowerLO'] |
554 | |
555 | @@ -4085,11 +4089,25 @@ |
556 | switch['madspin'] = 'ON' |
557 | else: |
558 | switch['madspin'] = 'OFF' |
559 | + if misc.which('f2py'): |
560 | + if os.path.exists(pjoin(self.me_dir,'Cards','reweight_card.dat')): |
561 | + switch['reweight'] = 'ON' |
562 | + else: |
563 | + switch['reweight'] = 'OFF' |
564 | + else: |
565 | + switch['reweight'] = 'Numpy python package not available.' |
566 | + |
567 | + if not aMCatNLO or self.options['mg5_path']: |
568 | + available_mode.append('5') |
569 | + if os.path.exists(pjoin(self.me_dir,'Cards','reweight_card.dat')): |
570 | + switch['reweight'] = 'ON' |
571 | + else: |
572 | + switch['reweight'] = 'OFF' |
573 | |
574 | answers = list(available_mode) + ['auto', 'done'] |
575 | alias = {} |
576 | for id, key in enumerate(switch_order): |
577 | - if switch[key] != void: |
578 | + if switch[key] != void and switch[key] in allowed_switch_value[key]: |
579 | answers += ['%s=%s' % (key, s) for s in allowed_switch_value[key]] |
580 | #allow lower case for on/off |
581 | alias.update(dict(('%s=%s' % (key, s.lower()), '%s=%s' % (key, s)) |
582 | @@ -4121,36 +4139,32 @@ |
583 | return |
584 | elif answer in special_values: |
585 | logger.info('Enter mode value: Go to the related mode', '$MG:color:BLACK') |
586 | + assign_switch('reweight', 'OFF') |
587 | + assign_switch('madspin', 'OFF') |
588 | if answer == 'LO': |
589 | switch['order'] = 'LO' |
590 | switch['fixed_order'] = 'ON' |
591 | assign_switch('shower', 'OFF') |
592 | - assign_switch('madspin', 'OFF') |
593 | elif answer == 'NLO': |
594 | switch['order'] = 'NLO' |
595 | switch['fixed_order'] = 'ON' |
596 | assign_switch('shower', 'OFF') |
597 | - assign_switch('madspin', 'OFF') |
598 | elif answer == 'aMC@NLO': |
599 | switch['order'] = 'NLO' |
600 | switch['fixed_order'] = 'OFF' |
601 | assign_switch('shower', 'ON') |
602 | - assign_switch('madspin', 'OFF') |
603 | elif answer == 'aMC@LO': |
604 | switch['order'] = 'LO' |
605 | switch['fixed_order'] = 'OFF' |
606 | assign_switch('shower', 'ON') |
607 | - assign_switch('madspin', 'OFF') |
608 | elif answer == 'noshower': |
609 | switch['order'] = 'NLO' |
610 | switch['fixed_order'] = 'OFF' |
611 | - assign_switch('shower', 'OFF') |
612 | - assign_switch('madspin', 'OFF') |
613 | + assign_switch('shower', 'OFF') |
614 | elif answer == 'noshowerLO': |
615 | switch['order'] = 'LO' |
616 | switch['fixed_order'] = 'OFF' |
617 | assign_switch('shower', 'OFF') |
618 | - assign_switch('madspin', 'OFF') |
619 | if mode: |
620 | return |
621 | return switch |
622 | @@ -4207,8 +4221,11 @@ |
623 | options['parton'] = True |
624 | ignore = ['shower_card.dat', 'madspin_card.dat'] |
625 | cards.append('FO_analyse_card.dat') |
626 | - elif switch['madspin'] == 'ON': |
627 | - cards.append('madspin_card.dat') |
628 | + else: |
629 | + if switch['madspin'] == 'ON': |
630 | + cards.append('madspin_card.dat') |
631 | + if switch['reweight'] == 'ON': |
632 | + cards.append('reweight_card.dat') |
633 | if 'aMC@' in mode: |
634 | cards.append('shower_card.dat') |
635 | if mode == 'onlyshower': |
636 | |
637 | === modified file 'madgraph/interface/common_run_interface.py' |
638 | --- madgraph/interface/common_run_interface.py 2015-06-14 00:32:59 +0000 |
639 | +++ madgraph/interface/common_run_interface.py 2015-07-24 15:59:43 +0000 |
640 | @@ -774,11 +774,11 @@ |
641 | madweight_card.dat [MW] |
642 | """ |
643 | |
644 | - text = open(path).read(50000) |
645 | - if text == '': |
646 | + fulltext = open(path).read(50000) |
647 | + if fulltext == '': |
648 | logger.warning('File %s is empty' % path) |
649 | return 'unknown' |
650 | - text = re.findall('(<MGVersion>|ParticlePropagator|<mg5proccard>|CEN_max_tracker|#TRIGGER CARD|parameter set name|muon eta coverage|QES_over_ref|MSTP|b_stable|FO_ANALYSIS_FORMAT|MSTU|Begin Minpts|gridpack|ebeam1|block\s+mw_run|BLOCK|DECAY|launch|madspin|transfer_card\.dat|set)', text, re.I) |
651 | + text = re.findall('(<MGVersion>|ParticlePropagator|<mg5proccard>|CEN_max_tracker|#TRIGGER CARD|parameter set name|muon eta coverage|QES_over_ref|MSTP|b_stable|FO_ANALYSIS_FORMAT|MSTU|Begin Minpts|gridpack|ebeam1|block\s+mw_run|BLOCK|DECAY|launch|madspin|transfer_card\.dat|set)', fulltext, re.I) |
652 | text = [t.lower() for t in text] |
653 | if '<mgversion>' in text or '<mg5proccard>' in text: |
654 | return 'banner' |
655 | @@ -809,12 +809,19 @@ |
656 | return 'shower_card.dat' |
657 | elif 'fo_analysis_format' in text: |
658 | return 'FO_analyse_card.dat' |
659 | - elif 'decay' in text and 'launch' in text and 'madspin' in text: |
660 | - return 'madspin_card.dat' |
661 | - elif 'launch' in text and 'set' in text: |
662 | - return 'reweight_card.dat' |
663 | - elif 'decay' in text and 'launch' in text: |
664 | - return 'madspin_card.dat' |
665 | + elif 'launch' in text: |
666 | + # need to separate madspin/reweight. |
667 | + # decay/set can be in both... |
668 | + if 'madspin' in text: |
669 | + return 'madspin_card.dat' |
670 | + if 'decay' in text: |
671 | + # need to check if this a line like "decay w+" or "set decay" |
672 | + if re.search("(^|;)\s*decay", fulltext): |
673 | + return 'madspin_card.dat' |
674 | + else: |
675 | + return 'reweight_card.dat' |
676 | + else: |
677 | + return 'reweight_card.dat' |
678 | else: |
679 | return 'unknown' |
680 | |
681 | @@ -1010,6 +1017,54 @@ |
682 | """Dummy routine, to be overwritten by daughter classes""" |
683 | |
684 | pass |
685 | + ############################################################################ |
686 | + def do_reweight(self, line): |
687 | + """ Allow to reweight the events generated with a new choices of model |
688 | + parameter. |
689 | + """ |
690 | + |
691 | + if '-from_cards' in line and not os.path.exists(pjoin(self.me_dir, 'Cards', 'reweight_card.dat')): |
692 | + return |
693 | + |
694 | + # Check that MG5 directory is present . |
695 | + if MADEVENT and not self.options['mg5_path']: |
696 | + raise self.InvalidCmd, '''The module reweight requires that MG5 is installed on the system. |
697 | + You can install it and set its path in ./Cards/me5_configuration.txt''' |
698 | + elif MADEVENT: |
699 | + sys.path.append(self.options['mg5_path']) |
700 | + try: |
701 | + import madgraph.interface.reweight_interface as reweight_interface |
702 | + except ImportError: |
703 | + raise self.ConfigurationError, '''Can\'t load Reweight module. |
704 | + The variable mg5_path might not be correctly configured.''' |
705 | + |
706 | + self.to_store.append('event') |
707 | + if not '-from_cards' in line: |
708 | + self.keep_cards(['reweight_card.dat']) |
709 | + self.ask_edit_cards(['reweight_card.dat'], 'fixed', plot=False) |
710 | + |
711 | + # forbid this function to create an empty item in results. |
712 | + if self.results.current['cross'] == 0 and self.run_name: |
713 | + self.results.delete_run(self.run_name, self.run_tag) |
714 | + |
715 | + # load the name of the event file |
716 | + args = self.split_arg(line) |
717 | + self.check_decay_events(args) |
718 | + # args now alway content the path to the valid files |
719 | + reweight_cmd = reweight_interface.ReweightInterface(args[0]) |
720 | + reweight_cmd.mother = self |
721 | + self.update_status('Running Reweight', level='madspin') |
722 | + |
723 | + |
724 | + path = pjoin(self.me_dir, 'Cards', 'reweight_card.dat') |
725 | + reweight_cmd.me_dir = self.me_dir |
726 | + reweight_cmd.import_command_file(path) |
727 | + |
728 | + # re-define current run |
729 | + try: |
730 | + self.results.def_current(self.run_name, self.run_tag) |
731 | + except Exception: |
732 | + pass |
733 | |
734 | ############################################################################ |
735 | def do_pgs(self, line): |
736 | @@ -3022,7 +3077,7 @@ |
737 | # check if input is a file |
738 | elif hasattr(self, 'do_%s' % args[0]): |
739 | self.do_set(' '.join(args[1:])) |
740 | - elif os.path.exists(line): |
741 | + elif os.path.isfile(line): |
742 | self.copy_file(line) |
743 | self.value = 'repeat' |
744 | elif os.path.exists(pjoin(self.me_dir, line)): |
745 | @@ -3114,6 +3169,7 @@ |
746 | return self.mother_interface.complete_compute_widths(*args,**opts) |
747 | |
748 | |
749 | + |
750 | def help_asperge(self): |
751 | """Help associated to the asperge command""" |
752 | signal.alarm(0) |
753 | @@ -3191,7 +3247,7 @@ |
754 | logger.warning('Fail to determine the type of the file. Not copied') |
755 | if card_name != 'banner': |
756 | logger.info('copy %s as %s' % (path, card_name)) |
757 | - files.cp(path, pjoin(self.mother_interface.me_dir, 'Cards', card_name)) |
758 | + files.cp(path, pjoin(self.me_dir, 'Cards', card_name)) |
759 | elif card_name == 'banner': |
760 | banner_mod.split_banner(path, self.mother_interface.me_dir, proc_card=False) |
761 | logger.info('Splitting the banner in it\'s component') |
762 | |
763 | === modified file 'madgraph/interface/extended_cmd.py' |
764 | --- madgraph/interface/extended_cmd.py 2015-03-31 06:48:20 +0000 |
765 | +++ madgraph/interface/extended_cmd.py 2015-07-24 15:59:43 +0000 |
766 | @@ -705,7 +705,7 @@ |
767 | return self.check_answer_in_input_file(question_instance, default, path) |
768 | elif path: |
769 | line = os.path.expanduser(os.path.expandvars(line)) |
770 | - if os.path.exists(line): |
771 | + if os.path.isfile(line): |
772 | return line |
773 | # No valid answer provides |
774 | if self.haspiping: |
775 | |
776 | === modified file 'madgraph/interface/loop_interface.py' |
777 | --- madgraph/interface/loop_interface.py 2015-05-22 17:46:32 +0000 |
778 | +++ madgraph/interface/loop_interface.py 2015-07-24 15:59:43 +0000 |
779 | @@ -25,6 +25,7 @@ |
780 | import madgraph |
781 | from madgraph import MG4DIR, MG5DIR, MadGraph5Error |
782 | import madgraph.interface.madgraph_interface as mg_interface |
783 | +import madgraph.interface.launch_ext_program as launch_ext |
784 | import madgraph.core.base_objects as base_objects |
785 | import madgraph.core.diagram_generation as diagram_generation |
786 | import madgraph.loop.loop_diagram_generation as loop_diagram_generation |
787 | @@ -90,9 +91,10 @@ |
788 | |
789 | mg_interface.MadGraphCmd.check_output(self,args) |
790 | |
791 | - if self._export_format not in ["standalone", "matchbox"]: |
792 | - self._export_format = 'standalone' |
793 | |
794 | + if self._export_format not in self.supported_ML_format: |
795 | + raise self.InvalidCmd, "not supported format %s" % self._export_format |
796 | + |
797 | def check_launch(self, args, options): |
798 | """ Further check that only valid options are given to the MadLoop |
799 | default launcher.""" |
800 | @@ -228,10 +230,10 @@ |
801 | # "will come out with the next release.") |
802 | |
803 | if isinstance(proc, base_objects.ProcessDefinition) and mode.startswith('ML5'): |
804 | - if proc.has_multiparticle_label(): |
805 | - raise self.InvalidCmd( |
806 | + if proc.has_multiparticle_label(): |
807 | + raise self.InvalidCmd, \ |
808 | "When running ML5 standalone, multiparticle labels cannot be"+\ |
809 | - " employed. Please use the FKS5 interface instead.") |
810 | + " employed." |
811 | |
812 | if proc['decay_chains']: |
813 | raise self.InvalidCmd( |
814 | @@ -341,7 +343,9 @@ |
815 | " corrections with this model because it does not support Feynman gauge.") |
816 | |
817 | class LoopInterface(CheckLoop, CompleteLoop, HelpLoop, CommonLoopInterface): |
818 | - |
819 | + |
820 | + supported_ML_format = ['standalone', 'standalone_rw', 'matchbox'] |
821 | + |
822 | def __init__(self, mgme_dir = '', *completekey, **stdin): |
823 | """ Special init tasks for the Loop Interface """ |
824 | |
825 | @@ -420,16 +424,16 @@ |
826 | aloha_original_quad_mode = aloha.mp_precision |
827 | aloha.mp_precision = True |
828 | |
829 | - if self._export_format not in ['standalone', 'matchbox']: |
830 | - raise self.InvalidCmd('ML5 only support standalone/matchbox as export format.') |
831 | + if self._export_format not in self.supported_ML_format: |
832 | + raise self.InvalidCmd('ML5 only support "%s" as export format.' % \ |
833 | + ''.join(self.supported_ML_format)) |
834 | |
835 | - if not os.path.isdir(self._export_dir) and \ |
836 | - self._export_format in ['matrix']: |
837 | + if not os.path.isdir(self._export_dir) and self._export_format in ['matrix']: |
838 | raise self.InvalidCmd('Specified export directory %s does not exist.'\ |
839 | %str(self._export_dir)) |
840 | |
841 | if not force and not noclean and os.path.isdir(self._export_dir)\ |
842 | - and self._export_format in ['standalone']: |
843 | + and self._export_format.startswith('standalone'): |
844 | # Don't ask if user already specified force or noclean |
845 | logger.info('INFO: directory %s already exists.' % self._export_dir) |
846 | logger.info('If you continue this directory will be cleaned') |
847 | @@ -443,17 +447,22 @@ |
848 | raise self.InvalidCmd('Could not remove directory %s.'\ |
849 | %str(self._export_dir)) |
850 | |
851 | - if self._export_format == 'standalone': |
852 | + if self._export_format.startswith('standalone'): |
853 | output_type = 'madloop' |
854 | elif self._export_format == 'matchbox': |
855 | output_type = 'madloop_matchbox' |
856 | - |
857 | + |
858 | self._curr_exporter = export_v4.ExportV4Factory(self, \ |
859 | noclean, output_type=output_type) |
860 | |
861 | if self._export_format in ['standalone', 'matchbox']: |
862 | self._curr_exporter.copy_v4template(modelname=self._curr_model.get('name')) |
863 | |
864 | + if self._export_format == "standalone_rw": |
865 | + self._export_format = "standalone" |
866 | + self._curr_exporter.copy_v4template(modelname=self._curr_model.get('name')) |
867 | + self._export_format = "standalone_rw" |
868 | + |
869 | # Reset _done_export, since we have new directory |
870 | self._done_export = False |
871 | |
872 | @@ -509,7 +518,7 @@ |
873 | calls = 0 |
874 | |
875 | path = self._export_dir |
876 | - if self._export_format in ['standalone','matchbox']: |
877 | + if self._export_format in self.supported_ML_format: |
878 | path = pjoin(path, 'SubProcesses') |
879 | |
880 | cpu_time1 = time.time() |
881 | @@ -519,8 +528,8 @@ |
882 | self._curr_matrix_elements.get_matrix_elements() |
883 | |
884 | # Fortran MadGraph5_aMC@NLO Standalone |
885 | - if self._export_format in ['standalone', 'matchbox']: |
886 | - for me in matrix_elements: |
887 | + if self._export_format in self.supported_ML_format: |
888 | + for me in matrix_elements: |
889 | calls = calls + \ |
890 | self._curr_exporter.generate_subprocess_directory_v4(\ |
891 | me, self._curr_fortran_model) |
892 | @@ -531,12 +540,16 @@ |
893 | if self.options['loop_optimized_output'] and len(matrix_elements)>1: |
894 | max_lwfspins = [m.get_max_loop_particle_spin() for m in \ |
895 | matrix_elements] |
896 | - max_loop_vert_ranks = [me.get_max_loop_vertex_rank() for me in \ |
897 | + try: |
898 | + max_loop_vert_ranks = [me.get_max_loop_vertex_rank() for me in \ |
899 | matrix_elements] |
900 | - if len(set(max_lwfspins))>1 or len(set(max_loop_vert_ranks))>1: |
901 | - self._curr_exporter.fix_coef_specs(max(max_lwfspins),\ |
902 | + except MadGraph5Error: |
903 | + pass |
904 | + else: |
905 | + if len(set(max_lwfspins))>1 or len(set(max_loop_vert_ranks))>1: |
906 | + self._curr_exporter.fix_coef_specs(max(max_lwfspins),\ |
907 | max(max_loop_vert_ranks)) |
908 | - logger.warning('ML5 has just output processes which do not'+\ |
909 | + logger.warning('ML5 has just output processes which do not'+\ |
910 | ' share the same maximum loop wavefunction size or the '+\ |
911 | ' same maximum loop vertex rank. This is potentially '+\ |
912 | ' dangerous. Please prefer to output them separately.') |
913 | @@ -580,7 +593,7 @@ |
914 | """Copy necessary sources and output the ps representation of |
915 | the diagrams, if needed""" |
916 | |
917 | - if self._export_format in ['standalone','matchbox']: |
918 | + if self._export_format in self.supported_ML_format: |
919 | logger.info('Export UFO model to MG4 format') |
920 | # wanted_lorentz are the lorentz structures which are |
921 | # actually used in the wavefunctions and amplitudes in |
922 | @@ -599,7 +612,7 @@ |
923 | wanted_lorentz, |
924 | wanted_couplings) |
925 | |
926 | - if self._export_format in ['standalone', 'matchbox']: |
927 | + if self._export_format in self.supported_ML_format: |
928 | self._curr_exporter.finalize_v4_directory( \ |
929 | self._curr_matrix_elements, |
930 | self.history, |
931 | @@ -607,7 +620,7 @@ |
932 | online, |
933 | self.options['fortran_compiler']) |
934 | |
935 | - if self._export_format in ['standalone','matchbox']: |
936 | + if self._export_format in self.supported_ML_format: |
937 | logger.info('Output to directory ' + self._export_dir + ' done.') |
938 | |
939 | def do_launch(self, line, *args,**opt): |
940 | |
941 | === modified file 'madgraph/interface/madevent_interface.py' |
942 | --- madgraph/interface/madevent_interface.py 2015-06-23 21:24:06 +0000 |
943 | +++ madgraph/interface/madevent_interface.py 2015-07-24 15:59:43 +0000 |
944 | @@ -3061,54 +3061,6 @@ |
945 | self.update_status('End Parton', level='parton', makehtml=False) |
946 | devnull.close() |
947 | |
948 | - ############################################################################ |
949 | - def do_reweight(self, line): |
950 | - """ Allow to reweight the events generated with a new choices of model |
951 | - parameter. |
952 | - """ |
953 | - |
954 | - if '-from_cards' in line and not os.path.exists(pjoin(self.me_dir, 'Cards', 'reweight_card.dat')): |
955 | - return |
956 | - |
957 | - # Check that MG5 directory is present . |
958 | - if MADEVENT and not self.options['mg5_path']: |
959 | - raise self.InvalidCmd, '''The module reweight requires that MG5 is installed on the system. |
960 | - You can install it and set its path in ./Cards/me5_configuration.txt''' |
961 | - elif MADEVENT: |
962 | - sys.path.append(self.options['mg5_path']) |
963 | - try: |
964 | - import madgraph.interface.reweight_interface as reweight_interface |
965 | - except ImportError: |
966 | - raise self.ConfigurationError, '''Can\'t load Reweight module. |
967 | - The variable mg5_path might not be correctly configured.''' |
968 | - |
969 | - self.to_store.append('event') |
970 | - if not '-from_cards' in line: |
971 | - self.keep_cards(['reweight_card.dat']) |
972 | - self.ask_edit_cards(['reweight_card.dat'], 'fixed', plot=False) |
973 | - |
974 | - # forbid this function to create an empty item in results. |
975 | - if self.results.current['cross'] == 0 and self.run_name: |
976 | - self.results.delete_run(self.run_name, self.run_tag) |
977 | - |
978 | - # load the name of the event file |
979 | - args = self.split_arg(line) |
980 | - self.check_decay_events(args) |
981 | - # args now alway content the path to the valid files |
982 | - reweight_cmd = reweight_interface.ReweightInterface(args[0]) |
983 | - reweight_cmd. mother = self |
984 | - self.update_status('Running Reweight', level='madspin') |
985 | - |
986 | - |
987 | - path = pjoin(self.me_dir, 'Cards', 'reweight_card.dat') |
988 | - reweight_cmd.me_dir = self.me_dir |
989 | - reweight_cmd.import_command_file(path) |
990 | - |
991 | - # re-define current run |
992 | - try: |
993 | - self.results.def_current(self.run_name, self.run_tag) |
994 | - except Exception: |
995 | - pass |
996 | |
997 | ############################################################################ |
998 | def do_create_gridpack(self, line): |
999 | @@ -4280,16 +4232,19 @@ |
1000 | switch['madspin'] = 'ON' |
1001 | else: |
1002 | switch['madspin'] = 'OFF' |
1003 | - if os.path.exists(pjoin(self.me_dir,'Cards','reweight_card.dat')): |
1004 | - switch['reweight'] = 'ON' |
1005 | - else: |
1006 | - switch['reweight'] = 'OFF' |
1007 | + if misc.which('f2py'): |
1008 | + if os.path.exists(pjoin(self.me_dir,'Cards','reweight_card.dat')): |
1009 | + switch['reweight'] = 'ON' |
1010 | + else: |
1011 | + switch['reweight'] = 'OFF' |
1012 | + else: |
1013 | + switch['reweight'] = 'Numpy python package not available.' |
1014 | |
1015 | |
1016 | |
1017 | options = list(available_mode) + ['auto', 'done'] |
1018 | for id, key in enumerate(switch_order): |
1019 | - if switch[key] != void: |
1020 | + if switch[key] not in [void, 'Numpy python package not available.']: |
1021 | options += ['%s=%s' % (key, s) for s in ['ON','OFF']] |
1022 | options.append(key) |
1023 | options.append('parton') |
1024 | |
1025 | === modified file 'madgraph/interface/madgraph_interface.py' |
1026 | --- madgraph/interface/madgraph_interface.py 2015-06-26 10:55:43 +0000 |
1027 | +++ madgraph/interface/madgraph_interface.py 2015-07-24 15:59:43 +0000 |
1028 | @@ -1057,7 +1057,8 @@ |
1029 | if not args: |
1030 | if self._done_export: |
1031 | mode = self.find_output_type(self._done_export[0]) |
1032 | - if mode != self._done_export[1]: |
1033 | + |
1034 | + if not self._done_export[1].startswith(mode): |
1035 | print mode, self._done_export[1] |
1036 | raise self.InvalidCmd, \ |
1037 | '%s not valid directory for launch' % self._done_export[0] |
1038 | @@ -1384,10 +1385,6 @@ |
1039 | text = 'No processes generated. Please generate a process first.' |
1040 | raise self.InvalidCmd(text) |
1041 | |
1042 | - |
1043 | - |
1044 | - |
1045 | - |
1046 | if args and args[0][0] != '-': |
1047 | # This is a path |
1048 | path = args.pop(0) |
1049 | @@ -1415,6 +1412,7 @@ |
1050 | self.get_default_path() |
1051 | if '-noclean' not in args and os.path.exists(self._export_dir): |
1052 | args.append('-noclean') |
1053 | + |
1054 | else: |
1055 | if self.options['pythia8_path']: |
1056 | self._export_dir = self.options['pythia8_path'] |
1057 | @@ -1548,7 +1546,7 @@ |
1058 | (self._curr_model['name'], i) |
1059 | auto_path = lambda i: pjoin(self.writing_dir, |
1060 | name_dir(i)) |
1061 | - elif self._export_format == 'standalone': |
1062 | + elif self._export_format.startswith('standalone'): |
1063 | name_dir = lambda i: 'PROC_SA_%s_%s' % \ |
1064 | (self._curr_model['name'], i) |
1065 | auto_path = lambda i: pjoin(self.writing_dir, |
1066 | |
1067 | === modified file 'madgraph/interface/reweight_interface.py' |
1068 | --- madgraph/interface/reweight_interface.py 2015-03-25 01:19:54 +0000 |
1069 | +++ madgraph/interface/reweight_interface.py 2015-07-24 15:59:43 +0000 |
1070 | @@ -20,6 +20,7 @@ |
1071 | import os |
1072 | import re |
1073 | import shutil |
1074 | +import sys |
1075 | import tempfile |
1076 | import time |
1077 | import subprocess |
1078 | @@ -38,6 +39,8 @@ |
1079 | import madgraph.various.banner as banner |
1080 | import madgraph.various.lhe_parser as lhe_parser |
1081 | import madgraph.various.combine_plots as combine_plots |
1082 | +import madgraph.various.cluster as cluster |
1083 | +import madgraph.fks.fks_common as fks_common |
1084 | |
1085 | import models.import_ufo as import_ufo |
1086 | import models.check_param_card as check_param_card |
1087 | @@ -75,8 +78,12 @@ |
1088 | |
1089 | self.events_file = None |
1090 | self.processes = {} |
1091 | + self.second_model = None |
1092 | + self.second_process = None |
1093 | self.mg5cmd = master_interface.MasterCmd() |
1094 | self.seed = None |
1095 | + self.output_type = "default" |
1096 | + self.helicity_reweighting = True |
1097 | |
1098 | if event_path: |
1099 | logger.info("Extracting the banner ...") |
1100 | @@ -91,6 +98,10 @@ |
1101 | |
1102 | def do_import(self, inputfile, allow_madspin=False): |
1103 | """import the event file""" |
1104 | + |
1105 | + args = self.split_arg(inputfile) |
1106 | + if not args: |
1107 | + return self.InvalidCmd, 'import requires arguments' |
1108 | |
1109 | # change directory where to write the output |
1110 | self.options['curr_dir'] = os.path.realpath(os.path.dirname(inputfile)) |
1111 | @@ -121,6 +132,17 @@ |
1112 | self.lhe_input.banner = open(value).read() |
1113 | self.banner = self.lhe_input.get_banner() |
1114 | |
1115 | + #get original cross-section/error |
1116 | + if 'init' not in self.banner: |
1117 | + raise self.InvalidCmd('Event file does not contain init information') |
1118 | + for line in self.banner['init'].split('\n'): |
1119 | + split = line.split() |
1120 | + if len(split) == 4: |
1121 | + cross, error = float(split[0]), float(split[1]) |
1122 | + self.orig_cross = (cross, error) |
1123 | + |
1124 | + |
1125 | + |
1126 | # Check the validity of the banner: |
1127 | if 'slha' not in self.banner: |
1128 | misc.sprint(self.banner) |
1129 | @@ -137,8 +159,8 @@ |
1130 | # load information |
1131 | process = self.banner.get_detail('proc_card', 'generate') |
1132 | if '[' in process: |
1133 | - msg = 'Reweighting options is valid only for LO events' |
1134 | - raise Exception, msg |
1135 | + logger.warning("Remember that the reweighting is performed at Leading Order. NLO precision is not guarantee.") |
1136 | + |
1137 | if not process: |
1138 | msg = 'Invalid proc_card information in the file (no generate line):\n %s' % self.banner['mg5proccard'] |
1139 | raise Exception, msg |
1140 | @@ -149,6 +171,49 @@ |
1141 | logger.info("options: %s" % option) |
1142 | |
1143 | |
1144 | + def get_LO_definition_from_NLO(self, proc): |
1145 | + """return the LO definitions of the process corresponding to the born/real""" |
1146 | + |
1147 | + # split the line definition with the part before and after the NLO tag |
1148 | + process, order, final = re.split('\[\s*(.*)\s*\]', proc) |
1149 | + # add the part without any additional jet. |
1150 | + commandline="add process %s %s --no_warning=duplicate;" % (process, final) |
1151 | + if not order: |
1152 | + #NO NLO tag => nothing to do actually return input |
1153 | + return proc |
1154 | + elif not order.startswith(('virt=','loonly=')): |
1155 | + # OK this a standard NLO process |
1156 | + if '=' in order: |
1157 | + # get the type NLO QCD/QED/... |
1158 | + order = order.split('=',1)[1] |
1159 | + # define the list of particles that are needed for the radiation |
1160 | + pert = fks_common.find_pert_particles_interactions(self.model, |
1161 | + pert_order = order)['soft_particles'] |
1162 | + commandline += "define pert_%s = %s;" % (order.replace(' ',''), ' '.join(map(str,pert)) ) |
1163 | + |
1164 | + # check if we have to increase by one the born order |
1165 | + if '%s=' % order in process: |
1166 | + result=re.split(' ',process) |
1167 | + process='' |
1168 | + for r in result: |
1169 | + if '%s=' % order in r: |
1170 | + ior=re.split('=',r) |
1171 | + r='QCD=%i' % (int(ior[1])+1) |
1172 | + process=process+r+' ' |
1173 | + #handle special tag $ | / @ |
1174 | + result = re.split('([/$@]|\w+=\w+)', process, 1) |
1175 | + if len(result) ==3: |
1176 | + process, split, rest = result |
1177 | + commandline+="add process %s pert_%s %s%s %s --no_warning=duplicate;" % (process, order.replace(' ','') ,split, rest, final) |
1178 | + else: |
1179 | + commandline +='add process %s pert_%s %s --no_warning=duplicate;' % (process,order.replace(' ',''), final) |
1180 | + else: |
1181 | + #just return the input. since this Madloop. |
1182 | + return proc |
1183 | + logger.info(commandline) |
1184 | + return commandline |
1185 | + |
1186 | + |
1187 | def check_events(self): |
1188 | """Check some basic property of the events file""" |
1189 | |
1190 | @@ -202,35 +267,39 @@ |
1191 | pjoin(*[a for a in args if \ |
1192 | a.endswith(os.path.sep)])) |
1193 | |
1194 | - def check_set(self, args): |
1195 | - """checking the validity of the set command""" |
1196 | - |
1197 | - if len(args) < 2: |
1198 | - raise self.InvalidCmd('set command requires at least two argument.') |
1199 | - |
1200 | - valid = ['max_weight','seed','curr_dir'] |
1201 | - if args[0] not in self.options and args[0] not in valid: |
1202 | - raise self.InvalidCmd('Unknown options %s' % args[0]) |
1203 | - |
1204 | - if args[0] == 'max_weight': |
1205 | - try: |
1206 | - args[1] = float(args[1].replace('d','e')) |
1207 | - except ValueError: |
1208 | - raise self.InvalidCmd('second argument should be a real number.') |
1209 | - |
1210 | - elif args[0] == 'BW_effect': |
1211 | - if args[1] in [0, False,'.false.', 'F', 'f', 'False', 'no']: |
1212 | - args[1] = 0 |
1213 | - elif args[1] in [1, True,'.true.', 'T', 't', 'True', 'yes']: |
1214 | - args[1] = 1 |
1215 | + def help_change(self): |
1216 | + """help for change command""" |
1217 | + |
1218 | + print "change model X :use model X for the reweighting" |
1219 | + print "change process p p > e+ e-: use a new process for the reweighting" |
1220 | + print "change process p p > mu+ mu- --add : add one new process to existing ones" |
1221 | + |
1222 | + def do_change(self, line): |
1223 | + """allow to define a second model/processes""" |
1224 | + |
1225 | + args = self.split_arg(line) |
1226 | + if len(args)<2: |
1227 | + logger.critical("not enough argument (need at least two). Discard line") |
1228 | + if args[0] == "model": |
1229 | + self.second_model = " ".join(args[1:]) |
1230 | + if self.has_standalone_dir: |
1231 | + raise Exception, "command %s can only be run before the first launch. please run multiple times the re-weighting module to achieve this. (please quit python between each run)" |
1232 | + elif args[0] == "process": |
1233 | + if self.has_standalone_dir: |
1234 | + raise Exception, "command %s can only be run before the first launch. please run multiple times the re-weighting module to achieve this.(please quit python between each run)" |
1235 | + if args[-1] == "--add": |
1236 | + self.second_process.append(" ".join(args[1:-1])) |
1237 | else: |
1238 | - raise self.InvalidCmd('second argument should be either T or F.') |
1239 | + self.second_process = [" ".join(args[1:])] |
1240 | + elif args[0] == "output": |
1241 | + if args[1] in ['default', '2.0', 'unweight']: |
1242 | + self.output_type = args[1] |
1243 | + elif args[0] == "helicity": |
1244 | + self.helicity_reweighting = banner.ConfigFile.format_variable(args[1], bool, "helicity") |
1245 | + else: |
1246 | + logger.critical("unknown option! %s. Discard line." % args[0]) |
1247 | |
1248 | - elif args[0] == 'curr_dir': |
1249 | - if not os.path.isdir(args[1]): |
1250 | - raise self.InvalidCmd('second argument should be a path to a existing directory') |
1251 | - |
1252 | - |
1253 | + |
1254 | def check_launch(self, args): |
1255 | """check the validity of the launch command""" |
1256 | |
1257 | @@ -258,23 +327,27 @@ |
1258 | model_line = self.banner.get('proc_card', 'full_model_line') |
1259 | |
1260 | if not self.has_standalone_dir: |
1261 | + misc.sprint("recreate standalone directory") |
1262 | self.create_standalone_directory() |
1263 | + |
1264 | + if self.second_model or self.second_process: |
1265 | + rw_dir = pjoin(self.me_dir, 'rw_me_second') |
1266 | + else: |
1267 | + rw_dir = pjoin(self.me_dir, 'rw_me') |
1268 | |
1269 | - ff = open(pjoin(self.me_dir, 'rw_me','Cards', 'param_card.dat'), 'w') |
1270 | + ff = open(pjoin(rw_dir,'Cards', 'param_card.dat'), 'w') |
1271 | ff.write(self.banner['slha']) |
1272 | ff.close() |
1273 | ff = open(pjoin(self.me_dir, 'rw_me','Cards', 'param_card_orig.dat'), 'w') |
1274 | ff.write(self.banner['slha']) |
1275 | ff.close() |
1276 | cmd = common_run_interface.CommonRunCmd.ask_edit_card_static(cards=['param_card.dat'], |
1277 | - ask=self.ask, pwd=pjoin(self.me_dir,'rw_me')) |
1278 | - |
1279 | - new_card = open(pjoin(self.me_dir, 'rw_me', 'Cards', 'param_card.dat')).read() |
1280 | + ask=self.ask, pwd=rw_dir) |
1281 | + new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read() |
1282 | # check if "Auto" is present for a width parameter |
1283 | if "auto" in new_card.lower(): |
1284 | self.mother.check_param_card(pjoin(self.me_dir, 'rw_me', 'Cards', 'param_card.dat')) |
1285 | - new_card = open(pjoin(self.me_dir, 'rw_me', 'Cards', 'param_card.dat')).read() |
1286 | - |
1287 | + new_card = open(pjoin(rw_dir, 'Cards', 'param_card.dat')).read() |
1288 | |
1289 | # Find new tag in the banner and add information if needed |
1290 | if 'initrwgt' in self.banner: |
1291 | @@ -282,7 +355,7 @@ |
1292 | blockpat = re.compile(r'''<weightgroup type=\'mg_reweighting\'\s*>(?P<text>.*?)</weightgroup>''', re.I+re.M+re.S) |
1293 | before, content, after = blockpat.split(self.banner['initrwgt']) |
1294 | header_rwgt_other = before + after |
1295 | - pattern = re.compile('<weight id=\'mg_reweight_(?P<id>\d+)\'>(?P<info>[^<>]*)</weight>', re.S+re.I+re.M) |
1296 | + pattern = re.compile('<weight id=\'mg_reweight_(?P<id>\d+)\'>(?P<info>[^<]*)</weight>', re.S+re.I+re.M) |
1297 | mg_rwgt_info = pattern.findall(content) |
1298 | maxid = 0 |
1299 | for i, diff in mg_rwgt_info: |
1300 | @@ -299,21 +372,38 @@ |
1301 | header_rwgt_other = '' |
1302 | mg_rwgt_info = [] |
1303 | rewgtid = 1 |
1304 | - |
1305 | |
1306 | |
1307 | - |
1308 | # add the reweighting in the banner information: |
1309 | #starts by computing the difference in the cards. |
1310 | s_orig = self.banner['slha'] |
1311 | s_new = new_card |
1312 | - old_param = check_param_card.ParamCard(s_orig.splitlines()) |
1313 | - new_param = check_param_card.ParamCard(s_new.splitlines()) |
1314 | - card_diff = old_param.create_diff(new_param) |
1315 | - if card_diff == '': |
1316 | - raise self.InvalidCmd, 'original card and new card are identical' |
1317 | - mg_rwgt_info.append((str(rewgtid), card_diff)) |
1318 | - |
1319 | + if not self.second_model: |
1320 | + old_param = check_param_card.ParamCard(s_orig.splitlines()) |
1321 | + new_param = check_param_card.ParamCard(s_new.splitlines()) |
1322 | + card_diff = old_param.create_diff(new_param) |
1323 | + if card_diff == '' and not self.second_process: |
1324 | + logger.warning(' REWEIGHTING: original card and new card are identical. Is this really the run that you expect?') |
1325 | + #raise self.InvalidCmd, 'original card and new card are identical' |
1326 | + try: |
1327 | + if old_param['sminputs'].get(3)- new_param['sminputs'].get(3) > 1e-3 * new_param['sminputs'].get(3): |
1328 | + logger.warning("We found different value of alpha_s. Note that the value of alpha_s used is the one associate with the event and not the one from the cards.") |
1329 | + except Exception, error: |
1330 | + logger.debug("error in check of alphas: %s" % str(error)) |
1331 | + pass #this is a security |
1332 | + if not self.second_process: |
1333 | + mg_rwgt_info.append((str(rewgtid), card_diff)) |
1334 | + else: |
1335 | + str_proc = "\n change process ".join([""]+self.second_process) |
1336 | + mg_rwgt_info.append((str(rewgtid), str_proc + '\n'+ card_diff)) |
1337 | + else: |
1338 | + str_info = "change model %s" % self.second_model |
1339 | + if self.second_process: |
1340 | + str_info += "\n change process ".join([""]+self.second_process) |
1341 | + card_diff = str_info |
1342 | + str_info += '\n' + s_new |
1343 | + mg_rwgt_info.append((str(rewgtid), str_info)) |
1344 | + |
1345 | # re-create the banner. |
1346 | self.banner['initrwgt'] = header_rwgt_other |
1347 | self.banner['initrwgt'] += '\n<weightgroup type=\'mg_reweighting\'>\n' |
1348 | @@ -335,15 +425,16 @@ |
1349 | if self.mother: |
1350 | out_path = pjoin(self.mother.me_dir, 'Events', 'reweight.lhe') |
1351 | output2 = open(out_path, 'w') |
1352 | + lha_strategy = self.banner.get_lha_strategy() |
1353 | + self.banner.set_lha_strategy(4*lha_strategy/abs(lha_strategy)) |
1354 | self.banner.write(output2, close_tag=False) |
1355 | + self.banner.set_lha_strategy(lha_strategy) |
1356 | new_banner = banner.Banner(self.banner) |
1357 | if not hasattr(self, 'run_card'): |
1358 | self.run_card = new_banner.charge_card('run_card') |
1359 | self.run_card['run_tag'] = 'reweight_%s' % rewgtid |
1360 | new_banner['slha'] = s_new |
1361 | del new_banner['initrwgt'] |
1362 | - #ensure that original banner is kept untouched |
1363 | - assert new_banner['slha'] != self.banner['slha'] |
1364 | assert 'initrwgt' in self.banner |
1365 | ff = open(pjoin(self.mother.me_dir,'Events',self.mother.run_name, '%s_%s_banner.txt' % \ |
1366 | (self.mother.run_name, self.run_card['run_tag'])),'w') |
1367 | @@ -354,29 +445,69 @@ |
1368 | tag_name = 'mg_reweight_%s' % rewgtid |
1369 | start = time.time() |
1370 | cross = 0 |
1371 | + ratio, ratio_square = 0, 0 # to compute the variance and associate error |
1372 | |
1373 | os.environ['GFORTRAN_UNBUFFERED_ALL'] = 'y' |
1374 | if self.lhe_input.closed: |
1375 | + misc.sprint("using", self.lhe_input.name) |
1376 | self.lhe_input = lhe_parser.EventFile(self.lhe_input.name) |
1377 | + |
1378 | +# Multicore option not really stable -> not use it |
1379 | + nb_core = 1 |
1380 | +# if nb_core >1: |
1381 | +# multicore = cluster.MultiCore(nb_core) |
1382 | + |
1383 | self.lhe_input.seek(0) |
1384 | for event_nb,event in enumerate(self.lhe_input): |
1385 | #control logger |
1386 | - if (event_nb % max(int(10**int(math.log10(float(event_nb)+1))),1000)==0): |
1387 | + if (event_nb % max(int(10**int(math.log10(float(event_nb)+1))),10)==0): |
1388 | running_time = misc.format_timer(time.time()-start) |
1389 | logger.info('Event nb %s %s' % (event_nb, running_time)) |
1390 | if (event_nb==10001): logger.info('reducing number of print status. Next status update in 10000 events') |
1391 | |
1392 | - |
1393 | - weight = self.calculate_weight(event) |
1394 | - cross += weight |
1395 | - event.reweight_data[tag_name] = weight |
1396 | - #write this event with weight |
1397 | - output.write(str(event)) |
1398 | - if self.mother: |
1399 | - event.wgt = weight |
1400 | - event.reweight_data = {} |
1401 | - output2.write(str(event)) |
1402 | - |
1403 | + if nb_core > 1: |
1404 | + # Multicore option not really stable -> not use it |
1405 | + while 1: |
1406 | + if multicore.queue.qsize() < 100 * nb_core: |
1407 | + multicore.submit(self.write_reweighted_event, argument=[event, tag_name]) |
1408 | + break |
1409 | + #else: |
1410 | + # time.sleep(0.001) |
1411 | + continue |
1412 | + else: |
1413 | + weight = self.calculate_weight(event) |
1414 | + cross += weight |
1415 | + ratio += weight/event.wgt |
1416 | + ratio_square += (weight/event.wgt)**2 |
1417 | + if self.output_type == "default": |
1418 | + event.reweight_data[tag_name] = weight |
1419 | + #write this event with weight |
1420 | + output.write(str(event)) |
1421 | + if self.mother: |
1422 | + event.wgt = weight |
1423 | + event.reweight_data = {} |
1424 | + output2.write(str(event)) |
1425 | + |
1426 | + else: |
1427 | + event.wgt = weight |
1428 | + event.reweight_data = {} |
1429 | + if self.mother: |
1430 | + output2.write(str(event)) |
1431 | + else: |
1432 | + output.write(str(event)) |
1433 | + |
1434 | + if nb_core >1: |
1435 | + multicore.wait_time = 1 |
1436 | + multicore.wait(rw_dir,lambda *x:misc.sprint(x)) |
1437 | + for t in multicore.demons: |
1438 | + cross += t.local.cross |
1439 | + |
1440 | + # check normalisation of the events: |
1441 | + if 'event_norm' in self.run_card: |
1442 | + if self.run_card['event_norm'] == 'average': |
1443 | + cross /= event_nb+1 |
1444 | + |
1445 | + |
1446 | running_time = misc.format_timer(time.time()-start) |
1447 | logger.info('All event done (nb_event: %s) %s' % (event_nb+1, running_time)) |
1448 | |
1449 | @@ -393,7 +524,12 @@ |
1450 | results.add_run(run_name, self.run_card, current=True) |
1451 | results.add_detail('nb_event', event_nb+1) |
1452 | results.add_detail('cross', cross) |
1453 | - results.add_detail('error', 'nan') |
1454 | + event_nb +=1 |
1455 | + variance = ratio_square/event_nb - (ratio/event_nb)**2 |
1456 | + orig_cross, orig_error = self.orig_cross |
1457 | + error = variance/math.sqrt(event_nb) * orig_cross + ratio/event_nb * orig_error |
1458 | + |
1459 | + results.add_detail('error', error) |
1460 | self.mother.create_plot(mode='reweight', event_path=output2.name, |
1461 | tag=self.run_card['run_tag']) |
1462 | #modify the html output to add the original run |
1463 | @@ -420,82 +556,177 @@ |
1464 | #self.run_card['run_tag'] = self.run_card['run_tag'][9:] |
1465 | #self.mother.run_name = old_name |
1466 | self.lhe_input.close() |
1467 | - files.mv(output.name, self.lhe_input.name) |
1468 | + if not self.mother or self.output_type != "default" : |
1469 | + target = pjoin(self.mother.me_dir, 'Events', run_name, 'events.lhe') |
1470 | + else: |
1471 | + target = self.lhe_input.name |
1472 | + |
1473 | + if self.output_type == "default": |
1474 | + files.mv(output.name, target) |
1475 | + elif self.output_type == "unweight": |
1476 | + output2.close() |
1477 | + lhe = lhe_parser.EventFile(output2.name) |
1478 | + nb_event = lhe.unweight(target) |
1479 | + if self.mother and hasattr(self.mother, 'results'): |
1480 | + results = self.mother.results |
1481 | + results.add_detail('nb_event', nb_event) |
1482 | + results.current.parton.append('lhe') |
1483 | + |
1484 | + else: |
1485 | + files.mv(output2.name, self.lhe_input.name) |
1486 | + if self.mother and hasattr(self.mother, 'results'): |
1487 | + results = self.mother.results |
1488 | + results.current.parton.append('lhe') |
1489 | + |
1490 | logger.info('Event %s have now the additional weight' % self.lhe_input.name) |
1491 | - logger.info('new cross-section is : %g pb' % cross) |
1492 | + logger.info('new cross-section is : %g pb (indicative error: %g pb)' % (cross,error)) |
1493 | self.terminate_fortran_executables(new_card_only=True) |
1494 | #store result |
1495 | - self.all_cross_section[rewgtid] = cross |
1496 | - |
1497 | - |
1498 | - |
1499 | - |
1500 | - def calculate_weight(self, event): |
1501 | + self.all_cross_section[rewgtid] = (cross, error) |
1502 | + |
1503 | + |
1504 | + def write_reweighted_event(self, event, tag_name, **opt): |
1505 | + """a function for running in multicore""" |
1506 | + |
1507 | + if not hasattr(opt['thread_space'], "calculator"): |
1508 | + opt['thread_space'].calculator = {} |
1509 | + opt['thread_space'].calculator_nbcall = {} |
1510 | + opt['thread_space'].cross = 0 |
1511 | + opt['thread_space'].output = open( self.lhe_input.name +'rw.%s' % opt['thread_id'], 'w') |
1512 | + if self.mother: |
1513 | + out_path = pjoin(self.mother.me_dir, 'Events', 'reweight.lhe.%s' % opt['thread_id']) |
1514 | + opt['thread_space'].output2 = open(out_path, 'w') |
1515 | + |
1516 | + weight = self.calculate_weight(event, space=opt['thread_space']) |
1517 | + opt['thread_space'].cross += weight |
1518 | + if self.output_type == "default": |
1519 | + event.reweight_data[tag_name] = weight |
1520 | + #write this event with weight |
1521 | + opt['thread_space'].output.write(str(event)) |
1522 | + if self.mother: |
1523 | + event.wgt = weight |
1524 | + event.reweight_data = {} |
1525 | + opt['thread_space'].output2.write(str(event)) |
1526 | + else: |
1527 | + event.wgt = weight |
1528 | + event.reweight_data = {} |
1529 | + if self.mother: |
1530 | + opt['thread_space'].output2.write(str(event)) |
1531 | + else: |
1532 | + opt['thread_space'].output.write(str(event)) |
1533 | + |
1534 | + return 0 |
1535 | + |
1536 | + def calculate_weight(self, event, space=None): |
1537 | + """space defines where to find the calculator (in multicore)""" |
1538 | + |
1539 | + if not space: |
1540 | + space = self |
1541 | |
1542 | event.parse_reweight() |
1543 | - w_orig = self.calculate_matrix_element(event, 0) |
1544 | - w_new = self.calculate_matrix_element(event, 1) |
1545 | |
1546 | + w_orig = self.calculate_matrix_element(event, 0, space) |
1547 | + w_new = self.calculate_matrix_element(event, 1, space) |
1548 | + if w_orig == 0: |
1549 | + tag, order = event.get_tag_and_order() |
1550 | + orig_order, Pdir, hel_dict = self.id_to_path[tag] |
1551 | + misc.sprint(w_orig, w_new) |
1552 | + misc.sprint(event) |
1553 | + raise Exception, "Invalid matrix element for original computation (weight=0)" |
1554 | return w_new/w_orig*event.wgt |
1555 | - |
1556 | - |
1557 | - def calculate_matrix_element(self, event, hypp_id): |
1558 | + |
1559 | + @staticmethod |
1560 | + def invert_momenta(p): |
1561 | + """ fortran/C-python do not order table in the same order""" |
1562 | + new_p = [] |
1563 | + for i in range(len(p[0])): new_p.append([0]*len(p)) |
1564 | + for i, onep in enumerate(p): |
1565 | + for j, x in enumerate(onep): |
1566 | + new_p[j][i] = x |
1567 | + return new_p |
1568 | + |
1569 | + def calculate_matrix_element(self, event, hypp_id, space): |
1570 | """routine to return the matrix element""" |
1571 | |
1572 | tag, order = event.get_tag_and_order() |
1573 | - orig_order, Pdir = self.id_to_path[tag] |
1574 | + |
1575 | + if (not self.second_model and not self.second_process) or hypp_id==0: |
1576 | + orig_order, Pdir, hel_dict = self.id_to_path[tag] |
1577 | + else: |
1578 | + orig_order, Pdir, hel_dict = self.id_to_path_second[tag] |
1579 | |
1580 | run_id = (tag, hypp_id) |
1581 | |
1582 | - if run_id in self.calculator: |
1583 | - external = self.calculator[run_id] |
1584 | - self.calculator_nbcall[run_id] += 1 |
1585 | - else: |
1586 | - # create the executable for this param_card |
1587 | - |
1588 | - tmpdir = pjoin(self.me_dir,'rw_me', 'SubProcesses', Pdir) |
1589 | - executable_prod="./check" |
1590 | - if not os.path.exists(pjoin(tmpdir, 'check')): |
1591 | - misc.compile( cwd=tmpdir) |
1592 | - external = Popen(executable_prod, stdout=PIPE, stdin=PIPE, |
1593 | - stderr=STDOUT, cwd=tmpdir) |
1594 | - self.calculator[run_id] = external |
1595 | - self.calculator_nbcall[run_id] = 1 |
1596 | - # set the param_card |
1597 | + |
1598 | + |
1599 | + start = False |
1600 | + if run_id in space.calculator: |
1601 | + external = space.calculator[run_id] |
1602 | + elif (not self.second_model and not self.second_process) or hypp_id==0: |
1603 | + # create the executable for this param_card |
1604 | + subdir = pjoin(self.me_dir,'rw_me ', 'SubProcesses') |
1605 | + if self.me_dir not in sys.path: |
1606 | + sys.path.insert(0,self.me_dir) |
1607 | + Pname = os.path.basename(Pdir) |
1608 | + if hypp_id == 0: |
1609 | + misc.compile(['matrix2py.so'], cwd=Pdir) |
1610 | + mymod = __import__('rw_me.SubProcesses.%s.matrix2py' % Pname, globals(), locals(), [],-1) |
1611 | + S = mymod.SubProcesses |
1612 | + P = getattr(S, Pname) |
1613 | + mymod = P.matrix2py |
1614 | + with misc.chdir(Pdir): |
1615 | + mymod.initialise('param_card_orig.dat') |
1616 | if hypp_id == 1: |
1617 | - external.stdin.write('param_card.dat\n') |
1618 | - elif hypp_id == 0: |
1619 | - external.stdin.write('param_card_orig.dat\n') |
1620 | - #import the value of alphas |
1621 | - external.stdin.write('%g\n' % event.aqcd) |
1622 | - stdin_text = event.get_momenta_str(orig_order) |
1623 | - external.stdin.write(stdin_text) |
1624 | - me_value = external.stdout.readline() |
1625 | - try: |
1626 | - me_value = float(me_value) |
1627 | - except Exception: |
1628 | - print 'ZERO DETECTED' |
1629 | - print stdin_text |
1630 | - print me_value |
1631 | - os.system('lsof -p %s' % external.pid) |
1632 | - me_value = 0 |
1633 | - |
1634 | - if len(self.calculator) > 100: |
1635 | - logger.debug('more than 100 calculator. Perform cleaning') |
1636 | - nb_calls = self.calculator_nbcall.values() |
1637 | - nb_calls.sort() |
1638 | - cut = max([nb_calls[len(nb_calls)//2], 0.001 * nb_calls[-1]]) |
1639 | - for key, external in list(self.calculator.items()): |
1640 | - nb = self.calculator_nbcall[key] |
1641 | - if nb < cut: |
1642 | - external.stdin.close() |
1643 | - external.stdout.close() |
1644 | - external.terminate() |
1645 | - del self.calculator[key] |
1646 | - del self.calculator_nbcall[key] |
1647 | - else: |
1648 | - self.calculator_nbcall[key] = self.calculator_nbcall[key] //10 |
1649 | - |
1650 | + if not os.path.exists(pjoin(Pdir, 'matrix3py.so')): |
1651 | + open(pjoin(Pdir, 'matrix3py.so'),'w').write(open(pjoin(Pdir, 'matrix2py.so') |
1652 | + ).read().replace('matrix2py', 'matrix3py')) |
1653 | + mymod = __import__('rw_me.SubProcesses.%s.matrix3py' % Pname, globals(), locals(), [],-1) |
1654 | + S = mymod.SubProcesses |
1655 | + P = getattr(S, Pname) |
1656 | + mymod = P.matrix3py |
1657 | + with misc.chdir(Pdir): |
1658 | + mymod.initialise('param_card.dat') |
1659 | + space.calculator[run_id] = mymod.get_me |
1660 | + external = space.calculator[run_id] |
1661 | + else: |
1662 | + subdir = pjoin(self.me_dir,'rw_me_second', 'SubProcesses') |
1663 | + if self.me_dir not in sys.path: |
1664 | + sys.path.append(self.me_dir) |
1665 | + |
1666 | + assert hypp_id == 1 |
1667 | + Pname = os.path.basename(Pdir) |
1668 | + misc.compile(['matrix2py.so'], cwd=pjoin(subdir, Pdir)) |
1669 | + with misc.chdir(Pdir): |
1670 | + mymod = __import__("rw_me_second.SubProcesses.%s.matrix2py" % Pname) |
1671 | + reload(mymod) |
1672 | + S = mymod.SubProcesses |
1673 | + P = getattr(S, Pname) |
1674 | + mymod = P.matrix2py |
1675 | + mymod.initialise('param_card.dat') |
1676 | + space.calculator[run_id] = mymod.get_me |
1677 | + external = space.calculator[run_id] |
1678 | + |
1679 | + |
1680 | + p = self.invert_momenta(event.get_momenta(orig_order)) |
1681 | + # add helicity information |
1682 | + |
1683 | + hel_order = event.get_helicity(orig_order) |
1684 | + if self.helicity_reweighting and 9 not in hel_order: |
1685 | + nhel = hel_dict[tuple(hel_order)] |
1686 | + else: |
1687 | + nhel = 0 |
1688 | + |
1689 | + with misc.chdir(Pdir): |
1690 | + with misc.stdchannel_redirected(sys.stdout, os.devnull): |
1691 | + me_value = external(p,event.aqcd, nhel) |
1692 | + # for NLO we have also the stability status code |
1693 | + if isinstance(me_value, tuple): |
1694 | + me_value, code = me_value |
1695 | + #if code points unstability -> returns 0 |
1696 | + hundred_value = (code % 1000) //100 |
1697 | + if hundred_value in [1,4]: |
1698 | + me_value = 0. |
1699 | + |
1700 | return me_value |
1701 | |
1702 | def terminate_fortran_executables(self, new_card_only=False): |
1703 | @@ -504,11 +735,7 @@ |
1704 | for (mode, production) in dict(self.calculator): |
1705 | |
1706 | if new_card_only and production == 0: |
1707 | - continue |
1708 | - external = self.calculator[(mode, production)] |
1709 | - external.stdin.close() |
1710 | - external.stdout.close() |
1711 | - external.terminate() |
1712 | + continue |
1713 | del self.calculator[(mode, production)] |
1714 | |
1715 | def do_quit(self, line): |
1716 | @@ -526,7 +753,7 @@ |
1717 | keys = self.all_cross_section.keys() |
1718 | keys.sort() |
1719 | for key in keys: |
1720 | - logger.info('%s : %s' % (key,self.all_cross_section[key])) |
1721 | + logger.info('%s : %s +- %s pb' % (key,self.all_cross_section[key][0],self.all_cross_section[key][1] )) |
1722 | self.terminate_fortran_executables() |
1723 | |
1724 | def __del__(self): |
1725 | @@ -542,7 +769,7 @@ |
1726 | |
1727 | |
1728 | @misc.mute_logger() |
1729 | - def create_standalone_directory(self): |
1730 | + def create_standalone_directory(self, second=False): |
1731 | """generate the various directory for the weight evaluation""" |
1732 | |
1733 | # 0. clean previous run ------------------------------------------------ |
1734 | @@ -599,9 +826,9 @@ |
1735 | commandline='' |
1736 | for proc in processes: |
1737 | if '[' not in proc: |
1738 | - commandline+="add process %s ;" % proc |
1739 | + commandline += "add process %s ;" % proc |
1740 | else: |
1741 | - raise self.InvalidCmd('NLO processes can\'t be reweight') |
1742 | + commandline += self.get_LO_definition_from_NLO(proc) |
1743 | |
1744 | commandline = commandline.replace('add process', 'generate',1) |
1745 | logger.info(commandline) |
1746 | @@ -610,8 +837,8 @@ |
1747 | mgcmd.exec_cmd(commandline, precmd=True) |
1748 | logger.info('Done %.4g' % (time.time()-start)) |
1749 | self.has_standalone_dir = True |
1750 | + |
1751 | |
1752 | - |
1753 | # 3. Store id to directory information --------------------------------- |
1754 | matrix_elements = mgcmd._curr_matrix_elements.get_matrix_elements() |
1755 | |
1756 | @@ -638,8 +865,142 @@ |
1757 | raise self.InvalidCmd, '2 different process have the same final states. This module can not handle such situation' |
1758 | else: |
1759 | continue |
1760 | - self.id_to_path[tag] = [order, Pdir] |
1761 | - |
1762 | + # build the helicity dictionary |
1763 | + hel_nb = 0 |
1764 | + hel_dict = {9:0} # unknown helicity -> use full ME |
1765 | + for helicities in me.get_helicity_matrix(): |
1766 | + hel_nb +=1 #fortran starts at 1 |
1767 | + hel_dict[tuple(helicities)] = hel_nb |
1768 | + |
1769 | + self.id_to_path[tag] = [order, Pdir, hel_dict] |
1770 | + |
1771 | + # 3. If we need a new model/process------------------------------------- |
1772 | + if self.second_model or self.second_process: |
1773 | + self.create_second_standalone_directory() |
1774 | + |
1775 | + @misc.mute_logger() |
1776 | + def create_second_standalone_directory(self, second=False): |
1777 | + """generate the various directory for the weight evaluation""" |
1778 | + |
1779 | + # 0. clean previous run ------------------------------------------------ |
1780 | + path_me = self.me_dir |
1781 | + try: |
1782 | + shutil.rmtree(pjoin(path_me,'rw_me_second')) |
1783 | + except Exception: |
1784 | + pass |
1785 | + |
1786 | + mgcmd = self.mg5cmd |
1787 | + # 1. Load model--------------------------------------------------------- |
1788 | + if self.second_model: |
1789 | + use_mgdefault= True |
1790 | + complex_mass = False |
1791 | + if ' ' in self.second_model: |
1792 | + args = self.second_model |
1793 | + if '--modelname' in args: |
1794 | + use_mgdefault = False |
1795 | + model_name = args[0] |
1796 | + else: |
1797 | + model_name = self.second_model |
1798 | + self.load_model(model_name, use_mgdefault, complex_mass) |
1799 | + |
1800 | + modelpath = self.model.get('modelpath') |
1801 | + if os.path.basename(modelpath) != mgcmd._curr_model['name']: |
1802 | + name, restrict = mgcmd._curr_model['name'].rsplit('-',1) |
1803 | + if os.path.exists(pjoin(os.path.dirname(modelpath),name, 'restrict_%s.dat' % restrict)): |
1804 | + modelpath = pjoin(os.path.dirname(modelpath), mgcmd._curr_model['name']) |
1805 | + |
1806 | + commandline="import model %s " % modelpath |
1807 | + mgcmd.exec_cmd(commandline) |
1808 | + |
1809 | + # 2. compute the production matrix element ----------------------------- |
1810 | + if self.second_process: |
1811 | + processes = self.second_process |
1812 | + else: |
1813 | + processes = [line[9:].strip() for line in self.banner.proc_card |
1814 | + if line.startswith('generate')] |
1815 | + processes += [' '.join(line.split()[2:]) for line in self.banner.proc_card |
1816 | + if re.search('^\s*add\s+process', line)] |
1817 | + mgcmd.exec_cmd("set group_subprocesses False") |
1818 | + |
1819 | + logger.info('generating the square matrix element for reweighting') |
1820 | + start = time.time() |
1821 | + commandline='' |
1822 | + for proc in processes: |
1823 | + if '[' not in proc: |
1824 | + commandline+="add process %s ;" % proc |
1825 | + elif 'sqrvirt' in proc: |
1826 | + commandline+="add process %s ;" % proc |
1827 | + else: |
1828 | + raise self.InvalidCmd('NLO processes can\'t be reweight (for Loop induced reweighting use [sqrvirt =])') |
1829 | + |
1830 | + commandline = commandline.replace('add process', 'generate',1) |
1831 | + logger.info(commandline) |
1832 | + mgcmd.exec_cmd(commandline, precmd=True) |
1833 | + |
1834 | + matrix_elements = mgcmd._curr_matrix_elements.get_matrix_elements() |
1835 | + |
1836 | + commandline = 'output standalone_rw %s' % pjoin(path_me,'rw_me_second') |
1837 | + mgcmd.exec_cmd(commandline, precmd=True) |
1838 | + logger.info('Done %.4g' % (time.time()-start)) |
1839 | + |
1840 | + # 3. Store id to directory information --------------------------------- |
1841 | + matrix_elements = mgcmd._curr_matrix_elements.get_matrix_elements() |
1842 | + |
1843 | + self.id_to_path_second = {} |
1844 | + to_check = [] # list of tag that do not have a Pdir at creation time. |
1845 | + for me in matrix_elements: |
1846 | + for proc in me.get('processes'): |
1847 | + initial = [] #filled in the next line |
1848 | + final = [l.get('id') for l in proc.get('legs')\ |
1849 | + if l.get('state') or initial.append(l.get('id'))] |
1850 | + order = (initial, final) |
1851 | + tag = proc.get_initial_final_ids() |
1852 | + decay_finals = proc.get_final_ids_after_decay() |
1853 | + |
1854 | + if tag[1] != decay_finals: |
1855 | + order = (initial, list(decay_finals)) |
1856 | + decay_finals.sort() |
1857 | + tag = (tag[0], tuple(decay_finals)) |
1858 | + Pdir = pjoin(path_me, 'rw_me_second', 'SubProcesses', |
1859 | + 'P%s' % me.get('processes')[0].shell_string()) |
1860 | + if not os.path.exists(Pdir): |
1861 | + to_check.append(tag) |
1862 | + continue |
1863 | + if tag in self.id_to_path_second: |
1864 | + if not Pdir == self.id_to_path_second[tag][1]: |
1865 | + misc.sprint(tag, Pdir, self.id_to_path_second[tag][1]) |
1866 | + raise self.InvalidCmd, '2 different process have the same final states. This module can not handle such situation' |
1867 | + else: |
1868 | + continue |
1869 | + |
1870 | + # build the helicity dictionary |
1871 | + hel_nb = 0 |
1872 | + hel_dict = {9:0} # unknown helicity -> use full ME |
1873 | + for helicities in me.get_helicity_matrix(): |
1874 | + hel_nb +=1 #fortran starts at 1 |
1875 | + hel_dict[tuple(helicities)] = hel_nb |
1876 | + self.id_to_path_second[tag] = [order, Pdir, hel_dict] |
1877 | + |
1878 | + for tag in to_check: |
1879 | + if tag not in self.id_to_path: |
1880 | + logger.warning("no valid path for %s" % (tag,)) |
1881 | + #raise self.InvalidCmd, "no valid path for %s" % (tag,) |
1882 | + |
1883 | + # 4. Check MadLoopParam |
1884 | + if os.path.exists(pjoin(path_me, 'rw_me_second', 'Cards', 'MadLoopParams.dat')): |
1885 | + MLCard = banner.MadLoopParam(pjoin(path_me, 'rw_me_second', 'Cards', 'MadLoopParams.dat')) |
1886 | + MLCard.set('WriteOutFilters', False) |
1887 | + MLCard.set('UseLoopFilter', False) |
1888 | + MLCard.set("DoubleCheckHelicityFilter", False) |
1889 | + MLCard.set("HelicityFilterLevel", 0) |
1890 | + MLCard.write(pjoin(path_me, 'rw_me_second', 'SubProcesses', 'MadLoopParams.dat'), |
1891 | + pjoin(path_me, 'rw_me_second', 'Cards', 'MadLoopParams.dat'), |
1892 | + commentdefault=False) |
1893 | + |
1894 | + |
1895 | + |
1896 | + |
1897 | + |
1898 | |
1899 | def load_model(self, name, use_mg_default, complex_mass=False): |
1900 | """load the model""" |
1901 | |
1902 | === modified file 'madgraph/iolibs/export_v4.py' |
1903 | --- madgraph/iolibs/export_v4.py 2015-07-01 22:02:22 +0000 |
1904 | +++ madgraph/iolibs/export_v4.py 2015-07-24 15:59:43 +0000 |
1905 | @@ -1776,9 +1776,6 @@ |
1906 | if self.format == 'standalone': |
1907 | shutil.copy(pjoin(self.mgme_dir, 'madgraph', 'iolibs', 'template_files', 'check_sa.f'), |
1908 | pjoin(self.dir_path, 'SubProcesses', 'check_sa.f')) |
1909 | - elif self.format == 'standalone_rw': |
1910 | - shutil.copy(pjoin(self.mgme_dir, 'madgraph', 'iolibs', 'template_files', 'driver_reweight.f'), |
1911 | - pjoin(self.dir_path, 'SubProcesses', 'check_sa.f')) |
1912 | |
1913 | # Add file in Source |
1914 | shutil.copy(pjoin(temp_dir, 'Source', 'make_opts'), |
1915 | @@ -1795,8 +1792,16 @@ |
1916 | |
1917 | super(ProcessExporterFortranSA,self).export_model_files(model_path) |
1918 | # Add the routine update_as_param in v4 model |
1919 | - # This is a function created in the UFO |
1920 | - |
1921 | + # This is a function created in the UFO |
1922 | + text=""" |
1923 | + subroutine update_as_param() |
1924 | + call setpara('param_card.dat',.false.) |
1925 | + return |
1926 | + end |
1927 | + """ |
1928 | + ff = open(os.path.join(self.dir_path, 'Source', 'MODEL', 'couplings.f'),'a') |
1929 | + ff.write(text) |
1930 | + ff.close() |
1931 | |
1932 | text = open(pjoin(self.dir_path,'SubProcesses','check_sa.f')).read() |
1933 | text = text.replace('call setpara(\'param_card.dat\')', 'call setpara(\'param_card.dat\', .true.)') |
1934 | @@ -1836,6 +1841,9 @@ |
1935 | history.write(output_file) |
1936 | |
1937 | ProcessExporterFortran.finalize_v4_directory(self, matrix_elements, history, makejpg, online, compiler) |
1938 | + open(pjoin(self.dir_path,'__init__.py'),'w') |
1939 | + open(pjoin(self.dir_path,'SubProcesses','__init__.py'),'w') |
1940 | + |
1941 | |
1942 | def compiler_choice(self, compiler): |
1943 | """ Different daughter classes might want different compilers. |
1944 | @@ -2119,7 +2127,7 @@ |
1945 | matrix_template = 'matrix_standalone_msP_v4.inc' |
1946 | elif self.opt['export_format']=='standalone_msF': |
1947 | matrix_template = 'matrix_standalone_msF_v4.inc' |
1948 | - elif self.opt['export_format']=='matchbox': |
1949 | + elif self.opt['export_format']=='matchbox': |
1950 | replace_dict["proc_prefix"] = 'MG5_%i_' % matrix_element.get('processes')[0].get('id') |
1951 | replace_dict["color_information"] = self.get_color_string_lines(matrix_element) |
1952 | |
1953 | @@ -5995,7 +6003,9 @@ |
1954 | 'fortran_compiler':cmd.options['fortran_compiler'], |
1955 | 'output_dependencies':cmd.options['output_dependencies'], |
1956 | 'SubProc_prefix':'P', |
1957 | - 'compute_color_flows':cmd.options['loop_color_flows']} |
1958 | + 'compute_color_flows':cmd.options['loop_color_flows'], |
1959 | + 'mode': 'reweight' if cmd._export_format == "standalone_rw" else '' |
1960 | + } |
1961 | |
1962 | if output_type.startswith('madloop'): |
1963 | import madgraph.loop.loop_exporters as loop_exporters |
1964 | |
1965 | === modified file 'madgraph/iolibs/file_writers.py' |
1966 | --- madgraph/iolibs/file_writers.py 2014-11-25 02:14:42 +0000 |
1967 | +++ madgraph/iolibs/file_writers.py 2015-07-24 15:59:43 +0000 |
1968 | @@ -192,7 +192,7 @@ |
1969 | # Private variables |
1970 | __indent = 0 |
1971 | __keyword_list = [] |
1972 | - __comment_pattern = re.compile(r"^(\s*#|c$|(c\s+([^=]|$)))", re.IGNORECASE) |
1973 | + __comment_pattern = re.compile(r"^(\s*#|c$|(c\s+([^=]|$))|cf2py)", re.IGNORECASE) |
1974 | |
1975 | def write_line(self, line): |
1976 | """Write a fortran line, with correct indent and line splits""" |
1977 | @@ -299,6 +299,10 @@ |
1978 | # write_comment_line must have a single line as argument |
1979 | assert(isinstance(line, str) and line.find('\n') == -1) |
1980 | |
1981 | + if line.startswith('F2PY'): |
1982 | + return ["C%s\n" % line.strip()] |
1983 | + |
1984 | + |
1985 | res_lines = [] |
1986 | |
1987 | # This is a comment |
1988 | |
1989 | === removed file 'madgraph/iolibs/template_files/driver_reweight.f' |
1990 | --- madgraph/iolibs/template_files/driver_reweight.f 2013-06-25 06:14:17 +0000 |
1991 | +++ madgraph/iolibs/template_files/driver_reweight.f 1970-01-01 00:00:00 +0000 |
1992 | @@ -1,103 +0,0 @@ |
1993 | - PROGRAM DRIVER |
1994 | -C************************************************************************** |
1995 | -C THIS IS THE DRIVER FOR CHECKING THE STANDALONE MATRIX ELEMENT. |
1996 | -C IT USES A SIMPLE PHASE SPACE GENERATOR |
1997 | -C Fabio Maltoni - 3rd Febraury 2007 |
1998 | -C Modified Version for the decay Package (Pierre Artoisenet) |
1999 | -C************************************************************************** |
2000 | - IMPLICIT NONE |
2001 | -C |
2002 | -C CONSTANTS |
2003 | -C |
2004 | - REAL*8 ZERO |
2005 | - PARAMETER (ZERO=0D0) |
2006 | -C |
2007 | -C INCLUDE FILES |
2008 | -C |
2009 | -C--- the include file with the values of the parameters and masses |
2010 | - INCLUDE "coupl.inc" |
2011 | -C--- integer nexternal ! number particles (incoming+outgoing) in the me |
2012 | - INCLUDE "nexternal.inc" |
2013 | -C--- particle masses |
2014 | - REAL*8 PMASS(NEXTERNAL) |
2015 | -C--- integer n_max_cg |
2016 | - INCLUDE "ngraphs.inc" !how many diagrams (could be useful to know...) |
2017 | - |
2018 | - DOUBLE PRECISION AMP2(n_max_cg) |
2019 | - COMMON/TO_AMPS/ AMP2 |
2020 | - |
2021 | - |
2022 | -C |
2023 | -C LOCAL |
2024 | -C |
2025 | - INTEGER I,J,K |
2026 | - REAL*8 P(0:3,NEXTERNAL) ! four momenta. Energy is the zeroth component. |
2027 | - REAL*8 SQRTS,MATELEM ! sqrt(s)= center of mass energy |
2028 | - REAL*8 PIN(0:3), POUT(0:3) |
2029 | - CHARACTER*120 BUFF(NEXTERNAL) |
2030 | - CHARACTER*200 param_card |
2031 | - real*8 new_alphas |
2032 | - real*8 pi |
2033 | -C |
2034 | -C EXTERNAL |
2035 | -C |
2036 | - REAL*8 DOT |
2037 | - EXTERNAL DOT |
2038 | - |
2039 | - pi = 3.141592653589793d0 |
2040 | -C----- |
2041 | -C BEGIN CODE |
2042 | -C----- |
2043 | -C |
2044 | -C--- INITIALIZATION CALLS |
2045 | -C |
2046 | -c--- Call to initialize the values of the couplings, masses and widths |
2047 | -c used in the evaluation of the matrix element. The primary parameters of the |
2048 | -c models are read from Cards/param_card.dat. The secondary parameters are calculated |
2049 | -c in Source/MODEL/couplings.f. The values are stored in common blocks that are listed |
2050 | -c in coupl.inc . |
2051 | - read(*,*) param_card |
2052 | - call setpara(param_card) !first call to setup the paramaters |
2053 | - |
2054 | -c include "../parameters.inc" |
2055 | - call coup() |
2056 | - include "pmass.inc" !set up masses |
2057 | - |
2058 | -c read phase-space point (main loop) |
2059 | -1 read(*,*) new_alphas |
2060 | - G = 2* DSQRT(new_alphas*pi) |
2061 | - call UPDATE_AS_PARAM() |
2062 | - do i=1,nexternal |
2063 | - read (*,*) P(0,i),P(1,i),P(2,i),P(3,i) |
2064 | - enddo |
2065 | - |
2066 | - |
2067 | - |
2068 | -c |
2069 | -c Now we can call the matrix element! |
2070 | -c |
2071 | - |
2072 | - CALL SMATRIX(P,MATELEM) |
2073 | -c |
2074 | - |
2075 | -c write (*,*) "Matrix element = ", MATELEM, " GeV^",-(2*nexternal-8) |
2076 | -c write (*,*) "-----------------------------------------------------------------------------" |
2077 | - |
2078 | - write(*,*) MATELEM |
2079 | - call flush() |
2080 | - goto 1 |
2081 | - |
2082 | - end |
2083 | - |
2084 | - |
2085 | - |
2086 | - |
2087 | - double precision function dot(p1,p2) |
2088 | -C**************************************************************************** |
2089 | -C 4-Vector Dot product |
2090 | -C**************************************************************************** |
2091 | - implicit none |
2092 | - double precision p1(0:3),p2(0:3) |
2093 | - dot=p1(0)*p2(0)-p1(1)*p2(1)-p1(2)*p2(2)-p1(3)*p2(3) |
2094 | - end |
2095 | - |
2096 | |
2097 | === modified file 'madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc' |
2098 | --- madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc 2015-03-10 10:10:05 +0000 |
2099 | +++ madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc 2015-07-24 15:59:43 +0000 |
2100 | @@ -336,7 +336,7 @@ |
2101 | 109 CONTINUE |
2102 | CLOSE(1) |
2103 | IF(BOOTANDSTOP) THEN |
2104 | - WRITE(*,*) 'Stopped by user request.' |
2105 | + WRITE(*,*) '##Stopped by user request.' |
2106 | STOP |
2107 | ENDIF |
2108 | |
2109 | @@ -622,8 +622,8 @@ |
2110 | ELSEIF (.NOT.HELDOUBLECHECKED)THEN |
2111 | IF ((.NOT.GOODHEL(HELPICKED)).AND.(.NOT.%(proc_prefix)sISZERO(ABS(ANS(1))+ABS(ANS(2))+ABS(ANS(3)),REF/DBLE(NCOMB),-1))) THEN |
2112 | write(*,*) '##W15 Helicity filter could not be successfully double checked.' |
2113 | - write(*,*) 'One reason for this is that you have changed sensible parameters which affected what are the zero helicity configurations.' |
2114 | - write(*,*) 'MadLoop will try to reset the Helicity filter with the next PS points it receives.' |
2115 | + write(*,*) '##One reason for this is that you have changed sensible parameters which affected what are the zero helicity configurations.' |
2116 | + write(*,*) '##MadLoop will try to reset the Helicity filter with the next PS points it receives.' |
2117 | NTRY=0 |
2118 | OPEN(30,FILE=HelFilterFN,err=349) |
2119 | 349 CONTINUE |
2120 | @@ -721,19 +721,19 @@ |
2121 | NEPS=NEPS+1 |
2122 | CALL %(proc_prefix)sCOMPUTE_ACCURACY(DP_RES,N_DP_EVAL,TEMP1,TEMP) |
2123 | WRITE(*,*) '##W03 WARNING An unstable PS point was', ' detected.' |
2124 | - WRITE(*,*) '(DP,QP) accuracies : (',TEMP1,',',ACC,')' |
2125 | - WRITE(*,*) 'Best estimate (fin,1eps,2eps) :',(ANS(I),I=1,3) |
2126 | + WRITE(*,*) '##(DP,QP) accuracies : (',TEMP1,',',ACC,')' |
2127 | + WRITE(*,*) '##Best estimate (fin,1eps,2eps) :',(ANS(I),I=1,3) |
2128 | IF(NEPS.LE.10) THEN |
2129 | - WRITE(*,*) 'Double precision evaluations :',(DP_RES(1,I),I=1,N_DP_EVAL) |
2130 | - WRITE(*,*) 'Quad precision evaluations :',(QP_RES(1,I),I=1,N_QP_EVAL) |
2131 | - WRITE(*,*) 'PS point specification :' |
2132 | - WRITE(*,*) 'Renormalization scale MU_R=',MU_R |
2133 | + WRITE(*,*) '##Double precision evaluations :',(DP_RES(1,I),I=1,N_DP_EVAL) |
2134 | + WRITE(*,*) '##Quad precision evaluations :',(QP_RES(1,I),I=1,N_QP_EVAL) |
2135 | + WRITE(*,*) '##PS point specification :' |
2136 | + WRITE(*,*) '##Renormalization scale MU_R=',MU_R |
2137 | DO I=1,NEXTERNAL |
2138 | WRITE (*,'(i2,1x,4e27.17)') i, P(0,i),P(1,i),P(2,i),P(3,i) |
2139 | ENDDO |
2140 | ENDIF |
2141 | IF(NEPS.EQ.10) THEN |
2142 | - WRITE(*,*) 'Further output of the details of these unstable PS points will now be suppressed.' |
2143 | + WRITE(*,*) '##Further output of the details of these unstable PS points will now be suppressed.' |
2144 | ENDIF |
2145 | ENDIF |
2146 | ELSE |
2147 | @@ -883,7 +883,7 @@ |
2148 | ENDIF |
2149 | |
2150 | IF(N_DP_EVALS.GT.20.OR.N_QP_EVALS.GT.20) THEN |
2151 | - WRITE(*,*) 'ERROR:: Increase hardcoded maxstabilitylength.' |
2152 | + WRITE(*,*) '##ERROR:: Increase hardcoded maxstabilitylength.' |
2153 | STOP |
2154 | ENDIF |
2155 | |
2156 | @@ -927,7 +927,7 @@ |
2157 | C ---------- |
2158 | C BEGIN CODE |
2159 | C ---------- |
2160 | - write(*,*) 'WARNING:: Ignored, the possibility of selecting specific squared order contributions is not available in the default mode.' |
2161 | + write(*,*) '##WARNING:: Ignored, the possibility of selecting specific squared order contributions is not available in the default mode.' |
2162 | |
2163 | END |
2164 | |
2165 | |
2166 | === added file 'madgraph/iolibs/template_files/loop_optimized/check_py.f' |
2167 | --- madgraph/iolibs/template_files/loop_optimized/check_py.f 1970-01-01 00:00:00 +0000 |
2168 | +++ madgraph/iolibs/template_files/loop_optimized/check_py.f 2015-07-24 15:59:43 +0000 |
2169 | @@ -0,0 +1,112 @@ |
2170 | + Subroutine Initialise(path) |
2171 | + |
2172 | + CHARACTER(128) path |
2173 | +CF2PY intent(in):path |
2174 | + |
2175 | +C INCLUDE FILES |
2176 | +C |
2177 | +C the include file with the values of the parameters and masses |
2178 | +C |
2179 | + INCLUDE 'coupl.inc' |
2180 | + CALL SETPARA(path) |
2181 | + return |
2182 | + end |
2183 | + |
2184 | + SUBROUTINE GET_ME(P, ALPHAS, NHEL , ANS,RETURNCODE) |
2185 | + IMPLICIT NONE |
2186 | +C |
2187 | +C CONSTANTS |
2188 | +C |
2189 | + REAL*8 ZERO |
2190 | + PARAMETER (ZERO=0D0) |
2191 | + |
2192 | +C integer nexternal C number particles (incoming+outgoing) in the |
2193 | +C me |
2194 | + include 'nexternal.inc' |
2195 | + |
2196 | +C CHARACTER(512) MADLOOPRESOURCEPATH |
2197 | +C |
2198 | +C INCLUDE FILES |
2199 | +C |
2200 | +C the include file with the values of the parameters and masses |
2201 | +C |
2202 | + INCLUDE 'coupl.inc' |
2203 | +C particle masses |
2204 | + REAL*8 PMASS(NEXTERNAL) |
2205 | +C integer n_max_cg |
2206 | + INCLUDE 'ngraphs.inc' |
2207 | + INCLUDE 'nsquaredSO.inc' |
2208 | + |
2209 | +C LOCAL |
2210 | +C |
2211 | + INTEGER I |
2212 | +C four momenta. Energy is the zeroth component. |
2213 | + REAL*8 P(0:3,NEXTERNAL) |
2214 | + INTEGER MATELEM_ARRAY_DIM |
2215 | + REAL*8 , ALLOCATABLE :: MATELEM(:,:) |
2216 | + INTEGER RETURNCODE |
2217 | + INTEGER NSQUAREDSO_LOOP |
2218 | + REAL*8 , ALLOCATABLE :: PREC_FOUND(:) |
2219 | + |
2220 | + DOUBLE PRECISION ANS |
2221 | + INTEGER NHEL |
2222 | + DOUBLE PRECISION ALPHAS |
2223 | +CF2PY INTENT(OUT) :: ANS |
2224 | +CF2PY INTENT(OUT) :: RETURNCODE |
2225 | +CF2PY INTENT(IN) :: NHEL |
2226 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
2227 | +CF2PY INTENT(IN) :: ALPHAS |
2228 | + |
2229 | + |
2230 | +C |
2231 | +C GLOBAL VARIABLES |
2232 | +C |
2233 | +C This is from ML code for the list of split orders selected by |
2234 | +C the process definition |
2235 | +C |
2236 | + INTEGER NLOOPCHOSEN |
2237 | + CHARACTER*20 CHOSEN_LOOP_SO_INDICES(NSQUAREDSO) |
2238 | + LOGICAL CHOSEN_LOOP_SO_CONFIGS(NSQUAREDSO) |
2239 | + COMMON/%(proc_prefix)sCHOSEN_LOOP_SQSO/CHOSEN_LOOP_SO_CONFIGS |
2240 | +C |
2241 | +C BEGIN CODE |
2242 | +C |
2243 | + CALL %(proc_prefix)sGET_ANSWER_DIMENSION(MATELEM_ARRAY_DIM) |
2244 | + ALLOCATE(MATELEM(0:3,0:MATELEM_ARRAY_DIM)) |
2245 | + CALL %(proc_prefix)sGET_NSQSO_LOOP(NSQUAREDSO_LOOP) |
2246 | + ALLOCATE(PREC_FOUND(0:NSQUAREDSO_LOOP)) |
2247 | + INCLUDE 'pmass.inc' |
2248 | + |
2249 | +C Start by initializing what is the squared split orders indices |
2250 | +C chosen |
2251 | + NLOOPCHOSEN=0 |
2252 | + DO I=1,NSQUAREDSO |
2253 | + IF (CHOSEN_LOOP_SO_CONFIGS(I)) THEN |
2254 | + NLOOPCHOSEN=NLOOPCHOSEN+1 |
2255 | + WRITE(CHOSEN_LOOP_SO_INDICES(NLOOPCHOSEN),'(I3,A2)') I,'L)' |
2256 | + ENDIF |
2257 | + ENDDO |
2258 | + |
2259 | +C Update the couplings with the new MU_R |
2260 | + CALL UPDATE_AS_PARAM2(2*P(0,1)*P(0,2), ALPHAS) |
2261 | + |
2262 | +C |
2263 | +C Now we can call the matrix element |
2264 | +C |
2265 | + if (NHEL.eq.0) then |
2266 | + CALL %(proc_prefix)sSLOOPMATRIX_THRES(P,MATELEM,-1.0D0, PREC_FOUND, RETURNCODE) |
2267 | + else |
2268 | + CALL %(proc_prefix)sSLOOPMATRIXHEL_THRES(P,NHEL, MATELEM,-1.0D0, PREC_FOUND, RETURNCODE) |
2269 | + endif |
2270 | + |
2271 | +c loop induce -> only finite part |
2272 | + ANS = MATELEM(1,0) |
2273 | + |
2274 | + END |
2275 | + |
2276 | + |
2277 | + |
2278 | + |
2279 | + |
2280 | + |
2281 | + |
2282 | |
2283 | === modified file 'madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc' |
2284 | --- madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc 2015-06-13 23:01:58 +0000 |
2285 | +++ madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc 2015-07-24 15:59:43 +0000 |
2286 | @@ -436,15 +436,15 @@ |
2287 | ENDIF |
2288 | ## if(LoopInduced){ |
2289 | IF(.NOT.LoopInitStartOver) THEN |
2290 | - WRITE(*,*) 'INFO: For loop-induced processes it is preferable to always set the parameter LoopInitStartOver to True, so it is hard-set here to True.' |
2291 | + WRITE(*,*) '##INFO: For loop-induced processes it is preferable to always set the parameter LoopInitStartOver to True, so it is hard-set here to True.' |
2292 | LoopInitStartOver=.TRUE. |
2293 | ENDIF |
2294 | IF(.NOT.HelInitStartOver) THEN |
2295 | - WRITE(*,*) "INFO: For loop-induced processes it is preferable to always set the parameter HelInitStartOver to True, so it is hard-set here to True.' |
2296 | + WRITE(*,*) "##INFO: For loop-induced processes it is preferable to always set the parameter HelInitStartOver to True, so it is hard-set here to True.' |
2297 | HelInitStartOver=.TRUE. |
2298 | ENDIF |
2299 | IF (CheckCycle.LT.5) THEN |
2300 | - WRITE(*,*) "INFO: Due to the dynamic setting of the reference scale for contributions comparisons, it is preferable to set the parameter CheckCycle to a value larger than 4, so it is hard-set here to 5.' |
2301 | + WRITE(*,*) "##INFO: Due to the dynamic setting of the reference scale for contributions comparisons, it is preferable to set the parameter CheckCycle to a value larger than 4, so it is hard-set here to 5.' |
2302 | CheckCycle=5 |
2303 | ENDIF |
2304 | ## } |
2305 | @@ -452,7 +452,7 @@ |
2306 | C Make sure that NROTATIONS_QP and NROTATIONS_DP are set to zero if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
2307 | if(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
2308 | IF(NROTATIONS_DP.NE.0.or.NROTATIONS_QP.NE.0) THEN |
2309 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disabled, so MadLoop automatically resets NROTATIONS_DP and NROTATIONS_QP to 0.' |
2310 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING is disabled, so MadLoop automatically resets NROTATIONS_DP and NROTATIONS_QP to 0.' |
2311 | NROTATIONS_QP=0 |
2312 | NROTATIONS_DP=0 |
2313 | ENDIF |
2314 | @@ -542,7 +542,7 @@ |
2315 | ENDDO |
2316 | ENDDO |
2317 | IF(BOOTANDSTOP) THEN |
2318 | - WRITE(*,*) 'Stopped by user request.' |
2319 | + WRITE(*,*) '##Stopped by user request.' |
2320 | stop |
2321 | ENDIF |
2322 | ENDIF |
2323 | @@ -1304,8 +1304,8 @@ |
2324 | IF (GOODHEL(HELPICKED).EQ.-HELOFFSET) THEN |
2325 | IF (.NOT.%(proc_prefix)sIsZero(DABS(HELSAVED(1,HELPICKED))+DABS(HELSAVED(2,HELPICKED))+DABS(HELSAVED(2,HELPICKED)),REF/DBLE(NCOMB),-1,-1)) THEN |
2326 | write(*,*) '##W15 Helicity filter could not be successfully double checked.' |
2327 | - write(*,*) 'One reason for this is that you might have changed sensible parameters which affected what are the zero helicity configurations.' |
2328 | - write(*,*) 'MadLoop will try to reset the Helicity filter with the next PS points it receives.' |
2329 | + write(*,*) '##One reason for this is that you might have changed sensible parameters which affected what are the zero helicity configurations.' |
2330 | + write(*,*) '##MadLoop will try to reset the Helicity filter with the next PS points it receives.' |
2331 | NTRY=0 |
2332 | OPEN(29,FILE=HelFilterFN,err=348) |
2333 | 348 CONTINUE |
2334 | @@ -1315,8 +1315,8 @@ |
2335 | IF (GOODHEL(HELPICKED).LT.-HELOFFSET.AND.NTRY.NE.0) THEN |
2336 | IF(%(proc_prefix)sISSAME(HELSAVED(1,HELPICKED),HELSAVED(1,ABS(GOODHEL(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
2337 | write(*,*) '##W15 Helicity filter could not be successfully double checked.' |
2338 | - write(*,*) 'One reason for this is that you might have changed sensible parameters which affected the helicity dependance relations.' |
2339 | - write(*,*) 'MadLoop will try to reset the Helicity filter with the next PS points it receives.' |
2340 | + write(*,*) '##One reason for this is that you might have changed sensible parameters which affected the helicity dependance relations.' |
2341 | + write(*,*) '##MadLoop will try to reset the Helicity filter with the next PS points it receives.' |
2342 | NTRY=0 |
2343 | OPEN(30,FILE=HelFilterFN,err=349) |
2344 | 349 CONTINUE |
2345 | @@ -1532,12 +1532,12 @@ |
2346 | IF(NEPS.LE.10) THEN |
2347 | WRITE(*,*) '##W03 WARNING An unstable PS point was', ' detected.' |
2348 | IF (NSQUAREDSO.NE.1) THEN |
2349 | - WRITE(*,*) 'Accuracies for each split order, starting with the summed case' |
2350 | - WRITE(*,*) 'DP accuracies (for each split order): ',(TEMP1(I),I=0,NSQUAREDSO) |
2351 | - WRITE(*,*) 'QP accuracies (for each split order): ',(ACC(I),I=0,NSQUAREDSO) |
2352 | + WRITE(*,*) '##Accuracies for each split order, starting with the summed case' |
2353 | + WRITE(*,*) '##DP accuracies (for each split order): ',(TEMP1(I),I=0,NSQUAREDSO) |
2354 | + WRITE(*,*) '##QP accuracies (for each split order): ',(ACC(I),I=0,NSQUAREDSO) |
2355 | ELSE |
2356 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
2357 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
2358 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
2359 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
2360 | ENDIF |
2361 | DO J=0,NSQUAREDSO |
2362 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
2363 | |
2364 | === modified file 'madgraph/iolibs/template_files/makefile_sa_f_sp' |
2365 | --- madgraph/iolibs/template_files/makefile_sa_f_sp 2013-10-30 08:15:19 +0000 |
2366 | +++ madgraph/iolibs/template_files/makefile_sa_f_sp 2015-07-24 15:59:43 +0000 |
2367 | @@ -1,5 +1,5 @@ |
2368 | include ../../Source/make_opts |
2369 | - |
2370 | +SHELL = /bin/bash |
2371 | LIBDIR = ../../lib/ |
2372 | PROG = check |
2373 | PROG_SPLITORDERS = check_sa_born_splitOrders |
2374 | @@ -15,4 +15,17 @@ |
2375 | $(PROG_SPLITORDERS): $(PROCESS) $(CHECK_SA_SPLITORDERS) makefile $(LIBS) |
2376 | $(FC) $(FFLAGS) -o $(PROG) $(PROCESS) $(CHECK_SA_SPLITORDERS) $(LINKLIBS) |
2377 | |
2378 | -driver.f: nexternal.inc pmass.inc ngraphs.inc coupl.inc |
2379 | \ No newline at end of file |
2380 | +driver.f: nexternal.inc pmass.inc ngraphs.inc coupl.inc |
2381 | + |
2382 | +# For python linking (require f2py part of numpy) |
2383 | +matrix2py.so: matrix.f makefile $(LIBS) |
2384 | + touch __init__.py |
2385 | + @ if [ -f `which f2py` ]; then \ |
2386 | + f2py $(LINKLIBS) -c matrix.f -m matrix2py;\ |
2387 | + else \ |
2388 | + if [ -f `which f2py-2.7` ]; then \ |
2389 | + f2py-2.7 $(LINKLIBS) -c matrix.f -m matrix2py;\ |
2390 | + else \ |
2391 | + f2py-2.6 $(LINKLIBS) -c matrix.f -m matrix2py;\ |
2392 | + fi; \ |
2393 | + fi |
2394 | \ No newline at end of file |
2395 | |
2396 | === modified file 'madgraph/iolibs/template_files/matrix_standalone_v4.inc' |
2397 | --- madgraph/iolibs/template_files/matrix_standalone_v4.inc 2013-12-07 23:38:41 +0000 |
2398 | +++ madgraph/iolibs/template_files/matrix_standalone_v4.inc 2015-07-24 15:59:43 +0000 |
2399 | @@ -7,6 +7,10 @@ |
2400 | PARAMETER (NEXTERNAL=%(nexternal)d) |
2401 | INTEGER NCOMB |
2402 | PARAMETER ( NCOMB=%(ncomb)d) |
2403 | +CF2PY INTENT(OUT) :: ANS |
2404 | +CF2PY INTENT(IN) :: HEL |
2405 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
2406 | + |
2407 | C |
2408 | C ARGUMENTS |
2409 | C |
2410 | @@ -52,6 +56,8 @@ |
2411 | C ARGUMENTS |
2412 | C |
2413 | REAL*8 P(0:3,NEXTERNAL),ANS |
2414 | +CF2PY INTENT(OUT) :: ANS |
2415 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
2416 | C |
2417 | C LOCAL VARIABLES |
2418 | C |
2419 | @@ -76,15 +82,15 @@ |
2420 | C ---------- |
2421 | C BEGIN CODE |
2422 | C ---------- |
2423 | - NTRY=NTRY+1 |
2424 | + IF(USERHEL.EQ.-1) NTRY=NTRY+1 |
2425 | DO IHEL=1,NEXTERNAL |
2426 | JC(IHEL) = +1 |
2427 | ENDDO |
2428 | ANS = 0D0 |
2429 | DO IHEL=1,NCOMB |
2430 | IF (USERHEL.EQ.-1.OR.USERHEL.EQ.IHEL) THEN |
2431 | - IF (GOODHEL(IHEL) .OR. NTRY .LT. 20) THEN |
2432 | - T=MATRIX(P ,NHEL(1,IHEL),JC(1)) |
2433 | + IF (GOODHEL(IHEL) .OR. NTRY .LT. 20.OR.USERHEL.NE.-1) THEN |
2434 | + T=%(proc_prefix)sMATRIX(P ,NHEL(1,IHEL),JC(1)) |
2435 | ANS=ANS+T |
2436 | IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN |
2437 | GOODHEL(IHEL)=.TRUE. |
2438 | @@ -99,7 +105,7 @@ |
2439 | END |
2440 | |
2441 | |
2442 | - REAL*8 FUNCTION MATRIX(P,NHEL,IC) |
2443 | + REAL*8 FUNCTION %(proc_prefix)sMATRIX(P,NHEL,IC) |
2444 | C |
2445 | %(info_lines)s |
2446 | C |
2447 | @@ -162,3 +168,46 @@ |
2448 | ENDDO |
2449 | %(amp2_lines)s |
2450 | END |
2451 | + |
2452 | + SUBROUTINE %(proc_prefix)sGET_ME(P, ALPHAS, NHEL ,ANS) |
2453 | + IMPLICIT NONE |
2454 | +C |
2455 | +C CONSTANT |
2456 | +C |
2457 | + INTEGER NEXTERNAL |
2458 | + PARAMETER (NEXTERNAL=%(nexternal)d) |
2459 | +C |
2460 | +C ARGUMENTS |
2461 | +C |
2462 | + REAL*8 P(0:3,NEXTERNAL),ANS |
2463 | + INTEGER NHEL |
2464 | + DOUBLE PRECISION ALPHAS |
2465 | + real*8 pi |
2466 | +CF2PY INTENT(OUT) :: ANS |
2467 | +CF2PY INTENT(IN) :: NHEL |
2468 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
2469 | +CF2PY INTENT(IN) :: ALPHAS |
2470 | +C ROUTINE FOR F2PY to read the benchmark point. |
2471 | +C the include file with the values of the parameters and masses |
2472 | + include "coupl.inc" |
2473 | + |
2474 | + pi = 3.141592653589793d0 |
2475 | + G = 2* DSQRT(ALPHAS*pi) |
2476 | + call UPDATE_AS_PARAM() |
2477 | + if (NHEL.ne.0) then |
2478 | + CALL SMATRIXHEL(P, NHEL, ANS) |
2479 | + else |
2480 | + CALL SMATRIX(P, ANS) |
2481 | + endif |
2482 | + return |
2483 | + end |
2484 | + |
2485 | + SUBROUTINE %(proc_prefix)sINITIALISE(PATH) |
2486 | +C ROUTINE FOR F2PY to read the benchmark point. |
2487 | + IMPLICIT NONE |
2488 | + CHARACTER*180 PATH |
2489 | +CF2PY INTENT(IN) :: PATH |
2490 | + call setpara(PATH) !first call to setup the paramaters |
2491 | + return |
2492 | + end |
2493 | + |
2494 | \ No newline at end of file |
2495 | |
2496 | === modified file 'madgraph/loop/loop_exporters.py' |
2497 | --- madgraph/loop/loop_exporters.py 2015-06-27 00:16:19 +0000 |
2498 | +++ madgraph/loop/loop_exporters.py 2015-07-24 15:59:43 +0000 |
2499 | @@ -82,13 +82,15 @@ |
2500 | 'fortran_compiler':'gfortran', |
2501 | 'SubProc_prefix': 'P', |
2502 | 'output_dependencies': 'external', |
2503 | - 'compute_color_flows': False} |
2504 | + 'compute_color_flows': False, |
2505 | + 'mode':''} |
2506 | |
2507 | |
2508 | def __init__(self, mgme_dir="", dir_path = "", opt=None): |
2509 | """Initiate the LoopExporterFortran with directory information on where |
2510 | to find all the loop-related source files, like CutTools""" |
2511 | |
2512 | + |
2513 | self.opt = dict(self.default_opt) |
2514 | if opt: |
2515 | self.opt.update(opt) |
2516 | @@ -977,9 +979,12 @@ |
2517 | replace_dict[key]='' |
2518 | if matrix_element.get('processes')[0].get('has_born'): |
2519 | file = open(os.path.join(self.template_dir,'check_sa.inc')).read() |
2520 | + elif self.opt['mode'] == 'reweight': |
2521 | + file = open(os.path.join(self.template_dir,\ |
2522 | + 'check_py.f')).read() |
2523 | else: |
2524 | file = open(os.path.join(self.template_dir,\ |
2525 | - 'check_sa_loop_induced.inc')).read() |
2526 | + 'check_sa_loop_induced.inc')).read() |
2527 | file=file%replace_dict |
2528 | writer.writelines(file) |
2529 | |
2530 | |
2531 | === modified file 'madgraph/madevent/gen_crossxhtml.py' |
2532 | --- madgraph/madevent/gen_crossxhtml.py 2015-05-22 16:18:38 +0000 |
2533 | +++ madgraph/madevent/gen_crossxhtml.py 2015-07-24 15:59:43 +0000 |
2534 | @@ -30,11 +30,13 @@ |
2535 | import internal.save_load_object as save_load_object |
2536 | import internal.lhe_parser as lhe_parser |
2537 | import internal.misc as misc |
2538 | + import internal.banner as bannerlib |
2539 | else: |
2540 | import madgraph.iolibs.files as files |
2541 | import madgraph.iolibs.save_load_object as save_load_object |
2542 | import madgraph.various.lhe_parser as lhe_parser |
2543 | import madgraph.various.misc as misc |
2544 | + import madgraph.various.banner as bannerlib |
2545 | |
2546 | pjoin = os.path.join |
2547 | exists = os.path.exists |
2548 | @@ -160,6 +162,7 @@ |
2549 | # Check if some directory already exists and if so add them |
2550 | runs = [d for d in os.listdir(pjoin(path, 'Events')) if |
2551 | os.path.isdir(pjoin(path, 'Events', d))] |
2552 | + |
2553 | if runs: |
2554 | if recreateold: |
2555 | for run in runs: |
2556 | @@ -174,6 +177,7 @@ |
2557 | |
2558 | event_path = pjoin(self.path, "Events", run_name, "unweighted_events.lhe") |
2559 | |
2560 | + |
2561 | try: |
2562 | import madgraph |
2563 | except ImportError: |
2564 | @@ -625,8 +629,8 @@ |
2565 | |
2566 | # No pythia only a single run: |
2567 | if not tags: |
2568 | - self[0]['nb_event'] = nb_event |
2569 | - self[0]['cross'] = cross |
2570 | + self[-1]['nb_event'] = nb_event |
2571 | + self[-1]['cross'] = cross |
2572 | |
2573 | #Loop over pythia run |
2574 | for tag in tags: |
2575 | |
2576 | === modified file 'madgraph/madevent/sum_html.py' |
2577 | --- madgraph/madevent/sum_html.py 2015-06-14 00:32:59 +0000 |
2578 | +++ madgraph/madevent/sum_html.py 2015-07-24 15:59:43 +0000 |
2579 | @@ -287,6 +287,7 @@ |
2580 | if m: |
2581 | return float(m.group(1))*10**(float(m.group(2))) |
2582 | return |
2583 | + |
2584 | data = [secure_float(d) for d in line.split()] |
2585 | self.axsec, self.xerru, self.xerrc, self.nevents, self.nw,\ |
2586 | self.maxit, self.nunwgt, self.luminosity, self.wgt, \ |
2587 | |
2588 | === modified file 'madgraph/various/banner.py' |
2589 | --- madgraph/various/banner.py 2015-06-18 16:49:50 +0000 |
2590 | +++ madgraph/various/banner.py 2015-07-24 15:59:43 +0000 |
2591 | @@ -292,7 +292,62 @@ |
2592 | if pid not in pid2label.keys(): |
2593 | block.remove((pid,)) |
2594 | |
2595 | - |
2596 | + def get_lha_strategy(self): |
2597 | + """get the lha_strategy: how the weight have to be handle by the shower""" |
2598 | + |
2599 | + if not self["init"]: |
2600 | + raise Exception, "No init block define" |
2601 | + |
2602 | + data = self["init"].split('\n')[0].split() |
2603 | + if len(data) != 10: |
2604 | + misc.sprint(len(data), self['init']) |
2605 | + raise Exception, "init block has a wrong format" |
2606 | + return int(float(data[-2])) |
2607 | + |
2608 | + def set_lha_strategy(self, value): |
2609 | + """set the lha_strategy: how the weight have to be handle by the shower""" |
2610 | + |
2611 | + if not (-4 <= int(value) <= 4): |
2612 | + raise Exception, "wrong value for lha_strategy", value |
2613 | + if not self["init"]: |
2614 | + raise Exception, "No init block define" |
2615 | + |
2616 | + all_lines = self["init"].split('\n') |
2617 | + data = all_lines[0].split() |
2618 | + if len(data) != 10: |
2619 | + misc.sprint(len(data), self['init']) |
2620 | + raise Exception, "init block has a wrong format" |
2621 | + data[-2] = '%s' % value |
2622 | + all_lines[0] = ' '.join(data) |
2623 | + self['init'] = '\n'.join(all_lines) |
2624 | + |
2625 | + def modify_init_cross(self, cross): |
2626 | + """modify the init information with the associate cross-section""" |
2627 | + |
2628 | + assert isinstance(cross, dict) |
2629 | +# assert "all" in cross |
2630 | + assert "init" in self |
2631 | + |
2632 | + all_lines = self["init"].split('\n') |
2633 | + new_data = [] |
2634 | + new_data.append(all_lines[0]) |
2635 | + for i in range(1, len(all_lines)): |
2636 | + line = all_lines[i] |
2637 | + split = line.split() |
2638 | + if len(split) == 4: |
2639 | + xsec, xerr, xmax, pid = split |
2640 | + else: |
2641 | + new_data += all_lines[i:] |
2642 | + break |
2643 | + if int(pid) not in cross: |
2644 | + raise Exception |
2645 | + pid = int(pid) |
2646 | + ratio = cross[pid]/float(xsec) |
2647 | + line = " %+13.7e %+13.7e %+13.7e %i" % \ |
2648 | + (float(cross[pid]), ratio* float(xerr), ratio*float(xmax), pid) |
2649 | + new_data.append(line) |
2650 | + self['init'] = '\n'.join(new_data) |
2651 | + |
2652 | ############################################################################ |
2653 | # WRITE BANNER |
2654 | ############################################################################ |
2655 | @@ -374,6 +429,8 @@ |
2656 | tag = 'madspin' |
2657 | elif 'FO_analyse_card' in card_name: |
2658 | tag = 'foanalyse' |
2659 | + elif 'reweight_card' in card_name: |
2660 | + tag='reweight_card' |
2661 | else: |
2662 | raise Exception, 'Impossible to know the type of the card' |
2663 | |
2664 | @@ -1878,9 +1935,17 @@ |
2665 | if self['pdlabel'] not in possible_set: |
2666 | raise InvalidRunCard, 'Invalid PDF set (argument of pdlabel) possible choice are:\n %s' % ','.join(possible_set) |
2667 | |
2668 | - # check that we use lhapdf if reweighting is ON |
2669 | - if self['reweight_pdf'] and self['pdlabel'] != "lhapdf": |
2670 | - raise InvalidRunCard, 'Reweight PDF option requires to use pdf sets associated to lhapdf. Please either change the pdlabel or set reweight_pdf to False.' |
2671 | + |
2672 | + # PDF reweighting check |
2673 | + if self['reweight_pdf']: |
2674 | + # check that we use lhapdf if reweighting is ON |
2675 | + if self['pdlabel'] != "lhapdf": |
2676 | + raise InvalidRunCard, 'Reweight PDF option requires to use pdf sets associated to lhapdf. Please either change the pdlabel or set reweight_pdf to False.' |
2677 | + |
2678 | + # check that the number of pdf set is coherent for the reweigting: |
2679 | + if (self['pdf_set_max'] - self['pdf_set_min'] + 1) % 2: |
2680 | + raise InvalidRunCard, "The number of PDF error sets must be even" |
2681 | + |
2682 | |
2683 | def write(self, output_file, template=None, python_template=False): |
2684 | """Write the run_card in output_file according to template |
2685 | |
2686 | === modified file 'madgraph/various/combine_plots.py' |
2687 | --- madgraph/various/combine_plots.py 2013-11-13 02:21:10 +0000 |
2688 | +++ madgraph/various/combine_plots.py 2015-07-24 15:59:43 +0000 |
2689 | @@ -50,13 +50,14 @@ |
2690 | self.histo[tag] = {} |
2691 | self.histo[tag]["values"] = string_values |
2692 | old_max = self.max |
2693 | + |
2694 | for line in string_values.split('\n'): |
2695 | split = line.split() |
2696 | - if len(split) ==3: |
2697 | + if len(split) in [2,3]: |
2698 | self.max = max(self.max, float(line.split()[1])) |
2699 | if self.max != old_max: |
2700 | self.max_file = tag |
2701 | - |
2702 | + |
2703 | def get_histo(self, tag, norm): |
2704 | """return a string with the histogram values, and the normalization """ |
2705 | if tag not in self.histo or self.histo[tag]["values"] == '': |
2706 | @@ -100,6 +101,7 @@ |
2707 | for index, tag_plot in enumerate(self.order_plots): |
2708 | norm1 = 1 |
2709 | norm2 = 1 |
2710 | + |
2711 | if self.plots[tag_plot].max_file == file1: |
2712 | color1, color2 = 'WHITE','BLUE' |
2713 | histtype1, histtype2 = 'HIST SOLID\n', 'SET PATTERN .05 .07\n' |
2714 | |
2715 | === modified file 'madgraph/various/lhe_parser.py' |
2716 | --- madgraph/various/lhe_parser.py 2015-07-01 22:02:22 +0000 |
2717 | +++ madgraph/various/lhe_parser.py 2015-07-24 15:59:43 +0000 |
2718 | @@ -283,6 +283,7 @@ |
2719 | def weight(event): |
2720 | return event.wgt |
2721 | get_wgt = weight |
2722 | + unwgt_name = "central weight" |
2723 | elif isinstance(get_wgt, str): |
2724 | unwgt_name =get_wgt |
2725 | def get_wgt(event): |
2726 | @@ -1262,50 +1263,59 @@ |
2727 | 'comments': self.comment, |
2728 | 'reweight': reweight_str} |
2729 | return re.sub('[\n]+', '\n', out) |
2730 | + |
2731 | + def get_momenta(self, get_order, allow_reversed=True): |
2732 | + """return the momenta vector in the order asked for""" |
2733 | + |
2734 | + #avoid to modify the input |
2735 | + order = [list(get_order[0]), list(get_order[1])] |
2736 | + out = [''] *(len(order[0])+len(order[1])) |
2737 | + for i, part in enumerate(self): |
2738 | + if part.status == 1: #final |
2739 | + try: |
2740 | + ind = order[1].index(part.pid) |
2741 | + except ValueError, error: |
2742 | + if not allow_reversed: |
2743 | + raise error |
2744 | + else: |
2745 | + order = [[-i for i in get_order[0]],[-i for i in get_order[1]]] |
2746 | + try: |
2747 | + return self.get_momenta_str(order, False) |
2748 | + except ValueError: |
2749 | + raise error |
2750 | + position = len(order[0]) + ind |
2751 | + order[1][ind] = 0 |
2752 | + elif part.status == -1: |
2753 | + try: |
2754 | + ind = order[0].index(part.pid) |
2755 | + except ValueError, error: |
2756 | + if not allow_reversed: |
2757 | + raise error |
2758 | + else: |
2759 | + order = [[-i for i in get_order[0]],[-i for i in get_order[1]]] |
2760 | + try: |
2761 | + return self.get_momenta_str(order, False) |
2762 | + except ValueError: |
2763 | + raise error |
2764 | + |
2765 | + position = ind |
2766 | + order[0][ind] = 0 |
2767 | + else: #intermediate |
2768 | + continue |
2769 | + |
2770 | + out[position] = (part.E, part.px, part.py, part.pz) |
2771 | + |
2772 | + return out |
2773 | + |
2774 | |
2775 | def get_momenta_str(self, get_order, allow_reversed=True): |
2776 | """return the momenta str in the order asked for""" |
2777 | |
2778 | - |
2779 | - #avoid to modify the input |
2780 | - order = [list(get_order[0]), list(get_order[1])] |
2781 | - out = [''] *(len(order[0])+len(order[1])) |
2782 | - for i, part in enumerate(self): |
2783 | - if part.status == 1: #final |
2784 | - try: |
2785 | - ind = order[1].index(part.pid) |
2786 | - except ValueError, error: |
2787 | - if not allow_reversed: |
2788 | - raise error |
2789 | - else: |
2790 | - order = [[-i for i in get_order[0]],[-i for i in get_order[1]]] |
2791 | - try: |
2792 | - return self.get_momenta_str(order, False) |
2793 | - except ValueError: |
2794 | - raise error |
2795 | - position = len(order[0]) + ind |
2796 | - order[1][ind] = 0 |
2797 | - elif part.status == -1: |
2798 | - try: |
2799 | - ind = order[0].index(part.pid) |
2800 | - except ValueError, error: |
2801 | - if not allow_reversed: |
2802 | - raise error |
2803 | - else: |
2804 | - order = [[-i for i in get_order[0]],[-i for i in get_order[1]]] |
2805 | - try: |
2806 | - return self.get_momenta_str(order, False) |
2807 | - except ValueError: |
2808 | - raise error |
2809 | - |
2810 | - position = ind |
2811 | - order[0][ind] = 0 |
2812 | - else: #intermediate |
2813 | - continue |
2814 | - format = '%.12f' |
2815 | - format_line = ' '.join([format]*4) + ' \n' |
2816 | - out[position] = format_line % (part.E, part.px, part.py, part.pz) |
2817 | - |
2818 | + out = self.get_momenta(get_order, allow_reversed) |
2819 | + #format |
2820 | + format = '%.12f' |
2821 | + format_line = ' '.join([format]*4) + ' \n' |
2822 | + out = [format_line % one for one in out] |
2823 | out = ''.join(out).replace('e','d') |
2824 | return out |
2825 | |
2826 | |
2827 | === modified file 'madgraph/various/misc.py' |
2828 | --- madgraph/various/misc.py 2015-06-24 12:54:39 +0000 |
2829 | +++ madgraph/various/misc.py 2015-07-24 15:59:43 +0000 |
2830 | @@ -15,6 +15,7 @@ |
2831 | |
2832 | """A set of functions performing routine administrative I/O tasks.""" |
2833 | |
2834 | +import contextlib |
2835 | import logging |
2836 | import os |
2837 | import re |
2838 | @@ -169,6 +170,20 @@ |
2839 | return exe_file |
2840 | return None |
2841 | |
2842 | +def has_f2py(): |
2843 | + has_f2py = False |
2844 | + if which('f2py'): |
2845 | + has_f2py = True |
2846 | + elif sys.version_info[1] == 6: |
2847 | + if which('f2py-2.6'): |
2848 | + has_f2py = True |
2849 | + else: |
2850 | + if which('f2py-2.7'): |
2851 | + has_f2py = True |
2852 | + return has_f2py |
2853 | + |
2854 | + |
2855 | + |
2856 | #=============================================================================== |
2857 | # find a library |
2858 | #=============================================================================== |
2859 | @@ -447,6 +462,49 @@ |
2860 | #for i, h in enumerate(my_logger.handlers): |
2861 | # h.setLevel(cls.logger_saved_info[logname][2][i]) |
2862 | |
2863 | +nb_open =0 |
2864 | +@contextlib.contextmanager |
2865 | +def stdchannel_redirected(stdchannel, dest_filename): |
2866 | + """ |
2867 | + A context manager to temporarily redirect stdout or stderr |
2868 | + |
2869 | + e.g.: |
2870 | + |
2871 | + |
2872 | + with stdchannel_redirected(sys.stderr, os.devnull): |
2873 | + if compiler.has_function('clock_gettime', libraries=['rt']): |
2874 | + libraries.append('rt') |
2875 | + """ |
2876 | + |
2877 | + try: |
2878 | + oldstdchannel = os.dup(stdchannel.fileno()) |
2879 | + dest_file = open(dest_filename, 'w') |
2880 | + os.dup2(dest_file.fileno(), stdchannel.fileno()) |
2881 | + yield |
2882 | + finally: |
2883 | + if oldstdchannel is not None: |
2884 | + os.dup2(oldstdchannel, stdchannel.fileno()) |
2885 | + os.close(oldstdchannel) |
2886 | + if dest_file is not None: |
2887 | + dest_file.close() |
2888 | + |
2889 | +def get_open_fds(): |
2890 | + ''' |
2891 | + return the number of open file descriptors for current process |
2892 | + |
2893 | + .. warning: will only work on UNIX-like os-es. |
2894 | + ''' |
2895 | + import subprocess |
2896 | + import os |
2897 | + |
2898 | + pid = os.getpid() |
2899 | + procs = subprocess.check_output( |
2900 | + [ "lsof", '-w', '-Ff', "-p", str( pid ) ] ) |
2901 | + nprocs = filter( |
2902 | + lambda s: s and s[ 0 ] == 'f' and s[1: ].isdigit(), |
2903 | + procs.split( '\n' ) ) |
2904 | + |
2905 | + return nprocs |
2906 | |
2907 | def detect_current_compiler(path, compiler_type='fortran'): |
2908 | """find the current compiler for the current directory""" |
2909 | @@ -1031,6 +1089,29 @@ |
2910 | def __exit__(self, etype, value, traceback): |
2911 | os.chdir(self.savedPath) |
2912 | |
2913 | +################################################################################ |
2914 | +# Timeout FUNCTION |
2915 | +################################################################################ |
2916 | + |
2917 | +def timeout(func, args=(), kwargs={}, timeout_duration=1, default=None): |
2918 | + '''This function will spwan a thread and run the given function using the args, kwargs and |
2919 | + return the given default value if the timeout_duration is exceeded |
2920 | + ''' |
2921 | + import threading |
2922 | + class InterruptableThread(threading.Thread): |
2923 | + def __init__(self): |
2924 | + threading.Thread.__init__(self) |
2925 | + self.result = default |
2926 | + def run(self): |
2927 | + try: |
2928 | + self.result = func(*args, **kwargs) |
2929 | + except Exception,error: |
2930 | + print error |
2931 | + self.result = default |
2932 | + it = InterruptableThread() |
2933 | + it.start() |
2934 | + it.join(timeout_duration) |
2935 | + return it.result |
2936 | |
2937 | |
2938 | ################################################################################ |
2939 | |
2940 | === modified file 'tests/acceptance_tests/test_cmd.py' |
2941 | --- tests/acceptance_tests/test_cmd.py 2015-07-01 22:02:22 +0000 |
2942 | +++ tests/acceptance_tests/test_cmd.py 2015-07-24 15:59:43 +0000 |
2943 | @@ -637,7 +637,7 @@ |
2944 | 'lib', 'libmodel.a'))) |
2945 | # Check that check_sa.f compiles |
2946 | subprocess.call(['make', 'check'], |
2947 | - stdout=devnull, stderr=devnull, |
2948 | +# stdout=devnull, stderr=devnull, |
2949 | cwd=os.path.join(self.out_dir, 'SubProcesses', |
2950 | 'P0_gg_hgg')) |
2951 | self.assertTrue(os.path.exists(os.path.join(self.out_dir, |
2952 | @@ -1099,6 +1099,13 @@ |
2953 | def test_madevent_subproc_group_symmetry(self): |
2954 | """Check that symmetry.f gives right output""" |
2955 | |
2956 | + def analyse(fsock): |
2957 | + data = [] |
2958 | + for line in fsock: |
2959 | + if line.strip(): |
2960 | + data.append([int(i) for i in line.split()]) |
2961 | + return data |
2962 | + |
2963 | if os.path.isdir(self.out_dir): |
2964 | shutil.rmtree(self.out_dir) |
2965 | |
2966 | @@ -1114,12 +1121,7 @@ |
2967 | 'SubProcesses', |
2968 | 'P0_qq_gogo_go_qqn1_go_qqn1'))) |
2969 | |
2970 | - # Check the contents of the symfact.dat file |
2971 | - self.assertEqual(open(os.path.join(self.out_dir, |
2972 | - 'SubProcesses', |
2973 | - 'P0_qq_gogo_go_qqn1_go_qqn1', |
2974 | - 'symfact_orig.dat')).read().split('\n'), |
2975 | - """ 1 1 |
2976 | + target=""" 1 1 |
2977 | 2 -1 |
2978 | 3 -1 |
2979 | 4 -1 |
2980 | @@ -1131,7 +1133,13 @@ |
2981 | 10 -9 |
2982 | 11 -9 |
2983 | 12 -9 |
2984 | -""".split('\n')) |
2985 | +""" |
2986 | + |
2987 | + self.assertEqual(analyse(target.split('\n')), |
2988 | + analyse(open(os.path.join(self.out_dir, |
2989 | + 'SubProcesses', |
2990 | + 'P0_qq_gogo_go_qqn1_go_qqn1', |
2991 | + 'symfact_orig.dat')))) |
2992 | |
2993 | # Compile the Source directory |
2994 | status = subprocess.call(['make'], |
2995 | @@ -1152,8 +1160,13 @@ |
2996 | proc.communicate('100 4 0.1 .false.\n') |
2997 | self.assertEqual(proc.returncode, 0) |
2998 | |
2999 | +<<<<<<< TREE |
3000 | |
3001 | target = """ 1 1 |
3002 | +======= |
3003 | + |
3004 | + target =""" 1 1 |
3005 | +>>>>>>> MERGE-SOURCE |
3006 | 2 -1 |
3007 | 3 -1 |
3008 | 4 -1 |
3009 | @@ -1165,6 +1178,7 @@ |
3010 | 10 -9 |
3011 | 11 -9 |
3012 | 12 -9 |
3013 | +<<<<<<< TREE |
3014 | """ |
3015 | data = [[int(i) for i in line.split()] for line in target.split('\n')] |
3016 | result = [] |
3017 | @@ -1177,6 +1191,18 @@ |
3018 | self.assertEqual(info, data[ii]) |
3019 | ii+=1 |
3020 | |
3021 | +======= |
3022 | +""" |
3023 | + |
3024 | + # Check the new contents of the symfact.dat file |
3025 | + self.assertEqual(analyse(open(os.path.join(self.out_dir, |
3026 | + 'SubProcesses', |
3027 | + 'P0_qq_gogo_go_qqn1_go_qqn1', |
3028 | + 'symfact.dat'))), |
3029 | + analyse(target.split('\n'))) |
3030 | + |
3031 | + |
3032 | +>>>>>>> MERGE-SOURCE |
3033 | def test_madevent_subproc_group_decay_chain(self): |
3034 | """Test decay chain output using the SubProcess group functionality""" |
3035 | |
3036 | |
3037 | === added directory 'tests/input_files/IOTestsComparison/ExportV4IOTest' |
3038 | === added directory 'tests/input_files/IOTestsComparison/ExportV4IOTest/export_matrix_element_v4_standalone' |
3039 | === added file 'tests/input_files/IOTestsComparison/ExportV4IOTest/export_matrix_element_v4_standalone/matrix.f' |
3040 | --- tests/input_files/IOTestsComparison/ExportV4IOTest/export_matrix_element_v4_standalone/matrix.f 1970-01-01 00:00:00 +0000 |
3041 | +++ tests/input_files/IOTestsComparison/ExportV4IOTest/export_matrix_element_v4_standalone/matrix.f 2015-07-24 15:59:43 +0000 |
3042 | @@ -0,0 +1,272 @@ |
3043 | + SUBROUTINE SMATRIXHEL(P,HEL,ANS) |
3044 | + IMPLICIT NONE |
3045 | +C |
3046 | +C CONSTANT |
3047 | +C |
3048 | + INTEGER NEXTERNAL |
3049 | + PARAMETER (NEXTERNAL=5) |
3050 | + INTEGER NCOMB |
3051 | + PARAMETER ( NCOMB=32) |
3052 | +CF2PY INTENT(OUT) :: ANS |
3053 | +CF2PY INTENT(IN) :: HEL |
3054 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
3055 | + |
3056 | +C |
3057 | +C ARGUMENTS |
3058 | +C |
3059 | + REAL*8 P(0:3,NEXTERNAL),ANS |
3060 | + INTEGER HEL |
3061 | +C |
3062 | +C GLOBAL VARIABLES |
3063 | +C |
3064 | + INTEGER USERHEL |
3065 | + COMMON/HELUSERCHOICE/USERHEL |
3066 | +C ---------- |
3067 | +C BEGIN CODE |
3068 | +C ---------- |
3069 | + USERHEL=HEL |
3070 | + CALL SMATRIX(P,ANS) |
3071 | + USERHEL=-1 |
3072 | + |
3073 | + END |
3074 | + |
3075 | + SUBROUTINE SMATRIX(P,ANS) |
3076 | +C |
3077 | +C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s |
3078 | +C By the MadGraph5_aMC@NLO Development Team |
3079 | +C Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch |
3080 | +C |
3081 | +C MadGraph5_aMC@NLO StandAlone Version |
3082 | +C |
3083 | +C Returns amplitude squared summed/avg over colors |
3084 | +C and helicities |
3085 | +C for the point in phase space P(0:3,NEXTERNAL) |
3086 | +C |
3087 | +C Process: e+ e- > a a a |
3088 | +C |
3089 | + IMPLICIT NONE |
3090 | +C |
3091 | +C CONSTANTS |
3092 | +C |
3093 | + INTEGER NEXTERNAL |
3094 | + PARAMETER (NEXTERNAL=5) |
3095 | + INTEGER NCOMB |
3096 | + PARAMETER ( NCOMB=32) |
3097 | + INTEGER HELAVGFACTOR |
3098 | + PARAMETER (HELAVGFACTOR=4) |
3099 | +C |
3100 | +C ARGUMENTS |
3101 | +C |
3102 | + REAL*8 P(0:3,NEXTERNAL),ANS |
3103 | +CF2PY INTENT(OUT) :: ANS |
3104 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
3105 | +C |
3106 | +C LOCAL VARIABLES |
3107 | +C |
3108 | + INTEGER NHEL(NEXTERNAL,NCOMB),NTRY |
3109 | + REAL*8 T |
3110 | + REAL*8 MATRIX |
3111 | + INTEGER IHEL,IDEN, I |
3112 | + INTEGER JC(NEXTERNAL) |
3113 | + LOGICAL GOODHEL(NCOMB) |
3114 | + DATA NTRY/0/ |
3115 | + DATA GOODHEL/NCOMB*.FALSE./ |
3116 | + |
3117 | +C |
3118 | +C GLOBAL VARIABLES |
3119 | +C |
3120 | + INTEGER USERHEL |
3121 | + COMMON/HELUSERCHOICE/USERHEL |
3122 | + DATA USERHEL/-1/ |
3123 | + |
3124 | + DATA (NHEL(I, 1),I=1,5) /-1, 1,-1,-1,-1/ |
3125 | + DATA (NHEL(I, 2),I=1,5) /-1, 1,-1,-1, 1/ |
3126 | + DATA (NHEL(I, 3),I=1,5) /-1, 1,-1, 1,-1/ |
3127 | + DATA (NHEL(I, 4),I=1,5) /-1, 1,-1, 1, 1/ |
3128 | + DATA (NHEL(I, 5),I=1,5) /-1, 1, 1,-1,-1/ |
3129 | + DATA (NHEL(I, 6),I=1,5) /-1, 1, 1,-1, 1/ |
3130 | + DATA (NHEL(I, 7),I=1,5) /-1, 1, 1, 1,-1/ |
3131 | + DATA (NHEL(I, 8),I=1,5) /-1, 1, 1, 1, 1/ |
3132 | + DATA (NHEL(I, 9),I=1,5) /-1,-1,-1,-1,-1/ |
3133 | + DATA (NHEL(I, 10),I=1,5) /-1,-1,-1,-1, 1/ |
3134 | + DATA (NHEL(I, 11),I=1,5) /-1,-1,-1, 1,-1/ |
3135 | + DATA (NHEL(I, 12),I=1,5) /-1,-1,-1, 1, 1/ |
3136 | + DATA (NHEL(I, 13),I=1,5) /-1,-1, 1,-1,-1/ |
3137 | + DATA (NHEL(I, 14),I=1,5) /-1,-1, 1,-1, 1/ |
3138 | + DATA (NHEL(I, 15),I=1,5) /-1,-1, 1, 1,-1/ |
3139 | + DATA (NHEL(I, 16),I=1,5) /-1,-1, 1, 1, 1/ |
3140 | + DATA (NHEL(I, 17),I=1,5) / 1, 1,-1,-1,-1/ |
3141 | + DATA (NHEL(I, 18),I=1,5) / 1, 1,-1,-1, 1/ |
3142 | + DATA (NHEL(I, 19),I=1,5) / 1, 1,-1, 1,-1/ |
3143 | + DATA (NHEL(I, 20),I=1,5) / 1, 1,-1, 1, 1/ |
3144 | + DATA (NHEL(I, 21),I=1,5) / 1, 1, 1,-1,-1/ |
3145 | + DATA (NHEL(I, 22),I=1,5) / 1, 1, 1,-1, 1/ |
3146 | + DATA (NHEL(I, 23),I=1,5) / 1, 1, 1, 1,-1/ |
3147 | + DATA (NHEL(I, 24),I=1,5) / 1, 1, 1, 1, 1/ |
3148 | + DATA (NHEL(I, 25),I=1,5) / 1,-1,-1,-1,-1/ |
3149 | + DATA (NHEL(I, 26),I=1,5) / 1,-1,-1,-1, 1/ |
3150 | + DATA (NHEL(I, 27),I=1,5) / 1,-1,-1, 1,-1/ |
3151 | + DATA (NHEL(I, 28),I=1,5) / 1,-1,-1, 1, 1/ |
3152 | + DATA (NHEL(I, 29),I=1,5) / 1,-1, 1,-1,-1/ |
3153 | + DATA (NHEL(I, 30),I=1,5) / 1,-1, 1,-1, 1/ |
3154 | + DATA (NHEL(I, 31),I=1,5) / 1,-1, 1, 1,-1/ |
3155 | + DATA (NHEL(I, 32),I=1,5) / 1,-1, 1, 1, 1/ |
3156 | + DATA IDEN/24/ |
3157 | +C ---------- |
3158 | +C BEGIN CODE |
3159 | +C ---------- |
3160 | + IF(USERHEL.EQ.-1) NTRY=NTRY+1 |
3161 | + DO IHEL=1,NEXTERNAL |
3162 | + JC(IHEL) = +1 |
3163 | + ENDDO |
3164 | + ANS = 0D0 |
3165 | + DO IHEL=1,NCOMB |
3166 | + IF (USERHEL.EQ.-1.OR.USERHEL.EQ.IHEL) THEN |
3167 | + IF (GOODHEL(IHEL) .OR. NTRY .LT. 20.OR.USERHEL.NE.-1) THEN |
3168 | + T=MATRIX(P ,NHEL(1,IHEL),JC(1)) |
3169 | + ANS=ANS+T |
3170 | + IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN |
3171 | + GOODHEL(IHEL)=.TRUE. |
3172 | + ENDIF |
3173 | + ENDIF |
3174 | + ENDIF |
3175 | + ENDDO |
3176 | + ANS=ANS/DBLE(IDEN) |
3177 | + IF(USERHEL.NE.-1) THEN |
3178 | + ANS=ANS*HELAVGFACTOR |
3179 | + ENDIF |
3180 | + END |
3181 | + |
3182 | + |
3183 | + REAL*8 FUNCTION MATRIX(P,NHEL,IC) |
3184 | +C |
3185 | +C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s |
3186 | +C By the MadGraph5_aMC@NLO Development Team |
3187 | +C Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch |
3188 | +C |
3189 | +C Returns amplitude squared summed/avg over colors |
3190 | +C for the point with external lines W(0:6,NEXTERNAL) |
3191 | +C |
3192 | +C Process: e+ e- > a a a |
3193 | +C |
3194 | + IMPLICIT NONE |
3195 | +C |
3196 | +C CONSTANTS |
3197 | +C |
3198 | + INTEGER NGRAPHS |
3199 | + PARAMETER (NGRAPHS=6) |
3200 | + INTEGER NEXTERNAL |
3201 | + PARAMETER (NEXTERNAL=5) |
3202 | + INTEGER NWAVEFUNCS, NCOLOR |
3203 | + PARAMETER (NWAVEFUNCS=9, NCOLOR=1) |
3204 | + REAL*8 ZERO |
3205 | + PARAMETER (ZERO=0D0) |
3206 | + COMPLEX*16 IMAG1 |
3207 | + PARAMETER (IMAG1=(0D0,1D0)) |
3208 | +C |
3209 | +C ARGUMENTS |
3210 | +C |
3211 | + REAL*8 P(0:3,NEXTERNAL) |
3212 | + INTEGER NHEL(NEXTERNAL), IC(NEXTERNAL) |
3213 | +C |
3214 | +C LOCAL VARIABLES |
3215 | +C |
3216 | + INTEGER I,J |
3217 | + COMPLEX*16 ZTEMP |
3218 | + REAL*8 DENOM(NCOLOR), CF(NCOLOR,NCOLOR) |
3219 | + COMPLEX*16 AMP(NGRAPHS), JAMP(NCOLOR) |
3220 | + COMPLEX*16 W(18,NWAVEFUNCS) |
3221 | + COMPLEX*16 DUM0,DUM1 |
3222 | + DATA DUM0, DUM1/(0D0, 0D0), (1D0, 0D0)/ |
3223 | +C |
3224 | +C GLOBAL VARIABLES |
3225 | +C |
3226 | + INCLUDE 'coupl.inc' |
3227 | + |
3228 | +C |
3229 | +C COLOR DATA |
3230 | +C |
3231 | + DATA DENOM(1)/1/ |
3232 | + DATA (CF(I, 1),I= 1, 1) / 1/ |
3233 | +C 1 ColorOne() |
3234 | +C ---------- |
3235 | +C BEGIN CODE |
3236 | +C ---------- |
3237 | + CALL OXXXXX(P(0,1),ZERO,NHEL(1),-1*IC(1),W(1,1)) |
3238 | + CALL IXXXXX(P(0,2),ZERO,NHEL(2),+1*IC(2),W(1,2)) |
3239 | + CALL VXXXXX(P(0,3),ZERO,NHEL(3),+1*IC(3),W(1,3)) |
3240 | + CALL VXXXXX(P(0,4),ZERO,NHEL(4),+1*IC(4),W(1,4)) |
3241 | + CALL VXXXXX(P(0,5),ZERO,NHEL(5),+1*IC(5),W(1,5)) |
3242 | + CALL FVOXXX(W(1,1),W(1,3),MGVX12,ZERO,ZERO,W(1,6)) |
3243 | + CALL FVIXXX(W(1,2),W(1,4),MGVX12,ZERO,ZERO,W(1,7)) |
3244 | +C Amplitude(s) for diagram number 1 |
3245 | + CALL IOVXXX(W(1,7),W(1,6),W(1,5),MGVX12,AMP(1)) |
3246 | + CALL FVIXXX(W(1,2),W(1,5),MGVX12,ZERO,ZERO,W(1,8)) |
3247 | +C Amplitude(s) for diagram number 2 |
3248 | + CALL IOVXXX(W(1,8),W(1,6),W(1,4),MGVX12,AMP(2)) |
3249 | + CALL FVOXXX(W(1,1),W(1,4),MGVX12,ZERO,ZERO,W(1,6)) |
3250 | + CALL FVIXXX(W(1,2),W(1,3),MGVX12,ZERO,ZERO,W(1,9)) |
3251 | +C Amplitude(s) for diagram number 3 |
3252 | + CALL IOVXXX(W(1,9),W(1,6),W(1,5),MGVX12,AMP(3)) |
3253 | +C Amplitude(s) for diagram number 4 |
3254 | + CALL IOVXXX(W(1,8),W(1,6),W(1,3),MGVX12,AMP(4)) |
3255 | + CALL FVOXXX(W(1,1),W(1,5),MGVX12,ZERO,ZERO,W(1,6)) |
3256 | +C Amplitude(s) for diagram number 5 |
3257 | + CALL IOVXXX(W(1,9),W(1,6),W(1,4),MGVX12,AMP(5)) |
3258 | +C Amplitude(s) for diagram number 6 |
3259 | + CALL IOVXXX(W(1,7),W(1,6),W(1,3),MGVX12,AMP(6)) |
3260 | + JAMP(1)=-AMP(1)-AMP(2)-AMP(3)-AMP(4)-AMP(5)-AMP(6) |
3261 | + |
3262 | + MATRIX = 0.D0 |
3263 | + DO I = 1, NCOLOR |
3264 | + ZTEMP = (0.D0,0.D0) |
3265 | + DO J = 1, NCOLOR |
3266 | + ZTEMP = ZTEMP + CF(J,I)*JAMP(J) |
3267 | + ENDDO |
3268 | + MATRIX = MATRIX+ZTEMP*DCONJG(JAMP(I))/DENOM(I) |
3269 | + ENDDO |
3270 | + |
3271 | + END |
3272 | + |
3273 | + SUBROUTINE GET_ME(P, ALPHAS, NHEL ,ANS) |
3274 | + IMPLICIT NONE |
3275 | +C |
3276 | +C CONSTANT |
3277 | +C |
3278 | + INTEGER NEXTERNAL |
3279 | + PARAMETER (NEXTERNAL=5) |
3280 | +C |
3281 | +C ARGUMENTS |
3282 | +C |
3283 | + REAL*8 P(0:3,NEXTERNAL),ANS |
3284 | + INTEGER NHEL |
3285 | + DOUBLE PRECISION ALPHAS |
3286 | + REAL*8 PI |
3287 | +CF2PY INTENT(OUT) :: ANS |
3288 | +CF2PY INTENT(IN) :: NHEL |
3289 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
3290 | +CF2PY INTENT(IN) :: ALPHAS |
3291 | +C ROUTINE FOR F2PY to read the benchmark point. |
3292 | +C the include file with the values of the parameters and masses |
3293 | + INCLUDE 'coupl.inc' |
3294 | + |
3295 | + PI = 3.141592653589793D0 |
3296 | + G = 2* DSQRT(ALPHAS*PI) |
3297 | + CALL UPDATE_AS_PARAM() |
3298 | + IF (NHEL.NE.0) THEN |
3299 | + CALL SMATRIXHEL(P, NHEL, ANS) |
3300 | + ELSE |
3301 | + CALL SMATRIX(P, ANS) |
3302 | + ENDIF |
3303 | + RETURN |
3304 | + END |
3305 | + |
3306 | + SUBROUTINE INITIALISE(PATH) |
3307 | +C ROUTINE FOR F2PY to read the benchmark point. |
3308 | + IMPLICIT NONE |
3309 | + CHARACTER*180 PATH |
3310 | +CF2PY INTENT(IN) :: PATH |
3311 | + CALL SETPARA(PATH) !first call to setup the paramaters |
3312 | + RETURN |
3313 | + END |
3314 | + |
3315 | |
3316 | === added directory 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone' |
3317 | === added file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f' |
3318 | --- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f 1970-01-01 00:00:00 +0000 |
3319 | +++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_standalone/matrix.f 2015-07-24 15:59:43 +0000 |
3320 | @@ -0,0 +1,272 @@ |
3321 | + SUBROUTINE SMATRIXHEL(P,HEL,ANS) |
3322 | + IMPLICIT NONE |
3323 | +C |
3324 | +C CONSTANT |
3325 | +C |
3326 | + INTEGER NEXTERNAL |
3327 | + PARAMETER (NEXTERNAL=5) |
3328 | + INTEGER NCOMB |
3329 | + PARAMETER ( NCOMB=32) |
3330 | +CF2PY INTENT(OUT) :: ANS |
3331 | +CF2PY INTENT(IN) :: HEL |
3332 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
3333 | + |
3334 | +C |
3335 | +C ARGUMENTS |
3336 | +C |
3337 | + REAL*8 P(0:3,NEXTERNAL),ANS |
3338 | + INTEGER HEL |
3339 | +C |
3340 | +C GLOBAL VARIABLES |
3341 | +C |
3342 | + INTEGER USERHEL |
3343 | + COMMON/HELUSERCHOICE/USERHEL |
3344 | +C ---------- |
3345 | +C BEGIN CODE |
3346 | +C ---------- |
3347 | + USERHEL=HEL |
3348 | + CALL SMATRIX(P,ANS) |
3349 | + USERHEL=-1 |
3350 | + |
3351 | + END |
3352 | + |
3353 | + SUBROUTINE SMATRIX(P,ANS) |
3354 | +C |
3355 | +C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s |
3356 | +C By the MadGraph5_aMC@NLO Development Team |
3357 | +C Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch |
3358 | +C |
3359 | +C MadGraph5_aMC@NLO StandAlone Version |
3360 | +C |
3361 | +C Returns amplitude squared summed/avg over colors |
3362 | +C and helicities |
3363 | +C for the point in phase space P(0:3,NEXTERNAL) |
3364 | +C |
3365 | +C Process: e+ e- > a a a |
3366 | +C |
3367 | + IMPLICIT NONE |
3368 | +C |
3369 | +C CONSTANTS |
3370 | +C |
3371 | + INTEGER NEXTERNAL |
3372 | + PARAMETER (NEXTERNAL=5) |
3373 | + INTEGER NCOMB |
3374 | + PARAMETER ( NCOMB=32) |
3375 | + INTEGER HELAVGFACTOR |
3376 | + PARAMETER (HELAVGFACTOR=4) |
3377 | +C |
3378 | +C ARGUMENTS |
3379 | +C |
3380 | + REAL*8 P(0:3,NEXTERNAL),ANS |
3381 | +CF2PY INTENT(OUT) :: ANS |
3382 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
3383 | +C |
3384 | +C LOCAL VARIABLES |
3385 | +C |
3386 | + INTEGER NHEL(NEXTERNAL,NCOMB),NTRY |
3387 | + REAL*8 T |
3388 | + REAL*8 MATRIX |
3389 | + INTEGER IHEL,IDEN, I |
3390 | + INTEGER JC(NEXTERNAL) |
3391 | + LOGICAL GOODHEL(NCOMB) |
3392 | + DATA NTRY/0/ |
3393 | + DATA GOODHEL/NCOMB*.FALSE./ |
3394 | + |
3395 | +C |
3396 | +C GLOBAL VARIABLES |
3397 | +C |
3398 | + INTEGER USERHEL |
3399 | + COMMON/HELUSERCHOICE/USERHEL |
3400 | + DATA USERHEL/-1/ |
3401 | + |
3402 | + DATA (NHEL(I, 1),I=1,5) /-1, 1,-1,-1,-1/ |
3403 | + DATA (NHEL(I, 2),I=1,5) /-1, 1,-1,-1, 1/ |
3404 | + DATA (NHEL(I, 3),I=1,5) /-1, 1,-1, 1,-1/ |
3405 | + DATA (NHEL(I, 4),I=1,5) /-1, 1,-1, 1, 1/ |
3406 | + DATA (NHEL(I, 5),I=1,5) /-1, 1, 1,-1,-1/ |
3407 | + DATA (NHEL(I, 6),I=1,5) /-1, 1, 1,-1, 1/ |
3408 | + DATA (NHEL(I, 7),I=1,5) /-1, 1, 1, 1,-1/ |
3409 | + DATA (NHEL(I, 8),I=1,5) /-1, 1, 1, 1, 1/ |
3410 | + DATA (NHEL(I, 9),I=1,5) /-1,-1,-1,-1,-1/ |
3411 | + DATA (NHEL(I, 10),I=1,5) /-1,-1,-1,-1, 1/ |
3412 | + DATA (NHEL(I, 11),I=1,5) /-1,-1,-1, 1,-1/ |
3413 | + DATA (NHEL(I, 12),I=1,5) /-1,-1,-1, 1, 1/ |
3414 | + DATA (NHEL(I, 13),I=1,5) /-1,-1, 1,-1,-1/ |
3415 | + DATA (NHEL(I, 14),I=1,5) /-1,-1, 1,-1, 1/ |
3416 | + DATA (NHEL(I, 15),I=1,5) /-1,-1, 1, 1,-1/ |
3417 | + DATA (NHEL(I, 16),I=1,5) /-1,-1, 1, 1, 1/ |
3418 | + DATA (NHEL(I, 17),I=1,5) / 1, 1,-1,-1,-1/ |
3419 | + DATA (NHEL(I, 18),I=1,5) / 1, 1,-1,-1, 1/ |
3420 | + DATA (NHEL(I, 19),I=1,5) / 1, 1,-1, 1,-1/ |
3421 | + DATA (NHEL(I, 20),I=1,5) / 1, 1,-1, 1, 1/ |
3422 | + DATA (NHEL(I, 21),I=1,5) / 1, 1, 1,-1,-1/ |
3423 | + DATA (NHEL(I, 22),I=1,5) / 1, 1, 1,-1, 1/ |
3424 | + DATA (NHEL(I, 23),I=1,5) / 1, 1, 1, 1,-1/ |
3425 | + DATA (NHEL(I, 24),I=1,5) / 1, 1, 1, 1, 1/ |
3426 | + DATA (NHEL(I, 25),I=1,5) / 1,-1,-1,-1,-1/ |
3427 | + DATA (NHEL(I, 26),I=1,5) / 1,-1,-1,-1, 1/ |
3428 | + DATA (NHEL(I, 27),I=1,5) / 1,-1,-1, 1,-1/ |
3429 | + DATA (NHEL(I, 28),I=1,5) / 1,-1,-1, 1, 1/ |
3430 | + DATA (NHEL(I, 29),I=1,5) / 1,-1, 1,-1,-1/ |
3431 | + DATA (NHEL(I, 30),I=1,5) / 1,-1, 1,-1, 1/ |
3432 | + DATA (NHEL(I, 31),I=1,5) / 1,-1, 1, 1,-1/ |
3433 | + DATA (NHEL(I, 32),I=1,5) / 1,-1, 1, 1, 1/ |
3434 | + DATA IDEN/24/ |
3435 | +C ---------- |
3436 | +C BEGIN CODE |
3437 | +C ---------- |
3438 | + IF(USERHEL.EQ.-1) NTRY=NTRY+1 |
3439 | + DO IHEL=1,NEXTERNAL |
3440 | + JC(IHEL) = +1 |
3441 | + ENDDO |
3442 | + ANS = 0D0 |
3443 | + DO IHEL=1,NCOMB |
3444 | + IF (USERHEL.EQ.-1.OR.USERHEL.EQ.IHEL) THEN |
3445 | + IF (GOODHEL(IHEL) .OR. NTRY .LT. 20.OR.USERHEL.NE.-1) THEN |
3446 | + T=MATRIX(P ,NHEL(1,IHEL),JC(1)) |
3447 | + ANS=ANS+T |
3448 | + IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN |
3449 | + GOODHEL(IHEL)=.TRUE. |
3450 | + ENDIF |
3451 | + ENDIF |
3452 | + ENDIF |
3453 | + ENDDO |
3454 | + ANS=ANS/DBLE(IDEN) |
3455 | + IF(USERHEL.NE.-1) THEN |
3456 | + ANS=ANS*HELAVGFACTOR |
3457 | + ENDIF |
3458 | + END |
3459 | + |
3460 | + |
3461 | + REAL*8 FUNCTION MATRIX(P,NHEL,IC) |
3462 | +C |
3463 | +C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s |
3464 | +C By the MadGraph5_aMC@NLO Development Team |
3465 | +C Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch |
3466 | +C |
3467 | +C Returns amplitude squared summed/avg over colors |
3468 | +C for the point with external lines W(0:6,NEXTERNAL) |
3469 | +C |
3470 | +C Process: e+ e- > a a a |
3471 | +C |
3472 | + IMPLICIT NONE |
3473 | +C |
3474 | +C CONSTANTS |
3475 | +C |
3476 | + INTEGER NGRAPHS |
3477 | + PARAMETER (NGRAPHS=6) |
3478 | + INTEGER NEXTERNAL |
3479 | + PARAMETER (NEXTERNAL=5) |
3480 | + INTEGER NWAVEFUNCS, NCOLOR |
3481 | + PARAMETER (NWAVEFUNCS=9, NCOLOR=1) |
3482 | + REAL*8 ZERO |
3483 | + PARAMETER (ZERO=0D0) |
3484 | + COMPLEX*16 IMAG1 |
3485 | + PARAMETER (IMAG1=(0D0,1D0)) |
3486 | +C |
3487 | +C ARGUMENTS |
3488 | +C |
3489 | + REAL*8 P(0:3,NEXTERNAL) |
3490 | + INTEGER NHEL(NEXTERNAL), IC(NEXTERNAL) |
3491 | +C |
3492 | +C LOCAL VARIABLES |
3493 | +C |
3494 | + INTEGER I,J |
3495 | + COMPLEX*16 ZTEMP |
3496 | + REAL*8 DENOM(NCOLOR), CF(NCOLOR,NCOLOR) |
3497 | + COMPLEX*16 AMP(NGRAPHS), JAMP(NCOLOR) |
3498 | + COMPLEX*16 W(18,NWAVEFUNCS) |
3499 | + COMPLEX*16 DUM0,DUM1 |
3500 | + DATA DUM0, DUM1/(0D0, 0D0), (1D0, 0D0)/ |
3501 | +C |
3502 | +C GLOBAL VARIABLES |
3503 | +C |
3504 | + INCLUDE 'coupl.inc' |
3505 | + |
3506 | +C |
3507 | +C COLOR DATA |
3508 | +C |
3509 | + DATA DENOM(1)/1/ |
3510 | + DATA (CF(I, 1),I= 1, 1) / 1/ |
3511 | +C 1 ColorOne() |
3512 | +C ---------- |
3513 | +C BEGIN CODE |
3514 | +C ---------- |
3515 | + CALL OXXXXX(P(0,1),ZERO,NHEL(1),-1*IC(1),W(1,1)) |
3516 | + CALL IXXXXX(P(0,2),ZERO,NHEL(2),+1*IC(2),W(1,2)) |
3517 | + CALL VXXXXX(P(0,3),ZERO,NHEL(3),+1*IC(3),W(1,3)) |
3518 | + CALL VXXXXX(P(0,4),ZERO,NHEL(4),+1*IC(4),W(1,4)) |
3519 | + CALL VXXXXX(P(0,5),ZERO,NHEL(5),+1*IC(5),W(1,5)) |
3520 | + CALL FVOXXX(W(1,1),W(1,3),MGVX12,ZERO,ZERO,W(1,6)) |
3521 | + CALL FVIXXX(W(1,2),W(1,4),MGVX12,ZERO,ZERO,W(1,7)) |
3522 | +C Amplitude(s) for diagram number 1 |
3523 | + CALL IOVXXX(W(1,7),W(1,6),W(1,5),MGVX12,AMP(1)) |
3524 | + CALL FVIXXX(W(1,2),W(1,5),MGVX12,ZERO,ZERO,W(1,8)) |
3525 | +C Amplitude(s) for diagram number 2 |
3526 | + CALL IOVXXX(W(1,8),W(1,6),W(1,4),MGVX12,AMP(2)) |
3527 | + CALL FVOXXX(W(1,1),W(1,4),MGVX12,ZERO,ZERO,W(1,6)) |
3528 | + CALL FVIXXX(W(1,2),W(1,3),MGVX12,ZERO,ZERO,W(1,9)) |
3529 | +C Amplitude(s) for diagram number 3 |
3530 | + CALL IOVXXX(W(1,9),W(1,6),W(1,5),MGVX12,AMP(3)) |
3531 | +C Amplitude(s) for diagram number 4 |
3532 | + CALL IOVXXX(W(1,8),W(1,6),W(1,3),MGVX12,AMP(4)) |
3533 | + CALL FVOXXX(W(1,1),W(1,5),MGVX12,ZERO,ZERO,W(1,6)) |
3534 | +C Amplitude(s) for diagram number 5 |
3535 | + CALL IOVXXX(W(1,9),W(1,6),W(1,4),MGVX12,AMP(5)) |
3536 | +C Amplitude(s) for diagram number 6 |
3537 | + CALL IOVXXX(W(1,7),W(1,6),W(1,3),MGVX12,AMP(6)) |
3538 | + JAMP(1)=-AMP(1)-AMP(2)-AMP(3)-AMP(4)-AMP(5)-AMP(6) |
3539 | + |
3540 | + MATRIX = 0.D0 |
3541 | + DO I = 1, NCOLOR |
3542 | + ZTEMP = (0.D0,0.D0) |
3543 | + DO J = 1, NCOLOR |
3544 | + ZTEMP = ZTEMP + CF(J,I)*JAMP(J) |
3545 | + ENDDO |
3546 | + MATRIX = MATRIX+ZTEMP*DCONJG(JAMP(I))/DENOM(I) |
3547 | + ENDDO |
3548 | + |
3549 | + END |
3550 | + |
3551 | + SUBROUTINE GET_ME(P, ALPHAS, NHEL ,ANS) |
3552 | + IMPLICIT NONE |
3553 | +C |
3554 | +C CONSTANT |
3555 | +C |
3556 | + INTEGER NEXTERNAL |
3557 | + PARAMETER (NEXTERNAL=5) |
3558 | +C |
3559 | +C ARGUMENTS |
3560 | +C |
3561 | + REAL*8 P(0:3,NEXTERNAL),ANS |
3562 | + INTEGER NHEL |
3563 | + DOUBLE PRECISION ALPHAS |
3564 | + REAL*8 PI |
3565 | +CF2PY INTENT(OUT) :: ANS |
3566 | +CF2PY INTENT(IN) :: NHEL |
3567 | +CF2PY INTENT(IN) :: P(0:3,NEXTERNAL) |
3568 | +CF2PY INTENT(IN) :: ALPHAS |
3569 | +C ROUTINE FOR F2PY to read the benchmark point. |
3570 | +C the include file with the values of the parameters and masses |
3571 | + INCLUDE 'coupl.inc' |
3572 | + |
3573 | + PI = 3.141592653589793D0 |
3574 | + G = 2* DSQRT(ALPHAS*PI) |
3575 | + CALL UPDATE_AS_PARAM() |
3576 | + IF (NHEL.NE.0) THEN |
3577 | + CALL SMATRIXHEL(P, NHEL, ANS) |
3578 | + ELSE |
3579 | + CALL SMATRIX(P, ANS) |
3580 | + ENDIF |
3581 | + RETURN |
3582 | + END |
3583 | + |
3584 | + SUBROUTINE INITIALISE(PATH) |
3585 | +C ROUTINE FOR F2PY to read the benchmark point. |
3586 | + IMPLICIT NONE |
3587 | + CHARACTER*180 PATH |
3588 | +CF2PY INTENT(IN) :: PATH |
3589 | + CALL SETPARA(PATH) !first call to setup the paramaters |
3590 | + RETURN |
3591 | + END |
3592 | + |
3593 | |
3594 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f' |
3595 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f 2015-06-30 16:20:47 +0000 |
3596 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f 2015-07-24 15:59:43 +0000 |
3597 | @@ -420,9 +420,9 @@ |
3598 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
3599 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
3600 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
3601 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
3602 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
3603 | - $ //'d NROTATIONS_QP to 0.' |
3604 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
3605 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
3606 | + $ //'_DP and NROTATIONS_QP to 0.' |
3607 | NROTATIONS_QP=0 |
3608 | NROTATIONS_DP=0 |
3609 | ENDIF |
3610 | @@ -518,10 +518,17 @@ |
3611 | ENDDO |
3612 | ENDDO |
3613 | ENDDO |
3614 | +<<<<<<< TREE |
3615 | IF(BOOTANDSTOP) THEN |
3616 | WRITE(*,*) 'Stopped by user request.' |
3617 | STOP |
3618 | ENDIF |
3619 | +======= |
3620 | + ENDDO |
3621 | + IF(BOOTANDSTOP) THEN |
3622 | + WRITE(*,*) '##Stopped by user request.' |
3623 | + STOP |
3624 | +>>>>>>> MERGE-SOURCE |
3625 | ENDIF |
3626 | |
3627 | IF(NTRY.EQ.0) THEN |
3628 | @@ -2258,10 +2265,10 @@ |
3629 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
3630 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3631 | $ //'lly double checked.' |
3632 | - WRITE(*,*) 'One reason for this is that you might hav' |
3633 | + WRITE(*,*) '##One reason for this is that you might hav' |
3634 | $ //'e changed sensible parameters which affected wha' |
3635 | $ //'t are the zero helicity configurations.' |
3636 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3637 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3638 | $ //'y filter with the next PS points it receives.' |
3639 | NTRY=0 |
3640 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
3641 | @@ -2274,10 +2281,10 @@ |
3642 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
3643 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3644 | $ //'lly double checked.' |
3645 | - WRITE(*,*) 'One reason for this is that you might hav' |
3646 | + WRITE(*,*) '##One reason for this is that you might hav' |
3647 | $ //'e changed sensible parameters which affected th' |
3648 | $ //'e helicity dependance relations.' |
3649 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3650 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3651 | $ //'y filter with the next PS points it receives.' |
3652 | NTRY=0 |
3653 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
3654 | @@ -2430,15 +2437,15 @@ |
3655 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
3656 | $ , ' detected.' |
3657 | IF (NSQUAREDSO.NE.1) THEN |
3658 | - WRITE(*,*) 'Accuracies for each split orde' |
3659 | + WRITE(*,*) '##Accuracies for each split orde' |
3660 | $ //'r, starting with the summed case' |
3661 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
3662 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
3663 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
3664 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
3665 | + WRITE(*,*) '##DP accuracies (for each split orde' |
3666 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
3667 | + WRITE(*,*) '##QP accuracies (for each split orde' |
3668 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
3669 | ELSE |
3670 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
3671 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
3672 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
3673 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
3674 | ENDIF |
3675 | DO J=0,NSQUAREDSO |
3676 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
3677 | |
3678 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f' |
3679 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f 2015-06-30 16:20:47 +0000 |
3680 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f 2015-07-24 15:59:43 +0000 |
3681 | @@ -420,9 +420,9 @@ |
3682 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
3683 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
3684 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
3685 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
3686 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
3687 | - $ //'d NROTATIONS_QP to 0.' |
3688 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
3689 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
3690 | + $ //'_DP and NROTATIONS_QP to 0.' |
3691 | NROTATIONS_QP=0 |
3692 | NROTATIONS_DP=0 |
3693 | ENDIF |
3694 | @@ -518,10 +518,17 @@ |
3695 | ENDDO |
3696 | ENDDO |
3697 | ENDDO |
3698 | +<<<<<<< TREE |
3699 | IF(BOOTANDSTOP) THEN |
3700 | WRITE(*,*) 'Stopped by user request.' |
3701 | STOP |
3702 | ENDIF |
3703 | +======= |
3704 | + ENDDO |
3705 | + IF(BOOTANDSTOP) THEN |
3706 | + WRITE(*,*) '##Stopped by user request.' |
3707 | + STOP |
3708 | +>>>>>>> MERGE-SOURCE |
3709 | ENDIF |
3710 | |
3711 | IF(NTRY.EQ.0) THEN |
3712 | @@ -9141,10 +9148,10 @@ |
3713 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
3714 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3715 | $ //'lly double checked.' |
3716 | - WRITE(*,*) 'One reason for this is that you might hav' |
3717 | + WRITE(*,*) '##One reason for this is that you might hav' |
3718 | $ //'e changed sensible parameters which affected wha' |
3719 | $ //'t are the zero helicity configurations.' |
3720 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3721 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3722 | $ //'y filter with the next PS points it receives.' |
3723 | NTRY=0 |
3724 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
3725 | @@ -9157,10 +9164,10 @@ |
3726 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
3727 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3728 | $ //'lly double checked.' |
3729 | - WRITE(*,*) 'One reason for this is that you might hav' |
3730 | + WRITE(*,*) '##One reason for this is that you might hav' |
3731 | $ //'e changed sensible parameters which affected th' |
3732 | $ //'e helicity dependance relations.' |
3733 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3734 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3735 | $ //'y filter with the next PS points it receives.' |
3736 | NTRY=0 |
3737 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
3738 | @@ -9313,15 +9320,15 @@ |
3739 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
3740 | $ , ' detected.' |
3741 | IF (NSQUAREDSO.NE.1) THEN |
3742 | - WRITE(*,*) 'Accuracies for each split orde' |
3743 | + WRITE(*,*) '##Accuracies for each split orde' |
3744 | $ //'r, starting with the summed case' |
3745 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
3746 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
3747 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
3748 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
3749 | + WRITE(*,*) '##DP accuracies (for each split orde' |
3750 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
3751 | + WRITE(*,*) '##QP accuracies (for each split orde' |
3752 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
3753 | ELSE |
3754 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
3755 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
3756 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
3757 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
3758 | ENDIF |
3759 | DO J=0,NSQUAREDSO |
3760 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
3761 | |
3762 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f' |
3763 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f 2015-06-30 16:20:47 +0000 |
3764 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f 2015-07-24 15:59:43 +0000 |
3765 | @@ -412,9 +412,9 @@ |
3766 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
3767 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
3768 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
3769 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
3770 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
3771 | - $ //'d NROTATIONS_QP to 0.' |
3772 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
3773 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
3774 | + $ //'_DP and NROTATIONS_QP to 0.' |
3775 | NROTATIONS_QP=0 |
3776 | NROTATIONS_DP=0 |
3777 | ENDIF |
3778 | @@ -510,10 +510,17 @@ |
3779 | ENDDO |
3780 | ENDDO |
3781 | ENDDO |
3782 | +<<<<<<< TREE |
3783 | IF(BOOTANDSTOP) THEN |
3784 | WRITE(*,*) 'Stopped by user request.' |
3785 | STOP |
3786 | ENDIF |
3787 | +======= |
3788 | + ENDDO |
3789 | + IF(BOOTANDSTOP) THEN |
3790 | + WRITE(*,*) '##Stopped by user request.' |
3791 | + STOP |
3792 | +>>>>>>> MERGE-SOURCE |
3793 | ENDIF |
3794 | |
3795 | IF(NTRY.EQ.0) THEN |
3796 | @@ -1304,10 +1311,10 @@ |
3797 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
3798 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3799 | $ //'lly double checked.' |
3800 | - WRITE(*,*) 'One reason for this is that you might hav' |
3801 | + WRITE(*,*) '##One reason for this is that you might hav' |
3802 | $ //'e changed sensible parameters which affected wha' |
3803 | $ //'t are the zero helicity configurations.' |
3804 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3805 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3806 | $ //'y filter with the next PS points it receives.' |
3807 | NTRY=0 |
3808 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
3809 | @@ -1320,10 +1327,10 @@ |
3810 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
3811 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3812 | $ //'lly double checked.' |
3813 | - WRITE(*,*) 'One reason for this is that you might hav' |
3814 | + WRITE(*,*) '##One reason for this is that you might hav' |
3815 | $ //'e changed sensible parameters which affected th' |
3816 | $ //'e helicity dependance relations.' |
3817 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3818 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3819 | $ //'y filter with the next PS points it receives.' |
3820 | NTRY=0 |
3821 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
3822 | @@ -1476,15 +1483,15 @@ |
3823 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
3824 | $ , ' detected.' |
3825 | IF (NSQUAREDSO.NE.1) THEN |
3826 | - WRITE(*,*) 'Accuracies for each split orde' |
3827 | + WRITE(*,*) '##Accuracies for each split orde' |
3828 | $ //'r, starting with the summed case' |
3829 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
3830 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
3831 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
3832 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
3833 | + WRITE(*,*) '##DP accuracies (for each split orde' |
3834 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
3835 | + WRITE(*,*) '##QP accuracies (for each split orde' |
3836 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
3837 | ELSE |
3838 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
3839 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
3840 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
3841 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
3842 | ENDIF |
3843 | DO J=0,NSQUAREDSO |
3844 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
3845 | |
3846 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f' |
3847 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f 2015-06-30 16:20:47 +0000 |
3848 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f 2015-07-24 15:59:43 +0000 |
3849 | @@ -420,9 +420,9 @@ |
3850 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
3851 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
3852 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
3853 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
3854 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
3855 | - $ //'d NROTATIONS_QP to 0.' |
3856 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
3857 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
3858 | + $ //'_DP and NROTATIONS_QP to 0.' |
3859 | NROTATIONS_QP=0 |
3860 | NROTATIONS_DP=0 |
3861 | ENDIF |
3862 | @@ -518,10 +518,17 @@ |
3863 | ENDDO |
3864 | ENDDO |
3865 | ENDDO |
3866 | +<<<<<<< TREE |
3867 | IF(BOOTANDSTOP) THEN |
3868 | WRITE(*,*) 'Stopped by user request.' |
3869 | STOP |
3870 | ENDIF |
3871 | +======= |
3872 | + ENDDO |
3873 | + IF(BOOTANDSTOP) THEN |
3874 | + WRITE(*,*) '##Stopped by user request.' |
3875 | + STOP |
3876 | +>>>>>>> MERGE-SOURCE |
3877 | ENDIF |
3878 | |
3879 | IF(NTRY.EQ.0) THEN |
3880 | @@ -9386,10 +9393,10 @@ |
3881 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
3882 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3883 | $ //'lly double checked.' |
3884 | - WRITE(*,*) 'One reason for this is that you might hav' |
3885 | + WRITE(*,*) '##One reason for this is that you might hav' |
3886 | $ //'e changed sensible parameters which affected wha' |
3887 | $ //'t are the zero helicity configurations.' |
3888 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3889 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3890 | $ //'y filter with the next PS points it receives.' |
3891 | NTRY=0 |
3892 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
3893 | @@ -9402,10 +9409,10 @@ |
3894 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
3895 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3896 | $ //'lly double checked.' |
3897 | - WRITE(*,*) 'One reason for this is that you might hav' |
3898 | + WRITE(*,*) '##One reason for this is that you might hav' |
3899 | $ //'e changed sensible parameters which affected th' |
3900 | $ //'e helicity dependance relations.' |
3901 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3902 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3903 | $ //'y filter with the next PS points it receives.' |
3904 | NTRY=0 |
3905 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
3906 | @@ -9558,15 +9565,15 @@ |
3907 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
3908 | $ , ' detected.' |
3909 | IF (NSQUAREDSO.NE.1) THEN |
3910 | - WRITE(*,*) 'Accuracies for each split orde' |
3911 | + WRITE(*,*) '##Accuracies for each split orde' |
3912 | $ //'r, starting with the summed case' |
3913 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
3914 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
3915 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
3916 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
3917 | + WRITE(*,*) '##DP accuracies (for each split orde' |
3918 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
3919 | + WRITE(*,*) '##QP accuracies (for each split orde' |
3920 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
3921 | ELSE |
3922 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
3923 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
3924 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
3925 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
3926 | ENDIF |
3927 | DO J=0,NSQUAREDSO |
3928 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
3929 | |
3930 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f' |
3931 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f 2015-06-30 16:20:47 +0000 |
3932 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f 2015-07-24 15:59:43 +0000 |
3933 | @@ -420,9 +420,9 @@ |
3934 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
3935 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
3936 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
3937 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
3938 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
3939 | - $ //'d NROTATIONS_QP to 0.' |
3940 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
3941 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
3942 | + $ //'_DP and NROTATIONS_QP to 0.' |
3943 | NROTATIONS_QP=0 |
3944 | NROTATIONS_DP=0 |
3945 | ENDIF |
3946 | @@ -518,10 +518,17 @@ |
3947 | ENDDO |
3948 | ENDDO |
3949 | ENDDO |
3950 | +<<<<<<< TREE |
3951 | IF(BOOTANDSTOP) THEN |
3952 | WRITE(*,*) 'Stopped by user request.' |
3953 | STOP |
3954 | ENDIF |
3955 | +======= |
3956 | + ENDDO |
3957 | + IF(BOOTANDSTOP) THEN |
3958 | + WRITE(*,*) '##Stopped by user request.' |
3959 | + STOP |
3960 | +>>>>>>> MERGE-SOURCE |
3961 | ENDIF |
3962 | |
3963 | IF(NTRY.EQ.0) THEN |
3964 | @@ -9141,10 +9148,10 @@ |
3965 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
3966 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3967 | $ //'lly double checked.' |
3968 | - WRITE(*,*) 'One reason for this is that you might hav' |
3969 | + WRITE(*,*) '##One reason for this is that you might hav' |
3970 | $ //'e changed sensible parameters which affected wha' |
3971 | $ //'t are the zero helicity configurations.' |
3972 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3973 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3974 | $ //'y filter with the next PS points it receives.' |
3975 | NTRY=0 |
3976 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
3977 | @@ -9157,10 +9164,10 @@ |
3978 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
3979 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
3980 | $ //'lly double checked.' |
3981 | - WRITE(*,*) 'One reason for this is that you might hav' |
3982 | + WRITE(*,*) '##One reason for this is that you might hav' |
3983 | $ //'e changed sensible parameters which affected th' |
3984 | $ //'e helicity dependance relations.' |
3985 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
3986 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
3987 | $ //'y filter with the next PS points it receives.' |
3988 | NTRY=0 |
3989 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
3990 | @@ -9313,15 +9320,15 @@ |
3991 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
3992 | $ , ' detected.' |
3993 | IF (NSQUAREDSO.NE.1) THEN |
3994 | - WRITE(*,*) 'Accuracies for each split orde' |
3995 | + WRITE(*,*) '##Accuracies for each split orde' |
3996 | $ //'r, starting with the summed case' |
3997 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
3998 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
3999 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
4000 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
4001 | + WRITE(*,*) '##DP accuracies (for each split orde' |
4002 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
4003 | + WRITE(*,*) '##QP accuracies (for each split orde' |
4004 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
4005 | ELSE |
4006 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
4007 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
4008 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
4009 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
4010 | ENDIF |
4011 | DO J=0,NSQUAREDSO |
4012 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
4013 | |
4014 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f' |
4015 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f 2015-06-30 16:20:47 +0000 |
4016 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f 2015-07-24 15:59:43 +0000 |
4017 | @@ -420,9 +420,9 @@ |
4018 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
4019 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
4020 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
4021 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
4022 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
4023 | - $ //'d NROTATIONS_QP to 0.' |
4024 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
4025 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
4026 | + $ //'_DP and NROTATIONS_QP to 0.' |
4027 | NROTATIONS_QP=0 |
4028 | NROTATIONS_DP=0 |
4029 | ENDIF |
4030 | @@ -518,10 +518,17 @@ |
4031 | ENDDO |
4032 | ENDDO |
4033 | ENDDO |
4034 | +<<<<<<< TREE |
4035 | IF(BOOTANDSTOP) THEN |
4036 | WRITE(*,*) 'Stopped by user request.' |
4037 | STOP |
4038 | ENDIF |
4039 | +======= |
4040 | + ENDDO |
4041 | + IF(BOOTANDSTOP) THEN |
4042 | + WRITE(*,*) '##Stopped by user request.' |
4043 | + STOP |
4044 | +>>>>>>> MERGE-SOURCE |
4045 | ENDIF |
4046 | |
4047 | IF(NTRY.EQ.0) THEN |
4048 | @@ -2258,10 +2265,10 @@ |
4049 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
4050 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
4051 | $ //'lly double checked.' |
4052 | - WRITE(*,*) 'One reason for this is that you might hav' |
4053 | + WRITE(*,*) '##One reason for this is that you might hav' |
4054 | $ //'e changed sensible parameters which affected wha' |
4055 | $ //'t are the zero helicity configurations.' |
4056 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
4057 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
4058 | $ //'y filter with the next PS points it receives.' |
4059 | NTRY=0 |
4060 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
4061 | @@ -2274,10 +2281,10 @@ |
4062 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
4063 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
4064 | $ //'lly double checked.' |
4065 | - WRITE(*,*) 'One reason for this is that you might hav' |
4066 | + WRITE(*,*) '##One reason for this is that you might hav' |
4067 | $ //'e changed sensible parameters which affected th' |
4068 | $ //'e helicity dependance relations.' |
4069 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
4070 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
4071 | $ //'y filter with the next PS points it receives.' |
4072 | NTRY=0 |
4073 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
4074 | @@ -2430,15 +2437,15 @@ |
4075 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
4076 | $ , ' detected.' |
4077 | IF (NSQUAREDSO.NE.1) THEN |
4078 | - WRITE(*,*) 'Accuracies for each split orde' |
4079 | + WRITE(*,*) '##Accuracies for each split orde' |
4080 | $ //'r, starting with the summed case' |
4081 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
4082 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
4083 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
4084 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
4085 | + WRITE(*,*) '##DP accuracies (for each split orde' |
4086 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
4087 | + WRITE(*,*) '##QP accuracies (for each split orde' |
4088 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
4089 | ELSE |
4090 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
4091 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
4092 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
4093 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
4094 | ENDIF |
4095 | DO J=0,NSQUAREDSO |
4096 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
4097 | |
4098 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f' |
4099 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f 2015-06-30 16:20:47 +0000 |
4100 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f 2015-07-24 15:59:43 +0000 |
4101 | @@ -412,9 +412,9 @@ |
4102 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
4103 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
4104 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
4105 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
4106 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
4107 | - $ //'d NROTATIONS_QP to 0.' |
4108 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
4109 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
4110 | + $ //'_DP and NROTATIONS_QP to 0.' |
4111 | NROTATIONS_QP=0 |
4112 | NROTATIONS_DP=0 |
4113 | ENDIF |
4114 | @@ -510,10 +510,17 @@ |
4115 | ENDDO |
4116 | ENDDO |
4117 | ENDDO |
4118 | +<<<<<<< TREE |
4119 | IF(BOOTANDSTOP) THEN |
4120 | WRITE(*,*) 'Stopped by user request.' |
4121 | STOP |
4122 | ENDIF |
4123 | +======= |
4124 | + ENDDO |
4125 | + IF(BOOTANDSTOP) THEN |
4126 | + WRITE(*,*) '##Stopped by user request.' |
4127 | + STOP |
4128 | +>>>>>>> MERGE-SOURCE |
4129 | ENDIF |
4130 | |
4131 | IF(NTRY.EQ.0) THEN |
4132 | @@ -1304,10 +1311,10 @@ |
4133 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
4134 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
4135 | $ //'lly double checked.' |
4136 | - WRITE(*,*) 'One reason for this is that you might hav' |
4137 | + WRITE(*,*) '##One reason for this is that you might hav' |
4138 | $ //'e changed sensible parameters which affected wha' |
4139 | $ //'t are the zero helicity configurations.' |
4140 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
4141 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
4142 | $ //'y filter with the next PS points it receives.' |
4143 | NTRY=0 |
4144 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
4145 | @@ -1320,10 +1327,10 @@ |
4146 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
4147 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
4148 | $ //'lly double checked.' |
4149 | - WRITE(*,*) 'One reason for this is that you might hav' |
4150 | + WRITE(*,*) '##One reason for this is that you might hav' |
4151 | $ //'e changed sensible parameters which affected th' |
4152 | $ //'e helicity dependance relations.' |
4153 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
4154 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
4155 | $ //'y filter with the next PS points it receives.' |
4156 | NTRY=0 |
4157 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
4158 | @@ -1476,15 +1483,15 @@ |
4159 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
4160 | $ , ' detected.' |
4161 | IF (NSQUAREDSO.NE.1) THEN |
4162 | - WRITE(*,*) 'Accuracies for each split orde' |
4163 | + WRITE(*,*) '##Accuracies for each split orde' |
4164 | $ //'r, starting with the summed case' |
4165 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
4166 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
4167 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
4168 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
4169 | + WRITE(*,*) '##DP accuracies (for each split orde' |
4170 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
4171 | + WRITE(*,*) '##QP accuracies (for each split orde' |
4172 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
4173 | ELSE |
4174 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
4175 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
4176 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
4177 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
4178 | ENDIF |
4179 | DO J=0,NSQUAREDSO |
4180 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
4181 | |
4182 | === modified file 'tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f' |
4183 | --- tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f 2015-06-30 16:20:47 +0000 |
4184 | +++ tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f 2015-07-24 15:59:43 +0000 |
4185 | @@ -412,9 +412,9 @@ |
4186 | C if AUTOMATIC_TIR_CACHE_CLEARING is disabled. |
4187 | IF(.NOT.AUTOMATIC_TIR_CACHE_CLEARING) THEN |
4188 | IF(NROTATIONS_DP.NE.0.OR.NROTATIONS_QP.NE.0) THEN |
4189 | - WRITE(*,*) 'INFO: AUTOMATIC_TIR_CACHE_CLEARING is disable' |
4190 | - $ //'d, so MadLoop automatically resets NROTATIONS_DP an' |
4191 | - $ //'d NROTATIONS_QP to 0.' |
4192 | + WRITE(*,*) '##INFO: AUTOMATIC_TIR_CACHE_CLEARING i' |
4193 | + $ //'s disabled, so MadLoop automatically resets NROTATIONS' |
4194 | + $ //'_DP and NROTATIONS_QP to 0.' |
4195 | NROTATIONS_QP=0 |
4196 | NROTATIONS_DP=0 |
4197 | ENDIF |
4198 | @@ -510,10 +510,17 @@ |
4199 | ENDDO |
4200 | ENDDO |
4201 | ENDDO |
4202 | +<<<<<<< TREE |
4203 | IF(BOOTANDSTOP) THEN |
4204 | WRITE(*,*) 'Stopped by user request.' |
4205 | STOP |
4206 | ENDIF |
4207 | +======= |
4208 | + ENDDO |
4209 | + IF(BOOTANDSTOP) THEN |
4210 | + WRITE(*,*) '##Stopped by user request.' |
4211 | + STOP |
4212 | +>>>>>>> MERGE-SOURCE |
4213 | ENDIF |
4214 | |
4215 | IF(NTRY.EQ.0) THEN |
4216 | @@ -1443,10 +1450,10 @@ |
4217 | $ ,REF/DBLE(NCOMB),-1,-1)) THEN |
4218 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
4219 | $ //'lly double checked.' |
4220 | - WRITE(*,*) 'One reason for this is that you might hav' |
4221 | + WRITE(*,*) '##One reason for this is that you might hav' |
4222 | $ //'e changed sensible parameters which affected wha' |
4223 | $ //'t are the zero helicity configurations.' |
4224 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
4225 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
4226 | $ //'y filter with the next PS points it receives.' |
4227 | NTRY=0 |
4228 | OPEN(29,FILE=HELFILTERFN,ERR=348) |
4229 | @@ -1459,10 +1466,10 @@ |
4230 | $ L(HELPICKED)+HELOFFSET)),REF,.TRUE.).EQ.0) THEN |
4231 | WRITE(*,*) '##W15 Helicity filter could not be successfu' |
4232 | $ //'lly double checked.' |
4233 | - WRITE(*,*) 'One reason for this is that you might hav' |
4234 | + WRITE(*,*) '##One reason for this is that you might hav' |
4235 | $ //'e changed sensible parameters which affected th' |
4236 | $ //'e helicity dependance relations.' |
4237 | - WRITE(*,*) 'MadLoop will try to reset the Helicit' |
4238 | + WRITE(*,*) '##MadLoop will try to reset the Helicit' |
4239 | $ //'y filter with the next PS points it receives.' |
4240 | NTRY=0 |
4241 | OPEN(30,FILE=HELFILTERFN,ERR=349) |
4242 | @@ -1615,15 +1622,15 @@ |
4243 | WRITE(*,*) '##W03 WARNING An unstable PS point was' |
4244 | $ , ' detected.' |
4245 | IF (NSQUAREDSO.NE.1) THEN |
4246 | - WRITE(*,*) 'Accuracies for each split orde' |
4247 | + WRITE(*,*) '##Accuracies for each split orde' |
4248 | $ //'r, starting with the summed case' |
4249 | - WRITE(*,*) 'DP accuracies (for each split order): ' |
4250 | - $ ,(TEMP1(I),I=0,NSQUAREDSO) |
4251 | - WRITE(*,*) 'QP accuracies (for each split order): ' |
4252 | - $ ,(ACC(I),I=0,NSQUAREDSO) |
4253 | + WRITE(*,*) '##DP accuracies (for each split orde' |
4254 | + $ //'r): ',(TEMP1(I),I=0,NSQUAREDSO) |
4255 | + WRITE(*,*) '##QP accuracies (for each split orde' |
4256 | + $ //'r): ',(ACC(I),I=0,NSQUAREDSO) |
4257 | ELSE |
4258 | - WRITE(*,*) 'DP accuracy: ',TEMP1(1) |
4259 | - WRITE(*,*) 'QP accuracy: ',ACC(1) |
4260 | + WRITE(*,*) '##DP accuracy: ',TEMP1(1) |
4261 | + WRITE(*,*) '##QP accuracy: ',ACC(1) |
4262 | ENDIF |
4263 | DO J=0,NSQUAREDSO |
4264 | IF (NSQUAREDSO.NE.1.OR.J.NE.0) THEN |
4265 | |
4266 | === renamed file 'tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f' => 'tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopCommons.f.THIS' |
4267 | === removed file 'tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopParamReader.f' |
4268 | --- tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopParamReader.f 2015-01-31 06:28:49 +0000 |
4269 | +++ tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%MadLoopParamReader.f 1970-01-01 00:00:00 +0000 |
4270 | @@ -1,270 +0,0 @@ |
4271 | - subroutine MadLoopParamReader(filename, printParam) |
4272 | - |
4273 | - implicit none |
4274 | - |
4275 | - CHARACTER(512) fileName, buff, buff2, mode |
4276 | - CHARACTER*10 MLReductionLib_str,MLReductionLib_str_save |
4277 | - CHARACTER*2 MLReductionLib_char |
4278 | - INTEGER MLRed,i,j,k |
4279 | - |
4280 | - include "MadLoopParams.inc" |
4281 | - |
4282 | - logical printParam, couldRead, paramPrinted, find |
4283 | - data paramPrinted/.FALSE./ |
4284 | - couldRead=.False. |
4285 | -! Default parameters |
4286 | - |
4287 | - open(666, file=fileName, err=676, status='OLD', action='READ') |
4288 | - do |
4289 | - read(666,*,end=999) buff |
4290 | - if(index(buff,'#').eq.1) then |
4291 | - |
4292 | - if (buff .eq. '#CTModeInit') then |
4293 | - read(666,*,end=999) CTModeInit |
4294 | - if (CTModeInit .lt. 0 .or. |
4295 | - & CTModeInit .gt. 6 ) then |
4296 | - stop 'CTModeInit must be >= 0 and <=6.' |
4297 | - endif |
4298 | - |
4299 | - else if (buff .eq. '#CTModeRun') then |
4300 | - read(666,*,end=999) CTModeRun |
4301 | - if (CTModeRun .lt. -1 .or. |
4302 | - & CTModeRun .gt. 6 ) then |
4303 | - stop 'CTModeRun must be >= -1 and <=6.' |
4304 | - endif |
4305 | - |
4306 | - else if (buff .eq. '#NRotations_DP') then |
4307 | - read(666,*,end=999) NRotations_DP |
4308 | - if (NRotations_DP .lt. 0 .or. |
4309 | - & NRotations_DP .gt. 2 ) then |
4310 | - stop 'NRotations_DP must be >= 0 and <=2.' |
4311 | - endif |
4312 | - |
4313 | - else if (buff .eq. '#NRotations_QP') then |
4314 | - read(666,*,end=999) NRotations_QP |
4315 | - if (NRotations_QP .lt. 0 .or. |
4316 | - & NRotations_QP .gt. 2 ) then |
4317 | - stop 'NRotations_QP must be >= 0 and <=2.' |
4318 | - endif |
4319 | - |
4320 | - else if (buff .eq. '#MLStabThres') then |
4321 | - read(666,*,end=999) MLStabThres |
4322 | - if (MLStabThres.lt.0.0d0) then |
4323 | - stop 'MLStabThres must be >= 0' |
4324 | - endif |
4325 | - |
4326 | - else if (buff .eq. '#CTLoopLibrary') then |
4327 | - read(666,*,end=999) CTLoopLibrary |
4328 | - if (CTLoopLibrary.lt.2 .or. |
4329 | - & CTLoopLibrary.gt.3) then |
4330 | - stop 'CTLoopLibrary must be >= 2 and <=3.' |
4331 | - endif |
4332 | - |
4333 | - else if (buff .eq. '#CTStabThres') then |
4334 | - read(666,*,end=999) CTStabThres |
4335 | - if (CTStabThres.le.0.0d0) then |
4336 | - stop 'CTStabThres must be > 0' |
4337 | - endif |
4338 | - |
4339 | - else if (buff .eq. '#ZeroThres') then |
4340 | - read(666,*,end=999) ZeroThres |
4341 | - if (ZeroThres.le.0.0d0) then |
4342 | - stop 'ZeroThres must be > 0' |
4343 | - endif |
4344 | - |
4345 | - else if (buff .eq. '#OSThres') then |
4346 | - read(666,*,end=999) OSThres |
4347 | - if (OSThres.le.0.0d0) then |
4348 | - stop 'OSThres must be > 0' |
4349 | - endif |
4350 | - |
4351 | - else if (buff .eq. '#CheckCycle') then |
4352 | - read(666,*,end=999) CheckCycle |
4353 | - if (CheckCycle.lt.1) then |
4354 | - stop 'CheckCycle must be >= 1' |
4355 | - endif |
4356 | - |
4357 | - else if (buff .eq. '#MaxAttempts') then |
4358 | - read(666,*,end=999) MaxAttempts |
4359 | - if (MaxAttempts.lt.1) then |
4360 | - stop 'MaxAttempts must be >= 1' |
4361 | - endif |
4362 | - |
4363 | - else if (buff .eq. '#UseLoopFilter') then |
4364 | - read(666,*,end=999) UseLoopFilter |
4365 | - |
4366 | - else if (buff .eq. '#DoubleCheckHelicityFilter') then |
4367 | - read(666,*,end=999) DoubleCheckHelicityFilter |
4368 | - |
4369 | - else if (buff .eq. '#LoopInitStartOver') then |
4370 | - read(666,*,end=999) LoopInitStartOver |
4371 | - |
4372 | - else if (buff .eq. '#HelInitStartOver') then |
4373 | - read(666,*,end=999) HelInitStartOver |
4374 | - |
4375 | - else if (buff .eq. '#WriteOutFilters') then |
4376 | - read(666,*,end=999) WriteOutFilters |
4377 | - |
4378 | - else if (buff .eq. '#ImprovePSPoint') then |
4379 | - read(666,*,end=999) ImprovePSPoint |
4380 | - if (ImprovePSPoint .lt. -1 .or. |
4381 | - & ImprovePSPoint .gt. 2 ) then |
4382 | - stop 'ImprovePSPoint must be >= -1 and <=2.' |
4383 | - endif |
4384 | - |
4385 | - else if (buff .eq. '#HelicityFilterLevel') then |
4386 | - read(666,*,end=999) HelicityFilterLevel |
4387 | - if (HelicityFilterLevel .lt. 0 .or. |
4388 | - & HelicityFilterLevel .gt. 2 ) then |
4389 | - stop 'HelicityFilterLevel must be >= 0 and <=2.' |
4390 | - endif |
4391 | - |
4392 | - else if (buff .eq. '#MLReductionLib') then |
4393 | - read(666,*,end=999) MLReductionLib_str |
4394 | - MLReductionLib(1:5)=0 |
4395 | - MLReductionLib_str_save=MLReductionLib_str |
4396 | - j=0 |
4397 | - DO |
4398 | - i=index(MLReductionLib_str,'|') |
4399 | - IF(i.EQ.0)THEN |
4400 | - MLReductionLib_char=MLReductionLib_str |
4401 | - ELSE |
4402 | - MLReductionLib_char=MLReductionLib_str(:i-1) |
4403 | - ENDIF |
4404 | - IF(MLReductionLib_char.EQ.'1 ')THEN |
4405 | - MLRed=1 |
4406 | - ELSEIF(MLReductionLib_char.EQ.'2 ')THEN |
4407 | - MLRed=2 |
4408 | - ELSEIF(MLReductionLib_char.EQ.'3 ')THEN |
4409 | - MLRed=3 |
4410 | - ELSEIF(MLReductionLib_char.EQ.'4 ')THEN |
4411 | - MLRed=4 |
4412 | - ELSE |
4413 | - PRINT *, 'MLReductionLib is wrong: '// |
4414 | - $ TRIM(MLReductionLib_str_save) |
4415 | - STOP |
4416 | - ENDIF |
4417 | - find=.FALSE. |
4418 | - DO k=1,j |
4419 | - IF(MLReductionLib(k).EQ.MLRed)THEN |
4420 | - find=.TRUE. |
4421 | - EXIT |
4422 | - ENDIF |
4423 | - ENDDO |
4424 | - IF(.NOT.find)THEN |
4425 | - j=j+1 |
4426 | - MLReductionLib(j)=MLRed |
4427 | - ENDIF |
4428 | - IF(i.EQ.0)THEN |
4429 | - EXIT |
4430 | - ELSE |
4431 | - MLReductionLib_str=MLReductionLib_str(i+1:) |
4432 | - ENDIF |
4433 | - ENDDO |
4434 | - else if (buff .eq. '#IREGIRECY') then |
4435 | - read(666,*,end=999) IREGIRECY |
4436 | - else if (buff .eq. '#IREGIMODE') then |
4437 | - read(666,*,end=999) IREGIMODE |
4438 | - if (IREGIMODE .lt. 0 .or. |
4439 | - & IREGIMODE .gt.2) then |
4440 | - stop 'IREGIMODE must be >=0 and <=2.' |
4441 | - endif |
4442 | - else |
4443 | - write(*,*) 'The parameter name ',buff(2:), |
4444 | - &' is not reckognized.' |
4445 | - stop |
4446 | - endif |
4447 | - |
4448 | - endif |
4449 | - enddo |
4450 | - 999 continue |
4451 | - couldRead=.True. |
4452 | - goto 998 |
4453 | - |
4454 | - 676 continue |
4455 | - write(*,*) '##E00 Error:: MadLoop parameter file ',fileName, |
4456 | - &' could not be found or is malformed. Please specify it.' |
4457 | - stop |
4458 | -C Below is the code if one desires to let the code continue with |
4459 | -C a non existing or malformed parameter file |
4460 | - write(*,*) '##I01 INFO :: The file ',fileName,' could not be ', |
4461 | - & ' open or did not contain the necessary information. The ', |
4462 | - & ' default MadLoop parameters will be used.' |
4463 | - call DefaultParam() |
4464 | - goto 999 |
4465 | - |
4466 | - 998 continue |
4467 | - |
4468 | - if(printParam.and..not.paramPrinted) then |
4469 | - write(*,*) |
4470 | - & '===============================================================' |
4471 | - if (couldRead) then |
4472 | - write(*,*) 'INFO: MadLoop read these parameters from ' |
4473 | - &,filename |
4474 | - else |
4475 | - write(*,*) 'INFO: MadLoop used the default parameters.' |
4476 | - endif |
4477 | - write(*,*) |
4478 | - & '===============================================================' |
4479 | - write(*,*) ' > MLReductionLib = ' |
4480 | - $ //TRIM(MLReductionLib_str_save) |
4481 | - write(*,*) ' > IREGIMODE = ',IREGIMODE |
4482 | - write(*,*) ' > IREGIRECY = ',IREGIRECY |
4483 | - write(*,*) ' > CTModeRun = ',CTModeRun |
4484 | - write(*,*) ' > MLStabThres = ',MLStabThres |
4485 | - write(*,*) ' > NRotations_DP = ',NRotations_DP |
4486 | - write(*,*) ' > NRotations_QP = ',NRotations_QP |
4487 | - write(*,*) ' > CTStabThres = ',CTStabThres |
4488 | - write(*,*) ' > CTLoopLibrary = ',CTLoopLibrary |
4489 | - write(*,*) ' > CTModeInit = ',CTModeInit |
4490 | - write(*,*) ' > CheckCycle = ',CheckCycle |
4491 | - write(*,*) ' > MaxAttempts = ',MaxAttempts |
4492 | - write(*,*) ' > UseLoopFilter = ',UseLoopFilter |
4493 | - write(*,*) ' > HelicityFilterLevel = ',HelicityFilterLevel |
4494 | - write(*,*) ' > ImprovePSPoint = ',ImprovePSPoint |
4495 | - write(*,*) ' > DoubleCheckHelicityFilter = ', |
4496 | - &DoubleCheckHelicityFilter |
4497 | - write(*,*) ' > LoopInitStartOver = ',LoopInitStartOver |
4498 | - write(*,*) ' > HelInitStartOver = ',HelInitStartOver |
4499 | - write(*,*) ' > ZeroThres = ',ZeroThres |
4500 | - write(*,*) ' > OSThres = ',OSThres |
4501 | - write(*,*) ' > WriteOutFilters = ',WriteOutFilters |
4502 | - write(*,*) |
4503 | - & '===============================================================' |
4504 | - paramPrinted=.TRUE. |
4505 | - endif |
4506 | - |
4507 | - close(666) |
4508 | - |
4509 | - end |
4510 | - |
4511 | - subroutine DefaultParam() |
4512 | - |
4513 | - implicit none |
4514 | - |
4515 | - include "MadLoopParams.inc" |
4516 | - |
4517 | - MLReductionLib(1)=1 |
4518 | - MLReductionLib(2:5)=0 |
4519 | - IREGIMODE=2 |
4520 | - IREGIRECY=.TRUE. |
4521 | - CTModeInit=0 |
4522 | - CTModeRun=-1 |
4523 | - NRotations_DP=1 |
4524 | - NRotations_QP=0 |
4525 | - MLStabThres=1.0d-3 |
4526 | - CTStabThres=1.0d-2 |
4527 | - CTLoopLibrary=3 |
4528 | - CheckCycle=3 |
4529 | - MaxAttempts=10 |
4530 | - HelicityFilterLevel=2 |
4531 | - UseLoopFilter=.False. |
4532 | - DoubleCheckHelicityFilter=.True. |
4533 | - LoopInitStartOver=.False. |
4534 | - HelInitStartOver=.False. |
4535 | - WriteOutFilters=.True. |
4536 | - ZeroThres=1.0d-9 |
4537 | - OSThres=1.0d-13 |
4538 | - ImprovePSPoint=2 |
4539 | - |
4540 | - end |
4541 | |
4542 | === removed file 'tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%CT_interface.f' |
4543 | --- tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%CT_interface.f 2014-10-20 01:07:00 +0000 |
4544 | +++ tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%CT_interface.f 1970-01-01 00:00:00 +0000 |
4545 | @@ -1,770 +0,0 @@ |
4546 | - SUBROUTINE ML5_0_CTLOOP(NLOOPLINE,PL,M2L,RANK,RES,STABLE) |
4547 | -C |
4548 | -C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s |
4549 | -C By the MadGraph5_aMC@NLO Development Team |
4550 | -C Visit launchpad.net/madgraph5 and amcatnlo.web.cern.ch |
4551 | -C |
4552 | -C Interface between MG5 and CutTools. |
4553 | -C |
4554 | -C Process: g g > t t~ [ virt = QCD ] |
4555 | -C |
4556 | -C |
4557 | -C CONSTANTS |
4558 | -C |
4559 | - INTEGER NEXTERNAL |
4560 | - PARAMETER (NEXTERNAL=4) |
4561 | - LOGICAL CHECKPCONSERVATION |
4562 | - PARAMETER (CHECKPCONSERVATION=.TRUE.) |
4563 | - REAL*8 NORMALIZATION |
4564 | - PARAMETER (NORMALIZATION = 1.D0/(16.D0*3.14159265358979323846D0* |
4565 | - $ *2)) |
4566 | -C |
4567 | -C ARGUMENTS |
4568 | -C |
4569 | - INTEGER NLOOPLINE, RANK |
4570 | - REAL*8 PL(0:3,NLOOPLINE) |
4571 | - REAL*8 PCT(0:3,0:NLOOPLINE-1) |
4572 | - COMPLEX*16 M2L(NLOOPLINE) |
4573 | - COMPLEX*16 M2LCT(0:NLOOPLINE-1) |
4574 | - COMPLEX*16 RES(3) |
4575 | - LOGICAL STABLE |
4576 | -C |
4577 | -C LOCAL VARIABLES |
4578 | -C |
4579 | - COMPLEX*16 R1, ACC |
4580 | - INTEGER I, J, K |
4581 | - LOGICAL CTINIT, TIRINIT, GOLEMINIT |
4582 | - COMMON/REDUCTIONCODEINIT/CTINIT,TIRINIT,GOLEMINIT |
4583 | -C |
4584 | -C EXTERNAL FUNCTIONS |
4585 | -C |
4586 | - EXTERNAL ML5_0_LOOPNUM |
4587 | - EXTERNAL ML5_0_MPLOOPNUM |
4588 | -C |
4589 | -C GLOBAL VARIABLES |
4590 | -C |
4591 | - INCLUDE 'coupl.inc' |
4592 | - INTEGER CTMODE |
4593 | - REAL*8 LSCALE |
4594 | - COMMON/ML5_0_CT/LSCALE,CTMODE |
4595 | - |
4596 | - INTEGER ID,SQSOINDEX,R |
4597 | - COMMON/ML5_0_LOOP/ID,SQSOINDEX,R |
4598 | - |
4599 | -C ---------- |
4600 | -C BEGIN CODE |
4601 | -C ---------- |
4602 | - |
4603 | -C INITIALIZE CUTTOOLS IF NEEDED |
4604 | - IF (CTINIT) THEN |
4605 | - CTINIT=.FALSE. |
4606 | - CALL ML5_0_INITCT() |
4607 | - ENDIF |
4608 | - |
4609 | -C YOU CAN FIND THE DETAILS ABOUT THE DIFFERENT CTMODE AT THE |
4610 | -C BEGINNING OF THE FILE CTS_CUTS.F90 IN THE CUTTOOLS DISTRIBUTION |
4611 | - |
4612 | -C CONVERT THE MASSES TO BE COMPLEX |
4613 | - DO I=1,NLOOPLINE |
4614 | - M2LCT(I-1)=M2L(I) |
4615 | - ENDDO |
4616 | - |
4617 | -C CONVERT THE MOMENTA FLOWING IN THE LOOP LINES TO CT CONVENTIONS |
4618 | - DO I=0,3 |
4619 | - DO J=0,(NLOOPLINE-1) |
4620 | - PCT(I,J)=0.D0 |
4621 | - ENDDO |
4622 | - ENDDO |
4623 | - DO I=0,3 |
4624 | - DO J=1,NLOOPLINE |
4625 | - PCT(I,0)=PCT(I,0)+PL(I,J) |
4626 | - ENDDO |
4627 | - ENDDO |
4628 | - IF (CHECKPCONSERVATION) THEN |
4629 | - IF (PCT(0,0).GT.1.D-6) THEN |
4630 | - WRITE(*,*) 'energy is not conserved ',PCT(0,0) |
4631 | - STOP 'energy is not conserved' |
4632 | - ELSEIF (PCT(1,0).GT.1.D-6) THEN |
4633 | - WRITE(*,*) 'px is not conserved ',PCT(1,0) |
4634 | - STOP 'px is not conserved' |
4635 | - ELSEIF (PCT(2,0).GT.1.D-6) THEN |
4636 | - WRITE(*,*) 'py is not conserved ',PCT(2,0) |
4637 | - STOP 'py is not conserved' |
4638 | - ELSEIF (PCT(3,0).GT.1.D-6) THEN |
4639 | - WRITE(*,*) 'pz is not conserved ',PCT(3,0) |
4640 | - STOP 'pz is not conserved' |
4641 | - ENDIF |
4642 | - ENDIF |
4643 | - DO I=0,3 |
4644 | - DO J=1,(NLOOPLINE-1) |
4645 | - DO K=1,J |
4646 | - PCT(I,J)=PCT(I,J)+PL(I,K) |
4647 | - ENDDO |
4648 | - ENDDO |
4649 | - ENDDO |
4650 | - |
4651 | - CALL CTSXCUT(CTMODE,LSCALE,MU_R,NLOOPLINE,ML5_0_LOOPNUM |
4652 | - $ ,ML5_0_MPLOOPNUM,RANK,PCT,M2LCT,RES,ACC,R1,STABLE) |
4653 | - RES(1)=NORMALIZATION*2.0D0*DBLE(RES(1)) |
4654 | - RES(2)=NORMALIZATION*2.0D0*DBLE(RES(2)) |
4655 | - RES(3)=NORMALIZATION*2.0D0*DBLE(RES(3)) |
4656 | -C WRITE(*,*) 'Loop ID',ID,' =',RES(1),RES(2),RES(3) |
4657 | - END |
4658 | - |
4659 | - SUBROUTINE ML5_0_INITCT() |
4660 | -C |
4661 | -C INITIALISATION OF CUTTOOLS |
4662 | -C |
4663 | -C LOCAL VARIABLES |
4664 | -C |
4665 | - REAL*8 THRS |
4666 | - LOGICAL EXT_NUM_FOR_R1 |
4667 | -C |
4668 | -C GLOBAL VARIABLES |
4669 | -C |
4670 | - INCLUDE 'MadLoopParams.inc' |
4671 | -C ---------- |
4672 | -C BEGIN CODE |
4673 | -C ---------- |
4674 | - |
4675 | -C DEFAULT PARAMETERS FOR CUTTOOLS |
4676 | -C ------------------------------- |
4677 | -C THRS1 IS THE PRECISION LIMIT BELOW WHICH THE MP ROUTINES |
4678 | -C ACTIVATES |
4679 | - THRS=CTSTABTHRES |
4680 | -C LOOPLIB SET WHAT LIBRARY CT USES |
4681 | -C 1 -> LOOPTOOLS |
4682 | -C 2 -> AVH |
4683 | -C 3 -> QCDLOOP |
4684 | - LOOPLIB=CTLOOPLIBRARY |
4685 | -C MADLOOP'S NUMERATOR IN THE OPEN LOOP IS MUCH FASTER THAN THE |
4686 | -C RECONSTRUCTED ONE IN CT. SO WE BETTER USE MADLOOP ONE IN THIS |
4687 | -C CASE. |
4688 | - EXT_NUM_FOR_R1=.TRUE. |
4689 | -C ------------------------------- |
4690 | - |
4691 | -C The initialization below is for CT v1.8.+ |
4692 | - CALL CTSINIT(THRS,LOOPLIB,EXT_NUM_FOR_R1) |
4693 | -C The initialization below is for the older stable CT v1.7, still |
4694 | -C used for now in the beta release. |
4695 | -C CALL CTSINIT(THRS,LOOPLIB) |
4696 | - |
4697 | - END |
4698 | - |
4699 | - SUBROUTINE ML5_0_LOOP_2_3(P1, P2, W1, W2, W3, M1, M2, RANK |
4700 | - $ , SQUAREDSOINDEX, LOOPNUM) |
4701 | - INTEGER NEXTERNAL |
4702 | - PARAMETER (NEXTERNAL=4) |
4703 | - INTEGER NLOOPLINE |
4704 | - PARAMETER (NLOOPLINE=2) |
4705 | - INTEGER NWAVEFUNCS |
4706 | - PARAMETER (NWAVEFUNCS=10) |
4707 | - INTEGER NLOOPGROUPS |
4708 | - PARAMETER (NLOOPGROUPS=26) |
4709 | - INTEGER NCOMB |
4710 | - PARAMETER (NCOMB=16) |
4711 | -C These are constants related to the split orders |
4712 | - INTEGER NSQUAREDSO |
4713 | - PARAMETER (NSQUAREDSO=1) |
4714 | -C |
4715 | -C ARGUMENTS |
4716 | -C |
4717 | - INTEGER W1, W2, W3 |
4718 | - COMPLEX*16 M1, M2 |
4719 | - INTEGER P1, P2 |
4720 | - INTEGER RANK, LSYMFACT |
4721 | - INTEGER LOOPNUM, SQUAREDSOINDEX |
4722 | -C |
4723 | -C LOCAL VARIABLES |
4724 | -C |
4725 | - REAL*8 PL(0:3,NLOOPLINE) |
4726 | - COMPLEX*16 M2L(NLOOPLINE) |
4727 | - INTEGER PAIRING(NLOOPLINE),WE(3) |
4728 | - INTEGER I, J, K, TEMP,I_LIB |
4729 | - LOGICAL COMPLEX_MASS,DOING_QP |
4730 | -C |
4731 | -C GLOBAL VARIABLES |
4732 | -C |
4733 | - INCLUDE 'MadLoopParams.inc' |
4734 | - INTEGER ID,SQSOINDEX,R |
4735 | - COMMON/ML5_0_LOOP/ID,SQSOINDEX,R |
4736 | - |
4737 | - LOGICAL CHECKPHASE, HELDOUBLECHECKED |
4738 | - COMMON/ML5_0_INIT/CHECKPHASE, HELDOUBLECHECKED |
4739 | - |
4740 | - INTEGER HELOFFSET |
4741 | - INTEGER GOODHEL(NCOMB) |
4742 | - LOGICAL GOODAMP(NSQUAREDSO,NLOOPGROUPS) |
4743 | - COMMON/ML5_0_FILTERS/GOODAMP,GOODHEL,HELOFFSET |
4744 | - |
4745 | - COMPLEX*16 LOOPRES(3,NSQUAREDSO,NLOOPGROUPS) |
4746 | - LOGICAL S(NSQUAREDSO,NLOOPGROUPS) |
4747 | - COMMON/ML5_0_LOOPRES/LOOPRES,S |
4748 | - |
4749 | - |
4750 | - COMPLEX*16 W(20,NWAVEFUNCS) |
4751 | - COMMON/ML5_0_W/W |
4752 | - REAL*8 LSCALE |
4753 | - INTEGER CTMODE |
4754 | - COMMON/ML5_0_CT/LSCALE,CTMODE |
4755 | - INTEGER LIBINDEX |
4756 | - COMMON/ML5_0_I_LIB/LIBINDEX |
4757 | - |
4758 | -C ---------- |
4759 | -C BEGIN CODE |
4760 | -C ---------- |
4761 | - |
4762 | - IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.GOODAMP(SQUAREDSOIND |
4763 | - $ EX,LOOPNUM)) THEN |
4764 | - WE(1)=W1 |
4765 | - WE(2)=W2 |
4766 | - WE(3)=W3 |
4767 | - M2L(1)=M2**2 |
4768 | - M2L(2)=M1**2 |
4769 | - PAIRING(1)=P1 |
4770 | - PAIRING(2)=P2 |
4771 | - R=RANK |
4772 | - ID=LOOPNUM |
4773 | - SQSOINDEX=SQUAREDSOINDEX |
4774 | - DO I=0,3 |
4775 | - TEMP=1 |
4776 | - DO J=1,NLOOPLINE |
4777 | - PL(I,J)=0.D0 |
4778 | - DO K=TEMP,(TEMP+PAIRING(J)-1) |
4779 | - PL(I,J)=PL(I,J)-DBLE(W(1+I,WE(K))) |
4780 | - ENDDO |
4781 | - TEMP=TEMP+PAIRING(J) |
4782 | - ENDDO |
4783 | - ENDDO |
4784 | -C Determine whether the integral is with complex masses or not |
4785 | -C since some reduction libraries, e.g.PJFry++ and IREGI, are |
4786 | -C still |
4787 | -C not able to deal with complex masses |
4788 | - COMPLEX_MASS=.FALSE. |
4789 | - DO I=1,NLOOPLINE |
4790 | - IF(DIMAG(M2L(I)).EQ.0D0)CYCLE |
4791 | - IF(ABS(DIMAG(M2L(I)))/MAX(ABS(M2L(I)),1D-2).GT.1D-15)THEN |
4792 | - COMPLEX_MASS=.TRUE. |
4793 | - EXIT |
4794 | - ENDIF |
4795 | - ENDDO |
4796 | -C Determine it uses qp or not |
4797 | - DOING_QP=.FALSE. |
4798 | - IF(CTMODE.GE.4)DOING_QP=.TRUE. |
4799 | -C Choose the correct loop library |
4800 | - CALL ML5_0_CHOOSE_LOOPLIB(LIBINDEX,NLOOPLINE,RANK,COMPLEX_MASS |
4801 | - $ ,DOING_QP,I_LIB) |
4802 | - IF(MLREDUCTIONLIB(I_LIB).EQ.1)THEN |
4803 | -C USE CUTTOOLS |
4804 | - CALL ML5_0_CTLOOP(NLOOPLINE,PL,M2L,RANK,LOOPRES(1,SQUAREDSOIN |
4805 | - $ DEX,LOOPNUM),S(SQUAREDSOINDEX,LOOPNUM)) |
4806 | - ELSE |
4807 | -C USE TIR |
4808 | - CALL ML5_0_TIRLOOP(SQUAREDSOINDEX,LOOPNUM,I_LIB,NLOOPLINE,PL |
4809 | - $ ,M2L,RANK,LOOPRES(1,SQUAREDSOINDEX,LOOPNUM),S(SQUAREDSOINDEX |
4810 | - $ ,LOOPNUM)) |
4811 | - ENDIF |
4812 | - ELSE |
4813 | - LOOPRES(1,SQUAREDSOINDEX,LOOPNUM)=(0.0D0,0.0D0) |
4814 | - LOOPRES(2,SQUAREDSOINDEX,LOOPNUM)=(0.0D0,0.0D0) |
4815 | - LOOPRES(3,SQUAREDSOINDEX,LOOPNUM)=(0.0D0,0.0D0) |
4816 | - S(SQUAREDSOINDEX,LOOPNUM)=.TRUE. |
4817 | - ENDIF |
4818 | - END |
4819 | - |
4820 | - SUBROUTINE ML5_0_LOOP_4(W1, W2, W3, W4, M1, M2, M3, M4, RANK |
4821 | - $ , SQUAREDSOINDEX, LOOPNUM) |
4822 | - INTEGER NEXTERNAL |
4823 | - PARAMETER (NEXTERNAL=4) |
4824 | - INTEGER NLOOPLINE |
4825 | - PARAMETER (NLOOPLINE=4) |
4826 | - INTEGER NWAVEFUNCS |
4827 | - PARAMETER (NWAVEFUNCS=10) |
4828 | - INTEGER NLOOPGROUPS |
4829 | - PARAMETER (NLOOPGROUPS=26) |
4830 | - INTEGER NCOMB |
4831 | - PARAMETER (NCOMB=16) |
4832 | -C These are constants related to the split orders |
4833 | - INTEGER NSQUAREDSO |
4834 | - PARAMETER (NSQUAREDSO=1) |
4835 | -C |
4836 | -C ARGUMENTS |
4837 | -C |
4838 | - INTEGER W1, W2, W3, W4 |
4839 | - COMPLEX*16 M1, M2, M3, M4 |
4840 | - |
4841 | - INTEGER RANK, LSYMFACT |
4842 | - INTEGER LOOPNUM, SQUAREDSOINDEX |
4843 | -C |
4844 | -C LOCAL VARIABLES |
4845 | -C |
4846 | - REAL*8 PL(0:3,NLOOPLINE) |
4847 | - COMPLEX*16 M2L(NLOOPLINE) |
4848 | - INTEGER PAIRING(NLOOPLINE),WE(4) |
4849 | - INTEGER I, J, K, TEMP,I_LIB |
4850 | - LOGICAL COMPLEX_MASS,DOING_QP |
4851 | -C |
4852 | -C GLOBAL VARIABLES |
4853 | -C |
4854 | - INCLUDE 'MadLoopParams.inc' |
4855 | - INTEGER ID,SQSOINDEX,R |
4856 | - COMMON/ML5_0_LOOP/ID,SQSOINDEX,R |
4857 | - |
4858 | - LOGICAL CHECKPHASE, HELDOUBLECHECKED |
4859 | - COMMON/ML5_0_INIT/CHECKPHASE, HELDOUBLECHECKED |
4860 | - |
4861 | - INTEGER HELOFFSET |
4862 | - INTEGER GOODHEL(NCOMB) |
4863 | - LOGICAL GOODAMP(NSQUAREDSO,NLOOPGROUPS) |
4864 | - COMMON/ML5_0_FILTERS/GOODAMP,GOODHEL,HELOFFSET |
4865 | - |
4866 | - COMPLEX*16 LOOPRES(3,NSQUAREDSO,NLOOPGROUPS) |
4867 | - LOGICAL S(NSQUAREDSO,NLOOPGROUPS) |
4868 | - COMMON/ML5_0_LOOPRES/LOOPRES,S |
4869 | - |
4870 | - |
4871 | - COMPLEX*16 W(20,NWAVEFUNCS) |
4872 | - COMMON/ML5_0_W/W |
4873 | - REAL*8 LSCALE |
4874 | - INTEGER CTMODE |
4875 | - COMMON/ML5_0_CT/LSCALE,CTMODE |
4876 | - INTEGER LIBINDEX |
4877 | - COMMON/ML5_0_I_LIB/LIBINDEX |
4878 | - |
4879 | -C ---------- |
4880 | -C BEGIN CODE |
4881 | -C ---------- |
4882 | - |
4883 | - IF (CHECKPHASE.OR.(.NOT.HELDOUBLECHECKED).OR.GOODAMP(SQUAREDSOIND |
4884 | - $ EX,LOOPNUM)) THEN |
4885 | - WE(1)=W1 |
4886 | - WE(2)=W2 |
4887 | - WE(3)=W3 |
4888 | - WE(4)=W4 |
4889 | - M2L(1)=M4**2 |
4890 | - M2L(2)=M1**2 |
4891 | - M2L(3)=M2**2 |
4892 | - M2L(4)=M3**2 |
4893 | - DO I=1,NLOOPLINE |
4894 | - PAIRING(I)=1 |
4895 | - ENDDO |
4896 | - |
4897 | - R=RANK |
4898 | - ID=LOOPNUM |
4899 | - SQSOINDEX=SQUAREDSOINDEX |
4900 | - DO I=0,3 |
4901 | - TEMP=1 |
4902 | - DO J=1,NLOOPLINE |
4903 | - PL(I,J)=0.D0 |
4904 | - DO K=TEMP,(TEMP+PAIRING(J)-1) |
4905 | - PL(I,J)=PL(I,J)-DBLE(W(1+I,WE(K))) |
4906 | - ENDDO |
4907 | - TEMP=TEMP+PAIRING(J) |
4908 | - ENDDO |
4909 | - ENDDO |
4910 | -C Determine whether the integral is with complex masses or not |
4911 | -C since some reduction libraries, e.g.PJFry++ and IREGI, are |
4912 | -C still |
4913 | -C not able to deal with complex masses |
4914 | - COMPLEX_MASS=.FALSE. |
4915 | - DO I=1,NLOOPLINE |
4916 | - IF(DIMAG(M2L(I)).EQ.0D0)CYCLE |
4917 | - IF(ABS(DIMAG(M2L(I)))/MAX(ABS(M2L(I)),1D-2).GT.1D-15)THEN |
4918 | - COMPLEX_MASS=.TRUE. |
4919 | - EXIT |
4920 | - ENDIF |
4921 | - ENDDO |
4922 | -C Determine it uses qp or not |
4923 | - DOING_QP=.FALSE. |
4924 | - IF(CTMODE.GE.4)DOING_QP=.TRUE. |
4925 | -C Choose the correct loop library |
4926 | - CALL ML5_0_CHOOSE_LOOPLIB(LIBINDEX,NLOOPLINE,RANK,COMPLEX_MASS |
4927 | - $ ,DOING_QP,I_LIB) |
4928 | - IF(MLREDUCTIONLIB(I_LIB).EQ.1)THEN |
4929 | -C USE CUTTOOLS |
4930 | - CALL ML5_0_CTLOOP(NLOOPLINE,PL,M2L,RANK,LOOPRES(1,SQUAREDSOIN |
4931 | - $ DEX,LOOPNUM),S(SQUAREDSOINDEX,LOOPNUM)) |
4932 | - ELSE |
4933 | -C USE TIR |
4934 | - CALL ML5_0_TIRLOOP(SQUAREDSOINDEX,LOOPNUM,I_LIB,NLOOPLINE,PL |
4935 | - $ ,M2L,RANK,LOOPRES(1,SQUAREDSOINDEX,LOOPNUM),S(SQUAREDSOINDEX |
4936 | - $ ,LOOPNUM)) |
4937 | - ENDIF |
4938 | - ELSE |
4939 | - LOOPRES(1,SQUAREDSOINDEX,LOOPNUM)=(0.0D0,0.0D0) |
4940 | - LOOPRES(2,SQUAREDSOINDEX,LOOPNUM)=(0.0D0,0.0D0) |
4941 | - LOOPRES(3,SQUAREDSOINDEX,LOOPNUM)=(0.0D0,0.0D0) |
4942 | - S(SQUAREDSOINDEX,LOOPNUM)=.TRUE. |
4943 | - ENDIF |
4944 | - END |
4945 | - |
4946 | - SUBROUTINE ML5_0_LOOP_3_4(P1, P2, P3, W1, W2, W3, W4, M1, M2, M3 |
4947 | - $ , RANK, SQUAREDSOINDEX, LOOPNUM) |
4948 | - INTEGER NEXTERNAL |
4949 | - PARAMETER (NEXTERNAL=4) |
4950 | - INTEGER NLOOPLINE |
4951 | - PARAMETER (NLOOPLINE=3) |
4952 | - INTEGER NWAVEFUNCS |
4953 | - PARAMETER (NWAVEFUNCS=10) |
4954 | - INTEGER NLOOPGROUPS |
4955 | - PARAMETER (NLOOPGROUPS=26) |
4956 | - INTEGER NCOMB |
4957 | - PARAMETER (NCOMB=16) |
4958 | -C These are constants related to the split orders |
4959 | - INTEGER NSQUAREDSO |
4960 | - PARAMETER (NSQUAREDSO=1) |
4961 | -C |
4962 | -C ARGUMENTS |
4963 | -C |
4964 | - INTEGER W1, W2, W3, W4 |
4965 | - COMPLEX*16 M1, M2, M3 |
4966 | - INTEGER P1, P2, P3 |
4967 | - INTEGER RANK, LSYMFACT |
4968 | - INTEGER LOOPNUM, SQUAREDSOINDEX |
4969 | -C |
4970 | -C LOCAL VARIABLES |
4971 | -C |
4972 | - REAL*8 PL(0:3,NLOOPLINE) |
4973 | - COMPLEX*16 M2L(NLOOPLINE) |
4974 | - INTEGER PAIRING(NLOOPLINE),WE(4) |
4975 | - INTEGER I, J, K, TEMP,I_LIB |
4976 | - LOGICAL COMPLEX_MASS,DOING_QP |
4977 | -C |
4978 | -C GLOBAL VARIABLES |
4979 | -C |
4980 | - INCLUDE 'MadLoopParams.inc' |
4981 | - INTEGER ID,SQSOINDEX,R |
4982 | - COMMON/ML5_0_LOOP/ID,SQSOINDEX,R |
4983 | - |
4984 | - LOGICAL CHECKPHASE, HELDOUBLECHECKED |
4985 | - COMMON/ML5_0_INIT/CHECKPHASE, HELDOUBLECHECKED |
4986 | - |
4987 | - INTEGER HELOFFSET |
4988 | - INTEGER GOODHEL(NCOMB) |
4989 | - LOGICAL GOODAMP(NSQUAREDSO,NLOOPGROUPS) |
4990 | - COMMON/ML5_0_FILTERS/GOODAMP,GOODHEL,HELOFFSET |
4991 | - |
4992 | - COMPLEX*16 LOOPRES(3,NSQUAREDSO,NLOOPGROUPS) |
4993 | - LOGICAL S(NSQUAREDSO,NLOOPGROUPS) |
4994 | - COMMON/ML5_0_LOOPRES/LOOPRES,S |
4995 | - |
4996 | - |
4997 | - COMPLEX*16 W(20,NWAVEFUNCS) |
4998 | - COMMON/ML5_0_W/W |
4999 | - REAL*8 LSCALE |
5000 | - INTEGER CTMODE |
So here are my comments on this really great functionality.
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
General comments:
-------
A1) What does this question really imply when launching the process?
5 Add weight to events based on coupling parameters reweight=OFF
I thought that you were multiplying/ dividing by the matrix element of the original and new hypothesis, and not just the ratio of particular couplings (which would be faster but much less general). So is this some hybrid implementation? I see the xml tag '<mgrwt>' added when turning this on, what is it used for?
A2) What is the status of the parrallelization? In the code it says that it's unstable, but is it still the case with f2py?
A3) What about adding the possibility of an 'unweight <filename>' command to the reweight_card.dat to allow the user to decide to create a new event file with only the unweighted events corresponding to the new hypothesis?
A4) How is the indicative error computed?
------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Comments on my trials of the reweighting:
-------
B1) Debug left at [common_ run_interface. py at line 3089]
B2) INFO: storring files of Previous run -> INFO: Storing files of previous run
INFO: Do remember that the reweighting -> INFO: Remember that the reweighting
B3) I tried to reweight h > g g from HEFT with loop-induced, using:
change model loop_sm valentin/ Documents/ Work/MG5/ unleashed_ reweighting/ TEST_LI_ gg_hg/Cards/ param_card2. dat
change process g g > h [virt=QCD]
launch
/Users/
and it crashed in a weird way telling me that the param_card I used was identical to the older one.
raise self.InvalidCmd, 'original card and new card are identical'.
Notice that you don't want to crash if they are identical but the model/process changed of course, so make sure that this case is correctly handled by the code.
Even then, I would put a warning and let the code go on with the same card because it is a good check to make sure that with an identical card one recovers the same result, and users might want to do this to get confidence in the tool.
Anyway, I realized that the problem in this case was that I should have used:
change model loop_sm valentin/ Documents/ Work/MG5/ LoopInduced_ newrefine/ PROC_loop_ sm_2/Cards/ param_card. dat
change process g g > h [sqrvirt=QCD]
launch
/Users/
which makes more sense. But even then it crashed because the file: files/loop_ optimized/ check_py. f"
"template_
was not added to the revision. So I'll continue the test of the loop functionality once this file has been added.
Anyway, I think that the fact that one should preferably use the syntax 'sqrvirt=QCD' and also that launch should come after the 'change ...' is a bit tricky to guess, so you should add an explicit example of loop-induced reweighting in the header of the card reweight_card.dat.
B4) I tried NLO reweighting for p p > e+ ve [QCD] by changing the irrelevant top Yukawa with
set ymt 200.0
and it first crashed because my f2py is called f2py-2.7. The crash was not helpful to the lambda user:
MadGraph5Error : A compilation Error occurs when trying to compile...