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


  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);
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 = 0;
                                                   >> 493   size_t                      idxDEDXSub = 0;
                                                   >> 494   size_t                      idxDEDXunRestricted = 0;
                                                   >> 495   size_t                      idxIonisation = 0;
                                                   >> 496   size_t                      idxIonisationSub = 0;
                                                   >> 497   size_t                      idxRange = 0;
                                                   >> 498   size_t                      idxCSDA = 0;
                                                   >> 499   size_t                      idxSecRange = 0;
                                                   >> 500   size_t                      idxInverseRange = 0;
                                                   >> 501   size_t                      idxLambda = 0;
                                                   >> 502   size_t                      idxSubLambda = 0;
                                                   >> 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   actLinLossLimit;
                                                   >> 545   G4bool   actLossFluc;
                                                   >> 546   G4bool   actBinning;
                                                   >> 547   G4bool   actMinKinEnergy;
                                                   >> 548   G4bool   actMaxKinEnergy;
472                                                   549 
473 protected:                                        550 protected:
474                                                   551 
475   G4double preStepLambda = 0.0;                << 552   G4ParticleChangeForLoss     fParticleChange;
476   G4double preStepKinEnergy = 0.0;             << 553   const G4Material*           currentMaterial;
477   G4double preStepScaledEnergy = 0.0;          << 554   const G4MaterialCutsCouple* currentCouple;
478   G4double mfpKinEnergy = 0.0;                 << 555   size_t                      currentCoupleIndex;
                                                   >> 556 
                                                   >> 557   G4double preStepLambda;
                                                   >> 558   G4double fRange;
                                                   >> 559   G4double computedRange;
                                                   >> 560   G4double preStepKinEnergy;
                                                   >> 561   G4double preStepLogKinEnergy;
                                                   >> 562   G4double preStepScaledEnergy;
                                                   >> 563   G4double preStepLogScaledEnergy;
                                                   >> 564   G4double preStepRangeEnergy;
                                                   >> 565   G4double mfpKinEnergy;
479                                                   566 
480   std::size_t currentCoupleIndex = 0;          << 567   // ======== Cached values - may be state dependent ================
481                                                   568 
482 private:                                          569 private:
483                                                   570 
484   G4int nBins;                                 << 571   std::vector<G4DynamicParticle*>  secParticles;
485   G4int nBinsCSDA;                             << 572   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                                                   573 
526   std::vector<G4DynamicParticle*> secParticles << 574   const G4ParticleDefinition* particle;
527   std::vector<G4Track*> scTracks;              << 575 
                                                   >> 576   G4VEmModel*                 currentModel;
                                                   >> 577   size_t                      basedCoupleIndex;
                                                   >> 578   size_t                      lastIdx;
                                                   >> 579 
                                                   >> 580   G4double massRatio;
                                                   >> 581   G4double logMassRatio;
                                                   >> 582   G4double fFactor;
                                                   >> 583   G4double reduceFactor;
                                                   >> 584   G4double chargeSqRatio;
                                                   >> 585 
                                                   >> 586   G4GPILSelection  aGPILSelection;
                                                   >> 587 
                                                   >> 588   G4int    secID;  
                                                   >> 589   G4int    subsecID;  
                                                   >> 590   G4int    biasID;  
528 };                                                591 };
529                                                   592 
530 // ======== Run time inline methods ==========    593 // ======== Run time inline methods ================
531                                                   594 
532 inline std::size_t G4VEnergyLossProcess::Curre << 595 inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 
533 {                                                 596 {
534   return currentCoupleIndex;                      597   return currentCoupleIndex;
535 }                                                 598 }
536                                                   599 
537 //....oooOO0OOooo........oooOO0OOooo........oo    600 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
538                                                   601 
539 inline void G4VEnergyLossProcess::SelectModel(    602 inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
540 {                                                 603 {
541   currentModel = modelManager->SelectModel(kin    604   currentModel = modelManager->SelectModel(kinEnergy, currentCoupleIndex);
542   currentModel->SetCurrentCouple(currentCouple    605   currentModel->SetCurrentCouple(currentCouple);
543 }                                                 606 }
544                                                   607 
545 //....oooOO0OOooo........oooOO0OOooo........oo    608 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
546                                                   609 
547 inline G4VEmModel* G4VEnergyLossProcess::Selec    610 inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
548                    G4double kinEnergy, std::si << 611                    G4double kinEnergy, size_t& idx) const
549 {                                                 612 {
550   return modelManager->SelectModel(kinEnergy,     613   return modelManager->SelectModel(kinEnergy, idx);
551 }                                                 614 }
552                                                   615 
553 //....oooOO0OOooo........oooOO0OOooo........oo    616 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
554                                                   617 
555 inline void                                       618 inline void 
556 G4VEnergyLossProcess::DefineMaterial(const G4M    619 G4VEnergyLossProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
557 {                                                 620 {
558   if(couple != currentCouple) {                   621   if(couple != currentCouple) {
559     currentCouple = couple;                    << 622     currentCouple   = couple;
560     currentMaterial = couple->GetMaterial();      623     currentMaterial = couple->GetMaterial();
561     basedCoupleIndex = currentCoupleIndex = co << 624     currentCoupleIndex = couple->GetIndex();
562     fFactor = chargeSqRatio*biasFactor;        << 625     basedCoupleIndex   = (*theDensityIdx)[currentCoupleIndex];
563     mfpKinEnergy = DBL_MAX;                    << 626     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);       627     reduceFactor = 1.0/(fFactor*massRatio);
                                                   >> 628     mfpKinEnergy = DBL_MAX;
                                                   >> 629     idxLambda = idxSubLambda = 0;
570   }                                               630   }
571 }                                                 631 }
572                                                   632 
573 //....oooOO0OOooo........oooOO0OOooo........oo    633 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
574                                                   634 
                                                   >> 635 inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
                                                   >> 636                                                        G4double charge2ratio)
                                                   >> 637 {
                                                   >> 638   massRatio     = massratio;
                                                   >> 639   logMassRatio  = G4Log(massRatio);
                                                   >> 640   fFactor = charge2ratio*biasFactor*(*theDensityFactor)[currentCoupleIndex];
                                                   >> 641   chargeSqRatio = charge2ratio;
                                                   >> 642   reduceFactor  = 1.0/(fFactor*massRatio);
                                                   >> 643 }
                                                   >> 644 
                                                   >> 645 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 646 
575 inline G4double G4VEnergyLossProcess::GetDEDXF    647 inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
576 {                                                 648 {
577   /*                                              649   /*
578   G4cout << "G4VEnergyLossProcess::GetDEDX: Id    650   G4cout << "G4VEnergyLossProcess::GetDEDX: Idx= " 
579            << basedCoupleIndex << " E(MeV)= "     651            << basedCoupleIndex << " E(MeV)= " << e 
580          << " Emin= " << minKinEnergy << "  Fa    652          << " Emin= " << minKinEnergy << "  Factor= " << fFactor 
581          << "  " << theDEDXTable << G4endl; */    653          << "  " << theDEDXTable << G4endl; */
582   G4double x = fFactor*(*theDEDXTable)[basedCo    654   G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->Value(e, idxDEDX);
583   if(e < minKinEnergy) { x *= std::sqrt(e/minK    655   if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
584   return x;                                       656   return x;
585 }                                                 657 }
586                                                   658 
587 //....oooOO0OOooo........oooOO0OOooo........oo << 
588                                                << 
589 inline                                            659 inline
590 G4double G4VEnergyLossProcess::GetDEDXForScale    660 G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e, G4double loge)
591 {                                                 661 {
592   /*                                              662   /*
593   G4cout << "G4VEnergyLossProcess::GetDEDX: Id    663   G4cout << "G4VEnergyLossProcess::GetDEDX: Idx= " 
594            << basedCoupleIndex << " E(MeV)= "     664            << basedCoupleIndex << " E(MeV)= " << e 
595          << " Emin= " << minKinEnergy << "  Fa    665          << " Emin= " << minKinEnergy << "  Factor= " << fFactor 
596          << "  " << theDEDXTable << G4endl; */    666          << "  " << theDEDXTable << G4endl; */
597   G4double x = fFactor*(*theDEDXTable)[basedCo    667   G4double x = fFactor*(*theDEDXTable)[basedCoupleIndex]->LogVectorValue(e,loge);
598   if(e < minKinEnergy) { x *= std::sqrt(e/minK    668   if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
599   return x;                                       669   return x;
600 }                                                 670 }
601                                                   671 
602 //....oooOO0OOooo........oooOO0OOooo........oo    672 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
603                                                   673 
                                                   >> 674 inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
                                                   >> 675 {
                                                   >> 676   G4double x = 
                                                   >> 677     fFactor*(*theDEDXSubTable)[basedCoupleIndex]->Value(e, idxDEDXSub);
                                                   >> 678   if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
                                                   >> 679   return x;
                                                   >> 680 }
                                                   >> 681 
                                                   >> 682 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 683 
604 inline G4double G4VEnergyLossProcess::GetIonis    684 inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
605 {                                                 685 {
606   G4double x =                                    686   G4double x = 
607     fFactor*(*theIonisationTable)[basedCoupleI    687     fFactor*(*theIonisationTable)[basedCoupleIndex]->Value(e, idxIonisation);
608   if(e < minKinEnergy) { x *= std::sqrt(e/minK    688   if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
609   return x;                                       689   return x;
610 }                                                 690 }
611                                                   691 
612 //....oooOO0OOooo........oooOO0OOooo........oo    692 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
613                                                   693 
                                                   >> 694 inline 
                                                   >> 695 G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
                                                   >> 696 {
                                                   >> 697   G4double x = fFactor*
                                                   >> 698     (*theIonisationSubTable)[basedCoupleIndex]->Value(e, idxIonisationSub);
                                                   >> 699   if(e < minKinEnergy) { x *= std::sqrt(e/minKinEnergy); }
                                                   >> 700   return x;
                                                   >> 701 }
                                                   >> 702 
                                                   >> 703 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 704 
614 inline G4double G4VEnergyLossProcess::GetScale    705 inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
615 {                                                 706 {
616   //G4cout << "G4VEnergyLossProcess::GetScaled    707   //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 
617   //         << basedCoupleIndex << " E(MeV)=     708   //         << basedCoupleIndex << " E(MeV)= " << e 
618   //         << " lastIdx= " << lastIdx << "      709   //         << " lastIdx= " << lastIdx << "  " << theRangeTableForLoss << G4endl; 
619   if(currentCoupleIndex != coupleIdxRange || f << 710   if(basedCoupleIndex != lastIdx || preStepRangeEnergy != e) {
620     coupleIdxRange = currentCoupleIndex;       << 711     lastIdx = basedCoupleIndex;
621     fRangeEnergy = e;                          << 712     preStepRangeEnergy = e;
622     fRange = reduceFactor*((*theRangeTableForL << 713     computedRange = 
623     if (fRange < 0.0) { fRange = 0.0; }        << 714                 ((*theRangeTableForLoss)[basedCoupleIndex])->Value(e, idxRange);
624     else if (e < minKinEnergy) { fRange *= std << 715     if(e < minKinEnergy) { computedRange *= std::sqrt(e/minKinEnergy); }
625   }                                               716   }
626   //G4cout << "G4VEnergyLossProcess::GetScaled    717   //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 
627   //         << basedCoupleIndex << " E(MeV)=     718   //         << basedCoupleIndex << " E(MeV)= " << e 
628   //         << " R=  " << computedRange << "  << 719   //         << " R=  " << fRange << "  " << theRangeTableForLoss << G4endl; 
629   return fRange;                               << 720 
                                                   >> 721   return computedRange;
630 }                                                 722 }
631                                                   723 
632 inline G4double                                   724 inline G4double
633 G4VEnergyLossProcess::GetScaledRangeForScaledE    725 G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e, G4double loge)
634 {                                                 726 {
635   //G4cout << "G4VEnergyLossProcess::GetScaled    727   //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 
636   //         << basedCoupleIndex << " E(MeV)=     728   //         << basedCoupleIndex << " E(MeV)= " << e 
637   //         << " lastIdx= " << lastIdx << "      729   //         << " lastIdx= " << lastIdx << "  " << theRangeTableForLoss << G4endl; 
638   if(currentCoupleIndex != coupleIdxRange || f << 730   if(basedCoupleIndex != lastIdx || preStepRangeEnergy != e) {
639     coupleIdxRange = currentCoupleIndex;       << 731     lastIdx = basedCoupleIndex;
640     fRangeEnergy = e;                          << 732     preStepRangeEnergy = e;
641     fRange = reduceFactor*((*theRangeTableForL << 733     computedRange = 
642     if (fRange < 0.0) { fRange = 0.0; }        << 734           ((*theRangeTableForLoss)[basedCoupleIndex])->LogVectorValue(e, loge);
643     else if (e < minKinEnergy) { fRange *= std << 735     if(e < minKinEnergy) { computedRange *= std::sqrt(e/minKinEnergy); }
644   }                                               736   }
645   //G4cout << "G4VEnergyLossProcess::GetScaled    737   //G4cout << "G4VEnergyLossProcess::GetScaledRange: Idx= " 
646   //         << basedCoupleIndex << " E(MeV)=     738   //         << basedCoupleIndex << " E(MeV)= " << e 
647   //         << " R=  " << fRange << "  " << t << 739   //         << " R=  " << fRange << "  " << theRangeTableForLoss << G4endl; 
648   return fRange;                               << 740 
                                                   >> 741   return computedRange;
649 }                                                 742 }
650                                                   743 
651 //....oooOO0OOooo........oooOO0OOooo........oo    744 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
652                                                   745 
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 
                                                   >> 892 inline G4double 
                                                   >> 893 G4VEnergyLossProcess::GetRangeForLoss(G4double kinEnergy,
                                                   >> 894                                       const G4MaterialCutsCouple* couple,
                                                   >> 895                                       G4double logKinEnergy)
                                                   >> 896 {
                                                   >> 897   //  G4cout << "GetRangeForLoss: Range from " << GetProcessName() << G4endl;
                                                   >> 898   DefineMaterial(couple);
                                                   >> 899   return reduceFactor * GetScaledRangeForScaledEnergy(kinEnergy*massRatio,
                                                   >> 900                                                      logKinEnergy+logMassRatio);
765 }                                                 901 }
766                                                   902 
767 //....oooOO0OOooo........oooOO0OOooo........oo    903 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
768                                                   904 
769 inline G4double                                   905 inline G4double 
770 G4VEnergyLossProcess::GetKineticEnergy(G4doubl    906 G4VEnergyLossProcess::GetKineticEnergy(G4double range,
771                                        const G    907                                        const G4MaterialCutsCouple* couple)
772 {                                                 908 {
773   DefineMaterial(couple);                         909   DefineMaterial(couple);
774   return ScaledKinEnergyForLoss(range/reduceFa    910   return ScaledKinEnergyForLoss(range/reduceFactor)/massRatio;
775 }                                                 911 }
776                                                   912 
777 //....oooOO0OOooo........oooOO0OOooo........oo    913 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
778                                                   914 
779 inline G4double                                   915 inline G4double 
780 G4VEnergyLossProcess::GetLambda(G4double kinEn    916 G4VEnergyLossProcess::GetLambda(G4double kinEnergy,
781                                 const G4Materi    917                                 const G4MaterialCutsCouple* couple)
782 {                                                 918 {
783   DefineMaterial(couple);                         919   DefineMaterial(couple);
784   return (nullptr != theLambdaTable) ?         << 920   return theLambdaTable ? GetLambdaForScaledEnergy(kinEnergy*massRatio) : 0.0;
785     GetLambdaForScaledEnergy(kinEnergy*massRat << 
786 }                                                 921 }
787                                                   922 
788 //....oooOO0OOooo........oooOO0OOooo........oo << 
789                                                << 
790 inline G4double                                   923 inline G4double 
791 G4VEnergyLossProcess::GetLambda(G4double kinEn    924 G4VEnergyLossProcess::GetLambda(G4double kinEnergy,
792                                 const G4Materi    925                                 const G4MaterialCutsCouple* couple,
793                                 G4double logKi    926                                 G4double logKinEnergy)
794 {                                                 927 {
795   DefineMaterial(couple);                         928   DefineMaterial(couple);
796   return (nullptr != theLambdaTable) ?         << 929   return theLambdaTable
797     GetLambdaForScaledEnergy(kinEnergy*massRat << 930     ?  GetLambdaForScaledEnergy(kinEnergy*massRatio, logKinEnergy+logMassRatio)
798     :  0.0;                                       931     :  0.0;
799 }                                                 932 }
800                                                   933 
801 // ======== Get/Set inline methods used at ini    934 // ======== Get/Set inline methods used at initialisation ================
802                                                   935 
803 inline void G4VEnergyLossProcess::SetFluctMode    936 inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
804 {                                                 937 {
805   fluctModel = p;                                 938   fluctModel = p;
806 }                                                 939 }
807                                                   940 
808 //....oooOO0OOooo........oooOO0OOooo........oo    941 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
809                                                   942 
810 inline G4VEmFluctuationModel* G4VEnergyLossPro << 943 inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
811 {                                                 944 {
812   return fluctModel;                              945   return fluctModel;
813 }                                                 946 }
814                                                   947 
815 //....oooOO0OOooo........oooOO0OOooo........oo    948 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
816                                                   949 
817 inline void G4VEnergyLossProcess::SetParticle(    950 inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
818 {                                                 951 {
819   particle = p;                                   952   particle = p;
820 }                                                 953 }
821                                                   954 
822 //....oooOO0OOooo........oooOO0OOooo........oo    955 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
823                                                   956 
824 inline void                                       957 inline void 
825 G4VEnergyLossProcess::SetSecondaryParticle(con    958 G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
826 {                                                 959 {
827   secondaryParticle = p;                          960   secondaryParticle = p;
828 }                                                 961 }
829                                                   962 
830 //....oooOO0OOooo........oooOO0OOooo........oo    963 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
831                                                   964 
832 inline void                                       965 inline void 
833 G4VEnergyLossProcess::SetBaseParticle(const G4    966 G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
834 {                                                 967 {
835   baseParticle = p;                               968   baseParticle = p;
836 }                                                 969 }
837                                                   970 
838 //....oooOO0OOooo........oooOO0OOooo........oo    971 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
839                                                   972 
840 inline const G4ParticleDefinition* G4VEnergyLo    973 inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
841 {                                                 974 {
842   return particle;                                975   return particle;
843 }                                                 976 }
844                                                   977 
845 //....oooOO0OOooo........oooOO0OOooo........oo    978 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
846                                                   979 
847 inline const G4ParticleDefinition* G4VEnergyLo    980 inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
848 {                                                 981 {
849   return baseParticle;                            982   return baseParticle;
850 }                                                 983 }
851                                                   984 
852 //....oooOO0OOooo........oooOO0OOooo........oo    985 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
853                                                   986 
854 inline const G4ParticleDefinition*                987 inline const G4ParticleDefinition* 
855 G4VEnergyLossProcess::SecondaryParticle() cons    988 G4VEnergyLossProcess::SecondaryParticle() const
856 {                                                 989 {
857   return secondaryParticle;                       990   return secondaryParticle;
858 }                                                 991 }
859                                                   992 
860 //....oooOO0OOooo........oooOO0OOooo........oo    993 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
861                                                   994 
862 inline void G4VEnergyLossProcess::SetLossFluct    995 inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
863 {                                                 996 {
864   lossFluctuationFlag = val;                      997   lossFluctuationFlag = val;
865   actLossFluc = true;                             998   actLossFluc = true;
866 }                                                 999 }
867                                                   1000 
868 //....oooOO0OOooo........oooOO0OOooo........oo    1001 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
869                                                   1002 
870 inline void G4VEnergyLossProcess::SetSpline(G4 << 1003 inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
871 {                                                 1004 {
872   spline = val;                                << 1005   integral = val;
873 }                                              << 1006   actIntegral = true;
874                                                << 
875 //....oooOO0OOooo........oooOO0OOooo........oo << 
876                                                << 
877 inline void G4VEnergyLossProcess::SetCrossSect << 
878 {                                              << 
879   fXSType = val;                               << 
880 }                                                 1007 }
881                                                   1008 
882 //....oooOO0OOooo........oooOO0OOooo........oo    1009 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
883                                                   1010   
884 inline G4CrossSectionType G4VEnergyLossProcess << 1011 inline G4bool G4VEnergyLossProcess::IsIntegral() const 
885 {                                                 1012 {
886   return fXSType;                              << 1013   return integral;
887 }                                                 1014 }
888                                                   1015 
889 //....oooOO0OOooo........oooOO0OOooo........oo    1016 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
890                                                   1017 
891 inline G4bool G4VEnergyLossProcess::IsIonisati    1018 inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
892 {                                                 1019 {
893   return isIonisation;                            1020   return isIonisation;
894 }                                                 1021 }
895                                                   1022 
896 //....oooOO0OOooo........oooOO0OOooo........oo    1023 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
897                                                   1024 
898 inline G4int G4VEnergyLossProcess::NumberOfSub    1025 inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
899 {                                                 1026 {
900   return nSCoffRegions;                           1027   return nSCoffRegions;
901 }                                                 1028 }
902                                                   1029 
903 //....oooOO0OOooo........oooOO0OOooo........oo    1030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
904                                                   1031 
905 inline G4double G4VEnergyLossProcess::MinKinEn    1032 inline G4double G4VEnergyLossProcess::MinKinEnergy() const
906 {                                                 1033 {
907   return minKinEnergy;                            1034   return minKinEnergy;
908 }                                                 1035 }
909                                                   1036 
910 //....oooOO0OOooo........oooOO0OOooo........oo    1037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
911                                                   1038 
912 inline G4double G4VEnergyLossProcess::MaxKinEn    1039 inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
913 {                                                 1040 {
914   return maxKinEnergy;                            1041   return maxKinEnergy;
915 }                                                 1042 }
916                                                   1043 
917 //....oooOO0OOooo........oooOO0OOooo........oo    1044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
918                                                   1045 
919 inline G4double G4VEnergyLossProcess::CrossSec    1046 inline G4double G4VEnergyLossProcess::CrossSectionBiasingFactor() const
920 {                                                 1047 {
921   return biasFactor;                              1048   return biasFactor;
922 }                                                 1049 }
923                                                   1050 
924 //....oooOO0OOooo........oooOO0OOooo........oo    1051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
925                                                   1052 
926 inline G4bool G4VEnergyLossProcess::TablesAreB    1053 inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
927 {                                                 1054 {
928   return tablesAreBuilt;                          1055   return tablesAreBuilt;
929 }                                                 1056 }
930                                                   1057 
931 //....oooOO0OOooo........oooOO0OOooo........oo    1058 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
932                                                   1059 
933 inline G4PhysicsTable* G4VEnergyLossProcess::D    1060 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
934 {                                                 1061 {
935   return theDEDXTable;                            1062   return theDEDXTable;
936 }                                                 1063 }
937                                                   1064 
938 //....oooOO0OOooo........oooOO0OOooo........oo    1065 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
939                                                   1066 
940 inline G4PhysicsTable* G4VEnergyLossProcess::D << 1067 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
941 {                                              << 
942   return theDEDXunRestrictedTable;             << 
943 }                                              << 
944                                                << 
945 //....oooOO0OOooo........oooOO0OOooo........oo << 
946                                                << 
947 inline G4PhysicsTable* G4VEnergyLossProcess::I << 
948 {                                                 1068 {
949   return theIonisationTable;                   << 1069   return theDEDXSubTable;
950 }                                                 1070 }
951                                                   1071 
952 //....oooOO0OOooo........oooOO0OOooo........oo    1072 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
953                                                   1073 
954 inline G4PhysicsTable* G4VEnergyLossProcess::C << 1074 inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
955 {                                              << 
956   return theCSDARangeTable;                    << 
957 }                                              << 
958                                                << 
959 //....oooOO0OOooo........oooOO0OOooo........oo << 
960                                                << 
961 inline G4PhysicsTable* G4VEnergyLossProcess::R << 
962 {                                                 1075 {
963   return theRangeTableForLoss;                 << 1076   return theDEDXunRestrictedTable;
964 }                                                 1077 }
965                                                   1078 
966 //....oooOO0OOooo........oooOO0OOooo........oo    1079 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
967                                                   1080 
968 inline G4PhysicsTable* G4VEnergyLossProcess::I << 1081 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
969 {                                                 1082 {
970   return theInverseRangeTable;                 << 1083   return theIonisationTable;
971 }                                                 1084 }
972                                                   1085 
973 //....oooOO0OOooo........oooOO0OOooo........oo    1086 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
974                                                   1087 
975 inline G4PhysicsTable* G4VEnergyLossProcess::L << 1088 inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
976 {                                                 1089 {
977   return theLambdaTable;                       << 1090   return theIonisationSubTable;
978 }                                                 1091 }
979                                                   1092 
980 //....oooOO0OOooo........oooOO0OOooo........oo    1093 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
981                                                   1094 
982 inline G4bool G4VEnergyLossProcess::UseBaseMat << 1095 inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
983 {                                                 1096 {
984   return baseMat;                              << 1097   return theCSDARangeTable;
985 }                                                 1098 }
986                                                   1099 
987 //....oooOO0OOooo........oooOO0OOooo........oo    1100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
988                                                   1101 
989 inline std::vector<G4double>*                  << 1102 inline G4PhysicsTable* G4VEnergyLossProcess::SecondaryRangeTable() const
990 G4VEnergyLossProcess::EnergyOfCrossSectionMax( << 
991 {                                                 1103 {
992   return theEnergyOfCrossSectionMax;           << 1104   return theSecondaryRangeTable;
993 }                                                 1105 }
994                                                   1106 
995 //....oooOO0OOooo........oooOO0OOooo........oo    1107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
996                                                   1108 
997 inline std::vector<G4TwoPeaksXS*>* G4VEnergyLo << 1109 inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
998 {                                                 1110 {
999   return fXSpeaks;                             << 1111   return theRangeTableForLoss;
1000 }                                                1112 }
1001                                                  1113 
1002 //....oooOO0OOooo........oooOO0OOooo........o    1114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1003                                                  1115 
1004 inline std::size_t G4VEnergyLossProcess::Numb << 1116 inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
1005 {                                                1117 {
1006   return numberOfModels;                      << 1118   return theInverseRangeTable;
1007 }                                                1119 }
1008                                                  1120 
1009 //....oooOO0OOooo........oooOO0OOooo........o    1121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1010                                                  1122 
1011 inline G4VEmModel* G4VEnergyLossProcess::EmMo << 1123 inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable() const
1012 {                                                1124 {
1013   return (index < emModels->size()) ? (*emMod << 1125   return theLambdaTable;
1014 }                                                1126 }
1015                                                  1127 
1016 //....oooOO0OOooo........oooOO0OOooo........o    1128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1017                                                  1129 
1018 inline G4VEmModel*                            << 1130 inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable() const
1019 G4VEnergyLossProcess::GetModelByIndex(std::si << 
1020 {                                                1131 {
1021   return modelManager->GetModel((G4int)idx, v << 1132   return theSubLambdaTable;
1022 }                                                1133 }
1023                                                  1134 
1024 //....oooOO0OOooo........oooOO0OOooo........o    1135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
1025                                                  1136 
1026 #endif                                           1137 #endif
1027                                                  1138