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 10.3.p3)


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