53 <<
"EvtVub generator expected " 54 <<
" at least 6 arguments (mb,a,alpha_s,Nbins,m1,w1,...) but found: " 57 <<
"Will terminate execution!" << endl;
71 <<
"EvtVub generator expected " <<
_nbins 72 <<
" masses and weights but found: " << (
getNArg() - 4 ) / 2
75 <<
"Will terminate execution!" << endl;
80 for ( i = 0; i <
_nbins; i++ ) {
84 <<
"EvtVub generator expected " 85 <<
" mass bins in ascending order!" 86 <<
"Will terminate execution!" << endl;
92 <<
"EvtVub generator expected " 93 <<
" weights >= 0, but found: " <<
_weights[i] << endl;
95 <<
"Will terminate execution!" << endl;
103 <<
"EvtVub generator expected at least one " 104 <<
" weight > 0, but found none! " 105 <<
"Will terminate execution!" << endl;
108 for ( i = 0; i <
_nbins; i++ )
113 const double dGMax0 = 3.;
128 double mB = ( mB0 < mBP ? mB0 : mBP );
130 const double xlow = -
_mb;
131 const double xhigh = mB -
_mb;
132 const int aSize = 10000;
138 for ( i = 0; i < aSize; i++ ) {
139 double kplus = xlow + (double)( i + 0.5 ) / ( (double)aSize ) *
146 for (
size_t index = 0; index <
_pf.size(); index++ ) {
169 EvtParticle *xuhad( 0 ), *lepton( 0 ), *neutrino( 0 );
175 double mB, ml, xlow, xhigh, qplus;
179 const double lp2epsilon = -10;
203 while ( kplus >= xhigh || kplus <= xlow ||
205 kplus >= mB / 2 -
_mb +
208 kplus = xlow + kplus * ( xhigh - xlow );
210 qplus = mB -
_mb - kplus;
211 if ( ( mB - qplus ) / 2. <= ml )
219 p2 = pow( 10.0, lp2epsilon * p2 );
221 El = x * ( mB - qplus ) / 2;
222 if ( El > ml && El < mB / 2 ) {
223 Eh = z * ( mB - qplus ) / 2 + qplus;
224 if ( Eh > 0 && Eh < mB ) {
225 sh = p2 * pow( mB - qplus, 2 ) +
226 2 * qplus * ( Eh - qplus ) + qplus * qplus;
228 mB * mB + sh - 2 * mB * Eh > ml * ml ) {
235 <<
"EvtVub decay probability > 1 found: " << y
246 double m = sqrt( sh );
248 while ( j < _nbins && m >
_masses[j] )
275 sttmp = sqrt( 1 - ctH * ctH );
276 ptmp = sqrt( Eh * Eh - sh );
277 double pHB[4] = {Eh, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
279 p4.
set( pHB[0], pHB[1], pHB[2], pHB[3] );
280 xuhad->init(
getDaug( 0 ), p4 );
296 xuhad->setLifetime( qplus / 10000. );
302 double pWB[4] = {mB - Eh, -pHB[1], -pHB[2], -pHB[3]};
307 double mW2 = mB * mB + sh - 2 * mB * Eh;
308 double beta = ptmp / pWB[0];
309 double gamma = pWB[0] / sqrt( mW2 );
313 ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
314 pLW[0] = sqrt( ml * ml + ptmp * ptmp );
316 double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
321 sttmp = sqrt( 1 - ctL * ctL );
324 double xW[3] = {-pWB[2], pWB[1], 0};
326 double zW[3] = {pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB};
328 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
329 for ( j = 0; j < 2; j++ )
333 double yW[3] = {-pWB[1] * pWB[3], -pWB[2] * pWB[3],
334 pWB[1] * pWB[1] + pWB[2] * pWB[2]};
335 double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
336 for ( j = 0; j < 3; j++ )
342 for ( j = 0; j < 3; j++ )
343 pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
344 sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
349 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
351 ptmp = sqrt( El * El - ml * ml );
352 double ctLL = appLB / ptmp;
359 double pLB[4] = {El, 0, 0, 0};
360 double pNB[4] = {pWB[0] - El, 0, 0, 0};
362 for ( j = 1; j < 4; j++ ) {
363 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
364 pNB[j] = pWB[j] - pLB[j];
367 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
368 lepton->init(
getDaug( 1 ), p4 );
370 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
379 double oOverBins = 1.0 / ( float(
_pf.size() ) );
381 int nBinsAbove =
_pf.size();
384 while ( nBinsAbove > nBinsBelow + 1 ) {
385 middle = ( nBinsAbove + nBinsBelow + 1 ) >> 1;
386 if ( ranNum >=
_pf[middle] ) {
393 double bSize =
_pf[nBinsAbove] -
_pf[nBinsBelow];
400 return ( nBinsBelow + .5 ) * oOverBins;
403 double bFract = ( ranNum -
_pf[nBinsBelow] ) / bSize;
405 return ( nBinsBelow + bFract ) * oOverBins;
void initProbMax() override
std::string getName() override
std::vector< double > _weights
std::unique_ptr< EvtVubdGamma > _dGamma
EvtDecayBase * clone() override
double getArg(unsigned int j)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
double getFPFermi(const double &kplus)
void set(int i, double d)
void decay(EvtParticle *p) override
std::vector< double > _masses
double initializePhaseSpace(unsigned int numdaughter, EvtId *daughters, bool forceResetMasses=false, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
void checkNDaug(int d1, int d2=-1)
double abs(const EvtComplex &c)
static EvtId getId(const std::string &name)
EvtParticle * getDaug(int i)
std::vector< double > _pf
static double getMaxMass(EvtId i)
EvtId getDaug(int i) const