Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/lowenergy/src/G4AugerData.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/lowenergy/src/G4AugerData.cc (Version 11.3.0) and /processes/electromagnetic/lowenergy/src/G4AugerData.cc (Version 9.6.p3)


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