Index: trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh
===================================================================
--- trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh	(revision 1228)
+++ trunk/source/processes/electromagnetic/utils/include/G4VMultipleScattering.hh	(revision 1315)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4VMultipleScattering.hh,v 1.62 2009/10/29 17:56:04 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4VMultipleScattering.hh,v 1.63 2010/03/10 18:29:51 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // -------------------------------------------------------------------
@@ -154,5 +154,5 @@
   // The function overloads the corresponding function of the base
   // class.
-  inline G4double PostStepGetPhysicalInteractionLength(
+  G4double PostStepGetPhysicalInteractionLength(
                                             const G4Track&,
 					    G4double  previousStepSize,
@@ -160,14 +160,14 @@
 
   // Along step actions
-  inline G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
+  G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
 
   // Post step actions
-  inline G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
+  G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
 
   // This method does not used for tracking, it is intended only for tests
-  inline G4double ContinuousStepLimit(const G4Track& track,
-				      G4double previousStepSize,
-				      G4double currentMinimalStep,
-				      G4double& currentSafety);
+  G4double ContinuousStepLimit(const G4Track& track,
+			       G4double previousStepSize,
+			       G4double currentMinimalStep,
+			       G4double& currentSafety);
 
   //------------------------------------------------------------------------
@@ -318,181 +318,21 @@
 };
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VMultipleScattering::ContinuousStepLimit(
-                                       const G4Track& track,
-                                       G4double previousStepSize,
-                                       G4double currentMinimalStep,
-                                       G4double& currentSafety)
-{
-  return GetContinuousStepLimit(track,previousStepSize,currentMinimalStep,
-				currentSafety);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VMultipleScattering::SetBinning(G4int nbins)
-{
-  nBins = nbins;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4int G4VMultipleScattering::Binning() const
-{
-  return nBins;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
-{
-  minKinEnergy = e;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VMultipleScattering::MinKinEnergy() const
-{
-  return minKinEnergy;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
-{
-  maxKinEnergy = e;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VMultipleScattering::MaxKinEnergy() const
-{
-  return maxKinEnergy;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
-{
-  buildLambdaTable = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
-{
-  return theLambdaTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
-{
-  return currentParticle;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
-{
-  return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
-		   G4double kinEnergy, size_t& idxRegion) const
-{
-  return modelManager->SelectModel(kinEnergy, idxRegion);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
-{
-  return latDisplasment;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
-{
-  latDisplasment = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  G4double G4VMultipleScattering::Skin() const
-{
-  return skin;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  void G4VMultipleScattering::SetSkin(G4double val)
-{
-  if(val < 1.0) skin = 0.0;
-  else          skin = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  G4double G4VMultipleScattering::RangeFactor() const
-{
-  return facrange;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  void G4VMultipleScattering::SetRangeFactor(G4double val)
-{
-  if(val > 0.0) facrange = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  G4double G4VMultipleScattering::GeomFactor() const
-{
-  return facgeom;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  void G4VMultipleScattering::SetGeomFactor(G4double val)
-{
-  if(val > 0.0) facgeom = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  G4double G4VMultipleScattering::PolarAngleLimit() const
-{
-  return polarAngleLimit;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline  void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
-{
-  if(val < 0.0)     polarAngleLimit = 0.0;
-  else if(val > pi) polarAngleLimit = pi;
-  else              polarAngleLimit = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
-{
-  return stepLimit;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val) 
-{
-  stepLimit = val;
-  if(val == fMinimal) facrange = 0.2;
+// ======== Run time inline methods ================
+
+inline const G4MaterialCutsCouple* 
+G4VMultipleScattering::CurrentMaterialCutsCouple() const
+{
+  return currentCouple;
+} 
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline 
+void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
+{
+  if(couple != currentCouple) {
+    currentCouple   = couple;
+    currentMaterialIndex = couple->GetIndex();
+  }
 }
 
@@ -509,6 +349,6 @@
     x = currentModel->CrossSection(currentCouple,p,e);
   }
-  if(x > DBL_MIN) x = 1./x;
-  else            x = DBL_MAX; 
+  if(x > DBL_MIN) { x = 1./x; }
+  else            { x = DBL_MAX; } 
   return x;
 }
@@ -516,57 +356,166 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
-inline 
-void G4VMultipleScattering::DefineMaterial(const G4MaterialCutsCouple* couple)
-{
-  if(couple != currentCouple) {
-    currentCouple   = couple;
-    currentMaterialIndex = couple->GetIndex();
-  }
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline const G4MaterialCutsCouple* 
-G4VMultipleScattering::CurrentMaterialCutsCouple() const
-{
-  return currentCouple;
-} 
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-// Follwoing methods are virtual, they are inlined because they applied at
-// each simulation step and some compilers may inline these methods
-
-inline G4double 
-G4VMultipleScattering::PostStepGetPhysicalInteractionLength(
-              const G4Track&, G4double, G4ForceCondition* condition)
-{
-  *condition = Forced;
-  return DBL_MAX;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VParticleChange* 
-G4VMultipleScattering::AlongStepDoIt(const G4Track& track, const G4Step& step)
-{
-  if(currentModel->IsActive(track.GetKineticEnergy())) {
-    fParticleChange.ProposeTrueStepLength(currentModel->ComputeTrueStepLength(step.GetStepLength()));
-  }
-  return &fParticleChange;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VParticleChange* 
-G4VMultipleScattering::PostStepDoIt(const G4Track& track, const G4Step& step)
-{
-  fParticleChange.Initialize(track);
-  if(currentModel->IsActive(track.GetKineticEnergy())) {
-    currentModel->SampleScattering(track.GetDynamicParticle(),
-				   step.GetPostStepPoint()->GetSafety());
-  }
-  return &fParticleChange;
+inline G4VEmModel* G4VMultipleScattering::SelectModel(G4double kinEnergy)
+{
+  return modelManager->SelectModel(kinEnergy, currentMaterialIndex);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4VEmModel* G4VMultipleScattering::SelectModelForMaterial(
+		   G4double kinEnergy, size_t& idxRegion) const
+{
+  return modelManager->SelectModel(kinEnergy, idxRegion);
+}
+
+// ======== Get/Set inline methods used at initialisation ================
+
+inline void G4VMultipleScattering::SetBinning(G4int nbins)
+{
+  nBins = nbins;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4int G4VMultipleScattering::Binning() const
+{
+  return nBins;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VMultipleScattering::SetMinKinEnergy(G4double e)
+{
+  minKinEnergy = e;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VMultipleScattering::MinKinEnergy() const
+{
+  return minKinEnergy;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VMultipleScattering::SetMaxKinEnergy(G4double e)
+{
+  maxKinEnergy = e;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VMultipleScattering::MaxKinEnergy() const
+{
+  return maxKinEnergy;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  void G4VMultipleScattering::SetBuildLambdaTable(G4bool val)
+{
+  buildLambdaTable = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VMultipleScattering::LambdaTable() const
+{
+  return theLambdaTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  const G4ParticleDefinition* G4VMultipleScattering::Particle() const
+{
+  return currentParticle;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  G4bool G4VMultipleScattering::LateralDisplasmentFlag() const
+{
+  return latDisplasment;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  void G4VMultipleScattering::SetLateralDisplasmentFlag(G4bool val)
+{
+  latDisplasment = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  G4double G4VMultipleScattering::Skin() const
+{
+  return skin;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  void G4VMultipleScattering::SetSkin(G4double val)
+{
+  if(val < 1.0) { skin = 0.0; }
+  else          { skin = val; }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  G4double G4VMultipleScattering::RangeFactor() const
+{
+  return facrange;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  void G4VMultipleScattering::SetRangeFactor(G4double val)
+{
+  if(val > 0.0) facrange = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  G4double G4VMultipleScattering::GeomFactor() const
+{
+  return facgeom;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  void G4VMultipleScattering::SetGeomFactor(G4double val)
+{
+  if(val > 0.0) facgeom = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  G4double G4VMultipleScattering::PolarAngleLimit() const
+{
+  return polarAngleLimit;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline  void G4VMultipleScattering::SetPolarAngleLimit(G4double val)
+{
+  if(val < 0.0)            { polarAngleLimit = 0.0; }
+  else if(val > CLHEP::pi) { polarAngleLimit = CLHEP::pi; }
+  else                     { polarAngleLimit = val; }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4MscStepLimitType G4VMultipleScattering::StepLimitType() const
+{
+  return stepLimit;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VMultipleScattering::SetStepLimitType(G4MscStepLimitType val) 
+{
+  stepLimit = val;
+  if(val == fMinimal) { facrange = 0.2; }
 }
 
