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 public:
119 KaonPhysics(const G4String& name,
120 const framework::config::Parameters& parameters);
121 virtual ~KaonPhysics() = default;
122
126 void setDecayProperties(G4ParticleDefinition* kaon,
127 const std::vector<double>& branching_ratios,
128 double lifetime_factor) const;
129
141 void ConstructParticle() override;
142
143 void dumpDecayDetails(const G4ParticleDefinition* kaon) const;
144
151 void ConstructProcess() override {};
152
153 private:
154 mutable framework::logging::logger the_log_{
155 framework::logging::makeLogger("KaonPhysics")};
156};
157} // namespace simcore
158
159#endif /* SIMCORE_KAON_PHYSICS_H */
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
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.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...