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


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