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

#include <G4AugerData.hh>

Public Member Functions

 G4AugerData ()
 
 ~G4AugerData ()
 
size_t NumberOfVacancies (G4int Z) const
 
G4int VacancyId (G4int Z, G4int vacancyIndex) const
 
size_t NumberOfTransitions (G4int Z, G4int vacancyIndex) const
 
G4int StartShellId (G4int Z, G4int initialVacancyIndex, G4int transitionShellIndex) const
 
G4double StartShellEnergy (G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const
 
G4double StartShellProb (G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const
 
size_t NumberOfAuger (G4int Z, G4int initIndex, G4int vacancyId) const
 
size_t AugerShellId (G4int Z, G4int vacancyIndex, G4int transId, G4int augerIndex) const
 
std::vector< G4AugerTransitionLoadData (G4int Z)
 
void BuildAugerTransitionTable ()
 
void PrintData (G4int Z)
 
G4AugerTransitionGetAugerTransition (G4int Z, G4int vacancyShellIndex)
 
std::vector< G4AugerTransition > * GetAugerTransitions (G4int Z)
 

Detailed Description

Definition at line 53 of file G4AugerData.hh.

Constructor & Destructor Documentation

◆ G4AugerData()

G4AugerData::G4AugerData ( )

Definition at line 49 of file G4AugerData.cc.

50{
51
52 G4int n = 0;
53 G4int pos = 0;
54
55 for (pos = 0 ; pos < 100; pos++)
56 {
57 numberOfVacancies.push_back(n);
58 }
59
61
62
63}
int G4int
Definition: G4Types.hh:85
void BuildAugerTransitionTable()
Definition: G4AugerData.cc:507

◆ ~G4AugerData()

G4AugerData::~G4AugerData ( )

Definition at line 65 of file G4AugerData.cc.

66{
67 /*
68 std::map<G4int,std::vector<G4AugerTransition>,std::less<G4int> >::iterator pos;
69
70 for (pos = augerTransitionTable.begin(); pos != augerTransitionTable.end(); pos++)
71 {
72 std::vector<G4AugerTransition> dataSet = (*pos).second;
73 delete dataSet;
74 }
75 for (pos = energyMap.begin(); pos != energyMap.end(); pos++)
76 {
77 std::map<G4Int,G4DataVector*,std::less<G4int>>* dataMap = (*pos).second;
78 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++)
79 {
80 G4DataVector* dataSet = (*pos2).second;
81 delete dataSet;
82 }
83 }
84 for (pos = probabilityMap.begin(); pos != probabilityMap.end(); pos++)
85 {
86 std::map<G4Int,G4DataVector*,std::less<G4int>>* dataMap = (*pos).second;
87 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++)
88 {
89 G4DataVector* dataSet = (*pos2).second;
90 delete dataSet;
91 }
92 }
93 for (pos2 = newIdMap.begin(); pos2 != idMap.end(); pos2++)
94 {
95 G4DataVector* dataSet = (*pos2).second;
96 delete dataSet;
97 }
98 for (pos2 = newIdEnergyMap.begin(); pos2 != idMap.end(); pos2++)
99 {
100 G4DataVector* dataSet = (*pos2).second;
101 delete dataSet;
102 }
103 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++)
104 {
105 G4DataVector* dataSet = (*pos2).second;
106 delete dataSet;
107 }
108 */
109
110}

Member Function Documentation

◆ AugerShellId()

size_t G4AugerData::AugerShellId ( G4int  Z,
G4int  vacancyIndex,
G4int  transId,
G4int  augerIndex 
) const

Definition at line 185 of file G4AugerData.cc.

186{
187 size_t n = 0;
188 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
189 {
190 G4Exception("G4AugerData::VacancyId()","de0002", FatalErrorInArgument,"");
191 return 0;
192 }
193 else {
194 trans_Table::const_iterator element = augerTransitionTable.find(Z);
195 if (element == augerTransitionTable.end()) {
196 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
197 return 0;
198 }
199 std::vector<G4AugerTransition> dataSet = (*element).second;
200 n = dataSet[vacancyIndex].AugerOriginatingShellId(augerIndex,transId);
201 }
202 return n;
203}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35

Referenced by PrintData().

◆ BuildAugerTransitionTable()

void G4AugerData::BuildAugerTransitionTable ( )

Definition at line 507 of file G4AugerData.cc.

508{
509
510 // trans_Table::iterator pos = augerTransitionTable.begin();
511
512 const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
513
515
516 G4DataVector activeZ;
517 activeZ.clear();
518
519 for (G4int mLocal=0; mLocal<nMaterials; mLocal++) {
520
521 const G4Material* material= (*materialTable)[mLocal];
522 const G4ElementVector* elementVector = material->GetElementVector();
523 const size_t nElements = material->GetNumberOfElements();
524
525 for (size_t iEl=0; iEl<nElements; iEl++) {
526 G4Element* element = (*elementVector)[iEl];
527 G4double Z = element->GetZ();
528 if (!(activeZ.contains(Z))) {
529 activeZ.push_back(Z);
530 }
531 }
532 }
533
534
535 for (G4int element = 6; element < 100; element++)
536 {
537 // if(nMaterials == 0 || activeZ.contains(element)) {
538 augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element)));
539 // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
540 // G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl;
541 //G4cout << "AugerTransitionTable complete"<< G4endl;
542 }
543}
std::vector< G4Element * > G4ElementVector
std::vector< G4Material * > G4MaterialTable
double G4double
Definition: G4Types.hh:83
std::vector< G4AugerTransition > LoadData(G4int Z)
Definition: G4AugerData.cc:275
G4bool contains(const G4double &) const
G4double GetZ() const
Definition: G4Element.hh:130
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:188
static size_t GetNumberOfMaterials()
Definition: G4Material.cc:644
size_t GetNumberOfElements() const
Definition: G4Material.hh:184
static G4MaterialTable * GetMaterialTable()
Definition: G4Material.cc:637

Referenced by G4AugerData().

◆ GetAugerTransition()

G4AugerTransition * G4AugerData::GetAugerTransition ( G4int  Z,
G4int  vacancyShellIndex 
)

Definition at line 576 of file G4AugerData.cc.

577 {
578 std::vector<G4AugerTransition>* dataSet = &augerTransitionTable[Z];
579 std::vector<G4AugerTransition>::iterator vectorIndex = dataSet->begin() + vacancyShellIndex;
580
581 G4AugerTransition* augerTransition = &(*vectorIndex);
582 return augerTransition;
583 }

Referenced by G4AtomicTransitionManager::ReachableAugerShell().

◆ GetAugerTransitions()

std::vector< G4AugerTransition > * G4AugerData::GetAugerTransitions ( G4int  Z)

Definition at line 585 of file G4AugerData.cc.

586 {
587 std::vector<G4AugerTransition>* dataSet = &augerTransitionTable[Z];
588 return dataSet;
589 }

◆ LoadData()

std::vector< G4AugerTransition > G4AugerData::LoadData ( G4int  Z)

Definition at line 275 of file G4AugerData.cc.

276{
277 // Build the complete string identifying the file with the data set
278
279 std::ostringstream ost;
280 if(Z != 0){
281 ost << "au-tr-pr-"<< Z << ".dat";
282 }
283 else{
284 ost << "au-tr-pr-"<<".dat";
285 }
286 G4String name(ost.str());
287
288 char* path = std::getenv("G4LEDATA");
289 if (!path)
290 {
291 G4String excep = "G4AugerData::LoadData";
292 G4Exception(excep,"em0006", FatalException,"" );
293 std::vector<G4AugerTransition> a;
294 return a;
295 }
296
297 G4String pathString(path);
298 G4String dirFile = pathString + "/auger/" + name;
299 std::ifstream file(dirFile);
300 std::filebuf* lsdp = file.rdbuf();
301
302 if (! (lsdp->is_open()) )
303 {
304 G4String excep = "G4AugerData::LoadData";
305 G4String msg = "Missing" + dirFile;
306 G4Exception(excep,"em0003", FatalException, msg);
307 }
308
309
310 G4double a = 0;
311 G4int k = 1;
312 G4int sLocal = 0;
313
314 G4int vacId = 0;
315 std::vector<G4int>* initIds = new std::vector<G4int>;
316 std::vector<G4int>* newIds = new std::vector<G4int>;
317 G4DataVector* transEnergies = new G4DataVector;
318 G4DataVector* transProbabilities = new G4DataVector;
319 std::vector<G4AugerTransition> augerTransitionVector;
320 std::map<G4int,std::vector<G4int>,std::less<G4int> >* newIdMap =
321 new std::map<G4int,std::vector<G4int>,std::less<G4int> >;
322 std::map<G4int,G4DataVector,std::less<G4int> >* newEnergyMap =
323 new std::map<G4int,G4DataVector,std::less<G4int> >;
324 std::map<G4int,G4DataVector,std::less<G4int> >* newProbabilityMap =
325 new std::map<G4int,G4DataVector,std::less<G4int> >;
326
327
328 do {
329 file >> a;
330
331
332 G4int nColumns = 4;
333
334 if (a == -1)
335 {
336
337
338
339 if (sLocal == 0)
340 {
341 // End of a shell data set
342
343
344
345 std::vector<G4int>::iterator vectorIndex = initIds->begin();
346
347 vacId = *vectorIndex;
348
349 //initIds->erase(vectorIndex);
350
351
352
353 std::vector<G4int> identifiers;
354 for (vectorIndex = initIds->begin()+1 ; vectorIndex != initIds->end(); ++vectorIndex){
355
356 identifiers.push_back(*vectorIndex);
357 }
358
359 vectorIndex = (initIds->end())-1;
360
361 G4int augerShellId = *(vectorIndex);
362
363
364 (*newIdMap)[augerShellId] = *newIds;
365 (*newEnergyMap)[augerShellId] = *transEnergies;
366 (*newProbabilityMap)[augerShellId] = *transProbabilities;
367
368 augerTransitionVector.push_back(G4AugerTransition(vacId, identifiers, newIdMap, newEnergyMap, newProbabilityMap));
369
370 // Now deleting all the variables I used, and creating new ones for the next shell
371
372 delete newIdMap;
373 delete newEnergyMap;
374 delete newProbabilityMap;
375
376 G4int n = initIds->size();
377 nInitShells.push_back(n);
378 numberOfVacancies[Z]++;
379 delete initIds;
380 delete newIds;
381 delete transEnergies;
382 delete transProbabilities;
383 initIds = new std::vector<G4int>;
384 newIds = new std::vector<G4int>;
385 transEnergies = new G4DataVector;
386 transProbabilities = new G4DataVector;
387 newIdMap = new std::map<G4int,std::vector<G4int>,std::less<G4int> >;
388 newEnergyMap = new std::map<G4int,G4DataVector,std::less<G4int> >;
389 newProbabilityMap = new std::map<G4int,G4DataVector,std::less<G4int> >;
390
391
392
393 }
394 sLocal++;
395 if (sLocal == nColumns)
396 {
397 sLocal = 0;
398 }
399 }
400 // moved to the end in order to avoid leaks
401 /*
402 else if (a == -2)
403 {
404 // End of file; delete the empty vectors created
405 //when encountering the last -1 -1 row
406 delete initIds;
407 delete newIds;
408 delete transEnergies;
409 delete transProbabilities;
410 delete newIdMap ;
411 delete newEnergyMap;
412 delete newProbabilityMap;
413 }*/
414 else
415 {
416
417 if (k%nColumns == 3){
418 // 3rd column is the transition probabilities
419 transProbabilities->push_back(a);
420
421 k++;}
422 else if(k%nColumns == 2){
423 // 2nd column is new auger vacancy
424
425 // 2nd column is new auger vacancy
426
427 G4int l = (G4int)a;
428 newIds->push_back(l);
429
430
431 k++;
432 }
433 else if (k%nColumns == 1)
434 {
435 // 1st column is shell id
436
437 if(initIds->size() == 0) {
438
439 // if this is the first data of the shell, all the colums are equal
440 // to the shell Id; so we skip the next colums ang go to the next row
441
442 initIds->push_back((G4int)a);
443 // first line of initIds is the original shell of the vacancy
444 file >> a;
445 file >> a;
446 file >> a;
447 k = k+3;
448 }
449 else {
450
451 // std::vector<G4int>::iterator vectorIndex = (initIds->end())-1;
452 if((G4int)a != initIds->back()){
453
454
455 if((initIds->size()) == 1) {
456 initIds->push_back((G4int)a);
457 }
458 else {
459
460
461 G4int augerShellId = 0;
462 augerShellId = initIds->back();
463
464 (*newIdMap)[augerShellId] = *newIds;
465 (*newEnergyMap)[augerShellId] = *transEnergies;
466 (*newProbabilityMap)[augerShellId] = *transProbabilities;
467 delete newIds;
468 delete transEnergies;
469 delete transProbabilities;
470 newIds = new std::vector<G4int>;
471 transEnergies = new G4DataVector;
472 transProbabilities = new G4DataVector;
473 initIds->push_back((G4int)a);
474 }
475 }
476 }
477
478 k++;
479
480 }
481 else if (k%nColumns == 0)
482
483 {//fourth column is transition energies
484 G4double e = a * MeV;
485
486 transEnergies->push_back(e);
487 k=1;
488
489 }
490 }
491 }
492
493
494 while (a != -2); // end of file
495 file.close();
496 delete initIds;
497 delete newIds;
498 delete transEnergies;
499 delete transProbabilities;
500 delete newIdMap ;
501 delete newEnergyMap;
502 delete newProbabilityMap;
503 return augerTransitionVector;
504
505}
@ FatalException
const char * name(G4int ptype)

Referenced by BuildAugerTransitionTable().

◆ NumberOfAuger()

size_t G4AugerData::NumberOfAuger ( G4int  Z,
G4int  initIndex,
G4int  vacancyId 
) const

Definition at line 164 of file G4AugerData.cc.

165{
166 size_t n = 0;
167 if (initIndex<0 || initIndex>=numberOfVacancies[Z])
168 {
169 G4Exception("G4AugerData::VacancyId()","de0002", FatalErrorInArgument,"");
170 return 0;
171 }
172 else {
173 trans_Table::const_iterator element = augerTransitionTable.find(Z);
174 if (element == augerTransitionTable.end()) {
175 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
176 return 0;
177 }
178 std::vector<G4AugerTransition> dataSet = (*element).second;
179 const std::vector<G4int>* temp = dataSet[initIndex].AugerOriginatingShellIds(vacancyId);
180 n = temp->size();
181 }
182 return n;
183}

Referenced by PrintData().

◆ NumberOfTransitions()

size_t G4AugerData::NumberOfTransitions ( G4int  Z,
G4int  vacancyIndex 
) const

Definition at line 141 of file G4AugerData.cc.

142{
143 G4int n = 0;
144 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
145 {
146 G4Exception("G4AugerData::VacancyId()","de0002", JustWarning, "Energy deposited locally");
147 return 0;
148 }
149 else {
150 trans_Table::const_iterator element = augerTransitionTable.find(Z);
151 if (element == augerTransitionTable.end())
152 {
153 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
154 return 0;
155 }
156 std::vector<G4AugerTransition> dataSet = (*element).second;
157 n = (G4int)dataSet[vacancyIndex].TransitionOriginatingShellIds()->size();
158 }
159 return n;
160}
@ JustWarning

Referenced by PrintData().

◆ NumberOfVacancies()

size_t G4AugerData::NumberOfVacancies ( G4int  Z) const

Definition at line 112 of file G4AugerData.cc.

113{
114 return numberOfVacancies[Z];
115}

Referenced by G4AtomicTransitionManager::NumberOfReachableAugerShells().

◆ PrintData()

void G4AugerData::PrintData ( G4int  Z)

Definition at line 545 of file G4AugerData.cc.

546{
547
548 for (G4int i = 0; i < numberOfVacancies[Z]; i++)
549 {
550 G4cout << "---- TransitionData for the vacancy nb "
551 <<i
552 <<" of the atomic number elemnt "
553 << Z
554 <<"----- "
555 <<G4endl;
556
557 for (size_t k = 0; k<=NumberOfTransitions(Z,i); k++)
558 {
559 G4int id = StartShellId(Z,i,k);
560
561 for (size_t a = 0; a <= NumberOfAuger(Z,i,id); a++) {
562
563 G4double e = StartShellEnergy(Z,i,id,a)/MeV;
564 G4double p = StartShellProb(Z,i,id,a);
565 G4int augerId = AugerShellId(Z, i, id, a);
566 G4cout << k <<") Shell id: " << id <<G4endl;
567 G4cout << " Auger Originatig Shell Id :"<< augerId <<G4endl;
568 G4cout << " - Transition energy = " << e << " MeV "<<G4endl;
569 G4cout << " - Transition probability = " << p <<G4endl;
570 }
571 }
572 G4cout << "-------------------------------------------------"
573 << G4endl;
574 }
575}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
size_t NumberOfTransitions(G4int Z, G4int vacancyIndex) const
Definition: G4AugerData.cc:141
size_t NumberOfAuger(G4int Z, G4int initIndex, G4int vacancyId) const
Definition: G4AugerData.cc:164
G4int StartShellId(G4int Z, G4int initialVacancyIndex, G4int transitionShellIndex) const
Definition: G4AugerData.cc:205
size_t AugerShellId(G4int Z, G4int vacancyIndex, G4int transId, G4int augerIndex) const
Definition: G4AugerData.cc:185
G4double StartShellProb(G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const
Definition: G4AugerData.cc:251
G4double StartShellEnergy(G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const
Definition: G4AugerData.cc:228

◆ StartShellEnergy()

G4double G4AugerData::StartShellEnergy ( G4int  Z,
G4int  vacancyIndex,
G4int  transitionId,
G4int  augerIndex 
) const

Definition at line 228 of file G4AugerData.cc.

229{
230 G4double energy = 0;
231
232 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
233 {
234 G4Exception("G4AugerData::VacancyId()","de0002", FatalErrorInArgument,"");
235 return 0;
236 }
237 else {
238 trans_Table::const_iterator element = augerTransitionTable.find(Z);
239 if (element == augerTransitionTable.end()) {
240 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
241 return 0;
242 }
243 std::vector<G4AugerTransition> dataSet = (*element).second;
244 energy = dataSet[vacancyIndex].AugerTransitionEnergy(augerIndex,transitionId);
245
246 }
247 return energy;
248}
G4double energy(const ThreeVector &p, const G4double m)

Referenced by PrintData().

◆ StartShellId()

G4int G4AugerData::StartShellId ( G4int  Z,
G4int  initialVacancyIndex,
G4int  transitionShellIndex 
) const

Definition at line 205 of file G4AugerData.cc.

206{
207 G4int n = 0;
208
209 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
210 {
211 G4Exception("G4AugerData::VacancyId()","de0002", FatalErrorInArgument,"");
212 return 0;
213 }
214 else {
215 trans_Table::const_iterator element = augerTransitionTable.find(Z);
216 if (element == augerTransitionTable.end()) {
217 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
218 return 0;
219 }
220 std::vector<G4AugerTransition> dataSet = (*element).second;
221 n = dataSet[vacancyIndex].TransitionOriginatingShellId(transitionShellIndex);
222 }
223
224
225 return n;
226}

Referenced by PrintData().

◆ StartShellProb()

G4double G4AugerData::StartShellProb ( G4int  Z,
G4int  vacancyIndex,
G4int  transitionId,
G4int  augerIndex 
) const

Definition at line 251 of file G4AugerData.cc.

252{
253 G4double prob = 0;
254
255 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
256 {
257 G4Exception("G4AugerData::VacancyId()","de0002", FatalErrorInArgument,"");
258 return 0;
259 }
260 else {
261 trans_Table::const_iterator element = augerTransitionTable.find(Z);
262 if (element == augerTransitionTable.end()) {
263 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
264 return 0;
265 }
266 std::vector<G4AugerTransition> dataSet = (*element).second;
267 prob = dataSet[vacancyIndex].AugerTransitionProbability(augerIndex, transitionId);
268
269
270
271 }
272 return prob;
273}

Referenced by PrintData().

◆ VacancyId()

G4int G4AugerData::VacancyId ( G4int  Z,
G4int  vacancyIndex 
) const

Definition at line 117 of file G4AugerData.cc.

118{
119
120 G4int n = 0;
121 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z])
122 {
123 G4Exception("G4AugerData::VacancyId()","de0002", FatalErrorInArgument,"");
124 }
125 else {
126 trans_Table::const_iterator element = augerTransitionTable.find(Z);
127 if (element == augerTransitionTable.end()) {
128 G4Exception("G4AugerData::VacancyId()","de0004", FatalErrorInArgument, "Check element");
129 return 0;
130 }
131 std::vector<G4AugerTransition> dataSet = (*element).second;
132 n = (G4int) dataSet[vacancyIndex].FinalShellId();
133 }
134
135 return n;
136}

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