33 #define INCLXX_IN_GEANT4_MODE 1
45 namespace PhaseSpaceDecay {
51 G4double Fmax = std::sqrt(std::pow(xN/(xN+1.),N)/(xN+1.));
56 F = std::sqrt(std::pow(chi,N)*(1.-chi));
64 size_t N = particles.size();
65 std::vector<G4double> masses(N);
66 std::vector<G4double> sumMasses(N);
67 std::transform(particles.begin(), particles.end(), masses.begin(), std::mem_fun(&
Particle::getMass));
68 std::partial_sum(masses.begin(), masses.end(), sumMasses.begin());
71 G4double T = initialMass-sumMasses.back();
79 Particle *restParticle = particles.front();
80 restParticle->
setMass(initialMass);
86 for (ParticleList::reverse_iterator
p=particles.rbegin(); k>0; ++
p, --k) {
88 T *= (k>1) ? betaKopylov(k) : 0.;
94 (*p)->setMomentum(PFragCM);
95 (*p)->adjustEnergyFromMomentum();
96 restParticle->
setMass(restMass);
101 (*p)->boost(theBoostVector);
102 restParticle->
boost(boostV);
106 restParticle->
setMass(masses[0]);
108 restParticle->
boost(theBoostVector);
void setMass(G4double mass)
G4double getMass() const
Get the cached particle mass.
void boost(const ThreeVector &aBoostVector)
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
ThreeVector boostVector() const
ThreeVector normVector(G4double norm=1.)
void decay(G4double initialMass, const ThreeVector &theBoostVector, ParticleList &particles)
Generate decay momenta according to a uniform phase-space model.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)