34 double EvtPawt(
double a,
double b,
double c )
36 double temp = ( a * a - ( b + c ) * ( b + c ) ) *
37 ( a * a - ( b - c ) * ( b - c ) );
43 return sqrt( temp ) / ( 2.0 * a );
54 double energy, p3, alpha, beta;
57 p4[0].
set( mass[0], 0.0, 0.0, 0.0 );
64 energy = ( mp * mp + mass[0] * mass[0] - mass[1] * mass[1] ) /
68 if ( energy > mass[0] ) {
69 p3 = sqrt( energy * energy - mass[0] * mass[0] );
72 p4[0].
set( energy, 0.0, 0.0, p3 );
76 p4[1].
set( energy, 0.0, 0.0, p3 );
91 double pm[5][30], pmin, pmax, psum, rnd[30];
92 double ran, wt, pa, costh, sinth, phi, p[4][30], be[4], bep, temp;
93 int i, il, ilr, i1, il1u, il1, il2r, ilu;
96 for ( i = 0; i < ndaug; i++ ) {
108 for ( i = 1; i < ndaug + 1; i++ ) {
109 psum = psum + mass[i - 1];
112 pm[4][ndaug - 1] = mass[ndaug - 1];
162 <<
"too many daughters for phase space..." << ndaug <<
" " 168 pmax = mp - psum + mass[ndaug - 1];
172 for ( ilr = 2; ilr < ndaug + 1; ilr++ ) {
173 il = ndaug + 1 - ilr;
174 pmax = pmax + mass[il - 1];
175 pmin = pmin + mass[il + 1 - 1];
176 wtmax = wtmax *
EvtPawt( pmax, pmin, mass[il - 1] );
183 for ( il1 = 2; il1 < il1u + 1; il1++ ) {
185 for ( il2r = 2; il2r < il1 + 1; il2r++ ) {
186 il2 = il1 + 1 - il2r;
187 if ( ran <= rnd[il2 - 1] )
189 rnd[il2 + 1 - 1] = rnd[il2 - 1];
192 rnd[il2 + 1 - 1] = ran;
195 rnd[ndaug - 1] = 0.0;
197 for ( ilr = 2; ilr < ndaug + 1; ilr++ ) {
198 il = ndaug + 1 - ilr;
199 pm[4][il - 1] = pm[4][il + 1 - 1] + mass[il - 1] +
200 ( rnd[il - 1] - rnd[il + 1 - 1] ) * ( mp - psum );
202 EvtPawt( pm[4][il - 1], pm[4][il + 1 - 1], mass[il - 1] );
206 <<
"wtmax to small in EvtPhaseSpace with " << ndaug
207 <<
" daughters" << endl;
214 for ( il = 1; il < ilu + 1; il++ ) {
215 pa =
EvtPawt( pm[4][il - 1], pm[4][il + 1 - 1], mass[il - 1] );
217 sinth = sqrt( 1.0 - costh * costh );
219 p[1][il - 1] = pa * sinth * cos( phi );
220 p[2][il - 1] = pa * sinth * sin( phi );
221 p[3][il - 1] = pa * costh;
222 pm[1][il + 1 - 1] = -p[1][il - 1];
223 pm[2][il + 1 - 1] = -p[2][il - 1];
224 pm[3][il + 1 - 1] = -p[3][il - 1];
225 p[0][il - 1] = sqrt( pa * pa + mass[il - 1] * mass[il - 1] );
226 pm[0][il + 1 - 1] = sqrt( pa * pa +
227 pm[4][il + 1 - 1] * pm[4][il + 1 - 1] );
230 p[0][ndaug - 1] = pm[0][ndaug - 1];
231 p[1][ndaug - 1] = pm[1][ndaug - 1];
232 p[2][ndaug - 1] = pm[2][ndaug - 1];
233 p[3][ndaug - 1] = pm[3][ndaug - 1];
235 for ( ilr = 2; ilr < ndaug + 1; ilr++ ) {
236 il = ndaug + 1 - ilr;
237 be[0] = pm[0][il - 1] / pm[4][il - 1];
238 be[1] = pm[1][il - 1] / pm[4][il - 1];
239 be[2] = pm[2][il - 1] / pm[4][il - 1];
240 be[3] = pm[3][il - 1] / pm[4][il - 1];
242 for ( i1 = il; i1 < ndaug + 1; i1++ ) {
243 bep = be[1] * p[1][i1 - 1] + be[2] * p[2][i1 - 1] +
244 be[3] * p[3][i1 - 1] + be[0] * p[0][i1 - 1];
245 temp = ( p[0][i1 - 1] + bep ) / ( be[0] + 1.0 );
246 p[1][i1 - 1] = p[1][i1 - 1] + temp * be[1];
247 p[2][i1 - 1] = p[2][i1 - 1] + temp * be[2];
248 p[3][i1 - 1] = p[3][i1 - 1] + temp * be[3];
253 for ( ilr = 0; ilr < ndaug; ilr++ ) {
254 p4[ilr].
set( p[0][ilr], p[1][ilr], p[2][ilr], p[3][ilr] );
272 double m12sqmax = ( M - m3 ) * ( M - m3 );
273 double m12sqmin = ( m1 + m2 ) * ( m1 + m2 );
275 double m13sqmax = ( M - m2 ) * ( M - m2 );
276 double m13sqmin = ( m1 + m3 ) * ( m1 + m3 );
278 double v1 = ( m12sqmax - m12sqmin ) * ( m13sqmax - m13sqmin );
279 double v2 = a * ( 1.0 / m12sqmin - 1.0 / m12sqmax ) * ( m13sqmax - m13sqmin );
283 double r = v1 / ( v1 + v2 );
285 double m13min, m13max;
299 double E3star = ( M * M - m12sq - m3 * m3 ) / sqrt( 4 * m12sq );
300 double E1star = ( m12sq + m1 * m1 - m2 * m2 ) / sqrt( 4 * m12sq );
301 double p3star = sqrt( E3star * E3star - m3 * m3 );
302 double p1star = sqrt( E1star * E1star - m1 * m1 );
303 m13max = ( E3star + E1star ) * ( E3star + E1star ) -
304 ( p3star - p1star ) * ( p3star - p1star );
305 m13min = ( E3star + E1star ) * ( E3star + E1star ) -
306 ( p3star + p1star ) * ( p3star + p1star );
308 }
while ( m13sq < m13min || m13sq > m13max );
310 double E2 = ( M * M + m2 * m2 - m13sq ) / ( 2.0 * M );
311 double E3 = ( M * M + m3 * m3 - m12sq ) / ( 2.0 * M );
312 double E1 = M - E2 - E3;
313 double p1mom = sqrt( E1 * E1 - m1 * m1 );
314 double p3mom = sqrt( E3 * E3 - m3 * m3 );
315 double cost13 = ( 2.0 * E1 * E3 + m1 * m1 + m3 * m3 - m13sq ) /
316 ( 2.0 * p1mom * p3mom );
327 p4[2].
set( E3, 0.0, 0.0, p3mom );
328 p4[0].
set( E1, p1mom * sqrt( 1.0 - cost13 * cost13 ), 0.0, p1mom * cost13 );
329 p4[1].
set( E2, -p1mom * sqrt( 1.0 - cost13 * cost13 ), 0.0,
330 -p1mom * cost13 - p3mom );
342 return 1.0 + a / ( m12sq * m12sq );
353 const double mParent = p->
mass();
357 const double mDaug1 = daug1->
mass();
358 const double mDaug2 = daug2->
mass();
359 const double mDaug3 = daug3->
mass();
360 const double mParentSq{ mParent * mParent };
361 const double mDaug1Sq{ mDaug1 * mDaug1 };
362 const double mDaug2Sq{ mDaug2 * mDaug2 };
363 const double mDaug3Sq{ mDaug3 * mDaug3 };
364 const double invMParent{ 1. / mParent };
366 const double En1 = 0.5 * ( mParentSq + mDaug1Sq - m23Sq ) * invMParent;
367 const double En3 = 0.5 * ( mParentSq + mDaug3Sq - m12Sq ) * invMParent;
368 const double En2 = mParent - En1 - En3;
369 const double p1mag = std::sqrt( En1 * En1 - mDaug1Sq );
370 const double p2mag = std::sqrt( En2 * En2 - mDaug2Sq );
371 double cosPhi = 0.5 * ( mDaug1Sq + mDaug2Sq + 2 * En1 * En2 - m12Sq ) /
374 double sinPhi = std::sqrt( 1 - cosPhi * cosPhi );
378 const double p2x = p2mag * cosPhi;
379 const double p2y = p2mag * sinPhi;
380 const double p3x = -p1mag - p2x;
381 const double p3y = -p2y;
static double PhaseSpacePole(double M, double m1, double m2, double m3, double a, EvtVector4R p4[10])
void applyRotateEuler(double alpha, double beta, double gamma)
std::ostream & EvtGenReport(EvtGenSeverity severity, const char *facility=0)
virtual void init(EvtId part_n, const EvtVector4R &p4)=0
double EvtPawt(double a, double b, double c)
static const double twoPi
void set(int i, double d)
static void ThreeBodyKine(const double m12Sq, const double m23Sq, EvtParticle *p)
static double PhaseSpace(int ndaug, double mass[30], EvtVector4R p4[30], double mp)
EvtParticle * getDaug(int i)