33 #define INCLXX_IN_GEANT4_MODE 1
56 namespace NuclearPotential {
58 const G4double INuclearPotential::vPionDefault = 30.6;
62 G4ThreadLocal std::map<long,INuclearPotential const *> *nuclearPotentialCache = NULL;
67 if(!nuclearPotentialCache)
68 nuclearPotentialCache =
new std::map<long,INuclearPotential const *>;
70 const long nuclideID = (pionPotential ? 1 : -1) * (1000*theZ + theA + 1000000*type);
71 const std::map<long,INuclearPotential const *>::const_iterator mapEntry = nuclearPotentialCache->find(nuclideID);
72 if(mapEntry == nuclearPotentialCache->end()) {
88 INCL_FATAL(
"Unrecognized potential type at Nucleus creation." << std::endl);
91 (*nuclearPotentialCache)[nuclideID] = thePotential;
94 return mapEntry->second;
99 if(nuclearPotentialCache) {
100 for(std::map<long,INuclearPotential const *>::const_iterator i = nuclearPotentialCache->begin(), e=nuclearPotentialCache->end(); i!=e; ++i)
102 nuclearPotentialCache->clear();
103 delete nuclearPotentialCache;
104 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.