LDMX Software
KaonPhysics.h
1#ifndef SIMCORE_KAON_PHYSICS_H
2#define SIMCORE_KAON_PHYSICS_H
3
4#include <G4DecayTable.hh>
5#include <G4KaonMinus.hh>
6#include <G4KaonPlus.hh>
7#include <G4KaonZeroLong.hh>
8#include <G4KaonZeroShort.hh>
9#include <G4ParticleDefinition.hh>
10#include <G4VDecayChannel.hh>
11#include <G4VPhysicsConstructor.hh>
12#include <iomanip>
13#include <iostream>
14#include <numeric>
15#include <vector>
16
17#include "Framework/Configure/Parameters.h"
18#include "Framework/Exception/Exception.h"
19#include "Framework/Logger.h"
20
21namespace simcore {
22
32class KaonPhysics : public G4VPhysicsConstructor {
33 private:
60 mu_nu = 0,
61 pi_pi0 = 1,
62 pi_pi_pi = 2,
63 pi0_e_nu = 3,
64 pi0_mu_nu = 4,
65 pi_pi0_pi0 = 5,
66 };
92 pim_e_nu = 0,
93 pip_e_nu = 1,
94 pi0_pi0_pi0 = 2,
95 pim_mu_nu = 3,
96 pip_mu_nu = 4,
97 pi0_pip_pim = 5,
98 };
99 enum KaonZeroShortDecayChannel {
100 pip_pim = 0,
101 pi0_pi0 = 1,
102 };
103
104 // Factor to scale the K^+/K^-/K^0_L/K^0_S lifetimes by. To reduce the
105 // lifetime of all charged kaons by a factor 50, set these to 1/50.
106 double kplus_lifetime_factor{1};
107 double kminus_lifetime_factor{1};
108 double k0l_lifetime_factor{1};
109 double k0s_lifetime_factor{1};
110
111 // Branching ratios for each of the decay processes listed in the
112 // KaonDecayChannel enumerators
113 std::vector<double> kplus_branching_ratios;
114 std::vector<double> kminus_branching_ratios;
115 std::vector<double> k0l_branching_ratios;
116 std::vector<double> k0s_branching_ratios;
117
118 // If > 0, dump details about what was changed
119 // If > 1, dump details about the initial branching ratios
120 int verbosity;
121
122 public:
123 KaonPhysics(const G4String& name,
124 const framework::config::Parameters& parameters);
125 virtual ~KaonPhysics() = default;
126
130 void setDecayProperties(G4ParticleDefinition* kaon,
131 const std::vector<double>& branching_ratios,
132 double lifetime_factor) const;
133
145 void ConstructParticle() override;
146
147 void DumpDecayDetails(const G4ParticleDefinition* kaon) const;
148
155 void ConstructProcess() override{};
156
157 private:
158 mutable framework::logging::logger theLog_{
159 framework::logging::makeLogger("KaonPhysics")};
160};
161} // namespace simcore
162
163#endif /* SIMCORE_KAON_PHYSICS_H */
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Allows the configuration of properties of kaons produced in the simulation, in particular setting the...
Definition KaonPhysics.h:32
KaonZeroLongDecayChannel
Corresponding entries for the K^0_L.
Definition KaonPhysics.h:91
void ConstructProcess() override
Construct processes.
void setDecayProperties(G4ParticleDefinition *kaon, const std::vector< double > &branching_ratios, double lifetime_factor) const
Set the lifetime and branching ratios for one of the kaon species.
ChargedKaonDecayChannel
Represents the 6 possible decay channels for charged kaons in Geant4 (See G4KaonMinus....
Definition KaonPhysics.h:59
void ConstructParticle() override
Construct/Update particles.