Geant4 10.7.0
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)
 
virtual ~G4MuonDecayChannel ()
 
virtual G4DecayProductsDecayIt (G4double)
 
- 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="")
 
virtual ~G4VDecayChannel ()
 
G4bool operator== (const G4VDecayChannel &r) const
 
G4bool operator!= (const G4VDecayChannel &r) const
 
G4bool operator< (const G4VDecayChannel &right) const
 
virtual G4DecayProductsDecayIt (G4double parentMass=-1.0)=0
 
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 ()
 
 G4MuonDecayChannel (const G4MuonDecayChannel &)
 
G4MuonDecayChanneloperator= (const G4MuonDecayChannel &)
 
- Protected Member Functions inherited from G4VDecayChannel
void ClearDaughtersName ()
 
void CheckAndFillDaughters ()
 
void CheckAndFillParent ()
 
G4double DynamicalMass (G4double massPDG, G4double width, G4double maxDev=1.0) const
 
 G4VDecayChannel ()
 
 G4VDecayChannel (const G4VDecayChannel &)
 
G4VDecayChanneloperator= (const G4VDecayChannel &)
 

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 50 of file G4MuonDecayChannel.cc.

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}
#define G4endl
Definition: G4ios.hh:57
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 ( )
virtual

Definition at line 91 of file G4MuonDecayChannel.cc.

92{
93}

◆ G4MuonDecayChannel() [2/3]

G4MuonDecayChannel::G4MuonDecayChannel ( )
protected

Definition at line 45 of file G4MuonDecayChannel.cc.

47{
48}

◆ G4MuonDecayChannel() [3/3]

G4MuonDecayChannel::G4MuonDecayChannel ( const G4MuonDecayChannel right)
protected

Definition at line 86 of file G4MuonDecayChannel.cc.

87 : G4VDecayChannel(right)
88{
89}

Member Function Documentation

◆ DecayIt()

G4DecayProducts * G4MuonDecayChannel::DecayIt ( G4double  )
virtual

Implements G4VDecayChannel.

Reimplemented in G4MuonDecayChannelWithSpin.

Definition at line 126 of file G4MuonDecayChannel.cc.

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
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();
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 G4UniformRand()
Definition: Randomize.hh:52
HepRotation & set(const Hep3Vector &axis, double delta)
Definition: RotationA.cc:23
void DumpInfo() const
G4int PushProducts(G4DynamicParticle *aParticle)
G4ParticleDefinition ** G4MT_daughters
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()

◆ operator=()

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

Definition at line 96 of file G4MuonDecayChannel.cc.

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}
G4String * parent_name
G4String ** daughters_name
G4String kinematics_name

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