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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 11.0.p3,)


** Warning: Cannot open xref database.

  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 //                                                
 28 // Authors: Elena Guardincerri (Elena.Guardinc    
 29 //          Alfonso Mantero (Alfonso.Mantero@g    
 30 //                                                
 31 // History:                                       
 32 // -----------                                    
 33 // 16 Sep 2001 E. Guardincerri  First Committe    
 34 //                                                
 35 // -------------------------------------------    
 36                                                   
 37 #include "G4RDAtomicTransitionManager.hh"         
 38                                                   
 39 G4RDAtomicTransitionManager::G4RDAtomicTransit    
 40   G4int limitInfTable,G4int limitSupTable)        
 41   :zMin(minZ),                                    
 42   zMax(maxZ),                                     
 43   infTableLimit(limitInfTable),                   
 44   supTableLimit(limitSupTable)                    
 45 {                                                 
 46   // infTableLimit is initialized to 6 because    
 47   G4RDShellData* shellManager = new G4RDShellD    
 48                                                   
 49   // initialization of the data for auger effe    
 50                                                   
 51   augerData = new G4RDAugerData;                  
 52                                                   
 53   shellManager->LoadData("/fluor/binding");       
 54                                                   
 55   // Fills shellTable with the data from EADL,    
 56   // energies of shells                           
 57   for (G4int Z = zMin; Z<= zMax; Z++)             
 58     {                                             
 59       std::vector<G4RDAtomicShell*> vectorOfSh    
 60       size_t shellIndex = 0;                      
 61                                                   
 62       size_t numberOfShells=shellManager->Numb    
 63       for (shellIndex = 0; shellIndex<numberOf    
 64   {                                               
 65     G4int shellId = shellManager->ShellId(Z,sh    
 66     G4double bindingEnergy = shellManager->Bin    
 67                                                   
 68     G4RDAtomicShell * shell = new G4RDAtomicSh    
 69                                                   
 70     vectorOfShells.push_back(shell);              
 71   }                                               
 72                                                   
 73       //     shellTable.insert(std::make_pair(    
 74       shellTable[Z] = vectorOfShells;             
 75     }                                             
 76                                                   
 77   // Fills transitionTable with the data from     
 78   // energies and transition probabilities        
 79   for (G4int Znum= infTableLimit; Znum<=supTab    
 80     {  G4RDFluoData* fluoManager = new G4RDFlu    
 81     std::vector<G4RDFluoTransition*> vectorOfT    
 82     fluoManager->LoadData(Znum);                  
 83                                                   
 84     size_t numberOfVacancies = fluoManager-> N    
 85                                                   
 86     for (size_t vacancyIndex = 0; vacancyIndex    
 87                                                   
 88       {                                           
 89   std::vector<G4int>  vectorOfIds;                
 90   G4DataVector vectorOfEnergies;                  
 91   G4DataVector vectorOfProbabilities;             
 92                                                   
 93   G4int finalShell = fluoManager->VacancyId(va    
 94   size_t numberOfTransitions = fluoManager->Nu    
 95   for (size_t origShellIndex = 0; origShellInd    
 96        origShellIndex++)                          
 97                                                   
 98     {                                             
 99                                                   
100       G4int originatingShellId = fluoManager->    
101                                                   
102       vectorOfIds.push_back(originatingShellId    
103                                                   
104       G4double transitionEnergy = fluoManager-    
105       vectorOfEnergies.push_back(transitionEne    
106       G4double transitionProbability = fluoMan    
107       vectorOfProbabilities.push_back(transiti    
108     }                                             
109     G4RDFluoTransition * transition = new G4RD    
110                     vectorOfEnergies,vectorOfP    
111     vectorOfTransitions.push_back(transition);    
112       }                                           
113     //      transitionTable.insert(std::make_p    
114     transitionTable[Znum] = vectorOfTransition    
115                                                   
116       delete fluoManager;                         
117     }                                             
118   delete shellManager;                            
119 }                                                 
120                                                   
121 G4RDAtomicTransitionManager::~G4RDAtomicTransi    
122                                                   
123 {                                                 
124                                                   
125   delete augerData;                               
126                                                   
127 std::map<G4int,std::vector<G4RDAtomicShell*>,s    
128                                                   
129  for (pos = shellTable.begin(); pos != shellTa    
130                                                   
131    std::vector< G4RDAtomicShell*>vec = (*pos).    
132                                                   
133    G4int vecSize=vec.size();                      
134                                                   
135    for (G4int i=0; i< vecSize; i++){              
136      G4RDAtomicShell* shell = vec[i];             
137      delete shell;                                
138    }                                              
139                                                   
140  }                                                
141                                                   
142  std::map<G4int,std::vector<G4RDFluoTransition    
143                                                   
144  for (ppos = transitionTable.begin(); ppos !=     
145                                                   
146    std::vector<G4RDFluoTransition*>vec = (*ppo    
147                                                   
148    G4int vecSize=vec.size();                      
149                                                   
150    for (G4int i=0; i< vecSize; i++){              
151    G4RDFluoTransition* transition = vec[i];       
152    delete transition;                             
153    }                                              
154                                                   
155  }                                                
156                                                   
157 }                                                 
158                                                   
159 G4RDAtomicTransitionManager* G4RDAtomicTransit    
160                                                   
161 G4RDAtomicTransitionManager* G4RDAtomicTransit    
162 {                                                 
163   if (instance == 0)                              
164     {                                             
165       instance = new G4RDAtomicTransitionManag    
166                                                   
167     }                                             
168   return instance;                                
169 }                                                 
170                                                   
171                                                   
172 G4RDAtomicShell* G4RDAtomicTransitionManager::    
173 {                                                 
174   std::map<G4int,std::vector<G4RDAtomicShell*>    
175                                                   
176   pos = shellTable.find(Z);                       
177                                                   
178   if (pos!= shellTable.end())                     
179     {                                             
180       std::vector<G4RDAtomicShell*> v = (*pos)    
181       if (shellIndex<v.size())                    
182   {                                               
183     return(v[shellIndex]);                        
184   }                                               
185       else                                        
186   {                                               
187     size_t lastShell = v.size();                  
188     G4cout << "G4RDAtomicTransitionManager::Sh    
189      << Z << ", shellIndex = " << shellIndex      
190      << " not found; number of shells = " << l    
191     //  G4Exception("G4RDAtomicTransitionManag    
192     if (lastShell > 0)                            
193       {                                           
194         return v[lastShell - 1];                  
195       }                                           
196     else                                          
197       {                                           
198         return 0;                                 
199       }                                           
200   }                                               
201     }                                             
202   else                                            
203     {                                             
204       G4Exception("G4RDAtomicTransitionManager    
205                   "InvalidSetup", FatalExcepti    
206       return 0;                                   
207     }                                             
208 }                                                 
209                                                   
210 // This function gives, upon Z and the Index o    
211 // the radiative transition that can happen (o    
212                                                   
213 const G4RDFluoTransition* G4RDAtomicTransition    
214 {                                                 
215   std::map<G4int,std::vector<G4RDFluoTransitio    
216   pos = transitionTable.find(Z);                  
217   if (pos!= transitionTable.end())                
218     {                                             
219       std::vector<G4RDFluoTransition*> v = (*p    
220       if (shellIndex < v.size()) return(v[shel    
221       else {                                      
222   G4Exception("G4RDAtomicTransitionManager::Re    
223                     "InvalidCondition", FatalE    
224                     "Reachable shell not found    
225   return 0;                                       
226       }                                           
227   }                                               
228   else{                                           
229     G4cout << "G4AtomicTransitionMagare warnin    
230     G4cout << "Absorbed enrgy deposited locall    
231                                                   
232     //    G4Exception("G4RDAtomicTransitionMan    
233     return 0;                                     
234   }                                               
235 }                                                 
236                                                   
237 const G4RDAugerTransition* G4RDAtomicTransitio    
238 {                                                 
239                                                   
240   G4RDAugerTransition* augerTransition = auger    
241   return augerTransition;                         
242 }                                                 
243                                                   
244                                                   
245                                                   
246 G4int G4RDAtomicTransitionManager::NumberOfShe    
247 {                                                 
248                                                   
249 std::map<G4int,std::vector<G4RDAtomicShell*>,s    
250                                                   
251   pos = shellTable.find(Z);                       
252                                                   
253   if (pos!= shellTable.end()){                    
254                                                   
255     std::vector<G4RDAtomicShell*> v = (*pos).s    
256                                                   
257     return v.size();                              
258   }                                               
259                                                   
260   else{                                           
261     G4cout << "G4AtomicTransitionMagare warnin    
262     G4cout << "Absorbed enrgy deposited locall    
263                                                   
264     //    G4Exception("G4RDAtomicTransitionMan    
265     return 0;                                     
266   }                                               
267 }                                                 
268                                                   
269 // This function returns the number of possibl    
270 // i.e. the number of shell in wich a vacancy     
271                                                   
272 G4int G4RDAtomicTransitionManager::NumberOfRea    
273 {                                                 
274 std::map<G4int,std::vector<G4RDFluoTransition*    
275                                                   
276   pos = transitionTable.find(Z);                  
277                                                   
278   if (pos!= transitionTable.end())                
279     {                                             
280       std::vector<G4RDFluoTransition*> v = (*p    
281       return v.size();                            
282     }                                             
283   else                                            
284     {                                             
285       G4cout << "G4AtomicTransitionMagare warn    
286       G4cout << "Absorbed enrgy deposited loca    
287                                                   
288       //    G4Exception("G4RDAtomicTransitionM    
289       return 0;                                   
290     }                                             
291 }                                                 
292                                                   
293 // This function returns the number of possibl    
294 // i.e. the number of shell in wich a vacancy     
295                                                   
296 G4int G4RDAtomicTransitionManager::NumberOfRea    
297 {                                                 
298   G4int n = augerData->NumberOfVacancies(Z);      
299   return n;                                       
300 }                                                 
301                                                   
302                                                   
303                                                   
304 G4double G4RDAtomicTransitionManager::TotalRad    
305                   size_t shellIndex)              
306                                                   
307 {                                                 
308 std::map<G4int,std::vector<G4RDFluoTransition*    
309                                                   
310   pos = transitionTable.find(Z);                  
311                                                   
312   if (pos!= transitionTable.end())                
313     {                                             
314       std::vector<G4RDFluoTransition*> v = (*p    
315                                                   
316     if (shellIndex < v.size())                    
317       {                                           
318   G4RDFluoTransition* transition = v[shellInde    
319   G4DataVector transProb = transition->Transit    
320   G4double totalRadTransProb = 0;                 
321                                                   
322   for (size_t j = 0; j<transProb.size(); j++)     
323   {                                               
324     totalRadTransProb = totalRadTransProb + tr    
325   }                                               
326       return totalRadTransProb;                   
327                                                   
328     }                                             
329     else {                                        
330       G4Exception("G4RDAtomicTransitionManager    
331                   "InvalidCondition", FatalExc    
332       return 0;                                   
333                                                   
334     }                                             
335   }                                               
336   else{                                           
337     G4cout << "G4AtomicTransitionMagare warnin    
338     G4cout << "Absorbed enrgy deposited locall    
339                                                   
340     //    G4Exception("G4RDAtomicTransitionMan    
341                                                   
342     return 0;                                     
343   }                                               
344 }                                                 
345                                                   
346 G4double G4RDAtomicTransitionManager::TotalNon    
347                                                   
348 {                                                 
349                                                   
350   std::map<G4int,std::vector<G4RDFluoTransitio    
351                                                   
352   pos = transitionTable.find(Z);                  
353                                                   
354   if (pos!= transitionTable.end()){               
355                                                   
356     std::vector<G4RDFluoTransition*> v = (*pos    
357                                                   
358                                                   
359     if (shellIndex<v.size()){                     
360                                                   
361       G4RDFluoTransition* transition=v[shellIn    
362       G4DataVector transProb = transition->Tra    
363       G4double totalRadTransProb = 0;             
364                                                   
365       for(size_t j = 0; j<transProb.size(); j+    
366   {                                               
367     totalRadTransProb = totalRadTransProb + tr    
368   }                                               
369                                                   
370       G4double totalNonRadTransProb= (1 - tota    
371                                                   
372       return totalNonRadTransProb;    }           
373                                                   
374     else {                                        
375       G4Exception("G4RDAtomicTransitionManager    
376                   "InvalidCondition", FatalExc    
377       return 0;                                   
378     }                                             
379   }                                               
380   else{                                           
381     G4cout << "G4AtomicTransitionMagare warnin    
382     G4cout << "Absorbed enrgy deposited locall    
383                                                   
384     //    G4Exception("G4RDAtomicTransitionMan    
385     return 0;                                     
386   }                                               
387 }                                                 
388                                                   
389                                                   
390                                                   
391                                                   
392                                                   
393                                                   
394                                                   
395                                                   
396                                                   
397                                                   
398