196 dimension scip(300,300),rnip(300,300),sjip(300,300),jtp(3),
197 & ipcol(90000),itcol(90000)
198 common/hiparnt/hipr1(100),ihpr2(50),hint1(100),ihnt2(50)
201 common/hijcrdn/yp(3,300),yt(3,300)
203 common/hijglbr/nelt,nint,nelp,ninp
205 common/himain1/natt,eatt,jatt,nt,np,n0,n01,n10,n11
207 common/himain2/katt(130000,4),patt(130000,4)
209 common/histrng/nfp(300,15),pp(300,15),nft(300,15),
pt(300,15)
211 common/hijjet1/npj(300),kfpj(300,500),pjpx(300,500),
212 & pjpy(300,500),pjpz(300,500),pjpe(300,500),
213 & pjpm(300,500),ntj(300),kftj(300,500),
214 & pjtx(300,500),pjty(300,500),pjtz(300,500),
215 & pjte(300,500),pjtm(300,500)
217 common/hijjet2/nsg,njsg(900),iasg(900,3),k1sg(900,100),
218 & k2sg(900,100),pxsg(900,100),pysg(900,100),
219 & pzsg(900,100),pesg(900,100),pmsg(900,100)
221 common/hijjet4/ndr,iadr(900,2),kfdr(900),pdr(900,5)
226 common/lujets/
n,k(9000,5),p(9000,5),v(9000,5)
228 common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
231 bmax=
min(bmax0,hipr1(34)+hipr1(35))
233 IF(ihnt2(1).LE.1 .AND. ihnt2(3).LE.1)
THEN 235 bmax=2.5*sqrt(hipr1(31)*0.1/hipr1(40))
236 c
write(*,*)
"HIJING bmin bmax",bmin,
"=====", bmax
238 c ----------------------------
240 c ********hipr1(31) is
in mb =0.1fm**2
241 c*******the following is to
SELECT the coordinations of nucleons
242 c both
in projectile and
TARGET nuclear(
in fm)
247 IF(ihnt2(1).LE.1)
GO TO 14
251 if(ihnt2(1).EQ.2)
then 255 r=-0.5*(log(rnd1)*4.38/2.0+log(rnd2)*0.85/2.0
256 & +4.38*0.85*log(rnd3)/(4.38+0.85))
262 c ********choose theta from uniform cos(theta) distr
263 phi=
rlu(0)*2.0*hipr1(40)
264 c ********choose phi form uniform phi distr 0 to 2*
pi 265 yp(1,kp)=
r*sx*cos(phi)
266 yp(2,kp)=
r*sx*sin(phi)
268 IF(hipr1(29).EQ.0.0)
GO TO 10
270 dnbp1=(yp(1,kp)-yp(1,kp2))**2
271 dnbp2=(yp(2,kp)-yp(2,kp2))**2
272 dnbp3=(yp(3,kp)-yp(3,kp2))**2
273 dnbp=dnbp1+dnbp2+dnbp3
274 IF(dnbp.LT.hipr1(29)*hipr1(29))
GO TO 5
275 c ********two neighbors cannot be closer than
279 c*******************************
280 if(ihnt2(1).EQ.2)
then 285 c********************************
288 IF(yp(3,i).GT.yp(3,j))
GO TO 12
300 c******************************
304 IF(ihnt2(3).LE.1)
GO TO 24
308 if(ihnt2(3).EQ.2)
then 312 r=-0.5*(log(rnd1)*4.38/2.0+log(rnd2)*0.85/2.0
313 & +4.38*0.85*log(rnd3)/(4.38+0.85))
319 c ********choose theta from uniform cos(theta) distr
320 phi=
rlu(0)*2.0*hipr1(40)
321 c ********chose phi form uniform phi distr 0 to 2*
pi 322 yt(1,kt)=
r*sx*cos(phi)
323 yt(2,kt)=
r*sx*sin(phi)
325 IF(hipr1(29).EQ.0.0)
GO TO 20
327 dnbt1=(yt(1,kt)-yt(1,kt2))**2
328 dnbt2=(yt(2,kt)-yt(2,kt2))**2
329 dnbt3=(yt(3,kt)-yt(3,kt2))**2
330 dnbt=dnbt1+dnbt2+dnbt3
331 IF(dnbt.LT.hipr1(29)*hipr1(29))
GO TO 15
332 c ********two neighbors cannot be closer than
336 c**********************************
337 if(ihnt2(3).EQ.2)
then 342 c*********************************
345 IF(yt(3,i).LT.yt(3,j))
GO TO 22
356 c********************
361 WRITE(6,*)
'infinite loop happened in HIJING' 370 c ********initialize
for a new event
384 c****
bb is the absolute
VALUE of impact
PARAMETER,
bb**2 is
385 c randomly generated and its orientation is randomly set
386 c by the
angle phi
for each collision.******************
389 bb=sqrt(bmin**2+
rlu(0)*(bmax**2-bmin**2))
390 c
write(*,*)
"HIJING bmin bmax bb", bmin, bmax,
bb 391 phi=2.0*hipr1(40)*
rlu(0)
400 b2=(yp(1,jp)+bbx-yt(1,jt))**2+(yp(2,jp)+bby-yt(2,jt))**2
401 r2=
b2*hipr1(40)/hipr1(31)/0.1
402 c ********mb=0.1*fm, yp is
in fm,hipr1(31) is
in mb
403 rrb1=
min((yp(1,jp)**2+yp(2,jp)**2)
404 & /1.2**2/
REAL(ihnt2(1))**0.6666667,1.0)
405 rrb2=
min((yt(1,jt)**2+yt(2,jt)**2)
406 & /1.2**2/
REAL(ihnt2(3))**0.6666667,1.0)
407 aphx1=hipr1(6)*4.0/3.0*(ihnt2(1)**0.3333333-1.0)
409 aphx2=hipr1(6)*4.0/3.0*(ihnt2(3)**0.3333333-1.0)
411 hint1(18)=hint1(14)-aphx1*hint1(15)
412 & -aphx2*hint1(16)+aphx1*aphx2*hint1(17)
414 IF(ihpr2(14).EQ.0.OR.
415 & (ihnt2(1).EQ.1.AND.ihnt2(3).EQ.1))
THEN 416 c
write(*,*)
'R2 ROMG(R2)',r2,
romg(r2),
omg0(r2) khal
417 gs=1.0-exp(-(hipr1(30)+hint1(18))*
romg(r2)/hipr1(31))
420 IF(rantot.GT.gs)
GO TO 70
423 c
write(*,*)
'ROMG(0.0)' 424 gstot_0=2.0*(1.0-exp(-(hipr1(30)+hint1(18))
425 & /hipr1(31)/2.0*
romg(0.0)))
426 c
write(*,*)gstot_0,
romg(0.0)
428 gs=1.0-exp(-(hipr1(30)+hint1(18))/hipr1(31)*
romg(r2))
429 gstot=2.0*(1.0-sqrt(1.0-gs))
430 rantot=
rlu(0)*gstot_0
431 c
write(*,*)
'rantot, gstot',rantot, gstot
432 IF(rantot.GT.gstot)
GO TO 70
433 IF(rantot.GT.gs)
THEN 434 c
write(*,*)
"----------------------------------start HIJCSC" 436 c
write(*,*)
"----------------------------------end HIJCSC" 438 c ********perform elastic collisions
442 sjip(jp,jt)=hint1(18)
447 c ********total number interactions
proj and
targ has
452 & (ihnt2(1).EQ.1.AND.ihnt2(3).EQ.1))
GO TO 60
455 c ********at large impact
parameter, there maybe
no 456 c interaction at all.
for nn collision
457 c repeat the event until interaction happens
459 IF(ihpr2(3).NE.0)
THEN 460 nhard=1+int(
rlu(0)*(ncolt-1)+0.5)
461 nhard=
min(nhard,ncolt)
466 IF(ihpr2(9).EQ.1)
THEN 467 nmini=1+int(
rlu(0)*(ncolt-1)+0.5)
468 nmini=
min(nmini,ncolt)
472 c ********specifying the location of the hard and
473 c minijet
if they are enforced by user
477 IF(scip(jp,jt).EQ.-1.0)
GO TO 200
478 nfp(jp,11)=nfp(jp,11)+1
479 nft(jt,11)=nft(jt,11)+1
480 IF(nfp(jp,5).LE.1 .AND. nft(jt,5).GT.1)
THEN 483 ELSE IF(nfp(jp,5).GT.1 .AND. nft(jt,5).LE.1)
THEN 486 ELSE IF(nfp(jp,5).LE.1 .AND. nft(jt,5).LE.1)
THEN 490 ELSE IF(nfp(jp,5).GT.1 .AND. nft(jt,5).GT.1)
THEN 497 c*****************************************************************
498 IF(ihpr2(8).EQ.0 .AND. ihpr2(3).EQ.0)
GO TO 160
499 c ********when ihpr2(8)=0
no jets are produced
500 IF(nfp(jp,6).LT.0 .OR. nft(jt,6).LT.0)
GO TO 160
501 c ********jets can not be produced
for(jp,jt)
505 hint1(18)=sjip(jp,jt)
506 tt=
romg(r2)*hint1(18)/hipr1(31)
507 tts=hipr1(30)*
romg(r2)/hipr1(31)
509 IF(ihpr2(3).NE.0 .AND. jp.EQ.jphard .AND. jt.EQ.jthard)
THEN 511 CALL hijhrd(jp,jt,0,jflg,0)
521 IF(abs(hint1(46)).GT.hipr1(11).AND.jflg.EQ.2) nfp(jp,7)=1
522 IF(abs(hint1(56)).GT.hipr1(11).AND.jflg.EQ.2) nft(jt,7)=1
523 IF(
max(abs(hint1(46)),abs(hint1(56))).GT.hipr1(11).AND.
524 & jflg.GE.3) iasg(nsg,3)=1
528 hint1(20+i05)=hint1(40+i05)
529 hint1(30+i05)=hint1(50+i05)
532 IF(ihpr2(8).EQ.0)
GO TO 160
533 rrb1=
min((yp(1,jp)**2+yp(2,jp)**2)/1.2**2
534 & /
REAL(ihnt2(1))**0.6666667,1.0)
535 rrb2=
min((yt(1,jt)**2+yt(2,jt)**2)/1.2**2
536 & /
REAL(ihnt2(3))**0.6666667,1.0)
537 aphx1=hipr1(6)*4.0/3.0*(ihnt2(1)**0.3333333-1.0)
539 aphx2=hipr1(6)*4.0/3.0*(ihnt2(3)**0.3333333-1.0)
541 hint1(65)=hint1(61)-aphx1*hint1(62)
542 & -aphx2*hint1(63)+aphx1*aphx2*hint1(64)
543 ttrig=
romg(r2)*hint1(65)/hipr1(31)
545 c ********subtract the trigger jet from total number
546 c of jet production to be done since it has
547 c already been produced here
548 xr1=-alog(exp(-ttrig)+
rlu(0)*(1.0-exp(-ttrig)))
550 xr1=xr1-alog(
max(
rlu(0),1.0
e-20))
551 IF(xr1.LT.ttrig)
GO TO 106
554 xr=xr-alog(
max(
rlu(0),1.0
e-20))
555 IF(xr.LT.tt-ttrig)
GO TO 107
559 c ********create
a hard interaction with specified p_t
561 IF(ihpr2(9).EQ.1.AND.jp.EQ.jpmini.AND.jt.EQ.jtmini)
GO TO 110
562 c ********create at least one pair of mini jets
565 IF(ihpr2(8).GT.0 .AND.rnip(jp,jt).LT.exp(-tt)*
566 & (1.0-exp(-tts)))
GO TO 160
567 c ********this is the probability
for no jet production
568 110 xr=-alog(exp(-tt)+
rlu(0)*(1.0-exp(-tt)))
570 xr=xr-alog(
max(
rlu(0),1.0
e-20))
571 IF(xr.LT.tt)
GO TO 111
572 112 njet=
min(njet,ihpr2(8))
573 IF(ihpr2(8).LT.0) njet=abs(ihpr2(8))
574 c ******** determine number of mini jet production
578 CALL hijhrd(jp,jt,jout,jflg,1)
579 c ********jflg=1 jets valence quarks, jflg=2 with
580 c gluon jet, jflg=3 with q-qbar prod
for 581 c(jp,jt).
If jflg=0 jets can not be produced
582 c this time.
If jflg=-1,
error occured abandon
583 c this event. jout is the total hard scat
for 585 IF(jflg.EQ.0)
GO TO 160
587 IF(ihpr2(10).NE.0)
WRITE(6,*)
'error occured in HIJHRD' 591 IF(abs(hint1(46)).GT.hipr1(11).AND.jflg.EQ.2) nfp(jp,7)=1
592 IF(abs(hint1(56)).GT.hipr1(11).AND.jflg.EQ.2) nft(jt,7)=1
593 IF(
max(abs(hint1(46)),abs(hint1(56))).GT.hipr1(11).AND.
594 & jflg.GE.3) iasg(nsg,3)=1
595 c ******** jet with
pt>hipr1(11) will be quenched
598 CALL hijsft(jp,jt,jout,ierror)
600 IF(ihpr2(10).NE.0)
WRITE(6,*)
'error occured in HIJSFT' 604 c ********conduct soft scattering between jp and jt
609 c**************************
612 IF(nfp(jp,5).GT.2)
THEN 614 ELSE IF(nfp(jp,5).EQ.2.OR.nfp(jp,5).EQ.1)
THEN 619 IF(nft(jt,5).GT.2)
THEN 621 ELSE IF(nft(jt,5).EQ.2.OR.nft(jt,5).EQ.1)
THEN 626 c*******************************
629 c********perform jet quenching
for jets with
pt>hipr1(11)**********
631 IF((ihpr2(8).NE.0.OR.ihpr2(3).NE.0).AND.ihpr2(4).GT.0.AND.
632 & ihnt2(1).GT.1.AND.ihnt2(3).GT.1)
THEN 634 IF(nfp(i,7).EQ.1)
CALL quench(i,1)
637 IF(nft(i,7).EQ.1)
CALL quench(i,2)
640 IF(iasg(isg,3).EQ.1)
CALL quench(isg,3)
644 c**************fragment all the string systems
in the following*****
646 c********n_st is
where particle information starts
647 c********n_str+1 is the number of strings
in fragmentation
648 c********the number of strings before
a line is stored
in k(i,4)
649 c********idstr is id number of the string
system(91,92 or 93)
651 IF(ihpr2(20).NE.0)
THEN 654 IF(mstu(24).NE.0 .OR.ierror.GT.0)
THEN 657 IF(ihpr2(10).NE.0)
THEN 659 WRITE(6,*)
'error occured, repeat the event' 663 c ********check errors
667 IF(ihpr2(21).EQ.0)
THEN 671 IF(k(n_st,2).LT.91.OR.k(n_st,2).GT.93)
GO TO 351
676 IF(frame.EQ.
'LAB')
THEN 679 c ********
boost back to lab frame(
if it was
in)
683 IF(k(i,2).EQ.idstr)
THEN 692 IF(k(i,3).EQ.0 .OR. k(k(i,3),2).EQ.idstr)
THEN 695 katt(natt,3)=natt-i+k(i,3)+n_str-k(k(i,3),4)
697 c ****** identify the mother particle
704 c ********fragment the q-qbar jets systems *****
709 DO 400 j_jtp=1,jtp(ntp)
710 CALL hijfrg(j_jtp,ntp,ierror)
711 IF(mstu(24).NE.0 .OR. ierror.GT.0)
THEN 714 IF(ihpr2(10).NE.0)
THEN 716 WRITE(6,*)
'error occured, repeat the event' 720 c ********check errors
724 IF(ihpr2(21).EQ.0)
THEN 728 IF(k(n_st,2).LT.91.OR.k(n_st,2).GT.93)
GO TO 381
732 IF(frame.EQ.
'LAB')
THEN 735 c ********
boost back to lab frame(
if it was
in)
738 IF(ntp.EQ.2) nftp=10+nft(j_jtp,5)
741 IF(k(i,2).EQ.idstr)
THEN 750 IF(k(i,3).EQ.0 .OR. k(k(i,3),2).EQ.idstr)
THEN 753 katt(natt,3)=natt-i+k(i,3)+n_str-k(k(i,3),4)
755 c ****** identify the mother particle
763 c ********fragment the q-qq related string systems
771 patt(natt,1)=pdr(i,1)
772 patt(natt,2)=pdr(i,2)
773 patt(natt,3)=pdr(i,3)
774 patt(natt,4)=pdr(i,4)
777 c ********store the direct-produced particles
779 dengy=eatt/(ihnt2(1)*hint1(6)+ihnt2(3)*hint1(7))-1.0
780 IF(abs(dengy).GT.hipr1(43).AND.ihpr2(20).NE.0
781 & .AND.ihpr2(21).EQ.0)
THEN 782 IF(ihpr2(10).NE.0)
THEN 783 WRITE(6,*)
'Energy not conserved, repeat the event'
subroutine hijfrg(JTP, NTP, IERROR)
for(Int_t i=0;i< nentries;i++)
static G4double angle[DIM]
static int FASTCALL common(PROLOG_STATE *state, int tok)
subroutine hijcsc(JP, JT)
subroutine quench(JPJT, NTP)
subroutine hijhrd(JP, JT, JOUT, JFLG, IOPJET0)
system("rm -rf microbeam.root")
static PROLOG_HANDLER error
subroutine jetini(JP, JT, I_TRIG)
subroutine hijsft(JP, JT, JOUT, IERROR)