~maddevelopers/mg5amcnlo/simple_unlops

« back to all changes in this revision

Viewing changes to Template/NLO/SubProcesses/symmetry_fks_test_ME.f.THIS

  • Committer: olivier-mattelaer
  • Date: 2021-11-12 09:29:31 UTC
  • mfrom: (967.1.15 3.3.0)
  • Revision ID: olivier-mattelaer-20211112092931-4ec9qfzgxkeovqog
versionĀ 3.3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
      program symmetry
2
 
c*****************************************************************************
3
 
c     Given identical particles, and the configurations. This program identifies
4
 
c     identical configurations and specifies which ones can be skipped
5
 
c*****************************************************************************
6
 
      implicit none
7
 
c
8
 
c     Constants
9
 
c
10
 
      include 'genps.inc'      
11
 
      include 'nexternal.inc'
12
 
      include '../../Source/run_config.inc'
13
 
      include 'nFKSconfigs.inc'
14
 
      include 'fks_info.inc'
15
 
      include 'run.inc'
16
 
      include 'cuts.inc'
17
 
      include 'mint.inc'
18
 
      
19
 
      double precision ZERO,one
20
 
      parameter       (ZERO = 0d0)
21
 
      parameter       (one = 1d0)
22
 
      integer   maxswitch
23
 
      parameter(maxswitch=99)
24
 
c
25
 
c     Local
26
 
c
27
 
      integer itree(2,-max_branch:-1)
28
 
      integer imatch
29
 
      integer i,j, k, n, nsym,l,ii,jj
30
 
      double precision diff,xi_i_fks
31
 
      double precision pmass(nexternal)
32
 
 
33
 
      integer biforest(2,-max_branch:-1,lmaxconfigs)
34
 
      integer fksmother,fksgrandmother,fksaunt,compare
35
 
      integer fksconfiguration,mapbconf(0:lmaxconfigs)
36
 
      integer r2b(lmaxconfigs),b2r(lmaxconfigs)
37
 
      logical searchforgranny,is_beta_cms,is_granny_sch,topdown,non_prop
38
 
      integer nbranch,ns_channel,nt_channel
39
 
c      include "fks.inc"
40
 
      integer fks_j_from_i(nexternal,0:nexternal)
41
 
     &     ,particle_type(nexternal),pdg_type(nexternal)
42
 
      common /c_fks_inc/fks_j_from_i,particle_type,pdg_type
43
 
      double precision fxl(15),wfxl(15),limit(15),wlimit(15)
44
 
      double precision lxp(15,0:3,nexternal+1),xp(15,0:3,nexternal+1)
45
 
      double precision fks_Sij
46
 
      double precision check,tolerance,zh,h_damp
47
 
      parameter (tolerance=1.d-4)
48
 
      integer kk,ll,bs,bs_min,bs_max,iconfig_in
49
 
 
50
 
      integer nsofttests,ncolltests,nerr,imax,iflag,iret
51
 
c
52
 
c     Local for generating amps
53
 
c
54
 
      double precision p(0:3,99), wgt, x(99), fx
55
 
      double complex wgt1(2)
56
 
      double precision p1(0:3,99),xx(maxinvar)
57
 
      integer ninvar, ndim,  minconfig, maxconfig
58
 
      common/tosigint/ndim
59
 
      integer ncall,itmax,nconfigs,ntry, ngraphs
60
 
      integer ic(nexternal,maxswitch), jc(12),nswitch
61
 
      double precision saveamp(maxamps)
62
 
      integer nmatch, ibase
63
 
      logical mtc, even
64
 
 
65
 
      double precision totmass
66
 
 
67
 
      double precision xi_i_fks_fix_save,y_ij_fks_fix_save
68
 
      double precision xi_i_fks_fix,y_ij_fks_fix
69
 
      common/cxiyfix/xi_i_fks_fix,y_ij_fks_fix
70
 
c
71
 
c     Global
72
 
c
73
 
      Double Precision amp2(maxamps), jamp2(0:maxamps)
74
 
      common/to_amps/  amp2,       jamp2
75
 
      include 'coupl.inc'
76
 
 
77
 
      logical calculatedBorn
78
 
      common/ccalculatedBorn/calculatedBorn
79
 
 
80
 
      integer i_fks,j_fks
81
 
      common/fks_indices/i_fks,j_fks
82
 
 
83
 
      double precision p1_cnt(0:3,nexternal,-2:2)
84
 
      double precision wgt_cnt(-2:2)
85
 
      double precision pswgt_cnt(-2:2)
86
 
      double precision jac_cnt(-2:2)
87
 
      common/counterevnts/p1_cnt,wgt_cnt,pswgt_cnt,jac_cnt
88
 
 
89
 
      double precision p_born(0:3,nexternal-1)
90
 
      common/pborn/p_born
91
 
 
92
 
      double precision xi_i_fks_ev,y_ij_fks_ev
93
 
      double precision p_i_fks_ev(0:3),p_i_fks_cnt(0:3,-2:2)
94
 
      common/fksvariables/xi_i_fks_ev,y_ij_fks_ev,p_i_fks_ev,p_i_fks_cnt
95
 
 
96
 
      double precision xi_i_fks_cnt(-2:2)
97
 
      common /cxiifkscnt/xi_i_fks_cnt
98
 
 
99
 
      logical rotategranny
100
 
      common/crotategranny/rotategranny
101
 
 
102
 
      logical softtest,colltest
103
 
      common/sctests/softtest,colltest
104
 
      
105
 
      logical xexternal
106
 
      common /toxexternal/ xexternal
107
 
 
108
 
c Particle types (=color) of i_fks, j_fks and fks_mother
109
 
      integer i_type,j_type,m_type
110
 
      double precision ch_i,ch_j,ch_m
111
 
      common/cparticle_types/i_type,j_type,m_type,ch_i,ch_j,ch_m
112
 
      double precision particle_charge(nexternal), particle_charge_born(nexternal-1)
113
 
      common /c_charges/particle_charge
114
 
      common /c_charges_born/particle_charge_born
115
 
 
116
 
c
117
 
c     External
118
 
c
119
 
      logical check_swap
120
 
      double precision dsig,ran2
121
 
      external dsig,ran2
122
 
      external check_swap, fks_Sij
123
 
 
124
 
c define here the maximum fraction of failures to consider the test
125
 
c   passed
126
 
      double precision max_fail, fail_frac
127
 
      parameter (max_fail=0.3d0)
128
 
 
129
 
c helicity stuff
130
 
      integer          isum_hel
131
 
      logical                    multi_channel
132
 
      common/to_matrix/isum_hel, multi_channel
133
 
 
134
 
      integer fks_conf_number,fks_loop_min,fks_loop_max,fks_loop
135
 
      INTEGER NFKSPROCESS
136
 
      COMMON/C_NFKSPROCESS/NFKSPROCESS
137
 
 
138
 
C split orders stuff
139
 
      include 'orders.inc'
140
 
      integer iamp
141
 
      integer orders(nsplitorders)
142
 
      double precision fxl_split(15,amp_split_size),wfxl_split(15,amp_split_size)
143
 
      double precision limit_split(15,amp_split_size), wlimit_split(15,amp_split_size)
144
 
 
145
 
c born configuration stuff
146
 
      include 'born_ngraphs.inc'
147
 
      include 'born_conf.inc'
148
 
      LOGICAL  IS_A_J(NEXTERNAL),IS_A_LP(NEXTERNAL),IS_A_LM(NEXTERNAL)
149
 
      LOGICAL  IS_A_PH(NEXTERNAL)
150
 
      COMMON /TO_SPECISA/IS_A_J,IS_A_LP,IS_A_LM,IS_A_PH
151
 
      
152
 
      logical new_point
153
 
      common /c_new_point/new_point
154
 
c      integer icomp
155
 
c-----
156
 
c  Begin Code
157
 
c-----
158
 
      if (fks_configs.eq.1) then
159
 
         if (pdg_type_d(1,fks_i_d(1)).eq.-21) then
160
 
            write (*,*) 'Process generated with [LOonly=QCD]. '/
161
 
     $           /'No tests to do.'
162
 
            return
163
 
         endif
164
 
      endif
165
 
 
166
 
      write(*,*)'Enter xi_i, y_ij to be used in coll/soft tests'
167
 
      write(*,*)' Enter -2 to generate them randomly'
168
 
      read(*,*)xi_i_fks_fix_save,y_ij_fks_fix_save
169
 
 
170
 
      write(*,*)'Enter number of tests for soft and collinear limits'
171
 
      read(*,*)nsofttests,ncolltests
172
 
 
173
 
      write(*,*)'Sum over helicity (0), or random helicity (1)'
174
 
      read(*,*) isum_hel
175
 
 
176
 
      call setrun                !Sets up run parameters
177
 
      call setpara('param_card.dat')   !Sets up couplings and masses
178
 
      call setcuts               !Sets up cuts 
179
 
 
180
 
c When doing hadron-hadron collision reduce the effect collision energy.
181
 
c Note that tests are always performed at fixed energy with Bjorken x=1.
182
 
      totmass = 0.0d0
183
 
      include 'pmass.inc' ! make sure to set the masses after the model has been included
184
 
      do i=nincoming+1,nexternal
185
 
         if (is_a_j(i) .and. i.ne.nexternal) then
186
 
            totmass = totmass + max(ptj,pmass(i))
187
 
         elseif ((is_a_lp(i).or.is_a_lm(i)) .and. i.ne.nexternal) then
188
 
            totmass = totmass + max(mll/2d0,mll_sf/2d0,ptl,pmass(i))
189
 
         else
190
 
            totmass = totmass + pmass(i)
191
 
         endif
192
 
      enddo
193
 
      if (lpp(1).ne.0) ebeam(1)=max(ebeam(1)/20d0,totmass)
194
 
      if (lpp(2).ne.0) ebeam(2)=max(ebeam(2)/20d0,totmass)
195
 
c
196
 
 
197
 
      write (*,*) 'Give FKS configuration number ("0" loops over all)'
198
 
      read (*,*) fks_conf_number
199
 
 
200
 
      if (fks_conf_number.eq.0) then
201
 
         fks_loop_min=1
202
 
         fks_loop_max=fks_configs
203
 
      else
204
 
         fks_loop_min=fks_conf_number
205
 
         fks_loop_max=fks_conf_number
206
 
      endif
207
 
 
208
 
      do fks_loop=fks_loop_min,fks_loop_max
209
 
         nFKSprocess=fks_loop
210
 
         write (*,*) ''
211
 
         write (*,*) '================================================='
212
 
         write (*,*) ''
213
 
         write (*,*) 'NEW FKS CONFIGURATION:'
214
 
 
215
 
         call fks_inc_chooser()
216
 
         call leshouche_inc_chooser()
217
 
         write (*,*) 'FKS configuration number is ',nFKSprocess
218
 
         write (*,*) 'FKS partons are: i=',i_fks,'  j=',j_fks
219
 
         write (*,*) 'with PDGs:       i=',PDG_type(i_fks),'  j='
220
 
     $        ,PDG_type(j_fks)
221
 
 
222
 
c
223
 
      ndim = 55
224
 
      ncall = 10000
225
 
      itmax = 10
226
 
      ninvar = 35
227
 
      nconfigs = 1
228
 
 
229
 
c Set color types of i_fks, j_fks and fks_mother.
230
 
      i_type=particle_type(i_fks)
231
 
      j_type=particle_type(j_fks)
232
 
      ch_i=particle_charge(i_fks)
233
 
      ch_j=particle_charge(j_fks)
234
 
      call get_mother_col_charge(i_type,ch_i,j_type,ch_j,m_type,ch_m) 
235
 
 
236
 
 
237
 
c     
238
 
c     Get momentum configuration
239
 
c
240
 
 
241
 
c Set xexternal to true to use the x's from external vegas in the
242
 
c x_to_f_arg subroutine
243
 
      xexternal=.true.
244
 
      
245
 
      write(*,*)'  '
246
 
      write(*,*)'  '
247
 
      write(*,*)'Enter graph number (iconfig), '
248
 
     &     //"'0' loops over all graphs"
249
 
      read(*,*)iconfig_in
250
 
      
251
 
      if (iconfig_in.eq.0) then
252
 
         bs_min=1
253
 
         bs_max=mapconfig(0)
254
 
      elseif (iconfig_in.eq.-1) then
255
 
         bs_min=1
256
 
         bs_max=1
257
 
      else
258
 
         bs_min=iconfig_in
259
 
         bs_max=iconfig_in
260
 
      endif
261
 
 
262
 
      do iconfig=bs_min,bs_max  ! Born configurations
263
 
         ichan=1
264
 
         iconfigs(1)=iconfig
265
 
      call setcuts
266
 
      call setfksfactor(.false.)
267
 
      wgt=1d0
268
 
      ntry=1
269
 
 
270
 
      softtest=.false.
271
 
      colltest=.false.
272
 
 
273
 
      do jj=1,ndim
274
 
         x(jj)=ran2()
275
 
      enddo
276
 
      new_point=.true.
277
 
      call generate_momenta(ndim,iconfig,wgt,x,p)
278
 
      calculatedBorn=.false.
279
 
      do while (( wgt.lt.0 .or. p(0,1).le.0d0 .or. p_born(0,1).le.0d0
280
 
     &           ) .and. ntry .lt. 1000)
281
 
         do jj=1,ndim
282
 
            x(jj)=ran2()
283
 
         enddo
284
 
         new_point=.true.
285
 
         wgt=1d0
286
 
         call generate_momenta(ndim,iconfig,wgt,x,p)
287
 
         calculatedBorn=.false.
288
 
         ntry=ntry+1
289
 
      enddo
290
 
 
291
 
      if (ntry.ge.1000) then
292
 
         write (*,*) 'No points passed cuts...'
293
 
         write (12,*) 'ERROR: no points passed cuts...'
294
 
     &        //' Cannot perform ME tests properly for config',iconfig
295
 
         exit
296
 
      endif
297
 
 
298
 
      call sborn(p_born,wgt1)
299
 
      
300
 
      write (*,*) ''
301
 
      write (*,*) ''
302
 
      write (*,*) ''
303
 
 
304
 
      softtest=.true.
305
 
      colltest=.false.
306
 
      nerr=0
307
 
      imax=14
308
 
      do j=1,nsofttests
309
 
      call get_helicity(i_fks,j_fks)
310
 
         do iamp=1,amp_split_size
311
 
            do i = 1,imax
312
 
               fxl_split(i,iamp) = 0d0
313
 
               wfxl_split(i,iamp) = 0d0
314
 
               limit_split(i,iamp) = 0d0
315
 
               wlimit_split(i,iamp) = 0d0
316
 
            enddo
317
 
         enddo
318
 
 
319
 
         if(nsofttests.le.10)then
320
 
           write (*,*) ' '
321
 
           write (*,*) ' '
322
 
         endif
323
 
 
324
 
         y_ij_fks_fix=y_ij_fks_fix_save
325
 
         xi_i_fks_fix=0.1d0
326
 
         ntry=1
327
 
         wgt=1d0
328
 
         do jj=1,ndim
329
 
            x(jj)=ran2()
330
 
         enddo
331
 
         new_point=.true.
332
 
         call generate_momenta(ndim,iconfig,wgt,x,p)
333
 
         do while (( wgt.lt.0 .or. p(0,1).le.0d0) .and. ntry.lt.1000)
334
 
            wgt=1d0
335
 
            do jj=1,ndim
336
 
               x(jj)=ran2()
337
 
            enddo
338
 
            new_point=.true.
339
 
            call generate_momenta(ndim,iconfig,wgt,x,p)
340
 
            ntry=ntry+1
341
 
         enddo
342
 
         if(nsofttests.le.10)write (*,*) 'ntry',ntry
343
 
         do i=1,imax
344
 
            wgt=1d0
345
 
            call generate_momenta(ndim,iconfig,wgt,x,p)
346
 
            calculatedBorn=.false.
347
 
            call set_cms_stuff(0)
348
 
            call sreal(p1_cnt(0,1,0),zero,y_ij_fks_ev,fx)
349
 
            fxl(i)=fx*wgt
350
 
            wfxl(i)=jac_cnt(0)
351
 
! keep track of the separate splitorders
352
 
            do iamp=1,amp_split_size
353
 
               fxl_split(i,iamp) = amp_split(iamp)*jac_cnt(0)
354
 
               wfxl_split(i,iamp)=jac_cnt(0)
355
 
            enddo
356
 
            calculatedBorn=.false.
357
 
            call set_cms_stuff(-100)
358
 
            call sreal(p,xi_i_fks_ev,y_ij_fks_ev,fx)
359
 
            limit(i)=fx*wgt
360
 
            wlimit(i)=wgt
361
 
         ! keep track of the separate splitorders
362
 
            do iamp=1,amp_split_size
363
 
               limit_split(i,iamp) = amp_split(iamp)*wgt
364
 
               wlimit_split(i,iamp) = wgt
365
 
            enddo
366
 
            do k=1,nexternal
367
 
               do l=0,3
368
 
                  xp(i,l,k)=p(l,k)
369
 
                  lxp(i,l,k)=p1_cnt(l,k,0)
370
 
               enddo
371
 
            enddo
372
 
            do l=0,3
373
 
               xp(i,l,nexternal+1)=p_i_fks_ev(l)
374
 
               lxp(i,l,nexternal+1)=p_i_fks_cnt(l,0)
375
 
            enddo
376
 
            xi_i_fks_fix=xi_i_fks_fix/10d0
377
 
         enddo
378
 
 
379
 
         if(nsofttests.le.10)then
380
 
           write (*,*) 'Soft limit:'
381
 
           write (*,*) '   Sum of all contributions:'
382
 
           do i=1,imax
383
 
              call xprintout(6,limit(i),fxl(i))
384
 
           enddo
385
 
           ! check the contributions coming from each splitorders
386
 
           ! only look at the non vanishing ones
387
 
           do iamp=1, amp_split_size
388
 
             if (limit_split(1,iamp).ne.0d0.or.fxl_split(1,iamp).ne.0d0) then
389
 
               write(*,*) '   Split-order', iamp
390
 
               call amp_split_pos_to_orders(iamp,orders)
391
 
               do i = 1, nsplitorders
392
 
                  write(*,*) '      ',ordernames(i), ':', orders(i)
393
 
               enddo
394
 
               do i=1,imax
395
 
                  call xprintout(6,limit_split(i,iamp),fxl_split(i,iamp))
396
 
               enddo
397
 
               call checkres2(limit_split(1,iamp),fxl_split(1,iamp),
398
 
     &                   wlimit_split(1,iamp),wfxl_split(1,iamp),xp,lxp,
399
 
     &                   iflag,imax,j,nexternal,i_fks,j_fks,iret)
400
 
               write(*,*) 'RETURN CODE', iret
401
 
             endif
402
 
           enddo
403
 
           
404
 
c
405
 
           write(80,*)'  '
406
 
           write(80,*)'****************************'
407
 
           write(80,*)'  '
408
 
           do k=1,nexternal+1
409
 
              write(80,*)''
410
 
              write(80,*)'part:',k
411
 
              do l=0,3
412
 
                 write(80,*)'comp:',l
413
 
                 do i=1,10
414
 
                    call xprintout(80,xp(i,l,k),lxp(i,l,k))
415
 
                 enddo
416
 
              enddo
417
 
           enddo
418
 
        else
419
 
           iflag=0
420
 
           call checkres2(limit,fxl,wlimit,wfxl,xp,lxp,
421
 
     &                   iflag,imax,j,nexternal,i_fks,j_fks,iret)
422
 
           nerr=nerr+iret
423
 
           ! check the contributions coming from each splitorders
424
 
           ! only look at the non vanishing ones
425
 
           do iamp=1, amp_split_size
426
 
             if (limit_split(1,iamp).ne.0d0.or.fxl_split(1,iamp).ne.0d0) then
427
 
               call checkres2(limit_split(1,iamp),fxl_split(1,iamp),
428
 
     &                   wlimit_split(1,iamp),wfxl_split(1,iamp),xp,lxp,
429
 
     &                   iflag,imax,j,nexternal,i_fks,j_fks,iret)
430
 
               nerr=nerr+iret
431
 
             endif
432
 
           enddo
433
 
        endif
434
 
 
435
 
      enddo
436
 
      if(nsofttests.gt.10)then
437
 
         write(*,*)'Soft tests done for (Born) config',iconfig
438
 
         write(*,*)'Failures:',nerr
439
 
         fail_frac= nerr/dble(nsofttests)
440
 
         if (fail_frac.lt.max_fail) then
441
 
             write(*,401) nFKSprocess, fail_frac
442
 
         else
443
 
             write(*,402) nFKSprocess, fail_frac
444
 
         endif
445
 
      endif
446
 
 
447
 
      write (*,*) ''
448
 
      write (*,*) ''
449
 
      write (*,*) ''
450
 
      
451
 
      include 'pmass.inc'
452
 
 
453
 
      if (pmass(j_fks).ne.0d0) then
454
 
         write (*,*) 'No collinear test for massive j_fks'
455
 
         goto 123
456
 
      endif
457
 
 
458
 
      softtest=.false.
459
 
      colltest=.true.
460
 
 
461
 
c Set rotategranny=.true. to align grandmother along the z axis, when 
462
 
c grandmother is not the c.m. system (if granny=cms, this rotation coincides
463
 
c with the identity, and the following is harmless).
464
 
c WARNING: the setting of rotategranny changes the definition of xij_aor
465
 
c in genps_fks_test.f
466
 
      rotategranny=.false.
467
 
 
468
 
      nerr=0
469
 
      imax=14
470
 
      do j=1,ncolltests
471
 
         call get_helicity(i_fks,j_fks)
472
 
         do iamp=1,amp_split_size
473
 
            do i = 1,imax
474
 
               fxl_split(i,iamp) = 0d0
475
 
               wfxl_split(i,iamp) = 0d0
476
 
               limit_split(i,iamp) = 0d0
477
 
               wlimit_split(i,iamp) = 0d0
478
 
            enddo
479
 
         enddo
480
 
 
481
 
         if(ncolltests.le.10)then
482
 
            write (*,*) ' '
483
 
            write (*,*) ' '
484
 
         endif
485
 
 
486
 
         y_ij_fks_fix=0.9d0
487
 
         xi_i_fks_fix=xi_i_fks_fix_save
488
 
         ntry=1
489
 
         wgt=1d0
490
 
         do jj=1,ndim
491
 
            x(jj)=ran2()
492
 
         enddo
493
 
         new_point=.true.
494
 
         call generate_momenta(ndim,iconfig,wgt,x,p)
495
 
         do while (( wgt.lt.0 .or. p(0,1).le.0d0) .and. ntry.lt.1000)
496
 
            wgt=1d0
497
 
            do jj=1,ndim
498
 
               x(jj)=ran2()
499
 
            enddo
500
 
            new_point=.true.
501
 
            call generate_momenta(ndim,iconfig,wgt,x,p)
502
 
            ntry=ntry+1
503
 
         enddo
504
 
         if(ncolltests.le.10)write (*,*) 'ntry',ntry
505
 
         do i=1,imax
506
 
            y_ij_fks_fix=1-0.1d0**i
507
 
            wgt=1d0
508
 
            call generate_momenta(ndim,iconfig,wgt,x,p)
509
 
            calculatedBorn=.false.
510
 
            call set_cms_stuff(1)
511
 
            call sreal(p1_cnt(0,1,1),xi_i_fks_cnt(1),one,fx) 
512
 
            fxl(i)=fx*jac_cnt(1)
513
 
         ! keep track of the separate splitorders
514
 
            do iamp=1,amp_split_size
515
 
               fxl_split(i,iamp) = amp_split(iamp)*jac_cnt(1)
516
 
               wfxl_split(i,iamp) = jac_cnt(1)
517
 
            enddo
518
 
            wfxl(i)=jac_cnt(1)
519
 
            calculatedBorn=.false.
520
 
            call set_cms_stuff(-100)
521
 
            call sreal(p,xi_i_fks_ev,y_ij_fks_ev,fx)
522
 
            limit(i)=fx*wgt
523
 
            wlimit(i)=wgt
524
 
            ! keep track of the separate splitorders
525
 
            do iamp=1,amp_split_size
526
 
              limit_split(i,iamp) = amp_split(iamp)*wgt
527
 
              wlimit_split(i,iamp) = wgt
528
 
            enddo
529
 
            do k=1,nexternal
530
 
               do l=0,3
531
 
                  lxp(i,l,k)=p1_cnt(l,k,1)
532
 
                  xp(i,l,k)=p(l,k)
533
 
               enddo
534
 
            enddo
535
 
            do l=0,3
536
 
               lxp(i,l,nexternal+1)=p_i_fks_cnt(l,1)
537
 
               xp(i,l,nexternal+1)=p_i_fks_ev(l)
538
 
            enddo
539
 
         enddo
540
 
         if(ncolltests.le.10)then
541
 
            write (*,*) 'Collinear limit:'
542
 
           write (*,*) '   Sum of all contributions:'
543
 
            do i=1,imax
544
 
               call xprintout(6,limit(i),fxl(i))
545
 
            enddo
546
 
           ! check the contributions coming from each splitorders
547
 
           ! only look at the non vanishing ones
548
 
           do iamp=1, amp_split_size
549
 
             if (limit_split(1,iamp).ne.0d0.or.fxl_split(1,iamp).ne.0d0) then
550
 
               write(*,*) '   Split-order', iamp
551
 
               call amp_split_pos_to_orders(iamp,orders)
552
 
               do i = 1, nsplitorders
553
 
                  write(*,*) '      ',ordernames(i), ':', orders(i)
554
 
               enddo
555
 
               do i=1,imax
556
 
                  call xprintout(6,limit_split(i,iamp),fxl_split(i,iamp))
557
 
               enddo
558
 
               call checkres2(limit_split(1,iamp),fxl_split(1,iamp),
559
 
     &                   wlimit_split(1,iamp),wfxl_split(1,iamp),xp,lxp,
560
 
     &                   iflag,imax,j,nexternal,i_fks,j_fks,iret)
561
 
               write(*,*) 'RETURN CODE', iret
562
 
             endif
563
 
           enddo
564
 
c
565
 
            write(80,*)'  '
566
 
            write(80,*)'****************************'
567
 
            write(80,*)'  '
568
 
            do k=1,nexternal+1
569
 
               write(80,*)''
570
 
               write(80,*)'part:',k
571
 
               do l=0,3
572
 
                  write(80,*)'comp:',l
573
 
                  do i=1,10
574
 
                     call xprintout(80,xp(i,l,k),lxp(i,l,k))
575
 
                  enddo
576
 
               enddo
577
 
            enddo
578
 
         else
579
 
            iflag=1
580
 
           call checkres2(limit,fxl,wlimit,wfxl,xp,lxp,
581
 
     &                   iflag,imax,j,nexternal,i_fks,j_fks,iret)
582
 
            nerr=nerr+iret
583
 
           ! check the contributions coming from each splitorders
584
 
           ! only look at the non vanishing ones
585
 
           do iamp=1, amp_split_size
586
 
             if (limit_split(1,iamp).ne.0d0.or.fxl_split(1,iamp).ne.0d0) then
587
 
               call checkres2(limit_split(1,iamp),fxl_split(1,iamp),
588
 
     &                   wlimit_split(1,iamp),wfxl_split(1,iamp),xp,lxp,
589
 
     &                   iflag,imax,j,nexternal,i_fks,j_fks,iret)
590
 
               nerr=nerr+iret
591
 
             endif
592
 
           enddo
593
 
         endif
594
 
      enddo
595
 
      if(ncolltests.gt.10)then
596
 
         write(*,*)'Collinear tests done for (Born) config', iconfig
597
 
         write(*,*)'Failures:',nerr
598
 
         fail_frac= nerr/dble(ncolltests)
599
 
         if (fail_frac.lt.max_fail) then
600
 
             write(*,501) nFKSprocess, fail_frac
601
 
         else
602
 
             write(*,502) nFKSprocess, fail_frac
603
 
         endif
604
 
      endif
605
 
 
606
 
 123  continue
607
 
 
608
 
      enddo                     ! Loop over Born configurations
609
 
      enddo                     ! Loop over nFKSprocess
610
 
 
611
 
 
612
 
      return
613
 
 401  format('     Soft test ',i2,' PASSED. Fraction of failures: ',
614
 
     & f4.2) 
615
 
 402  format('     Soft test ',I2,' FAILED. Fraction of failures: ',
616
 
     & f4.2) 
617
 
 501  format('Collinear test ',i2,' PASSED. Fraction of failures: ',
618
 
     & f4.2) 
619
 
 502  format('Collinear test ',I2,' FAILED. Fraction of failures: ',
620
 
     & f4.2) 
621
 
      end
622
 
 
623
 
c
624
 
c
625
 
c Dummy routines
626
 
c
627
 
c
628
 
      subroutine clear_events()
629
 
      end
630
 
      subroutine initplot
631
 
      end
632
 
      subroutine store_events()
633
 
      end
634
 
      integer function n_unwgted()
635
 
      n_unwgted = 1
636
 
      end
637
 
 
638
 
      subroutine outfun(pp,www)
639
 
      implicit none
640
 
      include 'nexternal.inc'
641
 
      real*8 pp(0:3,nexternal),www
642
 
c
643
 
      write(*,*)'This routine should not be called here'
644
 
      stop
645
 
      end