Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // 27 // =========================================== 28 // GEANT4 class header file 29 // 30 // Class: G4IonParametrisedLoss 31 // 32 // Base class: G4VEmModel (utils) 33 // 34 // Author: Anton Lechner (Anton. 35 // 36 // First implementation: 10. 11. 2008 37 // 38 // Modifications: 03. 02. 2009 - Bug fix itera 39 // 11. 03. 2009 - Introduced ne 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 // 54 // Class description: 55 // Model for computing the energy loss of i 56 // parameterisation of dE/dx tables (defaul 57 // ion-material combinations and/or project 58 // by this model, the G4BraggIonModel and G 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> 73 #include <CLHEP/Units/PhysicalConstants.h> 74 75 #include "G4VEmModel.hh" 76 #include "G4EmCorrections.hh" 77 #include "G4IonDEDXHandler.hh" 78 79 class G4BraggIonModel; 80 class G4BetheBlochModel; 81 class G4ParticleChangeForLoss; 82 class G4VIonDEDXTable; 83 class G4VIonDEDXScalingAlgorithm; 84 class G4PhysicsFreeVector; 85 class G4MaterialCutsCouple; 86 87 typedef std::list<G4IonDEDXHandler*> LossTable 88 typedef std::pair<const G4ParticleDefinition*, 89 const G4MaterialCutsCouple*> 90 91 class G4IonParametrisedLossModel : public G4VE 92 93 public: 94 explicit G4IonParametrisedLossModel(const G 95 const G4String& name = "ParamIC 96 97 virtual ~G4IonParametrisedLossModel(); 98 99 void Initialise( 100 const G4ParticleDefinition*, // Projecti 101 const G4DataVector&) override; // Cut en 102 103 G4double MinEnergyCut( 104 const G4ParticleDefinition*, // Project 105 const G4MaterialCutsCouple*) override; 106 107 G4double ComputeCrossSectionPerAtom( 108 const G4ParticleDefinition*, // 109 G4double, // Kinetic energy of 110 G4double, // Atomic number 111 G4double, // Mass number 112 G4double, // Energy cut for sec 113 G4double) override; // Maximum e 114 115 G4double CrossSectionPerVolume( 116 const G4Mater 117 const G4ParticleDefinition*, // Proje 118 G4double, // Kinetic energy 119 G4double, // Energy cut for secondar 120 G4double) override; // Maximum energy 121 122 G4double ComputeDEDXPerVolume( 123 const G4Material*, // Target material 124 const G4ParticleDefinition*, // Projec 125 G4double, // Kinetic energy of projec 126 G4double) override; // Energy cut for 127 128 // Function, which computes the continuous 129 // stopping) for a given pre-step energy an 130 // range vs energy (and energy vs range) ta 131 G4double ComputeLossForStep( 132 const G4Mater 133 const G4ParticleDefinition*, // Proje 134 G4double, // Kinetic energy of proje 135 G4double); // Length of current step 136 137 // Function, which computes the mean energy 138 inline G4double DeltaRayMeanEnergyTransferR 139 const G4Mater 140 const G4ParticleDefinition*, // 141 G4double, // Kinetic energy of proje 142 G4double); // Energy cut for secondar 143 144 145 void SampleSecondaries(std::vector<G4Dynami 146 const G4MaterialCutsCouple*, 147 const G4DynamicParticle*, 148 G4double, // Energy cut for secondary 149 G4double) override; // Maximum energy 150 151 G4double GetChargeSquareRatio( 152 const G4Parti 153 const G4Material*, // Target Materia 154 G4double) override; // Kinetic energy 155 156 G4double GetParticleCharge( 157 const G4ParticleDefinition*, // Pr 158 const G4Material*, // Target Mate 159 G4double) override; // Kinetic ene 160 161 void CorrectionsAlongStep( 162 const G4MaterialC 163 const G4DynamicParticle*, // Dyn. 164 const G4double&, 165 G4double&) override; // Ener 166 167 // Function which allows to add additional 168 // in combination with a scaling algorithm, 169 // information like the current particle en 170 // algorithm are used via a handler class, 171 // which applies the scaling of energy and 172 G4bool AddDEDXTable(const G4String& name, 173 G4VIonDEDXTable* table, 174 G4VIonDEDXScalingAlgorith 175 176 G4bool RemoveDEDXTable(const G4String& name 177 178 // Function which allows to switch off scal 179 // ions from existing ICRU 73 data 180 // void DeactivateICRU73Scaling(); 181 182 // Function checking the applicability of p 183 // combinations (Note: the energy range of 184 inline LossTableList::iterator IsApplicable 185 const G4ParticleDefiniti 186 const G4Material*); 187 188 // Function printing a dE/dx table for a gi 189 // and a specified energy grid 190 void PrintDEDXTable( 191 const G4ParticleDefiniti 192 const G4Material*, // Ab 193 G4double, // Mi 194 G4double, // Ma 195 G4int, // Nu 196 G4bool); // Lo 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 208 // Function for setting energy loss limit f 209 inline void SetEnergyLossLimit(G4double ion 210 211 protected: 212 G4double MaxSecondaryEnergy(const G4Particl 213 G4double) override; // Kinetic 214 215 private: 216 // Function which updates parameters concer 217 // (the parameters are only updated if the 218 // the associated energy cut has changed) 219 void UpdateDEDXCache( 220 const G4ParticleDefinition*, 221 const G4Material*, 222 G4double cutEnergy); 223 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 232 inline void UpdateCache( 233 const G4ParticleDefinition*) 234 235 // Function, which builds range vs energy ( 236 // for a given particle, material and energ 237 void BuildRangeVector( 238 const G4ParticleDefinition*, 239 const G4MaterialCutsCouple*) 240 241 // Assignment operator and copy constructor 242 G4IonParametrisedLossModel & operator=( 243 const G4IonParam 244 G4IonParametrisedLossModel(const G4IonParam 245 246 // ######################################## 247 // # Models and dE/dx tables for computing 248 // # 249 // ######################################## 250 251 // G4BraggIonModel and G4BetheBlochModel ar 252 // combinations and/or projectile energies 253 // adopted by this model: 254 G4BraggIonModel* braggIonModel; 255 G4BetheBlochModel* betheBlochModel; 256 257 // List of dE/dx tables plugged into the mo 258 LossTableList lossTableList; 259 260 // ######################################## 261 // # Maps of Range vs Energy and Energy vs 262 // # 263 // ######################################## 264 265 typedef std::map<IonMatCouple, G4PhysicsFre 266 RangeEnergyTable r; 267 268 typedef std::map<IonMatCouple, G4PhysicsFre 269 EnergyRangeTable E; 270 271 // ######################################## 272 // # Energy grid definitions (e.g. used for 273 // # tables) 274 // ######################################## 275 276 G4double lowerEnergyEdgeIntegr; 277 G4double upperEnergyEdgeIntegr; 278 279 size_t nmbBins; 280 size_t nmbSubBins; 281 282 // ######################################## 283 // # Particle change for loss 284 // # 285 // ######################################## 286 287 // Pointer to particle change object, which 288 // energy loss and secondary delta-electron 289 // used indicating if model is initialized 290 G4ParticleChangeForLoss* particleChangeLoss 291 292 // ######################################## 293 // # Corrections and energy loss limit 294 // # 295 // ######################################## 296 297 // Pointer to an G4EmCorrections object, wh 298 // effective ion charge, and other correcti 299 // to stopping powers) 300 G4EmCorrections* corrections; 301 302 // Corrections factor for effective charge, 303 // step 304 G4double corrFactor; 305 306 // Parameter indicating the maximal fractio 307 // a particle may loose along a step, in or 308 // (dE/dx)*l can still be applied to comput 309 // length) 310 G4double energyLossLimit; 311 312 // ######################################## 313 // # Cut energies and properties of generic 314 // # 315 // ######################################## 316 317 // Vector containing the current cut energi 318 // the material-cuts couple index): 319 G4DataVector cutEnergies; 320 321 // Pointer to generic ion and mass of gener 322 const G4ParticleDefinition* genericIon; 323 G4double genericIonPDGMass; 324 325 // ######################################## 326 // # "Most-recently-used" cache parameters 327 // # 328 // ######################################## 329 330 // Cached key (particle) and value informat 331 // access of particle-related information 332 const G4ParticleDefinition* cacheParticle; 333 G4double cacheMass; 334 G4double cacheElecMassRatio; 335 G4double cacheChargeSquare; 336 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 344 const G4ParticleDefinition* dedxCachePartic 345 const G4Material* dedxCacheMaterial; 346 G4double dedxCacheEnergyCut; 347 LossTableList::iterator dedxCacheIter; 348 G4double dedxCacheTransitionEnergy; // 349 // 350 // 351 G4double dedxCacheTransitionFactor; // 352 // 353 G4double dedxCacheGenIonMassRatio; // 354 // 355 G4bool isInitialised; 356 }; 357 358 359 #include "G4IonParametrisedLossModel.icc" 360 361 #endif 362