2
c*******************************************************************************
3
c Program that takes topologies from configs.inc and writes
4
c out new topologies with last particle removed in file
5
c configs-1.inc and props-1.inc
6
c******************************************************************************
12
include 'nexternal.inc'
16
integer iconfig,igraph,i,jbranch,ibranch,jconfig
17
integer isubprop, isubval
18
integer iforest(2,-max_branch:-1,lmaxconfigs)
19
integer iforest2(2,-max_branch:-1,lmaxconfigs)
21
integer mapconfig(0:lmaxconfigs)
22
integer mapconfig2(0:lmaxconfigs)
23
double precision spole(maxinvar),swidth(maxinvar),bwjac
24
integer sprop(-max_branch:-1,lmaxconfigs)
25
integer tprid(-max_branch:-1,lmaxconfigs)
26
integer sprop2(-max_branch:-1,lmaxconfigs)
27
integer tprid2(-max_branch:-1,lmaxconfigs)
28
character*50 buff_pmass
29
character*50 buff_pwidth
31
character*10 oniumtype
36
logical one_gluon_config
37
logical two_gluon_config
45
open(unit=35, file="configs_temp.inc",status="unknown",err=999)
46
open(unit=36, file="props.inc",status="old",err=999)
47
open(unit=37, file="props_temp.inc",status="unknown",err=999)
49
open(unit=38, file="oniumtype.mg",status="unknown",err=999)
50
read(38,'(a)') oniumtype
52
call no_spaces(oniumtype,nchars)
56
do iconfig = 1, mapconfig(0) !Loop over all configurations
58
c first quick check if we need to keep the conf.
61
if(oniumtype(4:4).eq.'1') then
62
if(one_gluon_config(iforest,
63
& sprop,tprid,iconfig)) then
65
c jump lines in props.inc
68
do while (ibranch .lt. nexternal-2)
70
read(36,'(a)') buff_pmass
71
read(36,'(a)') buff_pwidth
72
read(36,'(a)') buff_pow
75
c jump to the next config
81
if(oniumtype(1:1).eq.'3'.and.oniumtype(2:2).eq.'S') then
82
if (two_gluon_config(iforest,
83
& sprop,tprid,iconfig)) then
85
c jump lines in props.inc
88
do while (ibranch .lt. nexternal-2)
90
read(36,'(a)') buff_pmass
91
read(36,'(a)') buff_pwidth
92
read(36,'(a)') buff_pow
95
c jump to the next config
103
mapconfig2(jconfig)=mapconfig(iconfig)
106
c Second write out configuration # and graphs
108
igraph = mapconfig(iconfig)
110
write(35,'(a,i6)') 'c Graph ',igraph
111
write(35,'(6x,a,i4,a,i4,a)')
112
$ 'data mapconfig(',jconfig,') /',igraph,'/'
114
c Reset all parameters for configuration
121
do while (ibranch .lt. nexternal-2+t_chan)
122
ibranch = ibranch + 1
124
if (iforest(1,-ibranch,iconfig) .eq. 1) t_chan=1
125
c sometimes there is 1 branch less in props.inc
126
if(t_chan.ne.1.or. ibranch.ne.nexternal-1) then
127
read(36,'(a)') buff_pmass
128
read(36,'(a)') buff_pwidth
129
read(36,'(a)') buff_pow
130
c write(*,'(i2,a)') ibranch, buff_pmass
132
if (iforest(1,-ibranch,iconfig) .eq. (nexternal+1) .or.
133
$ iforest(2,-ibranch,iconfig) .eq. (nexternal+1)) then !Remove this one
134
c isubprop records the index of the removed branch
135
c isubval records the index of the particle initially grouped with particle nexternal+1
136
c isubprop is to be replaced by isubval later on
138
isubval = iforest(1,-ibranch,iconfig)+
139
$ iforest(2,-ibranch,iconfig)-nexternal-1
140
else !write out this line
141
jbranch=jbranch+1 !new ordering for branches
143
if (iforest(i,-ibranch,iconfig) .eq. isubprop) then
144
iforest(i,-ibranch,iconfig) = isubval
145
cPierre: here we have to add another condition
146
elseif(isubprop.ne.0.and. ! we have already met part. nexternal+1
147
& isubprop.gt.iforest(i,-ibranch,iconfig)) then ! i.e iforest(i,-ibr) is an intermediate part with an index smaller then isubprop
148
iforest(i,-ibranch,iconfig)=
149
& iforest(i,-ibranch,iconfig)+1
154
if(jbranch.ne.ibranch) then
155
write(buff_pmass(13:15),'(i3)') -jbranch
156
write(buff_pwidth(14:16),'(i3)') -jbranch
157
write(buff_pow(11:13),'(i3)') -jbranch
159
write(buff_pmass(17:20),'(i4)') jconfig
160
write(buff_pwidth(18:21),'(i4)') jconfig
161
write(buff_pow(15:18),'(i4)') jconfig
164
c write info in configs-1.inc
165
write(35,99) -jbranch,jconfig,iforest(1,-ibranch,iconfig)
166
$ ,iforest(2,-ibranch,iconfig),"?","?"
167
iforest2(1,-jbranch,jconfig)=iforest(1,-ibranch,iconfig)
168
iforest2(2,-jbranch,jconfig)=iforest(2,-ibranch,iconfig)
170
write(35,92) -jbranch,jconfig,sprop(-ibranch,iconfig)
171
sprop2(-jbranch,jconfig)=sprop(-ibranch,iconfig)
172
elseif(jbranch.lt.nexternal-2) then
173
write(35,93) -jbranch,jconfig,tprid(-ibranch,iconfig)
174
tprid2(-jbranch,jconfig)=tprid(-ibranch,iconfig)
176
c here we should also write pmass,pwidth,pow
177
c (sometimes there is 1 branch less in props.inc > condition on jbranch)
178
if(t_chan.ne.1.or. ibranch.ne.nexternal-1) then
180
c here break the loop in case we have just read the one-to-last branch
181
c and haven't met particle nexternal
182
if(isubprop.eq.0.and.ibranch.eq.nexternal-2) then
186
write(37,'(a)') buff_pmass
187
write(37,'(a)') buff_pwidth
188
write(37,'(a)') buff_pow
195
cPierre: add forgotten line
196
write(35,'(6x,a,i4,a,i4,a)')
197
$ 'data mapconfig(',0,') /',jconfig,'/'
198
mapconfig2(0)=jconfig
205
c here we should remove equivalent configs
206
call check_equivalent_configs(mapconfig2,iforest2,sprop2,tprid2)
209
99 format(6x,'data(iforest(i,',i3,',',i4,'),i=1,2) /',i3,',',i3,'/',
213
92 format(6x,'data sprop(',i4,',',i4,') /',i8,'/')
214
93 format(6x,'data tprid(',i4,',',i4,') /',i8,'/')
222
subroutine check_equivalent_configs(mapconfig,iforest,sprop,
224
c*******************************************************************************
225
c Program that removes redundant topologies from configs_temp.inc
226
c and props_temp.inc. Results written in configs-1.inc
227
c******************************************************************************
233
include 'nexternal.inc'
237
integer mapconfig(0:lmaxconfigs)
238
integer iforest(2,-max_branch:-1,lmaxconfigs)
239
integer sprop(-max_branch:-1,lmaxconfigs)
240
integer tprid(-max_branch:-1,lmaxconfigs)
244
integer iconfig,igraph,i,jbranch,ibranch,temp_config
245
integer t_chan,nb_configs
246
character*50 buff_pmass(-nexternal:0,lmaxconfigs)
247
character*50 buff_pwidth(-nexternal:0,lmaxconfigs)
248
character*50 buff_pow(-nexternal:0,lmaxconfigs)
249
character*50 buff_pmass_temp
250
character*50 buff_pwidth_temp
251
character*50 buff_pow_temp
252
logical foundmatch,foundmatch2
259
open(unit=35, file="configs-1.inc",status="unknown",err=998)
260
open(unit=36, file="props_temp.inc",status="old",err=998)
261
open(unit=37, file="props-1.inc",status="unknown",err=998)
266
c write(*,*) 'nb of configs before check equiv: ',mapconfig(0)
268
do iconfig = 1, mapconfig(0) !Loop over all configurations
272
do while (ibranch .lt. nexternal-3+t_chan)
273
ibranch = ibranch + 1
274
if (iforest(1,-ibranch,iconfig) .eq. 1) t_chan=1
275
c sometimes there is 1 branch less in props.inc
276
if((t_chan.ne.1).or. (ibranch.lt.(nexternal-2))) then
277
read(36,'(a)') buff_pmass(ibranch,iconfig)
278
read(36,'(a)') buff_pwidth(ibranch,iconfig)
279
read(36,'(a)') buff_pow(ibranch,iconfig)
284
do while (temp_config .lt. iconfig.and..not.foundmatch2)
288
do while (ibranch .lt. nexternal-3+t_chan)
289
ibranch = ibranch + 1
290
if (iforest(1,-ibranch,iconfig) .eq. 1) t_chan=1
291
if(iforest(1,-ibranch, temp_config).ne.
292
& iforest(1,-ibranch,iconfig).and.iforest(1,-ibranch,temp_config)
293
& .ne. iforest(2,-ibranch,iconfig)) foundmatch=.false.
295
if(iforest(2,-ibranch, temp_config).ne.
296
& iforest(1,-ibranch,iconfig).and.iforest(2,-ibranch,temp_config)
297
& .ne. iforest(2,-ibranch,iconfig)) foundmatch=.false.
299
if (t_chan.eq.0) then
300
if(sprop(-ibranch, temp_config).ne.
301
& sprop(-ibranch,iconfig)) foundmatch=.false.
303
if(tprid(-ibranch, temp_config).ne.
304
& tprid(-ibranch,iconfig)) foundmatch=.false.
307
c now check props.inc
309
if (buff_pmass(ibranch,temp_config)(23:50).ne.
310
& buff_pmass(ibranch,iconfig)(23:50)) foundmatch=.false.
311
if (buff_pwidth(ibranch,temp_config)(24:50).ne.
312
& buff_pwidth(ibranch,iconfig)(24:50)) foundmatch=.false.
313
if (buff_pow(ibranch,temp_config)(21:50).ne.
314
& buff_pow(ibranch,iconfig)(21:50)) foundmatch=.false.
316
if (buff_pmass(ibranch,temp_config)(1:16).ne.
317
& buff_pmass(ibranch,iconfig)(1:16)) foundmatch=.false.
318
if (buff_pwidth(ibranch,temp_config)(1:17).ne.
319
& buff_pwidth(ibranch,iconfig)(1:17)) foundmatch=.false.
320
if (buff_pow(ibranch,temp_config)(1:14).ne.
321
& buff_pow(ibranch,iconfig)(1:14)) foundmatch=.false.
324
enddo ! end loop over branches
327
c write(*,*) 'Removing config ',iconfig
330
temp_config=temp_config+1
331
enddo ! inner loop over configs
332
if(.not.foundmatch2) then !write config
333
nb_configs=nb_configs+1
334
igraph = mapconfig(iconfig)
335
write(35,'(a,i6)') 'c Graph ',igraph
336
write(35,'(6x,a,i4,a,i4,a)')
337
$ 'data mapconfig(',nb_configs,') /',igraph,'/'
340
do while (ibranch .lt. nexternal-3+t_chan)
341
ibranch = ibranch + 1
342
if (iforest(1,-ibranch,iconfig) .eq. 1) t_chan=1
344
write(35,20) -ibranch,nb_configs,iforest(1,-ibranch,iconfig)
345
$ ,iforest(2,-ibranch,iconfig),"?","?"
347
write(35,21) -ibranch,nb_configs,sprop(-ibranch,iconfig)
348
elseif(ibranch.lt.nexternal-2) then
349
write(35,22) -ibranch,nb_configs,tprid(-ibranch,iconfig)
352
if(t_chan.ne.1.or. ibranch.lt.nexternal-2) then
353
buff_pmass_temp=buff_pmass(ibranch,iconfig)
354
buff_pwidth_temp=buff_pwidth(ibranch,iconfig)
355
buff_pow_temp=buff_pow(ibranch,iconfig)
356
write(buff_pmass_temp(17:20),'(i4)') nb_configs
357
write(buff_pwidth_temp(18:21),'(i4)') nb_configs
358
write(buff_pow_temp(15:18),'(i4)') nb_configs
360
write(37,'(a)') buff_pmass_temp
361
write(37,'(a)') buff_pwidth_temp
362
write(37,'(a)') buff_pow_temp
368
write(35,'(6x,a,i4,a,i4,a)')
369
$ 'data mapconfig(',0,') /',nb_configs,'/'
375
21 format(6x,'data sprop(',i4,',',i4,') /',i8,'/')
376
22 format(6x,'data tprid(',i4,',',i4,') /',i8,'/')
378
20 format(6x,'data(iforest(i,',i3,',',i4,'),i=1,2) /',i3,',',i3,'/',
383
logical function one_gluon_config(iforest,sprop,tprid,iconfig)
387
include 'nexternal.inc'
388
integer iforest(2,-max_branch:-1,lmaxconfigs)
389
integer iforest2(2,-max_branch:-1,lmaxconfigs)
390
integer sprop(-max_branch:-1,lmaxconfigs)
391
integer tprid(-max_branch:-1,lmaxconfigs)
396
integer ibranch,t_chan
398
one_gluon_config=.false.
401
c write(*,*) 'iconfig',iconfig
402
do while (ibranch .lt. nexternal-2+t_chan)
403
ibranch = ibranch + 1
405
if (iforest(1,-ibranch,iconfig) .eq. 1) t_chan=1
407
if (iforest(1,-ibranch,iconfig).eq.(nexternal+1)) then
408
if(iforest(2,-ibranch,iconfig).eq.(nexternal).and.
409
& sprop(-ibranch,iconfig).eq.21) then
410
one_gluon_config=.true.
416
if (iforest(1,-ibranch,iconfig).eq.nexternal) then
417
if(iforest(2,-ibranch,iconfig).eq.(nexternal+1).and.
418
& sprop(-ibranch,iconfig).eq.21) then
419
one_gluon_config=.true.
427
logical function two_gluon_config(iforest,sprop,tprid,iconfig)
430
include 'maxamps.inc'
432
include 'nexternal.inc'
433
integer iforest(2,-max_branch:-1,lmaxconfigs)
434
integer iforest2(2,-max_branch:-1,lmaxconfigs)
435
integer sprop(-max_branch:-1,lmaxconfigs)
436
integer tprid(-max_branch:-1,lmaxconfigs)
438
integer q_ass,qb_ass,prop_qb, prop_q
442
integer ibranch,t_chan,i
443
integer idup(nexternal,maxproc)
444
integer mothup(2,nexternal,maxproc)
445
integer icolup(2,nexternal,maxflow)
446
include 'leshouche.inc'
447
two_gluon_config=.false.
451
do while (ibranch .lt. nexternal-2+t_chan)
452
ibranch = ibranch + 1
454
if (iforest(1,-ibranch,iconfig) .eq. 1) t_chan=1
456
if (iforest(1,-ibranch,iconfig) .eq. (nexternal+1) .or.
457
$ iforest(2,-ibranch,iconfig) .eq. (nexternal+1)) then
459
qb_ass = iforest(1,-ibranch,iconfig)+
460
$ iforest(2,-ibranch,iconfig)-nexternal-1
463
if (iforest(1,-ibranch,iconfig) .eq. (nexternal) .or.
464
$ iforest(2,-ibranch,iconfig) .eq. (nexternal)) then
466
q_ass = iforest(1,-ibranch,iconfig)+
467
$ iforest(2,-ibranch,iconfig)-nexternal
471
if(qb_ass.eq.prop_q) then
474
if (idup(q_ass,1).ne.21) return
478
if(sprop(q_ass,iconfig).ne.21.and.tprid(q_ass,iconfig).ne.21) return
481
if(t_chan.eq.1.and.prop_qb.eq.(-nexternal+1) ) then
482
if(idup(2,1).ne.21) return
484
if(sprop(prop_qb,iconfig).ne.21.and.tprid(prop_qb,iconfig).ne.21) return
487
two_gluon_config=.true.
490
if(q_ass.eq.prop_qb) then
492
if (idup(qb_ass,1).ne.21) return
496
if(sprop(qb_ass,iconfig).ne.21.and.tprid(qb_ass,iconfig).ne.21) return
499
if(t_chan.eq.1.and.prop_q.eq.(-nexternal+1) ) then
500
if(idup(2,1).ne.21) return
502
if(sprop(prop_q,iconfig).ne.21.and.tprid(prop_q,iconfig).ne.21) return
505
two_gluon_config=.true.
512
subroutine no_spaces(buff,nchars)
513
c**********************************************************************
514
c Given buff a buffer of words separated by spaces
515
c returns it where all space are moved to the right
516
c returns also the length of the single word.
517
c maxlength is the length of the buffer
518
c AUTHOR: FABIO MALTONI
519
c**********************************************************************
525
parameter (maxline=10)
531
character*(maxline) buff
532
integer nchars,maxlength
537
character*(maxline) temp
542
c write (*,*) "buff=",buff(1:maxlength)
544
if(buff(i:i).ne.null) then
546
temp(nchars:nchars)=buff(i:i)
548
c write(*,*) i,":",buff(1:maxlength),":",temp(1:nchars),":"