00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #define INCLXX_IN_GEANT4_MODE 1
00034
00035 #include "globals.hh"
00036
00037 #ifndef G4INCLNuclearDensityFactory_hh
00038 #define G4INCLNuclearDensityFactory_hh 1
00039
00040 #include "G4INCLNuclearDensity.hh"
00041 #include "G4INCLParticleSampler.hh"
00042 #include "G4INCLParticleTable.hh"
00043 #include <map>
00044
00045 namespace G4INCL {
00046
00047 class NuclearDensityFactory {
00048 public:
00049 static NuclearDensity *createDensity(const G4int A, const G4int Z);
00050
00051 static InverseInterpolationTable *createRPCorrelationTable(const G4int A, const G4int Z);
00052
00053 static InverseInterpolationTable *createRCDFTable(const G4int A, const G4int Z);
00054
00055 static InverseInterpolationTable *createPCDFTable(const G4int A, const G4int Z);
00056
00057 static ParticleSampler *createParticleSampler(const G4int A, const G4int Z);
00058
00059 static void clearCache() {
00060 for(std::map<G4int,NuclearDensity*>::const_iterator i = nuclearDensityCache.begin(); i!=nuclearDensityCache.end(); ++i)
00061 delete i->second;
00062 nuclearDensityCache.clear();
00063
00064 for(std::map<G4int,InverseInterpolationTable*>::const_iterator i = rpCorrelationTableCache.begin(); i!=rpCorrelationTableCache.end(); ++i)
00065 delete i->second;
00066 rpCorrelationTableCache.clear();
00067
00068 for(std::map<G4int,InverseInterpolationTable*>::const_iterator i = rCDFTableCache.begin(); i!=rCDFTableCache.end(); ++i)
00069 delete i->second;
00070 rCDFTableCache.clear();
00071
00072 for(std::map<G4int,InverseInterpolationTable*>::const_iterator i = pCDFTableCache.begin(); i!=pCDFTableCache.end(); ++i)
00073 delete i->second;
00074 pCDFTableCache.clear();
00075 }
00076
00077 protected:
00078
00079 NuclearDensityFactory() {}
00080 ~NuclearDensityFactory() {}
00081
00082 static std::map<G4int,NuclearDensity*> nuclearDensityCache;
00083
00084 static std::map<G4int,InverseInterpolationTable*> rpCorrelationTableCache;
00085 static std::map<G4int,InverseInterpolationTable*> rCDFTableCache;
00086 static std::map<G4int,InverseInterpolationTable*> pCDFTableCache;
00087
00088 };
00089 }
00090
00091 #endif