Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh (Version 11.3.0) and /processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh (Version 10.6.p2)


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