Geant4 Cross Reference

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


  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: G4VEmModel.hh,v 1.59 2008/11/13 19:29:41 vnivanch Exp $
                                                   >>  27 // GEANT4 tag $Name: geant4-09-02 $
                                                   >>  28 //
 26 // -------------------------------------------     29 // -------------------------------------------------------------------
 27 //                                                 30 //
 28 // GEANT4 Class header file                        31 // GEANT4 Class header file
 29 //                                                 32 //
 30 //                                                 33 //
 31 // File name:     G4VEmModel                       34 // File name:     G4VEmModel
 32 //                                                 35 //
 33 // Author:        Vladimir Ivanchenko              36 // Author:        Vladimir Ivanchenko
 34 //                                                 37 //
 35 // Creation date: 03.01.2002                       38 // Creation date: 03.01.2002
 36 //                                                 39 //
 37 // Modifications:                                  40 // Modifications:
 38 //                                                 41 //
 39 // 23-12-02 V.Ivanchenko change interface befo     42 // 23-12-02 V.Ivanchenko change interface before move to cut per region
 40 // 24-01-03 Cut per region (V.Ivanchenko)          43 // 24-01-03 Cut per region (V.Ivanchenko)
 41 // 13-02-03 Add name (V.Ivanchenko)                44 // 13-02-03 Add name (V.Ivanchenko)
 42 // 25-02-03 Add sample theta and displacement      45 // 25-02-03 Add sample theta and displacement (V.Ivanchenko)
 43 // 23-07-03 Replace G4Material by G4MaterialCu     46 // 23-07-03 Replace G4Material by G4MaterialCutCouple in dE/dx and CrossSection
 44 //          calculation (V.Ivanchenko)             47 //          calculation (V.Ivanchenko)
 45 // 01-03-04 L.Urban signature changed in Sampl     48 // 01-03-04 L.Urban signature changed in SampleCosineTheta 
 46 // 23-04-04 L.urban signature of SampleCosineT     49 // 23-04-04 L.urban signature of SampleCosineTheta changed back 
 47 // 17-11-04 Add method CrossSectionPerAtom (V.     50 // 17-11-04 Add method CrossSectionPerAtom (V.Ivanchenko)
 48 // 14-03-05 Reduce number of pure virtual meth     51 // 14-03-05 Reduce number of pure virtual methods and make inline part 
 49 //          separate (V.Ivanchenko)                52 //          separate (V.Ivanchenko)
 50 // 24-03-05 Remove IsInCharge and add G4VParti     53 // 24-03-05 Remove IsInCharge and add G4VParticleChange in the constructor (VI)
 51 // 08-04-05 Major optimisation of internal int     54 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
 52 // 15-04-05 optimize internal interface for ms     55 // 15-04-05 optimize internal interface for msc (V.Ivanchenko)
 53 // 08-05-05 A -> N (V.Ivanchenko)                  56 // 08-05-05 A -> N (V.Ivanchenko)
 54 // 25-07-05 Move constructor and destructor to     57 // 25-07-05 Move constructor and destructor to the body (V.Ivanchenko)
 55 // 02-02-06 ComputeCrossSectionPerAtom: defaul     58 // 02-02-06 ComputeCrossSectionPerAtom: default value A=0. (mma)
 56 // 06-02-06 add method ComputeMeanFreePath() (     59 // 06-02-06 add method ComputeMeanFreePath() (mma)
 57 // 07-03-06 Optimize msc methods (V.Ivanchenko     60 // 07-03-06 Optimize msc methods (V.Ivanchenko)
 58 // 29-06-06 Add member currentElement and Get/     61 // 29-06-06 Add member currentElement and Get/Set methods (V.Ivanchenko)
 59 // 29-10-07 Added SampleScattering (V.Ivanchen     62 // 29-10-07 Added SampleScattering (V.Ivanchenko)
 60 // 15-07-08 Reorder class members and improve      63 // 15-07-08 Reorder class members and improve comments (VI)
 61 // 21-07-08 Added vector of G4ElementSelector      64 // 21-07-08 Added vector of G4ElementSelector and methods to use it (VI)
 62 // 12-09-08 Added methods GetParticleCharge, G     65 // 12-09-08 Added methods GetParticleCharge, GetChargeSquareRatio, 
 63 //          CorrectionsAlongStep, ActivateNucl     66 //          CorrectionsAlongStep, ActivateNuclearStopping (VI)
 64 // 16-02-09 Moved implementations of virtual m << 
 65 // 07-04-09 Moved msc methods from G4VEmModel  << 
 66 // 13-10-10 Added G4VEmAngularDistribution (VI << 
 67 //                                                 67 //
 68 // Class Description:                              68 // Class Description:
 69 //                                                 69 //
 70 // Abstract interface to energy loss models        70 // Abstract interface to energy loss models
 71                                                    71 
 72 // -------------------------------------------     72 // -------------------------------------------------------------------
 73 //                                                 73 //
 74                                                    74 
 75 #ifndef G4VEmModel_h                               75 #ifndef G4VEmModel_h
 76 #define G4VEmModel_h 1                             76 #define G4VEmModel_h 1
 77                                                    77 
 78 #include "globals.hh"                              78 #include "globals.hh"
 79 #include "G4DynamicParticle.hh"                    79 #include "G4DynamicParticle.hh"
 80 #include "G4ParticleDefinition.hh"                 80 #include "G4ParticleDefinition.hh"
 81 #include "G4MaterialCutsCouple.hh"                 81 #include "G4MaterialCutsCouple.hh"
 82 #include "G4Material.hh"                           82 #include "G4Material.hh"
 83 #include "G4Element.hh"                            83 #include "G4Element.hh"
 84 #include "G4ElementVector.hh"                      84 #include "G4ElementVector.hh"
 85 #include "G4Isotope.hh"                        << 
 86 #include "G4DataVector.hh"                         85 #include "G4DataVector.hh"
 87 #include "G4VEmFluctuationModel.hh"                86 #include "G4VEmFluctuationModel.hh"
 88 #include "G4VEmAngularDistribution.hh"         << 
 89 #include "G4EmElementSelector.hh"                  87 #include "G4EmElementSelector.hh"
 90 #include <CLHEP/Random/RandomEngine.h>         <<  88 #include "Randomize.hh"
 91 #include <vector>                                  89 #include <vector>
 92                                                    90 
 93 class G4ElementData;                           << 
 94 class G4PhysicsTable;                              91 class G4PhysicsTable;
 95 class G4Region;                                    92 class G4Region;
 96 class G4VParticleChange;                           93 class G4VParticleChange;
 97 class G4ParticleChangeForLoss;                 << 
 98 class G4ParticleChangeForGamma;                << 
 99 class G4Track;                                     94 class G4Track;
100 class G4LossTableManager;                      << 
101                                                    95 
102 class G4VEmModel                                   96 class G4VEmModel
103 {                                                  97 {
104                                                    98 
105 public:                                            99 public:
106                                                   100 
107   explicit G4VEmModel(const G4String& nam);    << 101   G4VEmModel(const G4String& nam);
108                                                   102 
109   virtual ~G4VEmModel();                          103   virtual ~G4VEmModel();
110                                                   104 
111   //------------------------------------------    105   //------------------------------------------------------------------------
112   // Virtual methods to be implemented for any    106   // Virtual methods to be implemented for any concrete model
113   //------------------------------------------    107   //------------------------------------------------------------------------
114                                                   108 
115   virtual void Initialise(const G4ParticleDefi << 109   virtual void Initialise(const G4ParticleDefinition*, 
                                                   >> 110         const G4DataVector&) = 0;
116                                                   111 
117   virtual void SampleSecondaries(std::vector<G    112   virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
118                                  const G4Mater << 113          const G4MaterialCutsCouple*,
119                                  const G4Dynam << 114          const G4DynamicParticle*,
120                                  G4double tmin << 115          G4double tmin = 0.0,
121                                  G4double tmax << 116          G4double tmax = DBL_MAX) = 0;
122                                                << 
123   //------------------------------------------ << 
124   // Methods for initialisation of MT; may be  << 
125   //------------------------------------------ << 
126                                                << 
127   // initialisation in local thread            << 
128   virtual void InitialiseLocal(const G4Particl << 
129                                G4VEmModel* mas << 
130                                                << 
131   // initialisation of a new material at run t << 
132   virtual void InitialiseForMaterial(const G4P << 
133                                      const G4M << 
134                                                << 
135   // initialisation of a new element at run ti << 
136   virtual void InitialiseForElement(const G4Pa << 
137                                     G4int Z);  << 
138                                                   117 
139   //------------------------------------------    118   //------------------------------------------------------------------------
140   // Methods with standard implementation; may    119   // Methods with standard implementation; may be overwritten if needed 
141   //------------------------------------------    120   //------------------------------------------------------------------------
142                                                   121 
                                                   >> 122   // dEdx per unit length
                                                   >> 123   virtual G4double ComputeDEDX(const G4MaterialCutsCouple*,
                                                   >> 124              const G4ParticleDefinition*,
                                                   >> 125              G4double kineticEnergy,
                                                   >> 126              G4double cutEnergy = DBL_MAX);
                                                   >> 127 
143   // main method to compute dEdx                  128   // main method to compute dEdx
144   virtual G4double ComputeDEDXPerVolume(const     129   virtual G4double ComputeDEDXPerVolume(const G4Material*,
145                                         const  << 130           const G4ParticleDefinition*,
146                                         G4doub << 131           G4double kineticEnergy,
147                                         G4doub << 132           G4double cutEnergy = DBL_MAX);
                                                   >> 133 
                                                   >> 134   // cross section per volume
                                                   >> 135   virtual G4double CrossSection(const G4MaterialCutsCouple*,
                                                   >> 136         const G4ParticleDefinition*,
                                                   >> 137         G4double kineticEnergy,
                                                   >> 138         G4double cutEnergy = 0.0,
                                                   >> 139         G4double maxEnergy = DBL_MAX);
148                                                   140 
149   // main method to compute cross section per     141   // main method to compute cross section per Volume
150   virtual G4double CrossSectionPerVolume(const    142   virtual G4double CrossSectionPerVolume(const G4Material*,
151                                          const << 143            const G4ParticleDefinition*,
152                                          G4dou << 144            G4double kineticEnergy,
153                                          G4dou << 145            G4double cutEnergy = 0.0,
154                                          G4dou << 146            G4double maxEnergy = DBL_MAX);
155                                                << 
156   // method to get partial cross section       << 
157   virtual G4double GetPartialCrossSection(cons << 
158                                           G4in << 
159                                           cons << 
160                                           G4do << 
161                                                   147 
162   // main method to compute cross section per  << 148   // main method to compute cross section depending on atom
163   virtual G4double ComputeCrossSectionPerAtom(    149   virtual G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
164                                                << 150                 G4double kinEnergy, 
165                                                << 151                 G4double Z, 
166                                                << 152                 G4double A = 0., /* amu */
167                                                << 153                 G4double cutEnergy = 0.0,
168                                                << 154                 G4double maxEnergy = DBL_MAX);
169                                                << 155                            
170   // main method to compute cross section per  << 156   // min cut in kinetic energy allowed by the model
171   virtual G4double ComputeCrossSectionPerShell << 157   virtual G4double MinEnergyCut(const G4ParticleDefinition*,
172                                                << 158         const G4MaterialCutsCouple*);
173                                                << 
174                                                << 
175                                                << 
176                                                << 
177   // Compute effective ion charge square       << 
178   virtual G4double ChargeSquareRatio(const G4T << 
179                                                   159 
180   // Compute effective ion charge square          160   // Compute effective ion charge square
181   virtual G4double GetChargeSquareRatio(const     161   virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*,
182                                         const  << 162           const G4Material*,
183                                         G4doub << 163           G4double kineticEnergy);
184                                                   164 
185   // Compute ion charge                           165   // Compute ion charge 
186   virtual G4double GetParticleCharge(const G4P    166   virtual G4double GetParticleCharge(const G4ParticleDefinition*,
187                                      const G4M << 167              const G4Material*,
188                                      G4double  << 168              G4double kineticEnergy);
189                                                   169 
190   // Initialisation for a new track            << 170   // add correction to energy loss and ompute non-ionizing energy loss
191   virtual void StartTracking(G4Track*);        << 
192                                                << 
193   // add correction to energy loss and compute << 
194   virtual void CorrectionsAlongStep(const G4Ma    171   virtual void CorrectionsAlongStep(const G4MaterialCutsCouple*,
195                                     const G4Dy << 172             const G4DynamicParticle*,
196                                     const G4do << 173             G4double& eloss,
197                                     G4double&  << 174             G4double& niel,
198                                                << 175             G4double length);
199   // value which may be tabulated (by default  << 
200   virtual G4double Value(const G4MaterialCutsC << 
201                          const G4ParticleDefin << 
202                          G4double kineticEnerg << 
203                                                << 
204   // threshold for zero value                  << 
205   virtual G4double MinPrimaryEnergy(const G4Ma << 
206                                     const G4Pa << 
207                                     G4double c << 
208                                                << 
209   // model can define low-energy limit for the << 
210   virtual G4double MinEnergyCut(const G4Partic << 
211                                 const G4Materi << 
212                                                   176 
213   // initialisation at run time for a given ma << 177 protected:
214   virtual void SetupForMaterial(const G4Partic << 
215                                 const G4Materi << 
216                                 G4double kinet << 
217                                                   178 
218   // add a region for the model                << 179   // kinematically allowed max kinetic energy of a secondary
219   virtual void DefineForRegion(const G4Region* << 180   virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
                                                   >> 181               G4double kineticEnergy);  
                                                   >> 182                   
                                                   >> 183   //------------------------------------------------------------------------
                                                   >> 184   // Methods for msc simulation which needs to be overwritten 
                                                   >> 185   //------------------------------------------------------------------------
220                                                   186 
221   // fill number of different type of secondar << 187 public:
222   virtual void FillNumberOfSecondaries(G4int&  << 
223                                        G4int&  << 
224                                                   188 
225   // for automatic documentation               << 189   virtual void SampleScattering(const G4DynamicParticle*,
226   virtual void ModelDescription(std::ostream&  << 190         G4double safety);
227                                                   191 
228 protected:                                     << 192   virtual G4double ComputeTruePathLengthLimit(const G4Track& track, 
                                                   >> 193                 G4PhysicsTable* theLambdaTable, 
                                                   >> 194                 G4double currentMinimalStep);
229                                                   195 
230   // initialisation of the ParticleChange for  << 196   virtual G4double ComputeGeomPathLength(G4double truePathLength);
231   G4ParticleChangeForLoss* GetParticleChangeFo << 
232                                                   197 
233   // initialisation of the ParticleChange for  << 198   virtual G4double ComputeTrueStepLength(G4double geomPathLength);
234   G4ParticleChangeForGamma* GetParticleChangeF << 
235                                                   199 
236   // kinematically allowed max kinetic energy  << 200   virtual void DefineForRegion(const G4Region*);
237   virtual G4double MaxSecondaryEnergy(const G4 << 
238                                       G4double << 
239                                                   201 
240 public:                                        << 202   virtual void SetupForMaterial(const G4ParticleDefinition*,
                                                   >> 203         const G4Material*,
                                                   >> 204                                 G4double kineticEnergy);
241                                                   205 
242   //------------------------------------------    206   //------------------------------------------------------------------------
243   // Generic methods common to all models         207   // Generic methods common to all models
244   //------------------------------------------    208   //------------------------------------------------------------------------
245                                                   209 
246   // should be called at initialisation to bui    210   // should be called at initialisation to build element selectors
247   void InitialiseElementSelectors(const G4Part << 211   void InitialiseElementSelectors(const G4ParticleDefinition*, 
248                                   const G4Data << 212           const G4DataVector&);
249                                                << 
250   // should be called at initialisation to acc << 
251   inline std::vector<G4EmElementSelector*>* Ge << 
252                                                << 
253   // should be called at initialisation to set << 
254   inline void SetElementSelectors(std::vector< << 
255                                                << 
256   // dEdx per unit length, base material appro << 
257   inline G4double ComputeDEDX( const G4Materia << 
258                                const G4Particl << 
259                                G4double kineti << 
260                                G4double cutEne << 
261                                                << 
262   // cross section per volume, base material a << 
263   inline G4double CrossSection(const G4Materia << 
264                                const G4Particl << 
265                                G4double kineti << 
266                                G4double cutEne << 
267                                G4double maxEne << 
268                                                   213 
269   // compute mean free path via cross section     214   // compute mean free path via cross section per volume
270   inline G4double ComputeMeanFreePath(const G4 << 215   G4double ComputeMeanFreePath(const G4ParticleDefinition*,
271                                       G4double << 216              G4double kineticEnergy,
272                                       const G4 << 217              const G4Material*,    
273                                       G4double << 218              G4double cutEnergy = 0.0,
274                                       G4double << 219              G4double maxEnergy = DBL_MAX);
275                                                   220 
276   // generic cross section per element            221   // generic cross section per element
277   inline G4double ComputeCrossSectionPerAtom(c    222   inline G4double ComputeCrossSectionPerAtom(const G4ParticleDefinition*,
278                                              c    223                                              const G4Element*,
279                                              G << 224                G4double kinEnergy, 
280                                              G << 225                G4double cutEnergy = 0.0,
281                                              G << 226                G4double maxEnergy = DBL_MAX);
282                                                   227 
283   // atom can be selected effitiantly if eleme    228   // atom can be selected effitiantly if element selectors are initialised 
284   inline const G4Element* SelectRandomAtom(con    229   inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*,
285                                            con << 230              const G4ParticleDefinition*,
286                                            G4d << 231              G4double kineticEnergy,
287                                            G4d << 232              G4double cutEnergy = 0.0,
288                                            G4d << 233              G4double maxEnergy = DBL_MAX);
289   // same as SelectRandomAtom above but more e << 234 
290   inline const G4Element* SelectTargetAtom(con << 235   // this method can be used only in the case if generic method to compute
291                                            con << 236   // cross section per volume is used and not overwritten in derived class 
292                                            G4d << 237   inline const G4Element* SelectRandomAtom(const G4Material*,
293                                            G4d << 238              const G4ParticleDefinition*,
294                                            G4d << 239              G4double kineticEnergy,
295                                            G4d << 240              G4double cutEnergy = 0.0,
296                                                << 241              G4double maxEnergy = DBL_MAX);
297   // to select atom cross section per volume i << 
298   const G4Element* SelectRandomAtom(const G4Ma << 
299                                     const G4Pa << 
300                                     G4double k << 
301                                     G4double c << 
302                                     G4double m << 
303                                                << 
304   // to select atom if cross section is propor << 
305   const G4Element* GetCurrentElement(const G4M << 
306   G4int SelectRandomAtomNumber(const G4Materia << 
307                                                   242 
308   // select isotope in order to have precise m    243   // select isotope in order to have precise mass of the nucleus
309   const G4Isotope* GetCurrentIsotope(const G4E << 244   inline G4int SelectIsotopeNumber(const G4Element*);
310   G4int SelectIsotopeNumber(const G4Element*)  << 
311                                                   245 
312   //------------------------------------------    246   //------------------------------------------------------------------------
313   // Get/Set methods                              247   // Get/Set methods
314   //------------------------------------------    248   //------------------------------------------------------------------------
315                                                   249 
316   void SetParticleChange(G4VParticleChange*, G << 
317                                                << 
318   void SetCrossSectionTable(G4PhysicsTable*, G << 
319                                                << 
320   inline G4ElementData* GetElementData();      << 
321                                                << 
322   inline G4PhysicsTable* GetCrossSectionTable( << 
323                                                << 
324   inline G4VEmFluctuationModel* GetModelOfFluc    250   inline G4VEmFluctuationModel* GetModelOfFluctuations();
325                                                   251 
326   inline G4VEmAngularDistribution* GetAngularD << 
327                                                << 
328   inline G4VEmModel* GetTripletModel();        << 
329                                                << 
330   inline void SetTripletModel(G4VEmModel*);    << 
331                                                << 
332   inline void SetAngularDistribution(G4VEmAngu << 
333                                                << 
334   inline G4double HighEnergyLimit() const;        252   inline G4double HighEnergyLimit() const;
335                                                   253 
336   inline G4double LowEnergyLimit() const;         254   inline G4double LowEnergyLimit() const;
337                                                   255 
338   inline G4double HighEnergyActivationLimit()  << 
339                                                << 
340   inline G4double LowEnergyActivationLimit() c << 
341                                                << 
342   inline G4double PolarAngleLimit() const;        256   inline G4double PolarAngleLimit() const;
343                                                   257 
344   inline G4double SecondaryThreshold() const;     258   inline G4double SecondaryThreshold() const;
345                                                   259 
346   inline G4bool DeexcitationFlag() const;      << 260   inline G4bool LPMFlag() const;
347                                                << 
348   inline G4bool ForceBuildTableFlag() const;   << 
349                                                << 
350   inline G4bool UseAngularGeneratorFlag() cons << 
351                                                << 
352   inline void SetAngularGeneratorFlag(G4bool); << 
353                                                   261 
354   inline void SetHighEnergyLimit(G4double);       262   inline void SetHighEnergyLimit(G4double);
355                                                   263 
356   inline void SetLowEnergyLimit(G4double);        264   inline void SetLowEnergyLimit(G4double);
357                                                   265 
358   inline void SetActivationHighEnergyLimit(G4d << 
359                                                << 
360   inline void SetActivationLowEnergyLimit(G4do << 
361                                                << 
362   inline G4bool IsActive(G4double kinEnergy) c << 
363                                                << 
364   inline void SetPolarAngleLimit(G4double);       266   inline void SetPolarAngleLimit(G4double);
365                                                   267 
366   inline void SetSecondaryThreshold(G4double);    268   inline void SetSecondaryThreshold(G4double);
367                                                   269 
368   inline void SetDeexcitationFlag(G4bool val); << 270   inline void SetLPMFlag(G4bool val);
369                                                << 
370   inline void SetForceBuildTable(G4bool val);  << 
371                                                << 
372   inline void SetFluctuationFlag(G4bool val);  << 
373                                                << 
374   inline G4bool IsMaster() const;              << 
375                                                << 
376   inline void SetUseBaseMaterials(G4bool val); << 
377                                                   271 
378   inline G4bool UseBaseMaterials() const;      << 272   inline void ActivateNuclearStopping(G4bool);
379                                                   273 
380   inline G4double MaxSecondaryKinEnergy(const     274   inline G4double MaxSecondaryKinEnergy(const G4DynamicParticle* dynParticle);
381                                                   275 
382   inline const G4String& GetName() const;         276   inline const G4String& GetName() const;
383                                                   277 
384   inline void SetCurrentCouple(const G4Materia << 278   inline void SetParticleChange(G4VParticleChange*, G4VEmFluctuationModel*);
385                                                << 
386   inline G4bool IsLocked() const;              << 
387                                                << 
388   inline void SetLocked(G4bool);               << 
389                                                << 
390   // obsolete methods                          << 
391   [[deprecated("Use G4EmParameters::Instance() << 
392   void SetLPMFlag(G4bool);                     << 
393                                                << 
394   void SetMasterThread(G4bool);                << 
395                                                << 
396   //  hide assignment operator                 << 
397   G4VEmModel & operator=(const  G4VEmModel &ri << 
398   G4VEmModel(const  G4VEmModel&) = delete;     << 
399                                                   279 
400 protected:                                        280 protected:
401                                                   281 
402   inline const G4MaterialCutsCouple* CurrentCo << 282   inline const G4Element* GetCurrentElement() const;
403                                                   283 
404   inline void SetCurrentElement(const G4Elemen    284   inline void SetCurrentElement(const G4Element*);
405                                                   285 
406 private:                                          286 private:
407                                                   287 
408   // ======== Parameters of the class fixed at << 288   //  hide assignment operator
409                                                << 289   G4VEmModel & operator=(const  G4VEmModel &right);
410   G4VEmFluctuationModel*      flucModel = null << 290   G4VEmModel(const  G4VEmModel&);
411   G4VEmAngularDistribution*   anglModel = null << 
412   G4VEmModel*                 fTripletModel =  << 
413   const G4MaterialCutsCouple* fCurrentCouple = << 
414   const G4Element*            fCurrentElement  << 
415   std::vector<G4EmElementSelector*>* elmSelect << 
416   G4LossTableManager*         fEmManager;      << 
417                                                << 
418 protected:                                     << 
419                                                   291 
420   G4ElementData*               fElementData =  << 292   // ======== Parameters of the class fixed at construction =========
421   G4VParticleChange*           pParticleChange << 
422   G4PhysicsTable*              xSectionTable = << 
423   const G4Material*            pBaseMaterial = << 
424   const std::vector<G4double>* theDensityFacto << 
425   const std::vector<G4int>*    theDensityIdx = << 
426                                                   293 
427   G4double inveplus;                           << 294   G4VEmFluctuationModel* fluc;
428   G4double pFactor = 1.0;                      << 295   const G4String   name;
429                                                   296 
430 private:                                       << 297   // ======== Parameters of the class fixed at initialisation =======
431                                                   298 
432   G4double lowLimit;                           << 299   G4double        lowLimit;
433   G4double highLimit;                          << 300   G4double        highLimit;
434   G4double eMinActive = 0.0;                   << 301   G4double        polarAngleLimit;
435   G4double eMaxActive = DBL_MAX;               << 302   G4double        secondaryThreshold;
436   G4double secondaryThreshold = DBL_MAX;       << 303   G4bool          theLPMflag;
437   G4double polarAngleLimit;                    << 
438                                                   304 
439   G4int nSelectors = 0;                        << 305   G4int           nSelectors;
440   G4int nsec = 5;                              << 306   std::vector<G4EmElementSelector*> elmSelectors;
441                                                   307 
442 protected:                                        308 protected:
443                                                   309 
444   std::size_t currentCoupleIndex = 0;          << 310   G4VParticleChange*  pParticleChange;
445   std::size_t basedCoupleIndex = 0;            << 311   G4bool              nuclearStopping;
446   G4bool lossFlucFlag = true;                  << 
447                                                   312 
448 private:                                       << 313   // ======== Cashed values - may be state dependent ================
449                                                   314 
450   G4bool flagDeexcitation = false;             << 315 private:
451   G4bool flagForceBuildTable = false;          << 
452   G4bool isMaster = true;                      << 
453                                                << 
454   G4bool localTable = true;                    << 
455   G4bool localElmSelectors = true;             << 
456   G4bool useAngularGenerator = false;          << 
457   G4bool useBaseMaterials = false;             << 
458   G4bool isLocked = false;                     << 
459                                                   316 
460   const G4String  name;                        << 317   const G4Element* currentElement;
                                                   >> 318   G4int                  nsec;
461   std::vector<G4double>  xsec;                    319   std::vector<G4double>  xsec;
462                                                   320 
463 };                                                321 };
464                                                   322 
465 // ======== Run time inline methods ========== << 323 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
466                                                << 324 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
467 inline void G4VEmModel::SetCurrentCouple(const << 
468 {                                              << 
469   if(fCurrentCouple != ptr) {                  << 
470     fCurrentCouple = ptr;                      << 
471     basedCoupleIndex = currentCoupleIndex = pt << 
472     pBaseMaterial = ptr->GetMaterial();        << 
473     pFactor = 1.0;                             << 
474     if(useBaseMaterials) {                     << 
475       basedCoupleIndex = (*theDensityIdx)[curr << 
476       if(nullptr != pBaseMaterial->GetBaseMate << 
477   pBaseMaterial = pBaseMaterial->GetBaseMateri << 
478       pFactor = (*theDensityFactor)[currentCou << 
479     }                                          << 
480   }                                            << 
481 }                                              << 
482                                                << 
483 //....oooOO0OOooo........oooOO0OOooo........oo << 
484                                                << 
485 inline const G4MaterialCutsCouple* G4VEmModel: << 
486 {                                              << 
487   return fCurrentCouple;                       << 
488 }                                              << 
489                                                << 
490 //....oooOO0OOooo........oooOO0OOooo........oo << 
491                                                   325 
492 inline void G4VEmModel::SetCurrentElement(cons << 326 inline G4double G4VEmModel::HighEnergyLimit() const
493 {                                              << 
494   fCurrentElement = elm;                       << 
495 }                                              << 
496                                                << 
497 //....oooOO0OOooo........oooOO0OOooo........oo << 
498                                                << 
499 inline                                         << 
500 G4double G4VEmModel::MaxSecondaryKinEnergy(con << 
501 {                                              << 
502   return MaxSecondaryEnergy(dynPart->GetPartic << 
503                             dynPart->GetKineti << 
504 }                                              << 
505                                                << 
506 //....oooOO0OOooo........oooOO0OOooo........oo << 
507                                                << 
508 inline G4double G4VEmModel::ComputeDEDX(const  << 
509                                         const  << 
510                                         G4doub << 
511                                         G4doub << 
512 {                                              << 
513   SetCurrentCouple(couple);                    << 
514   return pFactor*ComputeDEDXPerVolume(pBaseMat << 
515 }                                              << 
516                                                << 
517 //....oooOO0OOooo........oooOO0OOooo........oo << 
518                                                << 
519 inline G4double G4VEmModel::CrossSection(const << 
520                                          const << 
521                                          G4dou << 
522                                          G4dou << 
523                                          G4dou << 
524 {                                              << 
525   SetCurrentCouple(couple);                    << 
526   return pFactor*CrossSectionPerVolume(pBaseMa << 
527                                        cutEner << 
528 }                                              << 
529                                                << 
530 //....oooOO0OOooo........oooOO0OOooo........oo << 
531                                                << 
532 inline                                         << 
533 G4double G4VEmModel::ComputeMeanFreePath(const << 
534                                          G4dou << 
535                                          const << 
536                                          G4dou << 
537                                          G4dou << 
538 {                                                 327 {
539   G4double cross = CrossSectionPerVolume(mater << 328   return highLimit;
540   return (cross > 0.0) ? 1./cross : DBL_MAX;   << 
541 }                                                 329 }
542                                                   330 
543 //....oooOO0OOooo........oooOO0OOooo........oo << 331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
544                                                   332 
545 inline G4double                                << 333 inline G4double G4VEmModel::LowEnergyLimit() const
546 G4VEmModel::ComputeCrossSectionPerAtom(const G << 
547                                        const G << 
548                                        G4doubl << 
549                                        G4doubl << 
550                                        G4doubl << 
551 {                                                 334 {
552   fCurrentElement = elm;                       << 335   return lowLimit;
553   return ComputeCrossSectionPerAtom(part,kinEn << 
554                                     cutEnergy, << 
555 }                                              << 
556                                                << 
557 //....oooOO0OOooo........oooOO0OOooo........oo << 
558                                                << 
559 inline const G4Element*                        << 
560 G4VEmModel::SelectRandomAtom(const G4MaterialC << 
561                              const G4ParticleD << 
562                              G4double kinEnerg << 
563                              G4double cutEnerg << 
564                              G4double maxEnerg << 
565 {                                              << 
566   SetCurrentCouple(couple);                    << 
567   fCurrentElement = (nSelectors > 0) ?         << 
568     ((*elmSelectors)[couple->GetIndex()])->Sel << 
569     SelectRandomAtom(pBaseMaterial,part,kinEne << 
570   return fCurrentElement;                      << 
571 }                                              << 
572                                                << 
573 //....oooOO0OOooo........oooOO0OOooo........oo << 
574                                                << 
575 inline const G4Element*                        << 
576 G4VEmModel::SelectTargetAtom(const G4MaterialC << 
577                              const G4ParticleD << 
578                              G4double kinEnerg << 
579                              G4double logKinE, << 
580                              G4double cutEnerg << 
581                              G4double maxEnerg << 
582 {                                              << 
583   SetCurrentCouple(couple);                    << 
584   fCurrentElement = (nSelectors > 0)           << 
585    ? ((*elmSelectors)[couple->GetIndex()])->Se << 
586    : SelectRandomAtom(pBaseMaterial,part,kinEn << 
587   return fCurrentElement;                      << 
588 }                                                 336 }
589                                                   337 
590 // ======== Get/Set inline methods used at ini << 338 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
591                                                   339 
592 inline G4VEmFluctuationModel* G4VEmModel::GetM << 340 inline G4double G4VEmModel::PolarAngleLimit() const
593 {                                                 341 {
594   return flucModel;                            << 342   return polarAngleLimit;
595 }                                                 343 }
596                                                   344 
597 //....oooOO0OOooo........oooOO0OOooo........oo << 345 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
598                                                   346 
599 inline G4VEmAngularDistribution* G4VEmModel::G << 347 inline G4double G4VEmModel::SecondaryThreshold() const
600 {                                                 348 {
601   return anglModel;                            << 349   return secondaryThreshold;
602 }                                                 350 }
603                                                   351 
604 //....oooOO0OOooo........oooOO0OOooo........oo    352 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
605                                                   353 
606 inline void G4VEmModel::SetAngularDistribution << 354 inline G4bool G4VEmModel::LPMFlag() const 
607 {                                                 355 {
608   if(p != anglModel) {                         << 356   return theLPMflag;
609     delete anglModel;                          << 
610     anglModel = p;                             << 
611   }                                            << 
612 }                                                 357 }
613                                                   358 
614 //....oooOO0OOooo........oooOO0OOooo........oo << 359 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
615                                                   360 
616 inline G4VEmModel* G4VEmModel::GetTripletModel << 361 inline void G4VEmModel::SetHighEnergyLimit(G4double val)
617 {                                                 362 {
618   return fTripletModel;                        << 363   highLimit = val;
619 }                                                 364 }
620                                                   365 
621 //....oooOO0OOooo........oooOO0OOooo........oo << 366 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
622                                                   367 
623 inline void G4VEmModel::SetTripletModel(G4VEmM << 368 inline void G4VEmModel::SetLowEnergyLimit(G4double val)
624 {                                                 369 {
625   if(p != fTripletModel) {                     << 370   lowLimit = val;
626     delete fTripletModel;                      << 
627     fTripletModel = p;                         << 
628   }                                            << 
629 }                                                 371 }
630                                                   372 
631 //....oooOO0OOooo........oooOO0OOooo........oo << 373 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
632                                                   374 
633 inline G4double G4VEmModel::HighEnergyLimit()  << 375 inline void G4VEmModel::SetPolarAngleLimit(G4double val)
634 {                                                 376 {
635   return highLimit;                            << 377   polarAngleLimit = val;
636 }                                                 378 }
637                                                   379 
638 //....oooOO0OOooo........oooOO0OOooo........oo << 380 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
639                                                   381 
640 inline G4double G4VEmModel::LowEnergyLimit() c << 382 inline void G4VEmModel::SetSecondaryThreshold(G4double val) 
641 {                                                 383 {
642   return lowLimit;                             << 384   secondaryThreshold = val;
643 }                                                 385 }
644                                                   386 
645 //....oooOO0OOooo........oooOO0OOooo........oo    387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
646                                                   388 
647 inline G4double G4VEmModel::HighEnergyActivati << 389 inline void G4VEmModel::SetLPMFlag(G4bool val) 
648 {                                                 390 {
649   return eMaxActive;                           << 391   theLPMflag = val;
650 }                                                 392 }
651                                                   393 
652 //....oooOO0OOooo........oooOO0OOooo........oo    394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
653                                                   395 
654 inline G4double G4VEmModel::LowEnergyActivatio << 396 inline void G4VEmModel::ActivateNuclearStopping(G4bool val)
655 {                                                 397 {
656   return eMinActive;                           << 398   nuclearStopping = val;
657 }                                                 399 }
658                                                   400 
659 //....oooOO0OOooo........oooOO0OOooo........oo << 401 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
660                                                   402 
661 inline G4double G4VEmModel::PolarAngleLimit()  << 403 inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
                                                   >> 404     const G4ParticleDefinition* part,
                                                   >> 405     const G4Element* elm,
                                                   >> 406     G4double kinEnergy, 
                                                   >> 407     G4double cutEnergy,
                                                   >> 408     G4double maxEnergy)
662 {                                                 409 {
663   return polarAngleLimit;                      << 410   currentElement = elm;
                                                   >> 411   return ComputeCrossSectionPerAtom(part,kinEnergy,elm->GetZ(),elm->GetN(),
                                                   >> 412             cutEnergy,maxEnergy);
664 }                                                 413 }
665                                                   414 
666 //....oooOO0OOooo........oooOO0OOooo........oo << 415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
667                                                   416 
668 inline G4double G4VEmModel::SecondaryThreshold << 417 inline void G4VEmModel::SetParticleChange(G4VParticleChange* p,  
                                                   >> 418                                           G4VEmFluctuationModel* f = 0)
669 {                                                 419 {
670   return secondaryThreshold;                   << 420   if(p && pParticleChange != p) pParticleChange = p;
                                                   >> 421   fluc = f;
671 }                                                 422 }
672                                                   423 
673 //....oooOO0OOooo........oooOO0OOooo........oo << 424 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
674                                                << 
675 inline G4bool G4VEmModel::DeexcitationFlag() c << 
676 {                                              << 
677   return flagDeexcitation;                     << 
678 }                                              << 
679                                                   425 
680 //....oooOO0OOooo........oooOO0OOooo........oo << 
681                                                   426 
682 inline G4bool G4VEmModel::ForceBuildTableFlag( << 427 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
683 {                                                 428 {
684   return flagForceBuildTable;                  << 429   return fluc;
685 }                                                 430 }
686                                                   431 
687 //....oooOO0OOooo........oooOO0OOooo........oo << 432 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
688                                                   433 
689 inline G4bool G4VEmModel::UseAngularGeneratorF << 434 inline G4double G4VEmModel::MinEnergyCut(const G4ParticleDefinition*,
                                                   >> 435                                          const G4MaterialCutsCouple*)
690 {                                                 436 {
691   return useAngularGenerator;                  << 437   return 0.0;
692 }                                                 438 }
693                                                   439 
694 //....oooOO0OOooo........oooOO0OOooo........oo << 440 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
695                                                   441 
696 inline void G4VEmModel::SetAngularGeneratorFla << 442 inline G4double G4VEmModel::GetChargeSquareRatio(const G4ParticleDefinition* p,
                                                   >> 443              const G4Material*, G4double)
697 {                                                 444 {
698   useAngularGenerator = val;                   << 445   G4double q = p->GetPDGCharge()/CLHEP::eplus;
                                                   >> 446   return q*q;
699 }                                                 447 }
700                                                   448 
701 //....oooOO0OOooo........oooOO0OOooo........oo << 449 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
702                                                   450 
703 inline void G4VEmModel::SetFluctuationFlag(G4b << 451 inline G4double G4VEmModel::GetParticleCharge(const G4ParticleDefinition* p,
                                                   >> 452                 const G4Material*, G4double)
704 {                                                 453 {
705   lossFlucFlag = val;                          << 454   return p->GetPDGCharge();
706 }                                                 455 }
707                                                   456 
708 //....oooOO0OOooo........oooOO0OOooo........oo << 457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
709                                                   458 
710 inline G4bool G4VEmModel::IsMaster() const     << 459 inline void G4VEmModel::CorrectionsAlongStep(const G4MaterialCutsCouple*,
711 {                                              << 460                const G4DynamicParticle*,
712   return isMaster;                             << 461                G4double&,G4double&,G4double)
713 }                                              << 462 {}
714                                                   463 
715 //....oooOO0OOooo........oooOO0OOooo........oo << 464 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
716                                                   465 
717 inline void G4VEmModel::SetUseBaseMaterials(G4 << 466 inline G4double G4VEmModel::ComputeDEDXPerVolume(const G4Material*,
                                                   >> 467              const G4ParticleDefinition*,
                                                   >> 468              G4double,G4double)
718 {                                                 469 {
719   useBaseMaterials = val;                      << 470   return 0.0;
720 }                                                 471 }
721                                                   472 
722 //....oooOO0OOooo........oooOO0OOooo........oo << 473 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
723                                                   474 
724 inline G4bool G4VEmModel::UseBaseMaterials() c << 475 inline G4double G4VEmModel::ComputeDEDX(const G4MaterialCutsCouple* c,
                                                   >> 476                                         const G4ParticleDefinition* p,
                                                   >> 477           G4double kinEnergy,
                                                   >> 478           G4double cutEnergy)
725 {                                                 479 {
726   return useBaseMaterials;                     << 480   return ComputeDEDXPerVolume(c->GetMaterial(),p,kinEnergy,cutEnergy);
727 }                                                 481 }
728                                                   482 
729 //....oooOO0OOooo........oooOO0OOooo........oo << 483 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
730                                                   484 
731 inline void G4VEmModel::SetHighEnergyLimit(G4d << 485 inline G4double G4VEmModel::CrossSection(const G4MaterialCutsCouple* c,
                                                   >> 486                                          const G4ParticleDefinition* p,
                                                   >> 487            G4double kinEnergy,
                                                   >> 488            G4double cutEnergy,
                                                   >> 489            G4double maxEnergy)
732 {                                                 490 {
733   highLimit = val;                             << 491   return CrossSectionPerVolume(c->GetMaterial(),p,
                                                   >> 492              kinEnergy,cutEnergy,maxEnergy);
734 }                                                 493 }
735                                                   494 
736 //....oooOO0OOooo........oooOO0OOooo........oo << 495 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
737                                                   496 
738 inline void G4VEmModel::SetLowEnergyLimit(G4do << 497 inline G4double G4VEmModel::ComputeCrossSectionPerAtom(
                                                   >> 498                                          const G4ParticleDefinition*,
                                                   >> 499            G4double, G4double, G4double,
                                                   >> 500            G4double, G4double)
739 {                                                 501 {
740   lowLimit = val;                              << 502   return 0.0;
741 }                                                 503 }
742                                                   504 
743 //....oooOO0OOooo........oooOO0OOooo........oo << 505 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
744                                                   506 
745 inline void G4VEmModel::SetActivationHighEnerg << 507 inline 
746 {                                              << 508 const G4Element* G4VEmModel::SelectRandomAtom(const G4MaterialCutsCouple* couple,
747   eMaxActive = val;                            << 509                 const G4ParticleDefinition* p,
                                                   >> 510                 G4double kinEnergy,
                                                   >> 511                 G4double cutEnergy,
                                                   >> 512                 G4double maxEnergy)
                                                   >> 513 {
                                                   >> 514   if(nSelectors > 0) {
                                                   >> 515     currentElement = 
                                                   >> 516       elmSelectors[couple->GetIndex()]->SelectRandomAtom(kinEnergy);
                                                   >> 517   } else {
                                                   >> 518     currentElement = SelectRandomAtom(couple->GetMaterial(),p,kinEnergy,
                                                   >> 519               cutEnergy,maxEnergy);
                                                   >> 520   }
                                                   >> 521   return currentElement;
748 }                                                 522 }
749                                                   523 
750 //....oooOO0OOooo........oooOO0OOooo........oo << 524 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
751                                                   525 
752 inline void G4VEmModel::SetActivationLowEnergy << 526 inline 
753 {                                              << 527 const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
754   eMinActive = val;                            << 528                 const G4ParticleDefinition* pd,
                                                   >> 529                 G4double kinEnergy,
                                                   >> 530                 G4double tcut,
                                                   >> 531                 G4double tmax)
                                                   >> 532 {
                                                   >> 533   const G4ElementVector* theElementVector = material->GetElementVector();
                                                   >> 534   G4int n = material->GetNumberOfElements() - 1;
                                                   >> 535   currentElement = (*theElementVector)[n];
                                                   >> 536   if (n > 0) {
                                                   >> 537     G4double x = G4UniformRand()*
                                                   >> 538                  G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
                                                   >> 539     for(G4int i=0; i<n; i++) {
                                                   >> 540       if (x <= xsec[i]) {
                                                   >> 541   currentElement = (*theElementVector)[i];
                                                   >> 542   break;
                                                   >> 543       }
                                                   >> 544     }
                                                   >> 545   }
                                                   >> 546   return currentElement;
755 }                                                 547 }
756                                                   548 
757 //....oooOO0OOooo........oooOO0OOooo........oo << 549 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
758                                                   550 
759 inline G4bool G4VEmModel::IsActive(G4double ki << 551 inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
760 {                                                 552 {
761   return (kinEnergy >= eMinActive && kinEnergy << 553   G4int N = G4int(elm->GetN() + 0.5);
                                                   >> 554   G4int ni = elm->GetNumberOfIsotopes();
                                                   >> 555   if(ni > 0) {
                                                   >> 556     G4int idx = 0;
                                                   >> 557     if(ni > 1) {
                                                   >> 558       G4double* ab = currentElement->GetRelativeAbundanceVector();
                                                   >> 559       G4double x = G4UniformRand();
                                                   >> 560       for(; idx<ni; idx++) {
                                                   >> 561   x -= ab[idx];
                                                   >> 562   if (x <= 0.0) break;
                                                   >> 563       }
                                                   >> 564       if(idx >= ni) idx = ni - 1;
                                                   >> 565     }
                                                   >> 566     N = elm->GetIsotope(idx)->GetN();
                                                   >> 567   }
                                                   >> 568   return N;
762 }                                                 569 }
763                                                   570 
764 //....oooOO0OOooo........oooOO0OOooo........oo << 571 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
765                                                   572 
766 inline void G4VEmModel::SetPolarAngleLimit(G4d << 573 inline const G4Element* G4VEmModel::GetCurrentElement() const
767 {                                                 574 {
768   if(!isLocked) { polarAngleLimit = val; }     << 575   return currentElement;
769 }                                                 576 }
770                                                   577 
771 //....oooOO0OOooo........oooOO0OOooo........oo << 578 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
772                                                   579 
773 inline void G4VEmModel::SetSecondaryThreshold( << 580 inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
774 {                                                 581 {
775   secondaryThreshold = val;                    << 582   currentElement = elm;
776 }                                                 583 }
777                                                   584 
778 //....oooOO0OOooo........oooOO0OOooo........oo << 585 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
779                                                   586 
780 inline void G4VEmModel::SetDeexcitationFlag(G4 << 587 inline 
                                                   >> 588 G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
781 {                                                 589 {
782   flagDeexcitation = val;                      << 590   return MaxSecondaryEnergy(dynPart->GetDefinition(),
                                                   >> 591                             dynPart->GetKineticEnergy());
783 }                                                 592 }
784                                                   593 
785 //....oooOO0OOooo........oooOO0OOooo........oo << 594 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
786                                                   595 
787 inline void G4VEmModel::SetForceBuildTable(G4b << 596 inline G4double G4VEmModel::MaxSecondaryEnergy(const G4ParticleDefinition*,
                                                   >> 597                  G4double kineticEnergy)
788 {                                                 598 {
789   flagForceBuildTable = val;                   << 599   return kineticEnergy;
790 }                                                 600 }
791                                                   601 
792 //....oooOO0OOooo........oooOO0OOooo........oo << 602 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
793                                                   603 
794 inline const G4String& G4VEmModel::GetName() c    604 inline const G4String& G4VEmModel::GetName() const 
795 {                                                 605 {
796   return name;                                    606   return name;
797 }                                                 607 }
798                                                   608 
799 //....oooOO0OOooo........oooOO0OOooo........oo << 609 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
                                                   >> 610 // Methods for msc simulation
                                                   >> 611 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
800                                                   612 
801 inline std::vector<G4EmElementSelector*>* G4VE << 613 inline void G4VEmModel::SampleScattering(const G4DynamicParticle*, G4double)
802 {                                              << 614 {}
803   return elmSelectors;                         << 
804 }                                              << 
805                                                   615 
806 //....oooOO0OOooo........oooOO0OOooo........oo << 616 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
807                                                   617 
808 inline void                                    << 618 inline G4double G4VEmModel::ComputeTruePathLengthLimit(
809 G4VEmModel::SetElementSelectors(std::vector<G4 << 619                                 const G4Track&, 
                                                   >> 620         G4PhysicsTable*, 
                                                   >> 621         G4double)
810 {                                                 622 {
811   if(p != elmSelectors) {                      << 623   return DBL_MAX;
812     elmSelectors = p;                          << 
813     nSelectors = (nullptr != elmSelectors) ? G << 
814     localElmSelectors = false;                 << 
815   }                                            << 
816 }                                                 624 }
817                                                   625 
818 //....oooOO0OOooo........oooOO0OOooo........oo << 626 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
819                                                   627 
820 inline G4ElementData* G4VEmModel::GetElementDa << 628 inline G4double G4VEmModel::ComputeGeomPathLength(G4double truePathLength)
821 {                                                 629 {
822   return fElementData;                         << 630   return truePathLength;
823 }                                                 631 }
824                                                   632 
825 //....oooOO0OOooo........oooOO0OOooo........oo << 633 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
826                                                   634 
827 inline G4PhysicsTable* G4VEmModel::GetCrossSec << 635 inline G4double G4VEmModel::ComputeTrueStepLength(G4double geomPathLength)
828 {                                                 636 {
829   return xSectionTable;                        << 637   return geomPathLength;
830 }                                                 638 }
831                                                   639 
832 //....oooOO0OOooo........oooOO0OOooo........oo << 640 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
833                                                   641 
834 inline G4bool G4VEmModel::IsLocked() const     << 642 inline void G4VEmModel::DefineForRegion(const G4Region*) 
835 {                                              << 643 {}
836   return isLocked;                             << 
837 }                                              << 
838                                                   644 
839 //....oooOO0OOooo........oooOO0OOooo........oo << 645 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
840                                                   646 
841 inline void G4VEmModel::SetLocked(G4bool val)  << 647 inline void G4VEmModel::SetupForMaterial(const G4ParticleDefinition*,
842 {                                              << 648            const G4Material*, G4double)
843   isLocked = val;                              << 649 {}
844 }                                              << 
845                                                   650 
846 //....oooOO0OOooo........oooOO0OOooo........oo << 651 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
847                                                   652 
848 #endif                                            653 #endif
                                                   >> 654 
849                                                   655