Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4RDAtomicTransitionManager.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4RDAtomicTransitionManager.cc,v 1.2 ????
28 // GEANT4 tag $Name: emlowen-V09-01-01 $
29 //
30 // Authors: Elena Guardincerri (Elena.Guardincerri@ge.infn.it)
31 // Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
32 //
33 // History:
34 // -----------
35 // 16 Sep 2001 E. Guardincerri First Committed to cvs
36 //
37 // -------------------------------------------------------------------
38 
40 
42  G4int limitInfTable,G4int limitSupTable)
43  :zMin(minZ),
44  zMax(maxZ),
45  infTableLimit(limitInfTable),
46  supTableLimit(limitSupTable)
47 {
48  // infTableLimit is initialized to 6 because EADL lacks data for Z<=5
49  G4RDShellData* shellManager = new G4RDShellData;
50 
51  // initialization of the data for auger effect
52 
53  augerData = new G4RDAugerData;
54 
55  shellManager->LoadData("/fluor/binding");
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<G4RDAtomicShell*> 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  G4RDAtomicShell * shell = new G4RDAtomicShell(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  { G4RDFluoData* fluoManager = new G4RDFluoData;
83  std::vector<G4RDFluoTransition*> 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  G4RDFluoTransition * transition = new G4RDFluoTransition (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 }
122 
124 
125 {
126 
127  delete augerData;
128 
129 std::map<G4int,std::vector<G4RDAtomicShell*>,std::less<G4int> >::iterator pos;
130 
131  for (pos = shellTable.begin(); pos != shellTable.end(); pos++){
132 
133  std::vector< G4RDAtomicShell*>vec = (*pos).second;
134 
135  G4int vecSize=vec.size();
136 
137  for (G4int i=0; i< vecSize; i++){
138  G4RDAtomicShell* shell = vec[i];
139  delete shell;
140  }
141 
142  }
143 
144  std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::iterator ppos;
145 
146  for (ppos = transitionTable.begin(); ppos != transitionTable.end(); ppos++){
147 
148  std::vector<G4RDFluoTransition*>vec = (*ppos).second;
149 
150  G4int vecSize=vec.size();
151 
152  for (G4int i=0; i< vecSize; i++){
153  G4RDFluoTransition* transition = vec[i];
154  delete transition;
155  }
156 
157  }
158 
159 }
160 
161 G4RDAtomicTransitionManager* G4RDAtomicTransitionManager::instance = 0;
162 
164 {
165  if (instance == 0)
166  {
167  instance = new G4RDAtomicTransitionManager;
168 
169  }
170  return instance;
171 }
172 
173 
175 {
176  std::map<G4int,std::vector<G4RDAtomicShell*>,std::less<G4int> >::const_iterator pos;
177 
178  pos = shellTable.find(Z);
179 
180  if (pos!= shellTable.end())
181  {
182  std::vector<G4RDAtomicShell*> v = (*pos).second;
183  if (shellIndex<v.size())
184  {
185  return(v[shellIndex]);
186  }
187  else
188  {
189  size_t lastShell = v.size();
190  G4cout << "G4RDAtomicTransitionManager::Shell - Z = "
191  << Z << ", shellIndex = " << shellIndex
192  << " not found; number of shells = " << lastShell << G4endl;
193  // G4Exception("G4RDAtomicTransitionManager:shell not found");
194  if (lastShell > 0)
195  {
196  return v[lastShell - 1];
197  }
198  else
199  {
200  return 0;
201  }
202  }
203  }
204  else
205  {
206  G4Exception("G4RDAtomicTransitionManager::Shell()",
207  "InvalidSetup", FatalException, "Z not found!");
208  return 0;
209  }
210 }
211 
212 // This function gives, upon Z and the Index of the initial shell where te vacancy is,
213 // the radiative transition that can happen (originating shell, energy, probability)
214 
216 {
217  std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::const_iterator pos;
218  pos = transitionTable.find(Z);
219  if (pos!= transitionTable.end())
220  {
221  std::vector<G4RDFluoTransition*> v = (*pos).second;
222  if (shellIndex < v.size()) return(v[shellIndex]);
223  else {
224  G4Exception("G4RDAtomicTransitionManager::ReachableShell()",
225  "InvalidCondition", FatalException,
226  "Reachable shell not found!");
227  return 0;
228  }
229  }
230  else{
231  G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
232  G4cout << "Absorbed enrgy deposited locally" << G4endl;
233 
234  // G4Exception("G4RDAtomicTransitionManager:Z not found");
235  return 0;
236  }
237 }
238 
240 {
241 
242  G4RDAugerTransition* augerTransition = augerData->GetAugerTransition(Z,vacancyShellIndex);
243  return augerTransition;
244 }
245 
246 
247 
249 {
250 
251 std::map<G4int,std::vector<G4RDAtomicShell*>,std::less<G4int> >::const_iterator pos;
252 
253  pos = shellTable.find(Z);
254 
255  if (pos!= shellTable.end()){
256 
257  std::vector<G4RDAtomicShell*> v = (*pos).second;
258 
259  return v.size();
260  }
261 
262  else{
263  G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
264  G4cout << "Absorbed enrgy deposited locally" << G4endl;
265 
266  // G4Exception("G4RDAtomicTransitionManager:Z not found");
267  return 0;
268  }
269 }
270 
271 // This function returns the number of possible radiative transitions for the atom with atomic number Z
272 // i.e. the number of shell in wich a vacancy can be filled with a radiative transition
273 
275 {
276 std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::const_iterator pos;
277 
278  pos = transitionTable.find(Z);
279 
280  if (pos!= transitionTable.end())
281  {
282  std::vector<G4RDFluoTransition*> v = (*pos).second;
283  return v.size();
284  }
285  else
286  {
287  G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
288  G4cout << "Absorbed enrgy deposited locally" << G4endl;
289 
290  // G4Exception("G4RDAtomicTransitionManager:Z not found");
291  return 0;
292  }
293 }
294 
295 // This function returns the number of possible NON-radiative transitions for the atom with atomic number Z
296 // i.e. the number of shell in wich a vacancy can be filled with a NON-radiative transition
297 
299 {
300  G4int n = augerData->NumberOfVacancies(Z);
301  return n;
302 }
303 
304 
305 
307  size_t shellIndex)
308 
309 {
310 std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::iterator pos;
311 
312  pos = transitionTable.find(Z);
313 
314  if (pos!= transitionTable.end())
315  {
316  std::vector<G4RDFluoTransition*> v = (*pos).second;
317 
318  if (shellIndex < v.size())
319  {
320  G4RDFluoTransition* transition = v[shellIndex];
321  G4DataVector transProb = transition->TransitionProbabilities();
322  G4double totalRadTransProb = 0;
323 
324  for (size_t j = 0; j<transProb.size(); j++) // AM -- corrected, it was 1
325  {
326  totalRadTransProb = totalRadTransProb + transProb[j];
327  }
328  return totalRadTransProb;
329 
330  }
331  else {
332  G4Exception("G4RDAtomicTransitionManager::TotalRadiativeTransitionProbability()",
333  "InvalidCondition", FatalException, "Shell not found!" );
334  return 0;
335 
336  }
337  }
338  else{
339  G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
340  G4cout << "Absorbed enrgy deposited locally" << G4endl;
341 
342  // G4Exception("G4RDAtomicTransitionManager:Z not found");
343 
344  return 0;
345  }
346 }
347 
349 
350 {
351 
352  std::map<G4int,std::vector<G4RDFluoTransition*>,std::less<G4int> >::iterator pos;
353 
354  pos = transitionTable.find(Z);
355 
356  if (pos!= transitionTable.end()){
357 
358  std::vector<G4RDFluoTransition*> v = (*pos).second;
359 
360 
361  if (shellIndex<v.size()){
362 
363  G4RDFluoTransition* transition=v[shellIndex];
364  G4DataVector transProb = transition->TransitionProbabilities();
365  G4double totalRadTransProb = 0;
366 
367  for(size_t j = 0; j<transProb.size(); j++) // AM -- Corrected, was 1
368  {
369  totalRadTransProb = totalRadTransProb + transProb[j];
370  }
371 
372  G4double totalNonRadTransProb= (1 - totalRadTransProb);
373 
374  return totalNonRadTransProb; }
375 
376  else {
377  G4Exception("G4RDAtomicTransitionManager::TotalNonRadiativeTransitionProbability()",
378  "InvalidCondition", FatalException, "Shell not found!");
379  return 0;
380  }
381  }
382  else{
383  G4cout << "G4AtomicTransitionMagare warning: No fluorescence or Auger for Z=" << Z << G4endl;
384  G4cout << "Absorbed enrgy deposited locally" << G4endl;
385 
386  // G4Exception("G4RDAtomicTransitionManager:Z not found");
387  return 0;
388  }
389 }
390 
391 
392 
393 
394 
395 
396 
397 
398 
399