126{
127
128
129
130#ifdef G4VERBOSE
132#endif
133
134
137
138
144
145
146 G4double daughterP[3], daughterE[3];
149 const size_t MAX_LOOP = 10000;
150 for (std::size_t loop_counter = 0; loop_counter < MAX_LOOP; ++loop_counter) {
152 PhaseSpace(massK, &daughterM[0], &daughterE[0], &daughterP[0]);
155 if (r <= w) break;
156 }
157
158
159#ifdef G4VERBOSE
164 }
165#endif
166
167
170 delete direction;
171
172
174 delete parentparticle;
175
176
177 G4double costheta, sintheta, phi, sinphi, cosphi;
178 G4double costhetan, sinthetan, phin, sinphin, cosphin;
179
180
182 sintheta = std::sqrt((1.0 - costheta) * (1.0 + costheta));
184 sinphi = std::sin(phi);
185 cosphi = std::cos(phi);
186 direction =
new G4ThreeVector(sintheta * cosphi, sintheta * sinphi, costheta);
189 products->PushProducts(daughterparticle);
190
191
192 costhetan =
193 (daughterP[1] * daughterP[1] - daughterP[2] * daughterP[2] - daughterP[0] * daughterP[0])
194 / (2.0 * daughterP[2] * daughterP[0]);
195 sinthetan = std::sqrt((1.0 - costhetan) * (1.0 + costhetan));
197 sinphin = std::sin(phin);
198 cosphin = std::cos(phin);
199 direction->setX(sinthetan * cosphin * costheta * cosphi - sinthetan * sinphin * sinphi
200 + costhetan * sintheta * cosphi);
201 direction->setY(sinthetan * cosphin * costheta * sinphi + sinthetan * sinphin * cosphi
202 + costhetan * sintheta * sinphi);
203 direction->setZ(-sinthetan * cosphin * sintheta + costhetan * costheta);
204
207 products->PushProducts(daughterparticle);
208
209
212 products->PushProducts(daughterparticle);
213
214#ifdef G4VERBOSE
216 G4cout <<
"G4KL3DecayChannel::DecayIt ";
217 G4cout <<
" create decay products in rest frame " <<
G4endl;
218 G4cout <<
" decay products address=" << products <<
G4endl;
219 products->DumpInfo();
220 }
221#endif
222 delete direction;
223 return products;
224}
CLHEP::Hep3Vector G4ThreeVector
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()