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 | // |
---|
28 | // =========================================================================== |
---|
29 | // GEANT4 class header file |
---|
30 | // |
---|
31 | // Class: G4IonParametrisedLossModel |
---|
32 | // |
---|
33 | // Base class: G4VEmModel (utils) |
---|
34 | // |
---|
35 | // Author: Anton Lechner (Anton.Lechner@cern.ch) |
---|
36 | // |
---|
37 | // First implementation: 10. 11. 2008 |
---|
38 | // |
---|
39 | // Modifications: |
---|
40 | // |
---|
41 | // |
---|
42 | // Class description: |
---|
43 | // Model for computing the energy loss of ions by employing a |
---|
44 | // parameterisation of dE/dx tables (default ICRU 73 tables). For |
---|
45 | // ion-material combinations and/or projectile energies not covered |
---|
46 | // by this model, the G4BraggIonModel and G4BetheBloch models are |
---|
47 | // employed. |
---|
48 | // |
---|
49 | // Comments: |
---|
50 | // |
---|
51 | // =========================================================================== |
---|
52 | |
---|
53 | |
---|
54 | #ifndef G4IONPARAMETRISEDLOSSMODEL_HH |
---|
55 | #define G4IONPARAMETRISEDLOSSMODEL_HH |
---|
56 | |
---|
57 | #include "G4VEmModel.hh" |
---|
58 | #include "G4EmCorrections.hh" |
---|
59 | #include "G4IonParametrisedLossTable.hh" |
---|
60 | #include "G4EmCorrections.hh" |
---|
61 | #include <iomanip> |
---|
62 | #include <list> |
---|
63 | #include <map> |
---|
64 | #include <utility> |
---|
65 | |
---|
66 | class G4BraggIonModel; |
---|
67 | class G4BetheBlochModel; |
---|
68 | class G4ParticleChangeForLoss; |
---|
69 | |
---|
70 | typedef std::list<G4IonLossTableHandle*> LossTableList; |
---|
71 | typedef std::pair<const G4ParticleDefinition*, const G4Material*> IonMatCouple; |
---|
72 | |
---|
73 | |
---|
74 | class G4IonParametrisedLossModel : public G4VEmModel { |
---|
75 | |
---|
76 | public: |
---|
77 | G4IonParametrisedLossModel(const G4ParticleDefinition* particle = 0, |
---|
78 | const G4String& name = "ParamICRU73"); |
---|
79 | |
---|
80 | virtual ~G4IonParametrisedLossModel(); |
---|
81 | |
---|
82 | virtual void Initialise( |
---|
83 | const G4ParticleDefinition*, // Projectile |
---|
84 | const G4DataVector&); // Cut energies |
---|
85 | |
---|
86 | virtual G4double MinEnergyCut( |
---|
87 | const G4ParticleDefinition*, // Projectile |
---|
88 | const G4MaterialCutsCouple*); |
---|
89 | |
---|
90 | virtual G4double ComputeCrossSectionPerAtom( |
---|
91 | const G4ParticleDefinition*, // Projectile |
---|
92 | G4double, // Kinetic energy of projectile |
---|
93 | G4double, // Atomic number |
---|
94 | G4double, // Mass number |
---|
95 | G4double, // Energy cut for secondary prod. |
---|
96 | G4double); // Maximum energy of secondaries |
---|
97 | |
---|
98 | virtual G4double CrossSectionPerVolume( |
---|
99 | const G4Material*, // Target material |
---|
100 | const G4ParticleDefinition*, // Projectile |
---|
101 | G4double, // Kinetic energy |
---|
102 | G4double, // Energy cut for secondary prod. |
---|
103 | G4double); // Maximum energy of secondaries |
---|
104 | |
---|
105 | virtual G4double ComputeDEDXPerVolume( |
---|
106 | const G4Material*, // Target material |
---|
107 | const G4ParticleDefinition*, // Projectile |
---|
108 | G4double, // Kinetic energy of projectile |
---|
109 | G4double); // Energy cut for secondary prod. |
---|
110 | |
---|
111 | // Function, which computes the continuous energy loss (due to electronic |
---|
112 | // stopping) for a given pre-step energy and step length by using |
---|
113 | // range vs energy (and energy vs range) tables |
---|
114 | G4double ComputeLossForStep( |
---|
115 | const G4Material*, // Target material |
---|
116 | const G4ParticleDefinition*, // Projectile |
---|
117 | G4double, // Kinetic energy of projectile |
---|
118 | G4double, // Energy cut for secondary prod. |
---|
119 | G4double); // Length of current step |
---|
120 | |
---|
121 | // Function, which computes the mean energy transfer rate to delta rays |
---|
122 | G4double DeltaRayMeanEnergyTransferRate( |
---|
123 | const G4Material*, // Target Material |
---|
124 | const G4ParticleDefinition*, // Projectile |
---|
125 | G4double, // Kinetic energy of projectile |
---|
126 | G4double); // Energy cut for secondary prod. |
---|
127 | |
---|
128 | |
---|
129 | virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, |
---|
130 | const G4MaterialCutsCouple*, |
---|
131 | const G4DynamicParticle*, |
---|
132 | G4double, // Energy cut for secondary prod. |
---|
133 | G4double); // Maximum energy of secondaries |
---|
134 | |
---|
135 | virtual G4double GetChargeSquareRatio( |
---|
136 | const G4ParticleDefinition*, // Projectile |
---|
137 | const G4Material*, // Target Material |
---|
138 | G4double); // Kinetic energy of projectile |
---|
139 | |
---|
140 | virtual G4double GetParticleCharge( |
---|
141 | const G4ParticleDefinition*, // Projectile |
---|
142 | const G4Material*, // Target Material |
---|
143 | G4double); // Kinetic energy of projectile |
---|
144 | |
---|
145 | virtual void CorrectionsAlongStep( |
---|
146 | const G4MaterialCutsCouple*,// Mat.-Cut couple |
---|
147 | const G4DynamicParticle*, // Dyn. particle |
---|
148 | G4double&, // Energy loss in current step |
---|
149 | G4double&, |
---|
150 | G4double); // Length of current step |
---|
151 | |
---|
152 | |
---|
153 | // Template function which allows to add additional stopping power tables |
---|
154 | // in combination with a scaling algorithm, which may depend on dynamic |
---|
155 | // information like the current particle energy (the table and scaling |
---|
156 | // algorithm are used via a wrapper class, which performs e.g.caching or |
---|
157 | // which applies the scaling of energy and dE/dx values) |
---|
158 | template <class TABLE, class SCALING_ALGO> |
---|
159 | void AddDEDXTable() { |
---|
160 | G4IonLossTableHandle* table = |
---|
161 | new G4IonParametrisedLossTable<TABLE, SCALING_ALGO>; |
---|
162 | |
---|
163 | lossTableList.push_front(table); |
---|
164 | } |
---|
165 | |
---|
166 | // Template function which allows to add additional stopping power tables |
---|
167 | // (the table itself is used via a wrapper class, which performs e.g. |
---|
168 | // caching) |
---|
169 | template <class TABLE> |
---|
170 | void AddDEDXTable() { |
---|
171 | G4IonLossTableHandle* table = |
---|
172 | new G4IonParametrisedLossTable<TABLE>; |
---|
173 | |
---|
174 | lossTableList.push_front(table); |
---|
175 | } |
---|
176 | |
---|
177 | // Function checking the applicability of physics tables to ion-material |
---|
178 | // combinations (Note: the energy range of tables is not checked) |
---|
179 | LossTableList::iterator IsApplicable( |
---|
180 | const G4ParticleDefinition*, // Projectile (ion) |
---|
181 | const G4Material*); // Target material |
---|
182 | |
---|
183 | // Function printing a dE/dx table for a given ion-material combination |
---|
184 | // and a specified energy grid |
---|
185 | void PrintDEDXTable( |
---|
186 | const G4ParticleDefinition*, // Projectile (ion) |
---|
187 | const G4Material*, // Absorber material |
---|
188 | G4double, // Minimum energy per nucleon |
---|
189 | G4double, // Maximum energy per nucleon |
---|
190 | G4int, // Number of bins |
---|
191 | G4bool); // Logarithmic scaling of energy |
---|
192 | |
---|
193 | protected: |
---|
194 | G4double MaxSecondaryEnergy(const G4ParticleDefinition*, |
---|
195 | G4double); // Kinetic energy of projectile |
---|
196 | |
---|
197 | private: |
---|
198 | // Function which updates parameters concerning the dE/dx calculation |
---|
199 | // (the parameters are only updated if the particle, the material or |
---|
200 | // the associated energy cut has changed) |
---|
201 | void UpdateDEDXCache( |
---|
202 | const G4ParticleDefinition*, // Projectile (ion) |
---|
203 | const G4Material*, // Target material |
---|
204 | G4double cutEnergy); // Energy cut |
---|
205 | |
---|
206 | // Function, which updates parameters concering particle properties |
---|
207 | void UpdateCache( |
---|
208 | const G4ParticleDefinition*); // Projectile (ion) |
---|
209 | |
---|
210 | // Function, which builds range vs energy (and energy vs range) vectors |
---|
211 | // for a given particle, material and energy cut |
---|
212 | void BuildRangeVector( |
---|
213 | const G4ParticleDefinition*, // Projectile (ion) |
---|
214 | const G4Material*, // Target material |
---|
215 | G4double); // Energy cut |
---|
216 | |
---|
217 | // Assignment operator and copy constructor are hidden: |
---|
218 | G4IonParametrisedLossModel & operator=( |
---|
219 | const G4IonParametrisedLossModel &right); |
---|
220 | G4IonParametrisedLossModel(const G4IonParametrisedLossModel &); |
---|
221 | |
---|
222 | // ###################################################################### |
---|
223 | // # Models and dE/dx tables for computing the energy loss |
---|
224 | // # |
---|
225 | // ###################################################################### |
---|
226 | |
---|
227 | // G4BraggIonModel and G4BetheBlochModel are used for ion-target |
---|
228 | // combinations and/or projectile energies not covered by parametrisations |
---|
229 | // adopted by this model: |
---|
230 | G4BraggIonModel* braggIonModel; |
---|
231 | G4BetheBlochModel* betheBlochModel; |
---|
232 | |
---|
233 | // List of dE/dx tables plugged into the model |
---|
234 | LossTableList lossTableList; |
---|
235 | |
---|
236 | // ###################################################################### |
---|
237 | // # Maps of Range vs Energy and Energy vs Range vectors |
---|
238 | // # |
---|
239 | // ###################################################################### |
---|
240 | |
---|
241 | typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> RangeEnergyTable; |
---|
242 | RangeEnergyTable r; |
---|
243 | |
---|
244 | typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> EnergyRangeTable; |
---|
245 | EnergyRangeTable E; |
---|
246 | |
---|
247 | // ###################################################################### |
---|
248 | // # Energy grid definitions (e.g. used for computing range-energy |
---|
249 | // # tables) |
---|
250 | // ###################################################################### |
---|
251 | |
---|
252 | G4double lowerEnergyEdgeIntegr; |
---|
253 | G4double upperEnergyEdgeIntegr; |
---|
254 | |
---|
255 | size_t nmbBins; |
---|
256 | size_t nmbSubBins; |
---|
257 | |
---|
258 | // ###################################################################### |
---|
259 | // # Particle change for loss |
---|
260 | // # |
---|
261 | // ###################################################################### |
---|
262 | |
---|
263 | // Pointer to particle change object, which is used to set e.g. the |
---|
264 | // energy loss due to nuclear stopping |
---|
265 | G4ParticleChangeForLoss* particleChangeLoss; |
---|
266 | |
---|
267 | // Flag indicating if model is initialized (i.e. if |
---|
268 | // G4ParticleChangeForLoss was created) |
---|
269 | G4bool modelIsInitialised; |
---|
270 | |
---|
271 | // ###################################################################### |
---|
272 | // # Corrections and energy loss limit |
---|
273 | // # |
---|
274 | // ###################################################################### |
---|
275 | |
---|
276 | // Pointer to an G4EmCorrections object, which is used to compute the |
---|
277 | // effective ion charge, and other corrections (like high order corrections |
---|
278 | // to stopping powers) |
---|
279 | G4EmCorrections* corrections; |
---|
280 | |
---|
281 | // Corrections factor for effective charge, computed for each particle |
---|
282 | // step |
---|
283 | G4double corrFactor; |
---|
284 | |
---|
285 | // Parameter indicating the maximal fraction of kinetic energy, which |
---|
286 | // a particle may loose along a step, in order that the simple relation |
---|
287 | // (dE/dx)*l can still be applied to compute the energy loss (l = step |
---|
288 | // length) |
---|
289 | G4double energyLossLimit; |
---|
290 | |
---|
291 | // ###################################################################### |
---|
292 | // # Cut energies and properties of generic ion |
---|
293 | // # |
---|
294 | // ###################################################################### |
---|
295 | |
---|
296 | // Vector containing the current cut energies (the vector index matches |
---|
297 | // the material-cuts couple index): |
---|
298 | G4DataVector cutEnergies; |
---|
299 | |
---|
300 | // Pointer to generic ion and mass of generic ion |
---|
301 | G4ParticleDefinition* genericIon; |
---|
302 | G4double genericIonPDGMass; |
---|
303 | |
---|
304 | // ###################################################################### |
---|
305 | // # "Most-recently-used" cache parameters |
---|
306 | // # |
---|
307 | // ###################################################################### |
---|
308 | |
---|
309 | // Cached key (particle) and value information for a faster |
---|
310 | // access of particle-related information |
---|
311 | const G4ParticleDefinition* cacheParticle; // Key: Current projectile |
---|
312 | G4double cacheMass; // Projectile mass |
---|
313 | G4double cacheElecMassRatio; // Electron-mass ratio |
---|
314 | G4double cacheChargeSquare; // Charge squared |
---|
315 | |
---|
316 | // Cached parameters needed during dE/dx computations: |
---|
317 | const G4ParticleDefinition* dedxCacheParticle; // Key: 1) Current ion, |
---|
318 | const G4Material* dedxCacheMaterial; // 2) material and |
---|
319 | G4double dedxCacheEnergyCut; // 3) cut energy |
---|
320 | LossTableList::iterator dedxCacheIter; // Responsible dE/dx table |
---|
321 | G4PhysicsVector* dedxCacheEnergyRange; // Energy vs range vector |
---|
322 | G4PhysicsVector* dedxCacheRangeEnergy; // Range vs energy vector |
---|
323 | G4double dedxCacheTransitionEnergy; // Transition energy between |
---|
324 | // parameterization and |
---|
325 | // Bethe-Bloch model |
---|
326 | G4double dedxCacheTransitionFactor; // Factor for smoothing the dE/dx |
---|
327 | // values in the transition region |
---|
328 | G4double dedxCacheGenIonMassRatio; // Ratio of generic ion mass |
---|
329 | // and current particle mass |
---|
330 | }; |
---|
331 | |
---|
332 | |
---|
333 | #include "G4IonParametrisedLossModel.icc" |
---|
334 | |
---|
335 | #endif |
---|