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 // 27 // 28 // 28 // 29 // Author: Alfonso Mmantero (Alfonso.Mantero@g 29 // Author: Alfonso Mmantero (Alfonso.Mantero@ge.infn.it) 30 // 30 // 31 // History: 31 // History: 32 // ----------- 32 // ----------- 33 // Based on G4RDFluoData by Elena Guardincerri 33 // Based on G4RDFluoData by Elena Guardincerri 34 // 34 // 35 // Modified: 30.07.02 VI Add select active Z + 35 // Modified: 30.07.02 VI Add select active Z + clean up against pedantic compiler 36 // 36 // 37 // ------------------------------------------- 37 // ------------------------------------------------------------------- 38 38 39 #include <fstream> 39 #include <fstream> 40 #include <sstream> 40 #include <sstream> 41 41 42 #include "G4RDAugerData.hh" 42 #include "G4RDAugerData.hh" 43 #include "G4PhysicalConstants.hh" 43 #include "G4PhysicalConstants.hh" 44 #include "G4SystemOfUnits.hh" 44 #include "G4SystemOfUnits.hh" 45 #include "G4DataVector.hh" 45 #include "G4DataVector.hh" 46 #include "G4Material.hh" 46 #include "G4Material.hh" 47 #include "G4Element.hh" 47 #include "G4Element.hh" 48 #include "G4ElementVector.hh" 48 #include "G4ElementVector.hh" 49 49 50 G4RDAugerData::G4RDAugerData() 50 G4RDAugerData::G4RDAugerData() 51 { 51 { 52 52 53 G4int n = 0; 53 G4int n = 0; 54 G4int pos = 0; 54 G4int pos = 0; 55 55 56 for (pos = 0 ; pos < 100; pos++) 56 for (pos = 0 ; pos < 100; pos++) 57 { 57 { 58 numberOfVacancies.push_back(n); 58 numberOfVacancies.push_back(n); 59 } 59 } 60 60 61 BuildAugerTransitionTable(); 61 BuildAugerTransitionTable(); 62 62 63 63 64 } 64 } 65 65 66 G4RDAugerData::~G4RDAugerData() 66 G4RDAugerData::~G4RDAugerData() 67 { 67 { 68 /* 68 /* 69 std::map<G4int,std::vector<G4RDAugerTransiti 69 std::map<G4int,std::vector<G4RDAugerTransition>,std::less<G4int> >::iterator pos; 70 70 71 for (pos = augerTransitionTable.begin(); pos 71 for (pos = augerTransitionTable.begin(); pos != augerTransitionTable.end(); pos++) 72 { 72 { 73 std::vector<G4RDAugerTransition> dataSet 73 std::vector<G4RDAugerTransition> dataSet = (*pos).second; 74 delete dataSet; 74 delete dataSet; 75 } 75 } 76 for (pos = energyMap.begin(); pos != energyM 76 for (pos = energyMap.begin(); pos != energyMap.end(); pos++) 77 { 77 { 78 std::map<G4Int,G4DataVector*,std::less<G 78 std::map<G4Int,G4DataVector*,std::less<G4int>>* dataMap = (*pos).second; 79 for (pos2 = newIdProbabilityMap.begin(); 79 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++) 80 { 80 { 81 G4DataVector* dataSet = (*pos2).second; 81 G4DataVector* dataSet = (*pos2).second; 82 delete dataSet; 82 delete dataSet; 83 } 83 } 84 } 84 } 85 for (pos = probabilityMap.begin(); pos != pr 85 for (pos = probabilityMap.begin(); pos != probabilityMap.end(); pos++) 86 { 86 { 87 std::map<G4Int,G4DataVector*,std::less<G 87 std::map<G4Int,G4DataVector*,std::less<G4int>>* dataMap = (*pos).second; 88 for (pos2 = newIdProbabilityMap.begin(); 88 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++) 89 { 89 { 90 G4DataVector* dataSet = (*pos2).second; 90 G4DataVector* dataSet = (*pos2).second; 91 delete dataSet; 91 delete dataSet; 92 } 92 } 93 } 93 } 94 for (pos2 = newIdMap.begin(); pos2 != idMap. 94 for (pos2 = newIdMap.begin(); pos2 != idMap.end(); pos2++) 95 { 95 { 96 G4DataVector* dataSet = (*pos2).second; 96 G4DataVector* dataSet = (*pos2).second; 97 delete dataSet; 97 delete dataSet; 98 } 98 } 99 for (pos2 = newIdEnergyMap.begin(); pos2 != 99 for (pos2 = newIdEnergyMap.begin(); pos2 != idMap.end(); pos2++) 100 { 100 { 101 G4DataVector* dataSet = (*pos2).second; 101 G4DataVector* dataSet = (*pos2).second; 102 delete dataSet; 102 delete dataSet; 103 } 103 } 104 for (pos2 = newIdProbabilityMap.begin(); pos 104 for (pos2 = newIdProbabilityMap.begin(); pos2 != idMap.end(); pos2++) 105 { 105 { 106 G4DataVector* dataSet = (*pos2).second; 106 G4DataVector* dataSet = (*pos2).second; 107 delete dataSet; 107 delete dataSet; 108 } 108 } 109 */ 109 */ 110 110 111 } 111 } 112 112 113 size_t G4RDAugerData::NumberOfVacancies(G4int 113 size_t G4RDAugerData::NumberOfVacancies(G4int Z) const 114 { 114 { 115 return numberOfVacancies[Z]; 115 return numberOfVacancies[Z]; 116 } 116 } 117 117 118 G4int G4RDAugerData::VacancyId(G4int Z, G4int 118 G4int G4RDAugerData::VacancyId(G4int Z, G4int vacancyIndex) const 119 { 119 { 120 120 121 G4int n = 0; 121 G4int n = 0; 122 if (vacancyIndex<0 || vacancyIndex>=numberOf 122 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 123 {G4Exception("G4RDAugerData::VacancyId()", 123 {G4Exception("G4RDAugerData::VacancyId()", "OutOfRange", 124 FatalException, "VacancyIndex 124 FatalException, "VacancyIndex outside boundaries!");} 125 else { 125 else { 126 trans_Table::const_iterator element = auge 126 trans_Table::const_iterator element = augerTransitionTable.find(Z); 127 if (element == augerTransitionTable.end()) 127 if (element == augerTransitionTable.end()) 128 {G4Exception("G4RDAugerData::VacancyId() 128 {G4Exception("G4RDAugerData::VacancyId()", "NoDataFound", 129 FatalException, "Data not l 129 FatalException, "Data not loaded!");} 130 std::vector<G4RDAugerTransition> dataSet = 130 std::vector<G4RDAugerTransition> dataSet = (*element).second; 131 n = (G4int) dataSet[vacancyIndex].FinalShe 131 n = (G4int) dataSet[vacancyIndex].FinalShellId(); 132 } 132 } 133 133 134 return n; 134 return n; 135 } 135 } 136 136 137 137 138 138 139 // Attenzione: questa funzione vuole l'indice 139 // Attenzione: questa funzione vuole l'indice della vacanza, non l'Id 140 140 141 141 142 size_t G4RDAugerData::NumberOfTransitions(G4in 142 size_t G4RDAugerData::NumberOfTransitions(G4int Z, G4int vacancyIndex) const 143 { 143 { 144 G4int n = 0; 144 G4int n = 0; 145 if (vacancyIndex<0 || vacancyIndex>=numberOf 145 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 146 {G4Exception("G4RDAugerData::NumberOfTrans 146 {G4Exception("G4RDAugerData::NumberOfTransitions()", "OutOfRange", 147 FatalException, "VacancyIndex 147 FatalException, "VacancyIndex outside boundaries!");} 148 else { 148 else { 149 trans_Table::const_iterator element = auge 149 trans_Table::const_iterator element = augerTransitionTable.find(Z); 150 if (element == augerTransitionTable.end()) 150 if (element == augerTransitionTable.end()) 151 {G4Exception("G4RDAugerData::NumberOfTra 151 {G4Exception("G4RDAugerData::NumberOfTransitions()", "NoDataFound", 152 FatalException, "Data not l 152 FatalException, "Data not loaded!");} 153 std::vector<G4RDAugerTransition> dataSet = 153 std::vector<G4RDAugerTransition> dataSet = (*element).second; 154 n = (G4int)dataSet[vacancyIndex].Transitio 154 n = (G4int)dataSet[vacancyIndex].TransitionOriginatingShellIds()->size(); 155 } 155 } 156 return n; 156 return n; 157 } 157 } 158 158 159 159 160 160 161 size_t G4RDAugerData::NumberOfAuger(G4int Z, G 161 size_t G4RDAugerData::NumberOfAuger(G4int Z, G4int initIndex, G4int vacancyId) const 162 { 162 { 163 size_t n = 0; 163 size_t n = 0; 164 if (initIndex<0 || initIndex>=numberOfVacanc 164 if (initIndex<0 || initIndex>=numberOfVacancies[Z]) 165 {G4Exception("G4RDAugerData::NumberOfAuger 165 {G4Exception("G4RDAugerData::NumberOfAuger()", "OutOfRange", 166 FatalException, "VacancyIndex 166 FatalException, "VacancyIndex outside boundaries!");} 167 else { 167 else { 168 trans_Table::const_iterator element = auge 168 trans_Table::const_iterator element = augerTransitionTable.find(Z); 169 if (element == augerTransitionTable.end()) 169 if (element == augerTransitionTable.end()) 170 {G4Exception("G4RDAugerData::NumberOfAug 170 {G4Exception("G4RDAugerData::NumberOfAuger()", "NoDataFound", 171 FatalException, "Data not l 171 FatalException, "Data not loaded!");} 172 std::vector<G4RDAugerTransition> dataSet = 172 std::vector<G4RDAugerTransition> dataSet = (*element).second; 173 const std::vector<G4int>* temp = dataSet[ 173 const std::vector<G4int>* temp = dataSet[initIndex].AugerOriginatingShellIds(vacancyId); 174 n = temp->size(); 174 n = temp->size(); 175 } 175 } 176 return n; 176 return n; 177 } 177 } 178 178 179 size_t G4RDAugerData::AugerShellId(G4int Z, G4 179 size_t G4RDAugerData::AugerShellId(G4int Z, G4int vacancyIndex, G4int transId, G4int augerIndex) const 180 { 180 { 181 size_t n = 0; 181 size_t n = 0; 182 if (vacancyIndex<0 || vacancyIndex>=numberOf 182 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 183 {G4Exception("G4RDAugerData::AugerShellId( 183 {G4Exception("G4RDAugerData::AugerShellId()", "OutOfRange", 184 FatalException, "VacancyIndex 184 FatalException, "VacancyIndex outside boundaries!");} 185 else { 185 else { 186 trans_Table::const_iterator element = auge 186 trans_Table::const_iterator element = augerTransitionTable.find(Z); 187 if (element == augerTransitionTable.end()) 187 if (element == augerTransitionTable.end()) 188 {G4Exception("G4RDAugerData::AugerShellI 188 {G4Exception("G4RDAugerData::AugerShellId()", "NoDataFound", 189 FatalException, "Data not l 189 FatalException, "Data not loaded!");} 190 std::vector<G4RDAugerTransition> dataSet = 190 std::vector<G4RDAugerTransition> dataSet = (*element).second; 191 n = dataSet[vacancyIndex].AugerOriginating 191 n = dataSet[vacancyIndex].AugerOriginatingShellId(augerIndex,transId); 192 } 192 } 193 return n; 193 return n; 194 } 194 } 195 195 196 G4int G4RDAugerData::StartShellId(G4int Z, G4i 196 G4int G4RDAugerData::StartShellId(G4int Z, G4int vacancyIndex, G4int transitionShellIndex) const 197 { 197 { 198 G4int n = 0; 198 G4int n = 0; 199 199 200 if (vacancyIndex<0 || vacancyIndex>=numberOf 200 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 201 {G4Exception("G4RDAugerData::StartShellId( 201 {G4Exception("G4RDAugerData::StartShellId()", "OutOfRange", 202 FatalException, "VacancyIndex 202 FatalException, "VacancyIndex outside boundaries!");} 203 else { 203 else { 204 trans_Table::const_iterator element = auge 204 trans_Table::const_iterator element = augerTransitionTable.find(Z); 205 if (element == augerTransitionTable.end()) 205 if (element == augerTransitionTable.end()) 206 {G4Exception("G4RDAugerData::StartShellI 206 {G4Exception("G4RDAugerData::StartShellId()", "NoDataFound", 207 FatalException, "Data not l 207 FatalException, "Data not loaded!");} 208 std::vector<G4RDAugerTransition> dataSet = 208 std::vector<G4RDAugerTransition> dataSet = (*element).second; 209 n = dataSet[vacancyIndex].TransitionOrigi 209 n = dataSet[vacancyIndex].TransitionOriginatingShellId(transitionShellIndex); 210 } 210 } 211 211 212 212 213 return n; 213 return n; 214 } 214 } 215 215 216 G4double G4RDAugerData::StartShellEnergy(G4int 216 G4double G4RDAugerData::StartShellEnergy(G4int Z, G4int vacancyIndex, G4int transitionId, G4int augerIndex) const 217 { 217 { 218 G4double energy = 0; 218 G4double energy = 0; 219 219 220 if (vacancyIndex<0 || vacancyIndex>=numberOf 220 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 221 {G4Exception("G4RDAugerData::StartShellEne 221 {G4Exception("G4RDAugerData::StartShellEnergy()", "OutOfRange", 222 FatalException, "VacancyIndex 222 FatalException, "VacancyIndex outside boundaries!");} 223 else { 223 else { 224 trans_Table::const_iterator element = auge 224 trans_Table::const_iterator element = augerTransitionTable.find(Z); 225 if (element == augerTransitionTable.end()) 225 if (element == augerTransitionTable.end()) 226 {G4Exception("G4RDAugerData::StartShellE 226 {G4Exception("G4RDAugerData::StartShellEnergy()", "NoDataFound", 227 FatalException, "Data not l 227 FatalException, "Data not loaded!");} 228 std::vector<G4RDAugerTransition> dataSet = 228 std::vector<G4RDAugerTransition> dataSet = (*element).second; 229 energy = dataSet[vacancyIndex].AugerTransi 229 energy = dataSet[vacancyIndex].AugerTransitionEnergy(augerIndex,transitionId); 230 230 231 } 231 } 232 return energy; 232 return energy; 233 } 233 } 234 234 235 235 236 G4double G4RDAugerData::StartShellProb(G4int Z 236 G4double G4RDAugerData::StartShellProb(G4int Z, G4int vacancyIndex,G4int transitionId,G4int augerIndex) const 237 { 237 { 238 G4double prob = 0; 238 G4double prob = 0; 239 239 240 if (vacancyIndex<0 || vacancyIndex>=numberOf 240 if (vacancyIndex<0 || vacancyIndex>=numberOfVacancies[Z]) 241 {G4Exception("G4RDAugerData::StartShellPro 241 {G4Exception("G4RDAugerData::StartShellProb()", "OutOfRange", 242 FatalException, "VacancyIndex 242 FatalException, "VacancyIndex outside boundaries!");} 243 else { 243 else { 244 trans_Table::const_iterator element = auge 244 trans_Table::const_iterator element = augerTransitionTable.find(Z); 245 if (element == augerTransitionTable.end()) 245 if (element == augerTransitionTable.end()) 246 {G4Exception("G4RDAugerData::StartShellP 246 {G4Exception("G4RDAugerData::StartShellProb()", "NoDataFound", 247 FatalException, "Data not l 247 FatalException, "Data not loaded!");} 248 std::vector<G4RDAugerTransition> dataSet = 248 std::vector<G4RDAugerTransition> dataSet = (*element).second; 249 prob = dataSet[vacancyIndex].AugerTransiti 249 prob = dataSet[vacancyIndex].AugerTransitionProbability(augerIndex, transitionId); 250 250 251 251 252 252 253 } 253 } 254 return prob; 254 return prob; 255 } 255 } 256 256 257 std::vector<G4RDAugerTransition> G4RDAugerData 257 std::vector<G4RDAugerTransition> G4RDAugerData::LoadData(G4int Z) 258 { 258 { 259 // Build the complete string identifying the 259 // Build the complete string identifying the file with the data set 260 260 261 std::ostringstream ost; 261 std::ostringstream ost; 262 if(Z != 0){ 262 if(Z != 0){ 263 ost << "au-tr-pr-"<< Z << ".dat"; 263 ost << "au-tr-pr-"<< Z << ".dat"; 264 } 264 } 265 else{ 265 else{ 266 ost << "au-tr-pr-"<<".dat"; 266 ost << "au-tr-pr-"<<".dat"; 267 } 267 } 268 G4String name(ost.str()); 268 G4String name(ost.str()); 269 269 270 const char* path = G4FindDataDir("G4LEDATA << 270 char* path = std::getenv("G4LEDATA"); 271 if (!path) 271 if (!path) 272 { 272 { 273 G4String excep = "G4LEDATA environment varia 273 G4String excep = "G4LEDATA environment variable not set"; 274 G4Exception("G4RDAugerData::LoadData()", "In 274 G4Exception("G4RDAugerData::LoadData()", "InvalidSetup", 275 FatalException, excep); 275 FatalException, excep); 276 } 276 } 277 277 278 G4String pathString(path); 278 G4String pathString(path); 279 G4String dirFile = pathString + "/auger/" 279 G4String dirFile = pathString + "/auger/" + name; 280 std::ifstream file(dirFile); 280 std::ifstream file(dirFile); 281 std::filebuf* lsdp = file.rdbuf(); 281 std::filebuf* lsdp = file.rdbuf(); 282 282 283 if (! (lsdp->is_open()) ) 283 if (! (lsdp->is_open()) ) 284 { 284 { 285 G4String excep = "Data file: " + dirFile + " 285 G4String excep = "Data file: " + dirFile + " not found!"; 286 G4Exception("G4RDAugerData::LoadData()", "Da 286 G4Exception("G4RDAugerData::LoadData()", "DataNotFound", 287 FatalException, excep); 287 FatalException, excep); 288 } 288 } 289 289 290 290 291 G4double a = 0; 291 G4double a = 0; 292 G4int k = 1; 292 G4int k = 1; 293 G4int s = 0; 293 G4int s = 0; 294 294 295 G4int vacId = 0; 295 G4int vacId = 0; 296 std::vector<G4int>* initIds = new std::vec 296 std::vector<G4int>* initIds = new std::vector<G4int>; 297 std::vector<G4int>* newIds = new std::vect 297 std::vector<G4int>* newIds = new std::vector<G4int>; 298 G4DataVector* transEnergies = new G4DataVe 298 G4DataVector* transEnergies = new G4DataVector; 299 G4DataVector* transProbabilities = new G4D 299 G4DataVector* transProbabilities = new G4DataVector; 300 std::vector<G4RDAugerTransition> augerTran 300 std::vector<G4RDAugerTransition> augerTransitionVector; 301 std::map<G4int,std::vector<G4int>,std::les 301 std::map<G4int,std::vector<G4int>,std::less<G4int> >* newIdMap = 302 new std::map<G4int,std::vector<G4int>,st 302 new std::map<G4int,std::vector<G4int>,std::less<G4int> >; 303 std::map<G4int,G4DataVector,std::less<G4in 303 std::map<G4int,G4DataVector,std::less<G4int> >* newEnergyMap = 304 new std::map<G4int,G4DataVector,std::les 304 new std::map<G4int,G4DataVector,std::less<G4int> >; 305 std::map<G4int,G4DataVector,std::less<G4in 305 std::map<G4int,G4DataVector,std::less<G4int> >* newProbabilityMap = 306 new std::map<G4int,G4DataVector,std::les 306 new std::map<G4int,G4DataVector,std::less<G4int> >; 307 307 308 308 309 do { 309 do { 310 file >> a; 310 file >> a; 311 311 312 312 313 G4int nColumns = 4; 313 G4int nColumns = 4; 314 314 315 if (a == -1) 315 if (a == -1) 316 { 316 { 317 317 318 318 319 319 320 if (s == 0) 320 if (s == 0) 321 { 321 { 322 // End of a shell data set 322 // End of a shell data set 323 323 324 324 325 325 326 std::vector<G4int>::iterator vectorInd 326 std::vector<G4int>::iterator vectorIndex = initIds->begin(); 327 327 328 vacId = *vectorIndex; 328 vacId = *vectorIndex; 329 329 330 //initIds->erase(vectorIndex); 330 //initIds->erase(vectorIndex); 331 331 332 332 333 333 334 std::vector<G4int> identifiers; 334 std::vector<G4int> identifiers; 335 for (vectorIndex = initIds->begin()+1 335 for (vectorIndex = initIds->begin()+1 ; vectorIndex != initIds->end(); ++vectorIndex){ 336 336 337 identifiers.push_back(*vectorIndex); 337 identifiers.push_back(*vectorIndex); 338 } 338 } 339 339 340 vectorIndex = (initIds->end())-1; 340 vectorIndex = (initIds->end())-1; 341 341 342 G4int augerShellId = *(vectorIndex); 342 G4int augerShellId = *(vectorIndex); 343 343 344 344 345 (*newIdMap)[augerShellId] = *newIds; 345 (*newIdMap)[augerShellId] = *newIds; 346 (*newEnergyMap)[augerShellId] = *trans 346 (*newEnergyMap)[augerShellId] = *transEnergies; 347 (*newProbabilityMap)[augerShellId] = * 347 (*newProbabilityMap)[augerShellId] = *transProbabilities; 348 348 349 augerTransitionVector.push_back(G4RDAu 349 augerTransitionVector.push_back(G4RDAugerTransition(vacId, identifiers, newIdMap, newEnergyMap, newProbabilityMap)); 350 350 351 // Now deleting all the variables I us 351 // Now deleting all the variables I used, and creating new ones for the next shell 352 352 353 delete newIdMap; 353 delete newIdMap; 354 delete newEnergyMap; 354 delete newEnergyMap; 355 delete newProbabilityMap; 355 delete newProbabilityMap; 356 356 357 G4int n = initIds->size(); 357 G4int n = initIds->size(); 358 nInitShells.push_back(n); 358 nInitShells.push_back(n); 359 numberOfVacancies[Z]++; 359 numberOfVacancies[Z]++; 360 delete initIds; 360 delete initIds; 361 delete newIds; 361 delete newIds; 362 delete transEnergies; 362 delete transEnergies; 363 delete transProbabilities; 363 delete transProbabilities; 364 initIds = new std::vector<G4int>; 364 initIds = new std::vector<G4int>; 365 newIds = new std::vector<G4int>; 365 newIds = new std::vector<G4int>; 366 transEnergies = new G4DataVector; 366 transEnergies = new G4DataVector; 367 transProbabilities = new G4DataVector; 367 transProbabilities = new G4DataVector; 368 newIdMap = new std::map<G4int,std::vec 368 newIdMap = new std::map<G4int,std::vector<G4int>,std::less<G4int> >; 369 newEnergyMap = new std::map<G4int,G4Da 369 newEnergyMap = new std::map<G4int,G4DataVector,std::less<G4int> >; 370 newProbabilityMap = new std::map<G4int 370 newProbabilityMap = new std::map<G4int,G4DataVector,std::less<G4int> >; 371 371 372 372 373 373 374 } 374 } 375 s++; 375 s++; 376 if (s == nColumns) 376 if (s == nColumns) 377 { 377 { 378 s = 0; 378 s = 0; 379 } 379 } 380 } 380 } 381 else if (a == -2) 381 else if (a == -2) 382 { 382 { 383 // End of file; delete the empty vectors c 383 // End of file; delete the empty vectors created 384 //when encountering the last -1 -1 row 384 //when encountering the last -1 -1 row 385 delete initIds; 385 delete initIds; 386 delete newIds; 386 delete newIds; 387 delete transEnergies; 387 delete transEnergies; 388 delete transProbabilities; 388 delete transProbabilities; 389 delete newIdMap ; 389 delete newIdMap ; 390 delete newEnergyMap; 390 delete newEnergyMap; 391 delete newProbabilityMap; 391 delete newProbabilityMap; 392 } 392 } 393 else 393 else 394 { 394 { 395 395 396 if (k%nColumns == 3){ 396 if (k%nColumns == 3){ 397 // 3rd column is the transition probabil 397 // 3rd column is the transition probabilities 398 transProbabilities->push_back(a); 398 transProbabilities->push_back(a); 399 399 400 k++;} 400 k++;} 401 else if(k%nColumns == 2){ 401 else if(k%nColumns == 2){ 402 // 2nd column is new auger vacancy 402 // 2nd column is new auger vacancy 403 403 404 // 2nd column is new auger vacancy 404 // 2nd column is new auger vacancy 405 405 406 G4int l = (G4int)a; 406 G4int l = (G4int)a; 407 newIds->push_back(l); 407 newIds->push_back(l); 408 408 409 409 410 k++; 410 k++; 411 } 411 } 412 else if (k%nColumns == 1) 412 else if (k%nColumns == 1) 413 { 413 { 414 // 1st column is shell id 414 // 1st column is shell id 415 415 416 if(initIds->size() == 0) { 416 if(initIds->size() == 0) { 417 417 418 // if this is the first data of the shell, 418 // if this is the first data of the shell, all the colums are equal 419 // to the shell Id; so we skip the next co 419 // to the shell Id; so we skip the next colums ang go to the next row 420 420 421 initIds->push_back((G4int)a); 421 initIds->push_back((G4int)a); 422 // first line of initIds is the original s 422 // first line of initIds is the original shell of the vacancy 423 file >> a; 423 file >> a; 424 file >> a; 424 file >> a; 425 file >> a; 425 file >> a; 426 k = k+3; 426 k = k+3; 427 } 427 } 428 else { 428 else { 429 429 430 // std::vector<G4int>::iterator vec 430 // std::vector<G4int>::iterator vectorIndex = (initIds->end())-1; 431 if((G4int)a != initIds->back()){ 431 if((G4int)a != initIds->back()){ 432 432 433 433 434 if((initIds->size()) == 1) { 434 if((initIds->size()) == 1) { 435 initIds->push_back((G4int)a); 435 initIds->push_back((G4int)a); 436 } 436 } 437 else { 437 else { 438 438 439 439 440 G4int augerShellId = 0; 440 G4int augerShellId = 0; 441 augerShellId = initIds->back(); 441 augerShellId = initIds->back(); 442 442 443 (*newIdMap)[augerShellId] = *newIds; 443 (*newIdMap)[augerShellId] = *newIds; 444 (*newEnergyMap)[augerShellId] = *trans 444 (*newEnergyMap)[augerShellId] = *transEnergies; 445 (*newProbabilityMap)[augerShellId] = * 445 (*newProbabilityMap)[augerShellId] = *transProbabilities; 446 delete newIds; 446 delete newIds; 447 delete transEnergies; 447 delete transEnergies; 448 delete transProbabilities; 448 delete transProbabilities; 449 newIds = new std::vector<G4int>; 449 newIds = new std::vector<G4int>; 450 transEnergies = new G4DataVector; 450 transEnergies = new G4DataVector; 451 transProbabilities = new G4DataVector; 451 transProbabilities = new G4DataVector; 452 initIds->push_back((G4int)a); 452 initIds->push_back((G4int)a); 453 } 453 } 454 } 454 } 455 } 455 } 456 456 457 k++; 457 k++; 458 458 459 } 459 } 460 else if (k%nColumns == 0) 460 else if (k%nColumns == 0) 461 461 462 {//fourth column is transition energies 462 {//fourth column is transition energies 463 G4double e = a * MeV; 463 G4double e = a * MeV; 464 464 465 transEnergies->push_back(e); 465 transEnergies->push_back(e); 466 k=1; 466 k=1; 467 467 468 } 468 } 469 } 469 } 470 } 470 } 471 471 472 472 473 while (a != -2); // end of file 473 while (a != -2); // end of file 474 file.close(); 474 file.close(); 475 return augerTransitionVector; 475 return augerTransitionVector; 476 476 477 } 477 } 478 478 479 void G4RDAugerData::BuildAugerTransitionTable( 479 void G4RDAugerData::BuildAugerTransitionTable() 480 { 480 { 481 481 482 // trans_Table::iterator pos = augerTransit 482 // trans_Table::iterator pos = augerTransitionTable.begin(); 483 483 484 const G4MaterialTable* materialTable = G4Mat 484 const G4MaterialTable* materialTable = G4Material::GetMaterialTable(); 485 485 486 G4int nMaterials = G4Material::GetNumberOfMa 486 G4int nMaterials = G4Material::GetNumberOfMaterials(); 487 487 488 G4DataVector activeZ; 488 G4DataVector activeZ; 489 activeZ.clear(); 489 activeZ.clear(); 490 490 491 for (G4int m=0; m<nMaterials; m++) { 491 for (G4int m=0; m<nMaterials; m++) { 492 492 493 const G4Material* material= (*materialTabl 493 const G4Material* material= (*materialTable)[m]; 494 const G4ElementVector* elementVector = mat 494 const G4ElementVector* elementVector = material->GetElementVector(); 495 const size_t nElements = material->GetNumb 495 const size_t nElements = material->GetNumberOfElements(); 496 496 497 for (size_t iEl=0; iEl<nElements; iEl++) { 497 for (size_t iEl=0; iEl<nElements; iEl++) { 498 G4Element* element = (*elementVector)[iE 498 G4Element* element = (*elementVector)[iEl]; 499 G4double Z = element->GetZ(); 499 G4double Z = element->GetZ(); 500 if (!(activeZ.contains(Z))) { 500 if (!(activeZ.contains(Z))) { 501 activeZ.push_back(Z); 501 activeZ.push_back(Z); 502 } 502 } 503 } 503 } 504 } 504 } 505 505 506 506 507 for (G4int element = 6; element < 101; eleme 507 for (G4int element = 6; element < 101; element++) 508 { 508 { 509 if(nMaterials == 0 || activeZ.contains(e 509 if(nMaterials == 0 || activeZ.contains(element)) { 510 augerTransitionTable.insert(trans_Tabl 510 augerTransitionTable.insert(trans_Table::value_type(element,LoadData(element))); 511 511 512 G4cout << "G4RDAugerData for Element n 512 G4cout << "G4RDAugerData for Element no. " << element << " are loaded" << G4endl; 513 // PrintData(element); 513 // PrintData(element); 514 } 514 } 515 } 515 } 516 516 517 G4cout << "AugerTransitionTable complete"<< 517 G4cout << "AugerTransitionTable complete"<< G4endl; 518 } 518 } 519 519 520 void G4RDAugerData::PrintData(G4int Z) 520 void G4RDAugerData::PrintData(G4int Z) 521 { 521 { 522 522 523 for (G4int i = 0; i < numberOfVacancies[Z]; 523 for (G4int i = 0; i < numberOfVacancies[Z]; i++) 524 { 524 { 525 G4cout << "---- TransitionData for the v 525 G4cout << "---- TransitionData for the vacancy nb " 526 <<i 526 <<i 527 <<" of the atomic number elemnt " 527 <<" of the atomic number elemnt " 528 << Z 528 << Z 529 <<"----- " 529 <<"----- " 530 <<G4endl; 530 <<G4endl; 531 531 532 for (size_t k = 0; k<=NumberOfTransition 532 for (size_t k = 0; k<=NumberOfTransitions(Z,i); k++) 533 { 533 { 534 G4int id = StartShellId(Z,i,k); 534 G4int id = StartShellId(Z,i,k); 535 535 536 for (size_t a = 0; a <= NumberOfAuger(Z,i, 536 for (size_t a = 0; a <= NumberOfAuger(Z,i,id); a++) { 537 537 538 G4double e = StartShellEnergy(Z,i,id,a) 538 G4double e = StartShellEnergy(Z,i,id,a) /MeV; 539 G4double p = StartShellProb(Z,i,id,a); 539 G4double p = StartShellProb(Z,i,id,a); 540 G4int augerId = AugerShellId(Z, i, id, a 540 G4int augerId = AugerShellId(Z, i, id, a); 541 G4cout << k <<") Shell id: " << id <<G4e 541 G4cout << k <<") Shell id: " << id <<G4endl; 542 G4cout << " Auger Originatig Shell Id 542 G4cout << " Auger Originatig Shell Id :"<< augerId <<G4endl; 543 G4cout << " - Transition energy = " << e 543 G4cout << " - Transition energy = " << e << " MeV "<<G4endl; 544 G4cout << " - Transition probability = 544 G4cout << " - Transition probability = " << p <<G4endl; 545 } 545 } 546 } 546 } 547 G4cout << "----------------------------- 547 G4cout << "-------------------------------------------------" 548 << G4endl; 548 << G4endl; 549 } 549 } 550 } 550 } 551 G4RDAugerTransition* G4RDAugerData::GetAugerTr 551 G4RDAugerTransition* G4RDAugerData::GetAugerTransition(G4int Z,G4int vacancyShellIndex) 552 { 552 { 553 std::vector<G4RDAugerTransition>* dataSe 553 std::vector<G4RDAugerTransition>* dataSet = &augerTransitionTable[Z]; 554 std::vector<G4RDAugerTransition>::iterat 554 std::vector<G4RDAugerTransition>::iterator vectorIndex = dataSet->begin() + vacancyShellIndex; 555 555 556 G4RDAugerTransition* augerTransition = & 556 G4RDAugerTransition* augerTransition = &(*vectorIndex); 557 return augerTransition; 557 return augerTransition; 558 } 558 } 559 559 560 std::vector<G4RDAugerTransition>* G4RDAugerDat 560 std::vector<G4RDAugerTransition>* G4RDAugerData::GetAugerTransitions(G4int Z) 561 { 561 { 562 std::vector<G4RDAugerTransition>* dataSet 562 std::vector<G4RDAugerTransition>* dataSet = &augerTransitionTable[Z]; 563 return dataSet; 563 return dataSet; 564 } 564 } 565 565 566 566 567 567 568 568 569 569 570 570 571 571 572 572 573 573 574 574 575 575 576 576 577 577 578 578 579 579 580 580 581 581 582 582 583 583 584 584 585 585 586 586