Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/utils/include/G4VEmProcess.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/G4VEmProcess.hh (Version 11.3.0) and /processes/electromagnetic/utils/include/G4VEmProcess.hh (Version 9.3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
                                                   >>  26 // $Id: G4VEmProcess.hh,v 1.55 2009/09/23 14:42:47 vnivanch Exp $
                                                   >>  27 // GEANT4 tag $Name: geant4-09-03 $
                                                   >>  28 //
 26 // -------------------------------------------     29 // -------------------------------------------------------------------
 27 //                                                 30 //
 28 // GEANT4 Class header file                        31 // GEANT4 Class header file
 29 //                                                 32 //
 30 //                                                 33 //
 31 // File name:     G4VEmProcess                     34 // File name:     G4VEmProcess
 32 //                                                 35 //
 33 // Author:        Vladimir Ivanchenko              36 // Author:        Vladimir Ivanchenko
 34 //                                                 37 //
 35 // Creation date: 01.10.2003                       38 // Creation date: 01.10.2003
 36 //                                                 39 //
 37 // Modifications: Vladimir Ivanchenko          <<  40 // Modifications:
                                                   >>  41 // 30-06-04 make destructor virtual (V.Ivanchenko)
                                                   >>  42 // 09-08-04 optimise integral option (V.Ivanchenko)
                                                   >>  43 // 11-08-04 add protected methods to access cuts (V.Ivanchenko)
                                                   >>  44 // 09-09-04 Bug fix for the integral mode with 2 peaks (V.Ivanchneko)
                                                   >>  45 // 16-09-04 Add flag for LambdaTable and method RecalculateLambda (VI)
                                                   >>  46 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
                                                   >>  47 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
                                                   >>  48 // 18-04-05 Use G4ParticleChangeForGamma (V.Ivantchenko)
                                                   >>  49 // 09-05-05 Fix problem in logic when path boundary between materials (VI)
                                                   >>  50 // 11-01-06 add A to parameters of ComputeCrossSectionPerAtom (VI)
                                                   >>  51 // 01-02-06 put default value A=0. to keep compatibility with v5.2 (mma)
                                                   >>  52 // 13-05-06 Add method to access model by index (V.Ivanchenko)
                                                   >>  53 // 12-09-06 add SetModel() (mma)
                                                   >>  54 // 25-09-07 More accurate handling zero xsect in 
                                                   >>  55 //          PostStepGetPhysicalInteractionLength (V.Ivanchenko)
                                                   >>  56 // 27-10-07 Virtual functions moved to source (V.Ivanchenko)
                                                   >>  57 // 15-07-08 Reorder class members for further multi-thread development (VI)
 38 //                                                 58 //
 39 // Class Description:                              59 // Class Description:
 40 //                                                 60 //
 41 // It is the base class - EM discrete and rest <<  61 // It is the unified Discrete process
 42                                                    62 
 43 // -------------------------------------------     63 // -------------------------------------------------------------------
 44 //                                                 64 //
 45                                                    65 
 46 #ifndef G4VEmProcess_h                             66 #ifndef G4VEmProcess_h
 47 #define G4VEmProcess_h 1                           67 #define G4VEmProcess_h 1
 48                                                    68 
 49 #include <CLHEP/Units/SystemOfUnits.h>         << 
 50                                                << 
 51 #include "G4VDiscreteProcess.hh"                   69 #include "G4VDiscreteProcess.hh"
 52 #include "globals.hh"                              70 #include "globals.hh"
 53 #include "G4Material.hh"                           71 #include "G4Material.hh"
 54 #include "G4MaterialCutsCouple.hh"                 72 #include "G4MaterialCutsCouple.hh"
 55 #include "G4Track.hh"                              73 #include "G4Track.hh"
                                                   >>  74 #include "G4EmModelManager.hh"
 56 #include "G4UnitsTable.hh"                         75 #include "G4UnitsTable.hh"
 57 #include "G4ParticleDefinition.hh"                 76 #include "G4ParticleDefinition.hh"
 58 #include "G4ParticleChangeForGamma.hh"             77 #include "G4ParticleChangeForGamma.hh"
 59 #include "G4EmParameters.hh"                   << 
 60 #include "G4EmDataHandler.hh"                  << 
 61 #include "G4EmTableType.hh"                    << 
 62 #include "G4EmModelManager.hh"                 << 
 63 #include "G4EmSecondaryParticleType.hh"        << 
 64                                                    78 
 65 class G4Step;                                      79 class G4Step;
 66 class G4VEmModel;                                  80 class G4VEmModel;
 67 class G4DataVector;                                81 class G4DataVector;
 68 class G4VParticleChange;                           82 class G4VParticleChange;
 69 class G4PhysicsTable;                              83 class G4PhysicsTable;
 70 class G4PhysicsVector;                             84 class G4PhysicsVector;
 71 class G4EmBiasingManager;                      << 
 72 class G4LossTableManager;                      << 
 73                                                    85 
 74 //....oooOO0OOooo........oooOO0OOooo........oo     86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 75                                                    87 
 76 class G4VEmProcess : public G4VDiscreteProcess     88 class G4VEmProcess : public G4VDiscreteProcess
 77 {                                                  89 {
 78 public:                                            90 public:
 79                                                    91 
 80   G4VEmProcess(const G4String& name, G4Process <<  92   G4VEmProcess(const G4String& name,
                                                   >>  93          G4ProcessType type = fElectromagnetic);
 81                                                    94 
 82   ~G4VEmProcess() override;                    <<  95   virtual ~G4VEmProcess();
 83                                                    96 
 84   //------------------------------------------     97   //------------------------------------------------------------------------
 85   // Virtual methods to be implemented in conc     98   // Virtual methods to be implemented in concrete processes
 86   //------------------------------------------     99   //------------------------------------------------------------------------
 87                                                   100 
 88   void ProcessDescription(std::ostream& outFil << 101   virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
 89                                                   102 
 90 protected:                                     << 103   virtual void PrintInfo() = 0;
 91                                                   104 
 92   virtual void StreamProcessInfo(std::ostream& << 105 protected:
 93                                                   106 
 94   virtual void InitialiseProcess(const G4Parti    107   virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
 95                                                   108 
 96   //------------------------------------------    109   //------------------------------------------------------------------------
 97   // Implementation of virtual methods common     110   // Implementation of virtual methods common to all Discrete processes 
 98   //------------------------------------------    111   //------------------------------------------------------------------------
 99                                                   112 
100 public:                                           113 public:
101                                                   114 
102   // Initialise for build of tables               115   // Initialise for build of tables
103   void PreparePhysicsTable(const G4ParticleDef << 116   void PreparePhysicsTable(const G4ParticleDefinition&);
104                                                   117 
105   // Build physics table during initialisation    118   // Build physics table during initialisation
106   void BuildPhysicsTable(const G4ParticleDefin << 119   void BuildPhysicsTable(const G4ParticleDefinition&);
107                                                   120 
108   // Called before tracking of each new G4Trac << 121   void PrintInfoDefinition();
109   void StartTracking(G4Track*) override;       << 
110                                                   122 
111   // implementation of virtual method, specifi    123   // implementation of virtual method, specific for G4VEmProcess
112   G4double PostStepGetPhysicalInteractionLengt    124   G4double PostStepGetPhysicalInteractionLength(
113                              const G4Track& tr    125                              const G4Track& track,
114                              G4double   previo    126                              G4double   previousStepSize,
115                              G4ForceCondition* << 127                              G4ForceCondition* condition
                                                   >> 128                             );
116                                                   129 
117   // implementation of virtual method, specifi    130   // implementation of virtual method, specific for G4VEmProcess
118   G4VParticleChange* PostStepDoIt(const G4Trac << 131   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
119                                                   132 
120   // Store PhysicsTable in a file.                133   // Store PhysicsTable in a file.
121   // Return false in case of failure at I/O       134   // Return false in case of failure at I/O
122   G4bool StorePhysicsTable(const G4ParticleDef    135   G4bool StorePhysicsTable(const G4ParticleDefinition*,
123                            const G4String& dir << 136          const G4String& directory,
124                            G4bool ascii = fals << 137          G4bool ascii = false);
125                                                   138 
126   // Retrieve Physics from a file.                139   // Retrieve Physics from a file.
127   // (return true if the Physics Table can be     140   // (return true if the Physics Table can be build by using file)
128   // (return false if the process has no funct    141   // (return false if the process has no functionality or in case of failure)
129   // File name should is constructed as proces    142   // File name should is constructed as processName+particleName and the
130   // should be placed under the directory spec << 143   // should be placed under the directory specifed by the argument.
131   G4bool RetrievePhysicsTable(const G4Particle    144   G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
132                               const G4String&  << 145             const G4String& directory,
133                               G4bool ascii) ov << 146             G4bool ascii);
134                                                   147 
135   // allowing check process name               << 148   // deexcitation activated per G4Region
136   virtual G4VEmProcess* GetEmProcess(const G4S << 149   void ActivateDeexcitation(G4bool, const G4Region* r = 0);
137                                                   150 
138   //------------------------------------------    151   //------------------------------------------------------------------------
139   // Specific methods for Discrete EM post ste    152   // Specific methods for Discrete EM post step simulation 
140   //------------------------------------------    153   //------------------------------------------------------------------------
141                                                   154 
142   // The main method to access cross section p << 155   // It returns the cross section per volume for energy/ material
143   inline G4double GetLambda(G4double kinEnergy << 156   G4double CrossSectionPerVolume(G4double kineticEnergy,
144                             const G4MaterialCu << 157          const G4MaterialCutsCouple* couple);
145                             G4double logKinEne << 
146                                                << 
147   // It returns the cross section per volume f << 
148   G4double GetCrossSection(const G4double kinE << 
149                            const G4MaterialCut << 
150                                                   158 
151   // It returns the cross section of the proce    159   // It returns the cross section of the process per atom
152   G4double ComputeCrossSectionPerAtom(G4double << 160   inline G4double ComputeCrossSectionPerAtom(G4double kineticEnergy, 
153                                       G4double << 161                G4double Z, G4double A=0., 
154                                       G4double << 162                G4double cut=0.0);
155                                                   163 
156   inline G4double MeanFreePath(const G4Track&     164   inline G4double MeanFreePath(const G4Track& track);
157                                                   165 
                                                   >> 166   // It returns cross section per volume
                                                   >> 167   inline G4double GetLambda(G4double& kinEnergy, 
                                                   >> 168           const G4MaterialCutsCouple* couple);
                                                   >> 169 
158   //------------------------------------------    170   //------------------------------------------------------------------------
159   // Specific methods to build and access Phys    171   // Specific methods to build and access Physics Tables
160   //------------------------------------------    172   //------------------------------------------------------------------------
161                                                   173 
162   // Binning for lambda table                     174   // Binning for lambda table
163   void SetLambdaBinning(G4int nbins);          << 175   inline void SetLambdaBinning(G4int nbins);
                                                   >> 176   inline G4int LambdaBinning() const;
164                                                   177 
165   // Min kinetic energy for tables                178   // Min kinetic energy for tables
166   void SetMinKinEnergy(G4double e);            << 179   inline void SetMinKinEnergy(G4double e);
167                                                << 180   inline G4double MinKinEnergy() const;
168   // Min kinetic energy for high energy table  << 
169   void SetMinKinEnergyPrim(G4double e);        << 
170                                                   181 
171   // Max kinetic energy for tables                182   // Max kinetic energy for tables
172   void SetMaxKinEnergy(G4double e);            << 183   inline void SetMaxKinEnergy(G4double e);
                                                   >> 184   inline G4double MaxKinEnergy() const;
                                                   >> 185 
                                                   >> 186   inline void SetPolarAngleLimit(G4double a);
                                                   >> 187   inline G4double PolarAngleLimit() const;
173                                                   188 
174   // Cross section table pointers              << 189   inline const G4PhysicsTable* LambdaTable() const;
175   inline G4PhysicsTable* LambdaTable() const;  << 
176   inline G4PhysicsTable* LambdaTablePrim() con << 
177   inline void SetLambdaTable(G4PhysicsTable*); << 
178   inline void SetLambdaTablePrim(G4PhysicsTabl << 
179                                                << 
180   // Integral method type and peak positions   << 
181   inline std::vector<G4double>* EnergyOfCrossS << 
182   inline void SetEnergyOfCrossSectionMax(std:: << 
183   inline G4CrossSectionType CrossSectionType() << 
184   inline void SetCrossSectionType(G4CrossSecti << 
185                                                   190 
186   //------------------------------------------    191   //------------------------------------------------------------------------
187   // Define and access particle type              192   // Define and access particle type 
188   //------------------------------------------    193   //------------------------------------------------------------------------
189                                                   194 
190   inline const G4ParticleDefinition* Particle(    195   inline const G4ParticleDefinition* Particle() const;
191   inline const G4ParticleDefinition* Secondary    196   inline const G4ParticleDefinition* SecondaryParticle() const;
192                                                   197 
193 protected:                                     << 
194                                                << 
195   //------------------------------------------    198   //------------------------------------------------------------------------
196   // Specific methods to set, access, modify m    199   // Specific methods to set, access, modify models and basic parameters
197   //------------------------------------------    200   //------------------------------------------------------------------------
198                                                << 201 
                                                   >> 202 protected:
199   // Select model in run time                     203   // Select model in run time
200   inline G4VEmModel* SelectModel(G4double kinE << 204   inline G4VEmModel* SelectModel(G4double& kinEnergy, size_t index); 
201                                                   205 
202 public:                                           206 public:
203                                                << 207   // Select model by energy and region index
204   // Select model by energy and couple index   << 
205   inline G4VEmModel* SelectModelForMaterial(G4    208   inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 
206                                             st << 209               size_t& idxRegion) const;
207                                                   210    
208   // Add model for region, smaller value of or    211   // Add model for region, smaller value of order defines which
209   // model will be selected for a given energy    212   // model will be selected for a given energy interval  
210   void AddEmModel(G4int, G4VEmModel*, const G4 << 213   void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
211                                                   214 
212   // Assign a model to a process local list, t << 215   // Assign a model to a process
213   // the derived process should execute AddEmM << 216   void SetModel(G4VEmModel*, G4int index = 1);
214   void SetEmModel(G4VEmModel*, G4int index = 0 << 217   
215                                                << 218   // return the assigned model
216   inline G4int NumberOfModels() const;         << 219   G4VEmModel* Model(G4int index = 1);
217                                                << 220     
218   // return a model from the local list        << 221   // Define new energy range for the model identified by the name
219   inline G4VEmModel* EmModel(std::size_t index << 222   void UpdateEmModel(const G4String&, G4double, G4double);
220                                                << 
221   // Access to active model                    << 
222   inline const G4VEmModel* GetCurrentModel() c << 
223                                                   223 
224   // Access to models                             224   // Access to models
225   inline G4VEmModel* GetModelByIndex(G4int idx << 225   G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
226                                                << 
227   // Access to the current G4Element           << 
228   const G4Element* GetCurrentElement() const;  << 
229                                                   226 
230   // Biasing parameters                        << 227   inline void SetLambdaFactor(G4double val);
231   void SetCrossSectionBiasingFactor(G4double f << 
232   inline G4double CrossSectionBiasingFactor()  << 
233                                                   228 
234   // Activate forced interaction               << 229   inline void SetIntegral(G4bool val);
235   void ActivateForcedInteraction(G4double leng << 230   inline G4bool IsIntegral() const;
236                                  const G4Strin << 
237                                  G4bool flag = << 
238                                                   231 
239   void ActivateSecondaryBiasing(const G4String << 232   inline void SetApplyCuts(G4bool val);
240                                 G4double energ << 
241                                                << 
242   inline void SetEmMasterProcess(const G4VEmPr << 
243                                                << 
244   inline void SetBuildTableFlag(G4bool val);   << 
245                                                << 
246   inline void CurrentSetup(const G4MaterialCut << 
247                                                << 
248   inline G4bool UseBaseMaterial() const;       << 
249                                                << 
250   void BuildLambdaTable();                     << 
251                                                << 
252   void StreamInfo(std::ostream& outFile, const << 
253                   G4bool rst=false) const;     << 
254                                                << 
255   // hide copy constructor and assignment oper << 
256   G4VEmProcess(G4VEmProcess &) = delete;       << 
257   G4VEmProcess & operator=(const G4VEmProcess  << 
258                                                   233 
259   //------------------------------------------    234   //------------------------------------------------------------------------
260   // Other generic methods                        235   // Other generic methods
261   //------------------------------------------    236   //------------------------------------------------------------------------
262                                                   237   
263 protected:                                        238 protected:
264                                                   239 
265   G4double GetMeanFreePath(const G4Track& trac    240   G4double GetMeanFreePath(const G4Track& track,
266                            G4double previousSt << 241          G4double previousStepSize,
267                            G4ForceCondition* c << 242          G4ForceCondition* condition);
268                                                   243 
269   G4PhysicsVector* LambdaPhysicsVector(const G    244   G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*);
270                                                   245 
271   inline void DefineMaterial(const G4MaterialC << 246   inline G4double RecalculateLambda(G4double kinEnergy,
272                                                << 247             const G4MaterialCutsCouple* couple);
273   inline G4int LambdaBinning() const;          << 
274                                                << 
275   inline G4double MinKinEnergy() const;        << 
276                                                << 
277   inline G4double MaxKinEnergy() const;        << 
278                                                << 
279   // Single scattering parameters              << 
280   inline G4double PolarAngleLimit() const;     << 
281                                                   248 
282   inline G4ParticleChangeForGamma* GetParticle    249   inline G4ParticleChangeForGamma* GetParticleChange();
283                                                   250 
284   inline void SetParticle(const G4ParticleDefi    251   inline void SetParticle(const G4ParticleDefinition* p);
285                                                   252   
286   inline void SetSecondaryParticle(const G4Par    253   inline void SetSecondaryParticle(const G4ParticleDefinition* p);
287                                                   254 
288   inline std::size_t CurrentMaterialCutsCouple << 255   inline size_t CurrentMaterialCutsCoupleIndex() const;
289                                                << 
290   inline const G4MaterialCutsCouple* MaterialC << 
291                                                << 
292   inline G4bool ApplyCuts() const;             << 
293                                                   256 
294   inline G4double GetGammaEnergyCut();            257   inline G4double GetGammaEnergyCut();
295                                                   258 
296   inline G4double GetElectronEnergyCut();         259   inline G4double GetElectronEnergyCut();
297                                                   260 
298   inline void SetStartFromNullFlag(G4bool val) << 261   inline void SetBuildTableFlag(G4bool val);
299                                                << 
300   inline void SetSplineFlag(G4bool val);       << 
301                                                << 
302   const G4Element* GetTargetElement() const;   << 
303                                                << 
304   const G4Isotope* GetTargetIsotope() const;   << 
305                                                   262 
306   // these two methods assume that vectors are << 263   inline void SetStartFromNullFlag(G4bool val);
307   // and idx is within vector length           << 
308   inline G4int DensityIndex(G4int idx) const;  << 
309   inline G4double DensityFactor(G4int idx) con << 
310                                                   264 
311 private:                                          265 private:
312                                                   266 
313   void PrintWarning(G4String tit, G4double val << 267   void Clear();
314                                                   268 
315   void ComputeIntegralLambda(G4double kinEnerg << 269   void BuildLambdaTable();
316                                                   270 
317   inline G4double LogEkin(const G4Track&);     << 271   void FindLambdaMax();
318                                                   272 
319   inline G4double GetLambdaFromTable(G4double  << 273   inline void InitialiseStep(const G4Track&);
320                                                   274 
321   inline G4double GetLambdaFromTable(G4double  << 275   inline void DefineMaterial(const G4MaterialCutsCouple* couple);
322                                                   276 
323   inline G4double GetLambdaFromTablePrim(G4dou << 277   inline void ComputeIntegralLambda(G4double kinEnergy);
324                                                   278 
325   inline G4double GetLambdaFromTablePrim(G4dou << 279   inline G4double GetLambdaFromTable(G4double kinEnergy);
326                                                   280 
327   inline G4double GetCurrentLambda(G4double ki    281   inline G4double GetCurrentLambda(G4double kinEnergy);
328                                                   282 
329   inline G4double GetCurrentLambda(G4double ki << 
330                                                << 
331   inline G4double ComputeCurrentLambda(G4doubl    283   inline G4double ComputeCurrentLambda(G4double kinEnergy);
332                                                   284 
333   // ======== pointers =========               << 285   // copy constructor and hide assignment operator
                                                   >> 286   G4VEmProcess(G4VEmProcess &);
                                                   >> 287   G4VEmProcess & operator=(const G4VEmProcess &right);
334                                                   288 
335   G4EmModelManager*            modelManager =  << 289   // ======== Parameters of the class fixed at construction =========
336   const G4ParticleDefinition*  particle = null << 
337   const G4ParticleDefinition*  currentParticle << 
338   const G4ParticleDefinition*  theGamma = null << 
339   const G4ParticleDefinition*  theElectron = n << 
340   const G4ParticleDefinition*  thePositron = n << 
341   const G4ParticleDefinition*  secondaryPartic << 
342   const G4VEmProcess*          masterProc = nu << 
343   G4EmDataHandler*             theData = nullp << 
344   G4VEmModel*                  currentModel =  << 
345   G4LossTableManager*          lManager = null << 
346   G4EmParameters*              theParameters = << 
347   const G4Material*            baseMaterial =  << 
348                                                << 
349   // ======== tables and vectors ========      << 
350   G4PhysicsTable*              theLambdaTable  << 
351   G4PhysicsTable*              theLambdaTableP << 
352                                                << 
353   const std::vector<G4double>* theCuts = nullp << 
354   const std::vector<G4double>* theCutsGamma =  << 
355   const std::vector<G4double>* theCutsElectron << 
356   const std::vector<G4double>* theCutsPositron << 
357                                                   290 
358 protected:                                     << 291   G4EmModelManager*            modelManager;
                                                   >> 292   const G4ParticleDefinition*  theGamma;
                                                   >> 293   const G4ParticleDefinition*  theElectron;
                                                   >> 294   const G4ParticleDefinition*  thePositron;
                                                   >> 295   const G4ParticleDefinition*  secondaryParticle;
359                                                   296 
360   // ======== pointers =========               << 297   G4bool                       buildLambdaTable;
361                                                   298 
362   const G4MaterialCutsCouple*  currentCouple = << 299   // ======== Parameters of the class fixed at initialisation =======
363   const G4Material*            currentMaterial << 
364   G4EmBiasingManager*          biasManager = n << 
365   std::vector<G4double>*       theEnergyOfCros << 
366                                                   300 
367 private:                                       << 301   std::vector<G4VEmModel*>     emModels;
368                                                   302 
369   const std::vector<G4double>* theDensityFacto << 303   // tables and vectors
370   const std::vector<G4int>* theDensityIdx = nu << 304   G4PhysicsTable*              theLambdaTable;
                                                   >> 305   G4double*                    theEnergyOfCrossSectionMax;
                                                   >> 306   G4double*                    theCrossSectionMax;
371                                                   307 
372   // ======== parameters =========             << 308   const std::vector<G4double>* theCuts;
373   G4double minKinEnergy;                       << 309   const std::vector<G4double>* theCutsGamma;
374   G4double maxKinEnergy;                       << 310   const std::vector<G4double>* theCutsElectron;
375   G4double minKinEnergyPrim = DBL_MAX;         << 311   const std::vector<G4double>* theCutsPositron;
376   G4double lambdaFactor = 0.8;                 << 
377   G4double invLambdaFactor;                    << 
378   G4double biasFactor = 1.0;                   << 
379   G4double massRatio = 1.0;                    << 
380   G4double fFactor = 1.0;                      << 
381   G4double fLambda = 0.0;                      << 
382   G4double fLambdaEnergy = 0.0;                << 
383                                                   312 
384 protected:                                     << 313   G4int                        nLambdaBins;
385                                                   314 
386   G4double mfpKinEnergy = DBL_MAX;             << 315   G4double                     minKinEnergy;
387   G4double preStepKinEnergy = 0.0;             << 316   G4double                     maxKinEnergy;
388   G4double preStepLambda = 0.0;                << 317   G4double                     lambdaFactor;
                                                   >> 318   G4double                     polarAngleLimit;
389                                                   319 
390 private:                                       << 320   G4bool                       integral;
                                                   >> 321   G4bool                       applyCuts;
                                                   >> 322   G4bool                       startFromNull;
                                                   >> 323   G4bool                       useDeexcitation;
391                                                   324 
392   G4CrossSectionType fXSType = fEmNoIntegral;  << 325   G4int                        nDERegions;
                                                   >> 326   std::vector<const G4Region*> deRegions;
                                                   >> 327   G4bool*                      idxDERegions;
393                                                   328 
394   G4int numberOfModels = 0;                    << 329   // ======== Cashed values - may be state dependent ================
395   G4int nLambdaBins = 84;                      << 
396                                                   330 
397 protected:                                        331 protected:
398                                                   332 
399   G4int mainSecondaries = 1;                   << 333   G4ParticleChangeForGamma     fParticleChange;
400   G4int secID = _EM;                           << 
401   G4int fluoID = _Fluorescence;                << 
402   G4int augerID = _AugerElectron;              << 
403   G4int biasID = _EM;                          << 
404   G4int tripletID = _TripletElectron;          << 
405   std::size_t currentCoupleIndex = 0;          << 
406   std::size_t basedCoupleIndex = 0;            << 
407   std::size_t coupleIdxLambda = 0;             << 
408   std::size_t idxLambda = 0;                   << 
409                                                << 
410   G4bool isTheMaster = false;                  << 
411   G4bool baseMat = false;                      << 
412                                                   334 
413 private:                                          335 private:
414                                                   336 
415   G4bool buildLambdaTable = true;              << 
416   G4bool applyCuts = false;                    << 
417   G4bool startFromNull = false;                << 
418   G4bool splineFlag = true;                    << 
419   G4bool actMinKinEnergy = false;              << 
420   G4bool actMaxKinEnergy = false;              << 
421   G4bool actBinning = false;                   << 
422   G4bool isIon = false;                        << 
423   G4bool biasFlag = false;                     << 
424   G4bool weightFlag = false;                   << 
425                                                << 
426 protected:                                     << 
427                                                << 
428   // ======== particle change =========        << 
429   std::vector<G4DynamicParticle*> secParticles    337   std::vector<G4DynamicParticle*> secParticles;
430   G4ParticleChangeForGamma fParticleChange;    << 
431                                                   338 
432 private:                                       << 339   G4VEmModel*                  currentModel;  
433                                                   340 
434   // ======== local vectors =========          << 341   const G4ParticleDefinition*  particle;
435   std::vector<G4VEmModel*> emModels;           << 
436                                                   342 
437 };                                             << 343   // cash
438                                                << 344   const G4Material*            currentMaterial;
439 // ======== Run time inline methods ========== << 345   const G4MaterialCutsCouple*  currentCouple;
440                                                << 346   size_t                       currentCoupleIndex;
441 //....oooOO0OOooo........oooOO0OOooo........oo << 347 
442                                                << 348   G4double                     mfpKinEnergy;
443 inline std::size_t G4VEmProcess::CurrentMateri << 349   G4double                     preStepKinEnergy;
444 {                                              << 350   G4double                     preStepLambda;
445   return currentCoupleIndex;                   << 
446 }                                              << 
447                                                << 
448 //....oooOO0OOooo........oooOO0OOooo........oo << 
449                                                   351 
450 inline const G4MaterialCutsCouple* G4VEmProces << 352 };
451 {                                              << 
452   return currentCouple;                        << 
453 }                                              << 
454                                                << 
455 //....oooOO0OOooo........oooOO0OOooo........oo << 
456                                                << 
457 inline G4double G4VEmProcess::GetGammaEnergyCu << 
458 {                                              << 
459   return (*theCutsGamma)[currentCoupleIndex];  << 
460 }                                              << 
461                                                << 
462 //....oooOO0OOooo........oooOO0OOooo........oo << 
463                                                << 
464 inline G4double G4VEmProcess::GetElectronEnerg << 
465 {                                              << 
466   return (*theCutsElectron)[currentCoupleIndex << 
467 }                                              << 
468                                                   353 
469 //....oooOO0OOooo........oooOO0OOooo........oo    354 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
470                                                << 
471 inline void G4VEmProcess::DefineMaterial(const << 
472 {                                              << 
473   if (couple != currentCouple) {               << 
474     currentCouple = couple;                    << 
475     baseMaterial = currentMaterial = couple->G << 
476     basedCoupleIndex = currentCoupleIndex = co << 
477     fFactor = biasFactor;                      << 
478     mfpKinEnergy = DBL_MAX;                    << 
479     if (baseMat) {                             << 
480       basedCoupleIndex = (*theDensityIdx)[curr << 
481       if (nullptr != currentMaterial->GetBaseM << 
482         baseMaterial = currentMaterial->GetBas << 
483       fFactor *= (*theDensityFactor)[currentCo << 
484     }                                          << 
485   }                                            << 
486 }                                              << 
487                                                << 
488 //....oooOO0OOooo........oooOO0OOooo........oo    355 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
489                                                   356 
490 inline                                         << 357 inline G4double G4VEmProcess::ComputeCrossSectionPerAtom(
491 G4VEmModel* G4VEmProcess::SelectModel(G4double << 358      G4double kineticEnergy, G4double Z, G4double A, G4double cut)
492 {                                                 359 {
493   if(1 < numberOfModels) {                     << 360   SelectModel(kineticEnergy, currentCoupleIndex);
494     currentModel = modelManager->SelectModel(k << 361   G4double x = 0.0;
                                                   >> 362   if(currentModel) {
                                                   >> 363    x = currentModel->ComputeCrossSectionPerAtom(particle,kineticEnergy,
                                                   >> 364              Z,A,cut);
495   }                                               365   }
496   currentModel->SetCurrentCouple(currentCouple << 366   return x;
497   return currentModel;                         << 
498 }                                                 367 }
499                                                   368 
500 //....oooOO0OOooo........oooOO0OOooo........oo    369 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
501                                                   370 
502 inline                                         << 371 inline G4double G4VEmProcess::MeanFreePath(const G4Track& track)
503 G4VEmModel* G4VEmProcess::SelectModelForMateri << 
504                                                << 
505 {                                                 372 {
506   return modelManager->SelectModel(kinEnergy,  << 373   DefineMaterial(track.GetMaterialCutsCouple());
                                                   >> 374   preStepLambda = GetCurrentLambda(track.GetKineticEnergy());
                                                   >> 375   G4double x = DBL_MAX;
                                                   >> 376   if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
                                                   >> 377   return x;
507 }                                                 378 }
508                                                   379 
509 //....oooOO0OOooo........oooOO0OOooo........oo    380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
510                                                   381 
511 inline G4double G4VEmProcess::GetLambdaFromTab << 382 inline G4double G4VEmProcess::GetLambda(G4double& kineticEnergy,
                                                   >> 383           const G4MaterialCutsCouple* couple)
512 {                                                 384 {
513   return ((*theLambdaTable)[basedCoupleIndex]) << 385   DefineMaterial(couple);
                                                   >> 386   return GetCurrentLambda(kineticEnergy);
514 }                                                 387 }
515                                                   388 
516 //....oooOO0OOooo........oooOO0OOooo........oo    389 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
517                                                   390 
518 inline G4double G4VEmProcess::LogEkin(const G4 << 391 inline void G4VEmProcess::SetLambdaBinning(G4int nbins)
519 {                                                 392 {
520   return track.GetDynamicParticle()->GetLogKin << 393   nLambdaBins = nbins;
521 }                                                 394 }
522                                                   395 
523 //....oooOO0OOooo........oooOO0OOooo........oo    396 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
524                                                   397 
525 inline G4double G4VEmProcess::GetLambdaFromTab << 398 inline G4int G4VEmProcess::LambdaBinning() const
526 {                                                 399 {
527   return ((*theLambdaTable)[basedCoupleIndex]) << 400   return nLambdaBins;
528 }                                                 401 }
529                                                   402 
530 //....oooOO0OOooo........oooOO0OOooo........oo    403 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
531                                                   404 
532 inline G4double G4VEmProcess::GetLambdaFromTab << 405 inline void G4VEmProcess::SetMinKinEnergy(G4double e)
533 {                                                 406 {
534   return ((*theLambdaTablePrim)[basedCoupleInd << 407   minKinEnergy = e;
535 }                                                 408 }
536                                                   409 
537 //....oooOO0OOooo........oooOO0OOooo........oo    410 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
538                                                   411 
539 inline G4double G4VEmProcess::GetLambdaFromTab << 412 inline G4double G4VEmProcess::MinKinEnergy() const
540 {                                                 413 {
541   return ((*theLambdaTablePrim)[basedCoupleInd << 414   return minKinEnergy;
542 }                                                 415 }
543                                                   416 
544 //....oooOO0OOooo........oooOO0OOooo........oo    417 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
545                                                   418 
546 inline G4double G4VEmProcess::ComputeCurrentLa << 419 inline void G4VEmProcess::SetMaxKinEnergy(G4double e)
547 {                                                 420 {
548   return currentModel->CrossSectionPerVolume(b << 421   maxKinEnergy = e;
549 }                                                 422 }
550                                                   423 
551 //....oooOO0OOooo........oooOO0OOooo........oo    424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
552                                                   425 
553 inline G4double G4VEmProcess::GetCurrentLambda << 426 inline G4double G4VEmProcess::MaxKinEnergy() const
554 {                                                 427 {
555   if(currentCoupleIndex != coupleIdxLambda ||  << 428   return maxKinEnergy;
556     coupleIdxLambda = currentCoupleIndex;      << 
557     fLambdaEnergy = e;                         << 
558     if(e >= minKinEnergyPrim) { fLambda = GetL << 
559     else if(nullptr != theLambdaTable) { fLamb << 
560     else { fLambda = ComputeCurrentLambda(e);  << 
561     fLambda *= fFactor;                        << 
562   }                                            << 
563   return fLambda;                              << 
564 }                                                 429 }
565                                                   430 
566 //....oooOO0OOooo........oooOO0OOooo........oo    431 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
567                                                   432 
568 inline G4double G4VEmProcess::GetCurrentLambda << 433 inline void G4VEmProcess::SetPolarAngleLimit(G4double val)
569 {                                                 434 {
570   if(currentCoupleIndex != coupleIdxLambda ||  << 435   if(val < 0.0)     polarAngleLimit = 0.0;
571     coupleIdxLambda = currentCoupleIndex;      << 436   else if(val > pi) polarAngleLimit = pi;
572     fLambdaEnergy = e;                         << 437   else              polarAngleLimit = val;
573     if(e >= minKinEnergyPrim) { fLambda = GetL << 
574     else if(nullptr != theLambdaTable) { fLamb << 
575     else { fLambda = ComputeCurrentLambda(e);  << 
576     fLambda *= fFactor;                        << 
577   }                                            << 
578   return fLambda;                              << 
579 }                                                 438 }
580                                                   439 
581 //....oooOO0OOooo........oooOO0OOooo........oo    440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
582                                                   441 
583 inline void                                    << 442 inline G4double G4VEmProcess::PolarAngleLimit() const
584 G4VEmProcess::CurrentSetup(const G4MaterialCut << 
585 {                                                 443 {
586   DefineMaterial(couple);                      << 444   return polarAngleLimit;
587   SelectModel(energy*massRatio, currentCoupleI << 
588 }                                                 445 }
589                                                   446 
590 //....oooOO0OOooo........oooOO0OOooo........oo    447 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
591                                                   448 
592 inline G4double                                << 449 inline const G4PhysicsTable* G4VEmProcess::LambdaTable() const
593 G4VEmProcess::GetLambda(G4double kinEnergy, co << 
594                         G4double logKinEnergy) << 
595 {                                                 450 {
596   CurrentSetup(couple, kinEnergy);             << 451   return theLambdaTable;
597   return GetCurrentLambda(kinEnergy, logKinEne << 
598 }                                                 452 }
599                                                   453 
600 //....oooOO0OOooo........oooOO0OOooo........oo    454 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
601                                                   455 
602 G4double G4VEmProcess::MeanFreePath(const G4Tr << 456 inline const G4ParticleDefinition* G4VEmProcess::Particle() const
603 {                                              << 
604   const G4double kinEnergy = track.GetKineticE << 
605   CurrentSetup(track.GetMaterialCutsCouple(),  << 
606   const G4double xs = GetCurrentLambda(kinEner << 
607                              track.GetDynamicP << 
608   return (0.0 < xs) ? 1.0/xs : DBL_MAX;        << 
609 }                                              << 
610                                                << 
611 // ======== Get/Set inline methods used at ini << 
612                                                << 
613 inline G4bool G4VEmProcess::ApplyCuts() const  << 
614 {                                                 457 {
615   return applyCuts;                            << 458   return particle;
616 }                                                 459 }
617                                                   460 
618 //....oooOO0OOooo........oooOO0OOooo........oo    461 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
619                                                   462 
620 inline G4int G4VEmProcess::LambdaBinning() con << 463 inline const G4ParticleDefinition* G4VEmProcess::SecondaryParticle() const
621 {                                                 464 {
622   return nLambdaBins;                          << 465   return secondaryParticle;
623 }                                                 466 }
624                                                   467 
625 //....oooOO0OOooo........oooOO0OOooo........oo    468 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
626                                                   469 
627 inline G4double G4VEmProcess::MinKinEnergy() c << 470 inline 
                                                   >> 471 G4VEmModel* G4VEmProcess::SelectModel(G4double& kinEnergy, size_t index)
628 {                                                 472 {
629   return minKinEnergy;                         << 473   currentModel = modelManager->SelectModel(kinEnergy, index);
                                                   >> 474   currentModel->SetCurrentCouple(currentCouple);
                                                   >> 475   return currentModel;
630 }                                                 476 }
631                                                   477 
632 //....oooOO0OOooo........oooOO0OOooo........oo    478 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
633                                                   479 
634 inline G4double G4VEmProcess::MaxKinEnergy() c << 480 inline 
                                                   >> 481 G4VEmModel* G4VEmProcess::SelectModelForMaterial(G4double kinEnergy, 
                                                   >> 482              size_t& idxRegion) const
635 {                                                 483 {
636   return maxKinEnergy;                         << 484   return modelManager->SelectModel(kinEnergy, idxRegion);
637 }                                                 485 }
638                                                   486 
639 //....oooOO0OOooo........oooOO0OOooo........oo    487 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
640                                                   488 
641 inline G4double G4VEmProcess::CrossSectionBias << 489 inline void G4VEmProcess::SetLambdaFactor(G4double val)
642 {                                                 490 {
643   return biasFactor;                           << 491   if(val > 0.0 && val <= 1.0) lambdaFactor = val;
644 }                                                 492 }
645                                                   493 
646 //....oooOO0OOooo........oooOO0OOooo........oo    494 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
647                                                   495 
648 inline G4PhysicsTable* G4VEmProcess::LambdaTab << 496 inline void G4VEmProcess::SetIntegral(G4bool val)
649 {                                                 497 {
650   return theLambdaTable;                       << 498   if(particle && particle != theGamma) integral = val;
                                                   >> 499   if(integral) buildLambdaTable = true;
651 }                                                 500 }
652                                                   501 
653 //....oooOO0OOooo........oooOO0OOooo........oo    502 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
654                                                   503 
655 inline G4PhysicsTable* G4VEmProcess::LambdaTab << 504 inline G4bool G4VEmProcess::IsIntegral() const
656 {                                                 505 {
657   return theLambdaTablePrim;                   << 506   return integral;
658 }                                                 507 }
659                                                   508 
660 //....oooOO0OOooo........oooOO0OOooo........oo    509 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
661                                                   510 
662 inline void G4VEmProcess::SetLambdaTable(G4Phy << 511 inline void G4VEmProcess::SetApplyCuts(G4bool val)
663 {                                                 512 {
664   theLambdaTable = ptr;                        << 513   applyCuts = val;
665 }                                                 514 }
666                                                   515 
667 //....oooOO0OOooo........oooOO0OOooo........oo    516 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
668                                                   517 
669 inline void G4VEmProcess::SetLambdaTablePrim(G << 518 inline G4double G4VEmProcess::RecalculateLambda(G4double e, 
                                                   >> 519             const G4MaterialCutsCouple* couple)
670 {                                                 520 {
671   theLambdaTablePrim = ptr;                    << 521   DefineMaterial(couple);
                                                   >> 522   return ComputeCurrentLambda(e);
672 }                                                 523 }
673                                                   524 
674 //....oooOO0OOooo........oooOO0OOooo........oo    525 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
675                                                   526 
676 inline std::vector<G4double>* G4VEmProcess::En << 527 inline G4ParticleChangeForGamma* G4VEmProcess::GetParticleChange()
677 {                                                 528 {
678   return theEnergyOfCrossSectionMax;           << 529   return &fParticleChange;
679 }                                                 530 }
680                                                   531 
681 //....oooOO0OOooo........oooOO0OOooo........oo    532 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
682                                                   533 
683 inline void                                    << 534 inline void G4VEmProcess::SetParticle(const G4ParticleDefinition* p)
684 G4VEmProcess::SetEnergyOfCrossSectionMax(std:: << 
685 {                                                 535 {
686   theEnergyOfCrossSectionMax = ptr;            << 536   particle = p;
687 }                                                 537 }
688                                                   538 
689 //....oooOO0OOooo........oooOO0OOooo........oo    539 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
690                                                   540 
691 inline const G4ParticleDefinition* G4VEmProces << 541 inline void G4VEmProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
692 {                                                 542 {
693   return particle;                             << 543   secondaryParticle = p;
694 }                                                 544 }
695                                                   545 
696 //....oooOO0OOooo........oooOO0OOooo........oo    546 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
697                                                   547 
698 inline const G4ParticleDefinition* G4VEmProces << 548 inline size_t G4VEmProcess::CurrentMaterialCutsCoupleIndex() const 
699 {                                                 549 {
700   return secondaryParticle;                    << 550   return currentCoupleIndex;
701 }                                                 551 }
702                                                   552 
703 //....oooOO0OOooo........oooOO0OOooo........oo    553 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
704                                                   554 
705 inline void G4VEmProcess::SetCrossSectionType( << 555 inline G4double G4VEmProcess::GetGammaEnergyCut()
706 {                                                 556 {
707   fXSType = val;                               << 557   return (*theCutsGamma)[currentCoupleIndex];
708 }                                                 558 }
709                                                   559 
710 //....oooOO0OOooo........oooOO0OOooo........oo    560 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
711                                                   561 
712 inline G4CrossSectionType G4VEmProcess::CrossS << 562 inline G4double G4VEmProcess::GetElectronEnergyCut()
713 {                                                 563 {
714   return fXSType;                              << 564   return (*theCutsElectron)[currentCoupleIndex];
715 }                                                 565 }
716                                                   566 
717 //....oooOO0OOooo........oooOO0OOooo........oo    567 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
718                                                   568 
719 inline void G4VEmProcess::SetBuildTableFlag(G4    569 inline void G4VEmProcess::SetBuildTableFlag(G4bool val)
720 {                                                 570 {
721   buildLambdaTable = val;                         571   buildLambdaTable = val;
722 }                                              << 572   if(!val) integral = false;
723                                                << 
724 //....oooOO0OOooo........oooOO0OOooo........oo << 
725                                                << 
726 inline G4ParticleChangeForGamma* G4VEmProcess: << 
727 {                                              << 
728   return &fParticleChange;                     << 
729 }                                              << 
730                                                << 
731 //....oooOO0OOooo........oooOO0OOooo........oo << 
732                                                << 
733 inline void G4VEmProcess::SetParticle(const G4 << 
734 {                                              << 
735   particle = p;                                << 
736   currentParticle = p;                         << 
737 }                                              << 
738                                                << 
739 //....oooOO0OOooo........oooOO0OOooo........oo << 
740                                                << 
741 inline void G4VEmProcess::SetSecondaryParticle << 
742 {                                              << 
743   secondaryParticle = p;                       << 
744 }                                                 573 }
745                                                   574 
746 //....oooOO0OOooo........oooOO0OOooo........oo    575 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
747                                                   576 
748 inline void G4VEmProcess::SetStartFromNullFlag    577 inline void G4VEmProcess::SetStartFromNullFlag(G4bool val)
749 {                                                 578 {
750   startFromNull = val;                            579   startFromNull = val;
751 }                                                 580 }
752                                                   581 
753 //....oooOO0OOooo........oooOO0OOooo........oo    582 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
754                                                   583 
755 inline void G4VEmProcess::SetSplineFlag(G4bool << 584 inline void G4VEmProcess::InitialiseStep(const G4Track& track)
756 {                                              << 
757   splineFlag = val;                            << 
758 }                                              << 
759                                                << 
760 //....oooOO0OOooo........oooOO0OOooo........oo << 
761                                                << 
762 inline G4int G4VEmProcess::DensityIndex(G4int  << 
763 {                                                 585 {
764   return (*theDensityIdx)[idx];                << 586   preStepKinEnergy = track.GetKineticEnergy();
                                                   >> 587   DefineMaterial(track.GetMaterialCutsCouple());
                                                   >> 588   SelectModel(preStepKinEnergy, currentCoupleIndex);
                                                   >> 589   if (theNumberOfInteractionLengthLeft < 0.0) mfpKinEnergy = DBL_MAX;
765 }                                                 590 }
766                                                   591 
767 //....oooOO0OOooo........oooOO0OOooo........oo    592 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
768                                                   593 
769 inline G4double G4VEmProcess::DensityFactor(G4 << 594 inline void G4VEmProcess::DefineMaterial(const G4MaterialCutsCouple* couple)
770 {                                              << 
771   return (*theDensityFactor)[idx];             << 
772 }                                              << 
773                                                << 
774 //....oooOO0OOooo........oooOO0OOooo........oo << 
775                                                << 
776 inline G4bool G4VEmProcess::UseBaseMaterial()  << 
777 {                                                 595 {
778   return baseMat;                              << 596   if(couple != currentCouple) {
                                                   >> 597     currentCouple   = couple;
                                                   >> 598     currentMaterial = couple->GetMaterial();
                                                   >> 599     currentCoupleIndex = couple->GetIndex();
                                                   >> 600     mfpKinEnergy = DBL_MAX;
                                                   >> 601   }
779 }                                                 602 }
780                                                   603 
781 //....oooOO0OOooo........oooOO0OOooo........oo    604 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
782                                                   605 
783 inline const G4VEmModel* G4VEmProcess::GetCurr << 606 inline void G4VEmProcess::ComputeIntegralLambda(G4double e)
784 {                                                 607 {
785   return currentModel;                         << 608   mfpKinEnergy  = theEnergyOfCrossSectionMax[currentCoupleIndex];
786 }                                              << 609   if (e <= mfpKinEnergy) {
787                                                << 610     preStepLambda = GetLambdaFromTable(e);
788 //....oooOO0OOooo........oooOO0OOooo........oo << 611 
789                                                << 612   } else {
790 inline void G4VEmProcess::SetEmMasterProcess(c << 613     G4double e1 = e*lambdaFactor;
791 {                                              << 614     if(e1 > mfpKinEnergy) {
792   masterProc = ptr;                            << 615       preStepLambda  = GetLambdaFromTable(e);
                                                   >> 616       G4double preStepLambda1 = GetLambdaFromTable(e1);
                                                   >> 617       if(preStepLambda1 > preStepLambda) {
                                                   >> 618         mfpKinEnergy = e1;
                                                   >> 619         preStepLambda = preStepLambda1;
                                                   >> 620       }
                                                   >> 621     } else {
                                                   >> 622       preStepLambda = theCrossSectionMax[currentCoupleIndex];
                                                   >> 623     }
                                                   >> 624   }
793 }                                                 625 }
794                                                   626 
795 //....oooOO0OOooo........oooOO0OOooo........oo    627 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
796                                                   628 
797 inline G4int G4VEmProcess::NumberOfModels() co << 629 inline G4double G4VEmProcess::GetLambdaFromTable(G4double e)
798 {                                                 630 {
799   return numberOfModels;                       << 631   return (((*theLambdaTable)[currentCoupleIndex])->Value(e));
800 }                                                 632 }
801                                                   633 
802 //....oooOO0OOooo........oooOO0OOooo........oo    634 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
803                                                   635 
804 inline G4VEmModel* G4VEmProcess::EmModel(std:: << 636 inline G4double G4VEmProcess::GetCurrentLambda(G4double e)
805 {                                                 637 {
806   return (index < emModels.size()) ? emModels[ << 638   G4double x = 0.0;
                                                   >> 639   if(theLambdaTable) { x = GetLambdaFromTable(e); }
                                                   >> 640   else               { x = ComputeCurrentLambda(e); }
                                                   >> 641   return x;
807 }                                                 642 }
808                                                   643 
809 //....oooOO0OOooo........oooOO0OOooo........oo    644 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
810                                                   645 
811 inline G4VEmModel* G4VEmProcess::GetModelByInd << 646 inline G4double G4VEmProcess::ComputeCurrentLambda(G4double e)
812 {                                                 647 {
813   return modelManager->GetModel(idx, ver);     << 648   SelectModel(e, currentCoupleIndex);
                                                   >> 649   return currentModel->CrossSectionPerVolume(currentMaterial,particle,
                                                   >> 650                e,(*theCuts)[currentCoupleIndex]);
814 }                                                 651 }
815                                                   652 
816 //....oooOO0OOooo........oooOO0OOooo........oo    653 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
817                                                   654 
818 #endif                                            655 #endif
819                                                   656