34 #define INCLXX_IN_GEANT4_MODE 1
57 namespace NuclearPotential {
59 const G4double INuclearPotential::vPionDefault = 30.6;
63 G4ThreadLocal std::map<long,INuclearPotential const *> *nuclearPotentialCache = NULL;
68 if(!nuclearPotentialCache)
69 nuclearPotentialCache =
new std::map<long,INuclearPotential const *>;
71 const long nuclideID = (pionPotential ? 1 : -1) * (1000*theZ + theA + 1000000*type);
72 const std::map<long,INuclearPotential const *>::const_iterator mapEntry = nuclearPotentialCache->find(nuclideID);
73 if(mapEntry == nuclearPotentialCache->end()) {
89 INCL_FATAL(
"Unrecognized potential type at Nucleus creation." <<
'\n');
92 (*nuclearPotentialCache)[nuclideID] = thePotential;
95 return mapEntry->second;
100 if(nuclearPotentialCache) {
101 for(std::map<long,INuclearPotential const *>::const_iterator i = nuclearPotentialCache->begin(), e=nuclearPotentialCache->end(); i!=e; ++i)
103 nuclearPotentialCache->clear();
104 delete nuclearPotentialCache;
105 nuclearPotentialCache = NULL;
Isospin- and energy-dependent nuclear potential.
Abstract interface to the nuclear potential.
Isospin- and energy-dependent nuclear potential.
void clearCache()
Clear the INuclearPotential cache.
Isospin-dependent nuclear potential.
Isospin- and energy-independent nuclear potential.
INuclearPotential const * createPotential(const PotentialType type, const G4int theA, const G4int theZ, const G4bool pionPotential)
Create an INuclearPotential object.