Geant4 Cross Reference

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


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
                                                   >>  23 // $Id: G4VMultipleScattering.hh,v 1.27 2005/04/15 14:41:21 vnivanch Exp $
                                                   >>  24 // GEANT4 tag $Name: geant4-07-01 $
 26 //                                                 25 //
 27 // -------------------------------------------     26 // -------------------------------------------------------------------
 28 //                                                 27 //
 29 // GEANT4 Class header file                        28 // GEANT4 Class header file
 30 //                                                 29 //
 31 //                                                 30 //
 32 // File name:     G4VMultipleScattering            31 // File name:     G4VMultipleScattering
 33 //                                                 32 //
 34 // Author:        Vladimir Ivanchenko on base      33 // Author:        Vladimir Ivanchenko on base of Laszlo Urban code
 35 //                                                 34 //
 36 // Creation date: 12.03.2002                       35 // Creation date: 12.03.2002
 37 //                                                 36 //
 38 // Modifications:                                  37 // Modifications:
 39 //                                                 38 //
 40 // 16-07-03 Update GetRange interface (V.Ivanc     39 // 16-07-03 Update GetRange interface (V.Ivanchenko)
 41 // 26-11-03 bugfix in AlongStepDoIt (L.Urban)  <<  40 //
 42 // 25-05-04 add protection against case when r << 
 43 // 27-08-04 Add InitialiseForRun method (V.Iva << 
 44 // 08-11-04 Migration to new interface of Stor << 
 45 // 15-04-05 remove boundary flag (V.Ivanchenko << 
 46 // 07-10-05 error in a protection in GetContin << 
 47 // 27-10-05 introduce virtual function MscStep << 
 48 // 26-01-06 Rename GetRange -> GetRangeFromRes << 
 49 // 17-02-06 Save table of transport cross sect << 
 50 // 07-03-06 Move step limit calculation to mod << 
 51 // 13-05-06 Add method to access model by inde << 
 52 // 12-02-07 Add get/set skin (V.Ivanchenko)    << 
 53 // 27-10-07 Virtual functions moved to source  << 
 54 // 15-07-08 Reorder class members for further  << 
 55 // 07-04-09 Moved msc methods from G4VEmModel  << 
 56 //                                                 41 //
 57 // Class Description:                              42 // Class Description:
 58 //                                                 43 //
 59 // It is the generic process of multiple scatt     44 // It is the generic process of multiple scattering it includes common
 60 // part of calculations for all charged partic     45 // part of calculations for all charged particles
                                                   >>  46 //
                                                   >>  47 // 26-11-03 bugfix in AlongStepDoIt (L.Urban)
                                                   >>  48 // 25-05-04 add protection against case when range is less than steplimit (V.Ivanchenko)
                                                   >>  49 // 30-06-04 make destructor virtual (V.Ivanchenko)
                                                   >>  50 // 27-08-04 Add InitialiseForRun method (V.Ivanchneko)
                                                   >>  51 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
                                                   >>  52 // 15-04-05 optimize internal interfaces (V.Ivanchenko)
                                                   >>  53 // 15-04-05 remove boundary flag (V.Ivanchenko)
 61                                                    54 
 62 // -------------------------------------------     55 // -------------------------------------------------------------------
 63 //                                                 56 //
 64                                                    57 
 65 #ifndef G4VMultipleScattering_h                    58 #ifndef G4VMultipleScattering_h
 66 #define G4VMultipleScattering_h 1                  59 #define G4VMultipleScattering_h 1
 67                                                    60 
 68 #include "G4VContinuousDiscreteProcess.hh"         61 #include "G4VContinuousDiscreteProcess.hh"
                                                   >>  62 #include "G4LossTableManager.hh"
 69 #include "globals.hh"                              63 #include "globals.hh"
 70 #include "G4Material.hh"                           64 #include "G4Material.hh"
                                                   >>  65 #include "G4MaterialCutsCouple.hh"
 71 #include "G4ParticleChangeForMSC.hh"               66 #include "G4ParticleChangeForMSC.hh"
 72 #include "G4Track.hh"                              67 #include "G4Track.hh"
 73 #include "G4Step.hh"                               68 #include "G4Step.hh"
 74 #include "G4EmModelManager.hh"                     69 #include "G4EmModelManager.hh"
 75 #include "G4VMscModel.hh"                      <<  70 #include "G4VEmModel.hh"
 76 #include "G4EmParameters.hh"                   << 
 77 #include "G4MscStepLimitType.hh"               << 
 78                                                    71 
 79 class G4ParticleDefinition;                        72 class G4ParticleDefinition;
 80 class G4VEnergyLossProcess;                    <<  73 class G4DataVector;
 81 class G4LossTableManager;                      <<  74 class G4PhysicsTable;
 82 class G4SafetyHelper;                          <<  75 class G4PhysicsVector;
 83                                                    76 
 84 //....oooOO0OOooo........oooOO0OOooo........oo     77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 85                                                    78 
 86 class G4VMultipleScattering : public G4VContin     79 class G4VMultipleScattering : public G4VContinuousDiscreteProcess
 87 {                                                  80 {
 88 public:                                            81 public:
 89                                                    82 
 90   explicit G4VMultipleScattering(const G4Strin <<  83   G4VMultipleScattering(const G4String& name = "msc",
 91                                  G4ProcessType <<  84                               G4ProcessType type = fElectromagnetic);
 92                                                    85 
 93   ~G4VMultipleScattering() override;           <<  86   virtual ~G4VMultipleScattering();
 94                                                    87 
 95   //------------------------------------------     88   //------------------------------------------------------------------------
 96   // Virtual methods to be implemented for the     89   // Virtual methods to be implemented for the concrete model
 97   //------------------------------------------     90   //------------------------------------------------------------------------
 98                                                    91 
 99   void ProcessDescription(std::ostream& outFil <<  92   virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
                                                   >>  93     // True for all charged particles
100                                                    94 
101   virtual void InitialiseProcess(const G4Parti <<  95   virtual G4double TruePathLengthLimit(const G4Track& track,
                                                   >>  96                                              G4double& lambda,
                                                   >>  97                                              G4double currentMinimalStep) = 0;
102                                                    98 
103   // Print out of generic class parameters     <<  99   virtual void PrintInfo() = 0;
104   void StreamInfo(std::ostream& outFile, const << 
105                   G4bool rst = false) const;   << 
106                                                   100 
107 protected:                                        101 protected:
108                                                   102 
109   virtual void StreamProcessInfo(std::ostream& << 103   virtual void InitialiseProcess(const G4ParticleDefinition*) = 0;
110                                                   104 
                                                   >> 105   //------------------------------------------------------------------------
                                                   >> 106   // Methods with standard implementation; may be overwritten if needed
                                                   >> 107   //------------------------------------------------------------------------
111 public:                                           108 public:
112                                                   109 
                                                   >> 110   // Initialise for build of tables
                                                   >> 111   virtual void PreparePhysicsTable(const G4ParticleDefinition&);
                                                   >> 112   
                                                   >> 113   // Build physics table during initialisation
                                                   >> 114   virtual void BuildPhysicsTable(const G4ParticleDefinition&);
                                                   >> 115 
                                                   >> 116 
113   //------------------------------------------    117   //------------------------------------------------------------------------
114   // Generic methods common to all ContinuousD << 118   // Generic methods common to all models
115   //------------------------------------------    119   //------------------------------------------------------------------------
116                                                   120 
117   // Initialise for build of tables            << 121   G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
118   void PreparePhysicsTable(const G4ParticleDef << 
119                                                   122 
120   // Build physics table during initialisation << 123   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
121   void BuildPhysicsTable(const G4ParticleDefin << 124 
                                                   >> 125   // The function overloads the corresponding function of the base
                                                   >> 126   // class.It limits the step near to boundaries only
                                                   >> 127   // and invokes the method GetContinuousStepLimit at every step.
                                                   >> 128   G4double AlongStepGetPhysicalInteractionLength(
                                                   >> 129                                             const G4Track&,
                                                   >> 130                                                   G4double  previousStepSize,
                                                   >> 131                                                   G4double  currentMinimalStep,
                                                   >> 132                                                   G4double& currentSafety,
                                                   >> 133                                                   G4GPILSelection* selection);
                                                   >> 134 
                                                   >> 135   // Print out of generic class parameters
                                                   >> 136   void PrintInfoDefinition();
                                                   >> 137 
                                                   >> 138   void SetBinning(G4int nbins);
                                                   >> 139   G4int Binning() const;
                                                   >> 140     // Print out of the class parameters
                                                   >> 141 
                                                   >> 142   void SetMinKinEnergy(G4double e);
                                                   >> 143   G4double MinKinEnergy() const;
                                                   >> 144     // Print out of the class parameters
                                                   >> 145 
                                                   >> 146   void SetMaxKinEnergy(G4double e);
                                                   >> 147   G4double MaxKinEnergy() const;
                                                   >> 148 
                                                   >> 149   // Build empty Physics Vector
                                                   >> 150   G4PhysicsVector* PhysicsVector(const G4MaterialCutsCouple*);
122                                                   151 
123   // Store PhysicsTable in a file.                152   // Store PhysicsTable in a file.
124   // Return false in case of failure at I/O       153   // Return false in case of failure at I/O
125   G4bool StorePhysicsTable(const G4ParticleDef    154   G4bool StorePhysicsTable(const G4ParticleDefinition*,
126                            const G4String& dir    155                            const G4String& directory,
127                            G4bool ascii = fals << 156                                  G4bool ascii = false);
128                                                   157 
129   // Retrieve Physics from a file.                158   // Retrieve Physics from a file.
130   // (return true if the Physics Table can be     159   // (return true if the Physics Table can be build by using file)
131   // (return false if the process has no funct    160   // (return false if the process has no functionality or in case of failure)
132   // File name should is constructed as proces    161   // File name should is constructed as processName+particleName and the
133   // should be placed under the directory spec << 162   // should be placed under the directory specifed by the argument.
134   G4bool RetrievePhysicsTable(const G4Particle    163   G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
135                               const G4String&     164                               const G4String& directory,
136                               G4bool ascii) ov << 165                                     G4bool ascii);
137                                                << 
138   // This is called in the beginning of tracki << 
139   void StartTracking(G4Track*) override;       << 
140                                                << 
141   // The function overloads the corresponding  << 
142   // class.It limits the step near to boundari << 
143   // and invokes the method GetMscContinuousSt << 
144   G4double AlongStepGetPhysicalInteractionLeng << 
145                                         const  << 
146                                         G4doub << 
147                                         G4doub << 
148                                         G4doub << 
149                                         G4GPIL << 
150                                                << 
151   // The function overloads the corresponding  << 
152   // class.                                    << 
153   G4double PostStepGetPhysicalInteractionLengt << 
154                                       const G4 << 
155                                       G4double << 
156                                       G4ForceC << 
157                                                   166 
158   // Along step actions                        << 167   void AddEmModel(G4int, G4VEmModel*, const G4Region* region = 0);
159   G4VParticleChange* AlongStepDoIt(const G4Tra << 
160                                                   168 
161   // This method does not used for tracking, i    169   // This method does not used for tracking, it is intended only for tests
162   G4double ContinuousStepLimit(const G4Track&     170   G4double ContinuousStepLimit(const G4Track& track,
163                                G4double previo << 171                                      G4double previousStepSize,
164                                G4double curren << 172                                      G4double currentMinimalStep,
165                                G4double& curre << 173                                      G4double& currentSafety);
166                                                << 
167   // hide assignment operator                  << 
168   G4VMultipleScattering(G4VMultipleScattering  << 
169   G4VMultipleScattering & operator=(const G4VM << 
170                                                   174 
171   //------------------------------------------ << 175   G4bool LateralDisplasmentFlag() const;
172   // Specific methods to set, access, modify m << 176   void SetLateralDisplasmentFlag(G4bool val);
173   //------------------------------------------ << 177      // lateral displacement to be/not to be computed
174                                                   178 
175   // Select model in run time                  << 179   void SetBuildLambdaTable(G4bool val);
176   inline G4VEmModel* SelectModel(G4double kinE << 
177                                                   180 
178 public:                                        << 181   const G4PhysicsTable* LambdaTable() const;
179                                                   182 
180   // Add model for region, smaller value of or << 183   G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idxRegion) const;
181   // model will be selected for a given energy << 
182   void AddEmModel(G4int order, G4VMscModel*, c << 
183                                                << 
184   // Assign a model to a process local list, t << 
185   // the derived process should execute AddEmM << 
186   void SetEmModel(G4VMscModel*, G4int idx = 0) << 
187                                                << 
188   // return a model from the local list        << 
189   inline G4VMscModel* EmModel(size_t index = 0 << 
190                                                   184 
191   // Access to run time models                 << 185   // Define particle definition
192   inline G4int NumberOfModels() const;         << 186   const G4ParticleDefinition* Particle() const;
                                                   >> 187   void SetParticle(const G4ParticleDefinition*);
193                                                   188 
194   inline G4VMscModel* GetModelByIndex(G4int id << 189 protected:
195                                                   190 
196   //------------------------------------------ << 191   // This method is used for tracking, it returns mean free path value
197   // Get/Set parameters for simulation of mult << 192   G4double GetMeanFreePath(const G4Track& track,
198   //------------------------------------------ << 193                                  G4double,
                                                   >> 194                                  G4ForceCondition* condition);
199                                                   195 
200   inline G4bool LateralDisplasmentFlag() const << 196   G4double GetLambda(const G4ParticleDefinition* p, G4double& kineticEnergy);
201                                                << 
202   inline G4double Skin() const;                << 
203                                                << 
204   inline G4double RangeFactor() const;         << 
205                                                << 
206   inline G4double GeomFactor() const;          << 
207                                                << 
208   inline G4double PolarAngleLimit() const;     << 
209                                                << 
210   inline G4bool UseBaseMaterial() const;       << 
211                                                << 
212   inline G4MscStepLimitType StepLimitType() co << 
213   inline void SetStepLimitType(G4MscStepLimitT << 
214                                                   197 
215   inline G4double LowestKinEnergy() const;     << 198   // This method is used for tracking, it returns step limit
216   inline void SetLowestKinEnergy(G4double val) << 199   G4double GetContinuousStepLimit(const G4Track& track,
                                                   >> 200                                         G4double previousStepSize,
                                                   >> 201                                         G4double currentMinimalStep,
                                                   >> 202                                         G4double& currentSafety);
217                                                   203 
218   inline const G4ParticleDefinition* FirstPart << 204   void SelectModel(G4double& kinEnergy);
                                                   >> 205   // Select concrete model
219                                                   206 
220   //------------------------------------------ << 207   size_t CurrentMaterialCutsCoupleIndex() const {return currentMaterialIndex;};
221   // Run time methods                          << 208   // Return current index
222   //------------------------------------------ << 
223                                                   209 
224 protected:                                     << 210   G4double CurrentRange() const {return currentRange;};
225                                                   211 
226   // This method is not used for tracking, it  << 212 private:
227   G4double GetMeanFreePath(const G4Track& trac << 
228                            G4double,           << 
229                            G4ForceCondition* c << 
230                                                   213 
231   // This method is not used for tracking, it  << 214   void DefineMaterial(const G4MaterialCutsCouple* couple);
232   G4double GetContinuousStepLimit(const G4Trac << 215   // define current material
233                                   G4double pre << 
234                                   G4double cur << 
235                                   G4double& cu << 
236                                                   216 
237 private:                                       << 217   // hide  assignment operator
                                                   >> 218 
                                                   >> 219   G4VMultipleScattering(G4VMultipleScattering &);
                                                   >> 220   G4VMultipleScattering & operator=(const G4VMultipleScattering &right);
238                                                   221 
239   // ======== Parameters of the class fixed at << 222   // =====================================================================
240                                                   223 
                                                   >> 224   G4ParticleChangeForMSC      fParticleChange;
241   G4EmModelManager*           modelManager;       225   G4EmModelManager*           modelManager;
242   G4LossTableManager*         emManager;       << 226   G4VEmModel*                 currentModel;
243   G4EmParameters*             theParameters;   << 
244                                                   227 
245   // ======== Parameters of the class fixed at << 228   // tables and vectors
                                                   >> 229   G4PhysicsTable*             theLambdaTable;
246                                                   230 
247   G4SafetyHelper*             safetyHelper = n << 231   // cash
248   const G4ParticleDefinition* firstParticle =  << 232   const G4ParticleDefinition* firstParticle;
249   const G4ParticleDefinition* currParticle = n << 233   const G4ParticleDefinition* currentParticle;
250                                                << 234   const G4MaterialCutsCouple* currentCouple;
251   std::vector<G4VMscModel*>   mscModels;       << 235   size_t                      currentMaterialIndex;
                                                   >> 236 
                                                   >> 237   G4int                       nBins;
                                                   >> 238 
                                                   >> 239   G4double                    minKinEnergy;
                                                   >> 240   G4double                    maxKinEnergy;
                                                   >> 241 
                                                   >> 242   G4double                    trueStepLength;
                                                   >> 243   G4double                    truePathLength;
                                                   >> 244   G4double                    geomPathLength;
                                                   >> 245   G4double                    lambda0;
                                                   >> 246   G4double                    currentRange;
                                                   >> 247 
                                                   >> 248   G4GPILSelection             valueGPILSelectionMSC;
                                                   >> 249   G4bool                      latDisplasment;
                                                   >> 250   G4bool                      buildLambdaTable;
                                                   >> 251 };
252                                                   252 
253   G4double                    facrange = 0.04; << 253 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
254   G4double                    lowestKinEnergy; << 254 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
255                                                   255 
256   // ======== Cached values - may be state dep << 256 inline void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
                                                   >> 257 {
                                                   >> 258   if(couple != currentCouple) {
                                                   >> 259     currentCouple   = couple;
                                                   >> 260     currentMaterialIndex = couple->GetIndex();
                                                   >> 261   }
                                                   >> 262 }
257                                                   263 
258 protected:                                     << 264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
259                                                   265 
260   G4ParticleChangeForMSC      fParticleChange; << 266 inline G4double G4VMultipleScattering::GetMeanFreePath(const G4Track&,
                                                   >> 267                                                              G4double,
                                                   >> 268                                                              G4ForceCondition* cond)
                                                   >> 269 {
                                                   >> 270   *cond = Forced;
                                                   >> 271   return DBL_MAX;
                                                   >> 272 }
261                                                   273 
262 private:                                       << 274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
263                                                   275 
264   G4ThreeVector               fNewPosition;    << 276 inline G4double G4VMultipleScattering::AlongStepGetPhysicalInteractionLength(
265   G4ThreeVector               fNewDirection;   << 277                              const G4Track& track,
                                                   >> 278                              G4double previousStepSize,
                                                   >> 279                              G4double currentMinimalStep,
                                                   >> 280                              G4double& currentSafety,
                                                   >> 281                              G4GPILSelection* selection)
                                                   >> 282 {
                                                   >> 283   // get Step limit proposed by the process
                                                   >> 284   valueGPILSelectionMSC = NotCandidateForSelection;
                                                   >> 285   G4double steplength = GetContinuousStepLimit(track,previousStepSize,
                                                   >> 286                                               currentMinimalStep,currentSafety);
                                                   >> 287   // set return value for G4GPILSelection
                                                   >> 288   *selection = valueGPILSelectionMSC;
                                                   >> 289   return  steplength;
                                                   >> 290 }
266                                                   291 
267   G4VMscModel*                currentModel = n << 292 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
268   G4VEnergyLossProcess*       fIonisation = nu << 
269                                                   293 
270   G4double                    geomMin;         << 294 inline G4double G4VMultipleScattering::GetContinuousStepLimit(
271   G4double                    minDisplacement2 << 295                                           const G4Track& track,
272   G4double                    physStepLimit =  << 296                                                 G4double,
273   G4double                    tPathLength = 0. << 297                                                 G4double currentMinimalStep,
274   G4double                    gPathLength = 0. << 298                                                 G4double&)
275                                                << 299 {
276   G4MscStepLimitType          stepLimit = fUse << 300   DefineMaterial(track.GetMaterialCutsCouple());
277   G4int                       numberOfModels = << 301   G4double e = track.GetKineticEnergy();
278                                                << 302   SelectModel(e);
279   G4bool                      latDisplacement  << 303   const G4ParticleDefinition* p = track.GetDefinition();
280   G4bool                      isIon = false;   << 304   lambda0 = GetLambda(p, e);
281   G4bool                      fPositionChanged << 305   currentRange = G4LossTableManager::Instance()->GetTrancatedRange(p,e,currentCouple);
282   G4bool                      isActive = false << 306   if(currentRange < currentMinimalStep) currentRange = currentMinimalStep;
283   G4bool                      baseMat = false; << 307   truePathLength = TruePathLengthLimit(track,lambda0,currentMinimalStep);
284 };                                             << 308   //G4cout << "StepLimit: tpl= " << truePathLength << " lambda0= "
                                                   >> 309   //       << lambda0 << " range= " << currentRange
                                                   >> 310   //       << " currentMinStep= " << currentMinimalStep << G4endl;
                                                   >> 311   if (truePathLength < currentMinimalStep) valueGPILSelectionMSC = CandidateForSelection;
                                                   >> 312   geomPathLength = currentModel->GeomPathLength(theLambdaTable,currentCouple,
                                                   >> 313            p,e,lambda0,currentRange,truePathLength);
                                                   >> 314   if(geomPathLength > lambda0) geomPathLength = lambda0;
                                                   >> 315   return geomPathLength;
                                                   >> 316 }
285                                                   317 
286 // ======== Run time inline methods ========== << 
287                                                   318 
288 //....oooOO0OOooo........oooOO0OOooo........oo    319 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
289                                                   320 
290 inline G4VEmModel*                             << 321 inline G4double G4VMultipleScattering::ContinuousStepLimit(
291 G4VMultipleScattering::SelectModel(G4double ki << 322                                        const G4Track& track,
                                                   >> 323                                        G4double previousStepSize,
                                                   >> 324                                        G4double currentMinimalStep,
                                                   >> 325                                        G4double& currentSafety)
292 {                                                 326 {
293   return modelManager->SelectModel(kinEnergy,  << 327   return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
                                                   >> 328                                       currentSafety);
294 }                                                 329 }
295                                                   330 
296 //....oooOO0OOooo........oooOO0OOooo........oo    331 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
297                                                   332 
298 inline  G4bool G4VMultipleScattering::LateralD << 333 inline G4double G4VMultipleScattering::GetLambda(const G4ParticleDefinition* p, G4double& e)
                                                   >> 334 {
                                                   >> 335   G4double x;
                                                   >> 336   if(theLambdaTable) {
                                                   >> 337     G4bool b;
                                                   >> 338     x = ((*theLambdaTable)[currentMaterialIndex])->GetValue(e, b);
                                                   >> 339 
                                                   >> 340   } else {
                                                   >> 341     x = currentModel->CrossSection(currentCouple,p,e);
                                                   >> 342   }
                                                   >> 343   return x;
                                                   >> 344 }
                                                   >> 345 
                                                   >> 346 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 347 
                                                   >> 348 inline G4VParticleChange* G4VMultipleScattering::AlongStepDoIt(
                                                   >> 349                                                         const G4Track&,
                                                   >> 350                                                         const G4Step& step)
299 {                                                 351 {
300   return latDisplacement;                      << 352   G4double geomStepLength = step.GetStepLength();
                                                   >> 353   if((geomStepLength == geomPathLength) && (truePathLength <= currentRange))
                                                   >> 354      trueStepLength = truePathLength;
                                                   >> 355   else
                                                   >> 356      trueStepLength = currentModel->TrueStepLength(geomStepLength);
                                                   >> 357   fParticleChange.ProposeTrueStepLength(trueStepLength);
                                                   >> 358   return &fParticleChange;
301 }                                                 359 }
302                                                   360 
303 //....oooOO0OOooo........oooOO0OOooo........oo    361 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
304                                                   362 
305 inline  G4double G4VMultipleScattering::Skin() << 363 inline G4VParticleChange* G4VMultipleScattering::PostStepDoIt(const G4Track& track,
                                                   >> 364                     const G4Step& step)
306 {                                                 365 {
307   return theParameters->MscSkin();             << 366   fParticleChange.Initialize(track);
                                                   >> 367   currentModel->SampleSecondaries(currentCouple,track.GetDynamicParticle(),
                                                   >> 368         step.GetStepLength(),step.GetPostStepPoint()->GetSafety());
                                                   >> 369   return &fParticleChange;
308 }                                                 370 }
309                                                   371 
310 //....oooOO0OOooo........oooOO0OOooo........oo    372 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
311                                                   373 
312 inline  G4double G4VMultipleScattering::RangeF << 374 inline void G4VMultipleScattering::SelectModel(G4double& kinEnergy)
313 {                                                 375 {
314   return facrange;                             << 376   currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
315 }                                                 377 }
316                                                   378 
317 //....oooOO0OOooo........oooOO0OOooo........oo    379 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
318                                                   380 
319 inline  G4double G4VMultipleScattering::GeomFa << 381 inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
                                                   >> 382                                            G4double kinEnergy, size_t& idxRegion) const
320 {                                                 383 {
321   return theParameters->MscGeomFactor();       << 384   return modelManager->SelectModel(kinEnergy, idxRegion);
322 }                                                 385 }
323                                                   386 
324 //....oooOO0OOooo........oooOO0OOooo........oo    387 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
325                                                   388 
326 inline  G4double G4VMultipleScattering::PolarA << 389 inline void G4VMultipleScattering::SetBinning(G4int nbins)
327 {                                                 390 {
328   return theParameters->MscThetaLimit();       << 391   nBins = nbins;
329 }                                                 392 }
330                                                   393 
331 //....oooOO0OOooo........oooOO0OOooo........oo    394 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
332                                                   395 
333 inline G4MscStepLimitType G4VMultipleScatterin << 396 inline G4int G4VMultipleScattering::Binning() const
334 {                                                 397 {
335   return stepLimit;                            << 398   return nBins;
336 }                                                 399 }
337                                                   400 
338 //....oooOO0OOooo........oooOO0OOooo........oo    401 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
339                                                   402 
340 inline void G4VMultipleScattering::SetStepLimi << 403 inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
341 {                                                 404 {
342   theParameters->SetMscStepLimitType(val);     << 405   minKinEnergy = e;
343 }                                                 406 }
344                                                   407 
345 //....oooOO0OOooo........oooOO0OOooo........oo    408 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
346                                                   409 
347 inline G4double G4VMultipleScattering::LowestK << 410 inline G4double G4VMultipleScattering::MinKinEnergy() const
348 {                                                 411 {
349   return lowestKinEnergy;                      << 412   return minKinEnergy;
350 }                                                 413 }
351                                                   414 
352 //....oooOO0OOooo........oooOO0OOooo........oo    415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
353                                                   416 
354 inline void G4VMultipleScattering::SetLowestKi << 417 inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
355 {                                                 418 {
356   lowestKinEnergy = val;                       << 419   maxKinEnergy = e;
357 }                                                 420 }
358                                                   421 
359 //....oooOO0OOooo........oooOO0OOooo........oo    422 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
360                                                   423 
361 inline const G4ParticleDefinition* G4VMultiple << 424 inline G4double G4VMultipleScattering::MaxKinEnergy() const
                                                   >> 425 {
                                                   >> 426   return maxKinEnergy;
                                                   >> 427 }
                                                   >> 428 
                                                   >> 429 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
                                                   >> 430 
                                                   >> 431 inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
362 {                                                 432 {
363   return firstParticle;                        << 433   return latDisplasment;
364 }                                                 434 }
365                                                   435 
366 //....oooOO0OOooo........oooOO0OOooo........oo    436 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
367                                                   437 
368 inline G4VMscModel* G4VMultipleScattering::EmM << 438 inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
369 {                                                 439 {
370   return (index < mscModels.size()) ? mscModel << 440   latDisplasment = val;
371 }                                                 441 }
372                                                   442 
373 //....oooOO0OOooo........oooOO0OOooo........oo    443 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
374                                                   444 
375 inline G4int G4VMultipleScattering::NumberOfMo << 445 inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
376 {                                                 446 {
377   return numberOfModels;                       << 447   buildLambdaTable = val;
378 }                                                 448 }
379                                                   449 
380 //....oooOO0OOooo........oooOO0OOooo........oo    450 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
381                                                   451 
382 inline G4VMscModel*                            << 452 inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
383 G4VMultipleScattering::GetModelByIndex(G4int i << 
384 {                                                 453 {
385   // static cast is possible inside this class << 454   return currentParticle;
386   return static_cast<G4VMscModel*>(modelManage << 
387 }                                                 455 }
388                                                   456 
389 //....oooOO0OOooo........oooOO0OOooo........oo    457 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
390                                                   458 
391 inline G4bool G4VMultipleScattering::UseBaseMa << 459 inline const G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
392 {                                                 460 {
393   return baseMat;                              << 461   return theLambdaTable;
394 }                                                 462 }
395                                                   463 
396 //....oooOO0OOooo........oooOO0OOooo........oo    464 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
397                                                   465 
398 #endif                                            466 #endif
399                                                   467