Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh (Version 11.3.0) and /processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh (Version 4.0.p1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 // -------------------------------------------    
 28 //                                                
 29 // GEANT4 Class header file                       
 30 //                                                
 31 //                                                
 32 // File name:     G4VEnergyLossProcess            
 33 //                                                
 34 // Author:        Vladimir Ivanchenko on base     
 35 //                                                
 36 // Creation date: 03.01.2002                      
 37 //                                                
 38 // Modifications: Vladimir Ivanchenko             
 39 //                                                
 40 // Class Description:                             
 41 //                                                
 42 // It is the unified energy loss process it ca    
 43 // energy loss for charged particles using a s    
 44 // models valid for different energy regions.     
 45 // to create and access to dE/dx and range tab    
 46 // that information on fly.                       
 47                                                   
 48 // -------------------------------------------    
 49 //                                                
 50                                                   
 51 #ifndef G4VEnergyLossProcess_h                    
 52 #define G4VEnergyLossProcess_h 1                  
 53                                                   
 54 #include "G4VContinuousDiscreteProcess.hh"        
 55 #include "globals.hh"                             
 56 #include "G4Material.hh"                          
 57 #include "G4MaterialCutsCouple.hh"                
 58 #include "G4Track.hh"                             
 59 #include "G4EmModelManager.hh"                    
 60 #include "G4ParticleChangeForLoss.hh"             
 61 #include "G4EmTableType.hh"                       
 62 #include "G4EmSecondaryParticleType.hh"           
 63 #include "G4PhysicsTable.hh"                      
 64 #include "G4PhysicsVector.hh"                     
 65                                                   
 66 class G4Step;                                     
 67 class G4ParticleDefinition;                       
 68 class G4EmParameters;                             
 69 class G4VEmModel;                                 
 70 class G4VEmFluctuationModel;                      
 71 class G4DataVector;                               
 72 class G4Region;                                   
 73 class G4SafetyHelper;                             
 74 class G4VAtomDeexcitation;                        
 75 class G4VSubCutProducer;                          
 76 class G4EmBiasingManager;                         
 77 class G4LossTableManager;                         
 78 class G4EmDataHandler;                            
 79                                                   
 80 //....oooOO0OOooo........oooOO0OOooo........oo    
 81                                                   
 82 class G4VEnergyLossProcess : public G4VContinu    
 83 {                                                 
 84 public:                                           
 85                                                   
 86   G4VEnergyLossProcess(const G4String& name =     
 87                        G4ProcessType type = fE    
 88                                                   
 89   ~G4VEnergyLossProcess() override;               
 90                                                   
 91   //------------------------------------------    
 92   // Virtual methods to be implemented in conc    
 93   //------------------------------------------    
 94                                                   
 95 protected:                                        
 96                                                   
 97   // description of specific process parameter    
 98   virtual void StreamProcessInfo(std::ostream&    
 99                                                   
100   virtual void InitialiseEnergyLossProcess(con    
101                                            con    
102                                                   
103 public:                                           
104                                                   
105   // used as low energy limit LambdaTable         
106   virtual G4double MinPrimaryEnergy(const G4Pa    
107                                     const G4Ma    
108                                                   
109   // print documentation in html format           
110   void ProcessDescription(std::ostream& outFil    
111                                                   
112   // prepare all tables                           
113   void PreparePhysicsTable(const G4ParticleDef    
114                                                   
115   // build all tables                             
116   void BuildPhysicsTable(const G4ParticleDefin    
117                                                   
118   // build a table                                
119   G4PhysicsTable* BuildDEDXTable(G4EmTableType    
120                                                   
121   // build a table                                
122   G4PhysicsTable* BuildLambdaTable(G4EmTableTy    
123                                                   
124   // Called before tracking of each new G4Trac    
125   void StartTracking(G4Track*) override;          
126                                                   
127   // Step limit from AlongStep                    
128   G4double AlongStepGetPhysicalInteractionLeng    
129                                   const G4Trac    
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                                                   
141   // AlongStep computations                       
142   G4VParticleChange* AlongStepDoIt(const G4Tra    
143                                                   
144   // PostStep sampling of secondaries             
145   G4VParticleChange* PostStepDoIt(const G4Trac    
146                                                   
147   // Store all PhysicsTable in files.             
148   // Return false in case of any fatal failure    
149   G4bool StorePhysicsTable(const G4ParticleDef    
150                            const G4String& dir    
151                            G4bool ascii = fals    
152                                                   
153   // Retrieve all Physics from a files.           
154   // Return true if all the Physics Table are     
155   // Return false if any fatal failure.           
156   G4bool RetrievePhysicsTable(const G4Particle    
157                               const G4String&     
158                               G4bool ascii) ov    
159                                                   
160 private:                                          
161                                                   
162   // summary printout after initialisation        
163   void StreamInfo(std::ostream& out, const G4P    
164                   G4bool rst=false) const;        
165                                                   
166   //------------------------------------------    
167   // Public interface to cross section, mfp an    
168   // These methods are not used in run time       
169   //------------------------------------------    
170                                                   
171 public:                                           
172                                                   
173   // access to dispersion of restricted energy    
174   G4double GetDEDXDispersion(const G4MaterialC    
175                              const G4DynamicPa    
176                              G4double length);    
177                                                   
178   // Access to cross section table                
179   G4double CrossSectionPerVolume(G4double kine    
180                                  const G4Mater    
181   G4double CrossSectionPerVolume(G4double kine    
182                                  const G4Mater    
183                                  G4double logK    
184                                                   
185   // access to cross section                      
186   G4double MeanFreePath(const G4Track& track);    
187                                                   
188   // access to step limit                         
189   G4double ContinuousStepLimit(const G4Track&     
190                                G4double previo    
191                                G4double curren    
192                                G4double& curre    
193                                                   
194 protected:                                        
195                                                   
196   // implementation of the pure virtual method    
197   G4double GetMeanFreePath(const G4Track& trac    
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                                                   
207   // creation of an empty vector for cross sec    
208   G4PhysicsVector* LambdaPhysicsVector(const G    
209                                        G4doubl    
210                                                   
211   inline std::size_t CurrentMaterialCutsCouple    
212                                                   
213   //------------------------------------------    
214   // Specific methods to set, access, modify m    
215   //------------------------------------------    
216                                                   
217   // Select model in run time                     
218   inline void SelectModel(G4double kinEnergy);    
219                                                   
220 public:                                           
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                                                   
237   // Access to models                             
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                                                   
246   // Assign a fluctuation model to a process      
247   inline void SetFluctModel(G4VEmFluctuationMo    
248                                                   
249   // Return the assigned fluctuation model        
250   inline G4VEmFluctuationModel* FluctModel() c    
251                                                   
252   //------------------------------------------    
253   // Define and access particle type              
254   //------------------------------------------    
255                                                   
256 protected:                                        
257   inline void SetParticle(const G4ParticleDefi    
258   inline void SetSecondaryParticle(const G4Par    
259                                                   
260 public:                                           
261   inline void SetBaseParticle(const G4Particle    
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                                                   
274   // Add subcut processor for the region          
275   void ActivateSubCutoff(const G4Region* regio    
276                                                   
277   // Activate biasing                             
278   void SetCrossSectionBiasingFactor(G4double f    
279                                                   
280   void ActivateForcedInteraction(G4double leng    
281                                  const G4Strin    
282                                  G4bool flag =    
283                                                   
284   void ActivateSecondaryBiasing(const G4String    
285                                 G4double energ    
286                                                   
287   inline void SetLossFluctuations(G4bool val);    
288                                                   
289   inline void SetSpline(G4bool val);              
290   inline void SetCrossSectionType(G4CrossSecti    
291   inline G4CrossSectionType CrossSectionType()    
292                                                   
293   // Set/Get flag "isIonisation"                  
294   void SetIonisation(G4bool val);                 
295   inline G4bool IsIonisationProcess() const;      
296                                                   
297   // Redefine parameteters for stepping contro    
298   void SetLinearLossLimit(G4double val);          
299   void SetStepFunction(G4double v1, G4double v    
300   void SetLowestEnergyLimit(G4double);            
301                                                   
302   inline G4int NumberOfSubCutoffRegions() cons    
303                                                   
304   //------------------------------------------    
305   // Specific methods to path Physics Tables t    
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                                                   
317   //------------------------------------------    
318   // Specific methods to define custom Physics    
319   //------------------------------------------    
320                                                   
321   // Binning for dEdx, range, inverse range an    
322   void SetDEDXBinning(G4int nbins);               
323                                                   
324   // Min kinetic energy for tables                
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                                                   
332   // Biasing parameters                           
333   inline G4double CrossSectionBiasingFactor()     
334                                                   
335   // Return values for given G4MaterialCutsCou    
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                                                   
365   inline G4bool UseBaseMaterial() const;          
366                                                   
367   //------------------------------------------    
368   // Run time method for simulation of ionisat    
369   //------------------------------------------    
370                                                   
371   // access atom on which interaction happens     
372   const G4Element* GetCurrentElement() const;     
373                                                   
374   // Set scaling parameters for ions is needed    
375   void SetDynamicMassCharge(G4double massratio    
376                                                   
377 private:                                          
378                                                   
379   void FillSecondariesAlongStep(G4double weigh    
380                                                   
381   void PrintWarning(const G4String&, G4double     
382                                                   
383   // define material and indexes                  
384   inline void DefineMaterial(const G4MaterialC    
385                                                   
386   //------------------------------------------    
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                                                   
406   inline G4double LogScaledEkin(const G4Track&    
407                                                   
408   void ComputeLambdaForScaledEnergy(G4double s    
409                                     const G4Tr    
410                                                   
411   G4bool IsRegionForCubcutProcessor(const G4Tr    
412                                                   
413 protected:                                        
414                                                   
415   G4ParticleChangeForLoss     fParticleChange;    
416   const G4Material*           currentMaterial     
417   const G4MaterialCutsCouple* currentCouple =     
418                                                   
419 private:                                          
420                                                   
421   G4LossTableManager*         lManager;           
422   G4EmModelManager*           modelManager;       
423   G4VEmModel*                 currentModel = n    
424   G4EmBiasingManager*         biasManager = nu    
425   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                                                   
450   std::vector<G4double>* theEnergyOfCrossSecti    
451   std::vector<G4TwoPeaksXS*>* fXSpeaks = nullp    
452                                                   
453   G4double lowestKinEnergy;                       
454   G4double minKinEnergy;                          
455   G4double maxKinEnergy;                          
456   G4double maxKinEnergyCSDA;                      
457                                                   
458   G4double linLossLimit = 0.01;                   
459   G4double dRoverRange = 0.2;                     
460   G4double finalRange;                            
461   G4double lambdaFactor = 0.8;                    
462   G4double invLambdaFactor;                       
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                                                   
526   std::vector<G4DynamicParticle*> secParticles    
527   std::vector<G4Track*> scTracks;                 
528 };                                                
529                                                   
530 // ======== Run time inline methods ==========    
531                                                   
532 inline std::size_t G4VEnergyLossProcess::Curre    
533 {                                                 
534   return currentCoupleIndex;                      
535 }                                                 
536                                                   
537 //....oooOO0OOooo........oooOO0OOooo........oo    
538                                                   
539 inline void G4VEnergyLossProcess::SelectModel(    
540 {                                                 
541   currentModel = modelManager->SelectModel(kin    
542   currentModel->SetCurrentCouple(currentCouple    
543 }                                                 
544                                                   
545 //....oooOO0OOooo........oooOO0OOooo........oo    
546                                                   
547 inline G4VEmModel* G4VEnergyLossProcess::Selec    
548                    G4double kinEnergy, std::si    
549 {                                                 
550   return modelManager->SelectModel(kinEnergy,     
551 }                                                 
552                                                   
553 //....oooOO0OOooo........oooOO0OOooo........oo    
554                                                   
555 inline void                                       
556 G4VEnergyLossProcess::DefineMaterial(const G4M    
557 {                                                 
558   if(couple != currentCouple) {                   
559     currentCouple = couple;                       
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 }                                                 
572                                                   
573 //....oooOO0OOooo........oooOO0OOooo........oo    
574                                                   
575 inline G4double G4VEnergyLossProcess::GetDEDXF    
576 {                                                 
577   /*                                              
578   G4cout << "G4VEnergyLossProcess::GetDEDX: Id    
579            << basedCoupleIndex << " E(MeV)= "     
580          << " Emin= " << minKinEnergy << "  Fa    
581          << "  " << theDEDXTable << G4endl; */    
582   G4double x = fFactor*(*theDEDXTable)[basedCo    
583   if(e < minKinEnergy) { x *= std::sqrt(e/minK    
584   return x;                                       
585 }                                                 
586                                                   
587 //....oooOO0OOooo........oooOO0OOooo........oo    
588                                                   
589 inline                                            
590 G4double G4VEnergyLossProcess::GetDEDXForScale    
591 {                                                 
592   /*                                              
593   G4cout << "G4VEnergyLossProcess::GetDEDX: Id    
594            << basedCoupleIndex << " E(MeV)= "     
595          << " Emin= " << minKinEnergy << "  Fa    
596          << "  " << theDEDXTable << G4endl; */    
597   G4double x = fFactor*(*theDEDXTable)[basedCo    
598   if(e < minKinEnergy) { x *= std::sqrt(e/minK    
599   return x;                                       
600 }                                                 
601                                                   
602 //....oooOO0OOooo........oooOO0OOooo........oo    
603                                                   
604 inline G4double G4VEnergyLossProcess::GetIonis    
605 {                                                 
606   G4double x =                                    
607     fFactor*(*theIonisationTable)[basedCoupleI    
608   if(e < minKinEnergy) { x *= std::sqrt(e/minK    
609   return x;                                       
610 }                                                 
611                                                   
612 //....oooOO0OOooo........oooOO0OOooo........oo    
613                                                   
614 inline G4double G4VEnergyLossProcess::GetScale    
615 {                                                 
616   //G4cout << "G4VEnergyLossProcess::GetScaled    
617   //         << basedCoupleIndex << " E(MeV)=     
618   //         << " lastIdx= " << lastIdx << "      
619   if(currentCoupleIndex != coupleIdxRange || f    
620     coupleIdxRange = currentCoupleIndex;          
621     fRangeEnergy = e;                             
622     fRange = reduceFactor*((*theRangeTableForL    
623     if (fRange < 0.0) { fRange = 0.0; }           
624     else if (e < minKinEnergy) { fRange *= std    
625   }                                               
626   //G4cout << "G4VEnergyLossProcess::GetScaled    
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 }                                                 
650                                                   
651 //....oooOO0OOooo........oooOO0OOooo........oo    
652                                                   
653 inline G4double                                   
654 G4VEnergyLossProcess::GetLimitScaledRangeForSc    
655 {                                                 
656   G4double x = ((*theCSDARangeTable)[basedCoup    
657   if (x < 0.0) { x = 0.0; }                       
658   else if (e < minKinEnergy) { x *= std::sqrt(    
659   return x;                                       
660 }                                                 
661                                                   
662 //....oooOO0OOooo........oooOO0OOooo........oo    
663                                                   
664 inline G4double                                   
665 G4VEnergyLossProcess::GetLimitScaledRangeForSc    
666                                                   
667 {                                                 
668   G4double x = ((*theCSDARangeTable)[basedCoup    
669   if (x < 0.0) { x = 0.0; }                       
670   else if (e < minKinEnergy) { x *= std::sqrt(    
671   return x;                                       
672 }                                                 
673                                                   
674 //....oooOO0OOooo........oooOO0OOooo........oo    
675                                                   
676 inline G4double G4VEnergyLossProcess::ScaledKi    
677 {                                                 
678   //G4cout << "G4VEnergyLossProcess::GetEnergy    
679   //         << basedCoupleIndex << " R(mm)= "    
680   //         << theInverseRangeTable << G4endl    
681   G4PhysicsVector* v = (*theInverseRangeTable)    
682   G4double rmin = v->Energy(0);                   
683   G4double e = 0.0;                               
684   if(r >= rmin) { e = v->Value(r, idxInverseRa    
685   else if(r > 0.0) {                              
686     G4double x = r/rmin;                          
687     e = minKinEnergy*x*x;                         
688   }                                               
689   return e;                                       
690 }                                                 
691                                                   
692 //....oooOO0OOooo........oooOO0OOooo........oo    
693                                                   
694 inline G4double G4VEnergyLossProcess::GetLambd    
695 {                                                 
696   return fFactor*((*theLambdaTable)[basedCoupl    
697 }                                                 
698                                                   
699 //....oooOO0OOooo........oooOO0OOooo........oo    
700                                                   
701 inline G4double                                   
702 G4VEnergyLossProcess::GetLambdaForScaledEnergy    
703 {                                                 
704   return fFactor*((*theLambdaTable)[basedCoupl    
705 }                                                 
706                                                   
707 //....oooOO0OOooo........oooOO0OOooo........oo    
708                                                   
709 inline G4double G4VEnergyLossProcess::LogScale    
710 {                                                 
711   return track.GetDynamicParticle()->GetLogKin    
712 }                                                 
713                                                   
714 //....oooOO0OOooo........oooOO0OOooo........oo    
715                                                   
716 inline G4double                                   
717 G4VEnergyLossProcess::GetDEDX(G4double kinEner    
718                               const G4Material    
719 {                                                 
720   DefineMaterial(couple);                         
721   return GetDEDXForScaledEnergy(kinEnergy*mass    
722 }                                                 
723                                                   
724 //....oooOO0OOooo........oooOO0OOooo........oo    
725                                                   
726 inline G4double                                   
727 G4VEnergyLossProcess::GetDEDX(G4double kinEner    
728                               const G4Material    
729                               G4double logKinE    
730 {                                                 
731   DefineMaterial(couple);                         
732   return GetDEDXForScaledEnergy(kinEnergy*mass    
733 }                                                 
734                                                   
735 //....oooOO0OOooo........oooOO0OOooo........oo    
736                                                   
737 inline G4double                                   
738 G4VEnergyLossProcess::GetRange(G4double kinEne    
739                                const G4Materia    
740 {                                                 
741   DefineMaterial(couple);                         
742   return GetScaledRangeForScaledEnergy(kinEner    
743 }                                                 
744                                                   
745 //....oooOO0OOooo........oooOO0OOooo........oo    
746                                                   
747 inline G4double                                   
748 G4VEnergyLossProcess::GetRange(G4double kinEne    
749                                const G4Materia    
750                                G4double logKin    
751 {                                                 
752   DefineMaterial(couple);                         
753   return GetScaledRangeForScaledEnergy(kinEner    
754 }                                                 
755                                                   
756 //....oooOO0OOooo........oooOO0OOooo........oo    
757                                                   
758 inline G4double                                   
759 G4VEnergyLossProcess::GetCSDARange(G4double ki    
760                                    const G4Mat    
761 {                                                 
762   DefineMaterial(couple);                         
763   return (nullptr == theCSDARangeTable) ? DBL_    
764     GetLimitScaledRangeForScaledEnergy(kinetic    
765 }                                                 
766                                                   
767 //....oooOO0OOooo........oooOO0OOooo........oo    
768                                                   
769 inline G4double                                   
770 G4VEnergyLossProcess::GetKineticEnergy(G4doubl    
771                                        const G    
772 {                                                 
773   DefineMaterial(couple);                         
774   return ScaledKinEnergyForLoss(range/reduceFa    
775 }                                                 
776                                                   
777 //....oooOO0OOooo........oooOO0OOooo........oo    
778                                                   
779 inline G4double                                   
780 G4VEnergyLossProcess::GetLambda(G4double kinEn    
781                                 const G4Materi    
782 {                                                 
783   DefineMaterial(couple);                         
784   return (nullptr != theLambdaTable) ?            
785     GetLambdaForScaledEnergy(kinEnergy*massRat    
786 }                                                 
787                                                   
788 //....oooOO0OOooo........oooOO0OOooo........oo    
789                                                   
790 inline G4double                                   
791 G4VEnergyLossProcess::GetLambda(G4double kinEn    
792                                 const G4Materi    
793                                 G4double logKi    
794 {                                                 
795   DefineMaterial(couple);                         
796   return (nullptr != theLambdaTable) ?            
797     GetLambdaForScaledEnergy(kinEnergy*massRat    
798     :  0.0;                                       
799 }                                                 
800                                                   
801 // ======== Get/Set inline methods used at ini    
802                                                   
803 inline void G4VEnergyLossProcess::SetFluctMode    
804 {                                                 
805   fluctModel = p;                                 
806 }                                                 
807                                                   
808 //....oooOO0OOooo........oooOO0OOooo........oo    
809                                                   
810 inline G4VEmFluctuationModel* G4VEnergyLossPro    
811 {                                                 
812   return fluctModel;                              
813 }                                                 
814                                                   
815 //....oooOO0OOooo........oooOO0OOooo........oo    
816                                                   
817 inline void G4VEnergyLossProcess::SetParticle(    
818 {                                                 
819   particle = p;                                   
820 }                                                 
821                                                   
822 //....oooOO0OOooo........oooOO0OOooo........oo    
823                                                   
824 inline void                                       
825 G4VEnergyLossProcess::SetSecondaryParticle(con    
826 {                                                 
827   secondaryParticle = p;                          
828 }                                                 
829                                                   
830 //....oooOO0OOooo........oooOO0OOooo........oo    
831                                                   
832 inline void                                       
833 G4VEnergyLossProcess::SetBaseParticle(const G4    
834 {                                                 
835   baseParticle = p;                               
836 }                                                 
837                                                   
838 //....oooOO0OOooo........oooOO0OOooo........oo    
839                                                   
840 inline const G4ParticleDefinition* G4VEnergyLo    
841 {                                                 
842   return particle;                                
843 }                                                 
844                                                   
845 //....oooOO0OOooo........oooOO0OOooo........oo    
846                                                   
847 inline const G4ParticleDefinition* G4VEnergyLo    
848 {                                                 
849   return baseParticle;                            
850 }                                                 
851                                                   
852 //....oooOO0OOooo........oooOO0OOooo........oo    
853                                                   
854 inline const G4ParticleDefinition*                
855 G4VEnergyLossProcess::SecondaryParticle() cons    
856 {                                                 
857   return secondaryParticle;                       
858 }                                                 
859                                                   
860 //....oooOO0OOooo........oooOO0OOooo........oo    
861                                                   
862 inline void G4VEnergyLossProcess::SetLossFluct    
863 {                                                 
864   lossFluctuationFlag = val;                      
865   actLossFluc = true;                             
866 }                                                 
867                                                   
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                                                   
903 //....oooOO0OOooo........oooOO0OOooo........oo    
904                                                   
905 inline G4double G4VEnergyLossProcess::MinKinEn    
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 {                                                 
921   return biasFactor;                              
922 }                                                 
923                                                   
924 //....oooOO0OOooo........oooOO0OOooo........oo    
925                                                   
926 inline G4bool G4VEnergyLossProcess::TablesAreB    
927 {                                                 
928   return tablesAreBuilt;                          
929 }                                                 
930                                                   
931 //....oooOO0OOooo........oooOO0OOooo........oo    
932                                                   
933 inline G4PhysicsTable* G4VEnergyLossProcess::D    
934 {                                                 
935   return theDEDXTable;                            
936 }                                                 
937                                                   
938 //....oooOO0OOooo........oooOO0OOooo........oo    
939                                                   
940 inline G4PhysicsTable* G4VEnergyLossProcess::D    
941 {                                                 
942   return theDEDXunRestrictedTable;                
943 }                                                 
944                                                   
945 //....oooOO0OOooo........oooOO0OOooo........oo    
946                                                   
947 inline G4PhysicsTable* G4VEnergyLossProcess::I    
948 {                                                 
949   return theIonisationTable;                      
950 }                                                 
951                                                   
952 //....oooOO0OOooo........oooOO0OOooo........oo    
953                                                   
954 inline G4PhysicsTable* G4VEnergyLossProcess::C    
955 {                                                 
956   return theCSDARangeTable;                       
957 }                                                 
958                                                   
959 //....oooOO0OOooo........oooOO0OOooo........oo    
960                                                   
961 inline G4PhysicsTable* G4VEnergyLossProcess::R    
962 {                                                 
963   return theRangeTableForLoss;                    
964 }                                                 
965                                                   
966 //....oooOO0OOooo........oooOO0OOooo........oo    
967                                                   
968 inline G4PhysicsTable* G4VEnergyLossProcess::I    
969 {                                                 
970   return theInverseRangeTable;                    
971 }                                                 
972                                                   
973 //....oooOO0OOooo........oooOO0OOooo........oo    
974                                                   
975 inline G4PhysicsTable* G4VEnergyLossProcess::L    
976 {                                                 
977   return theLambdaTable;                          
978 }                                                 
979                                                   
980 //....oooOO0OOooo........oooOO0OOooo........oo    
981                                                   
982 inline G4bool G4VEnergyLossProcess::UseBaseMat    
983 {                                                 
984   return baseMat;                                 
985 }                                                 
986                                                   
987 //....oooOO0OOooo........oooOO0OOooo........oo    
988                                                   
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    
998 {                                                 
999   return fXSpeaks;                                
1000 }                                                
1001                                                  
1002 //....oooOO0OOooo........oooOO0OOooo........o    
1003                                                  
1004 inline std::size_t G4VEnergyLossProcess::Numb    
1005 {                                                
1006   return numberOfModels;                         
1007 }                                                
1008                                                  
1009 //....oooOO0OOooo........oooOO0OOooo........o    
1010                                                  
1011 inline G4VEmModel* G4VEnergyLossProcess::EmMo    
1012 {                                                
1013   return (index < emModels->size()) ? (*emMod    
1014 }                                                
1015                                                  
1016 //....oooOO0OOooo........oooOO0OOooo........o    
1017                                                  
1018 inline G4VEmModel*                               
1019 G4VEnergyLossProcess::GetModelByIndex(std::si    
1020 {                                                
1021   return modelManager->GetModel((G4int)idx, v    
1022 }                                                
1023                                                  
1024 //....oooOO0OOooo........oooOO0OOooo........o    
1025                                                  
1026 #endif                                           
1027