source: trunk/source/processes/electromagnetic/lowenergy/test/G4AtomicTransitionManagerTest.cc @ 1350

Last change on this file since 1350 was 1350, checked in by garnier, 13 years ago

update to last version 4.9.4

File size: 6.5 KB
Line 
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#include "G4AtomicTransitionManager.hh"
27#include "globals.hh"
28#include "G4ios.hh"
29#include <vector>
30
31int main() {
32
33
34  G4int Z;
35  G4int subShell;
36
37  G4cout << "Enter Z " << G4endl;
38  G4cin >> Z;
39
40  G4AtomicTransitionManager* transManager = G4AtomicTransitionManager::Instance();
41
42  G4cout << "Number of shells: " << transManager->NumberOfShells(Z)<<G4endl;
43
44
45
46  G4cout<< "Number of Fluo vacancies: "<<transManager->NumberOfReachableShells(Z)<<G4endl;
47
48
49
50 
51  G4cout << "Testing G4AtomicShell" << G4endl;
52  G4cout << "Select the index of the subshell whose binding energy you need: " << G4endl;
53  G4cin >> subShell;
54  G4cout << "Primary Shell: " << transManager->Shell(Z,subShell)->ShellId() << G4endl;
55  G4cout << "SubShell binding energy: " << transManager->Shell(Z,subShell)->BindingEnergy() << G4endl;
56 
57  G4cout << "Testing G4AtomicShell" << G4endl;
58  G4int shellIndex;
59
60
61  G4cout <<" Select the index of the Fluo vacancy "<<G4endl;
62  G4cin>> shellIndex; 
63 
64  G4cout << "Testing G4FluoTransition "<<G4endl;
65  std::vector<G4double> transEnergies = transManager->ReachableShell(Z,shellIndex)->TransitionEnergies();
66  std::vector<G4int> transIds = transManager->ReachableShell(Z,shellIndex)->OriginatingShellIds();
67  std::vector<G4double> transProbs = transManager->ReachableShell(Z,shellIndex)->TransitionProbabilities();
68
69  for (G4int trans=0; trans<transIds.size(); trans++) {
70
71    G4cout << "The transition starts from the shell: " << transIds[trans] << G4endl;
72    G4cout << "The transition starts from the shell: " << 
73
74
75      transManager->ReachableShell(Z,shellIndex)->OriginatingShellId(trans) << G4endl;
76
77
78    G4cout << " Transition energy: " << transEnergies[trans] << G4endl;
79    G4cout << "Transition energy: " << 
80      transManager->ReachableShell(Z,shellIndex)->TransitionEnergy(trans) << G4endl;
81
82    G4cout << "Transition probability: " << transProbs[trans] << G4endl;
83    G4cout << "Transition probability: " << 
84      transManager->ReachableShell(Z,shellIndex)->TransitionProbability(trans) << G4endl;
85
86  }
87
88  /* ===Atention=== the data given out by the following code usually doesn't
89     corespond to the data of the preceding one, I.E. the vacancy used for the testing of auger
90     effect isn't the same of that used for Fluorescence.
91  */
92
93
94
95  G4cout<< "Number of Auger vacancies: "<<transManager->NumberOfReachableAugerShells(Z)<<G4endl;
96  G4cout <<" Select the index of the Auger vacancy "<<G4endl;
97  G4int augerVacancyIndex(0);
98  G4cin>> augerVacancyIndex; 
99
100
101  G4cout << "Testing G4AugerTransition "<<G4endl;
102
103  const G4AugerTransition* augerTransition = transManager->ReachableAugerShell(Z, augerVacancyIndex);
104 
105  const std::vector<G4int> augerTransIds = *(augerTransition->TransitionOriginatingShellIds());
106  for (G4int transIndex = 0; transIndex<(augerTransIds.size() ); transIndex++) {
107 
108    G4cout << "Questo e' augerTransIds[transIndex]: "<< augerTransIds[transIndex] << G4endl;
109
110    std::vector<G4double> augerProbs = *augerTransition->AugerTransitionProbabilities(augerTransIds[transIndex]);
111    std::vector<G4int> augerIds = *augerTransition->AugerOriginatingShellIds(augerTransIds[transIndex]);
112    std::vector<G4double> augerEnergies = *augerTransition->AugerTransitionEnergies(augerTransIds[transIndex]);
113   
114    // we r comparing the vectors elements given by G4AugerTransition with the values of the single functions.
115   
116    G4cout << "The transition starts from the shell: " << augerTransIds[transIndex] << G4endl;
117
118    G4int transId = augerTransition->TransitionOriginatingShellId(transIndex);
119
120    G4cout << "The transition starts from the shell: " << transId << G4endl;
121   
122    for (G4int trans=0; trans<augerIds.size(); trans++) {
123     
124      G4cout << "The auger electron starts from the shell: " << augerIds[trans] << G4endl;
125      G4cout << "The auger electron starts from the shell: " << 
126
127
128        augerTransition->AugerOriginatingShellId(trans, transId) << G4endl;
129
130
131     
132      G4cout << " Transition energy: " << augerEnergies[trans] << G4endl;
133      G4cout << "Transition energy: " << 
134        augerTransition->AugerTransitionEnergy(trans, transId) << G4endl;
135     
136      G4cout << "Transition probability: " << augerProbs[trans] << G4endl;
137      G4cout << "Transition probability: " << 
138         augerTransition->AugerTransitionProbability(trans, transId) << G4endl;
139     
140    }
141
142  }
143
144
145  G4cout << "Testing G4AtomicTransitionManager" << G4endl;
146
147  G4cout << "Total number of SubShells: " << transManager->NumberOfShells(Z) <<G4endl;
148
149  G4cout <<"Number of available shells: "<< transManager->NumberOfReachableShells(Z);
150
151  G4cout << "Total Probability that a radiative transition occurs: " <<
152             transManager->TotalRadiativeTransitionProbability(Z,shellIndex) <<G4endl;
153
154  G4cout << "Total Probability that a NON radiative transition occurs: " <<
155             transManager->TotalNonRadiativeTransitionProbability(Z,shellIndex) <<G4endl;
156
157  G4cout << "END OF THE MAIN PROGRAM "<<G4endl;
158}
159
Note: See TracBrowser for help on using the repository browser.