From 2063236f7fa697cbddff343bea47de9ea1dde199 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 25 Oct 2026 03:25:40 +0100 Subject: [PATCH 01/49] LO phase-space: sample t-channel invariants relative to their range; grid on [0,1] Refining u q > z u q on the survey grid (keep_grid_for_refine=True and every non-split refine, i.e. non-grouped output) was 2.6% low; the gap between keep_grid True/False was a symptom, not the cause. Spikes of weight 1e6-1e7 (typical max 2e4) came from three issues: * t-channel invariants were sampled as x=-t/S_hadronic on a fixed grid, while the allowed range [tmin,tmax] moves with shat: the end-point t->tmin (u->0, collinear) is at a different x for each event and cannot be learned by the grid. Now t = tmax - (tmax-tmin) x. * the invariant mass of the remaining t-channel system was sampled flat in s/S_hadronic on [smin,smax]; now logarithmic within [smin,smax]. * the grid was defined on [xgmin,xgmax]=[-1,1] while all variables live in [0,1]: the lower truncation made bin 1 = [-1, xmin_seen], so the physical region [0, xmin_seen] was sampled with ~0 probability and never recovered. xgmin=0 (setgrid keeps the mirrored bins >= xgmin). High-statistics reference 111.61 pb (grouped 111.607+-0.030, non-grouped 111.610+-0.025). 4 seeds, nevents=5000, before -> after: grouped keep_grid=False 110.67 -> 110.83 keep_grid=True 108.75 -> 111.15 non-grouped 108.65 -> 111.05 with about half the phase-space points. p p > t t~, p p > e+ e- j and u d > u d h unchanged within errors (gq_llq G4 hi-stat 114.083 both). New test_t_channel_survey_grid (non-split refine; fails before: 109.5). Co-Authored-By: Claude --- Template/LO/Source/dsample.f | 22 ++++----- Template/LO/Source/genps.inc | 2 +- Template/LO/Source/transpole.f | 2 +- Template/LO/SubProcesses/genps.f | 51 +++++++++++---------- tests/acceptance_tests/test_cmd_madevent.py | 49 ++++++++++++++++++++ 5 files changed, 86 insertions(+), 40 deletions(-) diff --git a/Template/LO/Source/dsample.f b/Template/LO/Source/dsample.f index e653263761..72d01b8407 100644 --- a/Template/LO/Source/dsample.f +++ b/Template/LO/Source/dsample.f @@ -970,7 +970,7 @@ subroutine setgrid(j,xo,a,itype) c c Local c - integer i,k + integer i integer ngu, ngd c c Global @@ -1022,20 +1022,16 @@ subroutine setgrid(j,xo,a,itype) do i=1,ngd-1 c grid(2,i,j) = ((1d0-a)/(xo-a))**(1d0-dble(i)/dble(ngd)) grid(2,ngd-i,j) = xo-(grid(2,ngd+i,j)-xo) - if (grid(2,ngd-i,j) .lt. -1d0) then - write(*,*) 'Error grid set too low',grid(2,ngd-i,j) - do k=1,ng - write(*,*) k,grid(2,k,j) - enddo - stop - endif enddo c -c tjs, ja 2/25/11 -c Make sure sample all the way down to zero only if minimum positive -c - if (grid(2,1,j) .gt. 0) grid(2,1,j) = 0d0 -c write(*,*) "Adjusted bin 1 to zero" +c The mirrored bins must stay inside [xgmin, xo]: otherwise use +c equal bins (a bin below xgmin has a negative width) +c + if (grid(2,1,j) .le. xgmin) then + do i=1,ngd-1 + grid(2,i,j) = xgmin + (xo-xgmin)*dble(i)/dble(ngd) + enddo + endif elseif (itype .eq. 2) then do i=2,ng-1 diff --git a/Template/LO/Source/genps.inc b/Template/LO/Source/genps.inc index ef78e7e812..8d340c8a9b 100644 --- a/Template/LO/Source/genps.inc +++ b/Template/LO/Source/genps.inc @@ -10,7 +10,7 @@ c************************************************************************* c parameter (ng = 43, maxdim = 25, maxinvar= 57 , maxconfigs=20) double precision xgmin, xgmax - parameter (xgmin=-1d0, xgmax=1d0) + parameter (xgmin=0d0, xgmax=1d0) integer maxevents !Requires about 1K/event parameter (maxevents=200000) !Maximum # events to write to disk diff --git a/Template/LO/Source/transpole.f b/Template/LO/Source/transpole.f index 595039b155..e8d0b378d1 100644 --- a/Template/LO/Source/transpole.f +++ b/Template/LO/Source/transpole.f @@ -227,7 +227,7 @@ Subroutine untranspole(pole1,width1,x,y1,jac) double precision pole,width,y,xc double precision a,b double precision xgmin,xgmax ! these should be identical - parameter (xgmin=-1d0, xgmax=1d0) ! to the ones in genps.inc + parameter (xgmin=0d0, xgmax=1d0) ! to the ones in genps.inc c c s-hat map with a knee (pole=-25), parameters set in set_peaks: c lower end of the log region, fraction of the points in it and diff --git a/Template/LO/SubProcesses/genps.f b/Template/LO/SubProcesses/genps.f index e81be1b534..e0f5ac5247 100644 --- a/Template/LO/SubProcesses/genps.f +++ b/Template/LO/SubProcesses/genps.f @@ -757,7 +757,7 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) integer iopposite ! index for t-channel mapping for the part not handle by itree c data nerr/0/ double precision smin,smax,totmass,totmassin,xa2,xb2,wgt - double precision costh,phi,tmin,tmax,t + double precision costh,phi,tmin,tmax,t,trange,srem double precision ma2,mb2,m12,mn2,s1, mi2 c c External @@ -911,10 +911,17 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) return endif call sample_get_x(wgt,x(nbranch-1+(-ibranch)*2), - & nbranch-1+(-ibranch)*2,iconfig, - & smin/stot,smax/stot) - - m(ibranch-1)=dsqrt(max(stot*x(nbranch-1+(-ibranch)*2), 0d0)) + & nbranch-1+(-ibranch)*2,iconfig,0d0,1d0) +c logarithmic in [smin,smax] (the range depends on the event, so +c the grid can not learn the 1/s behaviour in absolute units) + if (smin.gt.0d0) then + srem = smin*(smax/smin)**x(nbranch-1+(-ibranch)*2) + jac = jac*srem*log(smax/smin)/stot + else + srem = smax*x(nbranch-1+(-ibranch)*2) + jac = jac*smax/stot + endif + m(ibranch-1)=dsqrt(max(srem, 0d0)) c write(*,*) 'Using s',nbranch-1+(-ibranch)*2 if (m(ibranch-1)**2.lt.smin.or.m(ibranch-1)**2.gt.smax @@ -1039,9 +1046,13 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) c t = stot*(-x(-ibranch)) c else +c t is sampled relative to its range [tmin,tmax] such that both +c ends are at a fixed position of the grid (x=0: |t| minimal, +c x=1: |t| maximal, i.e. the other invariant u minimal) call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, - $ -tmax/stot, -tmin/stot) - t = stot*(-x(-ibranch)) + $ 0d0, 1d0) + trange = tmax - tmin + t = tmax - trange*x(-ibranch) c endif c call yminmax(s1,0d0,m12,ma2,mb2,mn2,tmin_temp,tmax_temp) @@ -1049,17 +1060,10 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) jac=-3d0 return endif -c -c tmin and tmax set to -s,+s for jacobian because part of jacobian -c was determined from choosing the point x from the grid based on -c tmin and tmax. (ie wgt contains some of the jacobian) -c - tmin=-stot - tmax= stot call sample_get_x(wgt,x(nbranch+(-ibranch-1)*2), & nbranch+(-ibranch-1)*2,iconfig,0d0,1d0) phi = 2d0*pi*x(nbranch+(-ibranch-1)*2) - jac = jac*(tmax-tmin)*2d0*pi /2d0 ! I need /2d0 if -1 p1+ p2; t=(pa-p1)**2; pr = pa-p1 diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index 6a733a6cc7..c9a2dd0c3e 100755 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -545,6 +545,55 @@ def test_group_subprocess_permuted_scale(self): self.assertLess(abs(val - val0) / math.hypot(err, err0), 4, '%s: %s +- %s vs nongrouped %s +- %s' % (name, val, err, val0, err0)) + def test_t_channel_survey_grid(self): + """check that refining on the survey grid is not biased for + u q > z u q (all channels pure t-channel chains). With the t-channel + invariants sampled in units of the hadronic s and the grid defined + on [-1,1], the survey grid starved the regions close to the + kinematic end-points (u -> 0, and below the lowest x seen): the + rare huge weights from there biased the refine ~2-3% low. + Reference from high statistics (8 iterations up to 2.5M points per + channel), grouped and non-grouped agreeing: 111.61 +- 0.03 pb""" + + from unittest import mock + gen_ximprove = MECmd.gen_ximprove + + target = 111.61 + results = {} + for name, group in [('grouped', True), ('nongrouped', False)]: + self.run_dir = pjoin(self.path, 'MGPROC_%s' % name) + mg_cmd = MGCmd.MasterCmd() + mg_cmd.no_notification() + mg_cmd.exec_cmd('set automatic_html_opening False --no_save') + mg_cmd.exec_cmd('set group_subprocesses %s' % group) + mg_cmd.exec_cmd('define q = u d') + mg_cmd.exec_cmd('generate u q > z u q') + mg_cmd.exec_cmd('output %s' % self.run_dir) + + run_card = banner.RunCardLO(pjoin(self.run_dir, 'Cards', 'run_card.dat')) + run_card.set('nevents', 10000, user=True) + run_card.set('iseed', 21, user=True) + run_card.set('use_syst', False, user=True) + run_card.write(pjoin(self.run_dir, 'Cards', 'run_card.dat')) + + self.cmd_line = MECmd.MadEventCmdShell(me_dir=self.run_dir) + self.cmd_line.no_notification() + self.cmd_line.exec_cmd('set automatic_html_opening False') + # never split the refine jobs: they then restart from the + # survey grid (with a fixed grid) + with mock.patch.object(gen_ximprove.gen_ximprove_v4, 'max_request_event', 10**9): + self.do('generate_events -f') + results[name] = (self.cmd_line.results.current['cross'], + self.cmd_line.results.current['error']) + + val0, err0 = results['nongrouped'] + val1, err1 = results['grouped'] + self.assertLess(abs(val1 - val0) / math.hypot(err1, err0), 4, + 'grouped %s +- %s vs nongrouped %s +- %s' % (val1, err1, val0, err0)) + for name, (val, err) in results.items(): + self.assertLess(abs(val - target) / target, 0.012, + '%s: %s +- %s vs %s' % (name, val, err, target)) + def test_e_p_collision(self): """check that e p > e j gives the correct result""" From 9fdcb80d4a361ea15718268eefb8783aab39fe9a Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 25 Oct 2026 11:45:27 +0100 Subject: [PATCH 02/49] genps: clamp the remaining t-channel mass to [smin,smax]; document the t grid preset The log map smin*(smax/smin)**x can round just outside [smin,smax] at x=0/1, which the range check turned into a rejected (zero-weight) point. myamp.f: keep xo/stot as the preset floor of the (now relative) t-channel variable and say why: a preset based on the minimal shat (xo/shat_min) was tested and is worse (G1 of u q > z u q, 48 fresh-grid jobs: iteration 2 43.8 +- 14.5 instead of 29.0 +- 0.2, 1.6x more points). Co-Authored-By: Claude --- Template/LO/SubProcesses/genps.f | 7 ++++--- Template/LO/SubProcesses/myamp.f | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Template/LO/SubProcesses/genps.f b/Template/LO/SubProcesses/genps.f index e0f5ac5247..0329fde6c1 100644 --- a/Template/LO/SubProcesses/genps.f +++ b/Template/LO/SubProcesses/genps.f @@ -921,11 +921,12 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) srem = smax*x(nbranch-1+(-ibranch)*2) jac = jac*smax/stot endif - m(ibranch-1)=dsqrt(max(srem, 0d0)) +c avoid rounding outside [smin,smax] at the end-points + srem = min(max(srem, smin), smax) + m(ibranch-1)=dsqrt(srem) c write(*,*) 'Using s',nbranch-1+(-ibranch)*2 - if (m(ibranch-1)**2.lt.smin.or.m(ibranch-1)**2.gt.smax - $ .or.m(ibranch-1).ne.m(ibranch-1)) then + if (srem.ne.srem) then jac=-1d0 return endif diff --git a/Template/LO/SubProcesses/myamp.f b/Template/LO/SubProcesses/myamp.f index daf73b65ae..1d62bb9476 100644 --- a/Template/LO/SubProcesses/myamp.f +++ b/Template/LO/SubProcesses/myamp.f @@ -539,6 +539,10 @@ subroutine set_peaks xo = min(x1,x2) c Use 1/10000 of sqrt(s) as minimum, to always get integration +c The t-channel x is relative to [tmin,tmax] (one_tree in genps.f) +c whose size is ~shat: xo/stot is the smallest value it can take +c (shat=stot) which is the right floor for the preset (a larger +c value based on the minimal shat starves the high shat events) xo = xo*xo/stot if (xo.eq.0d0)then xo=1/10000d0 From 5e80c5de6cd7ceb9613e972cca4b2c77c2abb584 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 25 Oct 2026 12:49:08 +0100 Subject: [PATCH 03/49] test_t_channel_survey_grid: check the survey logs for negative-width grid bins With xgmin=0 the mirrored lower bins of setgrid went below xgmin; the resulting negative-width bin gives negative weights in the first survey iteration, too small to show in the cross-section but always reported as "xbin not returning correct x" in the channel log (run1_app.log). Fails with the setgrid part of 2063236f7 reverted, passes with it. Co-Authored-By: Claude --- tests/acceptance_tests/test_cmd_madevent.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index c9a2dd0c3e..5169458886 100755 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -585,6 +585,16 @@ def test_t_channel_survey_grid(self): self.do('generate_events -f') results[name] = (self.cmd_line.results.current['cross'], self.cmd_line.results.current['error']) + # the preset grid (setgrid) must stay inside [xgmin, xgmax]: + # a bin below xgmin has a negative width, which gives negative + # weights in the first survey iteration (barely visible in the + # cross-section) and this warning in the channel logs + logs = misc.glob(pjoin('P*', 'G*', '*.log'), + pjoin(self.run_dir, 'SubProcesses')) + self.assertTrue(logs, 'no survey log found for %s' % name) + for log in logs: + self.assertFalse('xbin not returning correct x' in open(log).read(), + '%s: negative width bin in %s' % (name, log)) val0, err0 = results['nongrouped'] val1, err1 = results['grouped'] From 9f420bdc8eea4879320fbb560bd8fd6ca9a8a69f Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 25 Oct 2026 14:27:53 +0100 Subject: [PATCH 04/49] Fix CI: first t-channel invariant back in units of stot; combine_grid on [0,1] * genps.f: sampling every t-channel invariant relative to [tmin,tmax] moved the pole region of 2->2 t-channel processes (cut at fixed |t|): e- p > e- j refined on the survey grid came out 0.6% low (5 sigma, 64 jobs; ~1% with 1k events). Only the next t-channel invariants need the relative variable (their tmin moves with the mass of the remaining system, which is where the u -> 0 end-point of u q > z u q sits); the first one is sampled as before, -t/stot, measured from max(tmax,0). e- p > e- j: 3934.7+-2.6 (ref 3935.0+-1.7); u q > z u q 4 seeds: grouped keep_grid=True 111.13, non-grouped 110.9 (ref 111.61). * combine_grid.py: the python version of the rebin (used to combine the grids of the split survey jobs of loop-induced processes) still had the [-1,1] grid range: the first edge could become negative, giving x>1 and a crash (STOP in the PDF) in all loop-induced runs. * test_density_mode_user_interface: places=3 (5e-4) is below the statistical uncertainty of a 50k-event average; use delta=3e-3. Co-Authored-By: Claude --- Template/LO/SubProcesses/genps.f | 56 ++++++++++++++++++++++-------- Template/LO/SubProcesses/myamp.f | 9 ++--- madgraph/madevent/combine_grid.py | 10 +++--- tests/acceptance_tests/test_cmd.py | 5 ++- 4 files changed, 55 insertions(+), 25 deletions(-) diff --git a/Template/LO/SubProcesses/genps.f b/Template/LO/SubProcesses/genps.f index 0329fde6c1..14bf3efa8f 100644 --- a/Template/LO/SubProcesses/genps.f +++ b/Template/LO/SubProcesses/genps.f @@ -757,7 +757,7 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) integer iopposite ! index for t-channel mapping for the part not handle by itree c data nerr/0/ double precision smin,smax,totmass,totmassin,xa2,xb2,wgt - double precision costh,phi,tmin,tmax,t,trange,srem + double precision costh,phi,tmin,tmax,t,trange,srem,tjac,tref double precision ma2,mb2,m12,mn2,s1, mi2 c c External @@ -1047,13 +1047,26 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) c t = stot*(-x(-ibranch)) c else -c t is sampled relative to its range [tmin,tmax] such that both -c ends are at a fixed position of the grid (x=0: |t| minimal, -c x=1: |t| maximal, i.e. the other invariant u minimal) - call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, - $ 0d0, 1d0) +c The first t-channel invariant is sampled in units of stot: its +c pole region (cut at fixed |t|) is then at a fixed position of the +c grid. The next ones are sampled relative to their range +c [tmin,tmax], which moves with the invariant mass of the remaining +c system: both ends are then at a fixed position (x=1: |t| maximal, +c i.e. the other invariant u minimal) trange = tmax - tmin - t = tmax - trange*x(-ibranch) + if (ibranch.eq.-ns_channel-1) then +c (measured from max(tmax,0) to stay in [0,1] if tmax>0) + tref = max(tmax, 0d0) + call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, + $ (tref-tmax)/stot, (tref-tmin)/stot) + t = tref - stot*x(-ibranch) + tjac = stot + else + call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, + $ 0d0, 1d0) + t = tmax - trange*x(-ibranch) + tjac = trange + endif c endif c call yminmax(s1,0d0,m12,ma2,mb2,mn2,tmin_temp,tmax_temp) @@ -1064,7 +1077,7 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) call sample_get_x(wgt,x(nbranch+(-ibranch-1)*2), & nbranch+(-ibranch-1)*2,iconfig,0d0,1d0) phi = 2d0*pi*x(nbranch+(-ibranch-1)*2) - jac = jac*trange*2d0*pi + jac = jac*tjac*2d0*pi c @@ -1241,13 +1254,26 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) c endif -c t is sampled relative to its range [tmin,tmax] such that both -c ends are at a fixed position of the grid (x=0: |t| minimal, -c x=1: |t| maximal, i.e. the other invariant u minimal) - call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, - $ 0d0, 1d0) +c The first t-channel invariant is sampled in units of stot: its +c pole region (cut at fixed |t|) is then at a fixed position of the +c grid. The next ones are sampled relative to their range +c [tmin,tmax], which moves with the invariant mass of the remaining +c system: both ends are then at a fixed position (x=1: |t| maximal, +c i.e. the other invariant u minimal) trange = tmax - tmin - t = tmax - trange*x(-ibranch) + if (ibranch.eq.-ns_channel-1) then +c (measured from max(tmax,0) to stay in [0,1] if tmax>0) + tref = max(tmax, 0d0) + call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, + $ (tref-tmax)/stot, (tref-tmin)/stot) + t = tref - stot*x(-ibranch) + tjac = stot + else + call sample_get_x(wgt,x(-ibranch),-ibranch,iconfig, + $ 0d0, 1d0) + t = tmax - trange*x(-ibranch) + tjac = trange + endif c if ((tmax-tmin)/stot.gt.0.1)then @@ -1279,7 +1305,7 @@ subroutine one_tree(itree,tstrategy,iconfig,nbranch,P,M,S,X,jac,pswgt) call sample_get_x(wgt,x(nbranch+(-ibranch-1)*2), & nbranch+(-ibranch-1)*2,iconfig,0d0,1d0) phi = 2d0*pi*x(nbranch+(-ibranch-1)*2) - jac = jac*trange*2d0*pi + jac = jac*tjac*2d0*pi c c Finally generate the momentum. The call is of the form c pa+pb -> p1+ p2; t=(pa-p1)**2; pr = pa-p1 diff --git a/Template/LO/SubProcesses/myamp.f b/Template/LO/SubProcesses/myamp.f index 1d62bb9476..8b8151e865 100644 --- a/Template/LO/SubProcesses/myamp.f +++ b/Template/LO/SubProcesses/myamp.f @@ -539,10 +539,11 @@ subroutine set_peaks xo = min(x1,x2) c Use 1/10000 of sqrt(s) as minimum, to always get integration -c The t-channel x is relative to [tmin,tmax] (one_tree in genps.f) -c whose size is ~shat: xo/stot is the smallest value it can take -c (shat=stot) which is the right floor for the preset (a larger -c value based on the minimal shat starves the high shat events) +c The first t-channel invariant is sampled as -t/stot, the next +c ones relative to [tmin,tmax] whose size is ~shat (one_tree in +c genps.f): xo/stot is then the smallest value they can take +c (shat=stot), the right floor for the preset (a larger value +c based on the minimal shat starves the high shat events) xo = xo*xo/stot if (xo.eq.0d0)then xo=1/10000d0 diff --git a/madgraph/madevent/combine_grid.py b/madgraph/madevent/combine_grid.py index 1715decc23..3857d851b8 100755 --- a/madgraph/madevent/combine_grid.py +++ b/madgraph/madevent/combine_grid.py @@ -18,7 +18,7 @@ class grid_information(object): - start, stop = -1,1 #original interval + start, stop = 0,1 #original interval (xgmin, xgmax of genps.inc) def __init__(self, mc_hel): @@ -449,18 +449,18 @@ def average(a,b,c): # special Dealing with first/last bin for handling endpoint. xmin, xmax = self.min_on_axis[var], self.max_on_axis[var] - if (xmin- (-1) > (self.original_grid[(1,var)] - self.original_grid[(0,var)])): + if (xmin - self.start > (self.original_grid[(1,var)] - self.original_grid[(0,var)])): start = 1 start_bin = xmin - (self.original_grid[(1,var)] - self.original_grid[(0,var)])/5 test_grid[0] = start_bin else: - xmin = -1 - if (1- xmax) > (self.original_grid[(self.ng-1,var)] - self.original_grid[(self.ng-2, var)]): + xmin = self.start + if (self.stop - xmax) > (self.original_grid[(self.ng-1,var)] - self.original_grid[(self.ng-2, var)]): stop = self.ng -2 xmax = xmax + (self.original_grid[(self.ng-1,var)] - self.original_grid[(self.ng-2, var)])/5 test_grid[self.ng-1] = xmax else: - xmax = 1 + xmax = self.stop test_grid[self.ng-1] = xmax diff --git a/tests/acceptance_tests/test_cmd.py b/tests/acceptance_tests/test_cmd.py index f929e8b356..fa90cc126e 100755 --- a/tests/acceptance_tests/test_cmd.py +++ b/tests/acceptance_tests/test_cmd.py @@ -1792,7 +1792,10 @@ def test_density_mode_user_interface(self): for i in range(len(rho_avg)): for j in range(len(rho_avg[0])): - self.assertAlmostEqual(rho_avg[i][j].real, rho_avg_ref[i][j].real, places=3) #we ask 3 digits because we only use 50k events + # 50k events: the statistical uncertainty on the diagonal + # elements is O(1e-3), places=3 (5e-4) only held for one + # given sequence of events + self.assertAlmostEqual(rho_avg[i][j].real, rho_avg_ref[i][j].real, delta=3e-3) self.assertAlmostEqual(rho_avg[i][j].imag, rho_avg_ref[i][j].imag, places=3) From bc3ac123895967781c00c33fe824f80001f845fa Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 25 Oct 2026 15:02:43 +0100 Subject: [PATCH 05/49] dsample: floor the per-iteration variance (NaN for 2-body decays) With the grid on [0,1] the uniform bins can be bit-identical, so for a constant integrand (a 2-body decay as generated by MadSpin, W+ > ve e+) all weights are equal and the variance of an iteration is exactly zero: mean**2/sigma -> Inf and the combined result NaN. MadSpin then failed in the unweighting (UnboundLocalError: max_wgt), acceptancetest_madspin_LI. W+ decays, 20 seeds: 2 NaN before, 0 after (0 on the [-1,1] baseline). Co-Authored-By: Claude --- Template/LO/Source/dsample.f | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Template/LO/Source/dsample.f b/Template/LO/Source/dsample.f index 72d01b8407..9e260d4204 100644 --- a/Template/LO/Source/dsample.f +++ b/Template/LO/Source/dsample.f @@ -2004,6 +2004,10 @@ subroutine sample_put_point(wgt, point, iteration,ipole, allow_update) sigma = (sigma/vol/vol - knt*mean*mean) . / dble(knt-1) / dble(knt) endif +c a constant integrand (e.g. a 2-body decay) can give a variance +c exactly zero (or negative by rounding): floor it at the +c numerical precision to keep mean**2/sigma finite + sigma = max(sigma, (1d-14*mean)**2, 1d-300) tmean = tmean + mean * (mean**2 / sigma) trmean = trmean + rmean * (mean**2 / sigma) From 1a9050abf980b4c96623611e179715a1856af62b Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 25 Oct 2026 20:08:50 +0100 Subject: [PATCH 06/49] test_madspin_factory: recalibrate the unweighting-consistency scatter The replica sd came from 9 replicas (8 degrees of freedom) and was low: the joint_replica control (same scheme, other seed) failed m(l+ vl) by 0.112 GeV against a 0.110 GeV tolerance, 2.6 sigma of the runs' own errors. Two more campaigns of 16 joint replicas off one 5000-event production sample each, with the code of PR #466 and with its base: lineshape 0.0411 / 0.0398, m(l+ vl) 0.0495 / 0.0416, dphi 0.0077 / 0.0124 i.e. no difference between the two codes. Pooled with the original campaign (38 dof): 0.0379, 0.0425, 0.0114 (was 0.0261, 0.0275, 0.0146). At NEVENTS=10000 the lineshape tolerance becomes 0.152 GeV, still below the 0.213 GeV bias the test guards against (S/N 5.6 instead of 8.2). Co-Authored-By: Claude --- tests/parallel_tests/test_madspin_factory.py | 38 +++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/tests/parallel_tests/test_madspin_factory.py b/tests/parallel_tests/test_madspin_factory.py index cbba1ee1b1..2a38388f50 100644 --- a/tests/parallel_tests/test_madspin_factory.py +++ b/tests/parallel_tests/test_madspin_factory.py @@ -431,6 +431,20 @@ def test_short_madspin_multicore(self): # signal (see below) 0.2126 0.0334 0.0014 # signal / replica sd 8.2 1.2 0.1 # +# Recalibration: the 8 degrees of freedom above under-estimated the scatter (the +# joint_replica control failed m(l+ vl) at 0.112 GeV against a 0.110 tolerance, +# 2.6 sigma of the runs' own errors). Two campaigns of 16 joint replicas +# (seeds 42-57) off one 5000-event production sample each, one with the code of +# PR #466 and one with its base -- they agree within their errors, so the +# three campaigns are pooled (38 degrees of freedom): +# +# m(l+ vl b) m(l+ vl) dphi(l+,l-) +# replica sd (PR #466) 0.0411 0.0495 0.0077 +# replica sd (base) 0.0398 0.0416 0.0124 +# replica sd (pooled) 0.0379 0.0425 0.0114 +# naive per-run error 0.0318 0.0434 0.0128 +# signal / replica sd 5.6 0.8 0.1 +# # The *signal* is the bias this test exists to catch. The PR #334 bug made the # offshell scheme sample the PA/Breit-Wigner lineshape instead of the offshell # one, so a PA run off the same production sample reproduces it: the row above @@ -440,7 +454,7 @@ def test_short_madspin_multicore(self): # Three things fall out, and they are the whole design of the test: # # 1. **Only the lineshape can see it.** m(l+ vl) and dphi(l+,l-) have a -# signal-to-noise of 1.2 and 0.1 -- they would not have moved measurably had +# signal-to-noise of 0.8 and 0.1 -- they would not have moved measurably had # the bug still been there. They are asserted below as no-regression checks # and must not be read as standing in for the lineshape. # @@ -455,19 +469,19 @@ def test_short_madspin_multicore(self): # The plan document's two-replica estimate had joint scattering by 0.005 # against a naive error of 0.023, suggesting the runs were strongly # correlated through the shared production events and the naive error was 4x -# too loose. Over nine replicas the ratio of replica sd to naive error is -# 0.82 (lineshape), 0.65 (W mass) and 1.14 (dphi): mildly correlated at -# most. The 0.005 was a small-sample fluctuation. The tolerances below are -# therefore built on the measured replica sd, which is the thing the test -# actually has to survive. +# too loose. Over the 41 replicas the ratio of pooled replica sd to naive +# error is 1.19 (lineshape), 0.98 (W mass) and 0.89 (dphi): no sign of a +# correlation that would shrink it. The 0.005 was a small-sample +# fluctuation. The tolerances below are therefore built on the measured +# replica sd, which is the thing the test actually has to survive. LINESHAPE_CALIB_NEVENTS = 5000 -# Replica sd (GeV, GeV, rad) at LINESHAPE_CALIB_NEVENTS, from the table above. -CALIB_SD = {'lineshape': 0.0261, 'w_mass': 0.0275, 'dphi': 0.0146} +# Replica sd (GeV, GeV, rad) at LINESHAPE_CALIB_NEVENTS, pooled recalibration. +CALIB_SD = {'lineshape': 0.0379, 'w_mass': 0.0425, 'dphi': 0.0114} # Two runs differ by sqrt(2) times a single run's scatter, and 4 sigma of that # leaves a per-comparison false-positive rate around 6e-5 -- with four # comparisons per test, a flake roughly once in four thousand runs. Even if the -# sd above is underestimated by the ~25% its 8 degrees of freedom allow, that -# only relaxes to 3.2 sigma. +# sd above is underestimated by the ~12% its 38 degrees of freedom allow, that +# only relaxes to 3.6 sigma. CALIB_NSIGMA = 4.0 # Measured offshell-minus-PA on the lineshape: the size of the bias to catch. LINESHAPE_SIGNAL = 0.213 @@ -640,7 +654,7 @@ def test_long_madspin_unweighting_consistency(self): **The reconstructed resonance lineshape is that observable.** ``m(l+ vl b)`` -- the top reconstructed from its decay products -- is what the original bug shifted by 0.25 GeV, and the calibration above measures its - signal-to-noise at 8.2 against 1.2 for ``m(l+ vl)`` and 0.1 for + signal-to-noise at 5.6 against 0.8 for ``m(l+ vl)`` and 0.1 for ``dphi(l+, l-)``. The other two are asserted as no-regression checks and nothing more: at those ratios they would not have moved measurably even with the bug still in place, so they must never be read as standing in @@ -716,7 +730,7 @@ def test_long_madspin_unweighting_consistency(self): assert_observable_consistent( self, lineshape, lineshape_tol, 'm(l+ vl b) [GeV]', reference='joint') - # No-regression only (S/N 1.2 and 0.1 against this class of bug). + # No-regression only (S/N 0.8 and 0.1 against this class of bug). assert_observable_consistent( self, w_mass, _consistency_tolerance('w_mass', NEVENTS), 'm(l+ vl) [GeV] (no-regression only, blind to the lineshape bias)', From 6053352228add77cf9e794c8b472363124924620 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 19:36:05 +0100 Subject: [PATCH 07/49] combine_grid: start the rebin at the lower end of the grid interval The python rebin (the grid update between the iterations of loop-induced and job_strategy=2 runs) started the first original bin at 1 instead of at the lower end of the interval (xgmin in the fortran rebin), so a new edge falling in that bin was interpolated to nonsense. With the [-1,1] range the lower truncation was always applied and hid it; with [0,1] it corrupted every loop-induced grid: g g > z z [noborn=QCD] (Z pT > 20) had refine yields of 0.1-0.2% and a survey error 10x larger. After the fix (3 seeds each): 0.8755 +- 0.0023 pb vs 0.8747 +- 0.0017 on the base; g g > h g [noborn=QCD]: 10.25 +- 0.04 vs 10.24 +- 0.04. Co-Authored-By: Claude --- madgraph/madevent/combine_grid.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/madgraph/madevent/combine_grid.py b/madgraph/madevent/combine_grid.py index 3857d851b8..ee4c489bbb 100755 --- a/madgraph/madevent/combine_grid.py +++ b/madgraph/madevent/combine_grid.py @@ -444,7 +444,9 @@ def average(a,b,c): start, stop = 0, self.ng-1 - start_bin, end_bin = 0, 1 + # edges of the original bin being consumed: the first one starts at + # the lower end of the interval (xgmin in the fortran rebin) + start_bin, end_bin = self.start, self.start test_grid = [0]*self.ng # a first attempt for the new grid # special Dealing with first/last bin for handling endpoint. From a1b17d2090035e3bfc172a62da431d9969ab739d Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 21:59:46 +0100 Subject: [PATCH 08/49] combine_grid: put the shifted upper edge on bin ng-2 (as dsample.f); add unit tests When the points seen stop below the last bin (self.stop - xmax larger than the width of the last bin), the shifted xmax was written to the LAST grid point test_grid[ng-1] instead of test_grid[ng-2], so the region x > xmax was never resampled. The last grid point is now always self.stop, the width of the last bin is taken from the bins below it, and the sanity check clamps to self.stop. Also the min/max-on-axis defaults use [self.start, self.stop] instead of [-1, 1]. Same code as MadGraph7 5bcfb91f53, so the two versions of combine_grid.py are identical. New tests/unit_tests/madevent/test_combine_grid.py (fails on the previous version), run in the unittest workflow as TestCombineGrid. --- .github/workflows/unittest.yml | 2 +- madgraph/madevent/combine_grid.py | 43 +++++---- .../unit_tests/madevent/test_combine_grid.py | 87 +++++++++++++++++++ 3 files changed, 108 insertions(+), 24 deletions(-) create mode 100644 tests/unit_tests/madevent/test_combine_grid.py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 267f7cb7d1..31844cbec8 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -767,4 +767,4 @@ jobs: - name: test lhe_parser/reweight ordering and boost run: | cd $GITHUB_WORKSPACE - ./tests/test_manager.py test_lhe_ordering test_reweight_ordering test_boost_by_a_momentum_at_rest test_nested_identical_children -t0 + ./tests/test_manager.py test_lhe_ordering test_reweight_ordering test_boost_by_a_momentum_at_rest test_nested_identical_children TestCombineGrid -t0 diff --git a/madgraph/madevent/combine_grid.py b/madgraph/madevent/combine_grid.py index ee4c489bbb..d583fc524f 100755 --- a/madgraph/madevent/combine_grid.py +++ b/madgraph/madevent/combine_grid.py @@ -18,7 +18,7 @@ class grid_information(object): - start, stop = 0,1 #original interval (xgmin, xgmax of genps.inc) + start, stop = 0, 1 # grid interval: [xgmin, xgmax] of genps.inc def __init__(self, mc_hel): @@ -31,8 +31,8 @@ def __init__(self, mc_hel): self.ng =0 self.maxinvar=0 self.nonzero = 0 - self.max_on_axis = collections.defaultdict(lambda: -1) - self.min_on_axis = collections.defaultdict(lambda: 1) + self.max_on_axis = collections.defaultdict(lambda: self.start) + self.min_on_axis = collections.defaultdict(lambda: self.stop) # information that we need to evaluate the cross-section/error self.sum_wgt = 0 self.sum_abs_wgt = 0 @@ -443,34 +443,34 @@ def average(a,b,c): grid[(j,var)] = ((x0-1)/math.log(x0))**1.5 + # special Dealing with first/last bin for handling endpoint + # (as in the rebinning of dsample.f). Grid point i is the upper + # edge of bin i: the last one is always self.stop. start, stop = 0, self.ng-1 - # edges of the original bin being consumed: the first one starts at - # the lower end of the interval (xgmin in the fortran rebin) - start_bin, end_bin = self.start, self.start test_grid = [0]*self.ng # a first attempt for the new grid - - # special Dealing with first/last bin for handling endpoint. xmin, xmax = self.min_on_axis[var], self.max_on_axis[var] - if (xmin - self.start > (self.original_grid[(1,var)] - self.original_grid[(0,var)])): + width_first = self.original_grid[(1,var)] - self.original_grid[(0,var)] + width_last = self.original_grid[(self.ng-2,var)] - self.original_grid[(self.ng-3, var)] + if xmin - self.start > width_first: start = 1 - start_bin = xmin - (self.original_grid[(1,var)] - self.original_grid[(0,var)])/5 - test_grid[0] = start_bin + xmin = xmin - width_first/5 + test_grid[0] = xmin else: xmin = self.start - if (self.stop - xmax) > (self.original_grid[(self.ng-1,var)] - self.original_grid[(self.ng-2, var)]): - stop = self.ng -2 - xmax = xmax + (self.original_grid[(self.ng-1,var)] - self.original_grid[(self.ng-2, var)])/5 - test_grid[self.ng-1] = xmax + if self.stop - xmax > width_last: + stop = self.ng - 2 + xmax = xmax + width_last/5 + test_grid[self.ng-2] = xmax else: xmax = self.stop - test_grid[self.ng-1] = xmax - + test_grid[self.ng-1] = self.stop #compute the value in order to have the same amount in each bin sum_var = sum([grid[(j,var)] for j in range(self.ng)]) avg = sum_var / (stop-start+1) cumulative = 0 pos_in_original_grid = -1 + end_bin = xmin for j in range(start,stop): while cumulative < avg and pos_in_original_grid < self.ng: #the previous bin (if any) is fully belonging to one single bin @@ -481,9 +481,6 @@ def average(a,b,c): start_bin = end_bin end_bin = max(xmin,min(xmax,self.original_grid[(pos_in_original_grid, var)])) cumulative -= avg - #if pos_in_original_grid == 0: - # print grid[(pos_in_original_grid,var)] - # print cumulative if end_bin != start_bin and cumulative and grid[(pos_in_original_grid,var)]: test_grid[j] = end_bin - (end_bin-start_bin)*cumulative / \ grid[(pos_in_original_grid,var)] @@ -495,14 +492,14 @@ def average(a,b,c): for j in range(1, self.ng): if test_grid[j] - test_grid[j-1] < 1e-14: test_grid[j] = test_grid[j-1] + 1e-14 - if test_grid[j] > xmax: + if test_grid[j] > self.stop: sanity = False break # not in fortran double check of the sanity from the top. if not sanity: for j in range(1, self.ng): - if test_grid[-1*j] > xmax - j * 1e-14: - test_grid[-1*j] = xmax - j * 1e-14 + if test_grid[-1*j] > self.stop - (j-1) * 1e-14: + test_grid[-1*j] = self.stop - (j-1) * 1e-14 # return the new grid return test_grid diff --git a/tests/unit_tests/madevent/test_combine_grid.py b/tests/unit_tests/madevent/test_combine_grid.py new file mode 100644 index 0000000000..9996c81300 --- /dev/null +++ b/tests/unit_tests/madevent/test_combine_grid.py @@ -0,0 +1,87 @@ +############################################################################## +# +# Copyright (c) 2026 The MadGraph5_aMC@NLO Development team and Contributors +# +# This file is a part of the MadGraph5_aMC@NLO project, an application which +# automatically generates Feynman diagrams and matrix elements for arbitrary +# high-energy processes in the Standard Model and beyond. +# +# It is subject to the MadGraph5_aMC@NLO license which should accompany this +# distribution. +# +# For more information, visit madgraph.phys.ucl.ac.be and amcatnlo.web.cern.ch +# +################################################################################ +"""Tests of the grid combination of the split survey/refine jobs +(madgraph/madevent/combine_grid.py, use_cut=-2 in dsample.f)""" +from __future__ import absolute_import +import unittest + +import madgraph.madevent.combine_grid as combine_grid + + +class TestCombineGrid(unittest.TestCase): + """new grid from the combined grid_information of the split jobs""" + + ng = 20 + + def get_new_grid(self, weights, xmin, xmax): + """uniform original grid on [0,1] with the given weight per bin and + the range [xmin, xmax] of the points seen""" + info = combine_grid.grid_information(mc_hel=0) + info.ng = self.ng + info.maxinvar = 1 + info.nonzero = 1000 + for i in range(self.ng): + info.original_grid[(i, 0)] = (i + 1) / self.ng + info.grid_base[(i, 0)] = weights[i] + info.non_zero_grid[(i, 0)] = 1000 // self.ng if weights[i] else 0 + info.min_on_axis[0] = xmin + info.max_on_axis[0] = xmax + return info.get_new_grid_for_var(0) + + def check_grid(self, grid): + self.assertEqual(len(grid), self.ng) + self.assertGreater(grid[0], 0) + for i in range(1, self.ng): + self.assertGreater(grid[i], grid[i-1], grid) + self.assertEqual(grid[-1], 1) + + def test_grid_interval(self): + """the grid of dsample.f is on [xgmin, xgmax] = [0, 1]""" + self.assertEqual((combine_grid.grid_information.start, + combine_grid.grid_information.stop), (0, 1)) + + def test_points_in_first_and_last_bin(self): + """points down to the first bin: the new grid starts at 0, not -1 + (x < 0 gave a Bjorken x above 1 for g g > h)""" + weights = [10. / (i + 1) for i in range(self.ng)] + grid = self.get_new_grid(weights, 1e-4, 0.999) + self.check_grid(grid) + # the weight is at small x + self.assertLess(grid[self.ng // 2], 0.5) + + def test_flat(self): + """a flat function keeps a uniform grid""" + grid = self.get_new_grid([1.] * self.ng, 1e-4, 0.999) + self.check_grid(grid) + for i, x in enumerate(grid): + self.assertAlmostEqual(x, (i + 1) / self.ng) + + def test_endpoints_not_reached(self): + """points only in [0.3, 0.6]: the first/last grid points are put + just outside of that range (as in dsample.f), and the last one + stays at 1 such that the region above is still sampled""" + weights = [1. if 6 <= i <= 11 else 0. for i in range(self.ng)] + grid = self.get_new_grid(weights, 0.3, 0.6) + self.check_grid(grid) + width = 1. / self.ng + self.assertAlmostEqual(grid[0], 0.3 - width / 5) + self.assertAlmostEqual(grid[-2], 0.6 + width / 5) + for x in grid[1:-2]: + self.assertGreaterEqual(x, grid[0]) + self.assertLessEqual(x, grid[-2]) + + +if __name__ == '__main__': + unittest.main() From 615729c4f139180b6cdb13f751f43142d83f2fc2 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:36:51 +0100 Subject: [PATCH 09/49] LO madevent: fix vector mode (vector_size>1) without subprocess grouping dsample.f calls the subroutine DSIG_VEC(ALL_P, ALL_WGT, ALL_XBK, ...) but the non-grouped auto_dsig.f defined DSIG_VEC as the per-process vector function with another argument list (result: NaN / 'No points passed cuts'). - non-grouped output: rename the per-process function DSIG_NOGROUP_VEC and add a DSIG_VEC wrapper with the dsample signature. It repacks the momenta, sets ICONF/IMIRROR (no mirror, no permutation), sets the scale and couplings per event (as DSIGPROC_VEC does for grouped output) and calls DSIG_NOGROUP_VEC. - set CHANNELS(IVEC) for the non-grouped SMATRIX_MULTI call (was unset). - dummy SELECT_GROUPING_VEC sets IPROC/ICONF_VEC/IMIRROR_VEC=1 (dsample uses IMIRROR_VEC for the beam orientation of the cuts). - DSIG(PP,WGT,1) now returns NFACT: the assignment sat after an infinite loop and was unreachable, so the vector function got NFACT=0. - acceptance test: add a non-grouped vector case to test_group_subprocess_permuted_scale. Co-Authored-By: Claude --- madgraph/iolibs/export_v4.py | 13 ++- .../iolibs/template_files/auto_dsig_v4.inc | 94 ++++++++++++++++++- tests/acceptance_tests/test_cmd_madevent.py | 8 +- 3 files changed, 110 insertions(+), 5 deletions(-) diff --git a/madgraph/iolibs/export_v4.py b/madgraph/iolibs/export_v4.py index 8ea237d7b8..54c63643bc 100755 --- a/madgraph/iolibs/export_v4.py +++ b/madgraph/iolibs/export_v4.py @@ -6068,7 +6068,9 @@ def write_auto_dsig_file(self, writer, matrix_element, proc_id = ""): replace_dict['define_subdiag_lines'] = "INTEGER IB(2)" replace_dict['cutsdone'] = " cutsdone=.false.\n cutspassed=.false." replace_dict['get_channel'] = "MAPCONFIG(ICONFIG)" - replace_dict['get_channel_vec'] = " channel = MAPCONFIG(ICONFIG)" + replace_dict['get_channel_vec'] = """ + CHANNELS(IVEC) = MAPCONFIG(ICONFIG) + channel = CHANNELS(IVEC)""" # need to extract get_helicities/select color from the group template file text = open(pjoin(MG5DIR, 'madgraph', 'iolibs', 'template_files', 'super_auto_dsig_group_v4.inc')).read() color_hel_text = writers.FortranWriter.get_routine(text, ['select_color', 'get_helicities']) @@ -6144,11 +6146,20 @@ def get_dummy_grouping(self): end SUBROUTINE SELECT_GROUPING_VEC(IMIRROR_VEC, IPROC, ICONF_VEC, WGT, VECSIZE_USED) + implicit none + include '../../Source/vector.inc' integer imirror_vec(*) integer iproc integer iconf_vec(*) double precision WGT(*) integer VECSIZE_USED + integer iw +c single process and no mirror (dsample uses imirror_vec for the cuts) + iproc = 1 + do iw=1, VECSIZE_USED/WARP_SIZE + iconf_vec(iw) = 1 + imirror_vec(iw) = 1 + enddo return end diff --git a/madgraph/iolibs/template_files/auto_dsig_v4.inc b/madgraph/iolibs/template_files/auto_dsig_v4.inc index c0e3be5a8c..af5a9ee0ef 100644 --- a/madgraph/iolibs/template_files/auto_dsig_v4.inc +++ b/madgraph/iolibs/template_files/auto_dsig_v4.inc @@ -112,10 +112,11 @@ C Set up process information from file symfact NFACT=IFACT ENDIF ENDDO - DSIG%(proc_id)s = NFACT 10 CLOSE(LUN) + DSIG%(proc_id)s = NFACT RETURN 20 WRITE(*,*)'Error opening symfact.dat. No symmetry factor used.' + DSIG%(proc_id)s = NFACT RETURN ENDIF C Continue only if IMODE is 0, 4 or 5 @@ -194,7 +195,12 @@ C ## } +## if(nogrouping) { +C Without grouping, DSIG_VEC (called by dsample) is the wrapper defined below +DOUBLE PRECISION FUNCTION DSIG_NOGROUP_VEC(ALL_PP, ALL_XBK, ALL_Q2FACT, ALL_CM_RAP, ALL_WGT, IMODE, ALL_OUT, SYMCONF, CONFSUB, ICONF_VEC, IMIRROR_VEC, VECSIZE_USED) +## } else { DOUBLE PRECISION FUNCTION DSIG%(proc_id)s_VEC(ALL_PP, ALL_XBK, ALL_Q2FACT, ALL_CM_RAP, ALL_WGT, IMODE, ALL_OUT, SYMCONF, CONFSUB, ICONF_VEC, IMIRROR_VEC, VECSIZE_USED) +## } C **************************************************** C %(info_lines)s @@ -448,6 +454,92 @@ C Call UNWGT to unweight and store events +## if(nogrouping) { + SUBROUTINE DSIG_VEC(ALL_P,ALL_WGT,ALL_XBK,ALL_Q2FACT,ALL_CM_RAP,ICONF_VEC,IPROC,IMIRROR_VEC,ALL_OUT,VECSIZE_USED) +C **************************************************** +C Vector entry point called by dsample.f when the subprocesses +C are not grouped (same arguments as DSIG_VEC of the grouped output) +C No symmetry permutation and no mirror process here: +C all warps use ICONFIG and the momenta as generated. +C Set the scale and the couplings of each event (done in +C DSIGPROC_VEC for the grouped output) and call DSIG_NOGROUP_VEC +C INPUT: ALL_P(4*MAXDIM/3+14, VECSIZE_USED) +C INPUT/OUTPUT: ALL_WGT(VECSIZE_USED) (set to zero if the clustering fails) +C OUTPUT: ALL_OUT(VECSIZE_USED) (PDF*matrix element) +C **************************************************** + IMPLICIT NONE + include '../../Source/vector.inc' ! defines VECSIZE_MEMMAX + include 'genps.inc' + include 'nexternal.inc' + include 'maxconfigs.inc' + include 'maxamps.inc' + include 'run.inc' + DOUBLE PRECISION ALL_P(4*MAXDIM/3+14,VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_WGT(VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_XBK(2,VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_Q2FACT(2,VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_CM_RAP(VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_OUT(VECSIZE_MEMMAX) + INTEGER ICONF_VEC(*), IPROC, IMIRROR_VEC(*) + INTEGER VECSIZE_USED +C +C GLOBAL VARIABLES +C + INTEGER MAPCONFIG(0:LMAXCONFIGS), ICONFIG + COMMON/TO_MCONFIGS/MAPCONFIG, ICONFIG + INTEGER IMIRROR_GLOBAL, IPROC_GLOBAL + COMMON/TO_MIRROR/ IMIRROR_GLOBAL, IPROC_GLOBAL + DOUBLE PRECISION CM_RAP + LOGICAL SET_CM_RAP + COMMON/TO_CM_RAP/SET_CM_RAP,CM_RAP +C +C LOCAL VARIABLES +C + INTEGER IVEC, IW, I, J + DOUBLE PRECISION ALL_P1(0:3,NEXTERNAL,VECSIZE_MEMMAX) + SAVE ALL_P1 + INTEGER SYMCONF(0:LMAXCONFIGS) + INTEGER CONFSUB(MAXSPROC,LMAXCONFIGS) + DOUBLE PRECISION XDUM + LOGICAL FIRST + DATA FIRST/.TRUE./ + SAVE FIRST + DOUBLE PRECISION DSIG_NOGROUP_VEC + +C momenta in the layout of the matrix element + DO IVEC=1, VECSIZE_USED + DO I=1, NEXTERNAL + DO J=0, 3 + ALL_P1(J,I,IVEC) = ALL_P(4*(I-1)+J+1,IVEC) + ENDDO + ENDDO + ENDDO + IPROC = 1 + DO IW=1, VECSIZE_USED/WARP_SIZE + ICONF_VEC(IW) = 1 + IMIRROR_VEC(IW) = 1 + ENDDO + SYMCONF(:) = ICONFIG + CONFSUB(:,:) = MAPCONFIG(ICONFIG) + IMIRROR_GLOBAL = 1 + IPROC_GLOBAL = 1 + IF (FIRST) THEN +C read the symmetry factor (as DSIG(PP,WGT,1) in the scalar mode) + XDUM = DSIG_NOGROUP_VEC(ALL_P1, ALL_XBK, ALL_Q2FACT, ALL_CM_RAP, ALL_WGT, 1, ALL_OUT, SYMCONF, CONFSUB, ICONF_VEC, IMIRROR_VEC, VECSIZE_USED) + FIRST = .FALSE. + ENDIF +C set the running scale and update the couplings of each event + DO IVEC=1, VECSIZE_USED + XBK(:) = ALL_XBK(:,IVEC) + CM_RAP = ALL_CM_RAP(IVEC) + CALL UPDATE_SCALE_COUPLING_IVEC(ALL_P1(0,1,IVEC), ALL_WGT(IVEC), ALL_Q2FACT(1,IVEC), IVEC) + ENDDO + ALL_OUT(:) = 0D0 + XDUM = DSIG_NOGROUP_VEC(ALL_P1, ALL_XBK, ALL_Q2FACT, ALL_CM_RAP, ALL_WGT, 0, ALL_OUT, SYMCONF, CONFSUB, ICONF_VEC, IMIRROR_VEC, VECSIZE_USED) + RETURN + END +## } + SUBROUTINE PRINT_ZERO_AMP%(proc_id)s() return diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index 6a733a6cc7..5fd5a7ebbb 100755 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -494,7 +494,7 @@ def test_group_subprocess(self): self.assertLess(err1 / val1, 0.005) def test_group_subprocess_permuted_scale(self): - """check that grouped (scalar and vector) and non-grouped output agree + """check that grouped and non-grouped output (scalar and vector) agree when the grouped channels use a symmetry permutation of the momenta and the scales depend on the clustering (MLM). see issue #453""" @@ -504,7 +504,8 @@ def test_group_subprocess_permuted_scale(self): results = {} for name, group, vector_size in [('grouped', True, 1), ('grouped_vec', True, 16), - ('nongrouped', False, 1)]: + ('nongrouped', False, 1), + ('nongrouped_vec', False, 16)]: self.run_dir = pjoin(self.path, 'MGPROC_%s' % name) mg_cmd = MGCmd.MasterCmd() mg_cmd.no_notification() @@ -539,9 +540,10 @@ def test_group_subprocess_permuted_scale(self): val0, err0 = results['nongrouped'] self.assertGreater(val0, 0) - for name in ['grouped', 'grouped_vec']: + for name in ['grouped', 'grouped_vec', 'nongrouped_vec']: val, err = results[name] # without the fix, grouped is ~3% low (about 8 sigma) + # and nongrouped_vec gave NaN / "No points passed cuts" self.assertLess(abs(val - val0) / math.hypot(err, err0), 4, '%s: %s +- %s vs nongrouped %s +- %s' % (name, val, err, val0, err0)) From 0724e5ad08ed38fbb138aeb26ad8de8ccbc98d11 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:43:37 +0100 Subject: [PATCH 10/49] LHAPDF glue: read optional metadata without exceptions LHAPDF's Info::get_entry_as(key, fallback) throws a MetadataError and catches it internally when the key is missing from the member, the set and the global configuration. In executables linked by gfortran with Homebrew GCC on macOS, that catch is never reached (no C++ exception can be caught there), so the program aborts with MetadataError: Metadata for key: AlphaS_Lambda4 not found. as soon as a PDF set without AlphaS_Lambda4/5 is loaded, e.g. the NNPDF4.0 QED sets (NNPDF40_nlo_as_01180_qed), which give alpha_s as a table (AlphaS_Type: ipol) and do not need Lambda. All the optional reads of pdf_lhapdf6.cc and pdf_lhapdf62.cc (Lambda4/5, x and Q ranges, QCD orders, Pythia6LambdaV5Compat) now check has_key() first; the values are unchanged whenever the key exists. --- Template/Common/Source/PDF/pdf_lhapdf6.cc | 38 ++++++++++++++-------- Template/Common/Source/PDF/pdf_lhapdf62.cc | 38 ++++++++++++++-------- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/Template/Common/Source/PDF/pdf_lhapdf6.cc b/Template/Common/Source/PDF/pdf_lhapdf6.cc index 8862966185..551e27f343 100644 --- a/Template/Common/Source/PDF/pdf_lhapdf6.cc +++ b/Template/Common/Source/PDF/pdf_lhapdf6.cc @@ -11,6 +11,18 @@ #include "LHAPDF/Paths.h" #include "LHAPDF/Version.h" #include "LHAPDF/LHAGlue.h" + +// Optional metadata entries are read without exceptions: LHAPDF's +// get_entry_as(key, fallback) throws and catches internally when the key is +// missing from the member, the set and the global configuration, and that +// catch is never reached in an executable linked by gfortran with some +// toolchains (Homebrew GCC on macOS): the program aborts with +// "MetadataError: Metadata for key: ... not found", e.g. for AlphaS_Lambda4 +// with PDF sets that give alpha_s as a table (NNPDF4.0 QED). +template +static T lhapdf_entry_or(const LHAPDF::Info& info, const std::string& key, const T& fallback) { + return info.has_key(key) ? info.get_entry_as(key) : fallback; +} #include #include #include @@ -729,17 +741,17 @@ extern "C" { // Extract parameters for common blocks (with sensible fallback values) lhapdf_amc::PDFPtr pdf = lhapdf_amc::ACTIVESETS[1].activemember(); - w50513_.xmin = pdf->info().get_entry_as("XMin", 0.0); - w50513_.xmax = pdf->info().get_entry_as("XMax", 1.0); - w50513_.q2min = LHAPDF::sqr(pdf->info().get_entry_as("QMin", 1.0)); - w50513_.q2max = LHAPDF::sqr(pdf->info().get_entry_as("QMax", 1.0e5)); - w50512_.qcdl4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - w50512_.qcdl5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); - lhapdfr_.qcdlha4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - lhapdfr_.qcdlha5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); + w50513_.xmin = lhapdf_entry_or(pdf->info(), "XMin", 0.0); + w50513_.xmax = lhapdf_entry_or(pdf->info(), "XMax", 1.0); + w50513_.q2min = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMin", 1.0)); + w50513_.q2max = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMax", 1.0e5)); + w50512_.qcdl4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + w50512_.qcdl5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); + lhapdfr_.qcdlha4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + lhapdfr_.qcdlha5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); lhapdfr_.nfllha = 4; // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values - if (pdf->info().get_entry_as("Pythia6LambdaV5Compat", true)) { + if (lhapdf_entry_or(pdf->info(), "Pythia6LambdaV5Compat", true)) { w50512_.qcdl4 = 0.192; w50512_.qcdl5 = 0.192; lhapdfr_.qcdlha4 = 0.192; @@ -985,7 +997,7 @@ int LHAPDF::getOrderAlphaS(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return alphaS Order for the requested set - return ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_OrderQCD", -1); } @@ -998,7 +1010,7 @@ int LHAPDF::getOrderPDF(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return PDF order for the requested set - return ACTIVESETS[nset].activemember()->info().get_entry_as("OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "OrderQCD", -1); } @@ -1011,7 +1023,7 @@ double LHAPDF::getLam4(int nset, int nmem) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_Lambda4", -1.0); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda4", -1.0); } @@ -1024,7 +1036,7 @@ double LHAPDF::getLam5(int nset, int nmem) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_Lambda5", -1.0); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda5", -1.0); } diff --git a/Template/Common/Source/PDF/pdf_lhapdf62.cc b/Template/Common/Source/PDF/pdf_lhapdf62.cc index 638da38309..4964cf0ae7 100644 --- a/Template/Common/Source/PDF/pdf_lhapdf62.cc +++ b/Template/Common/Source/PDF/pdf_lhapdf62.cc @@ -11,6 +11,18 @@ #include "LHAPDF/Paths.h" #include "LHAPDF/Version.h" #include "LHAPDF/LHAGlue.h" + +// Optional metadata entries are read without exceptions: LHAPDF's +// get_entry_as(key, fallback) throws and catches internally when the key is +// missing from the member, the set and the global configuration, and that +// catch is never reached in an executable linked by gfortran with some +// toolchains (Homebrew GCC on macOS): the program aborts with +// "MetadataError: Metadata for key: ... not found", e.g. for AlphaS_Lambda4 +// with PDF sets that give alpha_s as a table (NNPDF4.0 QED). +template +static T lhapdf_entry_or(const LHAPDF::Info& info, const std::string& key, const T& fallback) { + return info.has_key(key) ? info.get_entry_as(key) : fallback; +} #include using namespace std; @@ -1034,7 +1046,7 @@ extern "C" { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - qcdl4 = ACTIVESETS[nset].activeMember()->info().get_entry_as("AlphaS_Lambda4", -1.0); + qcdl4 = lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "AlphaS_Lambda4", -1.0); } void getlam4_(const int& nmem, double& qcdl4) { int nset1 = 1; @@ -1047,7 +1059,7 @@ extern "C" { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - qcdl5 = ACTIVESETS[nset].activeMember()->info().get_entry_as("AlphaS_Lambda5", -1.0); + qcdl5 = lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "AlphaS_Lambda5", -1.0); } void getlam5_(const int& nmem, double& qcdl5) { int nset1 = 1; @@ -1164,17 +1176,17 @@ extern "C" { // Extract parameters for common blocks (with sensible fallback values) PDFPtr pdf = ACTIVESETS[1].activeMember(); - w50513_.xmin = pdf->info().get_entry_as("XMin", 0.0); - w50513_.xmax = pdf->info().get_entry_as("XMax", 1.0); - w50513_.q2min = LHAPDF::sqr(pdf->info().get_entry_as("QMin", 1.0)); - w50513_.q2max = LHAPDF::sqr(pdf->info().get_entry_as("QMax", 1.0e5)); - w50512_.qcdl4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - w50512_.qcdl5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); - lhapdfr_.qcdlha4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - lhapdfr_.qcdlha5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); + w50513_.xmin = lhapdf_entry_or(pdf->info(), "XMin", 0.0); + w50513_.xmax = lhapdf_entry_or(pdf->info(), "XMax", 1.0); + w50513_.q2min = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMin", 1.0)); + w50513_.q2max = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMax", 1.0e5)); + w50512_.qcdl4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + w50512_.qcdl5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); + lhapdfr_.qcdlha4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + lhapdfr_.qcdlha5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); lhapdfr_.nfllha = 4; // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values - if (pdf->info().get_entry_as("Pythia6LambdaV5Compat", true)) { + if (lhapdf_entry_or(pdf->info(), "Pythia6LambdaV5Compat", true)) { w50512_.qcdl4 = 0.192; w50512_.qcdl5 = 0.192; lhapdfr_.qcdlha4 = 0.192; @@ -1424,7 +1436,7 @@ int LHAPDF::getOrderAlphaS(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return alphaS Order for the requested set - return ACTIVESETS[nset].activeMember()->info().get_entry_as("AlphaS_OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "AlphaS_OrderQCD", -1); } @@ -1437,7 +1449,7 @@ int LHAPDF::getOrderPDF(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return PDF order for the requested set - return ACTIVESETS[nset].activeMember()->info().get_entry_as("OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "OrderQCD", -1); } From fd10b52dd6a58a9744b8a9b74e3b4a9cf670bd8b Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:49:19 +0100 Subject: [PATCH 11/49] Drop the LHAPDF 6.0/6.1 glue (pdf_lhapdf6.cc): require LHAPDF >= 6.2 pdf_lhapdf6.cc was only compiled for LHAPDF 6.1.X and needed boost; LHAPDF 6.2 dates from 2017. The PDF makefiles and link_lhapdf now stop with an explicit error for LHAPDF 6.0/6.1 instead. --- Template/Common/Source/PDF/pdf_lhapdf6.cc | 1136 -------------------- Template/LO/Source/PDF/makefile | 12 +- Template/NLO/Source/PDF/makefile | 12 +- madgraph/interface/common_run_interface.py | 3 + 4 files changed, 12 insertions(+), 1151 deletions(-) delete mode 100644 Template/Common/Source/PDF/pdf_lhapdf6.cc diff --git a/Template/Common/Source/PDF/pdf_lhapdf6.cc b/Template/Common/Source/PDF/pdf_lhapdf6.cc deleted file mode 100644 index 551e27f343..0000000000 --- a/Template/Common/Source/PDF/pdf_lhapdf6.cc +++ /dev/null @@ -1,1136 +0,0 @@ -// -*- C++ -*- -// -// This file is part of LHAPDF -// Copyright (C) 2012-2014 The LHAPDF collaboration (see AUTHORS for details) -// -#include "LHAPDF/PDF.h" -#include "LHAPDF/PDFSet.h" -#include "LHAPDF/PDFIndex.h" -#include "LHAPDF/Factories.h" -#include "LHAPDF/Utils.h" -#include "LHAPDF/Paths.h" -#include "LHAPDF/Version.h" -#include "LHAPDF/LHAGlue.h" - -// Optional metadata entries are read without exceptions: LHAPDF's -// get_entry_as(key, fallback) throws and catches internally when the key is -// missing from the member, the set and the global configuration, and that -// catch is never reached in an executable linked by gfortran with some -// toolchains (Homebrew GCC on macOS): the program aborts with -// "MetadataError: Metadata for key: ... not found", e.g. for AlphaS_Lambda4 -// with PDF sets that give alpha_s as a table (NNPDF4.0 QED). -template -static T lhapdf_entry_or(const LHAPDF::Info& info, const std::string& key, const T& fallback) { - return info.has_key(key) ? info.get_entry_as(key) : fallback; -} -#include -#include -#include -#include - -using namespace std; - - -// We have to create and initialise some common blocks here for backwards compatibility -struct w50512 { - double qcdl4, qcdl5; -}; -w50512 w50512_; - -struct w50513 { - double xmin, xmax, q2min, q2max; -}; -w50513 w50513_; - -struct lhapdfr { - double qcdlha4, qcdlha5; - int nfllha; -}; -lhapdfr lhapdfr_; - - - -namespace lhapdf_amc { //< Unnamed namespace to restrict visibility to this file - - /// @brief PDF object storage here is a smart pointer to ensure deletion of created PDFs - /// - /// NB. std::auto_ptr cannot be stored in STL containers, hence we use - /// boost::shared_ptr. std::unique_ptr is the nature replacement when C++11 - /// is globally available. - typedef boost::shared_ptr PDFPtr; - - /// @brief A struct for handling the active PDFs for the Fortran interface. - /// - /// We operate in a string-based way, since maybe there will be sets with names, but no - /// index entry in pdfsets.index. - /// - /// @todo Can we avoid the strings and just work via the LHAPDF ID and factory construction? - /// - /// Smart pointers are used in the native map used for PDF member storage so - /// that they auto-delete if the PDFSetHandler that holds them goes out of - /// scope (i.e. is overwritten). - struct PDFSetHandler { - - /// Default constructor - PDFSetHandler() : currentmem(0) - { } //< It'll be stored in a map so we need one of these... - - /// Constructor from a PDF set name - PDFSetHandler(const string& name) - : setname(name) - { - loadMember(0); - } - - /// Constructor from a PDF set's LHAPDF ID code - PDFSetHandler(int lhaid) { - pair set_mem = LHAPDF::lookupPDF(lhaid); - // First check that the lookup was successful, i.e. it was a valid ID for the LHAPDF6 set collection - if (set_mem.first.empty() || set_mem.second < 0) - throw LHAPDF::UserError("Could not find a valid PDF with LHAPDF ID = " + LHAPDF::to_str(lhaid)); - // Try to load this PDF (checking that the member number is in the set's range is done in mkPDF, called by loadMember) - setname = set_mem.first; - loadMember(set_mem.second); - } - - /// @brief Load a new PDF member - /// - /// If it's already loaded, the existing object will not be reloaded. - void loadMember(int mem) { - if (mem < 0) - throw LHAPDF::UserError("Tried to load a negative PDF member ID: " + LHAPDF::to_str(mem) + " in set " + setname); - if (members.find(mem) == members.end()) - members[mem] = PDFPtr(LHAPDF::mkPDF(setname, mem)); - currentmem = mem; - } - - /// Actively delete a PDF member to save memory - void unloadMember(int mem) { - members.erase(mem); - const int nextmem = (!members.empty()) ? members.begin()->first : 0; - loadMember(nextmem); - } - - /// @brief Get a PDF member - /// - /// Non-const because it can secretly load the member. Not that constness - /// matters in a Fortran interface utility function! - const PDFPtr member(int mem) { - loadMember(mem); - return members.find(mem)->second; - } - - /// Get the currently active PDF member - /// - /// Non-const because it can secretly load the member. Not that constness - /// matters in a Fortran interface utility function! - const PDFPtr activemember() { - return member(currentmem); - } - - /// The currently active member in this set - int currentmem; - - /// Name of this set - string setname; - - /// Map of pointers to selected member PDFs - /// - // /// It's mutable so that a "const" member-getting operation can implicitly - // /// load a new PDF object. Good idea / bad idea? Disabled for now. - // mutable map members; - map members; - }; - - - /// Collection of active sets - static map ACTIVESETS; - - /// The currently active set - int CURRENTSET = 0; - -} - - - -string lhaglue_get_current_pdf(int nset) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - return "NONE"; - lhapdf_amc::CURRENTSET = nset; - return lhapdf_amc::ACTIVESETS[nset].activemember()->set().name() + " (" + - LHAPDF::to_str(lhapdf_amc::ACTIVESETS[nset].activemember()->lhapdfID()) + ")"; -} - - - -extern "C" { - - // NEW FORTRAN INTERFACE FUNCTIONS - - /// List of available sets - void lhapdf_getversion_(char* s, size_t len) { - strncpy(s, LHAPDF_VERSION, len); - } - - /// List of available PDF sets, returned as a space-separated string - void lhapdf_getpdfsetlist_(char* s, size_t len) { - string liststr; - BOOST_FOREACH(const string& setname, LHAPDF::availablePDFSets()) { - if (!liststr.empty()) liststr += " "; - liststr += setname; - } - strncpy(s, liststr.c_str(), len); - } - - - ////////////////// - - // LHAPDF5 / PDFLIB COMPATIBILITY INTERFACE FUNCTIONS - - - // System-level info - - /// LHAPDF library version - void getlhapdfversion_(char* s, size_t len) { - /// @todo Works? Need to check Fortran string return, string macro treatment, etc. - strncpy(s, LHAPDF_VERSION, len); - } - - - /// Does nothing, only provided for backward compatibility - void lhaprint_(int& a) { } - - - /// Set LHAPDF parameters -- does nothing in LHAPDF6! - void setlhaparm_(const char* par, int parlength) { - /// @todo Can any Fortran LHAPDF params be usefully mapped? - } - - - /// Return a dummy max number of sets (there is no limitation now) - void getmaxnumsets_(int& nmax) { - nmax = 1000; - } - - - /// Set PDF data path - void setpdfpath_(const char* s, size_t len) { - /// @todo Works? Need to check C-string copying, null termination - char s2[1024]; - s2[len] = '\0'; - strncpy(s2, s, len); - LHAPDF::pathsPrepend(s2); - } - - /// Get PDF data path (colon-separated if there is more than one element) - void getdatapath_(char* s, size_t len) { - /// @todo Works? Need to check Fortran string return, string macro treatment, etc. - string pathstr; - BOOST_FOREACH(const string& path, LHAPDF::paths()) { - if (!pathstr.empty()) pathstr += ":"; - pathstr += path; - } - strncpy(s, pathstr.c_str(), len); - } - - - // PDF initialisation and focus-switching - - /// Load a PDF set - /// - /// @todo Does this version actually take a *path*? What to do? - void initpdfsetm_(const int& nset, const char* setpath, int setpathlength) { - // Strip file extension for backward compatibility - string fullp = string(setpath, setpathlength); - // Remove trailing whitespace - fullp.erase( std::remove_if( fullp.begin(), fullp.end(), ::isspace ), fullp.end() ); - // Use only items after the last / - const string pap = LHAPDF::dirname(fullp); - const string p = LHAPDF::basename(fullp); - // Prepend path to search area - LHAPDF::pathsPrepend(pap); - // Handle extensions - string path = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p); - /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case. - if (boost::algorithm::to_lower_copy(path) == "cteq6ll") path = "cteq6l1"; - // Create the PDF set with index nset - // if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - lhapdf_amc::ACTIVESETS[nset] = lhapdf_amc::PDFSetHandler(path); //< @todo Will be wrong if a structured path is given - lhapdf_amc::CURRENTSET = nset; - } - /// Load a PDF set (non-multiset version) - void initpdfset_(const char* setpath, int setpathlength) { - int nset1 = 1; - initpdfsetm_(nset1, setpath, setpathlength); - } - - - /// Load a PDF set by name - void initpdfsetbynamem_(const int& nset, const char* setname, int setnamelength) { - // Truncate input to size setnamelength - string p = setname; - p.erase(setnamelength, std::string::npos); - // Strip file extension for backward compatibility - string name = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p); - // Remove trailing whitespace - name.erase( std::remove_if( name.begin(), name.end(), ::isspace ), name.end() ); - /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case. - if (boost::algorithm::to_lower_copy(name) == "cteq6ll") name = "cteq6l1"; - // Create the PDF set with index nset - // if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - lhapdf_amc::ACTIVESETS[nset] = lhapdf_amc::PDFSetHandler(name); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Load a PDF set by name (non-multiset version) - void initpdfsetbyname_(const char* setname, int setnamelength) { - int nset1 = 1; - initpdfsetbynamem_(nset1, setname, setnamelength); - } - - - /// Load a PDF in current set - void initpdfm_(const int& nset, const int& nmember) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - lhapdf_amc::ACTIVESETS[nset].loadMember(nmember); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Load a PDF in current set (non-multiset version) - void initpdf_(const int& nmember) { - int nset1 = 1; - initpdfm_(nset1, nmember); - } - - - /// Get the current set number (i.e. allocation slot index) - void getnset_(int& nset) { - nset = lhapdf_amc::CURRENTSET; - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - } - - /// Explicitly set the current set number (i.e. allocation slot index) - void setnset_(const int& nset) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - lhapdf_amc::CURRENTSET = nset; - } - - - /// Get the current member number in slot nset - void getnmem_(int& nset, int& nmem) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - nmem = lhapdf_amc::ACTIVESETS[nset].currentmem; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - - /// Set the current member number in slot nset - void setnmem_(const int& nset, const int& nmem) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + - LHAPDF::to_str(nset) + " but it is not initialised"); - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - - - - // PDF evolution functions - - /// Get xf(x) values for common partons from current PDF - void evolvepdfm_(const int& nset, const double& x, const double& q, double* fxq) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // Evaluate for the 13 LHAPDF5 standard partons (-6..6) - for (size_t i = 0; i < 13; ++i) { - try { - fxq[i] = lhapdf_amc::ACTIVESETS[nset].activemember()->xfxQ(i-6, x, q); - } catch (const exception& e) { - fxq[i] = 0; - } - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get xf(x) values for common partons from current PDF (non-multiset version) - void evolvepdf_(const double& x, const double& q, double* fxq) { - int nset1 = 1; - evolvepdfm_(nset1, x, q, fxq); - } - - // PDF evolution functions - // NEW BY MZ to evolve one single parton - - /// Get xf(x) values for common partons from current PDF - void evolvepartm_(const int& nset, const int& ipart, const double& x, const double& q, double& fxq) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - int ipart_copy; // this is to deal with photons, which are labeled 7 in MG5aMC - ipart_copy = ipart; - if (ipart==7) ipart_copy = 22; - try { - fxq = lhapdf_amc::ACTIVESETS[nset].activemember()->xfxQ(ipart_copy, x, q); - } catch (const exception& e) { - fxq = 0; - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get xf(x) values for common partons from current PDF (non-multiset version) - void evolvepart_( const int& ipart, const double& x, const double& q, double& fxq) { - int nset1 = 1; - evolvepartm_(nset1, ipart, x, q, fxq); - } - - - /// Determine if the current PDF has a photon flavour (historically only MRST2004QED) - /// @todo Function rather than subroutine? - /// @note There is no multiset version. has_photon will respect the current set slot. - bool has_photon_() { - return lhapdf_amc::ACTIVESETS[lhapdf_amc::CURRENTSET].activemember()->hasFlavor(22); - } - - - /// Get xfx values from current PDF, including an extra photon flavour - void evolvepdfphotonm_(const int& nset, const double& x, const double& q, double* fxq, double& photonfxq) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // First evaluate the "normal" partons - evolvepdfm_(nset, x, q, fxq); - // Then evaluate the photon flavor (historically only for MRST2004QED) - try { - photonfxq = lhapdf_amc::ACTIVESETS[nset].activemember()->xfxQ(22, x, q); - } catch (const exception& e) { - photonfxq = 0; - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get xfx values from current PDF, including an extra photon flavour (non-multiset version) - void evolvepdfphoton_(const double& x, const double& q, double* fxq, double& photonfxq) { - int nset1 = 1; - evolvepdfphotonm_(nset1, x, q, fxq, photonfxq); - } - - - /// Get xf(x) values for common partons from a photon PDF - void evolvepdfpm_(const int& nset, const double& x, const double& q, const double& p2, const int& ip2, double& fxq) { - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported in LHAPDF6"); - } - /// Get xf(x) values for common partons from a photon PDF (non-multiset version) - void evolvepdfp_(const double& x, const double& q, const double& p2, const int& ip2, double& fxq) { - int nset1 = 1; - evolvepdfpm_(nset1, x, q, p2, ip2, fxq); - } - - - // alpha_s evolution - - /// Get the alpha_s order for the set - void getorderasm_(const int& nset, int& oas) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // Set equal to the number of members for the requested set - oas = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_OrderQCD"); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the alpha_s order for the set (non-multiset version) - void getorderas_(int& oas) { - int nset1 = 1; - getorderasm_(nset1, oas); - } - - - /// Get the alpha_s(Q) value for set nset - double alphaspdfm_(const int& nset, const double& Q){ - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - return lhapdf_amc::ACTIVESETS[nset].activemember()->alphasQ(Q); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the alpha_s(Q) value for the set (non-multiset version) - double alphaspdf_(const double& Q){ - int nset1 = 1; - return alphaspdfm_(nset1, Q); - } - - - // Metadata functions - - /// Get the number of error members in the set (with special treatment for single member sets) - void numberpdfm_(const int& nset, int& numpdf) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // Set equal to the number of members for the requested set - numpdf= lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("NumMembers"); - // Reproduce old LHAPDF v5 behaviour, i.e. subtract 1 if more than 1 member set - if (numpdf > 1) numpdf -= 1; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the number of error members in the set (non-multiset version) - void numberpdf_(int& numpdf) { - int nset1 = 1; - numberpdfm_(nset1, numpdf); - } - - - /// Get the max number of active flavours - void getnfm_(const int& nset, int& nf) { - //nf = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_NumFlavors"); - nf = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("NumFlavors"); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the max number of active flavours (non-multiset version) - void getnf_(int& nf) { - int nset1 = 1; - getnfm_(nset1, nf); - } - - - /// Get nf'th quark mass - void getqmassm_(const int& nset, const int& nf, double& mass) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - if (nf*nf == 1) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MDown"); - else if (nf*nf == 4) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MUp"); - else if (nf*nf == 9) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MStrange"); - else if (nf*nf == 16) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MCharm"); - else if (nf*nf == 25) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MBottom"); - else if (nf*nf == 36) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MTop"); - else throw LHAPDF::UserError("Trying to get quark mass for invalid quark ID #" + LHAPDF::to_str(nf)); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get nf'th quark mass (non-multiset version) - void getqmass_(const int& nf, double& mass) { - int nset1 = 1; - getqmassm_(nset1, nf, mass); - } - - - /// Get the nf'th quark threshold - void getthresholdm_(const int& nset, const int& nf, double& Q) { - try { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - if (nf*nf == 1) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdDown"); - else if (nf*nf == 4) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdUp"); - else if (nf*nf == 9) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdStrange"); - else if (nf*nf == 16) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdCharm"); - else if (nf*nf == 25) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdBottom"); - else if (nf*nf == 36) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdTop"); - //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf)); - } catch (...) { - getqmassm_(nset, nf, Q); - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the nf'th quark threshold - void getthreshold_(const int& nf, double& Q) { - int nset1 = 1; - getthresholdm_(nset1, nf, Q); - } - - - /// Print PDF set's description to stdout - void getdescm_(const int& nset) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - cout << lhapdf_amc::ACTIVESETS[nset].activemember()->description() << endl; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getdesc_() { - int nset1 = 1; - getdescm_(nset1); - } - - - void getxminm_(const int& nset, const int& nmem, double& xmin) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - xmin = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMin"); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getxmin_(const int& nmem, double& xmin) { - int nset1 = 1; - getxminm_(nset1, nmem, xmin); - } - - - void getxmaxm_(const int& nset, const int& nmem, double& xmax) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - xmax = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMax"); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getxmax_(const int& nmem, double& xmax) { - int nset1 = 1; - getxmaxm_(nset1, nmem, xmax); - } - - - void getq2minm_(const int& nset, const int& nmem, double& q2min) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - q2min = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMin")); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getq2min_(const int& nmem, double& q2min) { - int nset1 = 1; - getq2minm_(nset1, nmem, q2min); - } - - - void getq2maxm_(const int& nset, const int& nmem, double& q2max) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - q2max = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMax")); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getq2max_(const int& nmem, double& q2max) { - int nset1 = 1; - getq2maxm_(nset1, nmem, q2max); - } - - - void getminmaxm_(const int& nset, const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - xmin = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMin"); - xmax = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMax"); - q2min = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMin")); - q2max = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMax")); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getminmax_(const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) { - int nset1 = 1; - getminmaxm_(nset1, nmem, xmin, xmax, q2min, q2max); - } - - - - /// Backwards compatibility functions for LHAPDF5 calculations of - /// PDF uncertainties and PDF correlations (G. Watt, March 2014). - - // subroutine GetPDFUncTypeM(nset,lMonteCarlo,lSymmetric) - void getpdfunctypem_(const int& nset, int& lmontecarlo, int& lsymmetric) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const string errorType = lhapdf_amc::ACTIVESETS[nset].activemember()->set().errorType(); - if (errorType == "replicas") { // Monte Carlo PDF sets - lmontecarlo = 1; - lsymmetric = 1; - } else if (errorType == "symmhessian") { // symmetric eigenvector PDF sets - lmontecarlo = 0; - lsymmetric = 1; - } else { // default: assume asymmetric Hessian eigenvector PDF sets - lmontecarlo = 0; - lsymmetric = 0; - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - // subroutine GetPDFUncType(lMonteCarlo,lSymmetric) - void getpdfunctype_(int& lmontecarlo, int& lsymmetric) { - int nset1 = 1; - getpdfunctypem_(nset1, lmontecarlo, lsymmetric); - } - - - // subroutine GetPDFuncertaintyM(nset,values,central,errplus,errminus,errsym) - void getpdfuncertaintym_(const int& nset, const double* values, double& central, double& errplus, double& errminus, double& errsymm) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const size_t nmem = lhapdf_amc::ACTIVESETS[nset].activemember()->set().size()-1; - const vector vecvalues(values, values + nmem + 1); - LHAPDF::PDFUncertainty err = lhapdf_amc::ACTIVESETS[nset].activemember()->set().uncertainty(vecvalues, -1); - central = err.central; - errplus = err.errplus; - errminus = err.errminus; - errsymm = err.errsymm; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - // subroutine GetPDFuncertainty(values,central,errplus,errminus,errsym) - void getpdfuncertainty_(const double* values, double& central, double& errplus, double& errminus, double& errsymm) { - int nset1 = 1; - getpdfuncertaintym_(nset1, values, central, errplus, errminus, errsymm); - } - - - // subroutine GetPDFcorrelationM(nset,valuesA,valuesB,correlation) - void getpdfcorrelationm_(const int& nset, const double* valuesA, const double* valuesB, double& correlation) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const size_t nmem = lhapdf_amc::ACTIVESETS[nset].activemember()->set().size()-1; - const vector vecvaluesA(valuesA, valuesA + nmem + 1); - const vector vecvaluesB(valuesB, valuesB + nmem + 1); - correlation = lhapdf_amc::ACTIVESETS[nset].activemember()->set().correlation(vecvaluesA,vecvaluesB); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - // subroutine GetPDFcorrelation(valuesA,valuesB,correlation) - void getpdfcorrelation_(const double* valuesA, const double* valuesB, double& correlation) { - int nset1 = 1; - getpdfcorrelationm_(nset1, valuesA, valuesB, correlation); - } - - - /////////////////////////////////////// - - - /// REALLY OLD PDFLIB COMPATILITY FUNCTIONS - - /// PDFLIB initialisation function - void pdfset_(const char* par, const double* value, int parlength) { - - // Identify the calling program (yuck!) - string my_par(par); - if (my_par.find("NPTYPE") != string::npos) { - cout << "==== LHAPDF6 USING PYTHIA-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[2] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[2]+1000*value[1]); - } else if (my_par.find("HWLHAPDF") != string::npos) { - cout << "==== LHAPDF6 USING HERWIG-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[0] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[0]); - } else if (my_par.find("DEFAULT") != string::npos) { - cout << "==== LHAPDF6 USING DEFAULT-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[0] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[0]); - } else { - cout << "==== LHAPDF6 USING PDFLIB-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[2] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[2]+1000*value[1]); - } - - lhapdf_amc::CURRENTSET = 1; - - // Extract parameters for common blocks (with sensible fallback values) - lhapdf_amc::PDFPtr pdf = lhapdf_amc::ACTIVESETS[1].activemember(); - w50513_.xmin = lhapdf_entry_or(pdf->info(), "XMin", 0.0); - w50513_.xmax = lhapdf_entry_or(pdf->info(), "XMax", 1.0); - w50513_.q2min = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMin", 1.0)); - w50513_.q2max = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMax", 1.0e5)); - w50512_.qcdl4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); - w50512_.qcdl5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); - lhapdfr_.qcdlha4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); - lhapdfr_.qcdlha5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); - lhapdfr_.nfllha = 4; - // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values - if (lhapdf_entry_or(pdf->info(), "Pythia6LambdaV5Compat", true)) { - w50512_.qcdl4 = 0.192; - w50512_.qcdl5 = 0.192; - lhapdfr_.qcdlha4 = 0.192; - lhapdfr_.qcdlha5 = 0.192; - } - } - - /// PDFLIB nucleon structure function querying - void structm_(const double& x, const double& q, - double& upv, double& dnv, double& usea, double& dsea, - double& str, double& chm, double& bot, double& top, double& glu) { - lhapdf_amc::CURRENTSET = 1; - /// Fill (partial) parton return variables - lhapdf_amc::PDFPtr pdf = lhapdf_amc::ACTIVESETS[1].activemember(); - dsea = pdf->xfxQ(-1, x, q); - usea = pdf->xfxQ(-2, x, q); - dnv = pdf->xfxQ(1, x, q) - dsea; - upv = pdf->xfxQ(2, x, q) - usea; - str = pdf->xfxQ(3, x, q); - chm = (pdf->hasFlavor(4)) ? pdf->xfxQ(4, x, q) : 0; - bot = (pdf->hasFlavor(5)) ? pdf->xfxQ(5, x, q) : 0; - top = (pdf->hasFlavor(6)) ? pdf->xfxQ(6, x, q) : 0; - glu = pdf->xfxQ(21, x, q); - } - - /// PDFLIB photon structure function querying - void structp_(const double& x, const double& q2, const double& p2, const double& ip2, - double& upv, double& dnv, double& usea, double& dsea, - double& str, double& chm, double& bot, double& top, double& glu) { - throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported"); - } - - /// PDFLIB statistics on PDF under/overflows - void pdfsta_() { - /// @note Can't do anything... - } - - -} - - -// LHAPDF namespace C++ compatibility code -#ifdef ENABLE_LHAGLUE_CXX - - -void LHAPDF::setVerbosity(LHAPDF::Verbosity noiselevel) { - LHAPDF::setVerbosity((int) noiselevel); -} - -void LHAPDF::setPDFPath(const string& path) { - pathsPrepend(path); -} - -string LHAPDF::pdfsetsPath() { - return paths()[0]; -} - -int LHAPDF::numberPDF() { - int nmem; - numberpdf_(nmem); - return nmem; -} -int LHAPDF::numberPDF(int nset) { - int nmem; - numberpdfm_(nset,nmem); - return nmem; -} - -void LHAPDF::initPDF( int memset) { - int nset1 = 1; - initpdfm_(nset1, memset); -} -void LHAPDF::initPDF(int nset, int memset) { - initpdfm_(nset, memset); -} - - -double LHAPDF::xfx(double x, double Q, int fl) { - vector r(13); - evolvepdf_(x, Q, &r[0]); - return r[fl+6]; -} -double LHAPDF::xfx(int nset, double x, double Q, int fl) { - vector r(13); - evolvepdfm_(nset, x, Q, &r[0]); - return r[fl+6]; -} - -vector LHAPDF::xfx(double x, double Q) { - vector r(13); - evolvepdf_(x, Q, &r[0]); - return r; -} -vector LHAPDF::xfx(int nset, double x, double Q) { - vector r(13); - evolvepdfm_(nset, x, Q, &r[0]); - return r; -} - -void LHAPDF::xfx(double x, double Q, double* results) { - evolvepdf_(x, Q, results); -} -void LHAPDF::xfx(int nset, double x, double Q, double* results) { - evolvepdfm_(nset, x, Q, results); -} - - -vector LHAPDF::xfxphoton(double x, double Q) { - vector r(13); - double mphoton; - evolvepdfphoton_(x, Q, &r[0], mphoton); - r.push_back(mphoton); - return r; -} -vector LHAPDF::xfxphoton(int nset, double x, double Q) { - vector r(13); - double mphoton; - evolvepdfphotonm_(nset, x, Q, &r[0], mphoton); - r.push_back(mphoton); - return r; -} - -void LHAPDF::xfxphoton(double x, double Q, double* results) { - evolvepdfphoton_(x, Q, results, results[13]); -} -void LHAPDF::xfxphoton(int nset, double x, double Q, double* results) { - evolvepdfphotonm_(nset, x, Q, results, results[13]); -} - -double LHAPDF::xfxphoton(double x, double Q, int fl) { - vector r(13); - double mphoton; - evolvepdfphoton_(x, Q, &r[0], mphoton); - if (fl == 7) return mphoton; - return r[fl+6]; -} -double LHAPDF::xfxphoton(int nset, double x, double Q, int fl) { - vector r(13); - double mphoton; - evolvepdfphotonm_(nset, x, Q, &r[0], mphoton); - if ( fl == 7 ) return mphoton; - return r[fl+6]; -} - - -void LHAPDF::initPDFSet(const string& filename, int nmem) { - initPDFSet(1,filename, nmem); -} - -void LHAPDF::initPDFSet(int nset, const string& filename, int nmem) { - initPDFSetByName(nset,filename); - ACTIVESETS[nset].loadMember(nmem); - CURRENTSET = nset; -} - - -void LHAPDF::initPDFSet(const string& filename, SetType type ,int nmem) { - // silently ignore type - initPDFSet(1,filename, nmem); -} - -void LHAPDF::initPDFSet(int nset, const string& filename, SetType type ,int nmem) { - // silently ignore type - initPDFSetByName(nset,filename); - ACTIVESETS[nset].loadMember(nmem); - CURRENTSET = nset; -} - -void LHAPDF::initPDFSet(int nset, int setid, int nmem) { - ACTIVESETS[nset] = PDFSetHandler(setid); // - CURRENTSET = nset; -} - -void LHAPDF::initPDFSet(int setid, int nmem) { - initPDFSet(1,setid,nmem); -} - -#define SIZE 999 -void LHAPDF::initPDFSetByName(const string& filename) { - std::cout << "initPDFSetByName: " << filename << std::endl; - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbyname_(cfilename, filename.length()); -} - -void LHAPDF::initPDFSetByName(int nset, const string& filename) { - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbynamem_(nset, cfilename, filename.length()); -} - -void LHAPDF::initPDFSetByName(const string& filename, SetType type) { - //silently ignore type - std::cout << "initPDFSetByName: " << filename << std::endl; - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbyname_(cfilename, filename.length()); -} - -void LHAPDF::initPDFSetByName(int nset, const string& filename, SetType type) { - //silently ignore type - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbynamem_(nset, cfilename, filename.length()); -} - - -void LHAPDF::getDescription() { - getDescription(1); -} - -void LHAPDF::getDescription(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - cout << ACTIVESETS[nset].activemember()->set().description() << endl; -} - - -double LHAPDF::alphasPDF(double Q) { - return LHAPDF::alphasPDF(1, Q) ; -} - -double LHAPDF::alphasPDF(int nset, double Q) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS for the requested set - return ACTIVESETS[nset].activemember()->alphasQ(Q); -} - - -bool LHAPDF::hasPhoton(){ - return has_photon_(); -} - - -int LHAPDF::getOrderAlphaS() { - return LHAPDF::getOrderAlphaS(1) ; -} - -int LHAPDF::getOrderAlphaS(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_OrderQCD", -1); -} - - -int LHAPDF::getOrderPDF() { - return LHAPDF::getOrderPDF(1) ; -} - -int LHAPDF::getOrderPDF(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return PDF order for the requested set - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "OrderQCD", -1); -} - - -double LHAPDF::getLam4(int nmem) { - return LHAPDF::getLam4(1, nmem) ; -} - -double LHAPDF::getLam4(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - ACTIVESETS[nset].loadMember(nmem); - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda4", -1.0); -} - - -double LHAPDF::getLam5(int nmem) { - return LHAPDF::getLam5(1, nmem) ; -} - -double LHAPDF::getLam5(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - ACTIVESETS[nset].loadMember(nmem); - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda5", -1.0); -} - - -int LHAPDF::getNf() { - return LHAPDF::getNf(1) ; -} - -int LHAPDF::getNf(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - return ACTIVESETS[nset].activemember()->info().get_entry_as("NumFlavors"); -} - - -double LHAPDF::getXmin(int nmem) { - return LHAPDF::getXmin(1, nmem) ; -} - -double LHAPDF::getXmin(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("XMin"); -} - -double LHAPDF::getXmax(int nmem) { - return LHAPDF::getXmax(1, nmem) ; -} - -double LHAPDF::getXmax(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("XMax"); -} - -double LHAPDF::getQ2min(int nmem) { - return LHAPDF::getQ2min(1, nmem) ; -} - -double LHAPDF::getQ2min(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return pow(ACTIVESETS[nset].activemember()->info().get_entry_as("QMin"),2); -} - -double LHAPDF::getQ2max(int nmem) { - return LHAPDF::getQ2max(1,nmem) ; -} - -double LHAPDF::getQ2max(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return pow(ACTIVESETS[nset].activemember()->info().get_entry_as("QMax"),2); -} - -double LHAPDF::getQMass(int nf) { - return LHAPDF::getQMass(1, nf) ; -} - -double LHAPDF::getQMass(int nset, int nf) { - double mass; - getqmassm_(nset, nf, mass); - return mass; -} - -double LHAPDF::getThreshold(int nf) { - return LHAPDF::getThreshold(1, nf) ; -} - -double LHAPDF::getThreshold(int nset, int nf) { - double thres; - getthresholdm_(nset, nf, thres); - return thres; -} - -void LHAPDF::usePDFMember(int member) { - initpdf_(member); -} - -void LHAPDF::usePDFMember(int nset, int member) { - initpdfm_(nset, member); -} - -#endif // ENABLE_LHAGLUE_CXX diff --git a/Template/LO/Source/PDF/makefile b/Template/LO/Source/PDF/makefile index bcaf733469..f5e0871554 100644 --- a/Template/LO/Source/PDF/makefile +++ b/Template/LO/Source/PDF/makefile @@ -44,15 +44,11 @@ ifdef lhapdf PDF += pdfwrap_lhapdf.o pdg2pdf_lhapdf6.o ifeq ($(lhapdfversion),5) $(error Bad lhadpfversion version 6 is now required) + else ifneq (,$(filter 0 1,$(lhapdfsubversion))) # 6.0.X, 6.1.X + $(error LHAPDF 6.2 or later is required) else - ifeq ($(lhapdfsubversion),1) # 6.1.X - PDF += pdf_lhapdf6.o - TOREMOVE += pdf_lhapdf62.o - else # 6.2.X - CXXFLAGS+=-std=c++11 - PDF += pdf_lhapdf62.o - TOREMOVE += pdf_lhapdf6.o - endif + CXXFLAGS+=-std=c++11 + PDF += pdf_lhapdf62.o endif else TOREMOVE += pdfwrap_lhapdf.o diff --git a/Template/NLO/Source/PDF/makefile b/Template/NLO/Source/PDF/makefile index bfffd79c48..83a23d673a 100644 --- a/Template/NLO/Source/PDF/makefile +++ b/Template/NLO/Source/PDF/makefile @@ -13,13 +13,11 @@ include ../make_opts ifdef lhapdf ifeq ($(lhapdfversion),5) PDF = pdfwrap_lhapdf.o pdf_lhapdf.o pdg2pdf_lhapdf.o opendata.o - else # lhapdf v6 - ifeq ($(lhapdfsubversion),1) # 6.1.X - PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o - else # 6.2.X - CXXFLAGS+=-std=c++11 - PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o - endif + else ifneq (,$(filter 0 1,$(lhapdfsubversion))) # 6.0.X, 6.1.X + $(error LHAPDF 6.2 or later is required) + else # lhapdf v6.2 or later + CXXFLAGS+=-std=c++11 + PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o endif else ifdef epdf CXXFLAGS+=-std=c++11 diff --git a/madgraph/interface/common_run_interface.py b/madgraph/interface/common_run_interface.py index f40549ab92..81a3c3c468 100755 --- a/madgraph/interface/common_run_interface.py +++ b/madgraph/interface/common_run_interface.py @@ -4423,6 +4423,9 @@ def link_lhapdf(self, libdir, extra_dirs = []): lhapdf_version = self.get_lhapdf_version() logger.info('Using LHAPDF v%s interface for PDFs' % lhapdf_version) + if lhapdf_version.startswith(('6.0.', '6.1.')): + raise MadGraph5Error('LHAPDF %s is not supported anymore: ' % lhapdf_version + + 'please use LHAPDF 6.2 or later (e.g. "install lhapdf6").') lhalibdir = subprocess.Popen([self.options['lhapdf'], '--libdir'], stdout = subprocess.PIPE).stdout.read().decode(errors='ignore').strip() From c8d2ef2f53fd4d8370550ddbda088e5be2097cb8 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:43:37 +0100 Subject: [PATCH 12/49] LHAPDF glue: read optional metadata without exceptions LHAPDF's Info::get_entry_as(key, fallback) throws a MetadataError and catches it internally when the key is missing from the member, the set and the global configuration. In executables linked by gfortran with Homebrew GCC on macOS, that catch is never reached (no C++ exception can be caught there), so the program aborts with MetadataError: Metadata for key: AlphaS_Lambda4 not found. as soon as a PDF set without AlphaS_Lambda4/5 is loaded, e.g. the NNPDF4.0 QED sets (NNPDF40_nlo_as_01180_qed), which give alpha_s as a table (AlphaS_Type: ipol) and do not need Lambda. All the optional reads of pdf_lhapdf6.cc and pdf_lhapdf62.cc (Lambda4/5, x and Q ranges, QCD orders, Pythia6LambdaV5Compat) now check has_key() first; the values are unchanged whenever the key exists. --- Template/Common/Source/PDF/pdf_lhapdf6.cc | 38 ++++++++++++++-------- Template/Common/Source/PDF/pdf_lhapdf62.cc | 38 ++++++++++++++-------- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/Template/Common/Source/PDF/pdf_lhapdf6.cc b/Template/Common/Source/PDF/pdf_lhapdf6.cc index 613dde6c3b..5b6e8cd4d4 100644 --- a/Template/Common/Source/PDF/pdf_lhapdf6.cc +++ b/Template/Common/Source/PDF/pdf_lhapdf6.cc @@ -11,6 +11,18 @@ #include "LHAPDF/Paths.h" #include "LHAPDF/Version.h" #include "LHAPDF/LHAGlue.h" + +// Optional metadata entries are read without exceptions: LHAPDF's +// get_entry_as(key, fallback) throws and catches internally when the key is +// missing from the member, the set and the global configuration, and that +// catch is never reached in an executable linked by gfortran with some +// toolchains (Homebrew GCC on macOS): the program aborts with +// "MetadataError: Metadata for key: ... not found", e.g. for AlphaS_Lambda4 +// with PDF sets that give alpha_s as a table (NNPDF4.0 QED). +template +static T lhapdf_entry_or(const LHAPDF::Info& info, const std::string& key, const T& fallback) { + return info.has_key(key) ? info.get_entry_as(key) : fallback; +} #include #include #include @@ -732,17 +744,17 @@ extern "C" { // Extract parameters for common blocks (with sensible fallback values) lhapdf_amc::PDFPtr pdf = lhapdf_amc::ACTIVESETS[1].activemember(); - w50513_.xmin = pdf->info().get_entry_as("XMin", 0.0); - w50513_.xmax = pdf->info().get_entry_as("XMax", 1.0); - w50513_.q2min = LHAPDF::sqr(pdf->info().get_entry_as("QMin", 1.0)); - w50513_.q2max = LHAPDF::sqr(pdf->info().get_entry_as("QMax", 1.0e5)); - w50512_.qcdl4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - w50512_.qcdl5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); - lhapdfr_.qcdlha4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - lhapdfr_.qcdlha5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); + w50513_.xmin = lhapdf_entry_or(pdf->info(), "XMin", 0.0); + w50513_.xmax = lhapdf_entry_or(pdf->info(), "XMax", 1.0); + w50513_.q2min = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMin", 1.0)); + w50513_.q2max = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMax", 1.0e5)); + w50512_.qcdl4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + w50512_.qcdl5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); + lhapdfr_.qcdlha4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + lhapdfr_.qcdlha5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); lhapdfr_.nfllha = 4; // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values - if (pdf->info().get_entry_as("Pythia6LambdaV5Compat", true)) { + if (lhapdf_entry_or(pdf->info(), "Pythia6LambdaV5Compat", true)) { w50512_.qcdl4 = 0.192; w50512_.qcdl5 = 0.192; lhapdfr_.qcdlha4 = 0.192; @@ -988,7 +1000,7 @@ int LHAPDF::getOrderAlphaS(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return alphaS Order for the requested set - return ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_OrderQCD", -1); } @@ -1001,7 +1013,7 @@ int LHAPDF::getOrderPDF(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return PDF order for the requested set - return ACTIVESETS[nset].activemember()->info().get_entry_as("OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "OrderQCD", -1); } @@ -1014,7 +1026,7 @@ double LHAPDF::getLam4(int nset, int nmem) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_Lambda4", -1.0); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda4", -1.0); } @@ -1027,7 +1039,7 @@ double LHAPDF::getLam5(int nset, int nmem) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_Lambda5", -1.0); + return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda5", -1.0); } diff --git a/Template/Common/Source/PDF/pdf_lhapdf62.cc b/Template/Common/Source/PDF/pdf_lhapdf62.cc index d52d83be14..52fcd36d96 100644 --- a/Template/Common/Source/PDF/pdf_lhapdf62.cc +++ b/Template/Common/Source/PDF/pdf_lhapdf62.cc @@ -11,6 +11,18 @@ #include "LHAPDF/Paths.h" #include "LHAPDF/Version.h" #include "LHAPDF/LHAGlue.h" + +// Optional metadata entries are read without exceptions: LHAPDF's +// get_entry_as(key, fallback) throws and catches internally when the key is +// missing from the member, the set and the global configuration, and that +// catch is never reached in an executable linked by gfortran with some +// toolchains (Homebrew GCC on macOS): the program aborts with +// "MetadataError: Metadata for key: ... not found", e.g. for AlphaS_Lambda4 +// with PDF sets that give alpha_s as a table (NNPDF4.0 QED). +template +static T lhapdf_entry_or(const LHAPDF::Info& info, const std::string& key, const T& fallback) { + return info.has_key(key) ? info.get_entry_as(key) : fallback; +} #include using namespace std; @@ -1035,7 +1047,7 @@ extern "C" { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - qcdl4 = ACTIVESETS[nset].activeMember()->info().get_entry_as("AlphaS_Lambda4", -1.0); + qcdl4 = lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "AlphaS_Lambda4", -1.0); } void getlam4_(const int& nmem, double& qcdl4) { int nset1 = 1; @@ -1048,7 +1060,7 @@ extern "C" { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; ACTIVESETS[nset].loadMember(nmem); - qcdl5 = ACTIVESETS[nset].activeMember()->info().get_entry_as("AlphaS_Lambda5", -1.0); + qcdl5 = lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "AlphaS_Lambda5", -1.0); } void getlam5_(const int& nmem, double& qcdl5) { int nset1 = 1; @@ -1165,17 +1177,17 @@ extern "C" { // Extract parameters for common blocks (with sensible fallback values) PDFPtr pdf = ACTIVESETS[1].activeMember(); - w50513_.xmin = pdf->info().get_entry_as("XMin", 0.0); - w50513_.xmax = pdf->info().get_entry_as("XMax", 1.0); - w50513_.q2min = LHAPDF::sqr(pdf->info().get_entry_as("QMin", 1.0)); - w50513_.q2max = LHAPDF::sqr(pdf->info().get_entry_as("QMax", 1.0e5)); - w50512_.qcdl4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - w50512_.qcdl5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); - lhapdfr_.qcdlha4 = pdf->info().get_entry_as("AlphaS_Lambda4", 0.0); - lhapdfr_.qcdlha5 = pdf->info().get_entry_as("AlphaS_Lambda5", 0.0); + w50513_.xmin = lhapdf_entry_or(pdf->info(), "XMin", 0.0); + w50513_.xmax = lhapdf_entry_or(pdf->info(), "XMax", 1.0); + w50513_.q2min = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMin", 1.0)); + w50513_.q2max = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMax", 1.0e5)); + w50512_.qcdl4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + w50512_.qcdl5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); + lhapdfr_.qcdlha4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); + lhapdfr_.qcdlha5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); lhapdfr_.nfllha = 4; // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values - if (pdf->info().get_entry_as("Pythia6LambdaV5Compat", true)) { + if (lhapdf_entry_or(pdf->info(), "Pythia6LambdaV5Compat", true)) { w50512_.qcdl4 = 0.192; w50512_.qcdl5 = 0.192; lhapdfr_.qcdlha4 = 0.192; @@ -1425,7 +1437,7 @@ int LHAPDF::getOrderAlphaS(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return alphaS Order for the requested set - return ACTIVESETS[nset].activeMember()->info().get_entry_as("AlphaS_OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "AlphaS_OrderQCD", -1); } @@ -1438,7 +1450,7 @@ int LHAPDF::getOrderPDF(int nset) { throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); CURRENTSET = nset; // return PDF order for the requested set - return ACTIVESETS[nset].activeMember()->info().get_entry_as("OrderQCD", -1); + return lhapdf_entry_or(ACTIVESETS[nset].activeMember()->info(), "OrderQCD", -1); } From 41629b57f150a8ab95df2e1bbceb78ce0334cbfa Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:49:19 +0100 Subject: [PATCH 13/49] Drop the LHAPDF 6.0/6.1 glue (pdf_lhapdf6.cc): require LHAPDF >= 6.2 pdf_lhapdf6.cc was only compiled for LHAPDF 6.1.X and needed boost; LHAPDF 6.2 dates from 2017. The PDF makefiles and link_lhapdf now stop with an explicit error for LHAPDF 6.0/6.1 instead. --- Template/Common/Source/PDF/pdf_lhapdf6.cc | 1139 -------------------- Template/LO/Source/PDF/makefile | 12 +- Template/NLO/Source/PDF/makefile | 12 +- madgraph/interface/common_run_interface.py | 3 + 4 files changed, 12 insertions(+), 1154 deletions(-) delete mode 100644 Template/Common/Source/PDF/pdf_lhapdf6.cc diff --git a/Template/Common/Source/PDF/pdf_lhapdf6.cc b/Template/Common/Source/PDF/pdf_lhapdf6.cc deleted file mode 100644 index 5b6e8cd4d4..0000000000 --- a/Template/Common/Source/PDF/pdf_lhapdf6.cc +++ /dev/null @@ -1,1139 +0,0 @@ -// -*- C++ -*- -// -// This file is part of LHAPDF -// Copyright (C) 2012-2014 The LHAPDF collaboration (see AUTHORS for details) -// -#include "LHAPDF/PDF.h" -#include "LHAPDF/PDFSet.h" -#include "LHAPDF/PDFIndex.h" -#include "LHAPDF/Factories.h" -#include "LHAPDF/Utils.h" -#include "LHAPDF/Paths.h" -#include "LHAPDF/Version.h" -#include "LHAPDF/LHAGlue.h" - -// Optional metadata entries are read without exceptions: LHAPDF's -// get_entry_as(key, fallback) throws and catches internally when the key is -// missing from the member, the set and the global configuration, and that -// catch is never reached in an executable linked by gfortran with some -// toolchains (Homebrew GCC on macOS): the program aborts with -// "MetadataError: Metadata for key: ... not found", e.g. for AlphaS_Lambda4 -// with PDF sets that give alpha_s as a table (NNPDF4.0 QED). -template -static T lhapdf_entry_or(const LHAPDF::Info& info, const std::string& key, const T& fallback) { - return info.has_key(key) ? info.get_entry_as(key) : fallback; -} -#include -#include -#include -#include - -using namespace std; - - -// We have to create and initialise some common blocks here for backwards compatibility -struct w50512 { - double qcdl4, qcdl5; -}; -w50512 w50512_; - -struct w50513 { - double xmin, xmax, q2min, q2max; -}; -w50513 w50513_; - -struct lhapdfr { - double qcdlha4, qcdlha5; - int nfllha; -}; -lhapdfr lhapdfr_; - - - -namespace lhapdf_amc { //< Unnamed namespace to restrict visibility to this file - - /// @brief PDF object storage here is a smart pointer to ensure deletion of created PDFs - /// - /// NB. std::auto_ptr cannot be stored in STL containers, hence we use - /// boost::shared_ptr. std::unique_ptr is the nature replacement when C++11 - /// is globally available. - typedef boost::shared_ptr PDFPtr; - - /// @brief A struct for handling the active PDFs for the Fortran interface. - /// - /// We operate in a string-based way, since maybe there will be sets with names, but no - /// index entry in pdfsets.index. - /// - /// @todo Can we avoid the strings and just work via the LHAPDF ID and factory construction? - /// - /// Smart pointers are used in the native map used for PDF member storage so - /// that they auto-delete if the PDFSetHandler that holds them goes out of - /// scope (i.e. is overwritten). - struct PDFSetHandler { - - /// Default constructor - PDFSetHandler() : currentmem(0) - { } //< It'll be stored in a map so we need one of these... - - /// Constructor from a PDF set name - PDFSetHandler(const string& name) - : setname(name) - { - loadMember(0); - } - - /// Constructor from a PDF set's LHAPDF ID code - PDFSetHandler(int lhaid) { - pair set_mem = LHAPDF::lookupPDF(lhaid); - // First check that the lookup was successful, i.e. it was a valid ID for the LHAPDF6 set collection - if (set_mem.first.empty() || set_mem.second < 0) - throw LHAPDF::UserError("Could not find a valid PDF with LHAPDF ID = " + LHAPDF::to_str(lhaid)); - // Try to load this PDF (checking that the member number is in the set's range is done in mkPDF, called by loadMember) - setname = set_mem.first; - loadMember(set_mem.second); - } - - /// @brief Load a new PDF member - /// - /// If it's already loaded, the existing object will not be reloaded. - void loadMember(int mem) { - if (mem < 0) - throw LHAPDF::UserError("Tried to load a negative PDF member ID: " + LHAPDF::to_str(mem) + " in set " + setname); - if (members.find(mem) == members.end()) - members[mem] = PDFPtr(LHAPDF::mkPDF(setname, mem)); - currentmem = mem; - } - - /// Actively delete a PDF member to save memory - void unloadMember(int mem) { - members.erase(mem); - const int nextmem = (!members.empty()) ? members.begin()->first : 0; - loadMember(nextmem); - } - - /// @brief Get a PDF member - /// - /// Non-const because it can secretly load the member. Not that constness - /// matters in a Fortran interface utility function! - const PDFPtr member(int mem) { - loadMember(mem); - return members.find(mem)->second; - } - - /// Get the currently active PDF member - /// - /// Non-const because it can secretly load the member. Not that constness - /// matters in a Fortran interface utility function! - const PDFPtr activemember() { - return member(currentmem); - } - - /// The currently active member in this set - int currentmem; - - /// Name of this set - string setname; - - /// Map of pointers to selected member PDFs - /// - // /// It's mutable so that a "const" member-getting operation can implicitly - // /// load a new PDF object. Good idea / bad idea? Disabled for now. - // mutable map members; - map members; - }; - - - /// Collection of active sets - static map ACTIVESETS; - - /// The currently active set - int CURRENTSET = 0; - -} - - - -string lhaglue_get_current_pdf(int nset) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - return "NONE"; - lhapdf_amc::CURRENTSET = nset; - return lhapdf_amc::ACTIVESETS[nset].activemember()->set().name() + " (" + - LHAPDF::to_str(lhapdf_amc::ACTIVESETS[nset].activemember()->lhapdfID()) + ")"; -} - - - -extern "C" { - - // NEW FORTRAN INTERFACE FUNCTIONS - - /// List of available sets - void lhapdf_getversion_(char* s, size_t len) { - strncpy(s, LHAPDF_VERSION, len); - } - - /// List of available PDF sets, returned as a space-separated string - void lhapdf_getpdfsetlist_(char* s, size_t len) { - string liststr; - BOOST_FOREACH(const string& setname, LHAPDF::availablePDFSets()) { - if (!liststr.empty()) liststr += " "; - liststr += setname; - } - strncpy(s, liststr.c_str(), len); - } - - - ////////////////// - - // LHAPDF5 / PDFLIB COMPATIBILITY INTERFACE FUNCTIONS - - - // System-level info - - /// LHAPDF library version - void getlhapdfversion_(char* s, size_t len) { - /// @todo Works? Need to check Fortran string return, string macro treatment, etc. - strncpy(s, LHAPDF_VERSION, len); - } - - - /// Does nothing, only provided for backward compatibility - void lhaprint_(int& a) { } - - - /// Set LHAPDF parameters -- does nothing in LHAPDF6! - void setlhaparm_(const char* par, int parlength) { - /// @todo Can any Fortran LHAPDF params be usefully mapped? - } - - - /// Return a dummy max number of sets (there is no limitation now) - void getmaxnumsets_(int& nmax) { - nmax = 1000; - } - - - /// Set PDF data path - void setpdfpath_(const char* s, size_t len) { - // The trailing blank padding of the Fortran string must be stripped: - // a padded path never matches an existing directory, so LHAPDF would - // silently ignore it and fall back to its global data directory. - string path(s, len); - const size_t last = path.find_last_not_of(' '); - if (last == string::npos) return; - path.erase(last+1); - LHAPDF::pathsPrepend(path); - } - - /// Get PDF data path (colon-separated if there is more than one element) - void getdatapath_(char* s, size_t len) { - /// @todo Works? Need to check Fortran string return, string macro treatment, etc. - string pathstr; - BOOST_FOREACH(const string& path, LHAPDF::paths()) { - if (!pathstr.empty()) pathstr += ":"; - pathstr += path; - } - strncpy(s, pathstr.c_str(), len); - } - - - // PDF initialisation and focus-switching - - /// Load a PDF set - /// - /// @todo Does this version actually take a *path*? What to do? - void initpdfsetm_(const int& nset, const char* setpath, int setpathlength) { - // Strip file extension for backward compatibility - string fullp = string(setpath, setpathlength); - // Remove trailing whitespace - fullp.erase( std::remove_if( fullp.begin(), fullp.end(), ::isspace ), fullp.end() ); - // Use only items after the last / - const string pap = LHAPDF::dirname(fullp); - const string p = LHAPDF::basename(fullp); - // Prepend path to search area - LHAPDF::pathsPrepend(pap); - // Handle extensions - string path = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p); - /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case. - if (boost::algorithm::to_lower_copy(path) == "cteq6ll") path = "cteq6l1"; - // Create the PDF set with index nset - // if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - lhapdf_amc::ACTIVESETS[nset] = lhapdf_amc::PDFSetHandler(path); //< @todo Will be wrong if a structured path is given - lhapdf_amc::CURRENTSET = nset; - } - /// Load a PDF set (non-multiset version) - void initpdfset_(const char* setpath, int setpathlength) { - int nset1 = 1; - initpdfsetm_(nset1, setpath, setpathlength); - } - - - /// Load a PDF set by name - void initpdfsetbynamem_(const int& nset, const char* setname, int setnamelength) { - // Truncate input to size setnamelength - string p = setname; - p.erase(setnamelength, std::string::npos); - // Strip file extension for backward compatibility - string name = LHAPDF::file_extn(p).empty() ? p : LHAPDF::file_stem(p); - // Remove trailing whitespace - name.erase( std::remove_if( name.begin(), name.end(), ::isspace ), name.end() ); - /// @note We correct the misnamed CTEQ6L1/CTEQ6ll set name as a backward compatibility special case. - if (boost::algorithm::to_lower_copy(name) == "cteq6ll") name = "cteq6l1"; - // Create the PDF set with index nset - // if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - lhapdf_amc::ACTIVESETS[nset] = lhapdf_amc::PDFSetHandler(name); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Load a PDF set by name (non-multiset version) - void initpdfsetbyname_(const char* setname, int setnamelength) { - int nset1 = 1; - initpdfsetbynamem_(nset1, setname, setnamelength); - } - - - /// Load a PDF in current set - void initpdfm_(const int& nset, const int& nmember) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - lhapdf_amc::ACTIVESETS[nset].loadMember(nmember); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Load a PDF in current set (non-multiset version) - void initpdf_(const int& nmember) { - int nset1 = 1; - initpdfm_(nset1, nmember); - } - - - /// Get the current set number (i.e. allocation slot index) - void getnset_(int& nset) { - nset = lhapdf_amc::CURRENTSET; - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - } - - /// Explicitly set the current set number (i.e. allocation slot index) - void setnset_(const int& nset) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - lhapdf_amc::CURRENTSET = nset; - } - - - /// Get the current member number in slot nset - void getnmem_(int& nset, int& nmem) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - nmem = lhapdf_amc::ACTIVESETS[nset].currentmem; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - - /// Set the current member number in slot nset - void setnmem_(const int& nset, const int& nmem) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + - LHAPDF::to_str(nset) + " but it is not initialised"); - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - - - - // PDF evolution functions - - /// Get xf(x) values for common partons from current PDF - void evolvepdfm_(const int& nset, const double& x, const double& q, double* fxq) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // Evaluate for the 13 LHAPDF5 standard partons (-6..6) - for (size_t i = 0; i < 13; ++i) { - try { - fxq[i] = lhapdf_amc::ACTIVESETS[nset].activemember()->xfxQ(i-6, x, q); - } catch (const exception& e) { - fxq[i] = 0; - } - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get xf(x) values for common partons from current PDF (non-multiset version) - void evolvepdf_(const double& x, const double& q, double* fxq) { - int nset1 = 1; - evolvepdfm_(nset1, x, q, fxq); - } - - // PDF evolution functions - // NEW BY MZ to evolve one single parton - - /// Get xf(x) values for common partons from current PDF - void evolvepartm_(const int& nset, const int& ipart, const double& x, const double& q, double& fxq) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - int ipart_copy; // this is to deal with photons, which are labeled 7 in MG5aMC - ipart_copy = ipart; - if (ipart==7) ipart_copy = 22; - try { - fxq = lhapdf_amc::ACTIVESETS[nset].activemember()->xfxQ(ipart_copy, x, q); - } catch (const exception& e) { - fxq = 0; - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get xf(x) values for common partons from current PDF (non-multiset version) - void evolvepart_( const int& ipart, const double& x, const double& q, double& fxq) { - int nset1 = 1; - evolvepartm_(nset1, ipart, x, q, fxq); - } - - - /// Determine if the current PDF has a photon flavour (historically only MRST2004QED) - /// @todo Function rather than subroutine? - /// @note There is no multiset version. has_photon will respect the current set slot. - bool has_photon_() { - return lhapdf_amc::ACTIVESETS[lhapdf_amc::CURRENTSET].activemember()->hasFlavor(22); - } - - - /// Get xfx values from current PDF, including an extra photon flavour - void evolvepdfphotonm_(const int& nset, const double& x, const double& q, double* fxq, double& photonfxq) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // First evaluate the "normal" partons - evolvepdfm_(nset, x, q, fxq); - // Then evaluate the photon flavor (historically only for MRST2004QED) - try { - photonfxq = lhapdf_amc::ACTIVESETS[nset].activemember()->xfxQ(22, x, q); - } catch (const exception& e) { - photonfxq = 0; - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get xfx values from current PDF, including an extra photon flavour (non-multiset version) - void evolvepdfphoton_(const double& x, const double& q, double* fxq, double& photonfxq) { - int nset1 = 1; - evolvepdfphotonm_(nset1, x, q, fxq, photonfxq); - } - - - /// Get xf(x) values for common partons from a photon PDF - void evolvepdfpm_(const int& nset, const double& x, const double& q, const double& p2, const int& ip2, double& fxq) { - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported in LHAPDF6"); - } - /// Get xf(x) values for common partons from a photon PDF (non-multiset version) - void evolvepdfp_(const double& x, const double& q, const double& p2, const int& ip2, double& fxq) { - int nset1 = 1; - evolvepdfpm_(nset1, x, q, p2, ip2, fxq); - } - - - // alpha_s evolution - - /// Get the alpha_s order for the set - void getorderasm_(const int& nset, int& oas) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // Set equal to the number of members for the requested set - oas = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_OrderQCD"); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the alpha_s order for the set (non-multiset version) - void getorderas_(int& oas) { - int nset1 = 1; - getorderasm_(nset1, oas); - } - - - /// Get the alpha_s(Q) value for set nset - double alphaspdfm_(const int& nset, const double& Q){ - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - return lhapdf_amc::ACTIVESETS[nset].activemember()->alphasQ(Q); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the alpha_s(Q) value for the set (non-multiset version) - double alphaspdf_(const double& Q){ - int nset1 = 1; - return alphaspdfm_(nset1, Q); - } - - - // Metadata functions - - /// Get the number of error members in the set (with special treatment for single member sets) - void numberpdfm_(const int& nset, int& numpdf) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - // Set equal to the number of members for the requested set - numpdf= lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("NumMembers"); - // Reproduce old LHAPDF v5 behaviour, i.e. subtract 1 if more than 1 member set - if (numpdf > 1) numpdf -= 1; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the number of error members in the set (non-multiset version) - void numberpdf_(int& numpdf) { - int nset1 = 1; - numberpdfm_(nset1, numpdf); - } - - - /// Get the max number of active flavours - void getnfm_(const int& nset, int& nf) { - //nf = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("AlphaS_NumFlavors"); - nf = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("NumFlavors"); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the max number of active flavours (non-multiset version) - void getnf_(int& nf) { - int nset1 = 1; - getnfm_(nset1, nf); - } - - - /// Get nf'th quark mass - void getqmassm_(const int& nset, const int& nf, double& mass) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - if (nf*nf == 1) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MDown"); - else if (nf*nf == 4) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MUp"); - else if (nf*nf == 9) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MStrange"); - else if (nf*nf == 16) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MCharm"); - else if (nf*nf == 25) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MBottom"); - else if (nf*nf == 36) mass = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("MTop"); - else throw LHAPDF::UserError("Trying to get quark mass for invalid quark ID #" + LHAPDF::to_str(nf)); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get nf'th quark mass (non-multiset version) - void getqmass_(const int& nf, double& mass) { - int nset1 = 1; - getqmassm_(nset1, nf, mass); - } - - - /// Get the nf'th quark threshold - void getthresholdm_(const int& nset, const int& nf, double& Q) { - try { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - if (nf*nf == 1) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdDown"); - else if (nf*nf == 4) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdUp"); - else if (nf*nf == 9) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdStrange"); - else if (nf*nf == 16) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdCharm"); - else if (nf*nf == 25) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdBottom"); - else if (nf*nf == 36) Q = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("ThresholdTop"); - //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf)); - } catch (...) { - getqmassm_(nset, nf, Q); - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - /// Get the nf'th quark threshold - void getthreshold_(const int& nf, double& Q) { - int nset1 = 1; - getthresholdm_(nset1, nf, Q); - } - - - /// Print PDF set's description to stdout - void getdescm_(const int& nset) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - cout << lhapdf_amc::ACTIVESETS[nset].activemember()->description() << endl; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getdesc_() { - int nset1 = 1; - getdescm_(nset1); - } - - - void getxminm_(const int& nset, const int& nmem, double& xmin) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - xmin = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMin"); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getxmin_(const int& nmem, double& xmin) { - int nset1 = 1; - getxminm_(nset1, nmem, xmin); - } - - - void getxmaxm_(const int& nset, const int& nmem, double& xmax) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - xmax = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMax"); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getxmax_(const int& nmem, double& xmax) { - int nset1 = 1; - getxmaxm_(nset1, nmem, xmax); - } - - - void getq2minm_(const int& nset, const int& nmem, double& q2min) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - q2min = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMin")); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getq2min_(const int& nmem, double& q2min) { - int nset1 = 1; - getq2minm_(nset1, nmem, q2min); - } - - - void getq2maxm_(const int& nset, const int& nmem, double& q2max) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - q2max = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMax")); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getq2max_(const int& nmem, double& q2max) { - int nset1 = 1; - getq2maxm_(nset1, nmem, q2max); - } - - - void getminmaxm_(const int& nset, const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const int activemem = lhapdf_amc::ACTIVESETS[nset].currentmem; - lhapdf_amc::ACTIVESETS[nset].loadMember(nmem); - xmin = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMin"); - xmax = lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("XMax"); - q2min = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMin")); - q2max = LHAPDF::sqr(lhapdf_amc::ACTIVESETS[nset].activemember()->info().get_entry_as("QMax")); - lhapdf_amc::ACTIVESETS[nset].loadMember(activemem); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - void getminmax_(const int& nmem, double& xmin, double& xmax, double& q2min, double& q2max) { - int nset1 = 1; - getminmaxm_(nset1, nmem, xmin, xmax, q2min, q2max); - } - - - - /// Backwards compatibility functions for LHAPDF5 calculations of - /// PDF uncertainties and PDF correlations (G. Watt, March 2014). - - // subroutine GetPDFUncTypeM(nset,lMonteCarlo,lSymmetric) - void getpdfunctypem_(const int& nset, int& lmontecarlo, int& lsymmetric) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const string errorType = lhapdf_amc::ACTIVESETS[nset].activemember()->set().errorType(); - if (errorType == "replicas") { // Monte Carlo PDF sets - lmontecarlo = 1; - lsymmetric = 1; - } else if (errorType == "symmhessian") { // symmetric eigenvector PDF sets - lmontecarlo = 0; - lsymmetric = 1; - } else { // default: assume asymmetric Hessian eigenvector PDF sets - lmontecarlo = 0; - lsymmetric = 0; - } - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - // subroutine GetPDFUncType(lMonteCarlo,lSymmetric) - void getpdfunctype_(int& lmontecarlo, int& lsymmetric) { - int nset1 = 1; - getpdfunctypem_(nset1, lmontecarlo, lsymmetric); - } - - - // subroutine GetPDFuncertaintyM(nset,values,central,errplus,errminus,errsym) - void getpdfuncertaintym_(const int& nset, const double* values, double& central, double& errplus, double& errminus, double& errsymm) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const size_t nmem = lhapdf_amc::ACTIVESETS[nset].activemember()->set().size()-1; - const vector vecvalues(values, values + nmem + 1); - LHAPDF::PDFUncertainty err = lhapdf_amc::ACTIVESETS[nset].activemember()->set().uncertainty(vecvalues, -1); - central = err.central; - errplus = err.errplus; - errminus = err.errminus; - errsymm = err.errsymm; - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - // subroutine GetPDFuncertainty(values,central,errplus,errminus,errsym) - void getpdfuncertainty_(const double* values, double& central, double& errplus, double& errminus, double& errsymm) { - int nset1 = 1; - getpdfuncertaintym_(nset1, values, central, errplus, errminus, errsymm); - } - - - // subroutine GetPDFcorrelationM(nset,valuesA,valuesB,correlation) - void getpdfcorrelationm_(const int& nset, const double* valuesA, const double* valuesB, double& correlation) { - if (lhapdf_amc::ACTIVESETS.find(nset) == lhapdf_amc::ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - const size_t nmem = lhapdf_amc::ACTIVESETS[nset].activemember()->set().size()-1; - const vector vecvaluesA(valuesA, valuesA + nmem + 1); - const vector vecvaluesB(valuesB, valuesB + nmem + 1); - correlation = lhapdf_amc::ACTIVESETS[nset].activemember()->set().correlation(vecvaluesA,vecvaluesB); - // Update current set focus - lhapdf_amc::CURRENTSET = nset; - } - // subroutine GetPDFcorrelation(valuesA,valuesB,correlation) - void getpdfcorrelation_(const double* valuesA, const double* valuesB, double& correlation) { - int nset1 = 1; - getpdfcorrelationm_(nset1, valuesA, valuesB, correlation); - } - - - /////////////////////////////////////// - - - /// REALLY OLD PDFLIB COMPATILITY FUNCTIONS - - /// PDFLIB initialisation function - void pdfset_(const char* par, const double* value, int parlength) { - - // Identify the calling program (yuck!) - string my_par(par); - if (my_par.find("NPTYPE") != string::npos) { - cout << "==== LHAPDF6 USING PYTHIA-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[2] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[2]+1000*value[1]); - } else if (my_par.find("HWLHAPDF") != string::npos) { - cout << "==== LHAPDF6 USING HERWIG-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[0] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[0]); - } else if (my_par.find("DEFAULT") != string::npos) { - cout << "==== LHAPDF6 USING DEFAULT-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[0] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[0]); - } else { - cout << "==== LHAPDF6 USING PDFLIB-TYPE LHAGLUE INTERFACE ====" << endl; - // Take PDF ID from value[2] - lhapdf_amc::ACTIVESETS[1] = lhapdf_amc::PDFSetHandler(value[2]+1000*value[1]); - } - - lhapdf_amc::CURRENTSET = 1; - - // Extract parameters for common blocks (with sensible fallback values) - lhapdf_amc::PDFPtr pdf = lhapdf_amc::ACTIVESETS[1].activemember(); - w50513_.xmin = lhapdf_entry_or(pdf->info(), "XMin", 0.0); - w50513_.xmax = lhapdf_entry_or(pdf->info(), "XMax", 1.0); - w50513_.q2min = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMin", 1.0)); - w50513_.q2max = LHAPDF::sqr(lhapdf_entry_or(pdf->info(), "QMax", 1.0e5)); - w50512_.qcdl4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); - w50512_.qcdl5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); - lhapdfr_.qcdlha4 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda4", 0.0); - lhapdfr_.qcdlha5 = lhapdf_entry_or(pdf->info(), "AlphaS_Lambda5", 0.0); - lhapdfr_.nfllha = 4; - // Activate legacy/compatibility LHAPDF5-type behaviour re. broken Lambda values - if (lhapdf_entry_or(pdf->info(), "Pythia6LambdaV5Compat", true)) { - w50512_.qcdl4 = 0.192; - w50512_.qcdl5 = 0.192; - lhapdfr_.qcdlha4 = 0.192; - lhapdfr_.qcdlha5 = 0.192; - } - } - - /// PDFLIB nucleon structure function querying - void structm_(const double& x, const double& q, - double& upv, double& dnv, double& usea, double& dsea, - double& str, double& chm, double& bot, double& top, double& glu) { - lhapdf_amc::CURRENTSET = 1; - /// Fill (partial) parton return variables - lhapdf_amc::PDFPtr pdf = lhapdf_amc::ACTIVESETS[1].activemember(); - dsea = pdf->xfxQ(-1, x, q); - usea = pdf->xfxQ(-2, x, q); - dnv = pdf->xfxQ(1, x, q) - dsea; - upv = pdf->xfxQ(2, x, q) - usea; - str = pdf->xfxQ(3, x, q); - chm = (pdf->hasFlavor(4)) ? pdf->xfxQ(4, x, q) : 0; - bot = (pdf->hasFlavor(5)) ? pdf->xfxQ(5, x, q) : 0; - top = (pdf->hasFlavor(6)) ? pdf->xfxQ(6, x, q) : 0; - glu = pdf->xfxQ(21, x, q); - } - - /// PDFLIB photon structure function querying - void structp_(const double& x, const double& q2, const double& p2, const double& ip2, - double& upv, double& dnv, double& usea, double& dsea, - double& str, double& chm, double& bot, double& top, double& glu) { - throw LHAPDF::NotImplementedError("Photon structure functions are not yet supported"); - } - - /// PDFLIB statistics on PDF under/overflows - void pdfsta_() { - /// @note Can't do anything... - } - - -} - - -// LHAPDF namespace C++ compatibility code -#ifdef ENABLE_LHAGLUE_CXX - - -void LHAPDF::setVerbosity(LHAPDF::Verbosity noiselevel) { - LHAPDF::setVerbosity((int) noiselevel); -} - -void LHAPDF::setPDFPath(const string& path) { - pathsPrepend(path); -} - -string LHAPDF::pdfsetsPath() { - return paths()[0]; -} - -int LHAPDF::numberPDF() { - int nmem; - numberpdf_(nmem); - return nmem; -} -int LHAPDF::numberPDF(int nset) { - int nmem; - numberpdfm_(nset,nmem); - return nmem; -} - -void LHAPDF::initPDF( int memset) { - int nset1 = 1; - initpdfm_(nset1, memset); -} -void LHAPDF::initPDF(int nset, int memset) { - initpdfm_(nset, memset); -} - - -double LHAPDF::xfx(double x, double Q, int fl) { - vector r(13); - evolvepdf_(x, Q, &r[0]); - return r[fl+6]; -} -double LHAPDF::xfx(int nset, double x, double Q, int fl) { - vector r(13); - evolvepdfm_(nset, x, Q, &r[0]); - return r[fl+6]; -} - -vector LHAPDF::xfx(double x, double Q) { - vector r(13); - evolvepdf_(x, Q, &r[0]); - return r; -} -vector LHAPDF::xfx(int nset, double x, double Q) { - vector r(13); - evolvepdfm_(nset, x, Q, &r[0]); - return r; -} - -void LHAPDF::xfx(double x, double Q, double* results) { - evolvepdf_(x, Q, results); -} -void LHAPDF::xfx(int nset, double x, double Q, double* results) { - evolvepdfm_(nset, x, Q, results); -} - - -vector LHAPDF::xfxphoton(double x, double Q) { - vector r(13); - double mphoton; - evolvepdfphoton_(x, Q, &r[0], mphoton); - r.push_back(mphoton); - return r; -} -vector LHAPDF::xfxphoton(int nset, double x, double Q) { - vector r(13); - double mphoton; - evolvepdfphotonm_(nset, x, Q, &r[0], mphoton); - r.push_back(mphoton); - return r; -} - -void LHAPDF::xfxphoton(double x, double Q, double* results) { - evolvepdfphoton_(x, Q, results, results[13]); -} -void LHAPDF::xfxphoton(int nset, double x, double Q, double* results) { - evolvepdfphotonm_(nset, x, Q, results, results[13]); -} - -double LHAPDF::xfxphoton(double x, double Q, int fl) { - vector r(13); - double mphoton; - evolvepdfphoton_(x, Q, &r[0], mphoton); - if (fl == 7) return mphoton; - return r[fl+6]; -} -double LHAPDF::xfxphoton(int nset, double x, double Q, int fl) { - vector r(13); - double mphoton; - evolvepdfphotonm_(nset, x, Q, &r[0], mphoton); - if ( fl == 7 ) return mphoton; - return r[fl+6]; -} - - -void LHAPDF::initPDFSet(const string& filename, int nmem) { - initPDFSet(1,filename, nmem); -} - -void LHAPDF::initPDFSet(int nset, const string& filename, int nmem) { - initPDFSetByName(nset,filename); - ACTIVESETS[nset].loadMember(nmem); - CURRENTSET = nset; -} - - -void LHAPDF::initPDFSet(const string& filename, SetType type ,int nmem) { - // silently ignore type - initPDFSet(1,filename, nmem); -} - -void LHAPDF::initPDFSet(int nset, const string& filename, SetType type ,int nmem) { - // silently ignore type - initPDFSetByName(nset,filename); - ACTIVESETS[nset].loadMember(nmem); - CURRENTSET = nset; -} - -void LHAPDF::initPDFSet(int nset, int setid, int nmem) { - ACTIVESETS[nset] = PDFSetHandler(setid); // - CURRENTSET = nset; -} - -void LHAPDF::initPDFSet(int setid, int nmem) { - initPDFSet(1,setid,nmem); -} - -#define SIZE 999 -void LHAPDF::initPDFSetByName(const string& filename) { - std::cout << "initPDFSetByName: " << filename << std::endl; - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbyname_(cfilename, filename.length()); -} - -void LHAPDF::initPDFSetByName(int nset, const string& filename) { - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbynamem_(nset, cfilename, filename.length()); -} - -void LHAPDF::initPDFSetByName(const string& filename, SetType type) { - //silently ignore type - std::cout << "initPDFSetByName: " << filename << std::endl; - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbyname_(cfilename, filename.length()); -} - -void LHAPDF::initPDFSetByName(int nset, const string& filename, SetType type) { - //silently ignore type - char cfilename[SIZE+1]; - strncpy(cfilename, filename.c_str(), SIZE); - initpdfsetbynamem_(nset, cfilename, filename.length()); -} - - -void LHAPDF::getDescription() { - getDescription(1); -} - -void LHAPDF::getDescription(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - cout << ACTIVESETS[nset].activemember()->set().description() << endl; -} - - -double LHAPDF::alphasPDF(double Q) { - return LHAPDF::alphasPDF(1, Q) ; -} - -double LHAPDF::alphasPDF(int nset, double Q) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS for the requested set - return ACTIVESETS[nset].activemember()->alphasQ(Q); -} - - -bool LHAPDF::hasPhoton(){ - return has_photon_(); -} - - -int LHAPDF::getOrderAlphaS() { - return LHAPDF::getOrderAlphaS(1) ; -} - -int LHAPDF::getOrderAlphaS(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_OrderQCD", -1); -} - - -int LHAPDF::getOrderPDF() { - return LHAPDF::getOrderPDF(1) ; -} - -int LHAPDF::getOrderPDF(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return PDF order for the requested set - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "OrderQCD", -1); -} - - -double LHAPDF::getLam4(int nmem) { - return LHAPDF::getLam4(1, nmem) ; -} - -double LHAPDF::getLam4(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - ACTIVESETS[nset].loadMember(nmem); - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda4", -1.0); -} - - -double LHAPDF::getLam5(int nmem) { - return LHAPDF::getLam5(1, nmem) ; -} - -double LHAPDF::getLam5(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - ACTIVESETS[nset].loadMember(nmem); - return lhapdf_entry_or(ACTIVESETS[nset].activemember()->info(), "AlphaS_Lambda5", -1.0); -} - - -int LHAPDF::getNf() { - return LHAPDF::getNf(1) ; -} - -int LHAPDF::getNf(int nset) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - return ACTIVESETS[nset].activemember()->info().get_entry_as("NumFlavors"); -} - - -double LHAPDF::getXmin(int nmem) { - return LHAPDF::getXmin(1, nmem) ; -} - -double LHAPDF::getXmin(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("XMin"); -} - -double LHAPDF::getXmax(int nmem) { - return LHAPDF::getXmax(1, nmem) ; -} - -double LHAPDF::getXmax(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return ACTIVESETS[nset].activemember()->info().get_entry_as("XMax"); -} - -double LHAPDF::getQ2min(int nmem) { - return LHAPDF::getQ2min(1, nmem) ; -} - -double LHAPDF::getQ2min(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return pow(ACTIVESETS[nset].activemember()->info().get_entry_as("QMin"),2); -} - -double LHAPDF::getQ2max(int nmem) { - return LHAPDF::getQ2max(1,nmem) ; -} - -double LHAPDF::getQ2max(int nset, int nmem) { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - CURRENTSET = nset; - // return alphaS Order for the requested set - ACTIVESETS[nset].loadMember(nmem); - return pow(ACTIVESETS[nset].activemember()->info().get_entry_as("QMax"),2); -} - -double LHAPDF::getQMass(int nf) { - return LHAPDF::getQMass(1, nf) ; -} - -double LHAPDF::getQMass(int nset, int nf) { - double mass; - getqmassm_(nset, nf, mass); - return mass; -} - -double LHAPDF::getThreshold(int nf) { - return LHAPDF::getThreshold(1, nf) ; -} - -double LHAPDF::getThreshold(int nset, int nf) { - double thres; - getthresholdm_(nset, nf, thres); - return thres; -} - -void LHAPDF::usePDFMember(int member) { - initpdf_(member); -} - -void LHAPDF::usePDFMember(int nset, int member) { - initpdfm_(nset, member); -} - -#endif // ENABLE_LHAGLUE_CXX diff --git a/Template/LO/Source/PDF/makefile b/Template/LO/Source/PDF/makefile index 4dcc018529..ab541e8507 100644 --- a/Template/LO/Source/PDF/makefile +++ b/Template/LO/Source/PDF/makefile @@ -44,15 +44,11 @@ ifdef lhapdf PDF += pdfwrap_lhapdf.o pdg2pdf_lhapdf6.o ifeq ($(lhapdfversion),5) $(error Bad lhadpfversion version 6 is now required) + else ifneq (,$(filter 0 1,$(lhapdfsubversion))) # 6.0.X, 6.1.X + $(error LHAPDF 6.2 or later is required) else - ifeq ($(lhapdfsubversion),1) # 6.1.X - PDF += pdf_lhapdf6.o - TOREMOVE += pdf_lhapdf62.o - else # 6.2.X - CXXFLAGS+=-std=c++11 - PDF += pdf_lhapdf62.o - TOREMOVE += pdf_lhapdf6.o - endif + CXXFLAGS+=-std=c++11 + PDF += pdf_lhapdf62.o endif else TOREMOVE += pdfwrap_lhapdf.o diff --git a/Template/NLO/Source/PDF/makefile b/Template/NLO/Source/PDF/makefile index bfffd79c48..83a23d673a 100644 --- a/Template/NLO/Source/PDF/makefile +++ b/Template/NLO/Source/PDF/makefile @@ -13,13 +13,11 @@ include ../make_opts ifdef lhapdf ifeq ($(lhapdfversion),5) PDF = pdfwrap_lhapdf.o pdf_lhapdf.o pdg2pdf_lhapdf.o opendata.o - else # lhapdf v6 - ifeq ($(lhapdfsubversion),1) # 6.1.X - PDF = pdfwrap_lhapdf.o pdf_lhapdf6.o pdg2pdf_lhapdf6.o opendata.o - else # 6.2.X - CXXFLAGS+=-std=c++11 - PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o - endif + else ifneq (,$(filter 0 1,$(lhapdfsubversion))) # 6.0.X, 6.1.X + $(error LHAPDF 6.2 or later is required) + else # lhapdf v6.2 or later + CXXFLAGS+=-std=c++11 + PDF = pdfwrap_lhapdf.o pdf_lhapdf62.o pdg2pdf_lhapdf6.o opendata.o endif else ifdef epdf CXXFLAGS+=-std=c++11 diff --git a/madgraph/interface/common_run_interface.py b/madgraph/interface/common_run_interface.py index acc370b337..f4262613b0 100755 --- a/madgraph/interface/common_run_interface.py +++ b/madgraph/interface/common_run_interface.py @@ -4885,6 +4885,9 @@ def link_lhapdf(self, libdir, extra_dirs = []): lhapdf_version = self.get_lhapdf_version() logger.info('Using LHAPDF v%s interface for PDFs' % lhapdf_version) + if lhapdf_version.startswith(('6.0.', '6.1.')): + raise MadGraph5Error('LHAPDF %s is not supported anymore: ' % lhapdf_version + + 'please use LHAPDF 6.2 or later (e.g. "install lhapdf6").') lhalibdir = subprocess.Popen([self.options['lhapdf'], '--libdir'], stdout = subprocess.PIPE).stdout.read().decode(errors='ignore').strip() From 3caac205d91a721979ef7d872e6ef9eff48ac264 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:56:01 +0100 Subject: [PATCH 14/49] LHAPDF glue: quark thresholds fall back to the mass without exceptions getthresholdm_ relied on catching LHAPDF's MetadataError for a missing Threshold key; that catch is not reached in gfortran-linked executables (same issue as lhapdf_entry_or), e.g. ThresholdCharm with NNPDF40_nlo_as_01180_qed. Check has_key and use the quark mass instead. --- Template/Common/Source/PDF/pdf_lhapdf62.cc | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Template/Common/Source/PDF/pdf_lhapdf62.cc b/Template/Common/Source/PDF/pdf_lhapdf62.cc index 4964cf0ae7..6fd8c21f93 100644 --- a/Template/Common/Source/PDF/pdf_lhapdf62.cc +++ b/Template/Common/Source/PDF/pdf_lhapdf62.cc @@ -920,18 +920,21 @@ extern "C" { /// Get the nf'th quark threshold void getthresholdm_(const int& nset, const int& nf, double& Q) { - try { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - if (nf*nf == 1) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdDown"); - else if (nf*nf == 4) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdUp"); - else if (nf*nf == 9) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdStrange"); - else if (nf*nf == 16) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdCharm"); - else if (nf*nf == 25) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdBottom"); - else if (nf*nf == 36) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdTop"); - //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf)); - } catch (...) { - getqmassm_(nset, nf, Q); + if (ACTIVESETS.find(nset) == ACTIVESETS.end()) + throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); + const char* key = 0; + if (nf*nf == 1) key = "ThresholdDown"; + else if (nf*nf == 4) key = "ThresholdUp"; + else if (nf*nf == 9) key = "ThresholdStrange"; + else if (nf*nf == 16) key = "ThresholdCharm"; + else if (nf*nf == 25) key = "ThresholdBottom"; + else if (nf*nf == 36) key = "ThresholdTop"; + //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf)); + if (key) { + // a missing threshold falls back to the quark mass (no exception, see lhapdf_entry_or) + const LHAPDF::Info& info = ACTIVESETS[nset].activeMember()->info(); + if (info.has_key(key)) Q = info.get_entry_as(key); + else getqmassm_(nset, nf, Q); } // Update current set focus CURRENTSET = nset; From ded4ce401939c93c1449365d635c2ec511824e0d Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 26 Oct 2026 23:56:01 +0100 Subject: [PATCH 15/49] LHAPDF glue: quark thresholds fall back to the mass without exceptions getthresholdm_ relied on catching LHAPDF's MetadataError for a missing Threshold key; that catch is not reached in gfortran-linked executables (same issue as lhapdf_entry_or), e.g. ThresholdCharm with NNPDF40_nlo_as_01180_qed. Check has_key and use the quark mass instead. --- Template/Common/Source/PDF/pdf_lhapdf62.cc | 27 ++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Template/Common/Source/PDF/pdf_lhapdf62.cc b/Template/Common/Source/PDF/pdf_lhapdf62.cc index 52fcd36d96..3efa5444b2 100644 --- a/Template/Common/Source/PDF/pdf_lhapdf62.cc +++ b/Template/Common/Source/PDF/pdf_lhapdf62.cc @@ -921,18 +921,21 @@ extern "C" { /// Get the nf'th quark threshold void getthresholdm_(const int& nset, const int& nf, double& Q) { - try { - if (ACTIVESETS.find(nset) == ACTIVESETS.end()) - throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); - if (nf*nf == 1) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdDown"); - else if (nf*nf == 4) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdUp"); - else if (nf*nf == 9) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdStrange"); - else if (nf*nf == 16) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdCharm"); - else if (nf*nf == 25) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdBottom"); - else if (nf*nf == 36) Q = ACTIVESETS[nset].activeMember()->info().get_entry_as("ThresholdTop"); - //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf)); - } catch (...) { - getqmassm_(nset, nf, Q); + if (ACTIVESETS.find(nset) == ACTIVESETS.end()) + throw LHAPDF::UserError("Trying to use LHAGLUE set #" + LHAPDF::to_str(nset) + " but it is not initialised"); + const char* key = 0; + if (nf*nf == 1) key = "ThresholdDown"; + else if (nf*nf == 4) key = "ThresholdUp"; + else if (nf*nf == 9) key = "ThresholdStrange"; + else if (nf*nf == 16) key = "ThresholdCharm"; + else if (nf*nf == 25) key = "ThresholdBottom"; + else if (nf*nf == 36) key = "ThresholdTop"; + //else throw LHAPDF::UserError("Trying to get quark threshold for invalid quark ID #" + LHAPDF::to_str(nf)); + if (key) { + // a missing threshold falls back to the quark mass (no exception, see lhapdf_entry_or) + const LHAPDF::Info& info = ACTIVESETS[nset].activeMember()->info(); + if (info.has_key(key)) Q = info.get_entry_as(key); + else getqmassm_(nset, nf, Q); } // Update current set focus CURRENTSET = nset; From d14d233d654d02f373b16511ff7224ca9dbc8330 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 27 Oct 2026 00:15:57 +0100 Subject: [PATCH 16/49] LHAPDF >= 6.2 check: do it in get_lhapdf_version_static Replace the stale 6.0 guard there instead of a second check in link_lhapdf (every LHAPDF code path reads the version through it). --- madgraph/interface/common_run_interface.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/madgraph/interface/common_run_interface.py b/madgraph/interface/common_run_interface.py index 81a3c3c468..f1ddb8eb69 100755 --- a/madgraph/interface/common_run_interface.py +++ b/madgraph/interface/common_run_interface.py @@ -4423,9 +4423,6 @@ def link_lhapdf(self, libdir, extra_dirs = []): lhapdf_version = self.get_lhapdf_version() logger.info('Using LHAPDF v%s interface for PDFs' % lhapdf_version) - if lhapdf_version.startswith(('6.0.', '6.1.')): - raise MadGraph5Error('LHAPDF %s is not supported anymore: ' % lhapdf_version + - 'please use LHAPDF 6.2 or later (e.g. "install lhapdf6").') lhalibdir = subprocess.Popen([self.options['lhapdf'], '--libdir'], stdout = subprocess.PIPE).stdout.read().decode(errors='ignore').strip() @@ -4766,9 +4763,9 @@ def get_lhapdf_version_static(lhapdf_config): else: raise - # this will be removed once some issues in lhapdf6 will be fixed - if lhapdf_version.startswith('6.0'): - raise MadGraph5Error('LHAPDF 6.0.x not supported. Please use v6.1 or later') + # the PDF glue (pdf_lhapdf62.cc) requires LHAPDF 6.2 or later + if lhapdf_version.startswith(('6.0.', '6.1.')): + raise MadGraph5Error('LHAPDF %s not supported. Please use v6.2 or later' % lhapdf_version) return lhapdf_version From c739da763435019423f4141f6f78c824b12b80b0 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 27 Oct 2026 00:15:57 +0100 Subject: [PATCH 17/49] LHAPDF >= 6.2 check: do it in get_lhapdf_version_static Replace the stale 6.0 guard there instead of a second check in link_lhapdf (every LHAPDF code path reads the version through it). --- madgraph/interface/common_run_interface.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/madgraph/interface/common_run_interface.py b/madgraph/interface/common_run_interface.py index f4262613b0..aaa4d3f2d0 100755 --- a/madgraph/interface/common_run_interface.py +++ b/madgraph/interface/common_run_interface.py @@ -4885,9 +4885,6 @@ def link_lhapdf(self, libdir, extra_dirs = []): lhapdf_version = self.get_lhapdf_version() logger.info('Using LHAPDF v%s interface for PDFs' % lhapdf_version) - if lhapdf_version.startswith(('6.0.', '6.1.')): - raise MadGraph5Error('LHAPDF %s is not supported anymore: ' % lhapdf_version + - 'please use LHAPDF 6.2 or later (e.g. "install lhapdf6").') lhalibdir = subprocess.Popen([self.options['lhapdf'], '--libdir'], stdout = subprocess.PIPE).stdout.read().decode(errors='ignore').strip() @@ -5293,9 +5290,9 @@ def get_lhapdf_version_static(lhapdf_config): else: raise - # this will be removed once some issues in lhapdf6 will be fixed - if lhapdf_version.startswith('6.0'): - raise MadGraph5Error('LHAPDF 6.0.x not supported. Please use v6.1 or later') + # the PDF glue (pdf_lhapdf62.cc) requires LHAPDF 6.2 or later + if lhapdf_version.startswith(('6.0.', '6.1.')): + raise MadGraph5Error('LHAPDF %s not supported. Please use v6.2 or later' % lhapdf_version) return lhapdf_version From 940bab5623cbf567208948412dc44da277b814f4 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 27 Oct 2026 07:34:45 +0100 Subject: [PATCH 18/49] LO run_card: recompile everything when vector_size/nb_warp changes VECSIZE_MEMMAX (vector.inc) sizes arrays and common blocks shared by the code of Source and of SubProcesses, but the makefiles do not track that dependency: after changing vector_size in an already compiled process directory, only part of Source was rebuilt and madevent was relinked with stale SubProcesses objects, giving a mixed build with wrong or zero cross sections. RunCardLO.reset_simd (the fct_mod hook of vector_size/nb_warp, a no-op so far) now runs 'make clean' in Source (Source and all P*) once per write of the include files. It is skipped, with a warning, when called from make itself (MAKELEVEL set, run_card.inc rule). The hook keeps its signature since plugins can overwrite it. Co-Authored-By: Claude --- madgraph/various/banner.py | 28 ++++++++++++++++++++++ tests/unit_tests/various/test_banner.py | 32 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/madgraph/various/banner.py b/madgraph/various/banner.py index 6f2606a801..11529f6e0d 100755 --- a/madgraph/various/banner.py +++ b/madgraph/various/banner.py @@ -3781,6 +3781,10 @@ def write_include_file(self, output_dir, output_file=None): for incname in self.includepath: self.write_one_include_file(output_dir, incname, output_file) + # directory of the include files, for the fct_mod functions + # (keep their signature: plugins can overwrite them) + self.include_output_dir = output_dir + self.simd_reset_done = False for name,value in value_in_old_include.items(): if value != self[name]: self.fct_mod[name][0](value, self[name], name, *self.fct_mod[name][1],**self.fct_mod[name][2]) @@ -4933,6 +4937,30 @@ def check_validity(self): self.set('tmin_for_channel', -self['tmin_for_channel']) + def reset_simd(self, old_value, new_value, name, *args, **opts): + """vector_size/nb_warp changed: VECSIZE_MEMMAX (vector.inc) sets the + size of arrays/common blocks shared by the code of Source and of + SubProcesses, while the makefiles do not track that dependency. + Keeping old object files gives a code mixing both sizes (wrong or zero + cross-section) -> clean the compiled code of Source and of all P*.""" + + if getattr(self, 'simd_reset_done', False): + return + source_dir = getattr(self, 'include_output_dir', None) + if not source_dir or not os.path.exists(pjoin(source_dir, 'makefile')): + return + if 'MAKELEVEL' in os.environ: + # called by make (run_card.inc rule): cleaning would remove the + # object files of the running make + logger.warning('%s changed from %s to %s: run "make clean" in %s ' + 'before compiling again', name, old_value, new_value, + source_dir) + return + logger.info('%s changed from %s to %s: removing the compiled code', + name, old_value, new_value) + misc.compile(['clean'], cwd=source_dir) + self.simd_reset_done = True + def update_system_parameter_for_include(self): """system parameter need to be setupe""" diff --git a/tests/unit_tests/various/test_banner.py b/tests/unit_tests/various/test_banner.py index a7dcb559e1..5ae5af97fc 100755 --- a/tests/unit_tests/various/test_banner.py +++ b/tests/unit_tests/various/test_banner.py @@ -16,6 +16,7 @@ from __future__ import absolute_import import unittest +from unittest import mock import tempfile import madgraph.various.banner as bannermod import madgraph.various.misc as misc @@ -1454,6 +1455,37 @@ class FakeCmd: shutil.rmtree(me_dir) + def test_reset_simd_cleans_compiled_code(self): + """changing vector_size/nb_warp must remove the compiled code + (VECSIZE_MEMMAX is shared by Source and SubProcesses but not + tracked by the makefiles)""" + + source_dir = tempfile.mkdtemp(prefix='mg_simd_') + try: + with open(pjoin(source_dir, 'makefile'), 'w') as fsock: + fsock.write('clean:\n\techo cleaned >> clean_calls\n') + marker = pjoin(source_dir, 'clean_calls') + run_card = bannermod.RunCardLO() + run_card.include_output_dir = source_dir + run_card.simd_reset_done = False + + env = dict(os.environ) + env.pop('MAKELEVEL', None) + # called from make (run_card.inc rule): no clean + env_make = dict(env, MAKELEVEL='1') + with mock.patch.dict(os.environ, env_make, clear=True): + run_card.reset_simd(1, 16, 'vector_size') + self.assertFalse(os.path.exists(marker)) + + with mock.patch.dict(os.environ, env, clear=True): + run_card.reset_simd(1, 16, 'vector_size') + # nb_warp changed in the same write: a single clean + run_card.reset_simd(1, 2, 'nb_warp') + with open(marker) as fsock: + self.assertEqual(fsock.read().split(), ['cleaned']) + finally: + shutil.rmtree(source_dir) + MadLoopParam = bannermod.MadLoopParam class TestMadLoopParam(unittest.TestCase): """ A class to test the MadLoopParam functionality """ From a1c1120e48b4a23151a8040e0a1fd88f38290212 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 27 Oct 2026 07:51:01 +0100 Subject: [PATCH 19/49] LO madevent vector mode: fix decays (one initial-state particle) For ninitial == 1 the vector PDF lines were replaced by the scalar ones: NB_WARP_USED was never set and ALL_PD never filled, so DSIG_VEC / DSIG_NOGROUP_VEC returned zero (t > b e+ ve, vector_size=16: 'Survey return zero cross section' with and without grouping). Keep the NB_WARP_USED setup and fill ALL_PD for all the events. Reported by the sourcery-ai review of #467. Co-Authored-By: Claude --- madgraph/iolibs/export_v4.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/madgraph/iolibs/export_v4.py b/madgraph/iolibs/export_v4.py index 54c63643bc..8cbb7f5033 100755 --- a/madgraph/iolibs/export_v4.py +++ b/madgraph/iolibs/export_v4.py @@ -2229,13 +2229,14 @@ def get_pdf_lines(self, matrix_element, ninitial, subproc_group = False, vector= if vector: pdf_definition_lines_vec = "" pdf_data_lines_vec = "" - pdf_lines = """ NB_WARP_USED = VECSIZE_USED / WARP_SIZE + nb_warp_lines = """ NB_WARP_USED = VECSIZE_USED / WARP_SIZE IF( NB_WARP_USED * WARP_SIZE .NE. VECSIZE_USED ) THEN WRITE(*,*) 'ERROR: NB_WARP_USED * WARP_SIZE .NE. VECSIZE_USED', & NB_WARP_USED, WARP_SIZE, VECSIZE_USED STOP ENDIF - +""" + pdf_lines = nb_warp_lines + """ DO CURR_WARP=1, NB_WARP_USED IF(IMIRROR_VEC(CURR_WARP).EQ.1)THEN IB(1) = 1 @@ -2250,7 +2251,15 @@ def get_pdf_lines(self, matrix_element, ninitial, subproc_group = False, vector= - if ninitial == 1: + if ninitial == 1 and vector: + # no PDF: same weight for all the events of the vector + pdf_lines = nb_warp_lines + "ALL_PD(0,:) = 0d0\nIPROC = 0\n" + for i, proc in enumerate(processes): + process_line = proc.base_string() + pdf_lines = pdf_lines + "IPROC=IPROC+1 ! " + process_line + pdf_lines = pdf_lines + "\nALL_PD(IPROC,:)=1d0\n" + pdf_lines = pdf_lines + "ALL_PD(0,:)=ALL_PD(0,:)+ALL_PD(IPROC,:)\n" + elif ninitial == 1: pdf_lines = "PD(0) = 0d0\nIPROC = 0\n" for i, proc in enumerate(processes): process_line = proc.base_string() From e81b8de5991915d86eeb3136ecdb1838d95d6371 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 27 Oct 2026 14:01:00 +0100 Subject: [PATCH 20/49] IOTests: pin the Tensor Integral libraries of the loop interface outputs testIO_TIR_output and testIO_MatchBoxOutput depended on what is installed on the machine running them: which TIR libraries are found (and whether ninja supports quadruple precision) changes LOOPLIBS_AVAILABLE, the NINJA/COLLIER interfaces and QP_NLOOPLIB in the generated loop_matrix.f, TIR_interface.f and CT_interface.f. activate_dependence also tried to install ninja/collier, and IREGI was compiled (several minutes). pinned_tir_libraries() generates the output as if exactly iregi, ninja (with quadruple precision) and collier were available, the set the reference files were written with, without looking for, installing or compiling any of them. --- tests/acceptance_tests/test_cmd_madloop.py | 55 +++++++++++++++------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/tests/acceptance_tests/test_cmd_madloop.py b/tests/acceptance_tests/test_cmd_madloop.py index 1e32b681d5..bce865598b 100755 --- a/tests/acceptance_tests/test_cmd_madloop.py +++ b/tests/acceptance_tests/test_cmd_madloop.py @@ -24,6 +24,8 @@ import sys import logging import time +import contextlib +from unittest import mock import tests.IOTests as IOTests logger = logging.getLogger('test_cmd') @@ -33,6 +35,7 @@ import madgraph.interface.amcatnlo_run_interface as NLOCmd import madgraph.interface.launch_ext_program as launch_ext import madgraph.various.misc as misc +import madgraph.loop.loop_exporters as loop_exporters import tests.IOTests as IOTests import madgraph.various.lhe_parser as lhe_parser @@ -1078,6 +1081,33 @@ def test_density_mode_vs_standalone_LI1(self): self.assertAlmostEqual(density_check[j].imag, rho_standalone[j].imag, places=7) +# Tensor Integral Reduction libraries considered as installed by the IOTests +# below. Which of them are available changes the generated code +# (LOOPLIBS_AVAILABLE, the NINJA/COLLIER interfaces, QP_NLOOPLIB), so the +# reference files must not depend on what is installed on the machine +# running the test. +IOTEST_TIR_AVAILABLE = ['iregi', 'ninja', 'collier'] +IOTEST_NINJA_QUAD_PREC = True + +@contextlib.contextmanager +def pinned_tir_libraries(available=IOTEST_TIR_AVAILABLE, + ninja_quad_prec=IOTEST_NINJA_QUAD_PREC): + """Generate the loop output as if exactly the TIR libraries in + 'available' were installed (ninja with quadruple precision support if + ninja_quad_prec), without looking for, installing or compiling any of + them. Only usable for tests that do not compile the output.""" + + def link_TIR(self, targetPath, libpath, libname, tir_name='TIR'): + self.tir_available_dict[tir_name] = tir_name in available + return '' + + with mock.patch.object(loop_exporters.LoopProcessOptimizedExporterFortranSA, + 'link_TIR', link_TIR), \ + mock.patch.object(misc, 'get_ninja_quad_prec_support', + lambda ninja_lib_path: ninja_quad_prec): + yield + + class TestCmdMatchBox(IOTests.IOTestManager): def setUp(self): @@ -1089,13 +1119,6 @@ def setUp(self): # first the handlers and second the level. self.logger_saved_info = {} - # Select the Tensor Integral to include in the test - misc.deactivate_dependence('pjfry', cmd = self.interface, log='stdout') - misc.deactivate_dependence('samurai', cmd = self.interface, log='stdout') - misc.deactivate_dependence('golem', cmd = self.interface, log='stdout') - misc.activate_dependence('ninja', cmd = self.interface, log='stdout',MG5dir=MG5DIR) - misc.activate_dependence('collier', cmd = self.interface, log='stdout',MG5dir=MG5DIR) - @IOTests.createIOTest() def testIO_MatchBoxOutput(self): r""" target: TEST/SubProcesses/P1_uux_uux/[.+\.(inc|f)] @@ -1109,8 +1132,10 @@ def testIO_MatchBoxOutput(self): output matchbox %(path)s/TEST -f """ % {'path': self.IOpath} - for line in cmd.split('\n'): - self.interface.exec_cmd(line) + # the Tensor Integral libraries are fixed (see pinned_tir_libraries) + with pinned_tir_libraries(): + for line in cmd.split('\n'): + self.interface.exec_cmd(line) #=============================================================================== @@ -1130,14 +1155,10 @@ def run_cmd(cmd): interface.exec_cmd(cmd, errorhandling=False, printcmd=False, precmd=True, postcmd=True) - # Select the Tensor Integral to include in the test - misc.deactivate_dependence('pjfry', cmd = interface, log='stdout') - misc.deactivate_dependence('samurai', cmd = interface, log='stdout') - misc.deactivate_dependence('golem', cmd = interface, log='stdout') - misc.activate_dependence('ninja', cmd = interface, log='stdout',MG5dir=MG5DIR) - - run_cmd('generate g g > t t~ [virt=QCD]') - interface.onecmd('output %s -f' % str(pjoin(self.IOpath,'ggttx_IOTest'))) + # the Tensor Integral libraries are fixed (see pinned_tir_libraries) + with pinned_tir_libraries(): + run_cmd('generate g g > t t~ [virt=QCD]') + interface.onecmd('output %s -f' % str(pjoin(self.IOpath,'ggttx_IOTest'))) #remove some function from some file: IOTests.IOTest.remove_f77_function_from_file( From af145fe55ed6d293d992b56d50ea1b360d77017f Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Tue, 27 Oct 2026 14:33:02 +0100 Subject: [PATCH 21/49] update IOTEST --- .../auto_dsig.f | 4 +- .../auto_dsig.f | 117 +++++++++++++++++- .../dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f | 29 ----- .../gg_wmtbx/%..%..%Source%MODEL%rw_onia.f | 29 ----- .../dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f | 29 ----- .../gg_wmtbx/%..%..%Source%MODEL%rw_onia.f | 29 ----- .../gg_hh/%..%..%Source%MODEL%rw_onia.f | 29 ----- .../gg_ttx/%..%..%Source%MODEL%rw_onia.f | 29 ----- .../gg_ttx/%..%..%Source%MODEL%rw_onia.f | 29 ----- 9 files changed, 115 insertions(+), 209 deletions(-) delete mode 100644 tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f delete mode 100644 tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f delete mode 100644 tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f delete mode 100644 tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f delete mode 100644 tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%rw_onia.f delete mode 100644 tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%rw_onia.f delete mode 100644 tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%rw_onia.f diff --git a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f index a827de31da..11e09d16b5 100644 --- a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f +++ b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_group/auto_dsig.f @@ -118,10 +118,11 @@ DOUBLE PRECISION FUNCTION DSIG1(PP,WGT,IMODE) NFACT=IFACT ENDIF ENDDO - DSIG1 = NFACT 10 CLOSE(LUN) + DSIG1 = NFACT RETURN 20 WRITE(*,*)'Error opening symfact.dat. No symmetry factor used.' + DSIG1 = NFACT RETURN ENDIF C Continue only if IMODE is 0, 4 or 5 @@ -528,6 +529,7 @@ DOUBLE PRECISION FUNCTION DSIG1_VEC(ALL_PP, ALL_XBK, ALL_Q2FACT, + SUBROUTINE PRINT_ZERO_AMP1() RETURN diff --git a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f index d02f86ee9d..b03df97094 100644 --- a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f +++ b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f @@ -117,10 +117,11 @@ DOUBLE PRECISION FUNCTION DSIG(PP,WGT,IMODE) NFACT=IFACT ENDIF ENDDO - DSIG = NFACT 10 CLOSE(LUN) + DSIG = NFACT RETURN 20 WRITE(*,*)'Error opening symfact.dat. No symmetry factor used.' + DSIG = NFACT RETURN ENDIF C Continue only if IMODE is 0, 4 or 5 @@ -257,9 +258,11 @@ INTEGER FUNCTION GET_MAXSPROC() - DOUBLE PRECISION FUNCTION DSIG_VEC(ALL_PP, ALL_XBK, ALL_Q2FACT, - $ ALL_CM_RAP, ALL_WGT, IMODE, ALL_OUT, SYMCONF, CONFSUB, - $ ICONF_VEC, IMIRROR_VEC, VECSIZE_USED) +C Without grouping, DSIG_VEC (called by dsample) is the wrapper +C defined below + DOUBLE PRECISION FUNCTION DSIG_NOGROUP_VEC(ALL_PP, ALL_XBK, + $ ALL_Q2FACT, ALL_CM_RAP, ALL_WGT, IMODE, ALL_OUT, SYMCONF, + $ CONFSUB, ICONF_VEC, IMIRROR_VEC, VECSIZE_USED) C **************************************************** C C Generated by MadGraph5_aMC@NLO v. %(version)s, %(date)s @@ -475,7 +478,9 @@ DOUBLE PRECISION FUNCTION DSIG_VEC(ALL_PP, ALL_XBK, ALL_Q2FACT, IPSEL=IPSEL+1 R=R-DABS(ALL_PD(IPSEL,IVEC))/ALL_PD(0,IVEC) ENDDO - CHANNEL = MAPCONFIG(ICONFIG) + + CHANNELS(IVEC) = MAPCONFIG(ICONFIG) + CHANNEL = CHANNELS(IVEC) ALL_RWGT(IVEC) = REWGT(ALL_PP(0,1,IVEC), IVEC) @@ -561,6 +566,98 @@ DOUBLE PRECISION FUNCTION DSIG_VEC(ALL_PP, ALL_XBK, ALL_Q2FACT, + SUBROUTINE DSIG_VEC(ALL_P,ALL_WGT,ALL_XBK,ALL_Q2FACT,ALL_CM_RAP + $ ,ICONF_VEC,IPROC,IMIRROR_VEC,ALL_OUT,VECSIZE_USED) +C **************************************************** +C Vector entry point called by dsample.f when the subprocesses +C are not grouped (same arguments as DSIG_VEC of the grouped +C output) +C No symmetry permutation and no mirror process here: +C all warps use ICONFIG and the momenta as generated. +C Set the scale and the couplings of each event (done in +C DSIGPROC_VEC for the grouped output) and call DSIG_NOGROUP_VEC +C INPUT: ALL_P(4*MAXDIM/3+14, VECSIZE_USED) +C INPUT/OUTPUT: ALL_WGT(VECSIZE_USED) (set to zero if the +C clustering fails) +C OUTPUT: ALL_OUT(VECSIZE_USED) (PDF*matrix element) +C **************************************************** + IMPLICIT NONE + INCLUDE '../../Source/vector.inc' ! defines VECSIZE_MEMMAX + INCLUDE 'genps.inc' + INCLUDE 'nexternal.inc' + INCLUDE 'maxconfigs.inc' + INCLUDE 'maxamps.inc' + INCLUDE 'run.inc' + DOUBLE PRECISION ALL_P(4*MAXDIM/3+14,VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_WGT(VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_XBK(2,VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_Q2FACT(2,VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_CM_RAP(VECSIZE_MEMMAX) + DOUBLE PRECISION ALL_OUT(VECSIZE_MEMMAX) + INTEGER ICONF_VEC(*), IPROC, IMIRROR_VEC(*) + INTEGER VECSIZE_USED +C +C GLOBAL VARIABLES +C + INTEGER MAPCONFIG(0:LMAXCONFIGS), ICONFIG + COMMON/TO_MCONFIGS/MAPCONFIG, ICONFIG + INTEGER IMIRROR_GLOBAL, IPROC_GLOBAL + COMMON/TO_MIRROR/ IMIRROR_GLOBAL, IPROC_GLOBAL + DOUBLE PRECISION CM_RAP + LOGICAL SET_CM_RAP + COMMON/TO_CM_RAP/SET_CM_RAP,CM_RAP +C +C LOCAL VARIABLES +C + INTEGER IVEC, IW, I, J + DOUBLE PRECISION ALL_P1(0:3,NEXTERNAL,VECSIZE_MEMMAX) + SAVE ALL_P1 + INTEGER SYMCONF(0:LMAXCONFIGS) + INTEGER CONFSUB(MAXSPROC,LMAXCONFIGS) + DOUBLE PRECISION XDUM + LOGICAL FIRST + DATA FIRST/.TRUE./ + SAVE FIRST + DOUBLE PRECISION DSIG_NOGROUP_VEC + +C momenta in the layout of the matrix element + DO IVEC=1, VECSIZE_USED + DO I=1, NEXTERNAL + DO J=0, 3 + ALL_P1(J,I,IVEC) = ALL_P(4*(I-1)+J+1,IVEC) + ENDDO + ENDDO + ENDDO + IPROC = 1 + DO IW=1, VECSIZE_USED/WARP_SIZE + ICONF_VEC(IW) = 1 + IMIRROR_VEC(IW) = 1 + ENDDO + SYMCONF(:) = ICONFIG + CONFSUB(:,:) = MAPCONFIG(ICONFIG) + IMIRROR_GLOBAL = 1 + IPROC_GLOBAL = 1 + IF (FIRST) THEN +C read the symmetry factor (as DSIG(PP,WGT,1) in the scalar mode) + XDUM = DSIG_NOGROUP_VEC(ALL_P1, ALL_XBK, ALL_Q2FACT, + $ ALL_CM_RAP, ALL_WGT, 1, ALL_OUT, SYMCONF, CONFSUB, ICONF_VEC + $ , IMIRROR_VEC, VECSIZE_USED) + FIRST = .FALSE. + ENDIF +C set the running scale and update the couplings of each event + DO IVEC=1, VECSIZE_USED + XBK(:) = ALL_XBK(:,IVEC) + CM_RAP = ALL_CM_RAP(IVEC) + CALL UPDATE_SCALE_COUPLING_IVEC(ALL_P1(0,1,IVEC), ALL_WGT(IVEC) + $ , ALL_Q2FACT(1,IVEC), IVEC) + ENDDO + ALL_OUT(:) = 0D0 + XDUM = DSIG_NOGROUP_VEC(ALL_P1, ALL_XBK, ALL_Q2FACT, ALL_CM_RAP, + $ ALL_WGT, 0, ALL_OUT, SYMCONF, CONFSUB, ICONF_VEC, IMIRROR_VEC, + $ VECSIZE_USED) + RETURN + END + SUBROUTINE PRINT_ZERO_AMP() RETURN @@ -672,11 +769,21 @@ SUBROUTINE STORE_GROUPING_CHOICE(IWARP) SUBROUTINE SELECT_GROUPING_VEC(IMIRROR_VEC, IPROC, ICONF_VEC, $ WGT, VECSIZE_USED) + IMPLICIT NONE + INCLUDE '../../Source/vector.inc' INTEGER IMIRROR_VEC(*) INTEGER IPROC INTEGER ICONF_VEC(*) DOUBLE PRECISION WGT(*) INTEGER VECSIZE_USED + INTEGER IW +C single process and no mirror (dsample uses imirror_vec for the +C cuts) + IPROC = 1 + DO IW=1, VECSIZE_USED/WARP_SIZE + ICONF_VEC(IW) = 1 + IMIRROR_VEC(IW) = 1 + ENDDO RETURN END diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%rw_onia.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%rw_onia.f deleted file mode 100644 index 6abc6b9e76..0000000000 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/%..%..%Source%MODEL%rw_onia.f +++ /dev/null @@ -1,29 +0,0 @@ -c************************************************************************ -c** ** -c** MadGraph/MadEvent Interface to FeynRules ** -c** ** -c** C. Duhr (Louvain U.) - M. Herquet (NIKHEF) ** -c** ** -c************************************************************************ - - subroutine setonia(onia_name) - implicit none - - character*(*) onia_name - logical readlha - - include 'ldme.inc' - - integer maxpara - parameter (maxpara=5000) - - integer nonia - character*20 onia(maxpara),value(maxpara) - - call LHA_loadcard(onia_name,nonia,onia,value) - - include 'onia_read.inc' - - return - - end From 1b4680c98f2548a649131a557616ccf273a3a6d0 Mon Sep 17 00:00:00 2001 From: Zach Marshall Date: Wed, 28 Oct 2026 10:30:53 -0700 Subject: [PATCH 22/49] Missing r formatting symbol in file_writers It looks like this string is missing the r formatting marker, which leads to an error in our generation system: ``` 15:45:04 Py:MadGraphUtils ERROR /build/ci-builds/main/AthGeneration/build/AthGeneration/AtlasTest/CITest/CMakeFiles/ciTestRun/Generation_CA_MG_LHE_13p6TeV/run_genTest950807/PROC_sm_0/bin/internal/file_writers.py:188: SyntaxWarning: invalid escape sequence '\s' 15:45:04 Py:MadGraphUtils ERROR keyword_pairs = {r'^if.+then\s*$': ('^end\s*if', 2), ``` --- madgraph/iolibs/file_writers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/madgraph/iolibs/file_writers.py b/madgraph/iolibs/file_writers.py index b4a9dda510..b970c64955 100755 --- a/madgraph/iolibs/file_writers.py +++ b/madgraph/iolibs/file_writers.py @@ -185,7 +185,7 @@ class FortranWriterError(FileWriter.FileWriterError): pass # Parameters defining the output of the Fortran writer - keyword_pairs = {r'^if.+then\s*$': ('^end\s*if', 2), + keyword_pairs = {r'^if.+then\s*$': (r'^end\s*if', 2), r'^type(?!\s\()\s.+\s*$': ('^endtype', 2), r'^do(?!\s+\d+)\s+': (r'^end\s*do\s*$', 2), '^subroutine': (r'^end\s*$', 0), From c41c058e4059481942e69e10875e37425b653ea8 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 09:59:10 +0100 Subject: [PATCH 23/49] Pythia8 8.318: load main164's merging hook from the shower card Port of MadGraph7 PR #361 (MadGraphTeam/MadGraph7@8b99723e68). Since Pythia8 8.318, main164 loads its CKKW-L/UMEPS/UNLOPS hook (aMCatNLOHooks) as a plugin, with a readString after reading the card. Pythia8 ignores that readString when the card has Main:subrun lines, as every card MG5aMC writes does (Settings::readFile leaves subrunNow set), so the hook is never loaded: - 'Merging:Process = guess', which the pythia8_card suggests, makes every shower job segfault; - UMEPS/UNLOPS lose their subtractive samples; - CKKW-L with an explicit process is not affected (identical events). When main164.cc requests the plugin, the card of a CKKW shower run by main164 now loads it itself (PY8Card.add_plugin): by the absolute path of the library, since the shower does not run with the Pythia8 library directory in the library search path; after the plugins of the user and with the key 'add', so that their UserHooks are kept; all in a single 'Init:plugins = {...}' line, since main164 reads the card twice before init(). Nothing changes for Pythia8 <= 8.317, whose main164 sets the hook itself, nor for the MG5aMC_PY8_interface (--old_interface), which sets the same hook itself. --- UpdateNotes.txt | 5 ++ madgraph/interface/madevent_interface.py | 11 ++++ madgraph/various/banner.py | 35 ++++++++++ madgraph/various/misc.py | 27 ++++++++ tests/unit_tests/interface/test_madevent.py | 72 +++++++++++++++++++++ tests/unit_tests/various/test_banner.py | 52 ++++++++++++++- tests/unit_tests/various/test_misc.py | 59 +++++++++++++++++ 7 files changed, 260 insertions(+), 1 deletion(-) diff --git a/UpdateNotes.txt b/UpdateNotes.txt index b4d9d25070..6a24b602f5 100644 --- a/UpdateNotes.txt +++ b/UpdateNotes.txt @@ -5,6 +5,11 @@ ANNOUNCEMENT: A new LTS (based on the current 3.5.X) is starting now and will act as the stable release for the coming years. 3.8.2 (XX/XX/XX): + OM: Pythia8 8.318: the LO shower (main164) ran CKKW-L/UMEPS/UNLOPS merging without its merging + hook, since main164 loads it with a readString that Pythia8 ignores for a card with + Main:subrun lines (all those of MG5aMC). 'Merging:Process = guess' crashed every shower job, + and UMEPS/UNLOPS lost their subtractive samples (CKKW-L with an explicit process was not + affected). The shower card now loads the hook itself (Init:plugins). OM: LO grouped output (default): the renormalisation/factorisation scales and the MLM xqcut veto were computed on the momenta before the symmetry permutation of the channel (#453). Channels with such permutations were biased (e.g. -3.5% for u q > z u q, also with MLM). diff --git a/madgraph/interface/madevent_interface.py b/madgraph/interface/madevent_interface.py index ed09d31c6d..e447062500 100755 --- a/madgraph/interface/madevent_interface.py +++ b/madgraph/interface/madevent_interface.py @@ -4645,6 +4645,17 @@ def setup_Pythia8RunAndCard(self, PY8_Card, run_type, use_mg5amc_py8_interface): "Read section 'Defining the hard process' of "+\ "http://home.thep.lu.se/~torbjorn/pythia81html/CKKWLMerging.html for more information.") + # Since Pythia8 8.318, main164 loads its merging hook as a plugin with + # a readString after reading the card. Pythia8 ignores that readString + # for a card with 'Main:subrun' lines, as ours always has: without + # the hook, 'Merging:Process = guess' crashes and UMEPS/UNLOPS lose + # their subtractive samples. Load the hook from the card instead + # (only for main164: the MG5aMC_PY8_interface sets its own hooks). + if not use_mg5amc_py8_interface: + merging_plugin = misc.get_pythia8_merging_plugin(self.options['pythia8_path']) + if merging_plugin: + PY8_Card.add_plugin(merging_plugin) + # When running CKKWL make sure that we do not write out the parameter # JetMatching:xxx as this can interfere with the MLM merging in older # versions of the driver. diff --git a/madgraph/various/banner.py b/madgraph/various/banner.py index 11529f6e0d..b7f8558ae2 100755 --- a/madgraph/various/banner.py +++ b/madgraph/various/banner.py @@ -2165,6 +2165,8 @@ def __init__(self, *args, **opts): self.visible_params_to_always_write = set() # List of parameters that should never be written out given the current context. self.params_to_never_write = set() + # Plugins that MG5aMC adds to the 'Init:plugins' of the card (see add_plugin). + self.init_plugins = [] # Parameters which have been set by the system (i.e. MG5 itself during # the regular course of the shower interface) @@ -2228,6 +2230,34 @@ def vetoParamWriteOut(self, name): "write" function will be invoked.""" self.params_to_never_write.add(name.lower()) + def card_plugins(self): + """The entries of 'Init:plugins' set in this card, by its 'Init:plugins =' + and then its 'Init:plugins +=' line.""" + + entries = [] + for name in ('Init:plugins', 'Init:plugins +'): + if name in self: + value = str(self[name]).strip() + if value.startswith('{') and value.endswith('}'): + value = value[1:-1] + entries += [entry.strip() for entry in value.split(',') if entry.strip()] + return entries + + def add_plugin(self, plugin): + """Make Pythia8 also load the UserHooks plugin '::', + after the plugins of this card and with the key 'add', so that it does + not replace the UserHooks these set. All of them are written in a single + 'Init:plugins = {...}' line: main164 reads the card twice before init(), + so that a '+=' line would load an 'add' plugin twice. + Nothing is done if the card already lists the class.""" + + name = plugin.split('::')[1] + if any(entry.split('::')[1:2] == [name] for entry in self.card_plugins()): + return + self.vetoParamWriteOut('Init:plugins') + self.vetoParamWriteOut('Init:plugins +') + self.init_plugins.append('%s::add' % plugin) + def systemSet(self, name, value, **opts): """Set an attribute of this card, independently of a specific user request and only if not already user_set.""" @@ -2555,6 +2585,11 @@ def group_params(params): logger.debug('Adding parameter %s (missing in the template) to current '+\ 'pythia8 card (with value %s)',param, value) + # The plugins of the card, followed by those MG5aMC adds + if self.init_plugins and not read_subrun: + output.write('!\n! Pythia8 plugins, including those added by MG5aMC.\n!\n') + output.write('Init:plugins={%s}\n' % ','.join(self.card_plugins() + self.init_plugins)) + if len(hidden_output_param)>0 and not template is None: output.write( """! diff --git a/madgraph/various/misc.py b/madgraph/various/misc.py index 21855429fb..c4bc1f9fa2 100755 --- a/madgraph/various/misc.py +++ b/madgraph/various/misc.py @@ -1592,6 +1592,33 @@ def get_HEPTools_location_setter(HEPToolsDir,type): else: return '' +def get_pythia8_merging_plugin(pythia8_path): + """The 'Init:plugins' entry ('::aMCatNLOHooks') of the merging + hook that main164 of this Pythia8 installation loads as a plugin, as the + main164 of Pythia8 8.318 does, or None if its main164 does not (up to + Pythia8 8.317, main164 sets the hook itself) or the plugin is missing. + The library is given by its absolute path, since the shower does not run + with the Pythia8 library directory in the library search path.""" + + for examples in (pjoin(pythia8_path, 'share', 'Pythia8', 'examples'), + pjoin(pythia8_path, 'examples')): + try: + source = open(pjoin(examples, 'main164.cc')).read() + except IOError: + continue + # join the adjacent string literals of the C++ source + source = re.sub(r'"\s*"', '', source) + if 'Init:plugins += {libpythia8amcatnloHooks.so::aMCatNLOHooks}' not in source: + return None + library = os.path.abspath(pjoin(pythia8_path, 'lib', 'libpythia8amcatnloHooks.so')) + if not os.path.isfile(library): + return None + # a path that the Pythia8 card (or MG5aMC's reading of it) would cut + if re.search(r'[\s,{}"!=]', library): + library = os.path.basename(library) + return '%s::aMCatNLOHooks' % library + return None + def get_shell_type(): """ Try and guess what shell type does the user use.""" try: diff --git a/tests/unit_tests/interface/test_madevent.py b/tests/unit_tests/interface/test_madevent.py index adeea02232..e3c04e2cd3 100755 --- a/tests/unit_tests/interface/test_madevent.py +++ b/tests/unit_tests/interface/test_madevent.py @@ -369,3 +369,75 @@ def test_copy_lhapdf_set_patches_global_without_local(self): self.assertFalse(os.path.exists(local_set)) self.assertIn('AlphaS_FlavorScheme: variable', open(global_info).read()) self.assertIn('AlphaS_NumFlavors: 5', open(global_info).read()) + + +class TestPythia8MergingPlugin(unittest.TestCase): + """Since Pythia8 8.318, main164 loads its merging hook as a plugin, with + a readString that Pythia8 ignores after reading a card with Main:subrun + lines (all of ours): the card of a CKKW-L shower requests the plugin.""" + + def setUp(self): + import madgraph.various.banner as banner_mod + self.banner_mod = banner_mod + self.tmpdir = tempfile.mkdtemp(prefix='mg5_py8_merging') + self.template = open(pjoin(madgraph.MG5DIR, 'Template', 'LO', 'Cards', + 'pythia8_card_default.dat')).read() + + def tearDown(self): + shutil.rmtree(self.tmpdir, ignore_errors=True) + + def make_pythia8(self, version): + """a fake Pythia8 installation, with main164.cc as in this version""" + py8 = pjoin(self.tmpdir, 'pythia%s' % version) + os.makedirs(pjoin(py8, 'share', 'Pythia8', 'examples')) + os.makedirs(pjoin(py8, 'lib')) + if version == '8318': + source = (' pythia.readString("Init:plugins += {libpythia8amcatnloHooks.so"\n' + ' "::aMCatNLOHooks}");\n') + open(pjoin(py8, 'lib', 'libpythia8amcatnloHooks.so'), 'w').close() + else: + source = ' pythia.setUserHooksPtr(mergingHooks);\n' + with open(pjoin(py8, 'share', 'Pythia8', 'examples', 'main164.cc'), 'w') as fsock: + fsock.write(source) + return py8 + + def setup_card(self, pythia8_path, run_type, use_mg5amc_py8_interface=False, + **run_card): + """the card of the shower, as do_pythia8 sets it up""" + class FakeCmd(object): + pass + cmd = FakeCmd() + cmd.run_tag, cmd.run_name, cmd.me_dir = 'tag_1', 'run_01', self.tmpdir + cmd.to_store = [] + cmd.options = {'run_mode': 2, 'pythia8_path': pythia8_path} + cmd.proc_characteristic = {'max_n_matched_jets': 2} + cmd.run_card = self.banner_mod.RunCardLO() + for name, value in run_card.items(): + cmd.run_card[name] = value + card = self.banner_mod.PY8Card(self.template) + card.read(self.template + 'Merging:Process = guess\n', setter='user') + mecmd.MadEventCmd.setup_Pythia8RunAndCard(cmd, card, run_type, + use_mg5amc_py8_interface=use_mg5amc_py8_interface) + return card + + def test_ckkwl_requests_the_merging_plugin(self): + ckkwl = {'ickkw': 0, 'xqcut': 0.0, 'ktdurham': 30.0} + py8 = self.make_pythia8('8318') + card = self.setup_card(py8, 'CKKW', **ckkwl) + self.assertEqual(card.init_plugins, + ['%s::aMCatNLOHooks::add' % + os.path.abspath(pjoin(py8, 'lib', 'libpythia8amcatnloHooks.so'))]) + # up to Pythia8 8.317, main164 sets the hook itself + card = self.setup_card(self.make_pythia8('8317'), 'CKKW', **ckkwl) + self.assertEqual(card.init_plugins, []) + # main164 does not merge an MLM shower + card = self.setup_card(py8, 'MLM', ickkw=1, xqcut=30.0) + self.assertEqual(card.init_plugins, []) + + # the MG5aMC_PY8_interface sets the hook itself: its card loads no plugin + card = self.setup_card(py8, 'CKKW', use_mg5amc_py8_interface=True, **ckkwl) + self.assertEqual(card.init_plugins, []) + cmd_card = pjoin(self.tmpdir, 'tag_1_pythia8.cmd') + card.write(cmd_card, self.template, direct_pythia_input=True, + use_mg5amc_py8_interface=True) + self.assertNotIn('init:plugins', open(cmd_card).read().lower()) diff --git a/tests/unit_tests/various/test_banner.py b/tests/unit_tests/various/test_banner.py index 5ae5af97fc..19077fc036 100755 --- a/tests/unit_tests/various/test_banner.py +++ b/tests/unit_tests/various/test_banner.py @@ -16,6 +16,7 @@ from __future__ import absolute_import import unittest +import copy from unittest import mock import tempfile import madgraph.various.banner as bannermod @@ -536,10 +537,59 @@ def test_PY8Card_with_subruns(self): set([k.lower() for k in modified_PY8Card.subruns[subrunID].keys()]) out = io.StringIO() modified_PY8Card.write(out,self.basic_PY8_template) - out.seek(0) + out.seek(0) read_PY8Card=bannermod.PY8Card(out) self.assertEqual(modified_PY8Card, read_PY8Card) + def test_PY8Card_add_plugin(self): + """A plugin that MG5aMC adds comes once, after the plugins of the + user, in the part of the card that main164 reads for all subruns, + also in the cards of the parallel shower.""" + + def write(card, template, add_missing=True): + out = io.StringIO() + card.write(out, template, direct_pythia_input=True, add_missing=add_missing) + return out.getvalue() + + def plugin_lines(text): + return [l for l in text.split('\n') if l.lower().startswith('init:plugins')] + + plugin = '/py8/lib/libpythia8amcatnloHooks.so::aMCatNLOHooks' + card = bannermod.PY8Card(self.basic_PY8_template) + self.assertEqual(plugin_lines(write(card, self.basic_PY8_template)), []) + + for user_line, entries in [ + ('', []), + ('Init:plugins = {libpythia8hepmc3.so::HepMC3Hooks}', + ['libpythia8hepmc3.so::HepMC3Hooks']), + ('Init:plugins += { libX.so::X::add }', ['libX.so::X::add'])]: + card = bannermod.PY8Card(self.basic_PY8_template) + card.read(self.basic_PY8_template + user_line + '\n', setter='user') + card.add_plugin(plugin) + text = write(card, self.basic_PY8_template) + expected = ['Init:plugins={%s}' % ','.join(entries + [plugin + '::add'])] + self.assertEqual(plugin_lines(text), expected) + self.assertLess(text.index('Init:plugins'), text.index('Main:subrun')) + + # the parallel shower writes a copy of the card, then the card of + # each job, from that one + parallel = write(copy.copy(card), self.basic_PY8_template) + self.assertEqual(plugin_lines(parallel), expected) + split_card = bannermod.PY8Card(parallel, setter='user') + split_card.systemSet('Main:numberOfEvents', 10, force=True) + self.assertEqual(plugin_lines(write(split_card, parallel, add_missing=False)), + expected) + + # the user already loads it + card = bannermod.PY8Card(self.basic_PY8_template) + card.read(self.basic_PY8_template + + 'Init:plugins += {libpythia8amcatnloHooks.so::aMCatNLOHooks}\n', + setter='user') + card.add_plugin(plugin) + self.assertEqual(card.init_plugins, []) + self.assertEqual(plugin_lines(write(card, self.basic_PY8_template)), + ['Init:plugins +={libpythia8amcatnloHooks.so::aMCatNLOHooks}']) + class TestRivetCard(unittest.TestCase): """ Test the RivetCard functionality """ diff --git a/tests/unit_tests/various/test_misc.py b/tests/unit_tests/various/test_misc.py index 2727b9dd65..7ed92d6a7c 100755 --- a/tests/unit_tests/various/test_misc.py +++ b/tests/unit_tests/various/test_misc.py @@ -15,6 +15,9 @@ """Test the validity of the LHE parser""" from __future__ import absolute_import +import os +import shutil +import tempfile import unittest import madgraph.various.misc as misc class TEST_misc(unittest.TestCase): @@ -130,3 +133,59 @@ def test_ordered_set(self): a = set(['a', 'b']) self.assertEqual(a.pop(), 'a') self.assertEqual(len(a), 1) + + +class TEST_pythia8_merging_plugin(unittest.TestCase): + """main164 of Pythia8 8.318 loads its merging hook as a plugin (a stub + Pythia8 installation here).""" + + # how main164.cc of Pythia8 8.318 requests its merging hook + main164_with_merging_plugin = ( + ' if (doMerging) {\n' + ' pythia.readString("Init:plugins += {libpythia8amcatnloHooks.so"\n' + ' "::aMCatNLOHooks}");\n' + ' }\n') + + def setUp(self): + self.tmpdir = tempfile.mkdtemp() + self.py8 = os.path.join(self.tmpdir, 'pythia8') + self.examples = os.path.join(self.py8, 'share', 'Pythia8', 'examples') + os.makedirs(self.examples) + + def tearDown(self): + shutil.rmtree(self.tmpdir) + + def write_merging_plugin(self, pythia8_path): + library = os.path.join(pythia8_path, 'lib', 'libpythia8amcatnloHooks.so') + os.makedirs(os.path.dirname(library)) + open(library, 'w').close() + return library + + def test_merging_plugin(self): + """main164 of Pythia8 8.318 loads its merging hook as a plugin: the + entry for Init:plugins, with the absolute path of the library""" + + self.assertEqual(misc.get_pythia8_merging_plugin(self.py8), None) + library = self.write_merging_plugin(self.py8) + # up to Pythia8 8.317, main164 sets the hook itself + with open(os.path.join(self.examples, 'main164.cc'), 'w') as fsock: + fsock.write(' if (doMerging) pythia.setUserHooksPtr(mergingHooks);\n') + self.assertEqual(misc.get_pythia8_merging_plugin(self.py8), None) + + with open(os.path.join(self.examples, 'main164.cc'), 'w') as fsock: + fsock.write(self.main164_with_merging_plugin) + self.assertEqual(misc.get_pythia8_merging_plugin(self.py8), + '%s::aMCatNLOHooks' % os.path.abspath(library)) + os.remove(library) + self.assertEqual(misc.get_pythia8_merging_plugin(self.py8), None) + + def test_merging_plugin_path_the_card_cannot_hold(self): + """a ',' or a space in the path of the library: its bare name""" + + source_tree = os.path.join(self.tmpdir, 'pythia 8,318') + os.makedirs(os.path.join(source_tree, 'examples')) + with open(os.path.join(source_tree, 'examples', 'main164.cc'), 'w') as fsock: + fsock.write(self.main164_with_merging_plugin) + self.write_merging_plugin(source_tree) + self.assertEqual(misc.get_pythia8_merging_plugin(source_tree), + 'libpythia8amcatnloHooks.so::aMCatNLOHooks') From 12e7d376ab330e12841fb72355d07eb1f254bf2d Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 10:01:31 +0100 Subject: [PATCH 24/49] CI: run TEST_pythia8_merging_plugin (test_misc) in unittest_madevent_run The new test_banner and test_madevent tests already run there through the test_banner and test_madevent module entries. --- .github/workflows/unittest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index 8a1f89c6ad..c7db672409 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -699,7 +699,8 @@ jobs: # madevent run helpers: Delphes split fusion and LHAPDF info patching # (madevent_interface), atomic make_opts update and the transpole s-hat map # (compiled with gfortran). These modules were not fully listed in any - # workflow (CI coverage audit). + # workflow (CI coverage audit). Also the merging hook of the Pythia8 8.318 + # main164 (misc.get_pythia8_merging_plugin). runs-on: ubuntu-latest if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == true @@ -709,7 +710,7 @@ jobs: - name: test madevent interface, make_opts and transpole helpers run: | cd $GITHUB_WORKSPACE - ./tests/test_manager.py test_madevent test_make_opts test_transpole -t0 + ./tests/test_manager.py test_madevent test_make_opts test_transpole TEST_pythia8_merging_plugin -t0 unittest_polarisation: From f48dedc34ef5a94e73f50c9cbf236404e9854e7e Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 09:43:32 +0100 Subject: [PATCH 25/49] LO setcuts: fix the ihtmin lower bound on shat The inclusive Ht cut (ihtmin) constrains HTj+HTb but its contribution to smin was added to the b-block as ihtmin**2-htjmin**2, on top of the jet-block term. When the jet block was driven by ptj/ptjNmin/htNmin the resulting smin exceeded the true minimum and removed allowed phase space. Use the global bound sqrt(shat) >= sum pT instead. Also count b-quarks from decays (cut_decays=F) in the b-block, as cuts.f applies ihtmin and xptb to them (the no-cut branch was dead). p p > b b~ j, ptj=150, ptb=20 (HT>=300 forced by pT balance): old: ihtmin=0 8528(40) pb, ihtmin=300 8287(33) pb (smin=112500) new: ihtmin=0 8584(37) pb, ihtmin=300 8526(37) pb (smin=90000) Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index f32da8b9fc..bd8d9b7c9f 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -583,7 +583,7 @@ SUBROUTINE SETCUTS nb_b = 0 nb_nocut = 0 do i=nincoming+1,nexternal - if (is_a_b(i).and.do_cuts(i)) then + if (is_a_b(i)) then nb_b = nb_b + 1 smin_m = smin_m - pmass(i)**2 if (do_cuts(i)) then @@ -604,8 +604,11 @@ SUBROUTINE SETCUTS if ((nb_b-nb_nocut).gt.0) then smin_m = smin_m + (nb_b-nb_nocut)*(nb_b-nb_nocut-1)/2d0*mmbb**2 endif - smin = smin + max(smin_p**2, smin_m, (ihtmin**2-htjmin**2)) + smin = smin + max(smin_p**2, smin_m) endif +c inclusive Ht cut (jets+b, including decay products): sqrt(shat) >= sum pT +c This cannot be attributed to the b-block alone since it constrains HTj+HTb. + smin = max(smin, ihtmin**2) c check for the photon smin_m = 0d0 smin_p = 0d0 From 34980c333f7f53af6e1610d0c94d8748ad5c6790 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 09:58:06 +0100 Subject: [PATCH 26/49] LO setcuts: keep decay b-quarks out of the b-block smin Re-enabling the no-cut branch is unsafe with xptb>0: a no-cut b counted first gets xptb and a cut b counted second gets ptb on top, while the event may have the cut b at pT=xptb and the decay b soft. Skipping decay b's is conservative; the ihtmin bound is global anyway. Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index bd8d9b7c9f..dd35f2760f 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -583,7 +583,7 @@ SUBROUTINE SETCUTS nb_b = 0 nb_nocut = 0 do i=nincoming+1,nexternal - if (is_a_b(i)) then + if (is_a_b(i).and.do_cuts(i)) then nb_b = nb_b + 1 smin_m = smin_m - pmass(i)**2 if (do_cuts(i)) then @@ -606,7 +606,7 @@ SUBROUTINE SETCUTS endif smin = smin + max(smin_p**2, smin_m) endif -c inclusive Ht cut (jets+b, including decay products): sqrt(shat) >= sum pT +c inclusive Ht cut (all jets+b, cut_decays not used in cuts.f): sqrt(shat) >= sum pT c This cannot be attributed to the b-block alone since it constrains HTj+HTb. smin = max(smin, ihtmin**2) c check for the photon From 8af924d0a4db6b4eb10690422b0edb08d25875cf Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 10:14:46 +0100 Subject: [PATCH 27/49] LO setcuts: safe jet-block smin with no-cut jets and cutuse=1 The jet block added per-leg bounds in leg order: a no-cut jet (decay product with cut_decays=F) counted first got ptj1min and a cut jet counted later got ptj on top, although the cut jet can be the leading one. With cutuse=1 all ptjNmin were required while cuts.f only asks one of them. Now bound the k-th largest jet energy by max(ptjNmin (N>=k), xptj (k=1), ej/ptj (k<=number of cut jets)), htNmin on partial sums. p p > w+ j j, w+ > j j, cut_decays=F, ptj=150, ptj1min=160 (reference: same cut via xptj=160): ref 67.50(34), old 65.99(29), new 67.30(33) pb. p p > j j j, cutuse=1, ptj1..3min=150 (reference cutuse=0, ptj1min=150): ref 490835(2217), old 484674(1801), new 493148(2193) pb. Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 54 ++++++++++++++---------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index dd35f2760f..9bcbc50d10 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -116,6 +116,7 @@ SUBROUTINE SETCUTS c integer nb_j, nb_b, nb_a, nb_l, nb_nocut,nb_pdg double precision smin_p, smin_m ! local variable to compute smin + double precision ptjk c c setup masses for the final-state particles c @@ -534,6 +535,11 @@ SUBROUTINE SETCUTS c smin = 0d0 c check for the jet +c ptj/ej only apply to the jets with do_cuts, while ptjNmin, xptj, htNmin +c and htjmin apply to all the jets (ordered in pT, see cuts.f). +c The k-th hardest jet then has E >= pT >= max(ptjNmin, N>=k) and at least +c (nb_j-nb_nocut) jets have E >= max(ej,ptj), so the k-th largest +c E is bounded by max(ptjNmin (N>=k), ej, ptj (if k<=nb_j-nb_nocut)). smin_m = 0d0 smin_p = 0d0 nb_j = 0 @@ -542,35 +548,27 @@ SUBROUTINE SETCUTS if (is_a_j(i)) then nb_j = nb_j + 1 smin_m = smin_m - pmass(i)**2 - if (do_cuts(i))then - if (nb_j.eq.1) then - smin_p = smin_p + max(ej,ptj,xptj,0d0, - & max(ptj1min,ptj2min,ptj3min,ptj4min)) - elseif(nb_j.eq.2) then - smin_p = max(ht2min, smin_p + max(ej,ptj,0d0, - & max(ptj2min,ptj3min,ptj4min))) - elseif(nb_j.eq.3) then - smin_p = max(ht3min, smin_p + max(ej,ptj,0d0, - & max(ptj3min,ptj4min))) - elseif(nb_j.eq.4) then - smin_p = max(ht4min, smin_p + max(ej,ptj,ptj4min,0d0)) - else - smin_p = smin_p + max(ej,ptj,0d0) - endif - else - nb_nocut = nb_nocut + 1 - if (nb_j.eq.1) then - smin_p = smin_p + max(0d0,ptj1min,ptj2min,ptj3min,ptj4min) - elseif(nb_j.eq.2) then - smin_p = max(ht2min, smin_p + max(ptj2min,ptj3min,ptj4min,0d0)) - elseif(nb_j.eq.3) then - smin_p = max(ht3min, smin_p + max(0d0,ptj3min,ptj4min)) - elseif(nb_j.eq.4) then - smin_p = max(ht4min, smin_p + max(ptj4min,0d0)) - endif - endif + if (.not.do_cuts(i)) nb_nocut = nb_nocut + 1 endif - enddo + enddo + do k=1,nb_j + ptjk = 0d0 + if (jetor) then + do j=k,4 + ptjk = max(ptjk, ptjmin4(j)) + enddo + elseif (k.eq.1) then +c cutuse=1: only one of the min(nb_j,4) leading jets has to pass + ptjk = ptjmin4(1) + do j=2,min(nb_j,4) + ptjk = min(ptjk, ptjmin4(j)) + enddo + endif + if (k.eq.1) ptjk = max(ptjk, xptj) + if (k.le.nb_j-nb_nocut) ptjk = max(ptjk, ej, ptj) + smin_p = smin_p + max(ptjk, 0d0) + if (k.ge.2.and.k.le.4) smin_p = max(smin_p, htjmin4(k)) + enddo if (nb_j.gt.0)then if ((nb_j-nb_nocut).gt.0)then smin_m = smin_m + (nb_j-nb_nocut)*(nb_j-nb_nocut-1)/2d0*mmjj**2 From bdcabcdc0226d23c8e38ab22c3e3594398a452f2 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 12:18:58 +0100 Subject: [PATCH 28/49] LO setcuts: rank-based smin for leptons and photons Same as for the jets: ptlNmin/xptl (xpta) apply to all the leptons (photons) while ptl/el (pta/ea) only to those with do_cuts, so bound the k-th largest energy instead of charging leg by leg. Count all the leptons (the loop stopped at nexternal-1). mmll only for SFOS pairs with cuts, ptllmin only if a pair it applies to exists, mmnl only for exactly two leptons/neutrinos, as in cuts.f. Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 107 ++++++++++++++--------------- 1 file changed, 52 insertions(+), 55 deletions(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index 9bcbc50d10..4bc3cdcece 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -116,7 +116,9 @@ SUBROUTINE SETCUTS c integer nb_j, nb_b, nb_a, nb_l, nb_nocut,nb_pdg double precision smin_p, smin_m ! local variable to compute smin - double precision ptjk + double precision ptk + integer nb_pair + logical has_ptll c c setup masses for the final-state particles c @@ -552,21 +554,21 @@ SUBROUTINE SETCUTS endif enddo do k=1,nb_j - ptjk = 0d0 + ptk = 0d0 if (jetor) then do j=k,4 - ptjk = max(ptjk, ptjmin4(j)) + ptk = max(ptk, ptjmin4(j)) enddo elseif (k.eq.1) then c cutuse=1: only one of the min(nb_j,4) leading jets has to pass - ptjk = ptjmin4(1) + ptk = ptjmin4(1) do j=2,min(nb_j,4) - ptjk = min(ptjk, ptjmin4(j)) + ptk = min(ptk, ptjmin4(j)) enddo endif - if (k.eq.1) ptjk = max(ptjk, xptj) - if (k.le.nb_j-nb_nocut) ptjk = max(ptjk, ej, ptj) - smin_p = smin_p + max(ptjk, 0d0) + if (k.eq.1) ptk = max(ptk, xptj) + if (k.le.nb_j-nb_nocut) ptk = max(ptk, ej, ptj) + smin_p = smin_p + max(ptk, 0d0) if (k.ge.2.and.k.le.4) smin_p = max(smin_p, htjmin4(k)) enddo if (nb_j.gt.0)then @@ -608,6 +610,7 @@ SUBROUTINE SETCUTS c This cannot be attributed to the b-block alone since it constrains HTj+HTb. smin = max(smin, ihtmin**2) c check for the photon +c pta/ea only apply to the photons with do_cuts, xpta to all of them smin_m = 0d0 smin_p = 0d0 nb_a = 0 @@ -615,24 +618,17 @@ SUBROUTINE SETCUTS do i=nincoming+1,nexternal if (is_a_a(i))then nb_a = nb_a + 1 - if (do_cuts(i))then - if (ptgmin.eq.0d0) then - if (nb_a.eq.1) then - smin_p = smin_p + max(ea,pta,xpta,0d0) - else - smin_p = smin_p + max(ea,pta,0d0) - endif - endif - else - nb_nocut = nb_nocut + 1 - if(ptgmin.eq.0d0)then - if (nb_a.eq.1) then - smin_p = smin_p + max(xpta,0d0) - endif - endif - endif + if (.not.do_cuts(i)) nb_nocut = nb_nocut + 1 endif enddo + if (ptgmin.eq.0d0) then + do k=1,nb_a + ptk = 0d0 + if (k.eq.1) ptk = xpta + if (k.le.nb_a-nb_nocut) ptk = max(ptk, ea, pta) + smin_p = smin_p + max(ptk, 0d0) + enddo + endif if (nb_a.gt.0) then if ((nb_a-nb_nocut).gt.0)then smin_m = (nb_a-nb_nocut)*(nb_a-nb_nocut-1)/2d0*mmaa**2 @@ -640,47 +636,48 @@ SUBROUTINE SETCUTS smin = smin + max(smin_p**2, smin_m) endif c check for lepton +c ptl/el only apply to the leptons with do_cuts, ptlNmin and xptl to all +c the leptons (ordered in pT): same bound as for the jets. +c mmll only applies to same-flavour opposite-sign pairs with do_cuts, +c ptllmin only if such a pair (or a lepton/neutrino pair) exists and +c mmnl only for exactly two leptons/neutrinos (see above). smin_m = 0d0 smin_p = 0d0 nb_l = 0 nb_nocut = 0 - do i=nincoming+1,nexternal-1 + nb_pair = 0 + ncheck = 0 + has_ptll = .false. + do i=nincoming+1,nexternal + if (is_a_l(i).or.is_a_nu(i)) ncheck = ncheck + 1 if (is_a_l(i))then nb_l = nb_l + 1 smin_m = smin_m - pmass(i)**2 - if (do_cuts(i))then - if (nb_l.eq.1) then - smin_p = smin_p + max(el,ptl,xptl,0d0, - & max(ptl1min,ptl2min,ptl3min,ptl4min)) - elseif(nb_l.eq.2) then - smin_p = smin_p + max(el,ptl,0d0,max(ptl2min,ptl3min,ptl4min)) - elseif(nb_l.eq.3) then - smin_p = smin_p + max(el,ptl,0d0, max(ptl3min,ptl4min)) - elseif(nb_l.eq.4) then - smin_p = smin_p + max(el,ptl,ptl4min,0d0) - else - smin_p = smin_p + max(el,ptl,0d0) - endif - else - nb_nocut = nb_nocut + 1 - if (nb_l.eq.1) then - smin_p = smin_p + max(xptl,0d0, - & max(ptl1min,ptl2min,ptl3min,ptl4min)) - elseif(nb_l.eq.2) then - smin_p = smin_p + max(0d0,ptl2min,ptl3min,ptl4min) - elseif(nb_l.eq.3) then - smin_p = smin_p + max(0d0,ptl3min,ptl4min) - elseif(nb_l.eq.4) then - smin_p = smin_p + max(ptl4min,0d0) - endif - endif + if (.not.do_cuts(i)) nb_nocut = nb_nocut + 1 endif + do j=i+1,nexternal + if (ptll_min(j,i).gt.0d0) has_ptll = .true. + if (is_a_l(i).and.is_a_l(j).and.do_cuts(i).and.do_cuts(j) + & .and.abs(idup(i,1,iproc)).eq.abs(idup(j,1,iproc)) + & .and.idup(i,1,iproc)*idup(j,1,iproc).lt.0) + & nb_pair = nb_pair + 1 + enddo + enddo + do k=1,nb_l + ptk = 0d0 + do j=k,4 + ptk = max(ptk, ptlmin4(j)) + enddo + if (k.eq.1) ptk = max(ptk, xptl) + if (k.le.nb_l-nb_nocut) ptk = max(ptk, el, ptl) + smin_p = smin_p + max(ptk, 0d0) enddo if (nb_l.gt.0)then - if ((nb_l-nb_nocut).gt.0)then - smin_m = smin_m + (nb_l-nb_nocut)*((nb_l-nb_nocut)-1)/2d0*mmll**2 - endif - smin = smin + max(smin_p**2, smin_m, mmnl**2, ptllmin**2, misset**2) + smin_m = smin_m + nb_pair*max(mmll,0d0)**2 + smin_p = smin_p**2 + if (has_ptll) smin_p = max(smin_p, ptllmin**2) + if (ncheck.eq.2) smin_p = max(smin_p, max(mmnl,0d0)**2) + smin = smin + max(smin_p, smin_m, misset**2) endif c check for other PDG particle do i = 1,pdg_cut(0) From 14a6fbe71b5010a80d10908ee1c14360fe01a3fe Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 12:19:28 +0100 Subject: [PATCH 29/49] UpdateNotes: smin fixes Co-Authored-By: Claude --- UpdateNotes.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/UpdateNotes.txt b/UpdateNotes.txt index 044596cc76..4c681510be 100644 --- a/UpdateNotes.txt +++ b/UpdateNotes.txt @@ -4,6 +4,17 @@ ANNOUNCEMENT: 2.9.X version has a LONG TERM STABLE IS now an end of life for bug fixing/support since december 2025. A new LTS (based on current 3.5.X) is starting now and will act as stable release for the coming years. +3.5.18 (XX/XX/XX): + OM: LO: the lower bound on shat used for the phase-space integration (smin) could be too high, + never generating part of the allowed phase space (cross-section too low): + - ihtmin (inclusive Ht, jets+b) was attributed to the b-quarks alone, on top of the jet cuts + (e.g. p p > b b~ j with ptj=150, ihtmin=300: -2.8%); + - jets/leptons/photons from decays (cut_decays=F) together with ptjNmin/ptlNmin/xptj/xptl/xpta + (e.g. p p > w+ j j, w+ > j j with ptj=150, ptj1min=160: -2.2%); + - cutuse=1 (only one of the ptjNmin has to be satisfied); + - mmll for non same-flavour opposite-sign leptons, ptllmin without a pair to apply it to, + mmnl for more than two leptons/neutrinos. + 3.5.17 (9/10/26): RF: Fixed a bug in FxFx merging: MG side used inclusive-kT measure, PY side used exclusive. This mismatch resulted in an underrepresentation of events in DRjj<1.0, particularly visibile in boosted configurations. Thanks, Sihyun Jeon. From c26638650aeef6c9713eb399a2cc65abe008261b Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 14:18:34 +0100 Subject: [PATCH 30/49] LO setcuts: ignore negative ihtmin/htjmin/misset in smin Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index 4bc3cdcece..2c33a13e04 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -575,7 +575,7 @@ SUBROUTINE SETCUTS if ((nb_j-nb_nocut).gt.0)then smin_m = smin_m + (nb_j-nb_nocut)*(nb_j-nb_nocut-1)/2d0*mmjj**2 endif - smin = smin + max(smin_p**2, smin_m, htjmin**2) + smin = smin + max(smin_p**2, smin_m, max(htjmin,0d0)**2) endif c check for the bjet smin_m = 0d0 @@ -608,7 +608,7 @@ SUBROUTINE SETCUTS endif c inclusive Ht cut (all jets+b, cut_decays not used in cuts.f): sqrt(shat) >= sum pT c This cannot be attributed to the b-block alone since it constrains HTj+HTb. - smin = max(smin, ihtmin**2) + smin = max(smin, max(ihtmin,0d0)**2) c check for the photon c pta/ea only apply to the photons with do_cuts, xpta to all of them smin_m = 0d0 @@ -677,7 +677,7 @@ SUBROUTINE SETCUTS smin_p = smin_p**2 if (has_ptll) smin_p = max(smin_p, ptllmin**2) if (ncheck.eq.2) smin_p = max(smin_p, max(mmnl,0d0)**2) - smin = smin + max(smin_p, smin_m, misset**2) + smin = smin + max(smin_p, smin_m, max(misset,0d0)**2) endif c check for other PDG particle do i = 1,pdg_cut(0) From 0bc4ec7a835b0f1d809ac6bbb17eee0334f86012 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 14:38:53 +0100 Subject: [PATCH 31/49] LO setcuts: lepton smin block also for neutrino-only final states (misset/ptll/mmnl) Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index 2c33a13e04..11faab076c 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -672,7 +672,8 @@ SUBROUTINE SETCUTS if (k.le.nb_l-nb_nocut) ptk = max(ptk, el, ptl) smin_p = smin_p + max(ptk, 0d0) enddo - if (nb_l.gt.0)then +c this block bounds the energy of the leptons and neutrinos together + if (ncheck.gt.0)then smin_m = smin_m + nb_pair*max(mmll,0d0)**2 smin_p = smin_p**2 if (has_ptll) smin_p = max(smin_p, ptllmin**2) From 5afd43e5939dbca77d01ff9d31f1fa9c8c3c6c19 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 14:42:32 +0100 Subject: [PATCH 32/49] acceptance test: smin never above the minimal shat allowed by the cuts Co-Authored-By: Claude --- tests/acceptance_tests/test_cmd_madevent.py | 48 +++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index 4e2090fd7c..e16bfb64f8 100644 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -209,6 +209,54 @@ def test_madevent_ptj_bias(self): # Make sure that the cross-section is close enough for the bias and unbiased samples self.assertLess((abs(biased_events.cross-unbiased_events.cross)/abs(unbiased_events.cross)),0.1) + def test_smin_below_cut_threshold(self): + """ Check that the lower bound on shat (smin, setcuts.f) is never above + the minimal shat allowed by the cuts (cuts.f): a too large smin removes + allowed phase space. Old overshoots: ihtmin attributed to the b's + (bbj: 340^2) and ptj1min charged to a decay jet on top of ptj for the + production jets (wjj: 460^2). Allowed configurations exist at + sqrt(shat) ~ 320 GeV (bbj: j=160, b+b~=160) and ~ 390 GeV (wjj: jets + 160+150, W at rest), the new bounds are 300^2 and 310^2.""" + + try: + shutil.rmtree(self.run_dir) + except Exception: + pass + interface = MGCmd.MasterCmd() + interface.no_notification() + interface.run_cmd('import model sm') + interface.run_cmd('generate p p > b b~ j') + interface.run_cmd('add process p p > w+ j j, w+ > j j') + interface.onecmd('output madevent %s -f' % self.run_dir) + + run_card = banner.RunCardLO(pjoin(self.run_dir, 'Cards', 'run_card.dat')) + for name, value in [('nevents', 100), ('use_syst', False), + ('cut_decays', False), ('ptj', 150), ('ptj1min', 160), + ('ptb', 20), ('etab', -1), ('drbb', 0), ('drbj', 0), + ('ihtmin', 300)]: + run_card.set(name, value, user=True) + run_card.write(pjoin(self.run_dir, 'Cards', 'run_card.dat')) + + self.cmd_line = MECmd.MadEventCmdShell(me_dir=self.run_dir) + self.cmd_line.no_notification() + self.do('survey -f') + + smin = {} + for pdir in os.listdir(pjoin(self.run_dir, 'SubProcesses')): + if not pdir.startswith('P'): + continue + for root, _, files_in in os.walk(pjoin(self.run_dir, 'SubProcesses', pdir)): + for name in files_in: + if not name.endswith('.log'): + continue + for line in open(pjoin(root, name)): + if 'Define smin to' in line: + smin.setdefault(pdir, set()).add(float(line.split()[-1])) + self.assertTrue(smin) + for pdir, values in smin.items(): + for value in values: + self.assertLessEqual(value, 100000., '%s: smin=%s' % (pdir, value)) + def test_madspin_gridpack(self): self.out_dir = self.run_dir From ec59a09f3a9accf5e4991355792d308c0ea28b02 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 15:03:48 +0100 Subject: [PATCH 33/49] CI: run test_smin_below_cut_threshold Co-Authored-By: Claude --- .github/workflows/acceptancetest.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/acceptancetest.yml b/.github/workflows/acceptancetest.yml index 2d9447bf33..5a65cf9e7c 100644 --- a/.github/workflows/acceptancetest.yml +++ b/.github/workflows/acceptancetest.yml @@ -857,6 +857,25 @@ jobs: + acceptancetest_51_2: + # The type of runner that the job will run on + runs-on: ubuntu-22.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + - uses: ./.github/actions/checkout_mg5 + - uses: ./.github/actions/restore-pip-cache + + # Runs a set of commands using the runners shell + - name: test one of the test test_smin_below_cut_threshold + run: | + cd $GITHUB_WORKSPACE + ./tests/test_manager.py test_smin_below_cut_threshold -pA -t0 -l INFO + + + acceptancetest_52: # The type of runner that the job will run on runs-on: ubuntu-22.04 From a5dd49a5b1058d0fb9eca262c9e52adaaef11dad Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 15:16:53 +0100 Subject: [PATCH 34/49] LO setcuts: drop the dead no-cut branch of the b-block smin Co-Authored-By: Claude --- Template/LO/SubProcesses/setcuts.f | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Template/LO/SubProcesses/setcuts.f b/Template/LO/SubProcesses/setcuts.f index 11faab076c..db6eea76fb 100644 --- a/Template/LO/SubProcesses/setcuts.f +++ b/Template/LO/SubProcesses/setcuts.f @@ -578,32 +578,25 @@ SUBROUTINE SETCUTS smin = smin + max(smin_p**2, smin_m, max(htjmin,0d0)**2) endif c check for the bjet +c b's without cuts (decays with cut_decays=F) are skipped on purpose: +c xptb on the first b with cuts, ptb on the others, is then a safe bound +c (xptb can be satisfied by a skipped b, which still adds its energy). smin_m = 0d0 smin_p = 0d0 nb_b = 0 - nb_nocut = 0 do i=nincoming+1,nexternal if (is_a_b(i).and.do_cuts(i)) then nb_b = nb_b + 1 smin_m = smin_m - pmass(i)**2 - if (do_cuts(i)) then - if (nb_b.eq.1) then - smin_p = smin_p + max(eb,ptb,xptb,0d0) - else - smin_p = smin_p + max(eb,ptb,0d0) - endif + if (nb_b.eq.1) then + smin_p = smin_p + max(eb,ptb,xptb,0d0) else - nb_nocut = nb_nocut +1 - if (nb_b.eq.1) then - smin_p = smin_p + max(xptb,0d0) - endif + smin_p = smin_p + max(eb,ptb,0d0) endif endif enddo if (nb_b.gt.0)then - if ((nb_b-nb_nocut).gt.0) then - smin_m = smin_m + (nb_b-nb_nocut)*(nb_b-nb_nocut-1)/2d0*mmbb**2 - endif + smin_m = smin_m + nb_b*(nb_b-1)/2d0*mmbb**2 smin = smin + max(smin_p**2, smin_m) endif c inclusive Ht cut (all jets+b, cut_decays not used in cuts.f): sqrt(shat) >= sum pT From e908aba87690954e5f8d983666d31add09ee4977 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 15:17:45 +0100 Subject: [PATCH 35/49] acceptance test smin: also check the lower bound, close the log files Co-Authored-By: Claude --- tests/acceptance_tests/test_cmd_madevent.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index e16bfb64f8..0df4c51a60 100644 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -216,7 +216,7 @@ def test_smin_below_cut_threshold(self): (bbj: 340^2) and ptj1min charged to a decay jet on top of ptj for the production jets (wjj: 460^2). Allowed configurations exist at sqrt(shat) ~ 320 GeV (bbj: j=160, b+b~=160) and ~ 390 GeV (wjj: jets - 160+150, W at rest), the new bounds are 300^2 and 310^2.""" + 160+150, W at rest), the new bounds are 300^2 (ihtmin) and 310^2.""" try: shutil.rmtree(self.run_dir) @@ -249,13 +249,16 @@ def test_smin_below_cut_threshold(self): for name in files_in: if not name.endswith('.log'): continue - for line in open(pjoin(root, name)): - if 'Define smin to' in line: - smin.setdefault(pdir, set()).add(float(line.split()[-1])) + with open(pjoin(root, name)) as fsock: + for line in fsock: + if 'Define smin to' in line: + smin.setdefault(pdir, set()).add(float(line.split()[-1])) self.assertTrue(smin) for pdir, values in smin.items(): for value in values: + # upper: below the allowed minimum; lower: ihtmin bound kept self.assertLessEqual(value, 100000., '%s: smin=%s' % (pdir, value)) + self.assertGreaterEqual(value, 89999., '%s: smin=%s' % (pdir, value)) def test_madspin_gridpack(self): From 6605fb7c77cddddc6334e4d8dff8285a47037795 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 29 Oct 2026 15:30:00 +0100 Subject: [PATCH 36/49] acceptance test smin: exact values for all the cases of the fix Three survey-only runs (MLM off) checking smin per process: ihtmin, decay jets with ptj1min, decay leptons/photons with ptl1min/xpta, neutrino-only misset, negative ihtmin/htjmin/misset, mmll (SFOS only), ptllmin (with a pair only), mmnl (exactly two l/nu). Each value differs from 3.5.18 (checked). Co-Authored-By: Claude --- tests/acceptance_tests/test_cmd_madevent.py | 78 ++++++++++++++++----- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index 0df4c51a60..f15ac107dc 100644 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -209,14 +209,9 @@ def test_madevent_ptj_bias(self): # Make sure that the cross-section is close enough for the bias and unbiased samples self.assertLess((abs(biased_events.cross-unbiased_events.cross)/abs(unbiased_events.cross)),0.1) - def test_smin_below_cut_threshold(self): - """ Check that the lower bound on shat (smin, setcuts.f) is never above - the minimal shat allowed by the cuts (cuts.f): a too large smin removes - allowed phase space. Old overshoots: ihtmin attributed to the b's - (bbj: 340^2) and ptj1min charged to a decay jet on top of ptj for the - production jets (wjj: 460^2). Allowed configurations exist at - sqrt(shat) ~ 320 GeV (bbj: j=160, b+b~=160) and ~ 390 GeV (wjj: jets - 160+150, W at rest), the new bounds are 300^2 (ihtmin) and 310^2.""" + def get_smin(self, processes, cuts): + """generate the processes, run a survey with the given run_card + values and return {process number: set of smin (Define smin to)}""" try: shutil.rmtree(self.run_dir) @@ -225,15 +220,15 @@ def test_smin_below_cut_threshold(self): interface = MGCmd.MasterCmd() interface.no_notification() interface.run_cmd('import model sm') - interface.run_cmd('generate p p > b b~ j') - interface.run_cmd('add process p p > w+ j j, w+ > j j') + interface.run_cmd('generate %s' % processes[0]) + for proc in processes[1:]: + interface.run_cmd('add process %s' % proc) interface.onecmd('output madevent %s -f' % self.run_dir) run_card = banner.RunCardLO(pjoin(self.run_dir, 'Cards', 'run_card.dat')) + # no MLM matching (it resets ptj): exact values are checked for name, value in [('nevents', 100), ('use_syst', False), - ('cut_decays', False), ('ptj', 150), ('ptj1min', 160), - ('ptb', 20), ('etab', -1), ('drbb', 0), ('drbj', 0), - ('ihtmin', 300)]: + ('ickkw', 0), ('xqcut', 0)] + cuts: run_card.set(name, value, user=True) run_card.write(pjoin(self.run_dir, 'Cards', 'run_card.dat')) @@ -245,6 +240,7 @@ def test_smin_below_cut_threshold(self): for pdir in os.listdir(pjoin(self.run_dir, 'SubProcesses')): if not pdir.startswith('P'): continue + iproc = int(pdir[1:pdir.index('_')]) for root, _, files_in in os.walk(pjoin(self.run_dir, 'SubProcesses', pdir)): for name in files_in: if not name.endswith('.log'): @@ -252,13 +248,57 @@ def test_smin_below_cut_threshold(self): with open(pjoin(root, name)) as fsock: for line in fsock: if 'Define smin to' in line: - smin.setdefault(pdir, set()).add(float(line.split()[-1])) - self.assertTrue(smin) - for pdir, values in smin.items(): + smin.setdefault(iproc, set()).add(float(line.split()[-1])) + return smin + + def check_smin(self, smin, expected): + """compare to the expected smin of each process""" + self.assertEqual(sorted(smin), sorted(expected)) + for iproc, values in smin.items(): for value in values: - # upper: below the allowed minimum; lower: ihtmin bound kept - self.assertLessEqual(value, 100000., '%s: smin=%s' % (pdir, value)) - self.assertGreaterEqual(value, 89999., '%s: smin=%s' % (pdir, value)) + self.assertAlmostEqual(value, expected[iproc], delta=1e-6*expected[iproc], + msg='process %s: smin=%s (expected %s)' % (iproc, value, expected[iproc])) + + def test_smin_below_cut_threshold(self): + """ Check the lower bound on shat (smin, setcuts.f): it must never be + above the minimal shat allowed by the cuts (cuts.f), otherwise allowed + phase space is removed, and it should keep the bounds that are safe. + Exact values are checked; the comments give the value of 3.5.17. + A: ihtmin, jets from decays (cut_decays=F) with ptj1min, neutrinos only + with a negative misset. + B: leptons and photons from decays with ptl1min/xpta, misset for + neutrinos only, negative ihtmin/htjmin. + C: mmll (same-flavour opposite-sign only), ptllmin (only with a pair + it applies to), mmnl (exactly two leptons/neutrinos), negative misset. + """ + + # A: ptj1min=160 on top of ptj=150, ihtmin=300 + smin = self.get_smin(['p p > b b~ j', 'p p > w+ j j, w+ > j j', + 'p p > z j, z > vl vl~'], + [('cut_decays', False), ('ptj', 150), ('ptj1min', 160), + ('ptb', 20), ('etab', -1), ('drbb', 0), ('drbj', 0), + ('ihtmin', 300), ('misset', -500)]) + self.check_smin(smin, {1: 300.**2, # 3.5.17: 160^2+300^2 (allowed at ~320^2) + 2: 310.**2, # 3.5.17: 460^2 (allowed at ~390^2) + 3: 300.**2}) # 3.5.17: 160^2 (ihtmin ignored) + + # B: ptl1min=160 on top of ptl=150, xpta=100 on top of pta=50 + smin = self.get_smin(['p p > w+ e+ e- j, w+ > mu+ vm', 'p p > z j, z > vl vl~', + 'p p > w+ a, w+ > e+ ve a'], + [('cut_decays', False), ('ptl', 150), ('ptl1min', 160), + ('pta', 50), ('xpta', 100), ('misset', 30), + ('ihtmin', -500), ('htjmin', -500)]) + self.check_smin(smin, {1: 20.**2 + 310.**2, # 3.5.17: 500^2+20^2+460^2 + 2: 20.**2 + 30.**2, # 3.5.17: 500^2 (no neutrino block) + 3: 100.**2 + 160.**2}) # 3.5.17: 150^2+160^2 + + # C: pair cuts + smin = self.get_smin(['p p > e+ ve mu- vm~', 'p p > e+ ve', 'p p > e+ e-'], + [('ptl', 10), ('mmll', 300), ('ptllmin', 200), + ('mmnl', 250), ('misset', -500)]) + self.check_smin(smin, {1: 200.**2, # 3.5.17: 500^2 + 2: 250.**2, # 3.5.17: 500^2 + 3: 300.**2}) # 3.5.17: 500^2 def test_madspin_gridpack(self): From 3d325db6927a85d7b5fdfa9469e90138801dd014 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Fri, 30 Oct 2026 21:35:40 +0100 Subject: [PATCH 37/49] create_release: strip macOS metadata from release tarballs (#476) Recent macOS tags files with the com.apple.provenance xattr, which bsdtar stores as LIBARCHIVE.xattr/SCHILY.xattr pax headers (plus AppleDouble ._ entries); GNU tar on linux warns once per file when unpacking. Tar both the release and OfflineHEPToolsInstaller with COPYFILE_DISABLE=1 --no-xattrs --no-acls (and --no-mac-metadata --no-fflags when tar is bsdtar). Also fix two latent bugs in the same script: SMWidth.tar.gz was downloaded from the ninja link, and the tar-failure branch logged the undefined 'status' instead of 'status2'. --- bin/create_release.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/bin/create_release.py b/bin/create_release.py index 841219aac8..c4436f5e5b 100755 --- a/bin/create_release.py +++ b/bin/create_release.py @@ -331,6 +331,13 @@ # remove the apidoc file. # shutil.rmtree(os.path.join(filepath,'apidoc')) +# Do not ship macOS metadata (xattrs such as com.apple.provenance, ACLs, +# AppleDouble ._ files): GNU tar on linux warns about every such entry. +tar_env = dict(os.environ, COPYFILE_DISABLE='1') +tar_clean_options = ['--no-xattrs', '--no-acls'] +if b'bsdtar' in subprocess.check_output(['tar', '--version']): + tar_clean_options += ['--no-mac-metadata', '--no-fflags'] + # 4. Download the offline installer and other similar code install_str = """ cd %s @@ -340,11 +347,11 @@ git clone git@github.com:mg5amcnlo/HEPToolsInstallers.git rm -rfv `find HEPToolsInstallers -name .bzr -type d` > /dev/null; rm -rfv `find HEPToolsInstallers -name .git -type d` > /dev/null; -tar czf OfflineHEPToolsInstaller.tar.gz HEPToolsInstallers/ > /dev/null; +COPYFILE_DISABLE=1 tar %s -czf OfflineHEPToolsInstaller.tar.gz HEPToolsInstallers/ > /dev/null; mv OfflineHEPToolsInstaller.tar.gz ../vendor; cd ..; rm -rf download-temp; -""" % filepath +""" % (filepath, ' '.join(tar_clean_options)) os.system(install_str) sys.path.append(pjoin(root_path, '..')) @@ -356,7 +363,7 @@ # Add the tarball for SMWidth swidth_link = "http://madgraph.phys.ucl.ac.be/Downloads/SMWidth.tgz" -misc.wget(ninja_link, os.path.join(filepath, 'vendor', 'SMWidth.tar.gz')) +misc.wget(swidth_link, os.path.join(filepath, 'vendor', 'SMWidth.tar.gz')) if not os.path.exists(os.path.join(filepath, 'vendor', 'OfflineHEPToolsInstaller.tar.gz')): print('Fail to create OfflineHEPToolsInstaller') @@ -367,10 +374,11 @@ logging.info("Create the tar file " + filename) # clean all the pyc os.system("cd %s;find . -name '*.pyc' -delete" % filepath) -status2 = subprocess.call(['tar', 'czf', filename, filepath]) +status2 = subprocess.call(['tar'] + tar_clean_options + ['-czf', filename, filepath], + env=tar_env) if status2: logging.error('Non-0 exit code %d from tar. Please check result.' % \ - status) + status2) sys.exit() try: From b89dfc25169a6c10b5acd48cd0072c23107881fc Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sat, 31 Oct 2026 03:40:59 +0100 Subject: [PATCH 38/49] create_release: also exclude pre-existing AppleDouble ._* files from release tarballs Addresses review on #477: COPYFILE_DISABLE/--no-mac-metadata only stop tar from generating ._ entries, a ._* file already on disk was still archived. Shell-quote the options passed to the OfflineHEPToolsInstaller tar. --- bin/create_release.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/create_release.py b/bin/create_release.py index c4436f5e5b..9f3f0a4517 100755 --- a/bin/create_release.py +++ b/bin/create_release.py @@ -47,6 +47,7 @@ import os import os.path as path import re +import shlex import shutil import subprocess import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error @@ -332,9 +333,10 @@ # shutil.rmtree(os.path.join(filepath,'apidoc')) # Do not ship macOS metadata (xattrs such as com.apple.provenance, ACLs, -# AppleDouble ._ files): GNU tar on linux warns about every such entry. +# AppleDouble ._ files, generated or already on disk): GNU tar on linux warns +# about every such entry. tar_env = dict(os.environ, COPYFILE_DISABLE='1') -tar_clean_options = ['--no-xattrs', '--no-acls'] +tar_clean_options = ['--no-xattrs', '--no-acls', '--exclude=._*'] if b'bsdtar' in subprocess.check_output(['tar', '--version']): tar_clean_options += ['--no-mac-metadata', '--no-fflags'] @@ -351,7 +353,7 @@ mv OfflineHEPToolsInstaller.tar.gz ../vendor; cd ..; rm -rf download-temp; -""" % (filepath, ' '.join(tar_clean_options)) +""" % (filepath, ' '.join(shlex.quote(o) for o in tar_clean_options)) os.system(install_str) sys.path.append(pjoin(root_path, '..')) From 290369205d1b5be468b8da1826c6957606f23470 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 1 Nov 2026 06:49:22 +0100 Subject: [PATCH 39/49] NLO real emission: tie helicities only if they agree after a Lorentz transform SMATRIX_SPLITORDERS (realmatrix_splitorders_fks.inc) ties a helicity to an earlier one when their |M|^2 agree to 1e-12 on the first point, and afterwards only computes the earlier one. That assumes the equality is a symmetry. It is not always one: the FKS momenta of the real come in the partonic c.m. frame of the real for final-state sectors and in that of the Born (a boost along z) for initial-state ones, and helicities of massive particles change under that boost. In u d~ > w+ g g, (u-,d~+,W0,g-,g-) and (u-,d~+,W0,g+,g+) agree exactly at every event in its own c.m. frame and nowhere else (off by up to 3e4 elsewhere), so whether the first point tied them depends on the seed. The tie now has to hold again at a Lorentz transform of the first point (rotation tilting z, then a boost along z, tolerance 1e-10). Symmetries such as the full helicity flip of g g > t t~ g are covariant and stay tied; frame-dependent equalities are dropped. Cost: two ME calls per tied pair, once per job. p p > w+ j [QCD], fixed order, 20k points, against the same run with all ties off (only u d~ > w+ g and d~ u > w+ g move): seed 951: total +1.4% (u d~ +3.3%, d~ u +4.3%) seed 952: total +0.65% (u d~ +2.8%, d~ u +0.8%) seed 953: total +4.5% (u d~ +25%, 13.5 sigma) With this change seeds 951 and 953 give the ties-off totals bit for bit. New test test_real_helicity_ties_survive_a_boost (job acceptancetest_82_ties): first call at an event in its c.m. frame, second at the same event boosted along z, compared with the explicit helicity sum. Without the fix: off by 6.9e-3. The FKS-real IOTest references are not updated (test_pptt_fksreal, test_pptt_fksrealew, test_ppw_fksall, test_tdecay_fksreal, test_wprod_fksew in tests/unit_tests/iolibs/test_export_fks.py). Co-Authored-By: Claude --- .github/workflows/acceptancetest.yml | 17 +++ UpdateNotes.txt | 7 ++ .../realmatrix_splitorders_fks.inc | 39 ++++++- tests/acceptance_tests/test_cmd_amcatnlo.py | 103 ++++++++++++++++++ tests/input_files/fks_real_tie_frame_driver.f | 42 +++++++ 5 files changed, 207 insertions(+), 1 deletion(-) create mode 100644 tests/input_files/fks_real_tie_frame_driver.f diff --git a/.github/workflows/acceptancetest.yml b/.github/workflows/acceptancetest.yml index 5a65cf9e7c..9c7170d320 100644 --- a/.github/workflows/acceptancetest.yml +++ b/.github/workflows/acceptancetest.yml @@ -1390,6 +1390,23 @@ jobs: cd $GITHUB_WORKSPACE ./tests/test_manager.py test_calculate_xsect_nlo -pA -t0 -l INFO + acceptancetest_82_ties: + # The type of runner that the job will run on + runs-on: ubuntu-22.04 + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + - uses: ./.github/actions/checkout_mg5 + - uses: ./.github/actions/restore_all + + # Runs a set of commands using the runners shell + - name: test one of the test test_real_helicity_ties_survive_a_boost + run: | + cd $GITHUB_WORKSPACE + ./tests/test_manager.py test_real_helicity_ties_survive_a_boost -pA -t0 -l INFO + acceptancetest_83: diff --git a/UpdateNotes.txt b/UpdateNotes.txt index 4c681510be..4d464e5f6b 100644 --- a/UpdateNotes.txt +++ b/UpdateNotes.txt @@ -14,6 +14,13 @@ ANNOUNCEMENT: - cutuse=1 (only one of the ptjNmin has to be satisfied); - mmll for non same-flavour opposite-sign leptons, ptllmin without a pair to apply it to, mmnl for more than two leptons/neutrinos. + OM: NLO: the real emission reused the matrix element of one helicity for another whenever the two agreed + on the first phase-space point. Some only agree when the momenta come in the c.m. frame of the real + (final-state FKS sectors), not in that of the Born (initial-state ones): helicities of massive + particles are not boost invariant. E.g. (W0,g-,g-) and (W0,g+,g+) of u d~ > w+ g g. Whether the + first point tied them was a matter of the seed; p p > w+ j [QCD] (fixed order) came out + +0.6% to +4.5% too high (u d~ > w+ g up to +25%), p p > z j [QCD] is affected the same way. + A tie is now kept only if it also holds at a Lorentz transform of the first point. 3.5.17 (9/10/26): RF: Fixed a bug in FxFx merging: MG side used inclusive-kT measure, PY side used exclusive. This mismatch resulted in an diff --git a/madgraph/iolibs/template_files/realmatrix_splitorders_fks.inc b/madgraph/iolibs/template_files/realmatrix_splitorders_fks.inc index e1a5d2a9b1..d951dd6917 100644 --- a/madgraph/iolibs/template_files/realmatrix_splitorders_fks.inc +++ b/madgraph/iolibs/template_files/realmatrix_splitorders_fks.inc @@ -122,6 +122,8 @@ C INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) %(helicity_lines)s LOGICAL GOODHEL(NCOMB) @@ -178,7 +180,42 @@ C add to the sum of helicities ENDIF ENDIF ENDDO - DO I=1,NSQAMPSO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_%(proc_prefix)s(PLT,NHEL(1,IHEL),T) + CALL MATRIX_%(proc_prefix)s(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF + DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) ENDDO diff --git a/tests/acceptance_tests/test_cmd_amcatnlo.py b/tests/acceptance_tests/test_cmd_amcatnlo.py index 5497ee8ce3..c662054d73 100755 --- a/tests/acceptance_tests/test_cmd_amcatnlo.py +++ b/tests/acceptance_tests/test_cmd_amcatnlo.py @@ -741,6 +741,109 @@ def test_calculate_xsect_lo(self): self.assertTrue(os.path.exists('%s/Events/run_01_LO/alllogs_1.html' % self.path)) + def test_real_helicity_ties_survive_a_boost(self): + """The real emission may only reuse a helicity's matrix element for + another one if the two agree in every frame. + + SMATRIX_SPLITORDERS ties two helicities whose matrix elements agree + on the first point and computes only one of them afterwards. The FKS + momenta of the real come in the partonic c.m. frame of the real for + some sectors and in that of the Born, a boost along z, for the + initial-state ones; helicities of massive particles are not invariant + under that boost. In u d~ > w+ g g, (W0,g-,g-) and (W0,g+,g+) agree + in the c.m. frame of the real and not after the boost. A first point + in the c.m. frame tied them, and the helicity sum at every boosted + point after it was off: by 7e-3 at the point below. + + The driver makes the first call at an event in its own c.m. frame, + the second at the same event boosted along z, and compares the second + result with the helicity sum computed helicity by helicity. Exact, + no integration. + """ + self.generate('u d~ > w+ g [real=QCD]', 'sm') + proc_dir = pjoin(self.path, 'SubProcesses', 'P0_udx_wpg') + mfile = [f for f in sorted(os.listdir(proc_dir)) + if re.match(r'matrix_\d+\.f$', f) and + 'Process: u d~ > w+ g g ' in open(pjoin(proc_dir, f)).read()] + self.assertEqual(len(mfile), 1, 'no matrix file for u d~ > w+ g g') + mfile = mfile[0] + pfx = mfile[len('matrix_'):-len('.f')] + body = open(pjoin(proc_dir, mfile)).read() + body = body.split('SUBROUTINE SMATRIX%s_SPLITORDERS' % pfx)[1] + body = body.split('\n END\n')[0] + + driver = open(pjoin(_pickle_path, 'fks_real_tie_frame_driver.f')).read() + for key, value in ( + ('__NCOMB__', re.search(r'NCOMB=(\d+)', body).group(1)), + ('__NSQAMPSO__', re.search(r'NSQAMPSO=(\d+)', body).group(1)), + ('__IDEN__', re.search(r'DATA IDEN/(\d+)/', body).group(1)), + ('__NHEL__', '\n'.join(l for l in body.split('\n') + if 'DATA (NHEL(I,' in l)), + ('__PFX__', pfx)): + driver = driver.replace(key, value) + open(pjoin(proc_dir, 'real_tie_frame.f'), 'w').write(driver) + + # Only the helicity amplitudes and the model are needed. + build = subprocess.run(['make', '../lib/libdhelas.a', '../lib/libmodel.a'], + cwd=pjoin(self.path, 'Source'), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.assertEqual(build.returncode, 0, build.stdout.decode()) + build = subprocess.run( + ['gfortran', '-O', '-ffixed-line-length-132', '-I.', '-I../../lib', + 'real_tie_frame.f', mfile, '-o', 'real_tie_frame', + '-L../../lib', '-ldhelas', '-lmodel'], + cwd=proc_dir, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.assertEqual(build.returncode, 0, + 'could not build the driver:\n%s' % build.stdout.decode()) + + # A generic event in its partonic c.m. frame (sqrt(s) = 400 GeV, the + # g g system of mass 150 GeV), with the W on its mass shell. + card = open(pjoin(self.path, 'Cards', 'param_card.dat')).read() + mass_block = re.split(r'(?im)^\s*block\s+mass\b', card)[1] + mw = float(re.search(r'(?m)^\s*24\s+(\S+)', mass_block).group(1)) + + def boost(p, b): + b2 = sum(x * x for x in b) + gamma = 1. / math.sqrt(1. - b2) + bp = sum(b[i] * p[i + 1] for i in range(3)) + f = (gamma - 1.) * bp / b2 + gamma * p[0] + return [gamma * (p[0] + bp)] + [p[i + 1] + f * b[i] for i in range(3)] + + def direction(theta, phi): + return [math.sin(theta) * math.cos(phi), + math.sin(theta) * math.sin(phi), math.cos(theta)] + + sqrts, mgg = 400., 150. + e_w = (sqrts**2 + mw**2 - mgg**2) / (2. * sqrts) + p_w = math.sqrt(e_w**2 - mw**2) + d_w = direction(0.7, 0.3) + w = [e_w] + [p_w * x for x in d_w] + q = [sqrts - e_w] + [-p_w * x for x in d_w] + d_g = direction(1.9, 2.1) + to_cm = [x / q[0] for x in q[1:]] + g1 = boost([mgg / 2.] + [mgg / 2. * x for x in d_g], to_cm) + g2 = boost([mgg / 2.] + [-mgg / 2. * x for x in d_g], to_cm) + cm = [[sqrts / 2., 0., 0., sqrts / 2.], [sqrts / 2., 0., 0., -sqrts / 2.], + w, g1, g2] + boosted = [boost(p, [0., 0., 0.4]) for p in cm] + + momenta = '\n'.join(' '.join('%.17e' % x for p in event for x in p) + for event in (cm, boosted)) + '\n' + run = subprocess.run([pjoin(proc_dir, 'real_tie_frame')], + input=momenta.encode(), + cwd=pjoin(self.path, 'Cards'), + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out = run.stdout.decode() + self.assertEqual(run.returncode, 0, out) + result = [l.split() for l in out.split('\n') if l.startswith('RESULT')] + self.assertEqual(len(result), 1, out) + smatrix, helsum = float(result[0][1]), float(result[0][2]) + self.assertGreater(helsum, 0., out) + self.assertLess(abs(smatrix / helsum - 1.), 1e-10, + 'the real emission after a first point in the c.m. ' + 'frame is %.16e, its helicity sum %.16e' + % (smatrix, helsum)) + def test_amcatnlo_from_file(self): """ """ diff --git a/tests/input_files/fks_real_tie_frame_driver.f b/tests/input_files/fks_real_tie_frame_driver.f new file mode 100644 index 0000000000..e94191d22f --- /dev/null +++ b/tests/input_files/fks_real_tie_frame_driver.f @@ -0,0 +1,42 @@ + PROGRAM REAL_TIE_FRAME +C Driver of test_real_helicity_ties_survive_a_boost +C (tests/acceptance_tests/test_cmd_amcatnlo.py). +C Two calls of the real emission: the first one, where helicities +C with equal matrix elements are tied, at an event in its own +C partonic c.m. frame; the second one at the same event boosted +C along z, as the momenta of an initial-state FKS sector are. The +C second result must be the helicity sum at the boosted event. +C The placeholders between double underscores are filled in by the +C test from the generated matrix file of the real emission. + IMPLICIT NONE + INCLUDE 'nexternal.inc' + INCLUDE 'coupl.inc' + INTEGER NCOMB,NSQAMPSO + PARAMETER (NCOMB=__NCOMB__,NSQAMPSO=__NSQAMPSO__) + INTEGER NHEL(NEXTERNAL,NCOMB),IHEL,I,J,IDEN + REAL*8 PA(0:3,NEXTERNAL),PB(0:3,NEXTERNAL) + REAL*8 ANS(0:NSQAMPSO),T(0:NSQAMPSO),HELSUM +__NHEL__ + DATA IDEN/__IDEN__/ + READ(*,*) ((PA(I,J),I=0,3),J=1,NEXTERNAL) + READ(*,*) ((PB(I,J),I=0,3),J=1,NEXTERNAL) + CALL SETPARA('param_card.dat') + G=SQRT(4D0*3.141592653589793D0*0.118D0) + CALL UPDATE_AS_PARAM() + CALL SMATRIX__PFX___SPLITORDERS(PA,ANS) + CALL SMATRIX__PFX___SPLITORDERS(PB,ANS) + HELSUM=0D0 + DO IHEL=1,NCOMB + CALL MATRIX___PFX__(PB,NHEL(1,IHEL),T) + HELSUM=HELSUM+T(0) + ENDDO + HELSUM=HELSUM/DBLE(IDEN) + WRITE(*,'(A,2E25.16)') 'RESULT ',ANS(0),HELSUM + END + + +C SMATRIX in the same file refers to it; not called here. + INTEGER FUNCTION ORDERS_TO_AMP_SPLIT_POS(ORD) + INTEGER ORD(*) + ORDERS_TO_AMP_SPLIT_POS=1 + END From 955e1777115aa430fb16339cb1a5f87c0cea4385 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sun, 1 Nov 2026 11:58:26 +0100 Subject: [PATCH 40/49] MadLoop: disable the helicity filter for all 2>1 and 1>2 processes For NEXTERNAL<=3 one particle is at rest in the c.m. frame and which helicity configurations vanish depends on the frame (at rest the helicity is defined along z). A filter learned in one frame silently drops part of the virtual in another: u d~ > w+ came out 41% low after a rotation+boost and exactly zero with the W moving along -z, with return code 216 (the stability test reuses the same filter and cannot see it). Previously the filter was only disabled for spin-2 particles; the tree-level standalone output already disables it for every NEXTERNAL<=3. aMC@NLO is unaffected (virtual always in the Born c.m. frame): p p > w+ [QCD] FO, same seed, 9.963e4 +- 190 pb (old) vs 9.969e4 +- 170 pb. Also update the IOTest references: the 23 loop_matrix.f containing the guard, and the real-emission matrix_.f of the five FKS IOTests touched by the previous commit (only the hunks from the template changes). --- UpdateNotes.txt | 6 +++ .../loop/loop_matrix_standalone.inc | 14 +++++-- .../loop_optimized/loop_matrix_standalone.inc | 14 +++++-- .../%SubProcesses%P0_gg_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ag_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ag_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ag_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ag_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ag_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ddx_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ddx_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ddx_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ddx_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ddx_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ddx_ttx%matrix_6.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxd_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxd_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxd_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxd_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxd_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxd_ttx%matrix_6.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ga_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ga_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ga_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ga_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_ga_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_6.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_7.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_8.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_gg_ttx%matrix_9.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uux_ttx%matrix_6.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_4.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_5.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_uxu_ttx%matrix_6.f | 37 +++++++++++++++++++ ...rocesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f | 18 ++++++--- .../%SubProcesses%P0_dxu_wp%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxu_wp%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxu_wp%matrix_3.f | 37 +++++++++++++++++++ ...rocesses%P0_udx_wp%V0_udx_wp%loop_matrix.f | 18 ++++++--- .../%SubProcesses%P0_udx_wp%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_udx_wp%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_udx_wp%matrix_3.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_t_budx%matrix_1.f | 37 +++++++++++++++++++ ...sses%P0_dxu_veep%V0_dxu_veep%loop_matrix.f | 18 ++++++--- .../%SubProcesses%P0_dxu_veep%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxu_veep%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_dxu_veep%matrix_3.f | 37 +++++++++++++++++++ ...sses%P0_udx_veep%V0_udx_veep%loop_matrix.f | 18 ++++++--- .../%SubProcesses%P0_udx_veep%matrix_1.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_udx_veep%matrix_2.f | 37 +++++++++++++++++++ .../%SubProcesses%P0_udx_veep%matrix_3.f | 37 +++++++++++++++++++ .../loop_matrix_QCDQEDpert_QCDsq_eq_4.f | 18 ++++++--- ...CDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f | 18 ++++++--- .../loop_matrix_QCDQEDpert_QCDsq_gt_4.f | 18 ++++++--- .../loop_matrix_QCDQEDpert_QEDsq_le_4.f | 18 ++++++--- ...DQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f | 18 ++++++--- .../loop_matrix_QCDQEDpert_default.f | 18 ++++++--- .../loop_matrix_QCDpert_default.f | 18 ++++++--- .../loop_matrix_QEDpert_default.f | 18 ++++++--- ...OTest%SubProcesses%P0_gg_ttx%loop_matrix.f | 18 ++++++--- ...TEST%SubProcesses%P1_uux_uux%loop_matrix.f | 18 ++++++--- .../dux_mumvmxg/loop_matrix.f | 18 ++++++--- .../gg_wmtbx/loop_matrix.f | 18 ++++++--- .../dux_mumvmxg/loop_matrix.f | 18 ++++++--- .../gg_wmtbx/loop_matrix.f | 18 ++++++--- .../gg_hh/loop_matrix.f | 18 ++++++--- .../ddx_ttx/loop_matrix.f | 18 ++++++--- .../gg_ttx/loop_matrix.f | 18 ++++++--- .../ddx_ttx/loop_matrix.f | 18 ++++++--- .../gg_ttx/loop_matrix.f | 18 ++++++--- 93 files changed, 2783 insertions(+), 144 deletions(-) diff --git a/UpdateNotes.txt b/UpdateNotes.txt index 4d464e5f6b..a1c4432ed0 100644 --- a/UpdateNotes.txt +++ b/UpdateNotes.txt @@ -21,6 +21,12 @@ ANNOUNCEMENT: first point tied them was a matter of the seed; p p > w+ j [QCD] (fixed order) came out +0.6% to +4.5% too high (u d~ > w+ g up to +25%), p p > z j [QCD] is affected the same way. A tie is now kept only if it also holds at a Lorentz transform of the first point. + OM: MadLoop: the helicity filter is now disabled for all 2>1 and 1>2 processes (it was for spin-2 only), + as for the tree-level standalone output. A particle is at rest in the c.m. frame and which helicities + vanish depends on the frame: with the filter learned in one frame, u d~ > w+ returned a virtual + 41% too low, or exactly zero, in another, flagged as stable. aMC@NLO is not affected (the virtual + always comes in the c.m. frame of the Born); a 2>1 MadLoop called outside its c.m. frame + (standalone/OLP with lab-frame momenta, reweighting with a boost or me_frame) could be. 3.5.17 (9/10/26): RF: Fixed a bug in FxFx merging: MG side used inclusive-kT measure, PY side used exclusive. This mismatch resulted in an diff --git a/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc b/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc index b6353bb2ea..15062da3e9 100644 --- a/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc +++ b/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc @@ -398,9 +398,17 @@ C Setup the file paths CALL JOINPATH(TMP,COLORDENOMFNAME,COLORDENOMFN) CALL JOINPATH(TMP,HELFILTERFNAME,HELFILTERFN) -C Make sure that the loop filter is disabled when there is spin-2 particles for 2>1 or 1>2 processes - if(MAX_SPIN_EXTERNAL_PARTICLE.gt.3.AND.(NEXTERNAL.LE.3.AND.HelicityFilterLevel.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + if(NEXTERNAL.LE.3.AND.HelicityFilterLevel.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and 1>2 processes.' HelicityFilterLevel = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HelFilterFN, err=6116, status='NEW',action='WRITE') diff --git a/madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc b/madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc index 1436e24ea4..2521d9692e 100644 --- a/madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc +++ b/madgraph/iolibs/template_files/loop_optimized/loop_matrix_standalone.inc @@ -554,9 +554,17 @@ C Setup the file paths CALL %(proc_prefix)sSET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is spin-2 particles for 2>1 or 1>2 processes - if(MAX_SPIN_EXTERNAL_PARTICLE.gt.3.AND.(NEXTERNAL.LE.3.AND.HelicityFilterLevel.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + if(NEXTERNAL.LE.3.AND.HelicityFilterLevel.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and 1>2 processes.' HelicityFilterLevel = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HelFilterFN, err=6116, status='NEW',action='WRITE') diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f index f8806ab715..654042e1e0 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f @@ -129,6 +129,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1, 1/ @@ -216,6 +218,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f index 5f5ca69c32..8241713a98 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f index 7fa208f98e..2c999c4b61 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f index 84b1758dce..1de379e5dc 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f index 1edaca03c0..45a97a79a6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f index 4e41502e5c..f217742f25 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f index 5d1c5de05a..46edc34803 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f index 2e3c39de5f..5d1050982f 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f index b8fa68004f..da31761af1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f index e6e6e58915..ea51e791f6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f index 9f59773802..8becfbf9c5 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f @@ -135,6 +135,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -222,6 +224,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f index 0edbbbe11f..1cb139b885 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f @@ -129,6 +129,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1, 1/ @@ -216,6 +218,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_2.f index 567d73ff07..bb9636e1f1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_3.f index 5dd0e7a529..a6cce3a883 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_4.f index eab6654428..f9e58d6d11 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_5.f index e0680fc249..fb1c0ff026 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_1.f index a7b5044d74..0babe41f51 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_2.f index 567d73ff07..bb9636e1f1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f index ed15bb846a..af9731a002 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f index 0da5525fdb..a3db3d2eb7 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_5.f index 8143dd95c7..e349d2d6e8 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f index 8679662163..623bb55b0e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_6(PLT,NHEL(1,IHEL),T) + CALL MATRIX_6(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_1.f index cdaa8ceae6..8f62266b13 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_2.f index 1e71c46656..e878e598f1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f index 9e486eaef7..40eb36dccd 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f index 4e1b291fee..504b732166 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_5.f index 1a355bf2f3..238c5bfeff 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f index 246776719a..f5c4a52f6a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_6(PLT,NHEL(1,IHEL),T) + CALL MATRIX_6(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f index 8c81e9b628..8fa79cf847 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f @@ -129,6 +129,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1, 1/ @@ -216,6 +218,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_2.f index 4cf94329a8..e8f8e2be06 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_3.f index 4b9dc85bfe..64ef7e1194 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_4.f index 302fe4baeb..569342a4bf 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_5.f index 395da43cb6..4b4bcd1f0c 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f index a80c010c51..064c1177bf 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f index bda808ac44..7f7b348b7b 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f index e560d4c9e6..658fe9f27d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f index a304380db6..4753e177d9 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f index c26eb5c4a5..c072079773 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f index ac2e43b3f7..fc23d5381e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_6(PLT,NHEL(1,IHEL),T) + CALL MATRIX_6(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f index 8cc8287684..dc94b49660 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX7_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX7_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_7(PLT,NHEL(1,IHEL),T) + CALL MATRIX_7(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f index 95f0aa59b7..aff94cbb9d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX8_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX8_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_8(PLT,NHEL(1,IHEL),T) + CALL MATRIX_8(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f index 6cc5a2620a..c40c5c2317 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f @@ -129,6 +129,8 @@ SUBROUTINE SMATRIX9_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1, 1/ @@ -216,6 +218,41 @@ SUBROUTINE SMATRIX9_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_9(PLT,NHEL(1,IHEL),T) + CALL MATRIX_9(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_1.f index f666f29149..ea3d2a090f 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_2.f index 1cdeecdc75..6c84af2de4 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f index 19c8f60265..b35d8950bd 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f index 5db693758c..29cc38c588 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_5.f index 395da43cb6..4b4bcd1f0c 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f index 92cf2c704f..75bd3ee5ff 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_6(PLT,NHEL(1,IHEL),T) + CALL MATRIX_6(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_1.f index 0829b1f4bb..2758b1eb86 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_2.f index a67a1937c2..7baf9868a3 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f index 495a14d8ea..38366fea54 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f index f0f985a6ad..3177c76dba 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX4_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_4(PLT,NHEL(1,IHEL),T) + CALL MATRIX_4(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_5.f index 852592eac9..8b1e04d424 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_5.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX5_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_5(PLT,NHEL(1,IHEL),T) + CALL MATRIX_5(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f index c6222a7e93..c8bd4a3fc4 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX6_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_6(PLT,NHEL(1,IHEL),T) + CALL MATRIX_6(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f index 18c1c617c9..ab78bff685 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%V0_dxu_wp%loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE SLOOPMATRIX(P_USER,ANS) CALL SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f index b0d9871102..abc4b18e9f 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,4) /-1, 1,-1,-1/ DATA (NHEL(I, 2),I=1,4) /-1, 1,-1, 1/ @@ -210,6 +212,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f index 14eac10e06..c226b0b54a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,4) /-1, 1,-1,-1/ DATA (NHEL(I, 2),I=1,4) /-1, 1,-1, 1/ @@ -210,6 +212,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f index 58ab54f69f..69e12d4478 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_dxu_wp%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,4) /-1,-1,-1, 1/ DATA (NHEL(I, 2),I=1,4) /-1,-1,-1,-1/ @@ -210,6 +212,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f index 527012d8e4..46f9f344ae 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%V0_udx_wp%loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE SLOOPMATRIX(P_USER,ANS) CALL SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f index 4d97839966..65f908e6af 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,4) / 1,-1,-1,-1/ DATA (NHEL(I, 2),I=1,4) / 1,-1,-1, 1/ @@ -210,6 +212,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f index 93439e9e93..863e482d97 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,4) /-1,-1,-1, 1/ DATA (NHEL(I, 2),I=1,4) /-1,-1,-1,-1/ @@ -210,6 +212,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f index cbe8e00514..853d54f3b3 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_ppw_fksall/%SubProcesses%P0_udx_wp%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,4) / 1,-1,-1,-1/ DATA (NHEL(I, 2),I=1,4) / 1,-1,-1, 1/ @@ -210,6 +212,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f index c2605942c0..ff35934178 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_tdecay_fksreal/%SubProcesses%P0_t_budx%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%V0_dxu_veep%loop_matrix.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%V0_dxu_veep%loop_matrix.f index be69263d01..9e05db2d61 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%V0_dxu_veep%loop_matrix.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%V0_dxu_veep%loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE SLOOPMATRIX(P_USER,ANS) CALL SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_1.f index ccf4529b13..9d4d3d13c4 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_2.f index 660471a871..9fce4b73af 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1, 1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) /-1, 1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_3.f index 5a121e603c..7becf623c1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_dxu_veep%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%V0_udx_veep%loop_matrix.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%V0_udx_veep%loop_matrix.f index 7318696f17..fe57a31ad9 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%V0_udx_veep%loop_matrix.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%V0_udx_veep%loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE SLOOPMATRIX(P_USER,ANS) CALL SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_1.f index 0176f20878..4763b8f54b 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_1.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX1_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_1(PLT,NHEL(1,IHEL),T) + CALL MATRIX_1(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_2.f index 653c3fff2b..fbbc6e6053 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_2.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) /-1,-1,-1, 1, 1/ DATA (NHEL(I, 2),I=1,5) /-1,-1,-1, 1,-1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX2_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_2(PLT,NHEL(1,IHEL),T) + CALL MATRIX_2(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_3.f index c7072a114e..7060c7afdc 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_wprod_fksew/%SubProcesses%P0_udx_veep%matrix_3.f @@ -131,6 +131,8 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) INTEGER IHEL,IDEN,I,J,T_IDENT(NCOMB) REAL*8 T(0:NSQAMPSO),T_SAVE(NCOMB,0:NSQAMPSO) SAVE T_SAVE,T_IDENT + REAL*8 PLT(0:3,NEXTERNAL),T_LT(0:NSQAMPSO) + REAL*8 CA,SA,CB,SB,BZ,GZ,PX,PY,PZ INTEGER NHEL(NEXTERNAL,NCOMB) DATA (NHEL(I, 1),I=1,5) / 1,-1,-1, 1,-1/ DATA (NHEL(I, 2),I=1,5) / 1,-1,-1, 1, 1/ @@ -218,6 +220,41 @@ SUBROUTINE SMATRIX3_SPLITORDERS(P,ANS) ENDIF ENDIF ENDDO +C Two helicities tied on the first point are identical everywhere +C only if a symmetry relates them. A symmetry holds in any frame: +C check each tie again at a Lorentz transform of that point (a +C rotation tilting the z axis, then a boost along z) and drop it if +C it does not hold there. The momenta of the real emission come in +C the partonic c.m. frame of the real for some FKS sectors and in +C that of the Born (a boost along z) for the initial-state ones. +C Two helicities can agree in the first frame and not in the +C second: helicities of massive particles change under the boost. +C E.g. u d~ > w+ g g: (W0,g-,g-) and (W0,g+,g+). + IF (NTRY.LT.2 .AND. ANY(T_IDENT(:).GT.0)) THEN + CA=COS(1D0) + SA=SIN(1D0) + CB=COS(0.5D0) + SB=SIN(0.5D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,NEXTERNAL + PX=P(1,I) + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + PLT(0,I)=GZ*(P(0,I)+BZ*PZ) + PLT(1,I)=CB*PX-SB*PY + PLT(2,I)=SB*PX+CB*PY + PLT(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + DO IHEL=1,NCOMB + IF (T_IDENT(IHEL).LE.0) CYCLE + CALL MATRIX_3(PLT,NHEL(1,IHEL),T) + CALL MATRIX_3(PLT,NHEL(1,T_IDENT(IHEL)),T_LT) + DO J=0,NSQAMPSO + IF (ABS(T(J)/T_LT(J)-1D0) .GT. 1D-10) T_IDENT(IHEL)=-1 + ENDDO + ENDDO + ENDIF DO I=1,NSQAMPSO ANS(I)=ANS(I)/DBLE(IDEN) ANS(0)=ANS(0)+ANS(I) diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f index 86c52cd4d7..3b4774462d 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_eq_4.f @@ -539,12 +539,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f index 5af8a497c6..6196838aa3 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_0_QEDAmpAndQEDsq_gt_2.f @@ -539,12 +539,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f index 6302ff484a..56180c4d16 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QCDsq_gt_4.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f index 736ca85d82..15a564bf37 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_QEDsq_le_4.f @@ -539,12 +539,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f index ab8fb69985..55900b6098 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_WGTsq_le_10_QEDAmpAndQEDsq_gt_2.f @@ -539,12 +539,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f index 27067c6c93..b632b48d13 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDQEDpert_default.f @@ -539,12 +539,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f index 623bbd7f3f..24cad0cc74 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QCDpert_default.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f index e4db38fbcd..d2699182c3 100644 --- a/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f +++ b/tests/input_files/IOTestsComparison/LoopSquaredOrder_IOTest/Loop_sqso_uux_ddx/loop_matrix_QEDpert_default.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f b/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f index 7ef7259bf2..d223340a5b 100644 --- a/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f +++ b/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f b/tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f index 1a3979fad1..6b8b945800 100644 --- a/tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f +++ b/tests/input_files/IOTestsComparison/TestCmdMatchBox/MatchBoxOutput/%TEST%SubProcesses%P1_uux_uux%loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE MG5_1_SLOOPMATRIX(P_USER,ANS) CALL MG5_1_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f index 760e514928..21fa377aed 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f @@ -430,12 +430,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) CALL JOINPATH(TMP,COLORDENOMFNAME,COLORDENOMFN) CALL JOINPATH(TMP,HELFILTERFNAME,HELFILTERFN) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f index d3f6c75bd1..77b3b9c8bb 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f @@ -430,12 +430,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) CALL JOINPATH(TMP,COLORDENOMFNAME,COLORDENOMFN) CALL JOINPATH(TMP,HELFILTERFNAME,HELFILTERFN) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f index 7eefa70dfb..1b8e61d7fd 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/dux_mumvmxg/loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f index 9e6d1455c3..01f92acd60 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f index f6c5b76cbb..575e302b2b 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f @@ -428,12 +428,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) CALL JOINPATH(TMP,COLORDENOMFNAME,COLORDENOMFN) CALL JOINPATH(TMP,HELFILTERFNAME,HELFILTERFN) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f index a8d848c3a2..5706fdbb18 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f @@ -430,12 +430,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) CALL JOINPATH(TMP,COLORDENOMFNAME,COLORDENOMFN) CALL JOINPATH(TMP,HELFILTERFNAME,HELFILTERFN) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f index 1a2c1e6708..29c3fd429a 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f @@ -430,12 +430,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) CALL JOINPATH(TMP,COLORDENOMFNAME,COLORDENOMFN) CALL JOINPATH(TMP,HELFILTERFNAME,HELFILTERFN) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f index 3456391ef1..e9d791fa35 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/ddx_ttx/loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f index a8bfa3cfaa..273a73abaf 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/loop_matrix.f @@ -531,12 +531,18 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANS) CALL ML5_0_SET_N_EVALS(N_DP_EVAL,N_QP_EVAL) -C Make sure that the loop filter is disabled when there is -C spin-2 particles for 2>1 or 1>2 processes - IF(MAX_SPIN_EXTERNAL_PARTICLE.GT.3.AND.(NEXTERNAL.LE.3.AND.HELI - $CITYFILTERLEVEL.NE.0)) THEN - WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1' - $ //' processes involving spin 2 particles.' +C Disable the helicity filter for 2>1 and 1>2 processes. +C In the c.m. frame one particle is then at rest (the +C final state of a 2>1, the decaying one of a 1>2), and +C which helicities vanish depends on the frame: at rest +C the helicity is defined along z, a boost changes it. +C A filter learned in one frame silently drops part of +C the result in another (u d~ > w+: virtual = 0 with the +C W along -z) and the stability test cannot see it. +C The tree-level standalone output does the same. + IF(NEXTERNAL.LE.3.AND.HELICITYFILTERLEVEL.NE.0) THEN + WRITE(*,*) '##INFO: Helicity filter deactivated for 2>1 and' + $ //' 1>2 processes.' HELICITYFILTERLEVEL = 0 C We write a dummy filter for structural reasons here OPEN(1, FILE=HELFILTERFN, ERR=6116, STATUS='NEW' From 33bd157460ffa92e4a84c2ad61d6fa6ea216f9f2 Mon Sep 17 00:00:00 2001 From: Rikkert Date: Thu, 5 Nov 2026 15:38:05 +0000 Subject: [PATCH 41/49] MadLoop: retain all loop helicities for 2>1 and 1>2 processes Initialize every per-helicity loop amplitude as active for NEXTERNAL<=3 in unoptimized output. Zeros learned in the centre-of-mass frame can become nonzero after a boost, independently of the main helicity filter. Normal initialization still writes the regenerated all-true loop filter. Add a generated-code regression comparing the finite part and both poles after a rotation and boost against a fully unfiltered evaluation, with helicity-filter levels 0 and 2. Run it alongside the real-emission regression in CI and update the export references and release notes. --- .github/workflows/acceptancetest.yml | 4 +- UpdateNotes.txt | 3 +- .../loop/loop_matrix_standalone.inc | 4 +- tests/acceptance_tests/test_cmd_madloop.py | 67 +++++++++++++++++++ .../dux_mumvmxg/loop_matrix.f | 4 +- .../gg_wmtbx/loop_matrix.f | 4 +- .../gg_hh/loop_matrix.f | 4 +- .../ddx_ttx/loop_matrix.f | 4 +- .../gg_ttx/loop_matrix.f | 4 +- .../madloop_loop_filter_frame_driver.f | 41 ++++++++++++ 10 files changed, 130 insertions(+), 9 deletions(-) create mode 100644 tests/input_files/madloop_loop_filter_frame_driver.f diff --git a/.github/workflows/acceptancetest.yml b/.github/workflows/acceptancetest.yml index 9c7170d320..e3d336c05b 100644 --- a/.github/workflows/acceptancetest.yml +++ b/.github/workflows/acceptancetest.yml @@ -1402,10 +1402,10 @@ jobs: - uses: ./.github/actions/restore_all # Runs a set of commands using the runners shell - - name: test one of the test test_real_helicity_ties_survive_a_boost + - name: Test real-emission helicity ties and MadLoop filters across frames run: | cd $GITHUB_WORKSPACE - ./tests/test_manager.py test_real_helicity_ties_survive_a_boost -pA -t0 -l INFO + ./tests/test_manager.py test_real_helicity_ties_survive_a_boost test_ML_loop_filter_survives_a_boost -pA -t0 -l INFO diff --git a/UpdateNotes.txt b/UpdateNotes.txt index a1c4432ed0..4419a6a461 100644 --- a/UpdateNotes.txt +++ b/UpdateNotes.txt @@ -22,7 +22,8 @@ ANNOUNCEMENT: +0.6% to +4.5% too high (u d~ > w+ g up to +25%), p p > z j [QCD] is affected the same way. A tie is now kept only if it also holds at a Lorentz transform of the first point. OM: MadLoop: the helicity filter is now disabled for all 2>1 and 1>2 processes (it was for spin-2 only), - as for the tree-level standalone output. A particle is at rest in the c.m. frame and which helicities + as for the tree-level standalone output. The non-optimized loop filter also keeps all amplitudes, + since it caches zeros per helicity. A particle is at rest in the c.m. frame and which helicities vanish depends on the frame: with the filter learned in one frame, u d~ > w+ returned a virtual 41% too low, or exactly zero, in another, flagged as stable. aMC@NLO is not affected (the virtual always comes in the c.m. frame of the Born); a 2>1 MadLoop called outside its c.m. frame diff --git a/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc b/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc index 15062da3e9..83d7677abe 100644 --- a/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc +++ b/madgraph/iolibs/template_files/loop/loop_matrix_standalone.inc @@ -482,9 +482,11 @@ OPEN(1, FILE=LoopFilterFN, err=100, status='OLD', action='READ') GOTO 101 100 CONTINUE FOUNDLOOPFILTER=.FALSE. +C Keep all loop amplitudes for 2>1 and 1>2 processes: this filter +C stores zeros per helicity, which can depend on the frame too. DO J=1,NCOMB DO I=NCTAMPS+1,NLOOPAMPS - GOODAMP(I,J)=(.NOT.USELOOPFILTER) + GOODAMP(I,J)=(.NOT.USELOOPFILTER).OR.(NEXTERNAL.LE.3) ENDDO ENDDO 101 CONTINUE diff --git a/tests/acceptance_tests/test_cmd_madloop.py b/tests/acceptance_tests/test_cmd_madloop.py index b3c4d2bd8d..0cdfab4be4 100755 --- a/tests/acceptance_tests/test_cmd_madloop.py +++ b/tests/acceptance_tests/test_cmd_madloop.py @@ -35,6 +35,7 @@ import madgraph.interface.amcatnlo_run_interface as NLOCmd import madgraph.interface.launch_ext_program as launch_ext import madgraph.various.misc as misc +import madgraph.various.banner as banner import tests.IOTests as IOTests _file_path = os.path.split(os.path.dirname(os.path.realpath(__file__)))[0] @@ -170,6 +171,72 @@ def test_ML_check_brs_gd_gd(self): raise self.setup_logFile_for_logger('madgraph.check_cmd',restore=True) + def test_ML_loop_filter_survives_a_boost(self): + """A loop amplitude vanishing for a W at rest need not vanish in + another frame, even when the main helicity filter is disabled. + """ + with tempfile.TemporaryDirectory(prefix='madloop_frame_') as tmpdir: + output_dir = pjoin(tmpdir, 'MLProcess') + for command in ('set loop_optimized_output False --no_save', + 'import model loop_sm', + 'generate u d~ > w+ [virt=QCD]', + 'output %s -f' % output_dir): + self.interface.exec_cmd(command, errorhandling=False, + printcmd=False, precmd=True, postcmd=True) + + proc_dir = pjoin(output_dir, 'SubProcesses', 'P0_udx_wp') + resources = pjoin(output_dir, 'SubProcesses', 'MadLoop5_resources') + with open(pjoin(proc_dir, 'proc_prefix.txt')) as stream: + prefix = stream.read().strip() + with open(pjoin(_pickle_path, 'madloop_loop_filter_frame_driver.f')) as stream: + driver = stream.read().replace('__PFX__', prefix) + # Use the generated makefile to link the driver with the same model, + # helicity amplitudes and reduction library as the standalone check. + with open(pjoin(proc_dir, 'check_sa.f'), 'w') as stream: + stream.write(driver) + for directory, command in ( + (pjoin(output_dir, 'Source'), ['make', 'libdhelas', 'libmodel']), + (proc_dir, ['make', 'check'])): + build = subprocess.run(command, cwd=directory, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + self.assertEqual(build.returncode, 0, build.stdout.decode()) + + card_path = pjoin(output_dir, 'Cards', 'MadLoopParams.dat') + card = banner.MadLoopParam(card_path) + card['UseLoopFilter'] = True + card['MLReductionLib'] = '1' + card['CheckCycle'] = 3 + # Test the loop filter independently of the main helicity filter: + # a guard nested inside HelicityFilterLevel != 0 misses level zero. + for level in (0, 2): + with self.subTest(HelicityFilterLevel=level): + card['HelicityFilterLevel'] = level + card.write(card_path) + for name in ('HelFilter.dat', 'LoopFilter.dat'): + filename = pjoin(resources, prefix + name) + if os.path.exists(filename): + os.remove(filename) + run = subprocess.run([pjoin(proc_dir, 'check')], cwd=proc_dir, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out = run.stdout.decode() + self.assertEqual(run.returncode, 0, out) + results = [line.split() for line in out.splitlines() + if line.startswith('RESULT ')] + self.assertEqual(len(results), 1, out) + values = [float(value) for value in results[0][1:]] + self.assertEqual(len(values), 6, out) + filtered, unfiltered = values[:3], values[3:] + self.assertNotEqual(unfiltered[0], 0., out) + for actual, expected in zip(filtered, unfiltered): + self.assertLess(abs(actual - expected), + 1e-10 * abs(expected), out) + # MadLoop's Python initializer still requires this file + # when the card requested filtering but all loops are kept. + with open(pjoin(resources, prefix + 'LoopFilter.dat')) as stream: + loop_filter = stream.read().split() + self.assertTrue(loop_filter) + self.assertEqual(set(loop_filter), {'T'}) + def test_ML_check_full_epem_ttx(self): """ Test that check full e+ e- > t t~ works fine """ diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f index 21fa377aed..708880b6fc 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/dux_mumvmxg/loop_matrix.f @@ -530,9 +530,11 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) GOTO 101 100 CONTINUE FOUNDLOOPFILTER=.FALSE. +C Keep all loop amplitudes for 2>1 and 1>2 processes: this filter +C stores zeros per helicity, which can depend on the frame too. DO J=1,NCOMB DO I=NCTAMPS+1,NLOOPAMPS - GOODAMP(I,J)=(.NOT.USELOOPFILTER) + GOODAMP(I,J)=(.NOT.USELOOPFILTER).OR.(NEXTERNAL.LE.3) ENDDO ENDDO 101 CONTINUE diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f index 77b3b9c8bb..befea9f032 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/loop_matrix.f @@ -530,9 +530,11 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) GOTO 101 100 CONTINUE FOUNDLOOPFILTER=.FALSE. +C Keep all loop amplitudes for 2>1 and 1>2 processes: this filter +C stores zeros per helicity, which can depend on the frame too. DO J=1,NCOMB DO I=NCTAMPS+1,NLOOPAMPS - GOODAMP(I,J)=(.NOT.USELOOPFILTER) + GOODAMP(I,J)=(.NOT.USELOOPFILTER).OR.(NEXTERNAL.LE.3) ENDDO ENDDO 101 CONTINUE diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f index 575e302b2b..fbd5054c6b 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_LoopInduced/gg_hh/loop_matrix.f @@ -528,9 +528,11 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) GOTO 101 100 CONTINUE FOUNDLOOPFILTER=.FALSE. +C Keep all loop amplitudes for 2>1 and 1>2 processes: this filter +C stores zeros per helicity, which can depend on the frame too. DO J=1,NCOMB DO I=NCTAMPS+1,NLOOPAMPS - GOODAMP(I,J)=(.NOT.USELOOPFILTER) + GOODAMP(I,J)=(.NOT.USELOOPFILTER).OR.(NEXTERNAL.LE.3) ENDDO ENDDO 101 CONTINUE diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f index 5706fdbb18..5f649e2211 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/ddx_ttx/loop_matrix.f @@ -530,9 +530,11 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) GOTO 101 100 CONTINUE FOUNDLOOPFILTER=.FALSE. +C Keep all loop amplitudes for 2>1 and 1>2 processes: this filter +C stores zeros per helicity, which can depend on the frame too. DO J=1,NCOMB DO I=NCTAMPS+1,NLOOPAMPS - GOODAMP(I,J)=(.NOT.USELOOPFILTER) + GOODAMP(I,J)=(.NOT.USELOOPFILTER).OR.(NEXTERNAL.LE.3) ENDDO ENDDO 101 CONTINUE diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f index 29c3fd429a..81aed7fcdd 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/loop_matrix.f @@ -530,9 +530,11 @@ SUBROUTINE ML5_0_SLOOPMATRIX(P_USER,ANSRETURNED) GOTO 101 100 CONTINUE FOUNDLOOPFILTER=.FALSE. +C Keep all loop amplitudes for 2>1 and 1>2 processes: this filter +C stores zeros per helicity, which can depend on the frame too. DO J=1,NCOMB DO I=NCTAMPS+1,NLOOPAMPS - GOODAMP(I,J)=(.NOT.USELOOPFILTER) + GOODAMP(I,J)=(.NOT.USELOOPFILTER).OR.(NEXTERNAL.LE.3) ENDDO ENDDO 101 CONTINUE diff --git a/tests/input_files/madloop_loop_filter_frame_driver.f b/tests/input_files/madloop_loop_filter_frame_driver.f new file mode 100644 index 0000000000..fb99e20a23 --- /dev/null +++ b/tests/input_files/madloop_loop_filter_frame_driver.f @@ -0,0 +1,41 @@ + PROGRAM MADLOOP_LOOP_FILTER_FRAME +C Learn filters with the W at rest, then compare a rotated and +C boosted event against an evaluation bypassing all filters. + IMPLICIT NONE + INCLUDE 'coupl.inc' + INCLUDE 'nsquaredSO.inc' + REAL*8 P(0:3,3),Q(0:3,3),RESULT(0:3,0:NSQUAREDSO) + REAL*8 REFERENCE(0:3,0:NSQUAREDSO),ACC(0:NSQUAREDSO) + REAL*8 CA,SA,BZ,GZ,PY,PZ,TOL + INTEGER I,K,RET + LOGICAL BYPASS,ALWAYS + COMMON/__PFX__BYPASS_CHECK/BYPASS,ALWAYS + CALL SETPARA('../MadLoop5_resources/param_card.dat') + P=0D0 + P(0,1)=MDL_MW/2D0 + P(3,1)=MDL_MW/2D0 + P(0,2)=MDL_MW/2D0 + P(3,2)=-MDL_MW/2D0 + P(0,3)=MDL_MW + TOL=1D-7 + DO K=1,7 + CALL __PFX__SLOOPMATRIX_THRES(P,RESULT,TOL,ACC,RET) + ENDDO + CA=COS(1D0) + SA=SIN(1D0) + BZ=0.5D0 + GZ=1D0/SQRT(1D0-BZ**2) + DO I=1,3 + PY=CA*P(2,I)-SA*P(3,I) + PZ=SA*P(2,I)+CA*P(3,I) + Q(0,I)=GZ*(P(0,I)+BZ*PZ) + Q(1,I)=P(1,I) + Q(2,I)=PY + Q(3,I)=GZ*(PZ+BZ*P(0,I)) + ENDDO + CALL __PFX__SLOOPMATRIX_THRES(Q,RESULT,TOL,ACC,RET) + BYPASS=.TRUE. + CALL __PFX__SLOOPMATRIX_THRES(Q,REFERENCE,TOL,ACC,RET) + WRITE(*,'(A,6E25.16)') 'RESULT ',RESULT(1:3,0), + $ REFERENCE(1:3,0) + END From b2202def6f9db231ef0775f68d96e08a541ea9c2 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Fri, 6 Nov 2026 09:01:35 +0100 Subject: [PATCH 42/49] fixing IOTest --- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f | 4 ++-- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f | 6 +++--- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f | 2 +- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f | 2 +- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f | 6 +++--- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f | 2 +- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f | 4 ++-- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f | 2 +- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f | 2 +- .../test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f | 4 ++-- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f | 6 +++--- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f | 6 +++--- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f | 4 ++-- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f | 6 +++--- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f | 4 ++-- .../test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f | 4 ++-- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f | 4 ++-- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f | 6 +++--- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f | 6 +++--- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f | 4 ++-- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f | 4 ++-- .../test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f | 2 +- .../test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f | 2 +- .../export_matrix_element_v4_madevent_nogroup/matrix.f | 2 +- .../%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f | 2 +- .../long_ML_SMQCD_default/gg_wmtbx/born_matrix.f | 4 ++-- .../long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f | 4 ++-- .../short_ML_SMQCD_default/gg_ttx/born_matrix.f | 4 ++-- .../short_ML_SMQCD_optimized/gg_ttx/born_matrix.f | 4 ++-- 70 files changed, 97 insertions(+), 97 deletions(-) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f index 91457165c9..14697c60ff 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f @@ -242,10 +242,10 @@ SUBROUTINE B_SF_001(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) JAMP2(2,1) = ((0.000000000000000D+00,1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f index ca803f3ebf..c68c22a814 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_002(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f index 5d1745d415..65ebdb0005 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_003(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f index ed66f2cc9a..1609187a00 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_004(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f index 543d1b3054..a20ddb1843 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_005(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f index 6a13f524ce..655158eb2e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_006(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f index b403ba0306..d0ef32e0a2 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_007(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-1.666666666666667D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(3) JAMP2(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f index 99ab25ad63..b1f4a2e202 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_008(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f index 42ba307483..53d4704b96 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f @@ -507,7 +507,7 @@ SUBROUTINE BORN(P,NHEL,HELL,ANS,BORNS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO M = 1, NAMPSO DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f index b858da90fd..16c36e01c6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f @@ -218,7 +218,7 @@ SUBROUTINE BORN_HEL_SPLITORDERS(P,HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f index 930605e761..2accee86cb 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f @@ -242,10 +242,10 @@ SUBROUTINE B_SF_001(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) JAMP2(2,1) = ((0.000000000000000D+00,1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f index eade0cabcf..de9883343c 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_002(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f index c9ccd47d5b..fcea21c8fa 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_003(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f index e65d1d633b..de438144a2 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_004(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f index 72b4d07e16..e77632f864 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_005(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f index ba472d1fa4..f1bfdef202 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_006(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f index c84a7b53d2..154a983526 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_007(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-1.666666666666667D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(3) JAMP2(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f index 5d00f8ad8d..e0c52d6124 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_008(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f index 92dfc4eacb..289e9c45c1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f @@ -507,7 +507,7 @@ SUBROUTINE BORN(P,NHEL,HELL,ANS,BORNS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO M = 1, NAMPSO DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f index 8f0f669dc6..83b1ecfcb4 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f @@ -218,7 +218,7 @@ SUBROUTINE BORN_HEL_SPLITORDERS(P,HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f index 654042e1e0..545d98df1d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f @@ -398,17 +398,17 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) TMP_JAMP(3) = AMP(15) + AMP(16) ! used 4 times TMP_JAMP(2) = AMP(1) + AMP(18) ! used 4 times TMP_JAMP(1) = AMP(12) - AMP(17) ! used 4 times - TMP_JAMP(9) = TMP_JAMP(3) + ((0.000000000000000D+00, + TMP_JAMP(9) = TMP_JAMP(3) + ((-0.000000000000000D+00, $ -1.000000000000000D+00)) * AMP(8) ! used 2 times TMP_JAMP(8) = TMP_JAMP(3) + ((-0.000000000000000D+00 $ ,1.000000000000000D+00)) * AMP(5) ! used 2 times TMP_JAMP(7) = TMP_JAMP(2) + ((-0.000000000000000D+00 $ ,1.000000000000000D+00)) * AMP(2) ! used 2 times - TMP_JAMP(6) = TMP_JAMP(2) + ((0.000000000000000D+00, + TMP_JAMP(6) = TMP_JAMP(2) + ((-0.000000000000000D+00, $ -1.000000000000000D+00)) * AMP(3) ! used 2 times TMP_JAMP(5) = TMP_JAMP(1) + ((-0.000000000000000D+00 $ ,1.000000000000000D+00)) * AMP(11) ! used 2 times - TMP_JAMP(4) = TMP_JAMP(1) + ((0.000000000000000D+00, + TMP_JAMP(4) = TMP_JAMP(1) + ((-0.000000000000000D+00, $ -1.000000000000000D+00)) * AMP(10) ! used 2 times JAMP(1,1) = (-1.000000000000000D+00)*AMP(6)+(-1.000000000000000D $ +00)*TMP_JAMP(6)+TMP_JAMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f index 8241713a98..e4cf6a8172 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f @@ -367,7 +367,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(3,1) = (5.000000000000000D-01)*AMP(1)+(5.000000000000000D - $ -01)*AMP(3)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(3)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(4,1) = (-1.666666666666667D-01)*AMP(1)+(-1.666666666666667D $ -01)*AMP(5) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f index 2c999c4b61..a24c9409a7 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f @@ -362,7 +362,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) CALL FFV1_0(W(1,1),W(1,6),W(1,7),GC_11,AMP(5)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(1)+(-5.000000000000000D - $ -01)*AMP(2)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(2)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(2,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f index 1de379e5dc..d9ab307899 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(4,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f index 45a97a79a6..c59c1031e1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_5(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(1)+(1.666666666666667D $ -01)*AMP(4) JAMP(4,1) = (-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D - $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f index f217742f25..64a63ca2fb 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f @@ -366,7 +366,7 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) JAMP(2,1) = ((0.000000000000000D+00,5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D-01) $ *AMP(4) - JAMP(3,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(3,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D-01) $ *AMP(5) JAMP(4,1) = (1.666666666666667D-01)*AMP(4)+(1.666666666666667D diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f index 46edc34803..fcf95174b1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(4,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f index 5d1050982f..e50857f450 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f @@ -362,7 +362,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) CALL FFV1_0(W(1,1),W(1,6),W(1,7),GC_11,AMP(5)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(1)+(-5.000000000000000D - $ -01)*AMP(2)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(2)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(2,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f index da31761af1..a213c89f9a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f @@ -363,7 +363,7 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) - JAMP(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(5.000000000000000D-01)*AMP(2)+(5.000000000000000D-01) $ *AMP(5) JAMP(3,1) = ((0.000000000000000D+00,5.000000000000000D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f index ea51e791f6..2866c29bf1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(1)+(1.666666666666667D $ -01)*AMP(4) JAMP(4,1) = (-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D - $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f index 8becfbf9c5..93aeed691b 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f @@ -367,7 +367,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(3,1) = (5.000000000000000D-01)*AMP(1)+(5.000000000000000D - $ -01)*AMP(3)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(3)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(4,1) = (-1.666666666666667D-01)*AMP(1)+(-1.666666666666667D $ -01)*AMP(5) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f index 1cb139b885..bc40c18265 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f @@ -354,8 +354,8 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(7) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2,1) = (-1.000000000000000D+00)*AMP(1)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(8) - $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(8)+(( + $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) DO I=0,NSQAMPSO RES(I)=0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f index af9731a002..7346933989 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f @@ -380,7 +380,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = ((0.000000000000000D+00,5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D-01) $ *AMP(9) - JAMP(3,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(3,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(6)+(-5.000000000000000D-01) $ *AMP(12) JAMP(4,1) = (1.666666666666667D-01)*AMP(9)+(1.666666666666667D diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f index a3db3d2eb7..17a3a445a3 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f index 623bb55b0e..4972603215 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) CALL FFV2_3_0(W(1,1),W(1,11),W(1,9),GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f index 40eb36dccd..e599065b2f 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f @@ -377,7 +377,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-1.666666666666667D-01)*AMP(3)+(-1.666666666666667D $ -01)*AMP(6) - JAMP(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(5.000000000000000D-01)*AMP(3)+(5.000000000000000D-01) $ *AMP(12) JAMP(3,1) = ((0.000000000000000D+00,5.000000000000000D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f index 504b732166..849c4bd8e5 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f index f5c4a52f6a..2429496c4a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f index 8fa79cf847..cf7f081f74 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f @@ -354,8 +354,8 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) $ +00)*AMP(2)+(-1.000000000000000D+00)*AMP(7) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2,1) = (-1.000000000000000D+00)*AMP(3)+(-1.000000000000000D - $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) - $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8)+(( + $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) DO I=0,NSQAMPSO RES(I)=0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f index db8b0d6ec2..0ee0ba64f2 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f @@ -243,10 +243,10 @@ SUBROUTINE B_SF_001(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) JAMP2(2,1) = ((0.000000000000000D+00,1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f index c0e7bc49cc..948998bb66 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f @@ -243,12 +243,12 @@ SUBROUTINE B_SF_002(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f index 3d70ee0d9a..6489465fc7 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_003(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f index 11db1bdc23..8c11af9aca 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_004(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f index da275fb089..97a739e1d9 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f @@ -243,12 +243,12 @@ SUBROUTINE B_SF_005(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f index 79438e0692..4cfcd46c03 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_006(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f index 1195d82a95..4816e6b02a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f @@ -243,12 +243,12 @@ SUBROUTINE B_SF_007(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(2) - JAMP2(2,1) = ((0.000000000000000D+00,-1.666666666666667D-01)) + JAMP2(2,1) = ((-0.000000000000000D+00,-1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(3) JAMP2(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f index 6c7864c338..d92bee3d32 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_008(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f index 5df88e5f5c..eec6bd734e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f @@ -508,7 +508,7 @@ SUBROUTINE BORN(P,NHEL,HELL,ANS,BORNS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO M = 1, NAMPSO DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f index b45b5a7237..9504f81043 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f @@ -219,7 +219,7 @@ SUBROUTINE BORN_HEL_SPLITORDERS(P,HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f index 064c1177bf..af6f5aadec 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f index 7f7b348b7b..ad4d5ff129 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) CALL FFV2_3_0(W(1,1),W(1,11),W(1,9),GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f index 658fe9f27d..6a7962835e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f index 4753e177d9..bc722c72fb 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) CALL FFV2_5_0(W(1,1),W(1,11),W(1,9),-GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f index c072079773..7cbceb5b51 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_5(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f index fc23d5381e..ab97e25870 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f index dc94b49660..1cf3a01b5f 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_7(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f index aff94cbb9d..488153b0c1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_8(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f index c40c5c2317..09a56fe847 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f @@ -354,8 +354,8 @@ SUBROUTINE MATRIX_9(P,NHEL,RES) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2,1) = (-1.000000000000000D+00)*AMP(5)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7) - $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7)+(( + $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) DO I=0,NSQAMPSO RES(I)=0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f index b35d8950bd..acad743883 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f @@ -380,7 +380,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = ((0.000000000000000D+00,5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D-01) $ *AMP(9) - JAMP(3,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(3,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(6)+(-5.000000000000000D-01) $ *AMP(12) JAMP(4,1) = (1.666666666666667D-01)*AMP(9)+(1.666666666666667D diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f index 29cc38c588..054d1709e6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f index 75bd3ee5ff..6290797d9c 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) CALL FFV2_5_0(W(1,1),W(1,11),W(1,9),-GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f index 38366fea54..063bc33d14 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f @@ -377,7 +377,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-1.666666666666667D-01)*AMP(3)+(-1.666666666666667D $ -01)*AMP(6) - JAMP(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(5.000000000000000D-01)*AMP(3)+(5.000000000000000D-01) $ *AMP(12) JAMP(3,1) = ((0.000000000000000D+00,5.000000000000000D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f index 3177c76dba..c70039fcbf 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f index c8bd4a3fc4..165aaaebc6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f index 630ccf90d1..2d808f950f 100644 --- a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f +++ b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f @@ -326,7 +326,7 @@ REAL*8 FUNCTION MATRIX(P,NHEL,IC) C Amplitude(s) for diagram number 3 CALL FFV1_0(W(1,5),W(1,2),W(1,3),GQQ,AMP(3)) C JAMPs contributing to orders ALL_ORDERS=1 - JAMP(1,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(1,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+AMP(3) JAMP(2,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+AMP(2) diff --git a/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f b/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f index a9ebf03e70..5d3186b6aa 100644 --- a/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f +++ b/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f @@ -324,7 +324,7 @@ SUBROUTINE ML5_0_MATRIX(P,NHEL,IC,RES) C JAMPs contributing to orders QCD=2 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) RES = 0.D0 diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f index ca8f0c821d..faf1eaa847 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f @@ -309,8 +309,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2) = (-1.000000000000000D+00)*AMP(5)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7) - $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7)+(( + $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f index ca8f0c821d..faf1eaa847 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f @@ -309,8 +309,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2) = (-1.000000000000000D+00)*AMP(5)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7) - $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7)+(( + $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f index fb048249c7..ce14453f38 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f @@ -259,8 +259,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) CALL FFV1_0(W(1,5),W(1,3),W(1,2),GC_5,AMP(3)) JAMP(1) = ((0.000000000000000D+00,1.000000000000000D+00))*AMP(1) $ +(-1.000000000000000D+00)*AMP(2) - JAMP(2) = ((0.000000000000000D+00,-1.000000000000000D+00))*AMP(1) - $ +(-1.000000000000000D+00)*AMP(3) + JAMP(2) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f index fb048249c7..ce14453f38 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f @@ -259,8 +259,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) CALL FFV1_0(W(1,5),W(1,3),W(1,2),GC_5,AMP(3)) JAMP(1) = ((0.000000000000000D+00,1.000000000000000D+00))*AMP(1) $ +(-1.000000000000000D+00)*AMP(2) - JAMP(2) = ((0.000000000000000D+00,-1.000000000000000D+00))*AMP(1) - $ +(-1.000000000000000D+00)*AMP(3) + JAMP(2) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR From 43313c15f573f920a14f906b65b5a953c1e90a1e Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Fri, 6 Nov 2026 17:03:53 +0100 Subject: [PATCH 43/49] JAMP coefficients: print a zero real/imag part without its sign The complex JAMP coefficients are built with complex float arithmetic, and the sign of a zero part depends on the Python version (3.14 changed mixed real/complex arithmetic), so IOTest goldens regenerated on 3.14 failed on CI (Python 3.10). Normalise -0.0 to 0.0 when formatting and regenerate the 70 affected goldens (zero-sign and line-wrap changes only). --- madgraph/iolibs/export_v4.py | 6 ++++-- .../%SubProcesses%P0_gg_ttx%b_sf_001.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_002.f | 6 +++--- .../%SubProcesses%P0_gg_ttx%b_sf_003.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_004.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_005.f | 6 +++--- .../%SubProcesses%P0_gg_ttx%b_sf_006.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_007.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_008.f | 2 +- .../%SubProcesses%P0_gg_ttx%born.f | 2 +- .../%SubProcesses%P0_gg_ttx%born_hel.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_001.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_002.f | 6 +++--- .../%SubProcesses%P0_gg_ttx%b_sf_003.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_004.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_005.f | 6 +++--- .../%SubProcesses%P0_gg_ttx%b_sf_006.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_007.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_008.f | 2 +- .../test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f | 2 +- .../%SubProcesses%P0_gg_ttx%born_hel.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_1.f | 12 ++++++------ .../%SubProcesses%P0_gg_ttx%matrix_2.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_4.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_5.f | 2 +- .../%SubProcesses%P0_uux_ttx%matrix_1.f | 2 +- .../%SubProcesses%P0_uux_ttx%matrix_2.f | 2 +- .../%SubProcesses%P0_uux_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_uxu_ttx%matrix_1.f | 2 +- .../%SubProcesses%P0_uxu_ttx%matrix_2.f | 2 +- .../%SubProcesses%P0_uxu_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_ag_ttx%matrix_1.f | 4 ++-- .../%SubProcesses%P0_ddx_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_ddx_ttx%matrix_4.f | 2 +- .../%SubProcesses%P0_ddx_ttx%matrix_6.f | 2 +- .../%SubProcesses%P0_dxd_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_dxd_ttx%matrix_4.f | 2 +- .../%SubProcesses%P0_dxd_ttx%matrix_6.f | 2 +- .../%SubProcesses%P0_ga_ttx%matrix_1.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_001.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_002.f | 6 +++--- .../%SubProcesses%P0_gg_ttx%b_sf_003.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_004.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_005.f | 6 +++--- .../%SubProcesses%P0_gg_ttx%b_sf_006.f | 2 +- .../%SubProcesses%P0_gg_ttx%b_sf_007.f | 4 ++-- .../%SubProcesses%P0_gg_ttx%b_sf_008.f | 2 +- .../%SubProcesses%P0_gg_ttx%born.f | 2 +- .../%SubProcesses%P0_gg_ttx%born_hel.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_1.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_2.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_4.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_5.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_6.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_7.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_8.f | 2 +- .../%SubProcesses%P0_gg_ttx%matrix_9.f | 4 ++-- .../%SubProcesses%P0_uux_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_uux_ttx%matrix_4.f | 2 +- .../%SubProcesses%P0_uux_ttx%matrix_6.f | 2 +- .../%SubProcesses%P0_uxu_ttx%matrix_3.f | 2 +- .../%SubProcesses%P0_uxu_ttx%matrix_4.f | 2 +- .../%SubProcesses%P0_uxu_ttx%matrix_6.f | 2 +- .../matrix.f | 2 +- ...ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f | 2 +- .../long_ML_SMQCD_default/gg_wmtbx/born_matrix.f | 4 ++-- .../long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f | 4 ++-- .../short_ML_SMQCD_default/gg_ttx/born_matrix.f | 4 ++-- .../short_ML_SMQCD_optimized/gg_ttx/born_matrix.f | 4 ++-- 71 files changed, 104 insertions(+), 102 deletions(-) diff --git a/madgraph/iolibs/export_v4.py b/madgraph/iolibs/export_v4.py index 563270c8c7..d818293945 100755 --- a/madgraph/iolibs/export_v4.py +++ b/madgraph/iolibs/export_v4.py @@ -1534,10 +1534,12 @@ def format(frac): return "%id0/%id0" % (frac.numerator, frac.denominator) elif frac.real == frac: #misc.sprint(frac.real, frac) - return ('%.15e' % frac.real).replace('e','d') + # +0.0 maps -0.0 to 0.0: the sign of a zero from complex + # arithmetic depends on the Python version (3.14 changed it) + return ('%.15e' % (frac.real + 0.0)).replace('e','d') #str(float(frac.real)).replace('e','d') else: - return ('(%.15e,%.15e)' % (frac.real, frac.imag)).replace('e','d') + return ('(%.15e,%.15e)' % (frac.real + 0.0, frac.imag + 0.0)).replace('e','d') #str(frac).replace('e','d').replace('j','*imag1') diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f index 14697c60ff..91457165c9 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_001.f @@ -242,10 +242,10 @@ SUBROUTINE B_SF_001(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) JAMP2(2,1) = ((0.000000000000000D+00,1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f index c68c22a814..ca803f3ebf 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_002.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_002(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f index 65ebdb0005..5d1745d415 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_003.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_003(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f index 1609187a00..ed66f2cc9a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_004.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_004(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f index a20ddb1843..543d1b3054 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_005.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_005(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f index 655158eb2e..6a13f524ce 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_006.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_006(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f index d0ef32e0a2..b403ba0306 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_007.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_007(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-1.666666666666667D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(3) JAMP2(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f index b1f4a2e202..99ab25ad63 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%b_sf_008.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_008(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f index 53d4704b96..42ba307483 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born.f @@ -507,7 +507,7 @@ SUBROUTINE BORN(P,NHEL,HELL,ANS,BORNS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO M = 1, NAMPSO DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f index 16c36e01c6..b858da90fd 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fks_loonly/%SubProcesses%P0_gg_ttx%born_hel.f @@ -218,7 +218,7 @@ SUBROUTINE BORN_HEL_SPLITORDERS(P,HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f index 2accee86cb..930605e761 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_001.f @@ -242,10 +242,10 @@ SUBROUTINE B_SF_001(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) JAMP2(2,1) = ((0.000000000000000D+00,1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f index de9883343c..eade0cabcf 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_002.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_002(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f index fcea21c8fa..c9ccd47d5b 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_003.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_003(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f index de438144a2..e65d1d633b 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_004.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_004(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f index e77632f864..72b4d07e16 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_005.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_005(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f index f1bfdef202..ba472d1fa4 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_006.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_006(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f index 154a983526..c84a7b53d2 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_007.f @@ -242,12 +242,12 @@ SUBROUTINE B_SF_007(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-1.666666666666667D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(3) JAMP2(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f index e0c52d6124..5d00f8ad8d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%b_sf_008.f @@ -242,7 +242,7 @@ SUBROUTINE B_SF_008(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f index 289e9c45c1..92dfc4eacb 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born.f @@ -507,7 +507,7 @@ SUBROUTINE BORN(P,NHEL,HELL,ANS,BORNS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO M = 1, NAMPSO DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f index 83b1ecfcb4..8f0f669dc6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%born_hel.f @@ -218,7 +218,7 @@ SUBROUTINE BORN_HEL_SPLITORDERS(P,HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f index 545d98df1d..80686ac79d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_1.f @@ -398,17 +398,17 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) TMP_JAMP(3) = AMP(15) + AMP(16) ! used 4 times TMP_JAMP(2) = AMP(1) + AMP(18) ! used 4 times TMP_JAMP(1) = AMP(12) - AMP(17) ! used 4 times - TMP_JAMP(9) = TMP_JAMP(3) + ((-0.000000000000000D+00, + TMP_JAMP(9) = TMP_JAMP(3) + ((0.000000000000000D+00, $ -1.000000000000000D+00)) * AMP(8) ! used 2 times - TMP_JAMP(8) = TMP_JAMP(3) + ((-0.000000000000000D+00 + TMP_JAMP(8) = TMP_JAMP(3) + ((0.000000000000000D+00 $ ,1.000000000000000D+00)) * AMP(5) ! used 2 times - TMP_JAMP(7) = TMP_JAMP(2) + ((-0.000000000000000D+00 + TMP_JAMP(7) = TMP_JAMP(2) + ((0.000000000000000D+00 $ ,1.000000000000000D+00)) * AMP(2) ! used 2 times - TMP_JAMP(6) = TMP_JAMP(2) + ((-0.000000000000000D+00, + TMP_JAMP(6) = TMP_JAMP(2) + ((0.000000000000000D+00, $ -1.000000000000000D+00)) * AMP(3) ! used 2 times - TMP_JAMP(5) = TMP_JAMP(1) + ((-0.000000000000000D+00 + TMP_JAMP(5) = TMP_JAMP(1) + ((0.000000000000000D+00 $ ,1.000000000000000D+00)) * AMP(11) ! used 2 times - TMP_JAMP(4) = TMP_JAMP(1) + ((-0.000000000000000D+00, + TMP_JAMP(4) = TMP_JAMP(1) + ((0.000000000000000D+00, $ -1.000000000000000D+00)) * AMP(10) ! used 2 times JAMP(1,1) = (-1.000000000000000D+00)*AMP(6)+(-1.000000000000000D $ +00)*TMP_JAMP(6)+TMP_JAMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f index e4cf6a8172..8241713a98 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_2.f @@ -367,7 +367,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(3,1) = (5.000000000000000D-01)*AMP(1)+(5.000000000000000D - $ -01)*AMP(3)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(3)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(4,1) = (-1.666666666666667D-01)*AMP(1)+(-1.666666666666667D $ -01)*AMP(5) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f index a24c9409a7..2c999c4b61 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_3.f @@ -362,7 +362,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) CALL FFV1_0(W(1,1),W(1,6),W(1,7),GC_11,AMP(5)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(1)+(-5.000000000000000D - $ -01)*AMP(2)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(2)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(2,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f index d9ab307899..1de379e5dc 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_4.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(4,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f index c59c1031e1..45a97a79a6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_gg_ttx%matrix_5.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_5(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(1)+(1.666666666666667D $ -01)*AMP(4) JAMP(4,1) = (-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D - $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f index 64a63ca2fb..f217742f25 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_1.f @@ -366,7 +366,7 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) JAMP(2,1) = ((0.000000000000000D+00,5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D-01) $ *AMP(4) - JAMP(3,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(3,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D-01) $ *AMP(5) JAMP(4,1) = (1.666666666666667D-01)*AMP(4)+(1.666666666666667D diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f index fcf95174b1..46edc34803 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_2.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(4,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f index e50857f450..5d1050982f 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uux_ttx%matrix_3.f @@ -362,7 +362,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) CALL FFV1_0(W(1,1),W(1,6),W(1,7),GC_11,AMP(5)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(1)+(-5.000000000000000D - $ -01)*AMP(2)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(2)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(2,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f index a213c89f9a..da31761af1 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_1.f @@ -363,7 +363,7 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) - JAMP(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(5.000000000000000D-01)*AMP(2)+(5.000000000000000D-01) $ *AMP(5) JAMP(3,1) = ((0.000000000000000D+00,5.000000000000000D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f index 2866c29bf1..ea51e791f6 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_2.f @@ -369,7 +369,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(1)+(1.666666666666667D $ -01)*AMP(4) JAMP(4,1) = (-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D - $ -01)*AMP(4)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(4)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(5) DO I=0,NSQAMPSO diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f index 93aeed691b..8becfbf9c5 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksreal/%SubProcesses%P0_uxu_ttx%matrix_3.f @@ -367,7 +367,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(3) JAMP(3,1) = (5.000000000000000D-01)*AMP(1)+(5.000000000000000D - $ -01)*AMP(3)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(3)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(4) JAMP(4,1) = (-1.666666666666667D-01)*AMP(1)+(-1.666666666666667D $ -01)*AMP(5) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f index bc40c18265..1cb139b885 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ag_ttx%matrix_1.f @@ -354,8 +354,8 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(7) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2,1) = (-1.000000000000000D+00)*AMP(1)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(8)+(( - $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(8) + $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) DO I=0,NSQAMPSO RES(I)=0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f index 7346933989..af9731a002 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_3.f @@ -380,7 +380,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = ((0.000000000000000D+00,5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D-01) $ *AMP(9) - JAMP(3,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(3,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(6)+(-5.000000000000000D-01) $ *AMP(12) JAMP(4,1) = (1.666666666666667D-01)*AMP(9)+(1.666666666666667D diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f index 17a3a445a3..a3db3d2eb7 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f index 4972603215..623bb55b0e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ddx_ttx%matrix_6.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) CALL FFV2_3_0(W(1,1),W(1,11),W(1,9),GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f index e599065b2f..40eb36dccd 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_3.f @@ -377,7 +377,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-1.666666666666667D-01)*AMP(3)+(-1.666666666666667D $ -01)*AMP(6) - JAMP(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(5.000000000000000D-01)*AMP(3)+(5.000000000000000D-01) $ *AMP(12) JAMP(3,1) = ((0.000000000000000D+00,5.000000000000000D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f index 849c4bd8e5..504b732166 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f index 2429496c4a..f5c4a52f6a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_dxd_ttx%matrix_6.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f index cf7f081f74..8fa79cf847 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_ga_ttx%matrix_1.f @@ -354,8 +354,8 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) $ +00)*AMP(2)+(-1.000000000000000D+00)*AMP(7) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2,1) = (-1.000000000000000D+00)*AMP(3)+(-1.000000000000000D - $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8)+(( - $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) + $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) DO I=0,NSQAMPSO RES(I)=0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f index 0ee0ba64f2..db8b0d6ec2 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_001.f @@ -243,10 +243,10 @@ SUBROUTINE B_SF_001(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) JAMP2(2,1) = ((0.000000000000000D+00,1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f index 948998bb66..c0e7bc49cc 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_002.f @@ -243,12 +243,12 @@ SUBROUTINE B_SF_002(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f index 6489465fc7..3d70ee0d9a 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_003.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_003(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f index 8c11af9aca..11db1bdc23 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_004.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_004(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.500000000000000D+00)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f index 97a739e1d9..da275fb089 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_005.f @@ -243,12 +243,12 @@ SUBROUTINE B_SF_005(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 - JAMP2(1,1) = ((-0.000000000000000D+00,-1.500000000000000D+00)) + JAMP2(1,1) = ((0.000000000000000D+00,-1.500000000000000D+00)) $ *AMP(1)+(1.500000000000000D+00)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f index 4cfcd46c03..79438e0692 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_006.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_006(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f index 4816e6b02a..1195d82a95 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_007.f @@ -243,12 +243,12 @@ SUBROUTINE B_SF_007(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(2) - JAMP2(2,1) = ((-0.000000000000000D+00,-1.666666666666667D-01)) + JAMP2(2,1) = ((0.000000000000000D+00,-1.666666666666667D-01)) $ *AMP(1)+(-1.666666666666667D-01)*AMP(3) JAMP2(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D $ -01)*AMP(3) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f index d92bee3d32..6c7864c338 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%b_sf_008.f @@ -243,7 +243,7 @@ SUBROUTINE B_SF_008(HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP1(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP1(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP1(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) C JAMPs contributing to orders QCD=2 QED=0 JAMP2(1,1) = ((0.000000000000000D+00,6.666666666666666D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f index eec6bd734e..5df88e5f5c 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born.f @@ -508,7 +508,7 @@ SUBROUTINE BORN(P,NHEL,HELL,ANS,BORNS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO M = 1, NAMPSO DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f index 9504f81043..b45b5a7237 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%born_hel.f @@ -219,7 +219,7 @@ SUBROUTINE BORN_HEL_SPLITORDERS(P,HELL,ANS) C JAMPs contributing to orders QCD=2 QED=0 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) DO I = 1, NSQAMPSO ANS(I) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f index af6f5aadec..064c1177bf 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_1.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_1(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f index ad4d5ff129..7f7b348b7b 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_2.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_2(P,NHEL,RES) CALL FFV2_3_0(W(1,1),W(1,11),W(1,9),GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f index 6a7962835e..658fe9f27d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_3.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f index bc722c72fb..4753e177d9 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_4.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) CALL FFV2_5_0(W(1,1),W(1,11),W(1,9),-GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f index 7cbceb5b51..c072079773 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_5.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_5(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f index ab97e25870..fc23d5381e 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_6.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f index 1cf3a01b5f..dc94b49660 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_7.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_7(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f index 488153b0c1..aff94cbb9d 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_8.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_8(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f index 09a56fe847..c40c5c2317 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_gg_ttx%matrix_9.f @@ -354,8 +354,8 @@ SUBROUTINE MATRIX_9(P,NHEL,RES) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2,1) = (-1.000000000000000D+00)*AMP(5)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7)+(( - $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7) + $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) DO I=0,NSQAMPSO RES(I)=0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f index acad743883..b35d8950bd 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_3.f @@ -380,7 +380,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) JAMP(2,1) = ((0.000000000000000D+00,5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(3)+(-5.000000000000000D-01) $ *AMP(9) - JAMP(3,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(3,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(-5.000000000000000D-01)*AMP(6)+(-5.000000000000000D-01) $ *AMP(12) JAMP(4,1) = (1.666666666666667D-01)*AMP(9)+(1.666666666666667D diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f index 054d1709e6..29cc38c588 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(4,1) = (5.000000000000000D-01)*AMP(5)+(5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f index 6290797d9c..75bd3ee5ff 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uux_ttx%matrix_6.f @@ -376,7 +376,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) CALL FFV2_5_0(W(1,1),W(1,11),W(1,9),-GC_50,GC_58,AMP(13)) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-5.000000000000000D-01)*AMP(2)+(-5.000000000000000D - $ -01)*AMP(5)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(5)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(2,1) = (1.666666666666667D-01)*AMP(5)+(1.666666666666667D $ -01)*AMP(8) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f index 063bc33d14..38366fea54 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_3.f @@ -377,7 +377,7 @@ SUBROUTINE MATRIX_3(P,NHEL,RES) C JAMPs contributing to orders QCD=3 QED=0 JAMP(1,1) = (-1.666666666666667D-01)*AMP(3)+(-1.666666666666667D $ -01)*AMP(6) - JAMP(2,1) = ((-0.000000000000000D+00,-5.000000000000000D-01)) + JAMP(2,1) = ((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(1)+(5.000000000000000D-01)*AMP(3)+(5.000000000000000D-01) $ *AMP(12) JAMP(3,1) = ((0.000000000000000D+00,5.000000000000000D-01)) diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f index c70039fcbf..3177c76dba 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_4.f @@ -383,7 +383,7 @@ SUBROUTINE MATRIX_4(P,NHEL,RES) JAMP(3,1) = (1.666666666666667D-01)*AMP(2)+(1.666666666666667D $ -01)*AMP(11) JAMP(4,1) = (-5.000000000000000D-01)*AMP(8)+(-5.000000000000000D - $ -01)*AMP(11)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(11)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(13) C JAMPs contributing to orders QCD=1 QED=2 JAMP(1,2) = 0D0 diff --git a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f index 165aaaebc6..c8bd4a3fc4 100644 --- a/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f +++ b/tests/input_files/IOTestsComparison/IOExportFKSTest/test_pptt_fksrealew/%SubProcesses%P0_uxu_ttx%matrix_6.f @@ -381,7 +381,7 @@ SUBROUTINE MATRIX_6(P,NHEL,RES) JAMP(2,1) = (-1.666666666666667D-01)*AMP(5)+(-1.666666666666667D $ -01)*AMP(8) JAMP(3,1) = (5.000000000000000D-01)*AMP(2)+(5.000000000000000D - $ -01)*AMP(8)+((-0.000000000000000D+00,-5.000000000000000D-01)) + $ -01)*AMP(8)+((0.000000000000000D+00,-5.000000000000000D-01)) $ *AMP(10) JAMP(4,1) = (-1.666666666666667D-01)*AMP(2)+(-1.666666666666667D $ -01)*AMP(12) diff --git a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f index 2d808f950f..630ccf90d1 100644 --- a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f +++ b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/matrix.f @@ -326,7 +326,7 @@ REAL*8 FUNCTION MATRIX(P,NHEL,IC) C Amplitude(s) for diagram number 3 CALL FFV1_0(W(1,5),W(1,2),W(1,3),GQQ,AMP(3)) C JAMPs contributing to orders ALL_ORDERS=1 - JAMP(1,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(1,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+AMP(3) JAMP(2,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+AMP(2) diff --git a/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f b/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f index 5d3186b6aa..a9ebf03e70 100644 --- a/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f +++ b/tests/input_files/IOTestsComparison/MadLoop_output_from_the_interface/TIR_output/%ggttx_IOTest%SubProcesses%P0_gg_ttx%born_matrix.f @@ -324,7 +324,7 @@ SUBROUTINE ML5_0_MATRIX(P,NHEL,IC,RES) C JAMPs contributing to orders QCD=2 JAMP(1,1) = ((0.000000000000000D+00,1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(2) - JAMP(2,1) = ((-0.000000000000000D+00,-1.000000000000000D+00)) + JAMP(2,1) = ((0.000000000000000D+00,-1.000000000000000D+00)) $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) RES = 0.D0 diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f index faf1eaa847..ca8f0c821d 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_default/gg_wmtbx/born_matrix.f @@ -309,8 +309,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2) = (-1.000000000000000D+00)*AMP(5)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7)+(( - $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7) + $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f index faf1eaa847..ca8f0c821d 100644 --- a/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/long_ML_SMQCD_optimized/gg_wmtbx/born_matrix.f @@ -309,8 +309,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) $ +00)*AMP(4)+(-1.000000000000000D+00)*AMP(8) $ +((0.000000000000000D+00,1.000000000000000D+00))*TMP_JAMP(1) JAMP(2) = (-1.000000000000000D+00)*AMP(5)+(-1.000000000000000D - $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7)+(( - $ -0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) + $ +00)*AMP(6)+(-1.000000000000000D+00)*AMP(7) + $ +((0.000000000000000D+00,-1.000000000000000D+00))*TMP_JAMP(1) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f index ce14453f38..fb048249c7 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_default/gg_ttx/born_matrix.f @@ -259,8 +259,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) CALL FFV1_0(W(1,5),W(1,3),W(1,2),GC_5,AMP(3)) JAMP(1) = ((0.000000000000000D+00,1.000000000000000D+00))*AMP(1) $ +(-1.000000000000000D+00)*AMP(2) - JAMP(2) = ((-0.000000000000000D+00,-1.000000000000000D+00)) - $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) + JAMP(2) = ((0.000000000000000D+00,-1.000000000000000D+00))*AMP(1) + $ +(-1.000000000000000D+00)*AMP(3) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR diff --git a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f index ce14453f38..fb048249c7 100644 --- a/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f +++ b/tests/input_files/IOTestsComparison/short_ML_SMQCD_optimized/gg_ttx/born_matrix.f @@ -259,8 +259,8 @@ REAL*8 FUNCTION ML5_0_MATRIX(P,NHEL,IC) CALL FFV1_0(W(1,5),W(1,3),W(1,2),GC_5,AMP(3)) JAMP(1) = ((0.000000000000000D+00,1.000000000000000D+00))*AMP(1) $ +(-1.000000000000000D+00)*AMP(2) - JAMP(2) = ((-0.000000000000000D+00,-1.000000000000000D+00)) - $ *AMP(1)+(-1.000000000000000D+00)*AMP(3) + JAMP(2) = ((0.000000000000000D+00,-1.000000000000000D+00))*AMP(1) + $ +(-1.000000000000000D+00)*AMP(3) ML5_0_MATRIX = 0.D0 DO I = 1, NCOLOR From f488f0faf5abd1144dba1d0f85ad43335361e2fb Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Fri, 6 Nov 2026 21:09:50 +0100 Subject: [PATCH 44/49] final version for 3.5.18 --- UpdateNotes.txt | 22 +++++++++------------- VERSION | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/UpdateNotes.txt b/UpdateNotes.txt index 4419a6a461..5b93399fed 100644 --- a/UpdateNotes.txt +++ b/UpdateNotes.txt @@ -4,7 +4,7 @@ ANNOUNCEMENT: 2.9.X version has a LONG TERM STABLE IS now an end of life for bug fixing/support since december 2025. A new LTS (based on current 3.5.X) is starting now and will act as stable release for the coming years. -3.5.18 (XX/XX/XX): +3.5.18 (06/11/26): OM: LO: the lower bound on shat used for the phase-space integration (smin) could be too high, never generating part of the allowed phase space (cross-section too low): - ihtmin (inclusive Ht, jets+b) was attributed to the b-quarks alone, on top of the jet cuts @@ -15,19 +15,15 @@ ANNOUNCEMENT: - mmll for non same-flavour opposite-sign leptons, ptllmin without a pair to apply it to, mmnl for more than two leptons/neutrinos. OM: NLO: the real emission reused the matrix element of one helicity for another whenever the two agreed - on the first phase-space point. Some only agree when the momenta come in the c.m. frame of the real - (final-state FKS sectors), not in that of the Born (initial-state ones): helicities of massive - particles are not boost invariant. E.g. (W0,g-,g-) and (W0,g+,g+) of u d~ > w+ g g. Whether the - first point tied them was a matter of the seed; p p > w+ j [QCD] (fixed order) came out - +0.6% to +4.5% too high (u d~ > w+ g up to +25%), p p > z j [QCD] is affected the same way. - A tie is now kept only if it also holds at a Lorentz transform of the first point. + on the first few phase-space point. Some only agree when the momenta come in the c.m. frame of the real + p p > w+ j [QCD] (fixed order) came outc+0.6% to +4.5% too high (u d~ > w+ g up to +25%), + p p > z j [QCD] is affected the same way. OM: MadLoop: the helicity filter is now disabled for all 2>1 and 1>2 processes (it was for spin-2 only), - as for the tree-level standalone output. The non-optimized loop filter also keeps all amplitudes, - since it caches zeros per helicity. A particle is at rest in the c.m. frame and which helicities - vanish depends on the frame: with the filter learned in one frame, u d~ > w+ returned a virtual - 41% too low, or exactly zero, in another, flagged as stable. aMC@NLO is not affected (the virtual - always comes in the c.m. frame of the Born); a 2>1 MadLoop called outside its c.m. frame - (standalone/OLP with lab-frame momenta, reweighting with a boost or me_frame) could be. + as for the tree-level standalone output. + OM: scalefact not applied to beam 2’s μF (#454, reweight.f). This happens with fixed_fac_scale1=T, + fixed_fac_scale2=F and a dynamical scale. + OM: ktdurham/ptlund merging cut applied to decay b quarks (#455, cuts.f) even when the b was massive + OM: LHAPDF issue on mac when using homebrew (an homebrew bug) is now handle via a dedicated work-around. 3.5.17 (9/10/26): RF: Fixed a bug in FxFx merging: MG side used inclusive-kT measure, PY side used exclusive. This mismatch resulted in an diff --git a/VERSION b/VERSION index df1f03520c..af3a608526 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -version = 3.5.17 -date = 2026-10-09 +version = 3.5.18 +date = 2026-11-06 From 78b0075824b7f5a8181f65c12811af0d7c8e412e Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 9 Nov 2026 16:52:17 +0100 Subject: [PATCH 45/49] run_card: keep pdlabel user-defined when pdlabel1/2 are set internally (#481) Loop-induced processes write run_card.inc twice from the same RunCard object. During the first write, get_default('pdlabel1') fills the hidden parameter via self[name] = default, which triggered PDLabelBlock.post_set and removed 'pdlabel' from user_set. The second write then took pdlabel from run_card_default.dat (nn23lo1), so every survey job stopped with "Unknown PDLABEL nn23lo1" when running with lhapdf. Only drop pdlabel from user_set when pdlabel1/2 were actually set by the user, as FixedfacscaleBlock.post_set already does. Co-Authored-By: Claude Opus 5.5 --- madgraph/various/banner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/madgraph/various/banner.py b/madgraph/various/banner.py index 7cce580de9..53d9df32bd 100755 --- a/madgraph/various/banner.py +++ b/madgraph/various/banner.py @@ -3888,6 +3888,12 @@ def post_set_pdlabel(card, value, change_userdefine, raiseerror, **opt): def post_set(card, value, change_userdefine, raiseerror, name="unknown", **opt): """call when change to pdlabel1 or pdlabel2 --do not know which one """ + # only a user-defined pdlabel1/2 supersedes pdlabel. Internal + # assignments (e.g. get_default filling a hidden pdlabel1/2 while + # writing run_card.inc) must not drop pdlabel from user_set, otherwise + # the next write takes pdlabel from run_card_default.dat (issue 481) + if name not in card.user_set: + return if 'pdlabel' in card.user_set: card.user_set.remove('pdlabel') From 13764b1bd8d47a954356715e64452abd186d76b6 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Thu, 12 Nov 2026 00:00:33 +0100 Subject: [PATCH 46/49] Fix loop-induced madevent output with group_subprocesses=False (#486) - LoopInducedExporterMENoGroup.generate_subprocess_directory did not accept the second_exporter/second_helas keywords that export_processes always forwards, so the output crashed with a TypeError. - Once past that, matrix.f in the ungrouped P-dirs did not compile: run.inc needs VECSIZE_MEMMAX (vector.inc was not included) and select_color was called with an empty iproc argument (proc_id is '' without grouping); use iproc=1 as in the tree-level ungrouped template. - Add test_loop_induced_ggh_nogroup (ungrouped twin of test_loop_induced_ggh, same reference cross-section). Fixes #486 Co-Authored-By: Claude Opus 5.5 --- .../matrix_loop_induced_madevent.inc | 4 ++- madgraph/loop/loop_exporters.py | 8 ++++-- tests/acceptance_tests/test_cmd_madevent.py | 26 ++++++++++++++++++- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc b/madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc index 92e011b128..2b122ae91e 100644 --- a/madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc +++ b/madgraph/iolibs/template_files/matrix_loop_induced_madevent.inc @@ -21,6 +21,7 @@ C Include 'maxconfigs.inc' Include 'nexternal.inc' Include 'maxamps.inc' + Include '../../Source/vector.inc' ! defines VECSIZE_MEMMAX (needed by run.inc) include 'run.inc' INTEGER NCOMB PARAMETER ( NCOMB=%(ncomb)d) @@ -304,7 +305,8 @@ c Include the Jacobian from helicity sampling ENDIF ENDIF - call select_color(rcol, jamp2, iconfig,%(proc_id)s, icol, ivec) +C no grouping: a single matrix element per directory, so iproc=1 + call select_color(rcol, jamp2, iconfig, 1, icol, ivec) IF (MULTI_CHANNEL) THEN XTOT=0D0 diff --git a/madgraph/loop/loop_exporters.py b/madgraph/loop/loop_exporters.py index 29792921c8..66a21492eb 100755 --- a/madgraph/loop/loop_exporters.py +++ b/madgraph/loop/loop_exporters.py @@ -3627,11 +3627,15 @@ def finalize(self, *args, **opts): # care of MadLoop virtuals initialization LoopInducedExporterME.finalize(self, *args, **opts) - def generate_subprocess_directory(self, matrix_element, fortran_model, me_number): + def generate_subprocess_directory(self, matrix_element, fortran_model, me_number, + second_exporter=None, second_helas=None): """Generate the Pn directory for a subprocess group in MadEvent, including the necessary matrix_N.f files, configs.inc and various other helper files""" - + # export_processes always forwards these; no second exporter is + # supported for the loop-induced output (same as the grouped case) + assert second_exporter is None + self.unique_id += 1 # Then generate the MadLoop files calls = self.generate_loop_subprocess(matrix_element,fortran_model, diff --git a/tests/acceptance_tests/test_cmd_madevent.py b/tests/acceptance_tests/test_cmd_madevent.py index db28a596e6..f951068816 100755 --- a/tests/acceptance_tests/test_cmd_madevent.py +++ b/tests/acceptance_tests/test_cmd_madevent.py @@ -2283,7 +2283,31 @@ def test_loop_induced_ggh(self): '%s/Cards/run_card_default.dat'% self.run_dir) cmd.run_cmd('launch -f') - + + self.check_parton_output(cross=15.73, error=0.514) + + def test_loop_induced_ggh_nogroup(self): + """Same as test_loop_induced_ggh but with group_subprocesses=False, + i.e. through LoopInducedExporterMENoGroup (issue #486: the output + crashed on the second_exporter keyword)""" + + cmd = MGCmd.MasterCmd() + cmd.no_notification() + cmd.run_cmd('set automatic_html_opening False --no_save') + cmd.run_cmd('set group_subprocesses False --no_save') + cmd.run_cmd('generate g g > h QCD=0 [QCD]') + cmd.run_cmd('output madevent %s -f' % self.run_dir) + self.assertTrue(os.path.isdir(pjoin(self.run_dir, 'SubProcesses', + 'P0_gg_h'))) + #modify the run_card + run_card = banner.RunCardLO(pjoin(self.run_dir, 'Cards','run_card.dat')) + run_card['nevents'] = 100 + run_card['use_syst'] = 'F' + run_card.write('%s/Cards/run_card.dat'% self.run_dir, + '%s/Cards/run_card_default.dat'% self.run_dir) + + cmd.run_cmd('launch -f') + self.check_parton_output(cross=15.73, error=0.514) def _get_delphes_path(self): From 9945c7d8a5d0d128d544cb1033624a64c426c90b Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sat, 21 Nov 2026 00:00:31 +0100 Subject: [PATCH 47/49] LO: move DDILOG out of setrun.f into its own libpdf member setrun.o (libgeneric) defined ddilog_, as do CutTools and IREGI (qcdloop). GNU ld scans -lcts before -lgeneric, so a loop-induced madevent link that needs CutTools' ddilog.o and then setrun.o for setrun_ gets both copies: "multiple definition of `ddilog_'" (test_loop_induced_ggh_nogroup on the Linux CI; macOS ld64 hides it). DDILOG is only used by the dressed-lepton eepdf.f, so it now sits next to it in libpdf as ddilog.o, which the linker loads only when no earlier library already defines the symbol. Co-Authored-By: Claude Opus 5.5 --- Template/LO/Source/PDF/ddilog.f | 90 +++++++++++++++++++++++++++++++++ Template/LO/Source/PDF/makefile | 2 +- Template/LO/Source/setrun.f | 84 ------------------------------ 3 files changed, 91 insertions(+), 85 deletions(-) create mode 100644 Template/LO/Source/PDF/ddilog.f diff --git a/Template/LO/Source/PDF/ddilog.f b/Template/LO/Source/PDF/ddilog.f new file mode 100644 index 0000000000..f3a49ec0f1 --- /dev/null +++ b/Template/LO/Source/PDF/ddilog.f @@ -0,0 +1,90 @@ +c CERNLIB DDILOG (C332), the real dilogarithm. Used by the dressed- +c lepton densities (lep_densities/isrbet*ll/eepdf.f). +c It sits in its own member of libpdf, not in setrun.f (libgeneric): +c CutTools and IREGI (qcdloop) define the same symbol, and with GNU ld +c a loop-induced madevent link pulls both copies when ddilog is in +c setrun.o ("multiple definition of ddilog_"). As its own archive +c member it is only loaded when no earlier library defines it. + + double precision FUNCTION DDILOG(X) +* +* $Id: imp64.inc,v 1.1.1.1 1996/04/01 15:02:59 mclareni Exp $ +* +* $Log: imp64.inc,v $ +* Revision 1.1.1.1 1996/04/01 15:02:59 mclareni +* Mathlib gen +* +* +* imp64.inc +* + IMPLICIT DOUBLE PRECISION (A-H,O-Z) + DIMENSION C(0:19) + PARAMETER (Z1 = 1, HF = Z1/2) + PARAMETER (PI = 3.14159 26535 89793 24D0) + PARAMETER (PI3 = PI**2/3, PI6 = PI**2/6, PI12 = PI**2/12) + DATA C( 0) / 0.42996 69356 08136 97D0/ + DATA C( 1) / 0.40975 98753 30771 05D0/ + DATA C( 2) /-0.01858 84366 50145 92D0/ + DATA C( 3) / 0.00145 75108 40622 68D0/ + DATA C( 4) /-0.00014 30418 44423 40D0/ + DATA C( 5) / 0.00001 58841 55418 80D0/ + DATA C( 6) /-0.00000 19078 49593 87D0/ + DATA C( 7) / 0.00000 02419 51808 54D0/ + DATA C( 8) /-0.00000 00319 33412 74D0/ + DATA C( 9) / 0.00000 00043 45450 63D0/ + DATA C(10) /-0.00000 00006 05784 80D0/ + DATA C(11) / 0.00000 00000 86120 98D0/ + DATA C(12) /-0.00000 00000 12443 32D0/ + DATA C(13) / 0.00000 00000 01822 56D0/ + DATA C(14) /-0.00000 00000 00270 07D0/ + DATA C(15) / 0.00000 00000 00040 42D0/ + DATA C(16) /-0.00000 00000 00006 10D0/ + DATA C(17) / 0.00000 00000 00000 93D0/ + DATA C(18) /-0.00000 00000 00000 14D0/ + DATA C(19) /+0.00000 00000 00000 02D0/ + IF(X .EQ. 1) THEN + H=PI6 + ELSEIF(X .EQ. -1) THEN + H=-PI12 + ELSE + T=-X + IF(T .LE. -2) THEN + Y=-1/(1+T) + S=1 + A=-PI3+HF*(LOG(-T)**2-LOG(1+1/T)**2) + ELSEIF(T .LT. -1) THEN + Y=-1-T + S=-1 + A=LOG(-T) + A=-PI6+A*(A+LOG(1+1/T)) + ELSE IF(T .LE. -HF) THEN + Y=-(1+T)/T + S=1 + A=LOG(-T) + A=-PI6+A*(-HF*A+LOG(1+T)) + ELSE IF(T .LT. 0) THEN + Y=-T/(1+T) + S=-1 + A=HF*LOG(1+T)**2 + ELSE IF(T .LE. 1) THEN + Y=T + S=1 + A=0 + ELSE + Y=1/T + S=-1 + A=PI6+HF*LOG(T)**2 + ENDIF + H=Y+Y-1 + ALFA=H+H + B1=0 + B2=0 + DO 1 I = 19,0,-1 + B0=C(I)+ALFA*B1-B2 + B2=B1 + 1 B1=B0 + H=-(S*(B0-H*B2)+A) + ENDIF + DDILOG=H + RETURN + END diff --git a/Template/LO/Source/PDF/makefile b/Template/LO/Source/PDF/makefile index f1aeae4915..c4a3ac6ab9 100644 --- a/Template/LO/Source/PDF/makefile +++ b/Template/LO/Source/PDF/makefile @@ -46,7 +46,7 @@ ifdef lhapdf endif else TOREMOVE += pdfwrap_lhapdf.o - PDF += Ctq6Pdf.o pdfwrap.o pdf.o pdg2pdf.o NNPDFDriver.o eepdf.o gridpdfaux.o dfint.o kerset.o + PDF += Ctq6Pdf.o pdfwrap.o pdf.o pdg2pdf.o NNPDFDriver.o eepdf.o ddilog.o gridpdfaux.o dfint.o kerset.o endif diff --git a/Template/LO/Source/setrun.f b/Template/LO/Source/setrun.f index 2190163c1d..6bf8bf5730 100644 --- a/Template/LO/Source/setrun.f +++ b/Template/LO/Source/setrun.f @@ -298,87 +298,3 @@ subroutine get_pdfup(pdfin,pdfgup,pdfsup,lhaid) return end - - - double precision FUNCTION DDILOG(X) -* -* $Id: imp64.inc,v 1.1.1.1 1996/04/01 15:02:59 mclareni Exp $ -* -* $Log: imp64.inc,v $ -* Revision 1.1.1.1 1996/04/01 15:02:59 mclareni -* Mathlib gen -* -* -* imp64.inc -* - IMPLICIT DOUBLE PRECISION (A-H,O-Z) - DIMENSION C(0:19) - PARAMETER (Z1 = 1, HF = Z1/2) - PARAMETER (PI = 3.14159 26535 89793 24D0) - PARAMETER (PI3 = PI**2/3, PI6 = PI**2/6, PI12 = PI**2/12) - DATA C( 0) / 0.42996 69356 08136 97D0/ - DATA C( 1) / 0.40975 98753 30771 05D0/ - DATA C( 2) /-0.01858 84366 50145 92D0/ - DATA C( 3) / 0.00145 75108 40622 68D0/ - DATA C( 4) /-0.00014 30418 44423 40D0/ - DATA C( 5) / 0.00001 58841 55418 80D0/ - DATA C( 6) /-0.00000 19078 49593 87D0/ - DATA C( 7) / 0.00000 02419 51808 54D0/ - DATA C( 8) /-0.00000 00319 33412 74D0/ - DATA C( 9) / 0.00000 00043 45450 63D0/ - DATA C(10) /-0.00000 00006 05784 80D0/ - DATA C(11) / 0.00000 00000 86120 98D0/ - DATA C(12) /-0.00000 00000 12443 32D0/ - DATA C(13) / 0.00000 00000 01822 56D0/ - DATA C(14) /-0.00000 00000 00270 07D0/ - DATA C(15) / 0.00000 00000 00040 42D0/ - DATA C(16) /-0.00000 00000 00006 10D0/ - DATA C(17) / 0.00000 00000 00000 93D0/ - DATA C(18) /-0.00000 00000 00000 14D0/ - DATA C(19) /+0.00000 00000 00000 02D0/ - IF(X .EQ. 1) THEN - H=PI6 - ELSEIF(X .EQ. -1) THEN - H=-PI12 - ELSE - T=-X - IF(T .LE. -2) THEN - Y=-1/(1+T) - S=1 - A=-PI3+HF*(LOG(-T)**2-LOG(1+1/T)**2) - ELSEIF(T .LT. -1) THEN - Y=-1-T - S=-1 - A=LOG(-T) - A=-PI6+A*(A+LOG(1+1/T)) - ELSE IF(T .LE. -HF) THEN - Y=-(1+T)/T - S=1 - A=LOG(-T) - A=-PI6+A*(-HF*A+LOG(1+T)) - ELSE IF(T .LT. 0) THEN - Y=-T/(1+T) - S=-1 - A=HF*LOG(1+T)**2 - ELSE IF(T .LE. 1) THEN - Y=T - S=1 - A=0 - ELSE - Y=1/T - S=-1 - A=PI6+HF*LOG(T)**2 - ENDIF - H=Y+Y-1 - ALFA=H+H - B1=0 - B2=0 - DO 1 I = 19,0,-1 - B0=C(I)+ALFA*B1-B2 - B2=B1 - 1 B1=B0 - H=-(S*(B0-H*B2)+A) - ENDIF - DDILOG=H - RETURN - END From 5bff77d87ee8d402a57cbcc178fcccff70872e4a Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sat, 21 Nov 2026 00:05:45 +0100 Subject: [PATCH 48/49] IOTest: nogroup auto_dsig.f golden for the symfact fix DSIG = NFACT is now set after CLOSE(LUN) and on the symfact.dat error path (from mg5 3.8.2's auto_dsig_v4.inc). Co-Authored-By: Claude Opus 5.5 --- .../export_matrix_element_v4_madevent_nogroup/auto_dsig.f | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f index 9785d27784..d3929dcbaa 100644 --- a/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f +++ b/tests/input_files/IOTestsComparison/IOExportV4IOTest/export_matrix_element_v4_madevent_nogroup/auto_dsig.f @@ -153,10 +153,11 @@ DOUBLE PRECISION FUNCTION DSIG(PP,IFLAV,WGT,IMODE) NFACT=IFACT ENDIF ENDDO - DSIG = NFACT 10 CLOSE(LUN) + DSIG = NFACT RETURN 20 WRITE(*,*)'Error opening symfact.dat. No symmetry factor used.' + DSIG = NFACT RETURN ENDIF C Continue only if IMODE is 0, 4 or 5 From 8ec8ae7597adc9787d51827b5254a57ae179f803 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Sat, 21 Nov 2026 07:02:23 +0100 Subject: [PATCH 49/49] CI: run the IOTests on pull requests, drafts included IOtest.yml ran only on pushes to main or by hand, so a PR that changes generated code got no IOTest run before it was merged. It now follows the unittest rule: pull_request events (opened, synchronize, reopened, ready_for_review, converted_to_draft), every job runs for any PR, draft or not, and each job ends with the fail-fast step that cancels the other runs of the commit unless the PR carries the run-ci label. The notice posted on new PRs says that drafts run unittest and IOtest. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/IOtest.yml | 62 ++++++++++++++++++++++++++++++ .github/workflows/pr-ci-notice.yml | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/.github/workflows/IOtest.yml b/.github/workflows/IOtest.yml index 3e16fe40db..de116a9347 100644 --- a/.github/workflows/IOtest.yml +++ b/.github/workflows/IOtest.yml @@ -3,6 +3,8 @@ name: running IOTests on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] push: # main only: other branches run through workflow_dispatch branches: @@ -44,6 +46,7 @@ jobs: # Runs on the self-hosted alma10 runners (cern1, ...) to spare the hosted queue; # fork PRs stay on ubuntu-24.04 so outside code never runs on our machines. runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-24.04' || fromJSON('["self-hosted", "alma10"]') }} + if: ${{ (github.event_name != 'pull_request' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == true)) || (github.event_name == 'pull_request') }} steps: - uses: actions/checkout@v5 - uses: ./.github/actions/clean_tmp @@ -104,12 +107,27 @@ jobs: # Leave /tmp empty for the next job on this self-hosted machine. - if: always() uses: ./.github/actions/clean_tmp + - name: Cancel the other CI runs of this commit (fail fast) + if: ${{ failure() && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-ci') }} + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + RUN_ID: ${{ github.run_id }} + run: | + gh run list --repo "$REPO" --commit "$HEAD_SHA" --event pull_request --limit 300 \ + --json databaseId,status --jq '.[] | select(.status != "completed") | .databaseId' | + while read -r id; do + [ "$id" = "$RUN_ID" ] || gh run cancel "$id" --repo "$REPO" || true + done + gh run cancel "$RUN_ID" --repo "$REPO" || true # Loop squared-order IOTest – needs UFO model cache (from unittest_29) IOtest_loop_sqso: # Runs on the self-hosted alma10 runners (cern1, ...) to spare the hosted queue; # fork PRs stay on ubuntu-24.04 so outside code never runs on our machines. runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-24.04' || fromJSON('["self-hosted", "alma10"]') }} + if: ${{ (github.event_name != 'pull_request' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == true)) || (github.event_name == 'pull_request') }} steps: - uses: actions/checkout@v5 - uses: ./.github/actions/clean_tmp @@ -127,12 +145,27 @@ jobs: # Leave /tmp empty for the next job on this self-hosted machine. - if: always() uses: ./.github/actions/clean_tmp + - name: Cancel the other CI runs of this commit (fail fast) + if: ${{ failure() && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-ci') }} + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + RUN_ID: ${{ github.run_id }} + run: | + gh run list --repo "$REPO" --commit "$HEAD_SHA" --event pull_request --limit 300 \ + --json databaseId,status --jq '.[] | select(.status != "completed") | .databaseId' | + while read -r id; do + [ "$id" = "$RUN_ID" ] || gh run cancel "$id" --repo "$REPO" || true + done + gh run cancel "$RUN_ID" --repo "$REPO" || true IOtest_bundle_2: # merged jobs, run one after the other: IOtest_bundle_2 IOtest_bundle_3 # Each keeps its own steps, run even when an earlier one failed; one # job restores the caches once instead of once per former job. runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-24.04' || fromJSON('["self-hosted", "alma10", "large"]') }} + if: ${{ (github.event_name != 'pull_request' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == true)) || (github.event_name == 'pull_request') }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/clean_tmp @@ -184,12 +217,27 @@ jobs: # Leave /tmp empty for the next job on this self-hosted machine. - if: always() uses: ./.github/actions/clean_tmp + - name: Cancel the other CI runs of this commit (fail fast) + if: ${{ failure() && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-ci') }} + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + RUN_ID: ${{ github.run_id }} + run: | + gh run list --repo "$REPO" --commit "$HEAD_SHA" --event pull_request --limit 300 \ + --json databaseId,status --jq '.[] | select(.status != "completed") | .databaseId' | + while read -r id; do + [ "$id" = "$RUN_ID" ] || gh run cancel "$id" --repo "$REPO" || true + done + gh run cancel "$RUN_ID" --repo "$REPO" || true # Gnuplot histogram output IOTest (from acceptancetest_100) IOtest_gnuplot: # Runs on the self-hosted alma10 runners (cern1, ...) to spare the hosted queue; # fork PRs stay on ubuntu-24.04 so outside code never runs on our machines. runs-on: ${{ github.event.pull_request.head.repo.fork && 'ubuntu-24.04' || fromJSON('["self-hosted", "alma10"]') }} + if: ${{ (github.event_name != 'pull_request' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.fork == true)) || (github.event_name == 'pull_request') }} steps: - uses: actions/checkout@v4 - uses: ./.github/actions/clean_tmp @@ -203,3 +251,17 @@ jobs: # Leave /tmp empty for the next job on this self-hosted machine. - if: always() uses: ./.github/actions/clean_tmp + - name: Cancel the other CI runs of this commit (fail fast) + if: ${{ failure() && github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-ci') }} + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + RUN_ID: ${{ github.run_id }} + run: | + gh run list --repo "$REPO" --commit "$HEAD_SHA" --event pull_request --limit 300 \ + --json databaseId,status --jq '.[] | select(.status != "completed") | .databaseId' | + while read -r id; do + [ "$id" = "$RUN_ID" ] || gh run cancel "$id" --repo "$REPO" || true + done + gh run cancel "$RUN_ID" --repo "$REPO" || true diff --git a/.github/workflows/pr-ci-notice.yml b/.github/workflows/pr-ci-notice.yml index f5f125eb6f..473572dca6 100644 --- a/.github/workflows/pr-ci-notice.yml +++ b/.github/workflows/pr-ci-notice.yml @@ -26,7 +26,7 @@ jobs: ### How CI reacts to this PR - **Not a draft:** the full CI runs automatically when the PR is opened and on every push. - - **Draft:** only the `unittest` workflow runs. Mark the PR "Ready for review" to start the full CI. + - **Draft:** only the `unittest` and `IOtest` workflows run. Mark the PR "Ready for review" to start the full CI. - **`run-ci` label:** while this label is on the PR, every job keeps running after a failure, so you see all failures. Without it, the first failing job cancels the other runs of that commit. - **Closing or merging:** the unfinished CI runs of this PR are cancelled. A merge gets its own run on `main`. - **Pushes to `main`:** the full CI runs after each merge.