ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4IonParametrisedLossModel.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4IonParametrisedLossModel.hh
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 // GEANT4 class header file
29 //
30 // Class: G4IonParametrisedLossModel
31 //
32 // Base class: G4VEmModel (utils)
33 //
34 // Author: Anton Lechner (Anton.Lechner@cern.ch)
35 //
36 // First implementation: 10. 11. 2008
37 //
38 // Modifications: 03. 02. 2009 - Bug fix iterators (AL)
39 // 11. 03. 2009 - Introduced new table handler(G4IonDEDXHandler)
40 // and modified method to add/remove tables
41 // (tables are now built in init. phase),
42 // Minor bug fix in ComputeDEDXPerVolume (AL)
43 // 12. 11. 2009 - Added function for switching off scaling
44 // of heavy ions from ICRU 73 data
45 // 20. 11. 2009 - Added set-method for energy loss limit (AL)
46 // 24. 11. 2009 - Bug fix: Range calculation corrected if same
47 // materials appears with different cuts in diff.
48 // regions (added UpdateRangeCache function and
49 // modified BuildRangeVector, ComputeLossForStep
50 // functions accordingly, added new cache param.,
51 // changed typdef of IonMatCouple).
52 // - Removed GetRange function (AL)
53 //
54 // Class description:
55 // Model for computing the energy loss of ions by employing a
56 // parameterisation of dE/dx tables (default ICRU 73 tables). For
57 // ion-material combinations and/or projectile energies not covered
58 // by this model, the G4BraggIonModel and G4BetheBloch models are
59 // employed.
60 //
61 // Comments:
62 //
63 // ===========================================================================
64 
65 
66 #ifndef G4IONPARAMETRISEDLOSSMODEL_HH
67 #define G4IONPARAMETRISEDLOSSMODEL_HH
68 
69 #include <iomanip>
70 #include <list>
71 #include <map>
72 #include <utility>
74 
75 #include "G4VEmModel.hh"
76 #include "G4EmCorrections.hh"
77 #include "G4IonDEDXHandler.hh"
78 
79 class G4BraggIonModel;
80 class G4BetheBlochModel;
82 class G4VIonDEDXTable;
86 
87 typedef std::list<G4IonDEDXHandler*> LossTableList;
88 typedef std::pair<const G4ParticleDefinition*,
90 
91 
93 
94  public:
96  const G4String& name = "ParamICRU73");
97 
99 
100  virtual void Initialise(
101  const G4ParticleDefinition*, // Projectile
102  const G4DataVector&); // Cut energies
103 
104  virtual G4double MinEnergyCut(
105  const G4ParticleDefinition*, // Projectile
106  const G4MaterialCutsCouple*);
107 
109  const G4ParticleDefinition*, // Projectile
110  G4double, // Kinetic energy of projectile
111  G4double, // Atomic number
112  G4double, // Mass number
113  G4double, // Energy cut for secondary prod.
114  G4double); // Maximum energy of secondaries
115 
117  const G4Material*, // Target material
118  const G4ParticleDefinition*, // Projectile
119  G4double, // Kinetic energy
120  G4double, // Energy cut for secondary prod.
121  G4double); // Maximum energy of secondaries
122 
124  const G4Material*, // Target material
125  const G4ParticleDefinition*, // Projectile
126  G4double, // Kinetic energy of projectile
127  G4double); // Energy cut for secondary prod.
128 
129  // Function, which computes the continuous energy loss (due to electronic
130  // stopping) for a given pre-step energy and step length by using
131  // range vs energy (and energy vs range) tables
133  const G4MaterialCutsCouple*, // Mat-cuts couple
134  const G4ParticleDefinition*, // Projectile
135  G4double, // Kinetic energy of projectile
136  G4double); // Length of current step
137 
138  // Function, which computes the mean energy transfer rate to delta rays
140  const G4Material*, // Target Material
141  const G4ParticleDefinition*, // Projectile
142  G4double, // Kinetic energy of projectile
143  G4double); // Energy cut for secondary prod.
144 
145 
146  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
147  const G4MaterialCutsCouple*,
148  const G4DynamicParticle*,
149  G4double, // Energy cut for secondary prod.
150  G4double); // Maximum energy of secondaries
151 
153  const G4ParticleDefinition*, // Projectile
154  const G4Material*, // Target Material
155  G4double); // Kinetic energy of projectile
156 
157  virtual G4double GetParticleCharge(
158  const G4ParticleDefinition*, // Projectile
159  const G4Material*, // Target Material
160  G4double); // Kinetic energy of projectile
161 
162  virtual void CorrectionsAlongStep(
163  const G4MaterialCutsCouple*,// Mat.-Cut couple
164  const G4DynamicParticle*, // Dyn. particle
165  G4double&, // Energy loss in current step
166  G4double&,
167  G4double); // Length of current step
168 
169  // Function which allows to add additional stopping power tables
170  // in combination with a scaling algorithm, which may depend on dynamic
171  // information like the current particle energy (the table and scaling
172  // algorithm are used via a handler class, which performs e.g.caching or
173  // which applies the scaling of energy and dE/dx values)
175  G4VIonDEDXTable* table,
177 
178  G4bool RemoveDEDXTable(const G4String& name);
179 
180  // Function which allows to switch off scaling of stopping powers of heavy
181  // ions from existing ICRU 73 data
182  // void DeactivateICRU73Scaling();
183 
184  // Function checking the applicability of physics tables to ion-material
185  // combinations (Note: the energy range of tables is not checked)
186  inline LossTableList::iterator IsApplicable(
187  const G4ParticleDefinition*, // Projectile (ion)
188  const G4Material*); // Target material
189 
190  // Function printing a dE/dx table for a given ion-material combination
191  // and a specified energy grid
192  void PrintDEDXTable(
193  const G4ParticleDefinition*, // Projectile (ion)
194  const G4Material*, // Absorber material
195  G4double, // Minimum energy per nucleon
196  G4double, // Maximum energy per nucleon
197  G4int, // Number of bins
198  G4bool); // Logarithmic scaling of energy
199 
200  // Function printing a dE/dx table for a given ion-material combination
201  // and a specified energy grid
203  const G4ParticleDefinition*, // Projectile (ion)
204  const G4Material*, // Absorber material
205  G4double, // Minimum energy per nucleon
206  G4double, // Maximum energy per nucleon
207  G4int, // Number of bins
208  G4bool); // Logarithmic scaling of energy
209 
210  // Function for setting energy loss limit for stopping power integration
211  inline void SetEnergyLossLimit(G4double ionEnergyLossLimit);
212 
213  protected:
214 
215  virtual
217  G4double); // Kinetic energy of projectile
218 
219  private:
220  // Function which updates parameters concerning the dE/dx calculation
221  // (the parameters are only updated if the particle, the material or
222  // the associated energy cut has changed)
223  void UpdateDEDXCache(
224  const G4ParticleDefinition*, // Projectile (ion)
225  const G4Material*, // Target material
226  G4double cutEnergy); // Energy cut
227 
228  // Function which updates parameters concerning the range calculation
229  // (the parameters are only updated if the particle, the material or
230  // the associated energy cut has changed)
231  void UpdateRangeCache(
232  const G4ParticleDefinition*, // Projectile (ion)
233  const G4MaterialCutsCouple*); // Target material
234 
235  // Function, which updates parameters concering particle properties
236  inline void UpdateCache(
237  const G4ParticleDefinition*); // Projectile (ion)
238 
239  // Function, which builds range vs energy (and energy vs range) vectors
240  // for a given particle, material and energy cut
241  void BuildRangeVector(
242  const G4ParticleDefinition*, // Projectile (ion)
243  const G4MaterialCutsCouple*); // Material cuts couple
244 
245  // Assignment operator and copy constructor are hidden:
249 
250  // ######################################################################
251  // # Models and dE/dx tables for computing the energy loss
252  // #
253  // ######################################################################
254 
255  // G4BraggIonModel and G4BetheBlochModel are used for ion-target
256  // combinations and/or projectile energies not covered by parametrisations
257  // adopted by this model:
260 
261  // List of dE/dx tables plugged into the model
263 
264  // ######################################################################
265  // # Maps of Range vs Energy and Energy vs Range vectors
266  // #
267  // ######################################################################
268 
269  typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> RangeEnergyTable;
271 
272  typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> EnergyRangeTable;
274 
275  // ######################################################################
276  // # Energy grid definitions (e.g. used for computing range-energy
277  // # tables)
278  // ######################################################################
279 
282 
283  size_t nmbBins;
284  size_t nmbSubBins;
285 
286  // ######################################################################
287  // # Particle change for loss
288  // #
289  // ######################################################################
290 
291  // Pointer to particle change object, which is used to set e.g. the
292  // energy loss and secondary delta-electron
293  // used indicating if model is initialized
295 
296  // ######################################################################
297  // # Corrections and energy loss limit
298  // #
299  // ######################################################################
300 
301  // Pointer to an G4EmCorrections object, which is used to compute the
302  // effective ion charge, and other corrections (like high order corrections
303  // to stopping powers)
305 
306  // Corrections factor for effective charge, computed for each particle
307  // step
309 
310  // Parameter indicating the maximal fraction of kinetic energy, which
311  // a particle may loose along a step, in order that the simple relation
312  // (dE/dx)*l can still be applied to compute the energy loss (l = step
313  // length)
315 
316  // ######################################################################
317  // # Cut energies and properties of generic ion
318  // #
319  // ######################################################################
320 
321  // Vector containing the current cut energies (the vector index matches
322  // the material-cuts couple index):
324 
325  // Pointer to generic ion and mass of generic ion
328 
329  // ######################################################################
330  // # "Most-recently-used" cache parameters
331  // #
332  // ######################################################################
333 
334  // Cached key (particle) and value information for a faster
335  // access of particle-related information
336  const G4ParticleDefinition* cacheParticle; // Key: Current projectile
337  G4double cacheMass; // Projectile mass
338  G4double cacheElecMassRatio; // Electron-mass ratio
339  G4double cacheChargeSquare; // Charge squared
340 
341  // Cached parameters needed during range computations:
342  const G4ParticleDefinition* rangeCacheParticle; // Key: 1) Current ion,
343  const G4MaterialCutsCouple* rangeCacheMatCutsCouple; // 2) Mat-cuts-couple
344  G4PhysicsVector* rangeCacheEnergyRange; // Energy vs range vector
345  G4PhysicsVector* rangeCacheRangeEnergy; // Range vs energy vector
346 
347  // Cached parameters needed during dE/dx computations:
348  const G4ParticleDefinition* dedxCacheParticle; // Key: 1) Current ion,
349  const G4Material* dedxCacheMaterial; // 2) material and
350  G4double dedxCacheEnergyCut; // 3) cut energy
351  LossTableList::iterator dedxCacheIter; // Responsible dE/dx table
352  G4double dedxCacheTransitionEnergy; // Transition energy between
353  // parameterization and
354  // Bethe-Bloch model
355  G4double dedxCacheTransitionFactor; // Factor for smoothing the dE/dx
356  // values in the transition region
357  G4double dedxCacheGenIonMassRatio; // Ratio of generic ion mass
358  // and current particle mass
360 };
361 
362 
363 #include "G4IonParametrisedLossModel.icc"
364 
365 #endif