11 &q2min,q2max,w2min,w2max,ilep,inu,ig,iz
13 INTEGER ksave,ilep,inu,ig,iz
20 COMMON /leptou/ cut(14),lst(40),parl(30),
22 REAL cut,parl,
x,
y,w2,q2,u
26 COMMON /linter/ pari(50),ewqc(2,2,8),qc(8),zl(2,4),zq(2,8),pq(17)
27 REAL pari,ewqc,qc,zl,zq,pq
30 COMMON /loptim/ optx(4),opty(4),optq2(4),optw2(4),comfac
31 REAL optx,opty,optq2,optw2,comfac
36 COMMON /flinfo/ rflq,rflg,rflm,rflt
37 REAL rflq,rflg,rflm,rflt
42 common/lujets/
n,
k(nlupdm,5),
p(nlupdm,nplbuf),
v(nlupdm,5)
47 common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
54 INTEGER lqcd,ltm,lht,
lkinem
55 REAL w2low,w2upp,ylow,yupp,q2low,q2upp,pnt,pqh,
s,pm2,
56 +xpq,xdpq,gfq2,aemcor,
ulalem,zlep,a,b,flg,flq,
57 +flm,flt,f2em,pqh17,weight,hx,xfact,q2fact,hy,yfact,hq2,
58 +w2fact,sigl,sigr,sigma,viol,yq,yqb,fyq,fydq,hw2,which
61 dimension pqh(17,2),pnt(2,2),xpq(-6:6),xdpq(-6:6)
67 DOUBLE PRECISION dari27,dari28
68 DATA dari27,dari28/2*0.d0/
69 DATA w2low,w2upp,ylow,yupp,q2low,q2upp/6*0./
96 & (w2min-pm2)/
max(
s*(1.-
x),1.e-22))
98 & (w2max-pm2)/
max(
s*(1.-
x),1.e-22))
104 IF(pari(28).LT.0.5)
THEN
109 100 dari28=dari28+1.d0
117 which=(optx(1)+optx(2)+optx(3)+optx(4))*
rlu(0)
118 IF(which.LE.optx(1))
THEN
120 ELSEIF(which.LE.(optx(1)+optx(2)))
THEN
122 ELSEIF(which.LE.(optx(1)+optx(2)+optx(3)))
THEN
127 IF(lst(31).EQ.1)
THEN
135 IF(q2upp.LT.q2low) goto 101
136 which=(optq2(1)+optq2(2)+optq2(3)+optq2(4))*
rlu(0)
137 IF(which.LE.optq2(1))
THEN
138 q2=q2low+
rlu(0)*(q2upp-q2low)
139 ELSEIF(which.LE.(optq2(1)+optq2(2)))
THEN
140 q2=q2low*(q2upp/q2low)**
rlu(0)
141 ELSEIF(which.LE.(optq2(1)+optq2(2)+optq2(3)))
THEN
142 q2=q2low*q2upp/(q2upp+
rlu(0)*(q2low-q2upp))
144 q2=sqrt((q2low*q2upp)**2/(q2upp**2+
rlu(0)*(q2low**2-q2upp**2)))
148 ELSEIF(lst(31).EQ.2)
THEN
156 IF(yupp.LT.ylow) goto 101
157 which=(opty(1)+opty(2)+opty(3)+opty(4))*
rlu(0)
158 IF(which.LE.opty(1))
THEN
159 y=ylow+
rlu(0)*(yupp-ylow)
160 ELSEIF(which.LE.(opty(1)+opty(2)))
THEN
161 y=ylow*(yupp/ylow)**
rlu(0)
162 ELSEIF(which.LE.(opty(1)+opty(2)+opty(3)))
THEN
163 y=ylow*yupp/(yupp+
rlu(0)*(yupp-ylow))
165 y=sqrt((ylow*yupp)**2/(yupp**2+
rlu(0)*(ylow**2-yupp**2)))
168 IF(q2.LT.q2min.OR.q2.GT.q2max) goto 100
169 ELSEIF(lst(31).EQ.3)
THEN
175 w2low=
max(w2min,(1.-
x)*
ymin*
s+pm2,q2min*(1.-
x)/
x+pm2)
176 w2upp=
min(w2max,(1.-
x)*
ymax*
s+pm2,q2max*(1.-
x)/
x+pm2)
177 IF(w2upp.LT.w2low) goto 101
178 which=(optw2(1)+optw2(2)+optw2(3)+optw2(4))*
rlu(0)
179 IF(which.LE.optw2(1))
THEN
180 w2=w2low+
rlu(0)*(w2upp-w2low)
181 ELSEIF(which.LE.(optw2(1)+optw2(2)))
THEN
182 w2=w2low*(w2upp/w2low)**
rlu(0)
183 ELSEIF(which.LE.(optw2(1)+optw2(2)+optw2(3)))
THEN
184 w2=w2low*w2upp/(w2upp+
rlu(0)*(w2low-w2upp))
186 w2=sqrt((w2low*w2upp)**2/(w2upp**2+
rlu(0)*(w2low**2-w2upp**2)))
188 y=(w2-pm2)/((1.-
x)*parl(21))
191 IF(q2.LT.q2min.OR.q2.GT.q2max) goto 100
193 110
IF(
lkinem(lst(2)).NE.0)
THEN
196 IF(ncut.LE.9999) goto 100
197 IF(lst(3).GE.1)
WRITE(6,1200)
203 pari(24)=(1.+(1.-
y)**2)/2.
205 pari(26)=(1.-(1.-
y)**2)/2.
211 IF(parl(6).GT.+0.99) ih=2
212 200 lst(30)=
sign(1.,ih-1.5)
227 IF(lst(23).EQ.2)
THEN
229 IF(ksave(1).LT.0.AND.ih.EQ.1
230 & .OR.ksave(1).GT.0.AND.ih.EQ.2) goto 240
231 yq=pari(24)-lst(30)*pari(26)
232 yqb=pari(24)+lst(30)*pari(26)
233 IF(pari(11).GT.1.e-06)
THEN
235 pnt(1,ih)=(1.-pari(11))*pari(13)*yq
236 pnt(2,ih)=pari(11)*pari(12)*yq
238 pntdu(1,2,ih)=pari(13)*yq
239 pntdu(2,2,ih)=pari(12)*yq
241 pntdus(1,2,ih)=pari(43)*yq
242 pntdus(2,2,ih)=pari(42)*yq
244 pnt(1,ih)=(1.-pari(11))*pari(12)*yq
245 pnt(2,ih)=pari(11)*pari(13)*yq
247 pntdu(1,1,ih)=pari(12)*yq
248 pntdu(2,1,ih)=pari(13)*yq
250 pntdus(1,1,ih)=pari(42)*yq
251 pntdus(2,1,ih)=pari(43)*yq
255 IF(
k(3,2)*qc(i).LT.0)
THEN
258 pqh(i+lst(12),ih)=xpq(-i)*yqb
263 gfq2=q2/(pmas(23,1)**2+q2)*sqrt(2.)*parl(17)*pmas(23,1)**2/
264 & (3.1415927*parl(16))
267 IF(lst(18).GE.2) aemcor=
ulalem(q2)/parl(16)
269 zlep=zl(ih,ilep+2*inu)
270 DO 230 i=1,
max(lst(12),lst(13))
271 a=(-ig*qc(i)*aemcor+iz*gfq2*zlep*zq(ih,i))**2
272 b=(-ig*qc(i)*aemcor+iz*gfq2*zlep*zq(ii,i))**2
276 IF(i.GT.lst(12)) goto 230
277 fyq=(a+b)*pari(24)+(a-b)*pari(26)
284 pqh(i,ih)=xpq(i)*fyq+lst(40)*xdpq(i)*fydq
289 IF(i.LE.2.AND.pari(11).GT.1.e-06)
THEN
290 pnt(1,ih)=pnt(1,ih)+(1.-pari(11))*(pari(11+i)*fyq+
291 & lst(40)*pari(37+i)*fydq)
292 pnt(2,ih)=pnt(2,ih)+pari(11)*(pari(14-i)*fyq+
293 & lst(40)*pari(40-i)*fydq)
296 pntdu(1,i,ih)=pari(11+i)*fyq
297 & + lst(40) * pari(37+i)*fydq
298 pntdu(2,i,ih)=pari(14-i)*fyq
299 & + lst(40) * pari(40-i)*fydq
302 pntdus(1,i,ih)=((a+b)*pari(24)-(a-b)*pari(26))
303 & * pari(41+i) + lst(40) * pari(43+i) * fydq
304 pntdus(2,i,ih)=((a+b)*pari(24)-(a-b)*pari(26))
305 & * pari(44-i) + lst(40) * pari(46-i) * fydq
313 pqh(i+lst(12),ih)=xpq(-i)*((a+b)*pari(24)-(a-b)*pari(26))+
314 & lst(40)*xdpq(-i)*fydq
320 300 pqh(17,ih)=pqh(17,ih)+pqh(i,ih)+pqh(i+lst(12),ih)
322 IF(abs(parl(6)).LT.0.99.AND.ih.EQ.1)
THEN
331 IF(lst(11).NE.0.AND.(lst(23).EQ.1.OR.lst(23).EQ.4)
332 &.AND.lst(2).NE.-3)
THEN
335 ltm=mod(lst(11)/10,10)
339 IF(lqcd.EQ.1.OR.ltm.EQ.1) CALL
flipol(flq,flg,flm)
345 If (lqcd.EQ.2) CALL
flintg(flq,flg,flm)
349 IF(ltm.GE.1.OR.lht.GE.1)
THEN
352 301 f2em=f2em+qc(i)**2*(xpq(i)+xpq(-i))
353 IF(ltm.GE.1) flm=flm-2.*
x**2*psave(3,2,5)**2/q2*f2em
354 IF(lht.GE.1) flt=8.*parl(19)/q2*f2em
359 pqh(17,ih)=pqh(17,ih)-
y**2*(flq+flg+flm+flt)
361 305 pqh(i,ih)=pqh(i,ih)*pqh(17,ih)/pqh17
365 310 pq(i)=(1.-parl(6))/2.*pqh(i,1)+(1.+parl(6))/2.*pqh(i,2)
368 rflq=-
y**2*flq/
max(pq(17),1.e-33)
369 rflg=-
y**2*flg/
max(pq(17),1.e-33)
370 rflm=-
y**2*flm/
max(pq(17),1.e-33)
371 rflt=-
y**2*flt/
max(pq(17),1.e-33)
375 IF(lst(31).EQ.1)
THEN
376 IF(lst(23).EQ.2)
THEN
377 comfac=1./
x/(1.+q2/pmas(24,1)**2)**2
381 ELSEIF(lst(31).EQ.2)
THEN
382 IF(lst(23).EQ.2)
THEN
383 comfac=1./(1.+q2/pmas(24,1)**2)**2*parl(21)
385 comfac=1./q2**2*parl(21)
387 ELSEIF(lst(31).EQ.3)
THEN
388 IF(lst(23).EQ.2)
THEN
389 comfac=1./
x/(1.+q2/pmas(24,1)**2)**2 *
x/(1.-
x)
391 comfac=1./
x/q2**2 *
x/(1.-
x)
399 IF(lst(2).LE.-2)
RETURN
403 xfact=optx(1)+optx(2)+optx(3)+optx(4)
404 IF(lst(31).EQ.1)
THEN
405 hq2=optq2(1)/(q2upp-q2low)
406 & +1./alog(q2upp/q2low)*optq2(2)/q2
407 & +q2low*q2upp/(q2upp-q2low)*optq2(3)/q2**2
408 & +2*(q2low*q2upp)**2/(q2upp**2-q2low**2)*optq2(4)/q2**3
409 q2fact=optq2(1)+optq2(2)+optq2(3)+optq2(4)
410 comfac=comfac*xfact*q2fact/hx/hq2
411 ELSEIF(lst(31).EQ.2)
THEN
412 hy=opty(1)/(yupp-ylow)+1./alog(yupp/ylow)*opty(2)/
y
413 & +ylow*yupp/(yupp-ylow)*opty(3)/
y**2
414 & +2*(ylow*yupp)**2/(yupp**2-ylow**2)*opty(4)/
y**3
415 yfact=opty(1)+opty(2)+opty(3)+opty(4)
416 comfac=comfac*xfact*yfact/hx/hy
417 ELSEIF(lst(31).EQ.3)
THEN
418 hw2=optw2(1)/(w2upp-w2low)
419 & +1./alog(w2upp/w2low)*optw2(2)/w2
420 & +w2low*w2upp/(w2upp-w2low)*optw2(3)/w2**2
421 & +2*(w2low*w2upp)**2/(w2upp**2-w2low**2)*optw2(4)/w2**3
422 w2fact=optw2(1)+optw2(2)+optw2(3)+optw2(4)
423 comfac=comfac*xfact*w2fact/hx/hw2
425 IF(lst(2).LE.0)
RETURN
428 sigl=(1.-parl(6))/2.*pqh(17,1)
429 sigr=(1.+parl(6))/2.*pqh(17,2)
434 dari27=dari27+dble(sigma)*dble(comfac)*weight
436 viol=sigma*comfac/pari(lst(23))
437 IF(viol.GT.pari(32))
THEN
439 IF(pari(32).GT.1.)
THEN
440 pari(lst(23))=pari(lst(23))*pari(32)
441 IF(lst(3).GE.1)
WRITE(6,1300) pari(32),int(pari(30)+1),
442 & pari(lst(23)),
x,
y,q2,w2
446 IF(viol.LT.
rlu(0)) goto 100
447 parl(24)=pari(31)*dari27/dari28
449 IF(abs(parl(6)).LT.0.99)
THEN
452 IF(
rlu(0)*sigma.GT.sigl) ih=2
454 lst(30)=
sign(1.,ih-1.5)
462 IF(pari(11).GT.1.e-06)
THEN
463 IF(
rlu(0).LT.(pari(11)*(pqh(17,ih)-pnt(1,ih)-pnt(2,ih))+
464 & pnt(2,ih))/pqh(17,ih))
THEN
470 pq(17)=pq(17)-pq(1)-pq(2)-pq(1+lst(12))-pq(2+lst(12))
471 pq(1) =pntdu(lst(22),1,ih)
472 pq(2) =pntdu(lst(22),2,ih)
473 pq(1+lst(12))=pntdus(lst(22),1,ih)
474 pq(2+lst(12))=pntdus(lst(22),2,ih)
475 pq(17)=pq(17)+pq(1)+pq(2)+pq(1+lst(12))+pq(2+lst(12))
479 1200
FORMAT(
' Warning: LEPTOX is looping, cannot find allowed ',
480 &
'phase space point due to cuts,',/,
481 &10
x,
'check, in particular, CUT(11) to CUT(14)')
482 1300
FORMAT(
' Warning: maximum violated by a factor ',f7.3,
483 &
' in event ',i7,/,
' maximum increased by this factor to ',e12.3,
484 &/,
' Point of violation: x, y, Q**2, W**2 = ',4g10.3)