82 if (
getNArg() < EvtVubHybrid::nParameters )
85 <<
"EvtVub generator expected "
86 <<
"at least " << EvtVubHybrid::nParameters <<
" arguments but found: " <<
getNArg()
87 <<
"\nWill terminate execution!" << endl;
90 else if (
getNArg() == EvtVubHybrid::nParameters )
92 report(
WARNING,
"EvtVubHybrid" ) <<
"EvtVub: generate B -> Xu l nu events "
93 <<
"without using the hybrid reweighting." << endl;
96 else if (
getNArg() < EvtVubHybrid::nParameters + EvtVubHybrid::nVariables )
98 report(
ERROR,
"EvtVubHybrid" ) <<
"EvtVub could not read number of bins for "
99 <<
"all variables used in the reweighting\n"
100 <<
"Will terminate execution!" << endl;
113 const double dGMax0 = 3.;
114 _dGMax = 0.21344 + 8.905 * _alphas;
115 if ( _dGMax < dGMax0 ) _dGMax = dGMax0;
123 static double mB = ( mB0 < mBP ? mB0 : mBP );
125 const double xlow = -_mb;
126 const double xhigh = mB - _mb;
127 const int aSize = 10000;
132 for (
int i = 0; i < aSize; i++ )
134 double kplus =
xlow + (double)( i + 0.5 ) / ( (double)aSize ) * ( xhigh -
xlow );
135 if ( i == 0 ) _pf[i] = pFermi.
getFPFermi( kplus );
136 else _pf[i] = _pf[i - 1] + pFermi.
getFPFermi( kplus );
138 for (
int i = 0; i < _pf.size(); i++ ) _pf[i] /= _pf[_pf.size() - 1];
142 if ( _noHybrid )
return;
148 int nextArg = EvtVubHybrid::nParameters + EvtVubHybrid::nVariables;
150 _nbins = _nbins_mX * _nbins_q2 * _nbins_El;
152 int expectArgs = nextArg + _nbins_mX + _nbins_q2 + _nbins_El + _nbins;
157 <<
" finds " <<
getNArg() <<
" arguments, expected " << expectArgs
158 <<
". Something is wrong with the tables of weights or thresholds."
159 <<
"\nWill terminate execution!" << endl;
166 _bins_mX =
new double[_nbins_mX];
167 for ( i = 0; i < _nbins_mX; i++, nextArg++ ) { _bins_mX[i] =
getArg( nextArg ); }
168 _masscut = _bins_mX[0];
170 _bins_q2 =
new double[_nbins_q2];
171 for ( i = 0; i < _nbins_q2; i++, nextArg++ ) { _bins_q2[i] =
getArg( nextArg ); }
173 _bins_El =
new double[_nbins_El];
174 for ( i = 0; i < _nbins_El; i++, nextArg++ ) { _bins_El[i] =
getArg( nextArg ); }
193 double mB,
ml,
xlow, xhigh, qplus;
199 const double lp2epsilon = -10;
226 kplus >= xhigh || kplus <=
xlow ||
227 ( _alphas == 0 && kplus >= mB / 2 - _mb + sqrt( mB * mB / 4 - _masscut * _masscut ) ) )
229 kplus = findPFermi();
230 kplus =
xlow + kplus * ( xhigh -
xlow );
232 qplus = mB - _mb - kplus;
233 if ( ( mB - qplus ) / 2. <=
ml )
continue;
242 p2 = pow( 10, lp2epsilon *
p2 );
244 El = x * ( mB - qplus ) / 2;
245 if ( El >
ml && El < mB / 2 )
248 Eh = z * ( mB - qplus ) / 2 + qplus;
249 if ( Eh > 0 && Eh < mB )
252 sh =
p2 * pow( mB - qplus, 2 ) + 2 * qplus * ( Eh - qplus ) + qplus * qplus;
253 if ( sh > _masscut * _masscut && mB * mB + sh - 2 * mB * Eh >
ml *
ml )
258 double y = _dGamma->getdGdxdzdp( x, z,
p2 ) / _dGMax *
p2;
262 <<
"EvtVubHybrid decay probability > 1 found: " << y << endl;
263 if ( y >= xran ) tryit = 0;
271 q2 = mB * mB + sh - 2 * mB * Eh;
278 if ( !_noHybrid )
w =
getWeight( mX, q2, El );
279 if (
w >= xran1 ) rew =
false;
281 else { rew =
false; }
301 sttmp = sqrt( 1 - ctH * ctH );
302 ptmp = sqrt( Eh * Eh - sh );
303 double pHB[4] = { Eh, ptmp * sttmp *
cos( phH ), ptmp * sttmp *
sin( phH ), ptmp * ctH };
304 p4.
set( pHB[0], pHB[1], pHB[2], pHB[3] );
328 double pWB[4] = { mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
333 double mW2 = mB * mB + sh - 2 * mB * Eh;
334 double beta = ptmp / pWB[0];
335 double gamma = pWB[0] / sqrt( mW2 );
339 ptmp = ( mW2 -
ml *
ml ) / 2 / sqrt( mW2 );
340 pLW[0] = sqrt(
ml *
ml + ptmp * ptmp );
342 double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
343 if ( ctL < -1 ) ctL = -1;
344 if ( ctL > 1 ) ctL = 1;
345 sttmp = sqrt( 1 - ctL * ctL );
348 double xW[3] = { -pWB[2], pWB[1], 0 };
350 double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
352 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
353 for ( j = 0; j < 2; j++ ) xW[j] /= lx;
356 double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3], pWB[1] * pWB[1] + pWB[2] * pWB[2] };
357 double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
358 for ( j = 0; j < 3; j++ ) yW[j] /= ly;
363 for ( j = 0; j < 3; j++ )
364 pLW[j + 1] = sttmp *
cos( phL ) * ptmp * xW[j] + sttmp *
sin( phL ) * ptmp * yW[j] +
373 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
375 ptmp = sqrt( El * El -
ml *
ml );
376 double ctLL = appLB / ptmp;
378 if ( ctLL > 1 ) ctLL = 1;
379 if ( ctLL < -1 ) ctLL = -1;
381 double pLB[4] = { El, 0, 0, 0 };
382 double pNB[4] = { pWB[0] - El, 0, 0, 0 };
384 for ( j = 1; j < 4; j++ )
386 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
387 pNB[j] = pWB[j] - pLB[j];
390 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
393 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
436 for (
int i = 0; i < _nbins_mX; i++ )
438 if ( mX >= _bins_mX[i] ) ibin_mX = i;
440 for (
int i = 0; i < _nbins_q2; i++ )
442 if ( q2 >= _bins_q2[i] ) ibin_q2 = i;
444 for (
int i = 0; i < _nbins_El; i++ )
446 if ( El >= _bins_El[i] ) ibin_El = i;
448 int ibin = ibin_mX + ibin_q2 * _nbins_mX + ibin_El * _nbins_mX * _nbins_q2;
450 if ( ( ibin_mX < 0 ) || ( ibin_q2 < 0 ) || ( ibin_El < 0 ) )
452 report(
ERROR,
"EvtVubHybrid" ) <<
"Cannot determine hybrid weight "
454 <<
"-> assign weight = 0" << endl;
458 return _weights[ibin];
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)