35#define INCLXX_IN_GEANT4_MODE 1
51 sampleOneParticle(&
ParticleSampler::sampleOneParticleWithoutRPCorrelation),
54 theRCDFTable(rCDFTable),
55 thePCDFTable(pCDFTable),
65 updateSampleOneParticleMethod();
70 updateSampleOneParticleMethod();
73 void ParticleSampler::updateSampleOneParticleMethod() {
74 if(theDensity && thePotential)
75 sampleOneParticle = &ParticleSampler::sampleOneParticleWithRPCorrelation;
77 sampleOneParticle = &ParticleSampler::sampleOneParticleWithoutRPCorrelation;
84 for(
G4int i = 1; i <= theA; ++i) {
87 Particle *p = (this->*(this->sampleOneParticle))(type);
99 theList.push_back(aProton);
100 theList.push_back(aNeutron);
110 const G4double momentumRatio = momentumVector.
mag()/theFermiMomentum;
112 return new Particle(t, momentumVector, positionVector);
115 Particle *ParticleSampler::sampleOneParticleWithoutRPCorrelation(
const ParticleType t)
const {
120 return new Particle(t, momentumVector, positionVector);
Class for sampling particles in a nucleus.
Class for interpolating the inverse of a 1-dimensional function.
G4double getMaxRFromP(G4double p) const
Get the maximum allowed radius for a given momentum.
G4double getFermiMomentum(const Particle *const p) const
Return the Fermi momentum for a particle.
void setPotential(NuclearPotential::INuclearPotential const *const p)
Setter for thePotential.
~ParticleSampler()
Destructor.
void setDensity(NuclearDensity const *const d)
Setter for theDensity.
ParticleSampler(const G4int A, const G4int Z, InverseInterpolationTable const *const rCDFTable, InverseInterpolationTable const *const pCDFTable)
Constructor.
ParticleList sampleParticles(ThreeVector const &position) const
const G4INCL::ThreeVector & getPosition() const
const G4INCL::ThreeVector & getMomentum() const
virtual void setPosition(const G4INCL::ThreeVector &position)
static ThreeVector normVector(G4double norm=1.)
static ThreeVector sphereVector(G4double rmax=1.)
std::list< G4INCL::Particle * > ParticleList