Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // 27 // Author: Alfonso Mantero (Alfonso.Mantero@ge << 27 // $Id: G4AugerData.cc v1.0 >> 28 // >> 29 // >> 30 // Author: Alfonso Mmantero (Alfonso.Mantero@ge.infn.it) 28 // 31 // 29 // History: 32 // History: 30 // ----------- 33 // ----------- 31 // Based on G4FluoData by Elena Guardincerri 34 // Based on G4FluoData by Elena Guardincerri 32 // 35 // 33 // Modified: << 36 // Modified: 30.07.02 VI Add select active Z + clean up against pedantic compiler 34 // 30.07.02 VI Add select active Z + clean up << 35 // 37 // 36 // ------------------------------------------- 38 // ------------------------------------------------------------------- 37 39 38 #include <fstream> << 39 #include <sstream> << 40 << 41 #include "G4AugerData.hh" 40 #include "G4AugerData.hh" 42 #include "G4SystemOfUnits.hh" << 43 #include "G4DataVector.hh" 41 #include "G4DataVector.hh" 44 #include "G4Material.hh" 42 #include "G4Material.hh" 45 #include "G4Element.hh" 43 #include "G4Element.hh" 46 #include "G4ElementVector.hh" 44 #include "G4ElementVector.hh" 47 << 45 #include <fstream> 48 //....oooOO0OOooo........oooOO0OOooo........oo << 46 #include <sstream> 49 47 50 G4AugerData::G4AugerData() 48 G4AugerData::G4AugerData() 51 { 49 { 52 numberOfVacancies.resize(105, 0); << 50 >> 51 G4int n = 0; >> 52 G4int pos = 0; >> 53 >> 54 for (pos = 0 ; pos < 100; pos++) >> 55 { >> 56 numberOfVacancies.push_back(n); >> 57 } >> 58 53 BuildAugerTransitionTable(); 59 BuildAugerTransitionTable(); >> 60 >> 61 54 } 62 } 55 63 56 //....oooOO0OOooo........oooOO0OOooo........oo << 64 G4AugerData::~G4AugerData() >> 65 { >> 66 /* >> 67 std::map<G4int,std::vector<G4AugerTransition>,std::less<G4int> >::iterator pos; >> 68 >> 69 for (pos = augerTransitionTable.begin(); pos != augerTransitionTable.end(); pos++) >> 70 { >> 71 std::vector<G4AugerTransition> dataSet = (*pos).second; >> 72 delete dataSet; >> 73 } >> 74 for (pos = energyMap.begin(); pos != energyMap.end(); pos++) >> 75 { >> 76 std::map<G4Int,G4DataVector*,std::less<G4int>>* dataMap = (*pos).second; >> 77 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++) >> 78 { >> 79 G4DataVector* dataSet = (*pos2).second; >> 80 delete dataSet; >> 81 } >> 82 } >> 83 for (pos = probabilityMap.begin(); pos != probabilityMap.end(); pos++) >> 84 { >> 85 std::map<G4Int,G4DataVector*,std::less<G4int>>* dataMap = (*pos).second; >> 86 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++) >> 87 { >> 88 G4DataVector* dataSet = (*pos2).second; >> 89 delete dataSet; >> 90 } >> 91 } >> 92 for (pos2 = newIdMap.begin(); pos2 != idMap.end(); pos2++) >> 93 { >> 94 G4DataVector* dataSet = (*pos2).second; >> 95 delete dataSet; >> 96 } >> 97 for (pos2 = newIdEnergyMap.begin(); pos2 != idMap.end(); pos2++) >> 98 { >> 99 G4DataVector* dataSet = (*pos2).second; >> 100 delete dataSet; >> 101 } >> 102 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++) >> 103 { >> 104 G4DataVector* dataSet = (*pos2).second; >> 105 delete dataSet; >> 106 } >> 107 */ >> 108 >> 109 } 57 110 58 std::size_t G4AugerData::NumberOfVacancies(G4i << 111 size_t G4AugerData::NumberOfVacancies(G4int Z) const 59 { 112 { 60 return numberOfVacancies[Z]; 113 return numberOfVacancies[Z]; 61 } 114 } 62 115 63 //....oooOO0OOooo........oooOO0OOooo........oo << 64 << 65 G4int G4AugerData::VacancyId(G4int Z, G4int va 116 G4int G4AugerData::VacancyId(G4int Z, G4int vacancyIndex) const 66 { 117 { >> 118 67 G4int n = 0; 119 G4int n = 0; 68 if (vacancyIndex<0 || vacancyIndex>=numberOf 120 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 69 { << 121 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 70 G4Exception("G4AugerData::VacancyId()"," << 71 } << 72 else { 122 else { 73 trans_Table::const_iterator element = auge 123 trans_Table::const_iterator element = augerTransitionTable.find(Z); 74 if (element == augerTransitionTable.end()) << 124 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 75 G4Exception("G4AugerData::VacancyId()"," << 76 return 0; << 77 } << 78 std::vector<G4AugerTransition> dataSet = ( 125 std::vector<G4AugerTransition> dataSet = (*element).second; 79 n = (G4int) dataSet[vacancyIndex].FinalShe 126 n = (G4int) dataSet[vacancyIndex].FinalShellId(); 80 } << 127 } >> 128 81 return n; 129 return n; 82 } 130 } 83 131 84 //....oooOO0OOooo........oooOO0OOooo........oo << 85 132 86 // Attention: this method wants the vacancy in << 133 87 std::size_t G4AugerData::NumberOfTransitions(G << 134 // Attenzione: questa funzione vuole l'indice della vacanza, non l'Id >> 135 >> 136 >> 137 size_t G4AugerData::NumberOfTransitions(G4int Z, G4int vacancyIndex) const 88 { 138 { 89 std::size_t n = 0; << 139 G4int n = 0; 90 if (vacancyIndex<0 || vacancyIndex>=numberOf 140 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 91 { << 141 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 92 G4Exception("G4AugerData::VacancyId()"," << 93 return 0; << 94 } << 95 else { 142 else { 96 trans_Table::const_iterator element = auge 143 trans_Table::const_iterator element = augerTransitionTable.find(Z); 97 if (element == augerTransitionTable.end()) << 144 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 98 { << 99 G4Exception("G4AugerData::VacancyId()","de00 << 100 return 0; << 101 } << 102 std::vector<G4AugerTransition> dataSet = ( 145 std::vector<G4AugerTransition> dataSet = (*element).second; 103 n = dataSet[vacancyIndex].TransitionOrigin << 146 n = (G4int)dataSet[vacancyIndex].TransitionOriginatingShellIds()->size(); 104 } 147 } 105 return n; << 148 return n; 106 } 149 } 107 150 108 //....oooOO0OOooo........oooOO0OOooo........oo << 109 151 110 std::size_t G4AugerData::NumberOfAuger(G4int Z << 152 >> 153 size_t G4AugerData::NumberOfAuger(G4int Z, G4int initIndex, G4int vacancyId) const 111 { 154 { 112 std::size_t n = 0; << 155 size_t n = 0; 113 if (initIndex<0 || initIndex>=numberOfVacanc 156 if (initIndex<0 || initIndex>=numberOfVacancies[Z]) 114 { << 157 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 115 G4Exception("G4AugerData::VacancyId()"," << 116 return 0; << 117 } << 118 else { 158 else { 119 trans_Table::const_iterator element = auge 159 trans_Table::const_iterator element = augerTransitionTable.find(Z); 120 if (element == augerTransitionTable.end()) << 160 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 121 G4Exception("G4AugerData::VacancyId()"," << 122 return 0; << 123 } << 124 std::vector<G4AugerTransition> dataSet = ( 161 std::vector<G4AugerTransition> dataSet = (*element).second; 125 const std::vector<G4int>* temp = << 162 const std::vector<G4int>* temp = dataSet[initIndex].AugerOriginatingShellIds(vacancyId); 126 dataSet[initIndex].AugerOriginatingShell << 127 n = temp->size(); 163 n = temp->size(); 128 } 164 } 129 return n; 165 return n; 130 } 166 } 131 167 132 //....oooOO0OOooo........oooOO0OOooo........oo << 168 size_t G4AugerData::AugerShellId(G4int Z, G4int vacancyIndex, G4int transId, G4int augerIndex) const 133 << 134 std::size_t G4AugerData::AugerShellId(G4int Z, << 135 { 169 { 136 std::size_t n = 0; << 170 size_t n = 0; 137 if (vacancyIndex<0 || vacancyIndex>=numberOf 171 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 138 { << 172 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 139 G4Exception("G4AugerData::VacancyId()"," << 140 return 0; << 141 } << 142 else { 173 else { 143 trans_Table::const_iterator element = auge 174 trans_Table::const_iterator element = augerTransitionTable.find(Z); 144 if (element == augerTransitionTable.end()) << 175 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 145 G4Exception("G4AugerData::VacancyId()"," << 146 return 0; << 147 } << 148 std::vector<G4AugerTransition> dataSet = ( 176 std::vector<G4AugerTransition> dataSet = (*element).second; 149 n = dataSet[vacancyIndex].AugerOriginating 177 n = dataSet[vacancyIndex].AugerOriginatingShellId(augerIndex,transId); 150 } 178 } 151 return n; 179 return n; 152 } 180 } 153 181 154 //....oooOO0OOooo........oooOO0OOooo........oo << 155 << 156 G4int G4AugerData::StartShellId(G4int Z, G4int 182 G4int G4AugerData::StartShellId(G4int Z, G4int vacancyIndex, G4int transitionShellIndex) const 157 { 183 { 158 G4int n = 0; 184 G4int n = 0; 159 185 160 if (vacancyIndex<0 || vacancyIndex>=numberOf << 186 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 161 G4Exception("G4AugerData::VacancyId()","de << 187 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 162 return 0; << 163 } << 164 else { 188 else { 165 trans_Table::const_iterator element = auge 189 trans_Table::const_iterator element = augerTransitionTable.find(Z); 166 if (element == augerTransitionTable.end()) << 190 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 167 G4Exception("G4AugerData::VacancyId()"," << 168 return 0; << 169 } << 170 std::vector<G4AugerTransition> dataSet = ( 191 std::vector<G4AugerTransition> dataSet = (*element).second; 171 n = dataSet[vacancyIndex].TransitionOrigin << 192 n = dataSet[vacancyIndex].TransitionOriginatingShellId(transitionShellIndex); 172 } << 193 } 173 return n; << 194 >> 195 >> 196 return n; 174 } 197 } 175 198 176 //....oooOO0OOooo........oooOO0OOooo........oo << 177 << 178 G4double G4AugerData::StartShellEnergy(G4int Z 199 G4double G4AugerData::StartShellEnergy(G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const 179 { 200 { 180 G4double energy = 0; 201 G4double energy = 0; 181 202 182 if (vacancyIndex<0 || vacancyIndex>=numberOf 203 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 183 { << 204 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 184 G4Exception("G4AugerData::VacancyId()"," << 185 return 0; << 186 } << 187 else { 205 else { 188 trans_Table::const_iterator element = auge 206 trans_Table::const_iterator element = augerTransitionTable.find(Z); 189 if (element == augerTransitionTable.end()) << 207 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 190 G4Exception("G4AugerData::VacancyId()"," << 191 return 0; << 192 } << 193 std::vector<G4AugerTransition> dataSet = ( 208 std::vector<G4AugerTransition> dataSet = (*element).second; 194 energy = dataSet[vacancyIndex].AugerTransi 209 energy = dataSet[vacancyIndex].AugerTransitionEnergy(augerIndex,transitionId); 195 210 196 } 211 } 197 return energy; 212 return energy; 198 } 213 } 199 214 200 //....oooOO0OOooo........oooOO0OOooo........oo << 201 215 202 G4double G4AugerData::StartShellProb(G4int Z, 216 G4double G4AugerData::StartShellProb(G4int Z, G4int vacancyIndex,G4int transitionId,G4int augerIndex) const 203 { 217 { 204 G4double prob = 0; 218 G4double prob = 0; 205 219 206 if (vacancyIndex<0 || vacancyIndex>=numberOf << 220 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 207 { << 221 {G4Exception("G4AugerData::vacancyIndex outside boundaries");} 208 G4Exception("G4AugerData::VacancyId()"," << 209 return 0; << 210 } << 211 else { 222 else { 212 trans_Table::const_iterator element = auge 223 trans_Table::const_iterator element = augerTransitionTable.find(Z); 213 if (element == augerTransitionTable.end()) << 224 if (element == augerTransitionTable.end()) {G4Exception("G4AugerData::augerTransitionTable: Data not Loaded");} 214 G4Exception("G4AugerData::VacancyId()"," << 215 return 0; << 216 } << 217 std::vector<G4AugerTransition> dataSet = ( 225 std::vector<G4AugerTransition> dataSet = (*element).second; 218 prob = dataSet[vacancyIndex].AugerTransiti 226 prob = dataSet[vacancyIndex].AugerTransitionProbability(augerIndex, transitionId); >> 227 >> 228 >> 229 219 } 230 } 220 return prob; << 231 return prob; 221 } 232 } 222 233 223 //....oooOO0OOooo........oooOO0OOooo........oo << 224 << 225 std::vector<G4AugerTransition> G4AugerData::Lo 234 std::vector<G4AugerTransition> G4AugerData::LoadData(G4int Z) 226 { 235 { 227 // Build the complete string identifying the 236 // Build the complete string identifying the file with the data set >> 237 228 std::ostringstream ost; 238 std::ostringstream ost; 229 if(Z != 0){ 239 if(Z != 0){ 230 ost << "au-tr-pr-"<< Z << ".dat"; 240 ost << "au-tr-pr-"<< Z << ".dat"; 231 } 241 } 232 else{ 242 else{ 233 ost << "au-tr-pr-"<<".dat"; 243 ost << "au-tr-pr-"<<".dat"; 234 } 244 } 235 G4String name(ost.str()); 245 G4String name(ost.str()); 236 246 237 const char* path = G4FindDataDir("G4LEDATA") << 247 char* path = getenv("G4LEDATA"); 238 if (nullptr == path) << 248 if (!path) 239 { 249 { 240 G4String excep = "G4AugerData::LoadData" << 250 G4String excep = "G4EMDataSet - G4LEDATA environment variable not set"; 241 G4Exception(excep,"em0006", FatalExcepti << 251 G4Exception(excep); 242 std::vector<G4AugerTransition> a; << 243 return a; << 244 } 252 } 245 253 246 G4String pathString(path); 254 G4String pathString(path); 247 G4String dirFile = pathString + "/auger/" + 255 G4String dirFile = pathString + "/auger/" + name; 248 std::ifstream file(dirFile); 256 std::ifstream file(dirFile); 249 std::filebuf* lsdp = file.rdbuf(); 257 std::filebuf* lsdp = file.rdbuf(); 250 258 251 if (! (lsdp->is_open()) ) 259 if (! (lsdp->is_open()) ) 252 { 260 { 253 G4String excep = "G4AugerData::LoadData" << 261 G4String excep = "G4AugerData - data file: " + dirFile + " not found"; 254 G4String msg = "Missing" + dirFile; << 262 G4Exception(excep); 255 G4Exception(excep,"em0003", FatalExcepti << 256 } 263 } 257 264 >> 265 258 G4double a = 0; 266 G4double a = 0; 259 G4int k = 1; 267 G4int k = 1; 260 G4int sLocal = 0; << 268 G4int s = 0; 261 269 262 G4int vacId = 0; 270 G4int vacId = 0; 263 std::vector<G4int>* initIds = new std::vecto 271 std::vector<G4int>* initIds = new std::vector<G4int>; 264 std::vector<G4int>* newIds = new std::vector 272 std::vector<G4int>* newIds = new std::vector<G4int>; 265 G4DataVector* transEnergies = new G4DataVect 273 G4DataVector* transEnergies = new G4DataVector; 266 G4DataVector* transProbabilities = new G4Dat 274 G4DataVector* transProbabilities = new G4DataVector; 267 std::vector<G4AugerTransition> augerTransiti 275 std::vector<G4AugerTransition> augerTransitionVector; 268 std::map<G4int,std::vector<G4int>,std::less< 276 std::map<G4int,std::vector<G4int>,std::less<G4int> >* newIdMap = 269 new std::map<G4int,std::vector<G4int>,std: 277 new std::map<G4int,std::vector<G4int>,std::less<G4int> >; 270 std::map<G4int,G4DataVector,std::less<G4int> 278 std::map<G4int,G4DataVector,std::less<G4int> >* newEnergyMap = 271 new std::map<G4int,G4DataVector,std::less< 279 new std::map<G4int,G4DataVector,std::less<G4int> >; 272 std::map<G4int,G4DataVector,std::less<G4int> 280 std::map<G4int,G4DataVector,std::less<G4int> >* newProbabilityMap = 273 new std::map<G4int,G4DataVector,std::less< 281 new std::map<G4int,G4DataVector,std::less<G4int> >; >> 282 274 283 275 do { 284 do { 276 file >> a; 285 file >> a; >> 286 >> 287 277 G4int nColumns = 4; 288 G4int nColumns = 4; >> 289 278 if (a == -1) 290 if (a == -1) 279 { 291 { 280 if (sLocal == 0) << 292 >> 293 >> 294 >> 295 if (s == 0) 281 { 296 { 282 // End of a shell data set 297 // End of a shell data set 283 std::vector<G4int>::iterator vectorIndex << 284 298 >> 299 >> 300 >> 301 std::vector<G4int>::iterator vectorIndex = initIds->begin(); >> 302 285 vacId = *vectorIndex; 303 vacId = *vectorIndex; >> 304 >> 305 //initIds->erase(vectorIndex); >> 306 >> 307 >> 308 286 std::vector<G4int> identifiers; 309 std::vector<G4int> identifiers; 287 for (vectorIndex = initIds->begin()+1 ; 310 for (vectorIndex = initIds->begin()+1 ; vectorIndex != initIds->end(); ++vectorIndex){ 288 identifiers.push_back(*vectorIndex); << 311 >> 312 identifiers.push_back(*vectorIndex); 289 } 313 } >> 314 290 vectorIndex = (initIds->end())-1; 315 vectorIndex = (initIds->end())-1; >> 316 291 G4int augerShellId = *(vectorIndex); 317 G4int augerShellId = *(vectorIndex); 292 << 318 >> 319 293 (*newIdMap)[augerShellId] = *newIds; 320 (*newIdMap)[augerShellId] = *newIds; 294 (*newEnergyMap)[augerShellId] = *transEn 321 (*newEnergyMap)[augerShellId] = *transEnergies; 295 (*newProbabilityMap)[augerShellId] = *tr 322 (*newProbabilityMap)[augerShellId] = *transProbabilities; 296 << 323 297 augerTransitionVector.push_back(G4AugerT << 324 augerTransitionVector.push_back(G4AugerTransition(vacId, identifiers, newIdMap, newEnergyMap, newProbabilityMap)); 298 newIdMap, newEnergyMap, ne << 325 299 // Now deleting all the variables I used 326 // Now deleting all the variables I used, and creating new ones for the next shell >> 327 300 delete newIdMap; 328 delete newIdMap; 301 delete newEnergyMap; 329 delete newEnergyMap; 302 delete newProbabilityMap; 330 delete newProbabilityMap; 303 331 304 G4int n = (G4int)initIds->size(); << 332 G4int n = initIds->size(); 305 nInitShells.push_back(n); 333 nInitShells.push_back(n); 306 numberOfVacancies[Z]++; 334 numberOfVacancies[Z]++; 307 delete initIds; 335 delete initIds; 308 delete newIds; 336 delete newIds; 309 delete transEnergies; 337 delete transEnergies; 310 delete transProbabilities; 338 delete transProbabilities; 311 initIds = new std::vector<G4int>; 339 initIds = new std::vector<G4int>; 312 newIds = new std::vector<G4int>; 340 newIds = new std::vector<G4int>; 313 transEnergies = new G4DataVector; << 341 transEnergies = new G4DataVector; 314 transProbabilities = new G4DataVector; 342 transProbabilities = new G4DataVector; 315 newIdMap = << 343 newIdMap = new std::map<G4int,std::vector<G4int>,std::less<G4int> >; 316 new std::map<G4int,std::vector<G4int>, << 317 newEnergyMap = new std::map<G4int,G4Data 344 newEnergyMap = new std::map<G4int,G4DataVector,std::less<G4int> >; 318 newProbabilityMap = << 345 newProbabilityMap = new std::map<G4int,G4DataVector,std::less<G4int> >; 319 new std::map<G4int,G4DataVector,std::l << 346 >> 347 >> 348 320 } 349 } 321 ++sLocal; << 350 s++; 322 if (sLocal == nColumns) << 351 if (s == nColumns) 323 { 352 { 324 sLocal = 0; << 353 s = 0; 325 } 354 } 326 } 355 } >> 356 else if (a == -2) >> 357 { >> 358 // End of file; delete the empty vectors created >> 359 //when encountering the last -1 -1 row >> 360 delete initIds; >> 361 delete newIds; >> 362 delete transEnergies; >> 363 delete transProbabilities; >> 364 delete newIdMap ; >> 365 delete newEnergyMap; >> 366 delete newProbabilityMap; >> 367 } 327 else 368 else 328 { 369 { 329 370 330 if (k%nColumns == 3){ 371 if (k%nColumns == 3){ 331 // 3rd column is the transition probabilit 372 // 3rd column is the transition probabilities 332 transProbabilities->push_back(a); << 373 transProbabilities->push_back(a); 333 ++k; << 374 334 } << 375 k++;} 335 else if(k%nColumns == 2){ 376 else if(k%nColumns == 2){ 336 // 2nd column is new auger vacancy << 377 // 2nd column is new auger vacancy >> 378 >> 379 // 2nd column is new auger vacancy >> 380 337 G4int l = (G4int)a; 381 G4int l = (G4int)a; 338 newIds->push_back(l); 382 newIds->push_back(l); 339 ++k; << 383 340 } << 384 >> 385 k++; >> 386 } 341 else if (k%nColumns == 1) 387 else if (k%nColumns == 1) 342 { 388 { 343 // 1st column is shell id 389 // 1st column is shell id >> 390 344 if(initIds->size() == 0) { 391 if(initIds->size() == 0) { >> 392 345 // if this is the first data of the sh 393 // if this is the first data of the shell, all the colums are equal 346 // to the shell Id; so we skip the next co << 394 // to the shell Id; so we skip the next colums ang go to the next row >> 395 347 initIds->push_back((G4int)a); 396 initIds->push_back((G4int)a); 348 // first line of initIds is the origin 397 // first line of initIds is the original shell of the vacancy 349 file >> a; 398 file >> a; 350 file >> a; 399 file >> a; 351 file >> a; 400 file >> a; 352 k = k+3; 401 k = k+3; 353 } 402 } 354 else { << 403 else { >> 404 >> 405 // std::vector<G4int>::iterator vectorIndex = (initIds->end())-1; 355 if((G4int)a != initIds->back()){ 406 if((G4int)a != initIds->back()){ >> 407 >> 408 356 if((initIds->size()) == 1) { 409 if((initIds->size()) == 1) { 357 initIds->push_back((G4int)a); 410 initIds->push_back((G4int)a); 358 } 411 } 359 else { 412 else { 360 << 413 361 << 414 362 G4int augerShellId = 0; 415 G4int augerShellId = 0; 363 augerShellId = initIds->back(); 416 augerShellId = initIds->back(); 364 417 365 (*newIdMap)[augerShellId] = *newIds; 418 (*newIdMap)[augerShellId] = *newIds; 366 (*newEnergyMap)[augerShellId] = *transEn 419 (*newEnergyMap)[augerShellId] = *transEnergies; 367 (*newProbabilityMap)[augerShellId] = *tr 420 (*newProbabilityMap)[augerShellId] = *transProbabilities; 368 delete newIds; 421 delete newIds; 369 delete transEnergies; 422 delete transEnergies; 370 delete transProbabilities; 423 delete transProbabilities; 371 newIds = new std::vector<G4int>; 424 newIds = new std::vector<G4int>; 372 transEnergies = new G4DataVector; 425 transEnergies = new G4DataVector; 373 transProbabilities = new G4DataVector; 426 transProbabilities = new G4DataVector; 374 initIds->push_back((G4int)a); 427 initIds->push_back((G4int)a); 375 } 428 } 376 } 429 } 377 } 430 } >> 431 378 k++; 432 k++; >> 433 379 } 434 } 380 else if (k%nColumns == 0) 435 else if (k%nColumns == 0) >> 436 381 {//fourth column is transition energies 437 {//fourth column is transition energies 382 G4double e = a * MeV; 438 G4double e = a * MeV; >> 439 383 transEnergies->push_back(e); 440 transEnergies->push_back(e); 384 k=1; 441 k=1; >> 442 385 } 443 } 386 } 444 } 387 } 445 } >> 446 >> 447 388 while (a != -2); // end of file 448 while (a != -2); // end of file 389 file.close(); 449 file.close(); 390 delete initIds; << 450 return augerTransitionVector; 391 delete newIds; << 392 delete transEnergies; << 393 delete transProbabilities; << 394 delete newIdMap ; << 395 delete newEnergyMap; << 396 delete newProbabilityMap; << 397 return augerTransitionVector; << 398 } 451 } 399 452 400 //....oooOO0OOooo........oooOO0OOooo........oo << 401 << 402 void G4AugerData::BuildAugerTransitionTable() 453 void G4AugerData::BuildAugerTransitionTable() 403 { 454 { 404 for (G4int element = 6; element < 105; ++ele << 455 405 augerTransitionTable.insert(trans_Table::v << 456 // trans_Table::iterator pos = augerTransitionTable.begin(); >> 457 >> 458 const G4MaterialTable* materialTable = G4Material::GetMaterialTable(); >> 459 >> 460 G4int nMaterials = G4Material::GetNumberOfMaterials(); >> 461 >> 462 G4DataVector activeZ; >> 463 activeZ.clear(); >> 464 >> 465 for (G4int m=0; m<nMaterials; m++) { >> 466 >> 467 const G4Material* material= (*materialTable)[m]; >> 468 const G4ElementVector* elementVector = material->GetElementVector(); >> 469 const size_t nElements = material->GetNumberOfElements(); >> 470 >> 471 for (size_t iEl=0; iEl<nElements; iEl++) { >> 472 G4Element* element = (*elementVector)[iEl]; >> 473 G4double Z = element->GetZ(); >> 474 if (!(activeZ.contains(Z))) { >> 475 activeZ.push_back(Z); >> 476 } >> 477 } 406 } 478 } 407 } << 408 479 409 //....oooOO0OOooo........oooOO0OOooo........oo << 480 >> 481 for (G4int element = 6; element < 99; element++) >> 482 { >> 483 if(nMaterials == 0 || activeZ.contains(element)) { >> 484 augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element))); >> 485 >> 486 G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; >> 487 // PrintData(element); >> 488 } >> 489 } >> 490 >> 491 G4cout << "AugerTransitionTable complete"<< G4endl; >> 492 } 410 493 411 void G4AugerData::PrintData(G4int Z) 494 void G4AugerData::PrintData(G4int Z) 412 { 495 { 413 for (G4int i = 0; i < numberOfVacancies[Z]; << 496 >> 497 for (G4int i = 0; i < numberOfVacancies[Z]; i++) 414 { 498 { 415 G4cout << "---- TransitionData for the v 499 G4cout << "---- TransitionData for the vacancy nb " 416 <<i 500 <<i 417 <<" of the atomic number elemnt " 501 <<" of the atomic number elemnt " 418 << Z 502 << Z 419 <<"----- " 503 <<"----- " 420 <<G4endl; 504 <<G4endl; 421 505 422 for (G4int k = 0; k<=(G4int)NumberOfTran << 506 for (size_t k = 0; k<=NumberOfTransitions(Z,i); k++) 423 { 507 { 424 G4int id = StartShellId(Z,i,k); 508 G4int id = StartShellId(Z,i,k); 425 509 426 for (G4int a = 0; a <= (G4int)NumberOfAuge << 510 for (size_t a = 0; a <= NumberOfAuger(Z,i,id); a++) { 427 G4double e = StartShellEnergy(Z,i,id,a)/ << 511 >> 512 G4double e = StartShellEnergy(Z,i,id,a) /MeV; 428 G4double p = StartShellProb(Z,i,id,a); 513 G4double p = StartShellProb(Z,i,id,a); 429 std::size_t augerId = AugerShellId(Z, i, << 514 G4int augerId = AugerShellId(Z, i, id, a); 430 G4cout << k <<") Shell id: " << id <<G4e 515 G4cout << k <<") Shell id: " << id <<G4endl; 431 G4cout << " Auger Originatig Shell Id 516 G4cout << " Auger Originatig Shell Id :"<< augerId <<G4endl; 432 G4cout << " - Transition energy = " << e 517 G4cout << " - Transition energy = " << e << " MeV "<<G4endl; 433 G4cout << " - Transition probability = " << 518 G4cout << " - Transition probability = " << p <<G4endl; 434 } 519 } 435 } 520 } 436 G4cout << "----------------------------- 521 G4cout << "-------------------------------------------------" 437 << G4endl; 522 << G4endl; 438 } 523 } 439 } 524 } >> 525 G4AugerTransition* G4AugerData::GetAugerTransition(G4int Z,G4int vacancyShellIndex) >> 526 { >> 527 std::vector<G4AugerTransition>* dataSet = &augerTransitionTable[Z]; >> 528 std::vector<G4AugerTransition>::iterator vectorIndex = dataSet->begin() + vacancyShellIndex; 440 529 441 //....oooOO0OOooo........oooOO0OOooo........oo << 530 G4AugerTransition* augerTransition = &(*vectorIndex); 442 << 531 return augerTransition; 443 G4AugerTransition* << 532 } 444 G4AugerData::GetAugerTransition(G4int Z, G4int << 445 { << 446 std::vector<G4AugerTransition>* dataSet = &a << 447 std::vector<G4AugerTransition>::iterator vec << 448 dataSet->begin() + vacancyShellIndex; << 449 533 450 G4AugerTransition* augerTransition = &(*vect << 451 return augerTransition; << 452 } << 453 << 454 //....oooOO0OOooo........oooOO0OOooo........oo << 455 << 456 std::vector<G4AugerTransition>* G4AugerData::G 534 std::vector<G4AugerTransition>* G4AugerData::GetAugerTransitions(G4int Z) 457 { << 535 { 458 std::vector<G4AugerTransition>* dataSet = &a << 536 std::vector<G4AugerTransition>* dataSet = &augerTransitionTable[Z]; 459 return dataSet; << 537 return dataSet; 460 } << 538 } 461 << 539 462 540 463 541 464 542 465 543 466 544 467 545 468 546 469 547 470 548 471 549 472 550 473 551 474 552 475 553 476 554 477 555 478 556 479 557 480 558 481 559 482 560