1#include "CLHEP/GenericFunctions/VoigtProfile.hh"
2#include "CLHEP/GenericFunctions/Variable.hh"
6#if (defined __STRICT_ANSI__) || (defined _WIN32)
8#define M_PI 3.14159265358979323846
14inline double Pow(
double x,
int n) {
22inline std::complex<double>
nwwerf(std::complex<double> z) {
23 std::complex<double> zh,r[38],s,t,v;
26 const double hf = z1/2;
27 const double z10 = 10;
28 const double c1 = 74/z10;
29 const double c2 = 83/z10;
30 const double c3 = z10/32;
31 const double c4 = 16/z10;
32 const double c = 1.12837916709551257;
33 const double p =
Pow(2.0*c4,33);
37 double xa=(x >= 0) ? x : -x;
38 double ya=(y >= 0) ? y : -y;
39 if(ya < c1 && xa < c2){
40 zh = std::complex<double>(ya+c4,xa);
41 r[37]= std::complex<double>(0,0);
43 for(
int n = 36; n>0; n--){
44 t=zh+
double(n)*std::conj(r[n+1]);
45 r[n]=hf*t/std::norm(t);
48 s=std::complex<double>(0,0);
50 for(
int k=33; k>0; k--){
57 zh=std::complex<double>(ya,xa);
58 r[1]=std::complex<double>(0,0);
61 t=zh+
double(n)*std::conj(r[1]);
62 r[1]=hf*t/std::norm(t);
66 if(ya == 0) v= std::complex<double>(exp(-xa*xa),v.imag());
68 v=2.0*std::exp(std::complex<double>(-xa,-ya)*std::complex<double>(xa,ya))-v;
69 if(x > 0) v=std::conj(v);
72 if(x < 0) v=std::conj(v);
84 _mass("mass", 50, 10, 90),
85 _width ("width", 5, 0, 100),
86 _sigma("sigma", 5, 0, 100)
92 _width (right._width),
104 static const double sqrt2=sqrt(2.0);
105 static const double sqrt2PI=sqrt(2.0*M_PI);
106 static const std::complex<double> I(0,1);
107 std::complex<double> z = ((x-M) + I*G)/sqrt2/s;
109 double f=
nwwerf(z).real()/s/sqrt2PI;
#define FUNCTION_OBJECT_IMP(classname)
std::complex< double > nwwerf(std::complex< double > z)
double Pow(double x, int n)
virtual double getValue() const
virtual double operator()(double argument) const override