9 SUBROUTINE hijsft(JP,JT,JOUT,IERROR)
10 common/hijcrdn/
yp(3,300),
yt(3,300)
14 common/hijdat/hidat0(10,10),hidat(10)
18 common/hijjet1/
npj(300),
kfpj(300,500),
pjpx(300,500),
28 common/histrng/
nfp(300,15),
pp(300,15),
nft(300,15),
pt(300,15)
30 common/dpmcom1/jjp,jjt,amp,amt,apx0,atx0,ampn,amtn,amp0,amt0,
31 & nfdp,nfdt,wp,wm,sw,xremp,xremt,dpkc1,dpkc2,pp11,pp12,
34 common/dpmcom2/ndpm,kdpm(20,2),pdpm1(20,5),pdpm2(20,5)
59 IF(wp.LT.0.0 .OR. wm.LT.0.0)
go to 1000
62 IF(epp.LT.0.0)
go to 1000
63 IF(epm.LT.0.0)
go to 1000
64 IF(etp.LT.0.0)
go to 1000
65 IF(etm.LT.0.0)
go to 1000
66 IF(epp/(epm+0.01).LE.etp/(etm+0.01))
RETURN
89 IF(
nfp(jp,10).EQ.1.OR.
nft(jt,10).EQ.1)
THEN
90 IF(
nfp(jp,10).EQ.1)
THEN
92 ppjet=sqrt(
pp(jp,10)**2+
pp(jp,11)**2)
97 IF(
nft(jt,10).EQ.1)
THEN
99 ptjet=sqrt(
pt(jt,10)**2+
pt(jt,11)**2)
105 IF(
nfp(jp,10).EQ.0)
THEN
107 ELSE IF(
nft(jt,10).EQ.0)
THEN
119 & sqrt(xp0**2+yp0**2))
121 & sqrt((xt0-bx)**2+(yt0-by)**2))
122 IF(abs(cos(
phi)).LT.1.0
e-5)
THEN
125 dd3=abs(by+sqrt(
r2**2-(xp0-bx)**2)-yp0)
126 dd4=abs(by-sqrt(
r2**2-(xp0-bx)**2)-yp0)
129 bb=2.0*sin(
phi)*(cos(
phi)*yp0-sin(
phi)*xp0)
130 cc=(yp0**2-
r1**2)*cos(
phi)**2+xp0*sin(
phi)*(
131 & xp0*sin(
phi)-2.0*yp0*cos(
phi))
133 IF(dd.LT.0.0)
go to 10
134 xx1=(-bb+sqrt(dd))/2.0
135 xx2=(-bb-sqrt(dd))/2.0
136 dd1=abs((xx1-xp0)/cos(
phi))
137 dd2=abs((xx2-xp0)/cos(
phi))
139 bb=2.0*sin(
phi)*(cos(
phi)*(yt0-by)-sin(
phi)*xt0)-2.0*bx
140 cc=(bx**2+(yt0-by)**2-
r2**2)*cos(
phi)**2+xt0*sin(
phi)
141 & *(xt0*sin(
phi)-2.0*cos(
phi)*(yt0-by))
142 & -2.0*bx*sin(
phi)*(cos(
phi)*(yt0-by)-sin(
phi)*xt0)
144 IF(dd.LT.0.0)
go to 10
145 xx1=(-bb+sqrt(dd))/2.0
146 xx2=(-bb-sqrt(dd))/2.0
147 dd3=abs((xx1-xt0)/cos(
phi))
148 dd4=abs((xx2-xt0)/cos(
phi))
152 IF(dd1.LT.
hipr1(13)) dd1=0.0
153 IF(dd2.LT.
hipr1(13)) dd2=0.0
154 IF(
nfp(jp,10).EQ.1.AND.ppjet.GT.
hipr1(11))
THEN
155 dp1=dd1*
hipr1(14)/2.0
156 dp1=min(dp1,ppjet-
hipr1(11))
163 cthep=
pp(jp,12)/sqrt(
pp(jp,12)**2+ppjet**2)
164 dpz1=dp1*cthep/sqrt(1.0-cthep**2)
165 dpe1=sqrt(dpx1**2+dpy1**2+dpz1**2)
166 eppprm=
pp(jp,4)+
pp(jp,3)-dpe1-dpz1
167 epmprm=
pp(jp,4)-
pp(jp,3)-dpe1+dpz1
168 IF(eppprm.LE.0.0.OR.epmprm.LE.0.0)
go to 15
180 pp(jp,3)=
pp(jp,3)-dpz1
181 pp(jp,4)=
pp(jp,4)-dpe1
184 15
IF(
nft(jt,10).EQ.1.AND.ptjet.GT.
hipr1(11))
THEN
185 dp2=dd2*
hipr1(14)/2.0
186 dp2=min(dp2,ptjet-
hipr1(11))
193 cthet=
pt(jt,12)/sqrt(
pt(jt,12)**2+ptjet**2)
194 dpz2=dp2*cthet/sqrt(1.0-cthet**2)
195 dpe2=sqrt(dpx2**2+dpy2**2+dpz2**2)
196 etpprm=
pt(jt,4)+
pt(jt,3)-dpe2-dpz2
197 etmprm=
pt(jt,4)-
pt(jt,3)-dpe2+dpz2
198 IF(etpprm.LE.0.0.OR.etmprm.LE.0.0)
go to 16
210 pt(jt,3)=
pt(jt,3)-dpz2
211 pt(jt,4)=
pt(jt,4)-dpe2
214 16 dpkc11=-(
pp(jp,10)-pkc11)/2.0
215 dpkc12=-(
pp(jp,11)-pkc12)/2.0
216 dpkc21=-(
pt(jt,10)-pkc21)/2.0
217 dpkc22=-(
pt(jt,11)-pkc22)/2.0
227 10 ptp02=
pp(jp,1)**2+
pp(jp,2)**2
228 ptt02=
pt(jt,1)**2+
pt(jt,2)**2
237 IF(
nfp(jp,5).LE.2.AND.
nfp(jp,3).NE.0)
THEN
239 nfdp=
nfp(jp,3)+2*
nfp(jp,3)/abs(
nfp(jp,3))
242 nfdp=nfdp-2*nfdp/abs(nfdp)
249 IF(
nft(jt,5).LE.2.AND.
nft(jt,3).NE.0)
THEN
251 nfdt=
nft(jt,3)+2*
nft(jt,3)/abs(
nft(jt,3))
254 nfdt=nfdt-2*nfdt/abs(nfdt)
259 ampn=sqrt(amp0**2+ptp02)
260 amtn=sqrt(amt0**2+ptt02)
261 snn=(ampn+amtn)**2+0.001
263 IF(sw.LT.snn+0.001)
go to 4000
266 20 swptn=4.0*(
max(amp0,amt0)**2+
max(ptp02,ptt02))
267 swptd=4.0*(
max(dpm0,dtm0)**2+
max(ptp02,ptt02))
268 swptx=4.0*(amx**2+
max(ptp02,ptt02))
271 ELSE IF(sw.GT.swptn .AND. sw.LE.swptd
272 & .AND.
npj(jp).EQ.0.AND.
ntj(jt).EQ.0)
THEN
273 pkcmx=sqrt(sw/4.0-
max(amp0,amt0)**2)
274 & -sqrt(
max(ptp02,ptt02))
275 ELSE IF(sw.GT.swptd .AND. sw.LE.swptx
276 & .AND.
npj(jp).EQ.0.AND.
ntj(jt).EQ.0)
THEN
277 pkcmx=sqrt(sw/4.0-
max(dpm0,dtm0)**2)
278 & -sqrt(
max(ptp02,ptt02))
279 ELSE IF(sw.GT.swptx)
THEN
280 pkcmx=sqrt(sw/4.0-amx**2)-sqrt(
max(ptp02,ptt02))
285 IF(
nfp(jp,10).EQ.1.OR.
nft(jt,10).EQ.1)
THEN
286 IF(pkc1.GT.pkcmx)
THEN
290 dpkc11=-(
pp(jp,10)-pkc11)/2.0
291 dpkc12=-(
pp(jp,11)-pkc12)/2.0
293 IF(pkc2.GT.pkcmx)
THEN
297 dpkc21=-(
pt(jt,10)-pkc21)/2.0
298 dpkc22=-(
pt(jt,11)-pkc22)/2.0
310 IF((
nfp(jp,5).EQ.3 .OR.
nft(jt,5).EQ.3).OR.
311 & (
npj(jp).NE.0.OR.
nfp(jp,10).NE.0).OR.
312 & (
ntj(jt).NE.0.OR.
nft(jt,10).NE.0)) i_sng=0
315 IF(
ihpr2(5).EQ.0)
THEN
317 & *(1.0-exp(-pkcmx**2/
hipr1(2)**2))))
320 pkc=
hirnd2(3,0.0,pkcmx**2)
325 & exp(-pkcmx**2/
hipr1(2)**2))))
327 IF(i_sng.EQ.1) pkc=0.65*sqrt(
328 & -alog(1.0-
atl_ran(
nseed)*(1.0-exp(-pkcmx**2/0.65**2))))
337 40 pp11=
pp(jp,1)+pkc11-dpkc1
338 pp12=
pp(jp,2)+pkc12-dpkc2
339 pt11=
pt(jt,1)+pkc21-dpkc1
340 pt12=
pt(jt,2)+pkc22-dpkc2
344 ampn=sqrt(amp0**2+ptp2)
345 amtn=sqrt(amt0**2+ptt2)
346 snn=(ampn+amtn)**2+0.001
359 &
WRITE(6,*)
'Error occured in Pt kick section of HIJSFT'
363 ampd=sqrt(dpm0**2+ptp2)
364 amtd=sqrt(dtm0**2+ptt2)
366 ampx=sqrt(amx**2+ptp2)
367 amtx=sqrt(amx**2+ptt2)
396 IF(sw.GT.sxx+0.001)
THEN
406 IF((
nfp(jp,5).EQ.3 .AND.
nft(jt,5).EQ.3).OR.
407 & (
npj(jp).NE.0.OR.
nfp(jp,10).NE.0).OR.
408 & (
ntj(jt).NE.0.OR.
nft(jt,10).NE.0))
THEN
418 &
ntj(jt).NE.0.OR.
nft(jt,10).NE.0))
THEN
433 ELSE IF(sw.GT.
max(spdtx,spxtd)+0.001 .AND.
434 & sw.LE.sxx+0.001)
THEN
435 IF(((
npj(jp).EQ.0.AND.
ntj(jt).EQ.0.AND.
437 & .AND.
ntj(jt).NE.0)).AND.
nfp(jp,5).LE.2)
THEN
443 ELSE IF(
ntj(jt).EQ.0.AND.
nft(jt,5).LE.2)
THEN
451 ELSE IF(sw.GT.min(spdtx,spxtd)+0.001.AND.
452 & sw.LE.
max(spdtx,spxtd)+0.001)
THEN
453 IF(spdtx.LE.spxtd.AND.
npj(jp).EQ.0
454 & .AND.
nfp(jp,5).LE.2)
THEN
460 ELSE IF(spdtx.GT.spxtd.AND.
ntj(jt).EQ.0
461 & .AND.
nft(jt,5).LE.2)
THEN
470 IF(((
npj(jp).EQ.0.AND.
ntj(jt).EQ.0
472 & .AND.
ntj(jt).NE.0)).AND.
nfp(jp,5).LE.2)
THEN
478 ELSE IF(
ntj(jt).EQ.0.AND.
nft(jt,5).LE.2)
THEN
486 ELSE IF(sw.GT.
max(spntx,spxtn)+0.001 .AND.
487 & sw.LE.min(spdtx,spxtd)+0.001)
THEN
488 IF(((
npj(jp).EQ.0.AND.
ntj(jt).EQ.0
490 & .AND.
ntj(jt).NE.0)).AND.
nfp(jp,5).LE.2)
THEN
496 ELSE IF(
ntj(jt).EQ.0.AND.
nft(jt,5).LE.2)
THEN
504 ELSE IF(sw.GT.min(spntx,spxtn)+0.001 .AND.
505 & sw.LE.
max(spntx,spxtn)+0.001)
THEN
506 IF(spntx.LE.spxtn.AND.
npj(jp).EQ.0
507 & .AND.
nfp(jp,5).LE.2)
THEN
513 ELSEIF(spntx.GT.spxtn.AND.
ntj(jt).EQ.0
514 & .AND.
nft(jt,5).LE.2)
THEN
522 ELSE IF(sw.LE.min(spntx,spxtn)+0.001 .AND.
523 & (
npj(jp).NE.0 .OR.
ntj(jt).NE.0))
THEN
525 ELSE IF(sw.LE.min(spntx,spxtn)+0.001 .AND.
526 &
nfp(jp,5).GT.2.AND.
nft(jt,5).GT.2)
THEN
528 ELSE IF(sw.GT.sdd+0.001.AND.sw.LE.
529 & min(spntx,spxtn)+0.001)
THEN
535 ELSE IF(sw.GT.
max(spntd,spdtn)+0.001
536 & .AND. sw.LE.sdd+0.001)
THEN
550 ELSE IF(sw.GT.min(spntd,spdtn)+0.001
551 & .AND. sw.LE.
max(spntd,spdtn)+0.001)
THEN
552 IF(spntd.GT.spdtn)
THEN
565 ELSE IF(sw.LE.min(spntd,spdtn)+0.001)
THEN
572 WRITE(6,*)
'Error in HIJSFT: There is no path to here'
583 IF(bb1**2.LT.4.0*
d1 .OR. bb2**2.LT.4.0*d2)
THEN
585 IF(miss.GT.100.OR.pkc.EQ.0.0)
go to 3000
590 x1=(bb1-sqrt(bb1**2-4.0*
d1))/2.0
591 x2=(bb2-sqrt(bb2**2-4.0*d2))/2.0
593 x1=(bb1+sqrt(bb1**2-4.0*
d1))/2.0
594 x2=(bb2+sqrt(bb2**2-4.0*d2))/2.0
606 IF(bb2**2.LT.4.0*d2)
THEN
608 IF(miss.GT.100.OR.pkc.EQ.0.0)
go to 3000
612 xmin=(bb2-sqrt(bb2**2-4.0*d2))/2.0
613 xmax=(bb2+sqrt(bb2**2-4.0*d2))/2.0
617 IF(x2*(1.0-x1).LT.(d2+1.
e-4/sw))
THEN
619 IF(miss4.LE.1000)
go to 222
629 IF(bb1**2.LT.4.0*
d1)
THEN
631 IF(miss.GT.100.OR.pkc.EQ.0.0)
go to 3000
635 xmin=(bb1-sqrt(bb1**2-4.0*
d1))/2.0
636 xmax=(bb1+sqrt(bb1**2-4.0*
d1))/2.0
640 IF(x1*(1.0-x2).LT.(
d1+1.
e-4/sw))
THEN
642 IF(miss4.LE.1000)
go to 242
657 IF(bb1**2.LT.4.0*
d1 .OR. bb2**2.LT.4.0*d2)
THEN
659 IF(miss.GT.100.OR.pkc.EQ.0.0)
go to 3000
663 xmin1=(bb1-sqrt(bb1**2-4.0*
d1))/2.0
664 xmax1=(bb1+sqrt(bb1**2-4.0*
d1))/2.0
665 xmin2=(bb2-sqrt(bb2**2-4.0*d2))/2.0
666 xmax2=(bb2+sqrt(bb2**2-4.0*d2))/2.0
668 410 x1=
hirnd2(4,xmin1,xmax1)
670 IF(
nfp(jp,5).EQ.3.OR.
nft(jt,5).EQ.3)
THEN
675 IF(abs(
nfp(jp,1)*
nfp(jp,2)).GT.1000000.OR.
676 & abs(
nfp(jp,1)*
nfp(jp,2)).LT.100)
THEN
679 IF(abs(
nft(jt,1)*
nft(jt,2)).GT.1000000.OR.
680 & abs(
nft(jt,1)*
nft(jt,2)).LT.100)
THEN
689 IF(abs(
nfp(jp,1)*
nfp(jp,2)).GT.1000000) x1=1.0-x1
692 IF(xxp.LT.(
d1+1.
e-4/sw) .OR. xxt.LT.(d2+1.
e-4/sw))
THEN
694 IF(miss4.LE.1000)
go to 410
701 IF(x1*(1.0-x2).LT.(ampn**2-1.
e-4)/sw.OR.
702 & x2*(1.0-x1).LT.(amtn**2-1.
e-4)/sw)
THEN
704 IF(miss.GT.100.OR.pkc.EQ.0.0)
go to 2000
713 pp(jp,3)=(epp-epm)/2.0
714 pp(jp,4)=(epp+epm)/2.0
715 IF(epp*epm-ptp2.LT.0.0)
go to 6000
716 pp(jp,5)=sqrt(epp*epm-ptp2)
720 pt(jt,3)=(etp-etm)/2.0
721 pt(jt,4)=(etp+etm)/2.0
722 IF(etp*etm-ptt2.LT.0.0)
go to 6000
723 pt(jt,5)=sqrt(etp*etm-ptt2)
733 IF(abs(
nfp(jp,1)*
nfp(jp,2)).GT.1000000.OR.
734 & abs(
nfp(jp,1)*
nfp(jp,2)).LT.100)
THEN
737 IF(abs(
nft(jt,1)*
nft(jt,2)).GT.1000000.OR.
738 & abs(
nft(jt,1)*
nft(jt,2)).LT.100)
THEN
743 & .LT.0.5/(1.0+(pkc11**2+pkc12**2)/
hipr1(22)**2)))
THEN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t,9)-dpkc2)/2.0
780 pt(jt,1)=
pt(jt,6)+
pt(jt,8)
781 pt(jt,2)=
pt(jt,7)+
pt(jt,9)
784 IF(
npj(jp).NE.0)
nfp(jp,5)=3
785 IF(
ntj(jt).NE.0)
nft(jt,5)=3
787 IF(epp/(epm+0.0001).LT.etp/(etm+0.0001).AND.
788 & abs(
nfp(jp,1)*
nfp(jp,2)).LT.1000000)
THEN
791 pp(jp,jsb)=
pt(jt,jsb)
805 IF(
ihpr2(10).EQ.0)
RETURN
806 WRITE(6,*)
' Fatal HIJSFT start error,abandon this event'
807 WRITE(6,*)
' PROJ E+,E-,W+',epp,epm,wp
808 WRITE(6,*)
' TARG E+,E-,W-',etp,etm,wm
809 WRITE(6,*)
' W+*W-, (APN+ATN)^2',sw,snn
812 IF(
ihpr2(10).EQ.0)
RETURN
813 WRITE(6,*)
' (2)energy partition fail,'
814 WRITE(6,*)
' HIJSFT not performed, but continue'
815 WRITE(6,*)
' MP1,MPN',x1*(1.0-x2)*sw,ampn**2
816 WRITE(6,*)
' MT2,MTN',x2*(1.0-x1)*sw,amtn**2
819 IF(
ihpr2(10).EQ.0)
RETURN
820 WRITE(6,*)
' (3)something is wrong with the pt kick, '
821 WRITE(6,*)
' HIJSFT not performed, but continue'
822 WRITE(6,*)
' D1=',
d1,
' D2=',d2,
' SW=',sw
823 WRITE(6,*)
' HISTORY NFP5=',
nfp(jp,5),
' NFT5=',
nft(jt,5)
824 WRITE(6,*)
' THIS COLLISON NFP5=',nfp5,
' NFT5=',nft5
825 WRITE(6,*)
' # OF JET IN PROJ',
npj(jp),
' IN TARG',
ntj(jt)
828 IF(
ihpr2(10).EQ.0)
RETURN
829 WRITE(6,*)
' (4)unable to choose process, but not harmful'
830 WRITE(6,*)
' HIJSFT not performed, but continue'
831 WRITE(6,*)
' PTP=',sqrt(ptp2),
' PTT=',sqrt(ptt2),
' SW=',sw
832 WRITE(6,*)
' AMCUT=',amx,
' JP=',jp,
' JT=',jt
833 WRITE(6,*)
' HISTORY NFP5=',
nfp(jp,5),
' NFT5=',
nft(jt,5)
836 IF(
ihpr2(10).EQ.0)
RETURN
837 WRITE(6,*)
' energy partition failed(5),for limited try'
838 WRITE(6,*)
' HIJSFT not performed, but continue'
839 WRITE(6,*)
' NFP5=',nfp5,
' NFT5=',nft5
840 WRITE(6,*)
' D1',
d1,
' X1(1-X2)',x1*(1.0-x2)
841 WRITE(6,*)
' D2',d2,
' X2(1-X1)',x2*(1.0-x1)
845 IF(miss.LT.100)
go to 30
847 IF(
ihpr2(10).EQ.0)
RETURN
848 WRITE(6,*)
'ERROR OCCURED, HIJSFT NOT PERFORMED'
849 WRITE(6,*)
' Abort this event'
850 WRITE(6,*)
'MTP,PTP2',epp*epm,ptp2,
' MTT,PTT2',etp*etm,ptt2