Index: trunk/source/processes/electromagnetic/muons/History
===================================================================
--- trunk/source/processes/electromagnetic/muons/History	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/History	(revision 1196)
@@ -1,3 +1,3 @@
-$Id: History,v 1.127 2009/04/12 17:19:01 vnivanch Exp $
+$Id: History,v 1.134 2009/11/09 19:18:01 vnivanch Exp $
 -------------------------------------------------------------------
 
@@ -18,4 +18,27 @@
      ----------------------------------------------------------
 
+09 November 09: V.Ivant (emmuons-V09-02-08)
+- G4MuBetheBlochModel - compute density effect correction using method of 
+                        G4IonisParamMat class applying revised parameterisation
+
+30 October 09: V.Ivant (emmuons-V09-02-07)
+G4MuMultipleScattering - use G4UrbanMscModel90 by default
+
+11 August 09: V.Ivant (emmuons-V09-02-06)
+G4MuPairProductionModel - restore the head
+
+24 July 09: V.Ivant (emmuons-V09-02-05)
+G4MuMultipleScattering - removed obosolete members and methods (they
+                         are in the base class)
+
+09 July 09: V.Ivant (emmuons-V09-02-04)
+G4EnergyLossForExtrapolator - removed hidden bin to use full scale of 
+                              of PhysicsVector; linLossLimit = 0.01
+
+02 June 09: V.Ivant (emmuons-V09-02-03)
+G4MuPairProductionModel - added protection for the case when
+  maxPairEnergy<minPairEnergy (empty interval for energy transfer
+  observed for rare case happens with kaons)
+
 12 April 09: V.Ivant (emmuons-V09-02-02)
 G4MuBetheBlochModel, G4MuBremsstrahlungModel, G4MuPairProductionModel
@@ -28,4 +51,8 @@
 20 February 09: V.Ivant (emmuons-V09-02-00)
 - Cleanup: improved comments, move virtual methods from .hh to .cc
+
+11 August 09: V.Ivant (emmuons-V09-01-15a)
+G4MuPairProductionModel - added protection against numerical problem
+                          due to negative value of transfered energy 
 
 12 November 08: V.Ivant (emmuons-V09-01-15)
Index: trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4EnergyLossForExtrapolator.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4EnergyLossForExtrapolator.hh,v 1.12 2008/11/13 14:14:07 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-02 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/include/G4MuBetheBlochModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuBetheBlochModel.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuBetheBlochModel.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuBetheBlochModel.hh,v 1.18 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlung.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlung.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlung.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuBremsstrahlung.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlungModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlungModel.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuBremsstrahlungModel.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuBremsstrahlungModel.hh,v 1.22 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/include/G4MuIonisation.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuIonisation.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuIonisation.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuIonisation.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/include/G4MuMultipleScattering.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuMultipleScattering.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuMultipleScattering.hh	(revision 1196)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4MuMultipleScattering.hh,v 1.2 2008/04/13 17:19:13 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-02 $
+// $Id: G4MuMultipleScattering.hh,v 1.4 2009/10/30 18:37:06 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -----------------------------------------------------------------------------
@@ -60,13 +60,9 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-class G4VMscModel;
-
 class G4MuMultipleScattering : public G4VMultipleScattering
-
 {
 public:    // with description
 
-  G4MuMultipleScattering(G4double tet = 0.2, 
-			 const G4String& processName="muMsc");
+  G4MuMultipleScattering(const G4String& processName="muMsc");
 
   virtual ~G4MuMultipleScattering();
@@ -78,13 +74,4 @@
   void PrintInfo();
 
-  // geom. step length distribution should be sampled or not
-  void Setsamplez(G4bool value) { samplez = value;};
-
-  // to reduce the energy/step dependence
-  void Setdtrl(G4double value) { dtrl = value;};
-
-  // 'soften' step limitation above lambdalimit
-  void SetLimitTheta(G4double value) { thetaLimit = value;};
-
 protected:
 
@@ -94,10 +81,8 @@
 private:        // data members
 
-  G4VMscModel* mscModel;
+  //  hide assignment operator
+  G4MuMultipleScattering & operator=(const  G4MuMultipleScattering &right);
+  G4MuMultipleScattering(const  G4MuMultipleScattering&);
 
-  G4double thetaLimit;
-  G4double dtrl;
-
-  G4bool   samplez;
   G4bool   isInitialized;
 
Index: trunk/source/processes/electromagnetic/muons/include/G4MuPairProduction.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuPairProduction.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuPairProduction.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuPairProduction.hh,v 1.31 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/include/G4MuPairProductionModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/muons/include/G4MuPairProductionModel.hh	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/include/G4MuPairProductionModel.hh	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuPairProductionModel.hh,v 1.28 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/src/G4EnergyLossForExtrapolator.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4EnergyLossForExtrapolator.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4EnergyLossForExtrapolator.cc	(revision 1196)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4EnergyLossForExtrapolator.cc,v 1.18 2008/11/13 14:14:07 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-02 $
+// $Id: G4EnergyLossForExtrapolator.cc,v 1.19 2009/07/09 17:04:55 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 //---------------------------------------------------------------------------
@@ -230,5 +230,5 @@
   currentParticleName = "";
 
-  linLossLimit = 0.001;
+  linLossLimit = 0.01;
   emin         = 1.*MeV;
   emax         = 10.*TeV;
@@ -406,7 +406,7 @@
     G4PhysicsVector* aVector = (*table)[i];
 
-    for(G4int j=0; j<nbins; j++) {
+    for(G4int j=0; j<=nbins; j++) {
         
-       G4double e = aVector->GetLowEdgeEnergy(j);
+       G4double e = aVector->Energy(j);
        G4double dedx = ioni->ComputeDEDX(couple,part,e,e) + brem->ComputeDEDX(couple,part,e,e);
        if(1<verbose) {
@@ -454,7 +454,7 @@
     const G4MaterialCutsCouple* couple = couples[i];
     G4PhysicsVector* aVector = (*table)[i];
-    for(G4int j=0; j<nbins; j++) {
+    for(G4int j=0; j<=nbins; j++) {
         
-       G4double e = aVector->GetLowEdgeEnergy(j);
+       G4double e = aVector->Energy(j);
        G4double dedx = ioni->ComputeDEDX(couple,part,e,e) +
 	               pair->ComputeDEDX(couple,part,e,e) +
@@ -499,7 +499,7 @@
     const G4MaterialCutsCouple* couple = couples[i];
     G4PhysicsVector* aVector = (*table)[i];
-    for(G4int j=0; j<nbins; j++) {
+    for(G4int j=0; j<=nbins; j++) {
         
-       G4double e = aVector->GetLowEdgeEnergy(j);
+       G4double e = aVector->Energy(j);
        G4double dedx = ioni->ComputeDEDX(couple,part,e,e);
        aVector->PutValue(j,dedx);
@@ -542,7 +542,7 @@
       G4cout << "i= " << i << "  mat= " << mat->GetName() << G4endl;
     G4PhysicsVector* aVector = (*table)[i];
-    for(G4int j=0; j<nbins; j++) {
+    for(G4int j=0; j<=nbins; j++) {
         
-       G4double e = aVector->GetLowEdgeEnergy(j);
+       G4double e = aVector->Energy(j);
        G4double xs = msc->CrossSectionPerVolume(mat,part,e);
        aVector->PutValue(j,xs);
Index: trunk/source/processes/electromagnetic/muons/src/G4MuBetheBlochModel.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuBetheBlochModel.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuBetheBlochModel.cc	(revision 1196)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4MuBetheBlochModel.cc,v 1.26 2009/04/12 17:19:01 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// $Id: G4MuBetheBlochModel.cc,v 1.27 2009/11/09 19:18:01 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
@@ -220,9 +220,9 @@
   G4double eexc  = material->GetIonisation()->GetMeanExcitationEnergy();
   G4double eexc2 = eexc*eexc;
-  G4double cden  = material->GetIonisation()->GetCdensity();
-  G4double mden  = material->GetIonisation()->GetMdensity();
-  G4double aden  = material->GetIonisation()->GetAdensity();
-  G4double x0den = material->GetIonisation()->GetX0density();
-  G4double x1den = material->GetIonisation()->GetX1density();
+  //G4double cden  = material->GetIonisation()->GetCdensity();
+  //G4double mden  = material->GetIonisation()->GetMdensity();
+  //G4double aden  = material->GetIonisation()->GetAdensity();
+  //G4double x0den = material->GetIonisation()->GetX0density();
+  //G4double x1den = material->GetIonisation()->GetX1density();
 
   G4double eDensity = material->GetElectronDensity();
@@ -237,8 +237,9 @@
   // density correction
   G4double x = log(bg2)/twoln10;
-  if ( x >= x0den ) {
-    dedx -= twoln10*x - cden ;
-    if ( x < x1den ) dedx -= aden*pow((x1den-x),mden) ;
-  }
+  //if ( x >= x0den ) {
+  //  dedx -= twoln10*x - cden ;
+  //  if ( x < x1den ) dedx -= aden*pow((x1den-x),mden) ;
+  //}
+  dedx -= material->GetIonisation()->DensityCorrection(x);
 
   // shell correction
Index: trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlung.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlung.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlung.cc	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuBremsstrahlung.cc,v 1.42 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlungModel.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlungModel.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuBremsstrahlungModel.cc	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuBremsstrahlungModel.cc,v 1.35 2009/04/12 17:48:45 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/src/G4MuIonisation.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuIonisation.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuIonisation.cc	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuIonisation.cc,v 1.59 2009/02/26 11:04:20 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/src/G4MuMultipleScattering.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuMultipleScattering.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuMultipleScattering.cc	(revision 1196)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4MuMultipleScattering.cc,v 1.12 2008/10/16 13:37:04 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-02 $
+// $Id: G4MuMultipleScattering.cc,v 1.14 2009/10/30 18:37:06 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -----------------------------------------------------------------------------
@@ -48,4 +48,5 @@
 #include "G4MuMultipleScattering.hh"
 #include "G4WentzelVIModel.hh"
+#include "G4UrbanMscModel90.hh"
 #include "G4MscStepLimitType.hh"
 
@@ -54,13 +55,11 @@
 using namespace std;
 
-G4MuMultipleScattering::G4MuMultipleScattering(G4double tet,
-					       const G4String& processName)
-  : G4VMultipleScattering(processName), thetaLimit(tet)
+G4MuMultipleScattering::G4MuMultipleScattering(const G4String& pnam)
+  : G4VMultipleScattering(pnam)
 {
-  dtrl              = 0.05;
-  samplez           = false ; 
-  isInitialized     = false;  
-  SetRangeFactor(0.2);
-  SetLateralDisplasmentFlag(true);
+  isInitialized = false;  
+  SetStepLimitType(fMinimal);
+  //SetPolarAngleLimit(CLHEP::twopi);
+  //SetRangeFactor(0.2);
 }
 
@@ -79,34 +78,10 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-void G4MuMultipleScattering::InitialiseProcess(const G4ParticleDefinition* p)
+void G4MuMultipleScattering::InitialiseProcess(const G4ParticleDefinition*)
 {
   // Modification of parameters between runs
-  if(isInitialized) {
-
-    if (p->GetParticleType() != "nucleus" && p->GetPDGMass() < GeV) {
-      mscModel->SetStepLimitType(StepLimitType());
-      mscModel->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
-      mscModel->SetRangeFactor(RangeFactor());
-    }
-    mscModel->SetPolarAngleLimit(PolarAngleLimit());
-    return;
-  }
-
-  if (p->GetParticleType() == "nucleus" || p->GetPDGMass() > GeV) {
-    SetLateralDisplasmentFlag(false);
-    SetBuildLambdaTable(false);
-  }
-
-  // initialisation of the model
-
-  mscModel = new G4WentzelVIModel();
-  mscModel->SetStepLimitType(StepLimitType());
-  mscModel->SetLateralDisplasmentFlag(LateralDisplasmentFlag());
-  mscModel->SetRangeFactor(RangeFactor());
-  mscModel->SetPolarAngleLimit(PolarAngleLimit());
-  mscModel->SetLowEnergyLimit(MinKinEnergy());
-  mscModel->SetHighEnergyLimit(MaxKinEnergy());
-
-  AddEmModel(1,mscModel);
+  if(isInitialized) return;
+  AddEmModel(1, new G4UrbanMscModel90());
+  //  AddEmModel(1, new G4WentzelVIModel());
   isInitialized = true;
 }
@@ -119,4 +94,5 @@
          << ", step limit type: " << StepLimitType()
          << ", lateralDisplacement: " << LateralDisplasmentFlag()
+	 << ", polarAngleLimit(deg)= " << PolarAngleLimit()/degree
          << G4endl;
 }
Index: trunk/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuPairProduction.cc	(revision 1196)
@@ -25,5 +25,5 @@
 //
 // $Id: G4MuPairProduction.cc,v 1.52 2009/02/20 14:48:16 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
Index: trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc
===================================================================
--- trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc	(revision 1055)
+++ trunk/source/processes/electromagnetic/muons/src/G4MuPairProductionModel.cc	(revision 1196)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4MuPairProductionModel.cc,v 1.41 2009/04/12 17:19:01 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
+// $Id: G4MuPairProductionModel.cc,v 1.44 2009/08/11 16:50:07 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-03-cand-01 $
 //
 // -------------------------------------------------------------------
@@ -389,7 +389,8 @@
 
   SetCurrentElement(Z);
-  G4double tmax = std::min(maxEnergy, kineticEnergy);
-  G4double cut  = std::min(cutEnergy, kineticEnergy);
-  if(cut < minPairEnergy) cut = minPairEnergy;
+
+  G4double maxPairEnergy = MaxSecondaryEnergy(particle,kineticEnergy);
+  G4double tmax = std::min(maxEnergy, maxPairEnergy);
+  G4double cut  = std::max(cutEnergy, minPairEnergy);
   if (cut >= tmax) return cross;
 
@@ -457,9 +458,10 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-void G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp, 
-						const G4MaterialCutsCouple* couple,
-						const G4DynamicParticle* aDynamicParticle,
-						G4double tmin,
-						G4double tmax)
+void 
+G4MuPairProductionModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp, 
+					   const G4MaterialCutsCouple* couple,
+					   const G4DynamicParticle* aDynamicParticle,
+					   G4double tmin,
+					   G4double tmax)
 {
   G4double kineticEnergy = aDynamicParticle->GetKineticEnergy();
@@ -611,4 +613,5 @@
 
   G4double sum = 0.0;
+  G4double dl;
 
   size_t i;
@@ -618,25 +621,27 @@
     G4double maxPairEnergy = MaxSecondaryEnergy(particle,kinEnergy);
     G4double minEnergy     = std::max(tmin, minPairEnergy);
-
-    G4int iz;
-    for(iz=1; iz<nzdat; iz++) {if(Z <= zdat[iz]) break;}
-    if(iz == nzdat) iz--;
-    G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]);
-
-    G4double sigcut;
-    if(minEnergy <= minPairEnergy)
-      sigcut = 0.;
-    else
-    {
-      G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
-      G4int iy = (G4int)((log(xc) - ymin)/dy);
-      if(iy < 0) iy = 0;
-      if(iy >= nbiny) iy = nbiny-1;
-      sigcut = InterpolatedIntegralCrossSection(dt,dz,iz,it,iy,   Z);
+    dl = 0.0;
+    if(minEnergy < maxPairEnergy) {
+
+      G4int iz;
+      for(iz=1; iz<nzdat; iz++) {if(Z <= zdat[iz]) break;}
+      if(iz == nzdat) iz--;
+      G4double dz = log(Z/zdat[iz-1])/log(zdat[iz]/zdat[iz-1]);
+
+      G4double sigcut;
+      if(minEnergy <= minPairEnergy)
+	sigcut = 0.;
+      else
+	{
+	  G4double xc = log(minEnergy/minPairEnergy)/log(maxPairEnergy/minPairEnergy);
+	  G4int iy = (G4int)((log(xc) - ymin)/dy);
+	  if(iy < 0) iy = 0;
+	  if(iy >= nbiny) iy = nbiny-1;
+	  sigcut = InterpolatedIntegralCrossSection(dt,dz,iz,it,iy,   Z);
+	}
+
+      G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z);
+      dl = (sigtot - sigcut)*theAtomNumDensityVector[i];
     }
-
-    G4double sigtot = InterpolatedIntegralCrossSection(dt,dz,iz,it,nbiny,Z);
-    G4double dl = (sigtot - sigcut)*theAtomNumDensityVector[i];
-
     // protection
     if(dl < 0.0) dl = 0.0;
