#include <MyBiSource.hh>
Public Methods | |
MyBiSource (int newIsotope=k.Isotope) | |
MyBiSource constructor. More... | |
~MyBiSource () | |
MyBiSource destructor. | |
MyBiSource (const MyBiSource &BiSource) | |
MyBiSource copy constructor. | |
MyBiSource & | operator= (const MyBiSource &rhs) |
MyBiSource overloaded = operator. | |
int | GetNumBiGammas () const |
Returns the number of photons produced by the Bi decay. | |
float | GetBiGammaEnergy (int &n) const |
Returns the energy of each photon produced by the Bi decay. More... |
The supported isotopes are Bi212 and Bi214. The decay table is read in from tl_bi_decays.txt and parsed by MyBiSource to create an array of the decay branch probabilites and the number and energies of the photons generated by each branch.
Definition at line 18 of file MyBiSource.hh.
|
MyBiSource constructor. Called with the desired Thallium isotope: 212 or 214. Default is the isotope given in ReactorConstants, 252, which does nothing. Definition at line 17 of file MyBiSource.cpp.
00017 { 00018 00019 Isotope = newIsotope; 00020 00021 //cout << "MyBiSource::MyBiSource(" << Isotope << ")" << endl; 00022 00023 // input the source number and position 00024 fstream fin("data/tl_bi_decays.txt", ios::in); 00025 //cout << "Bi input file: data/tl_bi_decays.txt" << endl; 00026 00027 char paramLine[256]; 00028 string dummyString; 00029 int dummyInt; 00030 float dummyFloat; 00031 bool done = false; 00032 bool Set = false; 00033 00034 int Z, A; 00035 int Nbranch; 00036 float branchProb[130]; 00037 int Ngamma[130]; 00038 float gammaE[130][6]; 00039 00040 // zero the permanent information 00041 numGamma = 0; 00042 for(int i=0;i<6; i++) gammaEnergy[i] = 0.; 00043 00044 // Bi212 00045 if(Isotope == 212){ 00046 00047 while(!done){ 00048 00049 // '#' specifies a comment line -- ignore it 00050 if(fin.peek() == '#'){ 00051 00052 fin.getline(paramLine, 256); 00053 continue; 00054 } 00055 00056 // 'E'ND or 'e'nd specifies end of file -- set done flag to true 00057 if(fin.peek() == 'e' || fin.peek() == 'E'){ 00058 00059 done = true; 00060 continue; 00061 } 00062 00063 // 'N'UCLEUS = or 'n'ucleus = specifies Z and A of daughter nucleus 00064 if(fin.peek() == 'n' || fin.peek() == 'N'){ 00065 00066 if(Set){ 00067 00068 fin.getline( paramLine, 256 ); 00069 continue; 00070 } 00071 fin >> dummyString; 00072 while(fin.peek() == ' ' || fin.peek() == '=') 00073 fin.ignore(1); 00074 00075 fin >> Z >> A; 00076 //cout << Z << " " << A << endl; 00077 00078 if(A == 212){ 00079 00080 // read in Bi212 decay table, 6 branches 00081 Nbranch = 6; 00082 for(int n=0; n<Nbranch; n++){ 00083 00084 fin >> branchProb[n] >> dummyInt >> dummyFloat >> Ngamma[n]; 00085 for(int i=0; i<6; i++) fin >> gammaE[n][i]; 00086 fin >> dummyFloat >> dummyFloat >> dummyFloat; 00087 00088 /* 00089 cout << " branchProb[" << n << "] " << branchProb[n] 00090 << " and Ngamma[" << n << "] " << Ngamma[n] << endl; 00091 for(int i=0; i<Ngamma[n]; i++){ 00092 cout << " gammaE[" << n << "][" << i << "] " << gammaE[n][i]; 00093 } 00094 cout << endl; 00095 */ 00096 } 00097 00098 Set = true; 00099 } 00100 00101 continue; 00102 } 00103 00104 // ignore lines starting with numbers if they are not in our decay table 00105 if(fin.peek() == '0' || fin.peek() == '1'){ 00106 00107 fin.getline(paramLine, 256); 00108 continue; 00109 } 00110 00111 // ignore extra whitespace 00112 if(fin.peek() == ' ' || fin.peek() == '\n'){ 00113 00114 fin.ignore(1); 00115 continue; 00116 } 00117 } 00118 00119 } // done with Bi212 00120 00121 // Bi214 00122 if(Isotope == 214){ 00123 00124 while(!done){ 00125 00126 // '#' specifies a comment line -- ignore it 00127 if(fin.peek() == '#'){ 00128 00129 fin.getline(paramLine, 256); 00130 continue; 00131 } 00132 00133 // 'E'ND or 'e'nd specifies end of file -- set done flag to true 00134 if(fin.peek() == 'e' || fin.peek() == 'E'){ 00135 00136 done = true; 00137 continue; 00138 } 00139 00140 // 'N'UCLEUS = or 'n'ucleus = specifies Z and A of daughter nucleus 00141 if(fin.peek() == 'n' || fin.peek() == 'N'){ 00142 00143 if(Set){ 00144 00145 fin.getline( paramLine, 256 ); 00146 continue; 00147 } 00148 fin >> dummyString; 00149 while(fin.peek() == ' ' || fin.peek() == '=') 00150 fin.ignore(1); 00151 00152 fin >> Z >> A; 00153 //cout << Z << " " << A << endl; 00154 00155 if(A == 214){ 00156 00157 // read in Bi214 decay table, 127 branches 00158 Nbranch = 127; 00159 for(int n=0; n<Nbranch; n++){ 00160 00161 fin >> branchProb[n] >> dummyInt >> dummyFloat >> Ngamma[n]; 00162 for(int i=0; i<6; i++) fin >> gammaE[n][i]; 00163 fin >> dummyFloat >> dummyFloat >> dummyFloat; 00164 00165 /* 00166 cout << " branchProb[" << n << "] " << branchProb[n] 00167 << " and Ngamma[" << n << "] " << Ngamma[n] << endl; 00168 for(int i=0; i<Ngamma[n]; i++){ 00169 cout << " gammaE[" << n << "][" << i << "] " << gammaE[n][i]; 00170 } 00171 cout << endl; 00172 */ 00173 } 00174 00175 Set = true; 00176 } 00177 00178 continue; 00179 } 00180 00181 // ignore lines starting with numbers if they are not in our decay table 00182 if(fin.peek() == '0' || fin.peek() == '1'){ 00183 00184 fin.getline(paramLine, 256); 00185 continue; 00186 } 00187 00188 // ignore extra whitespace 00189 if(fin.peek() == ' ' || fin.peek() == '\n'){ 00190 00191 fin.ignore(1); 00192 continue; 00193 } 00194 } 00195 00196 } // done with Bi214 00197 00198 // pick a decay branch and get the gamma energies 00199 int len = 1; 00200 float r[len]; 00201 ranlux_(r,len); 00202 00203 bool passed = false; 00204 for(int n=0;n<Nbranch; n++){ 00205 00206 if(branchProb[n] > r[0] && !passed){ 00207 00208 // save the number and energies of the gammas 00209 numGamma = Ngamma[n]; 00210 for(int i=0;i<numGamma; i++) gammaEnergy[i] = gammaE[n][i]; 00211 00212 if(numGamma)passed = true; 00213 } 00214 } 00215 00216 00217 } |
|
Returns the energy of each photon produced by the Bi decay. Called with the integer index for each photon in the gammaEnergy array, from 0 to the total number of photons. Definition at line 38 of file MyBiSource.hh.
00038 {return gammaEnergy[n];} |