G4INCL::ParticleSampler Class Reference

#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


Detailed Description

Definition at line 52 of file G4INCLParticleSampler.hh.


Constructor & Destructor Documentation

G4INCL::ParticleSampler::ParticleSampler ( const G4int  A,
const G4int  Z,
InverseInterpolationTable const *const   rCDFTable,
InverseInterpolationTable const *const   pCDFTable 
)

Constructor.

Parameters:
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 (  ) 

Destructor.

Definition at line 58 of file G4INCLParticleSampler.cc.

00058                                     {
00059   }


Member Function Documentation

NuclearDensity const* G4INCL::ParticleSampler::getDensity (  )  const [inline]

Getter for theDensity.

Definition at line 68 of file G4INCLParticleSampler.hh.

00068 { return theDensity; }

NuclearPotential::INuclearPotential const* G4INCL::ParticleSampler::getPotential (  )  const [inline]

Getter for thePotential.

Definition at line 71 of file G4INCLParticleSampler.hh.

00071 { return thePotential; }

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().

00061                                                                  {
00062     theDensity = d;
00063     updateSampleOneParticleMethod();
00064   }

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().

00066                                                                                       {
00067     thePotential = p;
00068     updateSampleOneParticleMethod();
00069   }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:54:07 2013 for Geant4 by  doxygen 1.4.7