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 8.2.p1)


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