Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MuonDecayChannel.cc
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4MuonDecayChannel class implementation
27//
28// Author: H.Kurashige, 30 May 1997
29// Contributions:
30// - 2005 - M.Melissas, J.Brunner CPPM/IN2P3
31// Added V-A fluxes for neutrinos using a new algorithm, 2005
32// --------------------------------------------------------------------
33
36#include "G4SystemOfUnits.hh"
37#include "G4DecayProducts.hh"
38#include "G4VDecayChannel.hh"
39#include "G4MuonDecayChannel.hh"
40#include "Randomize.hh"
41#include "G4LorentzVector.hh"
42#include "G4LorentzRotation.hh"
43#include "G4RotationMatrix.hh"
44
47{
48}
49
51 G4double theBR)
52 : G4VDecayChannel("Muon Decay", 1)
53{
54 // set names for daughter particles
55 if (theParentName == "mu+")
56 {
57 SetBR(theBR);
58 SetParent("mu+");
60 SetDaughter(0, "e+");
61 SetDaughter(1, "nu_e");
62 SetDaughter(2, "anti_nu_mu");
63 }
64 else if (theParentName == "mu-")
65 {
66 SetBR(theBR);
67 SetParent("mu-");
69 SetDaughter(0, "e-");
70 SetDaughter(1, "anti_nu_e");
71 SetDaughter(2, "nu_mu");
72 }
73 else
74 {
75#ifdef G4VERBOSE
76 if (GetVerboseLevel()>0)
77 {
78 G4cout << "G4MuonDecayChannel:: constructor :";
79 G4cout << " parent particle is not muon but ";
80 G4cout << theParentName << G4endl;
81 }
82#endif
83 }
84}
85
87 : G4VDecayChannel(right)
88{
89}
90
92{
93}
94
97{
98 if (this != &right)
99 {
102 rbranch = right.rbranch;
103
104 // copy parent name
105 parent_name = new G4String(*right.parent_name);
106
107 // clear daughters_name array
109
110 // recreate array
112 if ( numberOfDaughters >0 )
113 {
116 // copy daughters name
117 for (G4int index=0; index < numberOfDaughters; ++index)
118 {
119 daughters_name[index] = new G4String(*right.daughters_name[index]);
120 }
121 }
122 }
123 return *this;
124}
125
127{
128 // this version neglects muon polarization,and electron mass
129 // assumes the pure V-A coupling
130 // the Neutrinos are correctly V-A
131
132#ifdef G4VERBOSE
133 if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
134#endif
135
138
139 // parent mass
140 G4double parentmass = G4MT_parent->GetPDGMass();
141 const G4int N_DAUGHTER=3;
142
143 // daughters'mass
144 G4double daughtermass[N_DAUGHTER];
145 G4double sumofdaughtermass = 0.0;
146 for (G4int index=0; index<N_DAUGHTER; ++index)
147 {
148 daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
149 sumofdaughtermass += daughtermass[index];
150 }
151
152 // create parent G4DynamicParticle at rest
153 G4ThreeVector dummy;
154 G4DynamicParticle* parentparticle
155 = new G4DynamicParticle( G4MT_parent, dummy, 0.0);
156 // create G4Decayproducts
157 G4DecayProducts *products = new G4DecayProducts(*parentparticle);
158 delete parentparticle;
159
160 // calculate daughter momentum
161 G4double daughtermomentum[N_DAUGHTER];
162 // calculate electron energy
163 G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
164 G4double x;
165
166 G4double Ee,Ene;
167
168 G4double gam;
169 G4double EMax=parentmass/2-daughtermass[0];
170
171 const std::size_t MAX_LOOP=1000;
172 //Generating Random Energy
173 for (std::size_t loop1=0; loop1<MAX_LOOP; ++loop1)
174 {
175 Ee=G4UniformRand();
176 for (std::size_t loop2 =0; loop2<MAX_LOOP; ++loop2)
177 {
178 x=xmax*G4UniformRand();
179 gam=G4UniformRand();
180 if (gam <= x*(1.-x)) break;
181 x = xmax;
182 }
183 Ene=x;
184 if ( Ene >= (1.-Ee)) break;
185 Ene = 1.-Ee;
186 }
187 G4double Enm=(2.-Ee-Ene);
188
189 // initialisation of rotation parameters
190
191 G4double costheta,sintheta,rphi,rtheta,rpsi;
192 costheta= 1.-2./Ee-2./Ene+2./Ene/Ee;
193 sintheta=std::sqrt(1.-costheta*costheta);
194
195
196 rphi=twopi*G4UniformRand()*rad;
197 rtheta=(std::acos(2.*G4UniformRand()-1.));
198 rpsi=twopi*G4UniformRand()*rad;
199
201 rot.set(rphi,rtheta,rpsi);
202
203 // electron 0
204 daughtermomentum[0]=std::sqrt(Ee*Ee*EMax*EMax+2.0*Ee*EMax * daughtermass[0]);
205 G4ThreeVector direction0(0.0,0.0,1.0);
206
207 direction0 *= rot;
208
209 G4DynamicParticle* daughterparticle
210 = new G4DynamicParticle (G4MT_daughters[0], direction0*daughtermomentum[0]);
211
212 products->PushProducts(daughterparticle);
213
214 // electronic neutrino 1
215
216 daughtermomentum[1] = std::sqrt(Ene*Ene*EMax*EMax
217 +2.0*Ene*EMax*daughtermass[1]);
218 G4ThreeVector direction1(sintheta, 0.0, costheta);
219
220 direction1 *= rot;
221
222 G4DynamicParticle* daughterparticle1
223 = new G4DynamicParticle (G4MT_daughters[1], direction1*daughtermomentum[1]);
224 products->PushProducts(daughterparticle1);
225
226 // muonnic neutrino 2
227
228 daughtermomentum[2] = std::sqrt(Enm*Enm*EMax*EMax
229 +2.0*Enm*EMax*daughtermass[2]);
230 G4ThreeVector direction2(-Ene/Enm*sintheta,0,-Ee/Enm-Ene/Enm*costheta);
231
232 direction2 *= rot;
233
234 G4DynamicParticle* daughterparticle2
235 = new G4DynamicParticle (G4MT_daughters[2], direction2*daughtermomentum[2]);
236 products->PushProducts(daughterparticle2);
237
238 // output message
239#ifdef G4VERBOSE
240 if (GetVerboseLevel()>1)
241 {
242 G4cout << "G4MuonDecayChannel::DecayIt()";
243 G4cout << " create decay products in rest frame " << G4endl;
244 products->DumpInfo();
245 }
246#endif
247 return products;
248}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
HepRotation & set(const Hep3Vector &axis, double delta)
Definition: RotationA.cc:23
void DumpInfo() const
G4int PushProducts(G4DynamicParticle *aParticle)
virtual G4DecayProducts * DecayIt(G4double)
G4MuonDecayChannel & operator=(const G4MuonDecayChannel &)
G4ParticleDefinition ** G4MT_daughters
G4String * parent_name
void SetBR(G4double value)
G4String ** daughters_name
G4int GetVerboseLevel() const
void SetNumberOfDaughters(G4int value)
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()
void SetDaughter(G4int anIndex, const G4ParticleDefinition *particle_type)
G4String kinematics_name
void SetParent(const G4ParticleDefinition *particle_type)