Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 constgetDensity () const
 Getter for theDensity.
 
NuclearPotential::INuclearPotential constgetPotential () 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 54 of file G4INCLParticleSampler.hh.

Constructor & Destructor Documentation

◆ ParticleSampler()

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

Constructor.

Parameters
Athe mass number
Zthe charge number
rCDFTablethe interpolation table for the inverse CDF in r-space
pCDFTablethe interpolation table for the inverse CDF in p-space

Definition at line 50 of file G4INCLParticleSampler.cc.

50 :
51 sampleOneParticle(&ParticleSampler::sampleOneParticleWithoutRPCorrelation),
52 theA(A),
53 theZ(Z),
54 theRCDFTable(rCDFTable),
55 thePCDFTable(pCDFTable),
56 theDensity(NULL),
57 thePotential(NULL)
58 {}

◆ ~ParticleSampler()

G4INCL::ParticleSampler::~ParticleSampler ( )

Destructor.

Definition at line 60 of file G4INCLParticleSampler.cc.

60 {
61 }

Member Function Documentation

◆ getDensity()

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

Getter for theDensity.

Definition at line 70 of file G4INCLParticleSampler.hh.

70{ return theDensity; }

◆ getPotential()

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

Getter for thePotential.

Definition at line 73 of file G4INCLParticleSampler.hh.

73{ return thePotential; }

◆ sampleParticles()

ParticleList G4INCL::ParticleSampler::sampleParticles ( ThreeVector const position) const

Definition at line 80 of file G4INCLParticleSampler.cc.

80 {
81 ParticleList theList;
82 if(theA > 2) {
83 ParticleType type = Proton;
84 for(G4int i = 1; i <= theA; ++i) {
85 if(i == (theZ + 1)) // Nucleons [Z+1..A] are neutrons
86 type = Neutron;
87 Particle *p = (this->*(this->sampleOneParticle))(type);
88 p->setPosition(position + p->getPosition());
89 theList.push_back(p);
90 }
91 } else {
92 // For deuterons, only sample the proton position and momentum. The
93 // neutron position and momenta are determined by the conditions of
94 // vanishing CM position and total momentum.
95// assert(theZ==1);
96 Particle *aProton = (this->*(this->sampleOneParticle))(Proton);
97 Particle *aNeutron = new Particle(Neutron, -aProton->getMomentum(), position - aProton->getPosition());
98 aProton->setPosition(position + aProton->getPosition());
99 theList.push_back(aProton);
100 theList.push_back(aNeutron);
101 }
102
103 return theList;
104 }
int G4int
Definition: G4Types.hh:66
std::list< G4INCL::Particle * > ParticleList

Referenced by G4INCL::Cluster::initializeParticles().

◆ setDensity()

void G4INCL::ParticleSampler::setDensity ( NuclearDensity const *const  d)

Setter for theDensity.

Definition at line 63 of file G4INCLParticleSampler.cc.

63 {
64 theDensity = d;
65 updateSampleOneParticleMethod();
66 }

Referenced by G4INCL::Nucleus::Nucleus().

◆ setPotential()

void G4INCL::ParticleSampler::setPotential ( NuclearPotential::INuclearPotential const *const  p)

Setter for thePotential.

Definition at line 68 of file G4INCLParticleSampler.cc.

68 {
69 thePotential = p;
70 updateSampleOneParticleMethod();
71 }

Referenced by G4INCL::Nucleus::Nucleus().


The documentation for this class was generated from the following files: