Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MuonDecayChannel Class Reference

#include <G4MuonDecayChannel.hh>

+ Inheritance diagram for G4MuonDecayChannel:

Public Member Functions

 G4MuonDecayChannel (const G4String &parentName, G4double BR)
 
 ~G4MuonDecayChannel () override=default
 
G4DecayProductsDecayIt (G4double) override
 
- Public Member Functions inherited from G4VDecayChannel
 G4VDecayChannel (const G4String &aName, G4int Verbose=1)
 
 G4VDecayChannel (const G4String &aName, const G4String &theParentName, G4double theBR, G4int theNumberOfDaughters, const G4String &theDaughterName1, const G4String &theDaughterName2="", const G4String &theDaughterName3="", const G4String &theDaughterName4="", const G4String &theDaughterName5="")
 
virtual ~G4VDecayChannel ()
 
G4bool operator== (const G4VDecayChannel &r) const
 
G4bool operator!= (const G4VDecayChannel &r) const
 
G4bool operator< (const G4VDecayChannel &right) const
 
const G4StringGetKinematicsName () const
 
G4double GetBR () const
 
G4int GetNumberOfDaughters () const
 
G4ParticleDefinitionGetParent ()
 
G4ParticleDefinitionGetDaughter (G4int anIndex)
 
G4int GetAngularMomentum ()
 
const G4StringGetParentName () const
 
const G4StringGetDaughterName (G4int anIndex) const
 
G4double GetParentMass () const
 
G4double GetDaughterMass (G4int anIndex) const
 
void SetParent (const G4ParticleDefinition *particle_type)
 
void SetParent (const G4String &particle_name)
 
void SetBR (G4double value)
 
void SetNumberOfDaughters (G4int value)
 
void SetDaughter (G4int anIndex, const G4ParticleDefinition *particle_type)
 
void SetDaughter (G4int anIndex, const G4String &particle_name)
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 
void DumpInfo ()
 
G4double GetRangeMass () const
 
void SetRangeMass (G4double val)
 
virtual G4bool IsOKWithParentMass (G4double parentMass)
 
void SetPolarization (const G4ThreeVector &)
 
const G4ThreeVectorGetPolarization () const
 

Protected Member Functions

 G4MuonDecayChannel ()=default
 
 G4MuonDecayChannel (const G4MuonDecayChannel &)=default
 
G4MuonDecayChanneloperator= (const G4MuonDecayChannel &)
 
- Protected Member Functions inherited from G4VDecayChannel
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 
void ClearDaughtersName ()
 
void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=1.0) const
 

Additional Inherited Members

- Protected Attributes inherited from G4VDecayChannel
G4String kinematics_name = ""
 
G4double rbranch = 0.0
 
G4Stringparent_name = nullptr
 
G4String ** daughters_name = nullptr
 
G4double rangeMass = 2.5
 
G4ThreeVector parent_polarization
 
G4ParticleTableparticletable = nullptr
 
G4ParticleDefinitionG4MT_parent = nullptr
 
G4ParticleDefinition ** G4MT_daughters = nullptr
 
G4double G4MT_parent_mass = 0.0
 
G4doubleG4MT_daughters_mass = nullptr
 
G4doubleG4MT_daughters_width = nullptr
 
G4Mutex daughtersMutex
 
G4Mutex parentMutex
 
G4int numberOfDaughters = 0
 
G4int verboseLevel = 1
 
- Static Protected Attributes inherited from G4VDecayChannel
static const G4String noName = " "
 

Detailed Description

Definition at line 43 of file G4MuonDecayChannel.hh.

Constructor & Destructor Documentation

◆ G4MuonDecayChannel() [1/3]

G4MuonDecayChannel::G4MuonDecayChannel ( const G4String & parentName,
G4double BR )

Definition at line 46 of file G4MuonDecayChannel.cc.

47 : G4VDecayChannel("Muon Decay", 1)
48{
49 // set names for daughter particles
50 if (theParentName == "mu+") {
51 SetBR(theBR);
52 SetParent("mu+");
54 SetDaughter(0, "e+");
55 SetDaughter(1, "nu_e");
56 SetDaughter(2, "anti_nu_mu");
57 }
58 else if (theParentName == "mu-") {
59 SetBR(theBR);
60 SetParent("mu-");
62 SetDaughter(0, "e-");
63 SetDaughter(1, "anti_nu_e");
64 SetDaughter(2, "nu_mu");
65 }
66 else {
67#ifdef G4VERBOSE
68 if (GetVerboseLevel() > 0) {
69 G4cout << "G4MuonDecayChannel:: constructor :";
70 G4cout << " parent particle is not muon but ";
71 G4cout << theParentName << G4endl;
72 }
73#endif
74 }
75}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
void SetBR(G4double value)
G4int GetVerboseLevel() const
void SetNumberOfDaughters(G4int value)
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
void SetParent(const G4ParticleDefinition *particle_type)

◆ ~G4MuonDecayChannel()

G4MuonDecayChannel::~G4MuonDecayChannel ( )
overridedefault

◆ G4MuonDecayChannel() [2/3]

G4MuonDecayChannel::G4MuonDecayChannel ( )
protecteddefault

◆ G4MuonDecayChannel() [3/3]

G4MuonDecayChannel::G4MuonDecayChannel ( const G4MuonDecayChannel & )
protecteddefault

Member Function Documentation

◆ DecayIt()

G4DecayProducts * G4MuonDecayChannel::DecayIt ( G4double )
overridevirtual

Implements G4VDecayChannel.

Reimplemented in G4MuonDecayChannelWithSpin.

Definition at line 104 of file G4MuonDecayChannel.cc.

105{
106 // this version neglects muon polarization,and electron mass
107 // assumes the pure V-A coupling
108 // the Neutrinos are correctly V-A
109
110#ifdef G4VERBOSE
111 if (GetVerboseLevel() > 1) G4cout << "G4MuonDecayChannel::DecayIt ";
112#endif
113
116
117 // parent mass
118 G4double parentmass = G4MT_parent->GetPDGMass();
119 const G4int N_DAUGHTER = 3;
120
121 // daughters'mass
122 G4double daughtermass[N_DAUGHTER];
123 // G4double sumofdaughtermass = 0.0;
124 for (G4int index = 0; index < N_DAUGHTER; ++index) {
125 daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
126 // sumofdaughtermass += daughtermass[index];
127 }
128
129 // create parent G4DynamicParticle at rest
130 G4ThreeVector dummy;
131 auto parentparticle = new G4DynamicParticle(G4MT_parent, dummy, 0.0);
132 // create G4Decayproducts
133 auto products = new G4DecayProducts(*parentparticle);
134 delete parentparticle;
135
136 // calculate daughter momentum
137 G4double daughtermomentum[N_DAUGHTER];
138 // calculate electron energy
139 G4double xmax = (1.0 + daughtermass[0] * daughtermass[0] / parentmass / parentmass);
140 G4double x;
141
142 G4double Ee, Ene;
143
145 G4double EMax = parentmass / 2 - daughtermass[0];
146
147 const std::size_t MAX_LOOP = 1000;
148 // Generating Random Energy
149 for (std::size_t loop1 = 0; loop1 < MAX_LOOP; ++loop1) {
150 Ee = G4UniformRand();
151 for (std::size_t loop2 = 0; loop2 < MAX_LOOP; ++loop2) {
152 x = xmax * G4UniformRand();
153 gam = G4UniformRand();
154 if (gam <= x * (1. - x)) break;
155 x = xmax;
156 }
157 Ene = x;
158 if (Ene >= (1. - Ee)) break;
159 Ene = 1. - Ee;
160 }
161 G4double Enm = (2. - Ee - Ene);
162
163 // initialisation of rotation parameters
164
165 G4double costheta, sintheta, rphi, rtheta, rpsi;
166 costheta = 1. - 2. / Ee - 2. / Ene + 2. / Ene / Ee;
167 sintheta = std::sqrt(1. - costheta * costheta);
168
169 rphi = twopi * G4UniformRand() * rad;
170 rtheta = (std::acos(2. * G4UniformRand() - 1.));
171 rpsi = twopi * G4UniformRand() * rad;
172
174 rot.set(rphi, rtheta, rpsi);
175
176 // electron 0
177 daughtermomentum[0] = std::sqrt(Ee * Ee * EMax * EMax + 2.0 * Ee * EMax * daughtermass[0]);
178 G4ThreeVector direction0(0.0, 0.0, 1.0);
179
180 direction0 *= rot;
181
182 auto daughterparticle =
183 new G4DynamicParticle(G4MT_daughters[0], direction0 * daughtermomentum[0]);
184
185 products->PushProducts(daughterparticle);
186
187 // electronic neutrino 1
188
189 daughtermomentum[1] = std::sqrt(Ene * Ene * EMax * EMax + 2.0 * Ene * EMax * daughtermass[1]);
190 G4ThreeVector direction1(sintheta, 0.0, costheta);
191
192 direction1 *= rot;
193
194 auto daughterparticle1 =
195 new G4DynamicParticle(G4MT_daughters[1], direction1 * daughtermomentum[1]);
196 products->PushProducts(daughterparticle1);
197
198 // muonnic neutrino 2
199
200 daughtermomentum[2] = std::sqrt(Enm * Enm * EMax * EMax + 2.0 * Enm * EMax * daughtermass[2]);
201 G4ThreeVector direction2(-Ene / Enm * sintheta, 0, -Ee / Enm - Ene / Enm * costheta);
202
203 direction2 *= rot;
204
205 auto daughterparticle2 =
206 new G4DynamicParticle(G4MT_daughters[2], direction2 * daughtermomentum[2]);
207 products->PushProducts(daughterparticle2);
208
209 // output message
210#ifdef G4VERBOSE
211 if (GetVerboseLevel() > 1) {
212 G4cout << "G4MuonDecayChannel::DecayIt()";
213 G4cout << " create decay products in rest frame " << G4endl;
214 products->DumpInfo();
215 }
216#endif
217 return products;
218}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4UniformRand()
Definition Randomize.hh:52
HepRotation & set(const Hep3Vector &axis, double delta)
Definition RotationA.cc:23
G4ParticleDefinition ** G4MT_daughters
G4ParticleDefinition * G4MT_parent

◆ operator=()

G4MuonDecayChannel & G4MuonDecayChannel::operator= ( const G4MuonDecayChannel & right)
protected

Definition at line 77 of file G4MuonDecayChannel.cc.

78{
79 if (this != &right) {
82 rbranch = right.rbranch;
83
84 // copy parent name
85 parent_name = new G4String(*right.parent_name);
86
87 // clear daughters_name array
89
90 // recreate array
92 if (numberOfDaughters > 0) {
93 if (daughters_name != nullptr) ClearDaughtersName();
95 // copy daughters name
96 for (G4int index = 0; index < numberOfDaughters; ++index) {
97 daughters_name[index] = new G4String(*right.daughters_name[index]);
98 }
99 }
100 }
101 return *this;
102}
G4String ** daughters_name

The documentation for this class was generated from the following files: