60 <<
"EvtVub generator expected "
61 <<
" at least 6 arguments (mb,a,alpha_s,Nbins,m1,w1,...) but found: " <<
getNArg()
63 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
71 _storeQplus = (
getArg( 3 ) < 0 ? 1 : 0 );
72 _masses =
new double[_nbins];
73 _weights =
new double[_nbins];
75 if (
getNArg() - 4 != 2 * _nbins )
77 report(
ERROR,
"EvtGen" ) <<
"EvtVub generator expected " << _nbins
78 <<
" masses and weights but found: " << (
getNArg() - 4 ) / 2
80 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
85 for ( i = 0; i < _nbins; i++ )
87 _masses[i] =
getArg( j++ );
88 if ( i > 0 && _masses[i] <= _masses[i - 1] )
90 report(
ERROR,
"EvtGen" ) <<
"EvtVub generator expected "
91 <<
" mass bins in ascending order!"
92 <<
"Will terminate execution!" << endl;
95 _weights[i] =
getArg( j++ );
96 if ( _weights[i] < 0 )
98 report(
ERROR,
"EvtGen" ) <<
"EvtVub generator expected "
99 <<
" weights >= 0, but found: " << _weights[i] << endl;
100 report(
ERROR,
"EvtGen" ) <<
"Will terminate execution!" << endl;
103 if ( _weights[i] > maxw ) maxw = _weights[i];
107 report(
ERROR,
"EvtGen" ) <<
"EvtVub generator expected at least one "
108 <<
" weight > 0, but found none! "
109 <<
"Will terminate execution!" << endl;
112 for ( i = 0; i < _nbins; i++ ) _weights[i] /= maxw;
116 const double dGMax0 = 3.;
117 _dGMax = 0.21344 + 8.905 * _alphas;
118 if ( _dGMax < dGMax0 ) _dGMax = dGMax0;
130 double mB = ( mB0 < mBP ? mB0 : mBP );
132 const double xlow = -_mb;
133 const double xhigh = mB - _mb;
134 const int aSize = 10000;
140 for ( i = 0; i < aSize; i++ )
142 double kplus =
xlow + (double)( i + 0.5 ) / ( (double)aSize ) * ( xhigh -
xlow );
143 if ( i == 0 ) _pf[i] = pFermi.
getFPFermi( kplus );
144 else _pf[i] = _pf[i - 1] + pFermi.
getFPFermi( kplus );
146 for ( i = 0; i < _pf.size(); i++ ) _pf[i] /= _pf[_pf.size() - 1];
170 double mB,
ml,
xlow, xhigh, qplus;
174 const double lp2epsilon = -10;
200 while ( kplus >= xhigh || kplus <=
xlow ||
202 kplus >= mB / 2 - _mb + sqrt( mB * mB / 4 - _masses[0] * _masses[0] ) ) )
204 kplus = findPFermi();
205 kplus =
xlow + kplus * ( xhigh -
xlow );
207 qplus = mB - _mb - kplus;
208 if ( ( mB - qplus ) / 2. <=
ml )
continue;
217 p2 = pow( 10, lp2epsilon *
p2 );
219 El = x * ( mB - qplus ) / 2;
220 if ( El >
ml && El < mB / 2 )
223 Eh = z * ( mB - qplus ) / 2 + qplus;
224 if ( Eh > 0 && Eh < mB )
227 sh =
p2 * pow( mB - qplus, 2 ) + 2 * qplus * ( Eh - qplus ) + qplus * qplus;
228 if ( sh > _masses[0] * _masses[0] && mB * mB + sh - 2 * mB * Eh >
ml *
ml )
233 double y = _dGamma->getdGdxdzdp( x, z,
p2 ) / _dGMax *
p2;
237 <<
"EvtVub decay probability > 1 found: " << y << endl;
238 if ( y >= xran ) tryit = 0;
247 double m = sqrt( sh );
249 while ( j < _nbins && m > _masses[j] ) j++;
250 double w = _weights[j - 1];
251 if (
w >= xran1 ) rew =
false;
253 else { rew =
false; }
273 sttmp = sqrt( 1 - ctH * ctH );
274 ptmp = sqrt( Eh * Eh - sh );
275 double pHB[4] = { Eh, ptmp * sttmp *
cos( phH ), ptmp * sttmp *
sin( phH ), ptmp * ctH };
276 p4.
set( pHB[0], pHB[1], pHB[2], pHB[3] );
300 double pWB[4] = { mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
305 double mW2 = mB * mB + sh - 2 * mB * Eh;
306 double beta = ptmp / pWB[0];
307 double gamma = pWB[0] / sqrt( mW2 );
311 ptmp = ( mW2 -
ml *
ml ) / 2 / sqrt( mW2 );
312 pLW[0] = sqrt(
ml *
ml + ptmp * ptmp );
314 double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
315 if ( ctL < -1 ) ctL = -1;
316 if ( ctL > 1 ) ctL = 1;
317 sttmp = sqrt( 1 - ctL * ctL );
320 double xW[3] = { -pWB[2], pWB[1], 0 };
322 double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
324 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
325 for ( j = 0; j < 2; j++ ) xW[j] /= lx;
328 double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3], pWB[1] * pWB[1] + pWB[2] * pWB[2] };
329 double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
330 for ( j = 0; j < 3; j++ ) yW[j] /= ly;
335 for ( j = 0; j < 3; j++ )
336 pLW[j + 1] = sttmp *
cos( phL ) * ptmp * xW[j] + sttmp *
sin( phL ) * ptmp * yW[j] +
345 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
347 ptmp = sqrt( El * El -
ml *
ml );
348 double ctLL = appLB / ptmp;
350 if ( ctLL > 1 ) ctLL = 1;
351 if ( ctLL < -1 ) ctLL = -1;
353 double pLB[4] = { El, 0, 0, 0 };
354 double pNB[4] = { pWB[0] - El, 0, 0, 0 };
356 for ( j = 1; j < 4; j++ )
358 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
359 pNB[j] = pWB[j] - pLB[j];
362 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
365 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
void setLifetime(double tau)
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)