This commit was generated by cvs2svn to compensate for changes in r1073,
[u/mrichter/AliRoot.git] / HIJING / hijing1_36 / ar3jet.F
CommitLineData
e74335a4 1* $Id$
2
3
4 SUBROUTINE AR3JET(S,X1,X3,JL)
5C
6#include "hiparnt.inc"
7#include "lujets_hijing.inc"
8 SAVE
9C
10 C=1./3.
11 IF(K(JL,2).NE.21 .AND. K(JL+1,2).NE.21) C=8./27.
12 EXP1=3
13 EXP3=3
14 IF(K(JL,2).NE.21) EXP1=2
15 IF(K(JL+1,2).NE.21) EXP3=2
16 A=0.24**2/S
17 YMA=ALOG(.5/SQRT(A)+SQRT(.25/A-1))
18 D=4.*C*YMA
19 SM1=P(JL,5)**2/S
20 SM3=P(JL+1,5)**2/S
21 XT2M=(1.-2.*SQRT(SM1)+SM1-SM3)*(1.-2.*SQRT(SM3)-SM1+SM3)
22 XT2M=MIN(.25,XT2M)
23 NTRY=0
241 IF(NTRY.EQ.5000) THEN
25 X1=.5*(2.*SQRT(SM1)+1.+SM1-SM3)
26 X3=.5*(2.*SQRT(SM3)+1.-SM1+SM3)
27 RETURN
28 ENDIF
29 NTRY=NTRY+1
30
31 XT2=A*(XT2M/A)**(RLU_HIJING(0)**(1./D))
32
33 YMAX=ALOG(.5/SQRT(XT2)+SQRT(.25/XT2-1.))
34 Y=(2.*RLU_HIJING(0)-1.)*YMAX
35 X1=1.-SQRT(XT2)*EXP(Y)
36 X3=1.-SQRT(XT2)*EXP(-Y)
37 X2=2.-X1-X3
38 NEG=0
39 IF(K(JL,2).NE.21 .OR. K(JL+1,2).NE.21) THEN
40 IF((1.-X1)*(1.-X2)*(1.-X3)-X2*SM1*(1.-X1)-X2*SM3*(1.-X3).
41 & LE.0..OR.X1.LE.2.*SQRT(SM1)-SM1+SM3.OR.X3.LE.2.*SQRT(SM3)
42 & -SM3+SM1) NEG=1
43 X1=X1+SM1-SM3
44 X3=X3-SM1+SM3
45 ENDIF
46 IF(NEG.EQ.1) GOTO 1
47
48 FG=2.*YMAX*C*(X1**EXP1+X3**EXP3)/D
49 XT2M=XT2
50 IF(FG.LT.RLU_HIJING(0)) GOTO 1
51
52 RETURN
53 END