Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NuclearLevelStore Class Reference

#include <G4NuclearLevelStore.hh>

Public Member Functions

G4NuclearLevelManagerGetManager (G4int Z, G4int A)
 
G4LevelManagerGetLevelManager (G4int Z, G4int A)
 
 ~G4NuclearLevelStore ()
 
void AddUserEvaporationDataFile (G4int Z, G4int A, const G4String &filename)
 

Static Public Member Functions

static G4NuclearLevelStoreGetInstance ()
 

Detailed Description

Definition at line 48 of file G4NuclearLevelStore.hh.

Constructor & Destructor Documentation

◆ ~G4NuclearLevelStore()

G4NuclearLevelStore::~G4NuclearLevelStore ( )

Definition at line 66 of file G4NuclearLevelStore.cc.

67{
68 ManagersMap::iterator i;
69 for (i = theManagers.begin(); i != theManagers.end(); ++i)
70 { delete i->second; }
71 MapForHEP::iterator j;
72 for (j = managersForHEP.begin(); j != managersForHEP.end(); ++j)
73 { delete j->second; }
74 if(userFiles) {
75 std::map<G4int, G4String>::iterator k;
76 for (k = theUserDataFiles.begin(); k != theUserDataFiles.end(); ++k)
77 { delete k->second; }
78 }
79}

Member Function Documentation

◆ AddUserEvaporationDataFile()

void G4NuclearLevelStore::AddUserEvaporationDataFile ( G4int  Z,
G4int  A,
const G4String filename 
)

Definition at line 82 of file G4NuclearLevelStore.cc.

84{
85 if (Z<1 || A<2) {
86 G4cout<<"G4NuclearLevelStore::AddUserEvaporationDataFile "
87 <<" Z= " << Z << " and A= " << A << " not valid!"<<G4endl;
88 }
89
90 std::ifstream DecaySchemeFile(filename);
91 if (DecaySchemeFile){
92 G4int ID_ion=Z*1000+A;//A*1000+Z;
93 theUserDataFiles[ID_ion]=filename;
94 userFiles = true;
95 }
96 else {
97 G4cout<<"The file "<<filename<<" does not exist!"<<G4endl;
98 }
99}
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by G4RadioactiveDecaymessenger::SetNewValue().

◆ GetInstance()

◆ GetLevelManager()

G4LevelManager * G4NuclearLevelStore::GetLevelManager ( G4int  Z,
G4int  A 
)

Definition at line 149 of file G4NuclearLevelStore.cc.

150{
151 G4LevelManager * result = 0;
152 // Generate the key = filename
153 G4int key = Z*1000+A;
154
155 // Check if already exists that key
156 MapForHEP::iterator idx = managersForHEP.find(key);
157 // If doesn't exists then create it
158 if ( idx == managersForHEP.end() ) {
159 result = new G4LevelManager(Z,A,reader,
160 dirName + GenerateFileName(Z,A));
161 managersForHEP.insert(std::make_pair(key,result));
162
163 // it exists
164 } else {
165 result = idx->second;
166 }
167
168 return result;
169}

◆ GetManager()

G4NuclearLevelManager * G4NuclearLevelStore::GetManager ( G4int  Z,
G4int  A 
)

Definition at line 111 of file G4NuclearLevelStore.cc.

112{
113 G4NuclearLevelManager * result = 0;
114 if (A < 1 || Z < 1 || A < Z)
115 {
116 //G4cerr << "G4NuclearLevelStore::GetManager: Wrong values Z = " << Z
117 // << " A = " << A << '\n';
118 return result;
119 }
120
121 // Generate the key = filename
122 G4int key = Z*1000+A; //GenerateKey(Z,A);
123
124 // Check if already exists that key
125 ManagersMap::iterator idx = theManagers.find(key);
126 // If doesn't exists then create it
127 if ( idx == theManagers.end() )
128 {
129 G4String file = dirName + GenerateFileName(Z,A);
130
131 //Check if data have been provided by the user
132 if(userFiles) {
133 G4String file1 = theUserDataFiles[key];//1000*A+Z];
134 if (file1 != "") { file = file1; }
135 }
136 result = new G4NuclearLevelManager(Z,A,file);
137 theManagers.insert(std::make_pair(key,result));
138 }
139 // But if it exists...
140 else
141 {
142 result = idx->second;
143 }
144
145 return result;
146}

Referenced by G4RadioactiveDecay::AddDecayRateTable(), G4ContinuumGammaDeexcitation::CreateTransition(), G4DiscreteGammaDeexcitation::CreateTransition(), and G4PromptPhotonEvaporation::GetEmissionProbability().


The documentation for this class was generated from the following files: