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

#include <G4PenelopeOscillatorManager.hh>

Public Member Functions

void Clear ()
 
void Dump (const G4Material *)
 
G4PenelopeOscillatorTableGetOscillatorTableIonisation (const G4Material *)
 
G4PenelopeOscillatorGetOscillatorIonisation (const G4Material *, G4int)
 
G4PenelopeOscillatorTableGetOscillatorTableCompton (const G4Material *)
 
G4PenelopeOscillatorGetOscillatorCompton (const G4Material *, G4int)
 
void SetVerbosityLevel (G4int vl)
 
G4int GetVerbosityLevel ()
 
G4double GetTotalZ (const G4Material *)
 
G4double GetTotalA (const G4Material *)
 Returns the total A for the molecule.
 
G4double GetMeanExcitationEnergy (const G4Material *)
 Returns the mean excitation energy.
 
G4double GetPlasmaEnergySquared (const G4Material *)
 Returns the squared plasma energy.
 
G4double GetAtomsPerMolecule (const G4Material *)
 Returns the total number of atoms per molecule.
 
G4double GetNumberOfZAtomsPerMolecule (const G4Material *, G4int Z)
 

Static Public Member Functions

static G4PenelopeOscillatorManagerGetOscillatorManager ()
 

Protected Member Functions

 G4PenelopeOscillatorManager ()
 
 ~G4PenelopeOscillatorManager ()
 

Detailed Description

Definition at line 68 of file G4PenelopeOscillatorManager.hh.

Constructor & Destructor Documentation

◆ G4PenelopeOscillatorManager()

G4PenelopeOscillatorManager::G4PenelopeOscillatorManager ( )
protected

Definition at line 62 of file G4PenelopeOscillatorManager.cc.

62 :
63 oscillatorStoreIonisation(0),oscillatorStoreCompton(0),atomicNumber(0),
64 atomicMass(0),excitationEnergy(0),plasmaSquared(0),atomsPerMolecule(0),
65 atomTablePerMolecule(0)
66{
67 fReadElementData = false;
68 for (G4int i=0;i<5;i++)
69 {
70 for (G4int j=0;j<2000;j++)
71 elementData[i][j] = 0.;
72 }
73 verbosityLevel = 0;
74}
int G4int
Definition: G4Types.hh:85

Referenced by GetOscillatorManager().

◆ ~G4PenelopeOscillatorManager()

G4PenelopeOscillatorManager::~G4PenelopeOscillatorManager ( )
protected

Definition at line 78 of file G4PenelopeOscillatorManager.cc.

79{
80 Clear();
81 delete instance;
82}

Member Function Documentation

◆ Clear()

void G4PenelopeOscillatorManager::Clear ( )

Definition at line 99 of file G4PenelopeOscillatorManager.cc.

100{
101 if (verbosityLevel > 1)
102 G4cout << " G4PenelopeOscillatorManager::Clear() - Clean Oscillator Tables" << G4endl;
103
104 //Clean up OscillatorStoreIonisation
105 for (auto& item : (*oscillatorStoreIonisation))
106 {
107 G4PenelopeOscillatorTable* table = item.second;
108 if (table)
109 {
110 for (size_t k=0;k<table->size();k++) //clean individual oscillators
111 {
112 if ((*table)[k])
113 delete ((*table)[k]);
114 }
115 delete table;
116 }
117 }
118 delete oscillatorStoreIonisation;
119
120 //Clean up OscillatorStoreCompton
121 for (auto& item : (*oscillatorStoreCompton))
122 {
123 G4PenelopeOscillatorTable* table = item.second;
124 if (table)
125 {
126 for (size_t k=0;k<table->size();k++) //clean individual oscillators
127 {
128 if ((*table)[k])
129 delete ((*table)[k]);
130 }
131 delete table;
132 }
133 }
134 delete oscillatorStoreCompton;
135
136 if (atomicMass) delete atomicMass;
137 if (atomicNumber) delete atomicNumber;
138 if (excitationEnergy) delete excitationEnergy;
139 if (plasmaSquared) delete plasmaSquared;
140 if (atomsPerMolecule) delete atomsPerMolecule;
141 if (atomTablePerMolecule) delete atomTablePerMolecule;
142}
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

Referenced by ~G4PenelopeOscillatorManager().

◆ Dump()

void G4PenelopeOscillatorManager::Dump ( const G4Material material)

Definition at line 146 of file G4PenelopeOscillatorManager.cc.

147{
149 if (!theTable)
150 {
151 G4cout << " G4PenelopeOscillatorManager::Dump " << G4endl;
152 G4cout << "Problem in retrieving the Ionisation Oscillator Table for " << material->GetName() << G4endl;
153 return;
154 }
155 G4cout << "*********************************************************************" << G4endl;
156 G4cout << " Penelope Oscillator Table Ionisation for " << material->GetName() << G4endl;
157 G4cout << "*********************************************************************" << G4endl;
158 G4cout << "The table contains " << theTable->size() << " oscillators " << G4endl;
159 G4cout << "*********************************************************************" << G4endl;
160 if (theTable->size() < 10)
161 for (size_t k=0;k<theTable->size();k++)
162 {
163 G4cout << "Oscillator # " << k << " Z = " << (*theTable)[k]->GetParentZ() <<
164 " Shell Flag = " << (*theTable)[k]->GetShellFlag() <<
165 " Parent shell ID = " << (*theTable)[k]->GetParentShellID() << G4endl;
166 G4cout << "Ionisation energy = " << (*theTable)[k]->GetIonisationEnergy()/eV << " eV" << G4endl;
167 G4cout << "Occupation number = " << (*theTable)[k]->GetOscillatorStrength() << G4endl;
168 G4cout << "Resonance energy = " << (*theTable)[k]->GetResonanceEnergy()/eV << " eV" << G4endl;
169 G4cout << "Cufoff resonance energy = " <<
170 (*theTable)[k]->GetCutoffRecoilResonantEnergy()/eV << " eV" << G4endl;
171 G4cout << "*********************************************************************" << G4endl;
172 }
173 for (size_t k=0;k<theTable->size();k++)
174 {
175 G4cout << k << " " << (*theTable)[k]->GetOscillatorStrength() << " " <<
176 (*theTable)[k]->GetIonisationEnergy()/eV << " " << (*theTable)[k]->GetResonanceEnergy()/eV << " " <<
177 (*theTable)[k]->GetParentZ() << " " << (*theTable)[k]->GetShellFlag() << " " <<
178 (*theTable)[k]->GetParentShellID() << G4endl;
179 }
180 G4cout << "*********************************************************************" << G4endl;
181
182
183 //Compton table
184 theTable = GetOscillatorTableCompton(material);
185 if (!theTable)
186 {
187 G4cout << " G4PenelopeOscillatorManager::Dump " << G4endl;
188 G4cout << "Problem in retrieving the Compton Oscillator Table for " << material->GetName() << G4endl;
189 return;
190 }
191 G4cout << "*********************************************************************" << G4endl;
192 G4cout << " Penelope Oscillator Table Compton for " << material->GetName() << G4endl;
193 G4cout << "*********************************************************************" << G4endl;
194 G4cout << "The table contains " << theTable->size() << " oscillators " << G4endl;
195 G4cout << "*********************************************************************" << G4endl;
196 if (theTable->size() < 10)
197 for (size_t k=0;k<theTable->size();k++)
198 {
199 G4cout << "Oscillator # " << k << " Z = " << (*theTable)[k]->GetParentZ() <<
200 " Shell Flag = " << (*theTable)[k]->GetShellFlag() <<
201 " Parent shell ID = " << (*theTable)[k]->GetParentShellID() << G4endl;
202 G4cout << "Compton index = " << (*theTable)[k]->GetHartreeFactor() << G4endl;
203 G4cout << "Ionisation energy = " << (*theTable)[k]->GetIonisationEnergy()/eV << " eV" << G4endl;
204 G4cout << "Occupation number = " << (*theTable)[k]->GetOscillatorStrength() << G4endl;
205 G4cout << "*********************************************************************" << G4endl;
206 }
207 for (size_t k=0;k<theTable->size();k++)
208 {
209 G4cout << k << " " << (*theTable)[k]->GetOscillatorStrength() << " " <<
210 (*theTable)[k]->GetIonisationEnergy()/eV << " " << (*theTable)[k]->GetHartreeFactor() << " " <<
211 (*theTable)[k]->GetParentZ() << " " << (*theTable)[k]->GetShellFlag() << " " <<
212 (*theTable)[k]->GetParentShellID() << G4endl;
213 }
214 G4cout << "*********************************************************************" << G4endl;
215
216 return;
217}
const G4String & GetName() const
Definition: G4Material.hh:175
G4PenelopeOscillatorTable * GetOscillatorTableCompton(const G4Material *)
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)

◆ GetAtomsPerMolecule()

G4double G4PenelopeOscillatorManager::GetAtomsPerMolecule ( const G4Material mat)

Returns the total number of atoms per molecule.

Definition at line 1203 of file G4PenelopeOscillatorManager.cc.

1204{
1205 // (1) First time, create oscillatorStores and read data
1206 CheckForTablesCreated();
1207
1208 // (2) Check if the material has been already included
1209 if (atomsPerMolecule->count(mat))
1210 return atomsPerMolecule->find(mat)->second;
1211
1212 // (3) If we are here, it means that we have to create the table for the material
1213 BuildOscillatorTable(mat);
1214
1215 // (4) now, the oscillator store should be ok
1216 if (atomsPerMolecule->count(mat))
1217 return atomsPerMolecule->find(mat)->second;
1218 else
1219 {
1220 G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl;
1221 G4cout << "Impossible to retrieve the number of atoms per molecule for "
1222 << mat->GetName() << G4endl;
1223 return 0;
1224 }
1225}

Referenced by G4PenelopeBremsstrahlungModel::ComputeDEDXPerVolume(), G4PenelopeIonisationModel::ComputeDEDXPerVolume(), G4PenelopeComptonModel::CrossSectionPerVolume(), G4PenelopeBremsstrahlungModel::CrossSectionPerVolume(), and G4PenelopeIonisationModel::CrossSectionPerVolume().

◆ GetMeanExcitationEnergy()

G4double G4PenelopeOscillatorManager::GetMeanExcitationEnergy ( const G4Material mat)

Returns the mean excitation energy.

Definition at line 1154 of file G4PenelopeOscillatorManager.cc.

1155{
1156 // (1) First time, create oscillatorStores and read data
1157 CheckForTablesCreated();
1158
1159 // (2) Check if the material has been already included
1160 if (excitationEnergy->count(mat))
1161 return excitationEnergy->find(mat)->second;
1162
1163 // (3) If we are here, it means that we have to create the table for the material
1164 BuildOscillatorTable(mat);
1165
1166 // (4) now, the oscillator store should be ok
1167 if (excitationEnergy->count(mat))
1168 return excitationEnergy->find(mat)->second;
1169 else
1170 {
1171 G4cout << "G4PenelopeOscillatorManager::GetMolecularExcitationEnergy() " << G4endl;
1172 G4cout << "Impossible to retrieve the excitation energy for " << mat->GetName() << G4endl;
1173 return 0;
1174 }
1175}

◆ GetNumberOfZAtomsPerMolecule()

G4double G4PenelopeOscillatorManager::GetNumberOfZAtomsPerMolecule ( const G4Material mat,
G4int  Z 
)

Definition at line 1229 of file G4PenelopeOscillatorManager.cc.

1230{
1231 // (1) First time, create oscillatorStores and read data
1232 CheckForTablesCreated();
1233
1234 // (2) Check if the material/Z couple has been already included
1235 std::pair<const G4Material*,G4int> theKey = std::make_pair(mat,Z);
1236 if (atomTablePerMolecule->count(theKey))
1237 return atomTablePerMolecule->find(theKey)->second;
1238
1239 // (3) If we are here, it means that we have to create the table for the material
1240 BuildOscillatorTable(mat);
1241
1242 // (4) now, the oscillator store should be ok
1243 if (atomTablePerMolecule->count(theKey))
1244 return atomTablePerMolecule->find(theKey)->second;
1245 else
1246 {
1247 G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl;
1248 G4cout << "Impossible to retrieve the number of atoms per molecule for Z = "
1249 << Z << " in material " << mat->GetName() << G4endl;
1250 return 0;
1251 }
1252}

Referenced by G4PenelopeIonisationCrossSection::CrossSection().

◆ GetOscillatorCompton()

G4PenelopeOscillator * G4PenelopeOscillatorManager::GetOscillatorCompton ( const G4Material material,
G4int  index 
)

Definition at line 391 of file G4PenelopeOscillatorManager.cc.

393{
395 if (((size_t)index) < theTable->size())
396 return (*theTable)[index];
397 else
398 {
399 G4cout << "WARNING: Compton table for material " << material->GetName() << " has " <<
400 theTable->size() << " oscillators" << G4endl;
401 G4cout << "Oscillator #" << index << " cannot be retrieved" << G4endl;
402 G4cout << "Returning null pointer" << G4endl;
403 return nullptr;
404 }
405}

◆ GetOscillatorIonisation()

G4PenelopeOscillator * G4PenelopeOscillatorManager::GetOscillatorIonisation ( const G4Material material,
G4int  index 
)

Definition at line 344 of file G4PenelopeOscillatorManager.cc.

346{
348 if (((size_t)index) < theTable->size())
349 return (*theTable)[index];
350 else
351 {
352 G4cout << "WARNING: Ionisation table for material " << material->GetName() << " has " <<
353 theTable->size() << " oscillators" << G4endl;
354 G4cout << "Oscillator #" << index << " cannot be retrieved" << G4endl;
355 G4cout << "Returning null pointer" << G4endl;
356 return nullptr;
357 }
358}

Referenced by G4PenelopeIonisationCrossSection::CrossSection().

◆ GetOscillatorManager()

◆ GetOscillatorTableCompton()

G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableCompton ( const G4Material mat)

Definition at line 363 of file G4PenelopeOscillatorManager.cc.

364{
365 // (1) First time, create oscillatorStore and read data
366 CheckForTablesCreated();
367
368 // (2) Check if the material has been already included
369 if (oscillatorStoreCompton->count(mat))
370 {
371 //Ok, it exists
372 return oscillatorStoreCompton->find(mat)->second;
373 }
374
375 // (3) If we are here, it means that we have to create the table for the material
376 BuildOscillatorTable(mat);
377
378 // (4) now, the oscillator store should be ok
379 if (oscillatorStoreCompton->count(mat))
380 return oscillatorStoreCompton->find(mat)->second;
381 else
382 {
383 G4cout << "G4PenelopeOscillatorManager::GetOscillatorTableCompton() " << G4endl;
384 G4cout << "Impossible to create Compton oscillator table for " << mat->GetName() << G4endl;
385 return nullptr;
386 }
387}

Referenced by G4PenelopeComptonModel::CrossSectionPerVolume(), Dump(), GetOscillatorCompton(), and G4PenelopeComptonModel::SampleSecondaries().

◆ GetOscillatorTableIonisation()

G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableIonisation ( const G4Material mat)

Definition at line 316 of file G4PenelopeOscillatorManager.cc.

317{
318 // (1) First time, create oscillatorStores and read data
319 CheckForTablesCreated();
320
321 // (2) Check if the material has been already included
322 if (oscillatorStoreIonisation->count(mat))
323 {
324 //Ok, it exists
325 return oscillatorStoreIonisation->find(mat)->second;
326 }
327
328 // (3) If we are here, it means that we have to create the table for the material
329 BuildOscillatorTable(mat);
330
331 // (4) now, the oscillator store should be ok
332 if (oscillatorStoreIonisation->count(mat))
333 return oscillatorStoreIonisation->find(mat)->second;
334 else
335 {
336 G4cout << "G4PenelopeOscillatorManager::GetOscillatorTableIonisation() " << G4endl;
337 G4cout << "Impossible to create ionisation oscillator table for " << mat->GetName() << G4endl;
338 return nullptr;
339 }
340}

Referenced by G4PenelopeIonisationXSHandler::BuildXSTable(), Dump(), GetOscillatorIonisation(), and G4PenelopeIonisationModel::SampleSecondaries().

◆ GetPlasmaEnergySquared()

G4double G4PenelopeOscillatorManager::GetPlasmaEnergySquared ( const G4Material mat)

Returns the squared plasma energy.

Definition at line 1178 of file G4PenelopeOscillatorManager.cc.

1179{
1180 // (1) First time, create oscillatorStores and read data
1181 CheckForTablesCreated();
1182
1183 // (2) Check if the material has been already included
1184 if (plasmaSquared->count(mat))
1185 return plasmaSquared->find(mat)->second;
1186
1187 // (3) If we are here, it means that we have to create the table for the material
1188 BuildOscillatorTable(mat);
1189
1190 // (4) now, the oscillator store should be ok
1191 if (plasmaSquared->count(mat))
1192 return plasmaSquared->find(mat)->second;
1193 else
1194 {
1195 G4cout << "G4PenelopeOscillatorManager::GetPlasmaEnergySquared() " << G4endl;
1196 G4cout << "Impossible to retrieve the plasma energy for " << mat->GetName() << G4endl;
1197 return 0;
1198 }
1199}

◆ GetTotalA()

G4double G4PenelopeOscillatorManager::GetTotalA ( const G4Material mat)

Returns the total A for the molecule.

Definition at line 291 of file G4PenelopeOscillatorManager.cc.

292{
293 // (1) First time, create oscillatorStores and read data
294 CheckForTablesCreated();
295
296 // (2) Check if the material has been already included
297 if (atomicMass->count(mat))
298 return atomicMass->find(mat)->second;
299
300 // (3) If we are here, it means that we have to create the table for the material
301 BuildOscillatorTable(mat);
302
303 // (4) now, the oscillator store should be ok
304 if (atomicMass->count(mat))
305 return atomicMass->find(mat)->second;
306 else
307 {
308 G4cout << "G4PenelopeOscillatorManager::GetTotalA() " << G4endl;
309 G4cout << "Impossible to retrieve the total A for " << mat->GetName() << G4endl;
310 return 0;
311 }
312}

◆ GetTotalZ()

G4double G4PenelopeOscillatorManager::GetTotalZ ( const G4Material mat)

These are cumulative for the molecule Returns the total Z for the molecule

Definition at line 266 of file G4PenelopeOscillatorManager.cc.

267{
268 // (1) First time, create oscillatorStores and read data
269 CheckForTablesCreated();
270
271 // (2) Check if the material has been already included
272 if (atomicNumber->count(mat))
273 return atomicNumber->find(mat)->second;
274
275 // (3) If we are here, it means that we have to create the table for the material
276 BuildOscillatorTable(mat);
277
278 // (4) now, the oscillator store should be ok
279 if (atomicNumber->count(mat))
280 return atomicNumber->find(mat)->second;
281 else
282 {
283 G4cout << "G4PenelopeOscillatorManager::GetTotalZ() " << G4endl;
284 G4cout << "Impossible to retrieve the total Z for " << mat->GetName() << G4endl;
285 return 0;
286 }
287}

Referenced by G4PenelopeComptonModel::SampleSecondaries().

◆ GetVerbosityLevel()

G4int G4PenelopeOscillatorManager::GetVerbosityLevel ( )
inline

Definition at line 89 of file G4PenelopeOscillatorManager.hh.

89{return verbosityLevel;};

◆ SetVerbosityLevel()

void G4PenelopeOscillatorManager::SetVerbosityLevel ( G4int  vl)
inline

Definition at line 88 of file G4PenelopeOscillatorManager.hh.

88{verbosityLevel = vl;};

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