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.0)


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