173 {
174
175 int j;
176
177
180
181 double pp,pm,pl,ml,El(0.0),Eh(0.0),sh(0.0);
182
183
184
186
190
193
194 bool tryit = true;
195
196 while (tryit) {
197
199 pm= pow(pm,1./3.)*_mB;
200
202 pl=sqrt(pl)*pm;
203
205
206 _ntot++;
207
208 El = (_mB-pl)/2.;
209 Eh = (pp+pm)/2;
210 sh = pp*pm;
211
212 double pdf(0.);
213 if (pp<pl && El>ml&& sh > _masses[0]*_masses[0]&& _mB*_mB + sh - 2*_mB*Eh > ml*ml) {
215 pdf = tripleDiff(pp,pl,pm);
216
217 if(pdf>_dGMax){
218 report(
ERROR,
"EvtGen") <<
"EvtVubNLO pdf above maximum: " <<pdf
219 <<" P+,P-,Pl,Pdf= "<<pp <<" "<<pm<<" "<<pl<<" "<<pdf<<endl;
220
221
222 }
223 if ( pdf >= xran ) tryit = false;
224
225 if(pdf>_gmax)_gmax=pdf;
226 } else {
227
228 }
229
230
231
232 if(!tryit && _nbins>0){
233 _ngood++;
235 double m = sqrt(sh);j=0;
236 while ( j < _nbins && m > _masses[j] ) j++;
237 double w = _weights[j-1];
238 if (
w < xran1 ) tryit =
true;
239 }
240 }
241
242
243
244
245
246
247
248
249
250
251
255
256
257
258 double ptmp,sttmp;
259
260
261 sttmp = sqrt(1-ctH*ctH);
262 ptmp = sqrt(Eh*Eh-sh);
263 double pHB[4] = {Eh,ptmp*sttmp*
cos(phH),ptmp*sttmp*
sin(phH),ptmp*ctH};
264 p4.set(pHB[0],pHB[1],pHB[2],pHB[3]);
266
267
268
269
270 double apWB = ptmp;
271 double pWB[4] = {_mB-Eh,-pHB[1],-pHB[2],-pHB[3]};
272
273
274
275
276 double mW2 = _mB*_mB + sh - 2*_mB*Eh;
277
278
279
280 double beta = ptmp/pWB[0];
281 double gamma = pWB[0]/sqrt(mW2);
282
283 double pLW[4];
284
285 ptmp = (mW2-ml*ml)/2/sqrt(mW2);
286 pLW[0] = sqrt(ml*ml + ptmp*ptmp);
287
288 double ctL = (El - gamma*pLW[0])/beta/gamma/ptmp;
289 if ( ctL < -1 ) ctL = -1;
290 if ( ctL > 1 ) ctL = 1;
291 sttmp = sqrt(1-ctL*ctL);
292
293
294 double xW[3] = {-pWB[2],pWB[1],0};
295
296 double zW[3] = {pWB[1]/apWB,pWB[2]/apWB,pWB[3]/apWB};
297
298 double lx = sqrt(xW[0]*xW[0]+xW[1]*xW[1]);
299 for (j=0;j<2;j++)
300 xW[j] /= lx;
301
302
303 double yW[3] = {-pWB[1]*pWB[3],-pWB[2]*pWB[3],pWB[1]*pWB[1]+pWB[2]*pWB[2]};
304 double ly = sqrt(yW[0]*yW[0]+yW[1]*yW[1]+yW[2]*yW[2]);
305 for (j=0;j<3;j++)
306 yW[j] /= ly;
307
308
309
310
311 for (j=0;j<3;j++)
312 pLW[j+1] = sttmp*
cos(phL)*ptmp*xW[j]
313 + sttmp*
sin(phL)*ptmp*yW[j]
314 + ctL *ptmp*zW[j];
315
316 double apLW = ptmp;
317
318
319
320 double appLB = beta*gamma*pLW[0] + gamma*ctL*apLW;
321
322 ptmp = sqrt(El*El-ml*ml);
323 double ctLL = appLB/ptmp;
324
325 if ( ctLL > 1 ) ctLL = 1;
326 if ( ctLL < -1 ) ctLL = -1;
327
328 double pLB[4] = {El,0,0,0};
329 double pNB[8] = {pWB[0]-El,0,0,0};
330
331 for (j=1;j<4;j++) {
332 pLB[j] = pLW[j] + (ctLL*ptmp - ctL*apLW)/apWB*pWB[j];
333 pNB[j] = pWB[j] - pLB[j];
334 }
335
336 p4.set(pLB[0],pLB[1],pLB[2],pLB[3]);
338
339 p4.set(pNB[0],pNB[1],pNB[2],pNB[3]);
341
342 return ;
343}
double sin(const BesAngle a)
double cos(const BesAngle a)
ostream & report(Severity severity, const char *facility)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
double double double * p4