3 C*********************************************************************
5 SUBROUTINE LUSPHE_HIJING(SPH,APL)
7 C...Purpose: to perform sphericity tensor analysis to give sphericity,
8 C...aplanarity and the related event axes.
9 #include "lujets_hijing.inc"
10 #include "ludat1_hijing.inc"
11 #include "ludat2_hijing.inc"
12 DIMENSION SM(3,3),SV(3,3)
14 C...Calculate matrix to be diagonalized.
21 IF(K(I,1).LE.0.OR.K(I,1).GT.10) GOTO 120
22 IF(MSTU(41).GE.2) THEN
23 KC=LUCOMP_HIJING(K(I,2))
24 IF(KC.EQ.0.OR.KC.EQ.12.OR.KC.EQ.14.OR.KC.EQ.16.OR.
26 IF(MSTU(41).GE.3.AND.KCHG(KC,2).EQ.0.AND.LUCHGE_HIJING(K(I,2))
30 PA=SQRT(P(I,1)**2+P(I,2)**2+P(I,3)**2)
32 IF(ABS(PARU(41)-2.).GT.0.001) PWT=MAX(1E-10,PA)**(PARU(41)-2.)
35 110 SM(J1,J2)=SM(J1,J2)+PWT*P(I,J1)*P(I,J2)
39 C...Very low multiplicities (0 or 1) not considered.
42 $ ,'(LUSPHE_HIJING:) too few particles for analysis')
49 130 SM(J1,J2)=SM(J1,J2)/PS
51 C...Find eigenvalues to matrix (third degree equation).
52 SQ=(SM(1,1)*SM(2,2)+SM(1,1)*SM(3,3)+SM(2,2)*SM(3,3)-SM(1,2)**2-
53 &SM(1,3)**2-SM(2,3)**2)/3.-1./9.
54 SR=-0.5*(SQ+1./9.+SM(1,1)*SM(2,3)**2+SM(2,2)*SM(1,3)**2+SM(3,3)*
55 &SM(1,2)**2-SM(1,1)*SM(2,2)*SM(3,3))+SM(1,2)*SM(1,3)*SM(2,3)+1./27.
56 SP=COS(ACOS(MAX(MIN(SR/SQRT(-SQ**3),1.),-1.))/3.)
57 P(N+1,4)=1./3.+SQRT(-SQ)*MAX(2.*SP,SQRT(3.*(1.-SP**2))-SP)
58 P(N+3,4)=1./3.+SQRT(-SQ)*MIN(2.*SP,-SQRT(3.*(1.-SP**2))-SP)
59 P(N+2,4)=1.-P(N+1,4)-P(N+3,4)
60 IF(P(N+2,4).LT.1E-5) THEN
62 $ ,'(LUSPHE_HIJING:) all particles back-to-back')
68 C...Find first and last eigenvector by solving equation system.
71 SV(J1,J1)=SM(J1,J1)-P(N+I,4)
74 140 SV(J2,J1)=SM(J1,J2)
78 IF(ABS(SV(J1,J2)).LE.SMAX) GOTO 150
86 RL=SV(J1,JB)/SV(JA,JB)
88 SV(J1,J2)=SV(J1,J2)-RL*SV(JA,J2)
89 IF(ABS(SV(J1,J2)).LE.SMAX) GOTO 160
95 P(N+I,JB1)=-SV(JC,JB2)
97 P(N+I,JB)=-(SV(JA,JB1)*P(N+I,JB1)+SV(JA,JB2)*P(N+I,JB2))/
99 PA=SQRT(P(N+I,1)**2+P(N+I,2)**2+P(N+I,3)**2)
100 SGN=(-1.)**INT(RLU_HIJING(0)+0.5)
102 170 P(N+I,J)=SGN*P(N+I,J)/PA
104 C...Middle axis orthogonal to other two. Fill other codes.
105 SGN=(-1.)**INT(RLU_HIJING(0)+0.5)
106 P(N+2,1)=SGN*(P(N+1,2)*P(N+3,3)-P(N+1,3)*P(N+3,2))
107 P(N+2,2)=SGN*(P(N+1,3)*P(N+3,1)-P(N+1,1)*P(N+3,3))
108 P(N+2,3)=SGN*(P(N+1,1)*P(N+3,2)-P(N+1,2)*P(N+3,1))
119 C...Select storing option. Calculate sphericity and aplanarity.
122 IF(MSTU(43).LE.1) MSTU(3)=3
123 IF(MSTU(43).GE.2) N=N+3
124 SPH=1.5*(P(N+2,4)+P(N+3,4))