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.2.p2)


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