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: G4ShellVacancyTest.cc,v 1.5 2006/06/29 19:44:36 gunter Exp $ |
---|
28 | // GEANT4 tag $Name: geant4-09-03-cand-01 $ |
---|
29 | // |
---|
30 | // ------------------------------------------------------------------- |
---|
31 | // GEANT 4 class file --- Copyright CERN 1998 |
---|
32 | // CERN Geneva Switzerland |
---|
33 | // |
---|
34 | // |
---|
35 | // File name: G4EMDataSetTest |
---|
36 | // |
---|
37 | // Author: Maria Grazia Pia |
---|
38 | // |
---|
39 | // Creation date: 1 August 2001 |
---|
40 | // |
---|
41 | // Modifications: |
---|
42 | // |
---|
43 | // ------------------------------------------------------------------- |
---|
44 | |
---|
45 | #include "globals.hh" |
---|
46 | #include "G4ios.hh" |
---|
47 | #include <fstream> |
---|
48 | #include <iomanip> |
---|
49 | #include "G4CompositeEMDataSet.hh" |
---|
50 | #include "G4ShellEMDataSet.hh" |
---|
51 | #include "G4EMDataSet.hh" |
---|
52 | #include "G4VEMDataSet.hh" |
---|
53 | #include "G4VDataSetAlgorithm.hh" |
---|
54 | #include "G4LogLogInterpolation.hh" |
---|
55 | #include "G4ShellVacancy.hh" |
---|
56 | #include "G4Material.hh" |
---|
57 | |
---|
58 | int main() |
---|
59 | { |
---|
60 | //--------- Materials definition --------- |
---|
61 | |
---|
62 | G4Material* Be = new G4Material("Beryllium", 4., 9.01*g/mole, 1.848*g/cm3); |
---|
63 | G4Material* Graphite = new G4Material("Graphite",6., 12.00*g/mole, 2.265*g/cm3 ); |
---|
64 | G4Material* Al = new G4Material("Aluminium", 13., 26.98*g/mole, 2.7 *g/cm3); |
---|
65 | //G4Material* Si = new G4Material("Silicon", 14., 28.055*g/mole, 2.33*g/cm3); |
---|
66 | //G4Material* LAr = new G4Material("LArgon", 18., 39.95*g/mole, 1.393*g/cm3); |
---|
67 | //G4Material* Fe = new G4Material("Iron", 26., 55.85*g/mole, 7.87*g/cm3); |
---|
68 | //G4Material* Cu = new G4Material("Copper", 29., 63.55*g/mole, 8.96*g/cm3); |
---|
69 | //G4Material* W = new G4Material("Tungsten", 74., 183.85*g/mole, 19.30*g/cm3); |
---|
70 | //G4Material* Pb = new G4Material("Lead", 82., 207.19*g/mole, 11.35*g/cm3); |
---|
71 | //G4Material* U = new G4Material("Uranium", 92., 238.03*g/mole, 18.95*g/cm3); |
---|
72 | |
---|
73 | G4Element* H = new G4Element ("Hydrogen", "H", 1. , 1.01*g/mole); |
---|
74 | G4Element* O = new G4Element ("Oxygen" , "O", 8. , 16.00*g/mole); |
---|
75 | G4Element* C = new G4Element ("Carbon" , "C", 6. , 12.00*g/mole); |
---|
76 | G4Element* Cs = new G4Element ("Cesium" , "Cs", 55. , 132.905*g/mole); |
---|
77 | G4Element* I = new G4Element ("Iodide" , "I", 53. , 126.9044*g/mole); |
---|
78 | |
---|
79 | //G4Material* maO = new G4Material("Oxygen", 8., 16.00*g/mole, 1.1*g/cm3); |
---|
80 | |
---|
81 | G4Material* water = new G4Material ("Water" , 1.*g/cm3, 2); |
---|
82 | water->AddElement(H,2); |
---|
83 | water->AddElement(O,1); |
---|
84 | |
---|
85 | G4Material* ethane = new G4Material ("Ethane" , 0.4241*g/cm3, 2); |
---|
86 | ethane->AddElement(H,6); |
---|
87 | ethane->AddElement(C,2); |
---|
88 | |
---|
89 | G4Material* csi = new G4Material ("CsI" , 4.53*g/cm3, 2); |
---|
90 | csi->AddElement(Cs,1); |
---|
91 | csi->AddElement(I,1); |
---|
92 | |
---|
93 | G4ShellVacancy* manager = new G4ShellVacancy; |
---|
94 | // Setup |
---|
95 | |
---|
96 | G4cout << "G4EMDataSet test: dump LLNL data sets" << G4endl; |
---|
97 | |
---|
98 | G4cout.setf( ios::scientific, ios::floatfield ); |
---|
99 | |
---|
100 | G4VDataSetAlgorithm* interpolation1 = new G4LogLogInterpolation(); |
---|
101 | G4VDataSetAlgorithm* interpolation2 = new G4LogLogInterpolation(); |
---|
102 | G4VDataSetAlgorithm* interpolation3 = new G4LogLogInterpolation(); |
---|
103 | G4VDataSetAlgorithm* interpolation4 = new G4LogLogInterpolation(); |
---|
104 | G4VDataSetAlgorithm* interpolation5 = new G4LogLogInterpolation(); |
---|
105 | G4VDataSetAlgorithm* interpolation6 = new G4LogLogInterpolation(); |
---|
106 | |
---|
107 | G4cout << "Interpolation created" << G4endl; |
---|
108 | G4String fileName = "brem/br-cs-"; |
---|
109 | |
---|
110 | G4VEMDataSet* dataSet1; |
---|
111 | |
---|
112 | dataSet1 = new G4CompositeEMDataSet(fileName,interpolation1,MeV,10000); |
---|
113 | |
---|
114 | fileName = "comp/ce-cs-"; |
---|
115 | |
---|
116 | G4VEMDataSet* dataSet2; |
---|
117 | dataSet2 = new G4CompositeEMDataSet(fileName,interpolation2,MeV,10000); |
---|
118 | |
---|
119 | fileName = "comp/ce-sf-"; |
---|
120 | G4VEMDataSet* dataSet3; |
---|
121 | |
---|
122 | dataSet3 = new G4CompositeEMDataSet(fileName,interpolation3,MeV,10000); |
---|
123 | |
---|
124 | |
---|
125 | fileName = "pair/pp-cs-"; |
---|
126 | G4VEMDataSet* dataSet4; |
---|
127 | |
---|
128 | dataSet4 = new G4CompositeEMDataSet(fileName,interpolation4,MeV,10000); |
---|
129 | static const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); |
---|
130 | |
---|
131 | fileName = "phot/pe-cs-"; |
---|
132 | G4VEMDataSet* dataSet5; |
---|
133 | |
---|
134 | dataSet5 = new G4CompositeEMDataSet(fileName,interpolation5,MeV,10000); |
---|
135 | |
---|
136 | fileName = "phot/pe-ss-cs-"; |
---|
137 | G4VEMDataSet* dataSet6; |
---|
138 | |
---|
139 | dataSet6 = new G4CompositeEMDataSet(fileName,interpolation6,MeV,10000); |
---|
140 | |
---|
141 | G4int nMaterials = G4Material::GetNumberOfMaterials(); |
---|
142 | |
---|
143 | G4cout << "Available materials are: " << G4endl; |
---|
144 | for (G4int mat = 0; mat < nMaterials; mat++) |
---|
145 | { |
---|
146 | G4cout << mat << ") " |
---|
147 | << (*theMaterialTable)[mat]->GetName() |
---|
148 | << G4endl; |
---|
149 | } |
---|
150 | G4int materialId=-1; |
---|
151 | G4cout << "Which material? " << G4endl; |
---|
152 | G4cin >> materialId; |
---|
153 | |
---|
154 | G4Material* material = (*theMaterialTable)[materialId] ; |
---|
155 | |
---|
156 | G4cout << "The selected material is: " |
---|
157 | << material->GetName() |
---|
158 | << G4endl; |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | G4cout << "Enter incidentEnergy" << G4endl; |
---|
163 | G4double e; |
---|
164 | G4cin >> e; |
---|
165 | |
---|
166 | G4cout << "Enter energyLoss" << G4endl; |
---|
167 | G4double eLoss; |
---|
168 | G4cin >> eLoss; |
---|
169 | |
---|
170 | manager->AddXsiTable(dataSet1); |
---|
171 | manager->AddXsiTable(dataSet2); |
---|
172 | manager->AddXsiTable(dataSet3); |
---|
173 | manager->AddXsiTable(dataSet4); |
---|
174 | manager->AddXsiTable(dataSet5); |
---|
175 | manager->AddXsiTable(dataSet6); |
---|
176 | |
---|
177 | std::vector<G4int> vector = manager->GenerateNumberOfIonisations(material, |
---|
178 | e,eLoss); |
---|
179 | size_t vectorSize = vector.size(); |
---|
180 | for (size_t p=0; p<vectorSize; p++) |
---|
181 | { |
---|
182 | G4int n = vector[p]; |
---|
183 | G4cout<<"The number of transition for the "<<p<<"th element in the material "<< |
---|
184 | material->GetName()<<" is : "<<n<<G4endl; |
---|
185 | } |
---|
186 | |
---|
187 | delete manager; |
---|
188 | |
---|
189 | G4cout << "END OF THE MAIN PROGRAM" << G4endl; |
---|
190 | } |
---|
191 | |
---|
192 | |
---|
193 | |
---|
194 | |
---|
195 | |
---|
196 | |
---|
197 | |
---|
198 | |
---|
199 | |
---|
200 | |
---|
201 | |
---|
202 | |
---|