187 {
188
189 int j;
190
191
194
195
197 double sh=0.0;
198 double mB,ml,
xlow,xhigh,qplus;
199 double El=0.0;
200 double Eh=0.0;
201 double kplus;
202 double q2, mX;
203
204 const double lp2epsilon=-10;
205 bool rew(true);
206 while(rew){
207
209
213
216
218 xhigh = mB-_mb;
219
220
221
222
223
224
225
226
227 kplus = 2*xhigh;
228
229 while( kplus >= xhigh || kplus <=
xlow
230 || (_alphas == 0 && kplus >= mB/2-_mb
231 + sqrt(mB*mB/4-_masscut*_masscut))) {
232 kplus = findPFermi();
234 }
235 qplus = mB-_mb-kplus;
236 if( (mB-qplus)/2.<=ml) continue;
237
238 int tryit = 1;
239 while (tryit) {
240
244 p2 = pow(10,lp2epsilon*p2);
245
247 if ( El > ml && El < mB/2) {
248
249 Eh = z*(mB-qplus)/2+qplus;
250 if ( Eh > 0 && Eh < mB ) {
251
252 sh = p2*pow(mB-qplus,2)+2*qplus*(Eh-qplus)+qplus*qplus;
253 if ( sh > _masscut*_masscut
254 && mB*mB + sh - 2*mB*Eh > ml*ml) {
255
257
259
261 <<
"EvtVubHybrid decay probability > 1 found: " <<
y << endl;
262 if (
y >= xran ) tryit = 0;
263 }
264 }
265 }
266 }
267
268
269 mX = sqrt(sh);
270 q2 = mB*mB + sh - 2*mB*Eh;
271
272
273 if (_nbins>0) {
277 if (
w >= xran1 ) rew =
false;
278 }
279 else {
280 rew = false;
281 }
282 }
283
284
285
286
287
288
289
290
291
295
296
297
298 double ptmp,sttmp;
299
300
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]);
306
307 if (_storeQplus ) {
308
309
310
311
312
313
314
315
316
317
318
319
320
322 }
323
324
325
326 double apWB = ptmp;
327 double pWB[4] = {mB-Eh,-pHB[1],-pHB[2],-pHB[3]};
328
329
330
331
332 double mW2 = mB*mB + sh - 2*mB*Eh;
333 double beta = ptmp/pWB[0];
334 double gamma = pWB[0]/sqrt(mW2);
335
336 double pLW[4];
337
338 ptmp = (mW2-ml*ml)/2/sqrt(mW2);
339 pLW[0] = sqrt(ml*ml + ptmp*ptmp);
340
341 double ctL = (El - gamma*pLW[0])/beta/gamma/ptmp;
342 if ( ctL < -1 ) ctL = -1;
343 if ( ctL > 1 ) ctL = 1;
344 sttmp = sqrt(1-ctL*ctL);
345
346
347 double xW[3] = {-pWB[2],pWB[1],0};
348
349 double zW[3] = {pWB[1]/apWB,pWB[2]/apWB,pWB[3]/apWB};
350
351 double lx = sqrt(xW[0]*xW[0]+xW[1]*xW[1]);
352 for (j=0;j<2;j++)
353 xW[j] /= lx;
354
355
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++)
359 yW[j] /= ly;
360
361
362
363
364 for (j=0;j<3;j++)
365 pLW[j+1] = sttmp*
cos(phL)*ptmp*xW[j]
366 + sttmp*
sin(phL)*ptmp*yW[j]
367 + ctL *ptmp*zW[j];
368
369 double apLW = ptmp;
370
371
372
373
374
375 double appLB = beta*gamma*pLW[0] + gamma*ctL*apLW;
376
377 ptmp = sqrt(El*El-ml*ml);
378 double ctLL = appLB/ptmp;
379
380 if ( ctLL > 1 ) ctLL = 1;
381 if ( ctLL < -1 ) ctLL = -1;
382
383 double pLB[4] = {El,0,0,0};
384 double pNB[4] = {pWB[0]-El,0,0,0};
385
386 for (j=1;j<4;j++) {
387 pLB[j] = pLW[j] + (ctLL*ptmp - ctL*apLW)/apWB*pWB[j];
388 pNB[j] = pWB[j] - pLB[j];
389 }
390
391 p4.
set(pLB[0],pLB[1],pLB[2],pLB[3]);
393
394 p4.
set(pNB[0],pNB[1],pNB[2],pNB[3]);
396
397 return ;
398}
double sin(const BesAngle a)
double cos(const BesAngle a)
ostream & report(Severity severity, const char *facility)
DOUBLE_PRECISION xlow[20]
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)
double getWeight(double mX, double q2, double El)
double getdGdxdzdp(const double &x, const double &z, const double &p2)