//-------------------------------------------------------------------------- // // // Copyright Information: See EvtGen/COPYRIGHT // // Environment: // This software is part of the EvtGen package developed jointly // for the BaBar and CLEO collaborations. If you use all or part // of it, please give an appropriate acknowledgement. // // Module: EvtBtoXsgammaFermiUtil.cc // // Description: // Class to hold various fermi functions and their helper functions. The // fermi functions are used in EvtBtoXsgammaKagan. // // Modification history: // // Jane Tinslay March 21, 2001 Module created //------------------------------------------------------------------------ #include "EvtGenBase/EvtPatches.hh" //----------------------- // This Class's Header -- //----------------------- #include "EvtGenModels/EvtBtoXsgammaFermiUtil.hh" #include "EvtGenModels/EvtItgTwoCoeffFcn.hh" #include "EvtGenModels/EvtBtoXsgammaRootFinder.hh" #include "EvtGenModels/EvtItgFunction.hh" #include "EvtGenBase/EvtConst.hh" #include "EvtGenBase/EvtReport.hh" //--------------- // C++ Headers -- //--------------- #include #include using std::endl; double EvtBtoXsgammaFermiUtil::FermiExpFunc(double y, const std::vector &coeffs) { //coeffs: 1 = lambdabar, 2 = a, 3 = lam1, 4 = norm // report(INFO,"EvtGen")< &coeffs) { //coeffs: 1 = lambdabar, 2 = a, 3 = c, 4 = norm return (pow(1. - (y/coeffs[1]),coeffs[2])*exp(-pow(coeffs[3],2.)*pow(1. - (y/coeffs[1]),2.)))/coeffs[4]; } double EvtBtoXsgammaFermiUtil::FermiGaussFuncRoot(double lambdabar, double lam1, double mb, std::vector &gammaCoeffs) { std::vector coeffs1(3); std::vector coeffs2(3); coeffs1[0]=0.2; coeffs1[1]=lambdabar; coeffs1[2]=0.0; coeffs2[0]=0.2; coeffs2[1]=lambdabar; coeffs2[2]=-lam1/3.; EvtItgTwoCoeffFcn *lhFunc = new EvtItgTwoCoeffFcn(&FermiGaussRootFcnA, -mb, lambdabar, coeffs1, gammaCoeffs); EvtItgTwoCoeffFcn *rhFunc = new EvtItgTwoCoeffFcn(&FermiGaussRootFcnB, -mb, lambdabar, coeffs2, gammaCoeffs); EvtBtoXsgammaRootFinder *rootFinder = new EvtBtoXsgammaRootFinder(); double root = rootFinder->GetGaussIntegFcnRoot(lhFunc, rhFunc, 1.0e-4, 1.0e-4, 40, 40, -mb, lambdabar, 0.2, 0.4, 1.0e-6); delete rootFinder; rootFinder=0; delete lhFunc; lhFunc=0; delete rhFunc; rhFunc=0; return root; } double EvtBtoXsgammaFermiUtil::FermiGaussRootFcnA(double y, const std::vector &coeffs1, const std::vector &coeffs2) { //coeffs1: 0=ap, 1=lambdabar, coeffs2=gamma function coeffs double cp = Gamma((2.0 + coeffs1[0])/2., coeffs2)/Gamma((1.0 + coeffs1[0])/2., coeffs2); return (y*y)*pow((1. - (y/coeffs1[1])),coeffs1[0])*exp(-pow(cp,2)*pow((1.-(y/coeffs1[1])),2.)); } double EvtBtoXsgammaFermiUtil::FermiGaussRootFcnB(double y, const std::vector &coeffs1, const std::vector &coeffs2) { //coeffs1: 0=ap, 1=lambdabar, coeffs2=gamma function coeffs double cp = Gamma((2.0 + coeffs1[0])/2., coeffs2)/Gamma((1.0 + coeffs1[0])/2., coeffs2); return pow((1. - (y/coeffs1[1])),coeffs1[0])*exp(-pow(cp,2)*pow((1.-(y/coeffs1[1])),2.)); } double EvtBtoXsgammaFermiUtil::Gamma(double z, const std::vector &coeffs) { //Lifted from Numerical Recipies in C double x, y, tmp, ser; int j; y = z; x = z; tmp = x + 5.5; tmp = tmp - (x+0.5)*log(tmp); ser=1.000000000190015; for (j=0;j<6;j++) { y = y +1.0; ser = ser + coeffs[j]/y; } return exp(-tmp+log(2.5066282746310005*ser/x)); } double EvtBtoXsgammaFermiUtil::BesselK1(double x) { //Lifted from Numerical Recipies in C : Returns the modified Bessel //function K_1(x) for positive real x if (x<0.0) report(INFO,"EvtGen") <<"x is negative !"<GetRootSingleFunc(lhFunc, rhSide, 0.1, 0.4, 1.0e-6); //rho=0.250353; report(INFO,"EvtGen")<<"rho/2 "< &coeffs) { if (y == (coeffs[1]-coeffs[2])) y=0.99999999*(coeffs[1]-coeffs[2]); //coeffs: 1 = mB, 2=mb, 3=rho, 4=lambdabar, 5=norm double pF = coeffs[4]*sqrt(EvtConst::pi)/(coeffs[3]*exp(coeffs[3]/2.)*BesselK1(coeffs[3]/2.)); // report(INFO,"EvtGen")<<" pf "<