34#define INCLXX_IN_GEANT4_MODE 1
48 namespace NuclearDensityFactory {
63 const G4int nuclideID = 1000*
Z +
A;
64 const std::map<G4int,NuclearDensity const *>::const_iterator mapEntry =
nuclearDensityCache->find(nuclideID);
69 if(!rpCorrelationTableProton || !rpCorrelationTableNeutron || !rpCorrelationTableLambda)
72 (*nuclearDensityCache)[nuclideID] = density;
75 return mapEntry->second;
89 INCL_DEBUG(
"Creating r-p correlation function for " << ((t==
Proton) ?
"protons" : ((t==
Neutron) ?
"neutrons" :
"lambdas")) <<
" in A=" <<
A <<
", Z=" <<
Z << std::endl);
97 INCL_DEBUG(
" ... Woods-Saxon; R0=" << radius <<
", a=" << diffuseness <<
", Rmax=" << maximumRadius << std::endl);
98 }
else if(A <= 19 && A > 6) {
103 INCL_DEBUG(
" ... MHO; param1=" << radius <<
", param2=" << diffuseness <<
", Rmax=" << maximumRadius << std::endl);
104 }
else if(A <= 6 && A > 1) {
108 INCL_DEBUG(
" ... Gaussian; sigma=" << radius <<
", Rmax=" << maximumRadius << std::endl);
110 INCL_ERROR(
"No r-p correlation function for " << ((t==
Proton) ?
"protons" :
"neutrons") <<
" in A = "
111 <<
A <<
" Z = " <<
Z <<
'\n');
116 delete rpCorrelationFunction;
117 INCL_DEBUG(
" ... here comes the table:\n" << theTable->
print() <<
'\n');
119 (*rpCorrelationTableCache)[nuclideID] = theTable;
122 return mapEntry->second;
133 const std::map<G4int,InterpolationTable*>::const_iterator mapEntry =
rCDFTableCache->find(nuclideID);
142 }
else if(A <= 19 && A > 6) {
147 }
else if(A <= 6 && A > 2) {
151 }
else if(
A == 2 &&
Z == 1) {
154 INCL_ERROR(
"No nuclear density function for target A = "
155 <<
A <<
" Z = " <<
Z <<
'\n');
160 delete rDensityFunction;
161 INCL_DEBUG(
"Creating inverse position CDF for A=" <<
A <<
", Z=" <<
Z <<
":" <<
162 '\n' << theTable->
print() <<
'\n');
164 (*rCDFTableCache)[nuclideID] = theTable;
167 return mapEntry->second;
178 const std::map<G4int,InterpolationTable*>::const_iterator mapEntry =
pCDFTableCache->find(nuclideID);
184 }
else if(A <= 19 && A > 2) {
187 }
else if(
A == 2 &&
Z == 1) {
190 INCL_ERROR(
"No nuclear density function for target A = "
191 <<
A <<
" Z = " <<
Z <<
'\n');
196 delete pDensityFunction;
197 INCL_DEBUG(
"Creating inverse momentum CDF for A=" <<
A <<
", Z=" <<
Z <<
":" <<
198 '\n' << theTable->
print() <<
'\n');
200 (*pCDFTableCache)[nuclideID] = theTable;
203 return mapEntry->second;
216 delete mapEntry->second;
225 const G4int nuclideID = 1000*
Z +
A;
226 const std::map<G4int,NuclearDensity const *>::const_iterator mapEntry =
nuclearDensityCache->find(nuclideID);
228 delete mapEntry->second;
230 (*nuclearDensityCache)[nuclideID] = density;
G4double S(G4double temp)
Simple interpolation table for the inverse of a IFunction1D functor.
Class for Gaussian density.
NDF* class for the deuteron density according to the HardSphere potential.
Class for modified harmonic oscillator density.
NDF* class for the deuteron density according to the Paris potential.
Class for Woods-Saxon density.
InterpolationTable * inverseCDFTable(ManipulatorFunc fWrap=0, const G4int nNodes=60) const
Return a pointer to the inverse of the CDF of this function.
Class for interpolating the of a 1-dimensional function.
std::string print() const
G4double pow13(G4double x)
const G4double oneOverSqrtThree
G4ThreadLocal std::map< G4int, InterpolationTable * > * rCDFTableCache
G4ThreadLocal std::map< G4int, InterpolationTable * > * pCDFTableCache
G4ThreadLocal std::map< G4int, NuclearDensity const * > * nuclearDensityCache
G4ThreadLocal std::map< G4int, InterpolationTable * > * rpCorrelationTableCache
InterpolationTable * createRPCorrelationTable(const ParticleType t, const G4int A, const G4int Z)
void addDensityToCache(const G4int A, const G4int Z, NuclearDensity *const density)
InterpolationTable * createPCDFTable(const ParticleType t, const G4int A, const G4int Z)
NuclearDensity const * createDensity(const G4int A, const G4int Z, const G4int S)
void addRPCorrelationToCache(const G4int A, const G4int Z, const ParticleType t, InterpolationTable *const table)
InterpolationTable * createRCDFTable(const ParticleType t, const G4int A, const G4int Z)
const G4double momentumRMS[clusterTableZSize][clusterTableASize]
G4ThreadLocal FermiMomentumFn getFermiMomentum
G4double getRadiusParameter(const ParticleType t, const G4int A, const G4int Z)
G4double getMaximumNuclearRadius(const ParticleType t, const G4int A, const G4int Z)
G4double getSurfaceDiffuseness(const ParticleType t, const G4int A, const G4int Z)
G4double getMomentumRMS(const G4int A, const G4int Z)
Return the RMS of the momentum distribution (light clusters)