65 phi[2] = -1.249864467;
66 phi[3] = -0.3067504308;
67 phi[4] = 0.9229242379;
68 phi[5] = -3.278567926;
69 phi[6] = -0.6346408622;
73 rho[2] = 0.7361782665;
110 mass[7] = 1.432787726;
122 mass_Pi0 = 0.1349766;
139 int GG[4][4] = { { 1, 0, 0, 0 }, { 0, -1, 0, 0 }, { 0, 0, -1, 0 }, { 0, 0, 0, -1 } };
140 for (
int i = 0; i < 4; i++ )
142 for (
int j = 0; j < 4; j++ ) { G[i][j] = GG[i][j]; }
185 double P1[4], P2[4], P3[4];
204 int g0[8] = { 1, 1, 4, 2, 500, 1, 1, 2 };
205 int spin[8] = { 1, 1, 0, 0, 0, 1, 1, 0 };
207 calEva( P1, P2, P3, mass, width, rho, phi, g0, spin, modetype, nstates, value );
214void EvtDsToKpipi::Com_Multi(
double a1[2],
double a2[2],
double res[2] ) {
215 res[0] = a1[0] * a2[0] - a1[1] * a2[1];
216 res[1] = a1[1] * a2[0] + a1[0] * a2[1];
218void EvtDsToKpipi::Com_Divide(
double a1[2],
double a2[2],
double res[2] ) {
219 double tmp = a2[0] * a2[0] + a2[1] * a2[1];
220 res[0] = ( a1[0] * a2[0] + a1[1] * a2[1] ) / tmp;
221 res[1] = ( a1[1] * a2[0] - a1[0] * a2[1] ) / tmp;
224double EvtDsToKpipi::SCADot(
double a1[4],
double a2[4] ) {
225 double _cal = a1[0] * a2[0] - a1[1] * a2[1] - a1[2] * a2[2] - a1[3] * a2[3];
228double EvtDsToKpipi::barrier(
int l,
double sa,
double sb,
double sc,
double r,
double mass ) {
229 double q = ( sa + sb - sc ) * ( sa + sb - sc ) / ( 4 * sa ) - sb;
230 if (
q < 0 )
q = 1e-16;
235 double q0 = ( sa0 + sb - sc ) * ( sa0 + sb - sc ) / ( 4 * sa0 ) - sb;
236 if ( q0 < 0 ) q0 = 1e-16;
237 double z0 = q0 * r * r;
240 if ( l == 1 ) F = sqrt( ( 1 + z0 ) / ( 1 + z ) );
241 if ( l == 2 ) F = sqrt( ( 9 + 3 * z0 + z0 * z0 ) / ( 9 + 3 * z + z * z ) );
244void EvtDsToKpipi::calt1(
double daug1[4],
double daug2[4],
double t1[4] ) {
247 for (
int i = 0; i < 4; i++ )
249 pa[i] = daug1[i] + daug2[i];
250 qa[i] = daug1[i] - daug2[i];
252 p = SCADot( pa, pa );
253 pq = SCADot( pa, qa );
255 for (
int i = 0; i < 4; i++ ) { t1[i] = qa[i] - tmp * pa[i]; }
257void EvtDsToKpipi::calt2(
double daug1[4],
double daug2[4],
double t2[4][4] ) {
260 calt1( daug1, daug2, t1 );
261 r = SCADot( t1, t1 ) / 3.0;
262 for (
int i = 0; i < 4; i++ ) { pa[i] = daug1[i] + daug2[i]; }
263 p = SCADot( pa, pa );
264 for (
int i = 0; i < 4; i++ )
266 for (
int j = 0; j < 4; j++ )
267 { t2[i][j] = t1[i] * t1[j] - r * ( G[i][j] - pa[i] * pa[j] / p ); }
273void EvtDsToKpipi::propagatorCBW(
double mass,
double width,
double sx,
double prop[2] ) {
277 b[0] = mass * mass - sx;
278 b[1] = -mass * width;
279 Com_Divide( a, b, prop );
281double EvtDsToKpipi::wid(
double mass2,
double mass,
double sa,
double sb,
double sc,
284 double m = sqrt( sa );
285 double tmp = sb - sc;
286 double tmp1 = sa + tmp;
287 double q = 0.25 * tmp1 * tmp1 / sa - sb;
288 if (
q < 0 )
q = 1e-16;
289 double tmp2 = mass2 + tmp;
290 double q0 = 0.25 * tmp2 * tmp2 / mass2 - sb;
291 if ( q0 < 0 ) q0 = 1e-16;
295 if ( l == 0 ) { widm = sqrt(
t ) * mass / m; }
296 else if ( l == 1 ) { widm =
t * sqrt(
t ) * mass / m * ( 1 + z0 ) / ( 1 + z ); }
298 { widm =
t *
t * sqrt(
t ) * mass / m * ( 9 + 3 * z0 + z0 * z0 ) / ( 9 + 3 * z + z * z ); }
302double EvtDsToKpipi::widl1(
double mass2,
double mass,
double sa,
double sb,
double sc,
305 double m = sqrt( sa );
306 double tmp = sb - sc;
307 double tmp1 = sa + tmp;
308 double q = 0.25 * tmp1 * tmp1 / sa - sb;
309 if (
q < 0 )
q = 1e-16;
310 double tmp2 = mass2 + tmp;
311 double q0 = 0.25 * tmp2 * tmp2 / mass2 - sb;
312 if ( q0 < 0 ) q0 = 1e-16;
315 double F = ( 1 + z0 ) / ( 1 + z );
317 widm =
t * sqrt(
t ) * mass / m * F;
320void EvtDsToKpipi::propagatorRBW(
double mass,
double width,
double sa,
double sb,
double sc,
321 double r2,
int l,
double prop[2] ) {
323 double mass2 = mass * mass;
328 b[1] = -mass * width * wid( mass2, mass, sa, sb, sc, r2, l );
329 Com_Divide( a, b, prop );
331void EvtDsToKpipi::propagatorFlatte(
double mass,
double width,
double sa,
double prop[2] ) {
334 double rhoPi[2], rhoKa[2];
336 q2_Pi = 0.25 * sa - mPi * mPi;
337 q2_Ka = 0.25 * sa - mKa * mKa;
341 rhoPi[0] = 2.0 * sqrt( q2_Pi / sa );
347 rhoPi[1] = 2.0 * sqrt( -q2_Pi / sa );
352 rhoKa[0] = 2.0 * sqrt( q2_Ka / sa );
358 rhoKa[1] = 2.0 * sqrt( -q2_Ka / sa );
364 b[0] = mass * mass - sa + 0.165 * rhoPi[1] + 0.69465 * rhoKa[1];
365 b[1] = -( 0.165 * rhoPi[0] + 0.69465 * rhoKa[0] );
366 Com_Divide( a, b, prop );
368void EvtDsToKpipi::propagatorGS(
double mass,
double width,
double sa,
double sb,
double sc,
369 double r2,
double prop[2] ) {
371 double mass2 = mass * mass;
372 double tmp = sb - sc;
373 double tmp1 = sa + tmp;
374 double q2 = 0.25 * tmp1 * tmp1 / sa - sb;
375 if ( q2 < 0 ) q2 = 1e-16;
377 double tmp2 = mass2 + tmp;
378 double q02 = 0.25 * tmp2 * tmp2 / mass2 - sb;
379 if ( q02 < 0 ) q02 = 1e-16;
381 double q = sqrt( q2 );
382 double q0 = sqrt( q02 );
383 double m = sqrt( sa );
384 double q03 = q0 * q02;
385 double tmp3 = log( mass + 2 * q0 ) + 1.2760418309;
387 double h = GS1 *
q / m * ( log( m + 2 *
q ) + 1.2760418309 );
388 double h0 = GS1 * q0 / mass * tmp3;
389 double dh = h0 * ( 0.125 / q02 - 0.5 / mass2 ) + GS3 / mass2;
390 double d = GS2 / q02 * tmp3 + GS3 * mass / q0 - GS4 * mass / q03;
391 double f = mass2 / q03 * ( q2 * ( h - h0 ) + ( mass2 - sa ) * q02 * dh );
393 a[0] = 1.0 + d * width / mass;
395 b[0] = mass2 - sa + width *
f;
396 b[1] = -mass * width * widl1( mass2, mass, sa, sb, sc, r2 );
397 Com_Divide( a, b, prop );
400void EvtDsToKpipi::Flatte_rhoab(
double sa,
double sb,
double sc,
double rho[2] ) {
401 double q = ( sa + sb - sc ) * ( sa + sb - sc ) / ( 4 * sa ) - sb;
404 rho[0] = 2 * sqrt(
q / sa );
410 rho[1] = 2 * sqrt( -
q / sa );
414void EvtDsToKpipi::propagatorKstr1430(
double mass,
double sx,
double* sb,
double* sc,
417 double unit[2] = { 1.0 };
418 double ci[2] = { 0, 1 };
420 Flatte_rhoab( sx, sb[0], sc[0], rho1 );
422 Flatte_rhoab( sx, sb[1], sc[1], rho2 );
423 double gKPi_Kstr1430 = 0.2990, gEtaPK_Kstr1430 = 0.0529;
424 double tmp1[2] = { gKPi_Kstr1430, 0 };
426 double tmp2[2] = { gEtaPK_Kstr1430, 0 };
428 Com_Multi( tmp1, rho1, tmp11 );
429 Com_Multi( tmp2, rho2, tmp22 );
430 double tmp3[2] = { tmp11[0] + tmp22[0], tmp11[1] + tmp22[1] };
432 Com_Multi( tmp3, ci, tmp31 );
433 double tmp4[2] = { mass * mass - sx - tmp31[0], -1.0 * tmp31[1] };
434 Com_Divide(
unit, tmp4, prop );
437double EvtDsToKpipi::DDalitz(
double P1[4],
double P2[4],
double P3[4],
int Ang,
440 double temp_PDF, v_re;
443 double B[2], s1, s2, s3, sR, sD;
444 for (
int i = 0; i < 4; i++ )
446 pR[i] = P1[i] + P2[i];
447 pD[i] = pR[i] + P3[i];
449 s1 = SCADot( P1, P1 );
450 s2 = SCADot( P2, P2 );
451 s3 = SCADot( P3, P3 );
452 sR = SCADot( pR, pR );
453 sD = SCADot( pD, pD );
455 for (
int i = 0; i != 4; i++ )
457 for (
int j = 0; j != 4; j++ )
461 if ( i == 0 ) G[i][j] = 1;
475 B[0] = barrier( 1, sR, s1, s2, 3.0, mass );
476 B[1] = barrier( 1, sD, sR, s3, 5.0, mDsM );
483 for (
int i = 0; i < 4; i++ ) { temp_PDF += t1[i] * T1[i] * G[i][i]; }
487 B[0] = barrier( 2, sR, s1, s2, 3.0, mass );
488 B[1] = barrier( 2, sD, sR, s3, 5.0, mDsM );
489 double t2[4][4], T2[4][4];
493 for (
int i = 0; i < 4; i++ )
495 for (
int j = 0; j < 4; j++ ) { temp_PDF += t2[i][j] * T2[j][i] * G[i][i] * G[j][j]; }
498 v_re = temp_PDF *
B[0] *
B[1];
502void EvtDsToKpipi::rhoab(
double sa,
double sb,
double sc,
double res[2] ) {
503 double tmp = sa + sb - sc;
504 double q = 0.25 * tmp * tmp / sa - sb;
507 res[0] = 2.0 * sqrt(
q / sa );
513 res[1] = 2.0 * sqrt( -
q / sa );
516void EvtDsToKpipi::rho4Pi(
double sa,
double res[2] ) {
517 double temp = 1.0 - 0.3116765584 / sa;
520 res[0] = sqrt( temp ) / ( 1.0 +
exp( 9.8 - 3.5 * sa ) );
526 res[1] = sqrt( -temp ) / ( 1.0 +
exp( 9.8 - 3.5 * sa ) );
530void EvtDsToKpipi::propagatorsigma500(
double sa,
double sb,
double sc,
532 double f = 0.5843 + 1.6663 * sa;
533 const double M = 0.9264;
534 const double mass2 = 0.85821696;
535 const double mpi2d2 = 0.00973989245;
536 double g1 =
f * ( sa - mpi2d2 ) / ( mass2 - mpi2d2 ) *
exp( ( mass2 - sa ) / 1.082 );
537 double rho1s[2], rho1M[2], rho2s[2], rho2M[2], rho1[2], rho2[2];
538 rhoab( sa, sb, sc, rho1s );
539 rhoab( mass2, sb, sc, rho1M );
541 rho4Pi( mass2, rho2M );
542 Com_Divide( rho1s, rho1M, rho1 );
543 Com_Divide( rho2s, rho2M, rho2 );
547 b[0] = mass2 - sa + M * (
g1 * rho1[1] + 0.0024 * rho2[1] );
548 b[1] = -M * (
g1 * rho1[0] + 0.0024 * rho2[0] );
549 Com_Divide( a, b, prop );
552void EvtDsToKpipi::calEva(
double* K,
double* Pi1,
double* Pi2,
double* mass1,
double* width1,
553 double* amp,
double* phase,
int* g0,
int* spin,
int* modetype,
554 int nstates,
double& Result ) {
558 double P23[4], P13[4];
559 double cof[2], amp_PDF[2], PDF[2];
563 for (
int i = 0; i < 4; i++ )
566 P13[i] = K[i] + Pi2[i];
567 P23[i] = Pi1[i] + Pi2[i];
569 s13 = SCADot( P13, P13 );
570 s23 = SCADot( P23, P23 );
573 s2 = SCADot( Pi1, Pi1 );
574 s3 = SCADot( Pi2, Pi2 );
575 double pro[2], temp_PDF, amp_tmp[2], temp_PDF1, temp_PDF2, pro1[2], pro2[2];
583 for (
int i = 0; i < nstates; i++ )
588 cof[0] = amp[i] *
cos( phase[i] );
589 cof[1] = amp[i] *
sin( phase[i] );
592 if ( modetype[i] == 13 )
594 temp_PDF = DDalitz( K, Pi2, Pi1, spin[i], mass1[i] );
596 propagatorRBW( mass1[i], width1[i], s13, mKa2, mPi2, rRess, spin[i], pro );
600 double skm2[2] = { s1, 0.95778 * 0.95778 };
601 double spi2[2] = { s3, mass_Kaon * mass_Kaon };
602 propagatorKstr1430( mass1[i], s13, skm2, spi2, pro );
609 amp_tmp[0] = temp_PDF * pro[0];
610 amp_tmp[1] = temp_PDF * pro[1];
613 if ( modetype[i] == 23 )
615 temp_PDF = DDalitz( Pi1, Pi2, K, spin[i], mass1[i] );
616 if ( g0[i] == 4 ) propagatorFlatte( mass1[i], width1[i], s23, pro );
617 if ( g0[i] == 3 ) propagatorCBW( mass1[i], width1[i], s23, pro );
619 propagatorRBW( mass1[i], width1[i], s23, mPi2, mPi2, rRess, spin[i], pro );
620 if ( g0[i] == 1 ) propagatorGS( mass1[i], width1[i], s23, mPi2, mPi2, 9.0, pro );
621 if ( g0[i] == 500 ) propagatorsigma500( s23, s2, s3, pro );
627 amp_tmp[0] = temp_PDF * pro[0];
628 amp_tmp[1] = temp_PDF * pro[1];
630 Com_Multi( amp_tmp, cof, amp_PDF );
631 PDF[0] += amp_PDF[0];
632 PDF[1] += amp_PDF[1];
637 double value = PDF[0] * PDF[0] + PDF[1] * PDF[1];
639 if ( value <= 0 ) value = 1e-20;
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
EvtComplex exp(const EvtComplex &c)
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in !Latex Output unit
double sin(const BesAngle a)
double cos(const BesAngle a)
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
void setProbMax(double prbmx)
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void setProb(double prob)
void decay(EvtParticle *p)
void getName(std::string &name)
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)