23void KaonPhysics::setDecayProperties(
24 G4ParticleDefinition* kaon,
const std::vector<double>& branching_ratios,
25 double lifetime_factor)
const {
26 auto table{kaon->GetDecayTable()};
28 EXCEPTION_RAISE(
"KaonPhysics",
"Unable to get the decay table from " +
29 kaon->GetParticleName());
32 ldmx_log(info) <<
"Decay details (" << kaon->GetParticleName()
33 <<
") before setting branching ratios and lifetimes"
35 DumpDecayDetails(kaon);
37 kaon->SetPDGLifeTime(kaon->GetPDGLifeTime() * lifetime_factor);
38 if (kaon == G4KaonZeroLong::Definition()) {
39 (*table)[KaonZeroLongDecayChannel::pi0_pi0_pi0]->SetBR(
40 branching_ratios[KaonZeroLongDecayChannel::pi0_pi0_pi0]);
41 (*table)[KaonZeroLongDecayChannel::pi0_pip_pim]->SetBR(
42 branching_ratios[KaonZeroLongDecayChannel::pi0_pip_pim]);
43 (*table)[KaonZeroLongDecayChannel::pip_e_nu]->SetBR(
44 branching_ratios[KaonZeroLongDecayChannel::pip_e_nu]);
45 (*table)[KaonZeroLongDecayChannel::pim_e_nu]->SetBR(
46 branching_ratios[KaonZeroLongDecayChannel::pim_e_nu]);
47 (*table)[KaonZeroLongDecayChannel::pim_mu_nu]->SetBR(
48 branching_ratios[KaonZeroLongDecayChannel::pim_mu_nu]);
49 (*table)[KaonZeroLongDecayChannel::pip_mu_nu]->SetBR(
50 branching_ratios[KaonZeroLongDecayChannel::pip_mu_nu]);
51 }
else if (kaon == G4KaonZeroShort::Definition()) {
52 (*table)[KaonZeroShortDecayChannel::pip_pim]->SetBR(
53 branching_ratios[KaonZeroShortDecayChannel::pip_pim]);
54 (*table)[KaonZeroShortDecayChannel::pi0_pi0]->SetBR(
55 branching_ratios[KaonZeroShortDecayChannel::pi0_pi0]);
57 (*table)[ChargedKaonDecayChannel::mu_nu]->SetBR(
58 branching_ratios[ChargedKaonDecayChannel::mu_nu]);
59 (*table)[ChargedKaonDecayChannel::pi_pi0]->SetBR(
60 branching_ratios[ChargedKaonDecayChannel::pi_pi0]);
61 (*table)[ChargedKaonDecayChannel::pi_pi_pi]->SetBR(
62 branching_ratios[ChargedKaonDecayChannel::pi_pi_pi]);
63 (*table)[ChargedKaonDecayChannel::pi_pi0_pi0]->SetBR(
64 branching_ratios[ChargedKaonDecayChannel::pi_pi0_pi0]);
65 (*table)[ChargedKaonDecayChannel::pi0_e_nu]->SetBR(
66 branching_ratios[ChargedKaonDecayChannel::pi0_e_nu]);
67 (*table)[ChargedKaonDecayChannel::pi0_mu_nu]->SetBR(
68 branching_ratios[ChargedKaonDecayChannel::pi0_mu_nu]);
71 ldmx_log(info) <<
"Decay details (" << kaon->GetParticleName()
72 <<
") after setting branching ratios and lifetimes"
74 DumpDecayDetails(kaon);
77void KaonPhysics::ConstructParticle() {
78 auto kaonPlus{G4KaonPlus::Definition()};
79 auto kaonMinus{G4KaonMinus::Definition()};
80 auto kaonLong{G4KaonZeroLong::Definition()};
81 auto kaonShort{G4KaonZeroShort::Definition()};
83 if (!kaonPlus || !kaonMinus || !kaonLong || !kaonShort) {
84 EXCEPTION_RAISE(
"KaonPhysics",
85 "Unable to get the charged kaon particle definitions, "
86 "something is very wrong with the configuration.");
88 setDecayProperties(kaonPlus, kplus_branching_ratios, kplus_lifetime_factor);
89 setDecayProperties(kaonMinus, kminus_branching_ratios,
90 kminus_lifetime_factor);
91 setDecayProperties(kaonLong, k0l_branching_ratios, k0l_lifetime_factor);
92 setDecayProperties(kaonShort, k0s_branching_ratios, k0s_lifetime_factor);