#include <G4INCLParticleSampler.hh>
Public Member Functions | |
ParticleSampler (const G4int A, const G4int Z, InverseInterpolationTable const *const rCDFTable, InverseInterpolationTable const *const pCDFTable) | |
Constructor. | |
~ParticleSampler () | |
Destructor. | |
NuclearDensity const * | getDensity () const |
Getter for theDensity. | |
NuclearPotential::INuclearPotential const * | getPotential () const |
Getter for thePotential. | |
void | setDensity (NuclearDensity const *const d) |
Setter for theDensity. | |
void | setPotential (NuclearPotential::INuclearPotential const *const p) |
Setter for thePotential. | |
ParticleList | sampleParticles (ThreeVector const &position) const |
Definition at line 52 of file G4INCLParticleSampler.hh.
G4INCL::ParticleSampler::ParticleSampler | ( | const G4int | A, | |
const G4int | Z, | |||
InverseInterpolationTable const *const | rCDFTable, | |||
InverseInterpolationTable const *const | pCDFTable | |||
) |
Constructor.
A | the mass number | |
Z | the charge number | |
rCDFTable | the interpolation table for the inverse CDF in r-space | |
pCDFTable | the interpolation table for the inverse CDF in p-space |
Definition at line 48 of file G4INCLParticleSampler.cc.
00048 : 00049 sampleOneParticle(&ParticleSampler::sampleOneParticleWithoutRPCorrelation), 00050 theA(A), 00051 theZ(Z), 00052 theRCDFTable(rCDFTable), 00053 thePCDFTable(pCDFTable), 00054 theDensity(NULL), 00055 thePotential(NULL) 00056 {}
G4INCL::ParticleSampler::~ParticleSampler | ( | ) |
NuclearDensity const* G4INCL::ParticleSampler::getDensity | ( | ) | const [inline] |
NuclearPotential::INuclearPotential const* G4INCL::ParticleSampler::getPotential | ( | ) | const [inline] |
ParticleList G4INCL::ParticleSampler::sampleParticles | ( | ThreeVector const & | position | ) | const |
Definition at line 78 of file G4INCLParticleSampler.cc.
References G4INCL::Particle::getMomentum(), G4INCL::Particle::getPosition(), G4INCL::Neutron, position, G4INCL::Proton, and G4INCL::Particle::setPosition().
Referenced by G4INCL::Cluster::initializeParticles().
00078 { 00079 ParticleList theList; 00080 if(theA > 2) { 00081 ParticleType type = Proton; 00082 for(G4int i = 1; i <= theA; ++i) { 00083 if(i == (theZ + 1)) // Nucleons [Z+1..A] are neutrons 00084 type = Neutron; 00085 Particle *p = (this->*(this->sampleOneParticle))(type); 00086 p->setPosition(position + p->getPosition()); 00087 theList.push_back(p); 00088 } 00089 } else { 00090 // For deuterons, only sample the proton position and momentum. The 00091 // neutron position and momenta are determined by the conditions of 00092 // vanishing CM position and total momentum. 00093 // assert(theZ==1); 00094 Particle *aProton = (this->*(this->sampleOneParticle))(Proton); 00095 Particle *aNeutron = new Particle(Neutron, -aProton->getMomentum(), position - aProton->getPosition()); 00096 aProton->setPosition(position + aProton->getPosition()); 00097 theList.push_back(aProton); 00098 theList.push_back(aNeutron); 00099 } 00100 00101 return theList; 00102 }
void G4INCL::ParticleSampler::setDensity | ( | NuclearDensity const *const | d | ) |
Setter for theDensity.
Definition at line 61 of file G4INCLParticleSampler.cc.
Referenced by G4INCL::Nucleus::Nucleus().
void G4INCL::ParticleSampler::setPotential | ( | NuclearPotential::INuclearPotential const *const | p | ) |
Setter for thePotential.
Definition at line 66 of file G4INCLParticleSampler.cc.
Referenced by G4INCL::Nucleus::Nucleus().