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.
EvtBtoXsgammaKagan.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/EvtConst.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"
30 
40 
41 #include <fstream>
42 #include <stdlib.h>
43 #include <string>
44 using std::endl;
45 using std::fstream;
46 
47 bool EvtBtoXsgammaKagan::bbprod = false;
49 
50 void EvtBtoXsgammaKagan::init( int nArg, double* args )
51 {
52  if ( ( nArg ) > 12 || ( nArg > 1 && nArg < 10 ) || nArg == 11 ) {
53  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
54  << "EvtBtoXsgamma generator model "
55  << "EvtBtoXsgammaKagan expected "
56  << "either 1(default config) or "
57  << "10 (default mass range) or "
58  << "12 (user range) arguments but found: " << nArg << endl;
59  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
60  << "Will terminate execution!" << endl;
61  ::abort();
62  }
63 
64  if ( nArg == 1 ) {
65  bbprod = true;
67  } else {
68  bbprod = false;
69  computeHadronicMass( nArg, args );
70  }
71 
72  double mHminLimit = 0.6373;
73  double mHmaxLimit = 4.5;
74 
75  if ( nArg > 10 ) {
76  _mHmin = args[10];
77  _mHmax = args[11];
78  if ( _mHmin > _mHmax ) {
79  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
80  << "Minimum hadronic mass exceeds maximum " << endl;
81  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
82  << "Will terminate execution!" << endl;
83  ::abort();
84  }
85  if ( _mHmin < mHminLimit ) {
86  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
87  << "Minimum hadronic mass below K pi threshold" << endl;
88  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
89  << "Resetting to K pi threshold" << endl;
90  _mHmin = mHminLimit;
91  }
92  if ( _mHmax > mHmaxLimit ) {
93  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
94  << "Maximum hadronic mass above 4.5 GeV/c^2" << endl;
95  EvtGenReport( EVTGEN_ERROR, "EvtGen" )
96  << "Resetting to 4.5 GeV/c^2" << endl;
97  _mHmax = mHmaxLimit;
98  }
99  } else {
100  _mHmin = mHminLimit; // usually just above K pi threshold for Xsd/u
101  _mHmax = mHmaxLimit;
102  }
103 }
104 
106 {
107  massHad = {0, 0.0625995, 0.125199, 0.187798, 0.250398, 0.312997,
108  0.375597, 0.438196, 0.500796, 0.563395, 0.625995, 0.688594,
109  0.751194, 0.813793, 0.876392, 0.938992, 1.00159, 1.06419,
110  1.12679, 1.18939, 1.25199, 1.31459, 1.37719, 1.43979,
111  1.50239, 1.56499, 1.62759, 1.69019, 1.75278, 1.81538,
112  1.87798, 1.94058, 2.00318, 2.06578, 2.12838, 2.19098,
113  2.25358, 2.31618, 2.37878, 2.44138, 2.50398, 2.56658,
114  2.62918, 2.69178, 2.75438, 2.81698, 2.87958, 2.94217,
115  3.00477, 3.06737, 3.12997, 3.19257, 3.25517, 3.31777,
116  3.38037, 3.44297, 3.50557, 3.56817, 3.63077, 3.69337,
117  3.75597, 3.81857, 3.88117, 3.94377, 4.00637, 4.06896,
118  4.13156, 4.19416, 4.25676, 4.31936, 4.38196, 4.44456,
119  4.50716, 4.56976, 4.63236, 4.69496, 4.75756, 4.82016,
120  4.88276, 4.94536, 5.00796};
121  brHad = {0, 1.03244e-09, 3.0239e-08, 1.99815e-07, 7.29392e-07,
122  1.93129e-06, 4.17806e-06, 7.86021e-06, 1.33421e-05, 2.09196e-05,
123  3.07815e-05, 4.29854e-05, 5.74406e-05, 7.3906e-05, 9.2003e-05,
124  0.000111223, 0.000130977, 0.000150618, 0.000169483, 0.000186934,
125  0.000202392, 0.000215366, 0.000225491, 0.000232496, 0.000236274,
126  0.000236835, 0.000234313, 0.000228942, 0.000221042, 0.000210994,
127  0.000199215, 0.000186137, 0.000172194, 0.000157775, 0.000143255,
128  0.000128952, 0.000115133, 0.000102012, 8.97451e-05, 7.84384e-05,
129  6.81519e-05, 5.89048e-05, 5.06851e-05, 4.34515e-05, 3.71506e-05,
130  3.1702e-05, 2.70124e-05, 2.30588e-05, 1.96951e-05, 1.68596e-05,
131  1.44909e-05, 1.25102e-05, 1.08596e-05, 9.48476e-06, 8.34013e-06,
132  7.38477e-06, 6.58627e-06, 5.91541e-06, 5.35022e-06, 4.87047e-06,
133  4.46249e-06, 4.11032e-06, 3.80543e-06, 3.54051e-06, 3.30967e-06,
134  3.10848e-06, 2.93254e-06, 2.78369e-06, 2.65823e-06, 2.55747e-06,
135  2.51068e-06, 2.57179e-06, 2.74684e-06, 3.02719e-06, 3.41182e-06,
136  3.91387e-06, 4.56248e-06, 5.40862e-06, 6.53915e-06, 8.10867e-06,
137  1.04167e-05};
138  massHad.resize( 81 );
139  brHad.resize( 81 );
140 
141  intervalMH = 80;
142 }
143 
144 void EvtBtoXsgammaKagan::computeHadronicMass( int /*nArg*/, double* args )
145 {
146  //Input parameters
147  int fermiFunction = (int)args[1];
148  _mB = args[2];
149  _mb = args[3];
150  _mu = args[4];
151  _lam1 = args[5];
152  _delta = args[6];
153  _z = args[7];
154  _nIntervalS = args[8];
155  _nIntervalmH = args[9];
156  std::vector<double> mHVect( int( _nIntervalmH + 1.0 ) );
157  massHad.clear();
158  massHad.resize( int( _nIntervalmH + 1.0 ) );
159  brHad.clear();
160  brHad.resize( int( _nIntervalmH + 1.0 ) );
162 
163  //Going to have to add a new entry into the data file - takes ages...
164  EvtGenReport( EVTGEN_WARNING, "EvtGen" )
165  << "EvtBtoXsgammaKagan: calculating new hadronic mass spectra. This takes a while..."
166  << endl;
167 
168  //Now need to compute the mHVect vector for
169  //the current parameters
170 
171  //A few more parameters
172  double _mubar = _mu;
173  _mW = 80.33;
174  _mt = 175.0;
175  _alpha = 1. / 137.036;
176  _lambdabar = _mB - _mb;
177  _kappabar = 3.382 - 4.14 * ( sqrt( _z ) - 0.29 );
178  _fz = Fz( _z );
179  _rer8 = ( 44. / 9. ) - ( 8. / 27. ) * pow( EvtConst::pi, 2. );
180  _r7 = ( -10. / 3. ) - ( 8. / 9. ) * pow( EvtConst::pi, 2. );
181  _rer2 = -4.092 + 12.78 * ( sqrt( _z ) - .29 );
182  _gam77 = 32. / 3.;
183  _gam27 = 416. / 81.;
184  _gam87 = -32. / 9.;
185  _lam2 = .12;
186  _beta0 = 23. / 3.;
187  _beta1 = 116. / 3.;
188  _alphasmZ = .118;
189  _mZ = 91.187;
190  _ms = _mb / 50.;
191 
192  double eGammaMin = 0.5 * _mB * ( 1. - _delta );
193  double eGammaMax = 0.5 * _mB;
194  double yMin = 2. * eGammaMin / _mB;
195  double yMax = 2. * eGammaMax / _mB;
196  double _CKMrat = 0.976;
197  double Nsl = 1.0;
198 
199  //Calculate alpha the various scales
200  _alphasmW = CalcAlphaS( _mW );
201  _alphasmt = CalcAlphaS( _mt );
202  _alphasmu = CalcAlphaS( _mu );
203  _alphasmubar = CalcAlphaS( _mubar );
204 
205  //Calculate the Wilson Coefficients and Delta
207  _kSLemmu = ( 12. / 23. ) * ( ( 1. / _etamu ) - 1. );
209  CalcDelta();
210 
211  //Build s22 and s27 vector - saves time because double
212  //integration is required otherwise
213  std::vector<double> s22Coeffs( int( _nIntervalS + 1.0 ) );
214  std::vector<double> s27Coeffs( int( _nIntervalS + 1.0 ) );
215  std::vector<double> s28Coeffs( int( _nIntervalS + 1.0 ) );
216 
217  double dy = ( yMax - yMin ) / _nIntervalS;
218  double yp = yMin;
219 
220  std::vector<double> sCoeffs( 1 );
221  sCoeffs[0] = _z;
222 
223  //Define s22 and s27 functions
224  auto mys22Func = EvtItgPtrFunction{&s22Func, 0., yMax + 0.1, sCoeffs};
225  auto mys27Func = EvtItgPtrFunction{&s27Func, 0., yMax + 0.1, sCoeffs};
226 
227  //Use a simpson integrator
228  auto mys22Simp = EvtItgSimpsonIntegrator{mys22Func, 1.0e-4, 20};
229  auto mys27Simp = EvtItgSimpsonIntegrator{mys27Func, 1.0e-4, 50};
230 
231  int i;
232 
233  for ( i = 0; i < int( _nIntervalS + 1.0 ); i++ ) {
234  s22Coeffs[i] = ( 16. / 27. ) * mys22Simp.evaluate( 1.0e-20, yp );
235  s27Coeffs[i] = ( -8. / 9. ) * _z * mys27Simp.evaluate( 1.0e-20, yp );
236  s28Coeffs[i] = -s27Coeffs[i] / 3.;
237  yp = yp + dy;
238  }
239 
240  //Define functions and vectors used to calculate mHVect. Each function takes a set
241  //of vectors which are used as the function coefficients
242  std::vector<double> FermiCoeffs( 6 );
243  std::vector<double> varCoeffs( 3 );
244  std::vector<double> DeltaCoeffs( 1 );
245  std::vector<double> s88Coeffs( 2 );
246  std::vector<double> sInitCoeffs( 3 );
247 
248  varCoeffs[0] = _mB;
249  varCoeffs[1] = _mb;
250  varCoeffs[2] = 0.;
251 
252  DeltaCoeffs[0] = _alphasmu;
253 
254  s88Coeffs[0] = _mb;
255  s88Coeffs[1] = _ms;
256 
257  sInitCoeffs[0] = _nIntervalS;
258  sInitCoeffs[1] = yMin;
259  sInitCoeffs[2] = yMax;
260 
261  FermiCoeffs[0] = fermiFunction;
262  FermiCoeffs[1] = 0.0;
263  FermiCoeffs[2] = 0.0;
264  FermiCoeffs[3] = 0.0;
265  FermiCoeffs[4] = 0.0;
266  FermiCoeffs[5] = 0.0;
267 
268  //Coefficients for gamma function
269  std::vector<double> gammaCoeffs( 6 );
270  gammaCoeffs[0] = 76.18009172947146;
271  gammaCoeffs[1] = -86.50532032941677;
272  gammaCoeffs[2] = 24.01409824083091;
273  gammaCoeffs[3] = -1.231739572450155;
274  gammaCoeffs[4] = 0.1208650973866179e-2;
275  gammaCoeffs[5] = -0.5395239384953e-5;
276 
277  //Calculate quantities for the fermi function to be used
278  //Distinguish among the different shape functions
279  if ( fermiFunction == 1 ) {
280  FermiCoeffs[1] = _lambdabar;
281  FermiCoeffs[2] = ( -3. * pow( _lambdabar, 2. ) / _lam1 ) - 1.;
282  FermiCoeffs[3] = _lam1;
283  FermiCoeffs[4] = 1.0;
284 
285  auto myNormFunc = std::make_unique<EvtItgPtrFunction>(
286  &EvtBtoXsgammaFermiUtil::FermiExpFunc, -_mb, _mB - _mb, FermiCoeffs );
287  auto myNormSimp =
288  std::make_unique<EvtItgSimpsonIntegrator>( *myNormFunc, 1.0e-4, 40 );
289  FermiCoeffs[4] = myNormSimp->normalisation();
290 
291  } else if ( fermiFunction == 2 ) {
293  _mb, gammaCoeffs );
294  FermiCoeffs[1] = _lambdabar;
295  FermiCoeffs[2] = a;
296  FermiCoeffs[3] =
297  EvtBtoXsgammaFermiUtil::Gamma( ( 2.0 + a ) / 2., gammaCoeffs ) /
298  EvtBtoXsgammaFermiUtil::Gamma( ( 1.0 + a ) / 2., gammaCoeffs );
299  FermiCoeffs[4] = 1.0;
300 
301  auto myNormFunc = std::make_unique<EvtItgPtrFunction>(
303  FermiCoeffs );
304  auto myNormSimp =
305  std::make_unique<EvtItgSimpsonIntegrator>( *myNormFunc, 1.0e-4, 40 );
306  FermiCoeffs[4] = myNormSimp->normalisation();
307 
308  } else if ( fermiFunction == 3 ) {
310  _lam1 );
311  FermiCoeffs[1] = _mB;
312  FermiCoeffs[2] = _mb;
313  FermiCoeffs[3] = rho;
314  FermiCoeffs[4] = _lambdabar;
315  FermiCoeffs[5] = 1.0;
316 
317  auto myNormFunc = std::make_unique<EvtItgPtrFunction>(
319  FermiCoeffs );
320  auto myNormSimp =
321  std::make_unique<EvtItgSimpsonIntegrator>( *myNormFunc, 1.0e-4, 40 );
322  FermiCoeffs[5] = myNormSimp->normalisation();
323  }
324 
325  //Define functions
326  auto myDeltaFermiFunc = EvtItgThreeCoeffFcn{&DeltaFermiFunc, -_mb,
327  _mB - _mb, FermiCoeffs,
328  varCoeffs, DeltaCoeffs};
329  auto mys88FermiFunc = EvtItgThreeCoeffFcn{&s88FermiFunc, -_mb,
330  _mB - _mb, FermiCoeffs,
331  varCoeffs, s88Coeffs};
332  auto mys77FermiFunc = EvtItgTwoCoeffFcn{&s77FermiFunc, -_mb, _mB - _mb,
333  FermiCoeffs, varCoeffs};
334  auto mys78FermiFunc = EvtItgTwoCoeffFcn{&s78FermiFunc, -_mb, _mB - _mb,
335  FermiCoeffs, varCoeffs};
336  auto mys22FermiFunc = EvtItgFourCoeffFcn{&sFermiFunc, -_mb,
337  _mB - _mb, FermiCoeffs,
338  varCoeffs, sInitCoeffs,
339  s22Coeffs};
340  auto mys27FermiFunc = EvtItgFourCoeffFcn{&sFermiFunc, -_mb,
341  _mB - _mb, FermiCoeffs,
342  varCoeffs, sInitCoeffs,
343  s27Coeffs};
344  auto mys28FermiFunc = EvtItgFourCoeffFcn{&sFermiFunc, -_mb,
345  _mB - _mb, FermiCoeffs,
346  varCoeffs, sInitCoeffs,
347  s28Coeffs};
348 
349  //Define integrators
350  auto myDeltaFermiSimp = EvtItgSimpsonIntegrator{myDeltaFermiFunc, 1.0e-4, 40};
351  auto mys77FermiSimp = EvtItgSimpsonIntegrator{mys77FermiFunc, 1.0e-4, 40};
352  auto mys88FermiSimp = EvtItgSimpsonIntegrator{mys88FermiFunc, 1.0e-4, 40};
353  auto mys78FermiSimp = EvtItgSimpsonIntegrator{mys78FermiFunc, 1.0e-4, 40};
354  auto mys22FermiSimp = EvtItgSimpsonIntegrator{mys22FermiFunc, 1.0e-4, 40};
355  auto mys27FermiSimp = EvtItgSimpsonIntegrator{mys27FermiFunc, 1.0e-4, 40};
356  auto mys28FermiSimp = EvtItgSimpsonIntegrator{mys28FermiFunc, 1.0e-4, 40};
357 
358  //Finally calculate mHVect for the range of hadronic masses
359  double mHmin = sqrt( _mB * _mB - 2. * _mB * eGammaMax );
360  double mHmax = sqrt( _mB * _mB - 2. * _mB * eGammaMin );
361  double dmH = ( mHmax - mHmin ) / _nIntervalmH;
362 
363  double mH = mHmin;
364 
365  //Calculating the Branching Fractions
366  for ( i = 0; i < int( _nIntervalmH + 1.0 ); i++ ) {
367  double ymH = 1. - ( ( mH * mH ) / ( _mB * _mB ) );
368 
369  //Need to set ymH as one of the input parameters
370  myDeltaFermiFunc.setCoeff( 2, 2, ymH );
371  mys77FermiFunc.setCoeff( 2, 2, ymH );
372  mys88FermiFunc.setCoeff( 2, 2, ymH );
373  mys78FermiFunc.setCoeff( 2, 2, ymH );
374  mys22FermiFunc.setCoeff( 2, 2, ymH );
375  mys27FermiFunc.setCoeff( 2, 2, ymH );
376  mys28FermiFunc.setCoeff( 2, 2, ymH );
377 
378  //Integrate
379 
380  double deltaResult = myDeltaFermiSimp.evaluate( ( _mB * ymH - _mb ),
381  _mB - _mb );
382  double s77Result = mys77FermiSimp.evaluate( ( _mB * ymH - _mb ),
383  _mB - _mb );
384  double s88Result = mys88FermiSimp.evaluate( ( _mB * ymH - _mb ),
385  _mB - _mb );
386  double s78Result = mys78FermiSimp.evaluate( ( _mB * ymH - _mb ),
387  _mB - _mb );
388  double s22Result = mys22FermiSimp.evaluate( ( _mB * ymH - _mb ),
389  _mB - _mb );
390  double s27Result = mys27FermiSimp.evaluate( ( _mB * ymH - _mb ),
391  _mB - _mb );
392  mys28FermiSimp.evaluate( ( _mB * ymH - _mb ), _mB - _mb );
393 
394  double py =
395  ( pow( _CKMrat, 2. ) * ( 6. / _fz ) * ( _alpha / EvtConst::pi ) *
396  ( deltaResult * _cDeltatot +
397  ( _alphasmu / EvtConst::pi ) *
398  ( s77Result * pow( _c70mu, 2. ) +
399  s27Result * _c2mu * ( _c70mu - _c80mu / 3. ) +
400  s78Result * _c70mu * _c80mu + s22Result * _c2mu * _c2mu +
401  s88Result * _c80mu * _c80mu ) ) );
402 
403  mHVect[i] = 2. * ( mH / ( _mB * _mB ) ) * 0.105 * Nsl * py;
404 
405  massHad[i] = mH;
406  brHad[i] = 2. * ( mH / ( _mB * _mB ) ) * 0.105 * Nsl * py;
407 
408  mH = mH + dmH;
409  }
410 }
411 
412 double EvtBtoXsgammaKagan::GetMass( int /*Xscode*/ )
413 {
414  // Get hadronic mass for the event according to the hadronic mass spectra computed in computeHadronicMass
415  double mass = 0.0;
416  double min = _mHmin;
417  if ( bbprod )
418  min = 1.1;
419  // double max=4.5;
420  double max = _mHmax;
421  double xbox( 0 ), ybox( 0 );
422  double boxheight( 0 );
423  double trueHeight( 0 );
424  double boxwidth = max - min;
425  double wgt( 0. );
426 
427  for ( int i = 0; i < int( intervalMH + 1.0 ); i++ ) {
428  if ( brHad[i] > boxheight )
429  boxheight = brHad[i];
430  }
431  while ( ( mass > max ) || ( mass < min ) ) {
432  xbox = EvtRandom::Flat( boxwidth ) + min;
433  ybox = EvtRandom::Flat( boxheight );
434  trueHeight = 0.0;
435  // Correction by Peter Richardson
436  for ( int i = 1; i < int( intervalMH + 1.0 ); ++i ) {
437  if ( ( massHad[i] >= xbox ) && ( 0.0 == trueHeight ) ) {
438  wgt = ( xbox - massHad[i - 1] ) / ( massHad[i] - massHad[i - 1] );
439  trueHeight = brHad[i - 1] + wgt * ( brHad[i] - brHad[i - 1] );
440  }
441  }
442 
443  if ( ybox > trueHeight ) {
444  mass = 0.0;
445  } else {
446  mass = xbox;
447  }
448  }
449 
450  return mass;
451 }
452 
453 double EvtBtoXsgammaKagan::CalcAlphaS( double scale )
454 {
455  double v = 1. - _beta0 * ( _alphasmZ / ( 2. * EvtConst::pi ) ) *
456  ( log( _mZ / scale ) );
457  return ( _alphasmZ / v ) *
458  ( 1. - ( ( _beta1 / _beta0 ) *
459  ( _alphasmZ / ( 4. * EvtConst::pi ) ) * ( log( v ) / v ) ) );
460 }
461 
463 {
464  double mtatmw = _mt * pow( ( _alphasmW / _alphasmt ), ( 12. / 23. ) ) *
465  ( 1 +
466  ( 12. / 23. ) * ( ( 253. / 18. ) - ( 116. / 23. ) ) *
467  ( ( _alphasmW - _alphasmt ) / ( 4.0 * EvtConst::pi ) ) -
468  ( 4. / 3. ) * ( _alphasmt / EvtConst::pi ) );
469  double xt = pow( mtatmw, 2. ) / pow( _mW, 2. );
470 
472  _c2mu = .5 * pow( _etamu, ( -12. / 23. ) ) + .5 * pow( _etamu, ( 6. / 23. ) );
473 
474  double c7mWsm = ( ( 3. * pow( xt, 3. ) - 2. * pow( xt, 2. ) ) /
475  ( 4. * pow( ( xt - 1. ), 4. ) ) ) *
476  log( xt ) +
477  ( ( -8. * pow( xt, 3. ) - 5. * pow( xt, 2. ) + 7. * xt ) /
478  ( 24. * pow( ( xt - 1. ), 3. ) ) );
479 
480  double c8mWsm = ( ( -3. * pow( xt, 2. ) ) / ( 4. * pow( ( xt - 1. ), 4. ) ) ) *
481  log( xt ) +
482  ( ( -pow( xt, 3. ) + 5. * pow( xt, 2. ) + 2. * xt ) /
483  ( 8. * pow( ( xt - 1. ), 3. ) ) );
484 
485  double c7constmu = ( 626126. / 272277. ) * pow( _etamu, ( 14. / 23. ) ) -
486  ( 56281. / 51730. ) * pow( _etamu, ( 16. / 23. ) ) -
487  ( 3. / 7. ) * pow( _etamu, ( 6. / 23. ) ) -
488  ( 1. / 14. ) * pow( _etamu, ( -12. / 23. ) ) -
489  .6494 * pow( _etamu, .4086 ) -
490  .038 * pow( _etamu, -.423 ) -
491  .0186 * pow( _etamu, -.8994 ) -
492  .0057 * pow( _etamu, .1456 );
493 
494  _c70mu = c7mWsm * pow( _etamu, ( 16. / 23. ) ) +
495  ( 8. / 3. ) *
496  ( pow( _etamu, ( 14. / 23. ) ) - pow( _etamu, ( 16. / 23. ) ) ) *
497  c8mWsm +
498  c7constmu;
499 
500  double c8constmu = ( 313063. / 363036. ) * pow( _etamu, ( 14. / 23. ) ) -
501  .9135 * pow( _etamu, .4086 ) +
502  .0873 * pow( _etamu, -.423 ) -
503  .0571 * pow( _etamu, -.8994 ) +
504  .0209 * pow( _etamu, .1456 );
505 
506  _c80mu = c8mWsm * pow( _etamu, ( 14. / 23. ) ) + c8constmu;
507 
508  //Compute the dilogarithm (PolyLog(2,x)) with the Simpson integrator
509  //The dilogarithm is defined as: Li_2(x)=Int_0^x(-log(1.-z)/z)
510  //however, Mathematica implements it as Sum[z^k/k^2,{k,1,Infinity}], so, althought the two
511  //results are similar and both implemented in the program, we prefer to use the
512  //one closer to the Mathematica implementation as identical to what used by the theorists.
513 
514  // EvtItgFunction *myDiLogFunc = new EvtItgFunction(&diLogFunc, 0., 1.-1./xt);
515  //EvtItgAbsIntegrator *myDiLogSimp = new EvtItgSimpsonIntegrator(*myDiLogFunc, 1.0e-4, 50);
516  //double li2 = myDiLogSimp->evaluate(1.0e-20,1.-1./xt);
517 
518  double li2 = diLogMathematica( 1. - 1. / xt );
519 
520  double c7mWsm1 =
521  ( ( -16. * pow( xt, 4. ) - 122. * pow( xt, 3. ) + 80. * pow( xt, 2. ) -
522  8. * xt ) /
523  ( 9. * pow( ( xt - 1. ), 4. ) ) * li2 +
524  ( 6. * pow( xt, 4. ) + 46. * pow( xt, 3. ) - 28. * pow( xt, 2. ) ) /
525  ( 3. * pow( ( xt - 1. ), 5. ) ) * pow( log( xt ), 2. ) +
526  ( -102. * pow( xt, 5. ) - 588. * pow( xt, 4. ) -
527  2262. * pow( xt, 3. ) + 3244. * pow( xt, 2. ) - 1364. * xt + 208. ) /
528  ( 81. * pow( ( xt - 1 ), 5. ) ) * log( xt ) +
529  ( 1646. * pow( xt, 4. ) + 12205. * pow( xt, 3. ) -
530  10740. * pow( xt, 2. ) + 2509. * xt - 436. ) /
531  ( 486. * pow( ( xt - 1 ), 4. ) ) );
532 
533  double c8mWsm1 =
534  ( ( -4. * pow( xt, 4. ) + 40. * pow( xt, 3. ) + 41. * pow( xt, 2. ) + xt ) /
535  ( 6. * pow( ( xt - 1. ), 4. ) ) * li2 +
536  ( -17. * pow( xt, 3. ) - 31. * pow( xt, 2. ) ) /
537  ( 2. * pow( ( xt - 1. ), 5. ) ) * pow( log( xt ), 2. ) +
538  ( -210. * pow( xt, 5. ) + 1086. * pow( xt, 4. ) +
539  4893. * pow( xt, 3. ) + 2857. * pow( xt, 2. ) - 1994. * xt + 280. ) /
540  ( 216. * pow( ( xt - 1 ), 5. ) ) * log( xt ) +
541  ( 737. * pow( xt, 4. ) - 14102. * pow( xt, 3. ) -
542  28209. * pow( xt, 2. ) + 610. * xt - 508. ) /
543  ( 1296. * pow( ( xt - 1 ), 4. ) ) );
544 
545  double E1 = ( xt * ( 18. - 11. * xt - pow( xt, 2. ) ) /
546  ( 12. * pow( ( 1. - xt ), 3. ) ) +
547  pow( xt, 2. ) * ( 15. - 16. * xt + 4. * pow( xt, 2. ) ) /
548  ( 6. * pow( ( 1. - xt ), 4. ) ) * log( xt ) -
549  2. / 3. * log( xt ) );
550 
551  double e1 = 4661194. / 816831.;
552  double e2 = -8516. / 2217.;
553  double e3 = 0.;
554  double e4 = 0.;
555  double e5 = -1.9043;
556  double e6 = -.1008;
557  double e7 = .1216;
558  double e8 = .0183;
559 
560  double f1 = -17.3023;
561  double f2 = 8.5027;
562  double f3 = 4.5508;
563  double f4 = .7519;
564  double f5 = 2.004;
565  double f6 = .7476;
566  double f7 = -.5385;
567  double f8 = .0914;
568 
569  double g1 = 14.8088;
570  double g2 = -10.809;
571  double g3 = -.874;
572  double g4 = .4218;
573  double g5 = -2.9347;
574  double g6 = .3971;
575  double g7 = .1600;
576  double g8 = .0225;
577 
578  double c71constmu =
579  ( ( e1 * _etamu * E1 + f1 + g1 * _etamu ) * pow( _etamu, ( 14. / 23. ) ) +
580  ( e2 * _etamu * E1 + f2 + g2 * _etamu ) * pow( _etamu, ( 16. / 23. ) ) +
581  ( e3 * _etamu * E1 + f3 + g3 * _etamu ) * pow( _etamu, ( 6. / 23. ) ) +
582  ( e4 * _etamu * E1 + f4 + g4 * _etamu ) * pow( _etamu, ( -12. / 23. ) ) +
583  ( e5 * _etamu * E1 + f5 + g5 * _etamu ) * pow( _etamu, .4086 ) +
584  ( e6 * _etamu * E1 + f6 + g6 * _etamu ) * pow( _etamu, ( -.423 ) ) +
585  ( e7 * _etamu * E1 + f7 + g7 * _etamu ) * pow( _etamu, ( -.8994 ) ) +
586  ( e8 * _etamu * E1 + f8 + g8 * _etamu ) * pow( _etamu, .1456 ) );
587 
588  double c71pmu =
589  ( ( ( 297664. / 14283. * pow( _etamu, ( 16. / 23. ) ) -
590  7164416. / 357075. * pow( _etamu, ( 14. / 23. ) ) +
591  256868. / 14283. * pow( _etamu, ( 37. / 23. ) ) -
592  6698884. / 357075. * pow( _etamu, ( 39. / 23. ) ) ) *
593  ( c8mWsm ) ) +
594  37208. / 4761. *
595  ( pow( _etamu, ( 39. / 23. ) ) - pow( _etamu, ( 16. / 23. ) ) ) *
596  ( c7mWsm ) +
597  c71constmu );
598 
599  _c71mu = ( _alphasmW / _alphasmu *
600  ( pow( _etamu, ( 16. / 23. ) ) * c7mWsm1 +
601  8. / 3. *
602  ( pow( _etamu, ( 14. / 23. ) ) -
603  pow( _etamu, ( 16. / 23. ) ) ) *
604  c8mWsm1 ) +
605  c71pmu );
606 
607  _c7emmu = ( ( 32. / 75. * pow( _etamu, ( -9. / 23. ) ) -
608  40. / 69. * pow( _etamu, ( -7. / 23. ) ) +
609  88. / 575. * pow( _etamu, ( 16. / 23. ) ) ) *
610  c7mWsm +
611  ( -32. / 575. * pow( _etamu, ( -9. / 23. ) ) +
612  32. / 1449. * pow( _etamu, ( -7. / 23. ) ) +
613  640. / 1449. * pow( _etamu, ( 14. / 23. ) ) -
614  704. / 1725. * pow( _etamu, ( 16. / 23. ) ) ) *
615  c8mWsm -
616  190. / 8073. * pow( _etamu, ( -35. / 23. ) ) -
617  359. / 3105. * pow( _etamu, ( -17. / 23. ) ) +
618  4276. / 121095. * pow( _etamu, ( -12. / 23. ) ) +
619  350531. / 1009125. * pow( _etamu, ( -9. / 23. ) ) +
620  2. / 4347. * pow( _etamu, ( -7. / 23. ) ) -
621  5956. / 15525. * pow( _etamu, ( 6. / 23. ) ) +
622  38380. / 169533. * pow( _etamu, ( 14. / 23. ) ) -
623  748. / 8625. * pow( _etamu, ( 16. / 23. ) ) );
624 
625  // Wilson coefficients values as according to Kagan's program
626  // _c2mu=1.10566;
627  //_c70mu=-0.314292;
628  // _c80mu=-0.148954;
629  // _c71mu=0.480964;
630  // _c7emmu=0.0323219;
631 }
632 
634 {
635  double cDelta77 = ( 1. +
636  ( _alphasmu / ( 2. * EvtConst::pi ) ) *
637  ( _r7 - ( 16. / 3. ) + _gam77 * log( _mb / _mu ) ) +
638  ( ( pow( ( 1. - _z ), 4. ) / _fz ) - 1. ) *
639  ( 6. * _lam2 / pow( _mb, 2. ) ) +
640  ( _alphasmubar / ( 2. * EvtConst::pi ) ) * _kappabar ) *
641  pow( _c70mu, 2. );
642 
643  double cDelta27 = ( ( _alphasmu / ( 2. * EvtConst::pi ) ) *
644  ( _rer2 + _gam27 * log( _mb / _mu ) ) -
645  ( _lam2 / ( 9. * _z * pow( _mb, 2. ) ) ) ) *
646  _c2mu * _c70mu;
647 
648  double cDelta78 = ( _alphasmu / ( 2. * EvtConst::pi ) ) *
649  ( _rer8 + _gam87 * log( _mb / _mu ) ) * _c70mu * _c80mu;
650 
651  _cDeltatot = cDelta77 + cDelta27 + cDelta78 +
652  ( _alphasmu / ( 2. * EvtConst::pi ) ) * _c71mu * _c70mu +
653  ( _alpha / _alphasmu ) *
654  ( 2. * _c7emmu * _c70mu - _kSLemmu * pow( _c70mu, 2. ) );
655 }
656 
657 double EvtBtoXsgammaKagan::Delta( double y, double alphasMu )
658 {
659  //Fix for singularity at endpoint
660  if ( y >= 1.0 )
661  y = 0.9999999999;
662 
663  return ( -4. * ( alphasMu / ( 3. * EvtConst::pi * ( 1. - y ) ) ) *
664  ( log( 1. - y ) + 7. / 4. ) *
665  exp( -2. * ( alphasMu / ( 3. * EvtConst::pi ) ) *
666  ( pow( log( 1. - y ), 2 ) + ( 7. / 2. ) * log( 1. - y ) ) ) );
667 }
668 
669 double EvtBtoXsgammaKagan::s77( double y )
670 {
671  //Fix for singularity at endpoint
672  if ( y >= 1.0 )
673  y = 0.9999999999;
674 
675  return ( ( 1. / 3. ) *
676  ( 7. + y - 2. * pow( y, 2 ) - 2. * ( 1. + y ) * log( 1. - y ) ) );
677 }
678 
679 double EvtBtoXsgammaKagan::s88( double y, double mb, double ms )
680 {
681  //Fix for singularity at endpoint
682  if ( y >= 1.0 )
683  y = 0.9999999999;
684 
685  return ( ( 1. / 27. ) * ( ( 2. * ( 2. - 2. * y + pow( y, 2 ) ) / y ) *
686  ( log( 1. - y ) + 2. * log( mb / ms ) ) -
687  2. * pow( y, 2 ) - y - 8. * ( ( 1. - y ) / y ) ) );
688 }
689 
690 double EvtBtoXsgammaKagan::s78( double y )
691 {
692  //Fix for singularity at endpoint
693  if ( y >= 1.0 )
694  y = 0.9999999999;
695 
696  return ( ( 8. / 9. ) * ( ( ( 1. - y ) / y ) * log( 1. - y ) + 1. +
697  ( pow( y, 2 ) / 4. ) ) );
698 }
699 
700 double EvtBtoXsgammaKagan::ReG( double y )
701 {
702  if ( y < 4. )
703  return -2. * pow( atan( sqrt( y / ( 4. - y ) ) ), 2. );
704  else {
705  return 2. * ( pow( log( ( sqrt( y ) + sqrt( y - 4. ) ) / 2. ), 2. ) ) -
706  ( 1. / 2. ) * pow( EvtConst::pi, 2. );
707  }
708 }
709 
710 double EvtBtoXsgammaKagan::ImG( double y )
711 {
712  if ( y < 4. )
713  return 0.0;
714  else {
715  return ( -2. * EvtConst::pi * log( ( sqrt( y ) + sqrt( y - 4. ) ) / 2. ) );
716  }
717 }
718 
719 double EvtBtoXsgammaKagan::s22Func( double y, const std::vector<double>& coeffs )
720 {
721  //coeffs[0]=z
722  return ( 1. - y ) *
723  ( ( pow( coeffs[0], 2. ) / pow( y, 2. ) ) *
724  ( pow( ReG( y / coeffs[0] ), 2. ) +
725  pow( ImG( y / coeffs[0] ), 2. ) ) +
726  ( coeffs[0] / y ) * ReG( y / coeffs[0] ) + ( 1. / 4. ) );
727 }
728 
729 double EvtBtoXsgammaKagan::s27Func( double y, const std::vector<double>& coeffs )
730 {
731  //coeffs[0] = z
732  return ( ReG( y / coeffs[0] ) + y / ( 2. * coeffs[0] ) );
733 }
734 
736  const std::vector<double>& coeffs1,
737  const std::vector<double>& coeffs2,
738  const std::vector<double>& coeffs3 )
739 {
740  //coeffs1=fermi function coeffs, coeffs2[0]=mB, coeffs2[1]=mb,
741  //coeffs2[2]=ymH, coeffs3[0]=DeltaCoeff (alphasmu)
742 
743  return FermiFunc( y, coeffs1 ) * ( coeffs2[0] / ( coeffs2[1] + y ) ) *
744  Delta( ( coeffs2[0] * coeffs2[2] ) / ( coeffs2[1] + y ), coeffs3[0] );
745 }
746 
748  const std::vector<double>& coeffs1,
749  const std::vector<double>& coeffs2 )
750 {
751  //coeffs1=fermi function coeffs, coeffs2[0]=mB, coeffs2[1]=mb,
752  //coeffs2[2]=ymH
753  return FermiFunc( y, coeffs1 ) * ( coeffs2[0] / ( coeffs2[1] + y ) ) *
754  s77( ( coeffs2[0] * coeffs2[2] ) / ( coeffs2[1] + y ) );
755 }
756 
758  const std::vector<double>& coeffs1,
759  const std::vector<double>& coeffs2,
760  const std::vector<double>& coeffs3 )
761 {
762  //coeffs1=fermi function coeffs, coeffs2[0]=mB, coeffs2[1]=mb,
763  //coeffs2[2]=ymH, coeffs3=s88 coeffs
764  return FermiFunc( y, coeffs1 ) * ( coeffs2[0] / ( coeffs2[1] + y ) ) *
765  s88( ( coeffs2[0] * coeffs2[2] ) / ( coeffs2[1] + y ), coeffs3[0],
766  coeffs3[1] );
767 }
768 
770  const std::vector<double>& coeffs1,
771  const std::vector<double>& coeffs2 )
772 {
773  //coeffs1=fermi function coeffs, coeffs2[0]=mB, coeffs2[1]=mb,
774  //coeffs2[2]=ymH
775  return FermiFunc( y, coeffs1 ) * ( coeffs2[0] / ( coeffs2[1] + y ) ) *
776  s78( ( coeffs2[0] * coeffs2[2] ) / ( coeffs2[1] + y ) );
777 }
778 
780  const std::vector<double>& coeffs1,
781  const std::vector<double>& coeffs2,
782  const std::vector<double>& coeffs3,
783  const std::vector<double>& coeffs4 )
784 {
785  //coeffs1=fermi function coeffs, coeffs2[0]=mB, coeffs2[1]=mb,
786  //coeffs2[2]=ymH, coeffs3[0]=nIntervals in s22 or s27 array, coeffs3[1]=yMin,
787  //coeffs3[2]=yMax, coeffs4=s22 or s27 array
788  return FermiFunc( y, coeffs1 ) * ( coeffs2[0] / ( coeffs2[1] + y ) ) *
789  GetArrayVal( coeffs2[0] * coeffs2[2] / ( coeffs2[1] + y ),
790  coeffs3[0], coeffs3[1], coeffs3[2], coeffs4 );
791 }
792 
793 double EvtBtoXsgammaKagan::Fz( double z )
794 {
795  return ( 1. - 8. * z + 8. * pow( z, 3. ) - pow( z, 4. ) -
796  12. * pow( z, 2. ) * log( z ) );
797 }
798 
799 double EvtBtoXsgammaKagan::GetArrayVal( double xp, double nInterval, double xMin,
800  double xMax, std::vector<double> array )
801 {
802  double dx = ( xMax - xMin ) / nInterval;
803  int bin1 = int( ( ( xp - xMin ) / ( xMax - xMin ) ) * nInterval );
804 
805  double x1 = double( bin1 ) * dx + xMin;
806 
807  if ( xp == x1 )
808  return array[bin1];
809 
810  int bin2( 0 );
811  if ( xp > x1 ) {
812  bin2 = bin1 + 1;
813  } else if ( xp < x1 ) {
814  bin2 = bin1 - 1;
815  }
816 
817  if ( bin1 <= 0 ) {
818  bin1 = 0;
819  bin2 = 1;
820  }
821 
822  //If xp is in the last bin, always interpolate between the last two bins
823  if ( bin1 == (int)nInterval ) {
824  bin2 = (int)nInterval;
825  bin1 = (int)nInterval - 1;
826  x1 = double( bin1 ) * dx + xMin;
827  }
828 
829  double x2 = double( bin2 ) * dx + xMin;
830  double y1 = array[bin1];
831 
832  double y2 = array[bin2];
833  double m = ( y2 - y1 ) / ( x2 - x1 );
834  double c = y1 - m * x1;
835  double result = m * xp + c;
836 
837  return result;
838 }
839 
840 double EvtBtoXsgammaKagan::FermiFunc( double y, const std::vector<double>& coeffs )
841 {
842  //Fermi shape functions :1=exponential, 2=gaussian, 3=roman
843  if ( int( coeffs[0] ) == 1 )
844  return EvtBtoXsgammaFermiUtil::FermiExpFunc( y, coeffs );
845  if ( int( coeffs[0] ) == 2 )
846  return EvtBtoXsgammaFermiUtil::FermiGaussFunc( y, coeffs );
847  if ( int( coeffs[0] ) == 3 )
848  return EvtBtoXsgammaFermiUtil::FermiRomanFunc( y, coeffs );
849  return 1.;
850 }
851 
853 {
854  return -log( fabs( 1. - y ) ) / y;
855 }
856 
858 {
859  double li2( 0 );
860  for ( int i = 1; i < 1000;
861  i++ ) { //the value 1000 should actually be Infinite...
862  li2 += pow( y, i ) / ( i * i );
863  }
864  return li2;
865 }
void computeHadronicMass(int, double *)
static double FermiRomanFunc(double, std::vector< double > const &coeffs)
static double s77(double)
static double Gamma(double, const std::vector< double > &coeffs)
static double s77FermiFunc(double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2)
static double s78FermiFunc(double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2)
static double Delta(double, double)
static double s78(double)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
Definition: EvtReport.cpp:33
static double diLogFunc(double)
static double sFermiFunc(double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2, const std::vector< double > &coeffs3, const std::vector< double > &coeffs4)
static double FermiRomanFuncRoot(double, double)
static double FermiGaussFunc(double, std::vector< double > const &coeffs)
static double FermiGaussFuncRoot(double, double, double, std::vector< double > &coeffs)
static const double pi
Definition: EvtConst.hh:26
static double ReG(double)
void init(int, double *) override
static double DeltaFermiFunc(double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2, const std::vector< double > &coeffs3)
static double FermiExpFunc(double var, const std::vector< double > &coeffs)
static double Flat()
Definition: EvtRandom.cpp:72
double evaluate(double lower, double upper) const
static double FermiFunc(double, const std::vector< double > &coeffs)
double GetMass(int code) override
static double s88(double, double, double)
static double diLogMathematica(double)
static double s22Func(double var, const std::vector< double > &coeffs)
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:240
static double s27Func(double var, const std::vector< double > &coeffs)
static double ImG(double)
static double GetArrayVal(double, double, double, double, std::vector< double >)
static double s88FermiFunc(double, const std::vector< double > &coeffs1, const std::vector< double > &coeffs2, const std::vector< double > &coeffs3)
std::vector< double > massHad
std::vector< double > brHad