evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtLi2Spence.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
21 #include <math.h>
22 
23 const double a1 = -0.250000000000000;
24 const double a2 = -0.111111111111111;
25 const double a3 = -0.010000000000000;
26 const double a4 = -0.017006802721088;
27 const double a5 = -0.019444444444444;
28 const double a6 = -0.020661157024793;
29 const double a7 = -0.021417300648069;
30 const double a8 = -0.021948866377231;
31 const double a9 = -0.022349233811171;
32 const double a10 = -0.022663689135191;
33 const double zeta2 = 1.644934066848226;
34 
35 double li2spence( double x )
36 {
37  double result = 0;
38  double xr = x;
39  double xi = 0;
40  double r2 = xr * xr + xi * xi;
41 
42  double y, z, z2, sp;
43 
44  if ( r2 > 1. && ( xr / r2 ) > 0.5 ) {
45  y = ( x - 1.0 ) / x;
46  z = -log( 1.0 - y );
47  z2 = z * z;
48  sp =
49  z * ( 1.0 +
50  a1 * z *
51  ( 1.0 +
52  a2 * z *
53  ( 1.0 +
54  a3 * z2 *
55  ( 1.0 +
56  a4 * z2 *
57  ( 1.0 +
58  a5 * z2 *
59  ( 1.0 +
60  a6 * z2 *
61  ( 1.0 +
62  a7 * z2 *
63  ( 1.0 +
64  a8 * z2 *
65  ( 1.0 +
66  a9 * z2 *
67  ( 1.0 +
68  a10 * z2 ) ) ) ) ) ) ) ) ) ) +
69  zeta2 - log( x ) * log( 1.0 - x ) + 0.5 * log( x ) * log( x );
70  result = sp;
71 
72  } else if ( r2 > 1 && ( xr / r2 ) <= 0.5 ) {
73  y = 1.0 / x;
74  z = -log( 1.0 - y );
75  z2 = z * z;
76  sp =
77  -z *
78  ( 1.0 +
79  a1 * z *
80  ( 1.0 +
81  a2 * z *
82  ( 1.0 +
83  a3 * z2 *
84  ( 1.0 +
85  a4 * z2 *
86  ( 1.0 +
87  a5 * z2 *
88  ( 1.0 +
89  a6 * z2 *
90  ( 1.0 +
91  a7 * z2 *
92  ( 1.0 +
93  a8 * z2 *
94  ( 1.0 +
95  a9 * z2 *
96  ( 1.0 +
97  a10 * z2 ) ) ) ) ) ) ) ) ) ) +
98  zeta2 - 0.5 * log( -x ) * log( -x );
99  result = sp;
100 
101  } else if ( r2 == 1 && xi == 0 ) {
102  sp = zeta2;
103  result = sp;
104 
105  } else if ( r2 <= 1 && xr > 0.5 ) {
106  y = 1.0 - x;
107  z = -log( 1.0 - y );
108  z2 = z * z;
109  sp =
110  -z *
111  ( 1.0 +
112  a1 * z *
113  ( 1.0 +
114  a2 * z *
115  ( 1.0 +
116  a3 * z2 *
117  ( 1.0 +
118  a4 * z2 *
119  ( 1.0 +
120  a5 * z2 *
121  ( 1.0 +
122  a6 * z2 *
123  ( 1.0 +
124  a7 * z2 *
125  ( 1.0 +
126  a8 * z2 *
127  ( 1.0 +
128  a9 * z2 *
129  ( 1.0 +
130  a10 * z2 ) ) ) ) ) ) ) ) ) ) +
131  zeta2 - log( x ) * log( 1.0 - x );
132  result = sp;
133 
134  } else if ( r2 <= 1 && xr <= 0.5 ) {
135  y = x;
136  z = -log( 1.0 - y );
137  z2 = z * z;
138  sp =
139  z *
140  ( 1.0 +
141  a1 * z *
142  ( 1.0 +
143  a2 * z *
144  ( 1.0 +
145  a3 * z2 *
146  ( 1.0 +
147  a4 * z2 *
148  ( 1.0 +
149  a5 * z2 *
150  ( 1.0 +
151  a6 * z2 *
152  ( 1.0 +
153  a7 * z2 *
154  ( 1.0 +
155  a8 * z2 *
156  ( 1.0 +
157  a9 * z2 *
158  ( 1.0 +
159  a10 * z2 ) ) ) ) ) ) ) ) ) );
160  result = sp;
161  }
162 
163  return result;
164 }
const double a5
const double a7
const double a6
const double a3
const double a2
const double a1
const double a9
const double a8
const double a4
const double zeta2
const double a10
double li2spence(double x)