159 {
160
161 int j;
162
163
164 EvtParticle *xuhad, *lepton, *neutrino;
165 EvtVector4R p4;
166
167
169 double sh = 0.0;
170 double mB,
ml,
xlow, xhigh, qplus;
171 double El = 0.0;
172 double Eh = 0.0;
173 double kplus;
174 const double lp2epsilon = -10;
175 bool rew( true );
176 while ( rew )
177 {
178
180
184
187
189 xhigh = mB - _mb;
190
191
192
193
194
195
196
197
198 kplus = 2 * xhigh;
199
200 while ( kplus >= xhigh || kplus <=
xlow ||
201 ( _alphas == 0 &&
202 kplus >= mB / 2 - _mb + sqrt( mB * mB / 4 - _masses[0] * _masses[0] ) ) )
203 {
204 kplus = findPFermi();
205 kplus =
xlow + kplus * ( xhigh -
xlow );
206 }
207 qplus = mB - _mb - kplus;
208 if ( ( mB - qplus ) / 2. <=
ml )
continue;
209
210 int tryit = 1;
211 while ( tryit )
212 {
213
217 p2 = pow( 10, lp2epsilon *
p2 );
218
219 El =
x * ( mB - qplus ) / 2;
220 if ( El >
ml && El < mB / 2 )
221 {
222
223 Eh = z * ( mB - qplus ) / 2 + qplus;
224 if ( Eh > 0 && Eh < mB )
225 {
226
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 )
229 {
230
232
233 double y = _dGamma->getdGdxdzdp(
x, z,
p2 ) / _dGMax *
p2;
234
235 if ( y > 1 )
237 << "EvtVub decay probability > 1 found: " << y << endl;
238 if ( y >= xran ) tryit = 0;
239 }
240 }
241 }
242 }
243
244 if ( _nbins > 0 )
245 {
247 double m = sqrt( sh );
248 j = 0;
249 while ( j < _nbins && m > _masses[j] ) j++;
250 double w = _weights[j - 1];
251 if (
w >= xran1 ) rew =
false;
252 }
253 else { rew = false; }
254 }
255
256
257
258
259
260
261
262
263
267
268
269
270 double ptmp, sttmp;
271
272
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] );
278
279 if ( _storeQplus )
280 {
281
282
283
284
285
286
287
288
289
290
291
292
293
295 }
296
297
298
299 double apWB = ptmp;
300 double pWB[4] = { mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
301
302
303
304
305 double mW2 = mB * mB + sh - 2 * mB * Eh;
306 double beta = ptmp / pWB[0];
307 double gamma = pWB[0] / sqrt( mW2 );
308
309 double pLW[4];
310
311 ptmp = ( mW2 -
ml *
ml ) / 2 / sqrt( mW2 );
312 pLW[0] = sqrt(
ml *
ml + ptmp * ptmp );
313
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 );
318
319
320 double xW[3] = { -pWB[2], pWB[1], 0 };
321
322 double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
323
324 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
325 for ( j = 0; j < 2; j++ ) xW[j] /= lx;
326
327
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;
331
332
333
334
335 for ( j = 0; j < 3; j++ )
336 pLW[j + 1] = sttmp *
cos( phL ) * ptmp * xW[j] + sttmp *
sin( phL ) * ptmp * yW[j] +
337 ctL * ptmp * zW[j];
338
339 double apLW = ptmp;
340
341
342
343
344
345 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
346
347 ptmp = sqrt( El * El -
ml *
ml );
348 double ctLL = appLB / ptmp;
349
350 if ( ctLL > 1 ) ctLL = 1;
351 if ( ctLL < -1 ) ctLL = -1;
352
353 double pLB[4] = { El, 0, 0, 0 };
354 double pNB[4] = { pWB[0] - El, 0, 0, 0 };
355
356 for ( j = 1; j < 4; j++ )
357 {
358 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
359 pNB[j] = pWB[j] - pLB[j];
360 }
361
362 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
364
365 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
367
368 return;
369}
character *LEPTONflag integer iresonances real zeta5 real adp3 real large_3 real zeta5 common params adp3 common switch large_3 common lepton LEPTONflag common RESFIT IRESON common RES iresonances common alpgmu era0 common physparams ERMW common leptomass ml
DOUBLE_PRECISION xlow[20]
ostream & report(Severity severity, const char *facility)
double sin(const BesAngle a)
double cos(const BesAngle a)
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)
void set(int i, double d)