evtgen is hosted by Hepforge, IPPP Durham
EvtGen  2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
EvtVubNLO.cpp
Go to the documentation of this file.
1 
2 /***********************************************************************
3 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors *
4 * *
5 * This file is part of EvtGen. *
6 * *
7 * EvtGen is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * EvtGen is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with EvtGen. If not, see <https://www.gnu.org/licenses/>. *
19 ***********************************************************************/
20 
22 
23 #include "EvtGenBase/EvtDiLog.hh"
24 #include "EvtGenBase/EvtGenKine.hh"
25 #include "EvtGenBase/EvtPDL.hh"
27 #include "EvtGenBase/EvtPatches.hh"
28 #include "EvtGenBase/EvtRandom.hh"
29 #include "EvtGenBase/EvtReport.hh"
31 
36 
37 #include <array>
38 #include <stdlib.h>
39 #include <string>
40 
41 using std::cout;
42 using std::endl;
43 
45 {
46  cout << " max pdf : " << _gmax << endl;
47  cout << " efficiency : " << (float)_ngood / (float)_ntot << endl;
48 }
49 
50 std::string EvtVubNLO::getName()
51 {
52  return "VUB_NLO";
53 }
54 
56 {
57  return new EvtVubNLO;
58 }
59 
61 {
62  // max pdf
63  _gmax = 0;
64  _ntot = 0;
65  _ngood = 0;
66  _lbar = -1000;
67  _mupi2 = -1000;
68 
69  // check that there are at least 6 arguments
70  int npar = 8;
71  if ( getNArg() < npar ) {
72  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
73  << "EvtVubNLO generator expected "
74  << " at least npar arguments but found: " << getNArg() << endl;
75  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
76  << "Will terminate execution!" << endl;
77  ::abort();
78  }
79  // this is the shape function parameter
80  _mb = getArg( 0 );
81  _b = getArg( 1 );
82  _lambdaSF = getArg( 2 ); // shape function lambda is different from lambda
83  _mui = 1.5; // GeV (scale)
84  _kpar = getArg( 3 ); // 0
85  _idSF = abs( (int)getArg(
86  4 ) ); // type of shape function 1: exponential (from Neubert)
87  int nbins = abs( (int)getArg( 5 ) );
88  _masses.resize( nbins );
89  _weights.resize( nbins );
90 
91  // Shape function normalization
92  _mB = 5.28; // temporary B meson mass for normalization
93 
94  std::vector<double> sCoeffs( 11 );
95  sCoeffs[3] = _b;
96  sCoeffs[4] = _mb;
97  sCoeffs[5] = _mB;
98  sCoeffs[6] = _idSF;
99  sCoeffs[7] = lambda_SF();
100  sCoeffs[8] = mu_h();
101  sCoeffs[9] = mu_i();
102  sCoeffs[10] = 1.;
103  _SFNorm = SFNorm( sCoeffs ); // SF normalization;
104 
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;
110 
111  if ( getNArg() - npar + 2 != int( 2 * _weights.size() ) ) {
112  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
113  << "EvtVubNLO generator expected " << _weights.size()
114  << " masses and weights but found: " << ( getNArg() - npar ) / 2
115  << endl;
116  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
117  << "Will terminate execution!" << endl;
118  ::abort();
119  }
120  int j = npar - 2;
121  double maxw = 0.;
122  for ( unsigned i = 0; i < _masses.size(); i++ ) {
123  _masses[i] = getArg( j++ );
124  if ( i > 0 && _masses[i] <= _masses[i - 1] ) {
125  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
126  << "EvtVubNLO generator expected "
127  << " mass bins in ascending order!"
128  << "Will terminate execution!" << endl;
129  ::abort();
130  }
131  _weights[i] = getArg( j++ );
132  if ( _weights[i] < 0 ) {
133  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
134  << "EvtVubNLO generator expected "
135  << " weights >= 0, but found: " << _weights[i] << endl;
136  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
137  << "Will terminate execution!" << endl;
138  ::abort();
139  }
140  if ( _weights[i] > maxw )
141  maxw = _weights[i];
142  }
143  if ( maxw == 0 ) {
144  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
145  << "EvtVubNLO generator expected at least one "
146  << " weight > 0, but found none! "
147  << "Will terminate execution!" << endl;
148  ::abort();
149  }
150  for ( auto& w : _weights )
151  w /= maxw;
152 
153  // the maximum dGamma*p2 value depends on alpha_s only:
154 
155  // _dGMax = 0.05;
156  _dGMax = 150.;
157 
158  // for the Fermi Motion we need a B-Meso\n mass - but it's not critical
159  // to get an exact value; in order to stay in the phase space for
160  // B+- and B0 use the smaller mass
161 
162  // check that there are 3 daughters
163  checkNDaug( 3 );
164 }
165 
167 {
168  noProbMax();
169 }
170 
172 {
173  // B+ -> u-bar specflav l+ nu
174 
175  EvtParticle *xuhad, *lepton, *neutrino;
176  EvtVector4R p4;
177 
178  double pp, pm, pl, ml, El( 0.0 ), Eh( 0.0 ), sh( 0.0 );
179 
181 
182  xuhad = p->getDaug( 0 );
183  lepton = p->getDaug( 1 );
184  neutrino = p->getDaug( 2 );
185 
186  _mB = p->mass();
187  ml = lepton->mass();
188 
189  bool tryit = true;
190 
191  while ( tryit ) {
192  // pm=(E_H+P_H)
193  pm = EvtRandom::Flat( 0., 1 );
194  pm = pow( pm, 1. / 3. ) * _mB;
195  // pl=mB-2*El
196  pl = EvtRandom::Flat( 0., 1 );
197  pl = sqrt( pl ) * pm;
198  // pp=(E_H-P_H)
199  pp = EvtRandom::Flat( 0., pl );
200 
201  _ntot++;
202 
203  El = ( _mB - pl ) / 2.;
204  Eh = ( pp + pm ) / 2;
205  sh = pp * pm;
206 
207  double pdf( 0. );
208  if ( pp < pl && El > ml && sh > _masses[0] * _masses[0] &&
209  _mB * _mB + sh - 2 * _mB * Eh > ml * ml ) {
210  double xran = EvtRandom::Flat( 0, _dGMax );
211  pdf = tripleDiff( pp, pl, pm ); // triple differential distribution
212  // cout <<" P+,P-,Pl,Pdf= "<<pp <<" "<<pm<<" "<<pl<<" "<<pdf<<endl;
213  if ( pdf > _dGMax ) {
214  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
215  << "EvtVubNLO pdf above maximum: " << pdf
216  << " P+,P-,Pl,Pdf= " << pp << " " << pm << " " << pl << " "
217  << pdf << endl;
218  //::abort();
219  }
220  if ( pdf >= xran )
221  tryit = false;
222 
223  if ( pdf > _gmax )
224  _gmax = pdf;
225  } else {
226  // cout <<" EvtVubNLO incorrect kinematics sh= "<<sh<<"EH "<<Eh<<endl;
227  }
228 
229  // reweight the Mx distribution
230  if ( !tryit && !_weights.empty() ) {
231  _ngood++;
232  double xran1 = EvtRandom::Flat();
233  double m = sqrt( sh );
234  unsigned j = 0;
235  while ( j < _masses.size() && m > _masses[j] )
236  j++;
237  double w = _weights[j - 1];
238  if ( w < xran1 )
239  tryit = true; // through away this candidate
240  }
241  }
242 
243  // cout <<" max prob "<<gmax<<" " << pp<<" "<<y<<" "<<x<<endl;
244 
245  // o.k. we have the three kineamtic variables
246  // now calculate a flat cos Theta_H [-1,1] distribution of the
247  // hadron flight direction w.r.t the B flight direction
248  // because the B is a scalar and should decay isotropic.
249  // Then chose a flat Phi_H [0,2Pi] w.r.t the B flight direction
250  // and and a flat Phi_L [0,2Pi] in the W restframe w.r.t the
251  // W flight direction.
252 
253  double ctH = EvtRandom::Flat( -1, 1 );
254  double phH = EvtRandom::Flat( 0, 2 * M_PI );
255  double phL = EvtRandom::Flat( 0, 2 * M_PI );
256 
257  // now compute the four vectors in the B Meson restframe
258 
259  double ptmp, sttmp;
260  // calculate the hadron 4 vector in the B Meson restframe
261 
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 ),
265  ptmp * ctH};
266  p4.set( pHB[0], pHB[1], pHB[2], pHB[3] );
267  xuhad->init( getDaug( 0 ), p4 );
268 
269  // calculate the W 4 vector in the B Meson restrframe
270 
271  double apWB = ptmp;
272  double pWB[4] = {_mB - Eh, -pHB[1], -pHB[2], -pHB[3]};
273 
274  // first go in the W restframe and calculate the lepton and
275  // the neutrino in the W frame
276 
277  double mW2 = _mB * _mB + sh - 2 * _mB * Eh;
278  // if(mW2<0.1){
279  // cout <<" low Q2! "<<pp<<" "<<epp<<" "<<x<<" "<<y<<endl;
280  //}
281  double beta = ptmp / pWB[0];
282  double gamma = pWB[0] / sqrt( mW2 );
283 
284  double pLW[4];
285 
286  ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
287  pLW[0] = sqrt( ml * ml + ptmp * ptmp );
288 
289  double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
290  if ( ctL < -1 )
291  ctL = -1;
292  if ( ctL > 1 )
293  ctL = 1;
294  sttmp = sqrt( 1 - ctL * ctL );
295 
296  // eX' = eZ x eW
297  double xW[3] = {-pWB[2], pWB[1], 0};
298  // eZ' = eW
299  double zW[3] = {pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB};
300 
301  double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
302  for ( int j = 0; j < 2; j++ )
303  xW[j] /= lx;
304 
305  // eY' = eZ' x eX'
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++ )
310  yW[j] /= ly;
311 
312  // p_lep = |p_lep| * ( sin(Theta) * cos(Phi) * eX'
313  // + sin(Theta) * sin(Phi) * eY'
314  // + cos(Theta) * eZ')
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];
318 
319  double apLW = ptmp;
320 
321  // boost them back in the B Meson restframe
322 
323  double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
324 
325  ptmp = sqrt( El * El - ml * ml );
326  double ctLL = appLB / ptmp;
327 
328  if ( ctLL > 1 )
329  ctLL = 1;
330  if ( ctLL < -1 )
331  ctLL = -1;
332 
333  double pLB[4] = {El, 0, 0, 0};
334  double pNB[8] = {pWB[0] - El, 0, 0, 0};
335 
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];
339  }
340 
341  p4.set( pLB[0], pLB[1], pLB[2], pLB[3] );
342  lepton->init( getDaug( 1 ), p4 );
343 
344  p4.set( pNB[0], pNB[1], pNB[2], pNB[3] );
345  neutrino->init( getDaug( 2 ), p4 );
346 
347  return;
348 }
349 
350 double EvtVubNLO::tripleDiff( double pp, double pl, double pm )
351 {
352  std::vector<double> sCoeffs( 11 );
353  sCoeffs[0] = pp;
354  sCoeffs[1] = pl;
355  sCoeffs[2] = pm;
356  sCoeffs[3] = _b;
357  sCoeffs[4] = _mb;
358  sCoeffs[5] = _mB;
359  sCoeffs[6] = _idSF;
360  sCoeffs[7] = lambda_SF();
361  sCoeffs[8] = mu_h();
362  sCoeffs[9] = mu_i();
363  sCoeffs[10] = _SFNorm; // SF normalization;
364 
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;
372 
373  auto func = EvtItgPtrFunction{&integrand, 0., _mB, sCoeffs};
374  auto jetSF = EvtItgSimpsonIntegrator{func, 0.01, 25};
375  double smallfrac =
376  0.000001; // stop a bit before the end to avoid problems with numerical integration
377  double tdInt = jetSF.evaluate( 0, pp * ( 1 - smallfrac ) );
378 
379  double SU = U1lo( mu_h(), mu_i() ) *
380  pow( ( pm - pp ) / ( _mB - pp ), alo( mu_h(), mu_i() ) );
381  double TD = ( _mB - pp ) * SU * ( td0 + tdInt );
382 
383  return TD;
384 }
385 
386 double EvtVubNLO::integrand( double omega, const std::vector<double>& coeffs )
387 {
388  //double pp=coeffs[0];
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] );
393 
394  return c1 * F1Int( omega, coeffs ) + c2 * F2Int( omega, coeffs ) +
395  c3 * F3Int( omega, coeffs );
396 }
397 
398 double EvtVubNLO::F10( const std::vector<double>& coeffs )
399 {
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];
404  double z = 1 - y;
405  double result = U1nlo( muh, mui ) / U1lo( muh, mui );
406 
407  result += anlo( muh, mui ) * log( y );
408 
409  result += C_F( muh ) *
410  ( -4 * pow( log( y * coeffs[4] / muh ), 2 ) +
411  10 * log( y * coeffs[4] / muh ) - 4 * log( y ) -
412  2 * log( y ) / ( 1 - y ) - 4.0 * EvtDiLog::DiLog( z ) -
413  pow( EvtConst::pi, 2 ) / 6. - 12 );
414 
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 -
418  pow( EvtConst::pi, 2 ) );
419  result *= shapeFunction( pp, coeffs );
420  // changes due to SSF
421  result += ( -subS( coeffs ) + 2 * subT( coeffs ) +
422  ( subU( coeffs ) - subV( coeffs ) ) * ( 1 / y - 1. ) ) /
423  ( coeffs[5] - pp );
424  result += shapeFunction( pp, coeffs ) / pow( ( coeffs[5] - coeffs[0] ), 2 ) *
425  ( -5 * ( lambda1() + 3 * lambda2() ) / 6 +
426  2 * ( 2 * lambda1() / 3 - lambda2() ) / pow( y, 2 ) );
427  // result += (subS(coeffs)+subT(coeffs)+(subU(coeffs)-subV(coeffs))/y)/(coeffs[5]-pp);
428  // this part has been added after Feb '05
429 
430  //result += shapeFunction(pp,coeffs)/pow((coeffs[5]-coeffs[0]),2)*((lambda1()+3*lambda2())/6+2*(2*lambda1()/3-lambda2())/pow(y,2));
431  return result;
432 }
433 
434 double EvtVubNLO::F1Int( double omega, const std::vector<double>& coeffs )
435 {
436  double pp = coeffs[0];
437  double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
438  // mubar == mui
439  return C_F( coeffs[9] ) *
440  ( ( shapeFunction( omega, coeffs ) - shapeFunction( pp, coeffs ) ) *
441  ( 4 * log( y * coeffs[4] * ( pp - omega ) / pow( coeffs[9], 2 ) ) -
442  3 ) /
443  ( pp - omega ) +
444  ( g1( y, ( pp - omega ) / ( coeffs[5] - coeffs[0] ) ) /
445  ( coeffs[5] - pp ) * shapeFunction( omega, coeffs ) ) );
446 }
447 
448 double EvtVubNLO::F20( const std::vector<double>& coeffs )
449 {
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 ) *
453  shapeFunction( pp, coeffs ) -
454  1 / y *
455  ( subS( coeffs ) + 2 * subT( coeffs ) -
456  ( subT( coeffs ) + subV( coeffs ) ) / y ) /
457  ( coeffs[5] - pp );
458  // added after Feb '05
459  result += shapeFunction( pp, coeffs ) /
460  pow( ( coeffs[5] - coeffs[0] ) * y, 2 ) *
461  ( 2 * lambda1() / 3 + 4 * lambda2() -
462  y * ( 7 / 6 * lambda1() + 3 * lambda2() ) );
463  return result;
464 }
465 
466 double EvtVubNLO::F2Int( double omega, const std::vector<double>& coeffs )
467 {
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] ) ) *
472  shapeFunction( omega, coeffs ) / ( coeffs[5] - pp );
473 }
474 
475 double EvtVubNLO::F30( const std::vector<double>& coeffs )
476 {
477  double y = ( coeffs[2] - coeffs[0] ) / ( coeffs[5] - coeffs[0] );
478  return shapeFunction( coeffs[0], coeffs ) /
479  pow( ( coeffs[5] - coeffs[0] ) * y, 2 ) *
480  ( -2 * lambda1() / 3 + lambda2() );
481 }
482 
483 double EvtVubNLO::F3Int( double omega, const std::vector<double>& coeffs )
484 {
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 *
489  shapeFunction( omega, coeffs ) / ( coeffs[2] - coeffs[0] );
490 }
491 
492 double EvtVubNLO::g1( double y, double x )
493 {
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 );
503  return result;
504 }
505 
506 double EvtVubNLO::g2( double y, double x )
507 {
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 ) );
515  return result;
516 }
517 
518 double EvtVubNLO::g3( double y, double x )
519 {
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 ) -
524  pow( x, 3 ) *
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 ) );
534  return result;
535 }
536 
537 /* old version (before Feb 05 notebook from NNeubert
538 
539 double
540 EvtVubNLO::F1Int(double omega,const std::vector<double> &coeffs){
541  double pp=coeffs[0];
542  double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
543  // mubar == mui
544  return C_F(coeffs[9])*(
545  (shapeFunction(omega,coeffs)-shapeFunction(pp,coeffs))*(4*log(y*coeffs[4]*(pp-omega)/pow(coeffs[9],2))-3)/(pp-omega)-
546  (1./y/(coeffs[5]-pp)*shapeFunction(omega,coeffs)*(5-6*y+4*(3-y)*log((pp-omega)/y/coeffs[4])))
547  );
548 }
549 
550 
551 double
552 EvtVubNLO::F2Int(double omega,const std::vector<double> &coeffs){
553  double pp=coeffs[0];
554  double y=(coeffs[2]-coeffs[0])/(coeffs[5]-coeffs[0]);
555  return C_F(coeffs[9])*shapeFunction(omega,coeffs)*(2-11/y-4/y*log((pp-omega)/y/coeffs[4]))/(coeffs[5]-pp);
556 }
557 
558 double
559 EvtVubNLO::F3(const std::vector<double> &coeffs){
560  return C_F(coeffs[9])*shapeFunction(omega,coeffs)/(coeffs[2]-coeffs[0]);
561 }
562 */
563 
564 double EvtVubNLO::SFNorm( const std::vector<double>& /*coeffs*/ )
565 {
566  double omega0 = 1.68; //normalization scale (mB-2*1.8)
567  if ( _idSF == 1 ) { // exponential SF
568  double omega0 = 1.68; //normalization scale (mB-2*1.8)
569  return M0( mu_i(), omega0 ) * pow( _b, _b ) / lambda_SF() /
570  ( Gamma( _b ) - Gamma( _b, _b * omega0 / lambda_SF() ) );
571  } else if ( _idSF == 2 ) { // Gaussian SF
572  double c = cGaus( _b );
573  return M0( mu_i(), omega0 ) * 2 / lambda_SF() /
574  pow( c, -( 1 + _b ) / 2. ) /
575  ( Gamma( ( 1 + _b ) / 2 ) -
576  Gamma( ( 1 + _b ) / 2, pow( omega0 / lambda_SF(), 2 ) * c ) );
577  } else {
578  EvtGenReport( EVTGEN_ERROR, "EvtGen" ) << "unknown SF " << _idSF << endl;
579  return -1;
580  }
581 }
582 
583 double EvtVubNLO::shapeFunction( double omega, const std::vector<double>& sCoeffs )
584 {
585  if ( sCoeffs[6] == 1 ) {
586  return sCoeffs[10] * expShapeFunction( omega, sCoeffs );
587  } else if ( sCoeffs[6] == 2 ) {
588  return sCoeffs[10] * gausShapeFunction( omega, sCoeffs );
589  } else {
590  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
591  << "EvtVubNLO : unknown shape function # " << sCoeffs[6] << endl;
592  }
593  return -1.;
594 }
595 
596 // SSF
597 double EvtVubNLO::subS( const std::vector<double>& c )
598 {
599  return ( lambda_bar( 1.68 ) - c[0] ) * shapeFunction( c[0], c );
600 }
601 double EvtVubNLO::subT( const std::vector<double>& c )
602 {
603  return -3 * lambda2() * subS( c ) / mu_pi2( 1.68 );
604 }
605 double EvtVubNLO::subU( const std::vector<double>& c )
606 {
607  return -2 * subS( c );
608 }
609 double EvtVubNLO::subV( const std::vector<double>& c )
610 {
611  return -subT( c );
612 }
613 
614 double EvtVubNLO::lambda_bar( double omega0 )
615 {
616  if ( _lbar < 0 ) {
617  if ( _idSF == 1 ) { // exponential SF
618  double rat = omega0 * _b / lambda_SF();
619  _lbar = lambda_SF() / _b *
620  ( Gamma( 1 + _b ) - Gamma( 1 + _b, rat ) ) /
621  ( Gamma( _b ) - Gamma( _b, rat ) );
622  } else if ( _idSF == 2 ) { // Gaussian SF
623  double c = cGaus( _b );
624  _lbar = lambda_SF() *
625  ( Gamma( 1 + _b / 2 ) -
626  Gamma( 1 + _b / 2, pow( omega0 / lambda_SF(), 2 ) * c ) ) /
627  ( Gamma( ( 1 + _b ) / 2 ) -
628  Gamma( ( 1 + _b ) / 2,
629  pow( omega0 / lambda_SF(), 2 ) * c ) ) /
630  sqrt( c );
631  }
632  }
633  return _lbar;
634 }
635 
636 double EvtVubNLO::mu_pi2( double omega0 )
637 {
638  if ( _mupi2 < 0 ) {
639  if ( _idSF == 1 ) { // exponential SF
640  double rat = omega0 * _b / lambda_SF();
641  _mupi2 = 3 * ( pow( lambda_SF() / _b, 2 ) *
642  ( Gamma( 2 + _b ) - Gamma( 2 + _b, rat ) ) /
643  ( Gamma( _b ) - Gamma( _b, rat ) ) -
644  pow( lambda_bar( omega0 ), 2 ) );
645  } else if ( _idSF == 2 ) { // Gaussian SF
646  double c = cGaus( _b );
647  double m1 = Gamma( ( 3 + _b ) / 2 ) -
648  Gamma( ( 3 + _b ) / 2,
649  pow( omega0 / lambda_SF(), 2 ) * c );
650  double m2 = Gamma( 1 + _b / 2 ) -
651  Gamma( 1 + _b / 2, pow( omega0 / lambda_SF(), 2 ) * c );
652  double m3 = Gamma( ( 1 + _b ) / 2 ) -
653  Gamma( ( 1 + _b ) / 2,
654  pow( omega0 / lambda_SF(), 2 ) * c );
655  _mupi2 = 3 * pow( lambda_SF(), 2 ) *
656  ( m1 / m3 - pow( m2 / m3, 2 ) ) / c;
657  }
658  }
659  return _mupi2;
660 }
661 
662 double EvtVubNLO::M0( double mui, double omega0 )
663 {
664  double mf = omega0 - lambda_bar( omega0 );
665  return 1 + 4 * C_F( mui ) *
666  ( -pow( log( mf / mui ), 2 ) - log( mf / mui ) -
667  pow( EvtConst::pi / 2, 2 ) / 6. +
668  mu_pi2( omega0 ) / 3 / pow( mf, 2 ) *
669  ( log( mf / mui ) - 0.5 ) );
670 }
671 
672 double EvtVubNLO::alphas( double mu )
673 {
674  double Lambda4 = 0.302932;
675  double lg = 2 * log( mu / Lambda4 );
676  return 4 * EvtConst::pi / lg / beta0() *
677  ( 1 - beta1() * log( lg ) / pow( beta0(), 2 ) / lg +
678  pow( beta1() / lg, 2 ) / pow( beta0(), 4 ) *
679  ( pow( log( lg ) - 0.5, 2 ) - 1.25 +
680  beta2() * beta0() / pow( beta1(), 2 ) ) );
681 }
682 
683 double EvtVubNLO::gausShapeFunction( double omega,
684  const std::vector<double>& sCoeffs )
685 {
686  double b = sCoeffs[3];
687  double l = sCoeffs[7];
688  double wL = omega / l;
689 
690  return pow( wL, b ) * exp( -cGaus( b ) * wL * wL );
691 }
692 
693 double EvtVubNLO::expShapeFunction( double omega,
694  const std::vector<double>& sCoeffs )
695 {
696  double b = sCoeffs[3];
697  double l = sCoeffs[7];
698  double wL = omega / l;
699 
700  return pow( wL, b - 1 ) * exp( -b * wL );
701 }
702 
703 double EvtVubNLO::Gamma( double z )
704 {
705  std::array<double, 6> gammaCoeffs{
706  76.18009172947146, -86.50532032941677, 24.01409824083091,
707  -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5};
708 
709  //Lifted from Numerical Recipies in C
710  double y = z;
711  double x = z;
712 
713  double tmp = x + 5.5;
714  tmp = tmp - ( x + 0.5 ) * log( tmp );
715  double ser = 1.000000000190015;
716 
717  for ( const auto& gammaCoeff : gammaCoeffs ) {
718  y += 1.0;
719  ser += gammaCoeff / y;
720  }
721 
722  return exp( -tmp + log( 2.5066282746310005 * ser / x ) );
723 }
724 
725 double EvtVubNLO::Gamma( double z, double tmin )
726 {
727  std::vector<double> c( 1 );
728  c[0] = z;
729  auto func = EvtItgPtrFunction{&dgamma, tmin, 100., c};
730  auto jetSF = EvtItgSimpsonIntegrator{func, 0.001};
731  return jetSF.evaluate( tmin, 100. );
732 }
int _ntot
Definition: EvtVubNLO.hh:70
static double F1Int(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:434
static double g1(double y, double z)
Definition: EvtVubNLO.cpp:492
double mu_h()
Definition: EvtVubNLO.hh:95
std::vector< double > _weights
Definition: EvtVubNLO.hh:67
double M0(double mui, double omega0)
Definition: EvtVubNLO.cpp:662
double tripleDiff(double pp, double pl, double pm)
Definition: EvtVubNLO.cpp:350
static double g2(double y, double z)
Definition: EvtVubNLO.cpp:506
static double beta2(int nf=4)
Definition: EvtVubNLO.hh:101
double _SFNorm
Definition: EvtVubNLO.hh:63
double mu_pi2(double omega0)
Definition: EvtVubNLO.cpp:636
static double C_F(double mu)
Definition: EvtVubNLO.hh:123
double subS(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:597
double getArg(unsigned int j)
double alo(double mu1, double mu2)
Definition: EvtVubNLO.hh:225
double _mb
Definition: EvtVubNLO.hh:57
static double expShapeFunction(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:693
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
static double integrand(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:386
static double g3(double y, double z)
Definition: EvtVubNLO.cpp:518
void decay(EvtParticle *p) override
Definition: EvtVubNLO.cpp:171
static double beta0(int nf=4)
Definition: EvtVubNLO.hh:99
double _mupi2
Definition: EvtVubNLO.hh:55
double F20(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:448
static double dgamma(double t, const std::vector< double > &c)
Definition: EvtVubNLO.hh:86
double F10(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:398
double SFNorm(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:564
double mu_i()
Definition: EvtVubNLO.hh:93
double _dGMax
Definition: EvtVubNLO.hh:64
double subV(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:609
static double Gamma(double z)
Definition: EvtVubNLO.cpp:703
void set(int i, double d)
Definition: EvtVector4R.hh:167
static double beta1(int nf=4)
Definition: EvtVubNLO.hh:100
int _ngood
Definition: EvtVubNLO.hh:70
EvtId * getDaugs()
Definition: EvtDecayBase.hh:66
static double gausShapeFunction(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:683
double F30(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:475
double _mui
Definition: EvtVubNLO.hh:62
static const double pi
Definition: EvtConst.hh:26
double _gmax
Definition: EvtVubNLO.hh:69
double U1lo(double mu1, double mu2)
Definition: EvtVubNLO.hh:218
static double alphas(double mu)
Definition: EvtVubNLO.cpp:672
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)
Definition: EvtVubNLO.hh:229
EvtVubNLO()=default
double U1nlo(double mu1, double mu2)
Definition: EvtVubNLO.hh:219
void checkNDaug(int d1, int d2=-1)
static double Flat()
Definition: EvtRandom.cpp:72
double evaluate(double lower, double upper) const
double subT(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:601
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:201
double lambda_SF()
Definition: EvtVubNLO.hh:130
std::vector< double > _masses
Definition: EvtVubNLO.hh:66
void initProbMax() override
Definition: EvtVubNLO.cpp:166
double lambda_bar(double omega0)
Definition: EvtVubNLO.cpp:614
double mass() const
int getNDaug() const
Definition: EvtDecayBase.hh:65
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:240
double subU(const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:605
double _mB
Definition: EvtVubNLO.hh:58
double _lambdaSF
Definition: EvtVubNLO.hh:59
EvtParticle * getDaug(int i)
Definition: EvtParticle.cpp:91
double _kpar
Definition: EvtVubNLO.hh:61
double DiLog(double x)
Definition: EvtDiLog.cpp:31
static double F3Int(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:483
void init() override
Definition: EvtVubNLO.cpp:60
std::string getName() override
Definition: EvtVubNLO.cpp:50
static double cGaus(double b)
Definition: EvtVubNLO.hh:137
double lambda2()
Definition: EvtVubNLO.hh:132
int _idSF
Definition: EvtVubNLO.hh:65
int getNArg() const
Definition: EvtDecayBase.hh:68
static double F2Int(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:466
static double shapeFunction(double omega, const std::vector< double > &coeffs)
Definition: EvtVubNLO.cpp:583
double _b
Definition: EvtVubNLO.hh:60
EvtDecayBase * clone() override
Definition: EvtVubNLO.cpp:55
double _lbar
Definition: EvtVubNLO.hh:54
double lambda1()
Definition: EvtVubNLO.hh:96
EvtId getDaug(int i) const
Definition: EvtDecayBase.hh:67