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