105{
106
107
108
109
110#ifdef G4VERBOSE
112#endif
113
116
117
119 const G4int N_DAUGHTER = 3;
120
121
123
124 for (
G4int index = 0; index < N_DAUGHTER; ++index) {
126
127 }
128
129
132
134 delete parentparticle;
135
136
137 G4double daughtermomentum[N_DAUGHTER];
138
139 G4double xmax = (1.0 + daughtermass[0] * daughtermass[0] / parentmass / parentmass);
141
143
145 G4double EMax = parentmass / 2 - daughtermass[0];
146
147 const std::size_t MAX_LOOP = 1000;
148
149 for (std::size_t loop1 = 0; loop1 < MAX_LOOP; ++loop1) {
151 for (std::size_t loop2 = 0; loop2 < MAX_LOOP; ++loop2) {
154 if (gam <= x * (1. - x)) break;
155 x = xmax;
156 }
157 Ene = x;
158 if (Ene >= (1. - Ee)) break;
159 Ene = 1. - Ee;
160 }
162
163
164
165 G4double costheta, sintheta, rphi, rtheta, rpsi;
166 costheta = 1. - 2. / Ee - 2. / Ene + 2. / Ene / Ee;
167 sintheta = std::sqrt(1. - costheta * costheta);
168
172
174 rot.
set(rphi, rtheta, rpsi);
175
176
177 daughtermomentum[0] = std::sqrt(Ee * Ee * EMax * EMax + 2.0 * Ee * EMax * daughtermass[0]);
179
180 direction0 *= rot;
181
182 auto daughterparticle =
184
185 products->PushProducts(daughterparticle);
186
187
188
189 daughtermomentum[1] = std::sqrt(Ene * Ene * EMax * EMax + 2.0 * Ene * EMax * daughtermass[1]);
191
192 direction1 *= rot;
193
194 auto daughterparticle1 =
196 products->PushProducts(daughterparticle1);
197
198
199
200 daughtermomentum[2] = std::sqrt(Enm * Enm * EMax * EMax + 2.0 * Enm * EMax * daughtermass[2]);
201 G4ThreeVector direction2(-Ene / Enm * sintheta, 0, -Ee / Enm - Ene / Enm * costheta);
202
203 direction2 *= rot;
204
205 auto daughterparticle2 =
207 products->PushProducts(daughterparticle2);
208
209
210#ifdef G4VERBOSE
212 G4cout <<
"G4MuonDecayChannel::DecayIt()";
213 G4cout <<
" create decay products in rest frame " <<
G4endl;
214 products->DumpInfo();
215 }
216#endif
217 return products;
218}
HepRotation & set(const Hep3Vector &axis, double delta)
G4double GetPDGMass() const
G4ParticleDefinition ** G4MT_daughters
void CheckAndFillParent()
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()