1
subroutine set_invarients(nfinal,ninvar)
2
c***************************************************************************
3
c Calculates all of the invarients for a 2->n process
4
c***************************************************************************
17
integer ip1,ip2,ipstart,ipstop,np,i
23
integer imom(maxinvar),ninvarients
24
common/to_invarients/imom ,ninvarients
36
c First do all the s-channel
39
do ip1 = ipstart,ipstop-1
40
do ip2=int((real(imom(ip1))/10.-imom(ip1)/10)*10+.1)+1,
43
if (np .gt. maxinvar) then
44
print*,'Sorry too many invarients',np,ip1,ip2,ncycle
47
imom(np)=imom(ip1)*10+imom(ip2)
48
if (imom(np) .lt. 10) then
49
write(buff,'(a2,i1)') 'S?',imom(np)
50
elseif (imom(np) .lt. 100) then
51
write(buff,'(a2,i2)') 'S?',imom(np)
52
elseif (imom(np) .lt. 1000) then
53
write(buff,'(a2,i3)') 'S?',imom(np)
54
elseif (imom(np) .lt. 10000) then
55
write(buff,'(a2,i4)') 'S?',imom(np)
56
elseif (imom(np) .lt. 100000) then
57
write(buff,'(a2,i5)') 'S?',imom(np)
59
write(buff,'(a2,i6)') 'S?',imom(ip1)
61
c call hbook1(100+np-nfinal,buff,100,0.,1.,0.)
62
c write(*,'(i4,i6)') np-nfinal,imom(np)
63
write(*,'(i4,a1,a6)') np-nfinal,'=',buff
64
if ((np-nfinal)/7 .eq. real(np-nfinal)/7.) write(*,*)' '
71
c Now do the t-channel
75
c write(*,'(i4,a2,i6)') np-nfinal+ip1,'a-',imom(ip1)
76
if (imom(ip1) .lt. 10) then
77
write(buff,'(a2,i1)') 'T?',imom(ip1)
78
elseif (imom(ip1) .lt. 100) then
79
write(buff,'(a2,i2)') 'T?',imom(ip1)
80
elseif (imom(ip1) .lt. 1000) then
81
write(buff,'(a2,i3)') 'T?',imom(ip1)
82
elseif (imom(ip1) .lt. 10000) then
83
write(buff,'(a2,i4)') 'T?',imom(ip1)
84
elseif (imom(ip1) .lt. 100000) then
85
write(buff,'(a2,i5)') 'T?',imom(ip1)
87
write(buff,'(a2,i6)') 'T?',imom(ip1)
89
c call hbook1(100+np-nfinal+ip1,buff,100,0.,1.,0.)
90
c write(*,*) np-nfinal+ip1,buff
91
write(*,'(i4,a1,a6)') np-nfinal+ip1,'=',buff
92
if ((np-nfinal+ip1)/7 .eq. real(np-nfinal+ip1)/7.) write(*,*)
95
print*,'Particles, Invarients',nfinal,np-nfinal+np
96
ninvarients=np-nfinal+np
98
if (ninvarients .gt. maxinvar) then
99
print*,'Error too many invarients to map'
105
subroutine fill_invarients(nfinal,p1,s,xx)
106
c***************************************************************************
107
c Calculates all of the invarients for a 2->n process
108
c***************************************************************************
118
double precision p1(0:3,nfinal+2),s,xx(55)
122
integer ip1,ip2,ipstart,ipstop,np,i,j
123
integer imom(maxinvar)
126
double precision p(0:3,maxinvar),ptemp(0:3)
141
c write(*,'(i3,4f17.8)') i,(p(j,i),j=0,3)
147
c First do all the s-channel
150
do ip1 = ipstart,ipstop-1
151
do ip2=int((real(imom(ip1))/10.-imom(ip1)/10)*10+.1)+1
154
if (np .gt. maxinvar) then
155
print*,'Sorry too many invarients',np,ip1,ip2,ncycle
158
imom(np)=imom(ip1)*10+imom(ip2)
160
p(j,np) = p(j,ip1)+p(j,ip2)
162
xx(np-nfinal) = dot(p(0,np),p(0,np))/s
163
c call hfill(100+np-nfinal,
164
c & real(dot(p(0,np),p(0,np))/s),0.,wgt)
165
c write(*,'(i4,3f20.8)') np-nfinal,
166
c & real(dot(p(0,np),p(0,np))/s)
173
c Now do the t-channel
178
ptemp(j)=p1(j,1)-p(j,ip1)
180
xx(np-nfinal+ip1)= .5d0*(dot(ptemp,ptemp)/s+1d0)
181
c call hfill(100+np-nfinal+ip1,real(-dot(ptemp,ptemp)/s),0.,wgt)
182
c write(*,'(i4,3f20.8)') np-nfinal+ip1,
183
c & real(-dot(ptemp,ptemp)/s)
188
subroutine map_invarients(Minvar,nconfigs,ninvar,mincfig,maxcfig,nexternal,nincoming)
189
c****************************************************************************
190
c Determines mappings for each structure of invarients onto integration
191
c variables. Input: Ninvar, iforest. Output: Minvar, ninvar
192
c****************************************************************************
201
integer Minvar(maxdim,lmaxconfigs),nconfigs,ninvar,nexternal,nincoming
202
integer mincfig,maxcfig
206
integer iconfig, jgrid,j, nbranch
207
logical found,tchannel
211
integer imom(maxinvar),ninvarients
212
common/to_invarients/imom ,ninvarients
213
integer iforest(2,-max_branch:-1,lmaxconfigs)
214
common/to_forest/ iforest
220
nbranch = nexternal-2
224
c Try simple mapping if nconfigs = 1
227
if (nconfigs .eq. 1) then
235
do iconfig=mincfig,maxcfig
238
if (iforest(1,-j,iconfig) .eq. 1) then
242
minvar(j,iconfig) = jgrid
243
if (tchannel .and. j .lt. nbranch-1) then
245
minvar(nbranch-1+2*j,iconfig)=jgrid
248
if (.not. tchannel .and. nincoming.eq.2) then !Don't need last s-channel
250
minvar(nbranch-1,iconfig)=0
254
c minvar(3*nbranch-3,iconfig)=jgrid
256
c minvar(3*nbranch-2,iconfig)=jgrid
259
c minvar(3*nbranch-3,iconfig)=jgrid
261
enddo !Each configurations
266
subroutine sortint(n,ra)
287
if(ra(j).lt.ra(j+1))j=j+1