42 cout <<
" max pdf : "<<_gmax<<endl;
43 cout <<
" efficiency : "<<(float)_ngood/(
float)_ntot<<endl;
77 report(
ERROR,
"EvtGen") <<
"EvtVubNLO generator expected "
78 <<
" at least npar arguments but found: "
80 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
92 _masses =
new double[_nbins];
93 _weights =
new double[_nbins];
98 std::vector<double> sCoeffs(11);
103 sCoeffs[7] = lambda_SF();
107 _SFNorm = SFNorm(sCoeffs) ;
110 cout <<
" pdf 0.66, 1.32 , 4.32 "<<tripleDiff(0.66, 1.32 , 4.32)<<endl;
111 cout <<
" pdf 0.23,0.37,3.76 "<<tripleDiff(0.23,0.37,3.76)<<endl;
112 cout <<
" pdf 0.97,4.32,4.42 "<<tripleDiff(0.97,4.32,4.42)<<endl;
113 cout <<
" pdf 0.52,1.02,2.01 "<<tripleDiff(0.52,1.02,2.01)<<endl;
114 cout <<
" pdf 1.35,1.39,2.73 "<<tripleDiff(1.35,1.39,2.73)<<endl;
117 if (
getNArg()-npar+2 != 2*_nbins) {
118 report(
ERROR,
"EvtGen") <<
"EvtVubNLO generator expected "
119 << _nbins <<
" masses and weights but found: "
121 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
126 for (i=0;i<_nbins;i++) {
128 if (i>0 && _masses[i] <= _masses[i-1]) {
129 report(
ERROR,
"EvtGen") <<
"EvtVubNLO generator expected "
130 <<
" mass bins in ascending order!"
131 <<
"Will terminate execution!"<<endl;
134 _weights[i] =
getArg(j++);
135 if (_weights[i] < 0) {
136 report(
ERROR,
"EvtGen") <<
"EvtVubNLO generator expected "
137 <<
" weights >= 0, but found: "
138 <<_weights[i] <<endl;
139 report(
ERROR,
"EvtGen") <<
"Will terminate execution!"<<endl;
142 if ( _weights[i] > maxw ) maxw = _weights[i];
145 report(
ERROR,
"EvtGen") <<
"EvtVubNLO generator expected at least one "
146 <<
" weight > 0, but found none! "
147 <<
"Will terminate execution!"<<endl;
150 for (i=0;i<_nbins;i++) _weights[i]/=maxw;
181 double pp,pm,pl,ml,El(0.0),Eh(0.0),sh(0.0);
199 pm= pow(pm,1./3.)*_mB;
213 if (pp<pl && El>ml&& sh > _masses[0]*_masses[0]&& _mB*_mB + sh - 2*_mB*Eh > ml*ml) {
215 pdf = tripleDiff(pp,pl,pm);
218 report(
ERROR,
"EvtGen") <<
"EvtVubNLO pdf above maximum: " <<pdf
219 <<
" P+,P-,Pl,Pdf= "<<pp <<
" "<<pm<<
" "<<pl<<
" "<<pdf<<endl;
223 if ( pdf >= xran ) tryit =
false;
225 if(pdf>_gmax)_gmax=pdf;
232 if(!tryit && _nbins>0){
235 double m = sqrt(sh);j=0;
236 while ( j < _nbins && m > _masses[j] ) j++;
237 double w = _weights[j-1];
238 if ( w < xran1 ) tryit =
true;
261 sttmp = sqrt(1-ctH*ctH);
262 ptmp = sqrt(Eh*Eh-sh);
263 double pHB[4] = {Eh,ptmp*sttmp*
cos(phH),ptmp*sttmp*
sin(phH),ptmp*ctH};
264 p4.
set(pHB[0],pHB[1],pHB[2],pHB[3]);
271 double pWB[4] = {_mB-Eh,-pHB[1],-pHB[2],-pHB[3]};
276 double mW2 = _mB*_mB + sh - 2*_mB*Eh;
280 double beta = ptmp/pWB[0];
281 double gamma = pWB[0]/sqrt(mW2);
285 ptmp = (mW2-ml*ml)/2/sqrt(mW2);
286 pLW[0] = sqrt(ml*ml + ptmp*ptmp);
288 double ctL = (El - gamma*pLW[0])/beta/gamma/ptmp;
289 if ( ctL < -1 ) ctL = -1;
290 if ( ctL > 1 ) ctL = 1;
291 sttmp = sqrt(1-ctL*ctL);
294 double xW[3] = {-pWB[2],pWB[1],0};
296 double zW[3] = {pWB[1]/apWB,pWB[2]/apWB,pWB[3]/apWB};
298 double lx = sqrt(xW[0]*xW[0]+xW[1]*xW[1]);
303 double yW[3] = {-pWB[1]*pWB[3],-pWB[2]*pWB[3],pWB[1]*pWB[1]+pWB[2]*pWB[2]};
304 double ly = sqrt(yW[0]*yW[0]+yW[1]*yW[1]+yW[2]*yW[2]);
312 pLW[j+1] = sttmp*
cos(phL)*ptmp*xW[j]
313 + sttmp*
sin(phL)*ptmp*yW[j]
320 double appLB = beta*gamma*pLW[0] + gamma*ctL*apLW;
322 ptmp = sqrt(El*El-ml*ml);
323 double ctLL = appLB/ptmp;
325 if ( ctLL > 1 ) ctLL = 1;
326 if ( ctLL < -1 ) ctLL = -1;
328 double pLB[4] = {El,0,0,0};
329 double pNB[8] = {pWB[0]-El,0,0,0};
332 pLB[j] = pLW[j] + (ctLL*ptmp - ctL*apLW)/apWB*pWB[j];
333 pNB[j] = pWB[j] - pLB[j];
336 p4.
set(pLB[0],pLB[1],pLB[2],pLB[3]);
339 p4.
set(pNB[0],pNB[1],pNB[2],pNB[3]);
346EvtVubNLO::tripleDiff (
double pp,
double pl,
double pm){
348 std::vector<double> sCoeffs(11);
356 sCoeffs[7] = lambda_SF();
359 sCoeffs[10] = _SFNorm;
362 double c1=(_mB+pl-pp-pm)*(pm-pl);
363 double c2=2*(pl-pp)*(pm-pl);
364 double c3=(_mB-pm)*(pm-pp);
365 double aF1=F10(sCoeffs);
366 double aF2=F20(sCoeffs);
367 double aF3=F30(sCoeffs);
368 double td0=
c1*aF1+c2*aF2+c3*aF3;
373 double smallfrac=0.000001;
374 double tdInt = jetSF->
evaluate(0,pp*(1-smallfrac));
377 double SU=U1lo(mu_h(),mu_i())*pow((pm-pp)/(_mB-pp),alo(mu_h(),mu_i()));
378 double TD=(_mB-pp)*SU*(td0+tdInt);
385EvtVubNLO::integrand(
double omega,
const std::vector<double> &coeffs){
387 double c1=(coeffs[5]+coeffs[1]-coeffs[0]-coeffs[2])*(coeffs[2]-coeffs[1]);
388 double c2=2*(coeffs[1]-coeffs[0])*(coeffs[2]-coeffs[1]);
389 double c3=(coeffs[5]-coeffs[2])*(coeffs[2]-coeffs[0]);
391 return c1*F1Int(omega,coeffs)+c2*F2Int(omega,coeffs)+c3*F3Int(omega,coeffs);
395EvtVubNLO::F10(
const std::vector<double> &coeffs){
397 double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
398 double mui=coeffs[9];
399 double muh=coeffs[8];
401 double result= U1nlo(muh,mui)/ U1lo(muh,mui);
403 result += anlo(muh,mui)*log(y);
405 result += C_F(muh)*(-4*pow(log(y*coeffs[4]/muh),2)+10*log(y*coeffs[4]/muh)-4*log(y)-2*log(y)/(1-y)-4.0*
ddilog_(&z)-pow(
EvtConst::pi,2)/6.-12 );
407 result += C_F(mui)*(2*pow(log(y*coeffs[4]*pp/pow(mui,2)),2)-3*log(y*coeffs[4]*pp/pow(mui,2))+7-pow(
EvtConst::pi,2) );
408 result *=shapeFunction(pp,coeffs);
410 result += (-subS(coeffs)+2*subT(coeffs)+(subU(coeffs)-subV(coeffs))*(1/y-1.))/(coeffs[5]-pp);
411 result += shapeFunction(pp,coeffs)/pow((coeffs[5]-coeffs[0]),2)*(-5*(lambda1()+3*lambda2())/6+2*(2*lambda1()/3-lambda2())/pow(y,2));
420EvtVubNLO::F1Int(
double omega,
const std::vector<double> &coeffs){
422 double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
424 return C_F(coeffs[9])*(
425 (shapeFunction(omega,coeffs)-shapeFunction(pp,coeffs))*(4*log(y*coeffs[4]*(pp-omega)/pow(coeffs[9],2))-3)/(pp-omega)+
426 (
g1(y,(pp-omega)/(coeffs[5]-coeffs[0]))/(coeffs[5]-pp)*shapeFunction(omega,coeffs))
431EvtVubNLO::F20(
const std::vector<double> &coeffs){
433 double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
434 double result= C_F(coeffs[8])*log(y)/(1-y)*shapeFunction(pp,coeffs)-
435 1/y*(subS(coeffs)+2*subT(coeffs)-(subT(coeffs)+subV(coeffs))/y)/(coeffs[5]-pp);
437 result += shapeFunction(pp,coeffs)/pow((coeffs[5]-coeffs[0])*y,2)*(2*lambda1()/3+4*lambda2()-y*(7/6*lambda1()+3*lambda2()));
442EvtVubNLO::F2Int(
double omega,
const std::vector<double> &coeffs){
444 double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
445 return C_F(coeffs[9])*g3(y,(pp-omega)/(coeffs[5]-coeffs[0]))*shapeFunction(omega,coeffs)/(coeffs[5]-pp);
449EvtVubNLO::F30(
const std::vector<double> &coeffs){
450 double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
451 return shapeFunction(coeffs[0],coeffs)/pow((coeffs[5]-coeffs[0])*y,2)*(-2*lambda1()/3+lambda2());
455EvtVubNLO::F3Int(
double omega,
const std::vector<double> &coeffs){
457 double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
458 return C_F(coeffs[9])*g3(y,(pp-omega)/(coeffs[5]-coeffs[0]))/2*shapeFunction(omega,coeffs)/(coeffs[2]-coeffs[0]);
462EvtVubNLO::g1(
double y,
double x){
463 double result=(y*(-9+10*y)+
x*
x*(-12+13*y)+2*
x*(-8+6*y+3*y*y))/y/pow(1+x,2)/(
x+y);
464 result -= 4*log((1+1/x)*y)/
x;
465 result -=2*log(1+y/x)*(3*pow(x,4)*(-2+y)-2*pow(y,3)-4*pow(x,3)*(2+y)-2*x*y*y*(4+y)-
x*
x*y*(12+4*y+y*y))/
x/pow((1+x)*y,2)/(
x+y);
470EvtVubNLO::g2(
double y,
double x){
471 double result=y*(10*pow(x,4)+y*y+3*
x*
x*y*(10+y)+pow(x,3)*(12+19*y)+x*y*(8+4*y+y*y));
472 result -= 2*
x*log(1+y/x)*(5*pow(x,4)+2*y*y+6*pow(x,3)*(1+2*y)+4*y*x*(1+2*y)+
x*
x*y*(18+5*y));
473 result *= 2/(pow(y*(1+x),2)*y*(
x+y));
478EvtVubNLO::g3(
double y,
double x){
479 double result=(2*pow(y,3)*(-11+2*y)-10*pow(x,4)*(6-6*y+y*y)+x*y*y*(-94+29*y+2*y*y)+2*
x*
x*y*(-72+18*y+13*y*y)-pow(x,3)*(72+42*y-70*y*y+3*pow(y,3)))/(pow(y*(1+x),2)*y*(
x+y));
480 result += 2*log(1+y/x)*(-6*
x*pow(y,3)*(-5+y)+4*pow(y,4)+5*pow(x,5)*(6-6*y+y*y)-4*pow(x*y,2)*(-20+6*y+y*y)+pow(x,3)*y*(90-10*y-28*y*y+pow(y,3))+pow(x,4)*(36+36*y-50*y*y+4*pow(y,3)))/(pow((1+x)*y*y,2)*(
x+y));
511double EvtVubNLO::SFNorm(
const std::vector<double> &coeffs){
516 return M0(mu_i(),omega0)*pow(_b,_b)/lambda_SF()/ (Gamma(_b)-Gamma(_b,_b*omega0/lambda_SF()));
519 return M0(mu_i(),omega0)*2/lambda_SF()/pow(c,-(1+_b)/2.)/
520 (Gamma((1+_b)/2)-Gamma((1+_b)/2,pow(omega0/lambda_SF(),2)*c));
522 report(
ERROR,
"EvtGen") <<
"unknown SF "<<_idSF<<endl;
528EvtVubNLO::shapeFunction (
double omega,
const std::vector<double> &sCoeffs){
530 return sCoeffs[10]*expShapeFunction(omega, sCoeffs);
531 }
else if( sCoeffs[6]==2) {
532 return sCoeffs[10]*gausShapeFunction(omega, sCoeffs);
534 report(
ERROR,
"EvtGen") <<
"EvtVubNLO : unknown shape function # "
543EvtVubNLO::subS(
const std::vector<double> &c){
return (lambda_bar(1.68)-c[0])*shapeFunction(c[0],c);}
545EvtVubNLO::subT(
const std::vector<double> &c){
return -3*lambda2()*subS(c)/mu_pi2(1.68);}
547EvtVubNLO::subU(
const std::vector<double> &c){
return -2*subS(c);}
549EvtVubNLO::subV(
const std::vector<double> &c){
return -subT(c);}
553EvtVubNLO::lambda_bar(
double omega0){
556 double rat=omega0*_b/lambda_SF();
557 _lbar=lambda_SF()/_b*(Gamma(1+_b)-Gamma(1+_b,rat))/(Gamma(_b)-Gamma(_b,rat));
560 _lbar=lambda_SF()*(Gamma(1+_b/2)-Gamma(1+_b/2,pow(omega0/lambda_SF(),2)*c))/(Gamma((1+_b)/2)-Gamma((1+_b)/2,pow(omega0/lambda_SF(),2)*c))/sqrt(c);
568EvtVubNLO::mu_pi2(
double omega0){
571 double rat=omega0*_b/lambda_SF();
572 _mupi2= 3*(pow(lambda_SF()/_b,2)*(Gamma(2+_b)-Gamma(2+_b,rat))/(Gamma(_b)-Gamma(_b,rat))-pow(lambda_bar(omega0),2));
575 double m1=Gamma((3+_b)/2)-Gamma((3+_b)/2,pow(omega0/lambda_SF(),2)*c);
576 double m2=Gamma(1+_b/2)-Gamma(1+_b/2,pow(omega0/lambda_SF(),2)*c);
577 double m3=Gamma((1+_b)/2)-Gamma((1+_b)/2,pow(omega0/lambda_SF(),2)*c);
578 _mupi2= 3*pow(lambda_SF(),2)*(m1/m3-pow(m2/m3,2))/c;
585EvtVubNLO::M0(
double mui,
double omega0){
586 double mf=omega0-lambda_bar(omega0);
587 return 1+4*C_F(mui)*(-pow(log(mf/mui),2)-log(mf/mui)-pow(
EvtConst::pi/2,2)/6.+mu_pi2(omega0)/3/pow(mf,2)*(log(mf/mui)-0.5));
591EvtVubNLO::alphas(
double mu){
592 double Lambda4=0.302932;
593 double lg=2*log(mu/Lambda4);
594 return 4*
EvtConst::pi/lg/beta0()*(1-beta1()*log(lg)/pow(beta0(),2)/lg+pow(beta1()/lg,2)/pow(beta0(),4)*(pow(log(lg)-0.5,2)-1.25+beta2()*beta0()/pow(beta1(),2)));
598EvtVubNLO::gausShapeFunction (
double omega,
const std::vector<double> &sCoeffs){
603 return pow(wL,b)*
exp(-cGaus(b)*wL*wL);
607EvtVubNLO::expShapeFunction (
double omega,
const std::vector<double> &sCoeffs){
612 return pow(wL,b-1)*
exp(-b*wL);
616EvtVubNLO::Gamma(
double z) {
618 std::vector<double> gammaCoeffs(6);
619 gammaCoeffs[0]=76.18009172947146;
620 gammaCoeffs[1]=-86.50532032941677;
621 gammaCoeffs[2]=24.01409824083091;
622 gammaCoeffs[3]=-1.231739572450155;
623 gammaCoeffs[4]=0.1208650973866179e-2;
624 gammaCoeffs[5]=-0.5395239384953e-5;
627 double x, y, tmp, ser;
634 tmp = tmp - (
x+0.5)*log(tmp);
635 ser=1.000000000190015;
639 ser = ser + gammaCoeffs[j]/y;
642 return exp(-tmp+log(2.5066282746310005*ser/x));
649EvtVubNLO::Gamma(
double z,
double tmin) {
650 std::vector<double> c(1);
double sin(const BesAngle a)
double cos(const BesAngle a)
EvtComplex exp(const EvtComplex &c)
double abs(const EvtComplex &c)
ostream & report(Severity severity, const char *facility)
double ddilog_(const double *)
double ddilog_(const double &sh)
void checkNDaug(int d1, int d2=-1)
double evaluate(double lower, double upper) const
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void set(int i, double d)
void getName(std::string &name)
void decay(EvtParticle *p)