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 | // $Id: G4DensityEffectData.hh,v 1.10 2010/05/15 15:37:33 vnivanch Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-04-beta-cand-01 $ |
---|
28 | |
---|
29 | //--------------------------------------------------------------------------- |
---|
30 | // |
---|
31 | // GEANT4 Class file |
---|
32 | // |
---|
33 | // Description: Data on density effect |
---|
34 | // |
---|
35 | // Authors: A.Bagulya, A.Ivanchenko 28.10.2009 |
---|
36 | // |
---|
37 | // Modifications: |
---|
38 | // |
---|
39 | // |
---|
40 | // |
---|
41 | //---------------------------------------------------------------------------- |
---|
42 | // |
---|
43 | // Data are taken from: |
---|
44 | // R.M. Sternheimer et al. Density Effect for the Ionization Loss of Charged |
---|
45 | // Particles in Various Substances. Atom. Data Nucl. Data Tabl. 30 (1984) 261-271. |
---|
46 | |
---|
47 | #ifndef DensityEffectData_h |
---|
48 | #define DensityEffectData_h 1 |
---|
49 | |
---|
50 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
51 | |
---|
52 | #include "globals.hh" |
---|
53 | #include "G4Material.hh" |
---|
54 | #include <vector> |
---|
55 | |
---|
56 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
57 | |
---|
58 | const G4int NDENSDATA = 278; |
---|
59 | const G4int NDENSARRAY = 9; |
---|
60 | const G4int NDENSELEM = 98; |
---|
61 | |
---|
62 | class G4DensityEffectData |
---|
63 | { |
---|
64 | public: |
---|
65 | |
---|
66 | G4DensityEffectData(); |
---|
67 | |
---|
68 | ~G4DensityEffectData(); |
---|
69 | |
---|
70 | // return index by Z, -1 if material is not in the table |
---|
71 | G4int GetElementIndex(G4int Z, G4State mState); |
---|
72 | |
---|
73 | // return index by material name, -1 if material is not in the table |
---|
74 | G4int GetIndex(const G4String& matName); |
---|
75 | |
---|
76 | // printout data for material |
---|
77 | void PrintData(const G4String& matName); |
---|
78 | |
---|
79 | // printout all data |
---|
80 | void DumpData(); |
---|
81 | |
---|
82 | // Access to the data via index |
---|
83 | inline G4double GetPlasmaEnergy(G4int idx); |
---|
84 | inline G4double GetAdjustmentFactor(G4int idx); |
---|
85 | inline G4double GetCdensity(G4int idx); |
---|
86 | inline G4double GetX0density(G4int idx); |
---|
87 | inline G4double GetX1density(G4int idx); |
---|
88 | inline G4double GetAdensity(G4int idx); |
---|
89 | inline G4double GetMdensity(G4int idx); |
---|
90 | inline G4double GetDelta0density(G4int idx); |
---|
91 | inline G4double GetErrorDensity(G4int idx); |
---|
92 | |
---|
93 | private: |
---|
94 | |
---|
95 | void Initialize(); |
---|
96 | |
---|
97 | void AddMaterial(G4double* val, const G4String& matName); |
---|
98 | |
---|
99 | // Assignment operator and copy constructor |
---|
100 | G4DensityEffectData & operator=(const G4DensityEffectData &right); |
---|
101 | G4DensityEffectData(const G4DensityEffectData&); |
---|
102 | |
---|
103 | G4double data[NDENSDATA][NDENSARRAY]; |
---|
104 | std::vector<G4String> names; |
---|
105 | |
---|
106 | // indexes defined only for pure materials |
---|
107 | G4int indexZ[NDENSELEM]; |
---|
108 | G4State state[NDENSELEM]; |
---|
109 | |
---|
110 | G4int index; |
---|
111 | |
---|
112 | }; |
---|
113 | |
---|
114 | inline G4double G4DensityEffectData::GetPlasmaEnergy(G4int idx) |
---|
115 | { |
---|
116 | G4double x = DBL_MAX; |
---|
117 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][0]; } |
---|
118 | return x; |
---|
119 | } |
---|
120 | |
---|
121 | inline G4double G4DensityEffectData::GetAdjustmentFactor(G4int idx) |
---|
122 | { |
---|
123 | G4double x = DBL_MAX; |
---|
124 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][1]; } |
---|
125 | return x; |
---|
126 | } |
---|
127 | |
---|
128 | inline G4double G4DensityEffectData::GetCdensity(G4int idx) |
---|
129 | { |
---|
130 | G4double x = DBL_MAX; |
---|
131 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][2]; } |
---|
132 | return x; |
---|
133 | } |
---|
134 | |
---|
135 | inline G4double G4DensityEffectData::GetX0density(G4int idx) |
---|
136 | { |
---|
137 | G4double x = DBL_MAX; |
---|
138 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][3]; } |
---|
139 | return x; |
---|
140 | } |
---|
141 | |
---|
142 | inline G4double G4DensityEffectData::GetX1density(G4int idx) |
---|
143 | { |
---|
144 | G4double x = DBL_MAX; |
---|
145 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][4]; } |
---|
146 | return x; |
---|
147 | } |
---|
148 | |
---|
149 | inline G4double G4DensityEffectData::GetAdensity(G4int idx) |
---|
150 | { |
---|
151 | G4double x = DBL_MAX; |
---|
152 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][5]; } |
---|
153 | return x; |
---|
154 | } |
---|
155 | |
---|
156 | inline G4double G4DensityEffectData::GetMdensity(G4int idx) |
---|
157 | { |
---|
158 | G4double x = DBL_MAX; |
---|
159 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][6]; } |
---|
160 | return x; |
---|
161 | } |
---|
162 | |
---|
163 | inline G4double G4DensityEffectData::GetDelta0density(G4int idx) |
---|
164 | { |
---|
165 | G4double x = DBL_MAX; |
---|
166 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][7]; } |
---|
167 | return x; |
---|
168 | } |
---|
169 | |
---|
170 | inline G4double G4DensityEffectData::GetErrorDensity(G4int idx) |
---|
171 | { |
---|
172 | G4double x = DBL_MAX; |
---|
173 | if(idx >= 0 && idx < NDENSDATA) { x = data[idx][8]; } |
---|
174 | return x; |
---|
175 | } |
---|
176 | |
---|
177 | |
---|
178 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
179 | |
---|
180 | #endif |
---|
181 | |
---|