Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/eRosita/physics/src/G4RDAtomicTransitionManager.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 /examples/advanced/eRosita/physics/src/G4RDAtomicTransitionManager.cc (Version 11.3.0) and /examples/advanced/eRosita/physics/src/G4RDAtomicTransitionManager.cc (Version 10.7.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 //                                                 27 //
 28 // Authors: Elena Guardincerri (Elena.Guardinc     28 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
 29 //          Alfonso Mantero (Alfonso.Mantero@g     29 //          Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
 30 //                                                 30 //
 31 // History:                                        31 // History:
 32 // -----------                                     32 // -----------
 33 // 16 Sep 2001 E. Guardincerri  First Committe     33 // 16 Sep 2001 E. Guardincerri  First Committed to cvs
 34 //                                                 34 //
 35 // -------------------------------------------     35 // -------------------------------------------------------------------
 36                                                    36 
 37 #include "G4RDAtomicTransitionManager.hh"          37 #include "G4RDAtomicTransitionManager.hh"
 38                                                    38 
 39 G4RDAtomicTransitionManager::G4RDAtomicTransit     39 G4RDAtomicTransitionManager::G4RDAtomicTransitionManager(G4int minZ, G4int maxZ, 
 40   G4int limitInfTable,G4int limitSupTable)         40   G4int limitInfTable,G4int limitSupTable)
 41   :zMin(minZ),                                     41   :zMin(minZ), 
 42   zMax(maxZ),                                      42   zMax(maxZ),
 43   infTableLimit(limitInfTable),                    43   infTableLimit(limitInfTable),
 44   supTableLimit(limitSupTable)                     44   supTableLimit(limitSupTable)
 45 {                                                  45 {
 46   // infTableLimit is initialized to 6 because     46   // infTableLimit is initialized to 6 because EADL lacks data for Z<=5
 47   G4RDShellData* shellManager = new G4RDShellD     47   G4RDShellData* shellManager = new G4RDShellData;
 48                                                    48 
 49   // initialization of the data for auger effe     49   // initialization of the data for auger effect
 50                                                    50   
 51   augerData = new G4RDAugerData;                   51   augerData = new G4RDAugerData;
 52                                                    52 
 53   shellManager->LoadData("/fluor/binding");        53   shellManager->LoadData("/fluor/binding");
 54                                                    54   
 55   // Fills shellTable with the data from EADL,     55   // Fills shellTable with the data from EADL, identities and binding 
 56   // energies of shells                            56   // energies of shells
 57   for (G4int Z = zMin; Z<= zMax; Z++)              57   for (G4int Z = zMin; Z<= zMax; Z++)
 58     {                                              58     {
 59       std::vector<G4RDAtomicShell*> vectorOfSh     59       std::vector<G4RDAtomicShell*> vectorOfShells;  
 60       size_t shellIndex = 0;                       60       size_t shellIndex = 0; 
 61                                                    61 
 62       size_t numberOfShells=shellManager->Numb     62       size_t numberOfShells=shellManager->NumberOfShells(Z);
 63       for (shellIndex = 0; shellIndex<numberOf     63       for (shellIndex = 0; shellIndex<numberOfShells; shellIndex++) 
 64   {                                                64   { 
 65     G4int shellId = shellManager->ShellId(Z,sh     65     G4int shellId = shellManager->ShellId(Z,shellIndex);
 66     G4double bindingEnergy = shellManager->Bin     66     G4double bindingEnergy = shellManager->BindingEnergy(Z,shellIndex);
 67                                                    67    
 68     G4RDAtomicShell * shell = new G4RDAtomicSh     68     G4RDAtomicShell * shell = new G4RDAtomicShell(shellId,bindingEnergy);
 69                                                    69   
 70     vectorOfShells.push_back(shell);               70     vectorOfShells.push_back(shell);
 71   }                                                71   }
 72                                                    72     
 73       //     shellTable.insert(std::make_pair(     73       //     shellTable.insert(std::make_pair(Z, vectorOfShells));
 74       shellTable[Z] = vectorOfShells;              74       shellTable[Z] = vectorOfShells;
 75     }                                              75     }
 76                                                    76   
 77   // Fills transitionTable with the data from      77   // Fills transitionTable with the data from EADL, identities, transition 
 78   // energies and transition probabilities         78   // energies and transition probabilities
 79   for (G4int Znum= infTableLimit; Znum<=supTab     79   for (G4int Znum= infTableLimit; Znum<=supTableLimit; Znum++)
 80     {  G4RDFluoData* fluoManager = new G4RDFlu     80     {  G4RDFluoData* fluoManager = new G4RDFluoData;
 81     std::vector<G4RDFluoTransition*> vectorOfT     81     std::vector<G4RDFluoTransition*> vectorOfTransitions;
 82     fluoManager->LoadData(Znum);                   82     fluoManager->LoadData(Znum);
 83                                                    83     
 84     size_t numberOfVacancies = fluoManager-> N     84     size_t numberOfVacancies = fluoManager-> NumberOfVacancies();
 85                                                    85     
 86     for (size_t vacancyIndex = 0; vacancyIndex     86     for (size_t vacancyIndex = 0; vacancyIndex<numberOfVacancies;  vacancyIndex++)
 87                                                    87       
 88       {                                            88       {
 89   std::vector<G4int>  vectorOfIds;                 89   std::vector<G4int>  vectorOfIds;
 90   G4DataVector vectorOfEnergies;                   90   G4DataVector vectorOfEnergies;
 91   G4DataVector vectorOfProbabilities;              91   G4DataVector vectorOfProbabilities;
 92                                                    92   
 93   G4int finalShell = fluoManager->VacancyId(va     93   G4int finalShell = fluoManager->VacancyId(vacancyIndex);
 94   size_t numberOfTransitions = fluoManager->Nu     94   size_t numberOfTransitions = fluoManager->NumberOfTransitions(vacancyIndex);
 95   for (size_t origShellIndex = 0; origShellInd     95   for (size_t origShellIndex = 0; origShellIndex < numberOfTransitions;
 96        origShellIndex++)                           96        origShellIndex++)
 97                                                    97       
 98     {                                              98     {
 99                                                    99       
100       G4int originatingShellId = fluoManager->    100       G4int originatingShellId = fluoManager->StartShellId(origShellIndex,vacancyIndex);
101                                                   101       
102       vectorOfIds.push_back(originatingShellId    102       vectorOfIds.push_back(originatingShellId);
103                                                   103       
104       G4double transitionEnergy = fluoManager-    104       G4double transitionEnergy = fluoManager->StartShellEnergy(origShellIndex,vacancyIndex);
105       vectorOfEnergies.push_back(transitionEne    105       vectorOfEnergies.push_back(transitionEnergy);
106       G4double transitionProbability = fluoMan    106       G4double transitionProbability = fluoManager->StartShellProb(origShellIndex,vacancyIndex);
107       vectorOfProbabilities.push_back(transiti    107       vectorOfProbabilities.push_back(transitionProbability);
108     }                                             108     }
109     G4RDFluoTransition * transition = new G4RD    109     G4RDFluoTransition * transition = new G4RDFluoTransition (finalShell,vectorOfIds,
110                     vectorOfEnergies,vectorOfP    110                     vectorOfEnergies,vectorOfProbabilities);
111     vectorOfTransitions.push_back(transition);    111     vectorOfTransitions.push_back(transition); 
112       }                                           112       }
113     //      transitionTable.insert(std::make_p    113     //      transitionTable.insert(std::make_pair(Znum, vectorOfTransitions));
114     transitionTable[Znum] = vectorOfTransition    114     transitionTable[Znum] = vectorOfTransitions;
115                                                   115       
116       delete fluoManager;                         116       delete fluoManager;
117     }                                             117     }
118   delete shellManager;                            118   delete shellManager;
119 }                                                 119 }
120                                                   120 
121 G4RDAtomicTransitionManager::~G4RDAtomicTransi    121 G4RDAtomicTransitionManager::~G4RDAtomicTransitionManager()
122                                                   122   
123 {                                                 123 { 
124                                                   124 
125   delete augerData;                               125   delete augerData;
126                                                   126 
127 std::map<G4int,std::vector<G4RDAtomicShell*>,s    127 std::map<G4int,std::vector<G4RDAtomicShell*>,std::less<G4int> >::iterator pos;
128                                                   128  
129  for (pos = shellTable.begin(); pos != shellTa    129  for (pos = shellTable.begin(); pos != shellTable.end(); pos++){
130                                                   130    
131    std::vector< G4RDAtomicShell*>vec = (*pos).    131    std::vector< G4RDAtomicShell*>vec = (*pos).second;
132                                                   132    
133    G4int vecSize=vec.size();                      133    G4int vecSize=vec.size();
134                                                   134    
135    for (G4int i=0; i< vecSize; i++){              135    for (G4int i=0; i< vecSize; i++){
136      G4RDAtomicShell* shell = vec[i];             136      G4RDAtomicShell* shell = vec[i];
137      delete shell;                                137      delete shell;     
138    }                                              138    }
139                                                   139    
140  }                                                140  }
141                                                   141  
142  std::map<G4int,std::vector<G4RDFluoTransition    142  std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::iterator ppos;
143                                                   143  
144  for (ppos = transitionTable.begin(); ppos !=     144  for (ppos = transitionTable.begin(); ppos != transitionTable.end(); ppos++){
145                                                   145    
146    std::vector<G4RDFluoTransition*>vec = (*ppo    146    std::vector<G4RDFluoTransition*>vec = (*ppos).second;
147                                                   147    
148    G4int vecSize=vec.size();                      148    G4int vecSize=vec.size();
149                                                   149    
150    for (G4int i=0; i< vecSize; i++){              150    for (G4int i=0; i< vecSize; i++){
151    G4RDFluoTransition* transition = vec[i];       151    G4RDFluoTransition* transition = vec[i];
152    delete transition;                             152    delete transition;      
153    }                                              153    }
154                                                   154    
155  }                                                155  }   
156                                                   156  
157 }                                                 157 }
158                                                   158 
159 G4RDAtomicTransitionManager* G4RDAtomicTransit    159 G4RDAtomicTransitionManager* G4RDAtomicTransitionManager::instance = 0;
160                                                   160 
161 G4RDAtomicTransitionManager* G4RDAtomicTransit    161 G4RDAtomicTransitionManager* G4RDAtomicTransitionManager::Instance()
162 {                                                 162 {
163   if (instance == 0)                              163   if (instance == 0)
164     {                                             164     {
165       instance = new G4RDAtomicTransitionManag    165       instance = new G4RDAtomicTransitionManager;
166                                                   166      
167     }                                             167     }
168   return instance;                                168   return instance;
169 }                                                 169 }
170                                                   170 
171                                                   171 
172 G4RDAtomicShell* G4RDAtomicTransitionManager::    172 G4RDAtomicShell* G4RDAtomicTransitionManager::Shell(G4int Z, size_t shellIndex) const
173 {                                                 173 { 
174   std::map<G4int,std::vector<G4RDAtomicShell*>    174   std::map<G4int,std::vector<G4RDAtomicShell*>,std::less<G4int> >::const_iterator pos;
175                                                   175   
176   pos = shellTable.find(Z);                       176   pos = shellTable.find(Z);
177                                                   177   
178   if (pos!= shellTable.end())                     178   if (pos!= shellTable.end())
179     {                                             179     {
180       std::vector<G4RDAtomicShell*> v = (*pos)    180       std::vector<G4RDAtomicShell*> v = (*pos).second;
181       if (shellIndex<v.size())                    181       if (shellIndex<v.size())
182   {                                               182   {
183     return(v[shellIndex]);                        183     return(v[shellIndex]);
184   }                                               184   }
185       else                                        185       else 
186   {                                               186   {
187     size_t lastShell = v.size();                  187     size_t lastShell = v.size();
188     G4cout << "G4RDAtomicTransitionManager::Sh    188     G4cout << "G4RDAtomicTransitionManager::Shell - Z = " 
189      << Z << ", shellIndex = " << shellIndex      189      << Z << ", shellIndex = " << shellIndex 
190      << " not found; number of shells = " << l    190      << " not found; number of shells = " << lastShell << G4endl;
191     //  G4Exception("G4RDAtomicTransitionManag    191     //  G4Exception("G4RDAtomicTransitionManager:shell not found");
192     if (lastShell > 0)                            192     if (lastShell > 0)
193       {                                           193       {
194         return v[lastShell - 1];                  194         return v[lastShell - 1];
195       }                                           195       }
196     else                                          196     else
197       {                                           197       {     
198         return 0;                                 198         return 0;
199       }                                           199       }
200   }                                               200   }
201     }                                             201     }
202   else                                            202   else
203     {                                             203     {
204       G4Exception("G4RDAtomicTransitionManager    204       G4Exception("G4RDAtomicTransitionManager::Shell()",
205                   "InvalidSetup", FatalExcepti    205                   "InvalidSetup", FatalException, "Z not found!");
206       return 0;                                   206       return 0;
207     }                                             207     } 
208 }                                                 208 }
209                                                   209 
210 // This function gives, upon Z and the Index o    210 // This function gives, upon Z and the Index of the initial shell where te vacancy is, 
211 // the radiative transition that can happen (o    211 // the radiative transition that can happen (originating shell, energy, probability)
212                                                   212 
213 const G4RDFluoTransition* G4RDAtomicTransition    213 const G4RDFluoTransition* G4RDAtomicTransitionManager::ReachableShell(G4int Z,size_t shellIndex) const
214 {                                                 214 {
215   std::map<G4int,std::vector<G4RDFluoTransitio    215   std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::const_iterator pos;
216   pos = transitionTable.find(Z);                  216   pos = transitionTable.find(Z);
217   if (pos!= transitionTable.end())                217   if (pos!= transitionTable.end())
218     {                                             218     {
219       std::vector<G4RDFluoTransition*> v = (*p    219       std::vector<G4RDFluoTransition*> v = (*pos).second;      
220       if (shellIndex < v.size()) return(v[shel    220       if (shellIndex < v.size()) return(v[shellIndex]);
221       else {                                      221       else {
222   G4Exception("G4RDAtomicTransitionManager::Re    222   G4Exception("G4RDAtomicTransitionManager::ReachableShell()",
223                     "InvalidCondition", FatalE    223                     "InvalidCondition", FatalException,
224                     "Reachable shell not found    224                     "Reachable shell not found!");
225   return 0;                                       225   return 0;
226       }                                           226       }
227   }                                               227   }
228   else{                                           228   else{
229     G4cout << "G4AtomicTransitionMagare warnin    229     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
230     G4cout << "Absorbed enrgy deposited locall    230     G4cout << "Absorbed enrgy deposited locally" << G4endl;
231                                                   231 
232     //    G4Exception("G4RDAtomicTransitionMan    232     //    G4Exception("G4RDAtomicTransitionManager:Z not found");
233     return 0;                                     233     return 0;
234   }                                               234   } 
235 }                                                 235 }
236                                                   236 
237 const G4RDAugerTransition* G4RDAtomicTransitio    237 const G4RDAugerTransition* G4RDAtomicTransitionManager::ReachableAugerShell(G4int Z, G4int vacancyShellIndex) const
238 {                                                 238 {
239                                                   239   
240   G4RDAugerTransition* augerTransition = auger    240   G4RDAugerTransition* augerTransition = augerData->GetAugerTransition(Z,vacancyShellIndex);
241   return augerTransition;                         241   return augerTransition;
242 }                                                 242 }
243                                                   243 
244                                                   244 
245                                                   245 
246 G4int G4RDAtomicTransitionManager::NumberOfShe    246 G4int G4RDAtomicTransitionManager::NumberOfShells (G4int Z) const
247 {                                                 247 {
248                                                   248 
249 std::map<G4int,std::vector<G4RDAtomicShell*>,s    249 std::map<G4int,std::vector<G4RDAtomicShell*>,std::less<G4int> >::const_iterator pos;
250                                                   250 
251   pos = shellTable.find(Z);                       251   pos = shellTable.find(Z);
252                                                   252 
253   if (pos!= shellTable.end()){                    253   if (pos!= shellTable.end()){
254                                                   254 
255     std::vector<G4RDAtomicShell*> v = (*pos).s    255     std::vector<G4RDAtomicShell*> v = (*pos).second;
256                                                   256 
257     return v.size();                              257     return v.size();
258   }                                               258   }
259                                                   259 
260   else{                                           260   else{
261     G4cout << "G4AtomicTransitionMagare warnin    261     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
262     G4cout << "Absorbed enrgy deposited locall    262     G4cout << "Absorbed enrgy deposited locally" << G4endl;
263                                                   263 
264     //    G4Exception("G4RDAtomicTransitionMan    264     //    G4Exception("G4RDAtomicTransitionManager:Z not found");
265     return 0;                                     265     return 0;
266   }                                               266   } 
267 }                                                 267 }
268                                                   268 
269 // This function returns the number of possibl    269 // This function returns the number of possible radiative transitions for the atom with atomic number Z
270 // i.e. the number of shell in wich a vacancy     270 // i.e. the number of shell in wich a vacancy can be filled with a radiative transition 
271                                                   271 
272 G4int G4RDAtomicTransitionManager::NumberOfRea    272 G4int G4RDAtomicTransitionManager::NumberOfReachableShells(G4int Z) const
273 {                                                 273 {
274 std::map<G4int,std::vector<G4RDFluoTransition*    274 std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::const_iterator pos;
275                                                   275 
276   pos = transitionTable.find(Z);                  276   pos = transitionTable.find(Z);
277                                                   277 
278   if (pos!= transitionTable.end())                278   if (pos!= transitionTable.end())
279     {                                             279     {
280       std::vector<G4RDFluoTransition*> v = (*p    280       std::vector<G4RDFluoTransition*> v = (*pos).second;
281       return v.size();                            281       return v.size();
282     }                                             282     }
283   else                                            283   else
284     {                                             284     {
285       G4cout << "G4AtomicTransitionMagare warn    285       G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
286       G4cout << "Absorbed enrgy deposited loca    286       G4cout << "Absorbed enrgy deposited locally" << G4endl;
287                                                   287 
288       //    G4Exception("G4RDAtomicTransitionM    288       //    G4Exception("G4RDAtomicTransitionManager:Z not found");
289       return 0;                                   289       return 0;
290     }                                             290     } 
291 }                                                 291 }
292                                                   292 
293 // This function returns the number of possibl    293 // This function returns the number of possible NON-radiative transitions for the atom with atomic number Z
294 // i.e. the number of shell in wich a vacancy     294 // i.e. the number of shell in wich a vacancy can be filled with a NON-radiative transition 
295                                                   295 
296 G4int G4RDAtomicTransitionManager::NumberOfRea    296 G4int G4RDAtomicTransitionManager::NumberOfReachableAugerShells(G4int Z)const 
297 {                                                 297 {
298   G4int n = augerData->NumberOfVacancies(Z);      298   G4int n = augerData->NumberOfVacancies(Z);
299   return n;                                       299   return n;
300 }                                                 300 }
301                                                   301 
302                                                   302 
303                                                   303 
304 G4double G4RDAtomicTransitionManager::TotalRad    304 G4double G4RDAtomicTransitionManager::TotalRadiativeTransitionProbability(G4int Z, 
305                   size_t shellIndex)              305                   size_t shellIndex)
306                                                   306 
307 {                                                 307 {
308 std::map<G4int,std::vector<G4RDFluoTransition*    308 std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::iterator pos;
309                                                   309 
310   pos = transitionTable.find(Z);                  310   pos = transitionTable.find(Z);
311                                                   311 
312   if (pos!= transitionTable.end())                312   if (pos!= transitionTable.end())
313     {                                             313     {
314       std::vector<G4RDFluoTransition*> v = (*p    314       std::vector<G4RDFluoTransition*> v = (*pos).second;
315                                                   315       
316     if (shellIndex < v.size())                    316     if (shellIndex < v.size())
317       {                                           317       {
318   G4RDFluoTransition* transition = v[shellInde    318   G4RDFluoTransition* transition = v[shellIndex];
319   G4DataVector transProb = transition->Transit    319   G4DataVector transProb = transition->TransitionProbabilities();
320   G4double totalRadTransProb = 0;                 320   G4double totalRadTransProb = 0;
321                                                   321   
322   for (size_t j = 0; j<transProb.size(); j++)     322   for (size_t j = 0; j<transProb.size(); j++) // AM -- corrected, it was 1
323   {                                               323   {
324     totalRadTransProb = totalRadTransProb + tr    324     totalRadTransProb = totalRadTransProb + transProb[j];
325   }                                               325   }
326       return totalRadTransProb;                   326       return totalRadTransProb;   
327                                                   327       
328     }                                             328     }
329     else {                                        329     else {
330       G4Exception("G4RDAtomicTransitionManager    330       G4Exception("G4RDAtomicTransitionManager::TotalRadiativeTransitionProbability()",
331                   "InvalidCondition", FatalExc    331                   "InvalidCondition", FatalException, "Shell not found!" );
332       return 0;                                   332       return 0;
333                                                   333       
334     }                                             334     }
335   }                                               335   }
336   else{                                           336   else{
337     G4cout << "G4AtomicTransitionMagare warnin    337     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
338     G4cout << "Absorbed enrgy deposited locall    338     G4cout << "Absorbed enrgy deposited locally" << G4endl;
339                                                   339 
340     //    G4Exception("G4RDAtomicTransitionMan    340     //    G4Exception("G4RDAtomicTransitionManager:Z not found");
341                                                   341 
342     return 0;                                     342     return 0;
343   }                                               343   } 
344 }                                                 344 }
345                                                   345 
346 G4double G4RDAtomicTransitionManager::TotalNon    346 G4double G4RDAtomicTransitionManager::TotalNonRadiativeTransitionProbability(G4int Z, size_t shellIndex)
347                                                   347 
348 {                                                 348 {
349                                                   349 
350   std::map<G4int,std::vector<G4RDFluoTransitio    350   std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::iterator pos;
351                                                   351   
352   pos = transitionTable.find(Z);                  352   pos = transitionTable.find(Z);
353                                                   353   
354   if (pos!= transitionTable.end()){               354   if (pos!= transitionTable.end()){
355                                                   355     
356     std::vector<G4RDFluoTransition*> v = (*pos    356     std::vector<G4RDFluoTransition*> v = (*pos).second;
357                                                   357   
358                                                   358     
359     if (shellIndex<v.size()){                     359     if (shellIndex<v.size()){
360                                                   360 
361       G4RDFluoTransition* transition=v[shellIn    361       G4RDFluoTransition* transition=v[shellIndex];
362       G4DataVector transProb = transition->Tra    362       G4DataVector transProb = transition->TransitionProbabilities();
363       G4double totalRadTransProb = 0;             363       G4double totalRadTransProb = 0;
364                                                   364       
365       for(size_t j = 0; j<transProb.size(); j+    365       for(size_t j = 0; j<transProb.size(); j++) // AM -- Corrected, was 1
366   {                                               366   {
367     totalRadTransProb = totalRadTransProb + tr    367     totalRadTransProb = totalRadTransProb + transProb[j];
368   }                                               368   }
369                                                   369       
370       G4double totalNonRadTransProb= (1 - tota    370       G4double totalNonRadTransProb= (1 - totalRadTransProb);
371                                                   371       
372       return totalNonRadTransProb;    }           372       return totalNonRadTransProb;    }
373                                                   373     
374     else {                                        374     else {
375       G4Exception("G4RDAtomicTransitionManager    375       G4Exception("G4RDAtomicTransitionManager::TotalNonRadiativeTransitionProbability()",
376                   "InvalidCondition", FatalExc    376                   "InvalidCondition", FatalException, "Shell not found!");
377       return 0;                                   377       return 0;
378     }                                             378     }
379   }                                               379   }
380   else{                                           380   else{
381     G4cout << "G4AtomicTransitionMagare warnin    381     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
382     G4cout << "Absorbed enrgy deposited locall    382     G4cout << "Absorbed enrgy deposited locally" << G4endl;
383                                                   383 
384     //    G4Exception("G4RDAtomicTransitionMan    384     //    G4Exception("G4RDAtomicTransitionManager:Z not found");
385     return 0;                                     385     return 0;
386   }                                               386   } 
387 }                                                 387 }
388                                                   388 
389                                                   389 
390                                                   390 
391                                                   391 
392                                                   392 
393                                                   393 
394                                                   394 
395                                                   395 
396                                                   396 
397                                                   397 
398                                                   398