|
EvtGen
2.0.0
Monte Carlo generator of particle decays, in particular the weak decays of heavy flavour particles such as B mesons.
|
Go to the documentation of this file. 38 #define square( x ) ( ( x ) * ( x ) ) 55 double cbeta = cos( betaCP ); 56 double sbeta = sin( betaCP ); 62 double StrongPhase = 0; 63 EvtComplex StrongExp( cos( StrongPhase ), sin( StrongPhase ) ); 78 EvtComplex Mat_Ppm( cos( -0.5 ), sin( -0.5 ) ); 83 EvtComplex Mat_P1 = 0.5 * ( Mat_Ppm - Mat_Pmp ); 84 EvtComplex Mat_P0 = 0.5 * ( Mat_Ppm + Mat_Pmp ); 100 Mat_Tpm = StrongExp * Mat_Tpm; 101 Nat_Tpm = StrongExp * Nat_Tpm; 103 Mat_S1 = Mat_Tp0 + 2. * Mat_P1; 104 Mat_S2 = Mat_T0p - 2. * Mat_P1; 105 Mat_S3 = Mat_Tpm + Mat_P1 + Mat_P0; 106 Mat_S4 = Mat_Tmp - Mat_P1 + Mat_P0; 107 Mat_S5 = -Mat_Tpm - Mat_Tmp + Mat_Tp0 + Mat_T0p - 2. * Mat_P0; 109 Nat_S1 = Nat_Tp0 + 2. * Nat_P1; 110 Nat_S2 = Nat_T0p - 2. * Nat_P1; 111 Nat_S3 = Nat_Tpm + Nat_P1 + Nat_P0; 112 Nat_S4 = Nat_Tmp - Nat_P1 + Nat_P0; 113 Nat_S5 = -Nat_Tpm - Nat_Tmp + Nat_Tp0 + Nat_T0p - 2. * Nat_P0; 136 double& Imag_B0, double& Real_B0bar, double& Imag_B0bar ) 139 double AB0, AB0bar, Ainter, R1, R2; 152 firstStep( p_pi_plus, p_p2, p_pi_minus, 1 ); 153 ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0, 154 Real_B0bar, Imag_B0bar, iset ); 155 } while ( ierr != 0 ); 156 } else if ( iset < 0 ) { 157 p_p2 = p_gamma_1 + p_gamma_2; 158 ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0, 159 Real_B0bar, Imag_B0bar, iset ); 161 std::cout << "Provided kinematics is not physical\n"; 162 std::cout << "Program will stop\n"; 170 for ( int i = 0; i < endLoop; ++i ) { 175 firstStep( p_pi_plus, p_p2, p_pi_minus, 1 ); 176 ierr = compute3pi( p_pi_plus, p_p2, p_pi_minus, Real_B0, Imag_B0, 177 Real_B0bar, Imag_B0bar, iset ); 183 Ainter = Real_B0 * Imag_B0bar - Imag_B0 * Real_B0bar; 184 R1 = ( AB0 - AB0bar ) / ( AB0 + AB0bar ); 185 R2 = ( 2.0 * Ainter ) / ( AB0 + AB0bar ); 186 factor = ( 1.0 + sqrt( square( R1 ) + square( R2 ) ) ) * 187 ( AB0 + AB0bar ) / 2.0; 212 double& Real_B0, double& Imag_B0, 213 double& Real_B0bar, double& Imag_B0bar ) 229 Real_B0bar, Imag_B0bar, iset ); 230 } while ( ierr != 0 ); 231 } else if ( iset < 0 ) { 232 ierr = compute3piMPP( p_p1, p_p2, p_p3, Real_B0, Imag_B0, Real_B0bar, 235 std::cout << "Provided kinematics is not physical\n"; 236 std::cout << "Program will stop\n"; 244 for ( int i = 0; i < endLoop; ++i ) { 251 Real_B0bar, Imag_B0bar, iset ); 282 double& Real_B0, double& Imag_B0, 283 double& Real_B0bar, double& Imag_B0bar ) 300 Real_B0bar, Imag_B0bar, iset ); 301 } while ( ierr != 0 ); 302 } else if ( iset < 0 ) { 303 p_p2 = p_p1_gamma1 + p_p1_gamma2; 304 p_p3 = p_p2_gamma1 + p_p2_gamma2; 305 ierr = compute3piP00( p_p1, p_p2, p_p3, Real_B0, Imag_B0, Real_B0bar, 308 std::cout << "Provided kinematics is not physical\n"; 309 std::cout << "Program will stop\n"; 317 for ( int i = 0; i < endLoop; ++i ) { 324 Real_B0bar, Imag_B0bar, iset ); 358 double& Real_B0, double& Imag_B0, double& Real_B0bar, 373 firstStep( p_K_plus, p_pi_minus, p_p3, 0 ); 374 ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0, 375 Real_B0bar, Imag_B0bar, iset ); 376 } while ( ierr != 0 ); 377 } else if ( iset < 0 ) { 378 p_p3 = p_gamma_1 + p_gamma_2; 379 ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0, 380 Real_B0bar, Imag_B0bar, iset ); 382 std::cout << "Provided kinematics is not physical\n"; 383 std::cout << "Program will stop\n"; 391 for ( int i = 0; i < endLoop; ++i ) { 395 firstStep( p_K_plus, p_pi_minus, p_p3, 0 ); 396 ierr = computeKpipi( p_K_plus, p_pi_minus, p_p3, Real_B0, Imag_B0, 397 Real_B0bar, Imag_B0bar, iset ); 433 const double m1sq = p1. mass2(); 434 const double m2sq = p2. mass2(); 435 const double m3sq = p3. mass2(); 436 double min_m12, min_m13, min_m23; 443 min_m12 = m1sq + m2sq + 2 * sqrt( m1sq * m2sq ); 444 min_m13 = m1sq + m3sq + 2 * sqrt( m1sq * m3sq ); 445 min_m23 = m2sq + m3sq + 2 * sqrt( m2sq * m3sq ); 447 min_m12 = m1sq + m2sq; 448 min_m13 = m1sq + m3sq; 449 min_m23 = m2sq + m3sq; 453 double m13, m12, m23; 483 if ( ( m23 < min_m23 ) || ( m23 > max_m23 ) ) 485 if ( ( m13 < min_m13 ) || ( m13 > max_m13 ) ) 487 if ( ( m12 < min_m12 ) || ( m12 > max_m12 ) ) 494 p1mom = square( E1 ) - m1sq; 495 p2mom = square( E2 ) - m2sq; 496 p3mom = square( E3 ) - m3sq; 497 if ( p1mom < 0 || p2mom < 0 || p3mom < 0 ) { 501 p1mom = sqrt( p1mom ); 502 p2mom = sqrt( p2mom ); 503 p3mom = sqrt( p3mom ); 505 cost13 = ( 2. * E1 * E3 + m1sq + m3sq - m13 ) / ( 2. * p1mom * p3mom ); 506 cost12 = ( 2. * E1 * E2 + m1sq + m2sq - m12 ) / ( 2. * p1mom * p2mom ); 507 cost23 = ( 2. * E2 * E3 + m2sq + m3sq - m23 ) / ( 2. * p2mom * p3mom ); 508 if ( cost13 < -1. || cost13 > 1. || cost12 < -1. || cost12 > 1. || 509 cost23 < -1. || cost23 > 1. ) { 513 } while ( eventOK == false ); 516 p3. set( E3, 0, 0, p3mom ); 517 p1. set( E1, p1mom * sqrt( 1 - square( cost13 ) ), 0, p1mom * cost13 ); 519 for ( int i = 1; i < 4; ++i ) { 523 std::cout << "Unphysical p1 generated: " << p1 << std::endl; 526 std::cout << "Unphysical p2 generated: " << p2 << std::endl; 529 std::cout << "Unphysical p3 generated: " << p3 << std::endl; 531 double testMB2 = MB2; 545 if ( fabs( m12 + m13 + m23 - testMB2 ) > 1e-4 ) { 546 std::cout << "Unphysical event generated: " << m12 << " " << m13 << " " 552 double MB2, double m1sq, double m2sq, 568 static bool phaseSpace = false; 571 double min_m12 = m1sq + m2sq + 2 * sqrt( m1sq * m2sq ); 574 double min_m13 = m1sq + m3sq + 2 * sqrt( m1sq * m3sq ); 577 double min_m23 = m2sq + m3sq + 2 * sqrt( m2sq * m3sq ); 586 double x = std::tan( y ); 591 m23 = MB2 - m12 - m13; 598 double x = std::tan( y ); 603 m23 = MB2 - m12 - m13; 610 double x = std::tan( y ); 615 m12 = MB2 - m23 - m13; 620 double MB2, double m1sq, double m2sq, 636 static bool phaseSpace = false; 639 double min_m12 = m1sq + m2sq; 642 double min_m13 = m1sq + m3sq; 645 double min_m23 = m2sq + m3sq; 650 double x = std::tan( y ); 662 m23 = MB2 - m12 - m13; 663 } else if ( z < 2. ) { 670 m23 = MB2 - m12 - m13; 678 m13 = MB2 - m12 - m23; 683 double MB2, double m1sq, double m2sq, 699 static bool phaseSpace = false; 702 double min_m12 = m1sq + m2sq; 705 double min_m13 = m1sq + m3sq; 711 double x = std::tan( y ); 723 m23 = MB2 - m12 - m13; 731 m23 = MB2 - m12 - m13; 736 double MB2, double m1sq, double m2sq, 752 static bool phaseSpace = false; 755 double min_m12 = m1sq + m2sq; 758 double min_m13 = m1sq + m3sq; 764 double x = std::tan( y ); 776 m23 = MB2 - m12 - m13; 784 m23 = MB2 - m12 - m13; 788 double& real_B0, double& imag_B0, 789 double& real_B0bar, double& imag_B0bar, int iset ) 793 double m12 = ( p1 + p2 ).mass(); 794 double m13 = ( p1 + p3 ).mass(); 795 double m23 = ( p2 + p3 ).mass(); 806 Wtot = 1. / sqrt( W12 + W13 + W23 ); 817 EvtComplex MatBp = ( Mat_1 + Mat_2 + Mat_3 ) * Wtot; 819 Mat_1 = Nat_S3 * Mat_rhom; 820 Mat_2 = Nat_S4 * Mat_rhop; 821 Mat_3 = Nat_S5 * Mat_rho0 * 0.5; 823 EvtComplex MatBm = ( Mat_1 + Mat_2 + Mat_3 ) * Wtot; 825 real_B0 = real( MatBp ); 826 imag_B0 = imag( MatBp ); 828 real_B0bar = real( MatBm ); 829 imag_B0bar = imag( MatBm ); 836 double& real_B0bar, double& imag_B0bar, int iset ) 839 const double ASHQ = sqrt( 2. ); 840 double m12 = ( p1 + p2 ).mass(); 841 double m13 = ( p1 + p3 ).mass(); 850 Wtot = 1. / sqrt( W12 + W13 ); 859 real_B0 = real( MatBp ); 860 imag_B0 = imag( MatBp ); 862 real_B0bar = real( MatBm ); 863 imag_B0bar = imag( MatBm ); 870 double& real_B0bar, double& imag_B0bar, int iset ) 873 const double ASHQ = sqrt( 2. ); 874 double m12 = ( p1 + p2 ).mass(); 875 double m13 = ( p1 + p3 ).mass(); 884 Wtot = 1. / sqrt( W12 + W13 ); 893 real_B0 = real( MatBp ); 894 imag_B0 = imag( MatBp ); 896 real_B0bar = real( MatBm ); 897 imag_B0bar = imag( MatBm ); 903 double& real_B0, double& imag_B0, 904 double& real_B0bar, double& imag_B0bar, int iset ) 908 double m12 = ( p1 + p2 ).mass(); 909 double m13 = ( p1 + p3 ).mass(); 910 double m23 = ( p2 + p3 ).mass(); 923 Wtot = 1. / sqrt( W12 + W13 + W23 ); 944 real_B0 = real( MatB0 ) * Wtot; 945 imag_B0 = imag( MatB0 ) * Wtot; 946 real_B0bar = real( MatB0bar ) * Wtot; 947 imag_B0bar = imag( MatB0bar ) * Wtot; 959 double c2 = cos( phi2 ); 960 double c3 = cos( phi3 ); 962 double s1 = sqrt( 1. - square( c1 ) ); 963 double s2 = sin( phi2 ); 964 double s3 = sin( phi3 ); 970 rotMatrix[1][1] = c1 * c2 * c3 - s2 * s3; 971 rotMatrix[1][2] = c1 * c2 * s3 + s2 * c3; 973 rotMatrix[2][1] = -c1 * s2 * c3 - c2 * s3; 974 rotMatrix[2][2] = -c1 * s2 * s3 + c2 * c3; 978 for ( int i = 1; i < 4; ++i ) { 979 mom[i - 1] = p. get( i ); 982 for ( int i = 0; i < 3; ++i ) { 983 for ( int j = 0; j < 3; ++j ) { 992 double EGammaCmsPi0 = sqrt( p. mass2() ) / 2.; 995 double sinThetaRot = sqrt( 1. - square( cosThetaRot ) ); 998 pgamma1. set( 1, EGammaCmsPi0 * sinThetaRot * cos( PhiRot ) ); 999 pgamma1. set( 2, EGammaCmsPi0 * sinThetaRot * sin( PhiRot ) ); 1000 pgamma1. set( 3, EGammaCmsPi0 * cosThetaRot ); 1001 pgamma1. set( 0, EGammaCmsPi0 ); 1003 for ( int i = 1; i < 4; ++i ) { 1004 pgamma2. set( i, -pgamma1. get( i ) ); 1006 pgamma2. set( 0, pgamma1. get( 0 ) ); 1016 bool pipiMode = true; 1018 if ( Mass > 1e-5 ) { 1022 bool relatBW = true; 1027 double m12 = ( p1 + p2 ).mass(); 1028 double e12 = ( p1 + p2 ).get( 0 ); 1032 beta = sqrt( argu ); 1034 std::cout << "Abnormal beta ! Argu = " << argu << std::endl; 1037 double gamma = e12 / m12; 1039 double m13sq = ( p1 + p3 ).mass2(); 1040 double costet = ( 2. * p1. get( 0 ) * p3. get( 0 ) - m13sq + p1. mass2() + 1044 double p1z = p1. d3mag() * costet; 1045 double p1zcms12 = gamma * ( p1z + beta * p1. get( 0 ) ); 1046 double e1cms12 = gamma * ( p1. get( 0 ) + beta * p1z ); 1047 double p1cms12 = sqrt( square( e1cms12 ) - p1. mass2() ); 1048 double coscms = p1zcms12 / p1cms12; 1052 double m12_2 = square( m12 ); 1057 factor = coscms * Gam_rho / factor; 1058 double numReal = ( Mass_rho - m12 ) * factor; 1059 double numImg = 0.5 * Gam_rho * factor; 1068 double factor = 2 * ( square( Mass - m12 ) + square( 0.5 * Width ) ); 1069 factor = coscms * Width / factor; 1070 double numReal = ( Mass - m12 ) * factor; 1071 double numImg = 0.5 * Width * factor; 1081 const bool kuhn_santa = true; 1084 double AmRho, GamRho, AmRhoP, GamRhoP, beta, AmRhoPP, GamRhoPP, gamma; 1119 ( 1. + beta + gamma ); 1124 ( 1. + beta + gamma ); 1137 double tmp = ( ( s - Am2Min ) / ( Am2 - Am2Min ) ); 1138 double G = Gam * ( Am2 / s ) * sqrt( square( tmp ) * tmp ); 1140 double X = Am2 * ( Am2 - s ); 1141 double Y = Am2 * sqrt( s ) * G; 1150 const double AmPi2 = square( 0.13956995 ); 1151 return EvtRBW( s, Am2, Gam, 4. * AmPi2 ); 1157 const double AmPi2 = square( 0.13956995 ); 1159 if ( s < 4. * AmPi2 ) { 1163 double tmp = ( ( s - 4. * AmPi2 ) / ( Am2 - 4. * AmPi2 ) ); 1165 double G = Gam * ( Am2 / s ) * sqrt( square( tmp ) * tmp ); 1166 double z1 = Am2 - s + Evtfs( s, Am2, Gam ); 1167 double z2 = sqrt( s ) * G; 1168 double z3 = Am2 + d( Am2 ) * Gam * sqrt( Am2 ); 1181 const double lpi = 3.141593; 1182 const double AmPi = 0.13956995; 1183 const double AmPi2 = square( AmPi ); 1184 double AmRho = sqrt( AmRho2 ); 1185 double k_AmRho2 = k( AmRho2 ); 1186 double result = 3. / lpi * AmPi2 / square( k_AmRho2 ) * 1187 log( ( AmRho + 2. * k_AmRho2 ) / ( 2. * AmPi ) ) + 1188 AmRho / ( 2. * pi * k_AmRho2 ) - 1189 AmPi2 * AmRho / ( pi * ( square( k_AmRho2 ) * k_AmRho2 ) ); 1195 const double AmPi2 = square( 0.13956995 ); 1196 return 0.5 * sqrt( s - 4. * AmPi2 ); 1201 double k_s = k( s ); 1202 double k_Am2 = k( AmRho2 ); 1204 return GamRho * AmRho2 / ( square( k_Am2 ) * k_Am2 ) * 1205 ( square( k_s ) * ( h( s ) - h( AmRho2 ) ) + 1206 ( AmRho2 - s ) * square( k_Am2 ) * dh_ds( AmRho2 ) ); 1211 const double pi = 3.141593; 1212 const double AmPi = 0.13956995; 1213 double sqrts = sqrt( s ); 1214 double k_s = k( s ); 1215 return 2. / pi * ( k_s / sqrts ) * 1216 log( ( sqrts + 2. * k_s ) / ( 2. * AmPi ) ); 1221 const double pi = 3.141593; 1222 return h( s ) * ( 1. / ( 8. * square( k( s ) ) ) - 1. / ( 2 * s ) ) + 1223 1. / ( 2. * pi * s );
EvtComplex EvtRBW(double s, double Am2, double Gam, double Am2Min)
void generateSqMasses_3piMPP(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
void Evt3piMPP(double alpha, int iset, EvtVector4R &p_p1, EvtVector4R &p_p2, EvtVector4R &p_p3, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
void rotation(EvtVector4R &p, int newRot)
double Evtfs(double s, double AmRho2, double GamRho)
void setConstants(double balpha, double bbeta)
int compute3piP00(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
EvtComplex BreitWigner(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, int &ierr, double Mass=0, double Width=0)
void set(int i, double d)
void EvtKpipi(double alpha, double beta, int iset, EvtVector4R &p_K_plus, EvtVector4R &p_pi_minus, EvtVector4R &p_gamma_1, EvtVector4R &p_gamma_2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
void generateSqMasses_Kpipi(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
int computeKpipi(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
void gammaGamma(EvtVector4R &p, EvtVector4R &pgamma1, EvtVector4R &pgamma2)
void firstStep(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, int mode)
void generateSqMasses_3piP00(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
void Evt3pi(double alpha, int iset, EvtVector4R &p_K_plus, EvtVector4R &p_pi_minus, EvtVector4R &p_gamma_1, EvtVector4R &p_gamma_2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
int compute3piMPP(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
EvtComplex EvtCRhoF_W(double s)
double imag(const EvtComplex &c)
void applyBoostTo(const EvtVector4R &p4, bool inverse=false)
void generateSqMasses_3pi(double &m12, double &m13, double &m23, double MB2, double m1sq, double m2sq, double m3sq)
EvtComplex EvtcBW_GS(double s, double Am2, double Gam)
int compute3pi(EvtVector4R &p1, EvtVector4R &p2, EvtVector4R &p3, double &real_B0, double &imag_B0, double &real_B0bar, double &imag_B0bar, int set)
EvtComplex EvtcBW_KS(double s, double Am2, double Gam)
double real(const EvtComplex &c)
void Evt3piP00(double alpha, int iset, EvtVector4R &p_p1, EvtVector4R &p_p1_gamma1, EvtVector4R &p_p1_gamma2, EvtVector4R &p_p2_gamma1, EvtVector4R &p_p2_gamma2, double &Real_B0, double &Imag_B0, double &Real_B0bar, double &Imag_B0bar)
|