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