57 <<
"EvtVub generator expected " 59 <<
" arguments but found: " <<
getNArg()
60 <<
"\nWill terminate execution!" << endl;
64 <<
"EvtVub: generate B -> Xu l nu events " 65 <<
"without using the hybrid reweighting." << endl;
69 <<
"EvtVub could not read number of bins for " 70 <<
"all variables used in the reweighting\n" 71 <<
"Will terminate execution!" << endl;
84 const double dGMax0 = 3.;
95 static double mB = ( mB0 < mBP ? mB0 : mBP );
97 const double xlow = -
_mb;
98 const double xhigh = mB -
_mb;
99 const int aSize = 10000;
104 for (
int i = 0; i < aSize; i++ ) {
105 double kplus = xlow + (double)( i + 0.5 ) / ( (double)aSize ) *
112 for (
size_t index = 0; index <
_pf.size(); index++ ) {
133 if (
getNArg() < expectArgs ) {
135 <<
" finds " <<
getNArg() <<
" arguments, expected " << expectArgs
136 <<
". Something is wrong with the tables of weights or thresholds." 137 <<
"\nWill terminate execution!" << endl;
165 EvtParticle *xuhad( 0 ), *lepton( 0 ), *neutrino( 0 );
171 double mB, ml, xlow, xhigh, qplus;
177 const double lp2epsilon = -10;
201 while ( kplus >= xhigh || kplus <= xlow ||
203 kplus >= mB / 2 -
_mb +
206 kplus = xlow + kplus * ( xhigh - xlow );
208 qplus = mB -
_mb - kplus;
209 if ( ( mB - qplus ) / 2. <= ml )
217 p2 = pow( 10, lp2epsilon * p2 );
219 El = x * ( mB - qplus ) / 2;
220 if ( El > ml && El < mB / 2 ) {
221 Eh = z * ( mB - qplus ) / 2 + qplus;
222 if ( Eh > 0 && Eh < mB ) {
223 sh = p2 * pow( mB - qplus, 2 ) +
224 2 * qplus * ( Eh - qplus ) + qplus * qplus;
226 mB * mB + sh - 2 * mB * Eh > ml * ml ) {
233 <<
"EvtVubHybrid decay probability > 1 found: " 244 q2 = mB * mB + sh - 2 * mB * Eh;
276 sttmp = sqrt( 1 - ctH * ctH );
277 ptmp = sqrt( Eh * Eh - sh );
278 double pHB[4] = {Eh, ptmp * sttmp * cos( phH ), ptmp * sttmp * sin( phH ),
280 p4.
set( pHB[0], pHB[1], pHB[2], pHB[3] );
281 xuhad->init(
getDaug( 0 ), p4 );
297 xuhad->setLifetime( qplus / 10000. );
303 double pWB[4] = {mB - Eh, -pHB[1], -pHB[2], -pHB[3]};
308 double mW2 = mB * mB + sh - 2 * mB * Eh;
309 double beta = ptmp / pWB[0];
310 double gamma = pWB[0] / sqrt( mW2 );
314 ptmp = ( mW2 - ml * ml ) / 2 / sqrt( mW2 );
315 pLW[0] = sqrt( ml * ml + ptmp * ptmp );
317 double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
322 sttmp = sqrt( 1 - ctL * ctL );
325 double xW[3] = {-pWB[2], pWB[1], 0};
327 double zW[3] = {pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB};
329 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
330 for ( j = 0; j < 2; j++ )
334 double yW[3] = {-pWB[1] * pWB[3], -pWB[2] * pWB[3],
335 pWB[1] * pWB[1] + pWB[2] * pWB[2]};
336 double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
337 for ( j = 0; j < 3; j++ )
343 for ( j = 0; j < 3; j++ )
344 pLW[j + 1] = sttmp * cos( phL ) * ptmp * xW[j] +
345 sttmp * sin( phL ) * ptmp * yW[j] + ctL * ptmp * zW[j];
353 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
355 ptmp = sqrt( El * El - ml * ml );
356 double ctLL = appLB / ptmp;
363 double pLB[4] = {El, 0, 0, 0};
364 double pNB[4] = {pWB[0] - El, 0, 0, 0};
366 for ( j = 1; j < 4; j++ ) {
367 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
368 pNB[j] = pWB[j] - pLB[j];
371 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
372 lepton->init(
getDaug( 1 ), p4 );
374 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
383 double oOverBins = 1.0 / ( float(
_pf.size() ) );
385 int nBinsAbove =
_pf.size();
388 while ( nBinsAbove > nBinsBelow + 1 ) {
389 middle = ( nBinsAbove + nBinsBelow + 1 ) >> 1;
390 if ( ranNum >=
_pf[middle] ) {
397 double bSize =
_pf[nBinsAbove] -
_pf[nBinsBelow];
404 return ( nBinsBelow + .5 ) * oOverBins;
407 double bFract = ( ranNum -
_pf[nBinsBelow] ) / bSize;
408 return ( nBinsBelow + bFract ) * oOverBins;
417 for (
unsigned i = 0; i <
_bins_mX.size(); i++ ) {
421 for (
unsigned i = 0; i <
_bins_q2.size(); i++ ) {
425 for (
unsigned i = 0; i <
_bins_El.size(); i++ ) {
429 int ibin = ibin_mX + ibin_q2 *
_bins_mX.size() +
432 if ( ( ibin_mX < 0 ) || ( ibin_q2 < 0 ) || ( ibin_El < 0 ) ) {
434 <<
"Cannot determine hybrid weight " 436 <<
"-> assign weight = 0" << endl;
456 <<
"EvtVub generator expected at least one " 457 <<
" weight > 0, but found none! " 458 <<
"Will terminate execution!" << endl;
double getWeight(double mX, double q2, double El)
void initProbMax() override
std::unique_ptr< EvtVubdGamma > _dGamma
double getArg(unsigned int j)
void decay(EvtParticle *p) override
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
double getFPFermi(const double &kplus)
std::string getName() override
void set(int i, double d)
std::vector< double > _pf
std::vector< double > _bins_mX
void readWeights(int startArg=0)
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)
std::vector< double > _weights
EvtParticle * getDaug(int i)
std::vector< double > _bins_q2
std::vector< double > _bins_El
EvtDecayBase * clone() override
static double getMaxMass(EvtId i)
EvtId getDaug(int i) const