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 // 29 // GEANT4 Class header file 29 // GEANT4 Class header file 30 // 30 // 31 // 31 // 32 // File name: G4VEnergyLossProcess 32 // File name: G4VEnergyLossProcess 33 // 33 // 34 // Author: Vladimir Ivanchenko on base 34 // Author: Vladimir Ivanchenko on base of Laszlo Urban code 35 // 35 // 36 // Creation date: 03.01.2002 36 // Creation date: 03.01.2002 37 // 37 // 38 // Modifications: Vladimir Ivanchenko 38 // Modifications: Vladimir Ivanchenko 39 // 39 // 40 // Class Description: 40 // Class Description: 41 // 41 // 42 // It is the unified energy loss process it ca 42 // It is the unified energy loss process it calculates the continuous 43 // energy loss for charged particles using a s 43 // energy loss for charged particles using a set of Energy Loss 44 // models valid for different energy regions. 44 // models valid for different energy regions. There are a possibility 45 // to create and access to dE/dx and range tab 45 // to create and access to dE/dx and range tables, or to calculate 46 // that information on fly. 46 // that information on fly. 47 47 48 // ------------------------------------------- 48 // ------------------------------------------------------------------- 49 // 49 // 50 50 51 #ifndef G4VEnergyLossProcess_h 51 #ifndef G4VEnergyLossProcess_h 52 #define G4VEnergyLossProcess_h 1 52 #define G4VEnergyLossProcess_h 1 53 53 54 #include "G4VContinuousDiscreteProcess.hh" 54 #include "G4VContinuousDiscreteProcess.hh" 55 #include "globals.hh" 55 #include "globals.hh" 56 #include "G4Material.hh" 56 #include "G4Material.hh" 57 #include "G4MaterialCutsCouple.hh" 57 #include "G4MaterialCutsCouple.hh" 58 #include "G4Track.hh" 58 #include "G4Track.hh" 59 #include "G4EmModelManager.hh" 59 #include "G4EmModelManager.hh" 60 #include "G4ParticleChangeForLoss.hh" 60 #include "G4ParticleChangeForLoss.hh" 61 #include "G4EmTableType.hh" 61 #include "G4EmTableType.hh" 62 #include "G4EmSecondaryParticleType.hh" 62 #include "G4EmSecondaryParticleType.hh" 63 #include "G4PhysicsTable.hh" 63 #include "G4PhysicsTable.hh" 64 #include "G4PhysicsVector.hh" 64 #include "G4PhysicsVector.hh" 65 65 66 class G4Step; 66 class G4Step; 67 class G4ParticleDefinition; 67 class G4ParticleDefinition; 68 class G4EmParameters; 68 class G4EmParameters; 69 class G4VEmModel; 69 class G4VEmModel; 70 class G4VEmFluctuationModel; 70 class G4VEmFluctuationModel; 71 class G4DataVector; 71 class G4DataVector; 72 class G4Region; 72 class G4Region; 73 class G4SafetyHelper; 73 class G4SafetyHelper; 74 class G4VAtomDeexcitation; 74 class G4VAtomDeexcitation; 75 class G4VSubCutProducer; 75 class G4VSubCutProducer; 76 class G4EmBiasingManager; 76 class G4EmBiasingManager; 77 class G4LossTableManager; 77 class G4LossTableManager; 78 class G4EmDataHandler; << 79 78 80 //....oooOO0OOooo........oooOO0OOooo........oo 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 81 80 82 class G4VEnergyLossProcess : public G4VContinu 81 class G4VEnergyLossProcess : public G4VContinuousDiscreteProcess 83 { 82 { 84 public: 83 public: 85 84 86 G4VEnergyLossProcess(const G4String& name = 85 G4VEnergyLossProcess(const G4String& name = "EnergyLoss", 87 G4ProcessType type = fE 86 G4ProcessType type = fElectromagnetic); 88 87 89 ~G4VEnergyLossProcess() override; 88 ~G4VEnergyLossProcess() override; 90 89 91 //------------------------------------------ 90 //------------------------------------------------------------------------ 92 // Virtual methods to be implemented in conc 91 // Virtual methods to be implemented in concrete processes 93 //------------------------------------------ 92 //------------------------------------------------------------------------ 94 93 95 protected: 94 protected: 96 95 97 // description of specific process parameter 96 // description of specific process parameters 98 virtual void StreamProcessInfo(std::ostream& 97 virtual void StreamProcessInfo(std::ostream&) const {}; 99 98 100 virtual void InitialiseEnergyLossProcess(con 99 virtual void InitialiseEnergyLossProcess(const G4ParticleDefinition*, 101 con 100 const G4ParticleDefinition*) = 0; 102 101 103 public: << 102 //------------------------------------------------------------------------ >> 103 // Methods with standard implementation; may be overwritten if needed >> 104 //------------------------------------------------------------------------ 104 105 105 // used as low energy limit LambdaTable << 106 virtual G4double MinPrimaryEnergy(const G4Pa 106 virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*, 107 const G4Ma 107 const G4Material*, G4double cut); 108 108 >> 109 //------------------------------------------------------------------------ >> 110 // Virtual methods implementation common to all EM ContinuousDiscrete >> 111 // processes. Further inheritance is not assumed >> 112 //------------------------------------------------------------------------ >> 113 >> 114 public: >> 115 109 // print documentation in html format 116 // print documentation in html format 110 void ProcessDescription(std::ostream& outFil 117 void ProcessDescription(std::ostream& outFile) const override; 111 118 112 // prepare all tables 119 // prepare all tables 113 void PreparePhysicsTable(const G4ParticleDef 120 void PreparePhysicsTable(const G4ParticleDefinition&) override; 114 121 115 // build all tables 122 // build all tables 116 void BuildPhysicsTable(const G4ParticleDefin 123 void BuildPhysicsTable(const G4ParticleDefinition&) override; 117 124 118 // build a table 125 // build a table 119 G4PhysicsTable* BuildDEDXTable(G4EmTableType 126 G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted); 120 127 121 // build a table 128 // build a table 122 G4PhysicsTable* BuildLambdaTable(G4EmTableTy 129 G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted); 123 130 124 // Called before tracking of each new G4Trac 131 // Called before tracking of each new G4Track 125 void StartTracking(G4Track*) override; 132 void StartTracking(G4Track*) override; 126 133 127 // Step limit from AlongStep 134 // Step limit from AlongStep 128 G4double AlongStepGetPhysicalInteractionLeng 135 G4double AlongStepGetPhysicalInteractionLength( 129 const G4Trac 136 const G4Track&, 130 G4double pr 137 G4double previousStepSize, 131 G4double cu 138 G4double currentMinimumStep, 132 G4double& cu 139 G4double& currentSafety, 133 G4GPILSelect 140 G4GPILSelection* selection) override; 134 141 135 // Step limit from cross section 142 // Step limit from cross section 136 G4double PostStepGetPhysicalInteractionLengt 143 G4double PostStepGetPhysicalInteractionLength( 137 const G4Trac 144 const G4Track& track, 138 G4double pre 145 G4double previousStepSize, 139 G4ForceCondi 146 G4ForceCondition* condition) override; 140 147 141 // AlongStep computations 148 // AlongStep computations 142 G4VParticleChange* AlongStepDoIt(const G4Tra 149 G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&) override; 143 150 144 // PostStep sampling of secondaries 151 // PostStep sampling of secondaries 145 G4VParticleChange* PostStepDoIt(const G4Trac 152 G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override; 146 153 147 // Store all PhysicsTable in files. 154 // Store all PhysicsTable in files. 148 // Return false in case of any fatal failure 155 // Return false in case of any fatal failure at I/O 149 G4bool StorePhysicsTable(const G4ParticleDef 156 G4bool StorePhysicsTable(const G4ParticleDefinition*, 150 const G4String& dir 157 const G4String& directory, 151 G4bool ascii = fals 158 G4bool ascii = false) override; 152 159 153 // Retrieve all Physics from a files. 160 // Retrieve all Physics from a files. 154 // Return true if all the Physics Table are 161 // Return true if all the Physics Table are built. 155 // Return false if any fatal failure. 162 // Return false if any fatal failure. 156 G4bool RetrievePhysicsTable(const G4Particle 163 G4bool RetrievePhysicsTable(const G4ParticleDefinition*, 157 const G4String& 164 const G4String& directory, 158 G4bool ascii) ov 165 G4bool ascii) override; 159 166 160 private: 167 private: 161 168 162 // summary printout after initialisation 169 // summary printout after initialisation 163 void StreamInfo(std::ostream& out, const G4P 170 void StreamInfo(std::ostream& out, const G4ParticleDefinition& part, 164 G4bool rst=false) const; 171 G4bool rst=false) const; 165 172 >> 173 // store a table >> 174 G4bool StoreTable(const G4ParticleDefinition* p, >> 175 G4PhysicsTable*, G4bool ascii, >> 176 const G4String& directory, >> 177 const G4String& tname); >> 178 >> 179 // retrieve a table >> 180 G4bool RetrieveTable(const G4ParticleDefinition* p, >> 181 G4PhysicsTable*, G4bool ascii, >> 182 const G4String& directory, >> 183 const G4String& tname, >> 184 G4bool mandatory); >> 185 166 //------------------------------------------ 186 //------------------------------------------------------------------------ 167 // Public interface to cross section, mfp an 187 // Public interface to cross section, mfp and sampling of fluctuations 168 // These methods are not used in run time 188 // These methods are not used in run time 169 //------------------------------------------ 189 //------------------------------------------------------------------------ 170 190 171 public: 191 public: 172 192 173 // access to dispersion of restricted energy 193 // access to dispersion of restricted energy loss 174 G4double GetDEDXDispersion(const G4MaterialC 194 G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple, 175 const G4DynamicPa 195 const G4DynamicParticle* dp, 176 G4double length); 196 G4double length); 177 197 178 // Access to cross section table 198 // Access to cross section table 179 G4double CrossSectionPerVolume(G4double kine 199 G4double CrossSectionPerVolume(G4double kineticEnergy, 180 const G4Mater 200 const G4MaterialCutsCouple* couple); 181 G4double CrossSectionPerVolume(G4double kine 201 G4double CrossSectionPerVolume(G4double kineticEnergy, 182 const G4Mater 202 const G4MaterialCutsCouple* couple, 183 G4double logK 203 G4double logKineticEnergy); 184 204 185 // access to cross section 205 // access to cross section 186 G4double MeanFreePath(const G4Track& track); 206 G4double MeanFreePath(const G4Track& track); 187 207 188 // access to step limit 208 // access to step limit 189 G4double ContinuousStepLimit(const G4Track& 209 G4double ContinuousStepLimit(const G4Track& track, 190 G4double previo 210 G4double previousStepSize, 191 G4double curren 211 G4double currentMinimumStep, 192 G4double& curre 212 G4double& currentSafety); 193 213 194 protected: 214 protected: 195 215 196 // implementation of the pure virtual method 216 // implementation of the pure virtual method 197 G4double GetMeanFreePath(const G4Track& trac 217 G4double GetMeanFreePath(const G4Track& track, 198 G4double previousSt 218 G4double previousStepSize, 199 G4ForceCondition* c 219 G4ForceCondition* condition) override; 200 220 201 // implementation of the pure virtual method 221 // implementation of the pure virtual method 202 G4double GetContinuousStepLimit(const G4Trac 222 G4double GetContinuousStepLimit(const G4Track& track, 203 G4double pre 223 G4double previousStepSize, 204 G4double cur 224 G4double currentMinimumStep, 205 G4double& cu 225 G4double& currentSafety) override; 206 226 207 // creation of an empty vector for cross sec 227 // creation of an empty vector for cross sections for derived processes 208 G4PhysicsVector* LambdaPhysicsVector(const G 228 G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, 209 G4doubl 229 G4double cut); 210 230 211 inline std::size_t CurrentMaterialCutsCouple << 231 inline size_t CurrentMaterialCutsCoupleIndex() const; 212 232 213 //------------------------------------------ 233 //------------------------------------------------------------------------ 214 // Specific methods to set, access, modify m 234 // Specific methods to set, access, modify models 215 //------------------------------------------ 235 //------------------------------------------------------------------------ 216 236 217 // Select model in run time 237 // Select model in run time 218 inline void SelectModel(G4double kinEnergy); 238 inline void SelectModel(G4double kinEnergy); 219 239 220 public: 240 public: 221 // Select model by energy and couple index 241 // Select model by energy and couple index 222 // Not for run time processing 242 // Not for run time processing 223 inline G4VEmModel* SelectModelForMaterial(G4 243 inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 224 st << 244 size_t& idxCouple) const; 225 245 226 // Add EM model coupled with fluctuation mod 246 // Add EM model coupled with fluctuation model for region, smaller value 227 // of order defines which pair of models wil 247 // of order defines which pair of models will be selected for a given 228 // energy interval 248 // energy interval 229 void AddEmModel(G4int, G4VEmModel*, 249 void AddEmModel(G4int, G4VEmModel*, 230 G4VEmFluctuationModel* fluc 250 G4VEmFluctuationModel* fluc = nullptr, 231 const G4Region* region = nul 251 const G4Region* region = nullptr); 232 252 233 // Assign a model to a process local list, t 253 // Assign a model to a process local list, to enable the list in run time 234 // the derived process should execute AddEmM 254 // the derived process should execute AddEmModel(..) for all such models 235 void SetEmModel(G4VEmModel*, G4int index=0); 255 void SetEmModel(G4VEmModel*, G4int index=0); 236 256 237 // Access to models 257 // Access to models 238 inline std::size_t NumberOfModels() const; << 258 inline size_t NumberOfModels() const; 239 259 240 // Return a model from the local list 260 // Return a model from the local list 241 inline G4VEmModel* EmModel(std::size_t index << 261 inline G4VEmModel* EmModel(size_t index=0) const; 242 262 243 // Access to models from G4EmModelManager li 263 // Access to models from G4EmModelManager list 244 inline G4VEmModel* GetModelByIndex(std::size << 264 inline G4VEmModel* GetModelByIndex(size_t idx = 0, G4bool ver = false) const; 245 265 246 // Assign a fluctuation model to a process 266 // Assign a fluctuation model to a process 247 inline void SetFluctModel(G4VEmFluctuationMo 267 inline void SetFluctModel(G4VEmFluctuationModel*); 248 268 249 // Return the assigned fluctuation model 269 // Return the assigned fluctuation model 250 inline G4VEmFluctuationModel* FluctModel() c 270 inline G4VEmFluctuationModel* FluctModel() const; 251 271 252 //------------------------------------------ 272 //------------------------------------------------------------------------ 253 // Define and access particle type 273 // Define and access particle type 254 //------------------------------------------ 274 //------------------------------------------------------------------------ 255 275 256 protected: 276 protected: 257 inline void SetParticle(const G4ParticleDefi 277 inline void SetParticle(const G4ParticleDefinition* p); 258 inline void SetSecondaryParticle(const G4Par 278 inline void SetSecondaryParticle(const G4ParticleDefinition* p); 259 279 260 public: 280 public: 261 inline void SetBaseParticle(const G4Particle 281 inline void SetBaseParticle(const G4ParticleDefinition* p); 262 inline const G4ParticleDefinition* Particle( 282 inline const G4ParticleDefinition* Particle() const; 263 inline const G4ParticleDefinition* BaseParti 283 inline const G4ParticleDefinition* BaseParticle() const; 264 inline const G4ParticleDefinition* Secondary 284 inline const G4ParticleDefinition* SecondaryParticle() const; 265 285 266 // hide assignment operator 286 // hide assignment operator 267 G4VEnergyLossProcess(G4VEnergyLossProcess &) 287 G4VEnergyLossProcess(G4VEnergyLossProcess &) = delete; 268 G4VEnergyLossProcess & operator=(const G4VEn 288 G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right) = delete; 269 289 270 //------------------------------------------ 290 //------------------------------------------------------------------------ 271 // Get/set parameters to configure the proce 291 // Get/set parameters to configure the process at initialisation time 272 //------------------------------------------ 292 //------------------------------------------------------------------------ 273 293 274 // Add subcut processor for the region 294 // Add subcut processor for the region 275 void ActivateSubCutoff(const G4Region* regio 295 void ActivateSubCutoff(const G4Region* region); 276 296 277 // Activate biasing 297 // Activate biasing 278 void SetCrossSectionBiasingFactor(G4double f 298 void SetCrossSectionBiasingFactor(G4double f, G4bool flag = true); 279 299 280 void ActivateForcedInteraction(G4double leng 300 void ActivateForcedInteraction(G4double length, 281 const G4Strin 301 const G4String& region, 282 G4bool flag = 302 G4bool flag = true); 283 303 284 void ActivateSecondaryBiasing(const G4String 304 void ActivateSecondaryBiasing(const G4String& region, G4double factor, 285 G4double energ 305 G4double energyLimit); 286 306 287 inline void SetLossFluctuations(G4bool val); 307 inline void SetLossFluctuations(G4bool val); 288 308 289 inline void SetSpline(G4bool val); 309 inline void SetSpline(G4bool val); 290 inline void SetCrossSectionType(G4CrossSecti 310 inline void SetCrossSectionType(G4CrossSectionType val); 291 inline G4CrossSectionType CrossSectionType() 311 inline G4CrossSectionType CrossSectionType() const; 292 312 293 // Set/Get flag "isIonisation" 313 // Set/Get flag "isIonisation" 294 void SetIonisation(G4bool val); 314 void SetIonisation(G4bool val); 295 inline G4bool IsIonisationProcess() const; 315 inline G4bool IsIonisationProcess() const; 296 316 297 // Redefine parameteters for stepping contro 317 // Redefine parameteters for stepping control 298 void SetLinearLossLimit(G4double val); 318 void SetLinearLossLimit(G4double val); 299 void SetStepFunction(G4double v1, G4double v 319 void SetStepFunction(G4double v1, G4double v2); 300 void SetLowestEnergyLimit(G4double); 320 void SetLowestEnergyLimit(G4double); 301 321 302 inline G4int NumberOfSubCutoffRegions() cons 322 inline G4int NumberOfSubCutoffRegions() const; 303 323 304 //------------------------------------------ 324 //------------------------------------------------------------------------ 305 // Specific methods to path Physics Tables t 325 // Specific methods to path Physics Tables to the process 306 //------------------------------------------ 326 //------------------------------------------------------------------------ 307 327 308 void SetDEDXTable(G4PhysicsTable* p, G4EmTab 328 void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType); 309 void SetCSDARangeTable(G4PhysicsTable* pRang 329 void SetCSDARangeTable(G4PhysicsTable* pRange); 310 void SetRangeTableForLoss(G4PhysicsTable* p) 330 void SetRangeTableForLoss(G4PhysicsTable* p); >> 331 void SetSecondaryRangeTable(G4PhysicsTable* p); 311 void SetInverseRangeTable(G4PhysicsTable* p) 332 void SetInverseRangeTable(G4PhysicsTable* p); 312 void SetLambdaTable(G4PhysicsTable* p); 333 void SetLambdaTable(G4PhysicsTable* p); 313 << 334 void SetTwoPeaksXS(std::vector<G4TwoPeaksXS*>* p); 314 void SetTwoPeaksXS(std::vector<G4TwoPeaksXS* << 315 void SetEnergyOfCrossSectionMax(std::vector< << 316 335 317 //------------------------------------------ 336 //------------------------------------------------------------------------ 318 // Specific methods to define custom Physics 337 // Specific methods to define custom Physics Tables to the process 319 //------------------------------------------ 338 //------------------------------------------------------------------------ 320 339 321 // Binning for dEdx, range, inverse range an << 340 // Binning for dEdx, range, inverse range and labda tables 322 void SetDEDXBinning(G4int nbins); 341 void SetDEDXBinning(G4int nbins); 323 342 324 // Min kinetic energy for tables 343 // Min kinetic energy for tables 325 void SetMinKinEnergy(G4double e); 344 void SetMinKinEnergy(G4double e); 326 inline G4double MinKinEnergy() const; 345 inline G4double MinKinEnergy() const; 327 346 328 // Max kinetic energy for tables 347 // Max kinetic energy for tables 329 void SetMaxKinEnergy(G4double e); 348 void SetMaxKinEnergy(G4double e); 330 inline G4double MaxKinEnergy() const; 349 inline G4double MaxKinEnergy() const; 331 350 332 // Biasing parameters 351 // Biasing parameters 333 inline G4double CrossSectionBiasingFactor() 352 inline G4double CrossSectionBiasingFactor() const; 334 353 335 // Return values for given G4MaterialCutsCou 354 // Return values for given G4MaterialCutsCouple 336 inline G4double GetDEDX(G4double kineticEner 355 inline G4double GetDEDX(G4double kineticEnergy, const G4MaterialCutsCouple*); 337 inline G4double GetCSDADEDX(G4double kinetic 356 inline G4double GetCSDADEDX(G4double kineticEnergy, 338 const G4Material 357 const G4MaterialCutsCouple*); 339 inline G4double GetDEDX(G4double kineticEner 358 inline G4double GetDEDX(G4double kineticEnergy, const G4MaterialCutsCouple*, 340 G4double logKineticE 359 G4double logKineticEnergy); 341 inline G4double GetRange(G4double kineticEne 360 inline G4double GetRange(G4double kineticEnergy, const G4MaterialCutsCouple*); 342 inline G4double GetRange(G4double kineticEne 361 inline G4double GetRange(G4double kineticEnergy, const G4MaterialCutsCouple*, 343 G4double logKinetic 362 G4double logKineticEnergy); 344 inline G4double GetCSDARange(G4double kineti 363 inline G4double GetCSDARange(G4double kineticEnergy, 345 const G4Materia 364 const G4MaterialCutsCouple*); 346 inline G4double GetKineticEnergy(G4double ra 365 inline G4double GetKineticEnergy(G4double range, 347 const G4Mat 366 const G4MaterialCutsCouple*); 348 inline G4double GetLambda(G4double kineticEn 367 inline G4double GetLambda(G4double kineticEnergy,const G4MaterialCutsCouple*); 349 inline G4double GetLambda(G4double kineticEn 368 inline G4double GetLambda(G4double kineticEnergy,const G4MaterialCutsCouple*, 350 G4double logKineti 369 G4double logKineticEnergy); 351 370 352 inline G4bool TablesAreBuilt() const; 371 inline G4bool TablesAreBuilt() const; 353 372 354 // Access to specific tables 373 // Access to specific tables 355 inline G4PhysicsTable* DEDXTable() const; 374 inline G4PhysicsTable* DEDXTable() const; 356 inline G4PhysicsTable* DEDXunRestrictedTable 375 inline G4PhysicsTable* DEDXunRestrictedTable() const; 357 inline G4PhysicsTable* IonisationTable() con 376 inline G4PhysicsTable* IonisationTable() const; 358 inline G4PhysicsTable* CSDARangeTable() cons 377 inline G4PhysicsTable* CSDARangeTable() const; >> 378 inline G4PhysicsTable* SecondaryRangeTable() const; 359 inline G4PhysicsTable* RangeTableForLoss() c 379 inline G4PhysicsTable* RangeTableForLoss() const; 360 inline G4PhysicsTable* InverseRangeTable() c 380 inline G4PhysicsTable* InverseRangeTable() const; 361 inline G4PhysicsTable* LambdaTable() const; 381 inline G4PhysicsTable* LambdaTable() const; 362 inline std::vector<G4TwoPeaksXS*>* TwoPeaksX 382 inline std::vector<G4TwoPeaksXS*>* TwoPeaksXS() const; 363 inline std::vector<G4double>* EnergyOfCrossS << 364 383 365 inline G4bool UseBaseMaterial() const; 384 inline G4bool UseBaseMaterial() const; 366 385 367 //------------------------------------------ 386 //------------------------------------------------------------------------ 368 // Run time method for simulation of ionisat 387 // Run time method for simulation of ionisation 369 //------------------------------------------ 388 //------------------------------------------------------------------------ 370 389 371 // access atom on which interaction happens 390 // access atom on which interaction happens 372 const G4Element* GetCurrentElement() const; 391 const G4Element* GetCurrentElement() const; 373 392 374 // Set scaling parameters for ions is needed 393 // Set scaling parameters for ions is needed to G4EmCalculator 375 void SetDynamicMassCharge(G4double massratio 394 void SetDynamicMassCharge(G4double massratio, G4double charge2ratio); 376 395 377 private: 396 private: 378 397 379 void FillSecondariesAlongStep(G4double weigh 398 void FillSecondariesAlongStep(G4double weight); 380 399 381 void PrintWarning(const G4String&, G4double 400 void PrintWarning(const G4String&, G4double val) const; 382 401 383 // define material and indexes 402 // define material and indexes 384 inline void DefineMaterial(const G4MaterialC 403 inline void DefineMaterial(const G4MaterialCutsCouple* couple); 385 404 386 //------------------------------------------ 405 //------------------------------------------------------------------------ 387 // Compute values using scaling relation, ma 406 // Compute values using scaling relation, mass and charge of based particle 388 //------------------------------------------ 407 //------------------------------------------------------------------------ 389 inline G4double GetDEDXForScaledEnergy(G4dou 408 inline G4double GetDEDXForScaledEnergy(G4double scaledKinE); 390 inline G4double GetDEDXForScaledEnergy(G4dou 409 inline G4double GetDEDXForScaledEnergy(G4double scaledKinE, 391 G4dou 410 G4double logScaledKinE); 392 inline G4double GetIonisationForScaledEnergy 411 inline G4double GetIonisationForScaledEnergy(G4double scaledKinE); 393 inline G4double GetScaledRangeForScaledEnerg 412 inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinE); 394 inline G4double GetScaledRangeForScaledEnerg 413 inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinE, 395 414 G4double logScaledKinE); 396 415 397 inline G4double GetLimitScaledRangeForScaled 416 inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinE); 398 inline G4double GetLimitScaledRangeForScaled 417 inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinE, 399 418 G4double logScaledKinE); 400 419 401 inline G4double ScaledKinEnergyForLoss(G4dou 420 inline G4double ScaledKinEnergyForLoss(G4double range); 402 inline G4double GetLambdaForScaledEnergy(G4d 421 inline G4double GetLambdaForScaledEnergy(G4double scaledKinE); 403 inline G4double GetLambdaForScaledEnergy(G4d 422 inline G4double GetLambdaForScaledEnergy(G4double scaledKinE, 404 G4d 423 G4double logScaledKinE); 405 424 406 inline G4double LogScaledEkin(const G4Track& << 407 << 408 void ComputeLambdaForScaledEnergy(G4double s 425 void ComputeLambdaForScaledEnergy(G4double scaledKinE, 409 const G4Tr << 426 G4double logScaledKinE); 410 427 411 G4bool IsRegionForCubcutProcessor(const G4Tr 428 G4bool IsRegionForCubcutProcessor(const G4Track& aTrack); 412 429 413 protected: 430 protected: 414 431 415 G4ParticleChangeForLoss fParticleChange; 432 G4ParticleChangeForLoss fParticleChange; 416 const G4Material* currentMaterial 433 const G4Material* currentMaterial = nullptr; 417 const G4MaterialCutsCouple* currentCouple = 434 const G4MaterialCutsCouple* currentCouple = nullptr; 418 435 419 private: 436 private: 420 437 421 G4LossTableManager* lManager; 438 G4LossTableManager* lManager; 422 G4EmModelManager* modelManager; 439 G4EmModelManager* modelManager; 423 G4VEmModel* currentModel = n 440 G4VEmModel* currentModel = nullptr; 424 G4EmBiasingManager* biasManager = nu 441 G4EmBiasingManager* biasManager = nullptr; 425 G4SafetyHelper* safetyHelper; 442 G4SafetyHelper* safetyHelper; 426 G4EmParameters* theParameters; 443 G4EmParameters* theParameters; 427 G4VEmFluctuationModel* fluctModel = nul 444 G4VEmFluctuationModel* fluctModel = nullptr; 428 G4VAtomDeexcitation* atomDeexcitation 445 G4VAtomDeexcitation* atomDeexcitation = nullptr; 429 G4VSubCutProducer* subcutProducer = 446 G4VSubCutProducer* subcutProducer = nullptr; 430 447 431 const G4ParticleDefinition* particle = nullp 448 const G4ParticleDefinition* particle = nullptr; 432 const G4ParticleDefinition* baseParticle = n 449 const G4ParticleDefinition* baseParticle = nullptr; 433 const G4ParticleDefinition* secondaryParticl 450 const G4ParticleDefinition* secondaryParticle = nullptr; 434 G4EmDataHandler* theData = nullptr; << 451 const G4ParticleDefinition* theElectron; >> 452 const G4ParticleDefinition* thePositron; >> 453 const G4ParticleDefinition* theGamma; >> 454 const G4ParticleDefinition* theGenericIon = nullptr; 435 455 436 G4PhysicsTable* theDEDXTable = nullptr; 456 G4PhysicsTable* theDEDXTable = nullptr; 437 G4PhysicsTable* theDEDXunRestrictedTable = n 457 G4PhysicsTable* theDEDXunRestrictedTable = nullptr; 438 G4PhysicsTable* theIonisationTable = nullptr 458 G4PhysicsTable* theIonisationTable = nullptr; >> 459 G4PhysicsTable* theIonisationSubTable = nullptr; 439 G4PhysicsTable* theRangeTableForLoss = nullp 460 G4PhysicsTable* theRangeTableForLoss = nullptr; 440 G4PhysicsTable* theCSDARangeTable = nullptr; 461 G4PhysicsTable* theCSDARangeTable = nullptr; >> 462 G4PhysicsTable* theSecondaryRangeTable = nullptr; 441 G4PhysicsTable* theInverseRangeTable = nullp 463 G4PhysicsTable* theInverseRangeTable = nullptr; 442 G4PhysicsTable* theLambdaTable = nullptr; 464 G4PhysicsTable* theLambdaTable = nullptr; 443 465 444 std::vector<const G4Region*>* scoffRegions = 466 std::vector<const G4Region*>* scoffRegions = nullptr; 445 std::vector<G4VEmModel*>* emModels = nul 467 std::vector<G4VEmModel*>* emModels = nullptr; 446 const std::vector<G4int>* theDensityIdx 468 const std::vector<G4int>* theDensityIdx = nullptr; 447 const std::vector<G4double>* theDensityFact 469 const std::vector<G4double>* theDensityFactor = nullptr; 448 const G4DataVector* theCuts = null 470 const G4DataVector* theCuts = nullptr; 449 471 450 std::vector<G4double>* theEnergyOfCrossSecti << 451 std::vector<G4TwoPeaksXS*>* fXSpeaks = nullp 472 std::vector<G4TwoPeaksXS*>* fXSpeaks = nullptr; 452 473 453 G4double lowestKinEnergy; 474 G4double lowestKinEnergy; 454 G4double minKinEnergy; 475 G4double minKinEnergy; 455 G4double maxKinEnergy; 476 G4double maxKinEnergy; 456 G4double maxKinEnergyCSDA; 477 G4double maxKinEnergyCSDA; 457 478 458 G4double linLossLimit = 0.01; 479 G4double linLossLimit = 0.01; 459 G4double dRoverRange = 0.2; 480 G4double dRoverRange = 0.2; 460 G4double finalRange; 481 G4double finalRange; 461 G4double lambdaFactor = 0.8; << 482 G4double lambdaFactor = 1.0; 462 G4double invLambdaFactor; << 483 G4double logLambdafactor = 0.0; 463 G4double biasFactor = 1.0; 484 G4double biasFactor = 1.0; 464 485 465 G4double massRatio = 1.0; 486 G4double massRatio = 1.0; 466 G4double logMassRatio = 0.0; 487 G4double logMassRatio = 0.0; 467 G4double fFactor = 1.0; 488 G4double fFactor = 1.0; 468 G4double reduceFactor = 1.0; 489 G4double reduceFactor = 1.0; 469 G4double chargeSqRatio = 1.0; 490 G4double chargeSqRatio = 1.0; >> 491 G4double fLambda = 0.0; >> 492 G4double fLambdaEnergy = 0.0; 470 G4double fRange = 0.0; 493 G4double fRange = 0.0; 471 G4double fRangeEnergy = 0.0; 494 G4double fRangeEnergy = 0.0; 472 495 473 protected: 496 protected: 474 497 475 G4double preStepLambda = 0.0; 498 G4double preStepLambda = 0.0; 476 G4double preStepKinEnergy = 0.0; 499 G4double preStepKinEnergy = 0.0; >> 500 G4double preStepLogKinEnergy = LOG_EKIN_MIN; 477 G4double preStepScaledEnergy = 0.0; 501 G4double preStepScaledEnergy = 0.0; >> 502 G4double preStepLogScaledEnergy = LOG_EKIN_MIN; 478 G4double mfpKinEnergy = 0.0; 503 G4double mfpKinEnergy = 0.0; 479 504 480 std::size_t currentCoupleIndex = 0; << 505 size_t currentCoupleIndex = 0; 481 506 482 private: 507 private: 483 508 484 G4int nBins; 509 G4int nBins; 485 G4int nBinsCSDA; 510 G4int nBinsCSDA; 486 G4int numberOfModels = 0; 511 G4int numberOfModels = 0; 487 G4int nSCoffRegions = 0; 512 G4int nSCoffRegions = 0; 488 G4int secID = _DeltaElectron; 513 G4int secID = _DeltaElectron; 489 G4int tripletID = _TripletElectron; 514 G4int tripletID = _TripletElectron; 490 G4int biasID = _DeltaEBelowCut; 515 G4int biasID = _DeltaEBelowCut; 491 G4int epixeID = _ePIXE; << 492 G4int gpixeID = _GammaPIXE; << 493 G4int mainSecondaries = 1; 516 G4int mainSecondaries = 1; 494 517 495 std::size_t basedCoupleIndex = 0; << 518 size_t basedCoupleIndex = 0; 496 std::size_t coupleIdxRange = 0; << 519 size_t coupleIdxRange = 0; 497 std::size_t idxDEDX = 0; << 520 size_t coupleIdxLambda = 0; 498 std::size_t idxDEDXunRestricted = 0; << 521 size_t idxDEDX = 0; 499 std::size_t idxIonisation = 0; << 522 size_t idxDEDXunRestricted = 0; 500 std::size_t idxRange = 0; << 523 size_t idxIonisation = 0; 501 std::size_t idxCSDA = 0; << 524 size_t idxRange = 0; 502 std::size_t idxSecRange = 0; << 525 size_t idxCSDA = 0; 503 std::size_t idxInverseRange = 0; << 526 size_t idxSecRange = 0; 504 std::size_t idxLambda = 0; << 527 size_t idxInverseRange = 0; >> 528 size_t idxLambda = 0; 505 529 506 G4GPILSelection aGPILSelection; 530 G4GPILSelection aGPILSelection; 507 G4CrossSectionType fXSType = fEmOnePeak; << 531 G4CrossSectionType fXSType = fEmIncreasing; 508 532 509 G4bool lossFluctuationFlag = true; 533 G4bool lossFluctuationFlag = true; 510 G4bool useCutAsFinalRange = false; << 534 G4bool rndmStepFlag = false; 511 G4bool tablesAreBuilt = false; 535 G4bool tablesAreBuilt = false; 512 G4bool spline = true; 536 G4bool spline = true; 513 G4bool isIon = false; 537 G4bool isIon = false; 514 G4bool isIonisation = false; << 538 G4bool isIonisation = true; 515 G4bool useDeexcitation = false; 539 G4bool useDeexcitation = false; 516 G4bool biasFlag = false; 540 G4bool biasFlag = false; 517 G4bool weightFlag = false; 541 G4bool weightFlag = false; 518 G4bool isMaster = false; << 542 G4bool isMaster = true; 519 G4bool baseMat = false; 543 G4bool baseMat = false; 520 G4bool actLinLossLimit = false; 544 G4bool actLinLossLimit = false; 521 G4bool actLossFluc = false; 545 G4bool actLossFluc = false; 522 G4bool actBinning = false; 546 G4bool actBinning = false; 523 G4bool actMinKinEnergy = false; 547 G4bool actMinKinEnergy = false; 524 G4bool actMaxKinEnergy = false; 548 G4bool actMaxKinEnergy = false; 525 549 526 std::vector<G4DynamicParticle*> secParticles 550 std::vector<G4DynamicParticle*> secParticles; 527 std::vector<G4Track*> scTracks; << 551 std::vector<G4Track*> scTracks; >> 552 528 }; 553 }; 529 554 530 // ======== Run time inline methods ========== 555 // ======== Run time inline methods ================ 531 556 532 inline std::size_t G4VEnergyLossProcess::Curre << 557 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 533 { 558 { 534 return currentCoupleIndex; 559 return currentCoupleIndex; 535 } 560 } 536 561 537 //....oooOO0OOooo........oooOO0OOooo........oo 562 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 538 563 539 inline void G4VEnergyLossProcess::SelectModel( 564 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy) 540 { 565 { 541 currentModel = modelManager->SelectModel(kin 566 currentModel = modelManager->SelectModel(kinEnergy, currentCoupleIndex); 542 currentModel->SetCurrentCouple(currentCouple 567 currentModel->SetCurrentCouple(currentCouple); 543 } 568 } 544 569 545 //....oooOO0OOooo........oooOO0OOooo........oo 570 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 546 571 547 inline G4VEmModel* G4VEnergyLossProcess::Selec 572 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial( 548 G4double kinEnergy, std::si << 573 G4double kinEnergy, size_t& idx) const 549 { 574 { 550 return modelManager->SelectModel(kinEnergy, 575 return modelManager->SelectModel(kinEnergy, idx); 551 } 576 } 552 577 553 //....oooOO0OOooo........oooOO0OOooo........oo 578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 554 579 555 inline void 580 inline void 556 G4VEnergyLossProcess::DefineMaterial(const G4M 581 G4VEnergyLossProcess::DefineMaterial(const G4MaterialCutsCouple* couple) 557 { 582 { 558 if(couple != currentCouple) { 583 if(couple != currentCouple) { 559 currentCouple = couple; << 584 currentCouple = couple; 560 currentMaterial = couple->GetMaterial(); 585 currentMaterial = couple->GetMaterial(); 561 basedCoupleIndex = currentCoupleIndex = co 586 basedCoupleIndex = currentCoupleIndex = couple->GetIndex(); 562 fFactor = chargeSqRatio*biasFactor; 587 fFactor = chargeSqRatio*biasFactor; 563 mfpKinEnergy = DBL_MAX; 588 mfpKinEnergy = DBL_MAX; 564 idxLambda = 0; 589 idxLambda = 0; 565 if(baseMat) { 590 if(baseMat) { 566 basedCoupleIndex = (*theDensityIdx)[curr 591 basedCoupleIndex = (*theDensityIdx)[currentCoupleIndex]; 567 fFactor *= (*theDensityFactor)[currentCo 592 fFactor *= (*theDensityFactor)[currentCoupleIndex]; 568 } 593 } 569 reduceFactor = 1.0/(fFactor*massRatio); 594 reduceFactor = 1.0/(fFactor*massRatio); 570 } 595 } 571 } 596 } 572 597 573 //....oooOO0OOooo........oooOO0OOooo........oo 598 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 574 599 575 inline G4double G4VEnergyLossProcess::GetDEDXF 600 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e) 576 { 601 { 577 /* 602 /* 578 G4cout << "G4VEnergyLossProcess::GetDEDX: Id 603 G4cout << "G4VEnergyLossProcess::GetDEDX: Idx= " 579 << basedCoupleIndex << " E(MeV)= " 604 << basedCoupleIndex << " E(MeV)= " << e 580 << " Emin= " << minKinEnergy << " Fa 605 << " Emin= " << minKinEnergy << " Factor= " << fFactor 581 << " " << theDEDXTable << G4endl; */ 606 << " " << theDEDXTable << G4endl; */ 582 G4double x = fFactor*(*theDEDXTable)[basedCo 607 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->Value(e, idxDEDX); 583 if(e < minKinEnergy) { x *= std::sqrt(e/minK 608 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); } 584 return x; 609 return x; 585 } 610 } 586 611 587 //....oooOO0OOooo........oooOO0OOooo........oo << 588 << 589 inline 612 inline 590 G4double G4VEnergyLossProcess::GetDEDXForScale 613 G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e, G4double loge) 591 { 614 { 592 /* 615 /* 593 G4cout << "G4VEnergyLossProcess::GetDEDX: Id 616 G4cout << "G4VEnergyLossProcess::GetDEDX: Idx= " 594 << basedCoupleIndex << " E(MeV)= " 617 << basedCoupleIndex << " E(MeV)= " << e 595 << " Emin= " << minKinEnergy << " Fa 618 << " Emin= " << minKinEnergy << " Factor= " << fFactor 596 << " " << theDEDXTable << G4endl; */ 619 << " " << theDEDXTable << G4endl; */ 597 G4double x = fFactor*(*theDEDXTable)[basedCo 620 G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->LogVectorValue(e,loge); 598 if(e < minKinEnergy) { x *= std::sqrt(e/minK 621 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); } 599 return x; 622 return x; 600 } 623 } 601 624 602 //....oooOO0OOooo........oooOO0OOooo........oo 625 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 603 626 604 inline G4double G4VEnergyLossProcess::GetIonis 627 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e) 605 { 628 { 606 G4double x = 629 G4double x = 607 fFactor*(*theIonisationTable)[basedCoupleI 630 fFactor*(*theIonisationTable)[basedCoupleIndex]->Value(e, idxIonisation); 608 if(e < minKinEnergy) { x *= std::sqrt(e/minK 631 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); } 609 return x; 632 return x; 610 } 633 } 611 634 612 //....oooOO0OOooo........oooOO0OOooo........oo 635 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 613 636 614 inline G4double G4VEnergyLossProcess::GetScale 637 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e) 615 { 638 { 616 //G4cout << "G4VEnergyLossProcess::GetScaled 639 //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 617 // << basedCoupleIndex << " E(MeV)= 640 // << basedCoupleIndex << " E(MeV)= " << e 618 // << " lastIdx= " << lastIdx << " 641 // << " lastIdx= " << lastIdx << " " << theRangeTableForLoss << G4endl; 619 if(currentCoupleIndex != coupleIdxRange || f 642 if(currentCoupleIndex != coupleIdxRange || fRangeEnergy != e) { 620 coupleIdxRange = currentCoupleIndex; 643 coupleIdxRange = currentCoupleIndex; 621 fRangeEnergy = e; 644 fRangeEnergy = e; 622 fRange = reduceFactor*((*theRangeTableForL 645 fRange = reduceFactor*((*theRangeTableForLoss)[basedCoupleIndex])->Value(e, idxRange); 623 if (fRange < 0.0) { fRange = 0.0; } << 646 if(e < minKinEnergy) { fRange *= std::sqrt(e/minKinEnergy); } 624 else if (e < minKinEnergy) { fRange *= std << 625 } 647 } 626 //G4cout << "G4VEnergyLossProcess::GetScaled 648 //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 627 // << basedCoupleIndex << " E(MeV)= 649 // << basedCoupleIndex << " E(MeV)= " << e 628 // << " R= " << computedRange << " 650 // << " R= " << computedRange << " " << theRangeTableForLoss << G4endl; 629 return fRange; 651 return fRange; 630 } 652 } 631 653 632 inline G4double 654 inline G4double 633 G4VEnergyLossProcess::GetScaledRangeForScaledE 655 G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e, G4double loge) 634 { 656 { 635 //G4cout << "G4VEnergyLossProcess::GetScaled 657 //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 636 // << basedCoupleIndex << " E(MeV)= 658 // << basedCoupleIndex << " E(MeV)= " << e 637 // << " lastIdx= " << lastIdx << " 659 // << " lastIdx= " << lastIdx << " " << theRangeTableForLoss << G4endl; 638 if(currentCoupleIndex != coupleIdxRange || f 660 if(currentCoupleIndex != coupleIdxRange || fRangeEnergy != e) { 639 coupleIdxRange = currentCoupleIndex; 661 coupleIdxRange = currentCoupleIndex; 640 fRangeEnergy = e; 662 fRangeEnergy = e; 641 fRange = reduceFactor*((*theRangeTableForL 663 fRange = reduceFactor*((*theRangeTableForLoss)[basedCoupleIndex])->LogVectorValue(e, loge); 642 if (fRange < 0.0) { fRange = 0.0; } << 664 if(e < minKinEnergy) { fRange *= std::sqrt(e/minKinEnergy); } 643 else if (e < minKinEnergy) { fRange *= std << 644 } 665 } 645 //G4cout << "G4VEnergyLossProcess::GetScaled 666 //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 646 // << basedCoupleIndex << " E(MeV)= 667 // << basedCoupleIndex << " E(MeV)= " << e 647 // << " R= " << fRange << " " << t 668 // << " R= " << fRange << " " << theRangeTableForLoss << G4endl; 648 return fRange; 669 return fRange; 649 } 670 } 650 671 651 //....oooOO0OOooo........oooOO0OOooo........oo 672 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 652 673 653 inline G4double 674 inline G4double 654 G4VEnergyLossProcess::GetLimitScaledRangeForSc 675 G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(G4double e) 655 { 676 { 656 G4double x = ((*theCSDARangeTable)[basedCoup 677 G4double x = ((*theCSDARangeTable)[basedCoupleIndex])->Value(e, idxCSDA); 657 if (x < 0.0) { x = 0.0; } << 678 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); } 658 else if (e < minKinEnergy) { x *= std::sqrt( << 659 return x; 679 return x; 660 } 680 } 661 681 662 //....oooOO0OOooo........oooOO0OOooo........oo 682 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 663 683 664 inline G4double 684 inline G4double 665 G4VEnergyLossProcess::GetLimitScaledRangeForSc 685 G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(G4double e, 666 686 G4double loge) 667 { 687 { 668 G4double x = ((*theCSDARangeTable)[basedCoup 688 G4double x = ((*theCSDARangeTable)[basedCoupleIndex])->LogVectorValue(e, loge); 669 if (x < 0.0) { x = 0.0; } << 689 if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); } 670 else if (e < minKinEnergy) { x *= std::sqrt( << 671 return x; 690 return x; 672 } 691 } 673 692 674 //....oooOO0OOooo........oooOO0OOooo........oo 693 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 675 694 676 inline G4double G4VEnergyLossProcess::ScaledKi 695 inline G4double G4VEnergyLossProcess::ScaledKinEnergyForLoss(G4double r) 677 { 696 { 678 //G4cout << "G4VEnergyLossProcess::GetEnergy 697 //G4cout << "G4VEnergyLossProcess::GetEnergy: Idx= " 679 // << basedCoupleIndex << " R(mm)= " 698 // << basedCoupleIndex << " R(mm)= " << r << " " 680 // << theInverseRangeTable << G4endl 699 // << theInverseRangeTable << G4endl; 681 G4PhysicsVector* v = (*theInverseRangeTable) 700 G4PhysicsVector* v = (*theInverseRangeTable)[basedCoupleIndex]; 682 G4double rmin = v->Energy(0); 701 G4double rmin = v->Energy(0); 683 G4double e = 0.0; 702 G4double e = 0.0; 684 if(r >= rmin) { e = v->Value(r, idxInverseRa 703 if(r >= rmin) { e = v->Value(r, idxInverseRange); } 685 else if(r > 0.0) { 704 else if(r > 0.0) { 686 G4double x = r/rmin; 705 G4double x = r/rmin; 687 e = minKinEnergy*x*x; 706 e = minKinEnergy*x*x; 688 } 707 } 689 return e; 708 return e; 690 } 709 } 691 710 692 //....oooOO0OOooo........oooOO0OOooo........oo 711 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 693 712 694 inline G4double G4VEnergyLossProcess::GetLambd 713 inline G4double G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e) 695 { 714 { 696 return fFactor*((*theLambdaTable)[basedCoupl << 715 if(currentCoupleIndex != coupleIdxLambda || fLambdaEnergy != e) { >> 716 coupleIdxLambda = currentCoupleIndex; >> 717 fLambdaEnergy = e; >> 718 fLambda = fFactor*((*theLambdaTable)[basedCoupleIndex])->Value(e, idxLambda); >> 719 } >> 720 return fLambda; 697 } 721 } 698 722 699 //....oooOO0OOooo........oooOO0OOooo........oo 723 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 700 724 701 inline G4double 725 inline G4double 702 G4VEnergyLossProcess::GetLambdaForScaledEnergy 726 G4VEnergyLossProcess::GetLambdaForScaledEnergy(G4double e, G4double loge) 703 { 727 { 704 return fFactor*((*theLambdaTable)[basedCoupl << 728 if(currentCoupleIndex != coupleIdxLambda || fLambdaEnergy != e) { 705 } << 729 coupleIdxLambda = currentCoupleIndex; 706 << 730 fLambdaEnergy = e; 707 //....oooOO0OOooo........oooOO0OOooo........oo << 731 fLambda = fFactor* 708 << 732 ((*theLambdaTable)[basedCoupleIndex])->LogVectorValue(e, loge); 709 inline G4double G4VEnergyLossProcess::LogScale << 733 } 710 { << 734 return fLambda; 711 return track.GetDynamicParticle()->GetLogKin << 712 } 735 } 713 736 714 //....oooOO0OOooo........oooOO0OOooo........oo 737 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 715 738 716 inline G4double 739 inline G4double 717 G4VEnergyLossProcess::GetDEDX(G4double kinEner 740 G4VEnergyLossProcess::GetDEDX(G4double kinEnergy, 718 const G4Material 741 const G4MaterialCutsCouple* couple) 719 { 742 { 720 DefineMaterial(couple); 743 DefineMaterial(couple); 721 return GetDEDXForScaledEnergy(kinEnergy*mass 744 return GetDEDXForScaledEnergy(kinEnergy*massRatio); 722 } 745 } 723 746 724 //....oooOO0OOooo........oooOO0OOooo........oo 747 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 725 748 726 inline G4double 749 inline G4double 727 G4VEnergyLossProcess::GetDEDX(G4double kinEner 750 G4VEnergyLossProcess::GetDEDX(G4double kinEnergy, 728 const G4Material 751 const G4MaterialCutsCouple* couple, 729 G4double logKinE 752 G4double logKinEnergy) 730 { 753 { 731 DefineMaterial(couple); 754 DefineMaterial(couple); 732 return GetDEDXForScaledEnergy(kinEnergy*mass 755 return GetDEDXForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio); 733 } 756 } 734 757 735 //....oooOO0OOooo........oooOO0OOooo........oo 758 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 736 759 737 inline G4double 760 inline G4double 738 G4VEnergyLossProcess::GetRange(G4double kinEne 761 G4VEnergyLossProcess::GetRange(G4double kinEnergy, 739 const G4Materia 762 const G4MaterialCutsCouple* couple) 740 { 763 { 741 DefineMaterial(couple); 764 DefineMaterial(couple); 742 return GetScaledRangeForScaledEnergy(kinEner 765 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio); 743 } 766 } 744 767 745 //....oooOO0OOooo........oooOO0OOooo........oo 768 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 746 769 747 inline G4double 770 inline G4double 748 G4VEnergyLossProcess::GetRange(G4double kinEne 771 G4VEnergyLossProcess::GetRange(G4double kinEnergy, 749 const G4Materia 772 const G4MaterialCutsCouple* couple, 750 G4double logKin 773 G4double logKinEnergy) 751 { 774 { 752 DefineMaterial(couple); 775 DefineMaterial(couple); 753 return GetScaledRangeForScaledEnergy(kinEner 776 return GetScaledRangeForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio); 754 } 777 } 755 778 756 //....oooOO0OOooo........oooOO0OOooo........oo 779 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 757 780 758 inline G4double 781 inline G4double 759 G4VEnergyLossProcess::GetCSDARange(G4double ki 782 G4VEnergyLossProcess::GetCSDARange(G4double kineticEnergy, 760 const G4Mat 783 const G4MaterialCutsCouple* couple) 761 { 784 { 762 DefineMaterial(couple); 785 DefineMaterial(couple); 763 return (nullptr == theCSDARangeTable) ? DBL_ 786 return (nullptr == theCSDARangeTable) ? DBL_MAX : 764 GetLimitScaledRangeForScaledEnergy(kinetic 787 GetLimitScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor; 765 } 788 } 766 789 767 //....oooOO0OOooo........oooOO0OOooo........oo 790 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 768 791 769 inline G4double 792 inline G4double 770 G4VEnergyLossProcess::GetKineticEnergy(G4doubl 793 G4VEnergyLossProcess::GetKineticEnergy(G4double range, 771 const G 794 const G4MaterialCutsCouple* couple) 772 { 795 { 773 DefineMaterial(couple); 796 DefineMaterial(couple); 774 return ScaledKinEnergyForLoss(range/reduceFa 797 return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio; 775 } 798 } 776 799 777 //....oooOO0OOooo........oooOO0OOooo........oo 800 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 778 801 779 inline G4double 802 inline G4double 780 G4VEnergyLossProcess::GetLambda(G4double kinEn 803 G4VEnergyLossProcess::GetLambda(G4double kinEnergy, 781 const G4Materi 804 const G4MaterialCutsCouple* couple) 782 { 805 { 783 DefineMaterial(couple); 806 DefineMaterial(couple); 784 return (nullptr != theLambdaTable) ? 807 return (nullptr != theLambdaTable) ? 785 GetLambdaForScaledEnergy(kinEnergy*massRat 808 GetLambdaForScaledEnergy(kinEnergy*massRatio) : 0.0; 786 } 809 } 787 810 788 //....oooOO0OOooo........oooOO0OOooo........oo 811 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 789 812 790 inline G4double 813 inline G4double 791 G4VEnergyLossProcess::GetLambda(G4double kinEn 814 G4VEnergyLossProcess::GetLambda(G4double kinEnergy, 792 const G4Materi 815 const G4MaterialCutsCouple* couple, 793 G4double logKi 816 G4double logKinEnergy) 794 { 817 { 795 DefineMaterial(couple); 818 DefineMaterial(couple); 796 return (nullptr != theLambdaTable) ? 819 return (nullptr != theLambdaTable) ? 797 GetLambdaForScaledEnergy(kinEnergy*massRat 820 GetLambdaForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio) 798 : 0.0; 821 : 0.0; 799 } 822 } 800 823 801 // ======== Get/Set inline methods used at ini 824 // ======== Get/Set inline methods used at initialisation ================ 802 825 803 inline void G4VEnergyLossProcess::SetFluctMode 826 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p) 804 { 827 { 805 fluctModel = p; 828 fluctModel = p; 806 } 829 } 807 830 808 //....oooOO0OOooo........oooOO0OOooo........oo 831 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 809 832 810 inline G4VEmFluctuationModel* G4VEnergyLossPro 833 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel() const 811 { 834 { 812 return fluctModel; 835 return fluctModel; 813 } 836 } 814 837 815 //....oooOO0OOooo........oooOO0OOooo........oo 838 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 816 839 817 inline void G4VEnergyLossProcess::SetParticle( 840 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p) 818 { 841 { 819 particle = p; 842 particle = p; 820 } 843 } 821 844 822 //....oooOO0OOooo........oooOO0OOooo........oo 845 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 823 846 824 inline void 847 inline void 825 G4VEnergyLossProcess::SetSecondaryParticle(con 848 G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p) 826 { 849 { 827 secondaryParticle = p; 850 secondaryParticle = p; 828 } 851 } 829 852 830 //....oooOO0OOooo........oooOO0OOooo........oo 853 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 831 854 832 inline void 855 inline void 833 G4VEnergyLossProcess::SetBaseParticle(const G4 856 G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p) 834 { 857 { 835 baseParticle = p; 858 baseParticle = p; 836 } 859 } 837 860 838 //....oooOO0OOooo........oooOO0OOooo........oo 861 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 839 862 840 inline const G4ParticleDefinition* G4VEnergyLo 863 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const 841 { 864 { 842 return particle; 865 return particle; 843 } 866 } 844 867 845 //....oooOO0OOooo........oooOO0OOooo........oo 868 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 846 869 847 inline const G4ParticleDefinition* G4VEnergyLo 870 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const 848 { 871 { 849 return baseParticle; 872 return baseParticle; 850 } 873 } 851 874 852 //....oooOO0OOooo........oooOO0OOooo........oo 875 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 853 876 854 inline const G4ParticleDefinition* 877 inline const G4ParticleDefinition* 855 G4VEnergyLossProcess::SecondaryParticle() cons 878 G4VEnergyLossProcess::SecondaryParticle() const 856 { 879 { 857 return secondaryParticle; 880 return secondaryParticle; 858 } 881 } 859 882 860 //....oooOO0OOooo........oooOO0OOooo........oo 883 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 861 884 862 inline void G4VEnergyLossProcess::SetLossFluct 885 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val) 863 { 886 { 864 lossFluctuationFlag = val; 887 lossFluctuationFlag = val; 865 actLossFluc = true; 888 actLossFluc = true; 866 } 889 } 867 890 868 //....oooOO0OOooo........oooOO0OOooo........oo 891 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 869 892 870 inline void G4VEnergyLossProcess::SetSpline(G4 893 inline void G4VEnergyLossProcess::SetSpline(G4bool val) 871 { 894 { 872 spline = val; 895 spline = val; 873 } 896 } 874 897 875 //....oooOO0OOooo........oooOO0OOooo........oo 898 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 876 899 877 inline void G4VEnergyLossProcess::SetCrossSect 900 inline void G4VEnergyLossProcess::SetCrossSectionType(G4CrossSectionType val) 878 { 901 { 879 fXSType = val; 902 fXSType = val; 880 } 903 } 881 904 882 //....oooOO0OOooo........oooOO0OOooo........oo 905 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 883 906 884 inline G4CrossSectionType G4VEnergyLossProcess 907 inline G4CrossSectionType G4VEnergyLossProcess::CrossSectionType() const 885 { 908 { 886 return fXSType; 909 return fXSType; 887 } 910 } 888 911 889 //....oooOO0OOooo........oooOO0OOooo........oo 912 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 890 913 891 inline G4bool G4VEnergyLossProcess::IsIonisati 914 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const 892 { 915 { 893 return isIonisation; 916 return isIonisation; 894 } 917 } 895 918 896 //....oooOO0OOooo........oooOO0OOooo........oo 919 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 897 920 898 inline G4int G4VEnergyLossProcess::NumberOfSub 921 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const 899 { 922 { 900 return nSCoffRegions; 923 return nSCoffRegions; 901 } 924 } 902 925 903 //....oooOO0OOooo........oooOO0OOooo........oo 926 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 904 927 905 inline G4double G4VEnergyLossProcess::MinKinEn 928 inline G4double G4VEnergyLossProcess::MinKinEnergy() const 906 { 929 { 907 return minKinEnergy; 930 return minKinEnergy; 908 } 931 } 909 932 910 //....oooOO0OOooo........oooOO0OOooo........oo 933 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 911 934 912 inline G4double G4VEnergyLossProcess::MaxKinEn 935 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const 913 { 936 { 914 return maxKinEnergy; 937 return maxKinEnergy; 915 } 938 } 916 939 917 //....oooOO0OOooo........oooOO0OOooo........oo 940 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 918 941 919 inline G4double G4VEnergyLossProcess::CrossSec 942 inline G4double G4VEnergyLossProcess::CrossSectionBiasingFactor() const 920 { 943 { 921 return biasFactor; 944 return biasFactor; 922 } 945 } 923 946 924 //....oooOO0OOooo........oooOO0OOooo........oo 947 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 925 948 926 inline G4bool G4VEnergyLossProcess::TablesAreB 949 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const 927 { 950 { 928 return tablesAreBuilt; 951 return tablesAreBuilt; 929 } 952 } 930 953 931 //....oooOO0OOooo........oooOO0OOooo........oo 954 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 932 955 933 inline G4PhysicsTable* G4VEnergyLossProcess::D 956 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const 934 { 957 { 935 return theDEDXTable; 958 return theDEDXTable; 936 } 959 } 937 960 938 //....oooOO0OOooo........oooOO0OOooo........oo 961 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 939 962 940 inline G4PhysicsTable* G4VEnergyLossProcess::D 963 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const 941 { 964 { 942 return theDEDXunRestrictedTable; 965 return theDEDXunRestrictedTable; 943 } 966 } 944 967 945 //....oooOO0OOooo........oooOO0OOooo........oo 968 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 946 969 947 inline G4PhysicsTable* G4VEnergyLossProcess::I 970 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const 948 { 971 { 949 return theIonisationTable; 972 return theIonisationTable; 950 } 973 } 951 974 952 //....oooOO0OOooo........oooOO0OOooo........oo 975 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 953 976 954 inline G4PhysicsTable* G4VEnergyLossProcess::C 977 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const 955 { 978 { 956 return theCSDARangeTable; 979 return theCSDARangeTable; 957 } 980 } 958 981 959 //....oooOO0OOooo........oooOO0OOooo........oo 982 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 960 983 >> 984 inline G4PhysicsTable* G4VEnergyLossProcess::SecondaryRangeTable() const >> 985 { >> 986 return theSecondaryRangeTable; >> 987 } >> 988 >> 989 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... >> 990 961 inline G4PhysicsTable* G4VEnergyLossProcess::R 991 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const 962 { 992 { 963 return theRangeTableForLoss; 993 return theRangeTableForLoss; 964 } 994 } 965 995 966 //....oooOO0OOooo........oooOO0OOooo........oo 996 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 967 997 968 inline G4PhysicsTable* G4VEnergyLossProcess::I 998 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const 969 { 999 { 970 return theInverseRangeTable; 1000 return theInverseRangeTable; 971 } 1001 } 972 1002 973 //....oooOO0OOooo........oooOO0OOooo........oo 1003 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 974 1004 975 inline G4PhysicsTable* G4VEnergyLossProcess::L 1005 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable() const 976 { 1006 { 977 return theLambdaTable; 1007 return theLambdaTable; 978 } 1008 } 979 1009 980 //....oooOO0OOooo........oooOO0OOooo........oo 1010 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 981 1011 982 inline G4bool G4VEnergyLossProcess::UseBaseMat 1012 inline G4bool G4VEnergyLossProcess::UseBaseMaterial() const 983 { 1013 { 984 return baseMat; 1014 return baseMat; 985 } 1015 } 986 1016 987 //....oooOO0OOooo........oooOO0OOooo........oo 1017 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 988 1018 989 inline std::vector<G4double>* << 990 G4VEnergyLossProcess::EnergyOfCrossSectionMax( << 991 { << 992 return theEnergyOfCrossSectionMax; << 993 } << 994 << 995 //....oooOO0OOooo........oooOO0OOooo........oo << 996 << 997 inline std::vector<G4TwoPeaksXS*>* G4VEnergyLo 1019 inline std::vector<G4TwoPeaksXS*>* G4VEnergyLossProcess::TwoPeaksXS() const 998 { 1020 { 999 return fXSpeaks; 1021 return fXSpeaks; 1000 } 1022 } 1001 1023 1002 //....oooOO0OOooo........oooOO0OOooo........o 1024 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1003 1025 1004 inline std::size_t G4VEnergyLossProcess::Numb << 1026 inline size_t G4VEnergyLossProcess::NumberOfModels() const 1005 { 1027 { 1006 return numberOfModels; 1028 return numberOfModels; 1007 } 1029 } 1008 1030 1009 //....oooOO0OOooo........oooOO0OOooo........o 1031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1010 1032 1011 inline G4VEmModel* G4VEnergyLossProcess::EmMo << 1033 inline G4VEmModel* G4VEnergyLossProcess::EmModel(size_t index) const 1012 { 1034 { 1013 return (index < emModels->size()) ? (*emMod << 1035 return (nullptr != emModels && index < emModels->size()) >> 1036 ? (*emModels)[index] : nullptr; 1014 } 1037 } 1015 1038 1016 //....oooOO0OOooo........oooOO0OOooo........o 1039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1017 1040 1018 inline G4VEmModel* 1041 inline G4VEmModel* 1019 G4VEnergyLossProcess::GetModelByIndex(std::si << 1042 G4VEnergyLossProcess::GetModelByIndex(size_t idx, G4bool ver) const 1020 { 1043 { 1021 return modelManager->GetModel((G4int)idx, v << 1044 return modelManager->GetModel(idx, ver); 1022 } 1045 } 1023 1046 1024 //....oooOO0OOooo........oooOO0OOooo........o 1047 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 1025 1048 1026 #endif 1049 #endif 1027 1050