4 SUBROUTINE lukfdi(KFL1,KFL2,KFL3,KF)
7 common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
9 common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
19 IF(kf1a.LE.10.AND.kf2a.LE.10.AND.kfl1*kfl2.GT.0)
RETURN
20 IF(kf1a.GT.10.AND.kf2a.GT.10)
RETURN
21 IF((kf1a.GT.10.OR.kf2a.GT.10).AND.kfl1*kfl2.LT.0)
RETURN
25 IF(mstj(15).EQ.1)
THEN
27 IF(kf1a.GE.1.AND.kf1a.LE.6) ktab1=kf1a
28 kfl1a=mod(kf1a/1000,10)
29 kfl1b=mod(kf1a/100,10)
31 IF(kfl1a.GE.1.AND.kfl1a.LE.4.AND.kfl1b.GE.1.AND.kfl1b.LE.4)
32 & ktab1=6+kfl1a*(kfl1a-2)+2*kfl1b+(kfl1s-1)/2
33 IF(kfl1a.GE.1.AND.kfl1a.LE.4.AND.kfl1a.EQ.kfl1b) ktab1=ktab1-1
34 IF(kf1a.GE.1.AND.kf1a.LE.6) kfl1a=kf1a
38 IF(kf2a.GE.1.AND.kf2a.LE.6) ktab2=kf2a
39 kfl2a=mod(kf2a/1000,10)
40 kfl2b=mod(kf2a/100,10)
42 IF(kfl2a.GE.1.AND.kfl2a.LE.4.AND.kfl2b.GE.1.AND.kfl2b.LE.4)
43 & ktab2=6+kfl2a*(kfl2a-2)+2*kfl2b+(kfl2s-1)/2
44 IF(kfl2a.GE.1.AND.kfl2a.LE.4.AND.kfl2a.EQ.kfl2b) ktab2=ktab2-1
46 IF(ktab1.GE.0.AND.ktab2.GE.0) goto 140
53 IF(mstj(12).GE.2)
THEN
55 par4m=1./(3.*sqrt(parj(4)))
56 pardm=parj(7)/(parj(7)+par3m*parj(6))
57 pars0=parj(5)*(2.+(1.+par2*par3m*parj(7))*(1.+par4m))
58 pars1=parj(7)*pars0/(2.*par3m)+parj(5)*(parj(6)*(1.+par4m)+
59 & par2*par3m*parj(6)*parj(7))
60 pars2=parj(5)*2.*parj(6)*parj(7)*(par2*parj(7)+(1.+par4m)/par3m)
61 parsm=
max(pars0,pars1,pars2)
62 par4=par4*(1.+parsm)/(1.+parsm/(3.*par4m))
69 IF(kf2a.EQ.0.AND.mstj(12).GE.1.AND.(1.+parj(1))*
rlu(0).GT.1.)
71 IF(kf2a.GT.10) mbary=2
72 IF(kf2a.GT.10.AND.kf2a.LE.10000) kfda=kf2a
75 IF(kf1a.LE.10000) kfda=kf1a
79 IF(kfda.NE.0.AND.mstj(12).GE.2)
THEN
80 kflda=mod(kfda/1000,10)
81 kfldb=mod(kfda/100,10)
84 IF(
max(kflda,kfldb).EQ.3) wtdq=pars1
85 IF(min(kflda,kfldb).EQ.3) wtdq=pars2
86 IF(kflds.EQ.1) wtdq=wtdq/(3.*par4m)
87 IF((1.+wtdq)*
rlu(0).GT.1.) mbary=-1
88 IF(mbary.EQ.-1.AND.kf2a.NE.0)
RETURN
95 IF(kf2a.EQ.0) kfl3=isign(1+int((2.+par2)*
rlu(0)),-kfl1)
96 kfla=
max(kf1a,kf2a+iabs(kfl3))
97 kflb=min(kf1a,kf2a+iabs(kfl3))
98 IF(kfla.NE.kf1a) kfs=-kfs
102 kfl1a=mod(kf1a/1000,10)
103 kfl1b=mod(kf1a/100,10)
104 110 kfl1d=kfl1a+int(
rlu(0)+0.5)*(kfl1b-kfl1a)
105 kfl1e=kfl1a+kfl1b-kfl1d
106 IF((kfl1d.EQ.3.AND.
rlu(0).GT.pardm).OR.(kfl1e.EQ.3.AND.
107 &
rlu(0).LT.pardm))
THEN
108 kfl1d=kfl1a+kfl1b-kfl1d
109 kfl1e=kfl1a+kfl1b-kfl1e
111 kfl3a=1+int((2.+par2*par3m*parj(7))*
rlu(0))
112 IF((kfl1e.NE.kfl3a.AND.
rlu(0).GT.(1.+par4m)/
max(2.,1.+par4m)).
113 & or.(kfl1e.EQ.kfl3a.AND.
rlu(0).GT.2./
max(2.,1.+par4m)))
116 IF(kfl1e.NE.kfl3a) kflds=2*int(
rlu(0)+1./(1.+par4m))+1
117 kfl3=isign(10000+1000*
max(kfl1e,kfl3a)+100*min(kfl1e,kfl3a)+
119 kfla=
max(kfl1d,kfl3a)
120 kflb=min(kfl1d,kfl3a)
121 IF(kfla.NE.kfl1d) kfs=-kfs
125 IF(kfla.LE.2) kmul=int(parj(11)+
rlu(0))
126 IF(kfla.EQ.3) kmul=int(parj(12)+
rlu(0))
127 IF(kfla.GE.4) kmul=int(parj(13)+
rlu(0))
128 IF(kmul.EQ.0.AND.parj(14).GT.0.)
THEN
129 IF(
rlu(0).LT.parj(14)) kmul=2
130 ELSEIF(kmul.EQ.1.AND.parj(15)+parj(16)+parj(17).GT.0.)
THEN
132 IF(rmul.LT.parj(15)) kmul=3
133 IF(kmul.EQ.1.AND.rmul.LT.parj(15)+parj(16)) kmul=4
134 IF(kmul.EQ.1.AND.rmul.LT.parj(15)+parj(16)+parj(17)) kmul=5
137 IF(kmul.EQ.0.OR.kmul.EQ.3) kfls=1
139 IF(kfla.NE.kflb)
THEN
140 kf=(100*kfla+10*kflb+kfls)*kfs*(-1)**kfla
144 IF(kfla.LE.3) kf=110*(1+int(rmix+parf(imix-1))+
145 & int(rmix+parf(imix)))+kfls
146 IF(kfla.GE.4) kf=110*kfla+kfls
148 IF(kmul.EQ.2.OR.kmul.EQ.3) kf=kf+isign(10000,kf)
149 IF(kmul.EQ.4) kf=kf+isign(20000,kf)
153 120
IF(kf1a.LE.10.AND.kf2a.EQ.0)
THEN
155 130 kflb=1+int((2.+par2*par3)*
rlu(0))
156 kflc=1+int((2.+par2*par3)*
rlu(0))
158 IF(kflb.GE.kflc) kflds=3
159 IF(kflds.EQ.1.AND.par4*
rlu(0).GT.1.) goto 130
160 IF(kflds.EQ.3.AND.par4.LT.
rlu(0)) goto 130
161 kfl3=isign(1000*
max(kflb,kflc)+100*min(kflb,kflc)+kflds,kfl1)
164 ELSEIF(kf1a.LE.10)
THEN
166 kflb=mod(kf2a/1000,10)
167 kflc=mod(kf2a/100,10)
172 IF(kf2a.EQ.0) kfl3=isign(1+int((2.+par2)*
rlu(0)),kfl1)
174 kflb=mod(kf1a/1000,10)
175 kflc=mod(kf1a/100,10)
181 IF(kflds.EQ.3.AND.kflb.NE.kflc) kbary=5
182 IF(kfla.NE.kflb.AND.kfla.NE.kflc) kbary=kbary+1
183 wt=parf(60+kbary)+parj(18)*parf(70+kbary)
184 IF(mbary.EQ.1.AND.mstj(12).GE.2)
THEN
186 IF(
max(kflb,kflc).EQ.3) wtdq=pars1
187 IF(min(kflb,kflc).EQ.3) wtdq=pars2
188 IF(kflds.EQ.1) wtdq=wtdq/(3.*par4m)
189 IF(kflds.EQ.1) wt=wt*(1.+wtdq)/(1.+parsm/(3.*par4m))
190 IF(kflds.EQ.3) wt=wt*(1.+wtdq)/(1.+parsm)
192 IF(kf2a.EQ.0.AND.wt.LT.
rlu(0)) goto 120
195 kfld=
max(kfla,kflb,kflc)
196 kflf=min(kfla,kflb,kflc)
197 kfle=kfla+kflb+kflc-kfld-kflf
199 IF((parf(60+kbary)+parj(18)*parf(70+kbary))*
rlu(0).GT.
200 & parf(60+kbary)) kfls=4
202 IF(kfls.EQ.2.AND.kfld.GT.kfle.AND.kfle.GT.kflf)
THEN
203 IF(kflds.EQ.1.AND.kfla.EQ.kfld) kfll=1
204 IF(kflds.EQ.1.AND.kfla.NE.kfld) kfll=int(0.25+
rlu(0))
205 IF(kflds.EQ.3.AND.kfla.NE.kfld) kfll=int(0.75+
rlu(0))
207 IF(kfll.EQ.0) kf=isign(1000*kfld+100*kfle+10*kflf+kfls,kfl1)
208 IF(kfll.EQ.1) kf=isign(1000*kfld+100*kflf+10*kfle+kfls,kfl1)
213 140
IF(ktab2.EQ.0.AND.mstj(12).LE.0)
THEN
216 ELSEIF(ktab2.EQ.0.AND.ktab1.GE.7.AND.mstj(12).LE.1)
THEN
219 ELSEIF(ktab2.EQ.0)
THEN
229 rfl=rfl+parf(120+80*ktab1+25*kts+kt3)
236 rfl=rfl-parf(120+80*ktab1+25*kts+kt3)
237 160
IF(rfl.LE.0.) goto 170
244 kfl3=isign(kfl3a,kfl1*(2*ktab1-13))
247 IF(ktab3.GE.8) kfl3a=2
248 IF(ktab3.GE.11) kfl3a=3
249 IF(ktab3.GE.16) kfl3a=4
250 kfl3b=(ktab3-6-kfl3a*(kfl3a-2))/2
251 kfl3=1000*kfl3a+100*kfl3b+1
252 IF(kfl3a.EQ.kfl3b.OR.ktab3.NE.6+kfl3a*(kfl3a-2)+2*kfl3b) kfl3=
254 kfl3=isign(kfl3,kfl1*(13-2*ktab1))
258 IF(kfl3a.EQ.kfl1a.AND.kfl3b.EQ.kfl1b.AND.(kfl3a.LE.3.OR.
260 rfl=
rlu(0)*(parf(143+80*ktab1+25*ktabs)+parf(144+80*ktab1+
261 & 25*ktabs)+parf(145+80*ktab1+25*ktabs))
263 IF(rfl.GT.parf(143+80*ktab1+25*ktabs)) kf=220+2*ktabs+1
264 IF(rfl.GT.parf(143+80*ktab1+25*ktabs)+parf(144+80*ktab1+
265 & 25*ktabs)) kf=330+2*ktabs+1
266 ELSEIF(ktab1.LE.6.AND.ktab3.LE.6)
THEN
267 kfla=
max(ktab1,ktab3)
268 kflb=min(ktab1,ktab3)
270 IF(kfla.NE.kf1a) kfs=-kfs
271 kf=(100*kfla+10*kflb+2*ktabs+1)*kfs*(-1)**kfla
272 ELSEIF(ktab1.GE.7.AND.ktab3.GE.7)
THEN
274 IF(kfl1a.EQ.kfl3a)
THEN
275 kfla=
max(kfl1b,kfl3b)
276 kflb=min(kfl1b,kfl3b)
277 IF(kfla.NE.kfl1b) kfs=-kfs
278 ELSEIF(kfl1a.EQ.kfl3b)
THEN
282 ELSEIF(kfl1b.EQ.kfl3a)
THEN
285 ELSEIF(kfl1b.EQ.kfl3b)
THEN
286 kfla=
max(kfl1a,kfl3a)
287 kflb=min(kfl1a,kfl3a)
288 IF(kfla.NE.kfl1a) kfs=-kfs
290 CALL
luerrm(2,
'(LUKFDI:) no matching flavours for qq -> qq')
293 kf=(100*kfla+10*kflb+2*ktabs+1)*kfs*(-1)**kfla
306 kfld=
max(kfla,kflb,kflc)
307 kflf=min(kfla,kflb,kflc)
308 kfle=kfla+kflb+kflc-kfld-kflf
309 IF(ktabs.EQ.0) kf=isign(1000*kfld+100*kflf+10*kfle+2,kfl1)
310 IF(ktabs.GE.1) kf=isign(1000*kfld+100*kfle+10*kflf+2*ktabs,kfl1)
317 CALL
luerrm(2,
'(LUKFDI:) user-defined flavour probabilities '//