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; 57 68 58 std::size_t G4AugerData::NumberOfVacancies(G4i << 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 } >> 110 >> 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 228 std::ostringstream ost; << 237 229 if(Z != 0){ << 238 std::ostringstream ost; 230 ost << "au-tr-pr-"<< Z << ".dat"; << 239 if(Z != 0){ 231 } << 240 ost << "au-tr-pr-"<< Z << ".dat"; 232 else{ << 233 ost << "au-tr-pr-"<<".dat"; << 234 } << 235 G4String name(ost.str()); << 236 << 237 const char* path = G4FindDataDir("G4LEDATA") << 238 if (nullptr == path) << 239 { << 240 G4String excep = "G4AugerData::LoadData" << 241 G4Exception(excep,"em0006", FatalExcepti << 242 std::vector<G4AugerTransition> a; << 243 return a; << 244 } 241 } >> 242 else{ >> 243 ost << "au-tr-pr-"<<".dat"; >> 244 } >> 245 G4String name(ost.str()); 245 246 246 G4String pathString(path); << 247 char* path = getenv("G4LEDATA"); 247 G4String dirFile = pathString + "/auger/" + << 248 if (!path) 248 std::ifstream file(dirFile); << 249 { 249 std::filebuf* lsdp = file.rdbuf(); << 250 G4String excep = "G4EMDataSet - G4LEDATA environment variable not set"; >> 251 G4Exception(excep); >> 252 } 250 253 251 if (! (lsdp->is_open()) ) << 254 G4String pathString(path); 252 { << 255 G4String dirFile = pathString + "/auger/" + name; 253 G4String excep = "G4AugerData::LoadData" << 256 std::ifstream file(dirFile); 254 G4String msg = "Missing" + dirFile; << 257 std::filebuf* lsdp = file.rdbuf(); 255 G4Exception(excep,"em0003", FatalExcepti << 258 256 } << 259 if (! (lsdp->is_open()) ) 257 << 258 G4double a = 0; << 259 G4int k = 1; << 260 G4int sLocal = 0; << 261 << 262 G4int vacId = 0; << 263 std::vector<G4int>* initIds = new std::vecto << 264 std::vector<G4int>* newIds = new std::vector << 265 G4DataVector* transEnergies = new G4DataVect << 266 G4DataVector* transProbabilities = new G4Dat << 267 std::vector<G4AugerTransition> augerTransiti << 268 std::map<G4int,std::vector<G4int>,std::less< << 269 new std::map<G4int,std::vector<G4int>,std: << 270 std::map<G4int,G4DataVector,std::less<G4int> << 271 new std::map<G4int,G4DataVector,std::less< << 272 std::map<G4int,G4DataVector,std::less<G4int> << 273 new std::map<G4int,G4DataVector,std::less< << 274 << 275 do { << 276 file >> a; << 277 G4int nColumns = 4; << 278 if (a == -1) << 279 { 260 { 280 if (sLocal == 0) << 261 G4String excep = "G4AugerData - data file: " + dirFile + " not found"; 281 { << 262 G4Exception(excep); 282 // End of a shell data set << 263 } 283 std::vector<G4int>::iterator vectorIndex << 264 284 << 265 285 vacId = *vectorIndex; << 266 G4double a = 0; 286 std::vector<G4int> identifiers; << 267 G4int k = 1; 287 for (vectorIndex = initIds->begin()+1 ; << 268 G4int s = 0; >> 269 >> 270 G4int vacId = 0; >> 271 std::vector<G4int>* initIds = new std::vector<G4int>; >> 272 std::vector<G4int>* newIds = new std::vector<G4int>; >> 273 G4DataVector* transEnergies = new G4DataVector; >> 274 G4DataVector* transProbabilities = new G4DataVector; >> 275 std::vector<G4AugerTransition> augerTransitionVector; >> 276 std::map<G4int,std::vector<G4int>,std::less<G4int> >* newIdMap = >> 277 new std::map<G4int,std::vector<G4int>,std::less<G4int> >; >> 278 std::map<G4int,G4DataVector,std::less<G4int> >* newEnergyMap = >> 279 new std::map<G4int,G4DataVector,std::less<G4int> >; >> 280 std::map<G4int,G4DataVector,std::less<G4int> >* newProbabilityMap = >> 281 new std::map<G4int,G4DataVector,std::less<G4int> >; >> 282 >> 283 >> 284 do { >> 285 file >> a; >> 286 >> 287 >> 288 G4int nColumns = 4; >> 289 >> 290 if (a == -1) >> 291 { >> 292 >> 293 >> 294 >> 295 if (s == 0) >> 296 { >> 297 // End of a shell data set >> 298 >> 299 >> 300 >> 301 std::vector<G4int>::iterator vectorIndex = initIds->begin(); >> 302 >> 303 vacId = *vectorIndex; >> 304 >> 305 //initIds->erase(vectorIndex); >> 306 >> 307 >> 308 >> 309 std::vector<G4int> identifiers; >> 310 for (vectorIndex = initIds->begin()+1 ; vectorIndex != initIds->end(); ++vectorIndex){ >> 311 288 identifiers.push_back(*vectorIndex); 312 identifiers.push_back(*vectorIndex); >> 313 } >> 314 >> 315 vectorIndex = (initIds->end())-1; >> 316 >> 317 G4int augerShellId = *(vectorIndex); >> 318 >> 319 >> 320 (*newIdMap)[augerShellId] = *newIds; >> 321 (*newEnergyMap)[augerShellId] = *transEnergies; >> 322 (*newProbabilityMap)[augerShellId] = *transProbabilities; >> 323 >> 324 augerTransitionVector.push_back(G4AugerTransition(vacId, identifiers, newIdMap, newEnergyMap, newProbabilityMap)); >> 325 >> 326 // Now deleting all the variables I used, and creating new ones for the next shell >> 327 >> 328 delete newIdMap; >> 329 delete newEnergyMap; >> 330 delete newProbabilityMap; >> 331 >> 332 G4int n = initIds->size(); >> 333 nInitShells.push_back(n); >> 334 numberOfVacancies[Z]++; >> 335 delete initIds; >> 336 delete newIds; >> 337 delete transEnergies; >> 338 delete transProbabilities; >> 339 initIds = new std::vector<G4int>; >> 340 newIds = new std::vector<G4int>; >> 341 transEnergies = new G4DataVector; >> 342 transProbabilities = new G4DataVector; >> 343 newIdMap = new std::map<G4int,std::vector<G4int>,std::less<G4int> >; >> 344 newEnergyMap = new std::map<G4int,G4DataVector,std::less<G4int> >; >> 345 newProbabilityMap = new std::map<G4int,G4DataVector,std::less<G4int> >; >> 346 >> 347 >> 348 >> 349 } >> 350 s++; >> 351 if (s == nColumns) >> 352 { >> 353 s = 0; 289 } 354 } 290 vectorIndex = (initIds->end())-1; << 291 G4int augerShellId = *(vectorIndex); << 292 << 293 (*newIdMap)[augerShellId] = *newIds; << 294 (*newEnergyMap)[augerShellId] = *transEn << 295 (*newProbabilityMap)[augerShellId] = *tr << 296 << 297 augerTransitionVector.push_back(G4AugerT << 298 newIdMap, newEnergyMap, ne << 299 // Now deleting all the variables I used << 300 delete newIdMap; << 301 delete newEnergyMap; << 302 delete newProbabilityMap; << 303 << 304 G4int n = (G4int)initIds->size(); << 305 nInitShells.push_back(n); << 306 numberOfVacancies[Z]++; << 307 delete initIds; << 308 delete newIds; << 309 delete transEnergies; << 310 delete transProbabilities; << 311 initIds = new std::vector<G4int>; << 312 newIds = new std::vector<G4int>; << 313 transEnergies = new G4DataVector; << 314 transProbabilities = new G4DataVector; << 315 newIdMap = << 316 new std::map<G4int,std::vector<G4int>, << 317 newEnergyMap = new std::map<G4int,G4Data << 318 newProbabilityMap = << 319 new std::map<G4int,G4DataVector,std::l << 320 } << 321 ++sLocal; << 322 if (sLocal == nColumns) << 323 { << 324 sLocal = 0; << 325 } << 326 } << 327 else << 328 { << 329 << 330 if (k%nColumns == 3){ << 331 // 3rd column is the transition probabilit << 332 transProbabilities->push_back(a); << 333 ++k; << 334 } 355 } 335 else if(k%nColumns == 2){ << 356 else if (a == -2) 336 // 2nd column is new auger vacancy << 357 { 337 G4int l = (G4int)a; << 358 // End of file; delete the empty vectors created 338 newIds->push_back(l); << 359 //when encountering the last -1 -1 row 339 ++k; << 360 delete initIds; 340 } << 361 delete newIds; 341 else if (k%nColumns == 1) << 362 delete transEnergies; 342 { << 363 delete transProbabilities; 343 // 1st column is shell id << 364 delete newIdMap ; 344 if(initIds->size() == 0) { << 365 delete newEnergyMap; 345 // if this is the first data of the sh << 366 delete newProbabilityMap; >> 367 } >> 368 else >> 369 { >> 370 >> 371 if (k%nColumns == 3){ >> 372 // 3rd column is the transition probabilities >> 373 transProbabilities->push_back(a); >> 374 >> 375 k++;} >> 376 else if(k%nColumns == 2){ >> 377 // 2nd column is new auger vacancy >> 378 >> 379 // 2nd column is new auger vacancy >> 380 >> 381 G4int l = (G4int)a; >> 382 newIds->push_back(l); >> 383 >> 384 >> 385 k++; >> 386 } >> 387 else if (k%nColumns == 1) >> 388 { >> 389 // 1st column is shell id >> 390 >> 391 if(initIds->size() == 0) { >> 392 >> 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 347 initIds->push_back((G4int)a); << 395 348 // first line of initIds is the origin << 396 initIds->push_back((G4int)a); 349 file >> a; << 397 // first line of initIds is the original shell of the vacancy 350 file >> a; << 398 file >> a; 351 file >> a; << 399 file >> a; 352 k = k+3; << 400 file >> a; 353 } << 401 k = k+3; 354 else { << 402 } 355 if((G4int)a != initIds->back()){ << 403 else { 356 if((initIds->size()) == 1) { << 404 357 initIds->push_back((G4int)a); << 405 // std::vector<G4int>::iterator vectorIndex = (initIds->end())-1; 358 } << 406 if((G4int)a != initIds->back()){ 359 else { << 407 360 << 408 361 << 409 if((initIds->size()) == 1) { 362 G4int augerShellId = 0; << 410 initIds->push_back((G4int)a); 363 augerShellId = initIds->back(); << 411 } >> 412 else { >> 413 >> 414 >> 415 G4int augerShellId = 0; >> 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); >> 428 } 375 } 429 } 376 } 430 } >> 431 >> 432 k++; >> 433 377 } 434 } 378 k++; << 435 else if (k%nColumns == 0) 379 } << 436 380 else if (k%nColumns == 0) << 437 {//fourth column is transition energies 381 {//fourth column is transition energies << 438 G4double e = a * MeV; 382 G4double e = a * MeV; << 439 383 transEnergies->push_back(e); << 440 transEnergies->push_back(e); 384 k=1; << 441 k=1; 385 } << 386 } << 387 } << 388 while (a != -2); // end of file << 389 file.close(); << 390 delete initIds; << 391 delete newIds; << 392 delete transEnergies; << 393 delete transProbabilities; << 394 delete newIdMap ; << 395 delete newEnergyMap; << 396 delete newProbabilityMap; << 397 return augerTransitionVector; << 398 } << 399 442 400 //....oooOO0OOooo........oooOO0OOooo........oo << 443 } >> 444 } >> 445 } >> 446 >> 447 >> 448 while (a != -2); // end of file >> 449 file.close(); >> 450 return augerTransitionVector; >> 451 >> 452 } 401 453 402 void G4AugerData::BuildAugerTransitionTable() 454 void G4AugerData::BuildAugerTransitionTable() 403 { 455 { 404 for (G4int element = 6; element < 105; ++ele << 456 405 augerTransitionTable.insert(trans_Table::v << 457 // trans_Table::iterator pos = augerTransitionTable.begin(); >> 458 >> 459 const G4MaterialTable* materialTable = G4Material::GetMaterialTable(); >> 460 >> 461 G4int nMaterials = G4Material::GetNumberOfMaterials(); >> 462 >> 463 G4DataVector activeZ; >> 464 activeZ.clear(); >> 465 >> 466 for (G4int m=0; m<nMaterials; m++) { >> 467 >> 468 const G4Material* material= (*materialTable)[m]; >> 469 const G4ElementVector* elementVector = material->GetElementVector(); >> 470 const size_t nElements = material->GetNumberOfElements(); >> 471 >> 472 for (size_t iEl=0; iEl<nElements; iEl++) { >> 473 G4Element* element = (*elementVector)[iEl]; >> 474 G4double Z = element->GetZ(); >> 475 if (!(activeZ.contains(Z))) { >> 476 activeZ.push_back(Z); >> 477 } >> 478 } 406 } 479 } 407 } << 408 480 409 //....oooOO0OOooo........oooOO0OOooo........oo << 481 >> 482 for (G4int element = 6; element < 99; element++) >> 483 { >> 484 if(nMaterials == 0 || activeZ.contains(element)) { >> 485 augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element))); >> 486 >> 487 G4cout << "G4AugerData for Element no. " << element << " are loaded" << G4endl; >> 488 // PrintData(element); >> 489 } >> 490 } >> 491 >> 492 G4cout << "AugerTransitionTable complete"<< G4endl; >> 493 } 410 494 411 void G4AugerData::PrintData(G4int Z) 495 void G4AugerData::PrintData(G4int Z) 412 { 496 { 413 for (G4int i = 0; i < numberOfVacancies[Z]; << 497 >> 498 for (G4int i = 0; i < numberOfVacancies[Z]; i++) 414 { 499 { 415 G4cout << "---- TransitionData for the v 500 G4cout << "---- TransitionData for the vacancy nb " 416 <<i 501 <<i 417 <<" of the atomic number elemnt " 502 <<" of the atomic number elemnt " 418 << Z 503 << Z 419 <<"----- " 504 <<"----- " 420 <<G4endl; 505 <<G4endl; 421 506 422 for (G4int k = 0; k<=(G4int)NumberOfTran << 507 for (size_t k = 0; k<=NumberOfTransitions(Z,i); k++) 423 { 508 { 424 G4int id = StartShellId(Z,i,k); 509 G4int id = StartShellId(Z,i,k); 425 510 426 for (G4int a = 0; a <= (G4int)NumberOfAuge << 511 for (size_t a = 0; a <= NumberOfAuger(Z,i,id); a++) { 427 G4double e = StartShellEnergy(Z,i,id,a)/ << 512 >> 513 G4double e = StartShellEnergy(Z,i,id,a) /MeV; 428 G4double p = StartShellProb(Z,i,id,a); 514 G4double p = StartShellProb(Z,i,id,a); 429 std::size_t augerId = AugerShellId(Z, i, << 515 G4int augerId = AugerShellId(Z, i, id, a); 430 G4cout << k <<") Shell id: " << id <<G4e 516 G4cout << k <<") Shell id: " << id <<G4endl; 431 G4cout << " Auger Originatig Shell Id 517 G4cout << " Auger Originatig Shell Id :"<< augerId <<G4endl; 432 G4cout << " - Transition energy = " << e 518 G4cout << " - Transition energy = " << e << " MeV "<<G4endl; 433 G4cout << " - Transition probability = " << 519 G4cout << " - Transition probability = " << p <<G4endl; 434 } 520 } 435 } 521 } 436 G4cout << "----------------------------- 522 G4cout << "-------------------------------------------------" 437 << G4endl; 523 << G4endl; 438 } 524 } 439 } 525 } >> 526 G4AugerTransition* G4AugerData::GetAugerTransition(G4int Z,G4int vacancyShellIndex) >> 527 { >> 528 std::vector<G4AugerTransition>* dataSet = &augerTransitionTable[Z]; >> 529 std::vector<G4AugerTransition>::iterator vectorIndex = dataSet->begin() + vacancyShellIndex; 440 530 441 //....oooOO0OOooo........oooOO0OOooo........oo << 531 G4AugerTransition* augerTransition = &(*vectorIndex); 442 << 532 return augerTransition; 443 G4AugerTransition* << 533 } 444 G4AugerData::GetAugerTransition(G4int Z, G4int << 445 { << 446 std::vector<G4AugerTransition>* dataSet = &a << 447 std::vector<G4AugerTransition>::iterator vec << 448 dataSet->begin() + vacancyShellIndex; << 449 534 450 G4AugerTransition* augerTransition = &(*vect << 451 return augerTransition; << 452 } << 453 << 454 //....oooOO0OOooo........oooOO0OOooo........oo << 455 << 456 std::vector<G4AugerTransition>* G4AugerData::G 535 std::vector<G4AugerTransition>* G4AugerData::GetAugerTransitions(G4int Z) 457 { << 536 { 458 std::vector<G4AugerTransition>* dataSet = &a << 537 std::vector<G4AugerTransition>* dataSet = &augerTransitionTable[Z]; 459 return dataSet; << 538 return dataSet; 460 } << 539 } 461 << 540 462 541 463 542 464 543 465 544 466 545 467 546 468 547 469 548 470 549 471 550 472 551 473 552 474 553 475 554 476 555 477 556 478 557 479 558 480 559 481 560 482 561