#include <G4PenelopeOscillatorManager.hh>
Definition at line 68 of file G4PenelopeOscillatorManager.hh.
G4PenelopeOscillatorManager::G4PenelopeOscillatorManager | ( | ) | [protected] |
Definition at line 61 of file G4PenelopeOscillatorManager.cc.
Referenced by GetOscillatorManager().
00061 : 00062 oscillatorStoreIonisation(0),oscillatorStoreCompton(0),atomicNumber(0), 00063 atomicMass(0),excitationEnergy(0),plasmaSquared(0),atomsPerMolecule(0), 00064 atomTablePerMolecule(0) 00065 { 00066 fReadElementData = false; 00067 for (G4int i=0;i<5;i++) 00068 { 00069 for (G4int j=0;j<2000;j++) 00070 elementData[i][j] = 0.; 00071 } 00072 verbosityLevel = 0; 00073 }
G4PenelopeOscillatorManager::~G4PenelopeOscillatorManager | ( | ) | [protected] |
Definition at line 77 of file G4PenelopeOscillatorManager.cc.
References Clear().
00078 { 00079 Clear(); 00080 delete instance; 00081 }
void G4PenelopeOscillatorManager::Clear | ( | ) |
Definition at line 98 of file G4PenelopeOscillatorManager.cc.
References G4cout, and G4endl.
Referenced by ~G4PenelopeOscillatorManager().
00099 { 00100 if (verbosityLevel > 1) 00101 G4cout << " G4PenelopeOscillatorManager::Clear() - Clean Oscillator Tables" << G4endl; 00102 00103 //Clean up OscillatorStoreIonisation 00104 std::map<const G4Material*,G4PenelopeOscillatorTable*>::iterator i; 00105 for (i=oscillatorStoreIonisation->begin();i != oscillatorStoreIonisation->end();i++) 00106 { 00107 G4PenelopeOscillatorTable* table = i->second; 00108 if (table) 00109 { 00110 for (size_t k=0;k<table->size();k++) //clean individual oscillators 00111 { 00112 if ((*table)[k]) 00113 delete ((*table)[k]); 00114 } 00115 delete table; 00116 } 00117 } 00118 delete oscillatorStoreIonisation; 00119 00120 //Clean up OscillatorStoreCompton 00121 for (i=oscillatorStoreCompton->begin();i != oscillatorStoreCompton->end();i++) 00122 { 00123 G4PenelopeOscillatorTable* table = i->second; 00124 if (table) 00125 { 00126 for (size_t k=0;k<table->size();k++) //clean individual oscillators 00127 { 00128 if ((*table)[k]) 00129 delete ((*table)[k]); 00130 } 00131 delete table; 00132 } 00133 } 00134 delete oscillatorStoreCompton; 00135 00136 if (atomicMass) delete atomicMass; 00137 if (atomicNumber) delete atomicNumber; 00138 if (excitationEnergy) delete excitationEnergy; 00139 if (plasmaSquared) delete plasmaSquared; 00140 if (atomsPerMolecule) delete atomsPerMolecule; 00141 if (atomTablePerMolecule) delete atomTablePerMolecule; 00142 }
void G4PenelopeOscillatorManager::Dump | ( | const G4Material * | ) |
Definition at line 146 of file G4PenelopeOscillatorManager.cc.
References G4cout, G4endl, G4Material::GetName(), GetOscillatorTableCompton(), and GetOscillatorTableIonisation().
00147 { 00148 G4PenelopeOscillatorTable* theTable = GetOscillatorTableIonisation(material); 00149 if (!theTable) 00150 { 00151 G4cout << " G4PenelopeOscillatorManager::Dump " << G4endl; 00152 G4cout << "Problem in retrieving the Ionisation Oscillator Table for " << material->GetName() << G4endl; 00153 return; 00154 } 00155 G4cout << "*********************************************************************" << G4endl; 00156 G4cout << " Penelope Oscillator Table Ionisation for " << material->GetName() << G4endl; 00157 G4cout << "*********************************************************************" << G4endl; 00158 G4cout << "The table contains " << theTable->size() << " oscillators " << G4endl; 00159 G4cout << "*********************************************************************" << G4endl; 00160 if (theTable->size() < 10) 00161 for (size_t k=0;k<theTable->size();k++) 00162 { 00163 G4cout << "Oscillator # " << k << " Z = " << (*theTable)[k]->GetParentZ() << 00164 " Shell Flag = " << (*theTable)[k]->GetShellFlag() << 00165 " Parent shell ID = " << (*theTable)[k]->GetParentShellID() << G4endl; 00166 G4cout << "Ionisation energy = " << (*theTable)[k]->GetIonisationEnergy()/eV << " eV" << G4endl; 00167 G4cout << "Occupation number = " << (*theTable)[k]->GetOscillatorStrength() << G4endl; 00168 G4cout << "Resonance energy = " << (*theTable)[k]->GetResonanceEnergy()/eV << " eV" << G4endl; 00169 G4cout << "Cufoff resonance energy = " << 00170 (*theTable)[k]->GetCutoffRecoilResonantEnergy()/eV << " eV" << G4endl; 00171 G4cout << "*********************************************************************" << G4endl; 00172 } 00173 for (size_t k=0;k<theTable->size();k++) 00174 { 00175 G4cout << k << " " << (*theTable)[k]->GetOscillatorStrength() << " " << 00176 (*theTable)[k]->GetIonisationEnergy()/eV << " " << (*theTable)[k]->GetResonanceEnergy()/eV << " " << 00177 (*theTable)[k]->GetParentZ() << " " << (*theTable)[k]->GetShellFlag() << " " << 00178 (*theTable)[k]->GetParentShellID() << G4endl; 00179 } 00180 G4cout << "*********************************************************************" << G4endl; 00181 00182 00183 //Compton table 00184 theTable = GetOscillatorTableCompton(material); 00185 if (!theTable) 00186 { 00187 G4cout << " G4PenelopeOscillatorManager::Dump " << G4endl; 00188 G4cout << "Problem in retrieving the Compton Oscillator Table for " << material->GetName() << G4endl; 00189 return; 00190 } 00191 G4cout << "*********************************************************************" << G4endl; 00192 G4cout << " Penelope Oscillator Table Compton for " << material->GetName() << G4endl; 00193 G4cout << "*********************************************************************" << G4endl; 00194 G4cout << "The table contains " << theTable->size() << " oscillators " << G4endl; 00195 G4cout << "*********************************************************************" << G4endl; 00196 if (theTable->size() < 10) 00197 for (size_t k=0;k<theTable->size();k++) 00198 { 00199 G4cout << "Oscillator # " << k << " Z = " << (*theTable)[k]->GetParentZ() << 00200 " Shell Flag = " << (*theTable)[k]->GetShellFlag() << 00201 " Parent shell ID = " << (*theTable)[k]->GetParentShellID() << G4endl; 00202 G4cout << "Compton index = " << (*theTable)[k]->GetHartreeFactor() << G4endl; 00203 G4cout << "Ionisation energy = " << (*theTable)[k]->GetIonisationEnergy()/eV << " eV" << G4endl; 00204 G4cout << "Occupation number = " << (*theTable)[k]->GetOscillatorStrength() << G4endl; 00205 G4cout << "*********************************************************************" << G4endl; 00206 } 00207 for (size_t k=0;k<theTable->size();k++) 00208 { 00209 G4cout << k << " " << (*theTable)[k]->GetOscillatorStrength() << " " << 00210 (*theTable)[k]->GetIonisationEnergy()/eV << " " << (*theTable)[k]->GetHartreeFactor() << " " << 00211 (*theTable)[k]->GetParentZ() << " " << (*theTable)[k]->GetShellFlag() << " " << 00212 (*theTable)[k]->GetParentShellID() << G4endl; 00213 } 00214 G4cout << "*********************************************************************" << G4endl; 00215 00216 return; 00217 }
G4double G4PenelopeOscillatorManager::GetAtomsPerMolecule | ( | const G4Material * | ) |
Returns the total number of atoms per molecule.
Definition at line 1190 of file G4PenelopeOscillatorManager.cc.
References G4cout.
Referenced by G4PenelopeIonisationModel::ComputeDEDXPerVolume(), G4PenelopeBremsstrahlungModel::ComputeDEDXPerVolume(), G4PenelopeIonisationModel::CrossSectionPerVolume(), G4PenelopeComptonModel::CrossSectionPerVolume(), and G4PenelopeBremsstrahlungModel::CrossSectionPerVolume().
01191 { 01192 // (1) First time, create oscillatorStores and read data 01193 CheckForTablesCreated(); 01194 01195 // (2) Check if the material has been already included 01196 if (atomsPerMolecule->count(mat)) 01197 return atomsPerMolecule->find(mat)->second; 01198 01199 // (3) If we are here, it means that we have to create the table for the material 01200 BuildOscillatorTable(mat); 01201 01202 // (4) now, the oscillator store should be ok 01203 if (atomsPerMolecule->count(mat)) 01204 return atomsPerMolecule->find(mat)->second; 01205 else 01206 { 01207 G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl; 01208 G4cout << "Impossible to retrieve the number of atoms per molecule for " 01209 << mat->GetName() << G4endl; 01210 return 0; 01211 } 01212 }
G4double G4PenelopeOscillatorManager::GetMeanExcitationEnergy | ( | const G4Material * | ) |
Returns the mean excitation energy.
Definition at line 1141 of file G4PenelopeOscillatorManager.cc.
References G4cout.
01142 { 01143 // (1) First time, create oscillatorStores and read data 01144 CheckForTablesCreated(); 01145 01146 // (2) Check if the material has been already included 01147 if (excitationEnergy->count(mat)) 01148 return excitationEnergy->find(mat)->second; 01149 01150 // (3) If we are here, it means that we have to create the table for the material 01151 BuildOscillatorTable(mat); 01152 01153 // (4) now, the oscillator store should be ok 01154 if (excitationEnergy->count(mat)) 01155 return excitationEnergy->find(mat)->second; 01156 else 01157 { 01158 G4cout << "G4PenelopeOscillatorManager::GetMolecularExcitationEnergy() " << G4endl; 01159 G4cout << "Impossible to retrieve the excitation energy for " << mat->GetName() << G4endl; 01160 return 0; 01161 } 01162 }
G4double G4PenelopeOscillatorManager::GetNumberOfZAtomsPerMolecule | ( | const G4Material * | , | |
G4int | Z | |||
) |
Definition at line 1216 of file G4PenelopeOscillatorManager.cc.
References G4cout, and G4Material::GetName().
Referenced by G4PenelopeIonisationCrossSection::CrossSection().
01217 { 01218 // (1) First time, create oscillatorStores and read data 01219 CheckForTablesCreated(); 01220 01221 // (2) Check if the material/Z couple has been already included 01222 std::pair<const G4Material*,G4int> theKey = std::make_pair(mat,Z); 01223 if (atomTablePerMolecule->count(theKey)) 01224 return atomTablePerMolecule->find(theKey)->second; 01225 01226 // (3) If we are here, it means that we have to create the table for the material 01227 BuildOscillatorTable(mat); 01228 01229 // (4) now, the oscillator store should be ok 01230 if (atomTablePerMolecule->count(theKey)) 01231 return atomTablePerMolecule->find(theKey)->second; 01232 else 01233 { 01234 G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl; 01235 G4cout << "Impossible to retrieve the number of atoms per molecule for Z = " 01236 << Z << " in material " << mat->GetName() << G4endl; 01237 return 0; 01238 } 01239 }
G4PenelopeOscillator * G4PenelopeOscillatorManager::GetOscillatorCompton | ( | const G4Material * | , | |
G4int | ||||
) |
Definition at line 391 of file G4PenelopeOscillatorManager.cc.
References G4cout, G4endl, G4Material::GetName(), and GetOscillatorTableCompton().
00393 { 00394 G4PenelopeOscillatorTable* theTable = GetOscillatorTableCompton(material); 00395 if (((size_t)index) < theTable->size()) 00396 return (*theTable)[index]; 00397 else 00398 { 00399 G4cout << "WARNING: Compton table for material " << material->GetName() << " has " << 00400 theTable->size() << " oscillators" << G4endl; 00401 G4cout << "Oscillator #" << index << " cannot be retrieved" << G4endl; 00402 G4cout << "Returning null pointer" << G4endl; 00403 return NULL; 00404 } 00405 }
G4PenelopeOscillator * G4PenelopeOscillatorManager::GetOscillatorIonisation | ( | const G4Material * | , | |
G4int | ||||
) |
Definition at line 344 of file G4PenelopeOscillatorManager.cc.
References G4cout, G4endl, G4Material::GetName(), and GetOscillatorTableIonisation().
Referenced by G4PenelopeIonisationCrossSection::CrossSection().
00346 { 00347 G4PenelopeOscillatorTable* theTable = GetOscillatorTableIonisation(material); 00348 if (((size_t)index) < theTable->size()) 00349 return (*theTable)[index]; 00350 else 00351 { 00352 G4cout << "WARNING: Ionisation table for material " << material->GetName() << " has " << 00353 theTable->size() << " oscillators" << G4endl; 00354 G4cout << "Oscillator #" << index << " cannot be retrieved" << G4endl; 00355 G4cout << "Returning null pointer" << G4endl; 00356 return NULL; 00357 } 00358 }
G4PenelopeOscillatorManager * G4PenelopeOscillatorManager::GetOscillatorManager | ( | ) | [static] |
Definition at line 89 of file G4PenelopeOscillatorManager.cc.
References G4PenelopeOscillatorManager().
Referenced by G4PenelopeBremsstrahlungModel::G4PenelopeBremsstrahlungModel(), G4PenelopeComptonModel::G4PenelopeComptonModel(), G4PenelopeIonisationCrossSection::G4PenelopeIonisationCrossSection(), G4PenelopeIonisationModel::G4PenelopeIonisationModel(), and G4PenelopeIonisationXSHandler::G4PenelopeIonisationXSHandler().
00090 { 00091 if (!instance) 00092 instance = new G4PenelopeOscillatorManager(); 00093 return instance; 00094 }
G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableCompton | ( | const G4Material * | ) |
Definition at line 363 of file G4PenelopeOscillatorManager.cc.
References G4cout, and G4endl.
Referenced by G4PenelopeComptonModel::CrossSectionPerVolume(), Dump(), GetOscillatorCompton(), and G4PenelopeComptonModel::SampleSecondaries().
00364 { 00365 // (1) First time, create oscillatorStore and read data 00366 CheckForTablesCreated(); 00367 00368 // (2) Check if the material has been already included 00369 if (oscillatorStoreCompton->count(mat)) 00370 { 00371 //Ok, it exists 00372 return oscillatorStoreCompton->find(mat)->second; 00373 } 00374 00375 // (3) If we are here, it means that we have to create the table for the material 00376 BuildOscillatorTable(mat); 00377 00378 // (4) now, the oscillator store should be ok 00379 if (oscillatorStoreCompton->count(mat)) 00380 return oscillatorStoreCompton->find(mat)->second; 00381 else 00382 { 00383 G4cout << "G4PenelopeOscillatorManager::GetOscillatorTableCompton() " << G4endl; 00384 G4cout << "Impossible to create Compton oscillator table for " << mat->GetName() << G4endl; 00385 return NULL; 00386 } 00387 }
G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableIonisation | ( | const G4Material * | ) |
Definition at line 316 of file G4PenelopeOscillatorManager.cc.
References G4cout, and G4endl.
Referenced by Dump(), GetOscillatorIonisation(), and G4PenelopeIonisationModel::SampleSecondaries().
00317 { 00318 // (1) First time, create oscillatorStores and read data 00319 CheckForTablesCreated(); 00320 00321 // (2) Check if the material has been already included 00322 if (oscillatorStoreIonisation->count(mat)) 00323 { 00324 //Ok, it exists 00325 return oscillatorStoreIonisation->find(mat)->second; 00326 } 00327 00328 // (3) If we are here, it means that we have to create the table for the material 00329 BuildOscillatorTable(mat); 00330 00331 // (4) now, the oscillator store should be ok 00332 if (oscillatorStoreIonisation->count(mat)) 00333 return oscillatorStoreIonisation->find(mat)->second; 00334 else 00335 { 00336 G4cout << "G4PenelopeOscillatorManager::GetOscillatorTableIonisation() " << G4endl; 00337 G4cout << "Impossible to create ionisation oscillator table for " << mat->GetName() << G4endl; 00338 return NULL; 00339 } 00340 }
G4double G4PenelopeOscillatorManager::GetPlasmaEnergySquared | ( | const G4Material * | ) |
Returns the squared plasma energy.
Definition at line 1165 of file G4PenelopeOscillatorManager.cc.
References G4cout.
01166 { 01167 // (1) First time, create oscillatorStores and read data 01168 CheckForTablesCreated(); 01169 01170 // (2) Check if the material has been already included 01171 if (plasmaSquared->count(mat)) 01172 return plasmaSquared->find(mat)->second; 01173 01174 // (3) If we are here, it means that we have to create the table for the material 01175 BuildOscillatorTable(mat); 01176 01177 // (4) now, the oscillator store should be ok 01178 if (plasmaSquared->count(mat)) 01179 return plasmaSquared->find(mat)->second; 01180 else 01181 { 01182 G4cout << "G4PenelopeOscillatorManager::GetPlasmaEnergySquared() " << G4endl; 01183 G4cout << "Impossible to retrieve the plasma energy for " << mat->GetName() << G4endl; 01184 return 0; 01185 } 01186 }
G4double G4PenelopeOscillatorManager::GetTotalA | ( | const G4Material * | ) |
Returns the total A for the molecule.
Definition at line 291 of file G4PenelopeOscillatorManager.cc.
References G4cout, and G4endl.
00292 { 00293 // (1) First time, create oscillatorStores and read data 00294 CheckForTablesCreated(); 00295 00296 // (2) Check if the material has been already included 00297 if (atomicMass->count(mat)) 00298 return atomicMass->find(mat)->second; 00299 00300 // (3) If we are here, it means that we have to create the table for the material 00301 BuildOscillatorTable(mat); 00302 00303 // (4) now, the oscillator store should be ok 00304 if (atomicMass->count(mat)) 00305 return atomicMass->find(mat)->second; 00306 else 00307 { 00308 G4cout << "G4PenelopeOscillatorManager::GetTotalA() " << G4endl; 00309 G4cout << "Impossible to retrieve the total A for " << mat->GetName() << G4endl; 00310 return 0; 00311 } 00312 }
G4double G4PenelopeOscillatorManager::GetTotalZ | ( | const G4Material * | ) |
These are cumulative for the molecule Returns the total Z for the molecule
Definition at line 266 of file G4PenelopeOscillatorManager.cc.
References G4cout, and G4endl.
Referenced by G4PenelopeComptonModel::SampleSecondaries().
00267 { 00268 // (1) First time, create oscillatorStores and read data 00269 CheckForTablesCreated(); 00270 00271 // (2) Check if the material has been already included 00272 if (atomicNumber->count(mat)) 00273 return atomicNumber->find(mat)->second; 00274 00275 // (3) If we are here, it means that we have to create the table for the material 00276 BuildOscillatorTable(mat); 00277 00278 // (4) now, the oscillator store should be ok 00279 if (atomicNumber->count(mat)) 00280 return atomicNumber->find(mat)->second; 00281 else 00282 { 00283 G4cout << "G4PenelopeOscillatorManager::GetTotalZ() " << G4endl; 00284 G4cout << "Impossible to retrieve the total Z for " << mat->GetName() << G4endl; 00285 return 0; 00286 } 00287 }
G4int G4PenelopeOscillatorManager::GetVerbosityLevel | ( | ) | [inline] |
void G4PenelopeOscillatorManager::SetVerbosityLevel | ( | G4int | vl | ) | [inline] |