cea551e6eb0ba75613b089caa1d7a461ee30bebb
[u/mrichter/AliRoot.git] / HIJING / hijing1_36 / arorie.F
1 * $Id$
2 C*************************************************************
3
4
5         SUBROUTINE ARORIE(S,X1,X3,JL)
6 C     
7 #include "hiparnt.inc"
8 #include "lujets_hijing.inc"
9         SAVE
10 C     
11         W=SQRT(S)
12         X2=2.-X1-X3
13         E1=.5*X1*W
14         E3=.5*X3*W
15         P1=SQRT(E1**2-P(JL,5)**2)
16         P3=SQRT(E3**2-P(JL+1,5)**2)
17         CBET=1.
18         IF(P1.GT.0..AND.P3.GT.0.) CBET=(P(JL,5)**2
19      &           +P(JL+1,5)**2+2.*E1*E3-S*(1.-X2))/(2.*P1*P3)
20         IF(ABS(CBET).GT.1.0) CBET=MAX(-1.,MIN(1.,CBET))
21         BET=ACOS(CBET)
22      
23 C.....MINIMIZE PT1-SQUARED PLUS PT3-SQUARED.....
24         IF(P1.GE.P3) THEN
25            PSI=.5*ULANGL_HIJING(P1**2+P3**2*COS(2.*BET),-P3**2*SIN(2.*BET))
26            PT1=P1*SIN(PSI)
27            PZ1=P1*COS(PSI)
28            PT3=P3*SIN(PSI+BET)
29            PZ3=P3*COS(PSI+BET)
30         ELSE IF(P3.GT.P1) THEN
31            PSI=.5*ULANGL_HIJING(P3**2+P1**2*COS(2.*BET),-P1**2*SIN(2.*BET))
32            PT1=P1*SIN(BET+PSI)
33            PZ1=-P1*COS(BET+PSI)
34            PT3=P3*SIN(PSI)
35            PZ3=-P3*COS(PSI)
36         ENDIF
37      
38         DEL=2.0*HIPR1(40)*RLU_HIJING(0)
39         P(JL,4)=E1
40         P(JL,1)=PT1*SIN(DEL)
41         P(JL,2)=-PT1*COS(DEL)
42         P(JL,3)=PZ1
43         P(JL+2,4)=E3
44         P(JL+2,1)=PT3*SIN(DEL)
45         P(JL+2,2)=-PT3*COS(DEL)
46         P(JL+2,3)=PZ3
47         P(JL+1,4)=W-E1-E3
48         P(JL+1,1)=-P(JL,1)-P(JL+2,1)
49         P(JL+1,2)=-P(JL,2)-P(JL+2,2)
50         P(JL+1,3)=-P(JL,3)-P(JL+2,3)
51         RETURN
52         END