Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Update orderings
Browse files Browse the repository at this point in the history
  • Loading branch information
EinarElen authored and tomeichlersmith committed Nov 27, 2023
1 parent 11bfe4f commit 79ccb4c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
31 changes: 19 additions & 12 deletions include/SimCore/KaonPhysics.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,25 @@ class KaonPhysics : public G4VPhysicsConstructor {
* K^+ -> \mu^+ + \nu_\mu
* K^+ -> \pi^+ + \pi^0
* K^+ -> \pi^+ + \pi^- + \pi^+
* K^+ -> \pi^+ + \pi^0 + \pi^0
* K^+ -> \pi^0 + e^+ + \nu_e
* K^+ -> \pi^0 + \mu^+ + \nu_\mu
* K^+ -> \pi^+ + \pi^0 + \pi^0
*
* And vice versa for K^-.
* The indices here correspond to the position of the branching ratio for
* that process in the corresponding parameter as well as the position in
* the decay table.
*
* @note: The order in the the decay table is sorted by the branching ratios
* of the default physics settings!
*/
enum ChargedKaonDecayChannel {
mu_nu = 0,
pi_pi0 = 1,
pi_pi_pi = 2,
pi_pi0_pi0 = 3,
pi0_e_nu = 4,
pi0_mu_nu = 5
pi0_e_nu = 3,
pi0_mu_nu = 4,
pi_pi0_pi0 = 5,
};
/**
*
Expand All @@ -64,26 +67,29 @@ class KaonPhysics : public G4VPhysicsConstructor {
*
* The processes are
*
* K^0_L -> \pi^0 + \pi^0 + \pi^0
* K^0_L -> \pi^0 + \pi^+ + \pi^-
* K^0_L -> \pi^- + e^+ + \nu_e
* K^0_L -> \pi^+ + e^- + \nu_e
* K^0_L -> \pi^0 + \pi^0 + \pi^0
* K^0_L -> \pi^- + \mu^+ + \nu_\mu
* K^0_L -> \pi^+ + \mu^- + \nu_\mu
* K^0_L -> \pi^0 + \pi^+ + \pi^-
*
* and
*
* K^0_S -> \pi^+ + \pi^-
* K^0_S -> \pi^0 + \pi^0
*
* @note: The order in the the decay table is sorted by the branching ratios
* of the default physics settings!
*
**/
enum KaonZeroLongDecayChannel {
pi0_pi0_pi0 = 0,
pi0_pip_pim = 1,
pip_e_nu = 2,
pim_e_nu = 3,
pim_mu_nu = 4,
pip_mu_nu = 5,
pim_e_nu = 0,
pip_e_nu = 1,
pi0_pi0_pi0 = 2,
pim_mu_nu = 3,
pip_mu_nu = 4,
pi0_pip_pim = 5,
};
enum KaonZeroShortDecayChannel {
pip_pim = 0,
Expand All @@ -107,6 +113,7 @@ class KaonPhysics : public G4VPhysicsConstructor {
// If > 0, dump details about what was changed
// If > 1, dump details about the initial branching ratios
int verbosity;

public:
KaonPhysics(const G4String& name,
const framework::config::Parameters& parameters);
Expand Down
24 changes: 12 additions & 12 deletions python/kaon_physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@ def __init__(self):
0.6355, # K^+ -> mu^+ + nu_mu
0.2066, # K^+ -> pi^+ + pi^0
0.0559, # K^+ -> pi^+ + pi^- + pi^+
0.01761, # K^+ -> pi^+ + pi^0 + pi^0
0.0507, # K^+ -> pi^0 + e^+ + nu_e
0.0335, # K^+ -> pi^0 + mu^+ + nu_mu
0.01761, # K^+ -> pi^+ + pi^0 + pi^0
]
self.kminus_branching_ratios = [
0.6355, # K^- -> mu^- + anti_nu_mu
0.2066, # K^- -> pi^- + pi^0
0.0559, # K^- -> pi^- + pi^+ + pi^-
0.01761, # K-+ -> pi^- + pi^0 + pi^0
0.0507, # K-+ -> pi^0 + e^- + anti_nu_e
0.0335, # K-+ -> pi^0 + mu^- + anti_nu_mu
0.01761, # K-+ -> pi^- + pi^0 + pi^0
]
self.k0l_branching_ratios = [
0.1952, # K^0_L -> pi^0 + pi^0 + pi^0
0.1254, # K^0_L -> pi^0 + pi^+ + pi^-
0.2027, # K^0_L -> pi^- + e^+ + nu_e
0.2027, # K^0_L -> pi^+ + e^- + anti_nu_e
0.1952, # K^0_L -> pi^0 + pi^0 + pi^0
0.1352, # K^0_L -> pi^- + mu^+ + nu_mu
0.1352, # K^0_L -> pi^+ + mu^- + anti_nu_mu
0.1254, # K^0_L -> pi^0 + pi^+ + pi^-
]
self.k0s_branching_ratios = [
0.6920, # K^0_S -> pi^+ + pi^-
Expand Down Expand Up @@ -101,19 +101,19 @@ def upKaons():
kaon_physics = KaonPhysics()
kaon_physics.kplus_branching_ratios = [
0.8831, # K^+ -> mu^+ + nu_mu
0., # K^+ -> pi^+ + pi^0
0., # K^+ -> pi^+ + pi^- + pi^+
0., # K^+ -> pi^+ + pi^0 + pi^0
0., # K^+ -> pi^+ + pi^0
0., # K^+ -> pi^+ + pi^- + pi^+
0.0704, # K^+ -> pi^0 + e^+ + nu_e
0.0465, # K^+ -> pi^0 + mu^+ + nu_mu
0., # K^+ -> pi^+ + pi^0 + pi^0
]
kaon_physics.kminus_branching_ratios = [
0.8831, # K^- -> mu^- + anti_nu_mu
0., # K^- -> pi^- + pi^0
0., # K^- -> pi^- + pi^+ + pi^-
0., # K-+ -> pi^- + pi^0 + pi^0
0.0704, # K-+ -> pi^0 + e^- + anti_nu_e
0.0464, # K-+ -> pi^0 + mu^- + anti_nu_mu
0., # K^- -> pi^- + pi^0
0., # K^- -> pi^- + pi^+ + pi^-
0.0704, # K^- -> pi^0 + e^- + anti_nu_e
0.0464, # K^- -> pi^0 + mu^- + anti_nu_mu
0., # K^- -> pi^- + pi^0 + pi^0
]
kaon_physics.kplus_lifetime_factor = 1/50.
kaon_physics.kminus_lifetime_factor = 1/50.
Expand Down
3 changes: 2 additions & 1 deletion src/SimCore/KaonPhysics.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ KaonPhysics::KaonPhysics(const G4String& name,
void KaonPhysics::setDecayProperties(
G4ParticleDefinition* kaon, const std::vector<double>& branching_ratios,
double lifetime_factor) const {
kaon->SetPDGLifeTime(kaon->GetPDGLifeTime() * lifetime_factor);
auto table{kaon->GetDecayTable()};
if (!table) {
EXCEPTION_RAISE("KaonPhysics", "Unable to get the decay table from " +
Expand All @@ -34,6 +33,7 @@ void KaonPhysics::setDecayProperties(
<< std::endl;
DumpDecayDetails(kaon);
}
kaon->SetPDGLifeTime(kaon->GetPDGLifeTime() * lifetime_factor);
if (kaon == G4KaonZeroLong::Definition()) {
(*table)[KaonZeroLongDecayChannel::pi0_pi0_pi0]->SetBR(
branching_ratios[KaonZeroLongDecayChannel::pi0_pi0_pi0]);
Expand Down Expand Up @@ -112,4 +112,5 @@ void KaonPhysics::DumpDecayDetails(const G4ParticleDefinition* kaon) const {
<< std::endl;
}
}

} // namespace simcore

0 comments on commit 79ccb4c

Please sign in to comment.