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: CrossSectionV52.cc,v 1.4 2006/06/29 19:54:09 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ |
---|
29 | // |
---|
30 | // ------------------------------------------------------------ |
---|
31 | // |
---|
32 | // To print cross sections per atom and mean free path for simple material |
---|
33 | // |
---|
34 | #include "G4Material.hh" |
---|
35 | |
---|
36 | #include "G4PhotoElectricEffect52.hh" |
---|
37 | #include "G4ComptonScattering52.hh" |
---|
38 | #include "G4GammaConversion52.hh" |
---|
39 | |
---|
40 | #include "G4eplusAnnihilation52.hh" |
---|
41 | |
---|
42 | #include "G4eIonisation52.hh" |
---|
43 | #include "G4eBremsstrahlung52.hh" |
---|
44 | |
---|
45 | #include "G4hIonisation52.hh" |
---|
46 | |
---|
47 | #include "G4MuIonisation52.hh" |
---|
48 | #include "G4MuBremsstrahlung52.hh" |
---|
49 | #include "G4MuPairProduction52.hh" |
---|
50 | |
---|
51 | #include "globals.hh" |
---|
52 | #include "G4UnitsTable.hh" |
---|
53 | |
---|
54 | int main() { |
---|
55 | |
---|
56 | G4UnitDefinition::BuildUnitsTable(); |
---|
57 | |
---|
58 | // define materials |
---|
59 | // |
---|
60 | G4double Z, A; |
---|
61 | |
---|
62 | G4Material* material = |
---|
63 | new G4Material("Iodine", Z=53., A=126.90*g/mole, 4.93*g/cm3); |
---|
64 | |
---|
65 | G4cout << *(G4Material::GetMaterialTable()) << G4endl; |
---|
66 | |
---|
67 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
68 | |
---|
69 | // initialise gamma processes |
---|
70 | // |
---|
71 | G4PhotoElectricEffect52* phot = new G4PhotoElectricEffect52(); |
---|
72 | G4ComptonScattering52* comp = new G4ComptonScattering52(); |
---|
73 | G4GammaConversion52* conv = new G4GammaConversion52(); |
---|
74 | |
---|
75 | // compute CrossSection per atom and MeanFreePath |
---|
76 | // |
---|
77 | G4double Emin = 1.01*MeV, Emax = 2.01*MeV, dE = 100*keV; |
---|
78 | |
---|
79 | G4cout << "\n #### Gamma CrossSectionPerAtom and MeanFreePath for " |
---|
80 | << material->GetName() << G4endl; |
---|
81 | G4cout << "\n Energy \t PhotoElec \t Compton \t Conversion \t"; |
---|
82 | G4cout << "\t PhotoElec \t Compton \t Conversion" << G4endl; |
---|
83 | |
---|
84 | for (G4double Energy = Emin; Energy <= Emax; Energy += dE) { |
---|
85 | G4cout << "\n " << G4BestUnit (Energy, "Energy") |
---|
86 | << "\t" |
---|
87 | << G4BestUnit (phot->ComputeCrossSectionPerAtom(Energy,Z), "Surface") |
---|
88 | << "\t" |
---|
89 | << G4BestUnit (comp->ComputeCrossSectionPerAtom(Energy,Z), "Surface") |
---|
90 | << "\t" |
---|
91 | << G4BestUnit (conv->ComputeCrossSectionPerAtom(Energy,Z), "Surface") |
---|
92 | << "\t \t" |
---|
93 | << G4BestUnit (phot->ComputeMeanFreePath(Energy,material), "Length") |
---|
94 | << "\t" |
---|
95 | << G4BestUnit (comp->ComputeMeanFreePath(Energy,material), "Length") |
---|
96 | << "\t" |
---|
97 | << G4BestUnit (conv->ComputeMeanFreePath(Energy,material), "Length"); |
---|
98 | } |
---|
99 | |
---|
100 | G4cout << G4endl; |
---|
101 | |
---|
102 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
103 | |
---|
104 | // initialise positron annihilation |
---|
105 | // |
---|
106 | G4eplusAnnihilation52* anni = new G4eplusAnnihilation52(); |
---|
107 | |
---|
108 | // compute CrossSection per atom and MeanFreePath |
---|
109 | // |
---|
110 | Emin = 1.01*MeV; Emax = 2.01*MeV; dE = 100*keV; |
---|
111 | |
---|
112 | G4cout << "\n #### e+ annihilation CrossSectionPerAtom and MeanFreePath for " |
---|
113 | << material->GetName() << G4endl; |
---|
114 | G4cout << "\n Energy \t e+ annihil \t"; |
---|
115 | G4cout << "\t e+ annihil" << G4endl; |
---|
116 | |
---|
117 | for (G4double Energy = Emin; Energy <= Emax; Energy += dE) { |
---|
118 | G4cout << "\n " << G4BestUnit (Energy, "Energy") |
---|
119 | << "\t" |
---|
120 | << G4BestUnit (anni->ComputeCrossSectionPerAtom(Energy,Z), "Surface") |
---|
121 | << "\t \t" |
---|
122 | << G4BestUnit (anni->ComputeMeanFreePath(Energy,material), "Length"); |
---|
123 | } |
---|
124 | |
---|
125 | G4cout << G4endl; |
---|
126 | |
---|
127 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
128 | |
---|
129 | // initialise electron processes |
---|
130 | // |
---|
131 | G4ParticleDefinition* elec = G4Electron::Electron(); |
---|
132 | |
---|
133 | G4eIonisation52* ioni = new G4eIonisation52(); |
---|
134 | G4eBremsstrahlung52* brem = new G4eBremsstrahlung52(); |
---|
135 | |
---|
136 | // compute CrossSection per atom and restricted dE/dx |
---|
137 | // |
---|
138 | Emin = 1.01*MeV; Emax = 101.01*MeV; dE = 10*MeV; |
---|
139 | G4double Ecut = 100*keV; |
---|
140 | |
---|
141 | G4cout << "\n ####electron: CrossSectionPerAtom and StoppingPower for " |
---|
142 | << material->GetName() |
---|
143 | << ";\tEnergy cut = " << G4BestUnit (Ecut, "Energy") << G4endl; |
---|
144 | |
---|
145 | G4cout << "\n Energy \t ionization \t bremsstra \t"; |
---|
146 | G4cout << "\t ionization" << G4endl; |
---|
147 | |
---|
148 | for (G4double Energy = Emin; Energy <= Emax; Energy += dE) { |
---|
149 | G4cout << "\n " << G4BestUnit (Energy, "Energy") |
---|
150 | << "\t" |
---|
151 | << G4BestUnit (ioni->ComputeCrossSectionPerAtom(*elec,Energy,Z,Ecut), |
---|
152 | "Surface") |
---|
153 | << "\t" |
---|
154 | << G4BestUnit (brem->ComputeCrossSectionPerAtom( elec,Energy,Z,Ecut), |
---|
155 | "Surface") |
---|
156 | << "\t \t" |
---|
157 | << G4BestUnit (ioni->ComputeRestrictedMeandEdx(*elec,Energy,material,Ecut), |
---|
158 | "Energy/Length"); |
---|
159 | } |
---|
160 | |
---|
161 | G4cout << G4endl; |
---|
162 | |
---|
163 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
164 | |
---|
165 | // initialise hadron processes |
---|
166 | // |
---|
167 | G4ParticleDefinition* prot = G4Proton::Proton(); |
---|
168 | |
---|
169 | G4hIonisation52* ionis = new G4hIonisation52(); |
---|
170 | |
---|
171 | // compute CrossSection per atom and restricted dE/dx |
---|
172 | // |
---|
173 | Emin = 1.01*MeV; Emax = 101.01*MeV; dE = 10*MeV; |
---|
174 | Ecut = 100*keV; |
---|
175 | |
---|
176 | G4cout << "\n ####proton: CrossSectionPerAtom and StoppingPower for " |
---|
177 | << material->GetName() |
---|
178 | << ";\tEnergy cut = " << G4BestUnit (Ecut, "Energy") << G4endl; |
---|
179 | |
---|
180 | G4cout << "\n Energy \t ionization \t"; |
---|
181 | G4cout << "\t ionization" << G4endl; |
---|
182 | |
---|
183 | for (G4double Energy = Emin; Energy <= Emax; Energy += dE) { |
---|
184 | G4cout << "\n " << G4BestUnit (Energy, "Energy") |
---|
185 | << "\t" |
---|
186 | << G4BestUnit (ionis->ComputeCrossSectionPerAtom(*prot,Energy,Z,Ecut), |
---|
187 | "Surface") |
---|
188 | << "\t \t" |
---|
189 | << G4BestUnit (ionis->ComputeRestrictedMeandEdx(*prot,Energy,material,Ecut), |
---|
190 | "Energy/Length"); |
---|
191 | } |
---|
192 | |
---|
193 | G4cout << G4endl; |
---|
194 | |
---|
195 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
196 | |
---|
197 | // initialise muon processes |
---|
198 | // |
---|
199 | G4ParticleDefinition* muon = G4MuonPlus::MuonPlus(); |
---|
200 | |
---|
201 | G4MuIonisation52* muioni = new G4MuIonisation52(); |
---|
202 | G4MuBremsstrahlung52* mubrem = new G4MuBremsstrahlung52(); |
---|
203 | G4MuPairProduction52* mupair = new G4MuPairProduction52(); |
---|
204 | |
---|
205 | // compute CrossSection per atom and restricted dE/dx |
---|
206 | // |
---|
207 | Emin = 1.01*GeV; Emax = 101.01*GeV; dE = 10*GeV; |
---|
208 | Ecut = 10*MeV; |
---|
209 | |
---|
210 | G4cout << "\n ####muon: CrossSectionPerAtom and StoppingPower for " |
---|
211 | << material->GetName() |
---|
212 | << ";\tEnergy cut = " << G4BestUnit (Ecut, "Energy") << G4endl; |
---|
213 | |
---|
214 | G4cout << "\n Energy \t ionization \t bremsstra \t pair_prod \t"; |
---|
215 | G4cout << "\t ionization" << G4endl; |
---|
216 | |
---|
217 | for (G4double Energy = Emin; Energy <= Emax; Energy += dE) { |
---|
218 | G4cout << "\n " << G4BestUnit (Energy, "Energy") |
---|
219 | << "\t" |
---|
220 | << G4BestUnit (muioni->ComputeCrossSectionPerAtom(*muon,Energy,Z,Ecut), |
---|
221 | "Surface") |
---|
222 | << "\t" |
---|
223 | << G4BestUnit (mubrem->ComputeMicroscopicCrossSection(muon,Energy,Z,A,Ecut), |
---|
224 | "Surface") |
---|
225 | << "\t" |
---|
226 | << G4BestUnit (mupair->ComputeMicroscopicCrossSection(muon,Energy,Z,Ecut, |
---|
227 | Ecut), |
---|
228 | "Surface") |
---|
229 | << "\t \t" |
---|
230 | << G4BestUnit (muioni->ComputeRestrictedMeandEdx(*muon,Energy,material,Ecut), |
---|
231 | "Energy/Length"); |
---|
232 | } |
---|
233 | |
---|
234 | G4cout << G4endl; |
---|
235 | |
---|
236 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
237 | |
---|
238 | return EXIT_SUCCESS; |
---|
239 | } |
---|