#include <EvtBtoXsgammaFermiUtil.hh>
Public Member Functions | |
EvtBtoXsgammaFermiUtil () | |
virtual | ~EvtBtoXsgammaFermiUtil () |
Static Public Member Functions | |
static double | FermiExpFunc (double var, const std::vector< double > &coeffs) |
static double | FermiGaussFunc (double, std::vector< double > const &coeffs) |
static double | FermiGaussFuncRoot (double, double, double, std::vector< double > &coeffs) |
static double | FermiGaussRootFcnA (double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2) |
static double | FermiGaussRootFcnB (double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2) |
static double | Gamma (double, const std::vector< double > &coeffs) |
static double | BesselI1 (double) |
static double | BesselK1 (double) |
static double | FermiRomanFuncRoot (double, double) |
static double | FermiRomanRootFcnA (double) |
static double | FermiRomanFunc (double, std::vector< double > const &coeffs) |
Definition at line 28 of file EvtBtoXsgammaFermiUtil.hh.
EvtBtoXsgammaFermiUtil::EvtBtoXsgammaFermiUtil | ( | ) | [inline] |
virtual EvtBtoXsgammaFermiUtil::~EvtBtoXsgammaFermiUtil | ( | ) | [inline, virtual] |
double EvtBtoXsgammaFermiUtil::BesselI1 | ( | double | ) | [static] |
Definition at line 142 of file EvtBtoXsgammaFermiUtil.cc.
References exp().
Referenced by BesselK1().
00142 { 00143 //Lifted from Numerical Recipies in C : Returns the modified Bessel 00144 //function I_1(x) for any real x 00145 00146 double ax, ans; 00147 double y; 00148 00149 if ((ax=fabs(x)) < 3.75) { 00150 y=x/3.75; 00151 y*=y; 00152 ans=ax*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934+y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))))); 00153 } 00154 else { 00155 y=3.75/ax; 00156 ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1 -y*0.420059e-2)); 00157 ans=0.398914228+y*(-0.3988024e-1+y*(-0.362018e-2+y*(0.163801e-2+y*(-0.1031555e-1+y*ans)))); 00158 ans*=(exp(ax)/sqrt(ax)); 00159 } 00160 return x < 0.0 ? -ans:ans; 00161 }
double EvtBtoXsgammaFermiUtil::BesselK1 | ( | double | ) | [static] |
Definition at line 122 of file EvtBtoXsgammaFermiUtil.cc.
References BesselI1(), exp(), Bes_Common::INFO, and report().
Referenced by FermiRomanFunc(), FermiRomanFuncRoot(), and FermiRomanRootFcnA().
00122 { 00123 00124 //Lifted from Numerical Recipies in C : Returns the modified Bessel 00125 //function K_1(x) for positive real x 00126 if (x<0.0) report(INFO,"EvtGen") <<"x is negative !"<<endl; 00127 00128 double y, ans; 00129 00130 if (x <= 2.0) { 00131 y=x*x/4.0; 00132 ans = (log(x/2.0)*BesselI1(x))+(1.0/x)*(1.0+y*(0.15443144+y*(-0.67278579+y*(-0.18156897+y*(-0.1919402e-1+y*(-0.110404e-2+y*(-0.4686e-4))))))); 00133 } 00134 else { 00135 y=2.0/x; 00136 ans=(exp(-x)/sqrt(x))*(1.25331414+y*(0.23498619+y*(-0.3655620e-1+y*(0.1504268e-1+y*(-0.780353e-2+y*(0.325614e-2+y*(-0.68245e-3))))))); 00137 } 00138 return ans; 00139 00140 }
double EvtBtoXsgammaFermiUtil::FermiExpFunc | ( | double | var, | |
const std::vector< double > & | coeffs | |||
) | [static] |
Definition at line 40 of file EvtBtoXsgammaFermiUtil.cc.
References exp().
Referenced by EvtBtoXsgammaKagan::computeHadronicMass(), and EvtBtoXsgammaKagan::FermiFunc().
00040 { 00041 00042 //coeffs: 1 = lambdabar, 2 = a, 3 = lam1, 4 = norm 00043 // report(INFO,"EvtGen")<<coeffs[4]<<endl; 00044 return (pow(1. - (y/coeffs[1]),coeffs[2])*exp((-3.*pow(coeffs[1],2.)/coeffs[3])*y/coeffs[1]))/coeffs[4]; 00045 00046 }
double EvtBtoXsgammaFermiUtil::FermiGaussFunc | ( | double | , | |
std::vector< double > const & | coeffs | |||
) | [static] |
Definition at line 48 of file EvtBtoXsgammaFermiUtil.cc.
References exp().
Referenced by EvtBtoXsgammaKagan::computeHadronicMass(), and EvtBtoXsgammaKagan::FermiFunc().
00048 { 00049 00050 //coeffs: 1 = lambdabar, 2 = a, 3 = c, 4 = norm 00051 return (pow(1. - (y/coeffs[1]),coeffs[2])*exp(-pow(coeffs[3],2.)*pow(1. - (y/coeffs[1]),2.)))/coeffs[4]; 00052 00053 }
double EvtBtoXsgammaFermiUtil::FermiGaussFuncRoot | ( | double | , | |
double | , | |||
double | , | |||
std::vector< double > & | coeffs | |||
) | [static] |
Definition at line 55 of file EvtBtoXsgammaFermiUtil.cc.
References FermiGaussRootFcnA(), FermiGaussRootFcnB(), EvtBtoXsgammaRootFinder::GetGaussIntegFcnRoot(), and root.
Referenced by EvtBtoXsgammaKagan::computeHadronicMass().
00055 { 00056 00057 std::vector<double> coeffs1(3); 00058 std::vector<double> coeffs2(3); 00059 00060 coeffs1[0]=0.2; 00061 coeffs1[1]=lambdabar; 00062 coeffs1[2]=0.0; 00063 00064 coeffs2[0]=0.2; 00065 coeffs2[1]=lambdabar; 00066 coeffs2[2]=-lam1/3.; 00067 00068 EvtItgTwoCoeffFcn *lhFunc = new EvtItgTwoCoeffFcn(&FermiGaussRootFcnA, -mb, lambdabar, coeffs1, gammaCoeffs); 00069 EvtItgTwoCoeffFcn *rhFunc = new EvtItgTwoCoeffFcn(&FermiGaussRootFcnB, -mb, lambdabar, coeffs2, gammaCoeffs); 00070 00071 EvtBtoXsgammaRootFinder *rootFinder = new EvtBtoXsgammaRootFinder(); 00072 00073 double root = rootFinder->GetGaussIntegFcnRoot(lhFunc, rhFunc, 1.0e-4, 1.0e-4, 40, 40, -mb, lambdabar, 0.2, 0.4, 1.0e-6); 00074 00075 delete rootFinder; rootFinder=0; 00076 delete lhFunc; lhFunc=0; 00077 delete rhFunc; rhFunc=0; 00078 return root; 00079 00080 }
double EvtBtoXsgammaFermiUtil::FermiGaussRootFcnA | ( | double | , | |
const std::vector< double > & | coeffs1, | |||
const std::vector< double > & | coeffs2 | |||
) | [static] |
Definition at line 82 of file EvtBtoXsgammaFermiUtil.cc.
References exp(), and Gamma().
Referenced by FermiGaussFuncRoot().
00082 { 00083 00084 00085 //coeffs1: 0=ap, 1=lambdabar, coeffs2=gamma function coeffs 00086 double cp = Gamma((2.0 + coeffs1[0])/2., coeffs2)/Gamma((1.0 + coeffs1[0])/2., coeffs2); 00087 00088 return (y*y)*pow((1. - (y/coeffs1[1])),coeffs1[0])*exp(-pow(cp,2)*pow((1.-(y/coeffs1[1])),2.)); 00089 00090 }
double EvtBtoXsgammaFermiUtil::FermiGaussRootFcnB | ( | double | , | |
const std::vector< double > & | coeffs1, | |||
const std::vector< double > & | coeffs2 | |||
) | [static] |
Definition at line 92 of file EvtBtoXsgammaFermiUtil.cc.
References exp(), and Gamma().
Referenced by FermiGaussFuncRoot().
00092 { 00093 00094 //coeffs1: 0=ap, 1=lambdabar, coeffs2=gamma function coeffs 00095 double cp = Gamma((2.0 + coeffs1[0])/2., coeffs2)/Gamma((1.0 + coeffs1[0])/2., coeffs2); 00096 return pow((1. - (y/coeffs1[1])),coeffs1[0])*exp(-pow(cp,2)*pow((1.-(y/coeffs1[1])),2.)); 00097 00098 }
double EvtBtoXsgammaFermiUtil::FermiRomanFunc | ( | double | , | |
std::vector< double > const & | coeffs | |||
) | [static] |
Definition at line 187 of file EvtBtoXsgammaFermiUtil.cc.
References BesselK1(), exp(), and EvtConst::pi.
Referenced by EvtBtoXsgammaKagan::computeHadronicMass(), and EvtBtoXsgammaKagan::FermiFunc().
00187 { 00188 if (y == (coeffs[1]-coeffs[2])) y=0.99999999*(coeffs[1]-coeffs[2]); 00189 00190 //coeffs: 1 = mB, 2=mb, 3=rho, 4=lambdabar, 5=norm 00191 double pF = coeffs[4]*sqrt(EvtConst::pi)/(coeffs[3]*exp(coeffs[3]/2.)*BesselK1(coeffs[3]/2.)); 00192 // report(INFO,"EvtGen")<<" pf "<<y<<" "<<pF<<" "<<coeffs[1]<<" "<<coeffs[2]<<" "<<coeffs[3]<<" "<<coeffs[4]<<" "<<coeffs[5]<<endl; 00193 //double pF=0.382533; 00194 00195 //report(INFO,"EvtGen")<<(coeffs[1]-coeffs[2])*(1./(sqrt(EvtConst::pi)*pF))<<endl; 00196 //report(INFO,"EvtGen")<<(1.-y/(coeffs[1]-coeffs[2]))<<endl; 00197 //report(INFO,"EvtGen")<<(coeffs[1]-coeffs[2])<<endl; 00198 //report(INFO,"EvtGen")<<(coeffs[1]-coeffs[2])*(1.-y/(coeffs[1]-coeffs[2]))<<endl; 00199 00200 //report(INFO,"EvtGen")<<" "<<pF*coeffs[3]/((coeffs[1]-coeffs[2])*(1.-y/(coeffs[1]-coeffs[2])))<<endl; 00201 // report(INFO,"EvtGen")<<" "<<((coeffs[1]-coeffs[2])/pF)*(1. -y/(coeffs[1]-coeffs[2]))<<endl; 00202 00203 //report(INFO,"EvtGen")<<"result "<<(coeffs[1]-coeffs[2])*(1./(sqrt(EvtConst::pi)*pF))*exp(-(1./4.)*pow(pF*(coeffs[3]/((coeffs[1]-coeffs[2])*(1.-y/(coeffs[1]-coeffs[2])))) - ((coeffs[1]-coeffs[2])/pF)*(1. -y/(coeffs[1]-coeffs[2])),2.))/coeffs[5]; 00204 00205 //report(INFO,"EvtGen")<<"leaving"<<endl; 00206 return (coeffs[1]-coeffs[2])*(1./(sqrt(EvtConst::pi)*pF))*exp(-(1./4.)*pow(pF*(coeffs[3]/((coeffs[1]-coeffs[2])*(1.-y/(coeffs[1]-coeffs[2])))) - ((coeffs[1]-coeffs[2])/pF)*(1. -y/(coeffs[1]-coeffs[2])),2.))/coeffs[5]; 00207 00208 00209 }
double EvtBtoXsgammaFermiUtil::FermiRomanFuncRoot | ( | double | , | |
double | ||||
) | [static] |
Definition at line 163 of file EvtBtoXsgammaFermiUtil.cc.
References BesselK1(), exp(), FermiRomanRootFcnA(), EvtBtoXsgammaRootFinder::GetRootSingleFunc(), Bes_Common::INFO, EvtConst::pi, and report().
Referenced by EvtBtoXsgammaKagan::computeHadronicMass().
00163 { 00164 00165 EvtItgFunction *lhFunc = new EvtItgFunction(&FermiRomanRootFcnA, -1.e-6, 1.e6); 00166 00167 EvtBtoXsgammaRootFinder *rootFinder = new EvtBtoXsgammaRootFinder(); 00168 double rhSide = 1.0 - (lam1/(3.0*lambdabar*lambdabar)); 00169 00170 double rho = rootFinder->GetRootSingleFunc(lhFunc, rhSide, 0.1, 0.4, 1.0e-6); 00171 //rho=0.250353; 00172 report(INFO,"EvtGen")<<"rho/2 "<<rho/2.<<" bessel "<<BesselK1(rho/2.)<<endl; 00173 double pF = lambdabar*sqrt(EvtConst::pi)/(rho*exp(rho/2.)*BesselK1(rho/2.)); 00174 report(INFO,"EvtGen")<<"rho "<<rho<<" pf "<<pF<<endl; 00175 00176 delete lhFunc; lhFunc=0; 00177 delete rootFinder; rootFinder=0; 00178 return rho; 00179 00180 }
double EvtBtoXsgammaFermiUtil::FermiRomanRootFcnA | ( | double | ) | [static] |
Definition at line 182 of file EvtBtoXsgammaFermiUtil.cc.
References BesselK1(), exp(), and EvtConst::pi.
Referenced by FermiRomanFuncRoot().
00182 { 00183 00184 return EvtConst::pi*(2. + y)*pow(y,-2.)*exp(-y)*pow(BesselK1(y/2.),-2.); 00185 00186 }
double EvtBtoXsgammaFermiUtil::Gamma | ( | double | , | |
const std::vector< double > & | coeffs | |||
) | [static] |
Definition at line 100 of file EvtBtoXsgammaFermiUtil.cc.
References exp(), ganga-rec::j, and x.
Referenced by EvtBtoXsgammaKagan::computeHadronicMass(), FermiGaussRootFcnA(), and FermiGaussRootFcnB().
00100 { 00101 00102 //Lifted from Numerical Recipies in C 00103 double x, y, tmp, ser; 00104 00105 int j; 00106 y = z; 00107 x = z; 00108 00109 tmp = x + 5.5; 00110 tmp = tmp - (x+0.5)*log(tmp); 00111 ser=1.000000000190015; 00112 00113 for (j=0;j<6;j++) { 00114 y = y +1.0; 00115 ser = ser + coeffs[j]/y; 00116 } 00117 00118 return exp(-tmp+log(2.5066282746310005*ser/x)); 00119 00120 }