159 {
160
161 int j;
162
163
164 EvtParticle *xuhad, *lepton, *neutrino;
165 EvtVector4R p4;
166
167 double pp, pm, pl,
ml, El( 0.0 ), Eh( 0.0 ), sh( 0.0 );
168
170
174
177
178 bool tryit = true;
179
180 while ( tryit )
181 {
182
184 pm = pow( pm, 1. / 3. ) * _mB;
185
187 pl = sqrt( pl ) * pm;
188
190
191 _ntot++;
192
193 El = ( _mB - pl ) / 2.;
194 Eh = ( pp + pm ) / 2;
195 sh = pp * pm;
196
197 double pdf( 0. );
198 if ( pp < pl && El >
ml && sh > _masses[0] * _masses[0] &&
199 _mB * _mB + sh - 2 * _mB * Eh >
ml *
ml )
200 {
202 pdf = tripleDiff( pp, pl, pm );
203
204 if ( pdf > _dGMax )
205 {
207 << "EvtVubNLO pdf above maximum: " << pdf << " P+,P-,Pl,Pdf= " << pp << " " << pm
208 << " " << pl << " " << pdf << endl;
209
210 }
211 if ( pdf >= xran ) tryit = false;
212
213 if ( pdf > _gmax ) _gmax = pdf;
214 }
215 else
216 {
217
218 }
219
220
221 if ( !tryit && _nbins > 0 )
222 {
223 _ngood++;
225 double m = sqrt( sh );
226 j = 0;
227 while ( j < _nbins && m > _masses[j] ) j++;
228 double w = _weights[j - 1];
229 if (
w < xran1 ) tryit =
true;
230 }
231 }
232
233
234
235
236
237
238
239
240
241
242
246
247
248
249 double ptmp, sttmp;
250
251
252 sttmp = sqrt( 1 - ctH * ctH );
253 ptmp = sqrt( Eh * Eh - sh );
254 double pHB[4] = { Eh, ptmp * sttmp *
cos( phH ), ptmp * sttmp *
sin( phH ), ptmp * ctH };
255 p4.
set( pHB[0], pHB[1], pHB[2], pHB[3] );
257
258
259
260 double apWB = ptmp;
261 double pWB[4] = { _mB - Eh, -pHB[1], -pHB[2], -pHB[3] };
262
263
264
265
266 double mW2 = _mB * _mB + sh - 2 * _mB * Eh;
267
268
269
270 double beta = ptmp / pWB[0];
271 double gamma = pWB[0] / sqrt( mW2 );
272
273 double pLW[4];
274
275 ptmp = ( mW2 -
ml *
ml ) / 2 / sqrt( mW2 );
276 pLW[0] = sqrt(
ml *
ml + ptmp * ptmp );
277
278 double ctL = ( El - gamma * pLW[0] ) / beta / gamma / ptmp;
279 if ( ctL < -1 ) ctL = -1;
280 if ( ctL > 1 ) ctL = 1;
281 sttmp = sqrt( 1 - ctL * ctL );
282
283
284 double xW[3] = { -pWB[2], pWB[1], 0 };
285
286 double zW[3] = { pWB[1] / apWB, pWB[2] / apWB, pWB[3] / apWB };
287
288 double lx = sqrt( xW[0] * xW[0] + xW[1] * xW[1] );
289 for ( j = 0; j < 2; j++ ) xW[j] /= lx;
290
291
292 double yW[3] = { -pWB[1] * pWB[3], -pWB[2] * pWB[3], pWB[1] * pWB[1] + pWB[2] * pWB[2] };
293 double ly = sqrt( yW[0] * yW[0] + yW[1] * yW[1] + yW[2] * yW[2] );
294 for ( j = 0; j < 3; j++ ) yW[j] /= ly;
295
296
297
298
299 for ( j = 0; j < 3; j++ )
300 pLW[j + 1] = sttmp *
cos( phL ) * ptmp * xW[j] + sttmp *
sin( phL ) * ptmp * yW[j] +
301 ctL * ptmp * zW[j];
302
303 double apLW = ptmp;
304
305
306
307 double appLB = beta * gamma * pLW[0] + gamma * ctL * apLW;
308
309 ptmp = sqrt( El * El -
ml *
ml );
310 double ctLL = appLB / ptmp;
311
312 if ( ctLL > 1 ) ctLL = 1;
313 if ( ctLL < -1 ) ctLL = -1;
314
315 double pLB[4] = { El, 0, 0, 0 };
316 double pNB[8] = { pWB[0] - El, 0, 0, 0 };
317
318 for ( j = 1; j < 4; j++ )
319 {
320 pLB[j] = pLW[j] + ( ctLL * ptmp - ctL * apLW ) / apWB * pWB[j];
321 pNB[j] = pWB[j] - pLB[j];
322 }
323
324 p4.
set( pLB[0], pLB[1], pLB[2], pLB[3] );
326
327 p4.
set( pNB[0], pNB[1], pNB[2], pNB[3] );
329
330 return;
331}
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
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
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)