54 nFinal(0), totalMass(0.), massExcess(0.), weightMax(0.), nTrials(0) {;}
61 const std::vector<G4double>& masses,
62 std::vector<G4LorentzVector>& finalState) {
87 std::partial_sum(masses.begin(), masses.end(),
msum.begin());
88 std::transform(masses.begin(), masses.end(), masses.begin(),
msq.begin(),
89 std::multiplies<G4double>());
111 std::sort(
rndm.begin(),
rndm.end());
120 const std::vector<G4double>& masses) {
126 meff.push_back(masses[0]);
127 for (
size_t i=1; i<
nFinal-1; i++) {
131 meff.push_back(initialMass);
149 for (
size_t i=1; i<
nFinal; i++) {
163 std::multiplies<G4double>()));
178 std::vector<G4LorentzVector>& finalState) {
181 finalState.resize(
nFinal);
183 for (
size_t i=0; i<
nFinal; i++) {
186 G4cout <<
" finalState[" << i <<
"] " << finalState[i] <<
G4endl;
194 const std::vector<G4double>& masses,
195 std::vector<G4LorentzVector>& finalState) {
209 G4cout <<
" initialized Py " << -
pd[i-1] <<
" phi " << phi
210 <<
" theta " << theta <<
G4endl;
217 gamma = esys /
meff[i];
220 G4cout <<
" esys " << esys <<
" beta " << beta <<
" gamma " << gamma
224 for (
size_t j=0; j<=i; j++) {
225 finalState[j].rotateZ(theta).rotateY(phi);
226 finalState[j].setY(gamma*(finalState[j].y() + beta*finalState[j].e()));
CLHEP::Hep3Vector G4ThreeVector
void FillEnergySteps(G4double initialMass, const std::vector< G4double > &masses)
void GenerateMomenta(const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
void ComputeWeightScale(const std::vector< G4double > &masses)
void AccumulateFinalState(size_t i, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
G4int GetVerboseLevel() const
G4double ComputeWeight() const
virtual void GenerateMultiBody(G4double initialMass, const std::vector< G4double > &masses, std::vector< G4LorentzVector > &finalState)
G4HadPhaseSpaceGenbod(G4int verbose=0)
G4GLOB_DLL std::ostream G4cout
void PrintVector(const std::vector< G4double > &v, const G4String &name, std::ostream &os) const
std::vector< G4double > msq
const G4String & GetName() const
void generate(const G4double sqrtS, ParticleList &particles)
Generate an event in the CM system.
void Initialize(G4double initialMass, const std::vector< G4double > &masses)
std::vector< G4double > pd
std::vector< G4double > rndm
G4bool AcceptEvent() const
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const
std::vector< G4double > msum
std::vector< G4double > meff