10 common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
12 common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
15 SAVE nsav,
np,
ps,pss,rinit,npre,nrem
18 r2t(i1,i2)=(
p(i1,5)*
p(i2,5)-
p(i1,1)*
p(i2,1)-
p(i1,2)*
p(i2,2)-
19 &
p(i1,3)*
p(i2,3))*2.*
p(i1,5)*
p(i2,5)/(0.0001+
p(i1,5)+
p(i2,5))**2
20 r2m(i1,i2)=2.*
p(i1,4)*
p(i2,4)*(1.-(
p(i1,1)*
p(i2,1)+
p(i1,2)*
21 &
p(i2,2)+
p(i1,3)*
p(i2,3))/(
p(i1,5)*
p(i2,5)))
24 IF(mstu(48).LE.0)
THEN
31 IF(mstu(43).GE.2)
n=
n-njet
33 110
p(i,5)=
sqrt(
p(i,1)**2+
p(i,2)**2+
p(i,3)**2)
34 IF(mstu(46).LE.3) r2acc=paru(44)**2
35 IF(mstu(46).GE.4) r2acc=paru(45)*
ps(5)**2
42 IF(
k(i,1).LE.0.OR.
k(i,1).GT.10) goto 140
43 IF(mstu(41).GE.2)
THEN
45 IF(kc.EQ.0.OR.kc.EQ.12.OR.kc.EQ.14.OR.kc.EQ.16.OR.
47 IF(mstu(41).GE.3.AND.kchg(kc,2).EQ.0.AND.
luchge(
k(i,2)).EQ.0)
50 IF(
n+2*
np.GE.mstu(4)-mstu(32)-5)
THEN
51 CALL
luerrm(11,
'(LUCLUS:) no more memory left in LUJETS')
61 IF(mstu(42).EQ.0)
p(
n+
np,5)=0.
62 IF(mstu(42).EQ.1.AND.
k(i,2).NE.22)
p(
n+
np,5)=pmas(101,1)
76 IF(
np.LT.mstu(47))
THEN
77 CALL
luerrm(8,
'(LUCLUS:) too few particles for analysis')
84 IF(mstu(46).LE.3) r2acc=paru(44)**2
85 IF(mstu(46).GE.4) r2acc=paru(45)*
ps(5)**2
87 IF(
np.LE.mstu(47)+2) rinit=0.
95 IF(mstu(46).LE.2)
THEN
99 IF(
p(i,5).GT.2.*rinit) goto 200
103 190
p(
n+1,j)=
p(
n+1,j)+
p(i,j)
106 IF(
p(
n+1,5).GT.2.*rinit) npre=1
107 IF(rinit.GE.0.2*paru(43).AND.npre+nrem.LT.mstu(47)) goto 160
114 IF(
k(i,4).NE.0.OR.
p(i,5).LE.pmax) goto 220
124 IF(mstu(46).LE.2)
THEN
126 IF(
k(i,4).NE.0) goto 250
128 IF(
r2.GT.rinit**2) goto 250
132 240
p(
n+npre,j)=
p(
n+npre,j)+
p(i,j)
134 p(
n+npre,5)=
sqrt(
p(
n+npre,1)**2+
p(
n+npre,2)**2+
p(
n+npre,3)**2)
141 IF(
k(i,4).NE.0) goto 270
143 IF(
r2.GE.r2min) goto 270
149 280
p(
n+npre,j)=
p(
n+npre,j)+
p(imin,j)
150 p(
n+npre,5)=
sqrt(
p(
n+npre,1)**2+
p(
n+npre,2)**2+
p(
n+npre,3)**2)
158 IF(rinit.GE.0.2*paru(43).AND.npre+nrem.LT.mstu(47)) goto 160
159 IF(nrem.GT.0) goto 210
165 300
IF(mstu(46).LE.1)
THEN
171 DO 320 ijet=
n+1,
n+njet
172 IF(
p(ijet,5).LT.rinit) goto 320
174 IF(
r2.GE.r2min) goto 320
180 330
v(imin,j)=
v(imin,j)+
p(i,j)
186 p(i,5)=
sqrt(
p(i,1)**2+
p(i,2)**2+
p(i,3)**2)
192 DO 370 itry1=
n+1,
n+njet-1
193 DO 370 itry2=itry1+1,
n+njet
194 IF(mstu(46).LE.2)
r2=r2t(itry1,itry2)
195 IF(mstu(46).GE.3)
r2=r2m(itry1,itry2)
196 IF(
r2.GE.r2min) goto 370
203 IF(njet.GT.mstu(47).AND.r2min.LT.r2acc)
THEN
204 irec=
min(imin1,imin2)
205 idel=
max(imin1,imin2)
207 380
p(irec,j)=
p(imin1,j)+
p(imin2,j)
208 p(irec,5)=
sqrt(
p(irec,1)**2+
p(irec,2)**2+
p(irec,3)**2)
209 DO 390 i=idel+1,
n+njet
212 IF(mstu(46).GE.2)
THEN
215 IF(iori.EQ.idel)
k(i,4)=irec-
n
216 400
IF(iori.GT.idel)
k(i,4)=
k(i,4)-1
222 ELSEIF(njet.EQ.mstu(47).AND.mstu(46).LE.1.AND.nloop.LE.2)
THEN
226 420
k(
n+
k(i,4),5)=
k(
n+
k(i,4),5)+1
229 430
IF(
k(i,5).EQ.0) iemp=i
235 IF(
k(
n+
k(i,4),5).LE.1.OR.
p(i,5).LT.rinit) goto 440
238 IF(
r2.LE.r2max) goto 440
246 450
p(ijet,j)=
p(ijet,j)-
p(ispl,j)
248 p(ijet,5)=
sqrt(
p(ijet,1)**2+
p(ijet,2)**2+
p(ijet,3)**2)
249 IF(nloop.LE.2) goto 290
255 IF(mstu(46).LE.1.AND.nloop.LE.2.AND.psjt/pss.GT.tsav+paru(48))
265 DO 490 inew=
n+1,
n+njet
267 DO 470 itry=
n+1,
n+njet
268 IF(
v(itry,4).LE.pemax) goto 470
285 IF(
k(
k(i,3),1).NE.3)
k(
k(i,3),4)=iori-
n
286 k(iori,4)=
k(iori,4)+1
296 520
IF(
k(i,4).EQ.0) iemp=i
305 IF(njet.LE.1) paru(63)=0.
307 CALL
luerrm(8,
'(LUCLUS:) failed to reconstruct as requested')
310 IF(mstu(43).LE.1) mstu(3)=njet
311 IF(mstu(43).GE.2)
n=
n+njet