153{
154
155
156
157#ifdef G4VERBOSE
159#endif
160
161
164
165
171
172
173 G4double daughterP[3], daughterE[3];
176 const size_t MAX_LOOP = 10000;
177 for (std::size_t loop_counter=0; loop_counter<MAX_LOOP; ++loop_counter)
178 {
180 PhaseSpace(massK, &daughterM[0], &daughterE[0], &daughterP[0]);
184 if ( r <= w) break;
185 }
186
187
188#ifdef G4VERBOSE
190 {
197 }
198#endif
199
200
204 delete direction;
205
206
209 delete parentparticle;
210
211
212 G4double costheta, sintheta, phi, sinphi, cosphi;
213 G4double costhetan, sinthetan, phin, sinphin, cosphin;
214
215
217 sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
219 sinphi = std::sin(phi);
220 cosphi = std::cos(phi);
221 direction =
new G4ThreeVector(sintheta*cosphi,sintheta*sinphi,costheta);
226
227
228 costhetan = (daughterP[1]*daughterP[1]
229 - daughterP[2]*daughterP[2]
230 - daughterP[0]*daughterP[0])/(2.0*daughterP[2]*daughterP[0]);
231 sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
233 sinphin = std::sin(phin);
234 cosphin = std::cos(phin);
235 direction->
setX( sinthetan*cosphin*costheta*cosphi
236 - sinthetan*sinphin*sinphi + costhetan*sintheta*cosphi);
237 direction->
setY( sinthetan*cosphin*costheta*sinphi
238 + sinthetan*sinphin*cosphi + costhetan*sintheta*sinphi);
239 direction->
setZ( -sinthetan*cosphin*sintheta + costhetan*costheta);
240
244
245
249
250#ifdef G4VERBOSE
252 {
253 G4cout <<
"G4KL3DecayChannel::DecayIt ";
254 G4cout <<
" create decay products in rest frame " <<
G4endl;
255 G4cout <<
" decay products address=" << products <<
G4endl;
257 }
258#endif
259 delete direction;
260 return products;
261}
CLHEP::Hep3Vector G4ThreeVector
G4int PushProducts(G4DynamicParticle *aParticle)
void PhaseSpace(G4double Mparent, const G4double *Mdaughter, G4double *Edaughter, G4double *Pdaughter)
G4double DalitzDensity(G4double parentmass, G4double Epi, G4double El, G4double Enu, G4double massPi, G4double massL, G4double massNu)
G4double GetPDGMass() const
G4ParticleDefinition ** G4MT_daughters
void CheckAndFillParent()
G4String ** daughters_name
G4ParticleDefinition * G4MT_parent
void CheckAndFillDaughters()