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