40 map<string, unsigned short int> getElementMap() {
41 map<string, unsigned short int> elementTable;
42 elementTable[
"H"] = 1;
43 elementTable[
"HE"] = 2;
44 elementTable[
"LI"] = 3;
45 elementTable[
"BE"] = 4;
46 elementTable[
"B"] = 5;
47 elementTable[
"C"] = 6;
48 elementTable[
"N"] = 7;
49 elementTable[
"O"] = 8;
50 elementTable[
"F"] = 9;
51 elementTable[
"NE"] = 10;
52 elementTable[
"NA"] = 11;
53 elementTable[
"MG"] = 12;
54 elementTable[
"AL"] = 13;
55 elementTable[
"SI"] = 14;
56 elementTable[
"P"] = 15;
57 elementTable[
"S"] = 16;
58 elementTable[
"CL"] = 17;
59 elementTable[
"AR"] = 18;
60 elementTable[
"K"] = 19;
61 elementTable[
"CA"] = 20;
62 elementTable[
"SC"] = 21;
63 elementTable[
"TI"] = 22;
64 elementTable[
"V"] = 23;
65 elementTable[
"CR"] = 24;
66 elementTable[
"MN"] = 25;
67 elementTable[
"FE"] = 26;
68 elementTable[
"CO"] = 27;
69 elementTable[
"NI"] = 28;
70 elementTable[
"CU"] = 29;
71 elementTable[
"ZN"] = 30;
72 elementTable[
"GA"] = 31;
73 elementTable[
"GE"] = 32;
74 elementTable[
"AS"] = 33;
75 elementTable[
"SE"] = 34;
76 elementTable[
"BR"] = 35;
77 elementTable[
"KR"] = 36;
78 elementTable[
"RB"] = 37;
79 elementTable[
"SR"] = 38;
80 elementTable[
"Y"] = 39;
81 elementTable[
"ZR"] = 40;
82 elementTable[
"NB"] = 41;
83 elementTable[
"MO"] = 42;
84 elementTable[
"TC"] = 43;
85 elementTable[
"RU"] = 44;
86 elementTable[
"RH"] = 45;
87 elementTable[
"PD"] = 46;
88 elementTable[
"AG"] = 47;
89 elementTable[
"CD"] = 48;
90 elementTable[
"IN"] = 49;
91 elementTable[
"SN"] = 50;
92 elementTable[
"SB"] = 51;
93 elementTable[
"TE"] = 52;
94 elementTable[
"I"] = 53;
95 elementTable[
"XE"] = 54;
96 elementTable[
"CS"] = 55;
97 elementTable[
"BA"] = 56;
98 elementTable[
"LA"] = 57;
99 elementTable[
"CE"] = 58;
100 elementTable[
"PR"] = 59;
101 elementTable[
"ND"] = 60;
102 elementTable[
"PM"] = 61;
103 elementTable[
"SM"] = 62;
104 elementTable[
"EU"] = 63;
105 elementTable[
"GD"] = 64;
106 elementTable[
"TB"] = 65;
107 elementTable[
"DY"] = 66;
108 elementTable[
"HO"] = 67;
109 elementTable[
"ER"] = 68;
110 elementTable[
"TM"] = 69;
111 elementTable[
"YB"] = 70;
112 elementTable[
"LU"] = 71;
113 elementTable[
"HF"] = 72;
114 elementTable[
"TA"] = 73;
115 elementTable[
"W"] = 74;
116 elementTable[
"RE"] = 75;
117 elementTable[
"OS"] = 76;
118 elementTable[
"IR"] = 77;
119 elementTable[
"PT"] = 78;
120 elementTable[
"AU"] = 79;
121 elementTable[
"HG"] = 80;
122 elementTable[
"TL"] = 81;
123 elementTable[
"PB"] = 82;
124 elementTable[
"BI"] = 83;
125 elementTable[
"PO"] = 84;
126 elementTable[
"AT"] = 85;
127 elementTable[
"RN"] = 86;
128 elementTable[
"FR"] = 87;
129 elementTable[
"RA"] = 88;
130 elementTable[
"AC"] = 89;
131 elementTable[
"TH"] = 90;
132 elementTable[
"PA"] = 91;
133 elementTable[
"U"] = 92;
134 elementTable[
"NP"] = 93;
135 elementTable[
"PU"] = 94;
136 elementTable[
"AM"] = 95;
137 elementTable[
"CM"] = 96;
138 elementTable[
"BK"] = 97;
139 elementTable[
"CF"] = 98;
140 elementTable[
"ES"] = 99;
141 elementTable[
"FM"] = 100;
142 elementTable[
"MD"] = 101;
143 elementTable[
"NO"] = 102;
144 elementTable[
"LR"] = 103;
145 elementTable[
"RF"] = 104;
146 elementTable[
"DB"] = 105;
147 elementTable[
"SG"] = 106;
148 elementTable[
"BH"] = 107;
149 elementTable[
"HS"] = 108;
150 elementTable[
"MT"] = 109;
151 elementTable[
"DS"] = 110;
152 elementTable[
"RG"] = 111;
153 elementTable[
"CN"] = 112;
154 elementTable[
"UUT"] = 113;
155 elementTable[
"UUQ"] = 114;
156 elementTable[
"UUP"] = 115;
157 elementTable[
"UUH"] = 116;
158 elementTable[
"UUS"] = 117;
159 elementTable[
"UUO"] = 118;
164 unsigned short int findZ(
string element) {
166 transform(element.begin(), element.end(), element.begin(), ::toupper);
168 map<string, unsigned short int> elementMap = getElementMap();
170 if (elementMap.find(element) != elementMap.end()) {
171 return elementMap[element];
178 unsigned short int setZ(
string id) {
181 for (
unsigned int i=0; i <
id.length(); ++i) {
182 if (!isdigit(
id[i])) {
183 element.push_back(
id[i]);
187 unsigned short int Z = findZ(element);
189 egsWarning(
"setZ: Warning: Element does not exist "
190 "in our data (%s)\n", element.c_str());
196 EGS_Ensdf::EGS_Ensdf(
const string nuclide,
const string ensdf_filename,
const string relaxType,
const bool allowMultiTrans,
int verbosity) {
199 relaxationType = relaxType;
200 allowMultiTransition = allowMultiTrans;
202 if (ensdf_file.is_open()) {
206 radionuclide = nuclide.substr(0, nuclide.find_last_of(
"."));
209 string element = radionuclide.substr(0, radionuclide.find(
"-"));
213 "%s\n",nuclide.c_str());
215 "\"%s\"\n",ensdf_filename.c_str());
217 ensdf_file.open(ensdf_filename.c_str(),ios::in);
218 if (!ensdf_file.is_open()) {
219 egsWarning(
"\nEGS_Ensdf::EGS_Ensdf: failed to open ensdf file %s"
220 " for reading\n\n",ensdf_filename.c_str());
225 vector<string> ensdf;
226 while (getline(ensdf_file, line)) {
227 ensdf.push_back(line);
230 if (ensdf_file.is_open()) {
239 if (ensdf_file.is_open()) {
243 for (vector<ParentRecord * >::iterator it = myParentRecords.begin();
244 it!=myParentRecords.end(); it++) {
248 myParentRecords.clear();
249 for (vector<NormalizationRecord * >::iterator it =
250 myNormalizationRecords.begin();
251 it!=myNormalizationRecords.end(); it++) {
255 myNormalizationRecords.clear();
256 for (vector<LevelRecord * >::iterator it =
257 myLevelRecords.begin();
258 it!=myLevelRecords.end(); it++) {
262 myLevelRecords.clear();
263 for (vector<BetaMinusRecord * >::iterator it =
264 myBetaMinusRecords.begin();
265 it!=myBetaMinusRecords.end(); it++) {
269 myBetaMinusRecords.clear();
270 for (vector<BetaPlusRecord * >::iterator it =
271 myBetaPlusRecords.begin();
272 it!=myBetaPlusRecords.end(); it++) {
276 myBetaPlusRecords.clear();
277 for (vector<GammaRecord * >::iterator it =
278 myGammaRecords.begin();
279 it!=myGammaRecords.end(); it++) {
283 myGammaRecords.clear();
284 for (vector<AlphaRecord * >::iterator it =
285 myAlphaRecords.begin();
286 it!=myAlphaRecords.end(); it++) {
290 myAlphaRecords.clear();
291 for (vector<GammaRecord * >::iterator it =
292 myMetastableGammaRecords.begin();
293 it!=myMetastableGammaRecords.end(); it++) {
297 myMetastableGammaRecords.clear();
298 for (vector<GammaRecord * >::iterator it =
299 myUncorrelatedGammaRecords.begin();
300 it!=myUncorrelatedGammaRecords.end(); it++) {
304 myUncorrelatedGammaRecords.clear();
307 string egsRemoveWhite(
string myString) {
310 for (
unsigned int i = 0; i<myString.size(); i++) {
311 if (!(myString[i]==
' ' || myString[i]==
'\n' || myString[i]==
'\t')) {
312 result += myString[i];
319 string egsTrimString(
string myString) {
321 int end = myString.size();
322 while (myString[++start]==
' ');
323 while (myString[--end]==
' ');
324 return myString.substr(start,end-start+1);
328 void EGS_Ensdf::parseEnsdf(vector<string> ensdf) {
345 for (
int i = 0; i < 14; i++) {
346 recordStack.push_back(vector<string>());
353 for (vector<string>::iterator it = ensdf.begin(); it!=ensdf.end(); it++) {
361 if (line.size() > 8 && line[6]==
' ' && line[7]==
' ' && line[8]==
' ') {
365 else if (line.size() > 8 && line[6]==
' ' && line[7]==
'H' && line[8]==
' ') {
369 else if (line.size() > 8 && line[6]==
' ' && line[7]==
'Q' && line[8]==
' ') {
373 else if (line.size() > 7 && line[6]==
' ' && line[7]==
'X') {
377 else if (line.size() > 4 && line[3]==
'N' && line[4]==
'N') {
380 else if (line.size() > 6 && (line[6]==
'C' || line[6]==
'D' || line[6]==
'T' ||
381 line[6]==
'c' || line[6]==
'd' || line[6]==
't')) {
383 if (line.size() > 7 && line[7]==
'G') {
385 recordStack[12].push_back(line);
389 recordStack[4].push_back(line);
393 else if (line.size() > 7 && line[6]==
' ' && line[7]==
'P') {
398 recordStack[5].push_back(line);
401 else if (line.size() > 7 && line[6]==
' ' && line[7]==
'N') {
406 recordStack[6].push_back(line);
409 if (line.size() > 8 && line[6]==
' ' && line[7]==
'L' && line[8]==
' ') {
414 recordStack[7].push_back(line);
417 else if (line.size() > 8 && line[6]==
' ' && line[7]==
'B' && line[8]==
' ') {
422 recordStack[8].push_back(line);
425 else if (line.size() > 8 && line[6]==
' ' && line[7]==
'E' && line[8]==
' ') {
430 recordStack[9].push_back(line);
433 else if (line.size() > 8 && line[6]==
' ' && line[7]==
'A' && line[8]==
' ') {
438 recordStack[10].push_back(line);
441 else if (line.size() > 8 && line[6]==
' ' && (line[7]==
'D' || line[7]==
' ') &&
442 (line[8]==
'N' || line[8]==
'P' || line[8]==
'A')) {
447 recordStack[11].push_back(line);
450 else if (line.size() > 8 && line[6]==
' ' && line[7]==
'G' && line[8]==
' ') {
455 recordStack[12].push_back(line);
460 if (!recordStack.empty()) {
465 if (relaxationType ==
"ensdf") {
467 egsInformation(
"EGS_Ensdf::parseEnsdf: Checking for x-rays and Auger...\n");
470 getEmissionsFromComments();
473 egsInformation(
"EGS_Ensdf::parseEnsdf: Done checking for x-rays and Auger.\n");
478 double minimumIntensity = 1e-10;
479 for (vector<BetaMinusRecord * >::iterator it = myBetaMinusRecords.begin();
480 it!=myBetaMinusRecords.end();) {
481 if ((*it)->getBetaIntensity() <= minimumIntensity) {
483 egsInformation(
"EGS_Ensdf::parseEnsdf: Removing beta- due to small intensity (%.1e < %.1e)\n",(*it)->getBetaIntensity(),minimumIntensity);
485 myBetaMinusRecords.erase(it);
491 for (vector<BetaPlusRecord * >::iterator it = myBetaPlusRecords.begin();
492 it!=myBetaPlusRecords.end();) {
493 if ((*it)->getBetaIntensity() <= minimumIntensity) {
495 egsInformation(
"EGS_Ensdf::parseEnsdf: Removing beta+ due to small intensity (%.1e < %.1e)\n",(*it)->getBetaIntensity(),minimumIntensity);
497 myBetaPlusRecords.erase(it);
503 for (vector<AlphaRecord *>::iterator it = myAlphaRecords.begin();
504 it != myAlphaRecords.end();) {
505 if ((*it)->getAlphaIntensity() <= minimumIntensity) {
507 egsInformation(
"EGS_Ensdf::parseEnsdf: Removing alpha due to small intensity (%.1e < %.1e)\n",(*it)->getAlphaIntensity(),minimumIntensity);
509 myAlphaRecords.erase(it);
518 bool printedWarning =
false;
519 for (vector<GammaRecord * >::iterator it = myGammaRecords.begin();
520 it!=myGammaRecords.end();) {
522 if ((*it)->getTransitionIntensity() <= minimumIntensity) {
524 egsInformation(
"EGS_Ensdf::parseEnsdf: Removing gamma due to small intensity (%.1e < %.1e)\n",(*it)->getTransitionIntensity(),minimumIntensity);
528 myGammaRecords.erase(it);
531 else if ((*it)->getLevelRecord()->getEnergy() <
epsilon) {
537 if (!printedWarning) {
538 egsWarning(
"EGS_Ensdf::parseEnsdf: Warning: Switching internal transition with unknown decay level to uncorrelated event (the emissions will still occur, but uncorrelated with disintegrations).\n");
539 printedWarning =
true;
542 myUncorrelatedGammaRecords.push_back(
new GammaRecord(*it));
544 egsInformation(
"EGS_Ensdf::parseEnsdf: Uncorrelated gamma (E,I): %f %f\n", myUncorrelatedGammaRecords.back()->getDecayEnergy(), myUncorrelatedGammaRecords.back()->getTransitionIntensity());
547 myGammaRecords.erase(it);
555 for (vector<BetaMinusRecord * >::iterator it = myBetaMinusRecords.begin();
556 it!=myBetaMinusRecords.end(); it++) {
558 myBetaRecords.push_back(*it);
561 for (vector<BetaPlusRecord * >::iterator it = myBetaPlusRecords.begin();
562 it!=myBetaPlusRecords.end(); it++) {
564 myBetaRecords.push_back(*it);
569 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
570 it!=myLevelRecords.end(); it++) {
572 if (it != myLevelRecords.begin()) {
573 auto itprev = std::prev(it);
575 if ((*it)->getEnergy() > 0 && (*it)->getEnergy() == (*itprev)->getEnergy()) {
580 if ((*itprev)->getHalfLife() > isomerCutoff && (*itprev)->getSpin() < (*it)->getSpin()) {
582 egsWarning(
"\nEGS_Ensdf::parseEnsdf: Warning: Levels with identical energy, long half-life and different spin have been detected. Assuming a low probability isomeric transition - the lower probability level will be removed. Removing level with energy = %f, spin = %d. Decays toward and transitions away from this level will also be removed. Double check the decay scheme and report any issues!\n\n", (*it)->getEnergy(), (*it)->getSpin());
585 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin(); gamma != myGammaRecords.end(); gamma++) {
586 if ((*gamma)->getLevelRecord() == (*it)) {
587 gamma = myGammaRecords.erase(gamma);
591 for (vector<BetaRecordLeaf *>::iterator beta = myBetaRecords.begin(); beta != myBetaRecords.end(); beta++) {
592 if ((*beta)->getLevelRecord() == (*it)) {
593 beta = myBetaRecords.erase(beta);
597 for (vector<BetaMinusRecord *>::iterator beta = myBetaMinusRecords.begin(); beta != myBetaMinusRecords.end(); beta++) {
598 if ((*beta)->getLevelRecord() == (*it)) {
599 beta = myBetaMinusRecords.erase(beta);
603 for (vector<BetaPlusRecord *>::iterator beta = myBetaPlusRecords.begin(); beta != myBetaPlusRecords.end(); beta++) {
604 if ((*beta)->getLevelRecord() == (*it)) {
605 beta = myBetaPlusRecords.erase(beta);
609 for (vector<AlphaRecord *>::iterator alpha = myAlphaRecords.begin(); alpha != myAlphaRecords.end(); alpha++) {
610 if ((*alpha)->getLevelRecord() == (*it)) {
611 alpha = myAlphaRecords.erase(alpha);
618 it = myLevelRecords.erase(it);
627 egsInformation(
"\nEGS_Ensdf::parseEnsdf: Summary of %s emissions:\n", radionuclide.c_str());
630 if (myBetaRecords.size()) {
632 for (vector<BetaRecordLeaf *>::iterator beta = myBetaRecords.begin();
633 beta != myBetaRecords.end(); beta++) {
634 egsInformation(
"%f %f\n", (*beta)->getFinalEnergy(), (*beta)->getBetaIntensity());
637 if (myAlphaRecords.size()) {
639 for (vector<AlphaRecord *>::iterator alpha = myAlphaRecords.begin();
640 alpha != myAlphaRecords.end(); alpha++) {
641 egsInformation(
"%f %f\n", (*alpha)->getFinalEnergy(), (*alpha)->getAlphaIntensity());
644 if (myGammaRecords.size()) {
646 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
647 gamma != myGammaRecords.end(); gamma++) {
650 if ((*gamma)->getICIntensity() > 0) {
651 icI = (*gamma)->getGammaIntensity()*(1+(*gamma)->getICIntensity()) - (*gamma)->getGammaIntensity();
653 if ((*gamma)->getIPIntensity() > 0) {
654 ipI = (*gamma)->getTransitionIntensity() - (*gamma)->getGammaIntensity() - icI;
656 egsInformation(
"%f %f %.4e %.4e\n", (*gamma)->getDecayEnergy(), (*gamma)->getGammaIntensity(), icI, ipI);
659 if (myUncorrelatedGammaRecords.size()) {
660 egsInformation(
"Uncorrelated gamma records (E,Igamma,Ice,Ipp):\n");
661 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammaRecords.begin();
662 gamma != myUncorrelatedGammaRecords.end(); gamma++) {
665 if ((*gamma)->getICIntensity() > 0) {
666 icI = (*gamma)->getGammaIntensity()*(1+(*gamma)->getICIntensity()) - (*gamma)->getGammaIntensity();
668 if ((*gamma)->getIPIntensity() > 0) {
669 ipI = (*gamma)->getTransitionIntensity() - (*gamma)->getGammaIntensity() - icI;
671 egsInformation(
"%f %f %.4e %.4e\n", (*gamma)->getDecayEnergy(), (*gamma)->getGammaIntensity(), icI, ipI);
674 if (xrayEnergies.size() > 0) {
676 for (
unsigned int i=0; i < xrayEnergies.size(); ++i) {
680 if (augerEnergies.size() > 0) {
682 for (
unsigned int i=0; i < augerEnergies.size(); ++i) {
691 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
692 gamma != myGammaRecords.end(); gamma++) {
694 double energy = (*gamma)->getDecayEnergy();
695 double guessedLevelEnergy =
696 ((*gamma)->getLevelRecord()->getEnergy() - energy);
700 "(LevelE,E,GuessedE): "
701 "%f %f %f\n",(*gamma)->getLevelRecord()->getEnergy(),
702 energy, guessedLevelEnergy);
705 double bestMatch = 1E10;
707 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
708 it!=myLevelRecords.end(); it++) {
710 double testMatch = fabs((*it)->getEnergy()-guessedLevelEnergy);
712 if (testMatch < bestMatch &&
713 (testMatch < guessedLevelEnergy*0.3 || testMatch < 20)) {
715 bestMatch = testMatch;
719 if (bestMatch == 1E10) {
720 egsWarning(
"EGS_Ensdf::parseEnsdf: Warning: Could "
721 "not find a level with energy matching decay "
722 "of gamma with energy E=%f; "
723 "assuming final level is ground state\n",energy);
724 (*gamma)->setFinalLevel(myLevelRecords.front());
727 (*gamma)->setFinalLevel(level);
731 egsInformation(
"EGS_Ensdf::parseEnsdf: Gamma (final level E, I, Igamma): "
732 "%f %f %f\n",level->getEnergy(), (*gamma)->getTransitionIntensity(), (*gamma)->getGammaIntensity());
735 (*gamma)->getFinalLevel()->cumulDisintegrationIntensity((*gamma)->getTransitionIntensity());
740 vector<double> totalLevelIntensity;
741 totalLevelIntensity.resize(myLevelRecords.size());
742 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
743 it!=myLevelRecords.end(); ++it) {
745 totalLevelIntensity[j] = 0;
746 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
747 gamma != myGammaRecords.end(); gamma++) {
749 if ((*gamma)->getLevelRecord() == (*it)) {
750 totalLevelIntensity[j] += (*gamma)->getTransitionIntensity();
762 egsInformation(
"EGS_Ensdf::parseEnsdf: Checking for metastable radionuclides...\n");
764 for (vector<ParentRecord * >::iterator parent = myParentRecords.begin();
765 parent!=myParentRecords.end(); parent++) {
767 bool gotDisint =
false;
768 for (vector<BetaRecordLeaf *>::iterator beta = myBetaRecords.begin();
769 beta != myBetaRecords.end(); beta++) {
771 if ((*beta)->getParentRecord() == *parent) {
777 for (vector<AlphaRecord *>::iterator alpha = myAlphaRecords.begin();
778 alpha != myAlphaRecords.end(); alpha++) {
780 if ((*alpha)->getParentRecord() == *parent) {
791 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
792 it!=myLevelRecords.end(); ++it) {
794 double disintIntensity = (*it)->getDisintegrationIntensity();
795 if (disintIntensity <
epsilon) {
796 bool gotDecayToLevel =
false;
797 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
798 gamma < myGammaRecords.end(); ++gamma) {
801 if ((*gamma)->getParentRecord() == *parent && (*gamma)->getLevelRecord() == (*it)) {
806 if (!gotDecayToLevel) {
807 gotDecayToLevel =
true;
810 myMetastableGammaRecords.push_back(
new GammaRecord(*gamma));
814 myMetastableGammaRecords.back()->setTransitionIntensity(totalLevelIntensity[j]);
819 if (verbose && myMetastableGammaRecords.size() > 0) {
829 if (verbose && myMetastableGammaRecords.size() < 1) {
836 void EGS_Ensdf::buildRecords() {
838 if (!myParentRecords.empty()) {
839 lastParent = myParentRecords.back();
842 if (!myNormalizationRecords.empty()) {
843 lastNormalization = myNormalizationRecords.back();
846 if (!myLevelRecords.empty()) {
847 if (!previousParent || previousParent == lastParent) {
848 lastLevel = myLevelRecords.back();
858 for (
int i = 0; i < recordStack.size(); i++) {
859 if (!recordStack[i].empty() && recordStack[i].front().length() > 5) {
873 myCommentRecords.push_back(
new CommentRecord(recordStack[i]));
876 myParentRecords.push_back(
new ParentRecord(recordStack[i]));
879 myNormalizationRecords.push_back(
new
883 myLevelRecords.push_back(
new LevelRecord(recordStack[i]));
884 previousParent = lastParent;
887 myBetaMinusRecords.push_back(
new
889 lastNormalization, lastLevel));
892 myBetaPlusRecords.push_back(
new
894 lastNormalization, lastLevel));
897 myAlphaRecords.push_back(
new
899 lastNormalization, lastLevel));
902 egsWarning(
"EGS_Ensdf::buildRecords: Warning: Delayed particle not "
903 "supported! Further development required.\n");
906 myGammaRecords.push_back(
new
908 lastNormalization, lastLevel));
911 recordStack[i].clear();
917 void EGS_Ensdf::normalizeIntensities() {
919 egsInformation(
"EGS_Ensdf::normalizeIntensities: Normalizing the "
920 "emission intensities to allow for spectrum sampling "
925 double totalDecayIntensity = 0;
926 double totalDecayIntensityUnc = 0;
927 double lastIntensity = 0;
929 for (vector<BetaMinusRecord * >::iterator it = myBetaMinusRecords.begin();
930 it!=myBetaMinusRecords.end(); it++) {
933 egsInformation(
"EGS_Ensdf::normalizeIntensities: Beta- (E,I): %f %f\n",
934 (*it)->getFinalEnergy(), (*it)->getBetaIntensity());
937 totalDecayIntensity += (*it)->getBetaIntensity();
938 totalDecayIntensityUnc += (*it)->getBetaIntensityUnc();
940 for (vector<BetaPlusRecord * >::iterator it = myBetaPlusRecords.begin();
941 it!=myBetaPlusRecords.end(); it++) {
944 egsInformation(
"EGS_Ensdf::normalizeIntensities: Beta+/EC (E,I): %f %f\n",
945 (*it)->getFinalEnergy(), (*it)->getBetaIntensity());
948 totalDecayIntensity += (*it)->getBetaIntensity();
949 totalDecayIntensityUnc += (*it)->getPositronIntensityUnc() + (*it)->getECIntensityUnc();
951 for (vector<AlphaRecord *>::iterator alpha = myAlphaRecords.begin();
952 alpha != myAlphaRecords.end(); alpha++) {
955 egsInformation(
"EGS_Ensdf::normalizeIntensities: Alpha (E,I): %f %f\n",
956 (*alpha)->getFinalEnergy(), (*alpha)->getAlphaIntensity());
959 totalDecayIntensity += (*alpha)->getAlphaIntensity();
960 totalDecayIntensityUnc += (*alpha)->getAlphaIntensityUnc();
962 for (vector<GammaRecord *>::iterator gamma = myMetastableGammaRecords.begin();
963 gamma != myMetastableGammaRecords.end(); gamma++) {
966 egsInformation(
"EGS_Ensdf::normalizeIntensities: MetastableGamma (I): %f\n",
967 (*gamma)->getTransitionIntensity());
970 totalDecayIntensity += (*gamma)->getTransitionIntensity();
971 totalDecayIntensityUnc += (*gamma)->getGammaIntensityUnc() + (*gamma)->getICIntensityUnc() + (*gamma)->getIPIntensityUnc();
975 double branchSum = 0;
976 for (vector<NormalizationRecord * >::iterator norm =
977 myNormalizationRecords.begin();
978 norm!=myNormalizationRecords.end(); norm++) {
979 branchSum += (*norm)->getBranchMultiplier();
984 egsWarning(
"\nEGS_Ensdf::normalizeIntensities: Warning: The branching ratios of this nuclide add to less than 1 (%f). The leftover probability will be assigned to fission events. These events will return a zero energy particle and be counted as disintegrations. This is expected for Cf-252 in the LNHB collection.\n\n",branchSum);
987 totalDecayIntensity /= branchSum;
989 else if (branchSum > 1+
epsilon) {
990 egsWarning(
"\nEGS_Ensdf::normalizeIntensities: Warning: The branching ratios of this nuclide add to greater than 1 (%f). This will result in overall emission rates being incorrect (e.g. number of emissions per 100 decays) when compared against the input.\n\n",branchSum);
1005 if (totalDecayIntensity > 100 +
epsilon || totalDecayIntensity < 100 -
epsilon) {
1011 decayDiscrepancy = 100 - totalDecayIntensity;
1013 egsInformation(
"EGS_Ensdf::normalizeIntensities: Warning: The sum of the decay probabilities for this nuclide does not equal 100\%! In order for modeling to proceed, this must be accounted for. The discrepancy of %f has been distributed over all decays, proportional to the corresponding uncertainties. Note that this will also change the internal transition intensities, since they depend on the decays.\n", decayDiscrepancy);
1018 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
1019 it!=myLevelRecords.end(); it++) {
1020 (*it)->resetDisintegrationIntensity();
1023 for (vector<BetaMinusRecord * >::iterator it = myBetaMinusRecords.begin();
1024 it!=myBetaMinusRecords.end(); it++) {
1026 (*it)->setBetaIntensity((*it)->getBetaIntensity() + (*it)->getBetaIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy);
1029 (*it)->getLevelRecord()->cumulDisintegrationIntensity((*it)->getBetaIntensity());
1032 for (vector<BetaPlusRecord * >::iterator it = myBetaPlusRecords.begin();
1033 it!=myBetaPlusRecords.end(); it++) {
1039 double newPositronIntensity = (*it)->getBetaIntensity() * (*it)->getPositronIntensity() + (*it)->getPositronIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy;
1040 double newECIntensity = (*it)->getBetaIntensity() * (1-(*it)->getPositronIntensity()) + (*it)->getECIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy;
1043 (*it)->setBetaIntensity(newPositronIntensity + newECIntensity);
1047 (*it)->setPositronIntensity(newPositronIntensity / (*it)->getBetaIntensity());
1050 (*it)->getLevelRecord()->cumulDisintegrationIntensity((*it)->getBetaIntensity());
1053 for (vector<AlphaRecord * >::iterator it = myAlphaRecords.begin();
1054 it!=myAlphaRecords.end(); it++) {
1056 (*it)->setAlphaIntensity((*it)->getAlphaIntensity() + (*it)->getAlphaIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy);
1059 (*it)->getLevelRecord()->cumulDisintegrationIntensity((*it)->getAlphaIntensity());
1062 for (vector<GammaRecord *>::iterator it = myMetastableGammaRecords.begin();
1063 it != myMetastableGammaRecords.end(); it++) {
1067 if ((*it)->getICIntensity() > 0) {
1068 icI = (*it)->getGammaIntensity()*(1+(*it)->getICIntensity()) - (*it)->getGammaIntensity();
1070 if ((*it)->getIPIntensity() > 0) {
1071 ipI = (*it)->getTransitionIntensity() - (*it)->getGammaIntensity() - ((*it)->getGammaIntensity()*(1+(*it)->getICIntensity()) - (*it)->getGammaIntensity());
1076 double newGammaIntensity = (*it)->getGammaIntensity() + (*it)->getGammaIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy;
1077 double newICIntensity = icI + (*it)->getICIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy;
1078 double newIPIntensity = ipI + (*it)->getIPIntensityUnc() / totalDecayIntensityUnc * decayDiscrepancy;
1081 (*it)->setTransitionIntensity(newGammaIntensity + newICIntensity + newIPIntensity);
1082 (*it)->setGammaIntensity(newGammaIntensity);
1083 (*it)->setICIntensity((newICIntensity+(*it)->getGammaIntensity()) / (*it)->getGammaIntensity() - 1);
1086 (*it)->getLevelRecord()->cumulDisintegrationIntensity((*it)->getTransitionIntensity());
1090 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
1091 gamma != myGammaRecords.end(); gamma++) {
1094 (*gamma)->getFinalLevel()->cumulDisintegrationIntensity((*gamma)->getTransitionIntensity());
1098 egsInformation(
"\nEGS_Ensdf::normalizeIntensities: Summary of %s decays (adjusted by %f):\n", radionuclide.c_str(), decayDiscrepancy);
1101 if (myBetaRecords.size()) {
1103 for (vector<BetaRecordLeaf *>::iterator beta = myBetaRecords.begin();
1104 beta != myBetaRecords.end(); beta++) {
1105 egsInformation(
"%f %f\n", (*beta)->getFinalEnergy(), (*beta)->getBetaIntensity());
1108 if (myAlphaRecords.size()) {
1110 for (vector<AlphaRecord *>::iterator alpha = myAlphaRecords.begin();
1111 alpha != myAlphaRecords.end(); alpha++) {
1112 egsInformation(
"%f %f\n", (*alpha)->getFinalEnergy(), (*alpha)->getAlphaIntensity());
1115 if (myGammaRecords.size()) {
1117 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
1118 gamma != myGammaRecords.end(); gamma++) {
1121 if ((*gamma)->getICIntensity() > 0) {
1122 icI = (*gamma)->getGammaIntensity()*(1+(*gamma)->getICIntensity()) - (*gamma)->getGammaIntensity();
1124 if ((*gamma)->getIPIntensity() > 0) {
1125 ipI = (*gamma)->getTransitionIntensity() - (*gamma)->getGammaIntensity() - icI;
1127 egsInformation(
"%f %f %.4e %.4e\n", (*gamma)->getDecayEnergy(), (*gamma)->getGammaIntensity(), icI, ipI);
1130 if (myUncorrelatedGammaRecords.size()) {
1131 egsInformation(
"Uncorrelated gamma records (E,Igamma,Ice,Ipp):\n");
1132 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammaRecords.begin();
1133 gamma != myUncorrelatedGammaRecords.end(); gamma++) {
1136 if ((*gamma)->getICIntensity() > 0) {
1137 icI = (*gamma)->getGammaIntensity()*(1+(*gamma)->getICIntensity()) - (*gamma)->getGammaIntensity();
1139 if ((*gamma)->getIPIntensity() > 0) {
1140 ipI = (*gamma)->getTransitionIntensity() - (*gamma)->getGammaIntensity() - icI;
1142 egsInformation(
"%f %f %.4e %.4e\n", (*gamma)->getDecayEnergy(), (*gamma)->getGammaIntensity(), icI, ipI);
1145 if (xrayEnergies.size() > 0) {
1147 for (
unsigned int i=0; i < xrayEnergies.size(); ++i) {
1151 if (augerEnergies.size() > 0) {
1153 for (
unsigned int i=0; i < augerEnergies.size(); ++i) {
1154 egsInformation(
"%f %f\n", augerEnergies[i], augerIntensities[i]);
1160 totalDecayIntensity = 100;
1166 if (allowMultiTransition) {
1168 egsInformation(
"EGS_Ensdf::normalizeIntensities: Comparing the cumulative disintegration intensity of each level with the gamma transition intensities... \n");
1173 vector<double> totalLevelIntensity;
1174 totalLevelIntensity.resize(myLevelRecords.size());
1175 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
1176 it!=myLevelRecords.end(); ++it) {
1178 totalLevelIntensity[j] = 0;
1179 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
1180 gamma != myGammaRecords.end(); gamma++) {
1182 if ((*gamma)->getLevelRecord() == (*it)) {
1183 totalLevelIntensity[j] += (*gamma)->getTransitionIntensity();
1191 j = myLevelRecords.size()-1;
1192 for (vector<LevelRecord * >::reverse_iterator it = myLevelRecords.rbegin();
1193 it!=myLevelRecords.rend(); ++it) {
1195 double disintIntensity = (*it)->getDisintegrationIntensity();
1198 egsInformation(
"EGS_Ensdf::normalizeIntensities: (Level, ItoLevel, IfromLevel): %d %f %f\n", j, disintIntensity, totalLevelIntensity[j]);
1202 if (disintIntensity >
epsilon && totalLevelIntensity[j] > disintIntensity +
epsilon) {
1203 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
1204 gamma != myGammaRecords.end(); gamma++) {
1206 if ((*gamma)->getLevelRecord() == (*it)) {
1207 double multipleTransitionProb = (1.-disintIntensity/totalLevelIntensity[j]);
1209 (*gamma)->setMultiTransitionProb(multipleTransitionProb);
1212 egsInformation(
"EGS_Ensdf::normalizeIntensities: Multiple gamma transition probability (E,I): %f %f\n",(*gamma)->getDecayEnergy(), multipleTransitionProb);
1216 (*gamma)->setTransitionIntensity(
1217 (*gamma)->getTransitionIntensity() * disintIntensity/totalLevelIntensity[j]
1219 (*gamma)->setGammaIntensity(
1220 (*gamma)->getGammaIntensity() * disintIntensity/totalLevelIntensity[j]
1230 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammaRecords.begin();
1231 gamma != myUncorrelatedGammaRecords.end(); gamma++) {
1232 totalDecayIntensity += (*gamma)->getTransitionIntensity();
1239 for (
unsigned int i=0; i < xrayIntensities.size(); ++i) {
1241 egsInformation(
"EGS_Ensdf::normalizeIntensities: XRay (E,I): %f %f\n",
1242 xrayEnergies[i], xrayIntensities[i]);
1245 totalDecayIntensity += xrayIntensities[i];
1247 for (
unsigned int i=0; i < augerIntensities.size(); ++i) {
1249 egsInformation(
"EGS_Ensdf::normalizeIntensities: Auger (E,I): %f %f\n",
1250 augerEnergies[i], augerIntensities[i]);
1253 totalDecayIntensity += augerIntensities[i];
1257 egsInformation(
"EGS_Ensdf::normalizeIntensities: totalDecayIntensity: "
1258 "%f\n\n",totalDecayIntensity);
1260 "Calculating renormalized intensities...\n");
1264 for (vector<BetaRecordLeaf *>::iterator beta = myBetaRecords.begin();
1265 beta != myBetaRecords.end(); beta++) {
1267 (*beta)->setBetaIntensity(
1268 (*beta)->getBetaIntensity() / totalDecayIntensity);
1270 if ((beta - myBetaRecords.begin()) > 0) {
1271 (*beta)->setBetaIntensity(
1272 (*beta)->getBetaIntensity() + (*(beta-1))->getBetaIntensity());
1274 lastIntensity = (*beta)->getBetaIntensity();
1277 egsInformation(
"EGS_Ensdf::normalizeIntensities: Beta (E,I): %f %f\n",
1278 (*beta)->getFinalEnergy(), (*beta)->getBetaIntensity());
1283 for (vector<AlphaRecord *>::iterator alpha = myAlphaRecords.begin();
1284 alpha != myAlphaRecords.end(); alpha++) {
1286 (*alpha)->setAlphaIntensity(
1287 (*alpha)->getAlphaIntensity() / totalDecayIntensity);
1289 if ((alpha - myAlphaRecords.begin()) == 0 && lastIntensity >
epsilon) {
1290 (*alpha)->setAlphaIntensity(
1291 (*alpha)->getAlphaIntensity() + lastIntensity);
1293 else if ((alpha - myAlphaRecords.begin()) > 0) {
1294 (*alpha)->setAlphaIntensity(
1295 (*alpha)->getAlphaIntensity() +
1296 (*(alpha-1))->getAlphaIntensity());
1298 lastIntensity = (*alpha)->getAlphaIntensity();
1301 egsInformation(
"EGS_Ensdf::normalizeIntensities: Alpha (E,I): %f %f\n",
1302 (*alpha)->getFinalEnergy(), (*alpha)->getAlphaIntensity());
1307 for (vector<GammaRecord *>::iterator gamma = myMetastableGammaRecords.begin();
1308 gamma != myMetastableGammaRecords.end(); gamma++) {
1310 (*gamma)->setTransitionIntensity(
1311 (*gamma)->getTransitionIntensity() / totalDecayIntensity);
1313 if ((gamma - myMetastableGammaRecords.begin()) == 0 && lastIntensity >
epsilon) {
1314 (*gamma)->setTransitionIntensity(
1315 (*gamma)->getTransitionIntensity() + lastIntensity);
1317 else if ((gamma - myMetastableGammaRecords.begin()) > 0) {
1318 (*gamma)->setTransitionIntensity(
1319 (*gamma)->getTransitionIntensity() +
1320 (*(gamma-1))->getTransitionIntensity());
1322 lastIntensity = (*gamma)->getTransitionIntensity();
1325 egsInformation(
"EGS_Ensdf::normalizeIntensities: MetastableGamma (I): %f\n",
1326 (*gamma)->getTransitionIntensity());
1331 for (vector<GammaRecord *>::iterator gamma = myUncorrelatedGammaRecords.begin();
1332 gamma != myUncorrelatedGammaRecords.end(); gamma++) {
1333 (*gamma)->setTransitionIntensity(
1334 (*gamma)->getTransitionIntensity() / totalDecayIntensity);
1336 if ((gamma - myUncorrelatedGammaRecords.begin()) == 0 && lastIntensity >
epsilon) {
1337 (*gamma)->setTransitionIntensity(
1338 (*gamma)->getTransitionIntensity() + lastIntensity);
1340 else if ((gamma - myUncorrelatedGammaRecords.begin()) > 0) {
1341 (*gamma)->setTransitionIntensity(
1342 (*gamma)->getTransitionIntensity() +
1343 (*(gamma-1))->getTransitionIntensity());
1345 lastIntensity = (*gamma)->getTransitionIntensity();
1348 egsInformation(
"EGS_Ensdf::normalizeIntensities: UncorrelatedGamma (I): %f\n",
1349 (*gamma)->getTransitionIntensity());
1354 for (
unsigned int i=0; i < xrayIntensities.size(); ++i) {
1356 xrayIntensities[i] /= totalDecayIntensity;
1358 if (i==0 && lastIntensity >
epsilon) {
1359 xrayIntensities[i] += lastIntensity;
1362 xrayIntensities[i] += xrayIntensities[i-1];
1364 lastIntensity = xrayIntensities[i];
1367 egsInformation(
"EGS_Ensdf::normalizeIntensities: XRay (E,I): %f %f\n",
1368 xrayEnergies[i], xrayIntensities[i]);
1373 for (
unsigned int i=0; i < augerIntensities.size(); ++i) {
1375 augerIntensities[i] /= totalDecayIntensity;
1377 if (i==0 && lastIntensity >
epsilon) {
1378 augerIntensities[i] += lastIntensity;
1381 augerIntensities[i] += augerIntensities[i-1];
1383 lastIntensity = augerIntensities[i];
1386 egsInformation(
"EGS_Ensdf::normalizeIntensities: Auger (E,I): %f %f\n",
1387 augerEnergies[i], augerIntensities[i]);
1394 vector<double> totalLevelIntensity;
1395 totalLevelIntensity.resize(myLevelRecords.size());
1396 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
1397 it!=myLevelRecords.end(); it++) {
1399 double disintIntensity = (*it)->getDisintegrationIntensity();
1401 totalLevelIntensity[j] = 0;
1402 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
1403 gamma != myGammaRecords.end(); gamma++) {
1405 if ((*gamma)->getLevelRecord() == (*it)) {
1406 totalLevelIntensity[j] += (*gamma)->getTransitionIntensity();
1412 "totalLevelIntensity: %f\n", totalLevelIntensity[j]);
1415 if (disintIntensity >
epsilon && totalLevelIntensity[j] < disintIntensity +
epsilon) {
1416 totalLevelIntensity[j] = disintIntensity;
1423 for (vector<LevelRecord * >::iterator it = myLevelRecords.begin();
1424 it!=myLevelRecords.end(); it++) {
1427 bool levelCanDecay =
false;
1428 for (vector<GammaRecord *>::iterator gamma = myGammaRecords.begin();
1429 gamma != myGammaRecords.end(); gamma++) {
1431 if ((*gamma)->getLevelRecord() == (*it)) {
1432 levelCanDecay =
true;
1434 (*gamma)->setGammaIntensity(
1435 (*gamma)->getGammaIntensity() /
1436 (*gamma)->getTransitionIntensity());
1438 (*gamma)->setICIntensity(
1439 (*gamma)->getGammaIntensity() * (1+(*gamma)->getICIntensity()));
1441 if (totalLevelIntensity[j] >
epsilon) {
1442 (*gamma)->setTransitionIntensity(
1443 (*gamma)->getTransitionIntensity() /
1444 totalLevelIntensity[j]);
1448 (*gamma)->setTransitionIntensity(
1449 (*gamma)->getTransitionIntensity() +
1450 (*(gamma-1))->getTransitionIntensity());
1456 "Gamma (level,E,I,Igamma,Ice): "
1458 j,(*gamma)->getDecayEnergy(), (*gamma)->getTransitionIntensity(),
1459 (*gamma)->getGammaIntensity(), (*gamma)->getICIntensity());
1469 (*it)->setLevelCanDecay(levelCanDecay);
1475 void EGS_Ensdf::getEmissionsFromComments() {
1477 egsInformation(
"EGS_Ensdf::getEmissionsFromComments: Attempting to obtain x-ray and Auger emissions from the ENSDF comments. This assumes a particular comment format...\n");
1480 bool containsEmissions =
false;
1481 bool xrayContinues =
false;
1482 bool augerContinues =
false;
1483 bool gotTotal =
false;
1484 vector<double> multilineEnergies,
1485 multilineIntensities;
1486 double lineTotalIntensity = 0;
1487 unsigned int countNumAfterTotal = 0;
1490 for (vector<CommentRecord *>::iterator comment = myCommentRecords.begin();
1491 comment != myCommentRecords.end(); comment++) {
1493 auto commentSet = (*comment)->getComments();
1494 for (
auto c = commentSet.begin(); c != commentSet.end(); ++c) {
1498 if (line.find(
"{U Energy (keV)} {U Intensity} {U Line}") != std::string::npos) {
1499 containsEmissions =
true;
1502 if (containsEmissions) {
1505 if (line.length() < 48 ||
1506 ((xrayContinues || augerContinues) && line.at(30) !=
'|')) {
1519 if (countNumAfterTotal > 0) {
1521 if (lineTotalType == 0) {
1522 bool containsZeroIntensity =
false;
1523 for (std::vector<double>::iterator it = xrayIntensities.end()-countNumAfterTotal; it != xrayIntensities.end(); ++it) {
1525 containsZeroIntensity =
true;
1530 if (containsZeroIntensity) {
1531 for (std::vector<double>::iterator it = xrayIntensities.end()-countNumAfterTotal; it != xrayIntensities.end(); ++it) {
1532 *it = lineTotalIntensity / countNumAfterTotal;
1538 else if (lineTotalType == -1) {
1539 bool containsZeroIntensity =
false;
1540 for (std::vector<double>::iterator it = augerIntensities.end()-countNumAfterTotal; it != augerIntensities.end(); ++it) {
1542 containsZeroIntensity =
true;
1547 if (containsZeroIntensity) {
1548 for (std::vector<double>::iterator it = augerIntensities.end()-countNumAfterTotal; it != augerIntensities.end(); ++it) {
1549 *it = lineTotalIntensity / countNumAfterTotal;
1556 countNumAfterTotal = 0;
1557 lineTotalIntensity = 0.;
1560 if ((xrayContinues || augerContinues)
1561 && multilineEnergies.size() > 0) {
1563 double energySum = 0;
1564 double intensitySum = 0;
1565 unsigned int numNonzeroE = 0;
1566 unsigned int numNonzeroI = 0;
1567 for (
unsigned int i=0; i < multilineEnergies.size(); ++i) {
1568 if (multilineEnergies[i] > 0) {
1569 energySum += multilineEnergies[i];
1573 for (
unsigned int i=0; i < multilineIntensities.size(); ++i) {
1574 if (multilineIntensities[i] >
epsilon) {
1575 intensitySum += multilineIntensities[i];
1580 if (numNonzeroE > 0) {
1581 energy = energySum / numNonzeroE;
1584 if (numNonzeroI > 0) {
1585 intensity = intensitySum / numNonzeroI;
1588 if (numNonzeroE > 0 && numNonzeroI > 0) {
1589 if (xrayContinues) {
1590 xrayEnergies.push_back(energy);
1591 xrayIntensities.push_back(intensity);
1594 augerEnergies.push_back(energy);
1595 augerIntensities.push_back(intensity);
1599 multilineEnergies.clear();
1600 multilineIntensities.clear();
1603 xrayContinues =
false;
1604 augerContinues =
false;
1608 if (line.length() > 48) {
1610 string emissionLine = egsTrimString(line.substr(47));
1613 if (emissionLine.length() < 1 || (emissionLine.at(0) !=
'X' && emissionLine.find(
"AUGER") == std::string::npos)) {
1617 string eStr = egsTrimString(line.substr(13, 15));
1621 size_t eDash = eStr.find(
'-');
1623 if (eDash!=std::string::npos) {
1624 if (eStr.length() > eDash+1) {
1625 double e1 = atof(eStr.substr(0, eDash).c_str());
1626 double e2 = atof(eStr.substr(eDash+1).c_str());
1627 energy = (e1 + e2) / 2;
1630 energy = atof(eStr.substr(0, eDash).c_str());
1634 energy = atof(eStr.c_str());
1641 string iStr = egsTrimString(line.substr(32, 9));
1642 double intensity = atof(iStr.c_str());
1648 if (gotTotal && energy >
epsilon) {
1649 countNumAfterTotal++;
1655 if (emissionLine.find(
"(total)") != std::string::npos) {
1657 lineTotalIntensity = intensity;
1658 if (emissionLine.find(
"AUGER") != std::string::npos) {
1669 if (line.at(30) ==
'|') {
1670 if (emissionLine.at(0) ==
'X') {
1671 xrayContinues =
true;
1673 else if (emissionLine.find(
"AUGER") != std::string::npos) {
1674 augerContinues =
true;
1677 multilineEnergies.push_back(energy);
1678 multilineIntensities.push_back(intensity);
1682 if (emissionLine.at(0) ==
'X') {
1684 (gotTotal && energy >
epsilon)) {
1685 xrayEnergies.push_back(energy);
1686 xrayIntensities.push_back(intensity);
1689 else if (emissionLine.find(
"AUGER") != std::string::npos) {
1691 (gotTotal && energy >
epsilon)) {
1692 augerEnergies.push_back(energy);
1693 augerIntensities.push_back(intensity);
1703 vector<double > EGS_Ensdf::getXRayIntensities()
const {
1704 return xrayIntensities;
1707 vector<double > EGS_Ensdf::getXRayEnergies()
const {
1708 return xrayEnergies;
1711 vector<double > EGS_Ensdf::getAugerIntensities()
const {
1712 return augerIntensities;
1715 vector<double > EGS_Ensdf::getAugerEnergies()
const {
1716 return augerEnergies;
1719 vector<ParentRecord * > EGS_Ensdf::getParentRecords()
const {
1720 return myParentRecords;
1723 vector<LevelRecord * > EGS_Ensdf::getLevelRecords()
const {
1724 return myLevelRecords;
1727 vector<BetaRecordLeaf * > EGS_Ensdf::getBetaRecords()
const {
1728 return myBetaRecords;
1731 vector<GammaRecord * > EGS_Ensdf::getGammaRecords()
const {
1732 return myGammaRecords;
1735 vector<GammaRecord * > EGS_Ensdf::getMetastableGammaRecords()
const {
1736 return myMetastableGammaRecords;
1739 vector<GammaRecord * > EGS_Ensdf::getUncorrelatedGammaRecords()
const {
1740 return myUncorrelatedGammaRecords;
1743 vector<AlphaRecord * > EGS_Ensdf::getAlphaRecords()
const {
1744 return myAlphaRecords;
1747 Record::Record() {};
1748 Record::Record(vector<string> ensdf) {
1749 if (!ensdf.empty()) {
1758 vector<string> Record::getRecords()
const {
1765 double Record::recordToDouble(
int startPos,
int endPos) {
1766 if (!lines.empty()) {
1767 if (lines.front().length() < endPos) {
1768 egsWarning(
"Record::recordToDouble: Warning: Record too short to "
1769 "contain desired quantity\n");
1772 string record = lines.front().substr(startPos-1,
1774 return atof(record.c_str());
1777 egsWarning(
"Record::recordToDouble: Error: Record is empty\n");
1784 string Record::recordToString(
int startPos,
int endPos) {
1785 if (!lines.empty()) {
1786 if (lines.front().length() < endPos) {
1787 egsWarning(
"Record::recordToString: Warning: Record too short to "
1788 "contain desired quantity\n");
1792 return egsTrimString(lines.front().substr(startPos-1, endPos-startPos+1));
1795 egsWarning(
"Record::recordToString: Error: Record is empty\n");
1811 double Record::getTag(
string searchString,
string notAfter=
"") {
1812 if (lines.size() > 1) {
1814 for (
int i=1; i<lines.size(); ++i) {
1816 int tagPos = lines[i].find(searchString);
1818 if (tagPos != std::string::npos) {
1821 size_t notAfterPos = std::string::npos;
1822 if (notAfter.length() > 0 && tagPos-notAfter.length() > 0) {
1823 notAfterPos = lines[i].find(notAfter, tagPos-notAfter.length());
1828 if (notAfterPos == std::string::npos || notAfterPos > tagPos) {
1829 tagPos += searchString.length();
1831 string record = lines[i].substr(tagPos, lines[i].find(
" ",tagPos)-tagPos);
1833 return atof(record.c_str());
1840 tagPos = lines[i].find(searchString, tagPos+searchString.length());
1842 if (tagPos != std::string::npos) {
1843 tagPos += searchString.length();
1845 string record = lines[i].substr(tagPos, lines[i].find(
" ",tagPos)-tagPos);
1847 return atof(record.c_str());
1859 double Record::parseStdUncertainty(
string value,
string stdUncertainty) {
1860 if (stdUncertainty.length() < 1) {
1863 if (value.length() < 1) {
1864 egsInformation(
"Record::parseStdUncertainty: Warning: No uncertainty provided! Returning 0 uncertainty for value of %f\n", value.c_str());
1868 if (stdUncertainty.length() > value.length()) {
1869 egsInformation(
"Record::parseStdUncertainty: Warning: Number of digits in uncertainty greater than number of digits in value. Returning 0 uncertainty for value of %f\n", value.c_str());
1874 size_t sciNotLoc = value.find_last_of(
'E');
1875 size_t dotLoc = value.find_last_of(
'.');
1879 if (sciNotLoc != std::string::npos) {
1880 startPos = sciNotLoc-1;
1883 startPos = value.length()-1;
1886 if (stdUncertainty.length() == 2) {
1892 for (
int i = startPos; i >= 0; --i) {
1895 value[i] = stdUncertainty[j--];
1903 return atof(value.c_str());
1906 string Record::getStringAfter(
string searchString,
size_t len) {
1907 if (lines.size() > 1) {
1909 for (
int i=1; i<lines.size(); ++i) {
1911 int tagPos = lines[i].find(searchString);
1913 if (tagPos != std::string::npos) {
1915 tagPos += searchString.length();
1917 string record = lines[i].substr(tagPos, len);
1929 double Record::parseHalfLife(
int startPos,
int endPos) {
1930 if (lines.empty()) {
1931 egsWarning(
"Record::parseHalfLife: Error: Record is empty\n");
1934 if (lines.front().length() < endPos) {
1935 egsWarning(
"Record::parseHalfLife: Warning: Record too short to "
1936 "contain desired quantity\n");
1940 string halfLifeStr = egsTrimString(lines.front().substr(startPos-1,
1941 endPos-startPos+1));
1944 if (halfLifeStr.substr(0,5).compare(
"STABLE") == 0) {
1949 unsigned int numLength;
1950 for (numLength = 0; numLength < halfLifeStr.length(); numLength++) {
1951 if (!isdigit(halfLifeStr[numLength])
1952 && halfLifeStr.at(numLength) !=
'.') {
1959 if (halfLifeStr.size() < numLength+2) {
1964 double hl = atof(halfLifeStr.substr(0, numLength).c_str());
1967 if (halfLifeStr.size()>numLength+2) {
1968 string units = halfLifeStr.substr(numLength+1, 2);
1969 if (units.compare(
"Y ") == 0) {
1972 else if (units.compare(
"D ") == 0) {
1975 else if (units.compare(
"H ") == 0) {
1978 else if (units.compare(
"M ") == 0) {
1981 else if (units.compare(
"S ") == 0) {
1984 else if (units.compare(
"MS") == 0) {
1987 else if (units.compare(
"US") == 0) {
1990 else if (units.compare(
"NS") == 0) {
1993 else if (units.compare(
"PS") == 0) {
1996 else if (units.compare(
"FS") == 0) {
1999 else if (units.compare(
"AS") == 0) {
2006 else if (halfLifeStr.size()>numLength+1) {
2007 string units = halfLifeStr.substr(numLength+1, 1);
2008 if (units.compare(
"Y") == 0) {
2011 else if (units.compare(
"D") == 0) {
2014 else if (units.compare(
"H") == 0) {
2017 else if (units.compare(
"M") == 0) {
2020 else if (units.compare(
"S") == 0) {
2035 unsigned short Record::parseSpin(
int startPos,
int endPos) {
2036 if (lines.empty()) {
2037 egsWarning(
"Record::parseSpin: Error: Record is empty\n");
2040 if (lines.front().length() < endPos) {
2041 egsWarning(
"Record::parseSpin: Warning: Record too short to "
2042 "contain desired quantity\n");
2046 string spinParityStr = egsTrimString(lines.front().substr(startPos-1,
2047 endPos-startPos+1));
2050 bool foundDigit =
false;
2051 for (
auto i = 0; i < spinParityStr.length(); i++) {
2052 if (isdigit(spinParityStr[i])) {
2060 egsWarning(
"Record::parseSpin: Warning: Spin didn't contain a number\n");
2064 unsigned short spin = spinParityStr[digitIndex] -
'0';
2071 bool Record::parseParity(
int startPos,
int endPos) {
2072 if (lines.empty()) {
2073 egsWarning(
"Record::parseParity: Error: Record is empty\n");
2076 if (lines.front().length() < startPos) {
2077 egsWarning(
"Record::parseParity: Warning: Record too short to "
2078 "contain desired quantity\n");
2082 string spinParityStr = egsTrimString(lines.front().substr(startPos-1,
2083 endPos-startPos+1));
2086 bool foundSign =
false;
2087 for (
auto i = 0; i < spinParityStr.length(); i++) {
2088 if (spinParityStr[i] ==
'-' || spinParityStr[i] ==
'+') {
2096 if (foundSign ==
false || spinParityStr[signIndex] ==
'+') {
2108 CommentRecord::CommentRecord(vector<string> ensdf):
Record(ensdf) {
2112 void CommentRecord::processEnsdf() {
2113 if (!lines.empty()) {
2119 vector<string> CommentRecord::getComments() {
2124 ParentRecord::ParentRecord(vector<string> ensdf):
Record(ensdf) {
2128 void ParentRecord::processEnsdf() {
2129 halfLife = parseHalfLife(40, 49);
2135 Q = recordToDouble(65, 74) / 1000.;
2139 egsWarning(
"ParentRecord::processEnsdf: Warning: No Q-value given, any "
2140 "positron records will give errors\n");
2145 double ParentRecord::getHalfLife()
const {
2149 double ParentRecord::getQ()
const {
2153 ParentRecord *ParentRecordLeaf::getParentRecord()
const {
2163 NormalizationRecord::NormalizationRecord(vector<string> ensdf,
2168 void NormalizationRecord::processEnsdf() {
2169 normalizeRelative = recordToDouble(10, 19);
2170 normalizeTransition = recordToDouble(22, 29);
2171 normalizeBranch = recordToDouble(32, 39);
2172 normalizeBeta = recordToDouble(42, 49);
2176 if (normalizeRelative <
epsilon) {
2177 normalizeRelative = 1;
2179 if (normalizeTransition <
epsilon) {
2180 normalizeTransition = 1;
2182 if (normalizeBranch <
epsilon) {
2183 normalizeBranch = 1;
2185 if (normalizeBeta <
epsilon) {
2190 string element = recordToString(4, 5);
2202 egsInformation(
"NormalizationRecord::processEnsdf(): Z, nshell: %d %d\n",Z,nshell);
2209 int NormalizationRecord::getNShell()
const {
2213 double NormalizationRecord::getBindingEnergy(
int shell)
const {
2217 void NormalizationRecord::relax(
int shell,
2218 EGS_Float ecut, EGS_Float pcut,
2221 relaxations->
relax(Z,shell,ecut,pcut,rndm,edep,particles);
2228 double NormalizationRecord::getRelativeMultiplier()
const {
2229 return normalizeRelative;
2235 double NormalizationRecord::getTransitionMultiplier()
const {
2236 return normalizeTransition;
2241 double NormalizationRecord::getBranchMultiplier()
const {
2242 return normalizeBranch;
2247 double NormalizationRecord::getBetaMultiplier()
const {
2248 return normalizeBeta;
2262 LevelRecord::LevelRecord() {
2265 disintegrationIntensity = 0;
2267 LevelRecord::LevelRecord(vector<string> ensdf):
2270 disintegrationIntensity = 0;
2273 void LevelRecord::processEnsdf() {
2274 energy = recordToDouble(10, 19) / 1000.;
2275 halfLife = parseHalfLife(40, 49);
2276 spin = parseSpin(22, 39);
2277 parity = parseParity(22, 39);
2280 void LevelRecord::setLevelCanDecay(
bool canDecayTmp) {
2281 canDecay = canDecayTmp;
2284 bool LevelRecord::levelCanDecay()
const {
2288 void LevelRecord::resetDisintegrationIntensity() {
2289 disintegrationIntensity = 0;
2292 void LevelRecord::cumulDisintegrationIntensity(
double disintIntensity) {
2293 disintegrationIntensity += disintIntensity;
2296 double LevelRecord::getDisintegrationIntensity()
const {
2297 return disintegrationIntensity;
2300 double LevelRecord::getEnergy()
const {
2304 double LevelRecord::getHalfLife()
const {
2308 unsigned short LevelRecord::getSpin()
const {
2312 bool LevelRecord::getParity()
const {
2317 LevelRecord *LevelRecordLeaf::getLevelRecord()
const {
2327 BetaRecordLeaf::BetaRecordLeaf(vector<string> ensdf,
2339 string id = egsRemoveWhite(lines.front().substr(0,5));
2342 string atomicWeight;
2343 for (
unsigned int i=0; i <
id.length(); ++i) {
2344 if (!isdigit(
id[i])) {
2348 atomicWeight.push_back(
id[i]);
2351 A = atoi(atomicWeight.c_str());
2354 if (lines.front().length() > 77) {
2356 lambda.push_back(lines.front().at(77));
2357 forbidden = atoi(lambda.c_str());
2363 int BetaRecordLeaf::getCharge()
const {
2367 void BetaRecordLeaf::incrNumSampled() {
2371 EGS_I64 BetaRecordLeaf::getNumSampled()
const {
2375 unsigned short int BetaRecordLeaf::getZ()
const {
2379 unsigned short int BetaRecordLeaf::getAtomicWeight()
const {
2383 unsigned short int BetaRecordLeaf::getForbidden()
const {
2396 BetaMinusRecord::BetaMinusRecord(vector<string> ensdf,
2401 myNormalization, myLevel) {
2404 myLevel->cumulDisintegrationIntensity(betaIntensity);
2407 void BetaMinusRecord::processEnsdf() {
2408 finalEnergy = recordToDouble(10, 19) / 1000.;
2409 betaIntensity = recordToDouble(22, 29);
2410 string betaIntensityStr = recordToString(22, 29);
2411 string betaIntensityUncStr = recordToString(30, 31);
2413 betaIntensityUnc = parseStdUncertainty(betaIntensityStr, betaIntensityUncStr);
2415 if (betaIntensityUnc == 0) {
2416 betaIntensityUnc = betaIntensity;
2419 if (getNormalizationRecord()) {
2420 double factor = getNormalizationRecord()->getBetaMultiplier() * getNormalizationRecord()->getBranchMultiplier();
2422 betaIntensity *= factor;
2423 betaIntensityUnc *= factor;
2427 double BetaMinusRecord::getFinalEnergy()
const {
2431 double BetaMinusRecord::getBetaIntensity()
const {
2432 return betaIntensity;
2435 double BetaMinusRecord::getBetaIntensityUnc()
const {
2436 return betaIntensityUnc;
2439 void BetaMinusRecord::setBetaIntensity(
double newIntensity) {
2440 betaIntensity = newIntensity;
2444 BetaPlusRecord::BetaPlusRecord(vector<string> ensdf,
2449 myNormalization, myLevel) {
2452 myLevel->cumulDisintegrationIntensity(betaIntensity);
2455 void BetaPlusRecord::processEnsdf() {
2456 finalEnergy = recordToDouble(10, 19) / 1000.;
2457 positronIntensity = recordToDouble(22, 29);
2458 string positronIntensityStr = recordToString(22, 29);
2459 string positronIntensityUncStr = recordToString(30, 31);
2460 ecIntensity = recordToDouble(32, 39);
2461 string ecIntensityStr = recordToString(32, 39);
2462 string ecIntensityUncStr = recordToString(40, 41);
2464 positronIntensityUnc = parseStdUncertainty(positronIntensityStr, positronIntensityUncStr);
2466 if (positronIntensityUnc == 0) {
2467 positronIntensityUnc = positronIntensity;
2470 ecIntensityUnc = parseStdUncertainty(ecIntensityStr, ecIntensityUncStr);
2472 if (ecIntensityUnc == 0) {
2473 ecIntensityUnc = ecIntensity;
2476 if (getNormalizationRecord()) {
2477 double factor = getNormalizationRecord()->getBetaMultiplier() * getNormalizationRecord()->getBranchMultiplier();
2479 positronIntensity *= factor;
2480 ecIntensity *= factor;
2481 positronIntensityUnc *= factor;
2482 ecIntensityUnc *= factor;
2487 betaIntensity = positronIntensity + ecIntensity;
2492 positronIntensity = positronIntensity / betaIntensity;
2496 if (finalEnergy == 0 && positronIntensity >
epsilon) {
2497 finalEnergy = getParentRecord()->getQ()
2498 - getLevelRecord()->getEnergy() - 1.022;
2500 if (finalEnergy < 0.) {
2501 egsWarning(
"BetaPlusRecord::processEnsdf: Error: Final energy of "
2502 "positron could not be calculated. Setting energy to zero!\n"
2508 if (ecIntensity > 0 && getNormalizationRecord()) {
2510 int nshell = getNormalizationRecord()->getNShell();
2512 double icK = getTag(
"CK=");
2513 double icL = getTag(
"CL=");
2514 double icM = getTag(
"CM=");
2515 double icN = getTag(
"CN=");
2516 double icO = getTag(
"CO=");
2517 double icP = getTag(
"CP=");
2518 double icQ = getTag(
"CQ=");
2521 ecShellIntensity.push_back(icK);
2526 int numShellsToInclude = min(4,nshell);
2527 for (
unsigned int i=1; i<numShellsToInclude; ++i) {
2528 ecShellIntensity.push_back(ecShellIntensity.back() + icL/(numShellsToInclude-1));
2532 if (numShellsToInclude < 4) {
2540 numShellsToInclude = min(9,nshell);
2541 for (
unsigned int i=4; i<numShellsToInclude; ++i) {
2542 ecShellIntensity.push_back(ecShellIntensity.back() + icM/(numShellsToInclude-4));
2544 if (numShellsToInclude < 9) {
2552 numShellsToInclude = min(16,nshell);
2553 for (
unsigned int i=9; i<numShellsToInclude; ++i) {
2554 ecShellIntensity.push_back(ecShellIntensity.back() + icN/(numShellsToInclude-9));
2556 if (numShellsToInclude < 16) {
2564 numShellsToInclude = min(23,nshell);
2565 for (
unsigned int i=16; i<numShellsToInclude; ++i) {
2566 ecShellIntensity.push_back(ecShellIntensity.back() + icO/(numShellsToInclude-16));
2569 if (numShellsToInclude < 23) {
2577 numShellsToInclude = min(26,nshell);
2578 for (
unsigned int i=23; i<numShellsToInclude; ++i) {
2579 ecShellIntensity.push_back(ecShellIntensity.back() + icP/(numShellsToInclude-23));
2582 if (numShellsToInclude < 26) {
2590 numShellsToInclude = 27;
2591 ecShellIntensity.push_back(ecShellIntensity.back() + icQ/(numShellsToInclude-26));
2600 void BetaPlusRecord::relax(
int shell,
2601 EGS_Float ecut, EGS_Float pcut,
2604 getNormalizationRecord()->relax(shell,ecut,pcut,rndm,edep,particles);
2607 double BetaPlusRecord::getFinalEnergy()
const {
2611 double BetaPlusRecord::getBetaIntensity()
const {
2612 return betaIntensity;
2615 double BetaPlusRecord::getPositronIntensity()
const {
2616 return positronIntensity;
2619 double BetaPlusRecord::getPositronIntensityUnc()
const {
2620 return positronIntensityUnc;
2623 double BetaPlusRecord::getECIntensityUnc()
const {
2624 return ecIntensityUnc;
2627 void BetaPlusRecord::setBetaIntensity(
double newIntensity) {
2628 betaIntensity = newIntensity;
2631 void BetaPlusRecord::setPositronIntensity(
double newIntensity) {
2632 positronIntensity = newIntensity;
2636 GammaRecord::GammaRecord(vector<string> ensdf,
2646 numGammaSampled = 0;
2649 multipleTransitionProb = 0;
2658 numGammaSampled = gamma->numGammaSampled;
2659 numICSampled = gamma->numICSampled;
2660 numIPSampled = gamma->numIPSampled;
2661 decayEnergy = gamma->decayEnergy;
2662 transitionIntensity = gamma->transitionIntensity;
2663 multipleTransitionProb = gamma->multipleTransitionProb;
2664 gammaIntensity = gamma->gammaIntensity;
2665 gammaIntensityUnc = gamma->gammaIntensityUnc;
2666 icCoeff = gamma->icCoeff;
2667 icCoeffUnc = gamma->icCoeffUnc;
2668 ipCoeff = gamma->ipCoeff;
2669 ipCoeffUnc = gamma->ipCoeffUnc;
2671 finalLevel = gamma->finalLevel;
2674 void GammaRecord::processEnsdf() {
2675 decayEnergy = recordToDouble(10, 19) / 1000.;
2676 gammaIntensity = recordToDouble(22, 29);
2677 string gammaIntensityStr = recordToString(22, 29);
2678 string gammaIntensityUncStr = recordToString(30, 31);
2683 icCoeff = recordToDouble(56, 62);
2684 string icCoeffStr = recordToString(56, 62);
2685 string icCoeffUncStr = recordToString(63, 64);
2688 if (gammaIntensity <
epsilon) {
2689 gammaIntensity = getTag(
"RI=");
2692 icCoeffUnc = parseStdUncertainty(icCoeffStr, icCoeffUncStr);
2694 if (icCoeffUnc == 0) {
2695 icCoeffUnc = icCoeff;
2700 string ipCoeffStr_tmp = getStringAfter(
"IPC=", 11);
2701 if (ipCoeffStr_tmp.length() > 0) {
2702 string ipCoeffStr = ipCoeffStr_tmp.substr(0, 9);
2703 string ipCoeffUncStr = ipCoeffStr_tmp.substr(9, 2);
2704 ipCoeff = atof(ipCoeffStr.c_str());
2705 ipCoeffUnc = atof(ipCoeffUncStr.c_str());
2707 if (ipCoeffUnc == 0) {
2708 ipCoeffUnc = ipCoeff;
2717 if (gammaIntensity <
epsilon) {
2718 double ti = getTag(
"TI ");
2720 gammaIntensity = ti / ((1+icCoeff) * (1+ipCoeff));
2724 gammaIntensityUnc = parseStdUncertainty(gammaIntensityStr, gammaIntensityUncStr);
2726 if (gammaIntensityUnc == 0) {
2727 gammaIntensityUnc = gammaIntensity;
2730 if (getNormalizationRecord()) {
2731 double factor = getNormalizationRecord()->getRelativeMultiplier() *
2732 getNormalizationRecord()->getBranchMultiplier();
2734 gammaIntensity *= factor;
2735 gammaIntensityUnc *= factor;
2739 transitionIntensity = gammaIntensity * (1+icCoeff) * (1+ipCoeff);
2741 if (icCoeff > 0 && getNormalizationRecord()) {
2743 int nshell = getNormalizationRecord()->getNShell();
2745 double icK = getTag(
"KC=");
2746 double icL = getTag(
"LC=");
2747 double icM = getTag(
"MC=");
2748 double icN = getTag(
"NC=");
2749 double icO = getTag(
"OC=");
2750 double icP = getTag(
"PC=",
"I");
2751 double icQ = getTag(
"QC=");
2754 icIntensity.push_back(icK / icCoeff);
2759 int numShellsToInclude = min(4,nshell);
2760 for (
unsigned int i=1; i<numShellsToInclude; ++i) {
2761 icIntensity.push_back(icIntensity.back() + (icL / icCoeff)/(numShellsToInclude-1));
2765 if (numShellsToInclude < 4) {
2773 numShellsToInclude = min(9,nshell);
2774 for (
unsigned int i=4; i<numShellsToInclude; ++i) {
2775 icIntensity.push_back(icIntensity.back() + (icM / icCoeff)/(numShellsToInclude-4));
2777 if (numShellsToInclude < 9) {
2785 numShellsToInclude = min(16,nshell);
2786 for (
unsigned int i=9; i<numShellsToInclude; ++i) {
2787 icIntensity.push_back(icIntensity.back() + (icN / icCoeff)/(numShellsToInclude-9));
2789 if (numShellsToInclude < 16) {
2797 numShellsToInclude = min(23,nshell);
2798 for (
unsigned int i=16; i<numShellsToInclude; ++i) {
2799 icIntensity.push_back(icIntensity.back() + (icO / icCoeff)/(numShellsToInclude-16));
2802 if (numShellsToInclude < 23) {
2810 numShellsToInclude = min(26,nshell);
2811 for (
unsigned int i=23; i<numShellsToInclude; ++i) {
2812 icIntensity.push_back(icIntensity.back() + (icP / icCoeff)/(numShellsToInclude-23));
2815 if (numShellsToInclude < 26) {
2823 numShellsToInclude = 27;
2824 icIntensity.push_back(icIntensity.back() + (icQ / icCoeff)/(numShellsToInclude-26));
2834 double GammaRecord::getBindingEnergy(
int shell)
const {
2835 return getNormalizationRecord()->getBindingEnergy(shell);
2838 void GammaRecord::relax(
int shell,
2839 EGS_Float ecut, EGS_Float pcut,
2842 getNormalizationRecord()->relax(shell,ecut,pcut,rndm,edep,particles);
2845 double GammaRecord::getDecayEnergy()
const {
2849 double GammaRecord::getMultiTransitionProb()
const {
2850 return multipleTransitionProb;
2853 void GammaRecord::setMultiTransitionProb(
double newIntensity) {
2854 multipleTransitionProb = newIntensity;
2857 double GammaRecord::getTransitionIntensity()
const {
2858 return transitionIntensity;
2861 double GammaRecord::getGammaIntensity()
const {
2862 return gammaIntensity;
2865 double GammaRecord::getGammaIntensityUnc()
const {
2866 return gammaIntensityUnc;
2869 double GammaRecord::getICIntensity()
const {
2873 double GammaRecord::getICIntensityUnc()
const {
2877 double GammaRecord::getIPIntensity()
const {
2881 double GammaRecord::getIPIntensityUnc()
const {
2885 void GammaRecord::setTransitionIntensity(
double newIntensity) {
2886 transitionIntensity = newIntensity;
2889 void GammaRecord::setGammaIntensity(
double newIntensity) {
2890 gammaIntensity = newIntensity;
2893 void GammaRecord::setICIntensity(
double newIntensity) {
2894 icCoeff = newIntensity;
2897 int GammaRecord::getCharge()
const {
2901 void GammaRecord::incrGammaSampled() {
2905 void GammaRecord::incrICSampled() {
2909 void GammaRecord::incrIPSampled() {
2913 EGS_I64 GammaRecord::getGammaSampled()
const {
2914 return numGammaSampled;
2917 EGS_I64 GammaRecord::getICSampled()
const {
2918 return numICSampled;
2921 EGS_I64 GammaRecord::getIPSampled()
const {
2922 return numIPSampled;
2929 void GammaRecord::setFinalLevel(
LevelRecord *newLevel) {
2930 finalLevel = newLevel;
2934 AlphaRecord::AlphaRecord(vector<string> ensdf,
2945 myLevel->cumulDisintegrationIntensity(alphaIntensity);
2948 void AlphaRecord::processEnsdf() {
2949 finalEnergy = recordToDouble(10, 19) / 1000.;
2950 alphaIntensity = recordToDouble(22, 29);
2952 string alphaIntensityStr = recordToString(22, 29);
2953 string alphaIntensityUncStr = recordToString(30, 31);
2955 alphaIntensityUnc = parseStdUncertainty(alphaIntensityStr, alphaIntensityUncStr);
2957 if (alphaIntensityUnc == 0) {
2958 alphaIntensityUnc = alphaIntensity;
2961 if (getNormalizationRecord()) {
2962 alphaIntensity *= getNormalizationRecord()->getBranchMultiplier();
2963 alphaIntensityUnc *= getNormalizationRecord()->getBranchMultiplier();
2967 double AlphaRecord::getFinalEnergy()
const {
2971 double AlphaRecord::getAlphaIntensity()
const {
2972 return alphaIntensity;
2975 double AlphaRecord::getAlphaIntensityUnc()
const {
2976 return alphaIntensityUnc;
2979 void AlphaRecord::setAlphaIntensity(
double newIntensity) {
2980 alphaIntensity = newIntensity;
2983 int AlphaRecord::getCharge()
const {
2987 void AlphaRecord::incrNumSampled() {
2991 EGS_I64 AlphaRecord::getNumSampled()
const {
A class for sampling random values from a given probability distribution using the alias table techni...
EGS_Float getBindingEnergy(int Z, int shell)
void relax(int Z, int sh, EGS_Float ecut, EGS_Float pcut, EGS_RandomGenerator *rndm, double &edep, EGS_SimpleContainer< EGS_RelaxationParticle > &particles)
EGS_Ensdf(const string nuclide, const string ensdf_filename="", const string relaxType="eadl", const bool allowMultiTrans=false, int verbosity=1)
Construct an ensdf object.
Base random number generator class. All random number generators should be derived from this class.
The ensdf library header file.
EGS_InfoFunction EGS_EXPORT egsInformation
Always use this function for reporting the progress of a simulation and any other type of information...
const EGS_Float epsilon
The epsilon constant for floating point comparisons.
EGS_InfoFunction EGS_EXPORT egsWarning
Always use this function for reporting warnings.