Geant4  10.02.p03
G4INCL::NuclearPotential Namespace Reference

Classes

class  INuclearPotential
 
class  NuclearPotentialConstant
 
class  NuclearPotentialEnergyIsospin
 
class  NuclearPotentialEnergyIsospinSmooth
 
class  NuclearPotentialIsospin
 

Functions

INuclearPotential const * createPotential (const PotentialType type, const G4int theA, const G4int theZ, const G4bool pionPotential)
 Create an INuclearPotential object. More...
 
void clearCache ()
 Clear the INuclearPotential cache. More...
 

Function Documentation

◆ clearCache()

void G4INCL::NuclearPotential::clearCache ( )

Clear the INuclearPotential cache.

Definition at line 232 of file G4INCLNuclearDensityFactory.cc.

232  {
233 
234  if(nuclearDensityCache) {
235  for(std::map<G4int,NuclearDensity const *>::const_iterator i = nuclearDensityCache->begin(); i!=nuclearDensityCache->end(); ++i)
236  delete i->second;
237  nuclearDensityCache->clear();
238  delete nuclearDensityCache;
239  nuclearDensityCache = NULL;
240  }
241 
242  if(rpCorrelationTableCache) {
243  for(std::map<G4int,InterpolationTable*>::const_iterator i = rpCorrelationTableCache->begin(); i!=rpCorrelationTableCache->end(); ++i)
244  delete i->second;
245  rpCorrelationTableCache->clear();
246  delete rpCorrelationTableCache;
247  rpCorrelationTableCache = NULL;
248  }
249 
250  if(rCDFTableCache) {
251  for(std::map<G4int,InterpolationTable*>::const_iterator i = rCDFTableCache->begin(); i!=rCDFTableCache->end(); ++i)
252  delete i->second;
253  rCDFTableCache->clear();
254  delete rCDFTableCache;
255  rCDFTableCache = NULL;
256  }
257 
258  if(pCDFTableCache) {
259  for(std::map<G4int,InterpolationTable*>::const_iterator i = pCDFTableCache->begin(); i!=pCDFTableCache->end(); ++i)
260  delete i->second;
261  pCDFTableCache->clear();
262  delete pCDFTableCache;
263  pCDFTableCache = NULL;
264  }
265  }
Here is the caller graph for this function:

◆ createPotential()

INuclearPotential const* G4INCL::NuclearPotential::createPotential ( const PotentialType  type,
const G4int  theA,
const G4int  theZ,
const G4bool  pionPotential 
)

Create an INuclearPotential object.

This is the method that should be used to instantiate objects derived from INuclearPotential. It uses a caching mechanism to minimise thrashing and speed up the code.

Parameters
typethe type of the potential to be created
theAmass number of the nucleus
theZcharge number of the nucleus
pionPotentialwhether pions should also feel the potential
Returns
a pointer to the nuclear potential
Here is the caller graph for this function: