Port of CERNLIB routines vvidis/vviden (G116) to calculate higher quality Vavilov density and distribution functions
Definition at line 24 of file VVIObj.h.
VVIObj::VVIObj |
( |
double |
kappa = 0.01 , |
|
|
double |
beta2 = 1. , |
|
|
int |
mode = 0 |
|
) |
| |
Constructor.
Constructor Set Vavilov parameters kappa and beta2 and define whether to calculate density fcn or distribution fcn
- Parameters
-
kappa | - (input) Vavilov kappa parameter [0.01 (Landau-like) < kappa < 10. (Gaussian-like)] |
beta2 | - (input) Vavilov beta2 parameter (square of particle speed in v/c units) |
mode | - (input) set to 0 to calculate the density function and to 1 to calculate the distribution function |
Definition at line 48 of file VVIObj.cc.
References a_, funct::abs(), b_, alignmentValidation::c1, counter::c2, funct::cos(), ztail::d, VVIObjDetails::dzero(), alignCSCRings::e, create_public_lumi_plots::exp, VVIObjDetails::expint(), python.connectstrParser::f1, python.connectstrParser::f2, relval_steps::k, kappa, prof2calltree::l, create_public_lumi_plots::log, mode_, gen::n, omega_, lumiQueryAPI::q, q2, funct::sin(), VVIObjDetails::sincosint(), t0_, t1_, t_, x, and x0_.
50 const double xp[9] = { 9.29,2.47,.89,.36,.15,.07,.03,.02,0.0 };
51 const double xq[7] = { .012,.03,.08,.26,.87,3.83,11.0 };
53 double q, u,
x,
c1,
c2, c3, c4, d1, h4, h5, h6,
q2, x1,
d, ll, ul, xf1, xf2, rv;
60 if(beta2 < 0.) beta2 = 0.;
61 if(beta2 > 1.) beta2 = 1.;
63 h_[4] = 1. - beta2*0.42278433999999998 + 7.6/
kappa;
66 h4 = -7.6/
kappa - (beta2 * .57721566 + 1);
73 for (lp = 0; lp < 9; ++lp) {
74 if (
kappa >= xp[lp])
break;
77 for (lq = 0; lq < 7; ++lq) {
78 if (
kappa <= xq[lq])
break;
87 h_[0] =
kappa * (beta2 * .57721566 + 2.) + 9.9166128600000008;
88 if (
kappa >= .07) {h_[0] += 6.90775527;}
89 h_[1] = beta2 *
kappa;
91 h_[3] = omega_ * 1.5707963250000001;
92 auto f1 = [h_](
double x){
return h_[0]+h_[1]*
std::log(h_[2]*x)-h_[3]*
x;};
95 d =
exp(kappa * (beta2 * (.57721566 - h5) + 1.)) * .31830988654751274;
98 a_[n - 1] = omega_ * .31830988654751274;
102 for (k = 1; k <
n; ++
k) {
110 xf1 = kappa * (beta2 * c1 - c4) - x * c2;
111 xf2 = x * c1 + kappa * (c3 + beta2 *
c2) +
t0_ * x;
113 d1 = q * d * omega_ *
exp(xf1);
114 a_[l - 1] = d1 *
cos(xf2);
115 b_[l - 1] = -d1 *
sin(xf2);
117 d1 = q * d *
exp(xf1)/
k;
118 a_[l - 1] = d1 *
sin(xf2);
119 b_[l - 1] = d1 *
cos(xf2);
120 a_[n - 1] += q2 *
a_[l - 1];
Sin< T >::type sin(const T &t)
int dzero(double a, double b, double &x0, double &rv, double eps, int mxf, F func)
Private version of the exponential integral.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
void sincosint(double x, double &sint, double &cint)
const int mode_
returns the limits on the non-zero (mode=0) or normalized region (mode=1)
static const G4double kappa
double expint(double x)
Private version of the sine integral.
double VVIObj::fcn |
( |
double |
x | ) |
const |
Vavilov function method Returns density fcn (mode=0) or distribution fcn (mode=1)
- Parameters
-
x | - (input) Argument of function [typically defined as (Q-mpv)/sigma] |
Definition at line 135 of file VVIObj.cc.
References a_, b_, funct::cos(), f, relval_steps::k, mode_, gen::n, omega_, funct::sin(), t0_, t1_, t_, x0_, and y.
Referenced by SiPixelTemplateSplit::PixelTempSplit().
139 double f, u,
y, a0, a1;
141 double b1, b0, b2, cof;
147 }
else if (
x <=
t1_) {
149 u =
omega_ * y - 3.141592653589793;
154 for (k = 2; k <= n1; ++
k) {
157 a0 =
a_[k - 1] + cof * a1 - a2;
161 for (k = 2; k <=
n; ++
k) {
164 b0 =
b_[k - 1] + cof * b1 - b2;
166 f = (a0 - a2) * .5 + b0 *
sin(u);
170 if (
mode_ != 0) {f = 1.;}
Sin< T >::type sin(const T &t)
Cos< T >::type cos(const T &t)
const int mode_
returns the limits on the non-zero (mode=0) or normalized region (mode=1)