Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / HIJING / hipyset1_35 / pydiff_hijing.F
CommitLineData
e74335a4 1* $Id$
2
3C*********************************************************************
4
5 SUBROUTINE PYDIFF_HIJING
6
7C...Handles diffractive and elastic scattering.
8#include "lujets_hijing.inc"
9#include "ludat1_hijing.inc"
10#include "pypars_hijing.inc"
11#include "pyint1_hijing.inc"
12
13C...Reset K, P and V vectors. Store incoming particles.
14 DO 100 JT=1,MSTP(126)+10
15 I=MINT(83)+JT
16 DO 100 J=1,5
17 K(I,J)=0
18 P(I,J)=0.
19 100 V(I,J)=0.
20 N=MINT(84)
21 MINT(3)=0
22 MINT(21)=0
23 MINT(22)=0
24 MINT(23)=0
25 MINT(24)=0
26 MINT(4)=4
27 DO 110 JT=1,2
28 I=MINT(83)+JT
29 K(I,1)=21
30 K(I,2)=MINT(10+JT)
31 P(I,5)=VINT(2+JT)
32 P(I,3)=VINT(5)*(-1)**(JT+1)
33 110 P(I,4)=SQRT(P(I,3)**2+P(I,5)**2)
34 MINT(6)=2
35
36C...Subprocess; kinematics.
37 ISUB=MINT(1)
38 SQLAM=(VINT(2)-VINT(63)-VINT(64))**2-4.*VINT(63)*VINT(64)
39 PZ=SQRT(SQLAM)/(2.*VINT(1))
40 DO 150 JT=1,2
41 I=MINT(83)+JT
42 PE=(VINT(2)+VINT(62+JT)-VINT(65-JT))/(2.*VINT(1))
43
44C...Elastically scattered particle.
45 IF(MINT(16+JT).LE.0) THEN
46 N=N+1
47 K(N,1)=1
48 K(N,2)=K(I,2)
49 K(N,3)=I+2
50 P(N,3)=PZ*(-1)**(JT+1)
51 P(N,4)=PE
52 P(N,5)=P(I,5)
53
54C...Diffracted particle: valence quark kicked out.
55 ELSEIF(MSTP(101).EQ.1) THEN
56 N=N+2
57 K(N-1,1)=2
58 K(N,1)=1
59 K(N-1,3)=I+2
60 K(N,3)=I+2
61 CALL PYSPLI_HIJING(K(I,2),21,K(N,2),K(N-1,2))
62 P(N-1,5)=ULMASS_HIJING(K(N-1,2))
63 P(N,5)=ULMASS_HIJING(K(N,2))
64 SQLAM=(VINT(62+JT)-P(N-1,5)**2-P(N,5)**2)**2-
65 & 4.*P(N-1,5)**2*P(N,5)**2
66 P(N-1,3)=(PE*SQRT(SQLAM)+PZ*(VINT(62+JT)+P(N-1,5)**2-
67 & P(N,5)**2))/(2.*VINT(62+JT))*(-1)**(JT+1)
68 P(N-1,4)=SQRT(P(N-1,3)**2+P(N-1,5)**2)
69 P(N,3)=PZ*(-1)**(JT+1)-P(N-1,3)
70 P(N,4)=SQRT(P(N,3)**2+P(N,5)**2)
71
72C...Diffracted particle: gluon kicked out.
73 ELSE
74 N=N+3
75 K(N-2,1)=2
76 K(N-1,1)=2
77 K(N,1)=1
78 K(N-2,3)=I+2
79 K(N-1,3)=I+2
80 K(N,3)=I+2
81 CALL PYSPLI_HIJING(K(I,2),21,K(N,2),K(N-2,2))
82 K(N-1,2)=21
83 P(N-2,5)=ULMASS_HIJING(K(N-2,2))
84 P(N-1,5)=0.
85 P(N,5)=ULMASS_HIJING(K(N,2))
86C...Energy distribution for particle into two jets.
87 120 IMB=1
88 IF(MOD(K(I,2)/1000,10).NE.0) IMB=2
89 CHIK=PARP(92+2*IMB)
90 IF(MSTP(92).LE.1) THEN
91 IF(IMB.EQ.1) CHI=RLU_HIJING(0)
92 IF(IMB.EQ.2) CHI=1.-SQRT(RLU_HIJING(0))
93 ELSEIF(MSTP(92).EQ.2) THEN
94 CHI=1.-RLU_HIJING(0)**(1./(1.+CHIK))
95 ELSEIF(MSTP(92).EQ.3) THEN
96 CUT=2.*0.3/VINT(1)
97 130 CHI=RLU_HIJING(0)**2
98 IF((CHI**2/(CHI**2+CUT**2))**0.25*(1.-CHI)**CHIK.LT.
99 & RLU_HIJING(0)) GOTO 130
100 ELSE
101 CUT=2.*0.3/VINT(1)
102 CUTR=(1.+SQRT(1.+CUT**2))/CUT
103 140 CHIR=CUT*CUTR**RLU_HIJING(0)
104 CHI=(CHIR**2-CUT**2)/(2.*CHIR)
105 IF((1.-CHI)**CHIK.LT.RLU_HIJING(0)) GOTO 140
106 ENDIF
107 IF(CHI.LT.P(N,5)**2/VINT(62+JT).OR.CHI.GT.1.-P(N-2,5)**2/
108 & VINT(62+JT)) GOTO 120
109 SQM=P(N-2,5)**2/(1.-CHI)+P(N,5)**2/CHI
110 IF((SQRT(SQM)+PARJ(32))**2.GE.VINT(62+JT)) GOTO 120
111 PZI=(PE*(VINT(62+JT)-SQM)+PZ*(VINT(62+JT)+SQM))/
112 & (2.*VINT(62+JT))
113 PEI=SQRT(PZI**2+SQM)
114 PQQP=(1.-CHI)*(PEI+PZI)
115 P(N-2,3)=0.5*(PQQP-P(N-2,5)**2/PQQP)*(-1)**(JT+1)
116 P(N-2,4)=SQRT(P(N-2,3)**2+P(N-2,5)**2)
117 P(N-1,3)=(PZ-PZI)*(-1)**(JT+1)
118 P(N-1,4)=ABS(P(N-1,3))
119 P(N,3)=PZI*(-1)**(JT+1)-P(N-2,3)
120 P(N,4)=SQRT(P(N,3)**2+P(N,5)**2)
121 ENDIF
122
123C...Documentation lines.
124 K(I+2,1)=21
125 IF(MINT(16+JT).EQ.0) K(I+2,2)=MINT(10+JT)
126 IF(MINT(16+JT).NE.0) K(I+2,2)=10*(MINT(10+JT)/10)
127 K(I+2,3)=I
128 P(I+2,3)=PZ*(-1)**(JT+1)
129 P(I+2,4)=PE
130 P(I+2,5)=SQRT(VINT(62+JT))
131 150 CONTINUE
132
133C...Rotate outgoing partons/particles using cos(theta).
134 CALL LUDBRB_HIJING(MINT(83)+3,N,ACOS(VINT(23)),VINT(24),0D0,0D0
135 $ ,0D0)
136
137 RETURN
138 END