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


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