Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / HIJING / hipyset1_35 / lufowo_hijing.F
CommitLineData
e74335a4 1* $Id$
2
3C*********************************************************************
4
5 SUBROUTINE LUFOWO_HIJING(H10,H20,H30,H40)
6
7C...Purpose: to calculate the first few Fox-Wolfram moments.
8#include "lujets_hijing.inc"
9#include "ludat1_hijing.inc"
10#include "ludat2_hijing.inc"
11
12C...Copy momenta for particles and calculate H0.
13 NP=0
14 H0=0.
15 HD=0.
16 DO 110 I=1,N
17 IF(K(I,1).LE.0.OR.K(I,1).GT.10) GOTO 110
18 IF(MSTU(41).GE.2) THEN
19 KC=LUCOMP_HIJING(K(I,2))
20 IF(KC.EQ.0.OR.KC.EQ.12.OR.KC.EQ.14.OR.KC.EQ.16.OR.
21 & KC.EQ.18) GOTO 110
22 IF(MSTU(41).GE.3.AND.KCHG(KC,2).EQ.0.AND.LUCHGE_HIJING(K(I,2))
23 $ .EQ.0)GOTO 110
24 ENDIF
25 IF(N+NP.GE.MSTU(4)-MSTU(32)-5) THEN
26 CALL LUERRM_HIJING(11
27 $ ,'(LUFOWO_HIJING:) no more memory left in LUJETS_HIJING')
28 H10=-1.
29 H20=-1.
30 H30=-1.
31 H40=-1.
32 RETURN
33 ENDIF
34 NP=NP+1
35 DO 100 J=1,3
36 100 P(N+NP,J)=P(I,J)
37 P(N+NP,4)=SQRT(P(I,1)**2+P(I,2)**2+P(I,3)**2)
38 H0=H0+P(N+NP,4)
39 HD=HD+P(N+NP,4)**2
40 110 CONTINUE
41 H0=H0**2
42
43C...Very low multiplicities (0 or 1) not considered.
44 IF(NP.LE.1) THEN
45 CALL LUERRM_HIJING(8
46 $ ,'(LUFOWO_HIJING:) too few particles for analysis')
47 H10=-1.
48 H20=-1.
49 H30=-1.
50 H40=-1.
51 RETURN
52 ENDIF
53
54C...Calculate H1 - H4.
55 H10=0.
56 H20=0.
57 H30=0.
58 H40=0.
59 DO 120 I1=N+1,N+NP
60 DO 120 I2=I1+1,N+NP
61 CTHE=(P(I1,1)*P(I2,1)+P(I1,2)*P(I2,2)+P(I1,3)*P(I2,3))/
62 &(P(I1,4)*P(I2,4))
63 H10=H10+P(I1,4)*P(I2,4)*CTHE
64 H20=H20+P(I1,4)*P(I2,4)*(1.5*CTHE**2-0.5)
65 H30=H30+P(I1,4)*P(I2,4)*(2.5*CTHE**3-1.5*CTHE)
66 H40=H40+P(I1,4)*P(I2,4)*(4.375*CTHE**4-3.75*CTHE**2+0.375)
67 120 CONTINUE
68
69C...Calculate H1/H0 - H4/H0. Output.
70 MSTU(61)=N+1
71 MSTU(62)=NP
72 H10=(HD+2.*H10)/H0
73 H20=(HD+2.*H20)/H0
74 H30=(HD+2.*H30)/H0
75 H40=(HD+2.*H40)/H0
76
77 RETURN
78 END