45 const std::vector<G4double>& masses,
46 std::vector<G4LorentzVector>& finalState) {
54 G4double mtot = std::accumulate(masses.begin(), masses.end(), 0.0);
63 for (
G4int 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;
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;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
void setVectM(const Hep3Vector &spatial, double mass)
virtual void GenerateMultiBody(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
G4double BetaKopylov(G4int K) const
static G4Pow * GetInstance()
G4double powN(G4double x, G4int n) const
const G4String & GetName() const
G4int GetVerboseLevel() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
G4ThreeVector UniformVector(G4double mag=1.) const