CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
HankelFunction.h File Reference
#include <Rtypes.h>

Go to the source code of this file.

Functions

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

Function Documentation

double HankelK0 ( double  x)

Definition at line 140 of file HankelFunction.cc.

References BesselI0(), reco::ParticleMasses::k0, k0Coefficient, fireworks::p1, fireworks::p2, gpuClustering::x, and detailsBasic3DVector::y.

Referenced by HankelKn().

140  {
141  const double p1 = k0Coefficient[0][0];
142  const double p2 = k0Coefficient[1][0];
143  const double p3 = k0Coefficient[2][0];
144  const double p4 = k0Coefficient[3][0];
145  const double p5 = k0Coefficient[4][0];
146  const double p6 = k0Coefficient[5][0];
147  const double p7 = k0Coefficient[6][0];
148 
149  const double q1 = k0Coefficient[0][1];
150  const double q2 = k0Coefficient[1][1];
151  const double q3 = k0Coefficient[2][1];
152  const double q4 = k0Coefficient[3][1];
153  const double q5 = k0Coefficient[4][1];
154  const double q6 = k0Coefficient[5][1];
155  const double q7 = k0Coefficient[6][1];
156 
157  double k0 = 0.;
158  if (x <= 2.0) {
159  double y = x * x / 4.0;
160  k0 = (-TMath::Log(x / 2.0) * BesselI0(x)) + (p1 + y * (p2 + y * (p3 + y * (p4 + y * (p5 + y * (p6 + y * p7))))));
161  } else {
162  double y = (2.0 / x);
163  k0 = (TMath::Exp(-x) / TMath::Sqrt(x)) * (q1 + y * (q2 + y * (q3 + y * (q4 + y * (q5 + y * (q6 + y * q7))))));
164  }
165 
166  return k0;
167 }
const TString p2
Definition: fwPaths.cc:13
double BesselI0(double x)
const double k0Coefficient[kNCoeff][kNe]
const TString p1
Definition: fwPaths.cc:12
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
double HankelK1 ( double  x)

Definition at line 169 of file HankelFunction.cc.

References BesselI1(), k1Coefficient, fireworks::p1, fireworks::p2, gpuClustering::x, and detailsBasic3DVector::y.

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

169  {
170  // (C) Copr. 1986-92 Numerical Recipes Software +7.
171  // compute modified Hankel function of the first order
172  const double p1 = k1Coefficient[0][0];
173  const double p2 = k1Coefficient[1][0];
174  const double p3 = k1Coefficient[2][0];
175  const double p4 = k1Coefficient[3][0];
176  const double p5 = k1Coefficient[4][0];
177  const double p6 = k1Coefficient[5][0];
178  const double p7 = k1Coefficient[6][0];
179 
180  const double q1 = k1Coefficient[0][1];
181  const double q2 = k1Coefficient[1][1];
182  const double q3 = k1Coefficient[2][1];
183  const double q4 = k1Coefficient[3][1];
184  const double q5 = k1Coefficient[4][1];
185  const double q6 = k1Coefficient[5][1];
186  const double q7 = k1Coefficient[6][1];
187 
188  double k1 = 0.;
189 
190  if (x <= 2.0) {
191  double y = x * x / 4.0;
192  k1 = (TMath::Log(x / 2.0) * BesselI1(x)) +
193  (1.0 / x) * (p1 + y * (p2 + y * (p3 + y * (p4 + y * (p5 + y * (p6 + y * p7))))));
194  } else {
195  double y = 2.0 / x;
196  k1 = (TMath::Exp(-x) / TMath::Sqrt(x)) * (q1 + y * (q2 + y * (q3 + y * (q4 + y * (q5 + y * (q6 + y * q7))))));
197  }
198 
199  return k1;
200 }
const TString p2
Definition: fwPaths.cc:13
const TString p1
Definition: fwPaths.cc:12
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
const double k1Coefficient[kNCoeff][kNe]
double BesselI1(double x)
double HankelKn ( int  n,
double  x 
)

Definition at line 202 of file HankelFunction.cc.

References c, HankelK0(), HankelK1(), isotrackApplyRegressor::k, kp, and gpuClustering::x.

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

202  {
203  // (C) Copr. 1986-92 Numerical Recipes Software +7.
204  // compute modified Hankel function of the first order
205  if (n < 2)
206  throw "Bad argument n in Kn";
207 
208  double tox = 2.0 / x;
209  double km = HankelK0(x);
210  double k = HankelK1(x);
211  double kp = 0.;
212 
213  for (int c = 1; c <= n - 1; ++c) {
214  kp = km + c * tox * k;
215  km = k;
216  k = kp;
217  }
218 
219  return k;
220 }
const edm::EventSetup & c
int kp
double HankelK0(double x)
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
double HankelK1(double x)