Geant4 9.6.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 55 of file G4AugerData.hh.

Constructor & Destructor Documentation

◆ G4AugerData()

G4AugerData::G4AugerData ( )

Definition at line 50 of file G4AugerData.cc.

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

◆ ~G4AugerData()

G4AugerData::~G4AugerData ( )

Definition at line 66 of file G4AugerData.cc.

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

Member Function Documentation

◆ AugerShellId()

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

Definition at line 186 of file G4AugerData.cc.

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

Referenced by PrintData().

◆ BuildAugerTransitionTable()

void G4AugerData::BuildAugerTransitionTable ( )

Definition at line 508 of file G4AugerData.cc.

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

Referenced by G4AugerData().

◆ GetAugerTransition()

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

Definition at line 577 of file G4AugerData.cc.

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

Referenced by G4AtomicTransitionManager::ReachableAugerShell().

◆ GetAugerTransitions()

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

Definition at line 586 of file G4AugerData.cc.

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

◆ LoadData()

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

Definition at line 276 of file G4AugerData.cc.

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

Referenced by BuildAugerTransitionTable().

◆ NumberOfAuger()

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

Definition at line 165 of file G4AugerData.cc.

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

Referenced by PrintData().

◆ NumberOfTransitions()

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

Definition at line 142 of file G4AugerData.cc.

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

Referenced by PrintData().

◆ NumberOfVacancies()

size_t G4AugerData::NumberOfVacancies ( G4int  Z) const

Definition at line 113 of file G4AugerData.cc.

114{
115 return numberOfVacancies[Z];
116}

Referenced by G4AtomicTransitionManager::NumberOfReachableAugerShells().

◆ PrintData()

void G4AugerData::PrintData ( G4int  Z)

Definition at line 546 of file G4AugerData.cc.

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

◆ StartShellEnergy()

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

Definition at line 229 of file G4AugerData.cc.

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

Referenced by PrintData().

◆ StartShellId()

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

Definition at line 206 of file G4AugerData.cc.

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

Referenced by PrintData().

◆ StartShellProb()

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

Definition at line 252 of file G4AugerData.cc.

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

Referenced by PrintData().

◆ VacancyId()

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

Definition at line 118 of file G4AugerData.cc.

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

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