00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id$ 00027 // 00028 // =========================================================================== 00029 // GEANT4 class header file 00030 // 00031 // Class: G4IonParametrisedLossModel 00032 // 00033 // Base class: G4VEmModel (utils) 00034 // 00035 // Author: Anton Lechner (Anton.Lechner@cern.ch) 00036 // 00037 // First implementation: 10. 11. 2008 00038 // 00039 // Modifications: 03. 02. 2009 - Bug fix iterators (AL) 00040 // 11. 03. 2009 - Introduced new table handler(G4IonDEDXHandler) 00041 // and modified method to add/remove tables 00042 // (tables are now built in init. phase), 00043 // Minor bug fix in ComputeDEDXPerVolume (AL) 00044 // 12. 11. 2009 - Added function for switching off scaling 00045 // of heavy ions from ICRU 73 data 00046 // 20. 11. 2009 - Added set-method for energy loss limit (AL) 00047 // 24. 11. 2009 - Bug fix: Range calculation corrected if same 00048 // materials appears with different cuts in diff. 00049 // regions (added UpdateRangeCache function and 00050 // modified BuildRangeVector, ComputeLossForStep 00051 // functions accordingly, added new cache param., 00052 // changed typdef of IonMatCouple). 00053 // - Removed GetRange function (AL) 00054 // 00055 // Class description: 00056 // Model for computing the energy loss of ions by employing a 00057 // parameterisation of dE/dx tables (default ICRU 73 tables). For 00058 // ion-material combinations and/or projectile energies not covered 00059 // by this model, the G4BraggIonModel and G4BetheBloch models are 00060 // employed. 00061 // 00062 // Comments: 00063 // 00064 // =========================================================================== 00065 00066 00067 #ifndef G4IONPARAMETRISEDLOSSMODEL_HH 00068 #define G4IONPARAMETRISEDLOSSMODEL_HH 00069 00070 #include <iomanip> 00071 #include <list> 00072 #include <map> 00073 #include <utility> 00074 #include <CLHEP/Units/PhysicalConstants.h> 00075 00076 #include "G4VEmModel.hh" 00077 #include "G4EmCorrections.hh" 00078 #include "G4IonDEDXHandler.hh" 00079 00080 class G4BraggIonModel; 00081 class G4BetheBlochModel; 00082 class G4ParticleChangeForLoss; 00083 class G4VIonDEDXTable; 00084 class G4VIonDEDXScalingAlgorithm; 00085 class G4LPhysicsFreeVector; 00086 class G4MaterialCutsCouple; 00087 00088 typedef std::list<G4IonDEDXHandler*> LossTableList; 00089 typedef std::pair<const G4ParticleDefinition*, 00090 const G4MaterialCutsCouple*> IonMatCouple; 00091 00092 00093 class G4IonParametrisedLossModel : public G4VEmModel { 00094 00095 public: 00096 G4IonParametrisedLossModel(const G4ParticleDefinition* particle = 0, 00097 const G4String& name = "ParamICRU73"); 00098 00099 virtual ~G4IonParametrisedLossModel(); 00100 00101 virtual void Initialise( 00102 const G4ParticleDefinition*, // Projectile 00103 const G4DataVector&); // Cut energies 00104 00105 virtual G4double MinEnergyCut( 00106 const G4ParticleDefinition*, // Projectile 00107 const G4MaterialCutsCouple*); 00108 00109 virtual G4double ComputeCrossSectionPerAtom( 00110 const G4ParticleDefinition*, // Projectile 00111 G4double, // Kinetic energy of projectile 00112 G4double, // Atomic number 00113 G4double, // Mass number 00114 G4double, // Energy cut for secondary prod. 00115 G4double); // Maximum energy of secondaries 00116 00117 virtual G4double CrossSectionPerVolume( 00118 const G4Material*, // Target material 00119 const G4ParticleDefinition*, // Projectile 00120 G4double, // Kinetic energy 00121 G4double, // Energy cut for secondary prod. 00122 G4double); // Maximum energy of secondaries 00123 00124 virtual G4double ComputeDEDXPerVolume( 00125 const G4Material*, // Target material 00126 const G4ParticleDefinition*, // Projectile 00127 G4double, // Kinetic energy of projectile 00128 G4double); // Energy cut for secondary prod. 00129 00130 // Function, which computes the continuous energy loss (due to electronic 00131 // stopping) for a given pre-step energy and step length by using 00132 // range vs energy (and energy vs range) tables 00133 G4double ComputeLossForStep( 00134 const G4MaterialCutsCouple*, // Mat-cuts couple 00135 const G4ParticleDefinition*, // Projectile 00136 G4double, // Kinetic energy of projectile 00137 G4double); // Length of current step 00138 00139 // Function, which computes the mean energy transfer rate to delta rays 00140 inline G4double DeltaRayMeanEnergyTransferRate( 00141 const G4Material*, // Target Material 00142 const G4ParticleDefinition*, // Projectile 00143 G4double, // Kinetic energy of projectile 00144 G4double); // Energy cut for secondary prod. 00145 00146 00147 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 00148 const G4MaterialCutsCouple*, 00149 const G4DynamicParticle*, 00150 G4double, // Energy cut for secondary prod. 00151 G4double); // Maximum energy of secondaries 00152 00153 virtual G4double GetChargeSquareRatio( 00154 const G4ParticleDefinition*, // Projectile 00155 const G4Material*, // Target Material 00156 G4double); // Kinetic energy of projectile 00157 00158 virtual G4double GetParticleCharge( 00159 const G4ParticleDefinition*, // Projectile 00160 const G4Material*, // Target Material 00161 G4double); // Kinetic energy of projectile 00162 00163 virtual void CorrectionsAlongStep( 00164 const G4MaterialCutsCouple*,// Mat.-Cut couple 00165 const G4DynamicParticle*, // Dyn. particle 00166 G4double&, // Energy loss in current step 00167 G4double&, 00168 G4double); // Length of current step 00169 00170 // Function which allows to add additional stopping power tables 00171 // in combination with a scaling algorithm, which may depend on dynamic 00172 // information like the current particle energy (the table and scaling 00173 // algorithm are used via a handler class, which performs e.g.caching or 00174 // which applies the scaling of energy and dE/dx values) 00175 G4bool AddDEDXTable(const G4String& name, 00176 G4VIonDEDXTable* table, 00177 G4VIonDEDXScalingAlgorithm* algorithm = 0); 00178 00179 G4bool RemoveDEDXTable(const G4String& name); 00180 00181 // Function which allows to switch off scaling of stopping powers of heavy 00182 // ions from existing ICRU 73 data 00183 void DeactivateICRU73Scaling(); 00184 00185 // Function checking the applicability of physics tables to ion-material 00186 // combinations (Note: the energy range of tables is not checked) 00187 inline LossTableList::iterator IsApplicable( 00188 const G4ParticleDefinition*, // Projectile (ion) 00189 const G4Material*); // Target material 00190 00191 // Function printing a dE/dx table for a given ion-material combination 00192 // and a specified energy grid 00193 void PrintDEDXTable( 00194 const G4ParticleDefinition*, // Projectile (ion) 00195 const G4Material*, // Absorber material 00196 G4double, // Minimum energy per nucleon 00197 G4double, // Maximum energy per nucleon 00198 G4int, // Number of bins 00199 G4bool); // Logarithmic scaling of energy 00200 00201 // Function printing a dE/dx table for a given ion-material combination 00202 // and a specified energy grid 00203 void PrintDEDXTableHandlers( 00204 const G4ParticleDefinition*, // Projectile (ion) 00205 const G4Material*, // Absorber material 00206 G4double, // Minimum energy per nucleon 00207 G4double, // Maximum energy per nucleon 00208 G4int, // Number of bins 00209 G4bool); // Logarithmic scaling of energy 00210 00211 // Function for setting energy loss limit for stopping power integration 00212 inline void SetEnergyLossLimit(G4double ionEnergyLossLimit); 00213 00214 protected: 00215 00216 virtual 00217 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 00218 G4double); // Kinetic energy of projectile 00219 00220 private: 00221 // Function which updates parameters concerning the dE/dx calculation 00222 // (the parameters are only updated if the particle, the material or 00223 // the associated energy cut has changed) 00224 void UpdateDEDXCache( 00225 const G4ParticleDefinition*, // Projectile (ion) 00226 const G4Material*, // Target material 00227 G4double cutEnergy); // Energy cut 00228 00229 // Function which updates parameters concerning the range calculation 00230 // (the parameters are only updated if the particle, the material or 00231 // the associated energy cut has changed) 00232 void UpdateRangeCache( 00233 const G4ParticleDefinition*, // Projectile (ion) 00234 const G4MaterialCutsCouple*); // Target material 00235 00236 // Function, which updates parameters concering particle properties 00237 inline void UpdateCache( 00238 const G4ParticleDefinition*); // Projectile (ion) 00239 00240 // Function, which builds range vs energy (and energy vs range) vectors 00241 // for a given particle, material and energy cut 00242 void BuildRangeVector( 00243 const G4ParticleDefinition*, // Projectile (ion) 00244 const G4MaterialCutsCouple*); // Material cuts couple 00245 00246 // Assignment operator and copy constructor are hidden: 00247 G4IonParametrisedLossModel & operator=( 00248 const G4IonParametrisedLossModel &right); 00249 G4IonParametrisedLossModel(const G4IonParametrisedLossModel &); 00250 00251 // ###################################################################### 00252 // # Models and dE/dx tables for computing the energy loss 00253 // # 00254 // ###################################################################### 00255 00256 // G4BraggIonModel and G4BetheBlochModel are used for ion-target 00257 // combinations and/or projectile energies not covered by parametrisations 00258 // adopted by this model: 00259 G4BraggIonModel* braggIonModel; 00260 G4BetheBlochModel* betheBlochModel; 00261 00262 // List of dE/dx tables plugged into the model 00263 LossTableList lossTableList; 00264 00265 // ###################################################################### 00266 // # Maps of Range vs Energy and Energy vs Range vectors 00267 // # 00268 // ###################################################################### 00269 00270 typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> RangeEnergyTable; 00271 RangeEnergyTable r; 00272 00273 typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> EnergyRangeTable; 00274 EnergyRangeTable E; 00275 00276 // ###################################################################### 00277 // # Energy grid definitions (e.g. used for computing range-energy 00278 // # tables) 00279 // ###################################################################### 00280 00281 G4double lowerEnergyEdgeIntegr; 00282 G4double upperEnergyEdgeIntegr; 00283 00284 size_t nmbBins; 00285 size_t nmbSubBins; 00286 00287 // ###################################################################### 00288 // # Particle change for loss 00289 // # 00290 // ###################################################################### 00291 00292 // Pointer to particle change object, which is used to set e.g. the 00293 // energy loss and secondary delta-electron 00294 // used indicating if model is initialized 00295 G4ParticleChangeForLoss* particleChangeLoss; 00296 00297 // ###################################################################### 00298 // # Corrections and energy loss limit 00299 // # 00300 // ###################################################################### 00301 00302 // Pointer to an G4EmCorrections object, which is used to compute the 00303 // effective ion charge, and other corrections (like high order corrections 00304 // to stopping powers) 00305 G4EmCorrections* corrections; 00306 00307 // Corrections factor for effective charge, computed for each particle 00308 // step 00309 G4double corrFactor; 00310 00311 // Parameter indicating the maximal fraction of kinetic energy, which 00312 // a particle may loose along a step, in order that the simple relation 00313 // (dE/dx)*l can still be applied to compute the energy loss (l = step 00314 // length) 00315 G4double energyLossLimit; 00316 00317 // ###################################################################### 00318 // # Cut energies and properties of generic ion 00319 // # 00320 // ###################################################################### 00321 00322 // Vector containing the current cut energies (the vector index matches 00323 // the material-cuts couple index): 00324 G4DataVector cutEnergies; 00325 00326 // Pointer to generic ion and mass of generic ion 00327 G4ParticleDefinition* genericIon; 00328 G4double genericIonPDGMass; 00329 00330 // ###################################################################### 00331 // # "Most-recently-used" cache parameters 00332 // # 00333 // ###################################################################### 00334 00335 // Cached key (particle) and value information for a faster 00336 // access of particle-related information 00337 const G4ParticleDefinition* cacheParticle; // Key: Current projectile 00338 G4double cacheMass; // Projectile mass 00339 G4double cacheElecMassRatio; // Electron-mass ratio 00340 G4double cacheChargeSquare; // Charge squared 00341 00342 // Cached parameters needed during range computations: 00343 const G4ParticleDefinition* rangeCacheParticle; // Key: 1) Current ion, 00344 const G4MaterialCutsCouple* rangeCacheMatCutsCouple; // 2) Mat-cuts-couple 00345 G4PhysicsVector* rangeCacheEnergyRange; // Energy vs range vector 00346 G4PhysicsVector* rangeCacheRangeEnergy; // Range vs energy vector 00347 00348 // Cached parameters needed during dE/dx computations: 00349 const G4ParticleDefinition* dedxCacheParticle; // Key: 1) Current ion, 00350 const G4Material* dedxCacheMaterial; // 2) material and 00351 G4double dedxCacheEnergyCut; // 3) cut energy 00352 LossTableList::iterator dedxCacheIter; // Responsible dE/dx table 00353 G4double dedxCacheTransitionEnergy; // Transition energy between 00354 // parameterization and 00355 // Bethe-Bloch model 00356 G4double dedxCacheTransitionFactor; // Factor for smoothing the dE/dx 00357 // values in the transition region 00358 G4double dedxCacheGenIonMassRatio; // Ratio of generic ion mass 00359 // and current particle mass 00360 }; 00361 00362 00363 #include "G4IonParametrisedLossModel.icc" 00364 00365 #endif