File indexing completed on 2025-04-04 08:05:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193 SUBROUTINE HIJING(BMIN0,BMAX0)
0194
0195 CHARACTER FRAME*8
0196 DIMENSION SCIP(300,300),RNIP(300,300),SJIP(300,300),JTP(3),
0197 & IPCOL(90000),ITCOL(90000)
0198 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
0199 SAVE /HIPARNT/
0200
0201 COMMON/HIJCRDN/YP(3,300),YT(3,300)
0202 SAVE /HIJCRDN/
0203 COMMON/HIJGLBR/NELT,NINT,NELP,NINP
0204 SAVE /HIJGLBR/
0205 COMMON/HIMAIN1/NATT,EATT,JATT,NT,NP,N0,N01,N10,N11
0206 SAVE /HIMAIN1/
0207 COMMON/HIMAIN2/KATT(130000,4),PATT(130000,4)
0208 SAVE /HIMAIN2/
0209 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
0210 SAVE /HISTRNG/
0211 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
0212 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
0213 & PJPM(300,500),NTJ(300),KFTJ(300,500),
0214 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
0215 & PJTE(300,500),PJTM(300,500)
0216 SAVE /HIJJET1/
0217 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
0218 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
0219 & PZSG(900,100),PESG(900,100),PMSG(900,100)
0220 SAVE /HIJJET2/
0221 COMMON/HIJJET4/NDR,IADR(900,2),KFDR(900),PDR(900,5)
0222 SAVE /HIJJET4/
0223 COMMON/RANSEED/NSEED
0224 SAVE /RANSEED/
0225
0226 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
0227 SAVE /LUJETS/
0228 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
0229 SAVE /LUDAT1/
0230
0231 BMAX=MIN(BMAX0,HIPR1(34)+HIPR1(35))
0232 BMIN=MIN(BMIN0,BMAX)
0233 IF(IHNT2(1).LE.1 .AND. IHNT2(3).LE.1) THEN
0234 BMIN=0.0
0235 BMAX=2.5*SQRT(HIPR1(31)*0.1/HIPR1(40))
0236
0237 ENDIF
0238
0239 FRAME='CMS' !khaled //CMS
0240
0241
0242
0243
0244 YP(1,1)=0.0
0245 YP(2,1)=0.0
0246 YP(3,1)=0.0
0247 IF(IHNT2(1).LE.1) GO TO 14
0248 DO 10 KP=1,IHNT2(1)
0249 5 R=HIRND(1)
0250
0251 if(IHNT2(1).EQ.2) then
0252 rnd1=max(RLU(0),1.0e-20)
0253 rnd2=max(RLU(0),1.0e-20)
0254 rnd3=max(RLU(0),1.0e-20)
0255 R=-0.5*(log(rnd1)*4.38/2.0+log(rnd2)*0.85/2.0
0256 & +4.38*0.85*log(rnd3)/(4.38+0.85))
0257 endif
0258
0259 X=RLU(0)
0260 CX=2.0*X-1.0
0261 SX=SQRT(1.0-CX*CX)
0262
0263 PHI=RLU(0)*2.0*HIPR1(40)
0264
0265 YP(1,KP)=R*SX*COS(PHI)
0266 YP(2,KP)=R*SX*SIN(PHI)
0267 YP(3,KP)=R*CX
0268 IF(HIPR1(29).EQ.0.0) GO TO 10
0269 DO 8 KP2=1,KP-1
0270 DNBP1=(YP(1,KP)-YP(1,KP2))**2
0271 DNBP2=(YP(2,KP)-YP(2,KP2))**2
0272 DNBP3=(YP(3,KP)-YP(3,KP2))**2
0273 DNBP=DNBP1+DNBP2+DNBP3
0274 IF(DNBP.LT.HIPR1(29)*HIPR1(29)) GO TO 5
0275
0276
0277 8 CONTINUE
0278 10 CONTINUE
0279
0280 if(IHNT2(1).EQ.2) then
0281 YP(1,2)=-YP(1,1)
0282 YP(2,2)=-YP(2,1)
0283 YP(3,2)=-YP(3,1)
0284 endif
0285
0286 DO 12 I=1,IHNT2(1)-1
0287 DO 12 J=I+1,IHNT2(1)
0288 IF(YP(3,I).GT.YP(3,J)) GO TO 12
0289 Y1=YP(1,I)
0290 Y2=YP(2,I)
0291 Y3=YP(3,I)
0292 YP(1,I)=YP(1,J)
0293 YP(2,I)=YP(2,J)
0294 YP(3,I)=YP(3,J)
0295 YP(1,J)=Y1
0296 YP(2,J)=Y2
0297 YP(3,J)=Y3
0298 12 CONTINUE
0299
0300
0301 14 YT(1,1)=0.0
0302 YT(2,1)=0.0
0303 YT(3,1)=0.0
0304 IF(IHNT2(3).LE.1) GO TO 24
0305 DO 20 KT=1,IHNT2(3)
0306 15 R=HIRND(2)
0307
0308 if(IHNT2(3).EQ.2) then
0309 rnd1=max(RLU(0),1.0e-20)
0310 rnd2=max(RLU(0),1.0e-20)
0311 rnd3=max(RLU(0),1.0e-20)
0312 R=-0.5*(log(rnd1)*4.38/2.0+log(rnd2)*0.85/2.0
0313 & +4.38*0.85*log(rnd3)/(4.38+0.85))
0314 endif
0315
0316 X=RLU(0)
0317 CX=2.0*X-1.0
0318 SX=SQRT(1.0-CX*CX)
0319
0320 PHI=RLU(0)*2.0*HIPR1(40)
0321
0322 YT(1,KT)=R*SX*COS(PHI)
0323 YT(2,KT)=R*SX*SIN(PHI)
0324 YT(3,KT)=R*CX
0325 IF(HIPR1(29).EQ.0.0) GO TO 20
0326 DO 18 KT2=1,KT-1
0327 DNBT1=(YT(1,KT)-YT(1,KT2))**2
0328 DNBT2=(YT(2,KT)-YT(2,KT2))**2
0329 DNBT3=(YT(3,KT)-YT(3,KT2))**2
0330 DNBT=DNBT1+DNBT2+DNBT3
0331 IF(DNBT.LT.HIPR1(29)*HIPR1(29)) GO TO 15
0332
0333
0334 18 CONTINUE
0335 20 CONTINUE
0336
0337 if(IHNT2(3).EQ.2) then
0338 YT(1,2)=-YT(1,1)
0339 YT(2,2)=-YT(2,1)
0340 YT(3,2)=-YT(3,1)
0341 endif
0342
0343 DO 22 I=1,IHNT2(3)-1
0344 DO 22 J=I+1,IHNT2(3)
0345 IF(YT(3,I).LT.YT(3,J)) GO TO 22
0346 Y1=YT(1,I)
0347 Y2=YT(2,I)
0348 Y3=YT(3,I)
0349 YT(1,I)=YT(1,J)
0350 YT(2,I)=YT(2,J)
0351 YT(3,I)=YT(3,J)
0352 YT(1,J)=Y1
0353 YT(2,J)=Y2
0354 YT(3,J)=Y3
0355 22 CONTINUE
0356
0357 24 MISS=-1
0358
0359 50 MISS=MISS+1
0360 IF(MISS.GT.50) THEN
0361 WRITE(6,*) 'infinite loop happened in HIJING'
0362 STOP
0363 ENDIF
0364
0365 NATT=0
0366 JATT=0
0367 EATT=0.0
0368 CALL HIJINI
0369 NLOP=0
0370
0371 60 NT=0
0372 NP=0
0373 N0=0
0374 N01=0
0375 N10=0
0376 N11=0
0377 NELT=0
0378 NINT=0
0379 NELP=0
0380 NINP=0
0381 NSG=0
0382 NCOLT=0
0383
0384
0385
0386
0387
0388
0389 BB=SQRT(BMIN**2+RLU(0)*(BMAX**2-BMIN**2))
0390
0391 PHI=2.0*HIPR1(40)*RLU(0)
0392 BBX=BB*COS(PHI)
0393 BBY=BB*SIN(PHI)
0394 HINT1(19)=BB
0395 HINT1(20)=PHI
0396
0397 DO 70 JP=1,IHNT2(1)
0398 DO 70 JT=1,IHNT2(3)
0399 SCIP(JP,JT)=-1.0
0400 B2=(YP(1,JP)+BBX-YT(1,JT))**2+(YP(2,JP)+BBY-YT(2,JT))**2
0401 R2=B2*HIPR1(40)/HIPR1(31)/0.1
0402
0403 RRB1=MIN((YP(1,JP)**2+YP(2,JP)**2)
0404 & /1.2**2/REAL(IHNT2(1))**0.6666667,1.0)
0405 RRB2=MIN((YT(1,JT)**2+YT(2,JT)**2)
0406 & /1.2**2/REAL(IHNT2(3))**0.6666667,1.0)
0407 APHX1=HIPR1(6)*4.0/3.0*(IHNT2(1)**0.3333333-1.0)
0408 & *SQRT(1.0-RRB1)
0409 APHX2=HIPR1(6)*4.0/3.0*(IHNT2(3)**0.3333333-1.0)
0410 & *SQRT(1.0-RRB2)
0411 HINT1(18)=HINT1(14)-APHX1*HINT1(15)
0412 & -APHX2*HINT1(16)+APHX1*APHX2*HINT1(17)
0413
0414 IF(IHPR2(14).EQ.0.OR.
0415 & (IHNT2(1).EQ.1.AND.IHNT2(3).EQ.1)) THEN
0416
0417 GS=1.0-EXP(-(HIPR1(30)+HINT1(18))*ROMG(R2)/HIPR1(31))
0418 RANTOT=RLU(0)
0419
0420 IF(RANTOT.GT.GS) GO TO 70
0421 GO TO 65
0422 ENDIF
0423
0424 GSTOT_0=2.0*(1.0-EXP(-(HIPR1(30)+HINT1(18))
0425 & /HIPR1(31)/2.0*ROMG(0.0)))
0426
0427 R2=R2/GSTOT_0
0428 GS=1.0-EXP(-(HIPR1(30)+HINT1(18))/HIPR1(31)*ROMG(R2))
0429 GSTOT=2.0*(1.0-SQRT(1.0-GS))
0430 RANTOT=RLU(0)*GSTOT_0
0431
0432 IF(RANTOT.GT.GSTOT) GO TO 70
0433 IF(RANTOT.GT.GS) THEN
0434
0435 CALL HIJCSC(JP,JT)
0436
0437 GO TO 70
0438
0439 ENDIF
0440 65 SCIP(JP,JT)=R2
0441 RNIP(JP,JT)=RANTOT
0442 SJIP(JP,JT)=HINT1(18)
0443 NCOLT=NCOLT+1
0444 IPCOL(NCOLT)=JP
0445 ITCOL(NCOLT)=JT
0446 70 CONTINUE
0447
0448
0449 IF(NCOLT.EQ.0) THEN
0450 NLOP=NLOP+1
0451 IF(NLOP.LE.20.OR.
0452 & (IHNT2(1).EQ.1.AND.IHNT2(3).EQ.1)) GO TO 60
0453 RETURN
0454 ENDIF
0455
0456
0457
0458
0459 IF(IHPR2(3).NE.0) THEN
0460 NHARD=1+INT(RLU(0)*(NCOLT-1)+0.5)
0461 NHARD=MIN(NHARD,NCOLT)
0462 JPHARD=IPCOL(NHARD)
0463 JTHARD=ITCOL(NHARD)
0464 ENDIF
0465
0466 IF(IHPR2(9).EQ.1) THEN
0467 NMINI=1+INT(RLU(0)*(NCOLT-1)+0.5)
0468 NMINI=MIN(NMINI,NCOLT)
0469 JPMINI=IPCOL(NMINI)
0470 JTMINI=ITCOL(NMINI)
0471 ENDIF
0472
0473
0474
0475 DO 200 JP=1,IHNT2(1)
0476 DO 200 JT=1,IHNT2(3)
0477 IF(SCIP(JP,JT).EQ.-1.0) GO TO 200
0478 NFP(JP,11)=NFP(JP,11)+1
0479 NFT(JT,11)=NFT(JT,11)+1
0480 IF(NFP(JP,5).LE.1 .AND. NFT(JT,5).GT.1) THEN
0481 NP=NP+1
0482 N01=N01+1
0483 ELSE IF(NFP(JP,5).GT.1 .AND. NFT(JT,5).LE.1) THEN
0484 NT=NT+1
0485 N10=N10+1
0486 ELSE IF(NFP(JP,5).LE.1 .AND. NFT(JT,5).LE.1) THEN
0487 NP=NP+1
0488 NT=NT+1
0489 N0=N0+1
0490 ELSE IF(NFP(JP,5).GT.1 .AND. NFT(JT,5).GT.1) THEN
0491 N11=N11+1
0492 ENDIF
0493
0494 JOUT=0
0495 NFP(JP,10)=0
0496 NFT(JT,10)=0
0497
0498 IF(IHPR2(8).EQ.0 .AND. IHPR2(3).EQ.0) GO TO 160
0499
0500 IF(NFP(JP,6).LT.0 .OR. NFT(JT,6).LT.0) GO TO 160
0501
0502
0503
0504 R2=SCIP(JP,JT)
0505 HINT1(18)=SJIP(JP,JT)
0506 TT=ROMG(R2)*HINT1(18)/HIPR1(31)
0507 TTS=HIPR1(30)*ROMG(R2)/HIPR1(31)
0508 NJET=0
0509 IF(IHPR2(3).NE.0 .AND. JP.EQ.JPHARD .AND. JT.EQ.JTHARD) THEN
0510 CALL JETINI(JP,JT,1)
0511 CALL HIJHRD(JP,JT,0,JFLG,0)
0512 HINT1(26)=HINT1(47)
0513 HINT1(27)=HINT1(48)
0514 HINT1(28)=HINT1(49)
0515 HINT1(29)=HINT1(50)
0516 HINT1(36)=HINT1(67)
0517 HINT1(37)=HINT1(68)
0518 HINT1(38)=HINT1(69)
0519 HINT1(39)=HINT1(70)
0520
0521 IF(ABS(HINT1(46)).GT.HIPR1(11).AND.JFLG.EQ.2) NFP(JP,7)=1
0522 IF(ABS(HINT1(56)).GT.HIPR1(11).AND.JFLG.EQ.2) NFT(JT,7)=1
0523 IF(MAX(ABS(HINT1(46)),ABS(HINT1(56))).GT.HIPR1(11).AND.
0524 & JFLG.GE.3) IASG(NSG,3)=1
0525 IHNT2(9)=IHNT2(14)
0526 IHNT2(10)=IHNT2(15)
0527 DO 105 I05=1,5
0528 HINT1(20+I05)=HINT1(40+I05)
0529 HINT1(30+I05)=HINT1(50+I05)
0530 105 CONTINUE
0531 JOUT=1
0532 IF(IHPR2(8).EQ.0) GO TO 160
0533 RRB1=MIN((YP(1,JP)**2+YP(2,JP)**2)/1.2**2
0534 & /REAL(IHNT2(1))**0.6666667,1.0)
0535 RRB2=MIN((YT(1,JT)**2+YT(2,JT)**2)/1.2**2
0536 & /REAL(IHNT2(3))**0.6666667,1.0)
0537 APHX1=HIPR1(6)*4.0/3.0*(IHNT2(1)**0.3333333-1.0)
0538 & *SQRT(1.0-RRB1)
0539 APHX2=HIPR1(6)*4.0/3.0*(IHNT2(3)**0.3333333-1.0)
0540 & *SQRT(1.0-RRB2)
0541 HINT1(65)=HINT1(61)-APHX1*HINT1(62)
0542 & -APHX2*HINT1(63)+APHX1*APHX2*HINT1(64)
0543 TTRIG=ROMG(R2)*HINT1(65)/HIPR1(31)
0544 NJET=-1
0545
0546
0547
0548 XR1=-ALOG(EXP(-TTRIG)+RLU(0)*(1.0-EXP(-TTRIG)))
0549 106 NJET=NJET+1
0550 XR1=XR1-ALOG(max(RLU(0),1.0e-20))
0551 IF(XR1.LT.TTRIG) GO TO 106
0552 XR=0.0
0553 107 NJET=NJET+1
0554 XR=XR-ALOG(max(RLU(0),1.0e-20))
0555 IF(XR.LT.TT-TTRIG) GO TO 107
0556 NJET=NJET-1
0557 GO TO 112
0558 ENDIF
0559
0560
0561 IF(IHPR2(9).EQ.1.AND.JP.EQ.JPMINI.AND.JT.EQ.JTMINI) GO TO 110
0562
0563
0564
0565 IF(IHPR2(8).GT.0 .AND.RNIP(JP,JT).LT.EXP(-TT)*
0566 & (1.0-EXP(-TTS))) GO TO 160
0567
0568 110 XR=-ALOG(EXP(-TT)+RLU(0)*(1.0-EXP(-TT)))
0569 111 NJET=NJET+1
0570 XR=XR-ALOG(max(RLU(0),1.0e-20))
0571 IF(XR.LT.TT) GO TO 111
0572 112 NJET=MIN(NJET,IHPR2(8))
0573 IF(IHPR2(8).LT.0) NJET=ABS(IHPR2(8))
0574
0575
0576 DO 150 I_JET=1,NJET
0577 CALL JETINI(JP,JT,0)
0578 CALL HIJHRD(JP,JT,JOUT,JFLG,1)
0579
0580
0581
0582
0583
0584
0585 IF(JFLG.EQ.0) GO TO 160
0586 IF(JFLG.LT.0) THEN
0587 IF(IHPR2(10).NE.0) WRITE(6,*) 'error occured in HIJHRD'
0588 GO TO 50
0589 ENDIF
0590 JOUT=JOUT+1
0591 IF(ABS(HINT1(46)).GT.HIPR1(11).AND.JFLG.EQ.2) NFP(JP,7)=1
0592 IF(ABS(HINT1(56)).GT.HIPR1(11).AND.JFLG.EQ.2) NFT(JT,7)=1
0593 IF(MAX(ABS(HINT1(46)),ABS(HINT1(56))).GT.HIPR1(11).AND.
0594 & JFLG.GE.3) IASG(NSG,3)=1
0595
0596 150 CONTINUE
0597 160 CONTINUE
0598 CALL HIJSFT(JP,JT,JOUT,IERROR)
0599 IF(IERROR.NE.0) THEN
0600 IF(IHPR2(10).NE.0) WRITE(6,*) 'error occured in HIJSFT'
0601 GO TO 50
0602 ENDIF
0603
0604
0605 JATT=JATT+JOUT
0606
0607 200 CONTINUE
0608
0609
0610
0611 DO 201 JP=1,IHNT2(1)
0612 IF(NFP(JP,5).GT.2) THEN
0613 NINP=NINP+1
0614 ELSE IF(NFP(JP,5).EQ.2.OR.NFP(JP,5).EQ.1) THEN
0615 NELP=NELP+1
0616 ENDIF
0617 201 continue
0618 DO 202 JT=1,IHNT2(3)
0619 IF(NFT(JT,5).GT.2) THEN
0620 NINT=NINT+1
0621 ELSE IF(NFT(JT,5).EQ.2.OR.NFT(JT,5).EQ.1) THEN
0622 NELT=NELT+1
0623 ENDIF
0624 202 continue
0625
0626
0627
0628
0629
0630
0631 IF((IHPR2(8).NE.0.OR.IHPR2(3).NE.0).AND.IHPR2(4).GT.0.AND.
0632 & IHNT2(1).GT.1.AND.IHNT2(3).GT.1) THEN
0633 DO 271 I=1,IHNT2(1)
0634 IF(NFP(I,7).EQ.1) CALL QUENCH(I,1)
0635 271 CONTINUE
0636 DO 272 I=1,IHNT2(3)
0637 IF(NFT(I,7).EQ.1) CALL QUENCH(I,2)
0638 272 CONTINUE
0639 DO 273 ISG=1,NSG
0640 IF(IASG(ISG,3).EQ.1) CALL QUENCH(ISG,3)
0641 273 CONTINUE
0642 ENDIF
0643
0644
0645
0646
0647
0648
0649
0650
0651 IF(IHPR2(20).NE.0) THEN
0652 DO 360 ISG=1,NSG
0653 CALL HIJFRG(ISG,3,IERROR)
0654 IF(MSTU(24).NE.0 .OR.IERROR.GT.0) THEN
0655 MSTU(24)=0
0656 MSTU(28)=0
0657 IF(IHPR2(10).NE.0) THEN
0658 call lulist(1)
0659 WRITE(6,*) 'error occured, repeat the event'
0660 ENDIF
0661 GO TO 50
0662 ENDIF
0663
0664
0665 N_ST=1
0666 IDSTR=92
0667 IF(IHPR2(21).EQ.0) THEN
0668 CALL LUEDIT(2)
0669 ELSE
0670 351 N_ST=N_ST+1
0671 IF(K(N_ST,2).LT.91.OR.K(N_ST,2).GT.93) GO TO 351
0672 IDSTR=K(N_ST,2)
0673 N_ST=N_ST+1
0674 ENDIF
0675
0676 IF(FRAME.EQ.'LAB') THEN
0677 CALL HIBOOST
0678 ENDIF
0679
0680
0681 N_STR=0
0682 DO 360 I=N_ST,N
0683 IF(K(I,2).EQ.IDSTR) THEN
0684 N_STR=N_STR+1
0685 GO TO 360
0686 ENDIF
0687 K(I,4)=N_STR
0688 NATT=NATT+1
0689 KATT(NATT,1)=K(I,2)
0690 KATT(NATT,2)=20
0691 KATT(NATT,4)=K(I,1)
0692 IF(K(I,3).EQ.0 .OR. K(K(I,3),2).EQ.IDSTR) THEN
0693 KATT(NATT,3)=0
0694 ELSE
0695 KATT(NATT,3)=NATT-I+K(I,3)+N_STR-K(K(I,3),4)
0696 ENDIF
0697
0698 PATT(NATT,1)=P(I,1)
0699 PATT(NATT,2)=P(I,2)
0700 PATT(NATT,3)=P(I,3)
0701 PATT(NATT,4)=P(I,4)
0702 EATT=EATT+P(I,4)
0703 360 CONTINUE
0704
0705
0706 JTP(1)=IHNT2(1)
0707 JTP(2)=IHNT2(3)
0708 DO 400 NTP=1,2
0709 DO 400 J_JTP=1,JTP(NTP)
0710 CALL HIJFRG(J_JTP,NTP,IERROR)
0711 IF(MSTU(24).NE.0 .OR. IERROR.GT.0) THEN
0712 MSTU(24)=0
0713 MSTU(28)=0
0714 IF(IHPR2(10).NE.0) THEN
0715 call lulist(1)
0716 WRITE(6,*) 'error occured, repeat the event'
0717 ENDIF
0718 GO TO 50
0719 ENDIF
0720
0721
0722 N_ST=1
0723 IDSTR=92
0724 IF(IHPR2(21).EQ.0) THEN
0725 CALL LUEDIT(2)
0726 ELSE
0727 381 N_ST=N_ST+1
0728 IF(K(N_ST,2).LT.91.OR.K(N_ST,2).GT.93) GO TO 381
0729 IDSTR=K(N_ST,2)
0730 N_ST=N_ST+1
0731 ENDIF
0732 IF(FRAME.EQ.'LAB') THEN
0733 CALL HIBOOST
0734 ENDIF
0735
0736
0737 NFTP=NFP(J_JTP,5)
0738 IF(NTP.EQ.2) NFTP=10+NFT(J_JTP,5)
0739 N_STR=0
0740 DO 390 I=N_ST,N
0741 IF(K(I,2).EQ.IDSTR) THEN
0742 N_STR=N_STR+1
0743 GO TO 390
0744 ENDIF
0745 K(I,4)=N_STR
0746 NATT=NATT+1
0747 KATT(NATT,1)=K(I,2)
0748 KATT(NATT,2)=NFTP
0749 KATT(NATT,4)=K(I,1)
0750 IF(K(I,3).EQ.0 .OR. K(K(I,3),2).EQ.IDSTR) THEN
0751 KATT(NATT,3)=0
0752 ELSE
0753 KATT(NATT,3)=NATT-I+K(I,3)+N_STR-K(K(I,3),4)
0754 ENDIF
0755
0756 PATT(NATT,1)=P(I,1)
0757 PATT(NATT,2)=P(I,2)
0758 PATT(NATT,3)=P(I,3)
0759 PATT(NATT,4)=P(I,4)
0760 EATT=EATT+P(I,4)
0761 390 CONTINUE
0762 400 CONTINUE
0763
0764 ENDIF
0765
0766 DO 450 I=1,NDR
0767 NATT=NATT+1
0768 KATT(NATT,1)=KFDR(I)
0769 KATT(NATT,2)=40
0770 KATT(NATT,3)=0
0771 PATT(NATT,1)=PDR(I,1)
0772 PATT(NATT,2)=PDR(I,2)
0773 PATT(NATT,3)=PDR(I,3)
0774 PATT(NATT,4)=PDR(I,4)
0775 EATT=EATT+PDR(I,4)
0776 450 CONTINUE
0777
0778
0779 DENGY=EATT/(IHNT2(1)*HINT1(6)+IHNT2(3)*HINT1(7))-1.0
0780 IF(ABS(DENGY).GT.HIPR1(43).AND.IHPR2(20).NE.0
0781 & .AND.IHPR2(21).EQ.0) THEN
0782 IF(IHPR2(10).NE.0) THEN
0783 WRITE(6,*) 'Energy not conserved, repeat the event'
0784 ENDIF
0785
0786 GO TO 50
0787 ENDIF
0788 RETURN
0789 END
0790
0791
0792
0793
0794
0795 SUBROUTINE hijset(efrm)
0796
0797
0798 CHARACTER FRAME*4,PROJ*4,TARG*4,EFRAME*4
0799 DOUBLE PRECISION DD1,DD2,DD3,DD4
0800 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
0801 SAVE /HISTRNG/
0802 COMMON/HIJCRDN/YP(3,300),YT(3,300)
0803 SAVE /HIJCRDN/
0804 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
0805 SAVE /HIPARNT/
0806 COMMON/HIJDAT/HIDAT0(10,10),HIDAT(10)
0807 SAVE /HIJDAT/
0808 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
0809 SAVE /LUDAT1/
0810 EXTERNAL FNKICK,FNKICK2,FNSTRU,FNSTRUM,FNSTRUS
0811 CALL TITLE
0812
0813 FRAME='CMS'
0814
0815 PROJ="A"
0816 TARG="B"
0817
0818
0819
0820
0821
0822
0823
0824
0825
0826
0827
0828
0829
0830
0831
0832
0833
0834
0835
0836
0837
0838
0839
0840
0841
0842
0843
0844
0845
0846
0847
0848
0849
0850
0851
0852
0853
0854
0855
0856
0857
0858
0859
0860
0861
0862
0863
0864
0865
0866
0867
0868
0869
0870
0871
0872
0873
0874
0875
0876
0877
0878
0879
0880
0881
0882
0883
0884
0885
0886 IF(IHPR2(12).GT.0) THEN
0887 CALL LUGIVE('MDCY(C111,1)=0')
0888 CALL LUGIVE('MDCY(C310,1)=0')
0889 CALL LUGIVE('MDCY(C411,1)=0;MDCY(C-411,1)=0')
0890 CALL LUGIVE('MDCY(C421,1)=0;MDCY(C-421,1)=0')
0891 CALL LUGIVE('MDCY(C431,1)=0;MDCY(C-431,1)=0')
0892 CALL LUGIVE('MDCY(C511,1)=0;MDCY(C-511,1)=0')
0893 CALL LUGIVE('MDCY(C521,1)=0;MDCY(C-521,1)=0')
0894 CALL LUGIVE('MDCY(C531,1)=0;MDCY(C-531,1)=0')
0895 CALL LUGIVE('MDCY(C3122,1)=0;MDCY(C-3122,1)=0')
0896 CALL LUGIVE('MDCY(C3112,1)=0;MDCY(C-3112,1)=0')
0897 CALL LUGIVE('MDCY(C3212,1)=0;MDCY(C-3212,1)=0')
0898 CALL LUGIVE('MDCY(C3222,1)=0;MDCY(C-3222,1)=0')
0899 CALL LUGIVE('MDCY(C3312,1)=0;MDCY(C-3312,1)=0')
0900 CALL LUGIVE('MDCY(C3322,1)=0;MDCY(C-3322,1)=0')
0901 CALL LUGIVE('MDCY(C3334,1)=0;MDCY(C-3334,1)=0')
0902 ENDIF
0903 MSTU(12)=0
0904 MSTU(21)=1
0905 IF(IHPR2(10).EQ.0) THEN
0906 MSTU(22)=0
0907 MSTU(25)=0
0908 MSTU(26)=0
0909 ENDIF
0910 MSTJ(12)=IHPR2(11)
0911 PARJ(21)=HIPR1(2)
0912 PARJ(41)=HIPR1(3)
0913 PARJ(42)=HIPR1(4)
0914
0915 IF(FRAME.EQ.'LAB') THEN
0916 DD1=EFRM
0917 DD2=HINT1(8)
0918 DD3=HINT1(9)
0919 HINT1(1)=SQRT(HINT1(8)**2+2.0*HINT1(9)*EFRM+HINT1(9)**2)
0920 DD4=DSQRT(DD1**2-DD2**2)/(DD1+DD3)
0921 HINT1(2)=DD4
0922 HINT1(3)=0.5*DLOG((1.D0+DD4)/(1.D0-DD4))
0923 DD4=DSQRT(DD1**2-DD2**2)/DD1
0924 HINT1(4)=0.5*DLOG((1.D0+DD4)/(1.D0-DD4))
0925 HINT1(5)=0.0
0926 HINT1(6)=EFRM
0927 HINT1(7)=HINT1(9)
0928 ELSE IF(FRAME.EQ.'CMS') THEN
0929 HINT1(1)=EFRM
0930 HINT1(2)=0.0
0931 HINT1(3)=0.0
0932 DD1=HINT1(1)
0933 DD2=HINT1(8)
0934 DD3=HINT1(9)
0935 DD4=DSQRT(1.D0-4.D0*DD2**2/DD1**2)
0936 HINT1(4)=0.5*DLOG((1.D0+DD4)/(1.D0-DD4))
0937 DD4=DSQRT(1.D0-4.D0*DD3**2/DD1**2)
0938 HINT1(5)=-0.5*DLOG((1.D0+DD4)/(1.D0-DD4))
0939 HINT1(6)=HINT1(1)/2.0
0940 HINT1(7)=HINT1(1)/2.0
0941 ENDIF
0942
0943
0944
0945
0946 IF(IHNT2(1).GT.1) THEN
0947 CALL HIJWDS(IHNT2(1),1,RMAX)
0948 HIPR1(34)=RMAX
0949
0950 ENDIF
0951 IF(IHNT2(3).GT.1) THEN
0952 CALL HIJWDS(IHNT2(3),2,RMAX)
0953 HIPR1(35)=RMAX
0954
0955 ENDIF
0956
0957
0958
0959
0960 I=0
0961 20 I=I+1
0962 IF(I.EQ.10) GO TO 30
0963 IF(HIDAT0(10,I).LE.HINT1(1)) GO TO 20
0964 30 IF(I.EQ.1) I=2
0965 DO 40 J=1,9
0966 HIDAT(J)=HIDAT0(J,I-1)+(HIDAT0(J,I)-HIDAT0(J,I-1))
0967 & *(HINT1(1)-HIDAT0(10,I-1))/(HIDAT0(10,I)-HIDAT0(10,I-1))
0968 40 CONTINUE
0969 HIPR1(31)=HIDAT(5)
0970 HIPR1(30)=2.0*HIDAT(5)
0971
0972
0973
0974
0975 CALL HIJCRS
0976
0977
0978 IF(IHPR2(5).NE.0) THEN
0979 CALL HIFUN(3,0.0,36.0,FNKICK)
0980
0981 ENDIF
0982 CALL HIFUN(7,0.0,6.0,FNKICK2)
0983 CALL HIFUN(4,0.0,1.0,FNSTRU)
0984 CALL HIFUN(5,0.0,1.0,FNSTRUM)
0985 CALL HIFUN(6,0.0,1.0,FNSTRUS)
0986
0987 EFRAME='Ecm'
0988 IF(FRAME.EQ.'LAB') EFRAME='Elab'
0989 WRITE(6,100) EFRAME,EFRM,PROJ,IHNT2(1),IHNT2(2),
0990 & TARG,IHNT2(3),IHNT2(4)
0991 100 FORMAT(//10X,'****************************************
0992 & **********'/
0993 & 10X,'*',48X,'*'/
0994 & 10X,'* HIJING has been initialized at *'/
0995 & 10X,'*',13X,A4,'= ',F10.2,' GeV/n',13X,'*'/
0996 & 10X,'*',48X,'*'/
0997 & 10X,'*',8X,'for ',
0998 & A4,'(',I3,',',I3,')',' + ',A4,'(',I3,',',I3,')',7X,'*'/
0999 & 10X,'**************************************************')
1000 RETURN
1001 END
1002
1003
1004
1005 FUNCTION FNKICK(X)
1006 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1007 SAVE /HIPARNT/
1008 FNKICK=1.0/(X+HIPR1(19)**2)/(X+HIPR1(20)**2)
1009 & /(1+EXP((SQRT(X)-HIPR1(20))/0.4))
1010 RETURN
1011 END
1012
1013
1014 FUNCTION FNKICK2(X)
1015 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1016 SAVE /HIPARNT/
1017 FNKICK2=X*EXP(-2.0*X/HIPR1(42))
1018 RETURN
1019 END
1020
1021
1022
1023 FUNCTION FNSTRU(X)
1024 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1025 SAVE /HIPARNT/
1026 FNSTRU=(1.0-X)**HIPR1(44)/
1027 & (X**2+HIPR1(45)**2/HINT1(1)**2)**HIPR1(46)
1028 RETURN
1029 END
1030
1031
1032
1033 FUNCTION FNSTRUM(X)
1034 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1035 SAVE /HIPARNT/
1036 FNSTRUM=1.0/((1.0-X)**2+HIPR1(45)**2/HINT1(1)**2)**HIPR1(46)
1037 & /(X**2+HIPR1(45)**2/HINT1(1)**2)**HIPR1(46)
1038 RETURN
1039 END
1040
1041
1042 FUNCTION FNSTRUS(X)
1043 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1044 SAVE /HIPARNT/
1045 FNSTRUS=(1.0-X)**HIPR1(47)/
1046 & (X**2+HIPR1(45)**2/HINT1(1)**2)**HIPR1(48)
1047 RETURN
1048 END
1049
1050
1051
1052
1053 SUBROUTINE HIBOOST
1054 IMPLICIT DOUBLE PRECISION(D)
1055 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
1056 SAVE /LUJETS/
1057 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
1058 SAVE /LUDAT1/
1059 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1060 SAVE /HIPARNT/
1061 DO 100 I=1,N
1062 DBETA=P(I,3)/P(I,4)
1063 IF(ABS(DBETA).GE.1.D0) THEN
1064 DB=HINT1(2)
1065 IF(DB.GT.0.99999999D0) THEN
1066
1067 WRITE(6,*) '(HIBOOT:) boost vector too large'
1068 DB=0.99999999D0
1069 ENDIF
1070 DGA=1D0/SQRT(1D0-DB**2)
1071 DP3=P(I,3)
1072 DP4=P(I,4)
1073 P(I,3)=(DP3+DB*DP4)*DGA
1074 P(I,4)=(DP4+DB*DP3)*DGA
1075 GO TO 100
1076 ENDIF
1077 Y=0.5*DLOG((1.D0+DBETA)/(1.D0-DBETA))
1078 AMT=SQRT(P(I,1)**2+P(I,2)**2+P(I,5)**2)
1079 P(I,3)=AMT*SINH(Y+HINT1(3))
1080 P(I,4)=AMT*COSH(Y+HINT1(3))
1081 100 CONTINUE
1082 RETURN
1083 END
1084
1085
1086
1087
1088 SUBROUTINE QUENCH(JPJT,NTP)
1089 DIMENSION RDP(300),LQP(300),RDT(300),LQT(300)
1090 COMMON/HIJCRDN/YP(3,300),YT(3,300)
1091 SAVE /HIJCRDN/
1092 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1093 SAVE /HIPARNT/
1094
1095 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
1096 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
1097 & PJPM(300,500),NTJ(300),KFTJ(300,500),
1098 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
1099 & PJTE(300,500),PJTM(300,500)
1100 SAVE /HIJJET1/
1101 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
1102 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
1103 & PZSG(900,100),PESG(900,100),PMSG(900,100)
1104 SAVE /HIJJET2/
1105 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
1106 SAVE /HISTRNG/
1107 COMMON/RANSEED/NSEED
1108 SAVE /RANSEED/
1109
1110 BB=HINT1(19) ! Uzhi
1111 PHI=HINT1(20) ! Uzhi
1112 BBX=BB*COS(PHI) ! Uzhi
1113 BBY=BB*SIN(PHI) ! Uzhi
1114
1115 IF(NTP.EQ.2) GO TO 400
1116 IF(NTP.EQ.3) GO TO 2000
1117
1118
1119
1120
1121 IF(NFP(JPJT,7).NE.1) RETURN
1122
1123 JP=JPJT
1124 DO 290 I=1,NPJ(JP)
1125 PTJET0=SQRT(PJPX(JP,I)**2+PJPY(JP,I)**2)
1126 IF(PTJET0.LE.HIPR1(11)) GO TO 290
1127 PTOT=SQRT(PTJET0*PTJET0+PJPZ(JP,I)**2)
1128 IF(PTOT.LT.HIPR1(8)) GO TO 290
1129 PHIP=ULANGL(PJPX(JP,I),PJPY(JP,I))
1130
1131 KP=0
1132 DO 100 I2=1,IHNT2(1)
1133 IF(NFP(I2,5).NE.3 .OR. I2.EQ.JP) GO TO 100
1134 DX=YP(1,I2)-YP(1,JP)
1135 DY=YP(2,I2)-YP(2,JP)
1136 PHI=ULANGL(DX,DY)
1137 DPHI=ABS(PHI-PHIP)
1138 IF(DPHI.GE.HIPR1(40)) DPHI=2.*HIPR1(40)-DPHI ! Uzhi
1139 IF(DPHI.GE.HIPR1(40)/2.0) GO TO 100
1140 RD0=SQRT(DX*DX+DY*DY)
1141 IF(RD0*SIN(DPHI).GT.HIPR1(12)) GO TO 100
1142 KP=KP+1
1143 LQP(KP)=I2
1144 RDP(KP)=COS(DPHI)*RD0
1145 100 CONTINUE
1146
1147 DO 110 I2=1,KP-1
1148 DO 110 J2=I2+1,KP
1149 IF(RDP(I2).LT.RDP(J2)) GO TO 110
1150 RD=RDP(I2)
1151 LQ=LQP(I2)
1152 RDP(I2)=RDP(J2)
1153 LQP(I2)=LQP(J2)
1154 RDP(J2)=RD
1155 LQP(J2)=LQ
1156 110 CONTINUE
1157
1158 KT=0
1159 DO 120 I2=1,IHNT2(3)
1160 IF(NFT(I2,5).NE.3) GO TO 120
1161 DX=YT(1,I2)-YP(1,JP)-BBX
1162 DY=YT(2,I2)-YP(2,JP)-BBY
1163 PHI=ULANGL(DX,DY)
1164 DPHI=ABS(PHI-PHIP)
1165 IF(DPHI.GE.HIPR1(40)) DPHI=2.*HIPR1(40)-DPHI ! Uzhi
1166 IF(DPHI.GT.HIPR1(40)/2.0) GO TO 120
1167 RD0=SQRT(DX*DX+DY*DY)
1168 IF(RD0*SIN(DPHI).GT.HIPR1(12)) GO TO 120
1169 KT=KT+1
1170 LQT(KT)=I2
1171 RDT(KT)=COS(DPHI)*RD0
1172 120 CONTINUE
1173
1174 DO 130 I2=1,KT-1
1175 DO 130 J2=I2+1,KT
1176 IF(RDT(I2).LT.RDT(J2)) GO TO 130
1177 RD=RDT(I2)
1178 LQ=LQT(I2)
1179 RDT(I2)=RDT(J2)
1180 LQT(I2)=LQT(J2)
1181 RDT(J2)=RD
1182 LQT(J2)=LQ
1183 130 CONTINUE
1184
1185 MP=0
1186 MT=0
1187 R0=0.0
1188 NQ=0
1189 DP=0.0
1190 PTOT=SQRT(PJPX(JP,I)**2+PJPY(JP,I)**2+PJPZ(JP,I)**2)
1191 V1=PJPX(JP,I)/PTOT
1192 V2=PJPY(JP,I)/PTOT
1193 V3=PJPZ(JP,I)/PTOT
1194
1195 200 RN=RLU(0)
1196 210 IF(MT.GE.KT .AND. MP.GE.KP) GO TO 290
1197 IF(MT.GE.KT) GO TO 220
1198 IF(MP.GE.KP) GO TO 240
1199 IF(RDP(MP+1).GT.RDT(MT+1)) GO TO 240
1200 220 MP=MP+1
1201 DRR=RDP(MP)-R0
1202 IF(RN.GE.1.0-EXP(-DRR/HIPR1(13))) GO TO 210
1203 DP=DRR*HIPR1(14)
1204 IF(KFPJ(JP,I).NE.21) DP=0.5*DP
1205
1206 IF(DP.LE.0.2) GO TO 210
1207 IF(PTOT.LE.0.4) GO TO 290
1208 IF(PTOT.LE.DP) DP=PTOT-0.2
1209 DE=DP
1210
1211 IF(KFPJ(JP,I).NE.21) THEN
1212 PRSHU=PP(LQP(MP),1)**2+PP(LQP(MP),2)**2
1213 & +PP(LQP(MP),3)**2
1214 DE=SQRT(PJPM(JP,I)**2+PTOT**2)
1215 & -SQRT(PJPM(JP,I)**2+(PTOT-DP)**2)
1216 ERSHU=(PP(LQP(MP),4)+DE-DP)**2
1217 AMSHU=ERSHU-PRSHU
1218 IF(AMSHU.LT.HIPR1(1)*HIPR1(1)) GO TO 210
1219 PP(LQP(MP),4)=SQRT(ERSHU)
1220 PP(LQP(MP),5)=SQRT(AMSHU)
1221 ENDIF
1222
1223 R0=RDP(MP)
1224 DP1=DP*V1
1225 DP2=DP*V2
1226 DP3=DP*V3
1227
1228
1229 NPJ(LQP(MP))=NPJ(LQP(MP))+1
1230 KFPJ(LQP(MP),NPJ(LQP(MP)))=21
1231 PJPX(LQP(MP),NPJ(LQP(MP)))=DP1
1232 PJPY(LQP(MP),NPJ(LQP(MP)))=DP2
1233 PJPZ(LQP(MP),NPJ(LQP(MP)))=DP3
1234 PJPE(LQP(MP),NPJ(LQP(MP)))=DP
1235 PJPM(LQP(MP),NPJ(LQP(MP)))=0.0
1236 GO TO 260
1237
1238 240 MT=MT+1
1239 DRR=RDT(MT)-R0
1240 IF(RN.GE.1.0-EXP(-DRR/HIPR1(13))) GO TO 210
1241 DP=DRR*HIPR1(14)
1242 IF(DP.LE.0.2) GO TO 210
1243 IF(PTOT.LE.0.4) GO TO 290
1244 IF(PTOT.LE.DP) DP=PTOT-0.2
1245 DE=DP
1246
1247 IF(KFPJ(JP,I).NE.21) THEN
1248 PRSHU=PT(LQT(MT),1)**2+PT(LQT(MT),2)**2
1249 & +PT(LQT(MT),3)**2
1250 DE=SQRT(PJPM(JP,I)**2+PTOT**2)
1251 & -SQRT(PJPM(JP,I)**2+(PTOT-DP)**2)
1252 ERSHU=(PT(LQT(MT),4)+DE-DP)**2
1253 AMSHU=ERSHU-PRSHU
1254 IF(AMSHU.LT.HIPR1(1)*HIPR1(1)) GO TO 210
1255 PT(LQT(MT),4)=SQRT(ERSHU)
1256 PT(LQT(MT),5)=SQRT(AMSHU)
1257 ENDIF
1258
1259
1260 R0=RDT(MT)
1261 DP1=DP*V1
1262 DP2=DP*V2
1263 DP3=DP*V3
1264
1265 NTJ(LQT(MT))=NTJ(LQT(MT))+1
1266 KFTJ(LQT(MT),NTJ(LQT(MT)))=21
1267 PJTX(LQT(MT),NTJ(LQT(MT)))=DP1
1268 PJTY(LQT(MT),NTJ(LQT(MT)))=DP2
1269 PJTZ(LQT(MT),NTJ(LQT(MT)))=DP3
1270 PJTE(LQT(MT),NTJ(LQT(MT)))=DP
1271 PJTM(LQT(MT),NTJ(LQT(MT)))=0.0
1272
1273 260 PJPX(JP,I)=(PTOT-DP)*V1
1274 PJPY(JP,I)=(PTOT-DP)*V2
1275 PJPZ(JP,I)=(PTOT-DP)*V3
1276 PJPE(JP,I)=PJPE(JP,I)-DE
1277
1278 PTOT=PTOT-DP
1279 NQ=NQ+1
1280 GO TO 200
1281 290 CONTINUE
1282
1283 RETURN
1284
1285
1286
1287
1288
1289
1290
1291 400 IF(NFT(JPJT,7).NE.1) RETURN
1292 JT=JPJT
1293 DO 690 I=1,NTJ(JT)
1294 PTJET0=SQRT(PJTX(JT,I)**2+PJTY(JT,I)**2)
1295 IF(PTJET0.LE.HIPR1(11)) GO TO 690
1296 PTOT=SQRT(PTJET0*PTJET0+PJTZ(JT,I)**2)
1297 IF(PTOT.LT.HIPR1(8)) GO TO 690
1298 PHIT=ULANGL(PJTX(JT,I),PJTY(JT,I))
1299 KP=0
1300 DO 500 I2=1,IHNT2(1)
1301 IF(NFP(I2,5).NE.3) GO TO 500
1302 DX=YP(1,I2)+BBX-YT(1,JT)
1303 DY=YP(2,I2)+BBY-YT(2,JT)
1304 PHI=ULANGL(DX,DY)
1305 DPHI=ABS(PHI-PHIT)
1306 IF(DPHI.GE.HIPR1(40)) DPHI=2.*HIPR1(40)-DPHI ! Uzhi
1307 IF(DPHI.GT.HIPR1(40)/2.0) GO TO 500
1308 RD0=SQRT(DX*DX+DY*DY)
1309 IF(RD0*SIN(DPHI).GT.HIPR1(12)) GO TO 500
1310 KP=KP+1
1311 LQP(KP)=I2
1312 RDP(KP)=COS(DPHI)*RD0
1313 500 CONTINUE
1314
1315 DO 510 I2=1,KP-1
1316 DO 510 J2=I2+1,KP
1317 IF(RDP(I2).LT.RDP(J2)) GO TO 510
1318 RD=RDP(I2)
1319 LQ=LQP(I2)
1320 RDP(I2)=RDP(J2)
1321 LQP(I2)=LQP(J2)
1322 RDP(J2)=RD
1323 LQP(J2)=LQ
1324 510 CONTINUE
1325
1326 KT=0
1327 DO 520 I2=1,IHNT2(3)
1328 IF(NFT(I2,5).NE.3 .OR. I2.EQ.JT) GO TO 520
1329 DX=YT(1,I2)-YT(1,JT)
1330 DY=YT(2,I2)-YT(2,JT)
1331 PHI=ULANGL(DX,DY)
1332 DPHI=ABS(PHI-PHIT)
1333 IF(DPHI.GE.HIPR1(40)) DPHI=2.*HIPR1(40)-DPHI ! Uzhi
1334 IF(DPHI.GT.HIPR1(40)/2.0) GO TO 520
1335 RD0=SQRT(DX*DX+DY*DY)
1336 IF(RD0*SIN(DPHI).GT.HIPR1(12)) GO TO 520
1337 KT=KT+1
1338 LQT(KT)=I2
1339 RDT(KT)=COS(DPHI)*RD0
1340 520 CONTINUE
1341
1342 DO 530 I2=1,KT-1
1343 DO 530 J2=I2+1,KT
1344 IF(RDT(I2).LT.RDT(J2)) GO TO 530
1345 RD=RDT(I2)
1346 LQ=LQT(I2)
1347 RDT(I2)=RDT(J2)
1348 LQT(I2)=LQT(J2)
1349 RDT(J2)=RD
1350 LQT(J2)=LQ
1351 530 CONTINUE
1352
1353 MP=0
1354 MT=0
1355 NQ=0
1356 DP=0.0
1357 R0=0.0
1358 PTOT=SQRT(PJTX(JT,I)**2+PJTY(JT,I)**2+PJTZ(JT,I)**2)
1359 V1=PJTX(JT,I)/PTOT
1360 V2=PJTY(JT,I)/PTOT
1361 V3=PJTZ(JT,I)/PTOT
1362
1363 600 RN=RLU(0)
1364 610 IF(MT.GE.KT .AND. MP.GE.KP) GO TO 690
1365 IF(MT.GE.KT) GO TO 620
1366 IF(MP.GE.KP) GO TO 640
1367 IF(RDP(MP+1).GT.RDT(MT+1)) GO TO 640
1368 620 MP=MP+1
1369 DRR=RDP(MP)-R0
1370 IF(RN.GE.1.0-EXP(-DRR/HIPR1(13))) GO TO 610
1371 DP=DRR*HIPR1(14)
1372 IF(KFTJ(JT,I).NE.21) DP=0.5*DP
1373
1374 IF(DP.LE.0.2) GO TO 610
1375 IF(PTOT.LE.0.4) GO TO 690
1376 IF(PTOT.LE.DP) DP=PTOT-0.2
1377 DE=DP
1378
1379 IF(KFTJ(JT,I).NE.21) THEN
1380 PRSHU=PP(LQP(MP),1)**2+PP(LQP(MP),2)**2
1381 & +PP(LQP(MP),3)**2
1382 DE=SQRT(PJTM(JT,I)**2+PTOT**2)
1383 & -SQRT(PJTM(JT,I)**2+(PTOT-DP)**2)
1384 ERSHU=(PP(LQP(MP),4)+DE-DP)**2
1385 AMSHU=ERSHU-PRSHU
1386 IF(AMSHU.LT.HIPR1(1)*HIPR1(1)) GO TO 610
1387 PP(LQP(MP),4)=SQRT(ERSHU)
1388 PP(LQP(MP),5)=SQRT(AMSHU)
1389 ENDIF
1390
1391
1392 R0=RDP(MP)
1393 DP1=DP*V1
1394 DP2=DP*V2
1395 DP3=DP*V3
1396
1397 NPJ(LQP(MP))=NPJ(LQP(MP))+1
1398 KFPJ(LQP(MP),NPJ(LQP(MP)))=21
1399 PJPX(LQP(MP),NPJ(LQP(MP)))=DP1
1400 PJPY(LQP(MP),NPJ(LQP(MP)))=DP2
1401 PJPZ(LQP(MP),NPJ(LQP(MP)))=DP3
1402 PJPE(LQP(MP),NPJ(LQP(MP)))=DP
1403 PJPM(LQP(MP),NPJ(LQP(MP)))=0.0
1404
1405 GO TO 660
1406
1407 640 MT=MT+1
1408 DRR=RDT(MT)-R0
1409 IF(RN.GE.1.0-EXP(-DRR/HIPR1(13))) GO TO 610
1410 DP=DRR*HIPR1(14)
1411 IF(DP.LE.0.2) GO TO 610
1412 IF(PTOT.LE.0.4) GO TO 690
1413 IF(PTOT.LE.DP) DP=PTOT-0.2
1414 DE=DP
1415
1416 IF(KFTJ(JT,I).NE.21) THEN
1417 PRSHU=PT(LQT(MT),1)**2+PT(LQT(MT),2)**2
1418 & +PT(LQT(MT),3)**2
1419 DE=SQRT(PJTM(JT,I)**2+PTOT**2)
1420 & -SQRT(PJTM(JT,I)**2+(PTOT-DP)**2)
1421 ERSHU=(PT(LQT(MT),4)+DE-DP)**2
1422 AMSHU=ERSHU-PRSHU
1423 IF(AMSHU.LT.HIPR1(1)*HIPR1(1)) GO TO 610
1424 PT(LQT(MT),4)=SQRT(ERSHU)
1425 PT(LQT(MT),5)=SQRT(AMSHU)
1426 ENDIF
1427
1428
1429 R0=RDT(MT)
1430 DP1=DP*V1
1431 DP2=DP*V2
1432 DP3=DP*V3
1433
1434 NTJ(LQT(MT))=NTJ(LQT(MT))+1
1435 KFTJ(LQT(MT),NTJ(LQT(MT)))=21
1436 PJTX(LQT(MT),NTJ(LQT(MT)))=DP1
1437 PJTY(LQT(MT),NTJ(LQT(MT)))=DP2
1438 PJTZ(LQT(MT),NTJ(LQT(MT)))=DP3
1439 PJTE(LQT(MT),NTJ(LQT(MT)))=DP
1440 PJTM(LQT(MT),NTJ(LQT(MT)))=0.0
1441
1442 660 PJTX(JT,I)=(PTOT-DP)*V1
1443 PJTY(JT,I)=(PTOT-DP)*V2
1444 PJTZ(JT,I)=(PTOT-DP)*V3
1445 PJTE(JT,I)=PJTE(JT,I)-DE
1446
1447 PTOT=PTOT-DP
1448 NQ=NQ+1
1449 GO TO 600
1450 690 CONTINUE
1451 RETURN
1452
1453
1454
1455 2000 ISG=JPJT
1456 IF(IASG(ISG,3).NE.1) RETURN
1457
1458 JP=IASG(ISG,1)
1459 JT=IASG(ISG,2)
1460 XJ=(YP(1,JP)+BBX+YT(1,JT))/2.0
1461 YJ=(YP(2,JP)+BBY+YT(2,JT))/2.0
1462 DO 2690 I=1,NJSG(ISG)
1463 PTJET0=SQRT(PXSG(ISG,I)**2+PYSG(ISG,I)**2)
1464 IF(PTJET0.LE.HIPR1(11).OR.PESG(ISG,I).LT.HIPR1(1))
1465 & GO TO 2690
1466 PTOT=SQRT(PTJET0*PTJET0+PZSG(ISG,I)**2)
1467 IF(PTOT.LT.MAX(HIPR1(1),HIPR1(8))) GO TO 2690
1468 PHIQ=ULANGL(PXSG(ISG,I),PYSG(ISG,I))
1469 KP=0
1470 DO 2500 I2=1,IHNT2(1)
1471 IF(NFP(I2,5).NE.3.OR.I2.EQ.JP) GO TO 2500
1472 DX=YP(1,I2)+BBX-XJ
1473 DY=YP(2,I2)+BBY-YJ
1474 PHI=ULANGL(DX,DY)
1475 DPHI=ABS(PHI-PHIQ)
1476 IF(DPHI.GE.HIPR1(40)) DPHI=2.*HIPR1(40)-DPHI ! Uzhi
1477 IF(DPHI.GT.HIPR1(40)/2.0) GO TO 2500
1478 RD0=SQRT(DX*DX+DY*DY)
1479 IF(RD0*SIN(DPHI).GT.HIPR1(12)) GO TO 2500
1480 KP=KP+1
1481 LQP(KP)=I2
1482 RDP(KP)=COS(DPHI)*RD0
1483 2500 CONTINUE
1484
1485 DO 2510 I2=1,KP-1
1486 DO 2510 J2=I2+1,KP
1487 IF(RDP(I2).LT.RDP(J2)) GO TO 2510
1488 RD=RDP(I2)
1489 LQ=LQP(I2)
1490 RDP(I2)=RDP(J2)
1491 LQP(I2)=LQP(J2)
1492 RDP(J2)=RD
1493 LQP(J2)=LQ
1494 2510 CONTINUE
1495
1496 KT=0
1497 DO 2520 I2=1,IHNT2(3)
1498 IF(NFT(I2,5).NE.3 .OR. I2.EQ.JT) GO TO 2520
1499 DX=YT(1,I2)-XJ
1500 DY=YT(2,I2)-YJ
1501 PHI=ULANGL(DX,DY)
1502 DPHI=ABS(PHI-PHIQ)
1503 IF(DPHI.GE.HIPR1(40)) DPHI=2.*HIPR1(40)-DPHI ! Uzhi
1504 IF(DPHI.GT.HIPR1(40)/2.0) GO TO 2520
1505 RD0=SQRT(DX*DX+DY*DY)
1506 IF(RD0*SIN(DPHI).GT.HIPR1(12)) GO TO 2520
1507 KT=KT+1
1508 LQT(KT)=I2
1509 RDT(KT)=COS(DPHI)*RD0
1510 2520 CONTINUE
1511
1512 DO 2530 I2=1,KT-1
1513 DO 2530 J2=I2+1,KT
1514 IF(RDT(I2).LT.RDT(J2)) GO TO 2530
1515 RD=RDT(I2)
1516 LQ=LQT(I2)
1517 RDT(I2)=RDT(J2)
1518 LQT(I2)=LQT(J2)
1519 RDT(J2)=RD
1520 LQT(J2)=LQ
1521 2530 CONTINUE
1522
1523 MP=0
1524 MT=0
1525 NQ=0
1526 DP=0.0
1527 R0=0.0
1528 PTOT=SQRT(PXSG(ISG,I)**2+PYSG(ISG,I)**2
1529 & +PZSG(ISG,I)**2)
1530 V1=PXSG(ISG,I)/PTOT
1531 V2=PYSG(ISG,I)/PTOT
1532 V3=PZSG(ISG,I)/PTOT
1533
1534 2600 RN=RLU(0)
1535 2610 IF(MT.GE.KT .AND. MP.GE.KP) GO TO 2690
1536 IF(MT.GE.KT) GO TO 2620
1537 IF(MP.GE.KP) GO TO 2640
1538 IF(RDP(MP+1).GT.RDT(MT+1)) GO TO 2640
1539 2620 MP=MP+1
1540 DRR=RDP(MP)-R0
1541 IF(RN.GE.1.0-EXP(-DRR/HIPR1(13))) GO TO 2610
1542 DP=DRR*HIPR1(14)/2.0
1543 IF(DP.LE.0.2) GO TO 2610
1544 IF(PTOT.LE.0.4) GO TO 2690
1545 IF(PTOT.LE.DP) DP=PTOT-0.2
1546 DE=DP
1547
1548 IF(K2SG(ISG,I).NE.21) THEN
1549 IF(PTOT.LT.DP+HIPR1(1)) GO TO 2690
1550 PRSHU=PP(LQP(MP),1)**2+PP(LQP(MP),2)**2
1551 & +PP(LQP(MP),3)**2
1552 DE=SQRT(PMSG(ISG,I)**2+PTOT**2)
1553 & -SQRT(PMSG(ISG,I)**2+(PTOT-DP)**2)
1554 ERSHU=(PP(LQP(MP),4)+DE-DP)**2
1555 AMSHU=ERSHU-PRSHU
1556 IF(AMSHU.LT.HIPR1(1)*HIPR1(1)) GO TO 2610
1557 PP(LQP(MP),4)=SQRT(ERSHU)
1558 PP(LQP(MP),5)=SQRT(AMSHU)
1559 ENDIF
1560
1561
1562 R0=RDP(MP)
1563 DP1=DP*V1
1564 DP2=DP*V2
1565 DP3=DP*V3
1566
1567 NPJ(LQP(MP))=NPJ(LQP(MP))+1
1568 KFPJ(LQP(MP),NPJ(LQP(MP)))=21
1569 PJPX(LQP(MP),NPJ(LQP(MP)))=DP1
1570 PJPY(LQP(MP),NPJ(LQP(MP)))=DP2
1571 PJPZ(LQP(MP),NPJ(LQP(MP)))=DP3
1572 PJPE(LQP(MP),NPJ(LQP(MP)))=DP
1573 PJPM(LQP(MP),NPJ(LQP(MP)))=0.0
1574
1575 GO TO 2660
1576
1577 2640 MT=MT+1
1578 DRR=RDT(MT)-R0
1579 IF(RN.GE.1.0-EXP(-DRR/HIPR1(13))) GO TO 2610
1580 DP=DRR*HIPR1(14)
1581 IF(DP.LE.0.2) GO TO 2610
1582 IF(PTOT.LE.0.4) GO TO 2690
1583 IF(PTOT.LE.DP) DP=PTOT-0.2
1584 DE=DP
1585
1586 IF(K2SG(ISG,I).NE.21) THEN
1587 IF(PTOT.LT.DP+HIPR1(1)) GO TO 2690
1588 PRSHU=PT(LQT(MT),1)**2+PT(LQT(MT),2)**2
1589 & +PT(LQT(MT),3)**2
1590 DE=SQRT(PMSG(ISG,I)**2+PTOT**2)
1591 & -SQRT(PMSG(ISG,I)**2+(PTOT-DP)**2)
1592 ERSHU=(PT(LQT(MT),4)+DE-DP)**2
1593 AMSHU=ERSHU-PRSHU
1594 IF(AMSHU.LT.HIPR1(1)*HIPR1(1)) GO TO 2610
1595 PT(LQT(MT),4)=SQRT(ERSHU)
1596 PT(LQT(MT),5)=SQRT(AMSHU)
1597 ENDIF
1598
1599
1600 R0=RDT(MT)
1601 DP1=DP*V1
1602 DP2=DP*V2
1603 DP3=DP*V3
1604
1605 NTJ(LQT(MT))=NTJ(LQT(MT))+1
1606 KFTJ(LQT(MT),NTJ(LQT(MT)))=21
1607 PJTX(LQT(MT),NTJ(LQT(MT)))=DP1
1608 PJTY(LQT(MT),NTJ(LQT(MT)))=DP2
1609 PJTZ(LQT(MT),NTJ(LQT(MT)))=DP3
1610 PJTE(LQT(MT),NTJ(LQT(MT)))=DP
1611 PJTM(LQT(MT),NTJ(LQT(MT)))=0.0
1612
1613 2660 PXSG(ISG,I)=(PTOT-DP)*V1
1614 PYSG(ISG,I)=(PTOT-DP)*V2
1615 PZSG(ISG,I)=(PTOT-DP)*V3
1616 PESG(ISG,I)=PESG(ISG,I)-DE
1617
1618 PTOT=PTOT-DP
1619 NQ=NQ+1
1620 GO TO 2600
1621 2690 CONTINUE
1622 RETURN
1623 END
1624
1625
1626
1627
1628
1629 SUBROUTINE HIJFRG(JTP,NTP,IERROR)
1630
1631
1632
1633
1634
1635
1636 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
1637 SAVE /HIPARNT/
1638 COMMON/HIJDAT/HIDAT0(10,10),HIDAT(10)
1639 SAVE /HIJDAT/
1640 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
1641 SAVE /HISTRNG/
1642 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
1643 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
1644 & PJPM(300,500),NTJ(300),KFTJ(300,500),
1645 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
1646 & PJTE(300,500),PJTM(300,500)
1647 SAVE /HIJJET1/
1648 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
1649 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
1650 & PZSG(900,100),PESG(900,100),PMSG(900,100)
1651 SAVE /HIJJET2/
1652
1653 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
1654 SAVE /LUJETS/
1655 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
1656 SAVE /LUDAT1/
1657 COMMON/RANSEED/NSEED
1658 SAVE /RANSEED/
1659
1660 IERROR=0
1661 CALL LUEDIT(0)
1662 N=0
1663
1664 IF(NTP.EQ.3) THEN
1665 ISG=JTP
1666 N=NJSG(ISG)
1667 DO 100 I=1,NJSG(ISG)
1668 K(I,1)=K1SG(ISG,I)
1669 K(I,2)=K2SG(ISG,I)
1670 P(I,1)=PXSG(ISG,I)
1671 P(I,2)=PYSG(ISG,I)
1672 P(I,3)=PZSG(ISG,I)
1673 P(I,4)=PESG(ISG,I)
1674 P(I,5)=PMSG(ISG,I)
1675 100 CONTINUE
1676
1677
1678
1679 CALL LUEXEC
1680 RETURN
1681 ENDIF
1682
1683 IF(NTP.EQ.2) GO TO 200
1684 IF(JTP.GT.IHNT2(1)) RETURN
1685 IF(NFP(JTP,5).NE.3.AND.NFP(JTP,3).NE.0
1686 & .AND.NPJ(JTP).EQ.0.AND.NFP(JTP,10).EQ.0) GO TO 1000
1687 IF(NFP(JTP,15).EQ.-1) THEN
1688 KF1=NFP(JTP,2)
1689 KF2=NFP(JTP,1)
1690 PQ21=PP(JTP,6)
1691 PQ22=PP(JTP,7)
1692 PQ11=PP(JTP,8)
1693 PQ12=PP(JTP,9)
1694 AM1=PP(JTP,15)
1695 AM2=PP(JTP,14)
1696 ELSE
1697 KF1=NFP(JTP,1)
1698 KF2=NFP(JTP,2)
1699 PQ21=PP(JTP,8)
1700 PQ22=PP(JTP,9)
1701 PQ11=PP(JTP,6)
1702 PQ12=PP(JTP,7)
1703 AM1=PP(JTP,14)
1704 AM2=PP(JTP,15)
1705 ENDIF
1706
1707 PB1=PQ11+PQ21
1708 PB2=PQ12+PQ22
1709 PB3=PP(JTP,3)
1710 PECM=PP(JTP,5)
1711 BTZ=PB3/PP(JTP,4)
1712 IF((ABS(PB1-PP(JTP,1)).GT.0.01.OR.
1713 & ABS(PB2-PP(JTP,2)).GT.0.01).AND.IHPR2(10).NE.0)
1714 & WRITE(6,*) ' Pt of Q and QQ do not sum to the total'
1715
1716 GO TO 300
1717
1718 200 IF(JTP.GT.IHNT2(3)) RETURN
1719 IF(NFT(JTP,5).NE.3.AND.NFT(JTP,3).NE.0
1720 & .AND.NTJ(JTP).EQ.0.AND.NFT(JTP,10).EQ.0) GO TO 1200
1721 IF(NFT(JTP,15).EQ.1) THEN
1722 KF1=NFT(JTP,1)
1723 KF2=NFT(JTP,2)
1724 PQ11=PT(JTP,6)
1725 PQ12=PT(JTP,7)
1726 PQ21=PT(JTP,8)
1727 PQ22=PT(JTP,9)
1728 AM1=PT(JTP,14)
1729 AM2=PT(JTP,15)
1730 ELSE
1731 KF1=NFT(JTP,2)
1732 KF2=NFT(JTP,1)
1733 PQ11=PT(JTP,8)
1734 PQ12=PT(JTP,9)
1735 PQ21=PT(JTP,6)
1736 PQ22=PT(JTP,7)
1737 AM1=PT(JTP,15)
1738 AM2=PT(JTP,14)
1739 ENDIF
1740
1741 PB1=PQ11+PQ21
1742 PB2=PQ12+PQ22
1743 PB3=PT(JTP,3)
1744 PECM=PT(JTP,5)
1745 BTZ=PB3/PT(JTP,4)
1746
1747 IF((ABS(PB1-PT(JTP,1)).GT.0.01.OR.
1748 & ABS(PB2-PT(JTP,2)).GT.0.01).AND.IHPR2(10).NE.0)
1749 & WRITE(6,*) ' Pt of Q and QQ do not sum to the total'
1750
1751 300 IF(PECM.LT.HIPR1(1)) THEN
1752 IERROR=1
1753 IF(IHPR2(10).EQ.0) RETURN
1754 WRITE(6,*) ' ECM=',PECM,' energy of the string is too small'
1755 RETURN
1756 ENDIF
1757 AMT=PECM**2+PB1**2+PB2**2
1758 AMT1=AM1**2+PQ11**2+PQ12**2
1759 AMT2=AM2**2+PQ21**2+PQ22**2
1760 PZCM=SQRT(ABS(AMT**2+AMT1**2+AMT2**2-2.0*AMT*AMT1
1761 & -2.0*AMT*AMT2-2.0*AMT1*AMT2))/2.0/SQRT(AMT)
1762
1763 K(1,1)=2
1764 K(1,2)=KF1
1765 P(1,1)=PQ11
1766 P(1,2)=PQ12
1767 P(1,3)=PZCM
1768 P(1,4)=SQRT(AMT1+PZCM**2)
1769 P(1,5)=AM1
1770 K(2,1)=1
1771 K(2,2)=KF2
1772 P(2,1)=PQ21
1773 P(2,2)=PQ22
1774 P(2,3)=-PZCM
1775 P(2,4)=SQRT(AMT2+PZCM**2)
1776 P(2,5)=AM2
1777 N=2
1778
1779 CALL HIROBO(0.0,0.0,0.0,0.0,BTZ)
1780 JETOT=0
1781 IF((PQ21**2+PQ22**2).GT.(PQ11**2+PQ12**2)) THEN
1782 PMAX1=P(2,1)
1783 PMAX2=P(2,2)
1784 PMAX3=P(2,3)
1785 ELSE
1786 PMAX1=P(1,1)
1787 PMAX2=P(1,2)
1788 PMAX3=P(1,3)
1789 ENDIF
1790 IF(NTP.EQ.1) THEN
1791 PP(JTP,10)=PMAX1
1792 PP(JTP,11)=PMAX2
1793 PP(JTP,12)=PMAX3
1794 ELSE IF(NTP.EQ.2) THEN
1795 PT(JTP,10)=PMAX1
1796 PT(JTP,11)=PMAX2
1797 PT(JTP,12)=PMAX3
1798 ENDIF
1799
1800 IF(NTP.EQ.1.AND.NPJ(JTP).NE.0) THEN
1801 JETOT=NPJ(JTP)
1802
1803
1804 IEX=0
1805 IF((ABS(KF1).GT.1000.AND.KF1.LT.0)
1806 & .OR.(ABS(KF1).LT.1000.AND.KF1.GT.0)) IEX=1
1807 DO 520 I=N,2,-1
1808 DO 520 J=1,5
1809 II=NPJ(JTP)+I
1810 K(II,J)=K(I,J)
1811 P(II,J)=P(I,J)
1812 V(II,J)=V(I,J)
1813 520 CONTINUE
1814 DO 540 I=1,NPJ(JTP)
1815 DO 542 J=1,5
1816 K(I+1,J)=0
1817 V(I+1,J)=0
1818 542 CONTINUE
1819 I0=I
1820 IF(IEX.EQ.1) I0=NPJ(JTP)-I+1
1821
1822 KK1=KFPJ(JTP,I0)
1823 K(I+1,1)=2
1824 K(I+1,2)=KK1
1825 IF(KK1.NE.21 .AND. KK1.NE.0) K(I+1,1)=
1826 & 1+(ABS(KK1)+(2*IEX-1)*KK1)/2/ABS(KK1)
1827 P(I+1,1)=PJPX(JTP,I0)
1828 P(I+1,2)=PJPY(JTP,I0)
1829 P(I+1,3)=PJPZ(JTP,I0)
1830 P(I+1,4)=PJPE(JTP,I0)
1831 P(I+1,5)=PJPM(JTP,I0)
1832 540 CONTINUE
1833 N=N+NPJ(JTP)
1834 ELSE IF(NTP.EQ.2.AND.NTJ(JTP).NE.0) THEN
1835 JETOT=NTJ(JTP)
1836
1837
1838 IEX=1
1839 IF((ABS(KF2).GT.1000.AND.KF2.LT.0)
1840 & .OR.(ABS(KF2).LT.1000.AND.KF2.GT.0)) IEX=0
1841 DO 560 I=N,2,-1
1842 DO 560 J=1,5
1843 II=NTJ(JTP)+I
1844 K(II,J)=K(I,J)
1845 P(II,J)=P(I,J)
1846 V(II,J)=V(I,J)
1847 560 CONTINUE
1848 DO 580 I=1,NTJ(JTP)
1849 DO 582 J=1,5
1850 K(I+1,J)=0
1851 V(I+1,J)=0
1852 582 CONTINUE
1853 I0=I
1854 IF(IEX.EQ.1) I0=NTJ(JTP)-I+1
1855
1856 KK1=KFTJ(JTP,I0)
1857 K(I+1,1)=2
1858 K(I+1,2)=KK1
1859 IF(KK1.NE.21 .AND. KK1.NE.0) K(I+1,1)=
1860 & 1+(ABS(KK1)+(2*IEX-1)*KK1)/2/ABS(KK1)
1861 P(I+1,1)=PJTX(JTP,I0)
1862 P(I+1,2)=PJTY(JTP,I0)
1863 P(I+1,3)=PJTZ(JTP,I0)
1864 P(I+1,4)=PJTE(JTP,I0)
1865 P(I+1,5)=PJTM(JTP,I0)
1866 580 CONTINUE
1867 N=N+NTJ(JTP)
1868 ENDIF
1869 IF(IHPR2(1).GT.0.AND.RLU(0).LE.HIDAT(3)) THEN
1870 HIDAT20=HIDAT(2)
1871 HIPR150=HIPR1(5)
1872 IF(IHPR2(8).EQ.0.AND.IHPR2(3).EQ.0.AND.IHPR2(9).EQ.0)
1873 & HIDAT(2)=2.0
1874 IF(HINT1(1).GE.1000.0.AND.JETOT.EQ.0)THEN
1875 HIDAT(2)=3.0
1876 HIPR1(5)=5.0
1877 ENDIF
1878 CALL ATTRAD(IERROR)
1879 HIDAT(2)=HIDAT20
1880 HIPR1(5)=HIPR150
1881 ELSE IF(JETOT.EQ.0.AND.IHPR2(1).GT.0.AND.
1882 & HINT1(1).GE.1000.0.AND.
1883 & RLU(0).LE.0.8) THEN
1884 HIDAT20=HIDAT(2)
1885 HIPR150=HIPR1(5)
1886 HIDAT(2)=3.0
1887 HIPR1(5)=5.0
1888 IF(IHPR2(8).EQ.0.AND.IHPR2(3).EQ.0.AND.IHPR2(9).EQ.0)
1889 & HIDAT(2)=2.0
1890 CALL ATTRAD(IERROR)
1891 HIDAT(2)=HIDAT20
1892 HIPR1(5)=HIPR150
1893 ENDIF
1894 IF(IERROR.NE.0) RETURN
1895
1896
1897
1898
1899
1900 CALL LUEXEC
1901 RETURN
1902
1903 1000 N=1
1904 K(1,1)=1
1905 K(1,2)=NFP(JTP,3)
1906 DO 1100 JJ=1,5
1907 P(1,JJ)=PP(JTP,JJ)
1908 1100 CONTINUE
1909
1910 CALL LUEXEC
1911
1912 RETURN
1913
1914 1200 N=1
1915 K(1,1)=1
1916 K(1,2)=NFT(JTP,3)
1917 DO 1300 JJ=1,5
1918 P(1,JJ)=PT(JTP,JJ)
1919 1300 CONTINUE
1920
1921 CALL LUEXEC
1922
1923 RETURN
1924 END
1925
1926
1927
1928
1929
1930
1931
1932 SUBROUTINE HIJSRT(JPJT,NPT)
1933 DIMENSION KF(100),PX(100),PY(100),PZ(100),PE(100),PM(100)
1934 DIMENSION Y(100),IP(100,2)
1935 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
1936 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
1937 & PJPM(300,500),NTJ(300),KFTJ(300,500),
1938 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
1939 & PJTE(300,500),PJTM(300,500)
1940 SAVE /HIJJET1/
1941 IF(NPT.EQ.2) GO TO 500
1942 JP=JPJT
1943 IQ=0
1944 I=1
1945 100 KF(I)=KFPJ(JP,I)
1946 PX(I)=PJPX(JP,I)
1947 PY(I)=PJPY(JP,I)
1948 PZ(I)=PJPZ(JP,I)
1949 PE(I)=PJPE(JP,I)
1950 PM(I)=PJPM(JP,I)
1951 Y(I-IQ)=0.5*ALOG((ABS(PE(I)+PZ(I))+1.E-5)
1952 & /(ABS(PE(I)-PZ(I))+1.E-5))
1953 IP(I-IQ,1)=I
1954 IP(I-IQ,2)=0
1955 IF(KF(I).NE.21) THEN
1956 IP(I-IQ,2)=1
1957 IQ=IQ+1
1958 I=I+1
1959 KF(I)=KFPJ(JP,I)
1960 PX(I)=PJPX(JP,I)
1961 PY(I)=PJPY(JP,I)
1962 PZ(I)=PJPZ(JP,I)
1963 PE(I)=PJPE(JP,I)
1964 PM(I)=PJPM(JP,I)
1965 ENDIF
1966 I=I+1
1967 IF(I.LE.NPJ(JP)) GO TO 100
1968
1969 DO 200 I=1,NPJ(JP)-IQ
1970 DO 200 J=I+1,NPJ(JP)-IQ
1971 IF(Y(I).GT.Y(J)) GO TO 200
1972 IP1=IP(I,1)
1973 IP2=IP(I,2)
1974 IP(I,1)=IP(J,1)
1975 IP(I,2)=IP(J,2)
1976 IP(J,1)=IP1
1977 IP(J,2)=IP2
1978 200 CONTINUE
1979
1980 IQQ=0
1981 I=1
1982 300 KFPJ(JP,I)=KF(IP(I-IQQ,1))
1983 PJPX(JP,I)=PX(IP(I-IQQ,1))
1984 PJPY(JP,I)=PY(IP(I-IQQ,1))
1985 PJPZ(JP,I)=PZ(IP(I-IQQ,1))
1986 PJPE(JP,I)=PE(IP(I-IQQ,1))
1987 PJPM(JP,I)=PM(IP(I-IQQ,1))
1988 IF(IP(I-IQQ,2).EQ.1) THEN
1989 KFPJ(JP,I+1)=KF(IP(I-IQQ,1)+1)
1990 PJPX(JP,I+1)=PX(IP(I-IQQ,1)+1)
1991 PJPY(JP,I+1)=PY(IP(I-IQQ,1)+1)
1992 PJPZ(JP,I+1)=PZ(IP(I-IQQ,1)+1)
1993 PJPE(JP,I+1)=PE(IP(I-IQQ,1)+1)
1994 PJPM(JP,I+1)=PM(IP(I-IQQ,1)+1)
1995 I=I+1
1996 IQQ=IQQ+1
1997 ENDIF
1998 I=I+1
1999 IF(I.LE.NPJ(JP)) GO TO 300
2000
2001 RETURN
2002
2003 500 JT=JPJT
2004 IQ=0
2005 I=1
2006 600 KF(I)=KFTJ(JT,I)
2007 PX(I)=PJTX(JT,I)
2008 PY(I)=PJTY(JT,I)
2009 PZ(I)=PJTZ(JT,I)
2010 PE(I)=PJTE(JT,I)
2011 PM(I)=PJTM(JT,I)
2012 Y(I-IQ)=0.5*ALOG((ABS(PE(I)+PZ(I))+1.E-5)
2013 & /(ABS(PE(I)-PZ(I))+1.E-5))
2014 IP(I-IQ,1)=I
2015 IP(I-IQ,2)=0
2016 IF(KF(I).NE.21) THEN
2017 IP(I-IQ,2)=1
2018 IQ=IQ+1
2019 I=I+1
2020 KF(I)=KFTJ(JT,I)
2021 PX(I)=PJTX(JT,I)
2022 PY(I)=PJTY(JT,I)
2023 PZ(I)=PJTZ(JT,I)
2024 PE(I)=PJTE(JT,I)
2025 PM(I)=PJTM(JT,I)
2026 ENDIF
2027 I=I+1
2028 IF(I.LE.NTJ(JT)) GO TO 600
2029
2030 DO 700 I=1,NTJ(JT)-IQ
2031 DO 700 J=I+1,NTJ(JT)-IQ
2032 IF(Y(I).LT.Y(J)) GO TO 700
2033 IP1=IP(I,1)
2034 IP2=IP(I,2)
2035 IP(I,1)=IP(J,1)
2036 IP(I,2)=IP(J,2)
2037 IP(J,1)=IP1
2038 IP(J,2)=IP2
2039 700 CONTINUE
2040
2041 IQQ=0
2042 I=1
2043 800 KFTJ(JT,I)=KF(IP(I-IQQ,1))
2044 PJTX(JT,I)=PX(IP(I-IQQ,1))
2045 PJTY(JT,I)=PY(IP(I-IQQ,1))
2046 PJTZ(JT,I)=PZ(IP(I-IQQ,1))
2047 PJTE(JT,I)=PE(IP(I-IQQ,1))
2048 PJTM(JT,I)=PM(IP(I-IQQ,1))
2049 IF(IP(I-IQQ,2).EQ.1) THEN
2050 KFTJ(JT,I+1)=KF(IP(I-IQQ,1)+1)
2051 PJTX(JT,I+1)=PX(IP(I-IQQ,1)+1)
2052 PJTY(JT,I+1)=PY(IP(I-IQQ,1)+1)
2053 PJTZ(JT,I+1)=PZ(IP(I-IQQ,1)+1)
2054 PJTE(JT,I+1)=PE(IP(I-IQQ,1)+1)
2055 PJTM(JT,I+1)=PM(IP(I-IQQ,1)+1)
2056 I=I+1
2057 IQQ=IQQ+1
2058 ENDIF
2059 I=I+1
2060 IF(I.LE.NTJ(JT)) GO TO 800
2061 RETURN
2062 END
2063
2064
2065
2066
2067
2068
2069
2070 SUBROUTINE ATTRAD(IERROR)
2071
2072 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
2073 SAVE /HIPARNT/
2074 COMMON/HIJDAT/HIDAT0(10,10),HIDAT(10)
2075 SAVE /HIJDAT/
2076 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
2077 SAVE /LUJETS/
2078 IERROR=0
2079
2080
2081
2082
2083 40 SM=0.
2084 JL=1
2085 DO 30 I=1,N-1
2086 S=2.*(P(I,4)*P(I+1,4)-P(I,1)*P(I+1,1)-P(I,2)*P(I+1,2)
2087 & -P(I,3)*P(I+1,3))+P(I,5)**2+P(I+1,5)**2
2088 IF(S.LT.0.) S=0.
2089 WP=SQRT(S)-1.5*(P(I,5)+P(I+1,5))
2090 IF(WP.GT.SM) THEN
2091 PBT1=P(I,1)+P(I+1,1)
2092 PBT2=P(I,2)+P(I+1,2)
2093 PBT3=P(I,3)+P(I+1,3)
2094 PBT4=P(I,4)+P(I+1,4)
2095 BTT=(PBT1**2+PBT2**2+PBT3**2)/PBT4**2
2096 IF(BTT.GE.1.0-1.0E-10) GO TO 30
2097 IF((I.NE.1.OR.I.NE.N-1).AND.
2098 & (K(I,2).NE.21.AND.K(I+1,2).NE.21)) GO TO 30
2099 JL=I
2100 SM=WP
2101 ENDIF
2102 30 CONTINUE
2103 S=(SM+1.5*(P(JL,5)+P(JL+1,5)))**2
2104 IF(SM.LT.HIPR1(5)) GOTO 2
2105
2106
2107 IF(JL+1.EQ.N) GOTO 190
2108 DO 160 J=N,JL+2,-1
2109 K(J+1,1)=K(J,1)
2110 K(J+1,2)=K(J,2)
2111 DO 150 M=1,5
2112 150 P(J+1,M)=P(J,M)
2113 160 CONTINUE
2114 190 N=N+1
2115
2116
2117 P1=P(JL,1)+P(JL+1,1)
2118 P2=P(JL,2)+P(JL+1,2)
2119 P3=P(JL,3)+P(JL+1,3)
2120 P4=P(JL,4)+P(JL+1,4)
2121 BEX=-P1/P4
2122 BEY=-P2/P4
2123 BEZ=-P3/P4
2124 IMIN=JL
2125 IMAX=JL+1
2126 CALL ATROBO(0.,0.,BEX,BEY,BEZ,IMIN,IMAX,IERROR)
2127 IF(IERROR.NE.0) RETURN
2128
2129 CTH=P(JL,3)/SQRT(P(JL,4)**2-P(JL,5)**2)
2130 IF(ABS(CTH).GT.1.0) CTH=MAX(-1.,MIN(1.,CTH))
2131 THETA=ACOS(CTH)
2132 PHI=ULANGL(P(JL,1),P(JL,2))
2133 CALL ATROBO(0.,-PHI,0.,0.,0.,IMIN,IMAX,IERROR)
2134 CALL ATROBO(-THETA,0.,0.,0.,0.,IMIN,IMAX,IERROR)
2135
2136
2137
2138 1 CALL AR3JET(S,X1,X3,JL)
2139 CALL ARORIE(S,X1,X3,JL)
2140 IF(HIDAT(2).GT.0.0) THEN
2141 PTG1=SQRT(P(JL,1)**2+P(JL,2)**2)
2142 PTG2=SQRT(P(JL+1,1)**2+P(JL+1,2)**2)
2143 PTG3=SQRT(P(JL+2,1)**2+P(JL+2,2)**2)
2144 PTG=MAX(PTG1,PTG2,PTG3)
2145 IF(PTG.GT.HIDAT(2)) THEN
2146 FMFACT=EXP(-(PTG**2-HIDAT(2)**2)/HIPR1(2)**2)
2147 IF(RLU(0).GT.FMFACT) GO TO 1
2148 ENDIF
2149 ENDIF
2150
2151 IMIN=JL
2152 IMAX=JL+2
2153 CALL ATROBO(THETA,PHI,-BEX,-BEY,-BEZ,IMIN,IMAX,IERROR)
2154 IF(IERROR.NE.0) RETURN
2155
2156 K(JL+2,1)=K(JL+1,1)
2157 K(JL+2,2)=K(JL+1,2)
2158 K(JL+2,3)=K(JL+1,3)
2159 K(JL+2,4)=K(JL+1,4)
2160 K(JL+2,5)=K(JL+1,5)
2161 P(JL+2,5)=P(JL+1,5)
2162 K(JL+1,1)=2
2163 K(JL+1,2)=21
2164 K(JL+1,3)=0
2165 K(JL+1,4)=0
2166 K(JL+1,5)=0
2167 P(JL+1,5)=0.
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179 IF(SM.GE.HIPR1(5)) GOTO 40
2180
2181 2 K(1,1)=2
2182 K(1,3)=0
2183 K(1,4)=0
2184 K(1,5)=0
2185 K(N,1)=1
2186 K(N,3)=0
2187 K(N,4)=0
2188 K(N,5)=0
2189
2190 RETURN
2191 END
2192
2193
2194 SUBROUTINE AR3JET(S,X1,X3,JL)
2195
2196 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
2197 SAVE /HIPARNT/
2198 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
2199 SAVE /LUJETS/
2200 COMMON/RANSEED/NSEED
2201 SAVE /RANSEED/
2202
2203 C=1./3.
2204 IF(K(JL,2).NE.21 .AND. K(JL+1,2).NE.21) C=8./27.
2205 EXP1=3
2206 EXP3=3
2207 IF(K(JL,2).NE.21) EXP1=2
2208 IF(K(JL+1,2).NE.21) EXP3=2
2209 A=0.24**2/S
2210 YMA=ALOG(.5/SQRT(A)+SQRT(.25/A-1))
2211 D=4.*C*YMA
2212 SM1=P(JL,5)**2/S
2213 SM3=P(JL+1,5)**2/S
2214 XT2M=(1.-2.*SQRT(SM1)+SM1-SM3)*(1.-2.*SQRT(SM3)-SM1+SM3)
2215 XT2M=MIN(.25,XT2M)
2216 NTRY=0
2217 1 IF(NTRY.EQ.5000) THEN
2218 X1=.5*(2.*SQRT(SM1)+1.+SM1-SM3)
2219 X3=.5*(2.*SQRT(SM3)+1.-SM1+SM3)
2220 RETURN
2221 ENDIF
2222 NTRY=NTRY+1
2223
2224 XT2=A*(XT2M/A)**(RLU(0)**(1./D))
2225
2226 YMAX=ALOG(.5/SQRT(XT2)+SQRT(.25/XT2-1.))
2227 Y=(2.*RLU(0)-1.)*YMAX
2228 X1=1.-SQRT(XT2)*EXP(Y)
2229 X3=1.-SQRT(XT2)*EXP(-Y)
2230 X2=2.-X1-X3
2231 NEG=0
2232 IF(K(JL,2).NE.21 .OR. K(JL+1,2).NE.21) THEN
2233 IF((1.-X1)*(1.-X2)*(1.-X3)-X2*SM1*(1.-X1)-X2*SM3*(1.-X3).
2234 & LE.0..OR.X1.LE.2.*SQRT(SM1)-SM1+SM3.OR.X3.LE.2.*SQRT(SM3)
2235 & -SM3+SM1) NEG=1
2236 X1=X1+SM1-SM3
2237 X3=X3-SM1+SM3
2238 ENDIF
2239 IF(NEG.EQ.1) GOTO 1
2240
2241 FG=2.*YMAX*C*(X1**EXP1+X3**EXP3)/D
2242 XT2M=XT2
2243 IF(FG.LT.RLU(0)) GOTO 1
2244
2245 RETURN
2246 END
2247
2248
2249
2250 SUBROUTINE ARORIE(S,X1,X3,JL)
2251
2252 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
2253 SAVE /HIPARNT/
2254 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
2255 SAVE /LUJETS/
2256 COMMON/RANSEED/NSEED
2257 SAVE /RANSEED/
2258
2259 W=SQRT(S)
2260 X2=2.-X1-X3
2261 E1=.5*X1*W
2262 E3=.5*X3*W
2263 P1=SQRT(E1**2-P(JL,5)**2)
2264 P3=SQRT(E3**2-P(JL+1,5)**2)
2265 CBET=1.
2266 IF(P1.GT.0..AND.P3.GT.0.) CBET=(P(JL,5)**2
2267 & +P(JL+1,5)**2+2.*E1*E3-S*(1.-X2))/(2.*P1*P3)
2268 IF(ABS(CBET).GT.1.0) CBET=MAX(-1.,MIN(1.,CBET))
2269 BET=ACOS(CBET)
2270
2271
2272 IF(P1.GE.P3) THEN
2273 PSI=.5*ULANGL(P1**2+P3**2*COS(2.*BET),-P3**2*SIN(2.*BET))
2274 PT1=P1*SIN(PSI)
2275 PZ1=P1*COS(PSI)
2276 PT3=P3*SIN(PSI+BET)
2277 PZ3=P3*COS(PSI+BET)
2278 ELSE IF(P3.GT.P1) THEN
2279 PSI=.5*ULANGL(P3**2+P1**2*COS(2.*BET),-P1**2*SIN(2.*BET))
2280 PT1=P1*SIN(BET+PSI)
2281 PZ1=-P1*COS(BET+PSI)
2282 PT3=P3*SIN(PSI)
2283 PZ3=-P3*COS(PSI)
2284 ENDIF
2285
2286 DEL=2.0*HIPR1(40)*RLU(0)
2287 P(JL,4)=E1
2288 P(JL,1)=PT1*SIN(DEL)
2289 P(JL,2)=-PT1*COS(DEL)
2290 P(JL,3)=PZ1
2291 P(JL+2,4)=E3
2292 P(JL+2,1)=PT3*SIN(DEL)
2293 P(JL+2,2)=-PT3*COS(DEL)
2294 P(JL+2,3)=PZ3
2295 P(JL+1,4)=W-E1-E3
2296 P(JL+1,1)=-P(JL,1)-P(JL+2,1)
2297 P(JL+1,2)=-P(JL,2)-P(JL+2,2)
2298 P(JL+1,3)=-P(JL,3)-P(JL+2,3)
2299 RETURN
2300 END
2301
2302
2303
2304
2305
2306
2307 SUBROUTINE ATROBO(THE,PHI,BEX,BEY,BEZ,IMIN,IMAX,IERROR)
2308 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
2309 SAVE /LUJETS/
2310 DIMENSION ROT(3,3),PV(3)
2311 DOUBLE PRECISION DP(4),DBEX,DBEY,DBEZ,DGA,DGA2,DBEP,DGABEP
2312 IERROR=0
2313
2314 IF(IMIN.LE.0 .OR. IMAX.GT.N .OR. IMIN.GT.IMAX) RETURN
2315
2316 IF(THE**2+PHI**2.GT.1E-20) THEN
2317
2318 ROT(1,1)=COS(THE)*COS(PHI)
2319 ROT(1,2)=-SIN(PHI)
2320 ROT(1,3)=SIN(THE)*COS(PHI)
2321 ROT(2,1)=COS(THE)*SIN(PHI)
2322 ROT(2,2)=COS(PHI)
2323 ROT(2,3)=SIN(THE)*SIN(PHI)
2324 ROT(3,1)=-SIN(THE)
2325 ROT(3,2)=0.
2326 ROT(3,3)=COS(THE)
2327 DO 120 I=IMIN,IMAX
2328
2329 DO 100 J=1,3
2330 100 PV(J)=P(I,J)
2331 DO 110 J=1,3
2332 110 P(I,J)=ROT(J,1)*PV(1)+ROT(J,2)*PV(2)
2333 & +ROT(J,3)*PV(3)
2334 120 CONTINUE
2335 ENDIF
2336
2337 IF(BEX**2+BEY**2+BEZ**2.GT.1E-20) THEN
2338
2339 DBEX=BEX
2340 DBEY=BEY
2341 DBEZ=BEZ
2342 DGA2=1D0-DBEX**2-DBEY**2-DBEZ**2
2343 IF(DGA2.LE.0D0) THEN
2344 IERROR=1
2345 RETURN
2346 ENDIF
2347 DGA=1D0/DSQRT(DGA2)
2348 DO 140 I=IMIN,IMAX
2349
2350 DO 130 J=1,4
2351 130 DP(J)=P(I,J)
2352 DBEP=DBEX*DP(1)+DBEY*DP(2)+DBEZ*DP(3)
2353 DGABEP=DGA*(DGA*DBEP/(1D0+DGA)+DP(4))
2354 P(I,1)=DP(1)+DGABEP*DBEX
2355 P(I,2)=DP(2)+DGABEP*DBEY
2356 P(I,3)=DP(3)+DGABEP*DBEZ
2357 P(I,4)=DGA*(DP(4)+DBEP)
2358 140 CONTINUE
2359 ENDIF
2360
2361 RETURN
2362 END
2363
2364
2365
2366 SUBROUTINE HIJHRD(JP,JT,JOUT,JFLG,IOPJET0)
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378 DIMENSION IP(100,2),IPQ(50),IPB(50),IT(100,2),ITQ(50),ITB(50)
2379 COMMON/HIJCRDN/YP(3,300),YT(3,300)
2380 SAVE /HIJCRDN/
2381 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
2382 SAVE /HIPARNT/
2383 COMMON/HIJDAT/HIDAT0(10,10),HIDAT(10)
2384 SAVE /HIJDAT/
2385 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
2386 SAVE /HISTRNG/
2387 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
2388 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
2389 & PJPM(300,500),NTJ(300),KFTJ(300,500),
2390 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
2391 & PJTE(300,500),PJTM(300,500)
2392 SAVE /HIJJET1/
2393 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
2394 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
2395 & PZSG(900,100),PESG(900,100),PMSG(900,100)
2396 SAVE /HIJJET2/
2397 COMMON/HIJJET4/NDR,IADR(900,2),KFDR(900),PDR(900,5)
2398 SAVE /HIJJET4/
2399 COMMON/RANSEED/NSEED
2400 SAVE /RANSEED/
2401
2402 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
2403 SAVE /LUJETS/
2404 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
2405 SAVE /LUDAT1/
2406 COMMON/PYSUBS/MSEL,MSUB(200),KFIN(2,-40:40),CKIN(200)
2407 SAVE /PYSUBS/
2408 COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
2409 SAVE /PYPARS/
2410 COMMON/PYINT1/MINT(400),VINT(400)
2411 SAVE /PYINT1/
2412 COMMON/PYINT2/ISET(200),KFPR(200,2),COEF(200,20),ICOL(40,4,2)
2413 SAVE /PYINT2/
2414 COMMON/PYINT5/NGEN(0:200,3),XSEC(0:200,3)
2415 SAVE /PYINT5/
2416 COMMON/HIPYINT/MINT4,MINT5,ATCO(200,20),ATXS(0:200)
2417 SAVE /HIPYINT/
2418
2419 MXJT=500
2420
2421 MXSG=900
2422
2423 MXSJ=100
2424
2425
2426 JFLG=0
2427 IHNT2(11)=JP
2428 IHNT2(12)=JT
2429
2430 IOPJET=IOPJET0
2431 IF(IOPJET.EQ.1.AND.(NFP(JP,6).NE.0.OR.NFT(JT,6).NE.0))
2432 & IOPJET=0
2433 IF(JP.GT.IHNT2(1) .OR. JT.GT.IHNT2(3)) RETURN
2434 IF(NFP(JP,6).LT.0 .OR. NFT(JT,6).LT.0) RETURN
2435
2436
2437 IF(JOUT.EQ.0) THEN
2438 EPP=PP(JP,4)+PP(JP,3)
2439 EPM=PP(JP,4)-PP(JP,3)
2440 ETP=PT(JT,4)+PT(JT,3)
2441 ETM=PT(JT,4)-PT(JT,3)
2442 IF(EPP.LT.0.0) GO TO 1000
2443 IF(EPM.LT.0.0) GO TO 1000
2444 IF(ETP.LT.0.0) GO TO 1000
2445 IF(ETM.LT.0.0) GO TO 1000
2446 IF(EPP/(EPM+0.01).LE.ETP/(ETM+0.01)) RETURN
2447 ENDIF
2448
2449
2450
2451 ECUT1=HIPR1(1)+HIPR1(8)+PP(JP,14)+PP(JP,15)
2452 ECUT2=HIPR1(1)+HIPR1(8)+PT(JT,14)+PT(JT,15)
2453 IF(PP(JP,4).LE.ECUT1) THEN
2454 NFP(JP,6)=-ABS(NFP(JP,6))
2455 RETURN
2456 ENDIF
2457 IF(PT(JT,4).LE.ECUT2) THEN
2458 NFT(JT,6)=-ABS(NFT(JT,6))
2459 RETURN
2460 ENDIF
2461
2462
2463 MISS=0
2464 MISP=0
2465 MIST=0
2466
2467 IF(NFP(JP,10).EQ.0 .AND. NFT(JT,10).EQ.0) THEN
2468 MINT(44)=MINT4
2469 MINT(45)=MINT5
2470 XSEC(0,1)=ATXS(0)
2471 XSEC(11,1)=ATXS(11)
2472 XSEC(12,1)=ATXS(12)
2473 XSEC(28,1)=ATXS(28)
2474 DO 120 I=1,20
2475 COEF(11,I)=ATCO(11,I)
2476 COEF(12,I)=ATCO(12,I)
2477 COEF(28,I)=ATCO(28,I)
2478 120 CONTINUE
2479 ELSE
2480 ISUB11=0
2481 ISUB12=0
2482 ISUB28=0
2483 IF(XSEC(11,1).NE.0) ISUB11=1
2484 IF(XSEC(12,1).NE.0) ISUB12=1
2485 IF(XSEC(28,1).NE.0) ISUB28=1
2486 MINT(44)=MINT4-ISUB11-ISUB12-ISUB28
2487 MINT(45)=MINT5-ISUB11-ISUB12-ISUB28
2488 XSEC(0,1)=ATXS(0)-ATXS(11)-ATXS(12)-ATXS(28)
2489 XSEC(11,1)=0.0
2490 XSEC(12,1)=0.0
2491 XSEC(28,1)=0.0
2492 DO 110 I=1,20
2493 COEF(11,I)=0.0
2494 COEF(12,I)=0.0
2495 COEF(28,I)=0.0
2496 110 CONTINUE
2497 ENDIF
2498
2499
2500
2501 155 CALL PYTHIA
2502 JJ=MINT(31)
2503 IF(JJ.NE.1) GO TO 155
2504
2505 IF(K(7,2).EQ.-K(8,2)) THEN
2506 QMASS2=(P(7,4)+P(8,4))**2-(P(7,1)+P(8,1))**2
2507 & -(P(7,2)+P(8,2))**2-(P(7,3)+P(8,3))**2
2508 QM=ULMASS(K(7,2))
2509 IF(QMASS2.LT.(2.0*QM+HIPR1(1))**2) GO TO 155
2510 ENDIF
2511
2512 PXP=PP(JP,1)-P(3,1)
2513 PYP=PP(JP,2)-P(3,2)
2514 PZP=PP(JP,3)-P(3,3)
2515 PEP=PP(JP,4)-P(3,4)
2516 PXT=PT(JT,1)-P(4,1)
2517 PYT=PT(JT,2)-P(4,2)
2518 PZT=PT(JT,3)-P(4,3)
2519 PET=PT(JT,4)-P(4,4)
2520
2521 IF(PEP.LE.ECUT1) THEN
2522 MISP=MISP+1
2523 IF(MISP.LT.50) GO TO 155
2524 NFP(JP,6)=-ABS(NFP(JP,6))
2525 RETURN
2526 ENDIF
2527 IF(PET.LE.ECUT2) THEN
2528 MIST=MIST+1
2529 IF(MIST.LT.50) GO TO 155
2530 NFT(JT,6)=-ABS(NFT(JT,6))
2531 RETURN
2532 ENDIF
2533
2534
2535
2536 WP=PEP+PZP+PET+PZT
2537 WM=PEP-PZP+PET-PZT
2538 IF(WP.LT.0.0 .OR. WM.LT.0.0) THEN
2539 MISS=MISS+1
2540 IF(MISS.LT.50) GO TO 155
2541 RETURN
2542 ENDIF
2543
2544 SW=WP*WM
2545 AMPX=SQRT((ECUT1-HIPR1(8))**2+PXP**2+PYP**2+0.01)
2546 AMTX=SQRT((ECUT2-HIPR1(8))**2+PXT**2+PYT**2+0.01)
2547 SXX=(AMPX+AMTX)**2
2548 IF(SW.LT.SXX.OR.VINT(43).LT.HIPR1(1)) THEN
2549 MISS=MISS+1
2550 IF(MISS.LT.50) GO TO 155
2551 RETURN
2552 ENDIF
2553
2554
2555
2556
2557 HINT1(41)=P(7,1)
2558 HINT1(42)=P(7,2)
2559 HINT1(43)=P(7,3)
2560 HINT1(44)=P(7,4)
2561 HINT1(45)=P(7,5)
2562 HINT1(46)=SQRT(P(7,1)**2+P(7,2)**2)
2563 HINT1(51)=P(8,1)
2564 HINT1(52)=P(8,2)
2565 HINT1(53)=P(8,3)
2566 HINT1(54)=P(8,4)
2567 HINT1(55)=P(8,5)
2568 HINT1(56)=SQRT(P(8,1)**2+P(8,2)**2)
2569 IHNT2(14)=K(7,2)
2570 IHNT2(15)=K(8,2)
2571
2572 PINIRAD=(1.0-EXP(-2.0*(VINT(47)-HIDAT(1))))
2573 & /(1.0+EXP(-2.0*(VINT(47)-HIDAT(1))))
2574 I_INIRAD=0
2575 IF(RLU(0).LE.PINIRAD) I_INIRAD=1
2576 IF(K(7,2).EQ.-K(8,2)) GO TO 190
2577 IF(K(7,2).EQ.21.AND.K(8,2).EQ.21.AND.IOPJET.EQ.1) GO TO 190
2578
2579
2580
2581
2582 JFLG=2
2583 JPP=0
2584 LPQ=0
2585 LPB=0
2586 JTT=0
2587 LTQ=0
2588 LTB=0
2589 IS7=0
2590 IS8=0
2591 HINT1(47)=0.0
2592 HINT1(48)=0.0
2593 HINT1(49)=0.0
2594 HINT1(50)=0.0
2595 HINT1(67)=0.0
2596 HINT1(68)=0.0
2597 HINT1(69)=0.0
2598 HINT1(70)=0.0
2599 DO 180 I=9,N
2600 IF(K(I,3).EQ.1 .OR. K(I,3).EQ.2.OR.
2601 & ABS(K(I,2)).GT.30) GO TO 180
2602
2603 IF(K(I,3).EQ.7) THEN
2604 HINT1(47)=HINT1(47)+P(I,1)
2605 HINT1(48)=HINT1(48)+P(I,2)
2606 HINT1(49)=HINT1(49)+P(I,3)
2607 HINT1(50)=HINT1(50)+P(I,4)
2608 ENDIF
2609 IF(K(I,3).EQ.8) THEN
2610 HINT1(67)=HINT1(67)+P(I,1)
2611 HINT1(68)=HINT1(68)+P(I,2)
2612 HINT1(69)=HINT1(69)+P(I,3)
2613 HINT1(70)=HINT1(70)+P(I,4)
2614 ENDIF
2615
2616 IF(K(I,2).GT.21.AND.K(I,2).LE.30) THEN
2617 NDR=NDR+1
2618 IADR(NDR,1)=JP
2619 IADR(NDR,2)=JT
2620 KFDR(NDR)=K(I,2)
2621 PDR(NDR,1)=P(I,1)
2622 PDR(NDR,2)=P(I,2)
2623 PDR(NDR,3)=P(I,3)
2624 PDR(NDR,4)=P(I,4)
2625 PDR(NDR,5)=P(I,5)
2626
2627 GO TO 180
2628
2629 ENDIF
2630 IF(K(I,3).EQ.7.OR.K(I,3).EQ.3) THEN
2631 IF(K(I,3).EQ.7.AND.K(I,2).NE.21.AND.K(I,2).EQ.K(7,2)
2632 & .AND.IS7.EQ.0) THEN
2633 PP(JP,10)=P(I,1)
2634 PP(JP,11)=P(I,2)
2635 PP(JP,12)=P(I,3)
2636 PZP=PZP+P(I,3)
2637 PEP=PEP+P(I,4)
2638 NFP(JP,10)=1
2639 IS7=1
2640 GO TO 180
2641 ENDIF
2642 IF(K(I,3).EQ.3.AND.(K(I,2).NE.21.OR.
2643 & I_INIRAD.EQ.0)) THEN
2644 PXP=PXP+P(I,1)
2645 PYP=PYP+P(I,2)
2646 PZP=PZP+P(I,3)
2647 PEP=PEP+P(I,4)
2648 GO TO 180
2649 ENDIF
2650 JPP=JPP+1
2651 IP(JPP,1)=I
2652 IP(JPP,2)=0
2653 IF(K(I,2).NE.21) THEN
2654 IF(K(I,2).GT.0) THEN
2655 LPQ=LPQ+1
2656 IPQ(LPQ)=JPP
2657 IP(JPP,2)=LPQ
2658 ELSE IF(K(I,2).LT.0) THEN
2659 LPB=LPB+1
2660 IPB(LPB)=JPP
2661 IP(JPP,2)=-LPB
2662 ENDIF
2663 ENDIF
2664 ELSE IF(K(I,3).EQ.8.OR.K(I,3).EQ.4) THEN
2665 IF(K(I,3).EQ.8.AND.K(I,2).NE.21.AND.K(I,2).EQ.K(8,2)
2666 & .AND.IS8.EQ.0) THEN
2667 PT(JT,10)=P(I,1)
2668 PT(JT,11)=P(I,2)
2669 PT(JT,12)=P(I,3)
2670 PZT=PZT+P(I,3)
2671 PET=PET+P(I,4)
2672 NFT(JT,10)=1
2673 IS8=1
2674 GO TO 180
2675 ENDIF
2676 IF(K(I,3).EQ.4.AND.(K(I,2).NE.21.OR.
2677 & I_INIRAD.EQ.0)) THEN
2678 PXT=PXT+P(I,1)
2679 PYT=PYT+P(I,2)
2680 PZT=PZT+P(I,3)
2681 PET=PET+P(I,4)
2682 GO TO 180
2683 ENDIF
2684 JTT=JTT+1
2685 IT(JTT,1)=I
2686 IT(JTT,2)=0
2687 IF(K(I,2).NE.21) THEN
2688 IF(K(I,2).GT.0) THEN
2689 LTQ=LTQ+1
2690 ITQ(LTQ)=JTT
2691 IT(JTT,2)=LTQ
2692 ELSE IF(K(I,2).LT.0) THEN
2693 LTB=LTB+1
2694 ITB(LTB)=JTT
2695 IT(JTT,2)=-LTB
2696 ENDIF
2697 ENDIF
2698 ENDIF
2699 180 CONTINUE
2700
2701
2702 IF(LPQ.NE.LPB .OR. LTQ.NE.LTB) THEN
2703 MISS=MISS+1
2704 IF(MISS.LE.50) GO TO 155
2705 WRITE(6,*) ' Q -QBAR NOT MATCHED IN HIJHRD'
2706 JFLG=0
2707 RETURN
2708 ENDIF
2709
2710
2711
2712 J=0
2713 181 J=J+1
2714 IF(J.GT.JPP) GO TO 182
2715 IF(IP(J,2).EQ.0) THEN
2716 GO TO 181
2717 ELSE IF(IP(J,2).NE.0) THEN
2718 LP=ABS(IP(J,2))
2719 IP1=IP(J,1)
2720 IP2=IP(J,2)
2721 IP(J,1)=IP(IPQ(LP),1)
2722 IP(J,2)=IP(IPQ(LP),2)
2723 IP(IPQ(LP),1)=IP1
2724 IP(IPQ(LP),2)=IP2
2725 IF(IP2.GT.0) THEN
2726 IPQ(IP2)=IPQ(LP)
2727 ELSE IF(IP2.LT.0) THEN
2728 IPB(-IP2)=IPQ(LP)
2729 ENDIF
2730
2731 IP1=IP(J+1,1)
2732 IP2=IP(J+1,2)
2733 IP(J+1,1)=IP(IPB(LP),1)
2734 IP(J+1,2)=IP(IPB(LP),2)
2735 IP(IPB(LP),1)=IP1
2736 IP(IPB(LP),2)=IP2
2737 IF(IP2.GT.0) THEN
2738 IPQ(IP2)=IPB(LP)
2739 ELSE IF(IP2.LT.0) THEN
2740 IPB(-IP2)=IPB(LP)
2741 ENDIF
2742
2743 J=J+1
2744 GO TO 181
2745 ENDIF
2746
2747 182 J=0
2748 183 J=J+1
2749 IF(J.GT.JTT) GO TO 184
2750 IF(IT(J,2).EQ.0) THEN
2751 GO TO 183
2752 ELSE IF(IT(J,2).NE.0) THEN
2753 LT=ABS(IT(J,2))
2754 IT1=IT(J,1)
2755 IT2=IT(J,2)
2756 IT(J,1)=IT(ITQ(LT),1)
2757 IT(J,2)=IT(ITQ(LT),2)
2758 IT(ITQ(LT),1)=IT1
2759 IT(ITQ(LT),2)=IT2
2760 IF(IT2.GT.0) THEN
2761 ITQ(IT2)=ITQ(LT)
2762 ELSE IF(IT2.LT.0) THEN
2763 ITB(-IT2)=ITQ(LT)
2764 ENDIF
2765
2766 IT1=IT(J+1,1)
2767 IT2=IT(J+1,2)
2768 IT(J+1,1)=IT(ITB(LT),1)
2769 IT(J+1,2)=IT(ITB(LT),2)
2770 IT(ITB(LT),1)=IT1
2771 IT(ITB(LT),2)=IT2
2772 IF(IT2.GT.0) THEN
2773 ITQ(IT2)=ITB(LT)
2774 ELSE IF(IT2.LT.0) THEN
2775 ITB(-IT2)=ITB(LT)
2776 ENDIF
2777
2778 J=J+1
2779 GO TO 183
2780
2781 ENDIF
2782
2783 184 CONTINUE
2784 IF(NPJ(JP)+JPP.GT.MXJT.OR.NTJ(JT)+JTT.GT.MXJT) THEN
2785 JFLG=0
2786 WRITE(6,*) 'number of partons per string exceeds'
2787 WRITE(6,*) 'the common block size'
2788 RETURN
2789 ENDIF
2790
2791 DO 186 J=1,JPP
2792 KFPJ(JP,NPJ(JP)+J)=K(IP(J,1),2)
2793 PJPX(JP,NPJ(JP)+J)=P(IP(J,1),1)
2794 PJPY(JP,NPJ(JP)+J)=P(IP(J,1),2)
2795 PJPZ(JP,NPJ(JP)+J)=P(IP(J,1),3)
2796 PJPE(JP,NPJ(JP)+J)=P(IP(J,1),4)
2797 PJPM(JP,NPJ(JP)+J)=P(IP(J,1),5)
2798 186 CONTINUE
2799 NPJ(JP)=NPJ(JP)+JPP
2800 DO 188 J=1,JTT
2801 KFTJ(JT,NTJ(JT)+J)=K(IT(J,1),2)
2802 PJTX(JT,NTJ(JT)+J)=P(IT(J,1),1)
2803 PJTY(JT,NTJ(JT)+J)=P(IT(J,1),2)
2804 PJTZ(JT,NTJ(JT)+J)=P(IT(J,1),3)
2805 PJTE(JT,NTJ(JT)+J)=P(IT(J,1),4)
2806 PJTM(JT,NTJ(JT)+J)=P(IT(J,1),5)
2807 188 CONTINUE
2808 NTJ(JT)=NTJ(JT)+JTT
2809 GO TO 900
2810
2811
2812
2813 190 JFLG=3
2814 IF(K(7,2).NE.21.AND.K(8,2).NE.21.AND.
2815 & K(7,2)*K(8,2).GT.0) GO TO 155
2816 JPP=0
2817 LPQ=0
2818 LPB=0
2819 DO 200 I=9,N
2820 IF(K(I,3).EQ.1.OR.K(I,3).EQ.2.OR.
2821 & ABS(K(I,2)).GT.30) GO TO 200
2822 IF(K(I,2).GT.21.AND.K(I,2).LE.30) THEN
2823 NDR=NDR+1
2824 IADR(NDR,1)=JP
2825 IADR(NDR,2)=JT
2826 KFDR(NDR)=K(I,2)
2827 PDR(NDR,1)=P(I,1)
2828 PDR(NDR,2)=P(I,2)
2829 PDR(NDR,3)=P(I,3)
2830 PDR(NDR,4)=P(I,4)
2831 PDR(NDR,5)=P(I,5)
2832
2833 GO TO 200
2834
2835 ENDIF
2836 IF(K(I,3).EQ.3.AND.(K(I,2).NE.21.OR.
2837 & I_INIRAD.EQ.0)) THEN
2838 PXP=PXP+P(I,1)
2839 PYP=PYP+P(I,2)
2840 PZP=PZP+P(I,3)
2841 PEP=PEP+P(I,4)
2842 GO TO 200
2843 ENDIF
2844 IF(K(I,3).EQ.4.AND.(K(I,2).NE.21.OR.
2845 & I_INIRAD.EQ.0)) THEN
2846 PXT=PXT+P(I,1)
2847 PYT=PYT+P(I,2)
2848 PZT=PZT+P(I,3)
2849 PET=PET+P(I,4)
2850 GO TO 200
2851 ENDIF
2852 JPP=JPP+1
2853 IP(JPP,1)=I
2854 IP(JPP,2)=0
2855 IF(K(I,2).NE.21) THEN
2856 IF(K(I,2).GT.0) THEN
2857 LPQ=LPQ+1
2858 IPQ(LPQ)=JPP
2859 IP(JPP,2)=LPQ
2860 ELSE IF(K(I,2).LT.0) THEN
2861 LPB=LPB+1
2862 IPB(LPB)=JPP
2863 IP(JPP,2)=-LPB
2864 ENDIF
2865 ENDIF
2866 200 CONTINUE
2867 IF(LPQ.NE.LPB) THEN
2868 MISS=MISS+1
2869 IF(MISS.LE.50) GO TO 155
2870 WRITE(6,*) LPQ,LPB, 'Q-QBAR NOT CONSERVED OR NOT MATCHED'
2871 JFLG=0
2872 RETURN
2873 ENDIF
2874
2875
2876
2877 J=0
2878 220 J=J+1
2879 IF(J.GT.JPP) GO TO 222
2880 IF(IP(J,2).EQ.0) GO TO 220
2881 LP=ABS(IP(J,2))
2882 IP1=IP(J,1)
2883 IP2=IP(J,2)
2884 IP(J,1)=IP(IPQ(LP),1)
2885 IP(J,2)=IP(IPQ(LP),2)
2886 IP(IPQ(LP),1)=IP1
2887 IP(IPQ(LP),2)=IP2
2888 IF(IP2.GT.0) THEN
2889 IPQ(IP2)=IPQ(LP)
2890 ELSE IF(IP2.LT.0) THEN
2891 IPB(-IP2)=IPQ(LP)
2892 ENDIF
2893 IPQ(LP)=J
2894
2895 IP1=IP(J+1,1)
2896 IP2=IP(J+1,2)
2897 IP(J+1,1)=IP(IPB(LP),1)
2898 IP(J+1,2)=IP(IPB(LP),2)
2899 IP(IPB(LP),1)=IP1
2900 IP(IPB(LP),2)=IP2
2901 IF(IP2.GT.0) THEN
2902 IPQ(IP2)=IPB(LP)
2903 ELSE IF(IP2.LT.0) THEN
2904 IPB(-IP2)=IPB(LP)
2905 ENDIF
2906
2907 IPB(LP)=J+1
2908 J=J+1
2909 GO TO 220
2910
2911 222 CONTINUE
2912 IF(LPQ.GE.1) THEN
2913 DO 240 L0=2,LPQ
2914 IP1=IP(2*L0-3,1)
2915 IP2=IP(2*L0-3,2)
2916 IP(2*L0-3,1)=IP(IPQ(L0),1)
2917 IP(2*L0-3,2)=IP(IPQ(L0),2)
2918 IP(IPQ(L0),1)=IP1
2919 IP(IPQ(L0),2)=IP2
2920 IF(IP2.GT.0) THEN
2921 IPQ(IP2)=IPQ(L0)
2922 ELSE IF(IP2.LT.0) THEN
2923 IPB(-IP2)=IPQ(L0)
2924 ENDIF
2925 IPQ(L0)=2*L0-3
2926
2927 IP1=IP(2*L0-2,1)
2928 IP2=IP(2*L0-2,2)
2929 IP(2*L0-2,1)=IP(IPB(L0),1)
2930 IP(2*L0-2,2)=IP(IPB(L0),2)
2931 IP(IPB(L0),1)=IP1
2932 IP(IPB(L0),2)=IP2
2933 IF(IP2.GT.0) THEN
2934 IPQ(IP2)=IPB(L0)
2935 ELSE IF(IP2.LT.0) THEN
2936 IPB(-IP2)=IPB(L0)
2937 ENDIF
2938 IPB(L0)=2*L0-2
2939 240 CONTINUE
2940
2941
2942 IP1=IP(2*LPQ-1,1)
2943 IP2=IP(2*LPQ-1,2)
2944 IP(2*LPQ-1,1)=IP(IPQ(1),1)
2945 IP(2*LPQ-1,2)=IP(IPQ(1),2)
2946 IP(IPQ(1),1)=IP1
2947 IP(IPQ(1),2)=IP2
2948 IF(IP2.GT.0) THEN
2949 IPQ(IP2)=IPQ(1)
2950 ELSE IF(IP2.LT.0) THEN
2951 IPB(-IP2)=IPQ(1)
2952 ENDIF
2953 IPQ(1)=2*LPQ-1
2954
2955
2956 IP1=IP(JPP,1)
2957 IP2=IP(JPP,2)
2958 IP(JPP,1)=IP(IPB(1),1)
2959 IP(JPP,2)=IP(IPB(1),2)
2960 IP(IPB(1),1)=IP1
2961 IP(IPB(1),2)=IP2
2962 IF(IP2.GT.0) THEN
2963 IPQ(IP2)=IPB(1)
2964 ELSE IF(IP2.LT.0) THEN
2965 IPB(-IP2)=IPB(1)
2966 ENDIF
2967 IPB(1)=JPP
2968
2969
2970 ENDIF
2971 IF(NSG.GE.MXSG) THEN
2972 JFLG=0
2973 WRITE(6,*) 'number of jets forming single strings exceeds'
2974 WRITE(6,*) 'the common block size'
2975 RETURN
2976 ENDIF
2977 IF(JPP.GT.MXSJ) THEN
2978 JFLG=0
2979 WRITE(6,*) 'number of partons per single jet system'
2980 WRITE(6,*) 'exceeds the common block size'
2981 RETURN
2982 ENDIF
2983
2984 NSG=NSG+1
2985 NJSG(NSG)=JPP
2986 IASG(NSG,1)=JP
2987 IASG(NSG,2)=JT
2988 IASG(NSG,3)=0
2989 DO 300 I=1,JPP
2990 K1SG(NSG,I)=2
2991 K2SG(NSG,I)=K(IP(I,1),2)
2992 IF(K2SG(NSG,I).LT.0) K1SG(NSG,I)=1
2993 PXSG(NSG,I)=P(IP(I,1),1)
2994 PYSG(NSG,I)=P(IP(I,1),2)
2995 PZSG(NSG,I)=P(IP(I,1),3)
2996 PESG(NSG,I)=P(IP(I,1),4)
2997 PMSG(NSG,I)=P(IP(I,1),5)
2998 300 CONTINUE
2999 K1SG(NSG,1)=2
3000 K1SG(NSG,JPP)=1
3001
3002 900 PP(JP,1)=PXP
3003 PP(JP,2)=PYP
3004 PP(JP,3)=PZP
3005 PP(JP,4)=PEP
3006 PP(JP,5)=0.0
3007 PT(JT,1)=PXT
3008 PT(JT,2)=PYT
3009 PT(JT,3)=PZT
3010 PT(JT,4)=PET
3011 PT(JT,5)=0.0
3012
3013 NFP(JP,6)=NFP(JP,6)+1
3014 NFT(JT,6)=NFT(JT,6)+1
3015 RETURN
3016
3017 1000 JFLG=-1
3018 IF(IHPR2(10).EQ.0) RETURN
3019 WRITE(6,*) 'Fatal HIJHRD error'
3020 WRITE(6,*) JP, ' proj E+,E-',EPP,EPM,' status',NFP(JP,5)
3021 WRITE(6,*) JT, ' targ E+,E_',ETP,ETM,' status',NFT(JT,5)
3022 RETURN
3023 END
3024
3025
3026
3027
3028
3029 SUBROUTINE JETINI(JP,JT,I_TRIG)
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044 CHARACTER BEAM*16,TARG*16
3045 DIMENSION XSEC0(8,0:200),COEF0(8,200,20),INI(8),
3046 & MINT44(8),MINT45(8)
3047 COMMON/HIJCRDN/YP(3,300),YT(3,300)
3048 SAVE /HIJCRDN/
3049 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
3050 SAVE /HIPARNT/
3051 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
3052 SAVE /HISTRNG/
3053 COMMON/HIPYINT/MINT4,MINT5,ATCO(200,20),ATXS(0:200)
3054 SAVE /HIPYINT/
3055
3056 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
3057 SAVE /LUDAT1/
3058 COMMON/LUDAT3/MDCY(500,3),MDME(2000,2),BRAT(2000),KFDP(2000,5)
3059 SAVE /LUDAT3/
3060 COMMON/PYSUBS/MSEL,MSUB(200),KFIN(2,-40:40),CKIN(200)
3061 SAVE /PYSUBS/
3062 COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
3063 SAVE /PYPARS/
3064 COMMON/PYINT1/MINT(400),VINT(400)
3065 SAVE /PYINT1/
3066 COMMON/PYINT2/ISET(200),KFPR(200,2),COEF(200,20),ICOL(40,4,2)
3067 SAVE /PYINT2/
3068 COMMON/PYINT5/NGEN(0:200,3),XSEC(0:200,3)
3069 SAVE /PYINT5/
3070 DATA INI/8*0/I_LAST/-1/
3071
3072 save INI, I_LAST !uzhi
3073
3074 IHNT2(11)=JP
3075 IHNT2(12)=JT
3076 IF(IHNT2(5).NE.0 .AND. IHNT2(6).NE.0) THEN
3077 I_TYPE=1
3078 ELSE IF(IHNT2(5).NE.0 .AND. IHNT2(6).EQ.0) THEN
3079 I_TYPE=1
3080 IF(NFT(JT,4).EQ.2112) I_TYPE=2
3081 ELSE IF(IHNT2(5).EQ.0 .AND. IHNT2(6).NE.0) THEN
3082 I_TYPE=1
3083 IF(NFP(JP,4).EQ.2112) I_TYPE=2
3084 ELSE
3085 IF(NFP(JP,4).EQ.2212 .AND. NFT(JT,4).EQ.2212) THEN
3086 I_TYPE=1
3087 ELSE IF(NFP(JP,4).EQ.2212 .AND. NFT(JT,4).EQ.2112) THEN
3088 I_TYPE=2
3089 ELSE IF(NFP(JP,4).EQ.2112 .AND. NFT(JT,4).EQ.2212) THEN
3090 I_TYPE=3
3091 ELSE
3092 I_TYPE=4
3093 ENDIF
3094 ENDIF
3095
3096 IF(I_TRIG.NE.0) GO TO 160
3097 IF(I_TRIG.EQ.I_LAST) GO TO 150
3098 MSTP(2)=2
3099
3100 MSTP(33)=1
3101 PARP(31)=HIPR1(17)
3102
3103 MSTP(51)=3
3104
3105 MSTP(61)=1
3106
3107 MSTP(71)=1
3108
3109 IF(IHPR2(2).EQ.0.OR.IHPR2(2).EQ.2) MSTP(61)=0
3110 IF(IHPR2(2).EQ.0.OR.IHPR2(2).EQ.1) MSTP(71)=0
3111
3112 MSTP(81)=0
3113
3114 MSTP(82)=1
3115
3116 MSTP(111)=0
3117
3118 IF(IHPR2(10).EQ.0) MSTP(122)=0
3119
3120 PARP(81)=HIPR1(8)
3121 CKIN(5)=HIPR1(8)
3122 CKIN(3)=HIPR1(8)
3123 CKIN(4)=HIPR1(9)
3124 IF(HIPR1(9).LE.HIPR1(8)) CKIN(4)=-1.0
3125 CKIN(9)=-10.0
3126 CKIN(10)=10.0
3127 MSEL=0
3128 DO 100 ISUB=1,200
3129 MSUB(ISUB)=0
3130 100 CONTINUE
3131 MSUB(11)=1
3132 MSUB(12)=1
3133 MSUB(13)=1
3134 MSUB(28)=1
3135 MSUB(53)=1
3136 MSUB(68)=1
3137 MSUB(81)=1
3138 MSUB(82)=1
3139 DO 110 J=1,MIN(8,MDCY(21,3))
3140 110 MDME(MDCY(21,2)+J-1,1)=0
3141 ISEL=4
3142 IF(HINT1(1).GE.20.0 .and. IHPR2(18).EQ.1) ISEL=5
3143 MDME(MDCY(21,2)+ISEL-1,1)=1
3144
3145 MSUB(14)=1
3146 MSUB(18)=1
3147 MSUB(29)=1
3148
3149 150 IF(INI(I_TYPE).NE.0) GO TO 800
3150 GO TO 400
3151
3152
3153
3154 160 I_TYPE=4+I_TYPE
3155 IF(I_TRIG.EQ.I_LAST) GO TO 260
3156 PARP(81)=ABS(HIPR1(10))-0.25
3157 CKIN(5)=ABS(HIPR1(10))-0.25
3158 CKIN(3)=ABS(HIPR1(10))-0.25
3159 CKIN(4)=ABS(HIPR1(10))+0.25
3160 IF(HIPR1(10).LT.HIPR1(8)) CKIN(4)=-1.0
3161
3162 MSEL=0
3163 DO 101 ISUB=1,200
3164 MSUB(ISUB)=0
3165 101 CONTINUE
3166 IF(IHPR2(3).EQ.1) THEN
3167 MSUB(11)=1
3168 MSUB(12)=1
3169 MSUB(13)=1
3170 MSUB(28)=1
3171 MSUB(53)=1
3172 MSUB(68)=1
3173 MSUB(81)=1
3174 MSUB(82)=1
3175 MSUB(14)=1
3176 MSUB(18)=1
3177 MSUB(29)=1
3178 DO 102 J=1,MIN(8,MDCY(21,3))
3179 102 MDME(MDCY(21,2)+J-1,1)=0
3180 ISEL=4
3181 IF(HINT1(1).GE.20.0 .and. IHPR2(18).EQ.1) ISEL=5
3182 MDME(MDCY(21,2)+ISEL-1,1)=1
3183
3184 ELSE IF(IHPR2(3).EQ.2) THEN
3185 MSUB(14)=1
3186 MSUB(18)=1
3187 MSUB(29)=1
3188
3189
3190 ELSE IF(IHPR2(3).EQ.3) THEN
3191 CKIN(3)=MAX(0.0,HIPR1(10))
3192 CKIN(5)=HIPR1(8)
3193 PARP(81)=HIPR1(8)
3194 MSUB(81)=1
3195 MSUB(82)=1
3196 DO 105 J=1,MIN(8,MDCY(21,3))
3197 105 MDME(MDCY(21,2)+J-1,1)=0
3198 ISEL=4
3199 IF(HINT1(1).GE.20.0 .and. IHPR2(18).EQ.1) ISEL=5
3200 MDME(MDCY(21,2)+ISEL-1,1)=1
3201
3202 ENDIF
3203 260 IF(INI(I_TYPE).NE.0) GO TO 800
3204
3205
3206 400 INI(I_TYPE)=1
3207 IF(IHPR2(10).EQ.0) MSTP(122)=0
3208 IF(NFP(JP,4).EQ.2212) THEN
3209 BEAM='P'
3210 ELSE IF(NFP(JP,4).EQ.-2212) THEN
3211 BEAM='P~'
3212 ELSE IF(NFP(JP,4).EQ.2112) THEN
3213 BEAM='N'
3214 ELSE IF(NFP(JP,4).EQ.-2112) THEN
3215 BEAM='N~'
3216 ELSE IF(NFP(JP,4).EQ.211) THEN
3217 BEAM='PI+'
3218 ELSE IF(NFP(JP,4).EQ.-211) THEN
3219 BEAM='PI-'
3220 ELSE IF(NFP(JP,4).EQ.321) THEN
3221 BEAM='PI+'
3222 ELSE IF(NFP(JP,4).EQ.-321) THEN
3223 BEAM='PI-'
3224 ELSE
3225 WRITE(6,*) 'unavailable beam type', NFP(JP,4)
3226 ENDIF
3227 IF(NFT(JT,4).EQ.2212) THEN
3228 TARG='P'
3229 ELSE IF(NFT(JT,4).EQ.-2212) THEN
3230 TARG='P~'
3231 ELSE IF(NFT(JT,4).EQ.2112) THEN
3232 TARG='N'
3233 ELSE IF(NFT(JT,4).EQ.-2112) THEN
3234 TARG='N~'
3235 ELSE IF(NFT(JT,4).EQ.211) THEN
3236 TARG='PI+'
3237 ELSE IF(NFT(JT,4).EQ.-211) THEN
3238 TARG='PI-'
3239 ELSE IF(NFT(JT,4).EQ.321) THEN
3240 TARG='PI+'
3241 ELSE IF(NFT(JT,4).EQ.-321) THEN
3242 TARG='PI-'
3243 ELSE
3244 WRITE(6,*) 'unavailable target type', NFT(JT,4)
3245 ENDIF
3246
3247 IHNT2(16)=1
3248
3249
3250
3251 CALL PYINIT('CMS',BEAM,TARG,HINT1(1))
3252 MINT4=MINT(44)
3253 MINT5=MINT(45)
3254 MINT44(I_TYPE)=MINT(44)
3255 MINT45(I_TYPE)=MINT(45)
3256 ATXS(0)=XSEC(0,1)
3257 XSEC0(I_TYPE,0)=XSEC(0,1)
3258 DO 500 I=1,200
3259 ATXS(I)=XSEC(I,1)
3260 XSEC0(I_TYPE,I)=XSEC(I,1)
3261 DO 500 J=1,20
3262 ATCO(I,J)=COEF(I,J)
3263 COEF0(I_TYPE,I,J)=COEF(I,J)
3264 500 CONTINUE
3265
3266 IHNT2(16)=0
3267
3268 RETURN
3269
3270
3271
3272
3273 800 MINT(44)=MINT44(I_TYPE)
3274 MINT(45)=MINT45(I_TYPE)
3275 MINT4=MINT(44)
3276 MINT5=MINT(45)
3277 XSEC(0,1)=XSEC0(I_TYPE,0)
3278 ATXS(0)=XSEC(0,1)
3279 DO 900 I=1,200
3280 XSEC(I,1)=XSEC0(I_TYPE,I)
3281 ATXS(I)=XSEC(I,1)
3282 DO 900 J=1,20
3283 COEF(I,J)=COEF0(I_TYPE,I,J)
3284 ATCO(I,J)=COEF(I,J)
3285 900 CONTINUE
3286 I_LAST=I_TRIG
3287 MINT(11)=NFP(JP,4)
3288 MINT(12)=NFT(JT,4)
3289 RETURN
3290 END
3291
3292
3293
3294 SUBROUTINE HIJINI
3295 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
3296 SAVE /HIPARNT/
3297 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
3298 SAVE /HISTRNG/
3299 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
3300 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
3301 & PJPM(300,500),NTJ(300),KFTJ(300,500),
3302 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
3303 & PJTE(300,500),PJTM(300,500)
3304 SAVE /HIJJET1/
3305 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
3306 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
3307 & PZSG(900,100),PESG(900,100),PMSG(900,100)
3308 SAVE /HIJJET2/
3309 COMMON/HIJJET4/NDR,IADR(900,2),KFDR(900),PDR(900,5)
3310 SAVE /HIJJET4/
3311 COMMON/RANSEED/NSEED
3312 SAVE /RANSEED/
3313
3314
3315
3316 NSG=0
3317 NDR=0
3318 IPP=2212
3319 IPT=2212
3320 IF(IHNT2(5).NE.0) IPP=IHNT2(5)
3321 IF(IHNT2(6).NE.0) IPT=IHNT2(6)
3322
3323
3324 DO 100 I=1,IHNT2(1)
3325 PP(I,1)=0.0
3326 PP(I,2)=0.0
3327 PP(I,3)=SQRT(HINT1(1)**2/4.0-HINT1(8)**2)
3328 PP(I,4)=HINT1(1)/2
3329 PP(I,5)=HINT1(8)
3330 PP(I,6)=0.0
3331 PP(I,7)=0.0
3332 PP(I,8)=0.0
3333 PP(I,9)=0.0
3334 PP(I,10)=0.0
3335 NFP(I,3)=IPP
3336 NFP(I,4)=IPP
3337 NFP(I,5)=0
3338 NFP(I,6)=0
3339 NFP(I,7)=0
3340 NFP(I,8)=0
3341 NFP(I,9)=0
3342 NFP(I,10)=0
3343 NFP(I,11)=0
3344 NPJ(I)=0
3345 IF(I.GT.ABS(IHNT2(2))) NFP(I,3)=2112
3346 CALL ATTFLV(NFP(I,3),IDQ,IDQQ)
3347 NFP(I,1)=IDQ
3348 NFP(I,2)=IDQQ
3349 NFP(I,15)=-1
3350 IF(ABS(IDQ).GT.1000.OR.(ABS(IDQ*IDQQ).LT.100.AND.
3351 & RLU(0).LT.0.5)) NFP(I,15)=1
3352 PP(I,14)=ULMASS(IDQ)
3353 PP(I,15)=ULMASS(IDQQ)
3354 100 CONTINUE
3355
3356 DO 200 I=1,IHNT2(3)
3357 PT(I,1)=0.0
3358 PT(I,2)=0.0
3359 PT(I,3)=-SQRT(HINT1(1)**2/4.0-HINT1(9)**2)
3360 PT(I,4)=HINT1(1)/2.0
3361 PT(I,5)=HINT1(9)
3362 PT(I,6)=0.0
3363 PT(I,7)=0.0
3364 PT(I,8)=0.0
3365 PT(I,9)=0.0
3366 PT(I,10)=0.0
3367 NFT(I,3)=IPT
3368 NFT(I,4)=IPT
3369 NFT(I,5)=0
3370 NFT(I,6)=0
3371 NFT(I,7)=0
3372 NFT(I,8)=0
3373 NFT(I,9)=0
3374 NFT(I,10)=0
3375 NFT(I,11)=0
3376 NTJ(I)=0
3377 IF(I.GT.ABS(IHNT2(4))) NFT(I,3)=2112
3378 CALL ATTFLV(NFT(I,3),IDQ,IDQQ)
3379 NFT(I,1)=IDQ
3380 NFT(I,2)=IDQQ
3381 NFT(I,15)=1
3382 IF(ABS(IDQ).GT.1000.OR.(ABS(IDQ*IDQQ).LT.100.AND.
3383 & RLU(0).LT.0.5)) NFT(I,15)=-1
3384 PT(I,14)=ULMASS(IDQ)
3385 PT(I,15)=ULMASS(IDQQ)
3386 200 CONTINUE
3387 RETURN
3388 END
3389
3390
3391
3392 SUBROUTINE ATTFLV(ID,IDQ,IDQQ)
3393 COMMON/RANSEED/NSEED
3394 SAVE /RANSEED/
3395
3396 IF(ABS(ID).LT.100) THEN
3397 NSIGN=1
3398 IDQ=ID/100
3399 IDQQ=-ID/10+IDQ*10
3400 IF(ABS(IDQ).EQ.3) NSIGN=-1
3401 IDQ=NSIGN*IDQ
3402 IDQQ=NSIGN*IDQQ
3403 IF(IDQ.LT.0) THEN
3404 ID0=IDQ
3405 IDQ=IDQQ
3406 IDQQ=ID0
3407 ENDIF
3408 RETURN
3409 ENDIF
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420 IDQ=2
3421 IF(ABS(ID).EQ.2112) IDQ=1
3422 IDQQ=2101
3423 X=RLU(0)
3424 IF(X.LE.0.5) GO TO 30
3425 IF(X.GT.0.666667) GO TO 10
3426 IDQQ=2103
3427 GO TO 30
3428 10 IDQ=1
3429 IDQQ=2203
3430 IF(ABS(ID).EQ.2112) THEN
3431 IDQ=2
3432 IDQQ=1103
3433 ENDIF
3434 30 IF(ID.LT.0) THEN
3435 ID00=IDQQ
3436 IDQQ=-IDQ
3437 IDQ=-ID00
3438 ENDIF
3439 RETURN
3440 END
3441
3442
3443
3444
3445
3446 SUBROUTINE HIJCSC(JP,JT)
3447 DIMENSION PSC1(5),PSC2(5)
3448 COMMON/HIJCRDN/YP(3,300),YT(3,300)
3449 SAVE /HIJCRDN/
3450 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
3451 SAVE /HIPARNT/
3452 COMMON/RANSEED/NSEED
3453 SAVE /RANSEED/
3454 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
3455 SAVE /HISTRNG/
3456 IF(JP.EQ.0 .OR. JT.EQ.0) GO TO 25
3457 DO 10 I=1,5
3458 PSC1(I)=PP(JP,I)
3459 PSC2(I)=PT(JT,I)
3460 10 CONTINUE
3461 CALL HIJELS(PSC1,PSC2)
3462 DPP1=PSC1(1)-PP(JP,1)
3463 DPP2=PSC1(2)-PP(JP,2)
3464 DPT1=PSC2(1)-PT(JT,1)
3465 DPT2=PSC2(2)-PT(JT,2)
3466 PP(JP,6)=PP(JP,6)+DPP1/2.0
3467 PP(JP,7)=PP(JP,7)+DPP2/2.0
3468 PP(JP,8)=PP(JP,8)+DPP1/2.0
3469 PP(JP,9)=PP(JP,9)+DPP2/2.0
3470 PT(JT,6)=PT(JT,6)+DPT1/2.0
3471 PT(JT,7)=PT(JT,7)+DPT2/2.0
3472 PT(JT,8)=PT(JT,8)+DPT1/2.0
3473 PT(JT,9)=PT(JT,9)+DPT2/2.0
3474 DO 20 I=1,4
3475 PP(JP,I)=PSC1(I)
3476 PT(JT,I)=PSC2(I)
3477 20 CONTINUE
3478 NFP(JP,5)=MAX(1,NFP(JP,5))
3479 NFT(JT,5)=MAX(1,NFT(JT,5))
3480
3481 RETURN
3482
3483
3484 25 IF(JP.EQ.0) GO TO 45
3485 PABS=SQRT(PP(JP,1)**2+PP(JP,2)**2+PP(JP,3)**2)
3486 BX=PP(JP,1)/PABS
3487 BY=PP(JP,2)/PABS
3488 BZ=PP(JP,3)/PABS
3489 DO 40 I=1,IHNT2(1)
3490 IF(I.EQ.JP) GO TO 40
3491 DX=YP(1,I)-YP(1,JP)
3492 DY=YP(2,I)-YP(2,JP)
3493 DZ=YP(3,I)-YP(3,JP)
3494 DIS=DX*BX+DY*BY+DZ*BZ
3495 IF(DIS.LE.0) GO TO 40
3496 BB=DX**2+DY**2+DZ**2-DIS**2
3497 R2=BB*HIPR1(40)/HIPR1(31)/0.1
3498
3499 GS=1.0-EXP(-(HIPR1(30)+HINT1(11))/HIPR1(31)/2.0
3500 & *ROMG(R2))**2
3501 GS0=1.0-EXP(-(HIPR1(30)+HINT1(11))/HIPR1(31)/2.0
3502 & *ROMG(0.0))**2
3503 IF(RLU(0).GT.GS/GS0) GO TO 40
3504 DO 30 K=1,5
3505 PSC1(K)=PP(JP,K)
3506 PSC2(K)=PP(I,K)
3507 30 CONTINUE
3508 CALL HIJELS(PSC1,PSC2)
3509 DPP1=PSC1(1)-PP(JP,1)
3510 DPP2=PSC1(2)-PP(JP,2)
3511 DPT1=PSC2(1)-PP(I,1)
3512 DPT2=PSC2(2)-PP(I,2)
3513 PP(JP,6)=PP(JP,6)+DPP1/2.0
3514 PP(JP,7)=PP(JP,7)+DPP2/2.0
3515 PP(JP,8)=PP(JP,8)+DPP1/2.0
3516 PP(JP,9)=PP(JP,9)+DPP2/2.0
3517 PP(I,6)=PP(I,6)+DPT1/2.0
3518 PP(I,7)=PP(I,7)+DPT2/2.0
3519 PP(I,8)=PP(I,8)+DPT1/2.0
3520 PP(I,9)=PP(I,9)+DPT2/2.0
3521 DO 35 K=1,5
3522 PP(JP,K)=PSC1(K)
3523 PP(I,K)=PSC2(K)
3524 35 CONTINUE
3525 NFP(I,5)=MAX(1,NFP(I,5))
3526 GO TO 45
3527 40 CONTINUE
3528 45 IF(JT.EQ.0) GO TO 80
3529 50 PABS=SQRT(PT(JT,1)**2+PT(JT,2)**2+PT(JT,3)**2)
3530 BX=PT(JT,1)/PABS
3531 BY=PT(JT,2)/PABS
3532 BZ=PT(JT,3)/PABS
3533 DO 70 I=1,IHNT2(3)
3534 IF(I.EQ.JT) GO TO 70
3535 DX=YT(1,I)-YT(1,JT)
3536 DY=YT(2,I)-YT(2,JT)
3537 DZ=YT(3,I)-YT(3,JT)
3538 DIS=DX*BX+DY*BY+DZ*BZ
3539 IF(DIS.LE.0) GO TO 70
3540 BB=DX**2+DY**2+DZ**2-DIS**2
3541 R2=BB*HIPR1(40)/HIPR1(31)/0.1
3542
3543 GS=(1.0-EXP(-(HIPR1(30)+HINT1(11))/HIPR1(31)/2.0
3544 & *ROMG(R2)))**2
3545 GS0=(1.0-EXP(-(HIPR1(30)+HINT1(11))/HIPR1(31)/2.0
3546 & *ROMG(0.0)))**2
3547 IF(RLU(0).GT.GS/GS0) GO TO 70
3548 DO 60 K=1,5
3549 PSC1(K)=PT(JT,K)
3550 PSC2(K)=PT(I,K)
3551 60 CONTINUE
3552 CALL HIJELS(PSC1,PSC2)
3553 DPP1=PSC1(1)-PT(JT,1)
3554 DPP2=PSC1(2)-PT(JT,2)
3555 DPT1=PSC2(1)-PT(I,1)
3556 DPT2=PSC2(2)-PT(I,2)
3557 PT(JT,6)=PT(JT,6)+DPP1/2.0
3558 PT(JT,7)=PT(JT,7)+DPP2/2.0
3559 PT(JT,8)=PT(JT,8)+DPP1/2.0
3560 PT(JT,9)=PT(JT,9)+DPP2/2.0
3561 PT(I,6)=PT(I,6)+DPT1/2.0
3562 PT(I,7)=PT(I,7)+DPT2/2.0
3563 PT(I,8)=PT(I,8)+DPT1/2.0
3564 PT(I,9)=PT(I,9)+DPT2/2.0
3565 DO 65 K=1,5
3566 PT(JT,K)=PSC1(K)
3567 PT(I,K)=PSC2(K)
3568 65 CONTINUE
3569 NFT(I,5)=MAX(1,NFT(I,5))
3570 GO TO 80
3571 70 CONTINUE
3572 80 RETURN
3573 END
3574
3575
3576
3577
3578
3579
3580 SUBROUTINE HIJELS(PSC1,PSC2)
3581 IMPLICIT DOUBLE PRECISION(D)
3582 DIMENSION PSC1(5),PSC2(5)
3583 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
3584 SAVE /HIPARNT/
3585 COMMON/RANSEED/NSEED
3586 SAVE /RANSEED/
3587
3588 CC=1.0-HINT1(12)/HINT1(13)
3589 RR=(1.0-CC)*HINT1(13)/HINT1(12)/(1.0-HIPR1(33))-1.0
3590 BB=0.5*(3.0+RR+SQRT(9.0+10.0*RR+RR**2))
3591 EP=SQRT((PSC1(1)-PSC2(1))**2+(PSC1(2)-PSC2(2))**2
3592 & +(PSC1(3)-PSC2(3))**2)
3593 IF(EP.LE.0.1) RETURN
3594 ELS0=98.0/EP+52.0*(1.0+RR)**2
3595 PCM1=PSC1(1)+PSC2(1)
3596 PCM2=PSC1(2)+PSC2(2)
3597 PCM3=PSC1(3)+PSC2(3)
3598 ECM=PSC1(4)+PSC2(4)
3599 AM1=PSC1(5)**2
3600 AM2=PSC2(5)**2
3601 AMM=ECM**2-PCM1**2-PCM2**2-PCM3**2
3602 IF(AMM.LE.PSC1(5)+PSC2(5)) RETURN
3603
3604
3605 PMAX=(AMM**2+AM1**2+AM2**2-2.0*AMM*AM1-2.0*AMM*AM2
3606 & -2.0*AM1*AM2)/4.0/AMM
3607 PMAX=ABS(PMAX)
3608 20 TT=RLU(0)*MIN(PMAX,1.5)
3609 ELS=98.0*EXP(-2.8*TT)/EP
3610 & +52.0*EXP(-9.2*TT)*(1.0+RR*EXP(-4.6*(BB-1.0)*TT))**2
3611 IF(RLU(0).GT.ELS/ELS0) GO TO 20
3612 PHI=2.0*HIPR1(40)*RLU(0)
3613
3614 DBX=PCM1/ECM
3615 DBY=PCM2/ECM
3616 DBZ=PCM3/ECM
3617 DB=SQRT(DBX**2+DBY**2+DBZ**2)
3618 IF(DB.GT.0.99999999D0) THEN
3619 DBX=DBX*(0.99999999D0/DB)
3620 DBY=DBY*(0.99999999D0/DB)
3621 DBZ=DBZ*(0.99999999D0/DB)
3622 DB=0.99999999D0
3623 WRITE(6,*) ' (HIJELS) boost vector too large'
3624
3625 ENDIF
3626 DGA=1D0/SQRT(1D0-DB**2)
3627
3628 DP1=SQRT(TT)*SIN(PHI)
3629 DP2=SQRT(TT)*COS(PHI)
3630 DP3=SQRT(PMAX-TT)
3631 DP4=SQRT(PMAX+AM1)
3632 DBP=DBX*DP1+DBY*DP2+DBZ*DP3
3633 DGABP=DGA*(DGA*DBP/(1D0+DGA)+DP4)
3634 PSC1(1)=DP1+DGABP*DBX
3635 PSC1(2)=DP2+DGABP*DBY
3636 PSC1(3)=DP3+DGABP*DBZ
3637 PSC1(4)=DGA*(DP4+DBP)
3638
3639 DP1=-SQRT(TT)*SIN(PHI)
3640 DP2=-SQRT(TT)*COS(PHI)
3641 DP3=-SQRT(PMAX-TT)
3642 DP4=SQRT(PMAX+AM2)
3643 DBP=DBX*DP1+DBY*DP2+DBZ*DP3
3644 DGABP=DGA*(DGA*DBP/(1D0+DGA)+DP4)
3645 PSC2(1)=DP1+DGABP*DBX
3646 PSC2(2)=DP2+DGABP*DBY
3647 PSC2(3)=DP3+DGABP*DBZ
3648 PSC2(4)=DGA*(DP4+DBP)
3649 RETURN
3650 END
3651
3652
3653
3654
3655
3656
3657
3658
3659 SUBROUTINE HIJSFT(JP,JT,JOUT,IERROR)
3660 COMMON/HIJCRDN/YP(3,300),YT(3,300)
3661 SAVE /HIJCRDN/
3662 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
3663 SAVE /HIPARNT/
3664 COMMON/HIJDAT/HIDAT0(10,10),HIDAT(10)
3665 SAVE /HIJDAT/
3666 COMMON/RANSEED/NSEED
3667 SAVE /RANSEED/
3668 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
3669 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
3670 & PJPM(300,500),NTJ(300),KFTJ(300,500),
3671 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
3672 & PJTE(300,500),PJTM(300,500)
3673 SAVE /HIJJET1/
3674 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
3675 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
3676 & PZSG(900,100),PESG(900,100),PMSG(900,100)
3677 SAVE /HIJJET2/
3678 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
3679 SAVE /HISTRNG/
3680 COMMON/DPMCOM1/JJP,JJT,AMP,AMT,APX0,ATX0,AMPN,AMTN,AMP0,AMT0,
3681 & NFDP,NFDT,WP,WM,SW,XREMP,XREMT,DPKC1,DPKC2,PP11,PP12,
3682 & PT11,PT12,PTP2,PTT2
3683 SAVE /DPMCOM1/
3684 COMMON/DPMCOM2/NDPM,KDPM(20,2),PDPM1(20,5),PDPM2(20,5)
3685 SAVE /DPMCOM2/
3686
3687
3688
3689
3690
3691
3692 IERROR=0
3693 JJP=JP
3694 JJT=JT
3695 NDPM=0
3696 IOPMAIN=0
3697 IF(JP.GT.IHNT2(1) .OR. JT.GT.IHNT2(3)) RETURN
3698
3699 EPP=PP(JP,4)+PP(JP,3)
3700 EPM=PP(JP,4)-PP(JP,3)
3701 ETP=PT(JT,4)+PT(JT,3)
3702 ETM=PT(JT,4)-PT(JT,3)
3703
3704 WP=EPP+ETP
3705 WM=EPM+ETM
3706 SW=WP*WM
3707
3708
3709 IF(WP.LT.0.0 .OR. WM.LT.0.0) GO TO 1000
3710
3711 IF(JOUT.EQ.0) THEN
3712 IF(EPP.LT.0.0) GO TO 1000
3713 IF(EPM.LT.0.0) GO TO 1000
3714 IF(ETP.LT.0.0) GO TO 1000
3715 IF(ETM.LT.0.0) GO TO 1000
3716 IF(EPP/(EPM+0.01).LE.ETP/(ETM+0.01)) RETURN
3717 ENDIF
3718
3719
3720
3721
3722
3723 IHNT2(11)=JP
3724 IHNT2(12)=JT
3725
3726
3727
3728 MISS=0
3729 PKC1=0.0
3730 PKC2=0.0
3731 PKC11=0.0
3732 PKC12=0.0
3733 PKC21=0.0
3734 PKC22=0.0
3735 DPKC11=0.0
3736 DPKC12=0.0
3737 DPKC21=0.0
3738 DPKC22=0.0
3739 IF(NFP(JP,10).EQ.1.OR.NFT(JT,10).EQ.1) THEN
3740 IF(NFP(JP,10).EQ.1) THEN
3741 PHI1=ULANGL(PP(JP,10),PP(JP,11))
3742 PPJET=SQRT(PP(JP,10)**2+PP(JP,11)**2)
3743 PKC1=PPJET
3744 PKC11=PP(JP,10)
3745 PKC12=PP(JP,11)
3746 ENDIF
3747 IF(NFT(JT,10).EQ.1) THEN
3748 PHI2=ULANGL(PT(JT,10),PT(JT,11))
3749 PTJET=SQRT(PT(JT,10)**2+PT(JT,11)**2)
3750 PKC2=PTJET
3751 PKC21=PT(JT,10)
3752 PKC22=PT(JT,11)
3753 ENDIF
3754 IF(IHPR2(4).GT.0.AND.IHNT2(1).GT.1.AND.IHNT2(3).GT.1) THEN
3755 IF(NFP(JP,10).EQ.0) THEN
3756 PHI=-PHI2
3757 ELSE IF(NFT(JT,10).EQ.0) THEN
3758 PHI=PHI1
3759 ELSE
3760 PHI=(PHI1+PHI2-HIPR1(40))/2.0
3761 ENDIF
3762 BX=HINT1(19)*COS(HINT1(20))
3763 BY=HINT1(19)*SIN(HINT1(20))
3764 XP0=YP(1,JP)
3765 YP0=YP(2,JP)
3766 XT0=YT(1,JT)+BX
3767 YT0=YT(2,JT)+BY
3768 R1=MAX(1.2*IHNT2(1)**0.3333333,
3769 & SQRT(XP0**2+YP0**2))
3770 R2=MAX(1.2*IHNT2(3)**0.3333333,
3771 & SQRT((XT0-BX)**2+(YT0-BY)**2))
3772 IF(ABS(COS(PHI)).LT.1.0E-5) THEN
3773 DD1=R1
3774 DD2=R1
3775 DD3=ABS(BY+SQRT(R2**2-(XP0-BX)**2)-YP0)
3776 DD4=ABS(BY-SQRT(R2**2-(XP0-BX)**2)-YP0)
3777 GO TO 5
3778 ENDIF
3779 BB=2.0*SIN(PHI)*(COS(PHI)*YP0-SIN(PHI)*XP0)
3780 CC=(YP0**2-R1**2)*COS(PHI)**2+XP0*SIN(PHI)*(
3781 & XP0*SIN(PHI)-2.0*YP0*COS(PHI))
3782 DD=BB**2-4.0*CC
3783 IF(DD.LT.0.0) GO TO 10
3784 XX1=(-BB+SQRT(DD))/2.0
3785 XX2=(-BB-SQRT(DD))/2.0
3786 DD1=ABS((XX1-XP0)/COS(PHI))
3787 DD2=ABS((XX2-XP0)/COS(PHI))
3788
3789 BB=2.0*SIN(PHI)*(COS(PHI)*(YT0-BY)-SIN(PHI)*XT0)-2.0*BX
3790 CC=(BX**2+(YT0-BY)**2-R2**2)*COS(PHI)**2+XT0*SIN(PHI)
3791 & *(XT0*SIN(PHI)-2.0*COS(PHI)*(YT0-BY))
3792 & -2.0*BX*SIN(PHI)*(COS(PHI)*(YT0-BY)-SIN(PHI)*XT0)
3793 DD=BB**2-4.0*CC
3794 IF(DD.LT.0.0) GO TO 10
3795 XX1=(-BB+SQRT(DD))/2.0
3796 XX2=(-BB-SQRT(DD))/2.0
3797 DD3=ABS((XX1-XT0)/COS(PHI))
3798 DD4=ABS((XX2-XT0)/COS(PHI))
3799
3800 5 DD1=MIN(DD1,DD3)
3801 DD2=MIN(DD2,DD4)
3802 IF(DD1.LT.HIPR1(13)) DD1=0.0
3803 IF(DD2.LT.HIPR1(13)) DD2=0.0
3804 IF(NFP(JP,10).EQ.1.AND.PPJET.GT.HIPR1(11)) THEN
3805 DP1=DD1*HIPR1(14)/2.0
3806 DP1=MIN(DP1,PPJET-HIPR1(11))
3807 PKC1=PPJET-DP1
3808 DPX1=COS(PHI1)*DP1
3809 DPY1=SIN(PHI1)*DP1
3810 PKC11=PP(JP,10)-DPX1
3811 PKC12=PP(JP,11)-DPY1
3812 IF(DP1.GT.0.0) THEN
3813 CTHEP=PP(JP,12)/SQRT(PP(JP,12)**2+PPJET**2)
3814 DPZ1=DP1*CTHEP/SQRT(1.0-CTHEP**2)
3815 DPE1=SQRT(DPX1**2+DPY1**2+DPZ1**2)
3816 EPPPRM=PP(JP,4)+PP(JP,3)-DPE1-DPZ1
3817 EPMPRM=PP(JP,4)-PP(JP,3)-DPE1+DPZ1
3818 IF(EPPPRM.LE.0.0.OR.EPMPRM.LE.0.0) GO TO 15
3819 EPP=EPPPRM
3820 EPM=EPMPRM
3821 PP(JP,10)=PKC11
3822 PP(JP,11)=PKC12
3823 NPJ(JP)=NPJ(JP)+1
3824 KFPJ(JP,NPJ(JP))=21
3825 PJPX(JP,NPJ(JP))=DPX1
3826 PJPY(JP,NPJ(JP))=DPY1
3827 PJPZ(JP,NPJ(JP))=DPZ1
3828 PJPE(JP,NPJ(JP))=DPE1
3829 PJPM(JP,NPJ(JP))=0.0
3830 PP(JP,3)=PP(JP,3)-DPZ1
3831 PP(JP,4)=PP(JP,4)-DPE1
3832 ENDIF
3833 ENDIF
3834 15 IF(NFT(JT,10).EQ.1.AND.PTJET.GT.HIPR1(11)) THEN
3835 DP2=DD2*HIPR1(14)/2.0
3836 DP2=MIN(DP2,PTJET-HIPR1(11))
3837 PKC2=PTJET-DP2
3838 DPX2=COS(PHI2)*DP2
3839 DPY2=SIN(PHI2)*DP2
3840 PKC21=PT(JT,10)-DPX2
3841 PKC22=PT(JT,11)-DPY2
3842 IF(DP2.GT.0.0) THEN
3843 CTHET=PT(JT,12)/SQRT(PT(JT,12)**2+PTJET**2)
3844 DPZ2=DP2*CTHET/SQRT(1.0-CTHET**2)
3845 DPE2=SQRT(DPX2**2+DPY2**2+DPZ2**2)
3846 ETPPRM=PT(JT,4)+PT(JT,3)-DPE2-DPZ2
3847 ETMPRM=PT(JT,4)-PT(JT,3)-DPE2+DPZ2
3848 IF(ETPPRM.LE.0.0.OR.ETMPRM.LE.0.0) GO TO 16
3849 ETP=ETPPRM
3850 ETM=ETMPRM
3851 PT(JT,10)=PKC21
3852 PT(JT,11)=PKC22
3853 NTJ(JT)=NTJ(JT)+1
3854 KFTJ(JT,NTJ(JT))=21
3855 PJTX(JT,NTJ(JT))=DPX2
3856 PJTY(JT,NTJ(JT))=DPY2
3857 PJTZ(JT,NTJ(JT))=DPZ2
3858 PJTE(JT,NTJ(JT))=DPE2
3859 PJTM(JT,NTJ(JT))=0.0
3860 PT(JT,3)=PT(JT,3)-DPZ2
3861 PT(JT,4)=PT(JT,4)-DPE2
3862 ENDIF
3863 ENDIF
3864 16 DPKC11=-(PP(JP,10)-PKC11)/2.0
3865 DPKC12=-(PP(JP,11)-PKC12)/2.0
3866 DPKC21=-(PT(JT,10)-PKC21)/2.0
3867 DPKC22=-(PT(JT,11)-PKC22)/2.0
3868 WP=EPP+ETP
3869 WM=EPM+ETM
3870 SW=WP*WM
3871 ENDIF
3872 ENDIF
3873
3874
3875
3876
3877 10 PTP02=PP(JP,1)**2+PP(JP,2)**2
3878 PTT02=PT(JT,1)**2+PT(JT,2)**2
3879
3880 AMQ=MAX(PP(JP,14)+PP(JP,15),PT(JT,14)+PT(JT,15))
3881 AMX=HIPR1(1)+AMQ
3882
3883
3884 AMP0=AMX
3885 DPM0=AMX
3886 NFDP=0
3887 IF(NFP(JP,5).LE.2.AND.NFP(JP,3).NE.0) THEN
3888 AMP0=ULMASS(NFP(JP,3))
3889 NFDP=NFP(JP,3)+2*NFP(JP,3)/ABS(NFP(JP,3))
3890 DPM0=ULMASS(NFDP)
3891 IF(DPM0.LE.0.0) THEN
3892 NFDP=NFDP-2*NFDP/ABS(NFDP)
3893 DPM0=ULMASS(NFDP)
3894 ENDIF
3895 ENDIF
3896 AMT0=AMX
3897 DTM0=AMX
3898 NFDT=0
3899 IF(NFT(JT,5).LE.2.AND.NFT(JT,3).NE.0) THEN
3900 AMT0=ULMASS(NFT(JT,3))
3901 NFDT=NFT(JT,3)+2*NFT(JT,3)/ABS(NFT(JT,3))
3902 DTM0=ULMASS(NFDT)
3903 IF(DTM0.LE.0.0) THEN
3904 NFDT=NFDT-2*NFDT/ABS(NFDT)
3905 DTM0=ULMASS(NFDT)
3906 ENDIF
3907 ENDIF
3908
3909 AMPN=SQRT(AMP0**2+PTP02)
3910 AMTN=SQRT(AMT0**2+PTT02)
3911 SNN=(AMPN+AMTN)**2+0.001
3912
3913 IF(SW.LT.SNN+0.001) GO TO 4000
3914
3915
3916 20 SWPTN=4.0*(MAX(AMP0,AMT0)**2+MAX(PTP02,PTT02))
3917 SWPTD=4.0*(MAX(DPM0,DTM0)**2+MAX(PTP02,PTT02))
3918 SWPTX=4.0*(AMX**2+MAX(PTP02,PTT02))
3919 IF(SW.LE.SWPTN) THEN
3920 PKCMX=0.0
3921 ELSE IF(SW.GT.SWPTN .AND. SW.LE.SWPTD
3922 & .AND.NPJ(JP).EQ.0.AND.NTJ(JT).EQ.0) THEN
3923 PKCMX=SQRT(SW/4.0-MAX(AMP0,AMT0)**2)
3924 & -SQRT(MAX(PTP02,PTT02))
3925 ELSE IF(SW.GT.SWPTD .AND. SW.LE.SWPTX
3926 & .AND.NPJ(JP).EQ.0.AND.NTJ(JT).EQ.0) THEN
3927 PKCMX=SQRT(SW/4.0-MAX(DPM0,DTM0)**2)
3928 & -SQRT(MAX(PTP02,PTT02))
3929 ELSE IF(SW.GT.SWPTX) THEN
3930 PKCMX=SQRT(SW/4.0-AMX**2)-SQRT(MAX(PTP02,PTT02))
3931 ENDIF
3932
3933
3934
3935 IF(NFP(JP,10).EQ.1.OR.NFT(JT,10).EQ.1) THEN
3936 IF(PKC1.GT.PKCMX) THEN
3937 PKC1=PKCMX
3938 PKC11=PKC1*COS(PHI1)
3939 PKC12=PKC1*SIN(PHI1)
3940 DPKC11=-(PP(JP,10)-PKC11)/2.0
3941 DPKC12=-(PP(JP,11)-PKC12)/2.0
3942 ENDIF
3943 IF(PKC2.GT.PKCMX) THEN
3944 PKC2=PKCMX
3945 PKC21=PKC2*COS(PHI2)
3946 PKC22=PKC2*SIN(PHI2)
3947 DPKC21=-(PT(JT,10)-PKC21)/2.0
3948 DPKC22=-(PT(JT,11)-PKC22)/2.0
3949 ENDIF
3950 DPKC1=DPKC11+DPKC21
3951 DPKC2=DPKC12+DPKC22
3952 NFP(JP,10)=-NFP(JP,10)
3953 NFT(JT,10)=-NFT(JT,10)
3954 GO TO 40
3955 ENDIF
3956
3957
3958 I_SNG=0
3959 IF(IHPR2(13).NE.0 .AND. RLU(0).LE.HIDAT(4)) I_SNG=1
3960 IF((NFP(JP,5).EQ.3 .OR.NFT(JT,5).EQ.3).OR.
3961 & (NPJ(JP).NE.0.OR.NFP(JP,10).NE.0).OR.
3962 & (NTJ(JT).NE.0.OR.NFT(JT,10).NE.0)) I_SNG=0
3963
3964
3965 IF(IHPR2(5).EQ.0) THEN
3966 PKC=HIPR1(2)*SQRT(-ALOG(1.0-RLU(0)
3967 & *(1.0-EXP(-PKCMX**2/HIPR1(2)**2))))
3968 GO TO 30
3969 ENDIF
3970 PKC=HIRND2(3,0.0,PKCMX**2)
3971 PKC=SQRT(PKC)
3972 IF(PKC.GT.HIPR1(20))
3973 & PKC=HIPR1(2)*SQRT(-ALOG(EXP(-HIPR1(20)**2/HIPR1(2)**2)
3974 & -RLU(0)*(EXP(-HIPR1(20)**2/HIPR1(2)**2)-
3975 & EXP(-PKCMX**2/HIPR1(2)**2))))
3976
3977 IF(I_SNG.EQ.1) PKC=0.65*SQRT(
3978 & -ALOG(1.0-RLU(0)*(1.0-EXP(-PKCMX**2/0.65**2))))
3979
3980 30 PHI0=2.0*HIPR1(40)*RLU(0)
3981 PKC11=PKC*SIN(PHI0)
3982 PKC12=PKC*COS(PHI0)
3983 PKC21=-PKC11
3984 PKC22=-PKC12
3985 DPKC1=0.0
3986 DPKC2=0.0
3987 40 PP11=PP(JP,1)+PKC11-DPKC1
3988 PP12=PP(JP,2)+PKC12-DPKC2
3989 PT11=PT(JT,1)+PKC21-DPKC1
3990 PT12=PT(JT,2)+PKC22-DPKC2
3991 PTP2=PP11**2+PP12**2
3992 PTT2=PT11**2+PT12**2
3993
3994 AMPN=SQRT(AMP0**2+PTP2)
3995 AMTN=SQRT(AMT0**2+PTT2)
3996 SNN=(AMPN+AMTN)**2+0.001
3997
3998 WP=EPP+ETP
3999 WM=EPM+ETM
4000 SW=WP*WM
4001
4002 IF(SW.LT.SNN) THEN
4003 MISS=MISS+1
4004 IF(MISS.LE.100) then
4005 PKC=0.0
4006 GO TO 30
4007 ENDIF
4008 IF(IHPR2(10).NE.0)
4009 & WRITE(6,*) 'Error occured in Pt kick section of HIJSFT'
4010 GO TO 4000
4011 ENDIF
4012
4013 AMPD=SQRT(DPM0**2+PTP2)
4014 AMTD=SQRT(DTM0**2+PTT2)
4015
4016 AMPX=SQRT(AMX**2+PTP2)
4017 AMTX=SQRT(AMX**2+PTT2)
4018
4019 DPN=AMPN**2/SW
4020 DTN=AMTN**2/SW
4021 DPD=AMPD**2/SW
4022 DTD=AMTD**2/SW
4023 DPX=AMPX**2/SW
4024 DTX=AMTX**2/SW
4025
4026 SPNTD=(AMPN+AMTD)**2
4027 SPNTX=(AMPN+AMTX)**2
4028
4029 SPDTN=(AMPD+AMTN)**2
4030 SPXTN=(AMPX+AMTN)**2
4031
4032 SPDTX=(AMPD+AMTX)**2
4033 SPXTD=(AMPX+AMTD)**2
4034 SDD=(AMPD+AMTD)**2
4035 SXX=(AMPX+AMTX)**2
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045 45 CONTINUE
4046 IF(SW.GT.SXX+0.001) THEN
4047 IF(I_SNG.EQ.0) THEN
4048 D1=DPX
4049 D2=DTX
4050 NFP3=0
4051 NFT3=0
4052 GO TO 400
4053 ELSE
4054
4055
4056 IF((NFP(JP,5).EQ.3 .AND.NFT(JT,5).EQ.3).OR.
4057 & (NPJ(JP).NE.0.OR.NFP(JP,10).NE.0).OR.
4058 & (NTJ(JT).NE.0.OR.NFT(JT,10).NE.0)) THEN
4059 D1=DPX
4060 D2=DTX
4061 NFP3=0
4062 NFT3=0
4063 GO TO 400
4064 ENDIF
4065
4066
4067 IF(RLU(0).GT.0.5.OR.(NFT(JT,5).GT.2.OR.
4068 & NTJ(JT).NE.0.OR.NFT(JT,10).NE.0)) THEN
4069 D1=DPN
4070 D2=DTX
4071 NFP3=NFP(JP,3)
4072 NFT3=0
4073 GO TO 220
4074 ELSE
4075 D1=DPX
4076 D2=DTN
4077 NFP3=0
4078 NFT3=NFT(JT,3)
4079 GO TO 240
4080 ENDIF
4081
4082 ENDIF
4083 ELSE IF(SW.GT.MAX(SPDTX,SPXTD)+0.001 .AND.
4084 & SW.LE.SXX+0.001) THEN
4085 IF(((NPJ(JP).EQ.0.AND.NTJ(JT).EQ.0.AND.
4086 & RLU(0).GT.0.5).OR.(NPJ(JP).EQ.0
4087 & .AND.NTJ(JT).NE.0)).AND.NFP(JP,5).LE.2) THEN
4088 D1=DPD
4089 D2=DTX
4090 NFP3=NFDP
4091 NFT3=0
4092 GO TO 220
4093 ELSE IF(NTJ(JT).EQ.0.AND.NFT(JT,5).LE.2) THEN
4094 D1=DPX
4095 D2=DTD
4096 NFP3=0
4097 NFT3=NFDT
4098 GO TO 240
4099 ENDIF
4100 GO TO 4000
4101 ELSE IF(SW.GT.MIN(SPDTX,SPXTD)+0.001.AND.
4102 & SW.LE.MAX(SPDTX,SPXTD)+0.001) THEN
4103 IF(SPDTX.LE.SPXTD.AND.NPJ(JP).EQ.0
4104 & .AND.NFP(JP,5).LE.2) THEN
4105 D1=DPD
4106 D2=DTX
4107 NFP3=NFDP
4108 NFT3=0
4109 GO TO 220
4110 ELSE IF(SPDTX.GT.SPXTD.AND.NTJ(JT).EQ.0
4111 & .AND.NFT(JT,5).LE.2) THEN
4112 D1=DPX
4113 D2=DTD
4114 NFP3=0
4115 NFT3=NFDT
4116 GO TO 240
4117 ENDIF
4118
4119
4120 IF(((NPJ(JP).EQ.0.AND.NTJ(JT).EQ.0
4121 & .AND.RLU(0).GT.0.5).OR.(NPJ(JP).EQ.0
4122 & .AND.NTJ(JT).NE.0)).AND.NFP(JP,5).LE.2) THEN
4123 D1=DPN
4124 D2=DTX
4125 NFP3=NFP(JP,3)
4126 NFT3=0
4127 GO TO 220
4128 ELSE IF(NTJ(JT).EQ.0.AND.NFT(JT,5).LE.2) THEN
4129 D1=DPX
4130 D2=DTN
4131 NFP3=0
4132 NFT3=NFT(JT,3)
4133 GO TO 240
4134 ENDIF
4135 GO TO 4000
4136 ELSE IF(SW.GT.MAX(SPNTX,SPXTN)+0.001 .AND.
4137 & SW.LE.MIN(SPDTX,SPXTD)+0.001) THEN
4138 IF(((NPJ(JP).EQ.0.AND.NTJ(JT).EQ.0
4139 & .AND.RLU(0).GT.0.5).OR.(NPJ(JP).EQ.0
4140 & .AND.NTJ(JT).NE.0)).AND.NFP(JP,5).LE.2) THEN
4141 D1=DPN
4142 D2=DTX
4143 NFP3=NFP(JP,3)
4144 NFT3=0
4145 GO TO 220
4146 ELSE IF(NTJ(JT).EQ.0.AND.NFT(JT,5).LE.2) THEN
4147 D1=DPX
4148 D2=DTN
4149 NFP3=0
4150 NFT3=NFT(JT,3)
4151 GO TO 240
4152 ENDIF
4153 GO TO 4000
4154 ELSE IF(SW.GT.MIN(SPNTX,SPXTN)+0.001 .AND.
4155 & SW.LE.MAX(SPNTX,SPXTN)+0.001) THEN
4156 IF(SPNTX.LE.SPXTN.AND.NPJ(JP).EQ.0
4157 & .AND.NFP(JP,5).LE.2) THEN
4158 D1=DPN
4159 D2=DTX
4160 NFP3=NFP(JP,3)
4161 NFT3=0
4162 GO TO 220
4163 ELSEIF(SPNTX.GT.SPXTN.AND.NTJ(JT).EQ.0
4164 & .AND.NFT(JT,5).LE.2) THEN
4165 D1=DPX
4166 D2=DTN
4167 NFP3=0
4168 NFT3=NFT(JT,3)
4169 GO TO 240
4170 ENDIF
4171 GO TO 4000
4172 ELSE IF(SW.LE.MIN(SPNTX,SPXTN)+0.001 .AND.
4173 & (NPJ(JP).NE.0 .OR.NTJ(JT).NE.0)) THEN
4174 GO TO 4000
4175 ELSE IF(SW.LE.MIN(SPNTX,SPXTN)+0.001 .AND.
4176 & NFP(JP,5).GT.2.AND.NFT(JT,5).GT.2) THEN
4177 GO TO 4000
4178 ELSE IF(SW.GT.SDD+0.001.AND.SW.LE.
4179 & MIN(SPNTX,SPXTN)+0.001) THEN
4180 D1=DPD
4181 D2=DTD
4182 NFP3=NFDP
4183 NFT3=NFDT
4184 GO TO 100
4185 ELSE IF(SW.GT.MAX(SPNTD,SPDTN)+0.001
4186 & .AND. SW.LE.SDD+0.001) THEN
4187 IF(RLU(0).GT.0.5) THEN
4188 D1=DPD
4189 D2=DTN
4190 NFP3=NFDP
4191 NFT3=NFT(JT,3)
4192 GO TO 100
4193 ELSE
4194 D1=DPN
4195 D2=DTD
4196 NFP3=NFP(JP,3)
4197 NFT3=NFDT
4198 GO TO 100
4199 ENDIF
4200 ELSE IF(SW.GT.MIN(SPNTD,SPDTN)+0.001
4201 & .AND. SW.LE.MAX(SPNTD,SPDTN)+0.001) THEN
4202 IF(SPNTD.GT.SPDTN) THEN
4203 D1=DPD
4204 D2=DTN
4205 NFP3=NFDP
4206 NFT3=NFT(JT,3)
4207 GO TO 100
4208 ELSE
4209 D1=DPN
4210 D2=DTD
4211 NFP3=NFP(JP,3)
4212 NFT3=NFDT
4213 GO TO 100
4214 ENDIF
4215 ELSE IF(SW.LE.MIN(SPNTD,SPDTN)+0.001) THEN
4216 D1=DPN
4217 D2=DTN
4218 NFP3=NFP(JP,3)
4219 NFT3=NFT(JT,3)
4220 GO TO 100
4221 ENDIF
4222 WRITE(6,*) ' Error in HIJSFT: There is no path to here'
4223 RETURN
4224
4225
4226
4227
4228
4229 100 NFP5=MAX(2,NFP(JP,5))
4230 NFT5=MAX(2,NFT(JT,5))
4231 BB1=1.0+D1-D2
4232 BB2=1.0+D2-D1
4233 IF(BB1**2.LT.4.0*D1 .OR. BB2**2.LT.4.0*D2) THEN
4234 MISS=MISS+1
4235 IF(MISS.GT.100.OR.PKC.EQ.0.0) GO TO 3000
4236 PKC=PKC*0.5
4237 GO TO 30
4238 ENDIF
4239 IF(RLU(0).LT.0.5) THEN
4240 X1=(BB1-SQRT(BB1**2-4.0*D1))/2.0
4241 X2=(BB2-SQRT(BB2**2-4.0*D2))/2.0
4242 ELSE
4243 X1=(BB1+SQRT(BB1**2-4.0*D1))/2.0
4244 X2=(BB2+SQRT(BB2**2-4.0*D2))/2.0
4245 ENDIF
4246 IHNT2(13)=2
4247 GO TO 600
4248
4249
4250
4251
4252 220 NFP5=MAX(2,NFP(JP,5))
4253 NFT5=3
4254 IF(NFP3.EQ.0) NFP5=3
4255 BB2=1.0+D2-D1
4256 IF(BB2**2.LT.4.0*D2) THEN
4257 MISS=MISS+1
4258 IF(MISS.GT.100.OR.PKC.EQ.0.0) GO TO 3000
4259 PKC=PKC*0.5
4260 GO TO 30
4261 ENDIF
4262 XMIN=(BB2-SQRT(BB2**2-4.0*D2))/2.0
4263 XMAX=(BB2+SQRT(BB2**2-4.0*D2))/2.0
4264 MISS4=0
4265 222 X2=HIRND2(6,XMIN,XMAX)
4266 X1=D1/(1.0-X2)
4267 IF(X2*(1.0-X1).LT.(D2+1.E-4/SW)) THEN
4268 MISS4=MISS4+1
4269 IF(MISS4.LE.1000) GO TO 222
4270 GO TO 5000
4271 ENDIF
4272 IHNT2(13)=2
4273 GO TO 600
4274
4275 240 NFP5=3
4276 NFT5=MAX(2,NFT(JT,5))
4277 IF(NFT3.EQ.0) NFT5=3
4278 BB1=1.0+D1-D2
4279 IF(BB1**2.LT.4.0*D1) THEN
4280 MISS=MISS+1
4281 IF(MISS.GT.100.OR.PKC.EQ.0.0) GO TO 3000
4282 PKC=PKC*0.5
4283 GO TO 30
4284 ENDIF
4285 XMIN=(BB1-SQRT(BB1**2-4.0*D1))/2.0
4286 XMAX=(BB1+SQRT(BB1**2-4.0*D1))/2.0
4287 MISS4=0
4288 242 X1=HIRND2(6,XMIN,XMAX)
4289 X2=D2/(1.0-X1)
4290 IF(X1*(1.0-X2).LT.(D1+1.E-4/SW)) THEN
4291 MISS4=MISS4+1
4292 IF(MISS4.LE.1000) GO TO 242
4293 GO TO 5000
4294 ENDIF
4295 IHNT2(13)=2
4296 GO TO 600
4297
4298
4299
4300
4301
4302
4303 400 NFP5=3
4304 NFT5=3
4305 BB1=1.0+D1-D2
4306 BB2=1.0+D2-D1
4307 IF(BB1**2.LT.4.0*D1 .OR. BB2**2.LT.4.0*D2) THEN
4308 MISS=MISS+1
4309 IF(MISS.GT.100.OR.PKC.EQ.0.0) GO TO 3000
4310 PKC=PKC*0.5
4311 GO TO 30
4312 ENDIF
4313 XMIN1=(BB1-SQRT(BB1**2-4.0*D1))/2.0
4314 XMAX1=(BB1+SQRT(BB1**2-4.0*D1))/2.0
4315 XMIN2=(BB2-SQRT(BB2**2-4.0*D2))/2.0
4316 XMAX2=(BB2+SQRT(BB2**2-4.0*D2))/2.0
4317 MISS4=0
4318 410 X1=HIRND2(4,XMIN1,XMAX1)
4319 X2=HIRND2(4,XMIN2,XMAX2)
4320 IF(NFP(JP,5).EQ.3.OR.NFT(JT,5).EQ.3) THEN
4321 X1=HIRND2(6,XMIN1,XMAX1)
4322 X2=HIRND2(6,XMIN2,XMAX2)
4323 ENDIF
4324
4325 IF(ABS(NFP(JP,1)*NFP(JP,2)).GT.1000000.OR.
4326 & ABS(NFP(JP,1)*NFP(JP,2)).LT.100) THEN
4327 X1=HIRND2(5,XMIN1,XMAX1)
4328 ENDIF
4329 IF(ABS(NFT(JT,1)*NFT(JT,2)).GT.1000000.OR.
4330 & ABS(NFT(JT,1)*NFT(JT,2)).LT.100) THEN
4331 X2=HIRND2(5,XMIN2,XMAX2)
4332 ENDIF
4333
4334
4335
4336
4337
4338
4339 IF(ABS(NFP(JP,1)*NFP(JP,2)).GT.1000000) X1=1.0-X1
4340 XXP=X1*(1.0-X2)
4341 XXT=X2*(1.0-X1)
4342 IF(XXP.LT.(D1+1.E-4/SW) .OR. XXT.LT.(D2+1.E-4/SW)) THEN
4343 MISS4=MISS4+1
4344 IF(MISS4.LE.1000) GO TO 410
4345 GO TO 5000
4346 ENDIF
4347 IHNT2(13)=3
4348
4349
4350 600 CONTINUE
4351 IF(X1*(1.0-X2).LT.(AMPN**2-1.E-4)/SW.OR.
4352 & X2*(1.0-X1).LT.(AMTN**2-1.E-4)/SW) THEN
4353 MISS=MISS+1
4354 IF(MISS.GT.100.OR.PKC.EQ.0.0) GO TO 2000
4355 PKC=0.0
4356 GO TO 30
4357 ENDIF
4358
4359 EPP=(1.0-X2)*WP
4360 EPM=X1*WM
4361 ETP=X2*WP
4362 ETM=(1.0-X1)*WM
4363 PP(JP,3)=(EPP-EPM)/2.0
4364 PP(JP,4)=(EPP+EPM)/2.0
4365 IF(EPP*EPM-PTP2.LT.0.0) GO TO 6000
4366 PP(JP,5)=SQRT(EPP*EPM-PTP2)
4367 NFP(JP,3)=NFP3
4368 NFP(JP,5)=NFP5
4369
4370 PT(JT,3)=(ETP-ETM)/2.0
4371 PT(JT,4)=(ETP+ETM)/2.0
4372 IF(ETP*ETM-PTT2.LT.0.0) GO TO 6000
4373 PT(JT,5)=SQRT(ETP*ETM-PTT2)
4374 NFT(JT,3)=NFT3
4375 NFT(JT,5)=NFT5
4376
4377
4378 PP(JP,1)=PP11-PKC11
4379 PP(JP,2)=PP12-PKC12
4380
4381 KICKDIP=1
4382 KICKDIT=1
4383 IF(ABS(NFP(JP,1)*NFP(JP,2)).GT.1000000.OR.
4384 & ABS(NFP(JP,1)*NFP(JP,2)).LT.100) THEN
4385 KICKDIP=0
4386 ENDIF
4387 IF(ABS(NFT(JT,1)*NFT(JT,2)).GT.1000000.OR.
4388 & ABS(NFT(JT,1)*NFT(JT,2)).LT.100) THEN
4389 KICKDIT=0
4390 ENDIF
4391 IF((KICKDIP.EQ.0.AND.RLU(0).LT.0.5)
4392 & .OR.(KICKDIP.NE.0.AND.RLU(0)
4393 & .LT.0.5/(1.0+(PKC11**2+PKC12**2)/HIPR1(22)**2))) THEN
4394 PP(JP,6)=(PP(JP,1)-PP(JP,6)-PP(JP,8)-DPKC1)/2.0+PP(JP,6)
4395 PP(JP,7)=(PP(JP,2)-PP(JP,7)-PP(JP,9)-DPKC2)/2.0+PP(JP,7)
4396 PP(JP,8)=(PP(JP,1)-PP(JP,6)-PP(JP,8)-DPKC1)/2.0
4397 & +PP(JP,8)+PKC11
4398 PP(JP,9)=(PP(JP,2)-PP(JP,7)-PP(JP,9)-DPKC2)/2.0
4399 & +PP(JP,9)+PKC12
4400 ELSE
4401 PP(JP,8)=(PP(JP,1)-PP(JP,6)-PP(JP,8)-DPKC1)/2.0+PP(JP,8)
4402 PP(JP,9)=(PP(JP,2)-PP(JP,7)-PP(JP,9)-DPKC2)/2.0+PP(JP,9)
4403 PP(JP,6)=(PP(JP,1)-PP(JP,6)-PP(JP,8)-DPKC1)/2.0
4404 & +PP(JP,6)+PKC11
4405 PP(JP,7)=(PP(JP,2)-PP(JP,7)-PP(JP,9)-DPKC2)/2.0
4406 & +PP(JP,7)+PKC12
4407 ENDIF
4408 PP(JP,1)=PP(JP,6)+PP(JP,8)
4409 PP(JP,2)=PP(JP,7)+PP(JP,9)
4410
4411 PT(JT,1)=PT11-PKC21
4412 PT(JT,2)=PT12-PKC22
4413 IF((KICKDIT.EQ.0.AND.RLU(0).LT.0.5)
4414 & .OR.(KICKDIT.NE.0.AND.RLU(0)
4415 & .LT.0.5/(1.0+(PKC21**2+PKC22**2)/HIPR1(22)**2))) THEN
4416 PT(JT,6)=(PT(JT,1)-PT(JT,6)-PT(JT,8)-DPKC1)/2.0+PT(JT,6)
4417 PT(JT,7)=(PT(JT,2)-PT(JT,7)-PT(JT,9)-DPKC2)/2.0+PT(JT,7)
4418 PT(JT,8)=(PT(JT,1)-PT(JT,6)-PT(JT,8)-DPKC1)/2.0
4419 & +PT(JT,8)+PKC21
4420 PT(JT,9)=(PT(JT,2)-PT(JT,7)-PT(JT,9)-DPKC2)/2.0
4421 & +PT(JT,9)+PKC22
4422 ELSE
4423 PT(JT,8)=(PT(JT,1)-PT(JT,6)-PT(JT,8)-DPKC1)/2.0+PT(JT,8)
4424 PT(JT,9)=(PT(JT,2)-PT(JT,7)-PT(JT,9)-DPKC2)/2.0+PT(JT,9)
4425 PT(JT,6)=(PT(JT,1)-PT(JT,6)-PT(JT,8)-DPKC1)/2.0
4426 & +PT(JT,6)+PKC21
4427 PT(JT,7)=(PT(JT,2)-PT(JT,7)-PT(JT,9)-DPKC2)/2.0
4428 & +PT(JT,7)+PKC22
4429 ENDIF
4430 PT(JT,1)=PT(JT,6)+PT(JT,8)
4431 PT(JT,2)=PT(JT,7)+PT(JT,9)
4432
4433
4434 IF(NPJ(JP).NE.0) NFP(JP,5)=3
4435 IF(NTJ(JT).NE.0) NFT(JT,5)=3
4436
4437 IF(EPP/(EPM+0.0001).LT.ETP/(ETM+0.0001).AND.
4438 & ABS(NFP(JP,1)*NFP(JP,2)).LT.1000000)THEN
4439 DO 620 JSB=1,15
4440 PSB=PP(JP,JSB)
4441 PP(JP,JSB)=PT(JT,JSB)
4442 PT(JT,JSB)=PSB
4443 NSB=NFP(JP,JSB)
4444 NFP(JP,JSB)=NFT(JT,JSB)
4445 NFT(JT,JSB)=NSB
4446 620 CONTINUE
4447
4448
4449 ENDIF
4450
4451 RETURN
4452
4453
4454 1000 IERROR=1
4455 IF(IHPR2(10).EQ.0) RETURN
4456 WRITE(6,*) ' Fatal HIJSFT start error,abandon this event'
4457 WRITE(6,*) ' PROJ E+,E-,W+',EPP,EPM,WP
4458 WRITE(6,*) ' TARG E+,E-,W-',ETP,ETM,WM
4459 WRITE(6,*) ' W+*W-, (APN+ATN)^2',SW,SNN
4460 RETURN
4461 2000 IERROR=0
4462 IF(IHPR2(10).EQ.0) RETURN
4463 WRITE(6,*) ' (2)energy partition fail,'
4464 WRITE(6,*) ' HIJSFT not performed, but continue'
4465 WRITE(6,*) ' MP1,MPN',X1*(1.0-X2)*SW,AMPN**2
4466 WRITE(6,*) ' MT2,MTN',X2*(1.0-X1)*SW,AMTN**2
4467 RETURN
4468 3000 IERROR=0
4469 IF(IHPR2(10).EQ.0) RETURN
4470 WRITE(6,*) ' (3)something is wrong with the pt kick, '
4471 WRITE(6,*) ' HIJSFT not performed, but continue'
4472 WRITE(6,*) ' D1=',D1,' D2=',D2,' SW=',SW
4473 WRITE(6,*) ' HISTORY NFP5=',NFP(JP,5),' NFT5=',NFT(JT,5)
4474 WRITE(6,*) ' THIS COLLISON NFP5=',NFP5, ' NFT5=',NFT5
4475 WRITE(6,*) ' # OF JET IN PROJ',NPJ(JP),' IN TARG',NTJ(JT)
4476 RETURN
4477 4000 IERROR=0
4478 IF(IHPR2(10).EQ.0) RETURN
4479 WRITE(6,*) ' (4)unable to choose process, but not harmful'
4480 WRITE(6,*) ' HIJSFT not performed, but continue'
4481 WRITE(6,*) ' PTP=',SQRT(PTP2),' PTT=',SQRT(PTT2),' SW=',SW
4482 WRITE(6,*) ' AMCUT=',AMX,' JP=',JP,' JT=',JT
4483 WRITE(6,*) ' HISTORY NFP5=',NFP(JP,5),' NFT5=',NFT(JT,5)
4484 RETURN
4485 5000 IERROR=0
4486 IF(IHPR2(10).EQ.0) RETURN
4487 WRITE(6,*) ' energy partition failed(5),for limited try'
4488 WRITE(6,*) ' HIJSFT not performed, but continue'
4489 WRITE(6,*) ' NFP5=',NFP5,' NFT5=',NFT5
4490 WRITE(6,*) ' D1',D1,' X1(1-X2)',X1*(1.0-X2)
4491 WRITE(6,*) ' D2',D2,' X2(1-X1)',X2*(1.0-X1)
4492 RETURN
4493 6000 PKC=0.0
4494 MISS=MISS+1
4495 IF(MISS.LT.100) GO TO 30
4496 IERROR=1
4497 IF(IHPR2(10).EQ.0) RETURN
4498 WRITE(6,*) ' ERROR OCCURED, HIJSFT NOT PERFORMED'
4499 WRITE(6,*) ' Abort this event'
4500 WRITE(6,*) 'MTP,PTP2',EPP*EPM,PTP2,' MTT,PTT2',ETP*ETM,PTT2
4501 RETURN
4502 END
4503
4504
4505
4506 SUBROUTINE HIJFLV(ID)
4507 COMMON/RANSEED/NSEED
4508 SAVE /RANSEED/
4509 ID=1
4510 RNID=RLU(0)
4511 IF(RNID.GT.0.43478) THEN
4512 ID=2
4513 IF(RNID.GT.0.86956) ID=3
4514 ENDIF
4515 RETURN
4516 END
4517
4518
4519
4520 SUBROUTINE HIPTDI(PT,PTMAX,IOPT)
4521 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4522 SAVE /HIPARNT/
4523 COMMON/RANSEED/NSEED
4524 SAVE /RANSEED/
4525 IF(IOPT.EQ.2) THEN
4526 PT=HIRND2(7,0.0,PTMAX)
4527 IF(PT.GT.HIPR1(8))
4528 & PT=HIPR1(2)*SQRT(-ALOG(EXP(-HIPR1(8)**2/HIPR1(2)**2)
4529 & -RLU(0)*(EXP(-HIPR1(8)**2/HIPR1(2)**2)-
4530 & EXP(-PTMAX**2/HIPR1(2)**2))))
4531
4532 ELSE
4533 PT=HIPR1(2)*SQRT(-ALOG(1.0-RLU(0)*
4534 & (1.0-EXP(-PTMAX**2/HIPR1(2)**2))))
4535 ENDIF
4536 PTMAX0=MAX(PTMAX,0.01)
4537 PT=MIN(PTMAX0-0.01,PT)
4538 RETURN
4539 END
4540
4541
4542
4543
4544
4545
4546
4547 SUBROUTINE HIJWDS(IA,IDH,XHIGH)
4548
4549
4550 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4551 SAVE /HIPARNT/
4552 COMMON/WOOD/R,D,FNORM,W
4553 SAVE /WOOD/
4554 DIMENSION IAA(20),RR(20),DD(20),WW(20),RMS(20)
4555 EXTERNAL RWDSAX,WDSAX
4556
4557
4558
4559 DATA IAA/2,4,12,16,27,32,40,56,63,93,184,197,208,7*0./
4560 DATA RR/0.01,.964,2.355,2.608,2.84,3.458,3.766,3.971,4.214,
4561 1 4.87,6.51,6.38,6.624,7*0./
4562 DATA DD/0.5882,.322,.522,.513,.569,.61,.586,.5935,.586,.573,
4563 1 .535,.535,.549,7*0./
4564 DATA WW/0.0,.517,-0.149,-0.051,0.,-0.208,-0.161,13*0./
4565 DATA RMS/2.11,1.71,2.46,2.73,3.05,3.247,3.482,3.737,3.925,4.31,
4566 1 5.42,5.33,5.521,7*0./
4567
4568 SAVE IAA, RR, DD, WW, RMS
4569
4570 A=IA
4571
4572
4573 D=0.54
4574
4575 R=1.19*A**(1./3.) - 1.61*A**(-1./3.)
4576
4577 W=0.
4578
4579
4580
4581 DO 10 I=1,13
4582 IF (IA.EQ.IAA(I)) THEN
4583 R=RR(I)
4584 D=DD(I)
4585 W=WW(I)
4586 RS=RMS(I)
4587 END IF
4588 10 CONTINUE
4589
4590 FNORM=1.0
4591 XLOW=0.
4592 XHIGH=R+ 12.*D
4593 IF (W.LT.-0.01) THEN
4594 IF (XHIGH.GT.R/SQRT(ABS(W))) XHIGH=R/SQRT(ABS(W))
4595 END IF
4596 FGAUS=GAUSS1(RWDSAX,XLOW,XHIGH,0.001)
4597 FNORM=1./FGAUS
4598
4599 IF (IDH.EQ.1) THEN
4600 HINT1(72)=R
4601 HINT1(73)=D
4602 HINT1(74)=W
4603 HINT1(75)=FNORM/4.0/HIPR1(40)
4604 ELSE IF (IDH.EQ.2) THEN
4605 HINT1(76)=R
4606 HINT1(77)=D
4607 HINT1(78)=W
4608 HINT1(79)=FNORM/4.0/HIPR1(40)
4609 ENDIF
4610
4611
4612
4613 CALL HIFUN(IDH,XLOW,XHIGH,RWDSAX)
4614 RETURN
4615 END
4616
4617
4618 FUNCTION WDSAX(X)
4619
4620 COMMON/WOOD/R,D,FNORM,W
4621 SAVE /WOOD/
4622 WDSAX=FNORM*(1.+W*(X/R)**2)/(1+EXP((X-R)/D))
4623 IF (W.LT.0.) THEN
4624 IF (X.GE.R/SQRT(ABS(W))) WDSAX=0.
4625 ENDIF
4626 RETURN
4627 END
4628
4629
4630 FUNCTION RWDSAX(X)
4631 RWDSAX=X*X*WDSAX(X)
4632 RETURN
4633 END
4634
4635
4636
4637
4638 FUNCTION WDSAX1(X)
4639
4640
4641
4642
4643 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4644 SAVE /HIPARNT/
4645 WDSAX1=HINT1(75)*(1.+HINT1(74)*(X/HINT1(72))**2)/
4646 & (1+EXP((X-HINT1(72))/HINT1(73)))
4647 IF (HINT1(74).LT.0.) THEN
4648 IF (X.GE.HINT1(72)/SQRT(ABS(HINT1(74)))) WDSAX1=0.
4649 ENDIF
4650 RETURN
4651 END
4652
4653
4654 FUNCTION WDSAX2(X)
4655
4656
4657
4658
4659 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4660 SAVE /HIPARNT/
4661 WDSAX2=HINT1(79)*(1.+HINT1(78)*(X/HINT1(76))**2)/
4662 & (1+EXP((X-HINT1(76))/HINT1(77)))
4663 IF (HINT1(78).LT.0.) THEN
4664 IF (X.GE.HINT1(76)/SQRT(ABS(HINT1(78)))) WDSAX2=0.
4665 ENDIF
4666 RETURN
4667 END
4668
4669
4670
4671
4672
4673 FUNCTION PROFILE(XB)
4674 COMMON/PACT/BB,B1,PHI,Z1
4675 SAVE /PACT/
4676 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4677 SAVE /HIPARNT/
4678 EXTERNAL FLAP, FLAP1, FLAP2
4679
4680 BB=XB
4681 PROFILE=1.0
4682 IF(IHNT2(1).GT.1 .AND. IHNT2(3).GT.1) THEN
4683 PROFILE=float(IHNT2(1))*float(IHNT2(3))*0.1*
4684 & GAUSS1(FLAP,0.0,HIPR1(34),0.01)
4685 ELSE IF(IHNT2(1).EQ.1 .AND. IHNT2(3).GT.1) THEN
4686 PROFILE=0.2*float(IHNT2(3))*
4687 & GAUSS1(FLAP2,0.0,HIPR1(35),0.001)
4688 ELSE IF(IHNT2(1).GT.1 .AND. IHNT2(3).EQ.1) THEN
4689 PROFILE=0.2*float(IHNT2(1))*
4690 & GAUSS1(FLAP1,0.0,HIPR1(34),0.001)
4691 ENDIF
4692 RETURN
4693 END
4694
4695
4696 FUNCTION FLAP(X)
4697 COMMON/PACT/BB,B1,PHI,Z1
4698 SAVE /PACT/
4699 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4700 SAVE /HIPARNT/
4701 EXTERNAL FGP1
4702 B1=X
4703 FLAP=GAUSS2(FGP1,0.0,2.0*HIPR1(40),0.01)
4704 RETURN
4705 END
4706
4707 FUNCTION FGP1(X)
4708 COMMON/PACT/BB,B1,PHI,Z1
4709 SAVE /PACT/
4710 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4711 SAVE /HIPARNT/
4712 EXTERNAL FGP2
4713 PHI=X
4714 FGP1=2.0*GAUSS3(FGP2,0.0,HIPR1(34),0.01)
4715 RETURN
4716 END
4717
4718 FUNCTION FGP2(X)
4719 COMMON/PACT/BB,B1,PHI,Z1
4720 SAVE /PACT/
4721 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4722 SAVE /HIPARNT/
4723 EXTERNAL FGP3
4724 Z1=X
4725 FGP2=2.0*GAUSS4(FGP3,0.0,HIPR1(35),0.01)
4726 RETURN
4727 END
4728
4729 FUNCTION FGP3(X)
4730 COMMON/PACT/BB,B1,PHI,Z1
4731 SAVE /PACT/
4732 R1=SQRT(B1**2+Z1**2)
4733 R2=SQRT(BB**2+B1**2-2.0*B1*BB*COS(PHI)+X**2)
4734 FGP3=B1*WDSAX1(R1)*WDSAX2(R2)
4735 RETURN
4736 END
4737
4738
4739 FUNCTION FLAP1(X)
4740 COMMON/PACT/BB,B1,PHI,Z1
4741 SAVE /PACT/
4742 R=SQRT(BB**2+X**2)
4743 FLAP1=WDSAX1(R)
4744 RETURN
4745 END
4746
4747
4748 FUNCTION FLAP2(X)
4749 COMMON/PACT/BB,B1,PHI,Z1
4750 SAVE /PACT/
4751 R=SQRT(BB**2+X**2)
4752 FLAP2=WDSAX2(R)
4753 RETURN
4754 END
4755
4756
4757
4758
4759
4760
4761
4762
4763 SUBROUTINE HIFUN(I,XMIN,XMAX,FHB)
4764 COMMON/HIJHB/RR(10,201),XX(10,201)
4765 SAVE /HIJHB/
4766 EXTERNAL FHB
4767 FNORM=GAUSS1(FHB,XMIN,XMAX,0.001)
4768 DO 100 J=1,201
4769 XX(I,J)=XMIN+(XMAX-XMIN)*(J-1)/200.0
4770 XDD=XX(I,J)
4771 RR(I,J)=GAUSS1(FHB,XMIN,XDD,0.001)/FNORM
4772 100 CONTINUE
4773 RETURN
4774 END
4775
4776
4777
4778 FUNCTION HIRND(I)
4779 COMMON/HIJHB/RR(10,201),XX(10,201)
4780 SAVE /HIJHB/
4781 COMMON/RANSEED/NSEED
4782 SAVE /RANSEED/
4783 RX=RLU(0)
4784 JL=0
4785 JU=202
4786 10 IF(JU-JL.GT.1) THEN
4787 JM=(JU+JL)/2
4788 IF((RR(I,201).GT.RR(I,1)).EQV.(RX.GT.RR(I,JM))) THEN
4789 JL=JM
4790 ELSE
4791 JU=JM
4792 ENDIF
4793 GO TO 10
4794 ENDIF
4795 J=JL
4796 IF(J.LT.1) J=1
4797 IF(J.GE.201) J=200
4798 HIRND=(XX(I,J)+XX(I,J+1))/2.0
4799 RETURN
4800 END
4801
4802
4803
4804
4805
4806 FUNCTION HIRND2(I,XMIN,XMAX)
4807 COMMON/HIJHB/RR(10,201),XX(10,201)
4808 SAVE /HIJHB/
4809 COMMON/RANSEED/NSEED
4810 SAVE /RANSEED/
4811 IF(XMIN.LT.XX(I,1)) XMIN=XX(I,1)
4812 IF(XMAX.GT.XX(I,201)) XMAX=XX(I,201)
4813 JMIN=1+200*(XMIN-XX(I,1))/(XX(I,201)-XX(I,1))
4814 JMAX=1+200*(XMAX-XX(I,1))/(XX(I,201)-XX(I,1))
4815 RX=RR(I,JMIN)+(RR(I,JMAX)-RR(I,JMIN))*RLU(0)
4816 JL=0
4817 JU=202
4818 10 IF(JU-JL.GT.1) THEN
4819 JM=(JU+JL)/2
4820 IF((RR(I,201).GT.RR(I,1)).EQV.(RX.GT.RR(I,JM))) THEN
4821 JL=JM
4822 ELSE
4823 JU=JM
4824 ENDIF
4825 GO TO 10
4826 ENDIF
4827 J=JL
4828 IF(J.LT.1) J=1
4829 IF(J.GE.201) J=200
4830 HIRND2=(XX(I,J)+XX(I,J+1))/2.0
4831 RETURN
4832 END
4833
4834
4835
4836
4837 SUBROUTINE HIJCRS
4838
4839
4840 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4841 SAVE /HIPARNT/
4842 COMMON/NJET/N,IP_CRS
4843 SAVE /NJET/
4844 EXTERNAL FHIN,FTOT,FNJET,FTOTJET,FTOTRIG
4845 IF(HINT1(1).GE.10.0) CALL CRSJET
4846
4847
4848 APHX1=HIPR1(6)*(IHNT2(1)**0.3333333-1.0)
4849 APHX2=HIPR1(6)*(IHNT2(3)**0.3333333-1.0)
4850 HINT1(11)=HINT1(14)-APHX1*HINT1(15)
4851 & -APHX2*HINT1(16)+APHX1*APHX2*HINT1(17)
4852 HINT1(10)=GAUSS1(FTOTJET,0.0,20.0,0.01)
4853 HINT1(12)=GAUSS1(FHIN,0.0,20.0,0.01)
4854 HINT1(13)=GAUSS1(FTOT,0.0,20.0,0.01)
4855 HINT1(60)=HINT1(61)-APHX1*HINT1(62)
4856 & -APHX2*HINT1(63)+APHX1*APHX2*HINT1(64)
4857 HINT1(59)=GAUSS1(FTOTRIG,0.0,20.0,0.01)
4858 IF(HINT1(59).EQ.0.0) HINT1(59)=HINT1(60)
4859 IF(HINT1(1).GE.10.0) Then
4860 DO 20 I=0,20
4861 N=I
4862 HINT1(80+I)=GAUSS1(FNJET,0.0,20.0,0.01)/HINT1(12)
4863 20 CONTINUE
4864 ENDIF
4865 HINT1(10)=HINT1(10)*HIPR1(31)
4866 HINT1(12)=HINT1(12)*HIPR1(31)
4867 HINT1(13)=HINT1(13)*HIPR1(31)
4868 HINT1(59)=HINT1(59)*HIPR1(31)
4869
4870
4871 IF(IHPR2(13).NE.0) THEN
4872 HIPR1(33)=1.36*(1.0+36.0/HINT1(1)**2)
4873 & *ALOG(0.6+0.1*HINT1(1)**2)
4874 HIPR1(33)=HIPR1(33)/HINT1(12)
4875 ENDIF
4876
4877
4878 RETURN
4879 END
4880
4881
4882
4883
4884 FUNCTION FTOT(X)
4885 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4886 SAVE /HIPARNT/
4887 OMG=OMG0(X)*(HIPR1(30)+HINT1(11))/HIPR1(31)/2.0
4888 FTOT=2.0*(1.0-EXP(-OMG))
4889 RETURN
4890 END
4891
4892
4893
4894 FUNCTION FHIN(X)
4895 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4896 SAVE /HIPARNT/
4897 OMG=OMG0(X)*(HIPR1(30)+HINT1(11))/HIPR1(31)/2.0
4898 FHIN=1.0-EXP(-2.0*OMG)
4899 RETURN
4900 END
4901
4902
4903
4904 FUNCTION FTOTJET(X)
4905 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4906 SAVE /HIPARNT/
4907 OMG=OMG0(X)*HINT1(11)/HIPR1(31)/2.0
4908 FTOTJET=1.0-EXP(-2.0*OMG)
4909 RETURN
4910 END
4911
4912
4913
4914 FUNCTION FTOTRIG(X)
4915 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4916 SAVE /HIPARNT/
4917 OMG=OMG0(X)*HINT1(60)/HIPR1(31)/2.0
4918 FTOTRIG=1.0-EXP(-2.0*OMG)
4919 RETURN
4920 END
4921
4922
4923
4924
4925 FUNCTION FNJET(X)
4926 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4927 SAVE /HIPARNT/
4928 COMMON/NJET/N,IP_CRS
4929 SAVE /NJET/
4930 OMG1=OMG0(X)*HINT1(11)/HIPR1(31)
4931 C0=EXP(N*ALOG(OMG1)-SGMIN(N+1))
4932 IF(N.EQ.0) C0=1.0-EXP(-2.0*OMG0(X)*HIPR1(30)/HIPR1(31)/2.0)
4933 FNJET=C0*EXP(-OMG1)
4934 RETURN
4935 END
4936
4937
4938
4939
4940
4941 FUNCTION SGMIN(N)
4942 GA=0.
4943 IF(N.LE.2) GO TO 20
4944 DO 10 I=1,N-1
4945 Z=I
4946 GA=GA+ALOG(Z)
4947 10 CONTINUE
4948 20 SGMIN=GA
4949 RETURN
4950 END
4951
4952
4953
4954 FUNCTION OMG0(X)
4955 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
4956 SAVE /HIPARNT/
4957 COMMON /BESEL/X4
4958 SAVE /BESEL/
4959 EXTERNAL BK
4960 X4=HIPR1(32)*SQRT(X)
4961 OMG0=HIPR1(32)**2*GAUSS2(BK,X4,X4+20.0,0.01)/96.0
4962
4963 RETURN
4964 END
4965
4966
4967
4968 FUNCTION ROMG(X)
4969
4970
4971 DIMENSION FR(0:1000)
4972
4973
4974 COMMON/EIKONAL/FR
4975
4976
4977 DATA I0/0/
4978 save I0 !Uzhi
4979 IF(I0.NE.0) GO TO 100
4980 DO 50 I=1,1001
4981 XR=(I-1)*0.01
4982 FR(I-1)=OMG0(XR)
4983
4984 50 CONTINUE
4985 100 I0=1
4986
4987 IF(X.GE.10.0) THEN
4988 ROMG=0.0
4989 RETURN
4990 ENDIF
4991 IX=INT(X*100)
4992
4993 ROMG=(FR(IX)*((IX+1)*0.01-X)+FR(IX+1)*(X-IX*0.01))/0.01
4994
4995 RETURN
4996 END
4997
4998
4999
5000
5001 FUNCTION BK(X)
5002 COMMON /BESEL/X4
5003 SAVE /BESEL/
5004 BK=EXP(-X)*(X**2-X4**2)**2.50/15.0
5005 RETURN
5006 END
5007
5008
5009
5010
5011
5012 SUBROUTINE CRSJET
5013 IMPLICIT REAL*8(A-H,O-Z)
5014 REAL HIPR1(100),HINT1(100)
5015 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5016 SAVE /HIPARNT/
5017 COMMON/NJET/N,IP_CRS
5018 SAVE /NJET/
5019 COMMON/BVEG1/XL(10),XU(10),ACC,NDIM,NCALL,ITMX,NPRN
5020 SAVE /BVEG1/
5021 COMMON/BVEG2/XI(50,10),SI,SI2,SWGT,SCHI,NDO,IT
5022 SAVE /BVEG2/
5023 COMMON/BVEG3/F,TI,TSI
5024 SAVE /BVEG3/
5025 COMMON/SEEDVAX/NUM1
5026 SAVE /SEEDVAX/
5027 EXTERNAL FJET,FJETRIG
5028
5029
5030
5031
5032
5033
5034 NDIM=3
5035 IP_CRS=0
5036 CALL VEGAS(FJET,AVGI,SD,CHI2A)
5037 HINT1(14)=AVGI/2.5682
5038 IF(IHPR2(6).EQ.1 .AND. IHNT2(1).GT.1) THEN
5039 IP_CRS=1
5040 CALL VEGAS(FJET,AVGI,SD,CHI2A)
5041 HINT1(15)=AVGI/2.5682
5042 ENDIF
5043 IF(IHPR2(6).EQ.1 .AND. IHNT2(3).GT.1) THEN
5044 IP_CRS=2
5045 CALL VEGAS(FJET,AVGI,SD,CHI2A)
5046 HINT1(16)=AVGI/2.5682
5047 ENDIF
5048 IF(IHPR2(6).EQ.1.AND.IHNT2(1).GT.1.AND.IHNT2(3).GT.1) THEN
5049 IP_CRS=3
5050 CALL VEGAS(FJET,AVGI,SD,CHI2A)
5051 HINT1(17)=AVGI/2.5682
5052 ENDIF
5053
5054
5055 IF(IHPR2(3).NE.0) THEN
5056 IP_CRS=0
5057 CALL VEGAS(FJETRIG,AVGI,SD,CHI2A)
5058 HINT1(61)=AVGI/2.5682
5059 IF(IHPR2(6).EQ.1 .AND. IHNT2(1).GT.1) THEN
5060 IP_CRS=1
5061 CALL VEGAS(FJETRIG,AVGI,SD,CHI2A)
5062 HINT1(62)=AVGI/2.5682
5063 ENDIF
5064 IF(IHPR2(6).EQ.1 .AND. IHNT2(3).GT.1) THEN
5065 IP_CRS=2
5066 CALL VEGAS(FJETRIG,AVGI,SD,CHI2A)
5067 HINT1(63)=AVGI/2.5682
5068 ENDIF
5069 IF(IHPR2(6).EQ.1.AND.IHNT2(1).GT.1.AND.IHNT2(3).GT.1) THEN
5070 IP_CRS=3
5071 CALL VEGAS(FJETRIG,AVGI,SD,CHI2A)
5072 HINT1(64)=AVGI/2.5682
5073 ENDIF
5074 ENDIF
5075
5076
5077 RETURN
5078 END
5079
5080
5081
5082 FUNCTION FJET(X,WGT)
5083 IMPLICIT REAL*8(A-H,O-Z)
5084 REAL HIPR1(100),HINT1(100)
5085 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5086 SAVE /HIPARNT/
5087 DIMENSION X(10)
5088 PT2=(HINT1(1)**2/4.0-HIPR1(8)**2)*X(1)+HIPR1(8)**2
5089 XT=2.0*DSQRT(PT2)/HINT1(1)
5090 YMX1=DLOG(1.0/XT+DSQRT(1.0/XT**2-1.0))
5091 Y1=2.0*YMX1*X(2)-YMX1
5092 YMX2=DLOG(2.0/XT-DEXP(Y1))
5093 YMN2=DLOG(2.0/XT-DEXP(-Y1))
5094 Y2=(YMX2+YMN2)*X(3)-YMN2
5095 FJET=2.0*YMX1*(YMX2+YMN2)*(HINT1(1)**2/4.0-HIPR1(8)**2)
5096 & *G(Y1,Y2,PT2)/2.0
5097 RETURN
5098 END
5099
5100
5101
5102 FUNCTION FJETRIG(X,WGT)
5103 IMPLICIT REAL*8(A-H,O-Z)
5104 REAL HIPR1(100),HINT1(100),PTMAX,PTMIN
5105 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5106 SAVE /HIPARNT/
5107 DIMENSION X(10)
5108 PTMIN=ABS(HIPR1(10))-0.25
5109 PTMIN=MAX(PTMIN,HIPR1(8))
5110 AM2=0.D0
5111 IF(IHPR2(3).EQ.3) THEN
5112 AM2=HIPR1(7)**2
5113 PTMIN=MAX(0.0,HIPR1(10))
5114 ENDIF
5115 PTMAX=ABS(HIPR1(10))+0.25
5116 IF(HIPR1(10).LE.0.0) PTMAX=HINT1(1)/2.0-AM2
5117 IF(PTMAX.LE.PTMIN) PTMAX=PTMIN+0.25
5118 PT2=(PTMAX**2-PTMIN**2)*X(1)+PTMIN**2
5119 AMT2=PT2+AM2
5120 XT=2.0*DSQRT(AMT2)/HINT1(1)
5121 YMX1=DLOG(1.0/XT+DSQRT(1.0/XT**2-1.0))
5122 Y1=2.0*YMX1*X(2)-YMX1
5123 YMX2=DLOG(2.0/XT-DEXP(Y1))
5124 YMN2=DLOG(2.0/XT-DEXP(-Y1))
5125 Y2=(YMX2+YMN2)*X(3)-YMN2
5126 IF(IHPR2(3).EQ.3) THEN
5127 GTRIG=2.0*GHVQ(Y1,Y2,AMT2)
5128 ELSE IF(IHPR2(3).EQ.2) THEN
5129 GTRIG=2.0*GPHOTON(Y1,Y2,PT2)
5130 ELSE
5131 GTRIG=G(Y1,Y2,PT2)
5132 ENDIF
5133 FJETRIG=2.0*YMX1*(YMX2+YMN2)*(PTMAX**2-PTMIN**2)
5134 & *GTRIG/2.0
5135 RETURN
5136 END
5137
5138
5139
5140 FUNCTION GHVQ(Y1,Y2,AMT2)
5141 IMPLICIT REAL*8 (A-H,O-Z)
5142 REAL HIPR1(100),HINT1(100)
5143 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5144 SAVE /HIPARNT/
5145 DIMENSION F(2,7)
5146 XT=2.0*DSQRT(AMT2)/HINT1(1)
5147 X1=0.50*XT*(DEXP(Y1)+DEXP(Y2))
5148 X2=0.50*XT*(DEXP(-Y1)+DEXP(-Y2))
5149 SS=X1*X2*HINT1(1)**2
5150 AF=4.0
5151 IF(IHPR2(18).NE.0) AF=5.0
5152 DLAM=HIPR1(15)
5153 APH=12.0*3.1415926/(33.0-2.0*AF)/DLOG(AMT2/DLAM**2)
5154
5155 CALL PARTON(F,X1,X2,AMT2)
5156
5157 Gqq=4.0*(COSH(Y1-Y2)+HIPR1(7)**2/AMT2)/(1.D0+COSH(Y1-Y2))/9.0
5158 & *(F(1,1)*F(2,2)+F(1,2)*F(2,1)+F(1,3)*F(2,4)
5159 & +F(1,4)*F(2,3)+F(1,5)*F(2,6)+F(1,6)*F(2,5))
5160 Ggg=(8.D0*COSH(Y1-Y2)-1.D0)*(COSH(Y1-Y2)+2.0*HIPR1(7)**2/AMT2
5161 & -2.0*HIPR1(7)**4/AMT2**2)/(1.0+COSH(Y1-Y2))/24.D0
5162 & *F(1,7)*F(2,7)
5163
5164 GHVQ=(Gqq+Ggg)*HIPR1(23)*3.14159*APH**2/SS**2
5165 RETURN
5166 END
5167
5168
5169
5170 FUNCTION GPHOTON(Y1,Y2,PT2)
5171 IMPLICIT REAL*8 (A-H,O-Z)
5172 REAL HIPR1(100),HINT1(100)
5173 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5174 SAVE /HIPARNT/
5175 DIMENSION F(2,7)
5176 XT=2.0*DSQRT(PT2)/HINT1(1)
5177 X1=0.50*XT*(DEXP(Y1)+DEXP(Y2))
5178 X2=0.50*XT*(DEXP(-Y1)+DEXP(-Y2))
5179 Z=DSQRT(1.D0-XT**2/X1/X2)
5180 SS=X1*X2*HINT1(1)**2
5181 T=-(1.0-Z)/2.0
5182 U=-(1.0+Z)/2.0
5183 AF=3.0
5184 DLAM=HIPR1(15)
5185 APH=12.0*3.1415926/(33.0-2.0*AF)/DLOG(PT2/DLAM**2)
5186 APHEM=1.0/137.0
5187
5188 CALL PARTON(F,X1,X2,PT2)
5189
5190 G11=-(U**2+1.0)/U/3.0*F(1,7)*(4.0*F(2,1)+4.0*F(2,2)
5191 & +F(2,3)+F(2,4)+F(2,5)+F(2,6))/9.0
5192 G12=-(T**2+1.0)/T/3.0*F(2,7)*(4.0*F(1,1)+4.0*F(1,2)
5193 & +F(1,3)+F(1,4)+F(1,5)+F(1,6))/9.0
5194 G2=8.0*(U**2+T**2)/U/T/9.0*(4.0*F(1,1)*F(2,2)
5195 & +4.0*F(1,2)*F(2,1)+F(1,3)*F(2,4)+F(1,4)*F(2,3)
5196 & +F(1,5)*F(2,6)+F(1,6)*F(2,5))/9.0
5197
5198 GPHOTON=(G11+G12+G2)*HIPR1(23)*3.14159*APH*APHEM/SS**2
5199 RETURN
5200 END
5201
5202
5203
5204
5205 FUNCTION G(Y1,Y2,PT2)
5206 IMPLICIT REAL*8 (A-H,O-Z)
5207 REAL HIPR1(100),HINT1(100)
5208 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5209 SAVE /HIPARNT/
5210 DIMENSION F(2,7)
5211 XT=2.0*DSQRT(PT2)/HINT1(1)
5212 X1=0.50*XT*(DEXP(Y1)+DEXP(Y2))
5213 X2=0.50*XT*(DEXP(-Y1)+DEXP(-Y2))
5214 Z=DSQRT(1.D0-XT**2/X1/X2)
5215 SS=X1*X2*HINT1(1)**2
5216 T=-(1.0-Z)/2.0
5217 U=-(1.0+Z)/2.0
5218 AF=3.0
5219 DLAM=HIPR1(15)
5220 APH=12.0*3.1415926/(33.0-2.0*AF)/DLOG(PT2/DLAM**2)
5221
5222 CALL PARTON(F,X1,X2,PT2)
5223
5224 G11=( (F(1,1)+F(1,2))*(F(2,3)+F(2,4)+F(2,5)+F(2,6))
5225 & +(F(1,3)+F(1,4))*(F(2,5)+F(2,6)) )*SUBCRS1(T,U)
5226
5227 G12=( (F(2,1)+F(2,2))*(F(1,3)+F(1,4)+F(1,5)+F(1,6))
5228 & +(F(2,3)+F(2,4))*(F(1,5)+F(1,6)) )*SUBCRS1(U,T)
5229
5230 G13=(F(1,1)*F(2,1)+F(1,2)*F(2,2)+F(1,3)*F(2,3)+F(1,4)*F(2,4)
5231 & +F(1,5)*F(2,5)+F(1,6)*F(2,6))*(SUBCRS1(U,T)
5232 & +SUBCRS1(T,U)-8.D0/T/U/27.D0)
5233
5234 G2=(AF-1)*(F(1,1)*F(2,2)+F(2,1)*F(1,2)+F(1,3)*F(2,4)
5235 & +F(2,3)*F(1,4)+F(1,5)*F(2,6)+F(2,5)*F(1,6))*SUBCRS2(T,U)
5236
5237 G31=(F(1,1)*F(2,2)+F(1,3)*F(2,4)+F(1,5)*F(2,6))*SUBCRS3(T,U)
5238 G32=(F(2,1)*F(1,2)+F(2,3)*F(1,4)+F(2,5)*F(1,6))*SUBCRS3(U,T)
5239
5240 G4=(F(1,1)*F(2,2)+F(2,1)*F(1,2)+F(1,3)*F(2,4)+F(2,3)*F(1,4)+
5241 1 F(1,5)*F(2,6)+F(2,5)*F(1,6))*SUBCRS4(T,U)
5242
5243 G5=AF*F(1,7)*F(2,7)*SUBCRS5(T,U)
5244
5245 G61=F(1,7)*(F(2,1)+F(2,2)+F(2,3)+F(2,4)+F(2,5)
5246 & +F(2,6))*SUBCRS6(T,U)
5247 G62=F(2,7)*(F(1,1)+F(1,2)+F(1,3)+F(1,4)+F(1,5)
5248 & +F(1,6))*SUBCRS6(U,T)
5249
5250 G7=F(1,7)*F(2,7)*SUBCRS7(T,U)
5251
5252 G=(G11+G12+G13+G2+G31+G32+G4+G5+G61+G62+G7)*HIPR1(17)*
5253 1 3.14159D0*APH**2/SS**2
5254 RETURN
5255 END
5256
5257
5258
5259 FUNCTION SUBCRS1(T,U)
5260 IMPLICIT REAL*8(A-H,O-Z)
5261 SUBCRS1=4.D0/9.D0*(1.D0+U**2)/T**2
5262 RETURN
5263 END
5264
5265
5266 FUNCTION SUBCRS2(T,U)
5267 IMPLICIT REAL*8(A-H,O-Z)
5268 SUBCRS2=4.D0/9.D0*(T**2+U**2)
5269 RETURN
5270 END
5271
5272
5273 FUNCTION SUBCRS3(T,U)
5274 IMPLICIT REAL*8(A-H,O-Z)
5275 SUBCRS3=4.D0/9.D0*(T**2+U**2+(1.D0+U**2)/T**2
5276 1 -2.D0*U**2/3.D0/T)
5277 RETURN
5278 END
5279
5280
5281 FUNCTION SUBCRS4(T,U)
5282 IMPLICIT REAL*8(A-H,O-Z)
5283 SUBCRS4=8.D0/3.D0*(T**2+U**2)*(4.D0/9.D0/T/U-1.D0)
5284 RETURN
5285 END
5286
5287
5288
5289 FUNCTION SUBCRS5(T,U)
5290 IMPLICIT REAL*8(A-H,O-Z)
5291 SUBCRS5=3.D0/8.D0*(T**2+U**2)*(4.D0/9.D0/T/U-1.D0)
5292 RETURN
5293 END
5294
5295
5296 FUNCTION SUBCRS6(T,U)
5297 IMPLICIT REAL*8(A-H,O-Z)
5298 SUBCRS6=(1.D0+U**2)*(1.D0/T**2-4.D0/U/9.D0)
5299 RETURN
5300 END
5301
5302
5303 FUNCTION SUBCRS7(T,U)
5304 IMPLICIT REAL*8(A-H,O-Z)
5305 SUBCRS7=9.D0/2.D0*(3.D0-T*U-U/T**2-T/U**2)
5306 RETURN
5307 END
5308
5309
5310
5311 SUBROUTINE PARTON(F,X1,X2,QQ)
5312 IMPLICIT REAL*8(A-H,O-Z)
5313 REAL HIPR1(100),HINT1(100)
5314 COMMON/HIPARNT/HIPR1,IHPR2(50),HINT1,IHNT2(50)
5315 SAVE /HIPARNT/
5316 COMMON/NJET/N,IP_CRS
5317 SAVE /NJET/
5318 DIMENSION F(2,7)
5319 DLAM=HIPR1(15)
5320 Q0=HIPR1(16)
5321 S=DLOG(DLOG(QQ/DLAM**2)/DLOG(Q0**2/DLAM**2))
5322 IF(IHPR2(7).EQ.2) GO TO 200
5323
5324 AT1=0.419+0.004*S-0.007*S**2
5325 AT2=3.460+0.724*S-0.066*S**2
5326 GMUD=4.40-4.86*S+1.33*S**2
5327 AT3=0.763-0.237*S+0.026*S**2
5328 AT4=4.00+0.627*S-0.019*S**2
5329 GMD=-0.421*S+0.033*S**2
5330
5331 CAS=1.265-1.132*S+0.293*S**2
5332 AS=-0.372*S-0.029*S**2
5333 BS=8.05+1.59*S-0.153*S**2
5334 APHS=6.31*S-0.273*S**2
5335 BTAS=-10.5*S-3.17*S**2
5336 GMS=14.7*S+9.80*S**2
5337
5338
5339
5340
5341
5342
5343
5344
5345 CAG=1.56-1.71*S+0.638*S**2
5346 AG=-0.949*S+0.325*S**2
5347 BG=6.0+1.44*S-1.05*S**2
5348 APHG=9.0-7.19*S+0.255*S**2
5349 BTAG=-16.5*S+10.9*S**2
5350 GMG=15.3*S-10.1*S**2
5351 GO TO 300
5352
5353 200 AT1=0.374+0.014*S
5354 AT2=3.33+0.753*S-0.076*S**2
5355 GMUD=6.03-6.22*S+1.56*S**2
5356 AT3=0.761-0.232*S+0.023*S**2
5357 AT4=3.83+0.627*S-0.019*S**2
5358 GMD=-0.418*S+0.036*S**2
5359
5360 CAS=1.67-1.92*S+0.582*S**2
5361 AS=-0.273*S-0.164*S**2
5362 BS=9.15+0.530*S-0.763*S**2
5363 APHS=15.7*S-2.83*S**2
5364 BTAS=-101.0*S+44.7*S**2
5365 GMS=223.0*S-117.0*S**2
5366
5367
5368
5369
5370
5371
5372
5373
5374 CAG=0.879-0.971*S+0.434*S**2
5375 AG=-1.16*S+0.476*S**2
5376 BG=4.0+1.23*S-0.254*S**2
5377 APHG=9.0-5.64*S-0.817*S**2
5378 BTAG=-7.54*S+5.50*S**2
5379 GMG=-0.596*S+1.26*S**2
5380
5381 300 B12=DEXP(GMRE(AT1)+GMRE(AT2+1.D0)-GMRE(AT1+AT2+1.D0))
5382 B34=DEXP(GMRE(AT3)+GMRE(AT4+1.D0)-GMRE(AT3+AT4+1.D0))
5383 CNUD=3.D0/B12/(1.D0+GMUD*AT1/(AT1+AT2+1.D0))
5384 CND=1.D0/B34/(1.D0+GMD*AT3/(AT3+AT4+1.D0))
5385
5386
5387
5388
5389 FUD1=CNUD*X1**AT1*(1.D0-X1)**AT2*(1.D0+GMUD*X1)
5390 FS1=CAS*X1**AS*(1.D0-X1)**BS*(1.D0+APHS*X1
5391 & +BTAS*X1**2+GMS*X1**3)
5392 F(1,3)=CND*X1**AT3*(1.D0-X1)**AT4*(1.D0+GMD*X1)+FS1/6.D0
5393 F(1,1)=FUD1-F(1,3)+FS1/3.D0
5394 F(1,2)=FS1/6.D0
5395 F(1,4)=FS1/6.D0
5396 F(1,5)=FS1/6.D0
5397 F(1,6)=FS1/6.D0
5398 F(1,7)=CAG*X1**AG*(1.D0-X1)**BG*(1.D0+APHG*X1
5399 & +BTAG*X1**2+GMG*X1**3)
5400
5401 FUD2=CNUD*X2**AT1*(1.D0-X2)**AT2*(1.D0+GMUD*X2)
5402 FS2=CAS*X2**AS*(1.D0-X2)**BS*(1.D0+APHS*X2
5403 & +BTAS*X2**2+GMS*X2**3)
5404 F(2,3)=CND*X2**AT3*(1.D0-X2)**AT4*(1.D0+GMD*X2)+FS2/6.D0
5405 F(2,1)=FUD2-F(2,3)+FS2/3.D0
5406 F(2,2)=FS2/6.D0
5407 F(2,4)=FS2/6.D0
5408 F(2,5)=FS2/6.D0
5409 F(2,6)=FS2/6.D0
5410 F(2,7)=CAG*X2**AG*(1.D0-X2)**BG*(1.D0+APHG*X2
5411 & +BTAG*X2**2+GMG*X2**3)
5412
5413
5414 IF(IHPR2(6).EQ.1 .AND. IHNT2(1).GT.1) THEN
5415 AAX=1.193*ALOG(FLOAT(IHNT2(1)))**0.16666666
5416 RRX=AAX*(X1**3-1.2*X1**2+0.21*X1)+1.0
5417 & +1.079*(FLOAT(IHNT2(1))**0.33333333-1.0)
5418 & /DLOG(IHNT2(1)+1.0D0)*DSQRT(X1)*DEXP(-X1**2/0.01)
5419 IF(IP_CRS.EQ.1 .OR.IP_CRS.EQ.3) RRX=DEXP(-X1**2/0.01)
5420 DO 400 I=1,7
5421 F(1,I)=RRX*F(1,I)
5422 400 CONTINUE
5423 ENDIF
5424 IF(IHPR2(6).EQ.1 .AND. IHNT2(3).GT.1) THEN
5425 AAX=1.193*ALOG(FLOAT(IHNT2(3)))**0.16666666
5426 RRX=AAX*(X2**3-1.2*X2**2+0.21*X2)+1.0
5427 & +1.079*(FLOAT(IHNT2(3))**0.33333-1.0)
5428 & /DLOG(IHNT2(3)+1.0D0)*DSQRT(X2)*DEXP(-X2**2/0.01)
5429 IF(IP_CRS.EQ.2 .OR. IP_CRS.EQ.3) RRX=DEXP(-X2**2/0.01)
5430 DO 500 I=1,7
5431 F(2,I)=RRX*F(2,I)
5432 500 CONTINUE
5433 ENDIF
5434
5435 RETURN
5436 END
5437
5438
5439
5440 FUNCTION GMRE(X)
5441 IMPLICIT REAL*8(A-H,O-Z)
5442 Z=X
5443 IF(X.GT.3.0D0) GO TO 10
5444 Z=X+3.D0
5445 10 GMRE=0.5D0*DLOG(2.D0*3.14159265D0/Z)+Z*DLOG(Z)-Z+DLOG(1.D0
5446 1 +1.D0/12.D0/Z+1.D0/288.D0/Z**2-139.D0/51840.D0/Z**3
5447 1 -571.D0/2488320.D0/Z**4)
5448 IF(Z.EQ.X) GO TO 20
5449 GMRE=GMRE-DLOG(Z-1.D0)-DLOG(Z-2.D0)-DLOG(Z-3.D0)
5450 20 CONTINUE
5451 RETURN
5452 END
5453
5454
5455
5456 FUNCTION GMIN(N)
5457 IMPLICIT REAL*8(A-H,O-Z)
5458 GA=0.
5459 IF(N.LE.2) GO TO 20
5460 DO 10 I=1,N-1
5461 Z=I
5462 GA=GA+DLOG(Z)
5463 10 CONTINUE
5464 20 GMIN=GA
5465 RETURN
5466 END
5467
5468
5469
5470
5471 BLOCK DATA HIDATA
5472 REAL*8 XL(10),XU(10),ACC
5473 COMMON/BVEG1/XL,XU,ACC,NDIM,NCALL,ITMX,NPRN
5474 SAVE /BVEG1/
5475 COMMON/SEEDVAX/NUM1
5476 SAVE /SEEDVAX/
5477 COMMON/HIPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
5478 SAVE /HIPARNT/
5479 COMMON/RANSEED/NSEED
5480 SAVE /RANSEED/
5481 COMMON/HIMAIN1/ NATT,EATT,JATT,NT,NP,N0,N01,N10,N11
5482 SAVE /HIMAIN1/
5483 COMMON/HIMAIN2/KATT(130000,4),PATT(130000,4)
5484 SAVE /HIMAIN2/
5485 COMMON/HISTRNG/NFP(300,15),PP(300,15),NFT(300,15),PT(300,15)
5486 SAVE /HISTRNG/
5487 COMMON/HIJCRDN/YP(3,300),YT(3,300)
5488 SAVE /HIJCRDN/
5489 COMMON/HIJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
5490 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
5491 & PJPM(300,500),NTJ(300),KFTJ(300,500),
5492 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
5493 & PJTE(300,500),PJTM(300,500)
5494 SAVE /HIJJET1/
5495 COMMON/HIJJET2/NSG,NJSG(900),IASG(900,3),K1SG(900,100),
5496 & K2SG(900,100),PXSG(900,100),PYSG(900,100),
5497 & PZSG(900,100),PESG(900,100),PMSG(900,100)
5498 SAVE /HIJJET2/
5499 COMMON/HIJDAT/HIDAT0(10,10),HIDAT(10)
5500 SAVE /HIJDAT/
5501 COMMON/HIPYINT/MINT4,MINT5,ATCO(200,20),ATXS(0:200)
5502 SAVE /HIPYINT/
5503 DATA NUM1/30123984/,XL/10*0.D0/,XU/10*1.D0/
5504 DATA NCALL/1000/ITMX/100/ACC/0.01/NPRN/0/
5505
5506
5507 DATA NSEED/74769375/
5508 DATA HIPR1/
5509 & 1.5, 0.35, 0.5, 0.9, 2.0, 0.1, 1.5, 2.0, -1.0, -2.25,
5510 & 2.0, 0.5, 1.0, 2.0, 0.2, 2.0, 2.5, 0.3, 0.1, 1.4,
5511 & 1.6, 1.0, 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.4, 57.0,
5512 & 28.5, 3.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
5513 & 3.141592654,
5514 & 0.0, 0.4, 0.1, 1.5, 0.1, 0.25, 0.0, 0.5, 0.0, 0.0,
5515 & 50*0.0/
5516
5517 DATA IHPR2/
5518 & 1, 3, 0, 1, 1, 1, 1, 10, 0, 0,
5519 & 1, 1, 1, 1, 0, 0, 1, 0, 0, 1,
5520 & 30*0/
5521
5522 DATA HINT1/100*0/
5523 DATA IHNT2/50*0/
5524
5525
5526 DATA NATT/0/EATT/0.0/JATT/0/NT/0/NP/0/N0/0/N01/0/N10/0/N11/0/
5527 DATA KATT/520000*0/PATT/520000*0.0/
5528
5529 DATA NFP/4500*0/PP/4500*0.0/NFT/4500*0/PT/4500*0.0/
5530
5531 DATA YP/900*0.0/YT/900*0.0/
5532
5533 DATA NPJ/300*0/KFPJ/150000*0/PJPX/150000*0.0/PJPY/150000*0.0/
5534 & PJPZ/150000*0.0/PJPE/150000*0.0/PJPM/150000*0.0/
5535 DATA NTJ/300*0/KFTJ/150000*0/PJTX/150000*0.0/PJTY/150000*0.0/
5536 & PJTZ/150000*0.0/PJTE/150000*0.0/PJTM/150000*0.0/
5537
5538 DATA NSG/0/NJSG/900*0/IASG/2700*0/K1SG/90000*0/K2SG/90000*0/
5539 & PXSG/90000*0.0/PYSG/90000*0.0/PZSG/90000*0.0/PESG/90000*0.0/
5540 & PMSG/90000*0.0/
5541 DATA MINT4/0/MINT5/0/ATCO/4000*0.0/ATXS/201*0.0/
5542 DATA (HIDAT0(1,I),I=1,10)/0.0,0.0,0.0,0.0,0.0,0.0,2.25,
5543 & 2.5,4.0,4.1/
5544 DATA (HIDAT0(2,I),I=1,10)/2.0,3.0,5.0,6.0,7.0,8.0,8.0,10.0,
5545 & 10.0,10.0/
5546 DATA (HIDAT0(3,I),I=1,10)/1.0,0.8,0.8,0.7,0.45,0.215,
5547 & 0.21,0.19,0.19,0.19/
5548 DATA (HIDAT0(4,I),I=1,10)/0.35,0.35,0.3,0.3,0.3,0.3,
5549 & 0.5,0.6,0.6,0.6/
5550 DATA (HIDAT0(5,I),I=1,10)/23.8,24.0,26.0,26.2,27.0,28.5,28.5,
5551 & 28.5,28.5,28.5/
5552 DATA ((HIDAT0(J,I),I=1,10),J=6,9)/40*0.0/
5553 DATA (HIDAT0(10,I),I=1,10)/5.0,20.0,53.0,62.0,100.0,200.0,
5554 & 546.0,900.0,1800.0,4000.0/
5555 DATA HIDAT/10*0.0/
5556 END
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567 SUBROUTINE VEGAS(FXN,AVGI,SD,CHI2A)
5568 IMPLICIT REAL*8(A-H,O-Z)
5569 COMMON/BVEG1/XL(10),XU(10),ACC,NDIM,NCALL,ITMX,NPRN
5570 SAVE /BVEG1/
5571 COMMON/BVEG2/XI(50,10),SI,SI2,SWGT,SCHI,NDO,IT
5572 SAVE /BVEG2/
5573 COMMON/BVEG3/F,TI,TSI
5574 SAVE /BVEG3/
5575 EXTERNAL FXN
5576 DIMENSION D(50,10),DI(50,10),XIN(50),R(50),DX(10),DT(10),X(10)
5577 1 ,KG(10),IA(10)
5578 REAL*4 QRAN(10)
5579 DATA NDMX/50/,ALPH/1.5D0/,ONE/1.D0/,MDS/-1/
5580
5581 save NDMX, ALPH, ONE, MDS !uzhi
5582
5583 NDO=1
5584 DO 1 J=1,NDIM
5585 1 XI(1,J)=ONE
5586
5587 ENTRY VEGAS1(FXN,AVGI,SD,CHI2A)
5588
5589 IT=0
5590 SI=0.
5591 SI2=SI
5592 SWGT=SI
5593 SCHI=SI
5594
5595 ENTRY VEGAS2(FXN,AVGI,SD,CHI2A)
5596
5597 ND=NDMX
5598 NG=1
5599 IF(MDS.EQ.0) GO TO 2
5600 NG=(NCALL/2.)**(1./NDIM)
5601 MDS=1
5602 IF((2*NG-NDMX).LT.0) GO TO 2
5603 MDS=-1
5604 NPG=NG/NDMX+1
5605 ND=NG/NPG
5606 NG=NPG*ND
5607 2 K=NG**NDIM
5608 NPG=NCALL/K
5609 IF(NPG.LT.2) NPG=2
5610 CALLS=NPG*K
5611 DXG=ONE/NG
5612 DV2G=(CALLS*DXG**NDIM)**2/NPG/NPG/(NPG-ONE)
5613 XND=ND
5614 NDM=ND-1
5615 DXG=DXG*XND
5616 XJAC=ONE/CALLS
5617 DO 3 J=1,NDIM
5618
5619 DX(J)=XU(J)-XL(J)
5620 3 XJAC=XJAC*DX(J)
5621
5622
5623
5624 IF(ND.EQ.NDO) GO TO 8
5625 RC=NDO/XND
5626 DO 7 J=1,NDIM
5627 K=0
5628 XN=0.
5629 DR=XN
5630 I=K
5631 4 K=K+1
5632 DR=DR+ONE
5633 XO=XN
5634 XN=XI(K,J)
5635 5 IF(RC.GT.DR) GO TO 4
5636 I=I+1
5637 DR=DR-RC
5638 XIN(I)=XN-(XN-XO)*DR
5639 IF(I.LT.NDM) GO TO 5
5640 DO 6 I=1,NDM
5641 6 XI(I,J)=XIN(I)
5642 7 XI(ND,J)=ONE
5643 NDO=ND
5644
5645 8 CONTINUE
5646 IF(NPRN.NE.0) WRITE(16,200) NDIM,CALLS,IT,ITMX,ACC,MDS,ND
5647 1 ,(XL(J),XU(J),J=1,NDIM)
5648
5649 ENTRY VEGAS3(FXN,AVGI,SD,CHI2A)
5650
5651 9 IT=IT+1
5652 TI=0.
5653 TSI=TI
5654 DO 10 J=1,NDIM
5655 KG(J)=1
5656 DO 10 I=1,ND
5657 D(I,J)=TI
5658 10 DI(I,J)=TI
5659
5660 11 FB=0.
5661 F2B=FB
5662 K=0
5663 12 K=K+1
5664 CALL ARAN9(QRAN,NDIM)
5665 WGT=XJAC
5666 DO 15 J=1,NDIM
5667 XN=(KG(J)-QRAN(J))*DXG+ONE
5668
5669 IA(J)=XN
5670 IF(IA(J).GT.1) GO TO 13
5671 XO=XI(IA(J),J)
5672 RC=(XN-IA(J))*XO
5673 GO TO 14
5674 13 XO=XI(IA(J),J)-XI(IA(J)-1,J)
5675 RC=XI(IA(J)-1,J)+(XN-IA(J))*XO
5676 14 X(J)=XL(J)+RC*DX(J)
5677 WGT=WGT*XO*XND
5678 15 CONTINUE
5679
5680 F=WGT
5681 F=F*FXN(X,WGT)
5682 F2=F*F
5683 FB=FB+F
5684 F2B=F2B+F2
5685 DO 16 J=1,NDIM
5686 DI(IA(J),J)=DI(IA(J),J)+F
5687 16 IF(MDS.GE.0) D(IA(J),J)=D(IA(J),J)+F2
5688 IF(K.LT.NPG) GO TO 12
5689
5690 F2B=DSQRT(F2B*NPG)
5691 F2B=(F2B-FB)*(F2B+FB)
5692 TI=TI+FB
5693 TSI=TSI+F2B
5694 IF(MDS.GE.0) GO TO 18
5695 DO 17 J=1,NDIM
5696 17 D(IA(J),J)=D(IA(J),J)+F2B
5697 18 K=NDIM
5698 19 KG(K)=MOD(KG(K),NG)+1
5699 IF(KG(K).NE.1) GO TO 11
5700 K=K-1
5701 IF(K.GT.0) GO TO 19
5702
5703
5704
5705 TSI=TSI*DV2G
5706 TI2=TI*TI
5707 WGT=TI2/(TSI+1.0d-37)
5708 SI=SI+TI*WGT
5709 SI2=SI2+TI2
5710 SWGT=SWGT+WGT
5711 SWGT=SWGT+1.0D-37
5712 SI2=SI2+1.0D-37
5713 SCHI=SCHI+TI2*WGT
5714 AVGI=SI/(SWGT)
5715 SD=SWGT*IT/(SI2)
5716 CHI2A=SD*(SCHI/SWGT-AVGI*AVGI)/(IT-.999)
5717 SD=DSQRT(ONE/SD)
5718
5719 IF(NPRN.EQ.0) GO TO 21
5720 TSI=DSQRT(TSI)
5721 WRITE(16,201) IT,TI,TSI,AVGI,SD,CHI2A
5722 IF(NPRN.GE.0) GO TO 21
5723 DO 20 J=1,NDIM
5724 20 WRITE(16,202) J,(XI(I,J),DI(I,J),D(I,J),I=1,ND)
5725
5726
5727
5728 21 DO 23 J=1,NDIM
5729 XO=D(1,J)
5730 XN=D(2,J)
5731 D(1,J)=(XO+XN)/2.
5732 DT(J)=D(1,J)
5733 DO 22 I=2,NDM
5734 D(I,J)=XO+XN
5735 XO=XN
5736 XN=D(I+1,J)
5737 D(I,J)=(D(I,J)+XN)/3.
5738 22 DT(J)=DT(J)+D(I,J)
5739 D(ND,J)=(XN+XO)/2.
5740 23 DT(J)=DT(J)+D(ND,J)
5741
5742 DO 28 J=1,NDIM
5743 RC=0.
5744 DO 24 I=1,ND
5745 R(I)=0.
5746 IF (DT(J).GE.1.0D18) THEN
5747 WRITE(6,*) '************** A SINGULARITY >1.0D18'
5748
5749
5750
5751
5752
5753
5754
5755
5756 END IF
5757 IF(D(I,J).LE.1.0D-18) GO TO 24
5758 XO=DT(J)/D(I,J)
5759 R(I)=((XO-ONE)/XO/DLOG(XO))**ALPH
5760 24 RC=RC+R(I)
5761 RC=RC/XND
5762 K=0
5763 XN=0.
5764 DR=XN
5765 I=K
5766 25 K=K+1
5767 DR=DR+R(K)
5768 XO=XN
5769
5770 XN=XI(K,J)
5771 26 IF(RC.GT.DR) GO TO 25
5772 I=I+1
5773 DR=DR-RC
5774 XIN(I)=XN-(XN-XO)*DR/(R(K)+1.0d-30)
5775 IF(I.LT.NDM) GO TO 26
5776 DO 27 I=1,NDM
5777 27 XI(I,J)=XIN(I)
5778 28 XI(ND,J)=ONE
5779
5780 IF(IT.LT.ITMX.AND.ACC*DABS(AVGI).LT.SD) GO TO 9
5781 200 FORMAT('0INPUT PARAMETERS FOR VEGAS: NDIM=',I3,' NCALL=',F8.0
5782 1 /28X,' IT=',I5,' ITMX=',I5/28X,' ACC=',G9.3
5783 2 /28X,' MDS=',I3,' ND=',I4/28X,' (XL,XU)=',
5784 3 (T40,'( ',G12.6,' , ',G12.6,' )'))
5785 201 FORMAT(///' INTEGRATION BY VEGAS' / '0ITERATION NO.',I3,
5786 1 ': INTEGRAL =',G14.8/21X,'STD DEV =',G10.4 /
5787 2 ' ACCUMULATED RESULTS: INTEGRAL =',G14.8 /
5788 3 24X,'STD DEV =',G10.4 / 24X,'CHI**2 PER IT''N =',G10.4)
5789 202 FORMAT('0DATA FOR AXIS',I2 / ' ',6X,'X',7X,' DELT I ',
5790 1 2X,' CONV''CE ',11X,'X',7X,' DELT I ',2X,' CONV''CE '
5791 2 ,11X,'X',7X,' DELT I ',2X,' CONV''CE ' /
5792 2 (' ',3G12.4,5X,3G12.4,5X,3G12.4))
5793 RETURN
5794 END
5795
5796
5797 SUBROUTINE ARAN9(QRAN,NDIM)
5798 DIMENSION QRAN(10)
5799 COMMON/SEEDVAX/NUM1
5800 DO 1 I=1,NDIM
5801 1 QRAN(I)=RLU(0)
5802 RETURN
5803 END
5804
5805
5806
5807
5808
5809 FUNCTION GAUSS1(F,A,B,EPS)
5810 EXTERNAL F
5811 DIMENSION W(12),X(12)
5812 DATA CONST/1.0E-12/
5813 DATA W/0.1012285,.2223810,.3137067,.3623838,.0271525,
5814 & .0622535,0.0951585,.1246290,.1495960,.1691565,
5815 & .1826034,.1894506/
5816 DATA X/0.9602899,.7966665,.5255324,.1834346,.9894009,
5817 & .9445750,0.8656312,.7554044,.6178762,.4580168,
5818 & .2816036,.0950125/
5819 DELTA=CONST*ABS(A-B)
5820 GAUSS1=0.0
5821 AA=A
5822 5 Y=B-AA
5823 IF(ABS(Y).LE.DELTA) RETURN
5824 2 BB=AA+Y
5825 C1=0.5*(AA+BB)
5826 C2=C1-AA
5827 S8=0.0
5828 S16=0.0
5829 DO 1 I=1,4
5830 U=X(I)*C2
5831 1 S8=S8+W(I)*(F(C1+U)+F(C1-U))
5832 DO 3 I=5,12
5833 U=X(I)*C2
5834 3 S16=S16+W(I)*(F(C1+U)+F(C1-U))
5835 S8=S8*C2
5836 S16=S16*C2
5837 IF(ABS(S16-S8).GT.EPS*(1.+ABS(S16))) GOTO 4
5838 GAUSS1=GAUSS1+S16
5839 AA=BB
5840 GOTO 5
5841 4 Y=0.5*Y
5842 IF(ABS(Y).GT.DELTA) GOTO 2
5843 WRITE(6,7)
5844 GAUSS1=0.0
5845 RETURN
5846 7 FORMAT(1X,'GAUSS1....TOO HIGH ACURACY REQUIRED')
5847 END
5848
5849
5850
5851 FUNCTION GAUSS2(F,A,B,EPS)
5852 EXTERNAL F
5853 DIMENSION W(12),X(12)
5854 DATA CONST/1.0E-12/
5855 DATA W/0.1012285,.2223810,.3137067,.3623838,.0271525,
5856 & .0622535,0.0951585,.1246290,.1495960,.1691565,
5857 & .1826034,.1894506/
5858 DATA X/0.9602899,.7966665,.5255324,.1834346,.9894009,
5859 & .9445750,0.8656312,.7554044,.6178762,.4580168,
5860 & .2816036,.0950125/
5861 DELTA=CONST*ABS(A-B)
5862 GAUSS2=0.0
5863 AA=A
5864 5 Y=B-AA
5865 IF(ABS(Y).LE.DELTA) RETURN
5866 2 BB=AA+Y
5867 C1=0.5*(AA+BB)
5868 C2=C1-AA
5869 S8=0.0
5870 S16=0.0
5871 DO 1 I=1,4
5872 U=X(I)*C2
5873 1 S8=S8+W(I)*(F(C1+U)+F(C1-U))
5874 DO 3 I=5,12
5875 U=X(I)*C2
5876 3 S16=S16+W(I)*(F(C1+U)+F(C1-U))
5877 S8=S8*C2
5878 S16=S16*C2
5879 IF(ABS(S16-S8).GT.EPS*(1.+ABS(S16))) GOTO 4
5880 GAUSS2=GAUSS2+S16
5881 AA=BB
5882 GOTO 5
5883 4 Y=0.5*Y
5884 IF(ABS(Y).GT.DELTA) GOTO 2
5885 WRITE(6,7)
5886 GAUSS2=0.0
5887 RETURN
5888 7 FORMAT(1X,'GAUSS2....TOO HIGH ACURACY REQUIRED')
5889 END
5890
5891
5892
5893 FUNCTION GAUSS3(F,A,B,EPS)
5894 EXTERNAL F
5895 DIMENSION W(12),X(12)
5896 DATA CONST/1.0E-12/
5897 DATA W/0.1012285,.2223810,.3137067,.3623838,.0271525,
5898 & .0622535,0.0951585,.1246290,.1495960,.1691565,
5899 & .1826034,.1894506/
5900 DATA X/0.9602899,.7966665,.5255324,.1834346,.9894009,
5901 & .9445750,0.8656312,.7554044,.6178762,.4580168,
5902 & .2816036,.0950125/
5903 DELTA=CONST*ABS(A-B)
5904 GAUSS3=0.0
5905 AA=A
5906 5 Y=B-AA
5907 IF(ABS(Y).LE.DELTA) RETURN
5908 2 BB=AA+Y
5909 C1=0.5*(AA+BB)
5910 C2=C1-AA
5911 S8=0.0
5912 S16=0.0
5913 DO 1 I=1,4
5914 U=X(I)*C2
5915 1 S8=S8+W(I)*(F(C1+U)+F(C1-U))
5916 DO 3 I=5,12
5917 U=X(I)*C2
5918 3 S16=S16+W(I)*(F(C1+U)+F(C1-U))
5919 S8=S8*C2
5920 S16=S16*C2
5921 IF(ABS(S16-S8).GT.EPS*(1.+ABS(S16))) GOTO 4
5922 GAUSS3=GAUSS3+S16
5923 AA=BB
5924 GOTO 5
5925 4 Y=0.5*Y
5926 IF(ABS(Y).GT.DELTA) GOTO 2
5927 WRITE(6,7)
5928 GAUSS3=0.0
5929 RETURN
5930 7 FORMAT(1X,'GAUSS3....TOO HIGH ACURACY REQUIRED')
5931 END
5932
5933
5934
5935
5936 FUNCTION GAUSS4(F,A,B,EPS)
5937 EXTERNAL F
5938 DIMENSION W(12),X(12)
5939 DATA CONST/1.0E-12/
5940 DATA W/0.1012285,.2223810,.3137067,.3623838,.0271525,
5941 & .0622535,0.0951585,.1246290,.1495960,.1691565,
5942 & .1826034,.1894506/
5943 DATA X/0.9602899,.7966665,.5255324,.1834346,.9894009,
5944 & .9445750,0.8656312,.7554044,.6178762,.4580168,
5945 & .2816036,.0950125/
5946 DELTA=CONST*ABS(A-B)
5947 GAUSS4=0.0
5948 AA=A
5949 5 Y=B-AA
5950 IF(ABS(Y).LE.DELTA) RETURN
5951 2 BB=AA+Y
5952 C1=0.5*(AA+BB)
5953 C2=C1-AA
5954 S8=0.0
5955 S16=0.0
5956 DO 1 I=1,4
5957 U=X(I)*C2
5958 1 S8=S8+W(I)*(F(C1+U)+F(C1-U))
5959 DO 3 I=5,12
5960 U=X(I)*C2
5961 3 S16=S16+W(I)*(F(C1+U)+F(C1-U))
5962 S8=S8*C2
5963 S16=S16*C2
5964 IF(ABS(S16-S8).GT.EPS*(1.+ABS(S16))) GOTO 4
5965 GAUSS4=GAUSS4+S16
5966 AA=BB
5967 GOTO 5
5968 4 Y=0.5*Y
5969 IF(ABS(Y).GT.DELTA) GOTO 2
5970 WRITE(6,7)
5971 GAUSS4=0.0
5972 RETURN
5973 7 FORMAT(1X,'GAUSS4....TOO HIGH ACURACY REQUIRED')
5974 END
5975
5976
5977
5978
5979
5980 SUBROUTINE TITLE
5981 WRITE(6,200)
5982 200 FORMAT(//10X,
5983 & '**************************************************'/10X,
5984 & '* | \\ _______ / ------/ *'/10X,
5985 & '* ----- ------ |_____| /_/ / *'/10X,
5986 & '* ||\\ / |_____| / / \\ *'/10X,
5987 & '* /| \\ /_/ /_______ /_ / \\_ *'/10X,
5988 & '* / | / / / / / | ------- *'/10X,
5989 & '* | / /\\ / / | / | *'/10X,
5990 & '* | / / \\ / / \\_| / ------- *'/10X,
5991 & '* *'/10X,
5992 & '**************************************************'/10X,
5993 & ' HIJING '/10X,
5994 & ' Heavy Ion Jet INteraction Generator '/10X,
5995 & ' by '/10X,
5996 & ' X. N. Wang and M. Gyulassy '/10X,
5997 & ' Lawrence Berkeley Laboratory '//)
5998 RETURN
5999 END