62 using namespace G4InuclSpecialFunctions;
77 momDist(0), angDist(0), multiplicity(0), bullet_ekin(0.) {;}
94 const std::vector<G4int>& particle_kinds) {
109 kinds = particle_kinds;
139 <<
" is " << is <<
" fs " << fs <<
G4endl;
146 G4int kw = (fs==is) ? 1 : 2;
165 std::vector<G4LorentzVector>& finalState) {
183 <<
"\n pmod " << pscm
184 <<
"\n before rotation px " <<
mom.
x() <<
" py " <<
mom.
y()
188 finalState.resize(2);
190 finalState[0].setVectM(
mom, masses[0]);
194 G4cout <<
" after rotation px " << finalState[0].x() <<
" py "
195 << finalState[0].y() <<
" pz " << finalState[0].z() <<
G4endl;
198 finalState[1].setVectM(-finalState[0].vect(), masses[1]);
206 std::vector<G4LorentzVector>& finalState) {
241 G4cout <<
" knd_last " <<
kinds.back() <<
" mass_last "
257 if (pmod <
small)
break;
258 eleft -= std::sqrt(pmod*pmod + masses[i]*masses[i]);
262 <<
" mass2 " << masses[i]*masses[i] <<
" eleft " << eleft
263 <<
"\n x1 " << eleft - mass_last <<
G4endl;
266 if (eleft <= mass_last)
break;
271 if (i < multiplicity-1)
continue;
273 G4double plast = eleft * eleft - masses.back()*masses.back();
276 if (plast <=
small)
continue;
278 plast = std::sqrt(plast);
286 G4cerr <<
" Unable to generate momenta for multiplicity "
300 return ( (pmod.size() != 3) ||
301 !(pmod[0] < std::fabs(pmod[1] - pmod[2]) ||
302 pmod[0] > pmod[1] + pmod[2] ||
303 pmod[1] < std::fabs(pmod[0] - pmod[2]) ||
304 pmod[1] > pmod[0] + pmod[2] ||
305 pmod[2] < std::fabs(pmod[0] - pmod[1]) ||
306 pmod[2] > pmod[1] + pmod[0])
314 std::vector<G4LorentzVector>& finalState) {
330 std::vector<G4LorentzVector>& finalState) {
334 finalState.resize(3);
354 finalState[0] =
toSCM.
rotate(finalState[2], finalState[0]);
357 finalState[1].set(0.,0.,0.,initialMass);
358 finalState[1] -= finalState[0] + finalState[2];
363 std::vector<G4LorentzVector>& finalState) {
380 std::accumulate(finalState.begin(), finalState.end()-2,
G4LorentzVector());
383 costh = -0.5 * (pmod*pmod +
386 / pmod /
modules[multiplicity-2];
399 finalState[multiplicity-2] =
401 masses[multiplicity-2]);
402 finalState[multiplicity-2] =
toSCM.
rotate(psum, finalState[multiplicity-2]);
405 finalState[multiplicity-1].set(0.,0.,0.,initialMass);
406 finalState[multiplicity-1] -= psum + finalState[multiplicity-2];
415 G4cout <<
" >>> " <<
GetName() <<
"::GenerateCosTheta " << ptype
424 G4double p0 = ptype<3 ? 0.36 : 0.25;
425 G4double alf = 1.0 / p0 / (p0 - (pmod+p0)*
G4Exp(-pmod / p0));
435 G4cout <<
" s1 * alf * G4Exp(-s1 / p0) " << salf
436 <<
" s2 " << s2 <<
G4endl;
439 if (salf > s2) sinth = s1 / pmod;
443 G4cout <<
" itry1 " << itry1 <<
" sinth " << sinth <<
G4endl;
447 G4cout <<
" high energy angles generation: itry1 " << itry1 <<
G4endl;
453 G4double costh = std::sqrt(1.0 - sinth * sinth);
465 const std::vector<G4double>& masses,
466 std::vector<G4LorentzVector>& finalState) {
472 size_t N = masses.size();
473 finalState.resize(N);
475 G4double mtot = std::accumulate(masses.begin(), masses.end(), 0.0);
483 for (
size_t k=N-1;
k>0; --
k) {
496 finalState[
k].setVectM(momV,masses[k]);
499 finalState[
k].boost(boostV);
500 recoil.
boost(boostV);
504 finalState[0] = recoil;
512 G4double Fmax = std::sqrt(g4pow->
powN(xN/(xN+1.),N)/(xN+1.));
517 F = std::sqrt(g4pow->
powN(chi,N)*(1.-chi));