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