79{
80
81
82
83
84#ifdef G4VERBOSE
86#endif
87
90
91
93
95
96
98
99 for (
G4int index = 0; index < 3; ++index) {
101
102 }
103
105
106
109
111 delete parentparticle;
112
113
114
119
121
124
125 G4double W_mue = (EMMU * EMMU + EMASS * EMASS) / (2. * EMMU);
127
129
130
131
132
133
134
135
136
137
138 const std::size_t MAX_LOOP = 10000;
139 for (std::size_t loop_count = 0; loop_count < MAX_LOOP; ++loop_count) {
140
141
143
144 x = x0 + rndm * (1. - x0);
145
147
149
150 F_IS = 1. / 6. * (-2. * x_squared + 3. * x - x0_squared);
151 F_AS = 1. / 6. * std::sqrt(x_squared - x0_squared) * (2. * x - 2. + std::sqrt(1. - x0_squared));
152
153 G_IS = 2. / 9. * (michel_rho - 0.75) * (4. * x_squared - 3. * x - x0_squared);
154 G_IS = G_IS + michel_eta * (1. - x) * x0;
155
156 G_AS = 3. * (michel_xsi - 1.) * (1. - x);
157 G_AS =
158 G_AS + 2. * (michel_xsi * michel_delta - 0.75) * (4. * x - 4. + std::sqrt(1. - x0_squared));
159 G_AS = 1. / 9. * std::sqrt(x_squared - x0_squared) * G_AS;
160
161 F_IS = F_IS + G_IS;
162 F_AS = F_AS + G_AS;
163
164
165
166 const G4double omega = std::log(EMMU / EMASS);
168
169 G4double F = 6. * F_IS + R_IS / std::sqrt(x_squared - x0_squared);
170
171
172
173 G4double R_AS = F_theta(x, x0, omega);
174
176
177 ctheta = 2. * rndm - 1.;
178
179 G4double G = 6. * F_AS - R_AS / std::sqrt(x_squared - x0_squared);
180
181 FG = std::sqrt(x_squared - x0_squared) * F * (1. + (G / F) * ctheta);
182
183 if (FG > FG_max) {
185 "Problem in Muon Decay: FG > FG_max");
186 FG_max = FG;
187 }
188
190
191 if (FG >= rndm * FG_max) break;
192 }
193
195
197
199
200 if (energy < EMASS)
energy = EMASS;
201
202
204
205 daughtermomentum[0] = std::sqrt(energy * energy - EMASS * EMASS);
206
207 G4double stheta = std::sqrt(1. - ctheta * ctheta);
210
211
215
217
219
220 auto daughterparticle0 =
222
223 products->PushProducts(daughterparticle0);
224
225
226
228 G4double vmass = std::sqrt((energy2 - daughtermomentum[0]) * (energy2 + daughtermomentum[0]));
229 G4double beta = -1.0 * daughtermomentum[0] / energy2;
231 G4double sinthetan = std::sqrt((1.0 - costhetan) * (1.0 + costhetan));
235
236 G4ThreeVector direction1(sinthetan * cosphin, sinthetan * sinphin, costhetan);
238 auto daughterparticle2 =
240
241
243 p4 = daughterparticle1->Get4Momentum();
244 p4.
boost(direction0.x() * beta, direction0.y() * beta, direction0.z() * beta);
245 daughterparticle1->Set4Momentum(p4);
246 p4 = daughterparticle2->Get4Momentum();
247 p4.
boost(direction0.x() * beta, direction0.y() * beta, direction0.z() * beta);
248 daughterparticle2->Set4Momentum(p4);
249 products->PushProducts(daughterparticle1);
250 products->PushProducts(daughterparticle2);
251 daughtermomentum[1] = daughterparticle1->GetTotalMomentum();
252 daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
253
254
255#ifdef G4VERBOSE
257 G4cout <<
"G4MuonDecayChannelWithSpin::DecayIt ";
258 G4cout <<
" create decay products in rest frame " <<
G4endl;
259 G4double TT = daughterparticle0->GetTotalEnergy() + daughterparticle1->GetTotalEnergy()
260 + daughterparticle2->GetTotalEnergy();
261 G4cout <<
"e " << daughterparticle0->GetTotalEnergy() / MeV <<
G4endl;
262 G4cout <<
"nu1" << daughterparticle1->GetTotalEnergy() / MeV <<
G4endl;
263 G4cout <<
"nu2" << daughterparticle2->GetTotalEnergy() / MeV <<
G4endl;
266 products->DumpInfo();
267 }
268 }
269#endif
270
271 return products;
272}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
HepLorentzVector & boost(double, double, double)
G4double GetPDGMass() const
G4ParticleDefinition ** G4MT_daughters
void CheckAndFillParent()
G4int GetVerboseLevel() const
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()
G4ThreeVector parent_polarization
G4double energy(const ThreeVector &p, const G4double m)