Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions
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. More...
 
G4double GetMeanExcitationEnergy (const G4Material *)
 Returns the mean excitation energy. More...
 
G4double GetPlasmaEnergySquared (const G4Material *)
 Returns the squared plasma energy. More...
 
G4double GetAtomsPerMolecule (const G4Material *)
 Returns the total number of atoms per molecule. More...
 
G4double GetNumberOfZAtomsPerMolecule (const G4Material *, G4int Z)
 

Static Public Member Functions

static
G4PenelopeOscillatorManager
GetOscillatorManager ()
 

Protected Member Functions

 G4PenelopeOscillatorManager ()
 
 ~G4PenelopeOscillatorManager ()
 

Detailed Description

Definition at line 68 of file G4PenelopeOscillatorManager.hh.

Constructor & Destructor Documentation

G4PenelopeOscillatorManager::G4PenelopeOscillatorManager ( )
protected

Definition at line 61 of file G4PenelopeOscillatorManager.cc.

Referenced by GetOscillatorManager().

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

Definition at line 77 of file G4PenelopeOscillatorManager.cc.

References Clear().

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

Member Function Documentation

void G4PenelopeOscillatorManager::Clear ( )

Definition at line 98 of file G4PenelopeOscillatorManager.cc.

References G4cout, and G4endl.

Referenced by ~G4PenelopeOscillatorManager().

99 {
100  if (verbosityLevel > 1)
101  G4cout << " G4PenelopeOscillatorManager::Clear() - Clean Oscillator Tables" << G4endl;
102 
103  //Clean up OscillatorStoreIonisation
104  std::map<const G4Material*,G4PenelopeOscillatorTable*>::iterator i;
105  for (i=oscillatorStoreIonisation->begin();i != oscillatorStoreIonisation->end();i++)
106  {
107  G4PenelopeOscillatorTable* table = i->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 (i=oscillatorStoreCompton->begin();i != oscillatorStoreCompton->end();i++)
122  {
123  G4PenelopeOscillatorTable* table = i->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 }
G4GLOB_DLL std::ostream G4cout
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
#define G4endl
Definition: G4ios.hh:61
void G4PenelopeOscillatorManager::Dump ( const G4Material material)

Definition at line 146 of file G4PenelopeOscillatorManager.cc.

References python.hepunit::eV, G4cout, G4endl, G4Material::GetName(), GetOscillatorTableCompton(), and GetOscillatorTableIonisation().

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 }
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
const G4String & GetName() const
Definition: G4Material.hh:176
G4PenelopeOscillatorTable * GetOscillatorTableCompton(const G4Material *)
G4GLOB_DLL std::ostream G4cout
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
#define G4endl
Definition: G4ios.hh:61
G4double G4PenelopeOscillatorManager::GetAtomsPerMolecule ( const G4Material mat)

Returns the total number of atoms per molecule.

Definition at line 1193 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

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

1194 {
1195  // (1) First time, create oscillatorStores and read data
1196  CheckForTablesCreated();
1197 
1198  // (2) Check if the material has been already included
1199  if (atomsPerMolecule->count(mat))
1200  return atomsPerMolecule->find(mat)->second;
1201 
1202  // (3) If we are here, it means that we have to create the table for the material
1203  BuildOscillatorTable(mat);
1204 
1205  // (4) now, the oscillator store should be ok
1206  if (atomsPerMolecule->count(mat))
1207  return atomsPerMolecule->find(mat)->second;
1208  else
1209  {
1210  G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl;
1211  G4cout << "Impossible to retrieve the number of atoms per molecule for "
1212  << mat->GetName() << G4endl;
1213  return 0;
1214  }
1215 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4PenelopeOscillatorManager::GetMeanExcitationEnergy ( const G4Material mat)

Returns the mean excitation energy.

Definition at line 1144 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

1145 {
1146  // (1) First time, create oscillatorStores and read data
1147  CheckForTablesCreated();
1148 
1149  // (2) Check if the material has been already included
1150  if (excitationEnergy->count(mat))
1151  return excitationEnergy->find(mat)->second;
1152 
1153  // (3) If we are here, it means that we have to create the table for the material
1154  BuildOscillatorTable(mat);
1155 
1156  // (4) now, the oscillator store should be ok
1157  if (excitationEnergy->count(mat))
1158  return excitationEnergy->find(mat)->second;
1159  else
1160  {
1161  G4cout << "G4PenelopeOscillatorManager::GetMolecularExcitationEnergy() " << G4endl;
1162  G4cout << "Impossible to retrieve the excitation energy for " << mat->GetName() << G4endl;
1163  return 0;
1164  }
1165 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4PenelopeOscillatorManager::GetNumberOfZAtomsPerMolecule ( const G4Material mat,
G4int  Z 
)

Definition at line 1219 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

Referenced by G4PenelopeIonisationCrossSection::CrossSection().

1220 {
1221  // (1) First time, create oscillatorStores and read data
1222  CheckForTablesCreated();
1223 
1224  // (2) Check if the material/Z couple has been already included
1225  std::pair<const G4Material*,G4int> theKey = std::make_pair(mat,Z);
1226  if (atomTablePerMolecule->count(theKey))
1227  return atomTablePerMolecule->find(theKey)->second;
1228 
1229  // (3) If we are here, it means that we have to create the table for the material
1230  BuildOscillatorTable(mat);
1231 
1232  // (4) now, the oscillator store should be ok
1233  if (atomTablePerMolecule->count(theKey))
1234  return atomTablePerMolecule->find(theKey)->second;
1235  else
1236  {
1237  G4cout << "G4PenelopeOscillatorManager::GetAtomsPerMolecule() " << G4endl;
1238  G4cout << "Impossible to retrieve the number of atoms per molecule for Z = "
1239  << Z << " in material " << mat->GetName() << G4endl;
1240  return 0;
1241  }
1242 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4PenelopeOscillator * G4PenelopeOscillatorManager::GetOscillatorCompton ( const G4Material material,
G4int  index 
)

Definition at line 391 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, G4Material::GetName(), and GetOscillatorTableCompton().

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 NULL;
404  }
405 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4PenelopeOscillatorTable * GetOscillatorTableCompton(const G4Material *)
G4GLOB_DLL std::ostream G4cout
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
#define G4endl
Definition: G4ios.hh:61
G4PenelopeOscillator * G4PenelopeOscillatorManager::GetOscillatorIonisation ( const G4Material material,
G4int  index 
)

Definition at line 344 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, G4Material::GetName(), and GetOscillatorTableIonisation().

Referenced by G4PenelopeIonisationCrossSection::CrossSection().

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 NULL;
357  }
358 }
G4PenelopeOscillatorTable * GetOscillatorTableIonisation(const G4Material *)
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
std::vector< G4PenelopeOscillator * > G4PenelopeOscillatorTable
#define G4endl
Definition: G4ios.hh:61
G4PenelopeOscillatorManager * G4PenelopeOscillatorManager::GetOscillatorManager ( )
static
G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableCompton ( const G4Material mat)

Definition at line 363 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

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

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 NULL;
386  }
387 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4PenelopeOscillatorTable * G4PenelopeOscillatorManager::GetOscillatorTableIonisation ( const G4Material mat)

Definition at line 316 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

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

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 NULL;
339  }
340 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4PenelopeOscillatorManager::GetPlasmaEnergySquared ( const G4Material mat)

Returns the squared plasma energy.

Definition at line 1168 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

1169 {
1170  // (1) First time, create oscillatorStores and read data
1171  CheckForTablesCreated();
1172 
1173  // (2) Check if the material has been already included
1174  if (plasmaSquared->count(mat))
1175  return plasmaSquared->find(mat)->second;
1176 
1177  // (3) If we are here, it means that we have to create the table for the material
1178  BuildOscillatorTable(mat);
1179 
1180  // (4) now, the oscillator store should be ok
1181  if (plasmaSquared->count(mat))
1182  return plasmaSquared->find(mat)->second;
1183  else
1184  {
1185  G4cout << "G4PenelopeOscillatorManager::GetPlasmaEnergySquared() " << G4endl;
1186  G4cout << "Impossible to retrieve the plasma energy for " << mat->GetName() << G4endl;
1187  return 0;
1188  }
1189 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4PenelopeOscillatorManager::GetTotalA ( const G4Material mat)

Returns the total A for the molecule.

Definition at line 291 of file G4PenelopeOscillatorManager.cc.

References G4cout, G4endl, and G4Material::GetName().

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 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
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.

References G4cout, G4endl, and G4Material::GetName().

Referenced by G4PenelopeComptonModel::SampleSecondaries().

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 }
const G4String & GetName() const
Definition: G4Material.hh:176
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int G4PenelopeOscillatorManager::GetVerbosityLevel ( )
inline

Definition at line 89 of file G4PenelopeOscillatorManager.hh.

89 {return verbosityLevel;};
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: