Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/lowenergy/src/G4AtomicTransitionManager.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/G4AtomicTransitionManager.cc (Version 11.3.0) and /processes/electromagnetic/lowenergy/src/G4AtomicTransitionManager.cc (Version 9.4.p1)


  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 // $Id: G4AtomicTransitionManager.cc,v 1.2 ????
                                                   >>  28 // GEANT4 tag $Name: geant4-09-04-patch-01 $
 27 //                                                 29 //
 28 // Authors: Elena Guardincerri (Elena.Guardinc     30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
 29 //          Alfonso Mantero (Alfonso.Mantero@g     31 //          Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
 30 //                                                 32 //
 31 // History:                                        33 // History:
 32 // -----------                                     34 // -----------
 33 // 16 Sep 2001 E. Guardincerri  First Committe     35 // 16 Sep 2001 E. Guardincerri  First Committed to cvs
 34 //                                                 36 //
 35 // -------------------------------------------     37 // -------------------------------------------------------------------
 36                                                    38 
 37 #include "G4AtomicTransitionManager.hh"            39 #include "G4AtomicTransitionManager.hh"
 38 #include "G4EmParameters.hh"                   << 
 39 #include "G4FluoData.hh"                       << 
 40 #include "G4AugerData.hh"                      << 
 41 #include "G4AutoLock.hh"                       << 
 42 namespace { G4Mutex AtomicTransitionManagerMut << 
 43                                                    40 
 44 //....oooOO0OOooo........oooOO0OOooo........oo <<  41 G4AtomicTransitionManager::G4AtomicTransitionManager(G4int minZ, G4int maxZ, 
 45 G4AtomicTransitionManager* G4AtomicTransitionM <<  42   G4int limitInfTable,G4int limitSupTable)
 46                                                <<  43   :zMin(minZ), 
 47 //....oooOO0OOooo........oooOO0OOooo........oo <<  44   zMax(maxZ),
 48 G4AtomicTransitionManager* G4AtomicTransitionM <<  45   infTableLimit(limitInfTable),
                                                   >>  46   supTableLimit(limitSupTable)
 49 {                                                  47 {
 50   if (instance == nullptr) {                   <<  48   // infTableLimit is initialized to 6 because EADL lacks data for Z<=5
 51     instance = new G4AtomicTransitionManager() <<  49   G4ShellData* shellManager = new G4ShellData;
 52   }                                            << 
 53   return instance;                             << 
 54 }                                              << 
 55                                                    50 
 56 //....oooOO0OOooo........oooOO0OOooo........oo <<  51   // initialization of the data for auger effect
 57 G4AtomicTransitionManager::G4AtomicTransitionM <<  52   
 58  : augerData(nullptr),                         <<  53   augerData = new G4AugerData;
 59    verboseLevel(0),                            <<  54 
 60    isInitialized(false)                        <<  55   shellManager->LoadData("/fluor/binding");
 61 {}                                             <<  56   
                                                   >>  57   // Fills shellTable with the data from EADL, identities and binding 
                                                   >>  58   // energies of shells
                                                   >>  59   for (G4int Z = zMin; Z<= zMax; Z++)
                                                   >>  60     {
                                                   >>  61       std::vector<G4AtomicShell*> vectorOfShells;  
                                                   >>  62       size_t shellIndex = 0; 
                                                   >>  63 
                                                   >>  64       size_t numberOfShells=shellManager->NumberOfShells(Z);
                                                   >>  65       for (shellIndex = 0; shellIndex<numberOfShells; shellIndex++) 
                                                   >>  66   { 
                                                   >>  67     G4int shellId = shellManager->ShellId(Z,shellIndex);
                                                   >>  68     G4double bindingEnergy = shellManager->BindingEnergy(Z,shellIndex);
                                                   >>  69    
                                                   >>  70     G4AtomicShell * shell = new G4AtomicShell(shellId,bindingEnergy);
                                                   >>  71   
                                                   >>  72     vectorOfShells.push_back(shell);
                                                   >>  73   }
                                                   >>  74     
                                                   >>  75       //     shellTable.insert(std::make_pair(Z, vectorOfShells));
                                                   >>  76       shellTable[Z] = vectorOfShells;
                                                   >>  77     }
                                                   >>  78   
                                                   >>  79   // Fills transitionTable with the data from EADL, identities, transition 
                                                   >>  80   // energies and transition probabilities
                                                   >>  81   for (G4int Znum= infTableLimit; Znum<=supTableLimit; Znum++)
                                                   >>  82     {  G4FluoData* fluoManager = new G4FluoData;
                                                   >>  83     std::vector<G4FluoTransition*> vectorOfTransitions;
                                                   >>  84     fluoManager->LoadData(Znum);
                                                   >>  85     
                                                   >>  86     size_t numberOfVacancies = fluoManager-> NumberOfVacancies();
                                                   >>  87     
                                                   >>  88     for (size_t vacancyIndex = 0; vacancyIndex<numberOfVacancies;  vacancyIndex++)
                                                   >>  89       
                                                   >>  90       {
                                                   >>  91   std::vector<G4int>  vectorOfIds;
                                                   >>  92   G4DataVector vectorOfEnergies;
                                                   >>  93   G4DataVector vectorOfProbabilities;
                                                   >>  94   
                                                   >>  95   G4int finalShell = fluoManager->VacancyId(vacancyIndex);
                                                   >>  96   size_t numberOfTransitions = fluoManager->NumberOfTransitions(vacancyIndex);
                                                   >>  97   for (size_t origShellIndex = 0; origShellIndex < numberOfTransitions;
                                                   >>  98        origShellIndex++)
                                                   >>  99       
                                                   >> 100     {
                                                   >> 101       
                                                   >> 102       G4int originatingShellId = fluoManager->StartShellId(origShellIndex,vacancyIndex);
                                                   >> 103       
                                                   >> 104       vectorOfIds.push_back(originatingShellId);
                                                   >> 105       
                                                   >> 106       G4double transitionEnergy = fluoManager->StartShellEnergy(origShellIndex,vacancyIndex);
                                                   >> 107       vectorOfEnergies.push_back(transitionEnergy);
                                                   >> 108       G4double transitionProbability = fluoManager->StartShellProb(origShellIndex,vacancyIndex);
                                                   >> 109       vectorOfProbabilities.push_back(transitionProbability);
                                                   >> 110     }
                                                   >> 111     G4FluoTransition * transition = new G4FluoTransition (finalShell,vectorOfIds,
                                                   >> 112                     vectorOfEnergies,vectorOfProbabilities);
                                                   >> 113     vectorOfTransitions.push_back(transition); 
                                                   >> 114       }
                                                   >> 115     //      transitionTable.insert(std::make_pair(Znum, vectorOfTransitions));
                                                   >> 116     transitionTable[Znum] = vectorOfTransitions;
                                                   >> 117       
                                                   >> 118       delete fluoManager;
                                                   >> 119     }
                                                   >> 120   delete shellManager;
                                                   >> 121 }
 62                                                   122 
 63 //....oooOO0OOooo........oooOO0OOooo........oo << 
 64 G4AtomicTransitionManager::~G4AtomicTransition    123 G4AtomicTransitionManager::~G4AtomicTransitionManager()
                                                   >> 124   
 65 {                                                 125 { 
                                                   >> 126 
 66   delete augerData;                               127   delete augerData;
                                                   >> 128 
                                                   >> 129 std::map<G4int,std::vector<G4AtomicShell*>,std::less<G4int> >::iterator pos;
 67                                                   130  
 68   for (auto& pos : shellTable){                << 131  for (pos = shellTable.begin(); pos != shellTable.end(); pos++){
 69     std::vector<G4AtomicShell*>vec = pos.secon << 132    
 70     std::size_t vecSize = vec.size();          << 133    std::vector< G4AtomicShell*>vec = (*pos).second;
 71     for (std::size_t i=0; i< vecSize; ++i){    << 134    
 72       G4AtomicShell* shell = vec[i];           << 135    G4int vecSize=vec.size();
 73       delete shell;                            << 136    
 74     }                                          << 137    for (G4int i=0; i< vecSize; i++){
 75   }                                            << 138      G4AtomicShell* shell = vec[i];
                                                   >> 139      delete shell;     
                                                   >> 140    }
                                                   >> 141    
                                                   >> 142  }
 76                                                   143  
 77   for (auto& ppos : transitionTable)           << 144  std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::iterator ppos;
 78     {                                          << 145  
 79       std::vector<G4FluoTransition*>vec = ppos << 146  for (ppos = transitionTable.begin(); ppos != transitionTable.end(); ppos++){
 80       std::size_t vecSize=vec.size();          << 
 81                                                   147    
 82       for (std::size_t i=0; i< vecSize; ++i){  << 148    std::vector<G4FluoTransition*>vec = (*ppos).second;
 83   G4FluoTransition* transition = vec[i];       << 149    
 84   delete transition;                           << 150    G4int vecSize=vec.size();
 85       }                                        << 151    
 86     }                                          << 152    for (G4int i=0; i< vecSize; i++){
                                                   >> 153    G4FluoTransition* transition = vec[i];
                                                   >> 154    delete transition;      
                                                   >> 155    }
                                                   >> 156    
                                                   >> 157  }   
                                                   >> 158  
 87 }                                                 159 }
 88 //....oooOO0OOooo........oooOO0OOooo........oo << 160 
 89 G4AtomicShell*                                 << 161 G4AtomicTransitionManager* G4AtomicTransitionManager::instance = 0;
 90 G4AtomicTransitionManager::Shell(G4int Z, size << 162 
 91 {                                              << 163 G4AtomicTransitionManager* G4AtomicTransitionManager::Instance()
 92   auto pos = shellTable.find(Z);               << 164 {
                                                   >> 165   if (instance == 0)
                                                   >> 166     {
                                                   >> 167       instance = new G4AtomicTransitionManager;
                                                   >> 168      
                                                   >> 169     }
                                                   >> 170   return instance;
                                                   >> 171 }
                                                   >> 172 
                                                   >> 173 
                                                   >> 174 G4AtomicShell* G4AtomicTransitionManager::Shell(G4int Z, size_t shellIndex) const
                                                   >> 175 { 
                                                   >> 176   std::map<G4int,std::vector<G4AtomicShell*>,std::less<G4int> >::const_iterator pos;
                                                   >> 177   
                                                   >> 178   pos = shellTable.find(Z);
 93                                                   179   
 94   if (pos!= shellTable.end())                     180   if (pos!= shellTable.end())
 95     {                                             181     {
 96       std::vector<G4AtomicShell*> v = (*pos).s    182       std::vector<G4AtomicShell*> v = (*pos).second;
 97       if (shellIndex < v.size()) { return v[sh << 183       if (shellIndex<v.size())
 98                                                << 184   {
                                                   >> 185     return(v[shellIndex]);
                                                   >> 186   }
 99       else                                        187       else 
100   {                                               188   {
101     size_t lastShell = v.size();                  189     size_t lastShell = v.size();
102     G4ExceptionDescription ed;                 << 190     G4cout << "G4AtomicTransitionManager::Shell - Z = " 
103     ed << "No de-excitation for Z= " << Z      << 191      << Z << ", shellIndex = " << shellIndex 
104        << "  shellIndex= " << shellIndex       << 192      << " not found; number of shells = " << lastShell << G4endl;
105        << ">=  numberOfShells= " << lastShell; << 193     //  G4Exception("G4AtomicTransitionManager:shell not found");
106     if (verboseLevel > 0)                      << 194     if (lastShell > 0)
107               G4Exception("G4AtomicTransitionM << 195       {
108     JustWarning,ed," AtomicShell not found");  << 196         return v[lastShell - 1];
109     if (lastShell > 0) { return v[lastShell -  << 197       }
                                                   >> 198     else
                                                   >> 199       {     
                                                   >> 200         return 0;
                                                   >> 201       }
110   }                                               202   }
111     }                                             203     }
112   else                                            204   else
113     {                                             205     {
114       G4ExceptionDescription ed;               << 206       G4Exception("G4AtomicTransitionManager:Z not found");
115       ed << "No de-excitation for Z= " << Z    << 207       return 0;
116    << "  shellIndex= " << shellIndex           << 
117    << ". AtomicShell not found - check if data << 
118       G4Exception("G4AtomicTransitionManager:: << 
119       FatalException,ed,"");                   << 
120     }                                             208     } 
121   return 0;                                    << 
122 }                                                 209 }
123                                                   210 
124 //....oooOO0OOooo........oooOO0OOooo........oo << 211 // This function gives, upon Z and the Index of the initial shell where te vacancy is, 
                                                   >> 212 // the radiative transition that can happen (originating shell, energy, probability)
125                                                   213 
126 // This function gives, upon Z and the Index o << 214 const G4FluoTransition* G4AtomicTransitionManager::ReachableShell(G4int Z,size_t shellIndex) const
127 // the vacancy is, the radiative transition th << 
128 // shell, energy, probability)                 << 
129 const G4FluoTransition*                        << 
130 G4AtomicTransitionManager::ReachableShell(G4in << 
131 {                                                 215 {
132   auto pos = transitionTable.find(Z);          << 216   std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::const_iterator pos;
                                                   >> 217   pos = transitionTable.find(Z);
133   if (pos!= transitionTable.end())                218   if (pos!= transitionTable.end())
134     {                                             219     {
135       std::vector<G4FluoTransition*> v = (*pos    220       std::vector<G4FluoTransition*> v = (*pos).second;      
136       if (shellIndex < v.size()) { return(v[sh << 221       if (shellIndex < v.size()) return(v[shellIndex]);
137                                                << 
138       else {                                      222       else {
139   G4ExceptionDescription ed;                   << 223   G4Exception("G4AtomicTransitionManager:reachable shell not found");
140   ed << "No fluo transition for Z= " << Z      << 224   return 0;
141      << "  shellIndex= " << shellIndex;        << 
142   G4Exception("G4AtomicTransitionManager::Reac << 
143         FatalException,ed,"");                 << 
144       }                                           225       }
145     }                                          << 226   }
146   else                                         << 227   else{
147     {                                          << 228     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
148       G4ExceptionDescription ed;               << 229     G4cout << "Absorbed enrgy deposited locally" << G4endl;
149       ed << "No transition table for Z= " << Z << 230 
150    << "  shellIndex= " << shellIndex;          << 231     //    G4Exception("G4AtomicTransitionManager:Z not found");
151       G4Exception("G4AtomicTransitionManager:: << 232     return 0;
152       FatalException,ed,"");                   << 233   } 
153     }                                          << 
154   return 0;                                    << 
155 }                                                 234 }
156                                                   235 
157 //....oooOO0OOooo........oooOO0OOooo........oo << 236 const G4AugerTransition* G4AtomicTransitionManager::ReachableAugerShell(G4int Z, G4int vacancyShellIndex) const
158 const G4AugerTransition*                       << 
159 G4AtomicTransitionManager::ReachableAugerShell << 
160                  G4int vacancyShellIndex) cons << 
161 {                                                 237 {
162   return augerData->GetAugerTransition(Z,vacan << 238   
                                                   >> 239   G4AugerTransition* augerTransition = augerData->GetAugerTransition(Z,vacancyShellIndex);
                                                   >> 240   return augerTransition;
163 }                                                 241 }
164                                                   242 
165 //....oooOO0OOooo........oooOO0OOooo........oo << 243 
                                                   >> 244 
166 G4int G4AtomicTransitionManager::NumberOfShell    245 G4int G4AtomicTransitionManager::NumberOfShells (G4int Z) const
167 {                                                 246 {
168   auto pos = shellTable.find(Z);               << 
169                                                   247 
170   std::size_t res = 0;                         << 248 std::map<G4int,std::vector<G4AtomicShell*>,std::less<G4int> >::const_iterator pos;
171   if (pos != shellTable.cend()){               << 
172                                                   249 
173     res = ((*pos).second).size();              << 250   pos = shellTable.find(Z);
174                                                   251 
175   } else {                                     << 252   if (pos!= shellTable.end()){
176     G4ExceptionDescription ed;                 << 253 
177     ed << "No deexcitation for Z= " << Z;      << 254     std::vector<G4AtomicShell*> v = (*pos).second;
178     G4Exception("G4AtomicTransitionManager::Nu << 255 
179     FatalException, ed, "");                   << 256     return v.size();
                                                   >> 257   }
                                                   >> 258 
                                                   >> 259   else{
                                                   >> 260     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
                                                   >> 261     G4cout << "Absorbed enrgy deposited locally" << G4endl;
                                                   >> 262 
                                                   >> 263     //    G4Exception("G4AtomicTransitionManager:Z not found");
                                                   >> 264     return 0;
180   }                                               265   } 
181   return (G4int)res;                           << 
182 }                                                 266 }
183                                                   267 
184 //....oooOO0OOooo........oooOO0OOooo........oo << 268 // This function returns the number of possible radiative transitions for the atom with atomic number Z
185 // This function returns the number of possibl << 269 // i.e. the number of shell in wich a vacancy can be filled with a radiative transition 
186 // the atom with atomic number Z i.e. the numb << 270 
187 // can be filled with a radiative transition   << 
188 G4int G4AtomicTransitionManager::NumberOfReach    271 G4int G4AtomicTransitionManager::NumberOfReachableShells(G4int Z) const
189 {                                                 272 {
190   auto pos = transitionTable.find(Z);          << 273 std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::const_iterator pos;
191   std::size_t res = 0;                         << 274 
192   if (pos!= transitionTable.cend())            << 275   pos = transitionTable.find(Z);
                                                   >> 276 
                                                   >> 277   if (pos!= transitionTable.end())
193     {                                             278     {
194       res = ((*pos).second).size();            << 279       std::vector<G4FluoTransition*> v = (*pos).second;
                                                   >> 280       return v.size();
195     }                                             281     }
196   else                                            282   else
197     {                                             283     {
198       G4ExceptionDescription ed;               << 284       G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
199       ed << "No deexcitation for Z= " << Z     << 285       G4cout << "Absorbed enrgy deposited locally" << G4endl;
200    << ", so energy deposited locally";         << 286 
201       G4Exception("G4AtomicTransitionManager:: << 287       //    G4Exception("G4AtomicTransitionManager:Z not found");
202       "de0001",FatalException,ed,"");          << 288       return 0;
203     }                                             289     } 
204   return (G4int)res;                           << 
205 }                                                 290 }
206                                                   291 
207 //....oooOO0OOooo........oooOO0OOooo........oo << 292 // This function returns the number of possible NON-radiative transitions for the atom with atomic number Z
208 // This function returns the number of possibl << 293 // i.e. the number of shell in wich a vacancy can be filled with a NON-radiative transition 
209 // for the atom with atomic number Z i.e. the  << 294 
210 // vacancy can be filled with a NON-radiative  << 
211 G4int G4AtomicTransitionManager::NumberOfReach    295 G4int G4AtomicTransitionManager::NumberOfReachableAugerShells(G4int Z)const 
212 {                                                 296 {
213   return (G4int)augerData->NumberOfVacancies(Z << 297   G4int n = augerData->NumberOfVacancies(Z);
                                                   >> 298   return n;
214 }                                                 299 }
215                                                   300 
216 //....oooOO0OOooo........oooOO0OOooo........oo << 301 
217 G4double G4AtomicTransitionManager::TotalRadia << 302 
218          G4int Z, size_t shellIndex) const     << 303 G4double G4AtomicTransitionManager::TotalRadiativeTransitionProbability(G4int Z, 
                                                   >> 304                   size_t shellIndex)
                                                   >> 305 
219 {                                                 306 {
220   auto pos = transitionTable.find(Z);          << 307 std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::iterator pos;
221   G4double totalRadTransProb = 0.0;            << 308 
                                                   >> 309   pos = transitionTable.find(Z);
222                                                   310 
223   if (pos!= transitionTable.end())                311   if (pos!= transitionTable.end())
224     {                                             312     {
225       std::vector<G4FluoTransition*> v = (*pos    313       std::vector<G4FluoTransition*> v = (*pos).second;
226                                                   314       
227       if (shellIndex < v.size())               << 315     if (shellIndex < v.size())
228   {                                            << 316       {
229     G4FluoTransition* transition = v[shellInde << 317   G4FluoTransition* transition = v[shellIndex];
230     G4DataVector transProb = transition->Trans << 318   G4DataVector transProb = transition->TransitionProbabilities();
                                                   >> 319   G4double totalRadTransProb = 0;
231                                                   320   
232     for (size_t j=0; j<transProb.size(); ++j)  << 321   for (size_t j = 0; j<transProb.size(); j++) // AM -- corrected, it was 1
233       {                                        << 
234         totalRadTransProb += transProb[j];     << 
235       }                                        << 
236   }                                            << 
237       else                                     << 
238   {                                               322   {
239     G4ExceptionDescription ed;                 << 323     totalRadTransProb = totalRadTransProb + transProb[j];
240     ed << "Zero transition probability for Z=" << 
241        << "  shellIndex= " << shellIndex;      << 
242     G4Exception(                               << 
243     "G4AtomicTransitionManager::TotalRadiative << 
244     "de0002",FatalException,"Incorrect de-exci << 
245   }                                               324   }
                                                   >> 325       return totalRadTransProb;   
                                                   >> 326       
                                                   >> 327     }
                                                   >> 328     else {
                                                   >> 329       G4Exception( "G4AtomicTransitionManager: shell not found" );
                                                   >> 330       return 0;
                                                   >> 331       
246     }                                             332     }
247   else                                         << 
248     {                                          << 
249       G4ExceptionDescription ed;               << 
250       ed << "No deexcitation for Z=" << Z      << 
251    << "  shellIndex= " << shellIndex;          << 
252       G4Exception(                             << 
253       "G4AtomicTransitionManager::TotalRadiati << 
254       "de0001",FatalException,ed,"Cannot compu << 
255     }                                          << 
256   return totalRadTransProb;                    << 
257 }                                              << 
258                                                << 
259 //....oooOO0OOooo........oooOO0OOooo........oo << 
260 G4double G4AtomicTransitionManager::TotalNonRa << 
261                  G4int Z, size_t shellIndex) c << 
262 {                                              << 
263   G4double prob = 1.0 - TotalRadiativeTransiti << 
264   if(prob > 1.0 || prob < 0.0) {               << 
265     G4ExceptionDescription ed;                 << 
266     ed << "Total probability mismatch Z= " <<  << 
267        << "  shellIndex= " << shellIndex       << 
268        << "  prob= " << prob;                  << 
269     G4Exception(                               << 
270     "G4AtomicTransitionManager::TotalNonRadiat << 
271     "de0003",FatalException,ed,"Cannot compute << 
272     return 0.0;                                << 
273   }                                               333   }
274   return prob;                                 << 334   else{
                                                   >> 335     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
                                                   >> 336     G4cout << "Absorbed enrgy deposited locally" << G4endl;
                                                   >> 337 
                                                   >> 338     //    G4Exception("G4AtomicTransitionManager:Z not found");
                                                   >> 339 
                                                   >> 340     return 0;
                                                   >> 341   } 
275 }                                                 342 }
276                                                   343 
277 //....oooOO0OOooo........oooOO0OOooo........oo << 344 G4double G4AtomicTransitionManager::TotalNonRadiativeTransitionProbability(G4int Z, size_t shellIndex)
278 void G4AtomicTransitionManager::Initialise()   << 
279 {                                              << 
280   if(isInitialized) { return; }                << 
281   G4AutoLock l(&AtomicTransitionManagerMutex); << 
282                                                   345 
283   if(isInitialized) { return; }                << 346 {
284   isInitialized = true;                        << 
285                                                   347 
286   // Selection of fluorescence files           << 348   std::map<G4int,std::vector<G4FluoTransition*>,std::less<G4int> >::iterator pos;
287                                                   349   
288   const G4String& defaultDirectory = "/fluor"; << 350   pos = transitionTable.find(Z);
289   G4String fluoDirectory = defaultDirectory;   << 
290   G4String bindingDirectory = defaultDirectory << 
291   G4EmFluoDirectory fdir = G4EmParameters::Ins << 
292   G4int zLim = zMax + 1;                       << 
293   if(fdir == fluoBearden) {                    << 
294     zMax = 100;                                << 
295     supTableLimit = 100;                       << 
296     bindingDirectory = fluoDirectory = "/fluor << 
297   } else if(fdir == fluoANSTO) {               << 
298     zLim = 93;                                 << 
299     fluoDirectory = "/fluor_ANSTO";            << 
300   } else if(fdir == fluoXDB_EADL) {            << 
301     zMax = 100;                                << 
302     supTableLimit = 100;                       << 
303     bindingDirectory = fluoDirectory = "/fluor << 
304   }                                            << 
305                                                << 
306   // infTableLimit is initialized to 6 because << 
307   G4ShellData* shellManager = new G4ShellData( << 
308   shellManager->LoadData(bindingDirectory + "/ << 
309                                                << 
310   // initialization of the data for auger effe << 
311   augerData = new G4AugerData;                 << 
312                                                   351   
313   // Fills shellTable with the data from EADL, << 352   if (pos!= transitionTable.end()){
314   // energies of shells                        << 353     
315   for (G4int Z = zMin; Z <= zMax; ++Z)         << 354     std::vector<G4FluoTransition*> v = (*pos).second;
316     {                                          << 
317       std::vector<G4AtomicShell*> vectorOfShel << 
318       G4int shellIndex = 0;                    << 
319                                                << 
320       G4int numberOfShells = (G4int)shellManag << 
321       for (shellIndex = 0; shellIndex<numberOf << 
322   {                                            << 
323     G4int shellId = shellManager->ShellId(Z,sh << 
324     G4double bindingEnergy = shellManager->Bin << 
325     G4AtomicShell * shell = new G4AtomicShell( << 
326     vectorOfShells.push_back(shell);           << 
327   }                                            << 
328       shellTable[Z] = std::move(vectorOfShells << 
329     }                                          << 
330                                                   355   
331   // Fills transitionTable with the data on id << 
332   // energies and transition probabilities     << 
333   G4String dir = std::move(fluoDirectory);     << 
334   for (G4int Znum= infTableLimit; Znum<=supTab << 
335     {                                          << 
336       if (Znum == zLim) { dir = defaultDirecto << 
337       G4FluoData* fluoManager = new G4FluoData << 
338       std::vector<G4FluoTransition*> vectorOfT << 
339       fluoManager->LoadData(Znum);             << 
340                                                   356     
341       G4int numberOfVacancies = (G4int)fluoMan << 357     if (shellIndex<v.size()){
342       for(G4int vacancyIndex = 0; vacancyIndex << 358 
343     ++vacancyIndex)                            << 359       G4FluoTransition* transition=v[shellIndex];
                                                   >> 360       G4DataVector transProb = transition->TransitionProbabilities();
                                                   >> 361       G4double totalRadTransProb = 0;
                                                   >> 362       
                                                   >> 363       for(size_t j = 0; j<transProb.size(); j++) // AM -- Corrected, was 1
344   {                                               364   {
345     std::vector<G4int> vectorOfIds;            << 365     totalRadTransProb = totalRadTransProb + transProb[j];
346     G4DataVector vectorOfEnergies;             << 
347     G4DataVector vectorOfProbabilities;        << 
348                                                << 
349     G4int finalShell = fluoManager->VacancyId( << 
350     G4int numberOfTransitions = (G4int)        << 
351                 fluoManager->NumberOfTransitio << 
352     for (G4int origShellIndex = 0; origShellIn << 
353          ++origShellIndex)                     << 
354       {                                        << 
355         G4int originatingShellId =             << 
356     fluoManager->StartShellId(origShellIndex,v << 
357         vectorOfIds.push_back(originatingShell << 
358                                                << 
359         G4double transitionEnergy =            << 
360     fluoManager->StartShellEnergy(origShellInd << 
361         vectorOfEnergies.push_back(transitionE << 
362         G4double transitionProbability =       << 
363     fluoManager->StartShellProb(origShellIndex << 
364         vectorOfProbabilities.push_back(transi << 
365       }                                        << 
366     G4FluoTransition* transition =             << 
367       new G4FluoTransition (finalShell,vectorO << 
368           vectorOfEnergies,vectorOfProbabiliti << 
369     vectorOfTransitions.push_back(transition); << 
370   }                                               366   }
371       transitionTable[Znum] = std::move(vector << 367       
372       delete fluoManager;                      << 368       if (totalRadTransProb > 1) {
                                                   >> 369       G4Exception( "Wrong Total Probability");
                                                   >> 370       return 0;
                                                   >> 371 }
                                                   >> 372       G4double totalNonRadTransProb= (1 - totalRadTransProb);
                                                   >> 373       
                                                   >> 374       return totalNonRadTransProb;    }
                                                   >> 375     
                                                   >> 376     else {
                                                   >> 377       G4Exception( "shell not found");
                                                   >> 378       return 0;
373     }                                             379     }
374   delete shellManager;                         << 380   }
375   l.unlock();                                  << 381   else{
                                                   >> 382     G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
                                                   >> 383     G4cout << "Absorbed enrgy deposited locally" << G4endl;
                                                   >> 384 
                                                   >> 385     //    G4Exception("G4AtomicTransitionManager:Z not found");
                                                   >> 386     return 0;
                                                   >> 387   } 
376 }                                                 388 }
                                                   >> 389 
                                                   >> 390 
                                                   >> 391 
                                                   >> 392 
                                                   >> 393 
                                                   >> 394 
                                                   >> 395 
                                                   >> 396 
                                                   >> 397 
                                                   >> 398 
377                                                   399