Geant4 11.2.2
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)
 
G4PenelopeOscillatorManageroperator= (const G4PenelopeOscillatorManager &right)=delete
 
 G4PenelopeOscillatorManager (const G4PenelopeOscillatorManager &)=delete
 
 ~G4PenelopeOscillatorManager ()
 

Static Public Member Functions

static G4PenelopeOscillatorManagerGetOscillatorManager ()
 

Protected Member Functions

 G4PenelopeOscillatorManager ()
 

Detailed Description

Definition at line 68 of file G4PenelopeOscillatorManager.hh.

Constructor & Destructor Documentation

◆ G4PenelopeOscillatorManager() [1/2]

G4PenelopeOscillatorManager::G4PenelopeOscillatorManager ( const G4PenelopeOscillatorManager & )
delete

◆ ~G4PenelopeOscillatorManager()

G4PenelopeOscillatorManager::~G4PenelopeOscillatorManager ( )

Definition at line 83 of file G4PenelopeOscillatorManager.cc.

84{
85 Clear();
86 delete instance;
87}

◆ G4PenelopeOscillatorManager() [2/2]

G4PenelopeOscillatorManager::G4PenelopeOscillatorManager ( )
explicitprotected

Definition at line 66 of file G4PenelopeOscillatorManager.cc.

66 :
67 fOscillatorStoreIonisation(nullptr),fOscillatorStoreCompton(nullptr),
68 fAtomicNumber(nullptr),fAtomicMass(nullptr),fExcitationEnergy(nullptr),
69 fPlasmaSquared(nullptr),fAtomsPerMolecule(nullptr),
70 fAtomTablePerMolecule(nullptr)
71{
72 fReadElementData = false;
73 for (G4int i=0;i<5;i++)
74 {
75 for (G4int j=0;j<2000;j++)
76 fElementData[i][j] = 0.;
77 }
78 fVerbosityLevel = 0;
79}
int G4int
Definition G4Types.hh:85

Referenced by GetOscillatorManager().

Member Function Documentation

◆ Clear()

void G4PenelopeOscillatorManager::Clear ( )

Definition at line 100 of file G4PenelopeOscillatorManager.cc.

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

Referenced by ~G4PenelopeOscillatorManager().

◆ Dump()

void G4PenelopeOscillatorManager::Dump ( const G4Material * material)

Definition at line 147 of file G4PenelopeOscillatorManager.cc.

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

1164{
1165 // (1) First time, create fOscillatorStores and read data
1166 CheckForTablesCreated();
1167
1168 // (2) Check if the material has been already included
1169 if (fAtomsPerMolecule->count(mat))
1170 return fAtomsPerMolecule->find(mat)->second;
1171
1172 // (3) If we are here, it means that we have to create the table for the material
1173 BuildOscillatorTable(mat);
1174
1175 // (4) now, the oscillator store should be ok
1176 if (fAtomsPerMolecule->count(mat))
1177 return fAtomsPerMolecule->find(mat)->second;
1178 else
1179 {
1180 G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl;
1181 G4cout << "Impossible to retrieve the number of atoms per molecule for "
1182 << mat->GetName() << G4endl;
1183 return 0;
1184 }
1185}

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

◆ GetMeanExcitationEnergy()

G4double G4PenelopeOscillatorManager::GetMeanExcitationEnergy ( const G4Material * mat)

Returns the mean excitation energy.

Definition at line 1114 of file G4PenelopeOscillatorManager.cc.

1115{
1116 // (1) First time, create fOscillatorStores and read data
1117 CheckForTablesCreated();
1118
1119 // (2) Check if the material has been already included
1120 if (fExcitationEnergy->count(mat))
1121 return fExcitationEnergy->find(mat)->second;
1122
1123 // (3) If we are here, it means that we have to create the table for the material
1124 BuildOscillatorTable(mat);
1125
1126 // (4) now, the oscillator store should be ok
1127 if (fExcitationEnergy->count(mat))
1128 return fExcitationEnergy->find(mat)->second;
1129 else
1130 {
1131 G4cout << "G4PenelopeOscillatorManager::GetMolecularExcitationEnergy() " << G4endl;
1132 G4cout << "Impossible to retrieve the excitation energy for " << mat->GetName() << G4endl;
1133 return 0;
1134 }
1135}

◆ GetNumberOfZAtomsPerMolecule()

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

Definition at line 1189 of file G4PenelopeOscillatorManager.cc.

1190{
1191 // (1) First time, create fOscillatorStores and read data
1192 CheckForTablesCreated();
1193
1194 // (2) Check if the material/Z couple has been already included
1195 std::pair<const G4Material*,G4int> theKey = std::make_pair(mat,Z);
1196 if (fAtomTablePerMolecule->count(theKey))
1197 return fAtomTablePerMolecule->find(theKey)->second;
1198
1199 // (3) If we are here, it means that we have to create the table for the material
1200 BuildOscillatorTable(mat);
1201
1202 // (4) now, the oscillator store should be ok
1203 if (fAtomTablePerMolecule->count(theKey))
1204 return fAtomTablePerMolecule->find(theKey)->second;
1205 else
1206 {
1207 G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl;
1208 G4cout << "Impossible to retrieve the number of atoms per molecule for Z = "
1209 << Z << " in material " << mat->GetName() << G4endl;
1210 return 0;
1211 }
1212}

Referenced by G4PenelopeIonisationCrossSection::CrossSection().

◆ GetOscillatorCompton()

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

Definition at line 394 of file G4PenelopeOscillatorManager.cc.

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

◆ GetOscillatorIonisation()

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

Definition at line 347 of file G4PenelopeOscillatorManager.cc.

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

Referenced by G4PenelopeIonisationCrossSection::CrossSection().

◆ GetOscillatorManager()

◆ GetOscillatorTableCompton()

G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableCompton ( const G4Material * mat)

Definition at line 366 of file G4PenelopeOscillatorManager.cc.

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

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

◆ GetOscillatorTableIonisation()

G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableIonisation ( const G4Material * mat)

Definition at line 319 of file G4PenelopeOscillatorManager.cc.

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

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

◆ GetPlasmaEnergySquared()

G4double G4PenelopeOscillatorManager::GetPlasmaEnergySquared ( const G4Material * mat)

Returns the squared plasma energy.

Definition at line 1138 of file G4PenelopeOscillatorManager.cc.

1139{
1140 // (1) First time, create fOscillatorStores and read data
1141 CheckForTablesCreated();
1142
1143 // (2) Check if the material has been already included
1144 if (fPlasmaSquared->count(mat))
1145 return fPlasmaSquared->find(mat)->second;
1146
1147 // (3) If we are here, it means that we have to create the table for the material
1148 BuildOscillatorTable(mat);
1149
1150 // (4) now, the oscillator store should be ok
1151 if (fPlasmaSquared->count(mat))
1152 return fPlasmaSquared->find(mat)->second;
1153 else
1154 {
1155 G4cout << "G4PenelopeOscillatorManager::GetPlasmaEnergySquared() " << G4endl;
1156 G4cout << "Impossible to retrieve the plasma energy for " << mat->GetName() << G4endl;
1157 return 0;
1158 }
1159}

◆ GetTotalA()

G4double G4PenelopeOscillatorManager::GetTotalA ( const G4Material * mat)

Returns the total A for the molecule.

Definition at line 294 of file G4PenelopeOscillatorManager.cc.

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

◆ GetTotalZ()

G4double G4PenelopeOscillatorManager::GetTotalZ ( const G4Material * mat)

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

Definition at line 269 of file G4PenelopeOscillatorManager.cc.

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

Referenced by G4PenelopeComptonModel::SampleSecondaries().

◆ GetVerbosityLevel()

G4int G4PenelopeOscillatorManager::GetVerbosityLevel ( )
inline

Definition at line 87 of file G4PenelopeOscillatorManager.hh.

87{return fVerbosityLevel;};

◆ operator=()

G4PenelopeOscillatorManager & G4PenelopeOscillatorManager::operator= ( const G4PenelopeOscillatorManager & right)
delete

◆ SetVerbosityLevel()

void G4PenelopeOscillatorManager::SetVerbosityLevel ( G4int vl)
inline

Definition at line 86 of file G4PenelopeOscillatorManager.hh.

86{fVerbosityLevel = vl;};

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