34#define INCLXX_IN_GEANT4_MODE 1
184 maxGeneratedWeight(0.)
195 for(
size_t i=1; i<
wMaxNP; ++i) {
216 const G4int maxIter = 500;
224 }
while(++iter<maxIter && r*weightMax>weight);
226#ifndef INCLXX_IN_GEANT4_MODE
228 INCL_WARN(
"Number of tries exceeded in PhaseSpaceRauboldLynch::generate()\n"
271#ifndef INCLXX_IN_GEANT4_MODE
273 INCL_WARN(
"The requested number of particles (" <<
nParticles <<
") requires extrapolation the tables in PhaseSpaceRauboldLynch. YMMV." <<
'\n');
277 INCL_WARN(
"The requested available energy (" <<
availableEnergy <<
" MeV) requires extrapolation the tables in PhaseSpaceRauboldLynch. YMMV." <<
'\n');
284 const G4double correction = (*wMaxCorrection)(reducedSqrtS);
313 weight *= momentumCM;
338 const G4double recoilE = std::sqrt(momentum.
mag2() + iM*iM);
339 boostV = -momentum/recoilE;
340 for(
size_t j=0; j<=i; ++j)
341 particles[j]->boost(boostV);
Class for interpolating the of a 1-dimensional function.
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
G4double getMass() const
Get the cached particle mass.
G4double prelog[wMaxNP]
Precalculated coefficients: -ln(n)
G4double maxGeneratedWeight
std::vector< G4double > sumMasses
void initialize(ParticleList &particles)
Initialize internal structures (masses and sum of masses)
std::vector< G4double > invariantMasses
std::vector< G4double > masses
InterpolationTable * wMaxMassless
static const G4double wMaxInterpolationMargin
G4double getMaxGeneratedWeight() const
Return the largest generated weight.
static const G4double wMaxMasslessX[wMaxNE]
virtual ~PhaseSpaceRauboldLynch()
static const G4double wMaxMasslessY[wMaxNE]
void generateEvent(ParticleList &particles)
Generate an event.
void generate(const G4double sqrtS, ParticleList &particles)
Generate momenta according to a uniform, Lorentz-invariant phase-space model.
static const size_t wMaxNE
static const size_t wMaxNP
G4double computeMaximumWeightParam()
Compute the maximum possible weight using parametrizations.
G4double computeMaximumWeightNaive()
Compute the maximum possible weight using a naive algorithm.
InterpolationTable * wMaxCorrection
G4double computeWeight()
Compute the maximum possible weight.
static const G4double wMaxCorrectionY[wMaxNE]
static const G4double wMaxCorrectionX[wMaxNE]
std::vector< G4double > momentaCM
std::vector< G4double > rnd
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
T max(const T t1, const T t2)
brief Return the largest of the two arguments
ThreeVector normVector(G4double norm=1.)