111{
112#ifdef G4VERBOSE
114#endif
115
118
119
121
123
124
126
127 for (
G4int index = 0; index < 4; ++index) {
129
130 }
131
133
134
137
138
140 delete parentparticle;
141
143
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
152
153
154
155
156
157
158
160
161 rn3dim(xx, yy, zz, x);
162
163 if (std::fabs((xx * xx) + (yy * yy) + (zz * zz) - (x * x)) > 0.001) {
165 }
166
167 phiE = atan4(xx, yy);
168 cthetaE = zz / x;
169 G4double sthetaE = std::sqrt((xx * xx) + (yy * yy)) / x;
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
187
188 rn3dim(xx, yy, zz, y);
189
190 if (std::fabs((xx * xx) + (yy * yy) + (zz * zz) - (y * y)) > 0.001) {
192 }
193
194 phiG = atan4(xx, yy);
195 cthetaG = zz / y;
196 G4double sthetaG = std::sqrt((xx * xx) + (yy * yy)) / y;
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213 cthetaGE = cthetaE * cthetaG + sthetaE * sthetaG * std::cos(phiE - phiG);
214
215
216
217
218
220 G4double term1 = x * ((1.0 - eps) * (1.0 - eps)) + 2.0 * eps;
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
232
233 if (Qsqr >= 0.0 && Qsqr <= 1.0) break;
234
235 }
236
237
238
241 Pmu = +1.0;
242 }
243
244 som0 = fron(Pmu, x, y, cthetaE, cthetaG, cthetaGE);
245
246
247
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
258
259 daughtermomentum[0] = std::sqrt(E * E - EMASS * EMASS);
260
261 G4double sthetaE = std::sqrt(1. - cthetaE * cthetaE);
264
265
266
270
272
274
275 auto daughterparticle0 =
277
278 products->PushProducts(daughterparticle0);
279
280 daughtermomentum[1] = G;
281
282 G4double sthetaG = std::sqrt(1. - cthetaG * cthetaG);
285
286
287
288 px = sthetaG * cphiG;
289 py = sthetaG * sphiG;
290 pz = cthetaG;
291
293
295
296 auto daughterparticle1 =
298
299 products->PushProducts(daughterparticle1);
300
301
302
303
304 G4double energy2 = parentmass - E - G;
305
306 G4ThreeVector P34 = -1. * (daughtermomentum[0] * direction0 + daughtermomentum[1] * direction1);
309
311 G4double sinthetan = std::sqrt((1.0 - costhetan) * (1.0 + costhetan));
315
316 G4ThreeVector direction2(sinthetan * cosphin, sinthetan * sinphin, costhetan);
317
319 auto daughterparticle3 =
321
322
325
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
341#ifdef G4VERBOSE
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;
353 products->DumpInfo();
354 }
355 }
356#endif
357
358 return products;
359}
HepLorentzVector & boost(double, double, double)
G4double GetPDGMass() const
G4ParticleDefinition ** G4MT_daughters
void CheckAndFillParent()
const G4String & GetParentName() const
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()
G4ThreeVector parent_polarization