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/EvtB0toK0K0K0.h"
25using namespace std::complex_literals;
36 EvtB0toK0K0K0::~EvtB0toK0K0K0() {}
38 std::string EvtB0toK0K0K0::getName()
43 EvtDecayBase* EvtB0toK0K0K0::clone()
45 return new EvtB0toK0K0K0;
48 void EvtB0toK0K0K0::decay(EvtParticle* p)
53 const int max_Ntry = 10000;
56 p->initializePhaseSpace(getNDaug(), getDaugs());
58 EvtParticle* NeutralKaon_1 = p->getDaug(0);
59 EvtParticle* NeutralKaon_2 = p->getDaug(1);
60 EvtParticle* NeutralKaon_3 = p->getDaug(2);
62 EvtVector4R mom_NeutralKaon_1 = NeutralKaon_1->getP4();
63 EvtVector4R mom_NeutralKaon_2 = NeutralKaon_2->getP4();
64 EvtVector4R mom_NeutralKaon_3 = NeutralKaon_3->getP4();
66 EvtVector4R mom_sum_12 = mom_NeutralKaon_1 + mom_NeutralKaon_2;
67 EvtVector4R mom_sum_13 = mom_NeutralKaon_1 + mom_NeutralKaon_3;
68 EvtVector4R mom_sum_23 = mom_NeutralKaon_2 + mom_NeutralKaon_3;
70 double s12 = mom_sum_12.mass2();
71 double s13 = mom_sum_13.mass2();
72 double s23 = mom_sum_23.mass2();
75 double smax = std::max(std::max(s12, s13), s23);
76 double smin = std::min(std::min(s12, s13), s23);
79 const double Probability_max = 0.409212;
80 double Probability_value = Probability(smax, smin);
81 double Probability_ratio = Probability_value / Probability_max;
83 double xbox = EvtRandom::Flat(0.0, 1.0);
85 if (xbox < Probability_ratio)
break;
87 if (Ntry > max_Ntry) {
88 std::cout <<
"try to set the kinematics more than 10000 times. abort.\n";
99 void EvtB0toK0K0K0::initProbMax()
105 void EvtB0toK0K0K0::init()
115 EvtId KaonZeroType_1 = getDaug(0);
116 EvtId KaonZeroType_2 = getDaug(1);
117 EvtId KaonZeroType_3 = getDaug(2);
121 if ((KaonZeroType_1 == EvtPDL::getId(
"K0")) ||
122 (KaonZeroType_1 == EvtPDL::getId(
"anti-K0")) ||
123 (KaonZeroType_1 == EvtPDL::getId(
"K_S0")) ||
124 (KaonZeroType_1 == EvtPDL::getId(
"K_L0"))) KaonZerotyp++;
125 if ((KaonZeroType_2 == EvtPDL::getId(
"K0")) ||
126 (KaonZeroType_2 == EvtPDL::getId(
"anti-K0")) ||
127 (KaonZeroType_2 == EvtPDL::getId(
"K_S0")) ||
128 (KaonZeroType_2 == EvtPDL::getId(
"K_L0"))) KaonZerotyp++;
129 if ((KaonZeroType_3 == EvtPDL::getId(
"K0")) ||
130 (KaonZeroType_3 == EvtPDL::getId(
"anti-K0")) ||
131 (KaonZeroType_3 == EvtPDL::getId(
"K_S0")) ||
132 (KaonZeroType_3 == EvtPDL::getId(
"K_L0"))) KaonZerotyp++;
134 if (KaonZerotyp != 3) {
136 std::cout <<
"All daughters should be K0, anti-K0, K_L0, or K_S0.\n";
146 double EvtB0toK0K0K0::Probability(
double s13,
double s23)
148 std::complex<double> total_amplitude = Amplitude(s13, s23,
"f980") + Amplitude(s13, s23,
"f1710") + Amplitude(s13, s23,
149 "f2010") + Amplitude(s13, s23,
"chic0") + Amplitude(s13, s23,
"NR");
150 return std::abs(total_amplitude) * std::abs(total_amplitude);
154 std::complex<double> EvtB0toK0K0K0::Amplitude(
double s13,
double s23,
const char* resonance)
158 double MagicNumber_f980 = std::sqrt(0.44 / 30.222805945);
159 double MagicNumber_f1710 = std::sqrt(0.07 / 136.555962030);
160 double MagicNumber_f2010 = std::sqrt(0.09 / 310762.546712675);
161 double MagicNumber_chic0 = std::sqrt(0.07 / 677.282967269);
162 double MagicNumber_NR = std::sqrt(2.16 / 51.262701105);
164 double s12 = mB0 * mB0 + mKS0 * mKS0 + mKL0 * mKL0 + mKL0 * mKL0 - s13 - s23;
166 if (strcmp(resonance,
"f980") == 0) {
167 std::complex<double> a;
168 a = c_f980 * std::exp(1i * phi_f980);
169 return MagicNumber_f980 * a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s12, s23,
170 resonance) + DynamicalAmplitude(s12, s13, resonance));
171 }
else if (strcmp(resonance,
"f1710") == 0) {
172 std::complex<double> a;
173 a = c_f1710 * std::exp(1i * phi_f1710);
174 return MagicNumber_f1710 * a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s12, s23,
175 resonance) + DynamicalAmplitude(s12, s13, resonance));
176 }
else if (strcmp(resonance,
"f2010") == 0) {
177 std::complex<double> a;
178 a = c_f2010 * std::exp(1i * phi_f2010);
179 return MagicNumber_f2010 * a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s12, s23,
180 resonance) + DynamicalAmplitude(s12, s13, resonance));
181 }
else if (strcmp(resonance,
"chic0") == 0) {
182 std::complex<double> a;
183 a = c_chic0 * std::exp(1i * phi_chic0);
184 return MagicNumber_chic0 * a * (DynamicalAmplitude(s13, s23, resonance) + DynamicalAmplitude(s12, s23,
185 resonance) + DynamicalAmplitude(s12, s13, resonance));
186 }
else if (strcmp(resonance,
"NR") == 0) {
188 std::complex<double> a;
189 a = c_NR * std::exp(1i * phi_NR);
191 return MagicNumber_NR * a * (std::exp(alpha_NR * s13) + std::exp(alpha_NR * s12) + std::exp(alpha_NR * s23));
193 printf(
"[Amplitude] unsupported resonance\n");
199 std::complex<double> EvtB0toK0K0K0::DynamicalAmplitude(
double s13,
double s23,
const char* resonance)
202 if (strcmp(resonance,
"f980") == 0) {
203 return Flatte(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
204 resonance) * Zemach(s13, s23, resonance);
206 if (strcmp(resonance,
"f1710") == 0) {
207 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
208 resonance) * Zemach(s13, s23, resonance);
209 }
else if (strcmp(resonance,
"f2010") == 0) {
210 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
211 resonance) * Zemach(s13, s23, resonance);
212 }
else if (strcmp(resonance,
"chic0") == 0) {
213 return RBW(s13, s23, resonance) * BlattWeisskopf_pstarrprime(s13, s23, resonance) * BlattWeisskopf_qr(s13, s23,
214 resonance) * Zemach(s13, s23, resonance);
216 printf(
"[Amplitude] unsupported resonance\n");
222 std::complex<double> EvtB0toK0K0K0::Flatte(
double s13,
double s23,
const char* resonance)
228 if (strcmp(resonance,
"f980") == 0) {
233 printf(
"[Flatte] unsupported resonance\n");
237 double m = Calculate_m(s13, s23);
239 double Gammapipi = gpi * ((1.0 / 3.0) * std::sqrt(1 - 4.0 * mpi0 * mpi0 / (m * m)) + (2.0 / 3.0) * std::sqrt(
240 1 - 4.0 * mpic * mpic / (m * m)));
241 double GammaKK = gK * (0.5 * std::sqrt(1 - 4.0 * mKp * mKp / (m * m)) + 0.5 * std::sqrt(1 - 4.0 * mK0 * mK0 / (m * m)));
243 return 1.0 / ((m0 * m0 - m * m) - 1i * (Gammapipi + GammaKK));
246 std::complex<double> EvtB0toK0K0K0::RBW(
double s13,
double s23,
const char* resonance)
250 double m = Calculate_m(s13, s23);
252 if (strcmp(resonance,
"f1710") == 0) {
254 }
else if (strcmp(resonance,
"f2010") == 0) {
256 }
else if (strcmp(resonance,
"chic0") == 0) {
259 printf(
"[RBW] unsupported resonance\n");
263 return 1.0 / (m0 * m0 - m * m - 1i * m0 * MassDepWidth(s13, s23, resonance));
266 double EvtB0toK0K0K0::MassDepWidth(
double s13,
double s23,
const char* resonance)
274 double q_mag = Calculate_q_mag(s13, s23);
275 double m = Calculate_m(s13, s23);
277 if (strcmp(resonance,
"f1710") == 0) {
281 Gamma0 = Gamma0_f1710;
282 }
else if (strcmp(resonance,
"f2010") == 0) {
286 Gamma0 = Gamma0_f2010;
287 }
else if (strcmp(resonance,
"chic0") == 0) {
291 Gamma0 = Gamma0_chic0;
293 printf(
"[MassDepWidth] unsupported resonance\n");
297 return Gamma0 * std::pow(q_mag / q0, 2 * spin + 1) * (m0 / m) * std::pow(BlattWeisskopf_qr(s13, s23, resonance), 2);
300 double EvtB0toK0K0K0::BlattWeisskopf_pstarrprime(
double s13,
double s23,
const char* resonance)
305 double z = Calculate_pstar_mag(s13, s23) * rprime;
307 if (strcmp(resonance,
"f980") == 0) {
310 }
else if (strcmp(resonance,
"f1710") == 0) {
312 z0 = pstar0_f1710 * rprime;
313 }
else if (strcmp(resonance,
"f2010") == 0) {
315 z0 = pstar0_f2010 * rprime;
316 }
else if (strcmp(resonance,
"chic0") == 0) {
318 z0 = pstar0_chic0 * rprime;
320 printf(
"[BlattWeisskopf_pstarrprime] unsupported resonance\n");
324 if (spin == 0)
return 1;
325 else if (spin == 1)
return std::sqrt((1 + z0 * z0) / (1 + z * z));
326 else if (spin == 2)
return std::sqrt((9 + 3 * z0 * z0 + z0 * z0 * z0 * z0) / (9 + 3 * z * z + z * z * z * z));
328 printf(
"[BlattWeisskopf_pstarrprime] unsupported spin\n");
334 double EvtB0toK0K0K0::BlattWeisskopf_qr(
double s13,
double s23,
const char* resonance)
339 double z = Calculate_q_mag(s13, s23) * r;
341 if (strcmp(resonance,
"f980") == 0) {
344 }
else if (strcmp(resonance,
"f1710") == 0) {
347 }
else if (strcmp(resonance,
"f2010") == 0) {
350 }
else if (strcmp(resonance,
"chic0") == 0) {
354 printf(
"[BlattWeisskopf_qr] unsupported resonance\n");
358 if (spin == 0)
return 1;
359 else if (spin == 1)
return std::sqrt((1 + z0 * z0) / (1 + z * z));
360 else if (spin == 2)
return std::sqrt((9 + 3 * z0 * z0 + z0 * z0 * z0 * z0) / (9 + 3 * z * z + z * z * z * z));
362 printf(
"[BlattWeisskopf_qr] unsupported spin\n");
368 double EvtB0toK0K0K0::Zemach(
double s13,
double s23,
const char* resonance)
372 double p_dot_q = Calculate_q_dot_p_mag(s13, s23);
373 double p_mag = Calculate_p_mag(s13, s23);
374 double q_mag = Calculate_q_mag(s13, s23);
376 if (strcmp(resonance,
"f980") == 0) {
378 }
else if (strcmp(resonance,
"f1710") == 0) {
380 }
else if (strcmp(resonance,
"f2010") == 0) {
382 }
else if (strcmp(resonance,
"chic0") == 0) {
385 printf(
"[Zemach] unsupported resonance\n");
389 if (spin == 0)
return 1.0;
390 else if (spin == 2)
return (8.0 / 3.0) * (3 * p_dot_q * p_dot_q - p_mag * p_mag * q_mag * q_mag);
392 printf(
"[Zemach] unsupported spin\n");
398 double EvtB0toK0K0K0::Calculate_m(
double s13,
double s23)
400 return std::sqrt(mB0 * mB0 + mKS0 * mKS0 + mKL0 * mKL0 + mKL0 * mKL0 - s13 - s23);
403 double EvtB0toK0K0K0::Calculate_q_mag(
double s13,
double s23)
405 double m = Calculate_m(s13, s23);
406 return std::sqrt(m * m / 4.0 - mKL0 * mKL0);
409 double EvtB0toK0K0K0::Calculate_pstar_mag(
double s13,
double s23)
411 double m = Calculate_m(s13, s23);
412 return std::sqrt(std::pow(mB0 * mB0 - m * m - mKS0 * mKS0, 2) / 4.0 - m * m * mKS0 * mKS0) / mB0;
415 double EvtB0toK0K0K0::Calculate_p_mag(
double s13,
double s23)
417 double m = Calculate_m(s13, s23);
419 return std::sqrt(std::pow(mB0 * mB0 - s12 - mKS0 * mKS0, 2) / (4 * s12) - mKS0 * mKS0);
422 double EvtB0toK0K0K0::Calculate_q_dot_p_mag(
double s13,
double s23)
424 return std::abs((s13 - s23) / 4.0);
427 void EvtB0toK0K0K0::GetZeros()
431 q0_f1710 = std::sqrt((m0_f1710 * m0_f1710) / 4.0 - mKL0 * mKL0);
432 pstar0_f1710 = std::sqrt(std::pow(mB0 * mB0 - m0_f1710 * m0_f1710 - mKS0 * mKS0,
433 2) / 4.0 - m0_f1710 * m0_f1710 * mKS0 * mKS0) / mB0;
436 q0_f2010 = std::sqrt((m0_f2010 * m0_f2010) / 4.0 - mKL0 * mKL0);
437 pstar0_f2010 = std::sqrt(std::pow(mB0 * mB0 - m0_f2010 * m0_f2010 - mKS0 * mKS0,
438 2) / 4.0 - m0_f2010 * m0_f2010 * mKS0 * mKS0) / mB0;
441 q0_chic0 = std::sqrt((m0_chic0 * m0_chic0) / 4.0 - mKL0 * mKL0);
442 pstar0_chic0 = std::sqrt(std::pow(mB0 * mB0 - m0_chic0 * m0_chic0 - mKS0 * mKS0,
443 2) / 4.0 - m0_chic0 * m0_chic0 * mKS0 * mKS0) / mB0;
447 void EvtB0toK0K0K0::GetMasses()
449 mB0 = EvtPDL::getMass(EvtPDL::getId(
"B0"));
450 mKp = EvtPDL::getMass(EvtPDL::getId(
"K+"));
451 mKL0 = EvtPDL::getMass(EvtPDL::getId(
"K_L0"));
452 mKS0 = EvtPDL::getMass(EvtPDL::getId(
"K_S0"));
453 mK0 = EvtPDL::getMass(EvtPDL::getId(
"K0"));
454 mpic = EvtPDL::getMass(EvtPDL::getId(
"pi+"));
455 mpi0 = EvtPDL::getMass(EvtPDL::getId(
"pi0"));
#define B2_EVTGEN_REGISTER_MODEL(classname)
Class to register B2_EVTGEN_REGISTER_MODEL.
Abstract base class for different kinds of events.