Index: trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh
===================================================================
--- trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh	(revision 961)
+++ trunk/source/processes/electromagnetic/utils/include/G4VEnergyLossProcess.hh	(revision 991)
@@ -24,5 +24,5 @@
 // ********************************************************************
 //
-// $Id: G4VEnergyLossProcess.hh,v 1.86 2009/02/19 09:57:36 vnivanch Exp $
+// $Id: G4VEnergyLossProcess.hh,v 1.83 2008/09/12 16:19:01 vnivanch Exp $
 // GEANT4 tag $Name:
 //
@@ -126,13 +126,8 @@
   virtual ~G4VEnergyLossProcess();
 
-private:
-  // clean vectors and arrays
-  void Clean();
-
   //------------------------------------------------------------------------
   // Virtual methods to be implemented in concrete processes
   //------------------------------------------------------------------------
 
-public:
   virtual G4bool IsApplicable(const G4ParticleDefinition& p) = 0;
   
@@ -148,36 +143,22 @@
   //------------------------------------------------------------------------
 
+protected:
+
   virtual G4double MinPrimaryEnergy(const G4ParticleDefinition*,
 				    const G4Material*, G4double cut);
 
   //------------------------------------------------------------------------
-  // Virtual methods implementation common to all EM ContinuousDiscrete 
-  // processes. Further inheritance is not assumed 
+  // Virtual methods common to all EM ContinuousDiscrete processes
+  // Further inheritance is not assumed 
   //------------------------------------------------------------------------
 
 public:
 
-  // prepare all tables
+  void PrintInfoDefinition();
+
   void PreparePhysicsTable(const G4ParticleDefinition&);
 
-  // build all tables
   void BuildPhysicsTable(const G4ParticleDefinition&);
 
-  // build a table
-  G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);
-
-  // build a table
-  G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);
-
-  // summary printout after initialisation
-  void PrintInfoDefinition();
-
-  // Add subcutoff option for the region
-  void ActivateSubCutoff(G4bool val, const G4Region* region = 0);
-
-  // Activate deexcitation code for region
-  void ActivateDeexcitation(G4bool, const G4Region* region = 0);
-
-  // Step limit from AlongStep 
   G4double AlongStepGetPhysicalInteractionLength(const G4Track&,
 						 G4double  previousStepSize,
@@ -186,79 +167,33 @@
 						 G4GPILSelection* selection);
 
-  // Step limit from cross section
   G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
 						G4double   previousStepSize,
 						G4ForceCondition* condition);
 
-  // AlongStep computations
   G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
 
-  // Sampling of secondaries in vicinity of geometrical boundary
-  void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&, 
-                               G4VEmModel* model, G4int matIdx,
-			       G4double& extraEdep); 
-
-  // PostStep sampling of secondaries
   G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&);
 
-  // Store all PhysicsTable in files.
-  // Return false in case of any fatal failure at I/O  
+  // Store PhysicsTable in a file.
+  // Return false in case of failure at I/O
   G4bool StorePhysicsTable(const G4ParticleDefinition*,
                            const G4String& directory,
 			   G4bool ascii = false);
 
-  // Retrieve all Physics from a files.
-  // Return true if all the Physics Table are built.
-  // Return false if any fatal failure. 
+  // Retrieve Physics from a file.
+  // (return true if the Physics Table can be build by using file)
+  // (return false if the process has no functionality or in case of failure)
+  // File name should is constructed as processName+particleName and the
+  // should be placed under the directory specifed by the argument.
   G4bool RetrievePhysicsTable(const G4ParticleDefinition*,
                               const G4String& directory,
 			      G4bool ascii);
 
-private:
-  // store a table
-  G4bool StoreTable(const G4ParticleDefinition* p, 
-		    G4PhysicsTable*, G4bool ascii,
-		    const G4String& directory, 
-		    const G4String& tname);
-
-  // retrieve a table
-  G4bool RetrieveTable(const G4ParticleDefinition* p, 
-		       G4PhysicsTable*, G4bool ascii,
-		       const G4String& directory, 
-		       const G4String& tname, 
-		       G4bool mandatory);
-
-  //------------------------------------------------------------------------
-  // Public interface to cross section, mfp and sampling of fluctuations
-  // These methods are not used in run time
-  //------------------------------------------------------------------------
-
-public:
-  // access to dispersion of restricted energy loss
-  G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
-			     const G4DynamicParticle* dp,
-			     G4double length);
-
-  // Access to cross section table
-  G4double CrossSectionPerVolume(G4double kineticEnergy,
-				 const G4MaterialCutsCouple* couple);
-
-  // access to cross section
-  G4double MeanFreePath(const G4Track& track);
-
-  // access to step limit
-  G4double ContinuousStepLimit(const G4Track& track,
-			       G4double previousStepSize,
-			       G4double currentMinimumStep,
-			       G4double& currentSafety);
-
 protected:
 
-  // implementation of the pure virtual method
   G4double GetMeanFreePath(const G4Track& track,
 			   G4double previousStepSize,
 			   G4ForceCondition* condition);
 
-  // implementation of the pure virtual method
   G4double GetContinuousStepLimit(const G4Track& track,
 				  G4double previousStepSize,
@@ -267,107 +202,32 @@
 
   //------------------------------------------------------------------------
-  // Run time method which may be also used by derived processes
-  //------------------------------------------------------------------------
-
-  // creeation of an empty vector for cross section
-  G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, 
-				       G4double cut);
-
-  inline G4ParticleChangeForLoss* GetParticleChange();
-
-  inline size_t CurrentMaterialCutsCoupleIndex() const;
-
-  inline G4double GetCurrentRange() const;
-
-  //------------------------------------------------------------------------
-  // Specific methods to set, access, modify models
-  //------------------------------------------------------------------------
-
-  // Select model in run time
-  inline void SelectModel(G4double kinEnergy);
+  // Specific methods for along/post step EM processes 
+  //------------------------------------------------------------------------
 
 public:
-  // Select model by energy and region index
-  inline G4VEmModel* SelectModelForMaterial(G4double kinEnergy, 
-					    size_t& idx) const;
-
-  // Add EM model coupled with fluctuation model for region, smaller value 
-  // of order defines which pair of models will be selected for a given 
-  // energy interval  
-  inline void AddEmModel(G4int, G4VEmModel*, 
-			 G4VEmFluctuationModel* fluc = 0,
-			 const G4Region* region = 0);
-
-  // Define new energy range for the model identified by the name
-  inline void UpdateEmModel(const G4String&, G4double, G4double);
-
-  // Assign a model to a process
-  inline void SetEmModel(G4VEmModel*, G4int index=1);
-  
-  // return the assigned model
-  inline G4VEmModel* EmModel(G4int index=1);
-  
-  // Access to models
-  inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
-
-  inline G4int NumberOfModels();
-
-  // Assign a fluctuation model to a process
-  inline void SetFluctModel(G4VEmFluctuationModel*);
-  
-  // return the assigned fluctuation model
-  inline G4VEmFluctuationModel* FluctModel();
-    
-  //------------------------------------------------------------------------
-  // Define and access particle type 
-  //------------------------------------------------------------------------
-
-protected:
-  inline void SetParticle(const G4ParticleDefinition* p);
-  inline void SetSecondaryParticle(const G4ParticleDefinition* p);
-
-public:
-  inline void SetBaseParticle(const G4ParticleDefinition* p);
-  inline const G4ParticleDefinition* Particle() const;
-  inline const G4ParticleDefinition* BaseParticle() const;
-  inline const G4ParticleDefinition* SecondaryParticle() const;
-
-  //------------------------------------------------------------------------
-  // Get/set parameters to configure the process at initialisation time
-  //------------------------------------------------------------------------
-
-  // Add subcutoff process (bremsstrahlung) to sample secondary 
-  // particle production in vicinity of the geometry boundary
+
   void AddCollaborativeProcess(G4VEnergyLossProcess*);
 
-  inline void SetLossFluctuations(G4bool val);
-  inline void SetRandomStep(G4bool val);
-
-  inline void SetIntegral(G4bool val);
-  inline G4bool IsIntegral() const;
-
-  // Set/Get flag "isIonisation"
-  inline void SetIonisation(G4bool val);
-  inline G4bool IsIonisationProcess() const;
-
-  // Redefine parameteters for stepping control
-  //
-  inline void SetLinearLossLimit(G4double val);
-  inline void SetMinSubRange(G4double val);
-  inline void SetLambdaFactor(G4double val);
-  inline void SetStepFunction(G4double v1, G4double v2);
-
-  inline G4int NumberOfSubCutoffRegions() const;
-  inline G4int NumberOfDERegions() const;
-
-  //------------------------------------------------------------------------
-  // Specific methods to path Physics Tables to the process
-  //------------------------------------------------------------------------
+  void SampleSubCutSecondaries(std::vector<G4Track*>&, const G4Step&, 
+                               G4VEmModel* model, G4int matIdx,
+			       G4double& extraEdep); 
+
+  G4double GetDEDXDispersion(const G4MaterialCutsCouple *couple,
+			     const G4DynamicParticle* dp,
+			     G4double length);
+
+  //------------------------------------------------------------------------
+  // Specific methods to build and access Physics Tables
+  //------------------------------------------------------------------------
+
+  G4PhysicsTable* BuildDEDXTable(G4EmTableType tType = fRestricted);
+
+  G4PhysicsTable* BuildLambdaTable(G4EmTableType tType = fRestricted);
 
   void SetDEDXTable(G4PhysicsTable* p, G4EmTableType tType);
   void SetCSDARangeTable(G4PhysicsTable* pRange);
   void SetRangeTableForLoss(G4PhysicsTable* p);
+  void SetInverseRangeTable(G4PhysicsTable* p);
   void SetSecondaryRangeTable(G4PhysicsTable* p);
-  void SetInverseRangeTable(G4PhysicsTable* p);
 
   void SetLambdaTable(G4PhysicsTable* p);
@@ -391,16 +251,4 @@
   // Max kinetic energy for tables
   inline void SetMaxKinEnergyForCSDARange(G4double e);
-
-  // Return values for given G4MaterialCutsCouple
-  inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);
-  inline G4double GetDEDXForSubsec(G4double& kineticEnergy, 
-				   const G4MaterialCutsCouple*);
-  inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
-  inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
-  inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);
-  inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);
-  inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);
-
-  inline G4bool TablesAreBuilt() const;
 
   // Access to specific tables
@@ -416,4 +264,97 @@
   inline G4PhysicsTable* SubLambdaTable();
 
+  // Return values for given G4MaterialCutsCouple
+  inline G4double GetDEDX(G4double& kineticEnergy, const G4MaterialCutsCouple*);
+  inline G4double GetDEDXForSubsec(G4double& kineticEnergy, 
+				   const G4MaterialCutsCouple*);
+  inline G4double GetRange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
+  inline G4double GetCSDARange(G4double& kineticEnergy, const G4MaterialCutsCouple*);
+  inline G4double GetRangeForLoss(G4double& kineticEnergy, const G4MaterialCutsCouple*);
+  inline G4double GetKineticEnergy(G4double& range, const G4MaterialCutsCouple*);
+  inline G4double GetLambda(G4double& kineticEnergy, const G4MaterialCutsCouple*);
+
+  inline G4bool TablesAreBuilt() const;
+
+  //------------------------------------------------------------------------
+  // Define and access particle type 
+  //------------------------------------------------------------------------
+
+  inline void SetBaseParticle(const G4ParticleDefinition* p);
+  inline const G4ParticleDefinition* Particle() const;
+  inline const G4ParticleDefinition* BaseParticle() const;
+  inline const G4ParticleDefinition* SecondaryParticle() const;
+
+  //------------------------------------------------------------------------
+  // Specific methods to set, access, modify models
+  //------------------------------------------------------------------------
+
+  // Add EM model coupled with fluctuation model for the region
+  inline void AddEmModel(G4int, G4VEmModel*, 
+			 G4VEmFluctuationModel* fluc = 0,
+			 const G4Region* region = 0);
+
+  // Assign a model to a process
+  inline void SetEmModel(G4VEmModel*, G4int index=1);
+  
+  // return the assigned model
+  inline G4VEmModel* EmModel(G4int index=1);
+  
+  // Assign a fluctuation model to a process
+  inline void SetFluctModel(G4VEmFluctuationModel*);
+  
+  // return the assigned fluctuation model
+  inline G4VEmFluctuationModel* FluctModel();
+    
+  // Define new energy range for the model identified by the name
+  inline void UpdateEmModel(const G4String&, G4double, G4double);
+
+  // Access to models
+  inline G4VEmModel* GetModelByIndex(G4int idx = 0, G4bool ver = false);
+
+  inline G4int NumberOfModels();
+
+  //------------------------------------------------------------------------
+  // Get/set parameters used for simulation of energy loss
+  //------------------------------------------------------------------------
+
+  inline void SetLossFluctuations(G4bool val);
+  inline void SetRandomStep(G4bool val);
+  inline void SetIntegral(G4bool val);
+  inline G4bool IsIntegral() const;
+
+  // Set/Get flag "isIonisation"
+  inline void SetIonisation(G4bool val);
+  inline G4bool IsIonisationProcess() const;
+
+  // Redefine parameteters for stepping control
+  //
+  inline void SetLinearLossLimit(G4double val);
+  inline void SetMinSubRange(G4double val);
+  inline void SetStepFunction(G4double v1, G4double v2);
+  inline void SetLambdaFactor(G4double val);
+
+
+  // Add subcutoff option for the region
+  void ActivateSubCutoff(G4bool val, const G4Region* region = 0);
+
+  inline G4int NumberOfSubCutoffRegions() const;
+
+  // Activate deexcitation code
+  virtual void ActivateDeexcitation(G4bool, const G4Region* region = 0);
+
+  //------------------------------------------------------------------------
+  // Public interface to helper functions 
+  //------------------------------------------------------------------------
+
+  inline 
+  G4VEmModel* SelectModelForMaterial(G4double kinEnergy, size_t& idx) const;
+
+  inline G4double MeanFreePath(const G4Track& track);
+
+  inline G4double ContinuousStepLimit(const G4Track& track,
+				      G4double previousStepSize,
+				      G4double currentMinimumStep,
+				      G4double& currentSafety);
+
   //------------------------------------------------------------------------
   // Run time method for simulation of ionisation
@@ -426,13 +367,49 @@
   inline void SetDynamicMassCharge(G4double massratio, G4double charge2ratio);
 
+  // Access to cross section table
+  G4double CrossSectionPerVolume(G4double kineticEnergy,
+				 const G4MaterialCutsCouple* couple);
+
+protected:
+
+  G4PhysicsVector* LambdaPhysicsVector(const G4MaterialCutsCouple*, 
+				       G4double cut);
+
+  inline G4ParticleChangeForLoss* GetParticleChange();
+
+  inline void SetParticle(const G4ParticleDefinition* p);
+
+  inline void SetSecondaryParticle(const G4ParticleDefinition* p);
+
+  inline void SelectModel(G4double kinEnergy);
+
+  inline size_t CurrentMaterialCutsCoupleIndex() const;
+
+  inline G4double GetCurrentRange() const;
+
 private:
+
+  //------------------------------------------------------------------------
+  // Management of tables
+  //------------------------------------------------------------------------
+
+  void Clear();
+
+  G4bool StoreTable(const G4ParticleDefinition* p, 
+		    G4PhysicsTable*, G4bool ascii,
+		    const G4String& directory, 
+		    const G4String& tname);
+
+  G4bool RetrieveTable(const G4ParticleDefinition* p, 
+		       G4PhysicsTable*, G4bool ascii,
+		       const G4String& directory, 
+		       const G4String& tname, 
+		       G4bool mandatory);
 
   // define material and indexes
   inline void DefineMaterial(const G4MaterialCutsCouple* couple);
 
-  //------------------------------------------------------------------------
-  // Compute values using scaling relation, mass and charge of based particle
-  //------------------------------------------------------------------------
-
+  // Returnd values for scaled energy using mass of the base particle
+  //
   inline G4double GetDEDXForScaledEnergy(G4double scaledKinEnergy);
   inline G4double GetSubDEDXForScaledEnergy(G4double scaledKinEnergy);
@@ -441,9 +418,10 @@
   inline G4double GetScaledRangeForScaledEnergy(G4double scaledKinEnergy);
   inline G4double GetLimitScaledRangeForScaledEnergy(G4double scaledKinEnergy);
+  inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);
   inline G4double ScaledKinEnergyForLoss(G4double range);
-  inline G4double GetLambdaForScaledEnergy(G4double scaledKinEnergy);
   inline void ComputeLambdaForScaledEnergy(G4double scaledKinEnergy);
 
   // hide  assignment operator
+
   G4VEnergyLossProcess(G4VEnergyLossProcess &);
   G4VEnergyLossProcess & operator=(const G4VEnergyLossProcess &right);
@@ -466,9 +444,6 @@
   G4VEmFluctuationModel*                fluctModel;
   std::vector<const G4Region*>          scoffRegions;
-  std::vector<const G4Region*>          deRegions;
   G4int                                 nSCoffRegions;
-  G4int                                 nDERegions;
-  G4bool*                               idxSCoffRegions;
-  G4bool*                               idxDERegions;
+  G4int*                                idxSCoffRegions;
 
   std::vector<G4VEnergyLossProcess*>    scProcesses;
@@ -518,5 +493,4 @@
   G4bool   isIonisation;
   G4bool   useSubCutoff;
-  G4bool   useDeexcitation;
 
 protected:
@@ -557,292 +531,13 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
-inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange()
-{
-  return &fParticleChange;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 
-{
-  return currentMaterialIndex;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-  
-inline G4double G4VEnergyLossProcess::GetCurrentRange() const
-{
-  return fRange;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
-{
-  currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
-  currentModel->SetCurrentCouple(currentCouple);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
-                   G4double kinEnergy, size_t& idx) const
-{
-  return modelManager->SelectModel(kinEnergy, idx);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline
-void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p, 
-				      G4VEmFluctuationModel* fluc,
-				      const G4Region* region)
-{
-  modelManager->AddEmModel(order, p, fluc, region);
-  if(p) p->SetParticleChange(pParticleChange, fluc);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam, 
-						G4double emin, G4double emax)
-{
-  modelManager->UpdateEmModel(nam, emin, emax);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index)
-{
-  G4int n = emModels.size();
-  if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);}
-  emModels[index] = p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index)
-{
-  G4VEmModel* p = 0;
-  if(index >= 0 && index <  G4int(emModels.size())) p = emModels[index];
-  return p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline 
-G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver)
-{
-  return modelManager->GetModel(idx, ver);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4int G4VEnergyLossProcess::NumberOfModels()
-{
-  return modelManager->NumberOfModels();
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
-{
-  fluctModel = p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
-{
-  return fluctModel;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
-{
-  particle = p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
-{
-  secondaryParticle = p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
-{
-  baseParticle = p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
-{
-  return particle;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
-{
-  return baseParticle;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
-{
-  return secondaryParticle;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
-{
-  lossFluctuationFlag = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)
-{
-  rndmStepFlag = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
-{
-  integral = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-  
-inline G4bool G4VEnergyLossProcess::IsIntegral() const 
-{
-  return integral;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetIonisation(G4bool val)
-{
-  isIonisation = val;
-  if(val) aGPILSelection = CandidateForSelection;
-  else    aGPILSelection = NotCandidateForSelection;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
-{
-  return isIonisation;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
-{
-  linLossLimit = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)
-{
-  minSubRange = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
-{
-  if(val > 0.0 && val <= 1.0) lambdaFactor = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)
-{
-  dRoverRange = v1;
-  finalRange = v2;
-  if (dRoverRange > 0.999) dRoverRange = 1.0;
-  currentCouple = 0;
-  mfpKinEnergy  = DBL_MAX;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
-{
-  return nSCoffRegions;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4int G4VEnergyLossProcess::NumberOfDERegions() const
-{
-  return nDERegions;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
-{
-  nBins = nbins;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
-{
-  nBins = nbins;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)
-{
-  nBinsCSDA = nbins;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
-{
-  minKinEnergy = e;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::MinKinEnergy() const
-{
-  return minKinEnergy;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
-{
-  maxKinEnergy = e;
-  if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
-{
-  return maxKinEnergy;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)
-{
-  maxKinEnergyCSDA = e;
+inline void G4VEnergyLossProcess::DefineMaterial(
+            const G4MaterialCutsCouple* couple)
+{
+  if(couple != currentCouple) {
+    currentCouple   = couple;
+    currentMaterial = couple->GetMaterial();
+    currentMaterialIndex = couple->GetIndex();
+    mfpKinEnergy = DBL_MAX;
+  }
 }
 
@@ -863,4 +558,55 @@
   DefineMaterial(couple);
   return GetSubDEDXForScaledEnergy(kineticEnergy*massRatio);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
+{
+  G4bool b;
+  G4double x = 
+    ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
+  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
+  return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
+{
+  G4bool b;
+  G4double x = 
+    ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
+  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
+  return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
+{
+  G4bool b;
+  G4double x = 0.0;
+  //  if(theIonisationTable) {
+  x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))
+    *chargeSqRatio;
+  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
+  //}
+  return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline 
+G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
+{
+  G4bool b;
+  G4double x = 0.0;
+  //if(theIonisationSubTable) {
+  x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))
+    *chargeSqRatio;
+  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
+  //}
+  return x;
 }
 
@@ -897,219 +643,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
-inline G4double G4VEnergyLossProcess::GetRangeForLoss(
-                G4double& kineticEnergy,
-		const G4MaterialCutsCouple* couple)
-{
-  DefineMaterial(couple);
-  G4double x = DBL_MAX;
-  if(theRangeTableForLoss) 
-    x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
-  //  G4cout << "Range from " << GetProcessName() 
-  //         << "  e= " << kineticEnergy << " r= " << x << G4endl;
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::GetKineticEnergy(
-                G4double& range,
-		const G4MaterialCutsCouple* couple)
-{
-  DefineMaterial(couple);
-  G4double r = range/reduceFactor;
-  G4double e = ScaledKinEnergyForLoss(r)/massRatio;
-  return e;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
-					  const G4MaterialCutsCouple* couple)
-{
-  DefineMaterial(couple);
-  G4double x = 0.0;
-  if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
-{
-  return  tablesAreBuilt;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
-{
-  return theDEDXTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
-{
-  return theDEDXSubTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
-{
-  return theDEDXunRestrictedTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
-{
-  G4PhysicsTable* t = theDEDXTable;
-  if(theIonisationTable) t = theIonisationTable; 
-  return t;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
-{
-  G4PhysicsTable* t = theDEDXSubTable;
-  if(theIonisationSubTable) t = theIonisationSubTable; 
-  return t;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
-{
-  return theCSDARangeTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
-{
-  return theRangeTableForLoss;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
-{
-  return theInverseRangeTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
-{
-  return theLambdaTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
-{
-  return theSubLambdaTable;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::SampleRange()
-{
-  G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
-  G4bool b;
-  G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));
-  G4double x = fRange + G4RandGauss::shoot(0.0,s);
-  if(x > 0.0) fRange = x;
-  return fRange;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
-                                                       G4double charge2ratio)
-{
-  massRatio     = massratio;
-  chargeSqRatio = charge2ratio;
-  reduceFactor  = 1.0/(chargeSqRatio*massRatio);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline void G4VEnergyLossProcess::DefineMaterial(
-            const G4MaterialCutsCouple* couple)
-{
-  if(couple != currentCouple) {
-    currentCouple   = couple;
-    currentMaterial = couple->GetMaterial();
-    currentMaterialIndex = couple->GetIndex();
-    mfpKinEnergy = DBL_MAX;
-  }
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::GetDEDXForScaledEnergy(G4double e)
-{
-  G4bool b;
-  G4double x = 
-    ((*theDEDXTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
-  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::GetSubDEDXForScaledEnergy(G4double e)
-{
-  G4bool b;
-  G4double x = 
-    ((*theDEDXSubTable)[currentMaterialIndex]->GetValue(e, b))*chargeSqRatio;
-  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::GetIonisationForScaledEnergy(G4double e)
-{
-  G4bool b;
-  G4double x = 0.0;
-  //  if(theIonisationTable) {
-  x = ((*theIonisationTable)[currentMaterialIndex]->GetValue(e, b))
-    *chargeSqRatio;
-  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
-  //}
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline 
-G4double G4VEnergyLossProcess::GetSubIonisationForScaledEnergy(G4double e)
-{
-  G4bool b;
-  G4double x = 0.0;
-  //if(theIonisationSubTable) {
-  x = ((*theIonisationSubTable)[currentMaterialIndex]->GetValue(e, b))
-    *chargeSqRatio;
-  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
-  //}
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
-{
-  G4bool b;
-  G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
-  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
-  return x;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
 inline G4double G4VEnergyLossProcess::GetLimitScaledRangeForScaledEnergy(
 		G4double e)
@@ -1126,4 +657,41 @@
   }
   return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetRangeForLoss(
+                G4double& kineticEnergy,
+		const G4MaterialCutsCouple* couple)
+{
+  DefineMaterial(couple);
+  G4double x = DBL_MAX;
+  if(theRangeTableForLoss) 
+    x = GetScaledRangeForScaledEnergy(kineticEnergy*massRatio)*reduceFactor;
+  //  G4cout << "Range from " << GetProcessName() 
+  //         << "  e= " << kineticEnergy << " r= " << x << G4endl;
+  return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetScaledRangeForScaledEnergy(G4double e)
+{
+  G4bool b;
+  G4double x = ((*theRangeTableForLoss)[currentMaterialIndex])->GetValue(e, b);
+  if(e < minKinEnergy) x *= std::sqrt(e/minKinEnergy);
+  return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetKineticEnergy(
+                G4double& range,
+		const G4MaterialCutsCouple* couple)
+{
+  DefineMaterial(couple);
+  G4double r = range/reduceFactor;
+  G4double e = ScaledKinEnergyForLoss(r)/massRatio;
+  return e;
 }
 
@@ -1143,4 +711,15 @@
   }
   return e;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::GetLambda(G4double& kineticEnergy,
+					  const G4MaterialCutsCouple* couple)
+{
+  DefineMaterial(couple);
+  G4double x = 0.0;
+  if(theLambdaTable) x = GetLambdaForScaledEnergy(kineticEnergy*massRatio);
+  return x;
 }
 
@@ -1179,3 +758,418 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
+inline G4double G4VEnergyLossProcess::ContinuousStepLimit(
+         const G4Track& track, G4double x, G4double y, G4double& z)
+{
+  G4GPILSelection sel;
+  return AlongStepGetPhysicalInteractionLength(track, x, y, z, &sel);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::SampleRange()
+{
+  G4double e = amu_c2*preStepKinEnergy/particle->GetPDGMass();
+  G4bool b;
+  G4double s = fRange*std::pow(10.,vstrag->GetValue(e,b));
+  G4double x = fRange + G4RandGauss::shoot(0.0,s);
+  if(x > 0.0) fRange = x;
+  return fRange;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::MeanFreePath(const G4Track& track)
+{
+  DefineMaterial(track.GetMaterialCutsCouple());
+  preStepLambda = GetLambdaForScaledEnergy(track.GetKineticEnergy()*massRatio);
+  G4double x = DBL_MAX;
+  if(DBL_MIN < preStepLambda) x = 1.0/preStepLambda;
+  return x;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::MinPrimaryEnergy(
+                const G4ParticleDefinition*, const G4Material*, G4double cut)
+{
+  return cut;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SelectModel(G4double kinEnergy)
+{
+  currentModel = modelManager->SelectModel(kinEnergy, currentMaterialIndex);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4VEmModel* G4VEnergyLossProcess::SelectModelForMaterial(
+                   G4double kinEnergy, size_t& idx) const
+{
+  return modelManager->SelectModel(kinEnergy, idx);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4ParticleChangeForLoss* G4VEnergyLossProcess::GetParticleChange()
+{
+  return &fParticleChange;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline const G4ParticleDefinition* G4VEnergyLossProcess::Particle() const
+{
+  return particle;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline const G4ParticleDefinition* G4VEnergyLossProcess::BaseParticle() const
+{
+  return baseParticle;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline const G4ParticleDefinition* G4VEnergyLossProcess::SecondaryParticle() const
+{
+  return secondaryParticle;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTable() const
+{
+  return theDEDXTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::DEDXTableForSubsec() const
+{
+  return theDEDXSubTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::DEDXunRestrictedTable() const
+{
+  return theDEDXunRestrictedTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTable() const
+{
+  G4PhysicsTable* t = theDEDXTable;
+  if(theIonisationTable) t = theIonisationTable; 
+  return t;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::IonisationTableForSubsec() const
+{
+  G4PhysicsTable* t = theDEDXSubTable;
+  if(theIonisationSubTable) t = theIonisationSubTable; 
+  return t;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::CSDARangeTable() const
+{
+  return theCSDARangeTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::RangeTableForLoss() const
+{
+  return theRangeTableForLoss;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::InverseRangeTable() const
+{
+  return theInverseRangeTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::LambdaTable()
+{
+  return theLambdaTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4PhysicsTable* G4VEnergyLossProcess::SubLambdaTable()
+{
+  return theSubLambdaTable;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+  
+inline G4bool G4VEnergyLossProcess::IsIntegral() const 
+{
+  return integral;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline size_t G4VEnergyLossProcess::CurrentMaterialCutsCoupleIndex() const 
+{
+  return currentMaterialIndex;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetDynamicMassCharge(G4double massratio,
+                                                       G4double charge2ratio)
+{
+  massRatio     = massratio;
+  chargeSqRatio = charge2ratio;
+  reduceFactor  = 1.0/(chargeSqRatio*massRatio);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+  
+inline G4double G4VEnergyLossProcess::GetCurrentRange() const
+{
+  return fRange;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline
+void G4VEnergyLossProcess::AddEmModel(G4int order, G4VEmModel* p, 
+				      G4VEmFluctuationModel* fluc,
+				      const G4Region* region)
+{
+  modelManager->AddEmModel(order, p, fluc, region);
+  if(p) p->SetParticleChange(pParticleChange, fluc);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline 
+G4VEmModel* G4VEnergyLossProcess::GetModelByIndex(G4int idx, G4bool ver)
+{
+  return modelManager->GetModel(idx, ver);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4int G4VEnergyLossProcess::NumberOfModels()
+{
+  return modelManager->NumberOfModels();
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetEmModel(G4VEmModel* p, G4int index)
+{
+  G4int n = emModels.size();
+  if(index >= n) for(G4int i=n; i<index+1; i++) {emModels.push_back(0);}
+  emModels[index] = p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4VEmModel* G4VEnergyLossProcess::EmModel(G4int index)
+{
+  G4VEmModel* p = 0;
+  if(index >= 0 && index <  G4int(emModels.size())) p = emModels[index];
+  return p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetFluctModel(G4VEmFluctuationModel* p)
+{
+  fluctModel = p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4VEmFluctuationModel* G4VEnergyLossProcess::FluctModel()
+{
+  return fluctModel;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::UpdateEmModel(const G4String& nam, 
+						G4double emin, G4double emax)
+{
+  modelManager->UpdateEmModel(nam, emin, emax);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetIntegral(G4bool val)
+{
+  integral = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetParticle(const G4ParticleDefinition* p)
+{
+  particle = p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetBaseParticle(const G4ParticleDefinition* p)
+{
+  baseParticle = p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetSecondaryParticle(const G4ParticleDefinition* p)
+{
+  secondaryParticle = p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetLinearLossLimit(G4double val)
+{
+  linLossLimit = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetLossFluctuations(G4bool val)
+{
+  lossFluctuationFlag = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetRandomStep(G4bool val)
+{
+  rndmStepFlag = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetMinSubRange(G4double val)
+{
+  minSubRange = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4bool G4VEnergyLossProcess::TablesAreBuilt() const
+{
+  return  tablesAreBuilt;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4int G4VEnergyLossProcess::NumberOfSubCutoffRegions() const
+{
+  return nSCoffRegions;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetDEDXBinning(G4int nbins)
+{
+  nBins = nbins;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetLambdaBinning(G4int nbins)
+{
+  nBins = nbins;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetDEDXBinningForCSDARange(G4int nbins)
+{
+  nBinsCSDA = nbins;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::MinKinEnergy() const
+{
+  return minKinEnergy;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetMinKinEnergy(G4double e)
+{
+  minKinEnergy = e;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetMaxKinEnergy(G4double e)
+{
+  maxKinEnergy = e;
+  if(e < maxKinEnergyCSDA) maxKinEnergyCSDA = e;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetMaxKinEnergyForCSDARange(G4double e)
+{
+  maxKinEnergyCSDA = e;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4double G4VEnergyLossProcess::MaxKinEnergy() const
+{
+  return maxKinEnergy;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetLambdaFactor(G4double val)
+{
+  if(val > 0.0 && val <= 1.0) lambdaFactor = val;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline void G4VEnergyLossProcess::SetIonisation(G4bool val)
+{
+  isIonisation = val;
+  if(val) aGPILSelection = CandidateForSelection;
+  else    aGPILSelection = NotCandidateForSelection;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+inline G4bool G4VEnergyLossProcess::IsIonisationProcess() const
+{
+  return isIonisation;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+void G4VEnergyLossProcess::SetStepFunction(G4double v1, G4double v2)
+{
+  dRoverRange = v1;
+  finalRange = v2;
+  if (dRoverRange > 0.999) dRoverRange = 1.0;
+  currentCouple = 0;
+  mfpKinEnergy  = DBL_MAX;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
 #endif
