ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyhispen.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyhispen.f
1 
2 C***********************************************************************
3 
4  FUNCTION pyhispen(XREIN,XIMIN,IREIM)
5 
6 C...Calculates real and imaginary part of Spence function; see
7 C...G. 't Hooft and M. Veltman, Nucl. Phys. B153 (1979) 365.
8  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
9  SAVE /ludat1/
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) pyhispen=paru(1)**2/6.
23  IF(ireim.EQ.2) pyhispen=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) pyhispen=0.
30  IF(ireim.EQ.2) pyhispen=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) pyhispen=sp0re+sgn*spre
83  IF(ireim.EQ.2) pyhispen=sp0im+sgn*spim
84 
85  RETURN
86  END