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

#include <G4MuonRadiativeDecayChannelWithSpin.hh>

+ Inheritance diagram for G4MuonRadiativeDecayChannelWithSpin:

Public Member Functions

 G4MuonRadiativeDecayChannelWithSpin (const G4String &theParentName, G4double theBR)
 
 ~G4MuonRadiativeDecayChannelWithSpin () 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

 G4MuonRadiativeDecayChannelWithSpin (const G4MuonRadiativeDecayChannelWithSpin &)=default
 
G4MuonRadiativeDecayChannelWithSpinoperator= (const G4MuonRadiativeDecayChannelWithSpin &)
 
- 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 53 of file G4MuonRadiativeDecayChannelWithSpin.hh.

Constructor & Destructor Documentation

◆ G4MuonRadiativeDecayChannelWithSpin() [1/2]

G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( const G4String & theParentName,
G4double theBR )

Definition at line 47 of file G4MuonRadiativeDecayChannelWithSpin.cc.

49 : G4VDecayChannel("Radiative Muon Decay", 1)
50{
51 // set names for daughter particles
52 if (theParentName == "mu+") {
53 SetBR(theBR);
54 SetParent("mu+");
56 SetDaughter(0, "e+");
57 SetDaughter(1, "gamma");
58 SetDaughter(2, "nu_e");
59 SetDaughter(3, "anti_nu_mu");
60 }
61 else if (theParentName == "mu-") {
62 SetBR(theBR);
63 SetParent("mu-");
65 SetDaughter(0, "e-");
66 SetDaughter(1, "gamma");
67 SetDaughter(2, "anti_nu_e");
68 SetDaughter(3, "nu_mu");
69 }
70 else {
71#ifdef G4VERBOSE
72 if (GetVerboseLevel() > 0) {
73 G4cout << "G4RadiativeMuonDecayChannel::G4RadiativeMuonDecayChannel():";
74 G4cout << " parent particle is not muon but ";
75 G4cout << theParentName << G4endl;
76 }
77#endif
78 }
79}
#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)

Referenced by G4MuonRadiativeDecayChannelWithSpin().

◆ ~G4MuonRadiativeDecayChannelWithSpin()

G4MuonRadiativeDecayChannelWithSpin::~G4MuonRadiativeDecayChannelWithSpin ( )
overridedefault

◆ G4MuonRadiativeDecayChannelWithSpin() [2/2]

G4MuonRadiativeDecayChannelWithSpin::G4MuonRadiativeDecayChannelWithSpin ( const G4MuonRadiativeDecayChannelWithSpin & )
protecteddefault

Member Function Documentation

◆ DecayIt()

G4DecayProducts * G4MuonRadiativeDecayChannelWithSpin::DecayIt ( G4double )
overridevirtual

Implements G4VDecayChannel.

Definition at line 110 of file G4MuonRadiativeDecayChannelWithSpin.cc.

111{
112#ifdef G4VERBOSE
113 if (GetVerboseLevel() > 1) G4cout << "G4MuonRadiativeDecayChannelWithSpin::DecayIt()";
114#endif
115
118
119 // parent mass
120 G4double parentmass = G4MT_parent->GetPDGMass();
121
122 G4double EMMU = parentmass;
123
124 // daughters'mass
125 G4double daughtermass[4];
126 // G4double sumofdaughtermass = 0.0;
127 for (G4int index = 0; index < 4; ++index) {
128 daughtermass[index] = G4MT_daughters[index]->GetPDGMass();
129 // sumofdaughtermass += daughtermass[index];
130 }
131
132 G4double EMASS = daughtermass[0];
133
134 // create parent G4DynamicParticle at rest
135 G4ThreeVector dummy;
136 auto parentparticle = new G4DynamicParticle(G4MT_parent, dummy, 0.0);
137
138 // create G4Decayproducts
139 auto products = new G4DecayProducts(*parentparticle);
140 delete parentparticle;
141
142 G4double eps = EMASS / EMMU;
143
144 G4double som0, x, y, xx, yy, zz;
145 G4double cthetaE, cthetaG, cthetaGE, phiE, phiG;
146 const std::size_t MAX_LOOP = 10000;
147
148 for (std::size_t loop_counter1 = 0; loop_counter1 < MAX_LOOP; ++loop_counter1) {
149 for (std::size_t loop_counter2 = 0; loop_counter2 < MAX_LOOP; ++loop_counter2) {
150 // -------------------------------------------------------------------
151 // Build two vectors of random length and random direction, for the
152 // positron and the photon.
153 // x/y is the length of the vector, xx, yy and zz the components,
154 // phi is the azimutal angle, theta the polar angle.
155 // -------------------------------------------------------------------
156
157 // For the positron
158 //
159 x = G4UniformRand();
160
161 rn3dim(xx, yy, zz, x);
162
163 if (std::fabs((xx * xx) + (yy * yy) + (zz * zz) - (x * x)) > 0.001) {
164 G4cout << "Norm of x not correct" << G4endl;
165 }
166
167 phiE = atan4(xx, yy);
168 cthetaE = zz / x;
169 G4double sthetaE = std::sqrt((xx * xx) + (yy * yy)) / x;
170
171 // What you get:
172 //
173 // x = positron energy
174 // phiE = azimutal angle of positron momentum
175 // cthetaE = cosine of polar angle of positron momentum
176 // sthetaE = sine of polar angle of positron momentum
177 //
178 //// G4cout << " x, xx, yy, zz " << x << " " << xx << " "
179 //// << yy << " " << zz << G4endl;
180 //// G4cout << " phiE, cthetaE, sthetaE " << phiE << " "
181 //// << cthetaE << " "
182 //// << sthetaE << " " << G4endl;
183
184 // For the photon
185 //
186 y = G4UniformRand();
187
188 rn3dim(xx, yy, zz, y);
189
190 if (std::fabs((xx * xx) + (yy * yy) + (zz * zz) - (y * y)) > 0.001) {
191 G4cout << " Norm of y not correct " << G4endl;
192 }
193
194 phiG = atan4(xx, yy);
195 cthetaG = zz / y;
196 G4double sthetaG = std::sqrt((xx * xx) + (yy * yy)) / y;
197
198 // What you get:
199 //
200 // y = photon energy
201 // phiG = azimutal angle of photon momentum
202 // cthetaG = cosine of polar angle of photon momentum
203 // sthetaG = sine of polar angle of photon momentum
204 //
205 //// G4cout << " y, xx, yy, zz " << y << " " << xx << " "
206 //// << yy << " " << zz << G4endl;
207 //// G4cout << " phiG, cthetaG, sthetaG " << phiG << " "
208 //// << cthetaG << " "
209 //// << sthetaG << " " << G4endl;
210
211 // Calculate the angle between positron and photon (cosine)
212 //
213 cthetaGE = cthetaE * cthetaG + sthetaE * sthetaG * std::cos(phiE - phiG);
214
215 //// G4cout << x << " " << cthetaE << " " << sthetaE << " "
216 //// << y << " " << cthetaG << " " << sthetaG << " "
217 //// << cthetaGE
218
219 G4double term0 = eps * eps;
220 G4double term1 = x * ((1.0 - eps) * (1.0 - eps)) + 2.0 * eps;
221 G4double beta =
222 std::sqrt(x * ((1.0 - eps) * (1.0 - eps)) * (x * ((1.0 - eps) * (1.0 - eps)) + 4.0 * eps))
223 / term1;
224 G4double delta = 1.0 - beta * cthetaGE;
225
226 G4double term3 = y * (1.0 - (eps * eps));
227 G4double term6 = term1 * delta * term3;
228
229 G4double Qsqr = (1.0 - term1 - term3 + term0 + 0.5 * term6) / ((1.0 - eps) * (1.0 - eps));
230
231 // Check the kinematics.
232 //
233 if (Qsqr >= 0.0 && Qsqr <= 1.0) break;
234
235 } // end loop count
236
237 // Do the calculation for -1 muon polarization (i.e. mu+)
238 //
239 G4double Pmu = -1.0;
240 if (GetParentName() == "mu-") {
241 Pmu = +1.0;
242 }
243
244 som0 = fron(Pmu, x, y, cthetaE, cthetaG, cthetaGE);
245
246 // Sample the decay rate
247 //
248 if (G4UniformRand() * 177.0 <= som0) break;
249 }
250
251 G4double E = EMMU / 2. * (x * ((1. - eps) * (1. - eps)) + 2. * eps);
252 G4double G = EMMU / 2. * y * (1. - eps * eps);
253
254 if (E < EMASS) E = EMASS;
255
256 // calculate daughter momentum
257 G4double daughtermomentum[4];
258
259 daughtermomentum[0] = std::sqrt(E * E - EMASS * EMASS);
260
261 G4double sthetaE = std::sqrt(1. - cthetaE * cthetaE);
262 G4double cphiE = std::cos(phiE);
263 G4double sphiE = std::sin(phiE);
264
265 // Coordinates of the decay positron with respect to the muon spin
266
267 G4double px = sthetaE * cphiE;
268 G4double py = sthetaE * sphiE;
269 G4double pz = cthetaE;
270
271 G4ThreeVector direction0(px, py, pz);
272
273 direction0.rotateUz(parent_polarization);
274
275 auto daughterparticle0 =
276 new G4DynamicParticle(G4MT_daughters[0], daughtermomentum[0] * direction0);
277
278 products->PushProducts(daughterparticle0);
279
280 daughtermomentum[1] = G;
281
282 G4double sthetaG = std::sqrt(1. - cthetaG * cthetaG);
283 G4double cphiG = std::cos(phiG);
284 G4double sphiG = std::sin(phiG);
285
286 // Coordinates of the decay gamma with respect to the muon spin
287
288 px = sthetaG * cphiG;
289 py = sthetaG * sphiG;
290 pz = cthetaG;
291
292 G4ThreeVector direction1(px, py, pz);
293
294 direction1.rotateUz(parent_polarization);
295
296 auto daughterparticle1 =
297 new G4DynamicParticle(G4MT_daughters[1], daughtermomentum[1] * direction1);
298
299 products->PushProducts(daughterparticle1);
300
301 // daughter 3 ,4 (neutrinos)
302 // create neutrinos in the C.M frame of two neutrinos
303
304 G4double energy2 = parentmass - E - G;
305
306 G4ThreeVector P34 = -1. * (daughtermomentum[0] * direction0 + daughtermomentum[1] * direction1);
307 G4double vmass2 = energy2 * energy2 - P34.mag2();
308 G4double vmass = std::sqrt(vmass2);
309
310 G4double costhetan = 2. * G4UniformRand() - 1.0;
311 G4double sinthetan = std::sqrt((1.0 - costhetan) * (1.0 + costhetan));
312 G4double phin = twopi * G4UniformRand() * rad;
313 G4double sinphin = std::sin(phin);
314 G4double cosphin = std::cos(phin);
315
316 G4ThreeVector direction2(sinthetan * cosphin, sinthetan * sinphin, costhetan);
317
318 auto daughterparticle2 = new G4DynamicParticle(G4MT_daughters[2], direction2 * (vmass / 2.));
319 auto daughterparticle3 =
320 new G4DynamicParticle(G4MT_daughters[3], direction2 * (-1.0 * vmass / 2.));
321
322 // boost to the muon rest frame
323 G4double beta = P34.mag() / energy2;
324 G4ThreeVector direction34 = P34.unit();
325
326 G4LorentzVector p4 = daughterparticle2->Get4Momentum();
327 p4.boost(direction34.x() * beta, direction34.y() * beta, direction34.z() * beta);
328 daughterparticle2->Set4Momentum(p4);
329
330 p4 = daughterparticle3->Get4Momentum();
331 p4.boost(direction34.x() * beta, direction34.y() * beta, direction34.z() * beta);
332 daughterparticle3->Set4Momentum(p4);
333
334 products->PushProducts(daughterparticle2);
335 products->PushProducts(daughterparticle3);
336
337 daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
338 daughtermomentum[3] = daughterparticle3->GetTotalMomentum();
339
340 // output message
341#ifdef G4VERBOSE
342 if (GetVerboseLevel() > 1) {
343 G4cout << "G4MuonRadiativeDecayChannelWithSpin::DecayIt() -";
344 G4cout << " create decay products in rest frame " << G4endl;
345 G4double TT = daughterparticle0->GetTotalEnergy() + daughterparticle1->GetTotalEnergy()
346 + daughterparticle2->GetTotalEnergy() + daughterparticle3->GetTotalEnergy();
347 G4cout << "e :" << daughterparticle0->GetTotalEnergy() / MeV << G4endl;
348 G4cout << "gamma:" << daughterparticle1->GetTotalEnergy() / MeV << G4endl;
349 G4cout << "nu2 :" << daughterparticle2->GetTotalEnergy() / MeV << G4endl;
350 G4cout << "nu2 :" << daughterparticle3->GetTotalEnergy() / MeV << G4endl;
351 G4cout << "total:" << (TT - parentmass) / keV << G4endl;
352 if (GetVerboseLevel() > 1) {
353 products->DumpInfo();
354 }
355 }
356#endif
357
358 return products;
359}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4UniformRand()
Definition Randomize.hh:52
double z() const
Hep3Vector unit() const
double x() const
double mag2() const
double y() const
double mag() const
HepLorentzVector & boost(double, double, double)
G4ParticleDefinition ** G4MT_daughters
const G4String & GetParentName() const
G4ParticleDefinition * G4MT_parent
G4ThreeVector parent_polarization

◆ operator=()

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

Definition at line 82 of file G4MuonRadiativeDecayChannelWithSpin.cc.

83{
84 if (this != &right) {
87 rbranch = right.rbranch;
88
89 // copy parent name
90 parent_name = new G4String(*right.parent_name);
91
92 // clear daughters_name array
94
95 // recreate array
97 if (numberOfDaughters > 0) {
98 if (daughters_name != nullptr) ClearDaughtersName();
100 // copy daughters name
101 for (G4int index = 0; index < numberOfDaughters; ++index) {
102 daughters_name[index] = new G4String(*right.daughters_name[index]);
103 }
104 }
106 }
107 return *this;
108}
G4String ** daughters_name

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