45 const std::vector<G4double>& masses,
46 std::vector<G4LorentzVector>& finalState) {
51 size_t N = masses.size();
54 G4double mtot = std::accumulate(masses.begin(), masses.end(), 0.0);
63 for (
size_t k=N-1;
k>0; --
k) {
74 PFragCM.
setVectM(RandVector,masses[k]);
75 PRestCM.
setVectM(-RandVector,RestMass);
79 PFragCM.
boost(BoostV);
80 PRestCM.
boost(BoostV);
83 finalState[
k] = PFragCM;
86 finalState[0] = PRestLab;
97 G4double Fmax = std::sqrt(g4pow->
powN(xN/(xN+1.),N)/(xN+1.));
100 const G4int maxNumberOfLoops = 10000;
101 G4int loopCounter = 0;
104 F = std::sqrt(g4pow->
powN(chi,N)*(1.-chi));
105 }
while ( ( Fmax*
G4UniformRand() > F ) && ++loopCounter < maxNumberOfLoops );
106 if ( loopCounter >= maxNumberOfLoops ) {
108 ed <<
" Failed sampling after maxNumberOfLoops attempts : forced exit" <<
G4endl;