Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / HIJING / hipyset1_35 / pyspen_hijing.F
CommitLineData
e74335a4 1* $Id$
2
3C***********************************************************************
4
5 FUNCTION PYSPEN_HIJING(XREIN,XIMIN,IREIM)
6
7C...Calculates real and imaginary part of Spence function; see
8C...G. 't Hooft and M. Veltman, Nucl. Phys. B153 (1979) 365.
9#include "ludat1_hijing.inc"
10 DIMENSION B(0:14)
11
12 DATA B/
13 & 1.000000E+00, -5.000000E-01, 1.666667E-01,
14 & 0.000000E+00, -3.333333E-02, 0.000000E+00,
15 & 2.380952E-02, 0.000000E+00, -3.333333E-02,
16 & 0.000000E+00, 7.575757E-02, 0.000000E+00,
17 &-2.531135E-01, 0.000000E+00, 1.166667E+00/
18
19 XRE=XREIN
20 XIM=XIMIN
21 IF(ABS(1.-XRE).LT.1.E-6.AND.ABS(XIM).LT.1.E-6) THEN
22 IF(IREIM.EQ.1) PYSPEN_HIJING=PARU(1)**2/6.
23 IF(IREIM.EQ.2) PYSPEN_HIJING=0.
24 RETURN
25 ENDIF
26
27 XMOD=SQRT(XRE**2+XIM**2)
28 IF(XMOD.LT.1.E-6) THEN
29 IF(IREIM.EQ.1) PYSPEN_HIJING=0.
30 IF(IREIM.EQ.2) PYSPEN_HIJING=0.
31 RETURN
32 ENDIF
33
34 XARG=SIGN(ACOS(XRE/XMOD),XIM)
35 SP0RE=0.
36 SP0IM=0.
37 SGN=1.
38 IF(XMOD.GT.1.) THEN
39 ALGXRE=LOG(XMOD)
40 ALGXIM=XARG-SIGN(PARU(1),XARG)
41 SP0RE=-PARU(1)**2/6.-(ALGXRE**2-ALGXIM**2)/2.
42 SP0IM=-ALGXRE*ALGXIM
43 SGN=-1.
44 XMOD=1./XMOD
45 XARG=-XARG
46 XRE=XMOD*COS(XARG)
47 XIM=XMOD*SIN(XARG)
48 ENDIF
49 IF(XRE.GT.0.5) THEN
50 ALGXRE=LOG(XMOD)
51 ALGXIM=XARG
52 XRE=1.-XRE
53 XIM=-XIM
54 XMOD=SQRT(XRE**2+XIM**2)
55 XARG=SIGN(ACOS(XRE/XMOD),XIM)
56 ALGYRE=LOG(XMOD)
57 ALGYIM=XARG
58 SP0RE=SP0RE+SGN*(PARU(1)**2/6.-(ALGXRE*ALGYRE-ALGXIM*ALGYIM))
59 SP0IM=SP0IM-SGN*(ALGXRE*ALGYIM+ALGXIM*ALGYRE)
60 SGN=-SGN
61 ENDIF
62
63 XRE=1.-XRE
64 XIM=-XIM
65 XMOD=SQRT(XRE**2+XIM**2)
66 XARG=SIGN(ACOS(XRE/XMOD),XIM)
67 ZRE=-LOG(XMOD)
68 ZIM=-XARG
69
70 SPRE=0.
71 SPIM=0.
72 SAVERE=1.
73 SAVEIM=0.
74 DO 100 I=0,14
75 TERMRE=(SAVERE*ZRE-SAVEIM*ZIM)/FLOAT(I+1)
76 TERMIM=(SAVERE*ZIM+SAVEIM*ZRE)/FLOAT(I+1)
77 SAVERE=TERMRE
78 SAVEIM=TERMIM
79 SPRE=SPRE+B(I)*TERMRE
80 100 SPIM=SPIM+B(I)*TERMIM
81
82 IF(IREIM.EQ.1) PYSPEN_HIJING=SP0RE+SGN*SPRE
83 IF(IREIM.EQ.2) PYSPEN_HIJING=SP0IM+SGN*SPIM
84
85 RETURN
86 END