9#include <generators/evtgen/EvtGenModelRegister.h>
14#include "EvtGenBase/EvtRandom.hh"
15#include "EvtGenBase/EvtParticle.hh"
16#include "EvtGenBase/EvtGenKine.hh"
17#include "EvtGenBase/EvtPDL.hh"
18#include "EvtGenBase/EvtReport.hh"
19#include "EvtGenBase/EvtConst.hh"
20#include "EvtGenBase/EvtId.hh"
22#include "generators/evtgen/models/EvtBtoKK0K0.h"
25using namespace std::complex_literals;
36 EvtBtoKK0K0::~EvtBtoKK0K0() {}
38 std::string EvtBtoKK0K0::getName()
43 EvtDecayBase* EvtBtoKK0K0::clone()
45 return new EvtBtoKK0K0;
48 void EvtBtoKK0K0::decay(EvtParticle* p)
53 const int max_Ntry = 10000;
56 p->initializePhaseSpace(getNDaug(), getDaugs());
58 EvtParticle* ChargedKaon = p->getDaug(0);
59 EvtParticle* NeutralKaon_1 = p->getDaug(1);
60 EvtParticle* NeutralKaon_2 = p->getDaug(2);
62 EvtVector4R mom_ChargedKaon = ChargedKaon->getP4();
63 EvtVector4R mom_NeutralKaon_1 = NeutralKaon_1->getP4();
64 EvtVector4R mom_NeutralKaon_2 = NeutralKaon_2->getP4();
66 EvtVector4R mom_sum_1 = mom_ChargedKaon + mom_NeutralKaon_1;
67 EvtVector4R mom_sum_2 = mom_ChargedKaon + mom_NeutralKaon_2;
69 double s_1 = mom_sum_1.mass2();
70 double s_2 = mom_sum_2.mass2();
84 const double Probability_max = 871.390583;
85 double Probability_value = Probability(s13, s23);
86 double Probability_ratio = Probability_value / Probability_max;
88 double xbox = EvtRandom::Flat(0.0, 1.0);
90 if (xbox < Probability_ratio)
break;
92 if (Ntry > max_Ntry) {
93 std::cout <<
"try to set the kinematics more than 10000 times. abort.\n";
104 void EvtBtoKK0K0::initProbMax()
110 void EvtBtoKK0K0::init()
120 EvtId KaonPlusType = getDaug(0);
121 EvtId KaonZeroType_1 = getDaug(1);
122 EvtId KaonZeroType_2 = getDaug(2);
127 if ((KaonPlusType == EvtPDL::getId(
"K+")) || (KaonPlusType == EvtPDL::getId(
"K-"))) KaonPlustyp++;
128 if ((KaonZeroType_1 == EvtPDL::getId(
"K0")) ||
129 (KaonZeroType_1 == EvtPDL::getId(
"anti-K0")) ||
130 (KaonZeroType_1 == EvtPDL::getId(
"K_S0")) ||
131 (KaonZeroType_1 == EvtPDL::getId(
"K_L0"))) KaonZerotyp++;
132 if ((KaonZeroType_2 == EvtPDL::getId(
"K0")) ||
133 (KaonZeroType_2 == EvtPDL::getId(
"anti-K0")) ||
134 (KaonZeroType_2 == EvtPDL::getId(
"K_S0")) ||
135 (KaonZeroType_2 == EvtPDL::getId(
"K_L0"))) KaonZerotyp++;
137 if ((KaonPlustyp != 1) || (KaonZerotyp != 2)) {
139 std::cout <<
"The first dauther should be charged Kaon. The second and third daughters should be K0, anti-K0, K_L0, or K_S0.\n";
149 double EvtBtoKK0K0::Probability(
double s13,
double s23)
151 std::complex<double> total_amplitude = Amplitude(s13, s23,
"f980",
false) + Amplitude(s13, s23,
"f1500",
false) + Amplitude(s13,
152 s23,
"f1525",
false) + Amplitude(s13, s23,
"f1710",
false) + Amplitude(s13, s23,
"chic0",
false) + Amplitude(s13, s23,
"NR",
false);
153 std::complex<double> total_amplitude_isobar = Amplitude(s13, s23,
"f980",
true) + Amplitude(s13, s23,
"f1500",
154 true) + Amplitude(s13, s23,
"f1525",
true) + Amplitude(s13, s23,
"f1710",
true) + Amplitude(s13, s23,
"chic0",
155 true) + Amplitude(s13, s23,
"NR",
true);
156 return std::abs(total_amplitude) * std::abs(total_amplitude) + std::abs(total_amplitude_isobar) * std::abs(total_amplitude_isobar);
160 std::complex<double> EvtBtoKK0K0::Amplitude(
double s13,
double s23,
const char* resonance,
bool isobar =
false)
163 if (strcmp(resonance,
"f980") == 0) {
164 std::complex<double> a;
165 if (isobar ==
false) a = c_f980 * std::exp(1i * DegreeToRadian(phi_f980));
166 else a = c_f980 * std::exp(1i * DegreeToRadian(phi_f980));
167 return a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s23, s13, resonance));
168 }
else if (strcmp(resonance,
"f1500") == 0) {
169 std::complex<double> a;
170 if (isobar ==
false) a = c_f1500 * std::exp(1i * DegreeToRadian(phi_f1500));
171 else a = c_f1500 * std::exp(1i * DegreeToRadian(phi_f1500));
172 return a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s23, s13, resonance));
173 }
else if (strcmp(resonance,
"f1525") == 0) {
174 std::complex<double> a;
175 if (isobar ==
false) a = c_f1525 * std::exp(1i * DegreeToRadian(phi_f1525));
176 else a = c_f1525 * std::exp(1i * DegreeToRadian(phi_f1525));
177 return a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s23, s13, resonance));
178 }
else if (strcmp(resonance,
"f1710") == 0) {
179 std::complex<double> a;
180 if (isobar ==
false) a = c_f1710 * std::exp(1i * DegreeToRadian(phi_f1710));
181 else a = c_f1710 * std::exp(1i * DegreeToRadian(phi_f1710));
182 return a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s23, s13, resonance));
183 }
else if (strcmp(resonance,
"chic0") == 0) {
184 std::complex<double> a;
185 if (isobar ==
false) a = c_chic0 * std::exp(1i * (DegreeToRadian(phi_chic0) + DegreeToRadian(delta_chic0)));
186 else a = c_chic0 * std::exp(1i * (DegreeToRadian(phi_chic0) - DegreeToRadian(delta_chic0)));
187 return a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s23, s13, resonance));
188 }
else if (strcmp(resonance,
"NR") == 0) {
190 double Omega = 0.5 * (mB + (1.0 / 3.0) * (mKp + mKL0 + mKL0));
191 double m12 = std::sqrt(mB * mB + mKp * mKp + mKL0 * mKL0 + mKL0 * mKL0 - s13 - s23);
192 double x = m12 - Omega;
194 std::complex<double> aS0;
195 std::complex<double> aS1;
196 std::complex<double> aS2;
198 if (isobar ==
false) {
199 aS0 = aS0_c_NR * (1 + b_NR) * std::exp(1i * DegreeToRadian(aS0_phi_NR));
200 aS1 = aS1_c_NR * (1 + b_NR) * std::exp(1i * DegreeToRadian(aS1_phi_NR));
201 aS2 = aS2_c_NR * (1 + b_NR) * std::exp(1i * DegreeToRadian(aS2_phi_NR));
203 aS0 = aS0_c_NR * (1 - b_NR) * std::exp(1i * DegreeToRadian(aS0_phi_NR));
204 aS1 = aS1_c_NR * (1 - b_NR) * std::exp(1i * DegreeToRadian(aS1_phi_NR));
205 aS2 = aS2_c_NR * (1 - b_NR) * std::exp(1i * DegreeToRadian(aS2_phi_NR));
208 return 2.0 * (aS0 + aS1 * x + aS2 * x * x);
210 printf(
"[Amplitude] unsupported resonance\n");
216 std::complex<double> EvtBtoKK0K0::DynamicalAmplitude(
double s13,
double s23,
const char* resonance)
219 if (strcmp(resonance,
"f980") == 0) {
220 return Flatte(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
221 resonance) * Zemach(s13, s23, resonance);
222 }
else if (strcmp(resonance,
"f1500") == 0) {
223 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
224 resonance) * Zemach(s13, s23, resonance);
225 }
else if (strcmp(resonance,
"f1525") == 0) {
226 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
227 resonance) * Zemach(s13, s23, resonance);
228 }
else if (strcmp(resonance,
"f1710") == 0) {
229 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
230 resonance) * Zemach(s13, s23, resonance);
231 }
else if (strcmp(resonance,
"chic0") == 0) {
232 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
233 resonance) * Zemach(s13, s23, resonance);
235 printf(
"[Amplitude] unsupported resonance\n");
241 std::complex<double> EvtBtoKK0K0::Flatte(
double s13,
double s23,
const char* resonance)
247 if (strcmp(resonance,
"f980") == 0) {
250 gK = gKgpi_f980 * gpi_f980;
252 printf(
"[Flatte] unsupported resonance\n");
256 double m = Calculate_m(s13, s23);
258 double rho_pipi = std::sqrt(1 - 4 * mpic * mpic / (m * m));
259 double rho_KK = std::sqrt(1 - 4 * mK * mK / (m * m));
261 return 1.0 / ((m0 * m0 - m * m) - 1i * (gpi * rho_pipi + gK * rho_KK));
264 std::complex<double> EvtBtoKK0K0::RBW(
double s13,
double s23,
const char* resonance)
268 double m = Calculate_m(s13, s23);
270 if (strcmp(resonance,
"f1500") == 0) {
272 }
else if (strcmp(resonance,
"f1525") == 0) {
274 }
else if (strcmp(resonance,
"f1710") == 0) {
276 }
else if (strcmp(resonance,
"chic0") == 0) {
279 printf(
"[RBW] unsupported resonance\n");
283 return 1.0 / (m0 * m0 - m * m - 1i * m0 * MassDepWidth(s13, s23, resonance));
286 double EvtBtoKK0K0::MassDepWidth(
double s13,
double s23,
const char* resonance)
294 double q_mag = Calculate_q_mag(s13, s23);
295 double m = Calculate_m(s13, s23);
297 if (strcmp(resonance,
"f1500") == 0) {
301 Gamma0 = Gamma0_f1500;
302 }
else if (strcmp(resonance,
"f1525") == 0) {
306 Gamma0 = Gamma0_f1525;
307 }
else if (strcmp(resonance,
"f1710") == 0) {
311 Gamma0 = Gamma0_f1710;
312 }
else if (strcmp(resonance,
"chic0") == 0) {
316 Gamma0 = Gamma0_chic0;
318 printf(
"[MassDepWidth] unsupported resonance\n");
322 return Gamma0 * std::pow(q_mag / q0, 2 * spin + 1) * (m0 / m) * std::pow(BlattWeisskopf_qr(s13, s23, resonance), 2);
325 double EvtBtoKK0K0::BlattWeisskopf_pstarrprime(
double s13,
double s23,
const char* resonance)
330 double z = Calculate_pstar_mag(s13, s23) * rprime;
332 if (strcmp(resonance,
"f980") == 0) {
335 }
else if (strcmp(resonance,
"f1500") == 0) {
337 z0 = pstar0_f1500 * rprime;
338 }
else if (strcmp(resonance,
"f1525") == 0) {
340 z0 = pstar0_f1525 * rprime;
341 }
else if (strcmp(resonance,
"f1710") == 0) {
343 z0 = pstar0_f1710 * rprime;
344 }
else if (strcmp(resonance,
"chic0") == 0) {
346 z0 = pstar0_chic0 * rprime;
348 printf(
"[BlattWeisskopf_pstarrprime] unsupported resonance\n");
352 if (spin == 0)
return 1;
353 else if (spin == 1)
return std::sqrt((1 + z0 * z0) / (1 + z * z));
354 else if (spin == 2)
return std::sqrt((9 + 3 * z0 * z0 + z0 * z0 * z0 * z0) / (9 + 3 * z * z + z * z * z * z));
356 printf(
"[BlattWeisskopf_pstarrprime] unsupported spin\n");
362 double EvtBtoKK0K0::BlattWeisskopf_qr(
double s13,
double s23,
const char* resonance)
367 double z = Calculate_q_mag(s13, s23) * r;
369 if (strcmp(resonance,
"f980") == 0) {
372 }
else if (strcmp(resonance,
"f1500") == 0) {
375 }
else if (strcmp(resonance,
"f1525") == 0) {
378 }
else if (strcmp(resonance,
"f1710") == 0) {
381 }
else if (strcmp(resonance,
"chic0") == 0) {
385 printf(
"[BlattWeisskopf_qr] unsupported resonance\n");
389 if (spin == 0)
return 1;
390 else if (spin == 1)
return std::sqrt((1 + z0 * z0) / (1 + z * z));
391 else if (spin == 2)
return std::sqrt((9 + 3 * z0 * z0 + z0 * z0 * z0 * z0) / (9 + 3 * z * z + z * z * z * z));
393 printf(
"[BlattWeisskopf_qr] unsupported spin\n");
399 double EvtBtoKK0K0::Zemach(
double s13,
double s23,
const char* resonance)
403 double p_dot_q = Calculate_q_dot_p_mag(s13, s23);
404 double p_mag = Calculate_p_mag(s13, s23);
405 double q_mag = Calculate_q_mag(s13, s23);
407 if (strcmp(resonance,
"f980") == 0) {
409 }
else if (strcmp(resonance,
"f1500") == 0) {
411 }
else if (strcmp(resonance,
"f1525") == 0) {
413 }
else if (strcmp(resonance,
"f1710") == 0) {
415 }
else if (strcmp(resonance,
"chic0") == 0) {
418 printf(
"[Zemach] unsupported resonance\n");
422 if (spin == 0)
return 1.0;
423 else if (spin == 1)
return 4 * p_dot_q;
424 else if (spin == 2)
return (16.0 / 3.0) * (3 * p_dot_q * p_dot_q - p_mag * p_mag * q_mag * q_mag);
426 printf(
"[Zemach] unsupported spin\n");
432 double EvtBtoKK0K0::Calculate_m(
double s13,
double s23)
434 return std::sqrt(mB * mB + mKp * mKp + mKL0 * mKL0 + mKL0 * mKL0 - s13 - s23);
437 double EvtBtoKK0K0::Calculate_q_mag(
double s13,
double s23)
439 double m = Calculate_m(s13, s23);
440 return std::sqrt(m * m / 4.0 - mKL0 * mKL0);
443 double EvtBtoKK0K0::Calculate_pstar_mag(
double s13,
double s23)
445 double m = Calculate_m(s13, s23);
446 return std::sqrt(std::pow(mB * mB - m * m - mKp * mKp, 2) / 4.0 - m * m * mKp * mKp) / mB;
449 double EvtBtoKK0K0::Calculate_p_mag(
double s13,
double s23)
451 double m = Calculate_m(s13, s23);
453 return std::sqrt(std::pow(mB * mB - s12 - mKp * mKp, 2) / (4 * s12) - mKp * mKp);
456 double EvtBtoKK0K0::Calculate_q_dot_p_mag(
double s13,
double s23)
458 return std::abs((s13 - s23) / 4.0);
461 double EvtBtoKK0K0::DegreeToRadian(
double degree)
463 return (3.141592 * degree) / 180.0;
466 void EvtBtoKK0K0::GetZeros()
470 q0_f1500 = std::sqrt((m0_f1500 * m0_f1500) / 4.0 - mKL0 * mKL0);
471 pstar0_f1500 = std::sqrt(std::pow(mB * mB - m0_f1500 * m0_f1500 - mKp * mKp, 2) / 4.0 - m0_f1500 * m0_f1500 * mKp * mKp) / mB;
474 q0_f1525 = std::sqrt((m0_f1525 * m0_f1525) / 4.0 - mKL0 * mKL0);
475 pstar0_f1525 = std::sqrt(std::pow(mB * mB - m0_f1525 * m0_f1525 - mKp * mKp, 2) / 4.0 - m0_f1525 * m0_f1525 * mKp * mKp) / mB;
478 q0_f1710 = std::sqrt((m0_f1710 * m0_f1710) / 4.0 - mKL0 * mKL0);
479 pstar0_f1710 = std::sqrt(std::pow(mB * mB - m0_f1710 * m0_f1710 - mKp * mKp, 2) / 4.0 - m0_f1710 * m0_f1710 * mKp * mKp) / mB;
482 q0_chic0 = std::sqrt((m0_chic0 * m0_chic0) / 4.0 - mKL0 * mKL0);
483 pstar0_chic0 = std::sqrt(std::pow(mB * mB - m0_chic0 * m0_chic0 - mKp * mKp, 2) / 4.0 - m0_chic0 * m0_chic0 * mKp * mKp) / mB;
487 void EvtBtoKK0K0::GetMasses()
489 mB = EvtPDL::getMass(EvtPDL::getId(
"B+"));
490 mKp = EvtPDL::getMass(EvtPDL::getId(
"K+"));
491 mKL0 = EvtPDL::getMass(EvtPDL::getId(
"K_L0"));
492 mK = (EvtPDL::getMass(EvtPDL::getId(
"K+")) + EvtPDL::getMass(EvtPDL::getId(
"K0"))) / 2.0;
493 mpic = EvtPDL::getMass(EvtPDL::getId(
"pi+"));
#define B2_EVTGEN_REGISTER_MODEL(classname)
Class to register B2_EVTGEN_REGISTER_MODEL.
Abstract base class for different kinds of events.