Merge lp:~maddevelopers/mg5amcnlo/2.6.5_polarization into lp:~mg5core1/mg5amcnlo/2.6.8

Proposed by Olivier Mattelaer
Status: Merged
Merge reported by: Olivier Mattelaer
Merged at revision: not available
Proposed branch: lp:~maddevelopers/mg5amcnlo/2.6.5_polarization
Merge into: lp:~mg5core1/mg5amcnlo/2.6.8
Diff against target: 4660 lines (+2209/-358)
71 files modified
HELAS/v2xxxx.f (+2/-2)
MadSpin/decay.py (+6/-7)
MadSpin/interface_madspin.py (+28/-11)
MadSpin/src/driver.f (+219/-11)
Template/LO/Cards/run_card.dat (+1/-0)
Template/LO/Source/dsample.f (+18/-2)
Template/LO/Source/genps.inc (+5/-0)
Template/LO/Source/run.inc (+3/-0)
Template/LO/SubProcesses/genps.f (+42/-0)
UpdateNotes.txt (+8/-1)
aloha/aloha_object.py (+682/-4)
aloha/aloha_parsers.py (+5/-2)
aloha/aloha_writers.py (+38/-5)
aloha/create_aloha.py (+43/-7)
madgraph/core/base_objects.py (+42/-18)
madgraph/core/diagram_generation.py (+18/-13)
madgraph/core/helas_objects.py (+122/-15)
madgraph/fks/fks_common.py (+1/-0)
madgraph/interface/madgraph_interface.py (+124/-1)
madgraph/interface/reweight_interface.py (+24/-1)
madgraph/iolibs/export_v4.py (+10/-1)
madgraph/iolibs/helas_call_writers.py (+12/-12)
madgraph/iolibs/template_files/auto_dsig_v4.inc (+11/-1)
madgraph/iolibs/template_files/born_fks.inc (+27/-7)
madgraph/iolibs/template_files/matrix_madevent_group_v4.inc (+7/-2)
madgraph/iolibs/template_files/matrix_madevent_v4.inc (+5/-2)
madgraph/iolibs/template_files/realmatrix_fks.inc (+11/-5)
madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc (+8/-1)
madgraph/loop/loop_base_objects.py (+3/-1)
madgraph/various/banner.py (+38/-3)
madgraph/various/lhe_parser.py (+8/-5)
madgraph/various/misc.py (+2/-0)
madgraph/various/process_checks.py (+1/-1)
models/import_ufo.py (+7/-4)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born.f (+29/-10)
tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f (+12/-5)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f (+11/-1)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f (+7/-2)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f (+16/-9)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f (+11/-1)
tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f (+5/-2)
tests/parallel_tests/compare_with_old_mg5_version.py (+53/-2)
tests/parallel_tests/test_aloha.py (+2/-1)
tests/unit_tests/core/test_base_objects.py (+19/-13)
tests/unit_tests/interface/test_cmd.py (+25/-0)
tests/unit_tests/iolibs/test_helas_call_writers.py (+2/-2)
To merge this branch: bzr merge lp:~maddevelopers/mg5amcnlo/2.6.5_polarization
Reviewer Review Type Date Requested Status
MadTeam Pending
Review via email: mp+377404@code.launchpad.net

Description of the change

1) support for polarization @LO
2) better identification of zero result at LO

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HELAS/v2xxxx.f'
2--- HELAS/v2xxxx.f 2010-10-30 03:26:37 +0000
3+++ HELAS/v2xxxx.f 2020-01-09 23:16:36 +0000
4@@ -30,11 +30,11 @@
5 vc(2) = p(1)/p(0)
6 vc(3) = p(2)/p(0)
7 vc(4) = p(3)/p(0)
8- else
9+ else
10 vc(1) = p(0)/vmass
11 vc(2) = p(1)/vmass
12 vc(3) = p(2)/vmass
13 vc(4) = p(3)/vmass
14- endif
15+ endif
16 return
17 end
18
19=== modified file 'MadSpin/decay.py'
20--- MadSpin/decay.py 2019-11-16 11:59:49 +0000
21+++ MadSpin/decay.py 2020-01-09 23:16:36 +0000
22@@ -2245,7 +2245,7 @@
23 nb_mc_masses=len(indices_for_mc_masses)
24
25 p, p_str=self.curr_event.give_momenta(event_map)
26- stdin_text=' %s %s %s %s \n' % ('2', self.options['BW_cut'], self.Ecollider, decay_me['max_weight'])
27+ stdin_text=' %s %s %s %s %s \n' % ('2', self.options['BW_cut'], self.Ecollider, decay_me['max_weight'], self.options['frame_id'])
28 stdin_text+=p_str
29 # here I also need to specify the Monte Carlo Masses
30 stdin_text+=" %s \n" % nb_mc_masses
31@@ -2373,7 +2373,7 @@
32 #no decays for this production mode, run in passthrough mode, only adding the helicities to the events
33 nb_mc_masses=0
34 p, p_str=self.curr_event.give_momenta(event_map)
35- stdin_text=' %s %s %s %s \n' % ('2', self.options['BW_cut'], self.Ecollider, 1.0)
36+ stdin_text=' %s %s %s %s \n' % ('2', self.options['BW_cut'], self.Ecollider, 1.0, self.options['frame_id'])
37 stdin_text+=p_str
38 # here I also need to specify the Monte Carlo Masses
39 stdin_text+=" %s \n" % nb_mc_masses
40@@ -3278,8 +3278,7 @@
41 """return the max. weight associated with me decay['path']"""
42
43 p, p_str=self.curr_event.give_momenta(event_map)
44-
45- std_in=" %s %s %s %s \n" % ("1",BWcut, self.Ecollider, nbpoints)
46+ std_in=" %s %s %s %s %s \n" % ("1",BWcut, self.Ecollider, nbpoints, self.options['frame_id'])
47 std_in+=p_str
48 max_weight = self.loadfortran('maxweight',
49 path, std_in)
50@@ -3348,7 +3347,7 @@
51 if nb < cut:
52 if key[0]=='full':
53 path=key[1]
54- end_signal="5 0 0 0 \n" # before closing, write down the seed
55+ end_signal="5 0 0 0 0\n" # before closing, write down the seed
56 external.stdin.write(end_signal)
57 ranmar_state=external.stdout.readline()
58 ranmar_file=pjoin(path,'ranmar_state.dat')
59@@ -3963,7 +3962,7 @@
60 external.terminate()
61 del external
62 elif mode=='full':
63- stdin_text="5 0 0 0 \n" # before closing, write down the seed
64+ stdin_text="5 0 0 0 0\n" # before closing, write down the seed
65 external = self.calculator[('full',path)]
66 try:
67 external.stdin.write(stdin_text)
68@@ -3990,7 +3989,7 @@
69 except Exception:
70 pass
71 else:
72- stdin_text="5 0 0 0"
73+ stdin_text="5 0 0 0 0"
74 external.stdin.write(stdin_text)
75 external.stdin.close()
76 external.stdout.close()
77
78=== modified file 'MadSpin/interface_madspin.py'
79--- MadSpin/interface_madspin.py 2019-10-16 10:56:33 +0000
80+++ MadSpin/interface_madspin.py 2020-01-09 23:16:36 +0000
81@@ -75,7 +75,7 @@
82 self.add_param('cross_section', {'__type__':0.}, comment="forcing normalization of cross-section after MS (for none/onshell)" )
83 self.add_param('new_wgt', 'cross-section' ,allowed=['cross-section', 'BR'], comment="if not consistent number of particles, choose what to do for the weight. (BR: means local according to number of part, cross use the force cross-section")
84 self.add_param('input_format', 'auto', allowed=['auto','lhe', 'hepmc', 'lhe_no_banner'])
85-
86+ self.add_param('frame_id', 6)
87
88 ############################################################################
89 ## Special post-processing of the options ##
90@@ -211,7 +211,7 @@
91 # Read the banner of the inputfile
92 self.events_file = open(os.path.realpath(inputfile))
93 self.banner = banner.Banner(self.events_file)
94-
95+
96
97 # Check the validity of the banner:
98 if 'slha' not in self.banner:
99@@ -226,14 +226,21 @@
100 raise self.InvalidCmd('This event file was already decayed by MS. This is not possible to add to it a second decay')
101
102 if 'mgruncard' in self.banner:
103+ run_card = self.banner.charge_card('run_card')
104 if not self.options['Nevents_for_max_weigth']:
105- nevents = int(self.banner.get_detail('run_card', 'nevents'))
106+ nevents = run_card['nevents']
107 N_weight = max([75, int(3*nevents**(1/3))])
108 self.options['Nevents_for_max_weigth'] = N_weight
109 N_sigma = max(4.5, math.log(nevents,7.7))
110 self.options['nb_sigma'] = N_sigma
111 if self.options['BW_cut'] == -1:
112 self.options['BW_cut'] = float(self.banner.get_detail('run_card', 'bwcutoff'))
113+
114+ if isinstance(run_card, banner.RunCardLO):
115+ run_card.update_system_parameter_for_include()
116+ self.options['frame_id'] = run_card['frame_id']
117+ else:
118+ self.options['frame_id'] = 6
119 else:
120 if not self.options['Nevents_for_max_weigth']:
121 self.options['Nevents_for_max_weigth'] = 75
122@@ -313,7 +320,6 @@
123 if model_name in line:
124 final_model = True
125
126-
127
128 def import_model(self, args):
129 """syntax: import model NAME CARD_PATH
130@@ -400,6 +406,12 @@
131 #if self.model and not self.model['case_sensitive']:
132 # decaybranch = decaybranch.lower()
133
134+ if self.options['spinmode'] != 'full' and '{' in decaybranch:
135+ if self.options['spinmode'] == 'none':
136+ logger.warning("polarization option used with spinmode=none. The polarization definition will be done according to the rest-frame of the decaying particles (which is likely not what you expect).")
137+ else:
138+ logger.warning("polarization option used with spinmode=onshell. This combination is not validated and is by construction using sub-optimal method which can likely lead to bias in some situation. Use at your own risk.")
139+
140 decay_process, init_part = self.decay.reorder_branch(decaybranch)
141 if not self.list_branches.has_key(init_part):
142 self.list_branches[init_part] = []
143@@ -585,14 +597,16 @@
144 self.check_launch(args)
145 for part in self.list_branches.keys():
146 if part in self.mg5cmd._multiparticles:
147+
148 if any(pid in self.final_state for pid in self.mg5cmd._multiparticles[part]):
149 break
150- pid = self.mg5cmd._curr_model.get('name2pdg')[part]
151- if pid in self.final_state:
152- break
153-# else:
154-# logger.info("Nothing to decay ...")
155-# return
156+ else:
157+ pid = self.mg5cmd._curr_model.get('name2pdg')[part]
158+ if pid in self.final_state:
159+ break
160+ else:
161+ logger.info("Nothing to decay ...")
162+ return
163
164
165 model_line = self.banner.get('proc_card', 'full_model_line')
166@@ -1443,8 +1457,10 @@
167 for curr_event,production in enumerate(orig_lhe):
168 if self.options['fixed_order']:
169 production, counterevt= production[0], production[1:]
170- if curr_event and curr_event % 1000 == 0 and float(str(curr_event)[1:]) ==0:
171+ if curr_event and self.efficiency:# and curr_event % 10 == 0 and float(str(curr_event)[1:]) ==0:
172 logger.info("decaying event number %s. Efficiency: %s [%s s]" % (curr_event, 1/self.efficiency, time.time()-start))
173+ else:
174+ logger.info("next event [%s]", time.time()-start)
175 while 1:
176 nb_try +=1
177 decays = self.get_decay_from_file(production, evt_decayfile, nb_event-curr_event)
178@@ -1579,6 +1595,7 @@
179 if len(all_maxwgt) < i:
180 break
181 ave_weight, std_weight = decay_tools.get_mean_sd(all_maxwgt[:i])
182+ #misc.sprint(ave_weight, std_weight)
183 base_max_weight = max(base_max_weight, 1.05 * (ave_weight+self.options['nb_sigma']*std_weight))
184
185 if all_maxwgt[1] > base_max_weight:
186
187=== modified file 'MadSpin/src/driver.f'
188--- MadSpin/src/driver.f 2018-09-19 09:41:33 +0000
189+++ MadSpin/src/driver.f 2020-01-09 23:16:36 +0000
190@@ -18,7 +18,7 @@
191 INTEGER I,J,K
192 INTEGER HELSET(NEXTERNAL)
193 REAL*8 P(0:3,NEXTERNAL_PROD)
194- REAL*8 PFULL(0:3,NEXTERNAL), Ptrial(0:3,NEXTERNAL)
195+ REAL*8 PFULL(0:3,NEXTERNAL), Ptrial(0:3,NEXTERNAL), P2(0:3,NEXTERNAL)
196 double precision x(36), Ecollider
197 CHARACTER*120 BUFF(NEXTERNAL_PROD)
198 integer iforest(2,-nexternal:-1,N_MAX_CG)
199@@ -39,6 +39,7 @@
200 double precision mean, variance, maxweight,weight,std
201 double precision temp
202 double precision Pprod(0:3,nexternal_prod)
203+
204 integer nb_mc_masses, indices_mc_masses(nexternal)
205 double precision values_mc_masses(nexternal)
206
207@@ -54,6 +55,9 @@
208 double precision BWcut, maxBW
209 common /to_BWcut/BWcut, maxBW
210
211+ integer frame_id
212+ common /to_me_frame/frame_id
213+
214 c Conflicting BW stuff
215 integer cBW_level_max,cBW(-nexternal:-1),cBW_level(-nexternal:-1)
216 double precision cBW_mass(-nexternal:-1,-1:1),
217@@ -94,7 +98,8 @@
218 read(56,*) P_seed
219 close(56)
220 iseed = iseed + P_seed
221-
222+c open(unit=999,file="/data/DOC/sujays/divisors")
223+c open(unit=999,file="/home/sujay/Downloads/momentaboost")
224 cccccccccccccccccccccccccccccccccccccccccccccccccccc
225 c I. read momenta for the production events
226 c
227@@ -112,7 +117,7 @@
228
229 1 continue
230 maxBW=0d0
231- read(*,*) mode, BWcut, Ecollider, temp
232+ read(*,*) mode, BWcut, Ecollider, temp, frame_id
233
234
235 if (mode.eq.1) then ! calculate the maximum weight
236@@ -258,10 +263,32 @@
237 !do j=1,nexternal
238 ! write (*,*) (pfull(k,j), k=0,3)
239 !enddo
240- call SMATRIX(pfull,M_full)
241- call SMATRIX_PROD(pprod,M_prod)
242-c write(*,*) 'M_full ', M_full
243-c write(*,*) 'jac',jac
244+
245+c=======================Modified part=================================
246+
247+
248+ call boost_to_frame(pfull, frame_id, P2)
249+ call SMATRIX(P2,M_full)
250+
251+
252+c call SMATRIX_PROD(pprod,M_prod)
253+c write(999,*) (M_prod)
254+c write(999,*) "---------after-boost------"
255+ call boost_to_frame_prod(pprod, frame_id,nexternal_prod, P2)
256+ call SMATRIX_PROD(P2,M_prod)
257+
258+
259+
260+c do j=1,nexternal
261+c write (999,*) (P2(k,j), k=0,3)
262+c enddo
263+c write(999,*) (M_prod)
264+c do j=1,nexternal_prod
265+c write (999,*) (pprod(k,j), k=0,3)
266+c enddo
267+c close(999)
268+
269+c==========================================================================
270
271 weight=M_full*jac/M_prod
272 if (weight.gt.maxweight) then
273@@ -335,7 +362,6 @@
274 do i = 1, 3*(nexternal-nexternal_prod)+1
275 call ntuple(x(i),0d0,1d0,i,1)
276 enddo
277-
278 call generate_momenta_conf(jac,x,itree,qmass,qwidth,pfull,pprod,map_external2res)
279 if (jac.lt.0d0) then
280 counter2=counter2+1
281@@ -366,9 +392,32 @@
282
283 cycle
284 endif
285- call SMATRIX(pfull,M_full)
286- call SMATRIX_PROD(pprod,M_prod)
287-
288+
289+c=======================Modified part=================================
290+
291+
292+ call boost_to_frame(pfull, frame_id, P2)
293+ call SMATRIX(P2,M_full)
294+
295+
296+c call SMATRIX_PROD(pprod,M_prod)
297+c write(999,*) (M_prod)
298+c write(999,*) "---------after-boost------"
299+ call boost_to_frame_prod(pprod, frame_id,nexternal_prod, P2)
300+ call SMATRIX_PROD(P2,M_prod)
301+
302+
303+
304+c do j=1,nexternal
305+c write (999,*) (P2(k,j), k=0,3)
306+c enddo
307+c write(999,*) (M_prod)
308+c do j=1,nexternal_prod
309+c write (999,*) (pprod(k,j), k=0,3)
310+c enddo
311+c close(999)
312+
313+c==========================================================================
314 weight=M_full*jac/M_prod
315
316 if (weight.gt.x(3*(nexternal-nexternal_prod)+1)*maxweight) notpass=.false.
317@@ -1892,3 +1941,162 @@
318 END
319
320
321+
322+
323+c======================================================================
324+C Subroutine to return momenta in a dedicated frame
325+C frame_id is the tag of the particle to put at rest
326+C frame_id follow the convention of cluster.f (sum 2**(N-1))
327+C -----------------------------------------
328+
329+ subroutine boost_to_frame(P1, frame_id, P2)
330+
331+ implicit none
332+
333+ include 'nexternal.inc'
334+
335+ DOUBLE PRECISION P1(0:3,NEXTERNAL)
336+ DOUBLE PRECISION P2(0:3,NEXTERNAL)
337+ DOUBLE PRECISION PBOOST(0:3)
338+ integer frame_id
339+
340+ integer ids(nexternal)
341+ integer i,j
342+ Pboost(0)= 0d0
343+ Pboost(1)= 0d0
344+ Pboost(2)= 0d0
345+ Pboost(3)= 0d0
346+
347+c uncompress
348+ call mapid(frame_id, ids)
349+c find the boost momenta --sum of particles--
350+ do i=1,nexternal
351+ if (ids(i).eq.1)then
352+c write (999,*) (Pboost(j), j=0,3)
353+ do j=0,3
354+ Pboost(j) = Pboost(j) + P1(j,i)
355+ enddo
356+ endif
357+ enddo
358+ do j=1,3
359+ Pboost(j) = -1 * Pboost(j)
360+ enddo
361+
362+c write (999,*) (Pboost(j), j=0,3)
363+ do i=1, nexternal
364+ call boostx(p1(0,i), pboost, p2(0,i))
365+ enddo
366+ return
367+ end
368+
369+
370+
371+
372+c========================================================================
373+
374+
375+ subroutine mapid(id,ids)
376+c**************************************************************************
377+c input:
378+c id compressed particle id
379+c ids array of particle ids
380+c**************************************************************************
381+ implicit none
382+ include 'nexternal.inc'
383+ integer i, icd, id, ids(nexternal)
384+
385+ icd=id
386+ do i=1,nexternal
387+ ids(i)=0
388+ if (btest(id,i)) then
389+ ids(i)=1
390+ endif
391+c write(*,*) 'cluster.f: uncompressed code ',i,' is ',ids(i)
392+ enddo
393+
394+ return
395+ end
396+
397+
398+
399+
400+C -----------------------------------------
401+
402+ subroutine boost_to_frame_prod(P1, frame_id, nexternal_prod, P2)
403+
404+ implicit none
405+
406+ include 'nexternal.inc'
407+
408+ DOUBLE PRECISION P1(0:3,*)
409+ DOUBLE PRECISION P2(0:3,*)
410+ DOUBLE PRECISION PBOOST(0:3)
411+ integer frame_id, nexternal_prod
412+
413+ integer ids(nexternal_prod)
414+ integer i,j
415+ Pboost(0)= 0d0
416+ Pboost(1)= 0d0
417+ Pboost(2)= 0d0
418+ Pboost(3)= 0d0
419+
420+c uncompress
421+ call mapid_prod(frame_id, ids,nexternal_prod)
422+c find the boost momenta --sum of particles--
423+ do i=1,nexternal_prod
424+ if (ids(i).eq.1)then
425+c write (999,*) (Pboost(j), j=0,3)
426+ do j=0,3
427+ Pboost(j) = Pboost(j) + P1(j,i)
428+ enddo
429+ endif
430+ enddo
431+ do j=1,3
432+ Pboost(j) = -1 * Pboost(j)
433+ enddo
434+
435+c write (999,*) (Pboost(j), j=0,3)
436+ do i=1, nexternal_prod
437+ call boostx(p1(0,i), pboost, p2(0,i))
438+ enddo
439+ return
440+ end
441+
442+
443+
444+
445+
446+
447+
448+
449+ subroutine mapid_prod(id,ids,nexternal_prod)
450+c**************************************************************************
451+c input:
452+c id compressed particle id
453+c ids array of particle ids
454+c**************************************************************************
455+ implicit none
456+ include 'nexternal.inc'
457+ integer i, icd, id, nexternal_prod, ids(nexternal_prod)
458+
459+ icd=id
460+ do i=1,nexternal_prod
461+ ids(i)=0
462+ if (btest(id,i)) then
463+ ids(i)=1
464+ endif
465+c write(*,*) 'cluster.f: uncompressed code ',i,' is ',ids(i)
466+ enddo
467+
468+ return
469+ end
470+
471+
472+
473+
474+
475+
476+
477+
478+
479+
480
481=== modified file 'Template/LO/Cards/run_card.dat'
482--- Template/LO/Cards/run_card.dat 2019-05-01 19:53:40 +0000
483+++ Template/LO/Cards/run_card.dat 2020-01-09 23:16:36 +0000
484@@ -39,6 +39,7 @@
485 %(ebeam1)s = ebeam1 ! beam 1 total energy in GeV
486 %(ebeam2)s = ebeam2 ! beam 2 total energy in GeV
487 $beam_pol
488+$frame
489 #*********************************************************************
490 # PDF CHOICE: this automatically fixes also alpha_s and its evol. *
491 #*********************************************************************
492
493=== modified file 'Template/LO/Source/dsample.f'
494--- Template/LO/Source/dsample.f 2019-01-25 10:01:29 +0000
495+++ Template/LO/Source/dsample.f 2020-01-09 23:16:36 +0000
496@@ -134,6 +134,7 @@
497 ievent=ievent+1
498 call x_to_f_arg(ndim,ipole,mincfig,maxcfig,ninvar,wgt,x,p)
499 if (pass_point(p)) then
500+ nb_pass_cuts = nb_pass_cuts + 1
501 fx = dsig(p,wgt,0) !Evaluate function
502 wgt = wgt*fx
503 if (wgt .ne. 0d0) call graph_point(p,wgt) !Update graphs
504@@ -316,6 +317,7 @@
505 fx =0d0
506 wgt=0d0
507 endif
508+
509 if (nzoom .le. 0) then
510 call sample_put_point(wgt,x(1),iter,ipole,itmin) !Store result
511 else
512@@ -705,6 +707,7 @@
513 tmean = 0d0
514 trmean = 0d0
515 tsigma = 0d0
516+ nb_pass_cuts = 0
517 kn = 0
518 cur_it = 1
519 do j=1,ng
520@@ -1756,6 +1759,11 @@
521 if (kn .ge. max_events .and. non_zero .le. 5) then
522 call none_pass(max_events)
523 endif
524+ if (iteration.eq.1) then
525+ if (nb_pass_cuts.eq.1000 .and. non_zero.eq.0) then
526+ call none_pass(1000)
527+ endif
528+ endif
529 if (non_zero .ge. events .or. (kn .gt. 200*events .and.
530 $ non_zero .gt. 5)) then
531
532@@ -2267,8 +2275,15 @@
533 c----
534 c Begin Code
535 c----
536- write(*,*) 'No points passed cuts!'
537- write(*,*) 'Loosen cuts or increase max_events',max_events
538+ if (1000.eq.max_events) then
539+ write(*,*) nb_pass_cuts,
540+ & ' points passed the cut but all returned zero'
541+ write(*,*) 'therefore considering this contribution as zero'
542+ else
543+ write(*,*) 'No points passed cuts!'
544+ write(*,*) 'Loosen cuts or increase max_events',max_events
545+ endif
546+
547 c open(unit=22,file=result_file,status='old',access='append',
548 c & err=23)
549 c write(22,222) 'Iteration',0,'Mean: ',0d0,
550@@ -2540,6 +2555,7 @@
551
552 write(*,*) "RESET CUMULATIVE VARIABLE"
553 non_zero = 0
554+ nb_pass_cuts = 0
555 do j=1,maxinvar
556 do i=1,ng -1
557 inon_zero = 0
558
559=== modified file 'Template/LO/Source/genps.inc'
560--- Template/LO/Source/genps.inc 2016-04-02 14:23:21 +0000
561+++ Template/LO/Source/genps.inc 2020-01-09 23:16:36 +0000
562@@ -38,3 +38,8 @@
563 double precision hel_jacobian
564 INTEGER HEL_PICKED
565 COMMON/HEL_PICKED/HEL_PICKED,hel_jacobian
566+c**********************************************************************************
567+c parameters to control is zero-cross section is due to PS or matrix-element
568+c**********************************************************************************
569+ integer nb_pass_cuts
570+ common/cut_efficiency/nb_pass_cuts
571\ No newline at end of file
572
573=== modified file 'Template/LO/Source/run.inc'
574--- Template/LO/Source/run.inc 2018-10-07 20:06:38 +0000
575+++ Template/LO/Source/run.inc 2020-01-09 23:16:36 +0000
576@@ -16,6 +16,9 @@
577 integer lpp(2)
578 double precision ebeam(2), xbk(2),q2fact(2)
579 common/to_collider/ ebeam , xbk ,q2fact, lpp
580+
581+ integer frame_id
582+ common/to_frame_me/frame_id
583 c
584 c Number of events
585 c
586
587=== modified file 'Template/LO/SubProcesses/genps.f'
588--- Template/LO/SubProcesses/genps.f 2019-06-17 14:27:09 +0000
589+++ Template/LO/SubProcesses/genps.f 2020-01-09 23:16:36 +0000
590@@ -1264,5 +1264,47 @@
591 END
592
593
594+C -----------------------------------------
595+C Subroutine to return momenta in a dedicated frame
596+C frame_id is the tag of the particle to put at rest
597+C frame_id follow the convention of cluster.f (sum 2**(N-1))
598+C -----------------------------------------
599+
600+ subroutine boost_to_frame(P1, frame_id, P2)
601+
602+ implicit none
603+
604+ include 'nexternal.inc'
605+
606+ DOUBLE PRECISION P1(0:3,NEXTERNAL)
607+ DOUBLE PRECISION P2(0:3,NEXTERNAL)
608+ DOUBLE PRECISION PBOOST(0:3)
609+ integer frame_id
610+
611+ integer ids(nexternal)
612+ integer i,j
613+
614+c uncompress
615+ call mapid(frame_id, ids)
616+ pboost(:) = 0d0
617+ p2(:,:) = 0d0
618+c find the boost momenta --sum of particles--
619+ do i=1,nexternal
620+ if (ids(i).eq.1)then
621+ do j=0,3
622+ Pboost(j) = Pboost(j) + P1(j,i)
623+ enddo
624+ endif
625+ enddo
626+ do j=1,3
627+ Pboost(j) = -1 * Pboost(j)
628+ enddo
629+ do i=1, nexternal
630+ call boostx(p1(0,i), pboost, p2(0,i))
631+ enddo
632+ return
633+ end
634+
635+
636
637
638
639=== modified file 'UpdateNotes.txt'
640--- UpdateNotes.txt 2020-01-09 09:35:56 +0000
641+++ UpdateNotes.txt 2020-01-09 23:16:36 +0000
642@@ -1,8 +1,16 @@
643 Update notes for MadGraph5_aMC@NLO (in reverse time order)
644
645+
646+
647 2.7.0()
648 OM: Allow for a new syntax:
649 generate p p > 3j replaces p p > j j j
650+ OM: Allow syntax for (fully) polarized particles at LO:
651+ ex: p p > w+{0} j, e+{L} e-{R} > mu+ mu- Z{T}
652+ p p > w+{T} w-{0} j j, w+ > e+ ve, w- > j j
653+ OM: distinguish in the code if zero contribution are related to no point passing cuts or if
654+ they are related to vanishing matrix-element. In the later case, allow for a lower threshold.
655+ (This allow to fasten the computation of such zero contribution)
656
657
658 2.6.7(16/10/19)
659@@ -30,7 +38,6 @@
660 OM: Energy cut (at LO) are now hidden by default for LHC type of run but visible for lepton collider ones.
661 OM: Same for beam polarization
662
663-
664 2.6.5 (03/02/19)
665 OM: Fix some speed issue with the generated gridpack --speed issue introduced in 2.6.1--
666 OM: Fix a bug in the computation of systematics when running with Python 2.6.
667
668=== modified file 'aloha/aloha_object.py'
669--- aloha/aloha_object.py 2018-04-26 18:04:25 +0000
670+++ aloha/aloha_object.py 2020-01-09 23:16:36 +0000
671@@ -69,8 +69,140 @@
672 def get_unique_name(self, lorentz1, particle):
673 return '_P^%s_%s' % (particle, lorentz1)
674
675-
676-
677+#===============================================================================
678+# P (Momenta)
679+#===============================================================================
680+class L_PVec(aloha_lib.LorentzObject):
681+ """ Helas Object for an Impulsion """
682+
683+ contract_first = 1
684+
685+ def __init__(self, name, lorentz1, particle):
686+ self.particle = particle
687+ aloha_lib.LorentzObject.__init__(self, name,[lorentz1], [],['PVec%s'%particle])
688+ aloha_lib.KERNEL.add_tag((name,))
689+
690+ def create_representation(self):
691+ #self.sub0 = aloha_lib.DVariable('P%s_0' % self.particle)
692+ self.sub1 = aloha_lib.DVariable('P%s_1' % self.particle)
693+ self.sub2 = aloha_lib.DVariable('P%s_2' % self.particle)
694+ self.sub3 = aloha_lib.DVariable('P%s_3' % self.particle)
695+
696+ self.representation= aloha_lib.LorentzObjectRepresentation(
697+ {(0,): 0, (1,): self.sub1, \
698+ (2,): self.sub2, (3,): self.sub3},
699+ self.lorentz_ind, [])
700+
701+
702+class PVec(aloha_lib.FactoryLorentz):
703+ """ Helas Object for an Impulsion """
704+
705+ object_class = L_PVec
706+
707+ #def __init__(self, lorentz1, particle):
708+ @classmethod
709+ def get_unique_name(self, lorentz1, particle):
710+ return '_Pvec^%s_%s' % (particle, lorentz1)
711+
712+
713+
714+#===============================================================================
715+# Three Norm
716+#===============================================================================
717+class L_Tnorm(aloha_lib.LorentzObject):
718+ """ Helas Object for DSQRT(Px^2+Py^2+pz^2) """
719+
720+ def __init__(self, name, particle):
721+ self.particle = particle
722+ aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['|p%s|' % particle])
723+
724+ def create_representation(self):
725+ mass = aloha_lib.DVariable('Tnorm%s' % self.particle)
726+
727+ self.representation = aloha_lib.LorentzObjectRepresentation(
728+ mass, self.lorentz_ind, self.spin_ind)
729+
730+class Tnorm(aloha_lib.FactoryLorentz):
731+
732+ object_class = L_Tnorm
733+
734+ @classmethod
735+ def get_unique_name(self, particle):
736+ return '_tnorm_%s' % particle
737+
738+#===============================================================================
739+# |p| + pz
740+#===============================================================================
741+class L_TnormZ(aloha_lib.LorentzObject):
742+ """ Helas Object for DSQRT(Px^2+Py^2+pz^2) + PZ """
743+
744+ def __init__(self, name, particle):
745+ self.particle = particle
746+ aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['|p%s|_z' % particle])
747+
748+ def create_representation(self):
749+ mass = aloha_lib.DVariable('TnormZ%s' % self.particle)
750+
751+ self.representation = aloha_lib.LorentzObjectRepresentation(
752+ mass, self.lorentz_ind, self.spin_ind)
753+
754+class TnormZ(aloha_lib.FactoryLorentz):
755+
756+ object_class = L_TnormZ
757+
758+ @classmethod
759+ def get_unique_name(self, particle):
760+ return '_tnormz_%s' % particle
761+
762+#===============================================================================
763+# DSQRT(E+- |p|)
764+#===============================================================================
765+class L_FermionWP(aloha_lib.LorentzObject):
766+ """ Helas Object for DSQRT(Px^2+Py^2+pz^2) """
767+
768+ def __init__(self, name, particle):
769+ self.particle = particle
770+ aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['FWP_%s' % particle])
771+
772+ def create_representation(self):
773+ mass = aloha_lib.DVariable('FWP%s' % self.particle)
774+
775+ self.representation = aloha_lib.LorentzObjectRepresentation(
776+ mass, self.lorentz_ind, self.spin_ind)
777+
778+class FermionWP(aloha_lib.FactoryLorentz):
779+
780+ object_class = L_FermionWP
781+
782+ @classmethod
783+ def get_unique_name(self, particle):
784+ return '_FermionWP_%s' % particle
785+
786+#===============================================================================
787+# DSQRT(E+- |p|)
788+#===============================================================================
789+class L_FermionWM(aloha_lib.LorentzObject):
790+ """ Helas Object for DSQRT(Px^2+Py^2+pz^2) """
791+
792+ def __init__(self, name, particle):
793+ self.particle = particle
794+ aloha_lib.LorentzObject.__init__(self, name, [], [], tags=['FWM_%s' % particle])
795+
796+ def create_representation(self):
797+ mass = aloha_lib.DVariable('FWM%s' % self.particle)
798+
799+ self.representation = aloha_lib.LorentzObjectRepresentation(
800+ mass, self.lorentz_ind, self.spin_ind)
801+
802+class FermionWM(aloha_lib.FactoryLorentz):
803+
804+ object_class = L_FermionWM
805+
806+ @classmethod
807+ def get_unique_name(self, particle):
808+ return '_FermionWM_%s' % particle
809+
810+
811 #===============================================================================
812 # Pslash
813 #===============================================================================
814@@ -219,6 +351,45 @@
815 def get_unique_name(self, particle):
816 return '_OM2_%s' % particle
817
818+
819+#===============================================================================
820+# P (Momenta)
821+#===============================================================================
822+class L_PT(aloha_lib.LorentzObject):
823+ """ Helas Object for an Impulsion """
824+
825+ contract_first = 1
826+
827+ def __init__(self, name, lorentz1, particle):
828+ self.particle = particle
829+ aloha_lib.LorentzObject.__init__(self, name,[lorentz1], [],['PT%s'%particle])
830+ aloha_lib.KERNEL.add_tag((name,))
831+
832+ def create_representation(self):
833+ #self.sub0 = aloha_lib.DVariable('P%s_0' % self.particle)
834+ self.sub1 = aloha_lib.DVariable('P%s_1' % self.particle)
835+ self.sub2 = aloha_lib.DVariable('P%s_2' % self.particle)
836+ #self.sub3 = aloha_lib.DVariable('P%s_3' % self.particle)
837+
838+ self.representation= aloha_lib.LorentzObjectRepresentation(
839+ {(0,): 0, (1,): self.sub1, \
840+ (2,): self.sub2, (3,): 0},
841+ self.lorentz_ind, [])
842+
843+
844+class PT(aloha_lib.FactoryLorentz):
845+ """ Helas Object for an Impulsion """
846+
847+ object_class = L_PT
848+
849+ #def __init__(self, lorentz1, particle):
850+ @classmethod
851+ def get_unique_name(self, lorentz1, particle):
852+ return '_PT^%s_%s' % (particle, lorentz1)
853+
854+
855+
856+
857 #===============================================================================
858 # Width
859 #===============================================================================
860@@ -928,7 +1099,513 @@
861 def get_unique_name(self, spin1, spin2):
862
863 return 'PROJP_%s_%s' % (spin1, spin2)
864-
865+
866+#===============================================================================
867+# EPSL (longitudinal part of the epsilon normmaized to avoid denominator)
868+#===============================================================================
869+class L_EPSL(aloha_lib.LorentzObject):
870+ """ eps^mu_L (polarization vector)
871+ (kx**2+ky**2+kz**2, E*kz, E*ky, E*kz)
872+ the normalization 1/m *|\vec{k} is NOT include
873+
874+ """
875+
876+ def __init__(self, name, lor1, particle):
877+
878+ self.particle = particle
879+ aloha_lib.LorentzObject.__init__(self,name, [lor1], [])
880+
881+ def create_representation(self):
882+ """create representation"""
883+ E = aloha_lib.DVariable('P%s_0' % self.particle)
884+ m = aloha_lib.DVariable('M%s' % self.particle)
885+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
886+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
887+ p3 = aloha_lib.DVariable('P%s_3' % self.particle)
888+
889+
890+ norm = (p1**2+p2**2+p3**2)
891+ eps = {
892+ (0,): norm,
893+ (1,): p1*E,
894+ (2,): p2*E ,
895+ (3,): p3*E ,
896+ }
897+# eps = {
898+# (0,): norm-E*E,
899+# (1,): 0,
900+# (2,): 0 ,
901+# (3,): 0 ,
902+# }
903+
904+ self.representation = aloha_lib.LorentzObjectRepresentation(eps,
905+ self.lorentz_ind,self.spin_ind)
906+
907+class EPSL(aloha_lib.FactoryLorentz):
908+
909+ object_class = L_EPSL
910+
911+ @classmethod
912+ def get_unique_name(self, lor1, particle):
913+ return '_EPSL%s_%s_' % (particle, lor1)
914+
915+#===============================================================================
916+# EPSTR (transverse part of the epsilon normmalized to avoid denominator -- one of the eigenstate)
917+# Real part
918+#===============================================================================
919+class L_EPST1(aloha_lib.LorentzObject):
920+ """ eps^mu_1 (polarization vector)
921+ (0, kx kz , ky kz, -k_T^2)
922+ the normalization 1/k_T / norm(k) is NOT include
923+
924+ """
925+
926+ def __init__(self, name, lor1, particle):
927+
928+ self.particle = particle
929+ aloha_lib.LorentzObject.__init__(self,name, [lor1], [])
930+
931+ def create_representation(self):
932+ """create representation"""
933+# E = aloha_lib.DVariable('P%s_0' % self.particle)
934+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
935+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
936+ p3 = aloha_lib.DVariable('P%s_3' % self.particle)
937+
938+
939+ kT = (p1**2+p2**2)
940+
941+ eps = {
942+ (0,): 0,
943+ (1,): (p1)*(p3),
944+ (2,): p2*(p3),
945+ (3,): -kT ,
946+ }
947+# eps = {
948+# (0,): norm-E*E,
949+# (1,): 0,
950+# (2,): 0 ,
951+# (3,): 0 ,
952+# }
953+
954+ self.representation = aloha_lib.LorentzObjectRepresentation(eps,
955+ self.lorentz_ind,self.spin_ind)
956+
957+class EPST1(aloha_lib.FactoryLorentz):
958+
959+ object_class = L_EPST1
960+
961+ @classmethod
962+ def get_unique_name(self, lor1, particle):
963+ return '_EPST1%s_%s_' % (particle, lor1)
964+
965+#===============================================================================
966+# EPSTI (transverse part of the epsilon normmalized to avoid denominator -- one of the eigenstate)
967+# Imaginary part
968+#===============================================================================
969+
970+class L_EPST2(aloha_lib.LorentzObject):
971+ """ eps^mu_+ (polarization vector)
972+ (0, ky k_T , -i kx k_T, 0)
973+
974+ the normalization 1/(kT*norm(k)) is NOT include here
975+ as well as the k_T term (to avoid the square-root)
976+
977+ """
978+
979+ def __init__(self, name, lor1, particle):
980+
981+ self.particle = particle
982+ aloha_lib.LorentzObject.__init__(self,name, [lor1], [])
983+
984+ def create_representation(self):
985+ """create representation"""
986+ # E = aloha_lib.DVariable('P%s_0' % self.particle)
987+ # m = aloha_lib.DVariable('M%s' % self.particle)
988+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
989+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
990+ # p3 = aloha_lib.DVariable('P%s_3' % self.particle)
991+
992+
993+ eps = {
994+ (0,): 0,
995+ (1,): -p2,
996+ (2,): (p1),
997+ (3,): 0 ,
998+ }
999+# eps = {
1000+# (0,): norm-E*E,
1001+# (1,): 0,
1002+# (2,): 0 ,
1003+# (3,): 0 ,
1004+# }
1005+
1006+ self.representation = aloha_lib.LorentzObjectRepresentation(eps,
1007+ self.lorentz_ind,self.spin_ind)
1008+
1009+class EPST2(aloha_lib.FactoryLorentz):
1010+
1011+ object_class = L_EPST2
1012+
1013+ @classmethod
1014+ def get_unique_name(self, lor1, particle):
1015+ return '_EPST2%s_%s_' % (particle, lor1)
1016+#===============================================================================
1017+# UFP U fermion plus component (first two component)
1018+# the denominator is include in the denominator of the propagator
1019+#===============================================================================
1020+fsign = -1
1021+
1022+class L_UFP(aloha_lib.LorentzObject):
1023+ """
1024+
1025+ """
1026+
1027+ def __init__(self, name, spin1, particle):
1028+
1029+ self.particle = particle
1030+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1031+ tags=['|p%s|_z' % particle,
1032+ 'FWP%s' % particle,
1033+ 'FWM%s' % particle])
1034+
1035+ def create_representation(self):
1036+ """create representation"""
1037+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1038+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1039+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1040+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1041+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1042+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1043+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1044+
1045+
1046+ u = {
1047+ (0,): fwm * normz,
1048+ (1,): fwm * (fsign * p1 + complex(0,fsign)*p2),
1049+ (2,): fwp * normz,
1050+ (3,): fwp * (fsign* p1 + complex(0,fsign)*p2),
1051+ }
1052+
1053+
1054+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1055+ self.lorentz_ind,self.spin_ind)
1056+
1057+
1058+class UFP(aloha_lib.FactoryLorentz):
1059+
1060+ object_class = L_UFP
1061+
1062+ @classmethod
1063+ def get_unique_name(self, spin1, particle):
1064+ return '_UFP%s_%s_' % (particle, spin1)
1065+
1066+class L_UFM(aloha_lib.LorentzObject):
1067+ """
1068+
1069+ """
1070+
1071+ def __init__(self, name, spin1, particle):
1072+
1073+ self.particle = particle
1074+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1075+ tags=['|p%s|_z' % particle,
1076+ 'FWP%s' % particle,
1077+ 'FWM%s' % particle])
1078+
1079+ def create_representation(self):
1080+ """create representation"""
1081+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1082+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1083+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1084+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1085+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1086+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1087+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1088+
1089+
1090+ u = {
1091+ (0,): fwp * (-1*fsign*p1 + complex(0,fsign)*p2),
1092+ (1,): fwp * normz,
1093+ (2,): fwm * (-1*fsign*p1 + complex(0,fsign)*p2),
1094+ (3,): fwm * normz,
1095+ }
1096+
1097+
1098+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1099+ self.lorentz_ind,self.spin_ind)
1100+
1101+class UFM(aloha_lib.FactoryLorentz):
1102+
1103+ object_class = L_UFM
1104+
1105+ @classmethod
1106+ def get_unique_name(self, spin1, particle):
1107+ return '_UFM%s_%s_' % (particle, spin1)
1108+
1109+class L_UFPC(aloha_lib.LorentzObject):
1110+ """
1111+
1112+ """
1113+
1114+ def __init__(self, name, spin1, particle):
1115+
1116+ self.particle = particle
1117+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1118+ tags=['|p%s|_z' % particle,
1119+ 'FWP%s' % particle,
1120+ 'FWM%s' % particle])
1121+
1122+ def create_representation(self):
1123+ """create representation"""
1124+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1125+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1126+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1127+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1128+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1129+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1130+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1131+
1132+
1133+ u = {
1134+ (0,): fwp * normz,
1135+ (1,): fwp * (fsign* p1 + complex(0,-fsign)*p2),
1136+ (2,): fwm * normz,
1137+ (3,): fwm * (fsign* p1 + complex(0,-fsign)*p2),
1138+ }
1139+
1140+
1141+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1142+ self.lorentz_ind,self.spin_ind)
1143+
1144+class UFPC(aloha_lib.FactoryLorentz):
1145+
1146+ object_class = L_UFPC
1147+
1148+ @classmethod
1149+ def get_unique_name(self, spin1, particle):
1150+ return '_UFPC%s_%s_' % (particle, spin1)
1151+
1152+class L_UFMC(aloha_lib.LorentzObject):
1153+ """
1154+
1155+ """
1156+
1157+ def __init__(self, name, spin1, particle):
1158+
1159+ self.particle = particle
1160+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1161+ tags=['|p%s|_z' % particle,
1162+ 'FWP%s' % particle,
1163+ 'FWM%s' % particle])
1164+
1165+ def create_representation(self):
1166+ """create representation"""
1167+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1168+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1169+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1170+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1171+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1172+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1173+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1174+
1175+
1176+ u = {
1177+ (0,): fwm * (-fsign*p1 + complex(0,-fsign)*p2),
1178+ (1,): fwm * normz,
1179+ (2,): fwp * (-fsign*p1 + complex(0,-fsign)*p2),
1180+ (3,): fwp * normz,
1181+ }
1182+
1183+
1184+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1185+ self.lorentz_ind,self.spin_ind)
1186+
1187+class UFMC(aloha_lib.FactoryLorentz):
1188+
1189+ object_class = L_UFMC
1190+
1191+ @classmethod
1192+ def get_unique_name(self, spin1, particle):
1193+ return '_UFMC%s_%s_' % (particle, spin1)
1194+
1195+class L_VFP(aloha_lib.LorentzObject):
1196+ """
1197+
1198+ """
1199+
1200+ def __init__(self, name, spin1, particle):
1201+
1202+ self.particle = particle
1203+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1204+ tags=['|p%s|_z' % particle,
1205+ 'FWP%s' % particle,
1206+ 'FWM%s' % particle])
1207+
1208+ def create_representation(self):
1209+ """create representation"""
1210+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1211+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1212+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1213+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1214+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1215+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1216+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1217+
1218+
1219+ u = {
1220+ (0,): -1*fwp * (-1 *fsign * p1 + complex(0,fsign)*p2),
1221+ (1,): -1*fwp * normz,
1222+ (2,): 1*fwm * (-1 *fsign * p1 + complex(0,fsign)*p2),
1223+ (3,): 1*fwm * normz,
1224+ }
1225+
1226+
1227+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1228+ self.lorentz_ind,self.spin_ind)
1229+
1230+
1231+class VFP(aloha_lib.FactoryLorentz):
1232+
1233+ object_class = L_VFP
1234+
1235+ @classmethod
1236+ def get_unique_name(self, spin1, particle):
1237+ return '_VFP%s_%s_' % (particle, spin1)
1238+
1239+class L_VFPC(aloha_lib.LorentzObject):
1240+ """
1241+
1242+ """
1243+
1244+ def __init__(self, name, spin1, particle):
1245+
1246+ self.particle = particle
1247+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1248+ tags=['|p%s|_z' % particle,
1249+ 'FWP%s' % particle,
1250+ 'FWM%s' % particle])
1251+
1252+ def create_representation(self):
1253+ """create representation"""
1254+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1255+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1256+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1257+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1258+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1259+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1260+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1261+
1262+
1263+ u = {
1264+ (0,): fwm * (-1 *fsign * p1 + complex(0,-1*fsign)*p2),
1265+ (1,): fwm * normz,
1266+ (2,): -1*fwp * (-1 *fsign * p1 + complex(0,-1*fsign)*p2),
1267+ (3,): -1*fwp * normz,
1268+ }
1269+
1270+
1271+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1272+ self.lorentz_ind,self.spin_ind)
1273+
1274+
1275+class VFPC(aloha_lib.FactoryLorentz):
1276+
1277+ object_class = L_VFPC
1278+
1279+ @classmethod
1280+ def get_unique_name(self, spin1, particle):
1281+ return '_VFPC%s_%s_' % (particle, spin1)
1282+
1283+
1284+class L_VFM(aloha_lib.LorentzObject):
1285+ """
1286+
1287+ """
1288+
1289+ def __init__(self, name, spin1, particle):
1290+
1291+ self.particle = particle
1292+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1293+ tags=['|p%s|_z' % particle,
1294+ 'FWP%s' % particle,
1295+ 'FWM%s' % particle])
1296+
1297+ def create_representation(self):
1298+ """create representation"""
1299+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1300+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1301+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1302+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1303+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1304+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1305+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1306+
1307+
1308+ u = {
1309+ (0,): fwm * normz,
1310+ (1,): fwm * (fsign * p1 + complex(0,fsign)*p2),
1311+ (2,): -1*fwp * normz,
1312+ (3,): -1*fwp * (fsign * p1 + complex(0,fsign)*p2),
1313+ }
1314+
1315+
1316+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1317+ self.lorentz_ind,self.spin_ind)
1318+
1319+
1320+class VFM(aloha_lib.FactoryLorentz):
1321+
1322+ object_class = L_VFM
1323+
1324+ @classmethod
1325+ def get_unique_name(self, spin1, particle):
1326+ return '_VFM%s_%s_' % (particle, spin1)
1327+
1328+class L_VFMC(aloha_lib.LorentzObject):
1329+ """
1330+
1331+ """
1332+
1333+ def __init__(self, name, spin1, particle):
1334+
1335+ self.particle = particle
1336+ aloha_lib.LorentzObject.__init__(self,name, [], [spin1],
1337+ tags=['|p%s|_z' % particle,
1338+ 'FWP%s' % particle,
1339+ 'FWM%s' % particle])
1340+
1341+ def create_representation(self):
1342+ """create representation"""
1343+ #E = aloha_lib.DVariable('P%s_0' % self.particle)
1344+ p1 = aloha_lib.DVariable('P%s_1' % self.particle)
1345+ p2 = aloha_lib.DVariable('P%s_2' % self.particle)
1346+ #p3 = aloha_lib.DVariable('P%s_3' % self.particle)
1347+ normz = aloha_lib.DVariable('TnormZ%s' % self.particle)
1348+ fwp = aloha_lib.DVariable('FWP%s' % self.particle)
1349+ fwm = aloha_lib.DVariable('FWM%s' % self.particle)
1350+
1351+
1352+ u = {
1353+ (0,): -1*fwp * normz,
1354+ (1,): -1*fwp * (fsign * p1 + complex(0,-1*fsign)*p2),
1355+ (2,): fwm * normz,
1356+ (3,): fwm * (fsign * p1 + complex(0,-1*fsign)*p2),
1357+
1358+ }
1359+
1360+
1361+ self.representation = aloha_lib.LorentzObjectRepresentation(u,
1362+ self.lorentz_ind,self.spin_ind)
1363+
1364+
1365+class VFMC(aloha_lib.FactoryLorentz):
1366+
1367+ object_class = L_VFMC
1368+
1369+ @classmethod
1370+ def get_unique_name(self, spin1, particle):
1371+ return '_VFMC%s_%s_' % (particle, spin1)
1372
1373 #===============================================================================
1374 # Denominator Propagator
1375@@ -979,11 +1656,12 @@
1376 SpinorPropagatorin = lambda spin1, spin2, particle: (Gamma('mu', spin1, spin2) * \
1377 P('mu', particle) + Mass(particle) * Identity(spin1, spin2))
1378
1379+
1380 VectorPropagator = lambda l1, l2, part: complex(0,1)*(-1 * Metric(l1, l2) + OverMass2(part) * \
1381 Metric(l1,'I3')* P('I3', part) * P(l2, part))
1382
1383 VectorPropagatorMassless= lambda l1, l2, part: complex(0,-1) * Metric(l1, l2)
1384-
1385+
1386
1387 Spin3halfPropagatorin = lambda mu, nu, s1, s2, part: (\
1388 -1/3 * (Gamma(mu,s1,-2) + Identity(s1, -2) * P(mu, part) * Mass(part) * OverMass2(part))* \
1389
1390=== modified file 'aloha/aloha_parsers.py'
1391--- aloha/aloha_parsers.py 2019-11-14 08:33:54 +0000
1392+++ aloha/aloha_parsers.py 2020-01-09 23:16:36 +0000
1393@@ -206,10 +206,13 @@
1394
1395 class ALOHAExpressionParser(UFOExpressionParser):
1396
1397- aloha_object = ['P','Gamma','Gamma5','Sigma','Mass','PSlash',
1398+ aloha_object = ['P', 'PVec','Gamma','Gamma5','Sigma','Mass','PSlash',
1399 'OverMass2','Width','Scalar','Spinor','Vector',
1400 'Spin2','Spin32','C','Epsilon','Metric','Identity',
1401- 'ProjM','ProjP','Coup']
1402+ 'ProjM','ProjP','Coup','Norm', 'EPSL', 'EPST1', 'EPST2', 'PT',
1403+ 'UFP', 'UFM', 'UFPC', 'UFMC',
1404+ 'VFP', 'VFM', 'VFPC', 'VFMC',
1405+ 'Tnorm', 'TnormZ']
1406
1407 def p_expression_pi(self, p):
1408 '''expression : PI'''
1409
1410=== modified file 'aloha/aloha_writers.py'
1411--- aloha/aloha_writers.py 2018-09-19 09:41:33 +0000
1412+++ aloha/aloha_writers.py 2020-01-09 23:16:36 +0000
1413@@ -594,12 +594,12 @@
1414 p = [] # a list for keeping track how to write the momentum
1415
1416 signs = self.get_momentum_conservation_sign()
1417-
1418 for i,type in enumerate(self.particles):
1419 if self.declaration.is_used('OM%s' % (i+1)):
1420 out.write(" OM{0} = {1}\n if (M{0}.ne.{1}) OM{0}={2}/M{0}**2\n".format(
1421 i+1, self.change_number_format(0), self.change_number_format(1)))
1422-
1423+
1424+
1425 if i+1 == self.outgoing:
1426 out_type = type
1427 out_size = self.type_to_size[type]
1428@@ -612,6 +612,8 @@
1429
1430 # define the resulting momenta
1431 if self.offshell:
1432+
1433+
1434 energy_pos = out_size -2
1435 type = self.particles[self.outgoing-1]
1436
1437@@ -622,6 +624,27 @@
1438 if self.declaration.is_used('P%s' % self.outgoing):
1439 self.get_one_momenta_def(self.outgoing, out)
1440
1441+ if "P1T" in self.tag or "P1L" in self.tag:
1442+ for i in range(1,4):
1443+ P = "P%s" % (self.outgoing)
1444+ value = ["1d-30", "0d0", "1d-15"]
1445+ out.write(" IF (DABS(%(P)s(0))*1e-10.gt.DABS(%(P)s(%(i)s))) %(P)s(%(i)s)=%(val)s\n"
1446+ % {"P": P, "i":i, 'val':value[i-1]})
1447+ i = self.outgoing -1
1448+ if self.declaration.is_used('Tnorm%s' % (i+1)):
1449+ out.write(" TNORM{0} = DSQRT(P{0}(1)*P{0}(1)+P{0}(2)*P{0}(2)+P{0}(3)*P{0}(3))\n".format(
1450+ i+1))
1451+ if self.declaration.is_used('TnormZ%s' % (i+1)):
1452+ out.write(" TNORMZ{0} = TNORM{0} - P{0}(3)\n".format(
1453+ i+1))
1454+
1455+ if self.declaration.is_used('FWP%s' % (i+1)):
1456+ out.write(" FWP{0} = DSQRT(-P{0}(0) + TNORM{0})\n"\
1457+ .format(i+1))
1458+ if self.declaration.is_used('FWM%s' % (i+1)):
1459+ out.write(" FWM{0} = DSQRT(-P{0}(0) - TNORM{0})\n"\
1460+ .format(i+1))
1461+ #out.write(" FWM{0} = M{0}/FWP{0}\n".format(i+1))
1462
1463 # Returning result
1464 return out.getvalue()
1465@@ -715,7 +738,10 @@
1466 tmp = Fraction(str(number))
1467 tmp = tmp.limit_denominator(100)
1468 if not abs(tmp - number) / abs(tmp + number) < 1e-8:
1469- out = '%s%s' % (number, self.format)
1470+ if 'e' in str(number):
1471+ out = str(number).replace('e','d')
1472+ else:
1473+ out = '%s%s' % (number, self.format)
1474 else:
1475 out = '%s%s/%s%s' % (tmp.numerator, self.format, tmp.denominator, self.format)
1476 return out
1477@@ -745,7 +771,6 @@
1478 keys.sort(sort_fct)
1479 for name in keys:
1480 fct, objs = self.routine.fct[name]
1481-
1482 format = ' %s = %s\n' % (name, self.get_fct_format(fct))
1483 try:
1484 text = format % ','.join([self.write_obj(obj) for obj in objs])
1485@@ -774,7 +799,14 @@
1486 else:
1487 OffShellParticle = '%s%d' % (self.particles[self.offshell-1],\
1488 self.offshell)
1489- if 'L' not in self.tag:
1490+ is_loop = False
1491+ if 'L' in self.tag:
1492+ if self.tag.count('L') == 1 and 'PL' in self.tag:
1493+ is_loop = False
1494+ else:
1495+ is_loop = True
1496+
1497+ if not is_loop:
1498 coeff = 'denom*'
1499 if not aloha.complex_mass:
1500 if self.routine.denominator:
1501@@ -917,6 +949,7 @@
1502 writer.writelines(text)
1503 return text
1504
1505+
1506 class QP(object):
1507 """routines for writing out Fortran"""
1508
1509
1510=== modified file 'aloha/create_aloha.py'
1511--- aloha/create_aloha.py 2018-06-13 07:15:48 +0000
1512+++ aloha/create_aloha.py 2020-01-09 23:16:36 +0000
1513@@ -238,6 +238,7 @@
1514 for name in aloha_lib.KERNEL.use_tag
1515 if name.startswith('TMP')])
1516
1517+
1518 output.fct = dict([(name, aloha_lib.KERNEL.reduced_expr2[name])
1519 for name in aloha_lib.KERNEL.use_tag
1520 if name.startswith('FCT')])
1521@@ -255,7 +256,7 @@
1522
1523 if need_P_sign:
1524 expr = re.sub(r'\b(P|PSlash)\(', r'-\1(', expr)
1525-
1526+
1527 calc = aloha_parsers.ALOHAExpressionParser()
1528 lorentz_expr = calc.parse(expr)
1529 return lorentz_expr
1530@@ -431,9 +432,43 @@
1531 def get_custom_propa(self, propa, spin, id):
1532 """Return the ALOHA object associated to the user define propagator"""
1533
1534- propagator = getattr(self.model.propagators, propa)
1535- numerator = propagator.numerator
1536- denominator = propagator.denominator
1537+ if not propa.startswith('1'):
1538+ propagator = getattr(self.model.propagators, propa)
1539+ numerator = propagator.numerator
1540+ denominator = propagator.denominator
1541+ elif propa == "1L":
1542+ numerator = "EPSL(1,id) * EPSL(2,id)"
1543+ denominator = "-1*PVec(-2,id)*PVec(-2,id)*Mass(id)**2 * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
1544+ elif propa == "1T":
1545+ numerator = "-1*PVec(-2,id)*PVec(-2,id) * EPST2(1,id)*EPST2(2,id) + EPST1(1,id)*EPST1(2,id)"
1546+ denominator = "PVec(-2,id)*PVec(-2,id) * PT(-3,id)*PT(-3,id) * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
1547+ elif propa == "1A":
1548+ numerator = "(P(-2,id)**2 - Mass(id)**2) * P(1,id) * P(2,id)"
1549+ denominator = "P(-2,id)**2 * Mass(id)**2 * (P(-1,id)**2 - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
1550+ elif propa in ["1P"]:
1551+ # shift and flip the tag if we multiply by C matrices
1552+ spin_id = id
1553+ if (id + 1) // 2 in self.conjg:
1554+ spin_id += _conjugate_gap + id % 2 - (id +1) % 2
1555+ if (spin_id % 2):
1556+ numerator = "UFP(1,id)*UFPC(2,id)"
1557+ else:
1558+ numerator = "VFP(1,id)*VFPC(2,id)"
1559+
1560+ denominator = "(2*Tnorm(id)*TnormZ(id))*(P(-1,id)*P(-1,id) - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
1561+
1562+ elif propa == "1M":
1563+ # shift and flip the tag if we multiply by C matrices
1564+ spin_id = id
1565+ if (id + 1) // 2 in self.conjg:
1566+ spin_id += _conjugate_gap + id % 2 - (id +1) % 2
1567+ if (spin_id % 2):
1568+ numerator = "UFM(1,id)*UFMC(2,id)"
1569+ else:
1570+ numerator = "VFM(1,id)*VFMC(2,id)"
1571+ denominator = "(2*Tnorm(id)*TnormZ(id))*(P(-1,id)*P(-1,id) - Mass(id) * Mass(id) + complex(0,1) * Mass(id) * Width(id))"
1572+ else:
1573+ raise Exception
1574
1575 # Find how to make the replacement for the various tag in the propagator expression
1576 needPflipping = False
1577@@ -475,15 +510,16 @@
1578
1579 numerator = self.mod_propagator_expression(tag, numerator)
1580 if denominator:
1581- denominator = self.mod_propagator_expression(tag, denominator)
1582+ denominator = self.mod_propagator_expression(tag, denominator)
1583+
1584 numerator = self.parse_expression(numerator, needPflipping)
1585-
1586+
1587 if denominator:
1588 self.denominator = self.parse_expression(denominator, needPflipping)
1589 self.denominator = eval(self.denominator)
1590 if not isinstance(self.denominator, numbers.Number):
1591 self.denominator = self.denominator.simplify().expand().simplify().get((0,))
1592-
1593+ needPflipping = False
1594 if spin ==4:
1595 return eval(numerator) * propaR
1596 else:
1597
1598=== modified file 'madgraph/core/base_objects.py'
1599--- madgraph/core/base_objects.py 2019-09-12 07:01:20 +0000
1600+++ madgraph/core/base_objects.py 2020-01-09 23:16:36 +0000
1601@@ -24,6 +24,7 @@
1602 import re
1603 import StringIO
1604 import madgraph.core.color_algebra as color
1605+import collections
1606 from madgraph import MadGraph5Error, MG5DIR, InvalidCmd
1607 import madgraph.various.misc as misc
1608
1609@@ -1968,6 +1969,8 @@
1610 self['from_group'] = True
1611 # onshell: decaying leg (True), forbidden s-channel (False), none (None)
1612 self['onshell'] = None
1613+ # filter on the helicty
1614+ self['polarization'] = []
1615
1616 def filter(self, name, value):
1617 """Filter for valid leg property values."""
1618@@ -2000,12 +2003,24 @@
1619 raise self.PhysicsObjectError, \
1620 "%s is not a valid boolean for leg flag onshell" % \
1621 str(value)
1622+
1623+
1624+ if name == 'polarization':
1625+ if not isinstance(value, list):
1626+ raise self.PhysicsObjectError, \
1627+ "%s is not a valid list" % str(value)
1628+ for i in value:
1629+ if i not in [-1, 1, 2,-2, 3,-3, 0, 99]:
1630+ raise self.PhysicsObjectError, \
1631+ "%s is not a valid polarization" % str(value)
1632+
1633+
1634 return True
1635
1636 def get_sorted_keys(self):
1637 """Return particle property names as a nicely sorted list."""
1638
1639- return ['id', 'number', 'state', 'from_group', 'loop_line', 'onshell']
1640+ return ['id', 'number', 'state', 'from_group', 'loop_line', 'onshell', 'polarization']
1641
1642 def is_fermion(self, model):
1643 """Returns True if the particle corresponding to the leg is a
1644@@ -2165,6 +2180,7 @@
1645
1646 self['ids'] = []
1647 self['state'] = True
1648+ self['polarization'] = []
1649
1650 def filter(self, name, value):
1651 """Filter for valid multileg property values."""
1652@@ -2178,6 +2194,15 @@
1653 raise self.PhysicsObjectError, \
1654 "%s is not a valid list of integers" % str(value)
1655
1656+ if name == 'polarization':
1657+ if not isinstance(value, list):
1658+ raise self.PhysicsObjectError, \
1659+ "%s is not a valid list" % str(value)
1660+ for i in value:
1661+ if i not in [-1, 1, 2, -2, 3, -3, 0, 99]:
1662+ raise self.PhysicsObjectError, \
1663+ "%s is not a valid polarization" % str(value)
1664+
1665 if name == 'state':
1666 if not isinstance(value, bool):
1667 raise self.PhysicsObjectError, \
1668@@ -2189,7 +2214,7 @@
1669 def get_sorted_keys(self):
1670 """Return particle property names as a nicely sorted list."""
1671
1672- return ['ids', 'state']
1673+ return ['ids', 'state','polarization']
1674
1675 #===============================================================================
1676 # LegList
1677@@ -3512,13 +3537,11 @@
1678 final_legs = filter(lambda leg: leg.get('state') == True, \
1679 self.get_legs_with_decays())
1680
1681- identical_indices = {}
1682+ identical_indices = collections.defaultdict(int)
1683 for leg in final_legs:
1684- if leg.get('id') in identical_indices:
1685- identical_indices[leg.get('id')] = \
1686- identical_indices[leg.get('id')] + 1
1687- else:
1688- identical_indices[leg.get('id')] = 1
1689+ key = (leg.get('id'), tuple(leg.get('polarization')))
1690+ identical_indices[key] += 1
1691+
1692 return reduce(lambda x, y: x * y, [ math.factorial(val) for val in \
1693 identical_indices.values() ], 1)
1694
1695@@ -3867,18 +3890,19 @@
1696
1697 # First make sure that the desired particle ids belong to those defined
1698 # in this process definition.
1699- my_isids = [leg.get('ids') for leg in self.get('legs') \
1700- if not leg.get('state')]
1701- my_fsids = [leg.get('ids') for leg in self.get('legs') \
1702- if leg.get('state')]
1703- for i, is_id in enumerate(initial_state_ids):
1704- assert is_id in my_isids[i]
1705- for i, fs_id in enumerate(final_state_ids):
1706- assert fs_id in my_fsids[i]
1707+ if __debug__:
1708+ my_isids = [leg.get('ids') for leg in self.get('legs') \
1709+ if not leg.get('state')]
1710+ my_fsids = [leg.get('ids') for leg in self.get('legs') \
1711+ if leg.get('state')]
1712+ for i, is_id in enumerate(initial_state_ids):
1713+ assert is_id in my_isids[i]
1714+ for i, fs_id in enumerate(final_state_ids):
1715+ assert fs_id in my_fsids[i]
1716
1717 return self.get_process_with_legs(LegList(\
1718- [Leg({'id': id, 'state':False}) for id in initial_state_ids] + \
1719- [Leg({'id': id, 'state':True}) for id in final_state_ids]))
1720+ [Leg({'id': id, 'state':False, 'polarization':[]}) for id in initial_state_ids] + \
1721+ [Leg({'id': id, 'state':True, 'polarization':[]}) for id in final_state_ids]))
1722
1723 def __eq__(self, other):
1724 """Overloading the equality operator, so that only comparison
1725
1726=== modified file 'madgraph/core/diagram_generation.py'
1727--- madgraph/core/diagram_generation.py 2019-03-15 15:43:38 +0000
1728+++ madgraph/core/diagram_generation.py 2020-01-09 23:16:36 +0000
1729@@ -627,7 +627,6 @@
1730 leglist = self.copy_leglist(process.get('legs'))
1731
1732 for leg in leglist:
1733-
1734 # For the first step, ensure the tag from_group
1735 # is true for all legs
1736 leg.set('from_group', True)
1737@@ -1690,36 +1689,42 @@
1738 # identifying identical matrix elements already at this stage.
1739 model = process_definition['model']
1740
1741+ islegs = [leg for leg in process_definition['legs'] \
1742+ if leg['state'] == False]
1743+ fslegs = [leg for leg in process_definition['legs'] \
1744+ if leg['state'] == True]
1745+
1746 isids = [leg['ids'] for leg in process_definition['legs'] \
1747 if leg['state'] == False]
1748- fsids = [leg['ids'] for leg in process_definition['legs'] \
1749+ fsids = [leg['ids'] for leg in process_definition['legs'] \
1750+ if leg['state'] == True]
1751+ polids = [tuple(leg['polarization']) for leg in process_definition['legs'] \
1752 if leg['state'] == True]
1753 # Generate all combinations for the initial state
1754-
1755 for prod in itertools.product(*isids):
1756 islegs = [\
1757- base_objects.Leg({'id':id, 'state': False}) \
1758- for id in prod]
1759+ base_objects.Leg({'id':id, 'state': False,
1760+ 'polarization': islegs[i]['polarization']})
1761+ for i,id in enumerate(prod)]
1762
1763 # Generate all combinations for the final state, and make
1764 # sure to remove double counting
1765
1766- red_fsidlist = []
1767+ red_fsidlist = set()
1768
1769 for prod in itertools.product(*fsids):
1770-
1771+ tag = zip(prod, polids)
1772+ tag = sorted(tag)
1773 # Remove double counting between final states
1774- if tuple(sorted(prod)) in red_fsidlist:
1775+ if tuple(tag) in red_fsidlist:
1776 continue
1777
1778- red_fsidlist.append(tuple(sorted(prod)));
1779-
1780+ red_fsidlist.add(tuple(tag))
1781 # Generate leg list for process
1782 leg_list = [copy.copy(leg) for leg in islegs]
1783-
1784 leg_list.extend([\
1785- base_objects.Leg({'id':id, 'state': True}) \
1786- for id in prod])
1787+ base_objects.Leg({'id':id, 'state': True, 'polarization': fslegs[i]['polarization']}) \
1788+ for i,id in enumerate(prod)])
1789
1790 legs = base_objects.LegList(leg_list)
1791
1792
1793=== modified file 'madgraph/core/helas_objects.py'
1794--- madgraph/core/helas_objects.py 2019-08-02 21:35:19 +0000
1795+++ madgraph/core/helas_objects.py 2020-01-09 23:16:36 +0000
1796@@ -638,6 +638,9 @@
1797 # conjugate_indices is a list [1,2,...] with fermion lines
1798 # that need conjugates. Default is "None"
1799 self['conjugate_indices'] = None
1800+ #
1801+ #
1802+ self['polarization'] = []
1803
1804 # Customized constructor
1805 def __init__(self, *arguments):
1806@@ -652,6 +655,7 @@
1807 leg = arguments[0]
1808 interaction_id = arguments[1]
1809 model = arguments[2]
1810+
1811 # decay_ids is the pdg codes for particles with decay
1812 # chains defined
1813 decay_ids = []
1814@@ -672,11 +676,17 @@
1815 # the decay is applied
1816 if self['state'] == 'final' and self.get('pdg_code') in decay_ids:
1817 self.set('decay', True)
1818-
1819+ else:
1820+ if 99 in leg.get('polarization'):
1821+ raise Exception("polarization A only valid for propagator.")
1822 # Set fermion flow state. Initial particle and final
1823 # antiparticle are incoming, and vice versa for
1824 # outgoing
1825 if self.is_fermion():
1826+ if leg.get('polarization'):
1827+ pol = list(leg.get('polarization'))
1828+ self.set('polarization', pol)
1829+
1830 if leg.get('state') == False and \
1831 self.get('is_part') or \
1832 leg.get('state') == True and \
1833@@ -684,12 +694,16 @@
1834 self.set('state', 'incoming')
1835 else:
1836 self.set('state', 'outgoing')
1837+ else:
1838+ self.set('polarization', leg.get('polarization'))
1839 self.set('interaction_id', interaction_id, model)
1840 elif arguments:
1841 super(HelasWavefunction, self).__init__(arguments[0])
1842 else:
1843 super(HelasWavefunction, self).__init__()
1844
1845+
1846+
1847 def filter(self, name, value):
1848 """Filter for valid wavefunction property values."""
1849
1850@@ -838,6 +852,15 @@
1851 raise self.PhysicsObjectError, \
1852 "%s is not a valid int" % str(value) + \
1853 " for the lcut_size"
1854+
1855+ if name == 'polarization':
1856+ if not isinstance(value, list):
1857+ raise self.PhysicsObjectError, \
1858+ "%s is not a valid list" % str(value)
1859+ for i in value:
1860+ if i not in [-1, 1, 2, -2, 3, -3, 0, 99]:
1861+ raise self.PhysicsObjectError, \
1862+ "%s is not a valid polarization" % str(value)
1863
1864 return True
1865
1866@@ -1567,6 +1590,33 @@
1867 output['propa'] = self.get('particle').get('propagator')
1868 if output['propa'] not in ['', None]:
1869 output['propa'] = 'P%s' % output['propa']
1870+ if self.get('polarization'):
1871+ raise InvalidCmd, 'particle with custom propagator can not have polarization'
1872+ elif self.get('polarization'):
1873+ if self.get('polarization') == [0]:
1874+ if self.get('spin') != 3:
1875+ raise InvalidCmd, 'polarization not handle for decay particle'
1876+ output['propa'] = 'P1L'
1877+ elif self.get('polarization') == [1,-1]:
1878+ if self.get('spin') != 3:
1879+ raise InvalidCmd, 'polarization not handle for decay particle'
1880+ output['propa'] = 'P1T'
1881+ elif self.get('polarization') == [99]:
1882+ if self.get('spin') != 3:
1883+ raise InvalidCmd, 'polarization not handle for decay particle'
1884+ output['propa'] = 'P1A'
1885+ elif self.get('polarization') == [1]:
1886+ if self.get('spin') != 2:
1887+ raise InvalidCmd, 'polarization not handle for decay particle'
1888+ output['propa'] = 'P1P'
1889+ elif self.get('polarization') == [-1]:
1890+ misc.sprint(self.get('polarization'), self.get('spin'))
1891+ if self.get('spin') != 2:
1892+ raise InvalidCmd, 'Left polarization not handle for decay particle for spin (2s+1=%s) particles' % self.get('spin')
1893+ output['propa'] = 'P1M'
1894+ else:
1895+ raise InvalidCmd, 'polarization not handle for decay particle'
1896+
1897 # optimization
1898 if aloha.complex_mass:
1899 if (self.get('width') == 'ZERO' or self.get('mass') == 'ZERO'):
1900@@ -1641,16 +1691,22 @@
1901 # Sort according to spin and flow direction
1902 res.sort()
1903 res.append(self.get_spin_state_number())
1904- res.append(self.find_outgoing_number())
1905+ outgoing =self.find_outgoing_number()
1906+ res.append(outgoing)
1907
1908 if self['is_loop']:
1909 res.append(self.get_loop_index())
1910 if not self.get('mothers'):
1911 res.append(self.get('is_part'))
1912
1913+ res.append(tuple(self.get('polarization')) )
1914+
1915 # Check if we need to append a charge conjugation flag
1916 if self.needs_hermitian_conjugate():
1917 res.append(self.get('conjugate_indices'))
1918+
1919+
1920+
1921
1922 return (tuple(res), tuple(self.get('lorentz')))
1923
1924@@ -1774,6 +1830,19 @@
1925
1926 if self.get('particle').get('propagator') not in ['', None]:
1927 tags.append('P%s' % str(self.get('particle').get('propagator')))
1928+ elif self.get('polarization'):
1929+ if self.get('polarization') == [0]:
1930+ tags.append('P1L')
1931+ elif self.get('polarization') == [1,-1]:
1932+ tags.append('P1T')
1933+ elif self.get('polarization') == [99]:
1934+ tags.append('P1A')
1935+ elif self.get('polarization') == [1]:
1936+ tags.append('P1P')
1937+ elif self.get('polarization') == [-1]:
1938+ tags.append('P1M')
1939+ else:
1940+ raise InvalidCmd, 'polarization not handle for decay particle'
1941
1942 return (tuple(self.get('lorentz')),tuple(tags),self.find_outgoing_number())
1943
1944@@ -3811,7 +3880,7 @@
1945 filter(lambda wf: not wf.get('mothers') and \
1946 wf.get('number_external') == number,
1947 self.get_all_wavefunctions())]
1948-
1949+
1950 # Keep track of wavefunction and amplitude numbers, to ensure
1951 # unique numbers for all new wfs and amps during manipulations
1952 numbers = [self.get_all_wavefunctions()[-1].get('number'),
1953@@ -3971,6 +4040,12 @@
1954 amplitudes which have this wavefunction as mother.
1955 """
1956
1957+ #check that decay does not specify polarization
1958+ wfs = filter(lambda w: w.get('state') == 'initial' , decay.get('diagrams')[0].get('wavefunctions'))
1959+ if any(wf.get('polarization') for wf in wfs):
1960+ raise InvalidCmd, 'In decay-chain polarization can only be specified in production not in decay. Please Retry'
1961+
1962+
1963 len_decay = len(decay.get('diagrams'))
1964
1965 number_external = old_wfs[0].get('number_external')
1966@@ -4218,6 +4293,11 @@
1967
1968 old_wf_index = [wf.get('number') for wf in \
1969 diagram_wfs].index(old_wf.get('number'))
1970+
1971+ old_wf_pol = diagram_wfs[old_wf_index].get('polarization')
1972+ for w in final_decay_wfs:
1973+ w.set('polarization', old_wf_pol)
1974+
1975
1976 diagram_wfs = diagram_wfs[0:old_wf_index] + \
1977 decay_diag_wfs + diagram_wfs[old_wf_index:]
1978@@ -4425,6 +4505,7 @@
1979 """Insert decay chain by simply modifying wavefunction. This
1980 is possible only if there is only one diagram in the decay."""
1981
1982+
1983 for key in old_wf.keys():
1984 old_wf.set(key, new_wf[key])
1985
1986@@ -4546,6 +4627,8 @@
1987 mothers.append(wf)
1988
1989 return mothers
1990+
1991+
1992
1993 def get_num_configs(self):
1994 """Get number of diagrams, which is always more than number of
1995@@ -4648,11 +4731,13 @@
1996 return None
1997
1998 model = self.get('processes')[0].get('model')
1999+ hel_per_part = [ len(wf.get('polarization')) if wf.get('polarization')
2000+ else len(model.get('particle_dict')[\
2001+ wf.get('pdg_code')].get_helicity_states())
2002+ for wf in self.get_external_wavefunctions()]
2003
2004 return reduce(lambda x, y: x * y,
2005- [ len(model.get('particle_dict')[wf.get('pdg_code')].\
2006- get_helicity_states())\
2007- for wf in self.get_external_wavefunctions() ], 1)
2008+ hel_per_part)
2009
2010 def get_helicity_matrix(self, allow_reverse=True):
2011 """Gives the helicity matrix for external wavefunctions"""
2012@@ -4663,9 +4748,12 @@
2013 process = self.get('processes')[0]
2014 model = process.get('model')
2015
2016- return apply(itertools.product, [ model.get('particle_dict')[\
2017- wf.get('pdg_code')].get_helicity_states(allow_reverse)\
2018- for wf in self.get_external_wavefunctions()])
2019+ hel_per_part = [ wf.get('polarization') if wf.get('polarization')
2020+ else model.get('particle_dict')[\
2021+ wf.get('pdg_code')].get_helicity_states(allow_reverse)
2022+ for wf in self.get_external_wavefunctions()]
2023+
2024+ return apply(itertools.product, hel_per_part)
2025
2026 def get_hel_avg_factor(self):
2027 """ Calculate the denominator factor due to the average over initial
2028@@ -4674,11 +4762,28 @@
2029 model = self.get('processes')[0].get('model')
2030 initial_legs = filter(lambda leg: leg.get('state') == False, \
2031 self.get('processes')[0].get('legs'))
2032-
2033- return reduce(lambda x, y: x * y,
2034- [ len(model.get('particle_dict')[leg.get('id')].\
2035- get_helicity_states())\
2036- for leg in initial_legs ])
2037+ hel_per_part = [ len(leg.get('polarization')) if leg.get('polarization')
2038+ else len(model.get('particle_dict')[\
2039+ leg.get('id')].get_helicity_states())
2040+ for leg in initial_legs]
2041+
2042+ return reduce(lambda x, y: x * y, hel_per_part, 1)
2043+
2044+ def get_spin_state_initial(self):
2045+ """Gives (number of state for each initial particle)"""
2046+
2047+ model = self.get('processes')[0].get('model')
2048+ initial_legs = filter(lambda leg: leg.get('state') == False, \
2049+ self.get('processes')[0].get('legs'))
2050+ hel_per_part = [ len(leg.get('polarization')) if leg.get('polarization')
2051+ else len(model.get('particle_dict')[\
2052+ leg.get('id')].get_helicity_states())
2053+ for leg in initial_legs]
2054+
2055+ if len(hel_per_part) == 1:
2056+ hel_per_part.append(0)
2057+
2058+ return hel_per_part
2059
2060 def get_beams_hel_avg_factor(self):
2061 """ Calculate the denominator factor due to the average over initial
2062@@ -4714,7 +4819,9 @@
2063
2064 spin_factor = reduce(lambda x, y: x * y,
2065 [ len(model.get('particle_dict')[leg.get('id')].\
2066- get_helicity_states())\
2067+ get_helicity_states())
2068+ if not leg.get('polarization') else
2069+ len(leg.get('polarization'))
2070 for leg in initial_legs ])
2071
2072 return spin_factor * color_factor * self['identical_particle_factor']
2073
2074=== modified file 'madgraph/fks/fks_common.py'
2075--- madgraph/fks/fks_common.py 2019-02-26 09:15:55 +0000
2076+++ madgraph/fks/fks_common.py 2020-01-09 23:16:36 +0000
2077@@ -667,6 +667,7 @@
2078 'number': fksleg.get('number'),
2079 'state': fksleg.get('state'),
2080 'from_group': fksleg.get('from_group'),
2081+ 'polarization': fksleg.get('polarization')
2082 })
2083 return leg
2084
2085
2086=== modified file 'madgraph/interface/madgraph_interface.py'
2087--- madgraph/interface/madgraph_interface.py 2020-01-09 13:09:41 +0000
2088+++ madgraph/interface/madgraph_interface.py 2020-01-09 23:16:36 +0000
2089@@ -1062,6 +1062,49 @@
2090 if re.search('\D\$', particles):
2091 raise self.InvalidCmd(
2092 'wrong process format: restriction should be place after the final states')
2093+
2094+ # '{}' should only be used for onshell particle (including initial/final state)
2095+ # check first that polarization are not include between > >
2096+ if nbsep == 2:
2097+ if '{' in particles_parts[1]:
2098+ raise self.InvalidCmd('Polarization restriction can not be used as required s-channel')
2099+ split = re.split('\D[$|/]',particles_parts[-1],1)
2100+ if len(split)==2:
2101+ if '{' in split[1]:
2102+ raise self.InvalidCmd('Polarization restriction can not be used in forbidding particles')
2103+
2104+ if '[' in process and '{' in process:
2105+ valid = False
2106+ if 'noborn' in process:
2107+ valid = True
2108+ else:
2109+ raise self.InvalidCmd('Polarization restriction can not be used for NLO processes')
2110+
2111+ # below are the check when [QCD] will be valid for computation
2112+ order = process.split('[')[1].split(']')[0]
2113+ if '=' in order:
2114+ order = order.split('=')[1]
2115+ if order.strip().lower() != 'qcd':
2116+ raise self.InvalidCmd('Polarization restriction can not be used for generic NLO computations')
2117+
2118+
2119+ for p in particles_parts[1].split():
2120+ if '{' in p:
2121+ part = p.split('{')[0]
2122+ else:
2123+ continue
2124+ if self._curr_model:
2125+ p = self._curr_model.get_particle(part)
2126+ if not p:
2127+ if part in self._multiparticles:
2128+ for part2 in self._multiparticles[part]:
2129+ p = self._curr_model.get_particle(part2)
2130+ if p.get('color') != 1:
2131+ raise self.InvalidCmd('Polarization restriction can not be used for color charged particles')
2132+ continue
2133+ if p.get('color') != 1:
2134+ raise self.InvalidCmd('Polarization restriction can not be used for color charged particles')
2135+
2136
2137
2138 def check_tutorial(self, args):
2139@@ -4645,6 +4688,7 @@
2140 else:
2141 orders[order]=99
2142
2143+
2144 if not self._curr_model['case_sensitive']:
2145 # Particle names lowercase
2146 line = line.lower()
2147@@ -4700,6 +4744,82 @@
2148 continue
2149
2150 mylegids = []
2151+ polarization = []
2152+ if '{' in part_name:
2153+ part_name, pol = part_name.split('{',1)
2154+ pol, rest = pol.split('}',1)
2155+
2156+ no_dup_name = part_name
2157+ while True:
2158+ try:
2159+ spin = self._curr_model.get_particle(no_dup_name).get('spin')
2160+ break
2161+ except AttributeError:
2162+ if no_dup_name in self._multiparticles:
2163+ spins = set([self._curr_model.get_particle(p).get('spin') for p in self._multiparticles[no_dup_name]])
2164+ if len(spins) > 1:
2165+ raise self.InvalidCmd('Can not use polarised on multi-particles for multi-particles with various spin')
2166+ else:
2167+ spin = spins.pop()
2168+ break
2169+ elif no_dup_name[0].isdigit():
2170+ no_dup_name = no_dup_name[1:]
2171+ else:
2172+ raise
2173+ if rest:
2174+ raise self.InvalidCmd('A space is required after the "}" symbol to separate particles')
2175+ ignore =False
2176+ for i,p in enumerate(pol):
2177+ if ignore or p==',':
2178+ ignore= False
2179+ continue
2180+ if p in ['t','T']:
2181+ if spin == 3:
2182+ polarization += [1,-1]
2183+ else:
2184+ raise self.InvalidCmd('"T" (transverse) polarization are only supported for spin one particle.')
2185+ elif p in ['l', 'L']:
2186+ if spin == 3:
2187+ logger.warning('"L" polarization is interpreted as Left for Longitudinal please use "0".')
2188+ polarization += [-1]
2189+ elif p in ['R','r']:
2190+ polarization += [1]
2191+ elif p in ["A",'a']:
2192+ if spin == 3:
2193+ polarization += [99]
2194+ else:
2195+ raise self.InvalidCmd('"A" (auxiliary) polarization are only supported for spin one particle.')
2196+ elif p in ['+']:
2197+ if i +1 < len(pol) and pol[i+1].isdigit():
2198+ p = int(pol[i+1])
2199+ if abs(p) > 3:
2200+ raise self.InvalidCmd("polarization are between -3 and 3")
2201+ polarization.append(p)
2202+ ignore = True
2203+ else:
2204+ polarization += [1]
2205+ elif p in ['-']:
2206+ if i+1 < len(pol) and pol[i+1].isdigit():
2207+ p = int(pol[i+1])
2208+ if abs(p) > 3:
2209+ raise self.InvalidCmd("polarization are between -3 and 3")
2210+ polarization.append(-p)
2211+ ignore = True
2212+ else:
2213+ polarization += [-1]
2214+ elif p in [0,'0']:
2215+ if spin in [1,2]:
2216+ raise self.InvalidCmd('"0" (longitudinal) polarization are not supported for scalar/fermion.')
2217+ else:
2218+ polarization += [0]
2219+ elif p.isdigit():
2220+ p = int(p)
2221+ if abs(p) > 3:
2222+ raise self.InvalidCmd("polarization are between -3 and 3")
2223+ polarization.append(p)
2224+ else:
2225+ raise self.InvalidCmd('Invalid Polarization')
2226+
2227 duplicate =1
2228 if part_name in self._multiparticles:
2229 if isinstance(self._multiparticles[part_name][0], list):
2230@@ -4735,7 +4855,8 @@
2231 if mylegids:
2232 for _ in range(duplicate):
2233 myleglist.append(base_objects.MultiLeg({'ids':mylegids,
2234- 'state':state}))
2235+ 'state':state,
2236+ 'polarization': polarization}))
2237 else:
2238 raise self.InvalidCmd, "No particle %s in model" % part_name
2239
2240@@ -5063,6 +5184,8 @@
2241 final_states = re.search(r'> ([^\/\$\=\@>]*)(\[|\s\S+\=|\$|\/|\@|$)', procline)
2242 particles = final_states.groups()[0]
2243 for particle in particles.split():
2244+ if '{' in particle:
2245+ particle = particle.split('{')[0]
2246 if particle in pids:
2247 final.add(pids[particle])
2248 elif particle in self._multiparticles:
2249
2250=== modified file 'madgraph/interface/reweight_interface.py'
2251--- madgraph/interface/reweight_interface.py 2019-12-11 10:31:48 +0000
2252+++ madgraph/interface/reweight_interface.py 2020-01-09 23:16:36 +0000
2253@@ -99,6 +99,7 @@
2254 self.dedicated_path = {}
2255 self.soft_threshold = None
2256 self.systematics = False # allow to run systematics in ouput2.0 mode
2257+ self.boost_event = False
2258 self.mg5cmd = master_interface.MasterCmd()
2259 if mother:
2260 self.mg5cmd.options.update(mother.options)
2261@@ -368,6 +369,8 @@
2262 self.second_process.append(" ".join(args[1:-1]))
2263 else:
2264 self.second_process = [" ".join(args[1:])]
2265+ elif args[0] == "boost":
2266+ self.boost_event = eval(' '.join(args[1:]))
2267 elif args[0] in ['virtual_path', 'tree_path']:
2268 self.dedicated_path[args[0]] = os.path.abspath(args[1])
2269 elif args[0] == "output":
2270@@ -1196,7 +1199,27 @@
2271 # For 2>N pass in the center of mass frame
2272 # - required for helicity by helicity re-weighitng
2273 # - Speed-up loop computation
2274- if (hasattr(event[1], 'status') and event[1].status == -1) or \
2275+ if (hypp_id == 0 and ('fram_id' in self.banner.run_card and self.banner.run_card['frame_id'] !=6)):
2276+ import copy
2277+ new_event = copy.deepcopy(event)
2278+ pboost = FourMomenta()
2279+ to_inc = bin(self.banner.run_card['frame_id'])[2:]
2280+ to_inc.reverse()
2281+ nb_ext = 0
2282+ for p in new_event:
2283+ if p.status in [-1,1]:
2284+ nb_ext += 1
2285+ if to_inc[nb_ext]:
2286+ pboost += p
2287+ new_event.boost(pboost)
2288+ p = new_event.get_momenta(orig_order)
2289+ elif (hypp_id == 1 and self.boost_event):
2290+ if self.boost_event is not True:
2291+ import copy
2292+ new_event = copy.deepcopy(event)
2293+ new_event.boost(self.boost_event)
2294+ p = new_event.get_momenta(orig_order)
2295+ elif (hasattr(event[1], 'status') and event[1].status == -1) or \
2296 (event[1].px == event[1].py == 0.):
2297 pboost = lhe_parser.FourMomentum(p[0]) + lhe_parser.FourMomentum(p[1])
2298 for i,thisp in enumerate(p):
2299
2300=== modified file 'madgraph/iolibs/export_v4.py'
2301--- madgraph/iolibs/export_v4.py 2019-06-26 14:12:13 +0000
2302+++ madgraph/iolibs/export_v4.py 2020-01-09 23:16:36 +0000
2303@@ -916,7 +916,7 @@
2304
2305 #copy Helas Template
2306 cp(MG5DIR + '/aloha/template_files/Makefile_F', write_dir+'/makefile')
2307- if any([any(['L' in tag for tag in d[1]]) for d in wanted_lorentz]):
2308+ if any([any([tag.startswith('L') for tag in d[1]]) for d in wanted_lorentz]):
2309 cp(MG5DIR + '/aloha/template_files/aloha_functions_loop.f',
2310 write_dir+'/aloha_functions.f')
2311 aloha_model.loop_mode = False
2312@@ -4136,6 +4136,11 @@
2313 'iolibs/template_files/%s' % self.matrix_file)
2314 replace_dict['template_file2'] = pjoin(_file_path, \
2315 'iolibs/template_files/split_orders_helping_functions.inc')
2316+
2317+ s1,s2 = matrix_element.get_spin_state_initial()
2318+ replace_dict['nb_spin_state1'] = s1
2319+ replace_dict['nb_spin_state2'] = s2
2320+
2321 if writer:
2322 file = open(replace_dict['template_file']).read()
2323 file = file % replace_dict
2324@@ -5224,6 +5229,10 @@
2325
2326 ncomb=matrix_elements[0].get_helicity_combinations()
2327 replace_dict['read_write_good_hel'] = self.read_write_good_hel(ncomb)
2328+
2329+ s1,s2 = matrix_elements[0].get_spin_state_initial()
2330+ replace_dict['nb_spin_state1'] = s1
2331+ replace_dict['nb_spin_state2'] = s2
2332
2333 if writer:
2334 file = open(pjoin(_file_path, \
2335
2336=== modified file 'madgraph/iolibs/helas_call_writers.py'
2337--- madgraph/iolibs/helas_call_writers.py 2018-11-08 22:24:49 +0000
2338+++ madgraph/iolibs/helas_call_writers.py 2020-01-09 23:16:36 +0000
2339@@ -363,7 +363,7 @@
2340
2341 # Gluon 4-vertex division tensor calls ggT for the FR sm and mssm
2342
2343- key = ((3, 3, 5, 3), ('A',))
2344+ key = ((3, 3, 5, 3,tuple()), ('A',))
2345 call = lambda wf: \
2346 "CALL UVVAXX(W(1,%d),W(1,%d),%s,zero,zero,zero,W(1,%d))" % \
2347 (FortranHelasCallWriter.sorted_mothers(wf)[0].get('me_id'),
2348@@ -372,7 +372,7 @@
2349 wf.get('me_id'))
2350 self.add_wavefunction(key, call)
2351
2352- key = ((3, 5, 3, 1), ('A',))
2353+ key = ((3, 5, 3, 1,tuple()), ('A',))
2354 call = lambda wf: \
2355 "CALL JVTAXX(W(1,%d),W(1,%d),%s,zero,zero,W(1,%d))" % \
2356 (FortranHelasCallWriter.sorted_mothers(wf)[0].get('me_id'),
2357@@ -393,7 +393,7 @@
2358
2359 # SM gluon 4-vertex components
2360
2361- key = ((3, 3, 3, 3, 1), ('gggg3',))
2362+ key = ((3, 3, 3, 3, 1,tuple()), ('gggg3',))
2363 call = lambda wf: \
2364 "CALL JGGGXX(W(1,%d),W(1,%d),W(1,%d),%s,W(1,%d))" % \
2365 (FortranHelasCallWriter.sorted_mothers(wf)[1].get('me_id'),
2366@@ -412,7 +412,7 @@
2367 amp.get('coupling')[0],
2368 amp.get('number'))
2369 self.add_amplitude(key, call)
2370- key = ((3, 3, 3, 3, 1), ('gggg2',))
2371+ key = ((3, 3, 3, 3, 1 ,tuple()), ('gggg2',))
2372 call = lambda wf: \
2373 "CALL JGGGXX(W(1,%d),W(1,%d),W(1,%d),%s,W(1,%d))" % \
2374 (FortranHelasCallWriter.sorted_mothers(wf)[0].get('me_id'),
2375@@ -431,7 +431,7 @@
2376 amp.get('coupling')[0],
2377 amp.get('number'))
2378 self.add_amplitude(key, call)
2379- key = ((3, 3, 3, 3, 1), ('gggg1',))
2380+ key = ((3, 3, 3, 3, 1,tuple()), ('gggg1',))
2381 call = lambda wf: \
2382 "CALL JGGGXX(W(1,%d),W(1,%d),W(1,%d),%s,W(1,%d))" % \
2383 (FortranHelasCallWriter.sorted_mothers(wf)[2].get('me_id'),
2384@@ -453,7 +453,7 @@
2385
2386 # HEFT VVVS calls
2387
2388- key = ((1, 3, 3, 3, 3), ('',))
2389+ key = ((1, 3, 3, 3, 3,tuple()), ('',))
2390 call = lambda wf: \
2391 "CALL JVVSXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \
2392 (wf.get('mothers')[0].get('me_id'),
2393@@ -465,7 +465,7 @@
2394 wf.get('me_id'))
2395 self.add_wavefunction(key, call)
2396
2397- key = ((3, 3, 3, 1, 4), ('',))
2398+ key = ((3, 3, 3, 1, 4,tuple()), ('',))
2399 call = lambda wf: \
2400 "CALL HVVVXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \
2401 (wf.get('mothers')[0].get('me_id'),
2402@@ -490,7 +490,7 @@
2403
2404 # HEFT VVVS calls
2405
2406- key = ((1, 3, 3, 3, 1), ('',))
2407+ key = ((1, 3, 3, 3, 1,tuple()), ('',))
2408 call = lambda wf: \
2409 "CALL JVVSXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \
2410 (wf.get('mothers')[0].get('me_id'),
2411@@ -502,7 +502,7 @@
2412 wf.get('me_id'))
2413 self.add_wavefunction(key, call)
2414
2415- key = ((3, 3, 3, 1, 4), ('',))
2416+ key = ((3, 3, 3, 1, 4,tuple()), ('',))
2417 call = lambda wf: \
2418 "CALL HVVVXX(W(1,%d),W(1,%d),W(1,%d),DUM1,%s,%s,%s,W(1,%d))" % \
2419 (wf.get('mothers')[0].get('me_id'),
2420@@ -537,7 +537,7 @@
2421 amp.get('number'))
2422 self.add_amplitude(key, call)
2423
2424- key = ((-2, 2, 5, 3), ('',))
2425+ key = ((-2, 2, 5, 3,tuple()), ('',))
2426 call = lambda wf: \
2427 "CALL UIOXXX(W(1,%d),W(1,%d),%s,%s,%s,%s,W(1,%d))" % \
2428 (wf.get('mothers')[0].get('me_id'),
2429@@ -1145,6 +1145,7 @@
2430 outgoing = 0
2431
2432
2433+
2434 # Check if we need to append a charge conjugation flag
2435 l = [str(l) for l in argument.get('lorentz')]
2436 flag = []
2437@@ -1223,7 +1224,7 @@
2438 # Now we have a line correctly formatted
2439 call_function = lambda wf: call % wf.get_helas_call_dict(\
2440 OptimizedOutput=False, specifyHel=self.hel_sum)
2441-
2442+
2443 # Add the constructed function to wavefunction or amplitude dictionary
2444 if isinstance(argument, helas_objects.HelasWavefunction):
2445 self.add_wavefunction(argument.get_call_key(), call_function)
2446@@ -1510,7 +1511,6 @@
2447
2448 # Creating line formatting:
2449 call = 'CALL %(routine_name)s(%(wf)s%(coup)s%(mass)s%(out)s)'
2450-
2451 arg = {'routine_name': aloha_writers.combine_name(\
2452 '%s' % l[0], l[1:], outgoing, flag, True),
2453 'coup': ("%%(coup%d)s," * len(argument.get('coupling'))) % \
2454
2455=== modified file 'madgraph/iolibs/template_files/auto_dsig_v4.inc'
2456--- madgraph/iolibs/template_files/auto_dsig_v4.inc 2016-08-20 06:27:26 +0000
2457+++ madgraph/iolibs/template_files/auto_dsig_v4.inc 2020-01-09 23:16:36 +0000
2458@@ -65,6 +65,11 @@
2459 %(define_subdiag_lines)s
2460 include 'coupl.inc'
2461 include 'run.inc'
2462+c
2463+c local
2464+c
2465+ double precision P1(0:3, nexternal)
2466+
2467 C
2468 C DATA
2469 C
2470@@ -100,7 +105,12 @@
2471 DSIG%(proc_id)s = PD(0)
2472 RETURN
2473 ENDIF
2474- CALL SMATRIX%(proc_id)s(PP,DSIGUU)
2475+ if(frame_id.ne.6)then
2476+ call boost_to_frame(PP, frame_id, P1)
2477+ else
2478+ P1 = PP
2479+ endif
2480+ CALL SMATRIX%(proc_id)s(P1,DSIGUU)
2481 IF (IMODE.EQ.5) THEN
2482 IF (DSIGUU.LT.1D199) THEN
2483 DSIG%(proc_id)s = DSIGUU*CONV
2484
2485=== modified file 'madgraph/iolibs/template_files/born_fks.inc'
2486--- madgraph/iolibs/template_files/born_fks.inc 2017-06-02 12:16:50 +0000
2487+++ madgraph/iolibs/template_files/born_fks.inc 2020-01-09 23:16:36 +0000
2488@@ -25,6 +25,7 @@
2489 C
2490 REAL*8 P1(0:3,NEXTERNAL-1)
2491 COMPLEX*16 ANS(2)
2492+
2493 C
2494 C LOCAL VARIABLES
2495 C
2496@@ -34,6 +35,8 @@
2497 INTEGER NTRY(%(nconfs)d)
2498 DATA NTRY /%(nconfs)d*0/
2499 INTEGER NHEL(NEXTERNAL-1,NCOMB)
2500+ real*8 T_SAVE(NCOMB,2)
2501+ real*8 T_SUM(2)
2502 %(helicity_lines)s
2503 %(den_factor_lines)s
2504 %(ij_lines)s
2505@@ -105,6 +108,8 @@
2506 ANS(1) = 0D0
2507 ANS(2) = 0D0
2508 hel_fac=1d0
2509+ T_SUM(1) = 0d0
2510+ T_SUM(2) = 0d0
2511 DO IHEL=1,NCOMB
2512 ! the following lines are to avoid segfaults when glu_ij=0
2513 cond_ij=skip(nfksprocess).eq.0
2514@@ -112,17 +117,32 @@
2515 !if (nhel(glu_ij,ihel).EQ.NHEL(GLU_IJ,1).or.skip(nfksprocess).eq.0) then
2516 if (cond_ij) then
2517 IF ((GOODHEL(IHEL,nFKSprocess) .OR. GOODHEL(IHEL+SKIP(nFKSprocess),nFKSprocess) .OR. NTRY(nFKSprocess) .LT. 2) ) THEN
2518- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,borns)
2519- ANS(2)=ANS(2)+BORNTILDE
2520- if ( borns(1).ne.0d0 .AND. .NOT. GOODHEL(IHEL,nFKSprocess) ) then
2521+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,borns)
2522+ ANS(2)=ANS(2)+ BORNTILDE
2523+ T_SAVE(IHEL,1) = borns(1)
2524+ T_SAVE(IHEL,2) = borns(2)
2525+ T_SUM(1) = T_SUM(1) + DABS(borns(1))
2526+ T_SUM(2) = T_SUM(2) + DABS(borns(2))
2527+ ENDIF
2528+ else
2529+ T_SAVE(IHEL,1) = 0d0
2530+ T_SAVE(IHEL,2) = 0d0
2531+ ENDIF
2532+ ENDDO
2533+
2534+ IF(ntry(nFKSprocess).LT.2) then
2535+ if (T_SUM(2).lt.1e-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
2536+ do IHEL=1,NCOMB
2537+ if ( DABS(T_SAVE(IHEL,1)).gt.DABS(T_SUM(1))*1d-8/NCOMB)then
2538 GOODHEL(IHEL,nFKSprocess)=.TRUE.
2539 endif
2540- if ( borns(2).ne.0d0 .AND. .NOT. GOODHEL(IHEL+SKIP(nFKSprocess),nFKSprocess) ) then
2541+
2542+ if ( DABS(T_SAVE(IHEL,2)).gt.DABS(T_SUM(2))*1d-8/NCOMB)then
2543 GOODHEL(IHEL+SKIP(nFKSprocess),nFKSprocess)=.TRUE.
2544 endif
2545- ENDIF
2546- ENDIF
2547- ENDDO
2548+ enddo
2549+ endif
2550+
2551 ANS(1)=ANS(1)/DBLE(IDEN)
2552 ANS(2)=ANS(2)/DBLE(IDEN)
2553 wgt_me_born=dble(ans(1))
2554
2555=== modified file 'madgraph/iolibs/template_files/matrix_madevent_group_v4.inc'
2556--- madgraph/iolibs/template_files/matrix_madevent_group_v4.inc 2018-10-26 08:20:43 +0000
2557+++ madgraph/iolibs/template_files/matrix_madevent_group_v4.inc 2020-01-09 23:16:36 +0000
2558@@ -37,6 +37,7 @@
2559 LOGICAL GOODHEL(NCOMB,2)
2560 INTEGER NTRY(2)
2561 common/BLOCK_GOODHEL/NTRY,GOODHEL
2562+
2563 C
2564 C LOCAL VARIABLES
2565 C
2566@@ -52,6 +53,7 @@
2567 INTEGER THIS_NTRY(2)
2568 SAVE THIS_NTRY
2569 DATA THIS_NTRY /0,0/
2570+c
2571 C This is just to temporarily store the reference grid for helicity of the DiscreteSampler so as to obtain its number of entries with ref_helicity_grid%%n_tot_entries
2572 type(SampledDimension) ref_helicity_grid
2573 C
2574@@ -62,6 +64,9 @@
2575
2576 CHARACTER*101 HEL_BUFF
2577 COMMON/TO_HELICITY/ HEL_BUFF
2578+
2579+ INTEGER NB_SPIN_STATE_in(2)
2580+ common /nb_hel_state/ nb_spin_state_in
2581
2582 INTEGER IMIRROR
2583 COMMON/TO_MIRROR/ IMIRROR
2584@@ -120,9 +125,9 @@
2585 T=MATRIX%(proc_id)s(P ,NHEL(1,I),JC(1))
2586 DO JJ=1,nincoming
2587 IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2588- T=T*ABS(POL(JJ))
2589+ T=T*ABS(POL(JJ))*NB_SPIN_STATE_IN(JJ)/2d0 ! NB_SPIN_STATE(JJ)/2d0 is added for polarised beam
2590 ELSE IF(POL(JJ).NE.1d0)THEN
2591- T=T*(2d0-ABS(POL(JJ)))
2592+ T=T*(2d0-ABS(POL(JJ)))*NB_SPIN_STATE_IN(JJ)/2d0
2593 ENDIF
2594 ENDDO
2595 IF (ISUM_HEL.NE.0.and.DS_get_dim_status('Helicity').eq.0.and.ALLOW_HELICITY_GRID_ENTRIES) then
2596
2597=== modified file 'madgraph/iolibs/template_files/matrix_madevent_v4.inc'
2598--- madgraph/iolibs/template_files/matrix_madevent_v4.inc 2019-06-10 21:44:14 +0000
2599+++ madgraph/iolibs/template_files/matrix_madevent_v4.inc 2020-01-09 23:16:36 +0000
2600@@ -37,6 +37,9 @@
2601 LOGICAL GOODHEL(NCOMB)
2602 INTEGER NTRY
2603 common/BLOCK_GOODHEL/NTRY,GOODHEL
2604+ integer nb_spin_state(2)
2605+ data nb_spin_state /%(nb_spin_state1)i,%(nb_spin_state2)i/
2606+ common /nb_hel_state/ nb_spin_state
2607 C
2608 C LOCAL VARIABLES
2609 C
2610@@ -102,9 +105,9 @@
2611 T=MATRIX%(proc_id)s(P ,NHEL(1,I),JC(1))
2612 DO JJ=1,nincoming
2613 IF(POL(JJ).NE.1d0.AND.NHEL(JJ,I).EQ.INT(SIGN(1d0,POL(JJ)))) THEN
2614- T=T*ABS(POL(JJ))
2615+ T=T*ABS(POL(JJ))*NB_SPIN_STATE(JJ)/2d0 ! NB_SPIN_STATE(JJ)/2d0 is added for polarised beam
2616 ELSE IF(POL(JJ).NE.1d0)THEN
2617- T=T*(2d0-ABS(POL(JJ)))
2618+ T=T*(2d0-ABS(POL(JJ)))*NB_SPIN_STATE(JJ)/2d0
2619 ENDIF
2620 ENDDO
2621 IF (ISUM_HEL.NE.0) then
2622
2623=== modified file 'madgraph/iolibs/template_files/realmatrix_fks.inc'
2624--- madgraph/iolibs/template_files/realmatrix_fks.inc 2016-09-08 23:15:34 +0000
2625+++ madgraph/iolibs/template_files/realmatrix_fks.inc 2020-01-09 23:16:36 +0000
2626@@ -41,8 +41,8 @@
2627 NTRY=NTRY+1
2628 ANS = 0D0
2629 DO IHEL=1,NCOMB
2630- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
2631- IF (NTRY.LT.2) THEN
2632+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
2633+ IF (NTRY.LT.10) THEN
2634 C for the first ps-point, check for helicities that give
2635 C identical matrix elements
2636 T=MATRIX_%(N_me)d(P ,NHEL(1,IHEL))
2637@@ -68,11 +68,17 @@
2638 ENDIF
2639 C add to the sum of helicities
2640 ANS=ANS+T
2641- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
2642- GOODHEL(IHEL)=.TRUE.
2643- ENDIF
2644 ENDIF
2645 ENDDO
2646+
2647+ IF ( NTRY .LT. 10) THEN
2648+ DO IHEL=1,NCOMB
2649+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1d-8/NCOMB)) THEN
2650+ GOODHEL(IHEL) = .true.
2651+ ENDIF
2652+ ENDDO
2653+ ENDIF
2654+
2655 ANS=ANS/DBLE(IDEN)
2656 wgt_ME_real=ans
2657 END
2658
2659=== modified file 'madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc'
2660--- madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc 2017-03-12 21:28:46 +0000
2661+++ madgraph/iolibs/template_files/super_auto_dsig_group_v4.inc 2020-01-09 23:16:36 +0000
2662@@ -69,6 +69,10 @@
2663 C
2664 C GLOBAL VARIABLES
2665 C
2666+ integer nb_spin_state(2)
2667+ data nb_spin_state /%(nb_spin_state1)i,%(nb_spin_state2)i/
2668+ common /nb_hel_state/ nb_spin_state
2669+
2670 include 'coupl.inc'
2671 include 'run.inc'
2672 C ICONFIG has this config number
2673@@ -132,9 +136,11 @@
2674 ENDDO
2675 ENDDO
2676 WRITE(*,*)'Relative summed weights:'
2677+ if (SUMPROB.ne.0d0)then
2678 DO J=1,SYMCONF(0)
2679 WRITE(*,'(%(nsprocs)dE12.4)')((SUMWGT(K,I,J)/SUMPROB,K=1,2),I=1,MAXSPROC)
2680 ENDDO
2681+ endif
2682 SUMPROB=0D0
2683 DO J=1,SYMCONF(0)
2684 DO I=1,MAXSPROC
2685@@ -144,9 +150,11 @@
2686 ENDDO
2687 ENDDO
2688 WRITE(*,*)'Relative number of events:'
2689+ if (SUMPROB.ne.0d0)then
2690 DO J=1,SYMCONF(0)
2691 WRITE(*,'(%(nsprocs)dE12.4)')((NUMEVTS(K,I,J)/SUMPROB,K=1,2),I=1,MAXSPROC)
2692 ENDDO
2693+ ENDIF
2694 WRITE(*,*)'Events:'
2695 DO J=1,SYMCONF(0)
2696 WRITE(*,'(%(nsprocs)dI12)')((NUMEVTS(K,I,J),K=1,2),I=1,MAXSPROC)
2697@@ -451,7 +459,6 @@
2698
2699 END
2700
2701-
2702 C -----------------------------------------
2703 C Subroutine to map three positive integers
2704 C I, J and K with upper bounds J_bound and
2705
2706=== modified file 'madgraph/loop/loop_base_objects.py'
2707--- madgraph/loop/loop_base_objects.py 2017-03-27 08:37:47 +0000
2708+++ madgraph/loop/loop_base_objects.py 2020-01-09 23:16:36 +0000
2709@@ -1545,7 +1545,8 @@
2710 def get_sorted_keys(self):
2711 """Return process property names as a nicely sorted list."""
2712
2713- return ['id', 'number', 'state', 'from_group','loop_line','depth']
2714+ return ['id', 'number', 'state', 'from_group','loop_line','depth',
2715+ 'polarization']
2716
2717 def convert_to_leg(self):
2718 """ Converts a DGLoopLeg back to a Leg. Basically removes the extra
2719@@ -1555,6 +1556,7 @@
2720 for key in aleg.get_sorted_keys():
2721 aleg.set(key,self[key])
2722
2723+
2724 return aleg
2725
2726 #===============================================================================
2727
2728=== modified file 'madgraph/various/banner.py'
2729--- madgraph/various/banner.py 2019-12-04 21:34:25 +0000
2730+++ madgraph/various/banner.py 2020-01-09 23:16:36 +0000
2731@@ -2624,7 +2624,7 @@
2732 continue
2733 else:
2734 pathinc = incname
2735-
2736+
2737 fsock = file_writers.FortranWriter(pjoin(output_dir,pathinc))
2738 for key in self.includepath[incname]:
2739 #define the fortran name
2740@@ -2794,8 +2794,20 @@
2741 %(e_max_pdg)s = e_max_pdg ! E cut for other particles (syntax e.g. {6: 100, 25: 50})
2742 """,
2743 template_off= '#\n# For display option for energy cut in the partonic center of mass frame type \'update ecut\'\n#'),
2744- ]
2745-
2746+
2747+
2748+# Frame for polarization
2749+ runblock(name='frame', fields=('me_frame'),
2750+ template_on=\
2751+"""#*********************************************************************
2752+# Frame where to evaluate the matrix-element (not the cut!) for polarization
2753+#*********************************************************************
2754+ %(me_frame)s = me_frame ! list of particles to sum-up to define the rest-frame
2755+ ! in which to evaluate the matrix-element
2756+ ! [1,2] means the partonic center of mass
2757+""",
2758+ template_off= ''),
2759+ ]
2760
2761 def default_setup(self):
2762 """default value for the run_card.dat"""
2763@@ -2857,6 +2869,8 @@
2764 self.add_param("clusinfo", True)
2765 self.add_param("lhe_version", 3.0)
2766 self.add_param("boost_event", "False", hidden=True, include=False, comment="allow to boost the full event. The boost put at rest the sume of 4-momenta of the particle selected by the filter defined here. example going to the higgs rest frame: lambda p: p.pid==25")
2767+ self.add_param("me_frame", [1,2], hidden=True, include=False, comment="choose lorentz frame where to evaluate matrix-element [for non lorentz invariant matrix-element/polarization]:\n - 0: partonic center of mass\n - 1: Multi boson frame\n - 2 : (multi) scalar frame\n - 3 : user custom")
2768+ self.add_param('frame_id', 6, system=True)
2769 self.add_param("event_norm", "average", allowed=['sum','average', 'unity'],
2770 include=False, sys_default='sum')
2771 #cut
2772@@ -3119,6 +3133,9 @@
2773
2774 def update_system_parameter_for_include(self):
2775
2776+ # polarization
2777+ self['frame_id'] = sum(2**(n) for n in self['me_frame'])
2778+
2779 # set the pdg_for_cut fortran parameter
2780 pdg_to_cut = set(self['pt_min_pdg'].keys() +self['pt_max_pdg'].keys() +
2781 self['e_min_pdg'].keys() +self['e_max_pdg'].keys() +
2782@@ -3280,6 +3297,24 @@
2783 if no_systematics:
2784 self['use_syst'] = False
2785 self['systematics_program'] = 'none'
2786+
2787+ # if polarization is used, set the choice of the frame in the run_card
2788+ # But only if polarization is used for massive particles
2789+ for plist in proc_def:
2790+ for proc in plist:
2791+ for l in proc.get('legs') + proc.get('legs_with_decays'):
2792+ if l.get('polarization'):
2793+ model = proc.get('model')
2794+ particle = model.get_particle(l.get('id'))
2795+ if particle.get('mass').lower() != 'zero':
2796+ self.display_block.append('frame')
2797+ break
2798+ else:
2799+ continue
2800+ break
2801+ else:
2802+ continue
2803+ break
2804
2805 if 'MLM' in proc_characteristic['limitations']:
2806 if self['dynamical_scale_choice'] == -1:
2807
2808=== modified file 'madgraph/various/lhe_parser.py'
2809--- madgraph/various/lhe_parser.py 2019-11-16 12:01:49 +0000
2810+++ madgraph/various/lhe_parser.py 2020-01-09 23:16:36 +0000
2811@@ -1734,11 +1734,14 @@
2812 """modify the current event to boost it according to the current filter"""
2813 if filter is None:
2814 filter = lambda p: p.status==-1
2815-
2816- pboost = FourMomentum()
2817- for p in self:
2818- if filter(p):
2819- pboost += p
2820+
2821+ if not isinstance(filter, FourMomentum):
2822+ pboost = FourMomentum()
2823+ for p in self:
2824+ if filter(p):
2825+ pboost += p
2826+ else:
2827+ pboost = FourMomentum(pboost)
2828
2829 # change sign of three-component due to helas convention
2830 pboost.px *=-1
2831
2832=== modified file 'madgraph/various/misc.py'
2833--- madgraph/various/misc.py 2019-11-24 19:59:28 +0000
2834+++ madgraph/various/misc.py 2020-01-09 23:16:36 +0000
2835@@ -611,6 +611,8 @@
2836 else:
2837 return True
2838
2839+
2840+
2841 #===============================================================================
2842 # mute_logger (designed to work as with statement)
2843 #===============================================================================
2844
2845=== modified file 'madgraph/various/process_checks.py'
2846--- madgraph/various/process_checks.py 2016-08-23 00:33:58 +0000
2847+++ madgraph/various/process_checks.py 2020-01-09 23:16:36 +0000
2848@@ -734,7 +734,7 @@
2849
2850 # If directory doesn't exist, skip and return 0
2851 if not shell_name:
2852- logging.info("Directory hasn't been created for process %s" %proc)
2853+ logging.info("Directory hasn't been created for process %s: %s", proc, directories)
2854 return ((0.0, 0.0, 0.0, 0.0, 0), [])
2855
2856 if verbose: logging.debug("Working on process %s in dir %s" % (proc, shell_name))
2857
2858=== modified file 'models/import_ufo.py'
2859--- models/import_ufo.py 2019-06-20 08:57:47 +0000
2860+++ models/import_ufo.py 2020-01-09 23:16:36 +0000
2861@@ -812,10 +812,13 @@
2862 particle.set('line', value)
2863 elif key == 'propagator':
2864 if value:
2865- if aloha.unitary_gauge:
2866- particle.set(key, str(value[0]))
2867- else:
2868- particle.set(key, str(value[1]))
2869+ if isinstance(value, (list,dict)):
2870+ if aloha.unitary_gauge:
2871+ particle.set(key, str(value[0]))
2872+ else:
2873+ particle.set(key, str(value[1]))
2874+ else:
2875+ particle.set(key, str(value))
2876 else:
2877 particle.set(key, '')
2878 else:
2879
2880=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f'
2881--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f 2017-06-02 12:16:50 +0000
2882+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f 2020-01-09 23:16:36 +0000
2883@@ -27,6 +27,7 @@
2884 C
2885 REAL*8 P1(0:3,NEXTERNAL-1)
2886 COMPLEX*16 ANS(2)
2887+
2888 C
2889 C LOCAL VARIABLES
2890 C
2891@@ -36,6 +37,8 @@
2892 INTEGER NTRY(1)
2893 DATA NTRY /1*0/
2894 INTEGER NHEL(NEXTERNAL-1,NCOMB)
2895+ REAL*8 T_SAVE(NCOMB,2)
2896+ REAL*8 T_SUM(2)
2897 DATA (NHEL(I, 1),I=1,4) /-1,-1,-1, 1/
2898 DATA (NHEL(I, 2),I=1,4) /-1,-1,-1,-1/
2899 DATA (NHEL(I, 3),I=1,4) /-1,-1, 1, 1/
2900@@ -125,6 +128,8 @@
2901 ANS(1) = 0D0
2902 ANS(2) = 0D0
2903 HEL_FAC=1D0
2904+ T_SUM(1) = 0D0
2905+ T_SUM(2) = 0D0
2906 DO IHEL=1,NCOMB
2907 ! the following lines are to avoid segfaults when glu_ij=0
2908 COND_IJ=SKIP(NFKSPROCESS).EQ.0
2909@@ -135,19 +140,33 @@
2910 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
2911 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
2912 $ 2) ) THEN
2913- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
2914- ANS(2)=ANS(2)+BORNTILDE
2915- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
2916- $ ) THEN
2917- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
2918- ENDIF
2919- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
2920- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
2921- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
2922- ENDIF
2923+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
2924+ $ ,BORNS)
2925+ ANS(2)=ANS(2)+ BORNTILDE
2926+ T_SAVE(IHEL,1) = BORNS(1)
2927+ T_SAVE(IHEL,2) = BORNS(2)
2928+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
2929+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
2930 ENDIF
2931+ ELSE
2932+ T_SAVE(IHEL,1) = 0D0
2933+ T_SAVE(IHEL,2) = 0D0
2934 ENDIF
2935 ENDDO
2936+
2937+ IF(NTRY(NFKSPROCESS).LT.2) THEN
2938+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
2939+ DO IHEL=1,NCOMB
2940+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
2941+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
2942+ ENDIF
2943+
2944+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
2945+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
2946+ ENDIF
2947+ ENDDO
2948+ ENDIF
2949+
2950 ANS(1)=ANS(1)/DBLE(IDEN)
2951 ANS(2)=ANS(2)/DBLE(IDEN)
2952 WGT_ME_BORN=DBLE(ANS(1))
2953
2954=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%born.f'
2955--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%born.f 2017-06-02 12:16:50 +0000
2956+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uux_ttx%born.f 2020-01-09 23:16:36 +0000
2957@@ -30,6 +30,7 @@
2958 C
2959 REAL*8 P1(0:3,NEXTERNAL-1)
2960 COMPLEX*16 ANS(2)
2961+
2962 C
2963 C LOCAL VARIABLES
2964 C
2965@@ -39,6 +40,8 @@
2966 INTEGER NTRY(1)
2967 DATA NTRY /1*0/
2968 INTEGER NHEL(NEXTERNAL-1,NCOMB)
2969+ REAL*8 T_SAVE(NCOMB,2)
2970+ REAL*8 T_SUM(2)
2971 DATA (NHEL(I, 1),I=1,4) / 1,-1,-1, 1/
2972 DATA (NHEL(I, 2),I=1,4) / 1,-1,-1,-1/
2973 DATA (NHEL(I, 3),I=1,4) / 1,-1, 1, 1/
2974@@ -128,6 +131,8 @@
2975 ANS(1) = 0D0
2976 ANS(2) = 0D0
2977 HEL_FAC=1D0
2978+ T_SUM(1) = 0D0
2979+ T_SUM(2) = 0D0
2980 DO IHEL=1,NCOMB
2981 ! the following lines are to avoid segfaults when glu_ij=0
2982 COND_IJ=SKIP(NFKSPROCESS).EQ.0
2983@@ -138,19 +143,33 @@
2984 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
2985 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
2986 $ 2) ) THEN
2987- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
2988- ANS(2)=ANS(2)+BORNTILDE
2989- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
2990- $ ) THEN
2991- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
2992- ENDIF
2993- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
2994- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
2995- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
2996- ENDIF
2997+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
2998+ $ ,BORNS)
2999+ ANS(2)=ANS(2)+ BORNTILDE
3000+ T_SAVE(IHEL,1) = BORNS(1)
3001+ T_SAVE(IHEL,2) = BORNS(2)
3002+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3003+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3004 ENDIF
3005+ ELSE
3006+ T_SAVE(IHEL,1) = 0D0
3007+ T_SAVE(IHEL,2) = 0D0
3008 ENDIF
3009 ENDDO
3010+
3011+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3012+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3013+ DO IHEL=1,NCOMB
3014+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3015+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3016+ ENDIF
3017+
3018+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3019+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3020+ ENDIF
3021+ ENDDO
3022+ ENDIF
3023+
3024 ANS(1)=ANS(1)/DBLE(IDEN)
3025 ANS(2)=ANS(2)/DBLE(IDEN)
3026 WGT_ME_BORN=DBLE(ANS(1))
3027
3028=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%born.f'
3029--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%born.f 2017-06-02 12:16:50 +0000
3030+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_uxu_ttx%born.f 2020-01-09 23:16:36 +0000
3031@@ -30,6 +30,7 @@
3032 C
3033 REAL*8 P1(0:3,NEXTERNAL-1)
3034 COMPLEX*16 ANS(2)
3035+
3036 C
3037 C LOCAL VARIABLES
3038 C
3039@@ -39,6 +40,8 @@
3040 INTEGER NTRY(1)
3041 DATA NTRY /1*0/
3042 INTEGER NHEL(NEXTERNAL-1,NCOMB)
3043+ REAL*8 T_SAVE(NCOMB,2)
3044+ REAL*8 T_SUM(2)
3045 DATA (NHEL(I, 1),I=1,4) /-1, 1,-1, 1/
3046 DATA (NHEL(I, 2),I=1,4) /-1, 1,-1,-1/
3047 DATA (NHEL(I, 3),I=1,4) /-1, 1, 1, 1/
3048@@ -128,6 +131,8 @@
3049 ANS(1) = 0D0
3050 ANS(2) = 0D0
3051 HEL_FAC=1D0
3052+ T_SUM(1) = 0D0
3053+ T_SUM(2) = 0D0
3054 DO IHEL=1,NCOMB
3055 ! the following lines are to avoid segfaults when glu_ij=0
3056 COND_IJ=SKIP(NFKSPROCESS).EQ.0
3057@@ -138,19 +143,33 @@
3058 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
3059 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
3060 $ 2) ) THEN
3061- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
3062- ANS(2)=ANS(2)+BORNTILDE
3063- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
3064- $ ) THEN
3065- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3066- ENDIF
3067- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
3068- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
3069- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3070- ENDIF
3071+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
3072+ $ ,BORNS)
3073+ ANS(2)=ANS(2)+ BORNTILDE
3074+ T_SAVE(IHEL,1) = BORNS(1)
3075+ T_SAVE(IHEL,2) = BORNS(2)
3076+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3077+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3078 ENDIF
3079+ ELSE
3080+ T_SAVE(IHEL,1) = 0D0
3081+ T_SAVE(IHEL,2) = 0D0
3082 ENDIF
3083 ENDDO
3084+
3085+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3086+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3087+ DO IHEL=1,NCOMB
3088+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3089+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3090+ ENDIF
3091+
3092+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3093+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3094+ ENDIF
3095+ ENDDO
3096+ ENDIF
3097+
3098 ANS(1)=ANS(1)/DBLE(IDEN)
3099 ANS(2)=ANS(2)/DBLE(IDEN)
3100 WGT_ME_BORN=DBLE(ANS(1))
3101
3102=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f'
3103--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f 2017-06-02 12:16:50 +0000
3104+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f 2020-01-09 23:16:36 +0000
3105@@ -27,6 +27,7 @@
3106 C
3107 REAL*8 P1(0:3,NEXTERNAL-1)
3108 COMPLEX*16 ANS(2)
3109+
3110 C
3111 C LOCAL VARIABLES
3112 C
3113@@ -36,6 +37,8 @@
3114 INTEGER NTRY(8)
3115 DATA NTRY /8*0/
3116 INTEGER NHEL(NEXTERNAL-1,NCOMB)
3117+ REAL*8 T_SAVE(NCOMB,2)
3118+ REAL*8 T_SUM(2)
3119 DATA (NHEL(I, 1),I=1,4) /-1,-1,-1, 1/
3120 DATA (NHEL(I, 2),I=1,4) /-1,-1,-1,-1/
3121 DATA (NHEL(I, 3),I=1,4) /-1,-1, 1, 1/
3122@@ -125,6 +128,8 @@
3123 ANS(1) = 0D0
3124 ANS(2) = 0D0
3125 HEL_FAC=1D0
3126+ T_SUM(1) = 0D0
3127+ T_SUM(2) = 0D0
3128 DO IHEL=1,NCOMB
3129 ! the following lines are to avoid segfaults when glu_ij=0
3130 COND_IJ=SKIP(NFKSPROCESS).EQ.0
3131@@ -135,19 +140,33 @@
3132 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
3133 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
3134 $ 2) ) THEN
3135- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
3136- ANS(2)=ANS(2)+BORNTILDE
3137- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
3138- $ ) THEN
3139- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3140- ENDIF
3141- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
3142- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
3143- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3144- ENDIF
3145+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
3146+ $ ,BORNS)
3147+ ANS(2)=ANS(2)+ BORNTILDE
3148+ T_SAVE(IHEL,1) = BORNS(1)
3149+ T_SAVE(IHEL,2) = BORNS(2)
3150+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3151+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3152 ENDIF
3153+ ELSE
3154+ T_SAVE(IHEL,1) = 0D0
3155+ T_SAVE(IHEL,2) = 0D0
3156 ENDIF
3157 ENDDO
3158+
3159+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3160+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3161+ DO IHEL=1,NCOMB
3162+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3163+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3164+ ENDIF
3165+
3166+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3167+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3168+ ENDIF
3169+ ENDDO
3170+ ENDIF
3171+
3172 ANS(1)=ANS(1)/DBLE(IDEN)
3173 ANS(2)=ANS(2)/DBLE(IDEN)
3174 WGT_ME_BORN=DBLE(ANS(1))
3175
3176=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f'
3177--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f 2016-02-27 14:33:01 +0000
3178+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f 2020-01-09 23:16:36 +0000
3179@@ -74,8 +74,8 @@
3180 NTRY=NTRY+1
3181 ANS = 0D0
3182 DO IHEL=1,NCOMB
3183- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3184- IF (NTRY.LT.2) THEN
3185+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3186+ IF (NTRY.LT.10) THEN
3187 C for the first ps-point, check for helicities that give
3188 C identical matrix elements
3189 T=MATRIX_1(P ,NHEL(1,IHEL))
3190@@ -101,11 +101,18 @@
3191 ENDIF
3192 C add to the sum of helicities
3193 ANS=ANS+T
3194- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3195- GOODHEL(IHEL)=.TRUE.
3196- ENDIF
3197 ENDIF
3198 ENDDO
3199+
3200+ IF ( NTRY .LT. 10) THEN
3201+ DO IHEL=1,NCOMB
3202+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3203+ $ /NCOMB)) THEN
3204+ GOODHEL(IHEL) = .TRUE.
3205+ ENDIF
3206+ ENDDO
3207+ ENDIF
3208+
3209 ANS=ANS/DBLE(IDEN)
3210 WGT_ME_REAL=ANS
3211 END
3212
3213=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f'
3214--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f 2016-02-27 14:33:01 +0000
3215+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f 2020-01-09 23:16:36 +0000
3216@@ -77,8 +77,8 @@
3217 NTRY=NTRY+1
3218 ANS = 0D0
3219 DO IHEL=1,NCOMB
3220- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3221- IF (NTRY.LT.2) THEN
3222+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3223+ IF (NTRY.LT.10) THEN
3224 C for the first ps-point, check for helicities that give
3225 C identical matrix elements
3226 T=MATRIX_2(P ,NHEL(1,IHEL))
3227@@ -104,11 +104,18 @@
3228 ENDIF
3229 C add to the sum of helicities
3230 ANS=ANS+T
3231- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3232- GOODHEL(IHEL)=.TRUE.
3233- ENDIF
3234 ENDIF
3235 ENDDO
3236+
3237+ IF ( NTRY .LT. 10) THEN
3238+ DO IHEL=1,NCOMB
3239+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3240+ $ /NCOMB)) THEN
3241+ GOODHEL(IHEL) = .TRUE.
3242+ ENDIF
3243+ ENDDO
3244+ ENDIF
3245+
3246 ANS=ANS/DBLE(IDEN)
3247 WGT_ME_REAL=ANS
3248 END
3249
3250=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f'
3251--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f 2016-02-27 14:33:01 +0000
3252+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f 2020-01-09 23:16:36 +0000
3253@@ -77,8 +77,8 @@
3254 NTRY=NTRY+1
3255 ANS = 0D0
3256 DO IHEL=1,NCOMB
3257- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3258- IF (NTRY.LT.2) THEN
3259+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3260+ IF (NTRY.LT.10) THEN
3261 C for the first ps-point, check for helicities that give
3262 C identical matrix elements
3263 T=MATRIX_3(P ,NHEL(1,IHEL))
3264@@ -104,11 +104,18 @@
3265 ENDIF
3266 C add to the sum of helicities
3267 ANS=ANS+T
3268- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3269- GOODHEL(IHEL)=.TRUE.
3270- ENDIF
3271 ENDIF
3272 ENDDO
3273+
3274+ IF ( NTRY .LT. 10) THEN
3275+ DO IHEL=1,NCOMB
3276+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3277+ $ /NCOMB)) THEN
3278+ GOODHEL(IHEL) = .TRUE.
3279+ ENDIF
3280+ ENDDO
3281+ ENDIF
3282+
3283 ANS=ANS/DBLE(IDEN)
3284 WGT_ME_REAL=ANS
3285 END
3286
3287=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f'
3288--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f 2016-02-27 14:33:01 +0000
3289+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f 2020-01-09 23:16:36 +0000
3290@@ -77,8 +77,8 @@
3291 NTRY=NTRY+1
3292 ANS = 0D0
3293 DO IHEL=1,NCOMB
3294- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3295- IF (NTRY.LT.2) THEN
3296+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3297+ IF (NTRY.LT.10) THEN
3298 C for the first ps-point, check for helicities that give
3299 C identical matrix elements
3300 T=MATRIX_4(P ,NHEL(1,IHEL))
3301@@ -104,11 +104,18 @@
3302 ENDIF
3303 C add to the sum of helicities
3304 ANS=ANS+T
3305- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3306- GOODHEL(IHEL)=.TRUE.
3307- ENDIF
3308 ENDIF
3309 ENDDO
3310+
3311+ IF ( NTRY .LT. 10) THEN
3312+ DO IHEL=1,NCOMB
3313+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3314+ $ /NCOMB)) THEN
3315+ GOODHEL(IHEL) = .TRUE.
3316+ ENDIF
3317+ ENDDO
3318+ ENDIF
3319+
3320 ANS=ANS/DBLE(IDEN)
3321 WGT_ME_REAL=ANS
3322 END
3323
3324=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f'
3325--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f 2016-02-27 14:33:01 +0000
3326+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f 2020-01-09 23:16:36 +0000
3327@@ -77,8 +77,8 @@
3328 NTRY=NTRY+1
3329 ANS = 0D0
3330 DO IHEL=1,NCOMB
3331- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3332- IF (NTRY.LT.2) THEN
3333+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3334+ IF (NTRY.LT.10) THEN
3335 C for the first ps-point, check for helicities that give
3336 C identical matrix elements
3337 T=MATRIX_5(P ,NHEL(1,IHEL))
3338@@ -104,11 +104,18 @@
3339 ENDIF
3340 C add to the sum of helicities
3341 ANS=ANS+T
3342- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3343- GOODHEL(IHEL)=.TRUE.
3344- ENDIF
3345 ENDIF
3346 ENDDO
3347+
3348+ IF ( NTRY .LT. 10) THEN
3349+ DO IHEL=1,NCOMB
3350+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3351+ $ /NCOMB)) THEN
3352+ GOODHEL(IHEL) = .TRUE.
3353+ ENDIF
3354+ ENDDO
3355+ ENDIF
3356+
3357 ANS=ANS/DBLE(IDEN)
3358 WGT_ME_REAL=ANS
3359 END
3360
3361=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%born.f'
3362--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%born.f 2017-06-02 12:16:50 +0000
3363+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%born.f 2020-01-09 23:16:36 +0000
3364@@ -30,6 +30,7 @@
3365 C
3366 REAL*8 P1(0:3,NEXTERNAL-1)
3367 COMPLEX*16 ANS(2)
3368+
3369 C
3370 C LOCAL VARIABLES
3371 C
3372@@ -39,6 +40,8 @@
3373 INTEGER NTRY(6)
3374 DATA NTRY /6*0/
3375 INTEGER NHEL(NEXTERNAL-1,NCOMB)
3376+ REAL*8 T_SAVE(NCOMB,2)
3377+ REAL*8 T_SUM(2)
3378 DATA (NHEL(I, 1),I=1,4) / 1,-1,-1, 1/
3379 DATA (NHEL(I, 2),I=1,4) / 1,-1,-1,-1/
3380 DATA (NHEL(I, 3),I=1,4) / 1,-1, 1, 1/
3381@@ -128,6 +131,8 @@
3382 ANS(1) = 0D0
3383 ANS(2) = 0D0
3384 HEL_FAC=1D0
3385+ T_SUM(1) = 0D0
3386+ T_SUM(2) = 0D0
3387 DO IHEL=1,NCOMB
3388 ! the following lines are to avoid segfaults when glu_ij=0
3389 COND_IJ=SKIP(NFKSPROCESS).EQ.0
3390@@ -138,19 +143,33 @@
3391 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
3392 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
3393 $ 2) ) THEN
3394- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
3395- ANS(2)=ANS(2)+BORNTILDE
3396- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
3397- $ ) THEN
3398- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3399- ENDIF
3400- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
3401- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
3402- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3403- ENDIF
3404+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
3405+ $ ,BORNS)
3406+ ANS(2)=ANS(2)+ BORNTILDE
3407+ T_SAVE(IHEL,1) = BORNS(1)
3408+ T_SAVE(IHEL,2) = BORNS(2)
3409+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3410+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3411 ENDIF
3412+ ELSE
3413+ T_SAVE(IHEL,1) = 0D0
3414+ T_SAVE(IHEL,2) = 0D0
3415 ENDIF
3416 ENDDO
3417+
3418+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3419+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3420+ DO IHEL=1,NCOMB
3421+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3422+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3423+ ENDIF
3424+
3425+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3426+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3427+ ENDIF
3428+ ENDDO
3429+ ENDIF
3430+
3431 ANS(1)=ANS(1)/DBLE(IDEN)
3432 ANS(2)=ANS(2)/DBLE(IDEN)
3433 WGT_ME_BORN=DBLE(ANS(1))
3434
3435=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f'
3436--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f 2016-02-27 14:33:01 +0000
3437+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f 2020-01-09 23:16:36 +0000
3438@@ -77,8 +77,8 @@
3439 NTRY=NTRY+1
3440 ANS = 0D0
3441 DO IHEL=1,NCOMB
3442- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3443- IF (NTRY.LT.2) THEN
3444+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3445+ IF (NTRY.LT.10) THEN
3446 C for the first ps-point, check for helicities that give
3447 C identical matrix elements
3448 T=MATRIX_1(P ,NHEL(1,IHEL))
3449@@ -104,11 +104,18 @@
3450 ENDIF
3451 C add to the sum of helicities
3452 ANS=ANS+T
3453- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3454- GOODHEL(IHEL)=.TRUE.
3455- ENDIF
3456 ENDIF
3457 ENDDO
3458+
3459+ IF ( NTRY .LT. 10) THEN
3460+ DO IHEL=1,NCOMB
3461+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3462+ $ /NCOMB)) THEN
3463+ GOODHEL(IHEL) = .TRUE.
3464+ ENDIF
3465+ ENDDO
3466+ ENDIF
3467+
3468 ANS=ANS/DBLE(IDEN)
3469 WGT_ME_REAL=ANS
3470 END
3471
3472=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f'
3473--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f 2016-02-27 14:33:01 +0000
3474+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f 2020-01-09 23:16:36 +0000
3475@@ -77,8 +77,8 @@
3476 NTRY=NTRY+1
3477 ANS = 0D0
3478 DO IHEL=1,NCOMB
3479- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3480- IF (NTRY.LT.2) THEN
3481+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3482+ IF (NTRY.LT.10) THEN
3483 C for the first ps-point, check for helicities that give
3484 C identical matrix elements
3485 T=MATRIX_2(P ,NHEL(1,IHEL))
3486@@ -104,11 +104,18 @@
3487 ENDIF
3488 C add to the sum of helicities
3489 ANS=ANS+T
3490- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3491- GOODHEL(IHEL)=.TRUE.
3492- ENDIF
3493 ENDIF
3494 ENDDO
3495+
3496+ IF ( NTRY .LT. 10) THEN
3497+ DO IHEL=1,NCOMB
3498+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3499+ $ /NCOMB)) THEN
3500+ GOODHEL(IHEL) = .TRUE.
3501+ ENDIF
3502+ ENDDO
3503+ ENDIF
3504+
3505 ANS=ANS/DBLE(IDEN)
3506 WGT_ME_REAL=ANS
3507 END
3508
3509=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f'
3510--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f 2016-02-27 14:33:01 +0000
3511+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f 2020-01-09 23:16:36 +0000
3512@@ -77,8 +77,8 @@
3513 NTRY=NTRY+1
3514 ANS = 0D0
3515 DO IHEL=1,NCOMB
3516- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3517- IF (NTRY.LT.2) THEN
3518+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3519+ IF (NTRY.LT.10) THEN
3520 C for the first ps-point, check for helicities that give
3521 C identical matrix elements
3522 T=MATRIX_3(P ,NHEL(1,IHEL))
3523@@ -104,11 +104,18 @@
3524 ENDIF
3525 C add to the sum of helicities
3526 ANS=ANS+T
3527- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3528- GOODHEL(IHEL)=.TRUE.
3529- ENDIF
3530 ENDIF
3531 ENDDO
3532+
3533+ IF ( NTRY .LT. 10) THEN
3534+ DO IHEL=1,NCOMB
3535+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3536+ $ /NCOMB)) THEN
3537+ GOODHEL(IHEL) = .TRUE.
3538+ ENDIF
3539+ ENDDO
3540+ ENDIF
3541+
3542 ANS=ANS/DBLE(IDEN)
3543 WGT_ME_REAL=ANS
3544 END
3545
3546=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%born.f'
3547--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%born.f 2017-06-02 12:16:50 +0000
3548+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%born.f 2020-01-09 23:16:36 +0000
3549@@ -30,6 +30,7 @@
3550 C
3551 REAL*8 P1(0:3,NEXTERNAL-1)
3552 COMPLEX*16 ANS(2)
3553+
3554 C
3555 C LOCAL VARIABLES
3556 C
3557@@ -39,6 +40,8 @@
3558 INTEGER NTRY(6)
3559 DATA NTRY /6*0/
3560 INTEGER NHEL(NEXTERNAL-1,NCOMB)
3561+ REAL*8 T_SAVE(NCOMB,2)
3562+ REAL*8 T_SUM(2)
3563 DATA (NHEL(I, 1),I=1,4) /-1, 1,-1, 1/
3564 DATA (NHEL(I, 2),I=1,4) /-1, 1,-1,-1/
3565 DATA (NHEL(I, 3),I=1,4) /-1, 1, 1, 1/
3566@@ -128,6 +131,8 @@
3567 ANS(1) = 0D0
3568 ANS(2) = 0D0
3569 HEL_FAC=1D0
3570+ T_SUM(1) = 0D0
3571+ T_SUM(2) = 0D0
3572 DO IHEL=1,NCOMB
3573 ! the following lines are to avoid segfaults when glu_ij=0
3574 COND_IJ=SKIP(NFKSPROCESS).EQ.0
3575@@ -138,19 +143,33 @@
3576 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
3577 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
3578 $ 2) ) THEN
3579- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
3580- ANS(2)=ANS(2)+BORNTILDE
3581- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
3582- $ ) THEN
3583- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3584- ENDIF
3585- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
3586- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
3587- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3588- ENDIF
3589+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
3590+ $ ,BORNS)
3591+ ANS(2)=ANS(2)+ BORNTILDE
3592+ T_SAVE(IHEL,1) = BORNS(1)
3593+ T_SAVE(IHEL,2) = BORNS(2)
3594+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3595+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3596 ENDIF
3597+ ELSE
3598+ T_SAVE(IHEL,1) = 0D0
3599+ T_SAVE(IHEL,2) = 0D0
3600 ENDIF
3601 ENDDO
3602+
3603+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3604+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3605+ DO IHEL=1,NCOMB
3606+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3607+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3608+ ENDIF
3609+
3610+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3611+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3612+ ENDIF
3613+ ENDDO
3614+ ENDIF
3615+
3616 ANS(1)=ANS(1)/DBLE(IDEN)
3617 ANS(2)=ANS(2)/DBLE(IDEN)
3618 WGT_ME_BORN=DBLE(ANS(1))
3619
3620=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f'
3621--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f 2016-02-27 14:33:01 +0000
3622+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f 2020-01-09 23:16:36 +0000
3623@@ -77,8 +77,8 @@
3624 NTRY=NTRY+1
3625 ANS = 0D0
3626 DO IHEL=1,NCOMB
3627- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3628- IF (NTRY.LT.2) THEN
3629+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3630+ IF (NTRY.LT.10) THEN
3631 C for the first ps-point, check for helicities that give
3632 C identical matrix elements
3633 T=MATRIX_1(P ,NHEL(1,IHEL))
3634@@ -104,11 +104,18 @@
3635 ENDIF
3636 C add to the sum of helicities
3637 ANS=ANS+T
3638- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3639- GOODHEL(IHEL)=.TRUE.
3640- ENDIF
3641 ENDIF
3642 ENDDO
3643+
3644+ IF ( NTRY .LT. 10) THEN
3645+ DO IHEL=1,NCOMB
3646+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3647+ $ /NCOMB)) THEN
3648+ GOODHEL(IHEL) = .TRUE.
3649+ ENDIF
3650+ ENDDO
3651+ ENDIF
3652+
3653 ANS=ANS/DBLE(IDEN)
3654 WGT_ME_REAL=ANS
3655 END
3656
3657=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f'
3658--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f 2016-02-27 14:33:01 +0000
3659+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f 2020-01-09 23:16:36 +0000
3660@@ -77,8 +77,8 @@
3661 NTRY=NTRY+1
3662 ANS = 0D0
3663 DO IHEL=1,NCOMB
3664- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3665- IF (NTRY.LT.2) THEN
3666+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3667+ IF (NTRY.LT.10) THEN
3668 C for the first ps-point, check for helicities that give
3669 C identical matrix elements
3670 T=MATRIX_2(P ,NHEL(1,IHEL))
3671@@ -104,11 +104,18 @@
3672 ENDIF
3673 C add to the sum of helicities
3674 ANS=ANS+T
3675- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3676- GOODHEL(IHEL)=.TRUE.
3677- ENDIF
3678 ENDIF
3679 ENDDO
3680+
3681+ IF ( NTRY .LT. 10) THEN
3682+ DO IHEL=1,NCOMB
3683+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3684+ $ /NCOMB)) THEN
3685+ GOODHEL(IHEL) = .TRUE.
3686+ ENDIF
3687+ ENDDO
3688+ ENDIF
3689+
3690 ANS=ANS/DBLE(IDEN)
3691 WGT_ME_REAL=ANS
3692 END
3693
3694=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f'
3695--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f 2016-02-27 14:33:01 +0000
3696+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f 2020-01-09 23:16:36 +0000
3697@@ -77,8 +77,8 @@
3698 NTRY=NTRY+1
3699 ANS = 0D0
3700 DO IHEL=1,NCOMB
3701- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3702- IF (NTRY.LT.2) THEN
3703+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3704+ IF (NTRY.LT.10) THEN
3705 C for the first ps-point, check for helicities that give
3706 C identical matrix elements
3707 T=MATRIX_3(P ,NHEL(1,IHEL))
3708@@ -104,11 +104,18 @@
3709 ENDIF
3710 C add to the sum of helicities
3711 ANS=ANS+T
3712- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3713- GOODHEL(IHEL)=.TRUE.
3714- ENDIF
3715 ENDIF
3716 ENDDO
3717+
3718+ IF ( NTRY .LT. 10) THEN
3719+ DO IHEL=1,NCOMB
3720+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3721+ $ /NCOMB)) THEN
3722+ GOODHEL(IHEL) = .TRUE.
3723+ ENDIF
3724+ ENDDO
3725+ ENDIF
3726+
3727 ANS=ANS/DBLE(IDEN)
3728 WGT_ME_REAL=ANS
3729 END
3730
3731=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%born.f'
3732--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%born.f 2017-06-02 12:16:50 +0000
3733+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%born.f 2020-01-09 23:16:36 +0000
3734@@ -28,6 +28,7 @@
3735 C
3736 REAL*8 P1(0:3,NEXTERNAL-1)
3737 COMPLEX*16 ANS(2)
3738+
3739 C
3740 C LOCAL VARIABLES
3741 C
3742@@ -37,6 +38,8 @@
3743 INTEGER NTRY(4)
3744 DATA NTRY /4*0/
3745 INTEGER NHEL(NEXTERNAL-1,NCOMB)
3746+ REAL*8 T_SAVE(NCOMB,2)
3747+ REAL*8 T_SUM(2)
3748 DATA (NHEL(I, 1),I=1,3) /-1, 1,-1/
3749 DATA (NHEL(I, 2),I=1,3) /-1, 1, 0/
3750 DATA (NHEL(I, 3),I=1,3) /-1, 1, 1/
3751@@ -122,6 +125,8 @@
3752 ANS(1) = 0D0
3753 ANS(2) = 0D0
3754 HEL_FAC=1D0
3755+ T_SUM(1) = 0D0
3756+ T_SUM(2) = 0D0
3757 DO IHEL=1,NCOMB
3758 ! the following lines are to avoid segfaults when glu_ij=0
3759 COND_IJ=SKIP(NFKSPROCESS).EQ.0
3760@@ -132,19 +137,33 @@
3761 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
3762 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
3763 $ 2) ) THEN
3764- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
3765- ANS(2)=ANS(2)+BORNTILDE
3766- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
3767- $ ) THEN
3768- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3769- ENDIF
3770- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
3771- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
3772- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3773- ENDIF
3774+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
3775+ $ ,BORNS)
3776+ ANS(2)=ANS(2)+ BORNTILDE
3777+ T_SAVE(IHEL,1) = BORNS(1)
3778+ T_SAVE(IHEL,2) = BORNS(2)
3779+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3780+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3781 ENDIF
3782+ ELSE
3783+ T_SAVE(IHEL,1) = 0D0
3784+ T_SAVE(IHEL,2) = 0D0
3785 ENDIF
3786 ENDDO
3787+
3788+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3789+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3790+ DO IHEL=1,NCOMB
3791+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3792+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3793+ ENDIF
3794+
3795+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3796+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3797+ ENDIF
3798+ ENDDO
3799+ ENDIF
3800+
3801 ANS(1)=ANS(1)/DBLE(IDEN)
3802 ANS(2)=ANS(2)/DBLE(IDEN)
3803 WGT_ME_BORN=DBLE(ANS(1))
3804
3805=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f'
3806--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f 2016-03-31 10:53:12 +0000
3807+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f 2020-01-09 23:16:36 +0000
3808@@ -67,8 +67,8 @@
3809 NTRY=NTRY+1
3810 ANS = 0D0
3811 DO IHEL=1,NCOMB
3812- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3813- IF (NTRY.LT.2) THEN
3814+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3815+ IF (NTRY.LT.10) THEN
3816 C for the first ps-point, check for helicities that give
3817 C identical matrix elements
3818 T=MATRIX_1(P ,NHEL(1,IHEL))
3819@@ -94,11 +94,18 @@
3820 ENDIF
3821 C add to the sum of helicities
3822 ANS=ANS+T
3823- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3824- GOODHEL(IHEL)=.TRUE.
3825- ENDIF
3826 ENDIF
3827 ENDDO
3828+
3829+ IF ( NTRY .LT. 10) THEN
3830+ DO IHEL=1,NCOMB
3831+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3832+ $ /NCOMB)) THEN
3833+ GOODHEL(IHEL) = .TRUE.
3834+ ENDIF
3835+ ENDDO
3836+ ENDIF
3837+
3838 ANS=ANS/DBLE(IDEN)
3839 WGT_ME_REAL=ANS
3840 END
3841
3842=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f'
3843--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f 2016-03-31 10:53:12 +0000
3844+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f 2020-01-09 23:16:36 +0000
3845@@ -67,8 +67,8 @@
3846 NTRY=NTRY+1
3847 ANS = 0D0
3848 DO IHEL=1,NCOMB
3849- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3850- IF (NTRY.LT.2) THEN
3851+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3852+ IF (NTRY.LT.10) THEN
3853 C for the first ps-point, check for helicities that give
3854 C identical matrix elements
3855 T=MATRIX_2(P ,NHEL(1,IHEL))
3856@@ -94,11 +94,18 @@
3857 ENDIF
3858 C add to the sum of helicities
3859 ANS=ANS+T
3860- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3861- GOODHEL(IHEL)=.TRUE.
3862- ENDIF
3863 ENDIF
3864 ENDDO
3865+
3866+ IF ( NTRY .LT. 10) THEN
3867+ DO IHEL=1,NCOMB
3868+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3869+ $ /NCOMB)) THEN
3870+ GOODHEL(IHEL) = .TRUE.
3871+ ENDIF
3872+ ENDDO
3873+ ENDIF
3874+
3875 ANS=ANS/DBLE(IDEN)
3876 WGT_ME_REAL=ANS
3877 END
3878
3879=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f'
3880--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f 2016-03-31 10:53:12 +0000
3881+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f 2020-01-09 23:16:36 +0000
3882@@ -67,8 +67,8 @@
3883 NTRY=NTRY+1
3884 ANS = 0D0
3885 DO IHEL=1,NCOMB
3886- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3887- IF (NTRY.LT.2) THEN
3888+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
3889+ IF (NTRY.LT.10) THEN
3890 C for the first ps-point, check for helicities that give
3891 C identical matrix elements
3892 T=MATRIX_3(P ,NHEL(1,IHEL))
3893@@ -94,11 +94,18 @@
3894 ENDIF
3895 C add to the sum of helicities
3896 ANS=ANS+T
3897- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
3898- GOODHEL(IHEL)=.TRUE.
3899- ENDIF
3900 ENDIF
3901 ENDDO
3902+
3903+ IF ( NTRY .LT. 10) THEN
3904+ DO IHEL=1,NCOMB
3905+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
3906+ $ /NCOMB)) THEN
3907+ GOODHEL(IHEL) = .TRUE.
3908+ ENDIF
3909+ ENDDO
3910+ ENDIF
3911+
3912 ANS=ANS/DBLE(IDEN)
3913 WGT_ME_REAL=ANS
3914 END
3915
3916=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%born.f'
3917--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%born.f 2017-06-02 12:16:50 +0000
3918+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%born.f 2020-01-09 23:16:36 +0000
3919@@ -28,6 +28,7 @@
3920 C
3921 REAL*8 P1(0:3,NEXTERNAL-1)
3922 COMPLEX*16 ANS(2)
3923+
3924 C
3925 C LOCAL VARIABLES
3926 C
3927@@ -37,6 +38,8 @@
3928 INTEGER NTRY(4)
3929 DATA NTRY /4*0/
3930 INTEGER NHEL(NEXTERNAL-1,NCOMB)
3931+ REAL*8 T_SAVE(NCOMB,2)
3932+ REAL*8 T_SUM(2)
3933 DATA (NHEL(I, 1),I=1,3) / 1,-1,-1/
3934 DATA (NHEL(I, 2),I=1,3) / 1,-1, 0/
3935 DATA (NHEL(I, 3),I=1,3) / 1,-1, 1/
3936@@ -122,6 +125,8 @@
3937 ANS(1) = 0D0
3938 ANS(2) = 0D0
3939 HEL_FAC=1D0
3940+ T_SUM(1) = 0D0
3941+ T_SUM(2) = 0D0
3942 DO IHEL=1,NCOMB
3943 ! the following lines are to avoid segfaults when glu_ij=0
3944 COND_IJ=SKIP(NFKSPROCESS).EQ.0
3945@@ -132,19 +137,33 @@
3946 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
3947 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
3948 $ 2) ) THEN
3949- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
3950- ANS(2)=ANS(2)+BORNTILDE
3951- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
3952- $ ) THEN
3953- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3954- ENDIF
3955- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
3956- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
3957- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3958- ENDIF
3959+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
3960+ $ ,BORNS)
3961+ ANS(2)=ANS(2)+ BORNTILDE
3962+ T_SAVE(IHEL,1) = BORNS(1)
3963+ T_SAVE(IHEL,2) = BORNS(2)
3964+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
3965+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
3966 ENDIF
3967+ ELSE
3968+ T_SAVE(IHEL,1) = 0D0
3969+ T_SAVE(IHEL,2) = 0D0
3970 ENDIF
3971 ENDDO
3972+
3973+ IF(NTRY(NFKSPROCESS).LT.2) THEN
3974+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
3975+ DO IHEL=1,NCOMB
3976+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
3977+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
3978+ ENDIF
3979+
3980+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
3981+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
3982+ ENDIF
3983+ ENDDO
3984+ ENDIF
3985+
3986 ANS(1)=ANS(1)/DBLE(IDEN)
3987 ANS(2)=ANS(2)/DBLE(IDEN)
3988 WGT_ME_BORN=DBLE(ANS(1))
3989
3990=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f'
3991--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f 2016-03-31 10:53:12 +0000
3992+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f 2020-01-09 23:16:36 +0000
3993@@ -67,8 +67,8 @@
3994 NTRY=NTRY+1
3995 ANS = 0D0
3996 DO IHEL=1,NCOMB
3997- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
3998- IF (NTRY.LT.2) THEN
3999+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
4000+ IF (NTRY.LT.10) THEN
4001 C for the first ps-point, check for helicities that give
4002 C identical matrix elements
4003 T=MATRIX_1(P ,NHEL(1,IHEL))
4004@@ -94,11 +94,18 @@
4005 ENDIF
4006 C add to the sum of helicities
4007 ANS=ANS+T
4008- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
4009- GOODHEL(IHEL)=.TRUE.
4010- ENDIF
4011 ENDIF
4012 ENDDO
4013+
4014+ IF ( NTRY .LT. 10) THEN
4015+ DO IHEL=1,NCOMB
4016+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
4017+ $ /NCOMB)) THEN
4018+ GOODHEL(IHEL) = .TRUE.
4019+ ENDIF
4020+ ENDDO
4021+ ENDIF
4022+
4023 ANS=ANS/DBLE(IDEN)
4024 WGT_ME_REAL=ANS
4025 END
4026
4027=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f'
4028--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f 2016-03-31 10:53:12 +0000
4029+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f 2020-01-09 23:16:36 +0000
4030@@ -67,8 +67,8 @@
4031 NTRY=NTRY+1
4032 ANS = 0D0
4033 DO IHEL=1,NCOMB
4034- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
4035- IF (NTRY.LT.2) THEN
4036+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
4037+ IF (NTRY.LT.10) THEN
4038 C for the first ps-point, check for helicities that give
4039 C identical matrix elements
4040 T=MATRIX_2(P ,NHEL(1,IHEL))
4041@@ -94,11 +94,18 @@
4042 ENDIF
4043 C add to the sum of helicities
4044 ANS=ANS+T
4045- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
4046- GOODHEL(IHEL)=.TRUE.
4047- ENDIF
4048 ENDIF
4049 ENDDO
4050+
4051+ IF ( NTRY .LT. 10) THEN
4052+ DO IHEL=1,NCOMB
4053+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
4054+ $ /NCOMB)) THEN
4055+ GOODHEL(IHEL) = .TRUE.
4056+ ENDIF
4057+ ENDDO
4058+ ENDIF
4059+
4060 ANS=ANS/DBLE(IDEN)
4061 WGT_ME_REAL=ANS
4062 END
4063
4064=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f'
4065--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f 2016-03-31 10:53:12 +0000
4066+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f 2020-01-09 23:16:36 +0000
4067@@ -67,8 +67,8 @@
4068 NTRY=NTRY+1
4069 ANS = 0D0
4070 DO IHEL=1,NCOMB
4071- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
4072- IF (NTRY.LT.2) THEN
4073+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
4074+ IF (NTRY.LT.10) THEN
4075 C for the first ps-point, check for helicities that give
4076 C identical matrix elements
4077 T=MATRIX_3(P ,NHEL(1,IHEL))
4078@@ -94,11 +94,18 @@
4079 ENDIF
4080 C add to the sum of helicities
4081 ANS=ANS+T
4082- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
4083- GOODHEL(IHEL)=.TRUE.
4084- ENDIF
4085 ENDIF
4086 ENDDO
4087+
4088+ IF ( NTRY .LT. 10) THEN
4089+ DO IHEL=1,NCOMB
4090+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
4091+ $ /NCOMB)) THEN
4092+ GOODHEL(IHEL) = .TRUE.
4093+ ENDIF
4094+ ENDDO
4095+ ENDIF
4096+
4097 ANS=ANS/DBLE(IDEN)
4098 WGT_ME_REAL=ANS
4099 END
4100
4101=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born.f'
4102--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born.f 2017-06-02 12:16:50 +0000
4103+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%born.f 2020-01-09 23:16:36 +0000
4104@@ -28,6 +28,7 @@
4105 C
4106 REAL*8 P1(0:3,NEXTERNAL-1)
4107 COMPLEX*16 ANS(2)
4108+
4109 C
4110 C LOCAL VARIABLES
4111 C
4112@@ -37,6 +38,8 @@
4113 INTEGER NTRY(3)
4114 DATA NTRY /3*0/
4115 INTEGER NHEL(NEXTERNAL-1,NCOMB)
4116+ REAL*8 T_SAVE(NCOMB,2)
4117+ REAL*8 T_SUM(2)
4118 DATA (NHEL(I, 1),I=1,4) / 1,-1,-1, 1/
4119 DATA (NHEL(I, 2),I=1,4) / 1,-1,-1,-1/
4120 DATA (NHEL(I, 3),I=1,4) / 1,-1, 1, 1/
4121@@ -126,6 +129,8 @@
4122 ANS(1) = 0D0
4123 ANS(2) = 0D0
4124 HEL_FAC=1D0
4125+ T_SUM(1) = 0D0
4126+ T_SUM(2) = 0D0
4127 DO IHEL=1,NCOMB
4128 ! the following lines are to avoid segfaults when glu_ij=0
4129 COND_IJ=SKIP(NFKSPROCESS).EQ.0
4130@@ -136,19 +141,33 @@
4131 IF ((GOODHEL(IHEL,NFKSPROCESS) .OR. GOODHEL(IHEL
4132 $ +SKIP(NFKSPROCESS),NFKSPROCESS) .OR. NTRY(NFKSPROCESS) .LT.
4133 $ 2) ) THEN
4134- ANS(1)=ANS(1)+BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE,BORNS)
4135- ANS(2)=ANS(2)+BORNTILDE
4136- IF ( BORNS(1).NE.0D0 .AND. .NOT. GOODHEL(IHEL,NFKSPROCESS)
4137- $ ) THEN
4138- GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
4139- ENDIF
4140- IF ( BORNS(2).NE.0D0 .AND. .NOT. GOODHEL(IHEL
4141- $ +SKIP(NFKSPROCESS),NFKSPROCESS) ) THEN
4142- GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
4143- ENDIF
4144+ ANS(1) = ANS(1) + BORN(P1,NHEL(1,IHEL),IHEL,BORNTILDE
4145+ $ ,BORNS)
4146+ ANS(2)=ANS(2)+ BORNTILDE
4147+ T_SAVE(IHEL,1) = BORNS(1)
4148+ T_SAVE(IHEL,2) = BORNS(2)
4149+ T_SUM(1) = T_SUM(1) + DABS(BORNS(1))
4150+ T_SUM(2) = T_SUM(2) + DABS(BORNS(2))
4151 ENDIF
4152+ ELSE
4153+ T_SAVE(IHEL,1) = 0D0
4154+ T_SAVE(IHEL,2) = 0D0
4155 ENDIF
4156 ENDDO
4157+
4158+ IF(NTRY(NFKSPROCESS).LT.2) THEN
4159+ IF (T_SUM(2).LT.1E-10*T_SUM(1)) T_SUM(2) = T_SUM(1)
4160+ DO IHEL=1,NCOMB
4161+ IF ( DABS(T_SAVE(IHEL,1)).GT.DABS(T_SUM(1))*1D-8/NCOMB)THEN
4162+ GOODHEL(IHEL,NFKSPROCESS)=.TRUE.
4163+ ENDIF
4164+
4165+ IF ( DABS(T_SAVE(IHEL,2)).GT.DABS(T_SUM(2))*1D-8/NCOMB)THEN
4166+ GOODHEL(IHEL+SKIP(NFKSPROCESS),NFKSPROCESS)=.TRUE.
4167+ ENDIF
4168+ ENDDO
4169+ ENDIF
4170+
4171 ANS(1)=ANS(1)/DBLE(IDEN)
4172 ANS(2)=ANS(2)/DBLE(IDEN)
4173 WGT_ME_BORN=DBLE(ANS(1))
4174
4175=== modified file 'tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f'
4176--- tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f 2016-08-07 07:16:07 +0000
4177+++ tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f 2020-01-09 23:16:36 +0000
4178@@ -75,8 +75,8 @@
4179 NTRY=NTRY+1
4180 ANS = 0D0
4181 DO IHEL=1,NCOMB
4182- IF (GOODHEL(IHEL) .OR. NTRY .LT. 2) THEN
4183- IF (NTRY.LT.2) THEN
4184+ IF (GOODHEL(IHEL) .OR. NTRY .LT. 10) THEN
4185+ IF (NTRY.LT.10) THEN
4186 C for the first ps-point, check for helicities that give
4187 C identical matrix elements
4188 T=MATRIX_1(P ,NHEL(1,IHEL))
4189@@ -102,11 +102,18 @@
4190 ENDIF
4191 C add to the sum of helicities
4192 ANS=ANS+T
4193- IF (T .NE. 0D0 .AND. .NOT. GOODHEL(IHEL)) THEN
4194- GOODHEL(IHEL)=.TRUE.
4195- ENDIF
4196 ENDIF
4197 ENDDO
4198+
4199+ IF ( NTRY .LT. 10) THEN
4200+ DO IHEL=1,NCOMB
4201+ IF (.NOT.GOODHEL(IHEL) .AND. (DABS(T_SAVE(IHEL)).GT.ANS*1D-8
4202+ $ /NCOMB)) THEN
4203+ GOODHEL(IHEL) = .TRUE.
4204+ ENDIF
4205+ ENDDO
4206+ ENDIF
4207+
4208 ANS=ANS/DBLE(IDEN)
4209 WGT_ME_REAL=ANS
4210 END
4211
4212=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f'
4213--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f 2018-03-16 12:10:36 +0000
4214+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f 2020-01-09 23:16:36 +0000
4215@@ -71,6 +71,11 @@
4216 INCLUDE 'coupl.inc'
4217 INCLUDE 'run.inc'
4218 C
4219+C local
4220+C
4221+ DOUBLE PRECISION P1(0:3, NEXTERNAL)
4222+
4223+C
4224 C DATA
4225 C
4226 DATA U1/1*1D0/
4227@@ -119,7 +124,12 @@
4228 DSIG1 = PD(0)
4229 RETURN
4230 ENDIF
4231- CALL SMATRIX1(PP,DSIGUU)
4232+ IF(FRAME_ID.NE.6)THEN
4233+ CALL BOOST_TO_FRAME(PP, FRAME_ID, P1)
4234+ ELSE
4235+ P1 = PP
4236+ ENDIF
4237+ CALL SMATRIX1(P1,DSIGUU)
4238 IF (IMODE.EQ.5) THEN
4239 IF (DSIGUU.LT.1D199) THEN
4240 DSIG1 = DSIGUU*CONV
4241
4242=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f'
4243--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2018-11-08 22:24:49 +0000
4244+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/matrix1.f 2020-01-09 23:16:36 +0000
4245@@ -39,6 +39,7 @@
4246 LOGICAL GOODHEL(NCOMB,2)
4247 INTEGER NTRY(2)
4248 COMMON/BLOCK_GOODHEL/NTRY,GOODHEL
4249+
4250 C
4251 C LOCAL VARIABLES
4252 C
4253@@ -54,6 +55,7 @@
4254 INTEGER THIS_NTRY(2)
4255 SAVE THIS_NTRY
4256 DATA THIS_NTRY /0,0/
4257+C
4258 C This is just to temporarily store the reference grid for
4259 C helicity of the DiscreteSampler so as to obtain its number of
4260 C entries with ref_helicity_grid%%n_tot_entries
4261@@ -67,6 +69,9 @@
4262 CHARACTER*101 HEL_BUFF
4263 COMMON/TO_HELICITY/ HEL_BUFF
4264
4265+ INTEGER NB_SPIN_STATE_IN(2)
4266+ COMMON /NB_HEL_STATE/ NB_SPIN_STATE_IN
4267+
4268 INTEGER IMIRROR
4269 COMMON/TO_MIRROR/ IMIRROR
4270
4271@@ -146,9 +151,9 @@
4272 DO JJ=1,NINCOMING
4273 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))
4274 $ )) THEN
4275- T=T*ABS(POL(JJ))
4276+ T=T*ABS(POL(JJ))*NB_SPIN_STATE_IN(JJ)/2D0 ! NB_SPIN_STATE(JJ)/2d0 is added for polarised beam
4277 ELSE IF(POL(JJ).NE.1D0)THEN
4278- T=T*(2D0-ABS(POL(JJ)))
4279+ T=T*(2D0-ABS(POL(JJ)))*NB_SPIN_STATE_IN(JJ)/2D0
4280 ENDIF
4281 ENDDO
4282 IF (ISUM_HEL.NE.0.AND.DS_GET_DIM_STATUS('Helicity')
4283
4284=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f'
4285--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f 2017-05-04 12:07:34 +0000
4286+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/super_auto_dsig.f 2020-01-09 23:16:36 +0000
4287@@ -72,6 +72,10 @@
4288 C
4289 C GLOBAL VARIABLES
4290 C
4291+ INTEGER NB_SPIN_STATE(2)
4292+ DATA NB_SPIN_STATE /2,2/
4293+ COMMON /NB_HEL_STATE/ NB_SPIN_STATE
4294+
4295 INCLUDE 'coupl.inc'
4296 INCLUDE 'run.inc'
4297 C ICONFIG has this config number
4298@@ -140,10 +144,12 @@
4299 ENDDO
4300 ENDDO
4301 WRITE(*,*)'Relative summed weights:'
4302- DO J=1,SYMCONF(0)
4303- WRITE(*,'(4E12.4)')((SUMWGT(K,I,J)/SUMPROB,K=1,2),I=1
4304- $ ,MAXSPROC)
4305- ENDDO
4306+ IF (SUMPROB.NE.0D0)THEN
4307+ DO J=1,SYMCONF(0)
4308+ WRITE(*,'(4E12.4)')((SUMWGT(K,I,J)/SUMPROB,K=1,2),I=1
4309+ $ ,MAXSPROC)
4310+ ENDDO
4311+ ENDIF
4312 SUMPROB=0D0
4313 DO J=1,SYMCONF(0)
4314 DO I=1,MAXSPROC
4315@@ -153,10 +159,12 @@
4316 ENDDO
4317 ENDDO
4318 WRITE(*,*)'Relative number of events:'
4319- DO J=1,SYMCONF(0)
4320- WRITE(*,'(4E12.4)')((NUMEVTS(K,I,J)/SUMPROB,K=1,2),I=1
4321- $ ,MAXSPROC)
4322- ENDDO
4323+ IF (SUMPROB.NE.0D0)THEN
4324+ DO J=1,SYMCONF(0)
4325+ WRITE(*,'(4E12.4)')((NUMEVTS(K,I,J)/SUMPROB,K=1,2),I=1
4326+ $ ,MAXSPROC)
4327+ ENDDO
4328+ ENDIF
4329 WRITE(*,*)'Events:'
4330 DO J=1,SYMCONF(0)
4331 WRITE(*,'(4I12)')((NUMEVTS(K,I,J),K=1,2),I=1,MAXSPROC)
4332@@ -487,7 +495,6 @@
4333
4334 END
4335
4336-
4337 C -----------------------------------------
4338 C Subroutine to map three positive integers
4339 C I, J and K with upper bounds J_bound and
4340
4341=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f'
4342--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f 2018-04-23 20:23:22 +0000
4343+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f 2020-01-09 23:16:36 +0000
4344@@ -69,6 +69,11 @@
4345 INCLUDE 'coupl.inc'
4346 INCLUDE 'run.inc'
4347 C
4348+C local
4349+C
4350+ DOUBLE PRECISION P1(0:3, NEXTERNAL)
4351+
4352+C
4353 C DATA
4354 C
4355 DATA U1/1*1D0/
4356@@ -117,7 +122,12 @@
4357 DSIG = PD(0)
4358 RETURN
4359 ENDIF
4360- CALL SMATRIX(PP,DSIGUU)
4361+ IF(FRAME_ID.NE.6)THEN
4362+ CALL BOOST_TO_FRAME(PP, FRAME_ID, P1)
4363+ ELSE
4364+ P1 = PP
4365+ ENDIF
4366+ CALL SMATRIX(P1,DSIGUU)
4367 IF (IMODE.EQ.5) THEN
4368 IF (DSIGUU.LT.1D199) THEN
4369 DSIG = DSIGUU*CONV
4370
4371=== modified file 'tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f'
4372--- tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2019-06-26 14:12:13 +0000
4373+++ tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f 2020-01-09 23:16:36 +0000
4374@@ -39,6 +39,9 @@
4375 LOGICAL GOODHEL(NCOMB)
4376 INTEGER NTRY
4377 COMMON/BLOCK_GOODHEL/NTRY,GOODHEL
4378+ INTEGER NB_SPIN_STATE(2)
4379+ DATA NB_SPIN_STATE /2,2/
4380+ COMMON /NB_HEL_STATE/ NB_SPIN_STATE
4381 C
4382 C LOCAL VARIABLES
4383 C
4384@@ -122,9 +125,9 @@
4385 DO JJ=1,NINCOMING
4386 IF(POL(JJ).NE.1D0.AND.NHEL(JJ,I).EQ.INT(SIGN(1D0,POL(JJ))
4387 $ )) THEN
4388- T=T*ABS(POL(JJ))
4389+ T=T*ABS(POL(JJ))*NB_SPIN_STATE(JJ)/2D0 ! NB_SPIN_STATE(JJ)/2d0 is added for polarised beam
4390 ELSE IF(POL(JJ).NE.1D0)THEN
4391- T=T*(2D0-ABS(POL(JJ)))
4392+ T=T*(2D0-ABS(POL(JJ)))*NB_SPIN_STATE(JJ)/2D0
4393 ENDIF
4394 ENDDO
4395 IF (ISUM_HEL.NE.0) THEN
4396
4397=== modified file 'tests/parallel_tests/compare_with_old_mg5_version.py'
4398--- tests/parallel_tests/compare_with_old_mg5_version.py 2017-05-24 22:17:29 +0000
4399+++ tests/parallel_tests/compare_with_old_mg5_version.py 2020-01-09 23:16:36 +0000
4400@@ -38,7 +38,7 @@
4401 """A class to compare the value of a old MG5 version and the current one"""
4402
4403 old_mg5 = None # link to the previous version of MG5 (prevent multiple build)
4404- reference_number = 263 #2.4.0
4405+ reference_number = 310 #2.4.0
4406 nb_test = 0
4407
4408
4409@@ -219,12 +219,14 @@
4410 Note that if you need to redo this, this is potentially due to a change
4411 in the model. In consequence, you need to change the old MG5 comparison
4412 point. (Since the default use another model)."""
4413-
4414+
4415+
4416 return # By default no need this
4417 self.create_short_parallel_sqso()
4418 self.create_short_paralel_sm()
4419 self.create_short_paralel_mssm()
4420 self.create_short_paralel_heft()
4421+ self.create_short_polarization()
4422 self.assertTrue(False)
4423
4424
4425@@ -303,6 +305,26 @@
4426 filename = "short_sqso.log",
4427 pickle_file = pickle_file)
4428
4429+ def create_short_polarization(self):
4430+ """Test a short list of processes with polarization"""
4431+ # Create a list of processes to check automatically
4432+ my_proc_list = ['u u~ > w+{T} w-{T0}',
4433+ ' u d~ > w+{T}, w+ > e+ ve',
4434+ ' u d~ > w+{0}, w+ > e+ ve',
4435+ ' g g > t{L} t~{R}, t > w+ b, t~ > w- b~'
4436+ 'W+{T} > e+ ve',
4437+ 'e+{L} e-{R} > mu+ mu-',
4438+ 'e+ e- > mu+ mu-{L}']
4439+
4440+
4441+ # Store list of non-zero processes and results in file
4442+ pickle_file = os.path.join(_pickle_path,
4443+ "mg5_short_paralleltest_pol.pkl")
4444+ self.compare_processes(my_proc_list,
4445+ model='sm',
4446+ orders = {},
4447+ filename = "short_pol.log",
4448+ pickle_file = pickle_file)
4449
4450 ############################################################################
4451 # ROUTINE FOR THE SHORT TEST (USE by the release script)
4452@@ -331,6 +353,33 @@
4453 # Do some cleanup
4454 my_comp.cleanup()
4455
4456+ def test_short_polarization(self):
4457+ """Test a short list of processes with squared order constraints"""
4458+
4459+ #self.create_short_polarization()
4460+ comparisons = me_comparator.PickleRunner.find_comparisons(\
4461+ os.path.join(_pickle_path, "mg5_short_paralleltest_pol.pkl"))
4462+
4463+ for stored_runner in comparisons:
4464+ # Create a MERunner object for MG5
4465+ my_mg5 = me_comparator.MG5_UFO_Runner()
4466+ my_mg5.setup(MG5DIR, MG5DIR)
4467+
4468+ # Create and setup a comparator
4469+ my_comp = me_comparator.MEComparator()
4470+ my_comp.set_me_runners(stored_runner, my_mg5)
4471+
4472+ # Run the actual comparison
4473+ my_comp.run_comparison(stored_runner.proc_list,'sm',
4474+ stored_runner.orders,
4475+ stored_runner.energy)
4476+
4477+ my_comp.assert_processes(self)
4478+
4479+ # Do some cleanup
4480+ my_comp.cleanup()
4481+
4482+
4483 def test_short_sqso(self):
4484 """Test a short list of processes with squared order constraints"""
4485
4486@@ -488,6 +537,8 @@
4487 filename = "sm_mini.log",
4488 energy = 1000)
4489
4490+
4491+
4492 def test_mg5_minitest_mssm(self):
4493 """Test a minimal list of sm 2->2 processes, mainly to test the test"""
4494 # Create a list of processes to check automatically
4495
4496=== added file 'tests/parallel_tests/input_files/mg5_short_paralleltest_pol.pkl'
4497Binary files tests/parallel_tests/input_files/mg5_short_paralleltest_pol.pkl 1970-01-01 00:00:00 +0000 and tests/parallel_tests/input_files/mg5_short_paralleltest_pol.pkl 2020-01-09 23:16:36 +0000 differ
4498=== modified file 'tests/parallel_tests/test_aloha.py'
4499--- tests/parallel_tests/test_aloha.py 2018-11-28 22:12:28 +0000
4500+++ tests/parallel_tests/test_aloha.py 2020-01-09 23:16:36 +0000
4501@@ -2301,8 +2301,9 @@
4502 if data1:
4503 data1 = data1.simplify()
4504 self.assertAlmostEqual(eval(str(data1)), eval(str(data2)))
4505+
4506
4507- def testGammaAlgebraDefinition(self):
4508+ def test_short_GammaAlgebraDefinition(self):
4509 """Test the coherence between gamma/gamma5/sigma/projector"""
4510 Gamma = aloha_obj.Gamma
4511 Gamma5 = aloha_obj.Gamma5
4512
4513=== modified file 'tests/unit_tests/core/test_base_objects.py'
4514--- tests/unit_tests/core/test_base_objects.py 2016-08-07 07:16:07 +0000
4515+++ tests/unit_tests/core/test_base_objects.py 2020-01-09 23:16:36 +0000
4516@@ -1010,7 +1010,8 @@
4517 'state':True,
4518 'from_group':False,
4519 'onshell':None,
4520- 'loop_line':False}
4521+ 'loop_line':False,
4522+ 'polarization':[]}
4523
4524 self.myleg = base_objects.Leg(self.mydict)
4525
4526@@ -1085,14 +1086,16 @@
4527 def test_representation(self):
4528 """Test leg object string representation."""
4529
4530- goal = "{\n"
4531- goal = goal + " \'id\': 3,\n"
4532- goal = goal + " \'number\': 5,\n"
4533- goal = goal + " \'state\': True,\n"
4534- goal = goal + " \'from_group\': False,\n"
4535- goal = goal + " \'loop_line\': False,\n"
4536- goal = goal + " \'onshell\': None\n}"
4537-
4538+ goal ="""{
4539+ 'id': 3,
4540+ 'number': 5,
4541+ 'state': True,
4542+ 'from_group': False,
4543+ 'loop_line': False,
4544+ 'onshell': None,
4545+ 'polarization': []
4546+}"""
4547+
4548 self.assertEqual(goal, str(self.myleg))
4549
4550 def test_leg_list(self):
4551@@ -1155,7 +1158,8 @@
4552 def setUp(self):
4553
4554 self.mydict = {'ids':[3, 2, 5],
4555- 'state':True}
4556+ 'state':True,
4557+ 'polarization':[]}
4558
4559 self.my_multi_leg = base_objects.MultiLeg(self.mydict)
4560
4561@@ -1227,10 +1231,12 @@
4562 def test_representation(self):
4563 """Test multi_leg object string representation."""
4564
4565- goal = "{\n"
4566- goal = goal + " \'ids\': [3, 2, 5],\n"
4567- goal = goal + " \'state\': True\n}"
4568
4569+ goal ="""{
4570+ 'ids': [3, 2, 5],
4571+ 'state': True,
4572+ 'polarization': []
4573+}"""
4574 self.assertEqual(goal, str(self.my_multi_leg))
4575
4576 def test_multi_leg_list(self):
4577
4578=== modified file 'tests/unit_tests/interface/test_cmd.py'
4579--- tests/unit_tests/interface/test_cmd.py 2020-01-09 09:35:56 +0000
4580+++ tests/unit_tests/interface/test_cmd.py 2020-01-09 23:16:36 +0000
4581@@ -204,6 +204,7 @@
4582 """check if generate format are correctly supported"""
4583
4584 cmd = self.cmd
4585+ cmd.do_import('sm')
4586
4587 # valid syntax
4588 cmd.check_process_format('e+ e- > e+ e-')
4589@@ -211,7 +212,13 @@
4590 cmd.check_process_format('e+ e- > mu+ ta- / x $y @1')
4591 cmd.check_process_format('e+ e- > mu+ ta- $ x /y @1')
4592 cmd.check_process_format('e+ e- > mu+ ta- $ x /y, (e+ > e-, e-> ta) @1')
4593+ cmd.check_process_format('e+ e- > Z{L}, Z > mu+ mu- @1')
4594+ cmd.check_process_format('e+ e- > Z{0}, Z > mu+ mu- @1')
4595+ cmd.check_process_format('e+{L} e- > mu+{L} mu-{R} @1')
4596+ cmd.check_process_format('e+ e- > t{L} t~ Z{L}, t > mu+ mu- @1')
4597+ cmd.check_process_format('g g > Z Z [ noborn=QCD] @1')
4598 cmd.check_process_format('u u~ > 2w+ 2j')
4599+ cmd.check_process_format('u u~ > 2w+{0} 2j')
4600
4601 # unvalid syntax
4602 self.wrong(cmd.check_process_format, ' e+ e-')
4603@@ -224,6 +231,13 @@
4604 self.wrong(cmd.check_process_format, ' e+ > e+, (e+ > e- / z, e- > top')
4605 self.wrong(cmd.check_process_format, 'e+ > ')
4606 self.wrong(cmd.check_process_format, 'e+ >')
4607+ self.wrong(cmd.check_process_format, 'e+ e- > Z{L} > mu+ mu-')
4608+ self.wrong(cmd.check_process_format, 'e+ e- > Z > mu+ mu- / W+{L}')
4609+ self.wrong(cmd.check_process_format, 'e+ e- > Z > mu+ mu- $ W+{L}')
4610+ self.wrong(cmd.check_process_format, 'u u~ > t{L} t~ [QCD]')
4611+ self.wrong(cmd.check_process_format, 'u u~ > W+{L} vl [ QED QCD]')
4612+ self.wrong(cmd.check_process_format,'u u~ > w+{L} [QCD]')
4613+ self.wrong(cmd.check_process_format,'u u~ > e+{L} vl [QCD]')
4614
4615 @test_aloha.set_global()
4616 def test_output_default(self):
4617@@ -243,6 +257,7 @@
4618 """check that simple syntax goes trough and return expected process"""
4619
4620 cmd = self.cmd
4621+ self.do('import model sm')
4622 self.do('generate 2p > 2j')
4623 self.assertTrue(cmd._curr_amps)
4624 proc = cmd._curr_amps[0].get('process').get('legs')
4625@@ -327,4 +342,14 @@
4626 output = self.cmd.get_final_part('p p > 2Z')
4627 self.assertEqual(output, set([23]))
4628
4629+ output = self.cmd.get_final_part('p p > Z{L} j')
4630+ self.assertEqual(output, set([1, 2, 3, 4, -1, 21, -4, -3, -2, 23]))
4631+
4632+ output = self.cmd.get_final_part('p p > Z{L} j, Z > e+ e-')
4633+ self.assertEqual(output, set([1, 2, 3, 4, -1, 21, -4, -3, -2, 11, -11]))
4634
4635+ output = self.cmd.get_final_part('p p > 2Z{L} ')
4636+ self.assertEqual(output, set([23]))
4637+
4638+ output = self.cmd.get_final_part('p p > 2Z{L} j, Z > e+ e-')
4639+ self.assertEqual(output, set([1, 2, 3, 4, -1, 21, -4, -3, -2, 11, -11]))
4640
4641=== modified file 'tests/unit_tests/iolibs/test_helas_call_writers.py'
4642--- tests/unit_tests/iolibs/test_helas_call_writers.py 2018-06-01 08:46:21 +0000
4643+++ tests/unit_tests/iolibs/test_helas_call_writers.py 2020-01-09 23:16:36 +0000
4644@@ -497,14 +497,14 @@
4645
4646 wavefunctions = {}
4647 # IXXXXXX.Key: (spin, state)
4648- key1 = ((-2, 0), ('',))
4649+ key1 = ((-2, 0, tuple()), ('',))
4650 wavefunctions[key1] = \
4651 lambda wf: 'CALL IXXXXX(P(0,%d),%s,NHEL(%d),%d*IC(%d),W(1,%d))' % \
4652 (wf.get('number_external'), wf.get('mass'),
4653 wf.get('number_external'), -(-1) ** wf.get_with_flow('is_part'),
4654 wf.get('number_external'), wf.get('number'))
4655 # OXXXXXX.Key: (spin, state)
4656- key2 = ((2, 0), ('',))
4657+ key2 = ((2, 0, tuple()), ('',))
4658 wavefunctions[key2] = \
4659 lambda wf: 'CALL OXXXXX(P(0,%d),%s,NHEL(%d),%d*IC(%d),W(1,%d))' % \
4660 (wf.get('number_external'), wf.get('mass'),

Subscribers

People subscribed via source and target branches

to all changes: