46 cout <<
" max pdf : " <<
_gmax << endl;
47 cout <<
" efficiency : " << (float)
_ngood / (
float)
_ntot << endl;
73 <<
"EvtVubNLO generator expected " 74 <<
" at least npar arguments but found: " <<
getNArg() << endl;
76 <<
"Will terminate execution!" << endl;
94 std::vector<double> sCoeffs( 11 );
105 cout <<
" pdf 0.66, 1.32 , 4.32 " <<
tripleDiff( 0.66, 1.32, 4.32 ) << endl;
106 cout <<
" pdf 0.23,0.37,3.76 " <<
tripleDiff( 0.23, 0.37, 3.76 ) << endl;
107 cout <<
" pdf 0.97,4.32,4.42 " <<
tripleDiff( 0.97, 4.32, 4.42 ) << endl;
108 cout <<
" pdf 0.52,1.02,2.01 " <<
tripleDiff( 0.52, 1.02, 2.01 ) << endl;
109 cout <<
" pdf 1.35,1.39,2.73 " <<
tripleDiff( 1.35, 1.39, 2.73 ) << endl;
113 <<
"EvtVubNLO generator expected " <<
_weights.size()
114 <<
" masses and weights but found: " << (
getNArg() - npar ) / 2
117 <<
"Will terminate execution!" << endl;
122 for (
unsigned i = 0; i <
_masses.size(); i++ ) {
126 <<
"EvtVubNLO generator expected " 127 <<
" mass bins in ascending order!" 128 <<
"Will terminate execution!" << endl;
134 <<
"EvtVubNLO generator expected " 135 <<
" weights >= 0, but found: " <<
_weights[i] << endl;
137 <<
"Will terminate execution!" << endl;
145 <<
"EvtVubNLO generator expected at least one " 146 <<
" weight > 0, but found none! " 147 <<
"Will terminate execution!" << endl;
178 double pp, pm, pl, ml, El( 0.0 ), Eh( 0.0 ), sh( 0.0 );
194 pm = pow( pm, 1. / 3. ) *
_mB;
197 pl = sqrt( pl ) * pm;
203 El = (
_mB - pl ) / 2.;
204 Eh = ( pp + pm ) / 2;
209 _mB *
_mB + sh - 2 *
_mB * Eh > ml * ml ) {
215 <<
"EvtVubNLO pdf above maximum: " << pdf
216 <<
" P+,P-,Pl,Pdf= " << pp <<
" " << pm <<
" " << pl <<
" " 230 if ( !tryit && !
_weights.empty() ) {
233 double m = sqrt( sh );
262 sttmp = sqrt( 1 - ctH * ctH );
263 ptmp = sqrt( Eh * Eh - sh );
264 double pHB[4] = {Eh, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
266 p4.
set( pHB[0], pHB[1], pHB[2], pHB[3] );
272 double pWB[4] = {
_mB - Eh, -pHB[1], -pHB[2], -pHB[3]};
277 double mW2 =
_mB *
_mB + sh - 2 *
_mB * Eh;
281 double beta = ptmp / pWB[0];
282 double gamma = pWB[0] / sqrt( mW2 );
286 ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
287 pLW[0] = sqrt( ml * ml + ptmp * ptmp );
289 double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
294 sttmp = sqrt( 1 - ctL * ctL );
297 double xW[3] = {-pWB[2], pWB[1], 0};
299 double zW[3] = {pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB};
301 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
302 for (
int j = 0; j < 2; j++ )
306 double yW[3] = {-pWB[1] * pWB[3], -pWB[2] * pWB[3],
307 pWB[1] * pWB[1] + pWB[2] * pWB[2]};
308 double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
309 for (
int j = 0; j < 3; j++ )
315 for (
int j = 0; j < 3; j++ )
316 pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
317 sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
323 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
325 ptmp = sqrt( El * El - ml * ml );
326 double ctLL = appLB / ptmp;
333 double pLB[4] = {El, 0, 0, 0};
334 double pNB[8] = {pWB[0] - El, 0, 0, 0};
336 for (
int j = 1; j < 4; j++ ) {
337 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
338 pNB[j] = pWB[j] - pLB[j];
341 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
344 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
352 std::vector<double> sCoeffs( 11 );
365 double c1 = (
_mB + pl - pp - pm ) * ( pm - pl );
366 double c2 = 2 * ( pl - pp ) * ( pm - pl );
367 double c3 = (
_mB - pm ) * ( pm - pp );
368 double aF1 =
F10( sCoeffs );
369 double aF2 =
F20( sCoeffs );
370 double aF3 =
F30( sCoeffs );
371 double td0 = c1 * aF1 + c2 * aF2 + c3 * aF3;
377 double tdInt = jetSF.
evaluate( 0, pp * ( 1 - smallfrac ) );
381 double TD = (
_mB - pp ) * SU * ( td0 + tdInt );
389 double c1 = ( coeffs[5] + coeffs[1] - coeffs[0] - coeffs[2] ) *
390 ( coeffs[2] - coeffs[1] );
391 double c2 = 2 * ( coeffs[1] - coeffs[0] ) * ( coeffs[2] - coeffs[1] );
392 double c3 = ( coeffs[5] - coeffs[2] ) * ( coeffs[2] - coeffs[0] );
394 return c1 *
F1Int( omega, coeffs ) + c2 *
F2Int( omega, coeffs ) +
395 c3 *
F3Int( omega, coeffs );
400 double pp = coeffs[0];
401 double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
402 double mui = coeffs[9];
403 double muh = coeffs[8];
405 double result =
U1nlo( muh, mui ) /
U1lo( muh, mui );
407 result +=
anlo( muh, mui ) * log( y );
409 result +=
C_F( muh ) *
410 ( -4 * pow( log( y * coeffs[4] / muh ), 2 ) +
411 10 * log( y * coeffs[4] / muh ) - 4 * log( y ) -
415 result +=
C_F( mui ) *
416 ( 2 * pow( log( y * coeffs[4] * pp / pow( mui, 2 ) ), 2 ) -
417 3 * log( y * coeffs[4] * pp / pow( mui, 2 ) ) + 7 -
421 result += ( -
subS( coeffs ) + 2 *
subT( coeffs ) +
422 (
subU( coeffs ) -
subV( coeffs ) ) * ( 1 / y - 1. ) ) /
424 result +=
shapeFunction( pp, coeffs ) / pow( ( coeffs[5] - coeffs[0] ), 2 ) *
436 double pp = coeffs[0];
437 double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
439 return C_F( coeffs[9] ) *
441 ( 4 * log( y * coeffs[4] * ( pp - omega ) / pow( coeffs[9], 2 ) ) -
444 (
g1( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) /
450 double pp = coeffs[0];
451 double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
452 double result =
C_F( coeffs[8] ) * log( y ) / ( 1 - y ) *
455 (
subS( coeffs ) + 2 *
subT( coeffs ) -
456 (
subT( coeffs ) +
subV( coeffs ) ) / y ) /
460 pow( ( coeffs[5] - coeffs[0] ) * y, 2 ) *
468 double pp = coeffs[0];
469 double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
470 return C_F( coeffs[9] ) *
471 g3( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) *
477 double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
479 pow( ( coeffs[5] - coeffs[0] ) * y, 2 ) *
485 double pp = coeffs[0];
486 double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
487 return C_F( coeffs[9] ) *
488 g3( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) / 2 *
494 double result = ( y * ( -9 + 10 * y ) + x * x * ( -12 + 13 * y ) +
495 2 * x * ( -8 + 6 * y + 3 * y * y ) ) /
496 y / pow( 1 + x, 2 ) / ( x + y );
497 result -= 4 * log( ( 1 + 1 / x ) * y ) / x;
498 result -= 2 * log( 1 + y / x ) *
499 ( 3 * pow( x, 4 ) * ( -2 + y ) - 2 * pow( y, 3 ) -
500 4 * pow( x, 3 ) * ( 2 + y ) - 2 * x * y * y * ( 4 + y ) -
501 x * x * y * ( 12 + 4 * y + y * y ) ) /
502 x / pow( ( 1 + x ) * y, 2 ) / ( x + y );
508 double result = y * ( 10 * pow( x, 4 ) + y * y + 3 * x * x * y * ( 10 + y ) +
509 pow( x, 3 ) * ( 12 + 19 * y ) +
510 x * y * ( 8 + 4 * y + y * y ) );
511 result -= 2 * x * log( 1 + y / x ) *
512 ( 5 * pow( x, 4 ) + 2 * y * y + 6 * pow( x, 3 ) * ( 1 + 2 * y ) +
513 4 * y * x * ( 1 + 2 * y ) + x * x * y * ( 18 + 5 * y ) );
514 result *= 2 / ( pow( y * ( 1 + x ), 2 ) * y * ( x + y ) );
520 double result = ( 2 * pow( y, 3 ) * ( -11 + 2 * y ) -
521 10 * pow( x, 4 ) * ( 6 - 6 * y + y * y ) +
522 x * y * y * ( -94 + 29 * y + 2 * y * y ) +
523 2 * x * x * y * ( -72 + 18 * y + 13 * y * y ) -
525 ( 72 + 42 * y - 70 * y * y + 3 * pow( y, 3 ) ) ) /
526 ( pow( y * ( 1 + x ), 2 ) * y * ( x + y ) );
527 result += 2 * log( 1 + y / x ) *
528 ( -6 * x * pow( y, 3 ) * ( -5 + y ) + 4 * pow( y, 4 ) +
529 5 * pow( x, 5 ) * ( 6 - 6 * y + y * y ) -
530 4 * pow( x * y, 2 ) * ( -20 + 6 * y + y * y ) +
531 pow( x, 3 ) * y * ( 90 - 10 * y - 28 * y * y + pow( y, 3 ) ) +
532 pow( x, 4 ) * ( 36 + 36 * y - 50 * y * y + 4 * pow( y, 3 ) ) ) /
533 ( pow( ( 1 + x ) * y * y, 2 ) * ( x + y ) );
566 double omega0 = 1.68;
568 double omega0 = 1.68;
571 }
else if (
_idSF == 2 ) {
574 pow( c, -( 1 +
_b ) / 2. ) /
585 if ( sCoeffs[6] == 1 ) {
587 }
else if ( sCoeffs[6] == 2 ) {
591 <<
"EvtVubNLO : unknown shape function # " << sCoeffs[6] << endl;
607 return -2 *
subS( c );
622 }
else if (
_idSF == 2 ) {
645 }
else if (
_idSF == 2 ) {
647 double m1 =
Gamma( ( 3 +
_b ) / 2 ) -
650 double m2 =
Gamma( 1 +
_b / 2 ) -
652 double m3 =
Gamma( ( 1 +
_b ) / 2 ) -
656 ( m1 / m3 - pow( m2 / m3, 2 ) ) / c;
665 return 1 + 4 *
C_F( mui ) *
666 ( -pow( log( mf / mui ), 2 ) - log( mf / mui ) -
668 mu_pi2( omega0 ) / 3 / pow( mf, 2 ) *
669 ( log( mf / mui ) - 0.5 ) );
674 double Lambda4 = 0.302932;
675 double lg = 2 * log( mu / Lambda4 );
677 ( 1 -
beta1() * log( lg ) / pow(
beta0(), 2 ) / lg +
679 ( pow( log( lg ) - 0.5, 2 ) - 1.25 +
684 const std::vector<double>& sCoeffs )
686 double b = sCoeffs[3];
687 double l = sCoeffs[7];
688 double wL = omega / l;
690 return pow( wL, b ) *
exp( -
cGaus( b ) * wL * wL );
694 const std::vector<double>& sCoeffs )
696 double b = sCoeffs[3];
697 double l = sCoeffs[7];
698 double wL = omega / l;
700 return pow( wL, b - 1 ) *
exp( -b * wL );
705 std::array<double, 6> gammaCoeffs{
706 76.18009172947146, -86.50532032941677, 24.01409824083091,
707 -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5};
713 double tmp = x + 5.5;
714 tmp = tmp - ( x + 0.5 ) * log( tmp );
715 double ser = 1.000000000190015;
717 for (
const auto& gammaCoeff : gammaCoeffs ) {
719 ser += gammaCoeff / y;
722 return exp( -tmp + log( 2.5066282746310005 * ser / x ) );
727 std::vector<double> c( 1 );
731 return jetSF.
evaluate( tmin, 100. );
static double F1Int(double omega, const std::vector< double > &coeffs)
static double g1(double y, double z)
std::vector< double > _weights
double M0(double mui, double omega0)
double tripleDiff(double pp, double pl, double pm)
static double g2(double y, double z)
static double beta2(int nf=4)
double mu_pi2(double omega0)
static double C_F(double mu)
double subS(const std::vector< double > &coeffs)
double getArg(unsigned int j)
double alo(double mu1, double mu2)
static double expShapeFunction(double omega, const std::vector< double > &coeffs)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
static double integrand(double omega, const std::vector< double > &coeffs)
static double g3(double y, double z)
void decay(EvtParticle *p) override
static double beta0(int nf=4)
double F20(const std::vector< double > &coeffs)
static double dgamma(double t, const std::vector< double > &c)
double F10(const std::vector< double > &coeffs)
double SFNorm(const std::vector< double > &coeffs)
double subV(const std::vector< double > &coeffs)
static double Gamma(double z)
void set(int i, double d)
static double beta1(int nf=4)
static double gausShapeFunction(double omega, const std::vector< double > &coeffs)
double F30(const std::vector< double > &coeffs)
double U1lo(double mu1, double mu2)
static double alphas(double mu)
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
double anlo(double mu1, double mu2)
double U1nlo(double mu1, double mu2)
void checkNDaug(int d1, int d2=-1)
double evaluate(double lower, double upper) const
double subT(const std::vector< double > &coeffs)
double abs(const EvtComplex &c)
std::vector< double > _masses
void initProbMax() override
double lambda_bar(double omega0)
EvtComplex exp(const EvtComplex &c)
double subU(const std::vector< double > &coeffs)
EvtParticle * getDaug(int i)
static double F3Int(double omega, const std::vector< double > &coeffs)
std::string getName() override
static double cGaus(double b)
static double F2Int(double omega, const std::vector< double > &coeffs)
static double shapeFunction(double omega, const std::vector< double > &coeffs)
EvtDecayBase * clone() override
EvtId getDaug(int i) const