1
subroutine addmothers(ip,jpart,pb,isym,jsym,rscale,aqcd,aqed,buff,
6
include 'maxconfigs.inc'
7
include 'nexternal.inc'
14
integer jpart(7,-nexternal+3:2*nexternal-3),npart,ip,numproc
15
double precision pb(0:4,-nexternal+3:2*nexternal-3)
16
double precision rscale,aqcd,aqed,targetamp(maxflow)
19
logical flip ! If .true., initial state is mirrored
21
integer isym(nexternal,99), jsym
22
integer i,j,k,ida(2),ns,nres,ires,icl,ito2,idenpart,nc,ic
23
integer mo_color,da_color(2),itmp
24
integer ito(-nexternal+3:nexternal),iseed,maxcolor,maxorg
25
integer icolalt(2,-nexternal+2:2*nexternal-3)
26
double precision qicl(-nexternal+3:2*nexternal-3), factpm
27
double precision xtarget
29
integer lconfig,idij(-nexternal+2:nexternal)
32
common/to_diag_number/diag_number
34
c Variables for combination of color indices (including multipart. vert)
36
parameter(maxcolmp=20)
37
integer ncolmp,icolmp(2,maxcolmp),is_colors(2,nincoming)
41
double precision prmass(-nexternal:0,lmaxconfigs)
42
double precision prwidth(-nexternal:0,lmaxconfigs)
43
integer pow(-nexternal:0,lmaxconfigs)
44
logical first_time,tchannel
45
save prmass,prwidth,pow
46
data first_time /.true./
48
Double Precision amp2(maxamps), jamp2(0:maxflow)
49
common/to_amps/ amp2, jamp2
51
integer mincfig, maxcfig
52
common/to_configs/mincfig, maxcfig
53
integer idmap(-nexternal:nexternal),icmp
55
integer iforest(2,-max_branch:-1,lmaxconfigs)
56
common/to_forest/ iforest
57
integer sprop(maxsproc,-max_branch:-1,lmaxconfigs)
58
integer tprid(-max_branch:-1,lmaxconfigs)
59
common/to_sprop/sprop,tprid
60
integer mapconfig(0:lmaxconfigs), iconfig
61
common/to_mconfigs/mapconfig, iconfig
63
integer idup(nexternal,maxproc,maxsproc)
64
integer mothup(2,nexternal)
65
integer icolup(2,nexternal,maxflow,maxsproc)
66
include 'leshouche.inc'
67
include 'coloramps.inc'
69
logical OnBW(-nexternal:0) !Set if event is on B.W.
70
common/to_BWEvents/ OnBW
71
CHARACTER temp*600,temp0*7,integ*1,float*18
73
CHARACTER(LEN=45*nexternal) ptclusstring
75
C iproc has the present process number
76
integer imirror, iproc
77
common/to_mirror/imirror, iproc
79
c integer ncols,ncolflow(maxamps),ncolalt(maxamps),icorg
80
c common/to_colstats/ncols,ncolflow,ncolalt,icorg
85
logical is_LC ! for not leading color bypass the writing of intermediate particle since the diagram is a very good candididate (and that it leads to issue)
89
integer get_color,elim_indices,set_colmp,fix_tchannel_color,combid
91
external pt,ran1,get_color,elim_indices,set_colmp,fix_tchannel_color
101
do i=-nexternal+2,nexternal
107
c Choose the config (diagram) which was actually used to produce the event
109
c ...unless the diagram is passed in igraphs(1); then use that diagram
112
if (btest(mlevel,3)) then
113
write(*,*)'unwgt.f: write out diagram ',igraphs(1)
119
c Choose a color flow which is certain to work with the propagator
120
c structure of the chosen diagram and use that as an alternative
127
if(icolamp(1,%(iconfig)s,iproc)) then
128
targetamp(1)=jamp2(1)
129
c print *,'Color flow 1 allowed for config ',lconfig
134
if(icolamp(ic,%(iconfig)s,iproc))then
135
targetamp(ic) = jamp2(ic)+targetamp(ic-1)
136
c print *,'Color flow ',ic,' allowed for config ',lconfig,targetamp(ic)
138
targetamp(ic)=targetamp(ic-1)
141
c ensure that at least one leading color is different of zero if not allow
142
c all subleading color.
143
if (targetamp(nc).eq.0)then
145
targetamp(1)=jamp2(1)
147
targetamp(ic) = jamp2(ic)+targetamp(ic-1)
152
xtarget=ran1(iseed)*targetamp(nc)
155
do while (targetamp(ic) .lt. xtarget .and. ic .lt. nc)
158
if(targetamp(nc).eq.0) ic=0
159
c print *,'Chose color flow ',ic
162
icolalt(1,isym(i,jsym))=icolup(1,i,ic,numproc)
163
icolalt(2,isym(i,jsym))=icolup(2,i,ic,numproc)
164
c write(*,*) i, icolalt(1,isym(i,jsym)), icolalt(2,isym(i,jsym))
165
if (abs(icolup(1,i,ic, numproc)).gt.maxcolor) maxcolor=icolup(1,i,ic, numproc)
166
if (abs(icolup(2,i,ic, numproc)).gt.maxcolor) maxcolor=icolup(2,i,ic, numproc)
178
c Store original maxcolor to know if we have epsilon vertices
180
c Keep track of IS colors that go through to final state
181
c (since we shouldn't replace pop-up indices with those)
186
if (iabs(icolalt(j,i)).eq.iabs(icolalt(j,k))) then
187
c This color is going through to FS
188
is_colors(j,i)=iabs(icolalt(j,i))
194
c Get mother information from chosen graph
197
c Set idij for external particles (needed to keep track of BWs)
204
c First check number of resonant s-channel propagators
208
c Ensure that mother-daughter information starts from 0
215
c Loop over propagators to find mother-daughter information
216
do i=-1,-nexternal+2,-1
218
if(i.gt.-nexternal+2)then
219
ida(1)=iforest(1,i,lconfig)
220
ida(2)=iforest(2,i,lconfig)
222
if(ida(j).gt.0) ida(j)=isym(ida(j),jsym)
224
c Set idij (needed to keep track of BWs)
225
if(ickkw.gt.0) idij(i)=combid(idij(ida(1)),idij(ida(2)))
227
c Decide s- or t-channel (for not LC -> set to none
228
if(i.gt.-nexternal+2.and.is_LC.and.
229
$ iabs(sprop(numproc,i,lconfig)).gt.0) then ! s-channel propagator
230
jpart(1,i)=sprop(numproc,i,lconfig)
232
else if(nres.gt.0.and.maxcolor.gt.maxorg.and.is_LC) then
233
c For t-channel propagators, just check that the colors are ok
234
if(i.eq.-nexternal+2) then
235
c This is the final t-channel, combining with leg 2
237
if(.not.tchannel)then
238
c There are no previous t-channels, so this is a combination of
239
c 2, 1 and the last s-channel
243
c The daughter info is in iforest
244
ida(1)=iforest(1,i,lconfig)
245
ida(2)=iforest(2,i,lconfig)
247
c Reverse colors of t-channels to get right color ordering
249
ncolmp=set_colmp(ncolmp,icolmp,2,jpart,
250
$ iforest(1,-max_branch,lconfig),icolalt,
251
$ icolalt(2,2),icolalt(1,2))
253
jpart(1,i)=tprid(i,lconfig)
254
mo_color=get_color(jpart(1,i))
257
if(mo_color.gt.1.and.
258
$ mo_color.ne.3.and.mo_color.ne.8)then
259
da_color(1)=get_color(jpart(1,ida(1)))
260
da_color(2)=get_color(jpart(1,ida(2)))
261
call write_error(da_color(1), da_color(2), mo_color)
263
c Set icolmp for daughters
264
ncolmp=set_colmp(ncolmp,icolmp,ida(2),jpart,
265
$ iforest(1,-max_branch,lconfig),icolalt,
266
$ icolalt(1,ida(2)),icolalt(2,ida(2)))
267
c Reverse colors of t-channels to get right color ordering
268
ncolmp=set_colmp(ncolmp,icolmp,ida(1),jpart,
269
$ iforest(1,-max_branch,lconfig),icolalt,
270
$ icolalt(2,ida(1)),icolalt(1,ida(1)))
271
c Fix t-channel color
272
c print *,'t-channel: ',i,ida(1),ida(2),mo_color
273
c print *,'colors: ',((icolmp(j,k),j=1,2),k=1,ncolmp)
274
maxcolor=fix_tchannel_color(mo_color,maxcolor,
275
$ ncolmp,icolmp,i,icolalt,is_colors)
281
c Set status codes for propagator
282
c if((igscl(0).ne.0.and.
283
c $ (iabs(jpart(1,i)).gt.5.and.iabs(jpart(1,i)).lt.11).or.
284
c $ (iabs(jpart(1,i)).gt.16.and.iabs(jpart(1,i)).ne.21)).or.
285
c $ (igscl(0).eq.0.and.OnBW(i))) then
286
if(ickkw.eq.0.and.OnBW(i))then
287
c Resonance whose mass should be preserved
290
else if (ickkw.gt.0) then
291
if(isbw(idij(i))) then
292
c Resonance whose mass should be preserved
299
c Propagator for documentation only - not included
302
c Calculate momentum (p1+p2 for s-channel, p2-p1 for t-channel)
304
pb(j,i)=pb(j,ida(1))+pb(j,ida(2))
306
pb(4,i)=sqrt(max(0d0,pb(0,i)**2-pb(1,i)**2-pb(2,i)**2-pb(3,i)**2))
307
c if(jpart(6,i).eq.2.and.
308
c $ abs(pb(4,i)-prmass(i,lconfig)).gt.5d0*prwidth(i,lconfig)) then
312
c Set color info for all s-channels
313
mo_color = get_color(jpart(1,i))
314
c If inside multipart. vertex (indicated by color 2) cycle
315
c Set tentative mothers
318
c Set mother info for daughters
323
if(mo_color.eq.2) cycle
324
c Reset list of color indices
326
c Add new color indices to list of color indices
328
ncolmp=set_colmp(ncolmp,icolmp,ida(j),jpart,
329
$ iforest(1,-max_branch,lconfig),icolalt,
330
$ icolalt(1,ida(j)),icolalt(2,ida(j)))
332
c print *,'s-channel: ',i,mo_color,ida(1),ida(2)
333
c print *,'colors: ',((icolmp(j,k),j=1,2),k=1,ncolmp)
335
if (icolmp(1,1).eq.1000.or.icolmp(2,1).eq.1000)then
336
if (jpart(6,i).eq.2)then
339
elseif(mo_color.eq.1) then ! color singlet
340
maxcolor=elim_indices(0,0,ncolmp,icolmp,i,icolalt,
341
$ is_colors,maxcolor)
342
elseif(mo_color.eq.-3) then ! color anti-triplet
343
maxcolor=elim_indices(0,1,ncolmp,icolmp,i,icolalt,
344
$ is_colors,maxcolor)
345
elseif(mo_color.eq.3) then ! color triplet
346
maxcolor=elim_indices(1,0,ncolmp,icolmp,i,icolalt,
347
$ is_colors,maxcolor)
348
elseif(mo_color.eq.-6) then ! color anti-sextet
349
maxcolor=elim_indices(0,2,ncolmp,icolmp,i,icolalt,
350
$ is_colors,maxcolor)
351
elseif(mo_color.eq.6) then ! color sextet
352
maxcolor=elim_indices(2,0,ncolmp,icolmp,i,icolalt,
353
$ is_colors,maxcolor)
354
elseif(mo_color.eq.8) then ! color octet
355
maxcolor=elim_indices(1,1,ncolmp,icolmp,i,icolalt,
356
$ is_colors,maxcolor)
357
else ! 2 indicates multipart. vertex
358
da_color(1) = get_color(jpart(1,ida(1)))
359
da_color(2) = get_color(jpart(1,ida(2)))
360
call write_error(da_color(1), da_color(2), mo_color)
362
endif !end of check on LC
364
c Just zero helicity info for intermediate states
368
if (is_LC) call check_pure_internal_flow(icolalt,jpart, maxcolor)
370
c Remove non-resonant mothers, set position of particles
373
jpart(4,i)=icolalt(1,i)
374
jpart(5,i)=icolalt(2,i)
375
if(i.eq.1.or.i.eq.2) then
376
ito(i)=i ! initial state particle
378
ito(i)=i+nres ! final state particle
379
else if(i.le.-1.and.jpart(6,i).eq.2) then
381
ito(i)=2+ires ! s-channel resonances
386
if(jpart(2,i).lt.0.and.jpart(6,jpart(2,i)).ne.2) then
387
jpart(2,i)=jpart(2,jpart(2,i))
388
jpart(3,i)=jpart(3,jpart(3,i))
392
c Shift particles to right place and set mothers of particles
394
do i=nexternal,-ns,-1
395
if(ito(i).le.0) cycle
397
jpart(j,ito(i))=jpart(j,i)
399
if(jpart(2,ito(i)).lt.0) then
400
jpart(2,ito(i))=ito(jpart(2,ito(i)))
401
jpart(3,ito(i))=ito(jpart(3,ito(i)))
408
c Set correct mother number for clustering info
410
if (icluster(1,1).ne.0) then
412
if(icluster(4,i).gt.0)then
413
icluster(4,i)=ito(icluster(4,i))
417
if(icluster(3,i).eq.0)then
420
if(ito(icluster(1,i)).gt.0)
421
$ icluster(1,i)=ito(icluster(1,i))
422
if(ito(icluster(2,i)).gt.0)
423
$ icluster(2,i)=ito(icluster(2,i))
425
if(icluster(1,i).le.2)
426
$ icluster(1,i)=3-icluster(1,i)
427
if(icluster(2,i).le.2)
428
$ icluster(2,i)=3-icluster(2,i)
429
if(icluster(3,i).ge.1.and.icluster(3,i).le.2)
430
$ icluster(3,i)=3-icluster(3,i)
436
c Need to flip initial state color, since might be overwritten
439
jpart(i,1)=jpart(i,2)
445
if (lhe_version.lt.3d0) then
446
write(cform,'(a4,i2,a6)') '(a1,',max(nexternal,10),'e15.7)'
447
write(buff,cform) '#',(ptclus(i),i=3,nexternal)
448
else if(nexternal.gt.2)then
454
Write(float,'(f16.5)') ptclus(i)
455
write(integfour,'(i4)') ito(i)
456
temp=trim(temp)//' pt_clust_'//trim(adjustl(integfour))//'="'//trim(adjustl(float))//'"'
458
ptclusstring=trim(adjustl(temp0//trim(temp)//'></scales>'))
459
c write(*,*)'WRITING THE ptclusscale:',trim(adjustl(ptclusstring))
460
write(buff,'(a)') trim(adjustl(ptclusstring))
464
npart = nexternal+nres
469
c *************************************
470
subroutine write_error(ida1,ida2,imo)
471
c *************************************
473
integer ida1,ida2,imo
475
open(unit=26,file='../../../error',status='unknown',err=999)
476
if (ida1.eq.1000)then
477
write(26,*) 'Error: too many particles in multipart. vertex,',
478
$ ' please increase maxcolmp in addmothers.f'
479
write(*,*) 'Error: too many particles in multipart. vertex,',
480
$ ' please increase maxcolmp in addmothers.f'
483
if (ida1.eq.1001)then
484
write(26,*) 'Error: failed to reduce to color indices: ',ida2,imo
485
write(*,*) 'Error: failed to reduce to color indices: ',ida2,imo
488
write(26,*) 'Error: Color combination ',ida1,ida2,
489
$ '->',imo,' not implemented in addmothers.f'
490
write(*,*) 'Error: Color combination ',ida1,ida2,
491
$ '->',imo,' not implemented in addmothers.f'
494
999 write(*,*) 'error'
497
c *********************************************************************
498
function set_colmp(ncolmp,icolmp,npart,jpart,forest,icol,icol1,icol2)
499
c *********************************************************************
502
parameter(maxcolmp=20)
503
include 'nexternal.inc'
507
integer ncolmp,icolmp(2,*),npart,icol1,icol2
508
integer icol(2,-nexternal+2:2*nexternal-3)
509
integer jpart(7,-nexternal+3:2*nexternal-3)
510
integer forest(2,-max_branch:-1)
512
integer da_color(2),itmp,ida(2),icolor,ipart,i,j
513
integer get_color,set1colmp
516
icolor=get_color(jpart(1,npart))
517
if(icolor.eq.1) return
519
c Multiparticle vertex - need to go through daughters and collect all colors
521
do while(icolor.eq.2)
522
ida(1)=forest(1,ipart)
523
ida(2)=forest(2,ipart)
524
da_color(1)=get_color(jpart(1,ida(1)))
525
da_color(2)=get_color(jpart(1,ida(2)))
526
c print *,'iforest: ',ipart,ida(1),ida(2),da_color(1),da_color(2)
527
if(da_color(1).ne.2.and.da_color(2).lt.da_color(1).or.
528
$ da_color(2).eq.2)then
529
c Order daughters according to color, but always color 2 first
534
da_color(1)=da_color(2)
538
if(da_color(i).ne.1.and.da_color(i).ne.2)then
539
ncolmp=set1colmp(ncolmp,icolmp,icol(1,ida(i)),
547
ncolmp=set1colmp(ncolmp,icolmp,icol1,icol2)
553
c ******************************************************
554
function set1colmp(ncolmp,icolmp,icol1,icol2)
555
c ******************************************************
559
parameter(maxcolmp=20)
561
integer ncolmp,icolmp(2,*),icol1,icol2,i,j
563
c print *,'icol1,icol2: ',icol1,icol2
566
icolmp(1,ncolmp)=icol1
567
icolmp(2,ncolmp)=icol2
568
c Avoid color sextet-type negative indices
569
if(icolmp(1,ncolmp).lt.0)then
571
icolmp(2,ncolmp)=-icolmp(1,ncolmp-1)
574
elseif(icolmp(2,ncolmp).lt.0)then
576
icolmp(1,ncolmp)=-icolmp(2,ncolmp-1)
580
c print *,'icolmp: ',((icolmp(i,j),i=1,2),j=1,ncolmp)
581
if(ncolmp.gt.maxcolmp)
582
$ call write_error(1000,ncolmp,maxcolmp)
587
c********************************************************************
588
function fix_tchannel_color(mo_color,maxcolor,ncolmp,icolmp,ires,
590
c********************************************************************
591
c Successively eliminate identical pairwise color indices from the
592
c icolmp list, until only (max) one triplet and one antitriplet remains
596
include 'nexternal.inc'
597
integer fix_tchannel_color
598
integer mo_color,maxcolor,ncolmp,icolmp(2,*)
599
integer ires,icol(2,-nexternal+2:2*nexternal-3)
600
integer is_colors(2,nincoming)
601
integer i,j,i3,i3bar,max3,max3bar,min3,min3bar,maxcol,mincol
604
c Successively eliminate color indices in pairs until only the wanted
608
if(icolmp(1,i).ne.0.and.icolmp(1,i).eq.icolmp(2,j)) then
620
if(icolmp(1,i).gt.0)then
622
c color for t-channels needs to be reversed
623
if(i3.eq.1) icol(2,ires)=icolmp(1,i)
624
if(i3.eq.2) icol(1,ires)=-icolmp(1,i)
626
if(icolmp(2,i).gt.0)then
628
c color for t-channels needs to be reversed
629
if(i3bar.eq.1) icol(1,ires)=icolmp(2,i)
630
if(i3bar.eq.2) icol(2,ires)=-icolmp(2,i)
634
if(mo_color.eq.0)then
639
fix_tchannel_color=maxcolor
640
if(mo_color.le.1.and.i3.eq.0.and.i3bar.eq.0) return
641
if(mo_color.eq.3.and.(i3.eq.1.and.i3bar.eq.0
642
$ .or.i3bar.eq.1.and.i3.eq.0)) return
643
if(mo_color.eq.8.and.i3.eq.1.and.i3bar.eq.1) return
645
c Make sure that max and min don't come from the same octet
646
call find_max_min(icolmp,ncolmp,max3,min3,max3bar,min3bar,
647
$ i3,i3bar,is_colors)
648
c print *,'After finding: ',ncolmp,((icolmp(j,i),j=1,2),i=1,ncolmp)
649
c print *,'mo_color = ',mo_color
651
if(mo_color.le.1.and.i3-i3bar.eq.2.or.
652
$ mo_color.le.1.and.i3bar-i3.eq.2.or.
653
$ mo_color.le.1.and.i3.eq.1.and.i3bar.eq.1) then
654
c Replace the maximum index with the minimum one everywhere
655
maxcol=max(max3,max3bar)
656
if(maxcol.eq.max3) then
663
if(icol(j,i).eq.maxcol)
667
c print *,'Replaced ',maxcol,' by ',mincol
668
elseif(mo_color.le.1.and.i3.eq.2.and.i3bar.eq.2) then
669
c Ensure that max > min
670
if(max3bar.lt.min3)then
675
if(max3.lt.min3bar)then
680
c Replace the maximum indices with the minimum ones everywhere
683
if(icol(j,i).eq.max3bar)
685
if(icol(j,i).eq.max3)
689
c print *,'Replaced ',max3bar,' by ',min3,' and ',max3,' by ',min3bar
690
elseif(mo_color.le.1.and.mod(i3,3).eq.0.and.mod(i3bar,3).eq.0)then
691
c This is epsilon index - do nothing
693
else if(mo_color.eq.3.and.mod(i3-i3bar,3).eq.2) then
694
c This is an epsilon index
696
icol(1,ires)=maxcolor
698
c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2)
699
else if(mo_color.eq.3.and.mod(i3bar-i3,3).eq.2) then
700
c This is an epsilon index
703
icol(2,ires)=maxcolor
704
c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2)
705
else if(mo_color.eq.3.and.(i3-i3bar.eq.1.or.i3bar-i3.eq.1).or.
706
$ mo_color.eq.8.and.i3.eq.2.and.i3bar.eq.2) then
707
c Replace the maximum index with the minimum one everywhere
708
c (we don't know if we should replace i3 with i3bar or vice versa)
709
c Actually we know if one of the index is repeated (we do not want to replace that one)
710
maxcol=max(max3,max3bar)
711
if(maxcol.eq.max3) then
718
if(icol(j,i).eq.maxcol)
723
if (mincol.eq.0.and.mo_color.eq.3) then
724
c situation like (possible if they are epsilon in the gluon decay
725
c (503,0)----------+ggggggggggggg (509,508)
728
c in this case maxcol=509 and mincol=0
729
c The correct solution in this case is:
730
c (503,0)----------+ggggggggggggg (503,508)
733
if(icolmp(2,1).eq.0)then
737
icol(2,ires) = icolmp(2,2)
738
elseif(icolmp(1,1).eq.0)then
741
icol(1,ires) = icolmp(1,2)
743
elseif(icolmp(2,2).eq.0)then
747
icol(2,ires) = icolmp(2,1)
748
elseif(icolmp(1,2).eq.0)then
751
icol(1,ires) = icolmp(1,1)
755
write(*,*) "weird color combination in addmothers.f"
756
write(*,*) icolmp(1,1), icolmp(2,1), icolmp(1,2), icolmp(2,2)
757
call write_error(1001,0,0)
759
c now maxcol=509 and mincol=503 so replace all occurence of 509-> 503
760
c print *,'Replaced ',maxcol,' by ',mincol
761
do i=ires+1,nexternal
763
if(icol(j,i).eq.maxcol)
769
c First check that mincol is not a going trough index. If it is it
770
C should not be assign to one of the temporary index
774
if (icol(j,i).eq.mincol) count = count +1
779
c we do not want to use that index pass to the other one
780
if (mincol.eq.min3)then
789
c Fix the color for ires (remember 3<->3bar for t-channels)
792
c print *,'Replaced ',maxcol,' by ',mincol
793
if(max3.eq.maxcol)then
794
if(i3-i3bar.ge.0) icol(2,ires)=min3
795
if(i3bar-i3.ge.0) icol(1,ires)=max3bar
797
if(i3-i3bar.ge.0) icol(2,ires)=max3
798
if(i3bar-i3.ge.0) icol(1,ires)=min3bar
801
c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2)
803
c Don't know how to deal with this
804
call write_error(i3,i3bar,mo_color)
806
fix_tchannel_color=maxcolor
811
c*******************************************************************
812
function elim_indices(n3,n3bar,ncolmp,icolmp,ires,icol,
813
$ is_colors,maxcolor)
814
c*******************************************************************
815
c Successively eliminate identical pairwise color indices from the
816
c icolmp list, until only the wanted indices remain
817
c n3 gives the number of triplet indices, n3bar number of antitriplets
818
c n3=1 for triplet, n3bar=1 for antitriplet,
819
c (n3,n3bar)=(1,1) for octet,
820
c n3=2 for sextet, n3bar=2 for antisextet
821
c If there are epsilon^{ijk} or epsilonbar color couplings, we
822
c need to introduce new index based on maxcolor.
826
include 'nexternal.inc'
828
integer n3,n3bar,ncolmp,icolmp(2,*),maxcolor
829
integer ires,icol(2,-nexternal+2:2*nexternal-3)
830
integer is_colors(2,nincoming)
833
c Successively eliminate color indices in pairs until only the wanted
837
if(icolmp(1,i).ne.0.and.icolmp(1,i).eq.icolmp(2,j)) then
849
if(icolmp(1,i).gt.0)then
851
if(i3.eq.1) icol(1,ires)=icolmp(1,i)
852
if(i3.eq.2) icol(2,ires)=-icolmp(1,i)
854
if(icolmp(2,i).gt.0)then
856
if(i3bar.eq.1) icol(2,ires)=icolmp(2,i)
857
if(i3bar.eq.2) icol(1,ires)=-icolmp(2,i)
861
c print *,'i3,n3,i3bar,n3bar: ',i3,n3,i3bar,n3bar
862
c print *,'icol(1,ires),icol(2,ires): ',icol(1,ires),icol(2,ires)
864
if(n3bar.le.1.and.n3.eq.0) icol(1,ires)=0
865
if(n3.le.1.and.n3bar.eq.0) icol(2,ires)=0
867
if(i3.ne.n3.or.i3bar.ne.n3bar) then
868
if(n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0.and.i3.eq.0)then
869
c This is an epsilon index interaction
870
c write(*,*) i3, n3, i3bar, n3bar, ires
872
icol(1,ires)=maxcolor
875
icol(2,ires)=-maxcolor
877
elseif(n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0.and.i3bar.eq.0)then
878
c This is an epsilonbar index interaction
879
c write(*,*) i3, n3, i3bar, n3bar, ires
881
icol(2,ires)=maxcolor
884
icol(1,ires)=-maxcolor
886
elseif(n3.gt.0.and.n3bar.eq.0.and.i3-i3bar.eq.n3.or.
887
$ n3bar.gt.0.and.n3.eq.0.and.i3bar-i3.eq.n3bar.or.
888
$ n3.eq.1.and.n3bar.eq.1.and.i3-i3bar.eq.0.or.
889
$ n3.eq.0.and.n3bar.eq.0.and.i3-i3bar.eq.0.or.
890
$ n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0.and.i3bar.ne.0.or.
891
$ n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0.and.i3.ne.0)then
892
c We have a previous epsilon which gives the wrong pop-up index
893
call fix_s_color_indices(n3,n3bar,i3,i3bar,ncolmp,icolmp,
894
$ ires,icol,is_colors)
896
c Don't know how to deal with this
897
call write_error(1001,n3,n3bar)
901
elim_indices=maxcolor
906
c*******************************************************************
907
subroutine fix_s_color_indices(n3,n3bar,i3,i3bar,ncolmp,icolmp,
908
$ ires,icol,is_colors)
909
c*******************************************************************
911
c Fix color flow if some particle has got the wrong pop-up color
912
c due to epsilon-ijk vertices
916
include 'nexternal.inc'
917
integer n3,n3bar,ncolmp,icolmp(2,*),maxcolor
918
integer ires,icol(2,-nexternal+2:2*nexternal-3)
919
integer is_colors(2,nincoming)
921
integer max_n3,max_n3bar,min_n3,min_n3bar,maxcol,mincol
926
c print *,'Colors: ',ncolmp,((icolmp(j,i),j=1,2),i=1,ncolmp)
927
c print *,'n3,n3bar,i3,i3bar: ',n3,n3bar,i3,i3bar
929
c Make sure that max and min don't come from the same octet
930
call find_max_min(icolmp,ncolmp,max_n3,min_n3,
931
$ max_n3bar,min_n3bar,i3,i3bar,is_colors)
932
c print *,'max3,min3bar,min3,max3bar: ',max_n3,min_n3bar,min_n3,max_n3bar
934
if(n3.eq.1.and.n3bar.eq.0.and.i3-i3bar.eq.n3.or.
935
$ n3bar.eq.1.and.n3.eq.0.and.i3bar-i3.eq.n3bar.or.
936
$ n3bar.eq.1.and.n3.eq.1.and.i3bar-i3.eq.0.or.
937
$ n3bar.eq.0.and.n3.eq.0.and.i3bar-i3.eq.0.or.
938
$ n3bar.gt.0.and.n3.eq.0.and.mod(i3+n3bar,3).eq.0.and.i3bar.ne.0.or.
939
$ n3.gt.0.and.n3bar.eq.0.and.mod(i3bar+n3,3).eq.0.and.i3.ne.0)then
941
if ((i3.eq.2.or.i3bar.eq.2).and.(n3bar+n3.eq.1))then
943
c -------------------- (0,503)
949
c ------------------------- (0,503)
954
icol(1,ires) = max(icolmp(1,1), icolmp(1,2))
956
maxcol = max(icolmp(2,1), icolmp(2,2))
957
mincol = min(icolmp(1,1), icolmp(1,2))
958
c replace maxcol by mincol
959
elseif (i3bar.eq.2) then
961
icol(2,ires) = max(icolmp(2,1), icolmp(2,2))
962
maxcol = max(icolmp(1,1), icolmp(1,2))
963
mincol = min(icolmp(2,1), icolmp(2,2))
965
c write(*,*) "replace ", maxcol,"by",mincol
966
do i=ires+1,nexternal
968
if(icol(j,i).eq.maxcol)
975
c Replace the highest 3bar-index with the lowest 3-index,
979
maxcol=max(max_n3,max_n3bar)
980
if(maxcol.eq.max_n3) then
987
if(icol(j,i).eq.maxcol)
991
c print *,'Replaced ',maxcol,' with ',mincol
992
if(max_n3.eq.maxcol)then
993
if(n3.eq.1) icol(1,ires)=min_n3
994
if(n3bar.eq.1) icol(2,ires)=max_n3bar
996
if(n3.eq.1) icol(1,ires)=max_n3
997
if(n3bar.eq.1) icol(2,ires)=min_n3bar
999
c print *,'Set mother color for ',ires,' to ',(icol(j,ires),j=1,2)
1002
c Don't know how to deal with this
1003
call write_error(1001,n3,n3bar)
1009
subroutine check_pure_internal_flow(icol,jpart, maxcolor)
1012
include 'nexternal.inc'
1013
integer jpart(7,-nexternal+3:2*nexternal-3)
1014
integer icol(2,-nexternal+2:2*nexternal-3)
1019
c do i=-nexternal+3,nexternal
1020
c write(*,*) i, icol(1,i), icol(2,i),(jpart(j,i) , j=1,3)
1022
do i=-nexternal+3,-1
1023
if (jpart(2,i).eq.0.or.jpart(3,i).eq.0) goto 20 ! not define mother -> continue
1024
if (icol(1,i).eq.1000.or.icol(2,i).eq.1000) goto 20 ! special color value -> continue
1028
if(icol(k,i).eq.icol(1,j).or.icol(k,i).eq.icol(2,j))then
1035
call correct_external_flow_epsilon(icol, jpart, maxcolor,
1046
subroutine correct_external_flow_epsilon(icol, jpart, maxcolor, mincol)
1048
c for avoiding double epsilon problem
1051
include 'nexternal.inc'
1052
integer jpart(7,-nexternal+3:2*nexternal-3)
1054
integer icol(2,-nexternal+2:2*nexternal-3)
1056
integer mincol ! the potential propagator linked to the two epsilon.
1058
integer potential_index(2)
1059
integer epsilon_index(4)
1060
integer mothers(2*nexternal-3)
1063
C In presence of two epsilon_ijk connected by a flow we need to ensure that the
1064
C the index of the non summed indices do not repeat each other
1066
do i=-nexternal+3,2*nexternal-3
1067
if (icol(1,i).eq.mincol.or.icol(2,i).eq.mincol)then
1068
potential_index(1)=0
1069
c write(*,*) "particle",i,"has color index", mincol
1070
k=0 !index to see how many child we found so far
1071
do j=-nexternal+3,2*nexternal-3
1072
if (jpart(2,j).eq.i.or.jpart(3,j).eq.i)then
1073
c write(*,*) "find the child", j
1074
if (icol(1,j).eq.mincol.or.icol(2,j).eq.mincol)then
1075
potential_index(1)=0
1076
c write(*,*) "the color", mincol,
1077
c & "is pass to one of the children ->no epsilon at this stage"
1078
c the color flow is pass to a child so no need to do anything for this part/junction
1080
elseif(icol(1,j).ne.0) then
1081
c write(*,*) "child has not colour", mincol, "add", icol(1,j)
1083
potential_index(k) = icol(1,j)
1085
elseif(icol(2,j).ne.0)then
1086
c write(*,*) "child has not colour", mincol, "add", icol(2,j)
1088
potential_index(k) = icol(2,j)
1091
call write_error(1001,0,0)
1096
c store the index of the final junction for this color
1097
c write(*,*) "found", potential_index
1098
if (potential_index(1).ne.0) then
1100
epsilon_index(l) = potential_index(1)
1102
epsilon_index(l) = potential_index(2)
1106
C Remove the duplication index if any
1108
c check the mother of mothers1 and change the color index
1109
c epsilon_index(3) -> maxcolor+1, epsilon_index(4) -> maxcolor+2
1110
c then add info on mothers to recursively change
1111
c Firs check if we have to change
1115
if (epsilon_index(i).eq.epsilon_index(j))then
1116
C ` The index is duplicated need to change one
1121
if (epsilon_index(4).eq.0) to_change = .false.
1124
do i =1, 2*nexternal-3
1125
if (mothers(i).eq.0)then
1128
do j=mothers(i)+1,2*nexternal-3
1129
if (jpart(2,j).eq.mothers(i).or.jpart(3,j).eq.mothers(i))then
1130
if (icol(1,j).eq.epsilon_index(3))then
1131
icol(1,j) = maxcolor + 1
1135
elseif (icol(2,j).eq.epsilon_index(3))then
1136
icol(2,j) = maxcolor + 1
1140
elseif (icol(1,j).eq.epsilon_index(4))then
1141
icol(1,j) = maxcolor + 2
1145
elseif (icol(2,j).eq.epsilon_index(4))then
1146
icol(2,j) = maxcolor + 2
1155
maxcolor = maxcolor +2
1159
c*******************************************************************************
1160
subroutine find_max_min(icolmp,ncolmp,max3,min3,max3bar,min3bar,
1161
$ i3,i3bar,is_colors)
1162
c*******************************************************************************
1164
include 'nexternal.inc'
1165
integer ncolmp,icolmp(2,*)
1166
integer is_colors(2,nincoming)
1167
integer i,j,k,max3,max3bar,min3,min3bar,i3,i3bar,i3now,i3barnow
1168
integer allpairs(2,nexternal),npairs,maxcol,mincol
1173
c Create all possible pairs (3,3bar) that
1174
c 1. come from different octets, 2. are different,
1175
c 3. don't contain any color lines passing through the event
1178
if(icolmp(1,i).eq.0) goto 20
1180
if(icolmp(1,i).eq.is_colors(1,k)) goto 20
1183
if(i.eq.j.or.icolmp(2,j).eq.0.or.
1184
$ icolmp(1,i).eq.icolmp(2,j)) goto 10
1186
if(icolmp(2,j).eq.is_colors(2,k)) goto 10
1189
allpairs(1,npairs)=icolmp(1,i)
1190
allpairs(2,npairs)=icolmp(2,j)
1194
c print *,'is_colors: ',((is_colors(i,j),i=1,2),j=1,nincoming)
1195
c print *,'pairs: ',((allpairs(i,j),i=1,2),j=1,npairs)
1197
c Find the pairs with maximum 3 and 3bar
1203
if(allpairs(1,i).gt.max3.and.
1204
$ (allpairs(2,i).lt.max3bar.or.
1205
$ allpairs(1,i).gt.allpairs(2,i)))then
1207
min3bar=allpairs(2,i)
1208
else if(allpairs(2,i).gt.max3bar.and.
1209
$ (allpairs(1,i).lt.max3.or.
1210
$ allpairs(2,i).gt.allpairs(1,i)))then
1211
max3bar=allpairs(2,i)
1216
c Find "maximum" pairs with minimum 3 and 3bar
1218
if(allpairs(1,i).eq.max3.and.
1219
$ allpairs(2,i).lt.min3bar.and.
1220
$ allpairs(2,i).ne.max3bar)
1221
$ min3bar=allpairs(2,i)
1222
if(allpairs(2,i).eq.max3bar.and.
1223
$ allpairs(1,i).lt.min3.and.
1224
$ allpairs(1,i).ne.max3)
1225
$ min3=allpairs(1,i)
1228
c Check that the pair are indeed different. Might not be the case if
1229
c The process contains some epsilon_ijk somewhere else.
1230
if (i3bar.gt.1.and.i3.gt.1)then
1231
if (max3bar.eq.min3bar)then
1232
c try to change min3bar
1235
c search a new pair but with a different index!
1236
if(allpairs(1,i).eq.max3.and.
1237
$ allpairs(2,i).lt.min3bar.and.
1238
$ allpairs(2,i).ne.max3bar)then
1239
min3bar=allpairs(2,i)
1242
c check if we found a new one. If not try to change the other index (max3bar)
1243
if (min3bar.eq.10000)then
1246
c search a new pair but with a different index!
1248
if(allpairs(1,i).eq.min3.and.
1249
$ allpairs(2,i).gt.max3bar.and.
1250
$ allpairs(2,i).ne.min3bar) then
1251
max3bar = allpairs(2,i)
1254
c This should not happen.
1255
if (max3bar.eq.0)then
1256
write(*,*) "colorflow problem"
1257
call write_error(1001,0,0)
1261
c Doing the same but for the color index.
1262
if (max3.eq.min3)then
1263
c try to change min3
1266
if(allpairs(2,i).eq.max3bar.and.
1267
$ allpairs(1,i).lt.min3.and.
1268
$ allpairs(1,i).ne.max3)then
1272
if (min3.eq.10000)then
1273
min3 = max3 ! restore value
1275
c try to change max3
1277
if(allpairs(2,i).eq.min3bar.and.
1278
$ allpairs(1,i).gt.max3.and.
1279
$ allpairs(1,i).ne.min3) then
1280
max3 = allpairs(1,i)
1284
write(*,*) "colorflow problem"
1291
if (max3.gt.0.and.max3bar.gt.0) then
1292
c We have found our two pairs, so we're done
1296
if(max3.gt.0.or.max3bar.gt.0)then
1301
c Find pair for non-maximum (where we allow all colors)
1302
maxcol=max(max3,max3bar)
1303
if(maxcol.eq.max3) then
1311
if(icolmp(1,i).eq.0.and.i3now.gt.0) cycle
1312
if(icolmp(1,i).eq.maxcol.or.icolmp(1,i).eq.mincol)
1315
if(icolmp(2,j).eq.0.and.i3barnow.gt.0) cycle
1316
if(i.eq.j.or.icolmp(1,i).eq.icolmp(2,j)) cycle
1317
if(icolmp(2,j).eq.maxcol.or.icolmp(2,j).eq.mincol)
1320
allpairs(1,npairs)=icolmp(1,i)
1321
allpairs(2,npairs)=icolmp(2,j)
1325
if(maxcol.eq.max3)then
1327
max3bar=allpairs(2,1)
1330
min3bar=allpairs(2,1)
1334
c print *,'allpairs: ',((allpairs(i,j),i=1,2),j=1,npairs)