Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4INCL::ParticleSampler Class Reference

#include <G4INCLParticleSampler.hh>

Public Member Functions

 ParticleSampler (const G4int A, const G4int Z)
 Constructor. More...
 
 ~ParticleSampler ()
 Destructor. More...
 
NuclearDensity const * getDensity () const
 Getter for theDensity. More...
 
NuclearPotential::INuclearPotential
const * 
getPotential () const
 Getter for thePotential. More...
 
G4double getRPCorrelationCoefficient (const ParticleType t) const
 Getter for rpCorrelationCoefficient. More...
 
void setDensity (NuclearDensity const *const d)
 Setter for theDensity. More...
 
void setPotential (NuclearPotential::INuclearPotential const *const p)
 Setter for thePotential. More...
 
void setRPCorrelationCoefficient (const ParticleType t, const G4double corrCoeff)
 Setter for rpCorrelationCoefficient. More...
 
ParticleList sampleParticles (ThreeVector const &position)
 
void sampleParticlesIntoList (ThreeVector const &position, ParticleList &theList)
 

Detailed Description

Definition at line 54 of file G4INCLParticleSampler.hh.

Constructor & Destructor Documentation

G4INCL::ParticleSampler::ParticleSampler ( const G4int  A,
const G4int  Z 
)

Constructor.

Parameters
Athe mass number
Zthe charge number

Definition at line 51 of file G4INCLParticleSampler.cc.

51  :
52  sampleOneProton(&ParticleSampler::sampleOneParticleWithoutRPCorrelation),
53  sampleOneNeutron(&ParticleSampler::sampleOneParticleWithoutRPCorrelation),
54  theA(A),
55  theZ(Z),
56  theDensity(NULL),
57  thePotential(NULL)
58  {
59  std::fill(theRCDFTable, theRCDFTable + UnknownParticle, static_cast<InterpolationTable *>(NULL));
60  std::fill(thePCDFTable, thePCDFTable + UnknownParticle, static_cast<InterpolationTable *>(NULL));
61  std::fill(rpCorrelationCoefficient, rpCorrelationCoefficient + UnknownParticle, 1.);
62  rpCorrelationCoefficient[Proton] = ParticleTable::getRPCorrelationCoefficient(Proton);
63  rpCorrelationCoefficient[Neutron] = ParticleTable::getRPCorrelationCoefficient(Neutron);
64  }
double A(double temperature)
G4double getRPCorrelationCoefficient(const ParticleType t)
Get the value of the r-p correlation coefficient.

Here is the call graph for this function:

G4INCL::ParticleSampler::~ParticleSampler ( )

Destructor.

Definition at line 66 of file G4INCLParticleSampler.cc.

66  {
67  }

Member Function Documentation

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

Getter for theDensity.

Definition at line 68 of file G4INCLParticleSampler.hh.

68 { return theDensity; }
NuclearPotential::INuclearPotential const* G4INCL::ParticleSampler::getPotential ( ) const
inline

Getter for thePotential.

Definition at line 71 of file G4INCLParticleSampler.hh.

71 { return thePotential; }
G4double G4INCL::ParticleSampler::getRPCorrelationCoefficient ( const ParticleType  t) const
inline

Getter for rpCorrelationCoefficient.

Definition at line 74 of file G4INCLParticleSampler.hh.

74  {
75 // assert(t==Proton || t==Neutron);
76  return rpCorrelationCoefficient[t];
77  }
ParticleList G4INCL::ParticleSampler::sampleParticles ( ThreeVector const &  position)

Definition at line 97 of file G4INCLParticleSampler.cc.

97  {
98  ParticleList aList;
100  return aList;
101  }
void sampleParticlesIntoList(ThreeVector const &position, ParticleList &theList)

Here is the call graph for this function:

void G4INCL::ParticleSampler::sampleParticlesIntoList ( ThreeVector const &  position,
ParticleList theList 
)

Definition at line 103 of file G4INCLParticleSampler.cc.

103  {
104 
105  if(sampleOneProton == &ParticleSampler::sampleOneParticleWithoutRPCorrelation) {
106  // sampling without correlation, we need to initialize the CDF tables
107  theRCDFTable[Proton] = NuclearDensityFactory::createRCDFTable(Proton, theA, theZ);
108  thePCDFTable[Proton] = NuclearDensityFactory::createPCDFTable(Proton, theA, theZ);
109  theRCDFTable[Neutron] = NuclearDensityFactory::createRCDFTable(Neutron, theA, theZ);
110  thePCDFTable[Neutron] = NuclearDensityFactory::createPCDFTable(Neutron, theA, theZ);
111  }
112 
113  theList.resize(theA);
114  if(theA > 2) {
115  ParticleType type = Proton;
116  ParticleSamplerMethod sampleOneParticle = sampleOneProton;
117  for(G4int i = 0; i < theA; ++i) {
118  if(i == theZ) { // Nucleons [Z..A-1] are neutrons
119  type = Neutron;
120  sampleOneParticle = sampleOneNeutron;
121  }
122  Particle *p = (this->*sampleOneParticle)(type);
123  p->setPosition(position + p->getPosition());
124  theList[i] = p;
125  }
126  } else {
127  // For deuterons, only sample the proton position and momentum. The
128  // neutron position and momenta are determined by the conditions of
129  // vanishing CM position and total momentum.
130 // assert(theZ==1);
131  Particle *aProton = (this->*(this->sampleOneProton))(Proton);
132  Particle *aNeutron = new Particle(Neutron, -aProton->getMomentum(), position - aProton->getPosition());
133  aProton->setPosition(position + aProton->getPosition());
134  theList[0] = aProton;
135  theList[1] = aNeutron;
136  }
137  }
InterpolationTable * createPCDFTable(const ParticleType t, const G4int A, const G4int Z)
const char * p
Definition: xmltok.h:285
InterpolationTable * createRCDFTable(const ParticleType t, const G4int A, const G4int Z)
int G4int
Definition: G4Types.hh:78

Here is the call graph for this function:

Here is the caller graph for this function:

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

Setter for theDensity.

Definition at line 69 of file G4INCLParticleSampler.cc.

69  {
70  theDensity = d;
71  updateSampleOneParticleMethods();
72  }

Here is the caller graph for this function:

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

Setter for thePotential.

Definition at line 74 of file G4INCLParticleSampler.cc.

74  {
75  thePotential = p;
76  updateSampleOneParticleMethods();
77  }
const char * p
Definition: xmltok.h:285

Here is the caller graph for this function:

void G4INCL::ParticleSampler::setRPCorrelationCoefficient ( const ParticleType  t,
const G4double  corrCoeff 
)
inline

Setter for rpCorrelationCoefficient.

Definition at line 86 of file G4INCLParticleSampler.hh.

86  {
87 // assert(t==Proton || t==Neutron);
88  rpCorrelationCoefficient[t] = corrCoeff;
89  }

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