Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // 27 // =========================================== 28 // =========================================================================== 28 // GEANT4 class header file 29 // GEANT4 class header file 29 // 30 // 30 // Class: G4IonParametrisedLoss 31 // Class: G4IonParametrisedLossModel 31 // 32 // 32 // Base class: G4VEmModel (utils) 33 // Base class: G4VEmModel (utils) 33 // 34 // 34 // Author: Anton Lechner (Anton. 35 // Author: Anton Lechner (Anton.Lechner@cern.ch) 35 // 36 // 36 // First implementation: 10. 11. 2008 37 // First implementation: 10. 11. 2008 37 // 38 // 38 // Modifications: 03. 02. 2009 - Bug fix itera 39 // Modifications: 03. 02. 2009 - Bug fix iterators (AL) 39 // 11. 03. 2009 - Introduced ne << 40 // 40 // and modified << 41 // (tables are n << 42 // Minor bug fix << 43 // 12. 11. 2009 - Added functio << 44 // of heavy ions << 45 // 20. 11. 2009 - Added set-met << 46 // 24. 11. 2009 - Bug fix: Rang << 47 // materials app << 48 // regions (adde << 49 // modified Buil << 50 // functions acc << 51 // changed typde << 52 // - Removed GetRa << 53 // 41 // 54 // Class description: 42 // Class description: 55 // Model for computing the energy loss of i 43 // Model for computing the energy loss of ions by employing a 56 // parameterisation of dE/dx tables (defaul 44 // parameterisation of dE/dx tables (default ICRU 73 tables). For 57 // ion-material combinations and/or project 45 // ion-material combinations and/or projectile energies not covered 58 // by this model, the G4BraggIonModel and G 46 // by this model, the G4BraggIonModel and G4BetheBloch models are 59 // employed. 47 // employed. 60 // 48 // 61 // Comments: 49 // Comments: 62 // 50 // 63 // =========================================== 51 // =========================================================================== 64 52 65 53 66 #ifndef G4IONPARAMETRISEDLOSSMODEL_HH 54 #ifndef G4IONPARAMETRISEDLOSSMODEL_HH 67 #define G4IONPARAMETRISEDLOSSMODEL_HH 55 #define G4IONPARAMETRISEDLOSSMODEL_HH 68 56 >> 57 #include "G4VEmModel.hh" >> 58 #include "G4EmCorrections.hh" >> 59 #include "G4IonParametrisedLossTable.hh" >> 60 #include "G4EmCorrections.hh" 69 #include <iomanip> 61 #include <iomanip> 70 #include <list> 62 #include <list> 71 #include <map> 63 #include <map> 72 #include <utility> 64 #include <utility> 73 #include <CLHEP/Units/PhysicalConstants.h> << 74 << 75 #include "G4VEmModel.hh" << 76 #include "G4EmCorrections.hh" << 77 #include "G4IonDEDXHandler.hh" << 78 65 79 class G4BraggIonModel; 66 class G4BraggIonModel; 80 class G4BetheBlochModel; 67 class G4BetheBlochModel; 81 class G4ParticleChangeForLoss; 68 class G4ParticleChangeForLoss; 82 class G4VIonDEDXTable; << 69 83 class G4VIonDEDXScalingAlgorithm; << 70 typedef std::list<G4IonLossTableHandle*> LossTableList; 84 class G4PhysicsFreeVector; << 71 typedef std::pair<const G4ParticleDefinition*, const G4Material*> IonMatCouple; 85 class G4MaterialCutsCouple; << 72 86 << 87 typedef std::list<G4IonDEDXHandler*> LossTable << 88 typedef std::pair<const G4ParticleDefinition*, << 89 const G4MaterialCutsCouple*> << 90 73 91 class G4IonParametrisedLossModel : public G4VE 74 class G4IonParametrisedLossModel : public G4VEmModel { 92 75 93 public: 76 public: 94 explicit G4IonParametrisedLossModel(const G << 77 G4IonParametrisedLossModel(const G4ParticleDefinition* particle = 0, 95 const G4String& name = "ParamIC << 78 const G4String& name = "ParamICRU73"); 96 79 97 virtual ~G4IonParametrisedLossModel(); 80 virtual ~G4IonParametrisedLossModel(); 98 81 99 void Initialise( << 82 virtual void Initialise( 100 const G4ParticleDefinition*, // Projecti << 83 const G4ParticleDefinition*, // Projectile 101 const G4DataVector&) override; // Cut en << 84 const G4DataVector&); // Cut energies 102 << 85 103 G4double MinEnergyCut( << 86 virtual G4double MinEnergyCut( 104 const G4ParticleDefinition*, // Project << 87 const G4ParticleDefinition*, // Projectile 105 const G4MaterialCutsCouple*) override; << 88 const G4MaterialCutsCouple*); 106 << 89 107 G4double ComputeCrossSectionPerAtom( << 90 virtual G4double ComputeCrossSectionPerAtom( 108 const G4ParticleDefinition*, // << 91 const G4ParticleDefinition*, // Projectile 109 G4double, // Kinetic energy of << 92 G4double, // Kinetic energy of projectile 110 G4double, // Atomic number << 93 G4double, // Atomic number 111 G4double, // Mass number << 94 G4double, // Mass number 112 G4double, // Energy cut for sec << 95 G4double, // Energy cut for secondary prod. 113 G4double) override; // Maximum e << 96 G4double); // Maximum energy of secondaries 114 << 97 115 G4double CrossSectionPerVolume( << 98 virtual G4double CrossSectionPerVolume( 116 const G4Mater 99 const G4Material*, // Target material 117 const G4ParticleDefinition*, // Proje 100 const G4ParticleDefinition*, // Projectile 118 G4double, // Kinetic energy 101 G4double, // Kinetic energy 119 G4double, // Energy cut for secondar 102 G4double, // Energy cut for secondary prod. 120 G4double) override; // Maximum energy << 103 G4double); // Maximum energy of secondaries 121 104 122 G4double ComputeDEDXPerVolume( << 105 virtual G4double ComputeDEDXPerVolume( 123 const G4Material*, // Target material << 106 const G4Material*, // Target material 124 const G4ParticleDefinition*, // Projec << 107 const G4ParticleDefinition*, // Projectile 125 G4double, // Kinetic energy of projec << 108 G4double, // Kinetic energy of projectile 126 G4double) override; // Energy cut for << 109 G4double); // Energy cut for secondary prod. 127 << 110 128 // Function, which computes the continuous 111 // Function, which computes the continuous energy loss (due to electronic 129 // stopping) for a given pre-step energy an 112 // stopping) for a given pre-step energy and step length by using 130 // range vs energy (and energy vs range) ta 113 // range vs energy (and energy vs range) tables 131 G4double ComputeLossForStep( 114 G4double ComputeLossForStep( 132 const G4Mater << 115 const G4Material*, // Target material 133 const G4ParticleDefinition*, // Proje 116 const G4ParticleDefinition*, // Projectile 134 G4double, // Kinetic energy of proje 117 G4double, // Kinetic energy of projectile >> 118 G4double, // Energy cut for secondary prod. 135 G4double); // Length of current step 119 G4double); // Length of current step 136 120 137 // Function, which computes the mean energy 121 // Function, which computes the mean energy transfer rate to delta rays 138 inline G4double DeltaRayMeanEnergyTransferR << 122 G4double DeltaRayMeanEnergyTransferRate( 139 const G4Mater 123 const G4Material*, // Target Material 140 const G4ParticleDefinition*, // 124 const G4ParticleDefinition*, // Projectile 141 G4double, // Kinetic energy of proje 125 G4double, // Kinetic energy of projectile 142 G4double); // Energy cut for secondar 126 G4double); // Energy cut for secondary prod. 143 127 144 128 145 void SampleSecondaries(std::vector<G4Dynami << 129 virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*, 146 const G4MaterialCutsCouple*, << 130 const G4MaterialCutsCouple*, 147 const G4DynamicParticle*, << 131 const G4DynamicParticle*, 148 G4double, // Energy cut for secondary << 132 G4double, // Energy cut for secondary prod. 149 G4double) override; // Maximum energy << 133 G4double); // Maximum energy of secondaries 150 134 151 G4double GetChargeSquareRatio( << 135 virtual G4double GetChargeSquareRatio( 152 const G4Parti 136 const G4ParticleDefinition*, // Projectile 153 const G4Material*, // Target Materia 137 const G4Material*, // Target Material 154 G4double) override; // Kinetic energy << 138 G4double); // Kinetic energy of projectile 155 139 156 G4double GetParticleCharge( << 140 virtual G4double GetParticleCharge( 157 const G4ParticleDefinition*, // Pr << 141 const G4ParticleDefinition*, // Projectile 158 const G4Material*, // Target Mate << 142 const G4Material*, // Target Material 159 G4double) override; // Kinetic ene << 143 G4double); // Kinetic energy of projectile 160 << 144 161 void CorrectionsAlongStep( << 145 virtual void CorrectionsAlongStep( 162 const G4MaterialC << 146 const G4MaterialCutsCouple*,// Mat.-Cut couple 163 const G4DynamicParticle*, // Dyn. << 147 const G4DynamicParticle*, // Dyn. particle 164 const G4double&, << 148 G4double&, // Energy loss in current step 165 G4double&) override; // Ener << 149 G4double&, >> 150 G4double); // Length of current step 166 151 167 // Function which allows to add additional << 152 >> 153 // Template function which allows to add additional stopping power tables 168 // in combination with a scaling algorithm, 154 // in combination with a scaling algorithm, which may depend on dynamic 169 // information like the current particle en 155 // information like the current particle energy (the table and scaling 170 // algorithm are used via a handler class, << 156 // algorithm are used via a wrapper class, which performs e.g.caching or 171 // which applies the scaling of energy and 157 // which applies the scaling of energy and dE/dx values) 172 G4bool AddDEDXTable(const G4String& name, << 158 template <class TABLE, class SCALING_ALGO> 173 G4VIonDEDXTable* table, << 159 void AddDEDXTable() { 174 G4VIonDEDXScalingAlgorith << 160 G4IonLossTableHandle* table = 175 << 161 new G4IonParametrisedLossTable<TABLE, SCALING_ALGO>; 176 G4bool RemoveDEDXTable(const G4String& name << 162 177 << 163 lossTableList.push_front(table); 178 // Function which allows to switch off scal << 164 } 179 // ions from existing ICRU 73 data << 165 180 // void DeactivateICRU73Scaling(); << 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 } 181 176 182 // Function checking the applicability of p 177 // Function checking the applicability of physics tables to ion-material 183 // combinations (Note: the energy range of 178 // combinations (Note: the energy range of tables is not checked) 184 inline LossTableList::iterator IsApplicable << 179 LossTableList::iterator IsApplicable( 185 const G4ParticleDefiniti 180 const G4ParticleDefinition*, // Projectile (ion) 186 const G4Material*); 181 const G4Material*); // Target material 187 182 188 // Function printing a dE/dx table for a gi 183 // Function printing a dE/dx table for a given ion-material combination 189 // and a specified energy grid 184 // and a specified energy grid 190 void PrintDEDXTable( 185 void PrintDEDXTable( 191 const G4ParticleDefiniti 186 const G4ParticleDefinition*, // Projectile (ion) 192 const G4Material*, // Ab 187 const G4Material*, // Absorber material 193 G4double, // Mi 188 G4double, // Minimum energy per nucleon 194 G4double, // Ma 189 G4double, // Maximum energy per nucleon 195 G4int, // Nu 190 G4int, // Number of bins 196 G4bool); // Lo 191 G4bool); // Logarithmic scaling of energy 197 << 198 // Function printing a dE/dx table for a gi << 199 // and a specified energy grid << 200 void PrintDEDXTableHandlers( << 201 const G4ParticleDefiniti << 202 const G4Material*, // Ab << 203 G4double, // Mi << 204 G4double, // Ma << 205 G4int, // Nu << 206 G4bool); // Lo << 207 192 208 // Function for setting energy loss limit f << 209 inline void SetEnergyLossLimit(G4double ion << 210 << 211 protected: 193 protected: 212 G4double MaxSecondaryEnergy(const G4Particl 194 G4double MaxSecondaryEnergy(const G4ParticleDefinition*, 213 G4double) override; // Kinetic << 195 G4double); // Kinetic energy of projectile 214 196 215 private: 197 private: 216 // Function which updates parameters concer 198 // Function which updates parameters concerning the dE/dx calculation 217 // (the parameters are only updated if the 199 // (the parameters are only updated if the particle, the material or 218 // the associated energy cut has changed) 200 // the associated energy cut has changed) 219 void UpdateDEDXCache( 201 void UpdateDEDXCache( 220 const G4ParticleDefinition*, 202 const G4ParticleDefinition*, // Projectile (ion) 221 const G4Material*, 203 const G4Material*, // Target material 222 G4double cutEnergy); 204 G4double cutEnergy); // Energy cut 223 205 224 // Function which updates parameters concer << 225 // (the parameters are only updated if the << 226 // the associated energy cut has changed) << 227 void UpdateRangeCache( << 228 const G4ParticleDefinition*, << 229 const G4MaterialCutsCouple*) << 230 << 231 // Function, which updates parameters conce 206 // Function, which updates parameters concering particle properties 232 inline void UpdateCache( << 207 void UpdateCache( 233 const G4ParticleDefinition*) 208 const G4ParticleDefinition*); // Projectile (ion) 234 209 235 // Function, which builds range vs energy ( 210 // Function, which builds range vs energy (and energy vs range) vectors 236 // for a given particle, material and energ 211 // for a given particle, material and energy cut 237 void BuildRangeVector( 212 void BuildRangeVector( 238 const G4ParticleDefinition*, 213 const G4ParticleDefinition*, // Projectile (ion) 239 const G4MaterialCutsCouple*) << 214 const G4Material*, // Target material >> 215 G4double); // Energy cut 240 216 241 // Assignment operator and copy constructor 217 // Assignment operator and copy constructor are hidden: 242 G4IonParametrisedLossModel & operator=( 218 G4IonParametrisedLossModel & operator=( 243 const G4IonParam 219 const G4IonParametrisedLossModel &right); 244 G4IonParametrisedLossModel(const G4IonParam 220 G4IonParametrisedLossModel(const G4IonParametrisedLossModel &); 245 221 246 // ######################################## 222 // ###################################################################### 247 // # Models and dE/dx tables for computing 223 // # Models and dE/dx tables for computing the energy loss 248 // # 224 // # 249 // ######################################## 225 // ###################################################################### 250 226 251 // G4BraggIonModel and G4BetheBlochModel ar 227 // G4BraggIonModel and G4BetheBlochModel are used for ion-target 252 // combinations and/or projectile energies 228 // combinations and/or projectile energies not covered by parametrisations 253 // adopted by this model: 229 // adopted by this model: 254 G4BraggIonModel* braggIonModel; 230 G4BraggIonModel* braggIonModel; 255 G4BetheBlochModel* betheBlochModel; 231 G4BetheBlochModel* betheBlochModel; 256 232 257 // List of dE/dx tables plugged into the mo 233 // List of dE/dx tables plugged into the model 258 LossTableList lossTableList; 234 LossTableList lossTableList; 259 235 260 // ######################################## 236 // ###################################################################### 261 // # Maps of Range vs Energy and Energy vs 237 // # Maps of Range vs Energy and Energy vs Range vectors 262 // # 238 // # 263 // ######################################## 239 // ###################################################################### 264 240 265 typedef std::map<IonMatCouple, G4PhysicsFre << 241 typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> RangeEnergyTable; 266 RangeEnergyTable r; 242 RangeEnergyTable r; 267 243 268 typedef std::map<IonMatCouple, G4PhysicsFre << 244 typedef std::map<IonMatCouple, G4LPhysicsFreeVector*> EnergyRangeTable; 269 EnergyRangeTable E; 245 EnergyRangeTable E; 270 246 271 // ######################################## 247 // ###################################################################### 272 // # Energy grid definitions (e.g. used for 248 // # Energy grid definitions (e.g. used for computing range-energy 273 // # tables) 249 // # tables) 274 // ######################################## 250 // ###################################################################### 275 251 276 G4double lowerEnergyEdgeIntegr; 252 G4double lowerEnergyEdgeIntegr; 277 G4double upperEnergyEdgeIntegr; 253 G4double upperEnergyEdgeIntegr; 278 254 279 size_t nmbBins; 255 size_t nmbBins; 280 size_t nmbSubBins; 256 size_t nmbSubBins; 281 257 282 // ######################################## 258 // ###################################################################### 283 // # Particle change for loss 259 // # Particle change for loss 284 // # 260 // # 285 // ######################################## 261 // ###################################################################### 286 262 287 // Pointer to particle change object, which 263 // Pointer to particle change object, which is used to set e.g. the 288 // energy loss and secondary delta-electron << 264 // energy loss due to nuclear stopping 289 // used indicating if model is initialized << 290 G4ParticleChangeForLoss* particleChangeLoss 265 G4ParticleChangeForLoss* particleChangeLoss; 291 266 >> 267 // Flag indicating if model is initialized (i.e. if >> 268 // G4ParticleChangeForLoss was created) >> 269 G4bool modelIsInitialised; >> 270 292 // ######################################## 271 // ###################################################################### 293 // # Corrections and energy loss limit 272 // # Corrections and energy loss limit 294 // # 273 // # 295 // ######################################## 274 // ###################################################################### 296 275 297 // Pointer to an G4EmCorrections object, wh 276 // Pointer to an G4EmCorrections object, which is used to compute the 298 // effective ion charge, and other correcti 277 // effective ion charge, and other corrections (like high order corrections 299 // to stopping powers) 278 // to stopping powers) 300 G4EmCorrections* corrections; 279 G4EmCorrections* corrections; 301 280 302 // Corrections factor for effective charge, 281 // Corrections factor for effective charge, computed for each particle 303 // step 282 // step 304 G4double corrFactor; 283 G4double corrFactor; 305 284 306 // Parameter indicating the maximal fractio 285 // Parameter indicating the maximal fraction of kinetic energy, which 307 // a particle may loose along a step, in or 286 // a particle may loose along a step, in order that the simple relation 308 // (dE/dx)*l can still be applied to comput 287 // (dE/dx)*l can still be applied to compute the energy loss (l = step 309 // length) 288 // length) 310 G4double energyLossLimit; 289 G4double energyLossLimit; 311 290 312 // ######################################## 291 // ###################################################################### 313 // # Cut energies and properties of generic 292 // # Cut energies and properties of generic ion 314 // # 293 // # 315 // ######################################## 294 // ###################################################################### 316 295 317 // Vector containing the current cut energi 296 // Vector containing the current cut energies (the vector index matches 318 // the material-cuts couple index): 297 // the material-cuts couple index): 319 G4DataVector cutEnergies; 298 G4DataVector cutEnergies; 320 299 321 // Pointer to generic ion and mass of gener 300 // Pointer to generic ion and mass of generic ion 322 const G4ParticleDefinition* genericIon; << 301 G4ParticleDefinition* genericIon; 323 G4double genericIonPDGMass; 302 G4double genericIonPDGMass; 324 303 325 // ######################################## 304 // ###################################################################### 326 // # "Most-recently-used" cache parameters 305 // # "Most-recently-used" cache parameters 327 // # 306 // # 328 // ######################################## 307 // ###################################################################### 329 308 330 // Cached key (particle) and value informat 309 // Cached key (particle) and value information for a faster 331 // access of particle-related information 310 // access of particle-related information 332 const G4ParticleDefinition* cacheParticle; 311 const G4ParticleDefinition* cacheParticle; // Key: Current projectile 333 G4double cacheMass; 312 G4double cacheMass; // Projectile mass 334 G4double cacheElecMassRatio; 313 G4double cacheElecMassRatio; // Electron-mass ratio 335 G4double cacheChargeSquare; 314 G4double cacheChargeSquare; // Charge squared 336 315 337 // Cached parameters needed during range co << 338 const G4ParticleDefinition* rangeCacheParti << 339 const G4MaterialCutsCouple* rangeCacheMatCu << 340 G4PhysicsVector* rangeCacheEnergyRange; << 341 G4PhysicsVector* rangeCacheRangeEnergy; << 342 << 343 // Cached parameters needed during dE/dx co 316 // Cached parameters needed during dE/dx computations: 344 const G4ParticleDefinition* dedxCachePartic 317 const G4ParticleDefinition* dedxCacheParticle; // Key: 1) Current ion, 345 const G4Material* dedxCacheMaterial; 318 const G4Material* dedxCacheMaterial; // 2) material and 346 G4double dedxCacheEnergyCut; 319 G4double dedxCacheEnergyCut; // 3) cut energy 347 LossTableList::iterator dedxCacheIter; 320 LossTableList::iterator dedxCacheIter; // Responsible dE/dx table >> 321 G4PhysicsVector* dedxCacheEnergyRange; // Energy vs range vector >> 322 G4PhysicsVector* dedxCacheRangeEnergy; // Range vs energy vector 348 G4double dedxCacheTransitionEnergy; // 323 G4double dedxCacheTransitionEnergy; // Transition energy between 349 // 324 // parameterization and 350 // 325 // Bethe-Bloch model 351 G4double dedxCacheTransitionFactor; // 326 G4double dedxCacheTransitionFactor; // Factor for smoothing the dE/dx 352 // 327 // values in the transition region 353 G4double dedxCacheGenIonMassRatio; // 328 G4double dedxCacheGenIonMassRatio; // Ratio of generic ion mass 354 // 329 // and current particle mass 355 G4bool isInitialised; << 356 }; 330 }; 357 331 358 332 359 #include "G4IonParametrisedLossModel.icc" 333 #include "G4IonParametrisedLossModel.icc" 360 334 361 #endif 335 #endif 362 336