CMS 3D CMS Logo

Enumerations | Functions | Variables
HankelFunction.cc File Reference
#include <TMath.h>
#include "GeneratorInterface/Hydjet2Interface/interface/HankelFunction.h"

Go to the source code of this file.

Enumerations

enum  { kNe = 2, kNCoeff = 9 }
 

Functions

double BesselI0 (double x)
 
double BesselI1 (double x)
 
double HankelK0 (double x)
 
double HankelK1 (double x)
 
double HankelKn (int n, double x)
 

Variables

const double i0Coefficient [kNCoeff][kNe]
 
const double i1Coefficient [kNCoeff][kNe]
 
const double k0Coefficient [kNCoeff][kNe]
 
const double k1Coefficient [kNCoeff][kNe]
 

Enumeration Type Documentation

anonymous enum
Enumerator
kNe 
kNCoeff 

Definition at line 14 of file HankelFunction.cc.

14 {kNe = 2, kNCoeff = 9};

Function Documentation

double BesselI0 ( double  x)

Definition at line 72 of file HankelFunction.cc.

References Abs(), create_public_lumi_plots::ax, i0Coefficient, p1, p2, p3, p4, q1, q2, and detailsBasic3DVector::y.

Referenced by gen::Hydjet2Hadronizer::CharmEnhancementFactor(), and HankelK0().

72  {
73  // (C) Copr. 1986-92 Numerical Recipes Software +7.
74  //compute Bessel function of zeroth order
75 
76  const double p1 = i0Coefficient[0][0];
77  const double p2 = i0Coefficient[1][0];
78  const double p3 = i0Coefficient[2][0];
79  const double p4 = i0Coefficient[3][0];
80  const double p5 = i0Coefficient[4][0];
81  const double p6 = i0Coefficient[5][0];
82  const double p7 = i0Coefficient[6][0];
83 
84  const double q1 = i0Coefficient[0][1];
85  const double q2 = i0Coefficient[1][1];
86  const double q3 = i0Coefficient[2][1];
87  const double q4 = i0Coefficient[3][1];
88  const double q5 = i0Coefficient[4][1];
89  const double q6 = i0Coefficient[5][1];
90  const double q7 = i0Coefficient[6][1];
91  const double q8 = i0Coefficient[7][1];
92  const double q9 = i0Coefficient[8][1];
93 
94  double i0 = 0.;
95 
96  if(TMath::Abs(x) < 3.75) {
97  double y = (x / 3.75) * (x / 3.75);
98  i0 = p1 + y * (p2 + y * (p3 + y * (p4 + y * (p5 + y * (p6 + y * p7)))));
99  }
100  else {
101  double ax = TMath::Abs(x);
102  double y = 3.75 / ax;
103  i0 = (TMath::Exp(ax)/TMath::Sqrt(ax))*(q1 + y*(q2 + y*(q3 + y*(q4 + y*(q5 + y*(q6 + y*(q7 + y*(q8 + y*q9))))))));
104  }
105 
106  return i0;
107 }
double q2[4]
Definition: TauolaWrapper.h:88
double p4[4]
Definition: TauolaWrapper.h:92
T Abs(T a)
Definition: MathUtil.h:49
double p2[4]
Definition: TauolaWrapper.h:90
const double i0Coefficient[kNCoeff][kNe]
double q1[4]
Definition: TauolaWrapper.h:87
double p1[4]
Definition: TauolaWrapper.h:89
double p3[4]
Definition: TauolaWrapper.h:91
double BesselI1 ( double  x)

Definition at line 109 of file HankelFunction.cc.

References Abs(), create_public_lumi_plots::ax, i1Coefficient, p1, p2, p3, p4, q1, q2, and detailsBasic3DVector::y.

Referenced by gen::Hydjet2Hadronizer::CharmEnhancementFactor(), and HankelK1().

109  {
110  // (C) Copr. 1986-92 Numerical Recipes Software +7.
111  //compute Bessel function of first order
112 
113  const double p1 = i1Coefficient[0][0];
114  const double p2 = i1Coefficient[1][0];
115  const double p3 = i1Coefficient[2][0];
116  const double p4 = i1Coefficient[3][0];
117  const double p5 = i1Coefficient[4][0];
118  const double p6 = i1Coefficient[5][0];
119  const double p7 = i1Coefficient[6][0];
120 
121  const double q1 = i1Coefficient[0][1];
122  const double q2 = i1Coefficient[1][1];
123  const double q3 = i1Coefficient[2][1];
124  const double q4 = i1Coefficient[3][1];
125  const double q5 = i1Coefficient[4][1];
126  const double q6 = i1Coefficient[5][1];
127  const double q7 = i1Coefficient[6][1];
128  const double q8 = i1Coefficient[7][1];
129  const double q9 = i1Coefficient[8][1];
130 
131  double i1 = 0.;
132 
133  if (TMath::Abs(x) < 3.75) {
134  double y = (x / 3.75) * (x / 3.75);
135  i1 = x * (p1 + y * (p2 + y * (p3 + y * (p4 + y * (p5 + y * (p6 + y * p7))))));
136  }
137  else {
138  double ax = TMath::Abs(x);
139  double y = 3.75/ax;
140  i1 = (TMath::Exp(ax)/TMath::Sqrt(ax))*(q1 + y*(q2 + y*(q3 + y*(q4 + y*(q5 + y*(q6 + y*(q7 + y*(q8 + y*q9))))))));
141  if(x < 0.) i1 = -i1;
142  }
143 
144  return i1;
145 }
double q2[4]
Definition: TauolaWrapper.h:88
const double i1Coefficient[kNCoeff][kNe]
double p4[4]
Definition: TauolaWrapper.h:92
T Abs(T a)
Definition: MathUtil.h:49
double p2[4]
Definition: TauolaWrapper.h:90
double q1[4]
Definition: TauolaWrapper.h:87
double p1[4]
Definition: TauolaWrapper.h:89
double p3[4]
Definition: TauolaWrapper.h:91
double HankelK0 ( double  x)

Definition at line 147 of file HankelFunction.cc.

References BesselI0(), reco::ParticleMasses::k0, k0Coefficient, p1, p2, p3, p4, q1, q2, vertices_cff::x, and detailsBasic3DVector::y.

Referenced by HankelKn().

147  {
148  const double p1 = k0Coefficient[0][0];
149  const double p2 = k0Coefficient[1][0];
150  const double p3 = k0Coefficient[2][0];
151  const double p4 = k0Coefficient[3][0];
152  const double p5 = k0Coefficient[4][0];
153  const double p6 = k0Coefficient[5][0];
154  const double p7 = k0Coefficient[6][0];
155 
156  const double q1 = k0Coefficient[0][1];
157  const double q2 = k0Coefficient[1][1];
158  const double q3 = k0Coefficient[2][1];
159  const double q4 = k0Coefficient[3][1];
160  const double q5 = k0Coefficient[4][1];
161  const double q6 = k0Coefficient[5][1];
162  const double q7 = k0Coefficient[6][1];
163 
164  double k0 = 0.;
165  if(x <= 2.0) {
166  double y = x * x / 4.0;
167  k0 = (-TMath::Log(x/2.0)*BesselI0(x)) + (p1 + y*(p2 + y*(p3 + y*(p4 + y*(p5 + y*(p6 + y*p7))))));
168  }
169  else {
170  double y = (2.0 / x);
171  k0 = (TMath::Exp(-x)/TMath::Sqrt(x))*(q1 + y*(q2 + y*(q3 + y*(q4 + y*(q5 + y*(q6 + y*q7))))));
172  }
173 
174  return k0;
175 }
double BesselI0(double x)
double q2[4]
Definition: TauolaWrapper.h:88
const double k0Coefficient[kNCoeff][kNe]
double p4[4]
Definition: TauolaWrapper.h:92
double p2[4]
Definition: TauolaWrapper.h:90
double q1[4]
Definition: TauolaWrapper.h:87
double p1[4]
Definition: TauolaWrapper.h:89
double p3[4]
Definition: TauolaWrapper.h:91
double HankelK1 ( double  x)

Definition at line 177 of file HankelFunction.cc.

References BesselI1(), k1Coefficient, p1, p2, p3, p4, q1, q2, vertices_cff::x, and detailsBasic3DVector::y.

Referenced by HankelKn(), and GrandCanonical::ParticleEnergyDensity().

177  {
178  // (C) Copr. 1986-92 Numerical Recipes Software +7.
179  // compute modified Hankel function of the first order
180  const double p1 = k1Coefficient[0][0];
181  const double p2 = k1Coefficient[1][0];
182  const double p3 = k1Coefficient[2][0];
183  const double p4 = k1Coefficient[3][0];
184  const double p5 = k1Coefficient[4][0];
185  const double p6 = k1Coefficient[5][0];
186  const double p7 = k1Coefficient[6][0];
187 
188  const double q1 = k1Coefficient[0][1];
189  const double q2 = k1Coefficient[1][1];
190  const double q3 = k1Coefficient[2][1];
191  const double q4 = k1Coefficient[3][1];
192  const double q5 = k1Coefficient[4][1];
193  const double q6 = k1Coefficient[5][1];
194  const double q7 = k1Coefficient[6][1];
195 
196  double k1 = 0.;
197 
198  if(x <= 2.0) {
199  double y = x * x / 4.0;
200  k1 = (TMath::Log(x/2.0)*BesselI1(x)) + (1.0/x)*(p1 + y*(p2 + y*(p3 + y*(p4 + y*(p5 + y*(p6 + y*p7))))));
201  }
202  else {
203  double y = 2.0 / x;
204  k1 = (TMath::Exp(-x)/TMath::Sqrt(x))*(q1 + y*(q2 + y*(q3 + y*(q4 + y*(q5 + y*(q6 + y*q7))))));
205  }
206 
207  return k1;
208 }
double q2[4]
Definition: TauolaWrapper.h:88
double p4[4]
Definition: TauolaWrapper.h:92
const double k1Coefficient[kNCoeff][kNe]
double p2[4]
Definition: TauolaWrapper.h:90
double q1[4]
Definition: TauolaWrapper.h:87
double p1[4]
Definition: TauolaWrapper.h:89
double BesselI1(double x)
double p3[4]
Definition: TauolaWrapper.h:91
double HankelKn ( int  n,
double  x 
)

Definition at line 210 of file HankelFunction.cc.

References EnergyCorrector::c, HankelK0(), HankelK1(), gen::k, and vertices_cff::x.

Referenced by GrandCanonical::ParticleEnergyDensity(), NAStrangeDensity::ParticleNumberDensity(), and GrandCanonical::ParticleNumberDensity().

210  {
211  // (C) Copr. 1986-92 Numerical Recipes Software +7.
212  // compute modified Hankel function of the first order
213  if(n < 2) throw "Bad argument n in Kn";
214 
215  double tox = 2.0 / x;
216  double km = HankelK0(x);
217  double k = HankelK1(x);
218  double kp = 0.;
219 
220  for(int c = 1; c <= n-1; ++c) {
221  kp = km + c * tox * k;
222  km = k;
223  k = kp;
224  }
225 
226  return k;
227 }
double HankelK1(double x)
int k[5][pyjets_maxn]
double HankelK0(double x)

Variable Documentation

const double i0Coefficient[kNCoeff][kNe]
Initial value:
=
{
{1.0, 0.39894228},
{3.5156229, 0.01328592},
{3.0899424, 0.00225319},
{1.2067492, -0.00157565},
{0.2659732, 0.00916281},
{0.0360768, -0.02057706},
{0.0045813, 0.02635537},
{0., -0.01647633},
{0., 0.00392377}
}

Definition at line 16 of file HankelFunction.cc.

Referenced by BesselI0().

const double i1Coefficient[kNCoeff][kNe]
Initial value:
=
{
{0.5, 0.39894228},
{0.87890594, -0.03988024},
{0.51498869, -0.00362018},
{0.15084934, 0.00163801},
{0.02658733, -0.01031555},
{0.00301532, 0.02282967},
{0.00032411, -0.02895312},
{0., 0.01787654},
{0., -0.00420059}
}

Definition at line 30 of file HankelFunction.cc.

Referenced by BesselI1().

const double k0Coefficient[kNCoeff][kNe]
Initial value:
=
{
{-0.57721566, 1.25331414},
{0.42278420, -0.07832358},
{0.23069756, 0.02189568},
{0.03488590, -0.01062446},
{0.00262698, 0.00587872},
{0.00010750, -0.00251540},
{0.0000074, 0.00053208},
{0., 0. },
{0., 0. }
}

Definition at line 44 of file HankelFunction.cc.

Referenced by HankelK0().

const double k1Coefficient[kNCoeff][kNe]
Initial value:
=
{
{1.0, 1.25331414},
{0.15443144, 0.23498619},
{-0.67278579, -0.03655620},
{-0.18156897, 0.01504268},
{-0.01919402, -0.00780353},
{-0.00110404, 0.00325614},
{-0.00004686, -0.00068245},
{ 0., 0. },
{ 0., 0. }
}

Definition at line 58 of file HankelFunction.cc.

Referenced by HankelK1().