Index: trunk/source/processes/hadronic/cross_sections/History
===================================================================
--- trunk/source/processes/hadronic/cross_sections/History	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/History	(revision 1340)
@@ -15,4 +15,36 @@
      ---------------------------------------------------------------
 
+24 October 2010 Vladimir Ivanchenko (hadr-cross-V09-03-12)
+- G4VComponentCrossSection - use G4ParticleDefinition and kinetic 
+   energy instead of G4DynamicParticle
+
+20 October 2010 Gunter Folger (hadr-cross-V09-03-11)
+- add missing inline for GetCrossSection in G4BGGPionElasticXS.hh
+
+15 October 2010 Dennis Wright (hadr-cross-V09-03-10)
+----------------------------------------------------
+- integer Z and A migration:
+  in all cross section data sets, replace IsZAApplicable with IsIsoApplicable
+  and replace GetIsoZACrossSection with GetZandACrossSection
+ 
+23 September 2010 Vladimir Ivanchenko (hadr-cross-V09-03-09)
+------------------------------------------------------------
+- G4NeutronElasticXS, G4NeutronInelasticXS, G4NeutronCaptureXS cleanup:
+                    use std vectors instead of C arrays;
+                    use G4HadronNucleonXsc class and PDG parameterisation
+                    for high energy cross sections off Hydrogen;
+                    removed Get/Set methods for verboseLevel
+
+30 July 2010 Vladimir Ivanchenko (hadr-cross-V09-03-08)
+- G4IonProtonCrossSection - move virtual methods to source,
+                            add constructor and destructor,
+                            make G4ProtonInelasticCrossSection class member,
+                            fix bug in kinematics
+
+05 July 2010 Vladimir Ivanchenko (hadr-cross-V09-03-07)
+- G4VComponentCrossSection - new interface for cross sections
+- G4VCrossSectionDataSet - added name, min and max kinetic energy and access 
+                           methods
+
 11 Jun 2010 Vladimir Ivanchenko (hadr-cross-V09-03-06)
 - G4UPiNuclearCrossSection - fixed memory leak at destruction
@@ -20,8 +52,10 @@
 
 03 Jun 2010 Vladimir Ivanchenko (hadr-cross-V09-03-05)
+------------------------------------------------------
 - G4NeutronElasticXS, G4NeutronInelasticXS, G4NeutronCaptureXS - substitute
      environment variable G4NEUTRONXS by G4NEUTRONXSDATA
 
 02 Jun 2010 Gunter Folger       (hadr-cross-V09-03-04)
+------------------------------------------------------
 - fix compilation error on Windows: use G4lrint not lrint
 
Index: trunk/source/processes/hadronic/cross_sections/include/G4BGGNucleonElasticXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4BGGNucleonElasticXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4BGGNucleonElasticXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGNucleonElasticXS.hh,v 1.5 2009/11/19 11:41:30 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGNucleonElasticXS.hh,v 1.6 2010/10/12 06:02:09 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -55,6 +55,6 @@
 #include "G4ParticleDefinition.hh"
 #include "G4Element.hh"
+#include "G4HadTmpUtil.hh"
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 class G4GlauberGribovCrossSection;
@@ -74,5 +74,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A);
 
   virtual
@@ -81,6 +81,6 @@
 
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
-				G4double /*A*/, G4double aTemperature = 0.);
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+                                G4int /*A*/, G4double aTemperature = 0.);
 
   virtual
@@ -94,5 +94,5 @@
   void Initialise();
 
-  G4double CoulombFactor(G4double kinEnergy, G4double A);
+  G4double CoulombFactor(G4double kinEnergy, G4int A);
 
   G4double fGlauberEnergy;  
@@ -109,5 +109,4 @@
 };
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
@@ -116,18 +115,14 @@
 {
   return true;
-  //  return IsZAApplicable(dp, elm->GetZ(), elm->GetN());
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
-G4bool G4BGGNucleonElasticXS::IsZAApplicable(const G4DynamicParticle*, 
-					     G4double /*Z*/, G4double/* A*/)
+G4bool G4BGGNucleonElasticXS::IsIsoApplicable(const G4DynamicParticle*,
+                                              G4int /*Z*/, G4int/* A*/)
 {
   return true;
-  //  return (dp->GetDefinition() == particle);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
@@ -136,8 +131,9 @@
 						G4double temp)
 {
-  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+//  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+  G4int Z = G4lrint(elm->GetZ());
+  G4int N = G4lrint(elm->GetN());
+  return GetZandACrossSection(dp, Z, N, temp);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4BGGNucleonInelasticXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4BGGNucleonInelasticXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4BGGNucleonInelasticXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGNucleonInelasticXS.hh,v 1.6 2009/11/19 11:44:46 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGNucleonInelasticXS.hh,v 1.7 2010/10/12 06:02:28 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -55,6 +55,6 @@
 #include "G4ParticleDefinition.hh"
 #include "G4Element.hh"
+#include "G4HadTmpUtil.hh"
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 class G4GlauberGribovCrossSection;
@@ -74,5 +74,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A);
 
   virtual
@@ -81,6 +81,6 @@
 
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
-				G4double /*A*/, G4double aTemperature = 0.);
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+                                G4int /*A*/, G4double aTemperature = 0.);
 
   virtual
@@ -94,5 +94,5 @@
   void Initialise();
 
-  G4double CoulombFactor(G4double kinEnergy, G4double A);
+  G4double CoulombFactor(G4double kinEnergy, G4int A);
 
   G4double fGlauberEnergy;  
@@ -109,5 +109,4 @@
 };
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
@@ -116,18 +115,14 @@
 {
   return true;
-  //  return IsZAApplicable(dp, elm->GetZ(), elm->GetN());
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
-G4bool G4BGGNucleonInelasticXS::IsZAApplicable(const G4DynamicParticle*, 
-					       G4double /*Z*/, G4double/* A*/)
+G4bool G4BGGNucleonInelasticXS::IsIsoApplicable(const G4DynamicParticle*,
+                                                G4int /*Z*/, G4int/* A*/)
 {
   return false;
-  //  return (dp->GetDefinition() == particle);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
@@ -136,8 +131,9 @@
 						  G4double temp)
 {
-  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+  G4int Z = G4lrint(elm->GetZ());
+  G4int N = G4lrint(elm->GetN());
+  return GetZandACrossSection(dp, Z, N, temp);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4BGGPionElasticXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4BGGPionElasticXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4BGGPionElasticXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGPionElasticXS.hh,v 1.5 2009/11/19 11:46:13 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGPionElasticXS.hh,v 1.7 2010/10/20 09:07:38 stesting Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -55,6 +55,6 @@
 #include "G4ParticleDefinition.hh"
 #include "G4Element.hh"
+#include "G4HadTmpUtil.hh"
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 class G4GlauberGribovCrossSection;
@@ -73,6 +73,9 @@
   G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
 
+//  virtual
+//  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A);
 
   virtual
@@ -80,7 +83,11 @@
 			   const G4Element*, G4double aTemperature = 0.);
 
+//  virtual
+//  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
+//				G4double /*A*/, G4double aTemperature = 0.);
+
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
-				G4double /*A*/, G4double aTemperature = 0.);
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+                                G4int /*A*/, G4double aTemperature = 0.);
 
   virtual
@@ -94,5 +101,6 @@
   void Initialise();
 
-  G4double CoulombFactor(G4double kinEnergy, G4double A);
+//  G4double CoulombFactor(G4double kinEnergy, G4double A);
+  G4double CoulombFactor(G4double kinEnergy, G4int A);
 
   G4double fGlauberEnergy;  
@@ -116,28 +124,28 @@
 {
   return true;
-  //return IsZAApplicable(dp, elm->GetZ(), elm->GetN());
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+//inline
+//G4bool G4BGGPionElasticXS::IsZAApplicable(const G4DynamicParticle*, 
+//					  G4double /*Z*/, G4double/* A*/)
 
 inline
-G4bool G4BGGPionElasticXS::IsZAApplicable(const G4DynamicParticle*, 
-					  G4double /*Z*/, G4double/* A*/)
+G4bool G4BGGPionElasticXS::IsIsoApplicable(const G4DynamicParticle*,
+                                           G4int /*Z*/, G4int/* A*/)
 {
   return false;
-  //  return (dp->GetDefinition() == particle);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-inline
+inline 
 G4double G4BGGPionElasticXS::GetCrossSection(const G4DynamicParticle* dp, 
 					     const G4Element* elm, 
 					     G4double temp)
 {
-  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+//  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+  G4int Z = G4lrint(elm->GetZ());
+  G4int N = G4lrint(elm->GetN());
+  return GetZandACrossSection(dp, Z, N, temp);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4BGGPionInelasticXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4BGGPionInelasticXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4BGGPionInelasticXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGPionInelasticXS.hh,v 1.5 2009/11/19 11:47:19 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGPionInelasticXS.hh,v 1.6 2010/10/12 06:04:02 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -55,6 +55,6 @@
 #include "G4ParticleDefinition.hh"
 #include "G4Element.hh"
+#include "G4HadTmpUtil.hh"
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 class G4GlauberGribovCrossSection;
@@ -73,6 +73,9 @@
   G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
 
+//  virtual
+//  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A);
 
   virtual
@@ -80,7 +83,11 @@
 			   const G4Element*, G4double aTemperature = 0.);
 
+//  virtual
+//  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
+//				G4double /*A*/, G4double aTemperature = 0.);
+
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
-				G4double /*A*/, G4double aTemperature = 0.);
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+                                G4int /*A*/, G4double aTemperature = 0.);
 
   virtual
@@ -94,5 +101,5 @@
   void Initialise();
 
-  G4double CoulombFactor(G4double kinEnergy, G4double A);
+  G4double CoulombFactor(G4double kinEnergy, G4int A);
 
   G4double fGlauberEnergy;  
@@ -109,5 +116,4 @@
 };
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
@@ -116,18 +122,14 @@
 {
   return true;
-  //  return IsZAApplicable(dp, elm->GetZ(), elm->GetN());
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
-G4bool G4BGGPionInelasticXS::IsZAApplicable(const G4DynamicParticle*, 
-					    G4double /*Z*/, G4double/* A*/)
+G4bool G4BGGPionInelasticXS::IsIsoApplicable(const G4DynamicParticle*, 
+					     G4int /*Z*/, G4int/* A*/)
 {
   return false;
-  // return (dp->GetDefinition() == particle);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 inline
@@ -136,8 +138,9 @@
 					       G4double temp)
 {
-  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+//  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
+  G4int Z = G4lrint(elm->GetZ());
+  G4int N = G4lrint(elm->GetN());
+  return GetZandACrossSection(dp, Z, N, temp);
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4EMDissociationCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4EMDissociationCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4EMDissociationCrossSection.hh	(revision 1340)
@@ -79,12 +79,11 @@
     virtual G4bool IsApplicable (const G4DynamicParticle*, const G4Element*);
  
-    virtual G4bool IsZAApplicable(const G4DynamicParticle*, G4double ZZ, 
-                                                            G4double AA);
+    virtual G4bool IsIsoApplicable(const G4DynamicParticle*, G4int ZZ, G4int AA);
  
     virtual G4double GetCrossSection (const G4DynamicParticle *,
       const G4Element *, G4double);
       
-    virtual G4double GetIsoZACrossSection(const G4DynamicParticle*, 
-                                          G4double ZZ, G4double AA, 
+    virtual G4double GetZandACrossSection(const G4DynamicParticle*, 
+                                          G4int ZZ, G4int AA, 
                                           G4double temperature);
       
@@ -110,5 +109,4 @@
     G4double                 xd;
 };
-///////////////////////////////////////////////////////////////////////////////
-//
+
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4ElectroNuclearCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4ElectroNuclearCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4ElectroNuclearCrossSection.hh	(revision 1340)
@@ -25,5 +25,5 @@
 //
 //
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 //
@@ -55,13 +55,15 @@
   G4bool IsApplicable(const G4DynamicParticle* aParticle, const G4Element* )
   {
-    return IsZAApplicable(aParticle, 0., 0.);
+    return IsIsoApplicable(aParticle, 0, 0);
   }
 
-  G4bool IsZAApplicable(const G4DynamicParticle* aParticle, G4double /*ZZ*/, 
-			                                    G4double /*AA*/)
+  G4bool IsIsoApplicable(const G4DynamicParticle* aParticle,
+                         G4int /*ZZ*/, G4int /*AA*/)
   {
     G4bool result = false;
-    if( aParticle->GetDefinition()==G4Electron::ElectronDefinition()) result = true;
-    if( aParticle->GetDefinition()==G4Positron::PositronDefinition()) result = true;
+    if (aParticle->GetDefinition() == G4Electron::ElectronDefinition())
+       result = true;
+    if (aParticle->GetDefinition() == G4Positron::PositronDefinition())
+       result = true;
     return result;
   }
@@ -71,7 +73,6 @@
                            const G4Element* anElement, G4double T=0.);
 
-  G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle, 
-                                G4double ZZ, G4double AA, G4double T=0.);
-
+  G4double GetZandACrossSection(const G4DynamicParticle* aParticle, 
+                                G4int ZZ, G4int AA, G4double T=0.);
 
   G4double GetEquivalentPhotonEnergy();
@@ -87,5 +88,5 @@
 private:
   G4int    GetFunctions(G4double a, G4double* x, G4double* y, G4double* z);
-  //G4double LinearFit(G4double X, G4int N, const G4double* XN, const G4double* YN);
+
   G4double ThresholdEnergy(G4int Z, G4int N);
   G4double HighEnergyJ1(G4double lE);
@@ -111,24 +112,35 @@
   static G4double  lastH;    // Last value of the High energy A-dependence
 
-  static std::vector <G4double*> J1;     // Vector of pointers to the J1 tabulated functions
-  static std::vector <G4double*> J2;     // Vector of pointers to the J2 tabulated functions
-  static std::vector <G4double*> J3;     // Vector of pointers to the J3 tabulated functions
+  // Vector of pointers to the J1 tabulated functions
+  static std::vector <G4double*> J1;
+
+  // Vector of pointers to the J2 tabulated functions
+  static std::vector <G4double*> J2;
+
+  // Vector of pointers to the J3 tabulated functions
+  static std::vector <G4double*> J3;
 };
 
-inline G4double G4ElectroNuclearCrossSection::DFun(G4double x)// Parametrization of the PhotoNucCS
+
+inline G4double
+G4ElectroNuclearCrossSection::DFun(G4double x)
 {
-  static const G4double shd=1.0734;                    // HE PomShadowing(D)
-  static const G4double poc=0.0375;                    // HE Pomeron coefficient
-  static const G4double pos=16.5;                      // HE Pomeron shift
-  static const G4double reg=.11;                       // HE Reggeon slope
-  static const G4double mel=0.5109989;                 // Mass of an electron in MeV
-  static const G4double lmel=std::log(mel);                 // Log of an electron mass
-  G4double y=std::exp(x-lastG-lmel);                        // y for the x
-  G4double flux=lastG*(2.-y*(2.-y))-1.;                // flux factor
+  // Parametrization of the PhotoNucCS
+  static const G4double shd=1.0734;              // HE PomShadowing(D)
+  static const G4double poc=0.0375;              // HE Pomeron coefficient
+  static const G4double pos=16.5;                // HE Pomeron shift
+  static const G4double reg=.11;                 // HE Reggeon slope
+  static const G4double mel=0.5109989;           // Mass of an electron in MeV
+  static const G4double lmel=std::log(mel);      // Log of an electron mass
+  G4double y=std::exp(x-lastG-lmel);             // y for the x
+  G4double flux=lastG*(2.-y*(2.-y))-1.;          // flux factor
   return (poc*(x-pos)+shd*std::exp(-reg*x))*flux;
 }
 
-inline G4double G4ElectroNuclearCrossSection::Fun(G4double x) // Integrated PhoNuc cross section
+
+inline G4double
+G4ElectroNuclearCrossSection::Fun(G4double x)
 {
+  // Integrated PhoNuc cross section
   G4double dlg1=lastG+lastG-1.;
   G4double lgoe=lastG/lastE;
@@ -137,5 +149,7 @@
 }
 
-inline G4double G4ElectroNuclearCrossSection::HighEnergyJ1(G4double lEn)
+
+inline G4double
+G4ElectroNuclearCrossSection::HighEnergyJ1(G4double lEn)
 {
   static const G4double le=std::log(50000.); // std::log(E0)
@@ -150,5 +164,7 @@
 }
 
-inline G4double G4ElectroNuclearCrossSection::HighEnergyJ2(G4double lEn)
+
+inline G4double
+G4ElectroNuclearCrossSection::HighEnergyJ2(G4double lEn)
 {
   static const G4double e=50000.;       // E0
@@ -164,5 +180,7 @@
 }
 
-inline G4double G4ElectroNuclearCrossSection::HighEnergyJ3(G4double lEn)
+
+inline G4double
+G4ElectroNuclearCrossSection::HighEnergyJ3(G4double lEn)
 {
   static const G4double e=50000.;       // E0
Index: trunk/source/processes/hadronic/cross_sections/include/G4GGNuclNuclCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4GGNuclNuclCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4GGNuclNuclCrossSection.hh	(revision 1340)
@@ -31,7 +31,4 @@
 //
 //
-//
-//
-//
 // 24.11.08 V. Grichine - first implementation based on G4GlauberGribovCrossSection
 //
@@ -60,5 +57,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle* aDP, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle* aDP, G4int Z, G4int A);
 
   virtual
@@ -68,10 +65,10 @@
 
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, 
-				G4double Z, G4double A, 
+  G4double GetZandACrossSection(const G4DynamicParticle*, 
+				G4int Z, G4int A, 
 				G4double aTemperature = 0.0);
 
   G4double GetCoulombBarier(const G4DynamicParticle*, 
-				G4double Z, G4double A, G4double pR, G4double tR);
+			    G4double Z, G4double A, G4double pR, G4double tR);
 
   virtual
@@ -87,25 +84,16 @@
 
   G4double GetHadronNucleonXsc(const G4DynamicParticle*, const G4Element*);
-  G4double GetHadronNucleonXsc(const G4DynamicParticle*, G4double At, G4double Zt);
+  G4double GetHadronNucleonXsc(const G4DynamicParticle*, G4int At, G4int Zt);
 
   G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, const G4Element*);
-  G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4double At, G4double Zt);
-
-  // G4double GetHadronNucleonXscNS(const G4DynamicParticle*, const G4Element*);
-  // G4double GetHadronNucleonXscNS(const G4DynamicParticle*,G4double At, G4double Zt);
-
+  G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4int At, G4int Zt);
   G4double GetHadronNucleonXscNS(G4ParticleDefinition*,G4double pTkin, G4ParticleDefinition*);
 
-  // G4double GetHNinelasticXsc(const G4DynamicParticle*, const G4Element*);
-  // G4double GetHNinelasticXsc(const G4DynamicParticle*, G4double At, G4double Zt);
-
-  G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4double At, G4double Zt);
-
-  G4double CalculateEcmValue ( const G4double , const G4double , const G4double ); 
-
+  G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4int At, G4int Zt);
+  G4double CalculateEcmValue(const G4double, const G4double, const G4double); 
   G4double CalcMandelstamS( const G4double , const G4double , const G4double );
 
-  G4double GetElasticGlauberGribov(const G4DynamicParticle*,G4double Z, G4double A);
-  G4double GetInelasticGlauberGribov(const G4DynamicParticle*,G4double Z, G4double A);
+  G4double GetElasticGlauberGribov(const G4DynamicParticle*,G4int Z, G4int A);
+  G4double GetInelasticGlauberGribov(const G4DynamicParticle*,G4int Z, G4int A);
 
   G4double GetTotalGlauberGribovXsc()    { return fTotalXsc;     }; 
@@ -118,9 +106,7 @@
   G4double GetNucleusRadius(const G4DynamicParticle*, const G4Element*);
 
-
   G4double GetNucleusRadius(G4double At);
   G4double GetNucleusRadiusGG(G4double At);
   G4double GetNucleusRadiusDE(G4double At);
-
 
   inline void SetEnergyLowerLimit(G4double E ){fLowerLimit=E;};
@@ -144,9 +130,9 @@
 // Inlines
 
-inline
-G4double G4GGNuclNuclCrossSection::GetElasticGlauberGribov(
-	 const G4DynamicParticle* dp, G4double Z, G4double A)
+inline G4double
+G4GGNuclNuclCrossSection::GetElasticGlauberGribov(const G4DynamicParticle* dp,
+                                                  G4int Z, G4int A)
 {
-  GetIsoZACrossSection(dp, Z, A);
+  GetZandACrossSection(dp, Z, A);
   return fElasticXsc;
 }
@@ -154,13 +140,11 @@
 /////////////////////////////////////////////////////////////////
 
-inline
-G4double G4GGNuclNuclCrossSection::GetInelasticGlauberGribov(
-         const G4DynamicParticle* dp, G4double Z, G4double A)
+inline G4double
+G4GGNuclNuclCrossSection::GetInelasticGlauberGribov(const G4DynamicParticle* dp,
+                                                    G4int Z, G4int A)
 {
-  GetIsoZACrossSection(dp, Z, A);
+  GetZandACrossSection(dp, Z, A);
   return fInelasticXsc;
 }
 
-
-
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4GeneralSpaceNNCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4GeneralSpaceNNCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4GeneralSpaceNNCrossSection.hh	(revision 1340)
@@ -91,12 +91,12 @@
       const G4Element* theTarget);
 
-    virtual G4bool IsZAApplicable(const G4DynamicParticle* theProjectile,
-      G4double ZZ, G4double AA);
+    virtual G4bool IsIsoApplicable(const G4DynamicParticle* theProjectile,
+      G4int ZZ, G4int AA);
 
     virtual G4double GetCrossSection(const G4DynamicParticle* theProjectile,
       const G4Element* theTarget, G4double theTemperature);
 
-    virtual G4double GetIsoZACrossSection(const G4DynamicParticle* theProjectile,
-      G4double ZZ, G4double AA, G4double theTemperature);
+    virtual G4double GetZandACrossSection(const G4DynamicParticle* theProjectile,
+      G4int ZZ, G4int AA, G4double theTemperature);
 
     virtual void BuildPhysicsTable(const G4ParticleDefinition&)
@@ -114,5 +114,4 @@
      G4IonsShenCrossSection        *Shen;
 };
-////////////////////////////////////////////////////////////////////////////////
-//
+
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4GlauberGribovCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4GlauberGribovCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4GlauberGribovCrossSection.hh	(revision 1340)
@@ -47,4 +47,5 @@
 #include "G4Proton.hh"
 #include "G4Nucleus.hh"
+#include "G4HadTmpUtil.hh"
 
 #include "G4VCrossSectionDataSet.hh"
@@ -63,5 +64,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle* aDP, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle* aDP, G4int Z, G4int A);
 
   virtual
@@ -71,7 +72,7 @@
 
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, 
-				G4double Z, G4double A, 
-				G4double aTemperature = 0.0);
+  G4double GetZandACrossSection(const G4DynamicParticle*,
+                                G4int Z, G4int A,
+                                G4double aTemperature = 0.0);
 
   virtual
@@ -83,19 +84,19 @@
   {G4cout << "G4GlauberGribovCrossSection: uses Glauber-Gribov formula"<<G4endl;}
 
-  G4double GetRatioSD(const G4DynamicParticle*, G4double At, G4double Zt);
-  G4double GetRatioQE(const G4DynamicParticle*, G4double At, G4double Zt);
+  G4double GetRatioSD(const G4DynamicParticle*, G4int At, G4int Zt);
+  G4double GetRatioQE(const G4DynamicParticle*, G4int At, G4int Zt);
 
   G4double GetHadronNucleonXsc(const G4DynamicParticle*, const G4Element*);
-  G4double GetHadronNucleonXsc(const G4DynamicParticle*, G4double At, G4double Zt);
+  G4double GetHadronNucleonXsc(const G4DynamicParticle*, G4int At, G4int Zt);
 
   G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, const G4Element*);
-  G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4double At, G4double Zt);
+  G4double GetHadronNucleonXscPDG(const G4DynamicParticle*, G4int At, G4int Zt);
 
   G4double GetHadronNucleonXscNS(const G4DynamicParticle*, const G4Element*);
-  G4double GetHadronNucleonXscNS(const G4DynamicParticle*,G4double At, G4double Zt);
+  G4double GetHadronNucleonXscNS(const G4DynamicParticle*, G4int At, G4int Zt);
 
   G4double GetHNinelasticXsc(const G4DynamicParticle*, const G4Element*);
-  G4double GetHNinelasticXsc(const G4DynamicParticle*, G4double At, G4double Zt);
-  G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4double At, G4double Zt);
+  G4double GetHNinelasticXsc(const G4DynamicParticle*, G4int At, G4int Zt);
+  G4double GetHNinelasticXscVU(const G4DynamicParticle*, G4int At, G4int Zt);
 
   G4double CalculateEcmValue ( const G4double , const G4double , const G4double ); 
@@ -103,6 +104,6 @@
   G4double CalcMandelstamS( const G4double , const G4double , const G4double );
 
-  G4double GetElasticGlauberGribov(const G4DynamicParticle*,G4double Z, G4double A);
-  G4double GetInelasticGlauberGribov(const G4DynamicParticle*,G4double Z, G4double A);
+  G4double GetElasticGlauberGribov(const G4DynamicParticle*, G4int Z, G4int A);
+  G4double GetInelasticGlauberGribov(const G4DynamicParticle*, G4int Z, G4int A);
 
   G4double GetTotalGlauberGribovXsc()    { return fTotalXsc;     }; 
@@ -114,8 +115,8 @@
 
   G4double GetNucleusRadius(const G4DynamicParticle*, const G4Element*);
-  G4double GetNucleusRadius(G4double At);
-
-  inline G4double GetParticleBarCorTot( const G4ParticleDefinition* theParticle, G4double Z );
-  inline G4double GetParticleBarCorIn( const G4ParticleDefinition* theParticle, G4double Z );
+  G4double GetNucleusRadius(G4int At);
+
+  inline G4double GetParticleBarCorTot(const G4ParticleDefinition* theParticle, G4int Z);
+  inline G4double GetParticleBarCorIn(const G4ParticleDefinition* theParticle, G4int Z);
 
   inline void SetEnergyLowerLimit(G4double E ){fLowerLimit=E;};
@@ -180,8 +181,9 @@
 
 inline
-G4double G4GlauberGribovCrossSection::GetElasticGlauberGribov(
-	 const G4DynamicParticle* dp, G4double Z, G4double A)
-{
-  GetIsoZACrossSection(dp, Z, A);
+G4double
+G4GlauberGribovCrossSection::GetElasticGlauberGribov(const G4DynamicParticle* dp,
+                                                     G4int Z, G4int A)
+{
+  GetZandACrossSection(dp, Z, A);
   return fElasticXsc;
 }
@@ -190,8 +192,9 @@
 
 inline
-G4double G4GlauberGribovCrossSection::GetInelasticGlauberGribov(
-         const G4DynamicParticle* dp, G4double Z, G4double A)
-{
-  GetIsoZACrossSection(dp, Z, A);
+G4double
+G4GlauberGribovCrossSection::GetInelasticGlauberGribov(const G4DynamicParticle* dp,
+                                                       G4int Z, G4int A)
+{
+  GetZandACrossSection(dp, Z, A);
   return fInelasticXsc;
 }
@@ -204,14 +207,12 @@
 
 inline G4double G4GlauberGribovCrossSection::GetParticleBarCorTot( 
-                          const G4ParticleDefinition* theParticle, G4double Z )
-{
-  G4int iZ = G4int(Z);
-
-  if( iZ >= 2 && iZ <= 92)
+                          const G4ParticleDefinition* theParticle, G4int Z)
+{
+  if(Z >= 2 && Z <= 92)
   {
-    if(      theParticle == theProton ) return fProtonBarCorrectionTot[iZ]; 
-    else if( theParticle == theNeutron) return fNeutronBarCorrectionTot[iZ]; 
-    else if( theParticle == thePiPlus ) return fPionPlusBarCorrectionTot[iZ];
-    else if( theParticle == thePiMinus) return fPionMinusBarCorrectionTot[iZ];
+    if(      theParticle == theProton ) return fProtonBarCorrectionTot[Z]; 
+    else if( theParticle == theNeutron) return fNeutronBarCorrectionTot[Z]; 
+    else if( theParticle == thePiPlus ) return fPionPlusBarCorrectionTot[Z];
+    else if( theParticle == thePiMinus) return fPionMinusBarCorrectionTot[Z];
     else return 1.0;
   }
@@ -226,14 +227,12 @@
 
 inline G4double G4GlauberGribovCrossSection::GetParticleBarCorIn( 
-                          const G4ParticleDefinition* theParticle, G4double Z )
-{
-  G4int iZ = G4int(Z);
-
-  if( iZ >= 2 && iZ <= 92)
+                          const G4ParticleDefinition* theParticle, G4int Z)
+{
+  if(Z >= 2 && Z <= 92)
   {
-    if(      theParticle == theProton ) return fProtonBarCorrectionIn[iZ]; 
-    else if( theParticle == theNeutron) return fNeutronBarCorrectionIn[iZ]; 
-    else if( theParticle == thePiPlus ) return fPionPlusBarCorrectionIn[iZ];
-    else if( theParticle == thePiMinus) return fPionMinusBarCorrectionIn[iZ];
+    if(      theParticle == theProton ) return fProtonBarCorrectionIn[Z]; 
+    else if( theParticle == theNeutron) return fNeutronBarCorrectionIn[Z]; 
+    else if( theParticle == thePiPlus ) return fPionPlusBarCorrectionIn[Z];
+    else if( theParticle == thePiMinus) return fPionMinusBarCorrectionIn[Z];
     else return 1.0;
   }
Index: trunk/source/processes/hadronic/cross_sections/include/G4HadronCaptureDataSet.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4HadronCaptureDataSet.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4HadronCaptureDataSet.hh	(revision 1340)
@@ -23,5 +23,4 @@
 // * acceptance of all terms of the Geant4 Software license.          *
 // ********************************************************************
-//
 //
 //
@@ -64,6 +63,6 @@
    }
 
-   G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
-                         G4double ZZ, G4double AA)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aParticle,
+                          G4int ZZ, G4int AA)
    {
      return theHadronCrossSections->IsApplicable(aParticle, ZZ, AA);
@@ -77,7 +76,6 @@
    }
 
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle,
-                            G4double ZZ, G4double AA,
-                            G4double /*aTemperature*/)
+   G4double GetZandACrossSection(const G4DynamicParticle* aParticle,
+                                 G4int ZZ, G4int AA, G4double /*aTemperature*/)
    {
      return theHadronCrossSections->GetCaptureCrossSection(aParticle, ZZ, AA);
Index: trunk/source/processes/hadronic/cross_sections/include/G4HadronCrossSections.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4HadronCrossSections.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4HadronCrossSections.hh	(revision 1340)
@@ -25,5 +25,5 @@
 //
 //
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 //
@@ -55,5 +55,5 @@
 #include "G4VProcess.hh"
 #include "G4DynamicParticle.hh"
-//#include "G4ParticleTypes.hh"
+#include "G4HadTmpUtil.hh"
 #include "G4PionPlus.hh"
 #include "G4PionZero.hh"
@@ -84,5 +84,4 @@
 #include "G4OmegaMinus.hh"
 #include "G4AntiOmegaMinus.hh"
-//#include "G4LPhysicsFreeVector.hh"
 
 
@@ -95,10 +94,8 @@
    G4HadronCrossSections()
      : prevParticleDefinition(0), lastEkx(0.), lastEkxPower(0.), verboseLevel(0)
-   {
-   }
+   {}
 
    ~G4HadronCrossSections()
-   {
-   }
+   {}
 
    static G4HadronCrossSections* Instance()
@@ -123,5 +120,5 @@
 
    G4double GetElasticCrossSection(const G4DynamicParticle*,
-                                   G4double /*ZZ*/, G4double /*AA*/);
+                                   G4int /*ZZ*/, G4int /*AA*/);
 
    G4double GetInelasticCrossSection(const G4DynamicParticle*, 
@@ -129,25 +126,27 @@
 
    G4double GetInelasticCrossSection(const G4DynamicParticle*,
-                                     G4double /*ZZ*/, G4double /*AA*/);
+                                     G4int /*ZZ*/, G4int /*AA*/);
 
    G4double GetCaptureCrossSection(const G4DynamicParticle* aParticle,
                                    const G4Element* anElement)
    {
-     return GetCaptureCrossSection(aParticle, anElement->GetZ(),
-                                              anElement->GetN());
+     G4int Z = G4lrint(anElement->GetZ());
+     G4int A = G4lrint(anElement->GetN());
+     return GetCaptureCrossSection(aParticle, Z, A);
    }
 
    G4double GetCaptureCrossSection(const G4DynamicParticle*,
-                                   G4double /*ZZ*/, G4double /*AA*/);
+                                   G4int /*ZZ*/, G4int /*AA*/);
 
    G4double GetFissionCrossSection(const G4DynamicParticle* aParticle,
                                    const G4Element* anElement)
    {
-     return GetFissionCrossSection(aParticle, anElement->GetZ(),
-                                              anElement->GetN());
+     G4int Z = G4lrint(anElement->GetZ());
+     G4int A = G4lrint(anElement->GetN());
+     return GetFissionCrossSection(aParticle, Z, A);
    }
 
    G4double GetFissionCrossSection(const G4DynamicParticle*,
-                                   G4double /*ZZ*/, G4double /*AA*/);
+                                   G4int /*ZZ*/, G4int /*AA*/);
 
 
@@ -177,5 +176,5 @@
 
    void CalcScatteringCrossSections(const G4DynamicParticle*, 
-                                    G4double /*ZZ*/, G4double /*AA*/);
+                                    G4int /*ZZ*/, G4int /*AA*/);
 
    static G4HadronCrossSections* theInstance;
@@ -199,5 +198,4 @@
    static G4float csin[NPARTS][TSIZE];
 
-
    static G4float cspiel[3][TSIZE];
    static G4float cspiin[3][TSIZE];
Index: trunk/source/processes/hadronic/cross_sections/include/G4HadronElasticDataSet.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4HadronElasticDataSet.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4HadronElasticDataSet.hh	(revision 1340)
@@ -63,6 +63,6 @@
    }
 
-   G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
-                         G4double ZZ, G4double AA)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aParticle,
+                          G4int ZZ, G4int AA)
    {
      return theHadronCrossSections->IsApplicable(aParticle, ZZ, AA);
@@ -77,7 +77,7 @@
    }
 
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle,
-                            G4double ZZ, G4double AA,
-                            G4double /*aTemperature*/)
+   G4double GetZandACrossSection(const G4DynamicParticle* aParticle,
+                                 G4int ZZ, G4int AA,
+                                 G4double /*aTemperature*/)
    {
      return theHadronCrossSections->GetElasticCrossSection(aParticle, ZZ, AA);
Index: trunk/source/processes/hadronic/cross_sections/include/G4HadronFissionDataSet.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4HadronFissionDataSet.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4HadronFissionDataSet.hh	(revision 1340)
@@ -62,6 +62,6 @@
    }
 
-   G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
-                         G4double ZZ, G4double AA)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aParticle,
+                          G4int ZZ, G4int AA)
    {
      return theHadronCrossSections->IsApplicable(aParticle, ZZ, AA);
@@ -76,7 +76,7 @@
    }
 
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle,
-                            G4double ZZ, G4double AA,
-                            G4double /*aTemperature*/)
+   G4double GetZandACrossSection(const G4DynamicParticle* aParticle,
+                                 G4int ZZ, G4int AA,
+                                 G4double /*aTemperature*/)
    {
      return theHadronCrossSections->GetFissionCrossSection(aParticle, ZZ, AA);
Index: trunk/source/processes/hadronic/cross_sections/include/G4HadronInelasticDataSet.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4HadronInelasticDataSet.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4HadronInelasticDataSet.hh	(revision 1340)
@@ -63,6 +63,6 @@
 
 
-   G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
-                         G4double ZZ, G4double AA)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aParticle,
+                          G4int ZZ, G4int AA)
    {
      return theHadronCrossSections->IsApplicable(aParticle, ZZ, AA);
@@ -77,7 +77,7 @@
    }
 
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle,
-                            G4double ZZ, G4double AA,
-                            G4double /*aTemperature*/)
+   G4double GetZandACrossSection(const G4DynamicParticle* aParticle,
+                                 G4int ZZ, G4int AA,
+                                 G4double /*aTemperature*/)
    {
      return theHadronCrossSections->GetInelasticCrossSection(aParticle, ZZ, AA);
Index: trunk/source/processes/hadronic/cross_sections/include/G4HadronNucleonXsc.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4HadronNucleonXsc.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4HadronNucleonXsc.hh	(revision 1340)
@@ -31,6 +31,4 @@
 //
 //
-//
-//
 // 14.03.07 V. Grichine - first implementation
 //
@@ -59,5 +57,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle* aDP, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle* aDP, G4int Z, G4int A);
 
   virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4IonProtonCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4IonProtonCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4IonProtonCrossSection.hh	(revision 1340)
@@ -24,68 +24,69 @@
 // ********************************************************************
 //
-#ifndef G4IonProtonCrossSection_h
-#define G4IonProtonCrossSection_h
-
-#include "globals.hh"
-#include "G4Proton.hh"
-// Class Description
+// $Id: G4IonProtonCrossSection.hh,v 1.12 2010/10/15 21:05:10 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
+//
+// -------------------------------------------------------------------
+//
+// GEANT4 Class header file
+//
+// File name:    G4IonProtonCrossSection
+//
+//
 // Cross-sections for ion proton scattering up to 20 GeV, getting the low
 // energy threshold behaviour right.
 // H.P. Wellisch (TRIUMF), D. Axen (British Columbia U.). 1996. 
 // Published in Phys.Rev.C54:1329-1332,1996 
-// Class Description - End
+//
+// Original by H.P.Wellisch 28 June 2001
+//
+// Modifications:
+// 30-07-2010 V.Ivanchenko move virtual methods to source,
+//                         add constructor and destructor,
+//                         make G4ProtonInelasticCrossSection class member,
+//                         fix bug in kinematics
+//
+
+#ifndef G4IonProtonCrossSection_h
+#define G4IonProtonCrossSection_h 1
 
 #include "G4VCrossSectionDataSet.hh"
-#include "G4ProtonInelasticCrossSection.hh"
+#include "globals.hh"
+
+class G4ProtonInelasticCrossSection;
 
 class G4IonProtonCrossSection : public G4VCrossSectionDataSet
 {
-   public:
+public:
 
-   virtual
-   G4bool IsZAApplicable(const G4DynamicParticle* aPart, G4double /*ZZ*/,
-                         G4double AA)
-   {
-     G4bool result = false;
-     if((AA < 1.1) &&
-        ( aPart->GetKineticEnergy()/aPart->GetDefinition()
-                                         ->GetBaryonNumber() < 20*GeV &&
-	  aPart->GetDefinition()->GetBaryonNumber() > 4)
-       ) result = true;
-     return result;
-   }
+  G4IonProtonCrossSection();
 
-   virtual
-   G4bool IsApplicable(const G4DynamicParticle* aPart, const G4Element* anEle)
-   {
-     return IsZAApplicable(aPart, 0., anEle->GetN());
-   }
+  virtual ~G4IonProtonCrossSection();
 
-   virtual
-   G4double GetCrossSection(const G4DynamicParticle* aPart, 
-                            const G4Element*, G4double )
-   {
-     return GetIsoZACrossSection(aPart, 0., 0., 0.);
-   }
+  virtual
+  G4bool IsApplicable(const G4DynamicParticle* aPart, const G4Element* anEle);
 
-   virtual
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aPart, 
-                                 G4double /*ZZ*/, G4double /*AA*/, 
-                                 G4double /*temperature*/)
-   {
-     G4ProtonInelasticCrossSection theForward;
-     return theForward.GetCrossSection(aPart->GetKineticEnergy(),
-                                  aPart->GetDefinition()->GetBaryonNumber(),
-				  aPart->GetDefinition()->GetPDGCharge());
-   }
+  virtual
+  G4bool IsIsoApplicable(const G4DynamicParticle* aPart,
+                         G4int Z, G4int A);
 
+  virtual
+  G4double GetCrossSection(const G4DynamicParticle* aPart, 
+			   const G4Element*, G4double);
+  
+  virtual
+  G4double GetZandACrossSection(const G4DynamicParticle* aPart, 
+				G4int Z=1, G4int A=1, G4double T=0.);
 
-   virtual
-   void BuildPhysicsTable(const G4ParticleDefinition&)
-   {}
+  virtual void BuildPhysicsTable(const G4ParticleDefinition&);
 
-   virtual
-   void DumpPhysicsTable(const G4ParticleDefinition&)
-   {G4cout << "G4IonProtonCrossSection: uses formula"<<G4endl;}
+  virtual void DumpPhysicsTable(const G4ParticleDefinition&);
+
+private: // Without Description
+
+  G4IonProtonCrossSection & operator=(const G4IonProtonCrossSection &right);
+  G4IonProtonCrossSection(const G4IonProtonCrossSection&);
+
+  G4ProtonInelasticCrossSection* theForward;
 
 };
Index: trunk/source/processes/hadronic/cross_sections/include/G4IonsKoxCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4IonsKoxCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4IonsKoxCrossSection.hh	(revision 1340)
@@ -57,10 +57,11 @@
    G4bool IsApplicable(const G4DynamicParticle* aDP, const G4Element*)
    {
-     return IsZAApplicable(aDP, 0., 0.);
+     return IsIsoApplicable(aDP, 0, 0);
    }
-   
+
+
    virtual
-   G4bool IsZAApplicable(const G4DynamicParticle* aDP, G4double /*ZZ*/,
-                       G4double /*AA*/) 
+   G4bool IsIsoApplicable(const G4DynamicParticle* aDP,
+                          G4int /*ZZ*/, G4int /*AA*/) 
    {
       G4int baryonNumber = aDP->GetDefinition()->GetBaryonNumber();
@@ -71,11 +72,13 @@
    }
 
+
    virtual
    G4double GetCrossSection(const G4DynamicParticle*, 
                             const G4Element*, G4double aTemperature);
 
+
    virtual
-   G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double ZZ,
-                                 G4double AA, G4double aTemperature);
+   G4double GetZandACrossSection(const G4DynamicParticle*, G4int ZZ,
+                                 G4int AA, G4double aTemperature);
 
    virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4IonsShenCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4IonsShenCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4IonsShenCrossSection.hh	(revision 1340)
@@ -61,16 +61,16 @@
    G4bool IsApplicable(const G4DynamicParticle* aDP, const G4Element*)
    {
-      return IsZAApplicable(aDP, 0., 0.);
+     return IsIsoApplicable(aDP, 0, 0);
    }
 
    virtual
-   G4bool IsZAApplicable(const G4DynamicParticle* aDP,
-                         G4double /*ZZ*/, G4double /*AA*/)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aDP,
+                          G4int /*ZZ*/, G4int /*AA*/)
    {
-      G4int baryonNumber = aDP->GetDefinition()->GetBaryonNumber();
-      G4double kineticEnergy = aDP->GetKineticEnergy(); 
-      if ( kineticEnergy / baryonNumber <= upperLimit ) 
-         return true;
-      return false;
+     G4int baryonNumber = aDP->GetDefinition()->GetBaryonNumber();
+     G4double kineticEnergy = aDP->GetKineticEnergy(); 
+     if ( kineticEnergy / baryonNumber <= upperLimit ) 
+        return true;
+     return false;
    }
 
@@ -81,6 +81,6 @@
 
    virtual
-   G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double ZZ, 
-                                 G4double AA, G4double aTemperature);
+   G4double GetZandACrossSection(const G4DynamicParticle*, G4int ZZ, 
+                                 G4int AA, G4double aTemperature);
 
    virtual
@@ -97,6 +97,6 @@
       const G4double r0;
 
-      G4double calEcmValue ( const G4double , const G4double , const G4double ); 
-      G4double calCeValue ( const G4double ); 
+      G4double calEcmValue(const G4double, const G4double, const G4double); 
+      G4double calCeValue(const G4double); 
 };
 
Index: trunk/source/processes/hadronic/cross_sections/include/G4IonsSihverCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4IonsSihverCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4IonsSihverCrossSection.hh	(revision 1340)
@@ -54,10 +54,10 @@
    G4bool IsApplicable(const G4DynamicParticle* aDP, const G4Element*)
    {
-     return IsZAApplicable(aDP, 0., 0.);
+     return IsIsoApplicable(aDP, 0, 0);
    }
 
    virtual 
-   G4bool IsZAApplicable(const G4DynamicParticle* aDP, G4double /*ZZ*/, 
-                         G4double /*AA*/)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aDP, G4int /*ZZ*/, 
+                          G4int /*AA*/)
    {
       G4int BaryonNumber = aDP->GetDefinition()->GetBaryonNumber();
@@ -73,6 +73,6 @@
 
    virtual
-   G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double ZZ, 
-                                 G4double AA, G4double aTemperature);
+   G4double GetZandACrossSection(const G4DynamicParticle*, G4int ZZ, 
+                                 G4int AA, G4double aTemperature);
 
    virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4NeutronCaptureXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4NeutronCaptureXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4NeutronCaptureXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4NeutronCaptureXS.hh,v 1.1 2009/11/12 00:36:01 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NeutronCaptureXS.hh,v 1.4 2010/10/15 22:32:40 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -38,6 +38,10 @@
 // Modifications:
 //
+
+// Class Description:
+// This is a base class for neutron radiative capture cross section based on
+// data files from G4NEUTRONXSDATA data set 
+// Class Description - End
  
-
 #ifndef G4NeutronCaptureXS_h
 #define G4NeutronCaptureXS_h 1
@@ -45,4 +49,5 @@
 #include "G4VCrossSectionDataSet.hh"
 #include "globals.hh"
+#include <vector>
 
 class G4DynamicParticle;
@@ -55,16 +60,13 @@
 public: // With Description
 
-  G4int Z;
   G4NeutronCaptureXS();
 
   virtual ~G4NeutronCaptureXS();
 
-  // The following methods need to be implemented for each new data set.
   virtual
   G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, 
-			G4double /*Z*/, G4double /*A*/);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/);
 
   virtual
@@ -79,17 +81,5 @@
   void DumpPhysicsTable(const G4ParticleDefinition&);
 
-
-public: // Without Description
-
-  inline void SetVerboseLevel(G4int value)
-  {
-    verboseLevel = value;
-  }
-  inline G4int GetVerboseLevel()
-  {
-    return verboseLevel;
-  }
-
-private: // Without Description
+private: 
 
   void Initialise(G4int Z, const char* = 0);
@@ -98,6 +88,7 @@
   G4NeutronCaptureXS(const G4NeutronCaptureXS&);
 
-  G4double         emax;
-  G4PhysicsVector* data[93];
+  G4double emax;
+  G4int    maxZ;
+  std::vector<G4PhysicsVector*> data;
 
   G4bool  isInitialized;
Index: trunk/source/processes/hadronic/cross_sections/include/G4NeutronElasticXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4NeutronElasticXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4NeutronElasticXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4NeutronElasticXS.hh,v 1.3 2009/11/19 11:51:46 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NeutronElasticXS.hh,v 1.6 2010/10/15 22:32:55 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -39,4 +39,8 @@
 //
  
+// Class Description:
+// This is a base class for neutron elastic hadronic cross section based on
+// data files from G4NEUTRONXSDATA data set 
+// Class Description - End
 
 #ifndef G4NeutronElasticXS_h
@@ -45,4 +49,5 @@
 #include "G4VCrossSectionDataSet.hh"
 #include "globals.hh"
+#include <vector>
 
 class G4DynamicParticle;
@@ -51,4 +56,5 @@
 class G4PhysicsVector;
 class G4GlauberGribovCrossSection;
+class G4HadronNucleonXsc;
 
 class G4NeutronElasticXS : public G4VCrossSectionDataSet
@@ -56,16 +62,13 @@
 public: // With Description
 
-  G4int Z;
   G4NeutronElasticXS();
 
   virtual ~G4NeutronElasticXS();
 
-  // The following methods need to be implemented for each new data set.
   virtual
   G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, 
-			G4double /*Z*/, G4double /*A*/);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/);
 
   virtual
@@ -80,16 +83,5 @@
   void DumpPhysicsTable(const G4ParticleDefinition&);
 
-public: // Without Description
-
-  inline void SetVerboseLevel(G4int value)
-  {
-    verboseLevel = value;
-  }
-  inline G4int GetVerboseLevel()
-  {
-    return verboseLevel;
-  }
-
-private: // Without Description
+private: 
 
   void Initialise(G4int Z, G4DynamicParticle* dp = 0, const char* = 0);
@@ -99,7 +91,11 @@
   
   G4GlauberGribovCrossSection* ggXsection;
+  G4HadronNucleonXsc* fNucleon;
 
-  G4PhysicsVector* data[93];
-  G4double         coeff[93];
+  const G4ParticleDefinition* proton;
+
+  std::vector<G4PhysicsVector*> data;
+  std::vector<G4double>         coeff;
+  G4int   maxZ;
 
   G4bool  isInitialized;
Index: trunk/source/processes/hadronic/cross_sections/include/G4NeutronInelasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4NeutronInelasticCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4NeutronInelasticCrossSection.hh	(revision 1340)
@@ -58,6 +58,6 @@
    }
 
-   G4bool IsZAApplicable(const G4DynamicParticle* aPart,
-                         G4double ZZ, G4double /*AA*/)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aPart,
+                          G4int ZZ, G4int /*AA*/)
    {
      G4bool result = false;
@@ -74,6 +74,6 @@
                             const G4Element*, G4double aTemperature);
 
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle,
-                                 G4double ZZ, G4double AA,
+   G4double GetZandACrossSection(const G4DynamicParticle* aParticle,
+                                 G4int ZZ, G4int AA,
                                  G4double /*aTemperature*/)
    {
@@ -82,5 +82,6 @@
   
 
-   G4double GetCrossSection(G4double anEnergy, G4double anA, G4double aZ);
+   G4double GetCrossSection(G4double anEnergy, G4int anA, G4int aZ);
+
 
    virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4NeutronInelasticXS.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4NeutronInelasticXS.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4NeutronInelasticXS.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4NeutronInelasticXS.hh,v 1.3 2009/11/19 11:52:27 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NeutronInelasticXS.hh,v 1.6 2010/10/15 22:33:22 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -38,6 +38,10 @@
 // Modifications:
 //
+
+// Class Description:
+// This is a base class for neutron inelastic hadronic cross section based on
+// data files from G4NEUTRONXSDATA data set 
+// Class Description - End
  
-
 #ifndef G4NeutronInelasticXS_h
 #define G4NeutronInelasticXS_h 1
@@ -45,4 +49,5 @@
 #include "G4VCrossSectionDataSet.hh"
 #include "globals.hh"
+#include <vector>
 
 class G4DynamicParticle;
@@ -51,25 +56,22 @@
 class G4PhysicsVector;
 class G4GlauberGribovCrossSection;
+class G4HadronNucleonXsc;
 
 class G4NeutronInelasticXS : public G4VCrossSectionDataSet
 {
-public: // With Description
+public: 
 
-  G4int Z;
   G4NeutronInelasticXS();
 
   virtual ~G4NeutronInelasticXS();
 
-  // The following methods need to be implemented for each new data set.
   virtual
   G4bool IsApplicable(const G4DynamicParticle*, const G4Element*);
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, 
-			G4double /*Z*/, G4double /*A*/);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int /*Z*/, G4int /*A*/);
 
   virtual
-  G4double GetCrossSection(const G4DynamicParticle*, 
-			   const G4Element*, 
+  G4double GetCrossSection(const G4DynamicParticle*, const G4Element*, 
 	 		   G4double aTemperature = 0.);
 
@@ -80,16 +82,5 @@
   void DumpPhysicsTable(const G4ParticleDefinition&);
 
-public: // Without Description
-
-  inline void SetVerboseLevel(G4int value)
-  {
-    verboseLevel = value;
-  }
-  inline G4int GetVerboseLevel()
-  {
-    return verboseLevel;
-  }
-
-private: // Without Description
+private: 
 
   void Initialise(G4int Z, G4DynamicParticle* dp = 0, const char* = 0);
@@ -99,7 +90,11 @@
   
   G4GlauberGribovCrossSection* ggXsection;
+  G4HadronNucleonXsc* fNucleon;
 
-  G4PhysicsVector* data[93];
-  G4double         coeff[93];
+  const G4ParticleDefinition* proton;
+
+  std::vector<G4PhysicsVector*> data;
+  std::vector<G4double>         coeff;
+  G4int   maxZ;
 
   G4bool  isInitialized;
Index: trunk/source/processes/hadronic/cross_sections/include/G4NucleonNuclearCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4NucleonNuclearCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4NucleonNuclearCrossSection.hh	(revision 1340)
@@ -52,7 +52,9 @@
   virtual ~G4NucleonNuclearCrossSection();
 
-  virtual G4bool IsApplicable(const G4DynamicParticle* aParticle, const G4Element* anElement);
-
-  virtual G4bool IsZAApplicable(const G4DynamicParticle* aParticle, G4double Z, G4double A);
+  virtual G4bool IsApplicable(const G4DynamicParticle* aParticle,
+                              const G4Element* anElement);
+
+  virtual G4bool IsIsoApplicable(const G4DynamicParticle* aParticle,
+                                 G4int Z, G4int A);
 
   G4double GetCrossSection(const G4DynamicParticle* aParticle, 
@@ -60,9 +62,9 @@
                            G4double T=0.);
 
-  G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle, 
-                                G4double ZZ, G4double AA, G4double T=0. );
+  G4double GetZandACrossSection(const G4DynamicParticle* aParticle, 
+                                G4int ZZ, G4int AA, G4double T=0. );
 
   G4double GetElasticCrossSection(const G4DynamicParticle* aParticle, 
-				  G4double ZZ, G4double AA);
+				  G4int ZZ, G4int AA);
 
   G4double GetTotalXsc()  { return fTotalXsc;   };
@@ -190,7 +192,7 @@
 inline
 G4double G4NucleonNuclearCrossSection::GetElasticCrossSection(
-         const G4DynamicParticle* dp, G4double ZZ, G4double AA)
+         const G4DynamicParticle* dp, G4int ZZ, G4int AA)
 {
-  GetIsoZACrossSection(dp, ZZ, AA);
+  GetZandACrossSection(dp, ZZ, AA);
   return fElasticXsc;
 }
Index: trunk/source/processes/hadronic/cross_sections/include/G4PhotoNuclearCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4PhotoNuclearCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4PhotoNuclearCrossSection.hh	(revision 1340)
@@ -25,5 +25,5 @@
 //
 //
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 //
@@ -53,9 +53,9 @@
   G4bool IsApplicable(const G4DynamicParticle* particle, const G4Element* )
   {
-    return IsZAApplicable(particle, 0, 0);
+    return IsIsoApplicable(particle, 0, 0);
   }
 
-  G4bool IsZAApplicable(const G4DynamicParticle* particle,
-                        G4double /*ZZ*/, G4double /*AA*/)
+  G4bool IsIsoApplicable(const G4DynamicParticle* particle,
+                         G4int /*ZZ*/, G4int /*AA*/)
   {
     G4bool result = false;
@@ -68,7 +68,7 @@
                            const G4Element* element, G4double temp = 0.);
 
-  G4double GetIsoZACrossSection(const G4DynamicParticle* particle,
-                                G4double ZZ, G4double AA,
-                                G4double /*aTemperature*/);
+
+  G4double GetZandACrossSection(const G4DynamicParticle* particle,
+                                G4int ZZ, G4int AA, G4double /*aTemperature*/);
 
 
@@ -78,10 +78,13 @@
 
 private:
-  G4int    GetFunctions(G4double a, G4double* y, G4double* z);
-  G4double EquLinearFit(G4double X, G4int N,const G4double X0,const G4double XD, const G4double* Y);
+
+  G4int GetFunctions(G4double a, G4double* y, G4double* z);
+  G4double EquLinearFit(G4double X, G4int N, const G4double X0,
+                        const G4double XD, const G4double* Y);
   G4double ThresholdEnergy(G4int Z, G4int N);
 
 // Body
 private:
+
   static G4int     lastN;   // The last N of calculated nucleus
   static G4int     lastZ;   // The last Z of calculated nucleus
@@ -93,6 +96,9 @@
   static G4double  lastSP;  // Last value of the ShadowingPomeron (A-dependent)
 
-  static std::vector <G4double*> GDR;   // Vector of pointers to the GDRPhotonuclearCrossSection
-  static std::vector <G4double*> HEN;   // Vector of pointers to the HighEnPhotonuclearCrossSect
+  // Vector of pointers to the GDRPhotonuclearCrossSection
+  static std::vector <G4double*> GDR;
+
+  // Vector of pointers to the HighEnPhotonuclearCrossSect
+  static std::vector <G4double*> HEN;
 
 };
Index: trunk/source/processes/hadronic/cross_sections/include/G4PiNuclearCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4PiNuclearCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4PiNuclearCrossSection.hh	(revision 1340)
@@ -42,5 +42,6 @@
   virtual ~G4PiNuclearCrossSection();
 
-  G4bool IsApplicable(const G4DynamicParticle* aParticle, const G4Element* anElement)
+  G4bool IsApplicable(const G4DynamicParticle* aParticle,
+                      const G4Element* anElement)
   {
     G4bool result = false;
@@ -52,14 +53,15 @@
   }
 
-  G4bool IsZAApplicable(const G4DynamicParticle* particle,
-                        G4double ZZ, G4double /*AA*/)
+  G4bool
+  IsIsoApplicable(const G4DynamicParticle* particle, G4int ZZ, G4int /*AA*/)
   {
     G4bool result = false;
     if(particle->GetDefinition() == G4PionMinus::PionMinus()) result=true;
     if(particle->GetDefinition() == G4PionPlus::PionPlus())   result=true;
-    if(G4lrint(ZZ) == 1) result = false;
+    if(ZZ == 1) result = false;
     if(particle->GetKineticEnergy() > 99.9*TeV) result=false;
     return result;
   }
+
 
   G4double GetCrossSection(const G4DynamicParticle* particle, 
@@ -67,14 +69,15 @@
                            G4double temperature)
   {
-    return GetIsoZACrossSection(particle, element->GetZ(), 
-                                element->GetN(), temperature);
+    G4int Z = G4lrint(element->GetZ());
+    G4int A = G4lrint(element->GetN());
+    return GetZandACrossSection(particle, Z, A, temperature);
   }
 
-  G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle,
-                                G4double ZZ, G4double AA,
+  G4double GetZandACrossSection(const G4DynamicParticle* aParticle,
+                                G4int ZZ, G4int AA,
                                 G4double /*aTemperature*/);
 
-  G4double GetTotalXsc()  { return fTotalXsc;   };
-  G4double GetElasticXsc(){ return fElasticXsc; };
+  G4double GetTotalXsc() {return fTotalXsc;};
+  G4double GetElasticXsc() {return fElasticXsc;};
 
 
Index: trunk/source/processes/hadronic/cross_sections/include/G4ProtonInelasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4ProtonInelasticCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4ProtonInelasticCrossSection.hh	(revision 1340)
@@ -56,5 +56,5 @@
    {
      G4bool result = false;
-     if(( aPart->GetDefinition()==G4Proton::Proton()) &&
+     if ( (aPart->GetDefinition()==G4Proton::Proton()) &&
         ( aPart->GetKineticEnergy()<100*TeV) ) result = true;
      if(aEle->GetZ()<3) result = false;
@@ -62,6 +62,7 @@
    }
 
-   G4bool IsZAApplicable(const G4DynamicParticle* aParticle,
-                         G4double ZZ, G4double /*AA*/)
+
+   G4bool
+   IsIsoApplicable(const G4DynamicParticle* aParticle, G4int ZZ, G4int /*AA*/)
    {
      G4bool result = false;
@@ -72,11 +73,13 @@
    }
 
+
    virtual
    G4double GetCrossSection(const G4DynamicParticle*, 
                             const G4Element*, G4double aTemperature);
+
    
-   G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle, 
-                                 G4double ZZ, G4double AA, 
-                                 G4double /*aTemperature*/)
+   G4double
+   GetZandACrossSection(const G4DynamicParticle* aParticle, 
+                        G4int ZZ, G4int AA, G4double /*aTemperature*/)
    {
      return GetCrossSection(aParticle->GetKineticEnergy(), AA, ZZ);
@@ -84,9 +87,11 @@
  
 
-   G4double GetCrossSection(G4double anEnergy, G4double anA, G4double aZ);
+   G4double GetCrossSection(G4double anEnergy, G4int anA, G4int aZ);
+
 
    virtual
    void BuildPhysicsTable(const G4ParticleDefinition&)
    {}
+
 
    virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4TripathiCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4TripathiCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4TripathiCrossSection.hh	(revision 1340)
@@ -49,13 +49,13 @@
    G4bool IsApplicable(const G4DynamicParticle* aPart, const G4Element*)
    {
-     return IsZAApplicable(aPart, 0., 0.);
+     return IsIsoApplicable(aPart, 0, 0);
    }
 
    virtual
-   G4bool IsZAApplicable(const G4DynamicParticle* aPart, G4double /*ZZ*/,
-                         G4double /*AA*/)
+   G4bool IsIsoApplicable(const G4DynamicParticle* aPart,
+                          G4int /*ZZ*/, G4int /*AA*/)
    {
      G4bool result = false;
-     if(( aPart->GetDefinition()->GetBaryonNumber()>2.5) &&
+     if ( (aPart->GetDefinition()->GetBaryonNumber()>2.5) &&
         ( aPart->GetKineticEnergy()/aPart->GetDefinition()->GetBaryonNumber()<1*GeV) ) result = true;
      return result;
@@ -68,6 +68,6 @@
 
    virtual
-   G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double ZZ,
-                                 G4double AA, G4double aTemperature);
+   G4double GetZandACrossSection(const G4DynamicParticle*, G4int ZZ,
+                                 G4int AA, G4double aTemperature);
 
    virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4TripathiLightCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4TripathiLightCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4TripathiLightCrossSection.hh	(revision 1340)
@@ -86,6 +86,6 @@
       const G4Element* theTarget);
 
-    virtual G4bool IsZAApplicable(const G4DynamicParticle* theProjectile,
-      G4double ZZ, G4double AA);
+    virtual G4bool IsIsoApplicable(const G4DynamicParticle* theProjectile,
+                                   G4int ZZ, G4int AA);
 
     virtual G4double GetCrossSection(const G4DynamicParticle* theProjectile,
@@ -93,6 +93,6 @@
 
     virtual 
-    G4double GetIsoZACrossSection(const G4DynamicParticle* theProjectile,
-                                  G4double ZZ, G4double AA, 
+    G4double GetZandACrossSection(const G4DynamicParticle* theProjectile,
+                                  G4int ZZ, G4int AA, 
                                   G4double theTemperature);
 
@@ -102,5 +102,5 @@
     virtual void DumpPhysicsTable(const G4ParticleDefinition&)
     {G4cout << "G4TripathiLightCrossSection: uses formula"<<G4endl;}
-    void SetLowEnergyCheck (G4bool);
+    void SetLowEnergyCheck(G4bool);
 
   private:
@@ -110,5 +110,4 @@
     G4bool         lowEnergyCheck;
 };
-///////////////////////////////////////////////////////////////////////////////
-//
+
 #endif
Index: trunk/source/processes/hadronic/cross_sections/include/G4UElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4UElasticCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4UElasticCrossSection.hh	(revision 1340)
@@ -61,5 +61,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A);
 
   virtual
@@ -68,6 +68,6 @@
 
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
-				G4double /*A*/, G4double aTemperature = 0.);
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+                                G4int /*A*/, G4double aTemperature = 0.);
 
   virtual
Index: trunk/source/processes/hadronic/cross_sections/include/G4UInelasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4UInelasticCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4UInelasticCrossSection.hh	(revision 1340)
@@ -61,5 +61,5 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle*, G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int Z, G4int A);
 
   virtual
@@ -68,6 +68,6 @@
 
   virtual
-  G4double GetIsoZACrossSection(const G4DynamicParticle*, G4double /*Z*/,
-				G4double /*A*/, G4double aTemperature = 0.);
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+				G4int /*A*/, G4double aTemperature = 0.);
 
   virtual
@@ -90,6 +90,4 @@
   G4HadronCrossSections*          fGheisha;
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 };
 
Index: trunk/source/processes/hadronic/cross_sections/include/G4UPiNuclearCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4UPiNuclearCrossSection.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4UPiNuclearCrossSection.hh	(revision 1340)
@@ -39,4 +39,5 @@
 #include "G4DynamicParticle.hh"
 #include "G4DataVector.hh"
+#include "G4HadTmpUtil.hh"
 #include "globals.hh"
 #include <vector>
@@ -57,6 +58,6 @@
 
   virtual
-  G4bool IsZAApplicable(const G4DynamicParticle* aParticle, 
-			G4double Z, G4double A);
+  G4bool IsIsoApplicable(const G4DynamicParticle* aParticle, 
+                         G4int Z, G4int A);
 
   virtual 
@@ -65,6 +66,6 @@
 
   virtual 
-  G4double GetIsoZACrossSection(const G4DynamicParticle* aParticle, 
-				G4double Z, G4double A, G4double T=0.);
+  G4double GetZandACrossSection(const G4DynamicParticle* aParticle, 
+				G4int Z, G4int A, G4double T=0.);
 
   G4double GetElasticCrossSection(const G4DynamicParticle* aParticle, 
@@ -72,5 +73,5 @@
 
   G4double GetElasticCrossSection(const G4DynamicParticle* aParticle, 
-				  G4double Z, G4double A);
+				  G4int Z, G4int A);
 
   G4double GetInelasticCrossSection(const G4DynamicParticle* aParticle, 
@@ -78,5 +79,5 @@
 
   G4double GetInelasticCrossSection(const G4DynamicParticle* aParticle, 
-				    G4double Z, G4double A);
+				    G4int Z, G4int A);
 
   void BuildPhysicsTable(const G4ParticleDefinition&);
@@ -91,5 +92,5 @@
 		  const G4double* in, const G4double* e, G4int n); 
 
-  G4double Interpolate(G4double Z, G4double A, G4double ekin, 
+  G4double Interpolate(G4int Z, G4int A, G4double ekin, 
 		       G4PhysicsTable*);
 
@@ -115,14 +116,16 @@
 		     const G4Element* elm)
 {
-  return IsZAApplicable(part, elm->GetZ(), elm->GetN());
+  G4int Z = G4lrint(elm->GetZ());
+  G4int A = G4lrint(elm->GetN());
+  return IsIsoApplicable(part, Z, A);
 }
 
-inline G4bool G4UPiNuclearCrossSection::IsZAApplicable(
-		     const G4DynamicParticle* part, 
-		     G4double Z, G4double)
+inline G4bool
+G4UPiNuclearCrossSection::IsIsoApplicable(const G4DynamicParticle* part, 
+		                          G4int Z, G4int)
 {
   return ((part->GetDefinition() == piMinus || 
 	   part->GetDefinition() == piPlus) &&
-	   Z > 1.5);
+	   Z > 1);
 }
 
@@ -131,10 +134,12 @@
 		      const G4Element* elm, G4double)
 {
-  return GetInelasticCrossSection(dp, elm->GetZ(), elm->GetN());
+  G4int Z = G4lrint(elm->GetZ());
+  G4int A = G4lrint(elm->GetN());
+  return GetInelasticCrossSection(dp, Z, A);
 }
 
-inline G4double G4UPiNuclearCrossSection::GetIsoZACrossSection(
-		      const G4DynamicParticle* dp, 
-		      G4double Z, G4double A, G4double)
+inline G4double
+G4UPiNuclearCrossSection::GetZandACrossSection(const G4DynamicParticle* dp, 
+		                               G4int Z, G4int A, G4double)
 {
   return GetInelasticCrossSection(dp, Z, A);
@@ -145,5 +150,7 @@
 		      const G4Element* elm)
 {
-  return GetInelasticCrossSection(dp, elm->GetZ(), elm->GetN());
+  G4int Z = G4lrint(elm->GetZ());
+  G4int A = G4lrint(elm->GetN());
+  return GetInelasticCrossSection(dp, Z, A);
 }
 
@@ -152,5 +159,7 @@
 		      const G4Element* elm)
 {
-  return GetElasticCrossSection(dp, elm->GetZ(), elm->GetN());
+  G4int Z = G4lrint(elm->GetZ());
+  G4int A = G4lrint(elm->GetN());
+  return GetElasticCrossSection(dp, Z, A);
 }
 
Index: trunk/source/processes/hadronic/cross_sections/include/G4VCrossSectionDataSet.hh
===================================================================
--- trunk/source/processes/hadronic/cross_sections/include/G4VCrossSectionDataSet.hh	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/include/G4VCrossSectionDataSet.hh	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4VCrossSectionDataSet.hh,v 1.13 2009/01/24 11:54:47 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4VCrossSectionDataSet.hh,v 1.14 2010/07/05 13:39:11 vnivanch Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -38,4 +38,6 @@
 // Modifications:
 // 23.01.2009 V.Ivanchenko move constructor and destructor to source
+// 05.07.2010 V.Ivanchenko added name, min and max energy limit and
+//            corresponding access methods
 //
  
@@ -58,5 +60,5 @@
 public: //with description
 
-  G4VCrossSectionDataSet();
+  G4VCrossSectionDataSet(const G4String& nam = "");
 
   virtual ~G4VCrossSectionDataSet();
@@ -68,4 +70,7 @@
   virtual
   G4bool IsZAApplicable(const G4DynamicParticle*, G4double /*Z*/, G4double /*A*/);
+
+  virtual
+  G4bool IsIsoApplicable(const G4DynamicParticle*, G4int /*Z*/, G4int /*N*/);
 
   virtual
@@ -83,4 +88,8 @@
 
   virtual
+  G4double GetZandACrossSection(const G4DynamicParticle*, G4int /*Z*/,
+				G4int /*A*/, G4double aTemperature = 0.);
+
+  virtual
   void BuildPhysicsTable(const G4ParticleDefinition&) = 0;
 
@@ -90,18 +99,60 @@
 public: // Without Description
 
-  inline void SetVerboseLevel(G4int value)
-  {
-    verboseLevel = value;
-  }
+  inline void SetVerboseLevel(G4int value);
 
-  inline G4int GetVerboseLevel()
-  {
-    return verboseLevel;
-  }
+  inline G4double GetMinKinEnergy() const;
+
+  inline void SetMinKinEnergy(G4double value);
+
+  inline G4double GetMaxKinEnergy() const;
+
+  inline void SetMaxKinEnergy(G4double value);
+
+  inline const G4String& GetName() const;
 
 protected:
 
   G4int verboseLevel;
+
+private:
+
+  G4VCrossSectionDataSet & operator=(const G4VCrossSectionDataSet &right);
+  G4VCrossSectionDataSet(const G4VCrossSectionDataSet&);
+
+  G4double minKinEnergy;
+  G4double maxKinEnergy;
+
+  const G4String name;
 };
 
+inline void G4VCrossSectionDataSet::SetVerboseLevel(G4int value)
+{
+  verboseLevel = value;
+}
+
+inline void G4VCrossSectionDataSet::SetMinKinEnergy(G4double value)
+{
+  minKinEnergy = value;
+}
+
+inline G4double G4VCrossSectionDataSet::GetMinKinEnergy() const
+{
+  return minKinEnergy;
+}
+
+inline void G4VCrossSectionDataSet::SetMaxKinEnergy(G4double value)
+{
+  maxKinEnergy = value;
+}
+
+inline G4double G4VCrossSectionDataSet::GetMaxKinEnergy() const
+{
+  return maxKinEnergy;
+}
+
+inline const G4String& G4VCrossSectionDataSet::GetName() const
+{
+  return name;
+}
+
 #endif
Index: trunk/source/processes/hadronic/cross_sections/src/G4BGGNucleonElasticXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4BGGNucleonElasticXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4BGGNucleonElasticXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGNucleonElasticXS.cc,v 1.7 2009/11/19 19:40:45 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGNucleonElasticXS.cc,v 1.8 2010/10/12 06:02:41 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -51,5 +51,4 @@
 #include "G4NistManager.hh"
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 G4BGGNucleonElasticXS::G4BGGNucleonElasticXS(const G4ParticleDefinition*) 
@@ -75,22 +74,19 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4BGGNucleonElasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp, 
-						       G4double Z,
-						       G4double A, 
-						       G4double)
+
+G4double
+G4BGGNucleonElasticXS::GetZandACrossSection(const G4DynamicParticle* dp,
+                                            G4int Z, G4int A, G4double)
 {
   G4double cross = 0.0;
   G4double ekin = dp->GetKineticEnergy();
-  G4int iz = G4int(Z);
-  if(iz > 92) iz = 92;
+  if(Z > 92) Z = 92;
 
   if(ekin <= fLowEnergy) {
-    cross = theCoulombFac[iz];
+    cross = theCoulombFac[Z];
     if(isProton) { cross *= CoulombFactor(ekin, A); }
 
-  } else if(iz == 1) {
-    if( A < 1.5) {
+  } else if(Z == 1) {
+    if( A < 2) {
       fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
       cross = fHadron->GetElasticHadronNucleonXsc();
@@ -102,5 +98,5 @@
     }
   } else if(ekin > fGlauberEnergy) {
-    cross = theGlauberFac[iz]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
+    cross = theGlauberFac[Z]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
   } else {
     cross = fNucleon->GetElasticCrossSection(dp, Z, A);
@@ -159,5 +155,6 @@
   G4NistManager* nist = G4NistManager::Instance();
 
-  G4double A, csup, csdn;
+  G4double csup, csdn;
+  G4int A;
 
   if(verboseLevel > 0) G4cout << "### G4BGGNucleonElasticXS::Initialise for "
@@ -167,8 +164,8 @@
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    csup = fGlauber->GetElasticGlauberGribov(&dp, Z, A);
-    csdn = fNucleon->GetElasticCrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    csup = fGlauber->GetElasticGlauberGribov(&dp, iz, A);
+    csdn = fNucleon->GetElasticCrossSection(&dp, iz, A);
 
     theGlauberFac[iz] = csdn/csup;
@@ -179,12 +176,12 @@
   fHadron->GetHadronNucleonXscNS(&dp, G4Proton::Proton());
   theCoulombFac[1] = fHadron->GetElasticHadronNucleonXsc();
-  if(isProton) { theCoulombFac[1] /= CoulombFactor(fLowEnergy, 1.0); }
+  if(isProton) { theCoulombFac[1] /= CoulombFactor(fLowEnergy, 1); }
 
   for(G4int iz=2; iz<93; iz++) {
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    theCoulombFac[iz] = fNucleon->GetElasticCrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    theCoulombFac[iz] = fNucleon->GetElasticCrossSection(&dp, iz, A);
     if(isProton) { theCoulombFac[iz] /= CoulombFactor(fLowEnergy, A); }
     if(verboseLevel > 0) G4cout << "Z= " << Z <<  "  A= " << A 
@@ -195,25 +192,24 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4double G4BGGNucleonElasticXS::CoulombFactor(G4double kinEnergy, G4double A)
-{
-  G4double res= 0.0;
+G4double G4BGGNucleonElasticXS::CoulombFactor(G4double kinEnergy, G4int A)
+{
+  G4double res = 0.0;
   if(kinEnergy <= DBL_MIN) return res;
-  else if(A < 1.5) return kinEnergy*kinEnergy;
+  else if(A < 2) return kinEnergy*kinEnergy;
 
   G4double elog = std::log10(kinEnergy/GeV);
+  G4double aa = A;
 
   // from G4ProtonInelasticCrossSection
-  G4double f1 = 8.0  - 8.0/A - 0.008*A;
-  G4double f2 = 2.34 - 5.4/A - 0.0028*A;
+  G4double f1 = 8.0  - 8.0/aa - 0.008*aa;
+  G4double f2 = 2.34 - 5.4/aa - 0.0028*aa;
 
   res = 1.0/(1.0 + std::exp(-f1*(elog + f2)));
  
-  f1 = 5.6 - 0.016*A;
-  f2 = 1.37 + 1.37/A;
-  res *= ( 1.0 + (0.8 + 18./A - 0.002*A)/(1.0 + std::exp(f1*(elog + f2))));
+  f1 = 5.6 - 0.016*aa;
+  f2 = 1.37 + 1.37/aa;
+  res *= ( 1.0 + (0.8 + 18./aa - 0.002*aa)/(1.0 + std::exp(f1*(elog + f2))));
   return res;  
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
+
Index: trunk/source/processes/hadronic/cross_sections/src/G4BGGNucleonInelasticXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4BGGNucleonInelasticXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4BGGNucleonInelasticXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGNucleonInelasticXS.cc,v 1.7 2009/11/19 19:40:45 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGNucleonInelasticXS.cc,v 1.9 2010/10/12 06:16:19 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -75,20 +75,18 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4BGGNucleonInelasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp, 
-						       G4double Z,
-						       G4double A, 
-						       G4double)
+
+G4double
+G4BGGNucleonInelasticXS::GetZandACrossSection(const G4DynamicParticle* dp,
+                                              G4int Z, G4int A, G4double)
 {
   G4double cross = 0.0;
   G4double ekin = dp->GetKineticEnergy();
-  G4int iz = G4int(Z);
-  if(iz > 92) iz = 92;
+//  G4int iz = G4int(Z);
+  if(Z > 92) Z = 92;
 
   if(ekin <= fLowEnergy) {
-    cross = theCoulombFac[iz]*CoulombFactor(ekin, A);
-  } else if(iz == 1) {
-    if( A < 1.5) {
+    cross = theCoulombFac[Z]*CoulombFactor(ekin, A);
+  } else if(Z == 1) {
+    if( A < 2) {
       fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
       cross = fHadron->GetInelasticHadronNucleonXsc();
@@ -100,7 +98,7 @@
     }
   } else if(ekin > fGlauberEnergy) {
-    cross = theGlauberFac[iz]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
+    cross = theGlauberFac[Z]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
   } else {
-    cross = fNucleon->GetIsoZACrossSection(dp, Z, A);
+    cross = fNucleon->GetZandACrossSection(dp, Z, A);
   }
 
@@ -156,5 +154,5 @@
 
   G4NistManager* nist = G4NistManager::Instance();
-  G4double A = nist->GetAtomicMassAmu(2);
+  G4int A = G4lrint(nist->GetAtomicMassAmu(2));
 
   G4double csup, csdn;
@@ -166,8 +164,9 @@
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    csup = fGlauber->GetInelasticGlauberGribov(&dp, Z, A);
-    csdn = fNucleon->GetIsoZACrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    csup = fGlauber->GetInelasticGlauberGribov(&dp, iz, A);
+//    csdn = fNucleon->GetIsoZACrossSection(&dp, Z, A);
+    csdn = fNucleon->GetZandACrossSection(&dp, iz, A);
 
     theGlauberFac[iz] = csdn/csup;
@@ -178,13 +177,13 @@
   fHadron->GetHadronNucleonXscNS(&dp, G4Proton::Proton());
   theCoulombFac[1] = 
-    fHadron->GetInelasticHadronNucleonXsc()/CoulombFactor(fLowEnergy,1.0);
+    fHadron->GetInelasticHadronNucleonXsc()/CoulombFactor(fLowEnergy,1);
      
   for(G4int iz=2; iz<93; iz++) {
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
 
     theCoulombFac[iz] = 
-      fNucleon->GetIsoZACrossSection(&dp, Z, A)/CoulombFactor(fLowEnergy,A);
+      fNucleon->GetZandACrossSection(&dp, iz, A)/CoulombFactor(fLowEnergy,A);
 
     if(verboseLevel > 0) G4cout << "Z= " << Z <<  "  A= " << A 
@@ -193,31 +192,31 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4BGGNucleonInelasticXS::CoulombFactor(G4double kinEnergy, G4double A)
+
+G4double G4BGGNucleonInelasticXS::CoulombFactor(G4double kinEnergy, G4int A)
 {
   G4double res= 0.0;
   if(kinEnergy <= DBL_MIN) return res;
-  else if (A < 1.5) return kinEnergy*kinEnergy;
+  else if (A < 2) return kinEnergy*kinEnergy;
   
   G4double elog = std::log10(kinEnergy/GeV);
+  G4double aa = A;
 
   // from G4ProtonInelasticCrossSection
   if(isProton) {
-    G4double f1 = 8.0  - 8.0/A - 0.008*A;
-    G4double f2 = 2.34 - 5.4/A - 0.0028*A;
+    G4double f1 = 8.0  - 8.0/aa - 0.008*aa;
+    G4double f2 = 2.34 - 5.4/aa - 0.0028*aa;
 
     res = 1.0/(1.0 + std::exp(-f1*(elog + f2)));
  
-    f1 = 5.6 - 0.016*A;
-    f2 = 1.37 + 1.37/A;
-    res *= ( 1.0 + (0.8 + 18./A - 0.002*A)/(1.0 + std::exp(f1*(elog + f2))));
+    f1 = 5.6 - 0.016*aa;
+    f2 = 1.37 + 1.37/aa;
+    res *= ( 1.0 + (0.8 + 18./aa - 0.002*aa)/(1.0 + std::exp(f1*(elog + f2))));
   } else {
 
-    G4double p3 = 0.6 + 13./A - 0.0005*A;
-    G4double p4 = 7.2449 - 0.018242*A;
-    G4double p5 = 1.36 + 1.8/A + 0.0005*A;
-    G4double p6 = 1. + 200./A + 0.02*A;
-    G4double p7 = 3.0 - (A-70.)*(A-200.)/11000.;
+    G4double p3 = 0.6 + 13./aa - 0.0005*aa;
+    G4double p4 = 7.2449 - 0.018242*aa;
+    G4double p5 = 1.36 + 1.8/aa + 0.0005*aa;
+    G4double p6 = 1. + 200./aa + 0.02*aa;
+    G4double p7 = 3.0 - (aa-70.)*(aa-200.)/11000.;
 
     res = (1.+p3/(1. + std::exp(p4*(elog+p5))))/(1.+std::exp(-p6*(elog+p7)));
@@ -227,4 +226,2 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
Index: trunk/source/processes/hadronic/cross_sections/src/G4BGGPionElasticXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4BGGPionElasticXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4BGGPionElasticXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGPionElasticXS.cc,v 1.7 2009/11/19 19:40:45 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGPionElasticXS.cc,v 1.8 2010/10/12 06:03:37 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -77,20 +77,19 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4double G4BGGPionElasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp, 
-						    G4double Z,
-						    G4double A, 
-						    G4double)
+G4double
+G4BGGPionElasticXS::GetZandACrossSection(const G4DynamicParticle* dp, 
+                                         G4int Z, G4int A, G4double)
 {
   G4double cross = 0.0;
   G4double ekin = dp->GetKineticEnergy();
-  G4int iz = G4int(Z);
-  if(iz > 92) iz = 92;
+//  G4int iz = G4int(Z);
+  if(Z > 92) Z = 92;
 
   if(ekin <= fLowEnergy) {
-    cross = theCoulombFac[iz];
+    cross = theCoulombFac[Z];
     if(isPiplus) { cross *= CoulombFactor(ekin, A); } 
 
-  } else if(iz == 1) {
-    if( A < 1.5) {
+  } else if(Z == 1) {
+    if( A < 2) {
       fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
       cross = fHadron->GetElasticHadronNucleonXsc();
@@ -102,5 +101,5 @@
     }
   } else if(ekin > fGlauberEnergy) {
-    cross = theGlauberFac[iz]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
+    cross = theGlauberFac[Z]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
   } else {
     cross = fPion->GetElasticCrossSection(dp, Z, A);
@@ -159,5 +158,6 @@
   G4NistManager* nist = G4NistManager::Instance();
 
-  G4double A, csup, csdn;
+  G4double csup, csdn;
+  G4int A;
 
   if(verboseLevel > 0) G4cout << "### G4BGGPionElasticXS::Initialise for "
@@ -167,8 +167,8 @@
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    csup = fGlauber->GetElasticGlauberGribov(&dp, Z, A);
-    csdn = fPion->GetElasticCrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    csup = fGlauber->GetElasticGlauberGribov(&dp, iz, A);
+    csdn = fPion->GetElasticCrossSection(&dp, iz, A);
 
     theGlauberFac[iz] = csdn/csup;
@@ -179,12 +179,12 @@
   fHadron->GetHadronNucleonXscNS(&dp, G4Proton::Proton());
   theCoulombFac[1] = fHadron->GetElasticHadronNucleonXsc();
-  if(isPiplus) { theCoulombFac[1] /= CoulombFactor(fLowEnergy,1.0); }
+  if(isPiplus) { theCoulombFac[1] /= CoulombFactor(fLowEnergy,1); }
 
   for(G4int iz=2; iz<93; iz++) {
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    theCoulombFac[iz] = fPion->GetElasticCrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    theCoulombFac[iz] = fPion->GetElasticCrossSection(&dp, iz, A);
     if(isPiplus) { theCoulombFac[iz] /= CoulombFactor(fLowEnergy,A); }
     if(verboseLevel > 0) G4cout << "Z= " << Z <<  "  A= " << A 
@@ -193,27 +193,24 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4BGGPionElasticXS::CoulombFactor(G4double kinEnergy, G4double A)
+
+G4double G4BGGPionElasticXS::CoulombFactor(G4double kinEnergy, G4int A)
 {
   G4double res= 0.0;
   if(kinEnergy <= DBL_MIN) return res;
-  else if(A < 1.5) return kinEnergy*kinEnergy;
+  else if(A < 2) return kinEnergy*kinEnergy;
   
   G4double elog = std::log10(kinEnergy/GeV);
+  G4double aa = A;
 
   // from G4ProtonInelasticCrossSection
-  G4double f1 = 8.0  - 8.0/A - 0.008*A;
-  G4double f2 = 2.34 - 5.4/A - 0.0028*A;
+  G4double f1 = 8.0  - 8.0/aa - 0.008*aa;
+  G4double f2 = 2.34 - 5.4/aa - 0.0028*aa;
 
   res = 1.0/(1.0 + std::exp(-f1*(elog + f2)));
  
-  f1 = 5.6 - 0.016*A;
-  f2 = 1.37 + 1.37/A;
-  res *= ( 1.0 + (0.8 + 18./A - 0.002*A)/(1.0 + std::exp(f1*(elog + f2))));
+  f1 = 5.6 - 0.016*aa;
+  f2 = 1.37 + 1.37/aa;
+  res *= ( 1.0 + (0.8 + 18./aa - 0.002*aa)/(1.0 + std::exp(f1*(elog + f2))));
   return res;  
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
Index: trunk/source/processes/hadronic/cross_sections/src/G4BGGPionInelasticXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4BGGPionInelasticXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4BGGPionInelasticXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4BGGPionInelasticXS.cc,v 1.8 2009/11/19 19:40:45 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4BGGPionInelasticXS.cc,v 1.9 2010/10/12 06:03:49 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -77,21 +77,20 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4double G4BGGPionInelasticXS::GetIsoZACrossSection(const G4DynamicParticle* dp, 
-						    G4double Z,
-						    G4double A, 
-						    G4double)
+G4double
+G4BGGPionInelasticXS::GetZandACrossSection(const G4DynamicParticle* dp, 
+                                           G4int Z, G4int A, G4double)
 {
   G4double cross = 0.0;
   G4double ekin = dp->GetKineticEnergy();
-  G4int iz = G4int(Z);
-  if(iz > 92) iz = 92;
+//  G4int iz = G4int(Z);
+  if(Z > 92) Z = 92;
 
   if(ekin <= fLowEnergy) {
-    cross = theCoulombFac[iz];
+    cross = theCoulombFac[Z];
     if(isPiplus) { cross *= CoulombFactor(ekin, A); } 
 
-  } else if(iz == 1) {
-
-    if( A < 1.5) {
+  } else if(Z == 1) {
+
+    if( A < 2) {
       fHadron->GetHadronNucleonXscNS(dp, G4Proton::Proton());
       cross = fHadron->GetInelasticHadronNucleonXsc();
@@ -104,5 +103,5 @@
 
   } else if(ekin > fGlauberEnergy) {
-    cross = theGlauberFac[iz]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
+    cross = theGlauberFac[Z]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
 
   } else {
@@ -162,5 +161,6 @@
   G4NistManager* nist = G4NistManager::Instance();
 
-  G4double A, csup, csdn;
+  G4double csup, csdn;
+  G4int A;
 
   if(verboseLevel > 0) G4cout << "### G4BGGPionInelasticXS::Initialise for "
@@ -172,8 +172,8 @@
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    csup = fGlauber->GetInelasticGlauberGribov(&dp, Z, A);
-    csdn = fPion->GetInelasticCrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    csup = fGlauber->GetInelasticGlauberGribov(&dp, iz, A);
+    csdn = fPion->GetInelasticCrossSection(&dp, iz, A);
 
     theGlauberFac[iz] = csdn/csup;
@@ -184,12 +184,12 @@
   fHadron->GetHadronNucleonXscNS(&dp, G4Proton::Proton());
   theCoulombFac[1] = fHadron->GetInelasticHadronNucleonXsc();
-  if(isPiplus) { theCoulombFac[1] /= CoulombFactor(fLowEnergy,1.0); }
+  if(isPiplus) { theCoulombFac[1] /= CoulombFactor(fLowEnergy,1); }
      
   for(G4int iz=2; iz<93; iz++) {
 
     G4double Z = G4double(iz);
-    A = nist->GetAtomicMassAmu(iz);
-
-    theCoulombFac[iz] = fPion->GetIsoZACrossSection(&dp, Z, A);
+    A = G4lrint(nist->GetAtomicMassAmu(iz));
+
+    theCoulombFac[iz] = fPion->GetIsoZACrossSection(&dp, iz, A);
     if(isPiplus) { theCoulombFac[iz] /= CoulombFactor(fLowEnergy,A); }
 
@@ -199,27 +199,25 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4BGGPionInelasticXS::CoulombFactor(G4double kinEnergy, G4double A)
+
+G4double G4BGGPionInelasticXS::CoulombFactor(G4double kinEnergy, G4int A)
 {
   G4double res= 0.0;
   if(kinEnergy <= DBL_MIN) return res;
-  else if(A < 1.5) return kinEnergy*kinEnergy;
+  else if(A < 2) return kinEnergy*kinEnergy;
   
   G4double elog = std::log10(kinEnergy/GeV);
+  G4double aa = A;
 
   // from G4ProtonInelasticCrossSection
-  G4double f1 = 8.0  - 8.0/A - 0.008*A;
-  G4double f2 = 2.34 - 5.4/A - 0.0028*A;
+  G4double f1 = 8.0  - 8.0/aa - 0.008*aa;
+  G4double f2 = 2.34 - 5.4/aa - 0.0028*aa;
 
   res = 1.0/(1.0 + std::exp(-f1*(elog + f2)));
  
-  f1 = 5.6 - 0.016*A;
-  f2 = 1.37 + 1.37/A;
-  res *= ( 1.0 + (0.8 + 18./A - 0.002*A)/(1.0 + std::exp(f1*(elog + f2))));
+  f1 = 5.6 - 0.016*aa;
+  f2 = 1.37 + 1.37/aa;
+  res *= ( 1.0 + (0.8 + 18./aa - 0.002*aa)/(1.0 + std::exp(f1*(elog + f2))));
   return res;  
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
+
Index: trunk/source/processes/hadronic/cross_sections/src/G4EMDissociationCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4EMDissociationCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4EMDissociationCrossSection.cc	(revision 1340)
@@ -34,5 +34,5 @@
 // ********************************************************************
 //
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //
 // MODULE:		G4EMDissociationCrossSection.cc
@@ -45,5 +45,5 @@
 // Contract:		17191/03/NL/LvH
 //
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 //
 // CHANGE HISTORY
@@ -56,8 +56,9 @@
 // Beta release
 //
-// 30. May 2005, J.P. Wellisch removed a compilation warning on gcc 3.4 for gant4 7.1.
-//
-// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-////////////////////////////////////////////////////////////////////////////////
+// 30. May 2005, J.P. Wellisch removed a compilation warning on gcc 3.4 for 
+//               geant4 7.1.
+//
+// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//////////////////////////////////////////////////////////////////////////////
 //
 #include "G4EMDissociationCrossSection.hh"
@@ -65,10 +66,10 @@
 #include "G4ParticleTable.hh"
 #include "G4IonTable.hh"
+#include "G4HadTmpUtil.hh"
 #include "globals.hh"
-////////////////////////////////////////////////////////////////////////////////
-//
+
+
 G4EMDissociationCrossSection::G4EMDissociationCrossSection ()
 {
-//
 //
 // This function makes use of the class which can sample the virtual photon
@@ -86,5 +87,5 @@
   xd      = 0.25;
 }
-////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////
 //
 G4EMDissociationCrossSection::~G4EMDissociationCrossSection()
@@ -92,8 +93,9 @@
   delete thePhotonSpectrum;
 }
-///////////////////////////////////////////////////////////////////////////////
-//
-G4bool G4EMDissociationCrossSection::IsZAApplicable
-(const G4DynamicParticle* theDynamicParticle, G4double /*ZZ*/, G4double AA)
+/////////////////////////////////////////////////////////////////////////////
+//
+G4bool
+G4EMDissociationCrossSection::IsIsoApplicable(const G4DynamicParticle* theDynamicParticle,
+                                              G4int /*ZZ*/, G4int AA)
 {
 //
@@ -105,5 +107,5 @@
 //
   if (G4ParticleTable::GetParticleTable()->GetIonTable()->
-    IsIon(theDynamicParticle->GetDefinition()) && AA > 1.0)
+    IsIon(theDynamicParticle->GetDefinition()) && AA > 1)
     return true;
   else
@@ -114,5 +116,5 @@
   (const G4DynamicParticle* theDynamicParticle, const G4Element* theElement)
 {
-  return IsZAApplicable(theDynamicParticle, 0., theElement->GetN());
+  return IsIsoApplicable(theDynamicParticle, 0, G4lrint(theElement->GetN()));
 }
 
@@ -130,18 +132,18 @@
     G4IsotopeVector* isoVector = theElement->GetIsotopeVector();
     G4double* abundVector = theElement->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
      
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
-      sig = GetIsoZACrossSection(theDynamicParticle, ZZ, AA, temperature);
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
+      sig = GetZandACrossSection(theDynamicParticle, ZZ, AA, temperature);
       crossSection += sig*abundVector[i];
     }
    
   } else {
-    crossSection =
-      GetIsoZACrossSection(theDynamicParticle, theElement->GetZ(), 
-                           theElement->GetN(), temperature);
+    G4int ZZ = G4lrint(theElement->GetZ());
+    G4int AA = G4lrint(theElement->GetN());
+    crossSection = GetZandACrossSection(theDynamicParticle, ZZ, AA, temperature);
   }
     
@@ -150,9 +152,8 @@
 
 
-G4double G4EMDissociationCrossSection::GetIsoZACrossSection
-  (const G4DynamicParticle *theDynamicParticle, G4double ZZ, G4double AA,
-   G4double /*temperature*/)
-{
-//
+G4double
+G4EMDissociationCrossSection::GetZandACrossSection(const G4DynamicParticle *theDynamicParticle,
+                                                   G4int ZZ, G4int AA, G4double /*temperature*/)
+{
 //
 // Get relevant information about the projectile and target (A, Z) and
@@ -240,4 +241,5 @@
   return theCrossSectionVector;
 }
+
 ////////////////////////////////////////////////////////////////////////////////
 //
@@ -247,5 +249,4 @@
 {
 //
-//
 // This is a cheaky little member function to calculate the probability of
 // EMD for the target in the field of the projectile ... just by reversing the
@@ -254,11 +255,10 @@
   return GetCrossSectionForProjectile (AT, ZT, AP, ZP, b, bmin);
 }
-////////////////////////////////////////////////////////////////////////////////
-//
+
+
 G4double
-  G4EMDissociationCrossSection::GetWilsonProbabilityForProtonDissociation
-  (G4double A, G4double Z)
-{
-//
+G4EMDissociationCrossSection::GetWilsonProbabilityForProtonDissociation(G4double A,
+                                                                        G4double Z)
+{
 //
 // This is a simple algorithm to choose whether a proton or neutron is ejected
@@ -282,4 +282,2 @@
   return p;
 }
-////////////////////////////////////////////////////////////////////////////////
-//
Index: trunk/source/processes/hadronic/cross_sections/src/G4ElectroNuclearCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4ElectroNuclearCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4ElectroNuclearCrossSection.cc	(revision 1340)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4ElectroNuclearCrossSection.cc,v 1.29 2008/10/24 19:15:17 dennis Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4ElectroNuclearCrossSection.cc,v 1.30 2010/10/14 05:25:22 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 //
@@ -33,5 +33,5 @@
 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 17-Oct-03
 // 
-//===============================================================================================
+//============================================================================
 
 ///#define debug
@@ -43,9 +43,16 @@
 
 #include "G4ElectroNuclearCrossSection.hh"
+#include "G4HadTmpUtil.hh"
 
 // Initialization of statics
-G4double  G4ElectroNuclearCrossSection::lastE=0.;  // Last used in the cross section TheEnergy
-G4int     G4ElectroNuclearCrossSection::lastF=0;   // Last used in the cross section TheFirstBin
-G4double  G4ElectroNuclearCrossSection::lastG=0.;  // Last used in the cross section TheGamma
+// Last used in the cross section TheEnergy
+G4double G4ElectroNuclearCrossSection::lastE=0.;
+
+// Last used in the cross section TheFirstBin
+G4int G4ElectroNuclearCrossSection::lastF=0;
+
+// Last used in the cross section TheGamma
+G4double G4ElectroNuclearCrossSection::lastG=0.;
+
 G4double  G4ElectroNuclearCrossSection::lastH=0.;  // Last value of the High Energy A-dependence
 G4double* G4ElectroNuclearCrossSection::lastJ1=0;  // Pointer to the last array of the J1 function
@@ -58,11 +65,17 @@
 G4double  G4ElectroNuclearCrossSection::lastSig=0.;// Last value of the Cross Section
 
-std::vector<G4double*> G4ElectroNuclearCrossSection::J1;     // Vector of pointers to the J1 tabulated functions
-std::vector<G4double*> G4ElectroNuclearCrossSection::J2;     // Vector of pointers to the J2 tabulated functions
-std::vector<G4double*> G4ElectroNuclearCrossSection::J3;     // Vector of pointers to the J3 tabulated functions
+// Vector of pointers to the J1 tabulated functions
+std::vector<G4double*> G4ElectroNuclearCrossSection::J1;
+
+// Vector of pointers to the J2 tabulated functions
+std::vector<G4double*> G4ElectroNuclearCrossSection::J2;
+
+// Vector of pointers to the J3 tabulated functions
+std::vector<G4double*> G4ElectroNuclearCrossSection::J3;
+
 
 G4ElectroNuclearCrossSection::G4ElectroNuclearCrossSection()
-{
-}
+{}
+
 
 G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection()
@@ -95,11 +108,11 @@
     G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
     G4double* abundVector = anEle->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
      
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
-      sig = GetIsoZACrossSection(aPart, ZZ, AA, temperature);
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
+      sig = GetZandACrossSection(aPart, ZZ, AA, temperature);
       xsection += sig*abundVector[i];
     }
@@ -107,5 +120,7 @@
   } else {
     xsection =
-      GetIsoZACrossSection(aPart, anEle->GetZ(), anEle->GetN(),
+      GetZandACrossSection(aPart,
+                           G4lrint(anEle->GetZ()),
+                           G4lrint(anEle->GetN()),
                            temperature);
   }
@@ -116,14 +131,14 @@
 
 G4double 
-G4ElectroNuclearCrossSection::GetIsoZACrossSection(const G4DynamicParticle* aPart,
-                                              G4double ZZ, G4double AA,
-					      G4double /*temperature*/)
+G4ElectroNuclearCrossSection::GetZandACrossSection(const G4DynamicParticle* aPart,
+                                                   G4int ZZ, G4int AA,
+					           G4double /*temperature*/)
 {
   static const G4int nE=336; // !!  If you change this, change it in GetFunctions() (*.hh) !!
   static const G4int mL=nE-1;
-  static const G4double EMi=2.0612;          // Minimum tabulated Energy of the Electron
-  static const G4double EMa=50000.;          // Maximum tabulated Energy of the Electron 
-  static const G4double lEMi=std::log(EMi);       // Minimum tabulated logarithmic Energy of the Electron
-  static const G4double lEMa=std::log(EMa);       // Maximum tabulated logarithmic Energy of the Electron
+  static const G4double EMi=2.0612; // Minimum tabulated Energy of the Electron
+  static const G4double EMa=50000.; // Maximum tabulated Energy of the Electron
+  static const G4double lEMi=std::log(EMi);  // Minimum tabulated logarithmic Energy of the Electron
+  static const G4double lEMa=std::log(EMa);  // Maximum tabulated logarithmic Energy of the Electron
   static const G4double dlnE=(lEMa-lEMi)/mL; // Logarithmic step in the table for the electron Energy
   static const G4double alop=1./137.036/3.14159265; //coef. for the calculated functions (Ee>50000.)
@@ -137,14 +152,16 @@
   static std::vector <G4double> colH;    // Vector of HighEnergyCoefficients (functional calculations)
   // *** End of Static Definitions (Associative Memory) ***
+
   const G4double Energy = aPart->GetKineticEnergy()/MeV; // Energy of the electron
-  const G4int targetAtomicNumber = static_cast<int>(AA+.499); //@@ Nat mixture (?!)
-  const G4int targZ = static_cast<int>(ZZ+.001);
+  const G4int targetAtomicNumber = AA;
+  const G4int targZ = ZZ;
   const G4int targN = targetAtomicNumber-targZ; // @@ Get isotops (can change initial A)
   if (Energy<=EMi) return 0.;              // Energy is below the minimum energy in the table
+
   G4int PDG=aPart->GetDefinition()->GetPDGEncoding();
-  if(  PDG == 11 || PDG == -11)            // @@ Now only for electrons, but can be fo muons
+  if (PDG == 11 || PDG == -11)            // @@ Now only for electrons, but can be fo muons
   {
-    G4double A=targN+targZ;                // New A (can differ from G4double targetAtomicNumber)
-    if(targN!=lastN || targZ!=lastZ)       // This nucleus was not the last used isotop
+    G4double A = targN + targZ;           // New A (can differ from G4double targetAtomicNumber)
+    if(targN!=lastN || targZ!=lastZ)      // This nucleus was not the last used isotop
 	{
       lastE    = 0.;                       // New history in the electron Energy
@@ -185,4 +202,5 @@
 	  } // End of creation of the new set of parameters
     } // End of parameters udate
+
     else if(std::abs((lastE-Energy)/Energy)<.001) return lastSig*millibarn; // Don't calc. same CS twice
     // ============================== NOW Calculate the Cross Section ==========================
@@ -268,22 +286,4 @@
 }
 
-// Correction function for Be,C @@ Move to header // @@@ !!! NOT used !!!
-//G4double G4ElectroNuclearCrossSection::LinearFit(G4double X, G4int N, const G4double* XN,
-//                                                 const G4double* YN)
-//{
-//  G4double Xj=XN[0];
-//  G4double Xh=XN[N-1];
-//  if(X<=Xj) return YN[0]; //-------+ !!! If you correct this, correct upper copy too!!
-//  else if(X>=Xh) return YN[N-1];//-|
-//  G4double Xp=0.; //               |
-//  G4int j=0;   //                  |
-//  while (X>Xj && j<N)//<-----------+
-//  {
-//    j++;
-//    Xp=Xj;
-//    Xj=XN[j];
-//  }
-//  return YN[j]-(Xj-X)*(YN[j]-YN[j-1])/(Xj-Xp);
-//}
 
 // Calculate the functions for the std::log(A)
Index: trunk/source/processes/hadronic/cross_sections/src/G4GGNuclNuclCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4GGNuclNuclCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4GGNuclNuclCrossSection.cc	(revision 1340)
@@ -33,8 +33,8 @@
 #include "G4IonTable.hh"
 #include "G4ParticleDefinition.hh"
-
-
-
-////////////////////////////////////////////////////////////////////////////////
+#include "G4HadTmpUtil.hh"
+
+
+///////////////////////////////////////////////////////////////////////////////
 //
 //
@@ -49,14 +49,12 @@
 }
 
-///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 //
 
 G4GGNuclNuclCrossSection::~G4GGNuclNuclCrossSection()
-{
-}
-
-
-////////////////////////////////////////////////////////////////////////////////////////
+{}
+
+///////////////////////////////////////////////////////////////////////////////
 //
 //
@@ -65,55 +63,63 @@
 G4bool 
 G4GGNuclNuclCrossSection::IsApplicable(const G4DynamicParticle* aDP, 
-					  const G4Element*  anElement)
-{
-  return IsZAApplicable(aDP, anElement->GetZ(), anElement->GetN());
+				       const G4Element*  anElement)
+{
+  G4int Z = G4lrint(anElement->GetZ());
+  G4int N = G4lrint(anElement->GetN());
+  return IsIsoApplicable(aDP, Z, N);
 } 
 
-////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 //
 
 G4bool 
-G4GGNuclNuclCrossSection::IsZAApplicable(const G4DynamicParticle* aDP, 
-					    G4double Z, G4double)
-{
-  G4bool applicable      = false;
-  // G4int baryonNumber     = aDP->GetDefinition()->GetBaryonNumber();
+G4GGNuclNuclCrossSection::IsIsoApplicable(const G4DynamicParticle* aDP, 
+					  G4int Z, G4int)
+{
+  G4bool applicable = false;
   G4double kineticEnergy = aDP->GetKineticEnergy();
 
-  //  const G4ParticleDefinition* theParticle = aDP->GetDefinition();
- 
-  if ( kineticEnergy  >= fLowerLimit && Z > 1.5 ) applicable = true;
-
+  if (kineticEnergy >= fLowerLimit && Z > 1) applicable = true;
   return applicable;
 }
 
-////////////////////////////////////////////////////////////////////////////////////////
-//
-// Calculates total and inelastic Xsc, derives elastic as total - inelastic accordong to
-// Glauber model with Gribov correction calculated in the dipole approximation on
-// light cone. Gaussian density helps to calculate rest integrals of the model.
-// [1] B.Z. Kopeliovich, nucl-th/0306044 
+///////////////////////////////////////////////////////////////////////////////
+//
+// Calculates total and inelastic Xsc, derives elastic as total - inelastic 
+// accordong to Glauber model with Gribov correction calculated in the dipole 
+// approximation on light cone. Gaussian density helps to calculate rest 
+// integrals of the model. [1] B.Z. Kopeliovich, nucl-th/0306044 
 
 
 G4double G4GGNuclNuclCrossSection::
-GetCrossSection(const G4DynamicParticle* aParticle, const G4Element* anElement, G4double T)
-{
-  return GetIsoZACrossSection(aParticle, anElement->GetZ(), anElement->GetN(), T);
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
-//
-// Calculates total and inelastic Xsc, derives elastic as total - inelastic accordong to
-// Glauber model with Gribov correction calculated in the dipole approximation on
-// light cone. Gaussian density of point-like nucleons helps to calculate rest integrals of the model.
-// [1] B.Z. Kopeliovich, nucl-th/0306044 + simplification above
-
+GetCrossSection(const G4DynamicParticle* aParticle, const G4Element* anElement,
+                G4double T)
+{
+  G4int Z = G4lrint(anElement->GetZ());
+  G4int N = G4lrint(anElement->GetN());
+  return GetZandACrossSection(aParticle, Z, N, T);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Calculates total and inelastic Xsc, derives elastic as total - inelastic 
+// accordong to Glauber model with Gribov correction calculated in the dipole 
+// approximation on light cone. Gaussian density of point-like nucleons helps 
+// to calculate rest integrals of the model. [1] B.Z. Kopeliovich,
+// nucl-th/0306044 + simplification above
 
 
 G4double G4GGNuclNuclCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double tZ, G4double tA, G4double)
-{
-  G4double xsection, sigma, cofInelastic = 2.4, cofTotal = 2.0, nucleusSquare, cB, ratio;
+GetZandACrossSection(const G4DynamicParticle* aParticle,
+                     G4int tZ, G4int tA, G4double)
+{
+  G4double xsection;
+  G4double sigma;
+  G4double cofInelastic = 2.4;
+  G4double cofTotal = 2.0;
+  G4double nucleusSquare;
+  G4double cB;
+  G4double ratio;
 
   G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
@@ -132,8 +138,6 @@
   G4double pR = GetNucleusRadius(pA); 
 
-  cB = GetCoulombBarier(aParticle, tZ, tA, pR, tR);
-
-  if(cB > 0.)
-  {
+  cB = GetCoulombBarier(aParticle, G4double(tZ), G4double(tA), pR, tR);
+  if (cB > 0.) {
 
     sigma = (pZ*tZ+pN*tN)*GetHadronNucleonXscNS(theProton, pTkin, theProton) +
@@ -143,9 +147,6 @@
 
     ratio = sigma/nucleusSquare;
-
     xsection =  nucleusSquare*std::log( 1. + ratio );
-
     fTotalXsc = xsection;
-
     fTotalXsc *= cB;
 
@@ -153,5 +154,4 @@
 
     fInelasticXsc *= cB;
-
     fElasticXsc   = fTotalXsc - fInelasticXsc;
 
@@ -171,5 +171,4 @@
  
     ratio = sigma/nucleusSquare;
-
     fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
 
@@ -186,14 +185,14 @@
 }
 
-////////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 //
 
 G4double G4GGNuclNuclCrossSection::
-GetCoulombBarier(const G4DynamicParticle* aParticle, G4double tZ, G4double tA, G4double pR, G4double tR)
+GetCoulombBarier(const G4DynamicParticle* aParticle, G4double tZ, G4double tA,
+                 G4double pR, G4double tR)
 {
   G4double ratio;
   G4double pZ = aParticle->GetDefinition()->GetPDGCharge();
-
 
   G4double pTkin = aParticle->GetKineticEnergy();
@@ -254,10 +253,6 @@
 
   nucleusSquare = cofTotal*pi*( pR*pR + tR*tR );   // basically 2piRR
-
   ratio = sigma/nucleusSquare;
-
-
-  fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
-   
+  fInelasticXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
   G4double difratio = ratio/(1.+ratio);
 
@@ -272,5 +267,5 @@
 //////////////////////////////////////////////////////////////////////////
 //
-// Return suasi-elastic/inelastic cross-section ratio
+// Return quasi-elastic/inelastic cross-section ratio
 
 G4double G4GGNuclNuclCrossSection::
@@ -298,13 +293,10 @@
 
   nucleusSquare = cofTotal*pi*( pR*pR + tR*tR );   // basically 2piRR
-
   ratio = sigma/nucleusSquare;
-
-  fInelasticXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
+  fInelasticXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
 
   //  sigma = GetHNinelasticXsc(aParticle, tA, tZ);
   ratio = sigma/nucleusSquare;
-
-  fProductionXsc = nucleusSquare*std::log( 1. + cofInelastic*ratio )/cofInelastic;
+  fProductionXsc = nucleusSquare*std::log(1. + cofInelastic*ratio)/cofInelastic;
 
   if (fInelasticXsc > fProductionXsc) ratio = (fInelasticXsc-fProductionXsc)/fInelasticXsc;
@@ -315,5 +307,5 @@
 }
 
-/////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 // Returns hadron-nucleon Xsc according to differnt parametrisations:
@@ -324,17 +316,15 @@
 G4double 
 G4GGNuclNuclCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
-  return GetHadronNucleonXsc( aParticle, At, Zt );
-}
-
-
-
-
-/////////////////////////////////////////////////////////////////////////////////////
+                                              const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());  // number of nucleons 
+  G4int Zt = G4lrint(anElement->GetZ());  // number of protons
+  return GetHadronNucleonXsc(aParticle, At, Zt);
+}
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////
 //
 // Returns hadron-nucleon Xsc according to differnt parametrisations:
@@ -345,15 +335,13 @@
 G4double 
 G4GGNuclNuclCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle, 
-                                                   G4double At,  G4double Zt       )
+                                                   G4int At, G4int Zt)
 {
   G4double xsection = 0.;
 
-
   G4double targ_mass = G4ParticleTable::GetParticleTable()->
-  GetIonTable()->GetIonMass( G4int(Zt+0.5) , G4int(At+0.5) );
-
+  GetIonTable()->GetIonMass(Zt, At);
   targ_mass = 0.939*GeV;  // ~mean neutron and proton ???
 
-  G4double proj_mass     = aParticle->GetMass();
+  G4double proj_mass = aParticle->GetMass();
   G4double proj_momentum = aParticle->GetMomentum().mag();
   G4double sMand = CalcMandelstamS ( proj_mass , targ_mass , proj_momentum );
@@ -361,17 +349,13 @@
   sMand /= GeV*GeV;  // in GeV for parametrisation
   proj_momentum /= GeV;
-
   const G4ParticleDefinition* pParticle = aParticle->GetDefinition();
-  
 
   if(pParticle == theNeutron) // as proton ??? 
   {
-    xsection = At*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
+    xsection = G4double(At)*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
   } 
   else if(pParticle == theProton) 
   {
-    xsection = At*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
-    // xsection = At*( 49.51*std::pow(sMand,-0.097) + 0.314*std::log(sMand)*std::log(sMand) );
-    // xsection = At*( 38.4 + 0.85*std::abs(std::pow(log(sMand),1.47)) );
+    xsection = G4double(At)*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
   } 
  
@@ -381,5 +365,5 @@
 
 
-/////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 // Returns hadron-nucleon Xsc according to PDG parametrisation (2005):
@@ -388,17 +372,13 @@
 G4double 
 G4GGNuclNuclCrossSection::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
+                                                  const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());  // number of nucleons 
+  G4int Zt = G4lrint(anElement->GetZ());  // number of protons
   return GetHadronNucleonXscPDG( aParticle, At, Zt );
 }
 
 
-
-
-/////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 // Returns hadron-nucleon Xsc according to PDG parametrisation (2005):
@@ -408,5 +388,5 @@
 G4double 
 G4GGNuclNuclCrossSection::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
+                                                 G4int At, G4int Zt)
 {
   G4double xsection = 0.;
@@ -415,15 +395,11 @@
   if (Nt < 0.) Nt = 0.;  
 
-
   G4double targ_mass = G4ParticleTable::GetParticleTable()->
-  GetIonTable()->GetIonMass( G4int(Zt+0.5) , G4int(At+0.5) );
-
+  GetIonTable()->GetIonMass(Zt, At);
   targ_mass = 0.939*GeV;  // ~mean neutron and proton ???
 
   G4double proj_mass     = aParticle->GetMass(); 
   G4double proj_momentum = aParticle->GetMomentum().mag();
-
   G4double sMand = CalcMandelstamS ( proj_mass , targ_mass , proj_momentum );
-
   sMand         /= GeV*GeV;  // in GeV for parametrisation
 
@@ -435,23 +411,20 @@
   G4double B    = 0.308;
 
-
   const G4ParticleDefinition* pParticle = aParticle->GetDefinition();
   
-
   if(pParticle == theNeutron) // proton-neutron fit 
   {
-    xsection = Zt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
-                          + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
-    xsection  += Nt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
-		      + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // pp for nn
+    xsection = G4double(Zt)*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
+                  + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
+    xsection += Nt*(35.45 + B*std::pow(std::log(sMand/s0),2.) 
+	     + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // pp for nn
   } 
   else if(pParticle == theProton) 
   {
-      
-      xsection  = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
-                          + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
-
-      xsection += Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
-                          + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
+    xsection = G4double(Zt)*(35.45 + B*std::pow(std::log(sMand/s0),2.) 
+                + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
+
+    xsection += Nt*(35.80 + B*std::pow(std::log(sMand/s0),2.) 
+                  + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
   } 
   xsection *= millibarn; // parametrised in mb
@@ -460,7 +433,5 @@
 
 
-
-
-/////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 // Returns nucleon-nucleon cross-section based on N. Starkov parametrisation of
@@ -469,5 +440,5 @@
 
 G4double 
-G4GGNuclNuclCrossSection::GetHadronNucleonXscNS( G4ParticleDefinition* pParticle, 
+G4GGNuclNuclCrossSection::GetHadronNucleonXscNS(G4ParticleDefinition* pParticle, 
                                                  G4double pTkin, 
                                                  G4ParticleDefinition* tParticle)
@@ -477,7 +448,6 @@
   G4double hnXsc(0);
 
-
-  G4double targ_mass     = tParticle->GetPDGMass();
-  G4double proj_mass     = pParticle->GetPDGMass(); 
+  G4double targ_mass = tParticle->GetPDGMass();
+  G4double proj_mass = pParticle->GetPDGMass(); 
 
   G4double proj_energy   = proj_mass + pTkin; 
@@ -497,8 +467,4 @@
   //  G4double eta2 = 0.458;
   //  G4double B    = 0.308;
-
-  
-
-
   
   if( proj_momentum >= 10. ) // high energy: pp = nn = np
@@ -506,15 +472,13 @@
   {
     Delta = 1.;
-
-    if( proj_energy < 40. ) Delta = 0.916+0.0021*proj_energy;
-
-    if( proj_momentum >= 10.)
-    {
-        B0 = 7.5;
-        A0 = 100. - B0*std::log(3.0e7);
-
-        xsection = A0 + B0*std::log(proj_energy) - 11
-                  + 103*std::pow(2*0.93827*proj_energy + proj_mass*proj_mass+
-                     0.93827*0.93827,-0.165);        //  mb
+    if (proj_energy < 40.) Delta = 0.916+0.0021*proj_energy;
+
+    if (proj_momentum >= 10.) {
+      B0 = 7.5;
+      A0 = 100. - B0*std::log(3.0e7);
+
+      xsection = A0 + B0*std::log(proj_energy) - 11
+                + 103*std::pow(2*0.93827*proj_energy + proj_mass*proj_mass+
+                  0.93827*0.93827,-0.165);        //  mb
     }
   }
@@ -562,51 +526,14 @@
 }
 
-/*
-/////////////////////////////////////////////////////////////////////////////////////
-//
-// Returns hadron-nucleon inelastic cross-section based on proper parametrisation 
-
-G4double 
-G4GGNuclNuclCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
-  return GetHNinelasticXsc( aParticle, At, Zt );
-}
-
-/////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
 //
 // Returns hadron-nucleon inelastic cross-section based on FTF-parametrisation 
 
 G4double 
-G4GGNuclNuclCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
-{
-  //  G4ParticleDefinition* hadron = aParticle->GetDefinition();
-  G4double sumInelastic, Nt = At - Zt;
-
-  if(Nt < 0.) Nt = 0.;
-  
-  sumInelastic  = Zt*GetHadronNucleonXscNS(aParticle, theProton);
-  sumInelastic += Nt*GetHadronNucleonXscNS(aParticle, theNeutron);    
- 
-  return sumInelastic;
-}
-*/
-
-/////////////////////////////////////////////////////////////////////////////////////
-//
-// Returns hadron-nucleon inelastic cross-section based on FTF-parametrisation 
-
-G4double 
 G4GGNuclNuclCrossSection::GetHNinelasticXscVU(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
-{
-  G4int PDGcode    = aParticle->GetDefinition()->GetPDGEncoding();
+                                              G4int At, G4int Zt)
+{
+  G4int PDGcode = aParticle->GetDefinition()->GetPDGEncoding();
   G4int absPDGcode = std::abs(PDGcode);
-
   G4double Elab = aParticle->GetTotalEnergy();              
                           // (s - 2*0.88*GeV*GeV)/(2*0.939*GeV)/GeV;
@@ -650,6 +577,6 @@
                            NumberOfTargetNeutrons * XelPN   );
   }
+
   Xinelastic = Xtotal - Xelastic;
-
   if(Xinelastic < 0.) Xinelastic = 0.;
 
@@ -657,41 +584,20 @@
 }
 
-////////////////////////////////////////////////////////////////////////////////////
-//
-//
-
-G4double 
-G4GGNuclNuclCrossSection::GetNucleusRadius( const G4DynamicParticle* , 
-                                               const G4Element* anElement)
-{
-  G4double At       = anElement->GetN();
+///////////////////////////////////////////////////////////////////////////////
+//
+//
+
+G4double 
+G4GGNuclNuclCrossSection::GetNucleusRadius(const G4DynamicParticle* , 
+                                           const G4Element* anElement)
+{
+  G4double At = anElement->GetN();
   G4double oneThird = 1.0/3.0;
   G4double cubicrAt = std::pow (At, oneThird); 
 
-
   G4double R;  // = fRadiusConst*cubicrAt;
-  /*  
-  G4double tmp = std::pow( cubicrAt-1., 3.);
-  tmp         += At;
-  tmp         *= 0.5;
-
-  if (At > 20.)   // 20.
-  {
-    R = fRadiusConst*std::pow (tmp, oneThird); 
-  }
-  else
-  {
-    R = fRadiusConst*cubicrAt; 
-  }
-  */
-  
   R = fRadiusConst*cubicrAt;
 
-  // return R;  // !!!!
-
-
-  
   G4double meanA  = 21.;
-
   G4double tauA1  = 40.; 
   G4double tauA2  = 10.; 
@@ -715,10 +621,10 @@
   {
     R *= ( 1.0 + b3*( 1. - std::exp( (At - meanA)/tauA3) ) ); 
-  }  
+  }
+
   return R;
- 
-}
-
-////////////////////////////////////////////////////////////////////////////////////
+}
+
+///////////////////////////////////////////////////////////////////////////////
 //
 //
@@ -728,7 +634,4 @@
 {
   G4double R;
-
-  // R = GetNucleusRadiusGG(At);
-
   R = GetNucleusRadiusDE(At);
 
@@ -741,42 +644,23 @@
 G4GGNuclNuclCrossSection::GetNucleusRadiusGG(G4double At)
 {
-  
   G4double oneThird = 1.0/3.0;
   G4double cubicrAt = std::pow (At, oneThird); 
 
-
-  G4double R;  // = fRadiusConst*cubicrAt;
-  
-  /*
-  G4double tmp = std::pow( cubicrAt-1., 3.);
-  tmp         += At;
-  tmp         *= 0.5;
-
-  if (At > 20.)
-  {
-    R = fRadiusConst*std::pow (tmp, oneThird); 
+  G4double R;  // = fRadiusConst*cubicrAt;  
+  R = fRadiusConst*cubicrAt;
+
+  G4double meanA = 20.;
+  G4double tauA  = 20.;
+
+  if ( At > 20.)   // 20.
+  {
+    R *= ( 0.8 + 0.2*std::exp( -(At - meanA)/tauA) ); 
   }
   else
   {
-    R = fRadiusConst*cubicrAt; 
-  }
-  */
-  
-  R = fRadiusConst*cubicrAt;
-
-  G4double meanA = 20.;
-  G4double tauA  = 20.; 
-
-  if ( At > 20.)   // 20.
-  {
-    R *= ( 0.8 + 0.2*std::exp( -(At - meanA)/tauA) ); 
-  }
-  else
-  {
     R *= ( 1.0 + 0.1*( 1. - std::exp( (At - meanA)/tauA) ) ); 
   }
 
   return R;
-
 }
 
@@ -785,5 +669,4 @@
 G4GGNuclNuclCrossSection::GetNucleusRadiusDE(G4double A)
 {
-
   // algorithm from diffuse-elastic
 
@@ -797,5 +680,5 @@
 
 
-  if( A < 50. )
+  if (A < 50.)
   {
     if( 10  < A && A <= 15. )     r0  = a11*( 1 - std::pow(A, -2./3.) )*fermi;   // 1.08*fermi;
@@ -816,11 +699,11 @@
 
 
-////////////////////////////////////////////////////////////////////////////////////
-//
-//
-
-G4double G4GGNuclNuclCrossSection::CalculateEcmValue( const G4double mp , 
-                                                         const G4double mt , 
-                                                         const G4double Plab )
+///////////////////////////////////////////////////////////////////////////////
+//
+//
+
+G4double G4GGNuclNuclCrossSection::CalculateEcmValue(const G4double mp, 
+                                                     const G4double mt, 
+                                                     const G4double Plab)
 {
   G4double Elab = std::sqrt ( mp * mp + Plab * Plab );
@@ -833,11 +716,11 @@
 
 
-////////////////////////////////////////////////////////////////////////////////////
-//
-//
-
-G4double G4GGNuclNuclCrossSection::CalcMandelstamS( const G4double mp , 
-                                                       const G4double mt , 
-                                                       const G4double Plab )
+///////////////////////////////////////////////////////////////////////////////
+//
+//
+
+G4double G4GGNuclNuclCrossSection::CalcMandelstamS(const G4double mp, 
+                                                   const G4double mt, 
+                                                   const G4double Plab)
 {
   G4double Elab = std::sqrt ( mp * mp + Plab * Plab );
@@ -847,6 +730,5 @@
 }
 
-
-//
-//
-///////////////////////////////////////////////////////////////////////////////////////
+//
+//
+///////////////////////////////////////////////////////////////////////////////
Index: trunk/source/processes/hadronic/cross_sections/src/G4GeneralSpaceNNCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4GeneralSpaceNNCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4GeneralSpaceNNCrossSection.cc	(revision 1340)
@@ -65,8 +65,9 @@
 #include "G4ParticleTable.hh"
 #include "G4IonTable.hh"
+#include "G4HadTmpUtil.hh"
 
 #include <iomanip>
-///////////////////////////////////////////////////////////////////////////////
-//
+
+
 G4GeneralSpaceNNCrossSection::G4GeneralSpaceNNCrossSection ()
 {
@@ -79,6 +80,6 @@
   return;
 }
-///////////////////////////////////////////////////////////////////////////////
-//
+
+
 G4GeneralSpaceNNCrossSection::~G4GeneralSpaceNNCrossSection ()
 {
@@ -92,16 +93,16 @@
 //
 
-G4bool G4GeneralSpaceNNCrossSection::IsZAApplicable
- (const G4DynamicParticle* theProjectile, G4double ZZ, G4double AA)
-{
-  G4bool result = protonInelastic->IsZAApplicable(theProjectile, ZZ, AA);
+G4bool G4GeneralSpaceNNCrossSection::IsIsoApplicable
+ (const G4DynamicParticle* theProjectile, G4int ZZ, G4int AA)
+{
+  G4bool result = protonInelastic->IsIsoApplicable(theProjectile, ZZ, AA);
   if (!result)
   {
-    result = ionProton->IsZAApplicable(theProjectile, ZZ, AA);
+    result = ionProton->IsIsoApplicable(theProjectile, ZZ, AA);
     if (!result)
     {
-      result = TripathiGeneral->IsZAApplicable(theProjectile, ZZ, AA);
+      result = TripathiGeneral->IsIsoApplicable(theProjectile, ZZ, AA);
       if (!result)
-        result = Shen->IsZAApplicable(theProjectile, ZZ, AA);
+        result = Shen->IsIsoApplicable(theProjectile, ZZ, AA);
     }
   }
@@ -139,18 +140,18 @@
     G4IsotopeVector* isoVector = theTarget->GetIsotopeVector();
     G4double* abundVector = theTarget->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
      
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
-      sig = GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
+      sig = GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       xsection += sig*abundVector[i];
     }
    
   } else {
-    xsection =
-      GetIsoZACrossSection(theProjectile, theTarget->GetZ(), theTarget->GetN(),
-                           theTemperature);
+    G4int ZZ = G4lrint(theTarget->GetZ());
+    G4int AA = G4lrint(theTarget->GetN());
+    xsection = GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
   }
     
@@ -159,7 +160,7 @@
 
 
-G4double G4GeneralSpaceNNCrossSection::GetIsoZACrossSection
-  (const G4DynamicParticle* theProjectile, G4double ZZ, G4double AA,
-   G4double theTemperature)
+G4double
+G4GeneralSpaceNNCrossSection::GetZandACrossSection(const G4DynamicParticle* theProjectile,
+                                                   G4int ZZ, G4int AA, G4double theTemperature)
 {
   G4double result = 0.0;
@@ -186,5 +187,5 @@
     {
       result = protonInelastic->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4ProtonInelasticCrossSection" <<G4endl;
@@ -193,5 +194,5 @@
     {
       result = TripathiLight->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
@@ -203,5 +204,5 @@
     {
       result = ionProton->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4IonProtonCrossSection" <<G4endl;
@@ -210,5 +211,5 @@
     {
       result = TripathiLight->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
@@ -217,22 +218,22 @@
   else
   {
-    if (TripathiLight->IsZAApplicable(theProjectile, ZZ, AA))
+    if (TripathiLight->IsIsoApplicable(theProjectile, ZZ, AA))
     {
       result = TripathiLight->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4TripathiLightCrossSection" <<G4endl;
     }
-    else if (TripathiGeneral->IsZAApplicable(theProjectile, ZZ, AA))
+    else if (TripathiGeneral->IsIsoApplicable(theProjectile, ZZ, AA))
     {
       result = TripathiGeneral->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4TripathiCrossSection" <<G4endl;
     }
-    else if (Shen->IsZAApplicable(theProjectile, ZZ, AA))
+    else if (Shen->IsIsoApplicable(theProjectile, ZZ, AA))
     {
       result = Shen->
-        GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+        GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       if (verboseLevel >= 2)
         G4cout <<"Selecting G4IonsShenCrossSection" <<G4endl;
@@ -247,4 +248,3 @@
   return result;
 }
-///////////////////////////////////////////////////////////////////////////////
-//
+
Index: trunk/source/processes/hadronic/cross_sections/src/G4GlauberGribovCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4GlauberGribovCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4GlauberGribovCrossSection.cc	(revision 1340)
@@ -279,5 +279,6 @@
 					  const G4Element*  anElement)
 {
-  return IsZAApplicable(aDP, anElement->GetZ(), anElement->GetN());
+  return IsIsoApplicable(aDP, G4lrint(anElement->GetZ()),
+                              G4lrint(anElement->GetN()));
 } 
 
@@ -287,6 +288,6 @@
 
 G4bool 
-G4GlauberGribovCrossSection::IsZAApplicable(const G4DynamicParticle* aDP, 
-					    G4double Z, G4double)
+G4GlauberGribovCrossSection::IsIsoApplicable(const G4DynamicParticle* aDP, 
+					     G4int Z, G4int)
 {
   G4bool applicable      = false;
@@ -297,5 +298,5 @@
  
   if ( ( kineticEnergy  >= fLowerLimit &&
-         Z > 1.5 &&      // >=  He
+         Z > 1 &&      // >=  He
        ( theParticle == theAProton   ||
          theParticle == theGamma     ||
@@ -305,5 +306,5 @@
 
        ( kineticEnergy  >= fLowerLimit &&
-         Z > 1.5 &&      // >=  He
+         Z > 1 &&      // >=  He
        ( theParticle == theProton    ||
          theParticle == theNeutron   ||   
@@ -325,5 +326,6 @@
 GetCrossSection(const G4DynamicParticle* aParticle, const G4Element* anElement, G4double T)
 {
-  return GetIsoZACrossSection(aParticle, anElement->GetZ(), anElement->GetN(), T);
+  return GetZandACrossSection(aParticle, G4lrint(anElement->GetZ()),
+                              G4lrint(anElement->GetN()), T);
 }
 
@@ -338,5 +340,5 @@
 
 G4double G4GlauberGribovCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double Z, G4double A, G4double)
+GetZandACrossSection(const G4DynamicParticle* aParticle, G4int Z, G4int A, G4double)
 {
   G4double xsection, sigma, cofInelastic, cofTotal, nucleusSquare, ratio;
@@ -362,5 +364,5 @@
   // cofInelastic = 2.0;
 
-  if( A > 1.5 )
+  if( A > 1 )
   { 
     nucleusSquare = cofTotal*pi*R*R;   // basically 2piRR
@@ -420,5 +422,5 @@
 
 G4double G4GlauberGribovCrossSection::
-GetRatioSD(const G4DynamicParticle* aParticle, G4double A, G4double Z)
+GetRatioSD(const G4DynamicParticle* aParticle, G4int A, G4int Z)
 {
   G4double sigma, cofInelastic, cofTotal, nucleusSquare, ratio;
@@ -462,5 +464,5 @@
 
 G4double G4GlauberGribovCrossSection::
-GetRatioQE(const G4DynamicParticle* aParticle, G4double A, G4double Z)
+GetRatioQE(const G4DynamicParticle* aParticle, G4int A, G4int Z)
 {
   G4double sigma, cofInelastic, cofTotal, nucleusSquare, ratio;
@@ -510,11 +512,10 @@
 G4double 
 G4GlauberGribovCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
-  return GetHadronNucleonXsc( aParticle, At, Zt );
+                                                 const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());  // number of nucleons 
+  G4int Zt = G4lrint(anElement->GetZ());  // number of protons
+
+  return GetHadronNucleonXsc(aParticle, At, Zt);
 }
 
@@ -531,11 +532,11 @@
 G4double 
 G4GlauberGribovCrossSection::GetHadronNucleonXsc(const G4DynamicParticle* aParticle, 
-                                                   G4double At,  G4double Zt       )
+                                                 G4int At, G4int Zt)
 {
   G4double xsection;
 
-
   G4double targ_mass = G4ParticleTable::GetParticleTable()->
-  GetIonTable()->GetIonMass( G4int(Zt+0.5) , G4int(At+0.5) );
+  GetIonTable()->GetIonMass(Zt, At);
+//  GetIonTable()->GetIonMass( G4int(Zt+0.5) , G4int(At+0.5) );
 
   targ_mass = 0.939*GeV;  // ~mean neutron and proton ???
@@ -550,16 +551,17 @@
   const G4ParticleDefinition* theParticle = aParticle->GetDefinition();
   
+  G4double aa = At;
 
   if(theParticle == theGamma) 
   {
-    xsection = At*(0.0677*std::pow(sMand,0.0808) + 0.129*std::pow(sMand,-0.4525));
+    xsection = aa*(0.0677*std::pow(sMand,0.0808) + 0.129*std::pow(sMand,-0.4525));
   } 
   else if(theParticle == theNeutron) // as proton ??? 
   {
-    xsection = At*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
+    xsection = aa*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
   } 
   else if(theParticle == theProton) 
   {
-    xsection = At*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
+    xsection = aa*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
     // xsection = At*( 49.51*std::pow(sMand,-0.097) + 0.314*std::log(sMand)*std::log(sMand) );
     // xsection = At*( 38.4 + 0.85*std::abs(std::pow(log(sMand),1.47)) );
@@ -567,26 +569,26 @@
   else if(theParticle == theAProton) 
   {
-    xsection = At*( 21.70*std::pow(sMand,0.0808) + 98.39*std::pow(sMand,-0.4525));
+    xsection = aa*( 21.70*std::pow(sMand,0.0808) + 98.39*std::pow(sMand,-0.4525));
   } 
   else if(theParticle == thePiPlus) 
   {
-    xsection = At*(13.63*std::pow(sMand,0.0808) + 27.56*std::pow(sMand,-0.4525));
+    xsection = aa*(13.63*std::pow(sMand,0.0808) + 27.56*std::pow(sMand,-0.4525));
   } 
   else if(theParticle == thePiMinus) 
   {
     // xsection = At*( 55.2*std::pow(sMand,-0.255) + 0.346*std::log(sMand)*std::log(sMand) );
-    xsection = At*(13.63*std::pow(sMand,0.0808) + 36.02*std::pow(sMand,-0.4525));
+    xsection = aa*(13.63*std::pow(sMand,0.0808) + 36.02*std::pow(sMand,-0.4525));
   } 
   else if(theParticle == theKPlus) 
   {
-    xsection = At*(11.82*std::pow(sMand,0.0808) + 8.15*std::pow(sMand,-0.4525));
+    xsection = aa*(11.82*std::pow(sMand,0.0808) + 8.15*std::pow(sMand,-0.4525));
   } 
   else if(theParticle == theKMinus) 
   {
-    xsection = At*(11.82*std::pow(sMand,0.0808) + 26.36*std::pow(sMand,-0.4525));
+    xsection = aa*(11.82*std::pow(sMand,0.0808) + 26.36*std::pow(sMand,-0.4525));
   }
   else  // as proton ??? 
   {
-    xsection = At*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
+    xsection = aa*(21.70*std::pow(sMand,0.0808) + 56.08*std::pow(sMand,-0.4525));
   } 
   xsection *= millibarn;
@@ -602,11 +604,10 @@
 G4double 
 G4GlauberGribovCrossSection::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
-  return GetHadronNucleonXscPDG( aParticle, At, Zt );
+                                                    const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());  // number of nucleons 
+  G4int Zt = G4lrint(anElement->GetZ());  // number of protons
+
+  return GetHadronNucleonXscPDG(aParticle, At, Zt);
 }
 
@@ -622,15 +623,17 @@
 G4double 
 G4GlauberGribovCrossSection::GetHadronNucleonXscPDG(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
+                                                    G4int At, G4int Zt)
 {
   G4double xsection;
 
-  G4double Nt = At-Zt;              // number of neutrons
-
-  if (Nt < 0.) Nt = 0.;  
-
+  G4int Nt = At-Zt;              // number of neutrons
+  if (Nt < 0) Nt = 0;
+  
+  G4double zz = Zt;
+  G4double aa = At;
+  G4double nn = Nt;
 
   G4double targ_mass = G4ParticleTable::GetParticleTable()->
-  GetIonTable()->GetIonMass( G4int(Zt+0.5) , G4int(At+0.5) );
+    GetIonTable()->GetIonMass(Zt, At);
 
   targ_mass = 0.939*GeV;  // ~mean neutron and proton ???
@@ -656,7 +659,7 @@
   if(theParticle == theNeutron) // proton-neutron fit 
   {
-    xsection = Zt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection = zz*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
                           + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
-    xsection  += Nt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  += nn*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
 		      + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2)); // pp for nn
   } 
@@ -664,52 +667,52 @@
   {
       
-      xsection  = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
+      xsection  = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
                           + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
 
-      xsection += Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
+      xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
                           + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
   } 
   else if(theParticle == theAProton) 
   {
-    xsection  = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
                           + 42.53*std::pow(sMand,-eta1) + 33.34*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
                           + 40.15*std::pow(sMand,-eta1) + 30.*std::pow(sMand,-eta2));
   } 
   else if(theParticle == thePiPlus) 
   {
-    xsection  = At*( 20.86 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = aa*( 20.86 + B*std::pow(std::log(sMand/s0),2.) 
                           + 19.24*std::pow(sMand,-eta1) - 6.03*std::pow(sMand,-eta2));
   } 
   else if(theParticle == thePiMinus) 
   {
-    xsection  = At*( 20.86 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = aa*( 20.86 + B*std::pow(std::log(sMand/s0),2.) 
                           + 19.24*std::pow(sMand,-eta1) + 6.03*std::pow(sMand,-eta2));
   } 
   else if(theParticle == theKPlus) 
   {
-    xsection  = Zt*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
                           + 7.14*std::pow(sMand,-eta1) - 13.45*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
                           + 5.17*std::pow(sMand,-eta1) - 7.23*std::pow(sMand,-eta2));
   } 
   else if(theParticle == theKMinus) 
   {
-    xsection  = Zt*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
                           + 7.14*std::pow(sMand,-eta1) + 13.45*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
                           + 5.17*std::pow(sMand,-eta1) + 7.23*std::pow(sMand,-eta2));
   }
   else if(theParticle == theSMinus) 
   {
-    xsection  = At*( 35.20 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = aa*( 35.20 + B*std::pow(std::log(sMand/s0),2.) 
                           - 199.*std::pow(sMand,-eta1) + 264.*std::pow(sMand,-eta2));
   } 
   else if(theParticle == theGamma) // modify later on
   {
-    xsection  = At*( 0.0 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = aa*( 0.0 + B*std::pow(std::log(sMand/s0),2.) 
                           + 0.032*std::pow(sMand,-eta1) - 0.0*std::pow(sMand,-eta2));
    
@@ -717,8 +720,8 @@
   else  // as proton ??? 
   {
-    xsection  = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
                           + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
                           + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
   } 
@@ -735,11 +738,10 @@
 G4double 
 G4GlauberGribovCrossSection::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
-  return GetHadronNucleonXscNS( aParticle, At, Zt );
+                                                   const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());  // number of nucleons 
+  G4int Zt = G4lrint(anElement->GetZ());  // number of protons
+
+  return GetHadronNucleonXscNS(aParticle, At, Zt);
 }
 
@@ -754,5 +756,5 @@
 G4double 
 G4GlauberGribovCrossSection::GetHadronNucleonXscNS(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
+                                                   G4int At, G4int Zt)
 {
   G4double xsection(0), Delta, A0, B0;
@@ -760,11 +762,13 @@
   G4double hnXsc(0);
 
-  G4double Nt = At-Zt;              // number of neutrons
-
-  if (Nt < 0.) Nt = 0.;  
-
+  G4int Nt = At-Zt;              // number of neutrons
+  if (Nt < 0) Nt = 0;  
+
+  G4double aa = At;
+  G4double zz = Zt;
+  G4double nn = Nt;
 
   G4double targ_mass = G4ParticleTable::GetParticleTable()->
-  GetIonTable()->GetIonMass( G4int(Zt+0.5) , G4int(At+0.5) );
+  GetIonTable()->GetIonMass(Zt, At);
 
   targ_mass = 0.939*GeV;  // ~mean neutron and proton ???
@@ -810,5 +814,5 @@
                      0.93827*0.93827,-0.165);        //  mb
       }
-      xsection *= Zt + Nt;
+      xsection *= zz + nn;
     }
     else
@@ -846,5 +850,5 @@
                  (std::pow(proj_momentum,2.50)+0.95);
       }
-      xsection = hpXsc*Zt + hnXsc*Nt;
+      xsection = hpXsc*zz + hnXsc*nn;
     }
   } 
@@ -867,5 +871,5 @@
                      0.93827*0.93827,-0.165);        //  mb
       }
-      xsection *= Zt + Nt;
+      xsection *= zz + nn;
     }
     else
@@ -903,5 +907,5 @@
                  (std::pow(proj_momentum,2.50)+0.95);
       }
-      xsection = hpXsc*Zt + hnXsc*Nt;
+      xsection = hpXsc*zz + hnXsc*nn;
       // xsection = hpXsc*(Zt + Nt);
       // xsection = hnXsc*(Zt + Nt);
@@ -921,14 +925,14 @@
     if( proj_momentum <= 1.0 )
     {
-      xsection  = Zt*(65.55 + 53.84/(proj_momentum+1.e-6)  );
+      xsection  = zz*(65.55 + 53.84/(proj_momentum+1.e-6)  );
     }
     else
     {
-      xsection  = Zt*( 41.1 + 77.2*std::pow( proj_momentum, -0.68) 
+      xsection  = zz*( 41.1 + 77.2*std::pow( proj_momentum, -0.68) 
                        + 0.293*logP*logP - 1.82*logP );
     }
-    if ( Nt > 0.)  
-    {
-      xsection += Nt*( 41.9 + 96.2*std::pow( proj_momentum, -0.99) - 0.154*logP);
+    if ( nn > 0.)  
+    {
+      xsection += nn*( 41.9 + 96.2*std::pow( proj_momentum, -0.99) - 0.154*logP);
     }
     else // H
@@ -987,5 +991,5 @@
       hnXsc = 10.6+2*std::log(proj_energy)+30*std::pow(proj_energy,-0.43); 
     }
-    xsection = hpXsc*Zt + hnXsc*Nt;
+    xsection = hpXsc*zz + hnXsc*nn;
   } 
   else if(theParticle == thePiMinus) 
@@ -1039,30 +1043,30 @@
       hpXsc = 10.6+2*std::log(proj_energy)+30*std::pow(proj_energy,-0.43); 
     }
-    xsection = hpXsc*Zt + hnXsc*Nt;
+    xsection = hpXsc*zz + hnXsc*nn;
   } 
   else if(theParticle == theKPlus) 
   {
-    xsection  = Zt*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
                           + 7.14*std::pow(sMand,-eta1) - 13.45*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
                           + 5.17*std::pow(sMand,-eta1) - 7.23*std::pow(sMand,-eta2));
   } 
   else if(theParticle == theKMinus) 
   {
-    xsection  = Zt*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 17.91 + B*std::pow(std::log(sMand/s0),2.) 
                           + 7.14*std::pow(sMand,-eta1) + 13.45*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 17.87 + B*std::pow(std::log(sMand/s0),2.) 
                           + 5.17*std::pow(sMand,-eta1) + 7.23*std::pow(sMand,-eta2));
   }
   else if(theParticle == theSMinus) 
   {
-    xsection  = At*( 35.20 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = aa*( 35.20 + B*std::pow(std::log(sMand/s0),2.) 
                           - 199.*std::pow(sMand,-eta1) + 264.*std::pow(sMand,-eta2));
   } 
   else if(theParticle == theGamma) // modify later on
   {
-    xsection  = At*( 0.0 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = aa*( 0.0 + B*std::pow(std::log(sMand/s0),2.) 
                           + 0.032*std::pow(sMand,-eta1) - 0.0*std::pow(sMand,-eta2));
    
@@ -1070,8 +1074,8 @@
   else  // as proton ??? 
   {
-    xsection  = Zt*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection  = zz*( 35.45 + B*std::pow(std::log(sMand/s0),2.) 
                           + 42.53*std::pow(sMand,-eta1) - 33.34*std::pow(sMand,-eta2));
 
-    xsection += Nt*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
+    xsection += nn*( 35.80 + B*std::pow(std::log(sMand/s0),2.) 
                           + 40.15*std::pow(sMand,-eta1) - 30.*std::pow(sMand,-eta2));
   } 
@@ -1087,11 +1091,10 @@
 G4double 
 G4GlauberGribovCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticle, 
-                                                  const G4Element* anElement          )
-{
-  G4double At = anElement->GetN();  // number of nucleons 
-  G4double Zt = anElement->GetZ();  // number of protons
-
-
-  return GetHNinelasticXsc( aParticle, At, Zt );
+                                               const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());  // number of nucleons 
+  G4int Zt = G4lrint(anElement->GetZ());  // number of protons
+
+  return GetHNinelasticXsc(aParticle, At, Zt);
 }
 
@@ -1102,9 +1105,10 @@
 G4double 
 G4GlauberGribovCrossSection::GetHNinelasticXsc(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
+                                                     G4int At,  G4int Zt)
 {
   G4ParticleDefinition* hadron = aParticle->GetDefinition();
-  G4double sumInelastic, Nt = At - Zt;
-  if(Nt < 0.) Nt = 0.;
+  G4double sumInelastic;
+  G4int Nt = At - Zt;
+  if(Nt < 0) Nt = 0;
   
   if( hadron == theKPlus )
@@ -1116,6 +1120,6 @@
     //sumInelastic  = Zt*GetHadronNucleonXscMK(aParticle, theProton);
     // sumInelastic += Nt*GetHadronNucleonXscMK(aParticle, theNeutron);    
-    sumInelastic  = Zt*GetHadronNucleonXscNS(aParticle, 1.0, 1.0);
-    sumInelastic += Nt*GetHadronNucleonXscNS(aParticle, 1.0, 0.0);    
+    sumInelastic  = G4double(Zt)*GetHadronNucleonXscNS(aParticle, 1, 1);
+    sumInelastic += G4double(Nt)*GetHadronNucleonXscNS(aParticle, 1, 0);    
   } 
   return sumInelastic;
@@ -1129,5 +1133,5 @@
 G4double 
 G4GlauberGribovCrossSection::GetHNinelasticXscVU(const G4DynamicParticle* aParticle, 
-                                                     G4double At,  G4double Zt )
+                                                 G4int At, G4int Zt)
 {
   G4int PDGcode    = aParticle->GetDefinition()->GetPDGEncoding();
@@ -1147,9 +1151,9 @@
   //G4cout<<"Plab = "<<Plab<<G4endl;
 
-  G4double NumberOfTargetProtons  = Zt; 
-  G4double NumberOfTargetNucleons = At;
+  G4double NumberOfTargetProtons = G4double(Zt); 
+  G4double NumberOfTargetNucleons = G4double(At);
   G4double NumberOfTargetNeutrons = NumberOfTargetNucleons - NumberOfTargetProtons;
 
-  if( NumberOfTargetNeutrons < 0.) NumberOfTargetNeutrons = 0.;
+  if(NumberOfTargetNeutrons < 0.0) NumberOfTargetNeutrons = 0.0;
 
   G4double Xtotal, Xelastic, Xinelastic;
@@ -1169,9 +1173,9 @@
                          0.169*sqrLogPlab - 1.85*LogPlab;
 
-       Xtotal          = ( NumberOfTargetProtons  * XtotPP +
-                           NumberOfTargetNeutrons * XtotPN  );
-
-       Xelastic        = ( NumberOfTargetProtons  * XelPP  +
-                           NumberOfTargetNeutrons * XelPN   );
+       Xtotal          = (NumberOfTargetProtons * XtotPP +
+                          NumberOfTargetNeutrons * XtotPN);
+
+       Xelastic        = (NumberOfTargetProtons * XelPP +
+                          NumberOfTargetNeutrons * XelPN);
   }
   else if( PDGcode ==  211 ) //------Projectile is PionPlus -------
@@ -1340,10 +1344,10 @@
 
 G4double 
-G4GlauberGribovCrossSection::GetNucleusRadius( const G4DynamicParticle* , 
-                                               const G4Element* anElement)
-{
-  G4double At       = anElement->GetN();
+G4GlauberGribovCrossSection::GetNucleusRadius(const G4DynamicParticle* , 
+                                              const G4Element* anElement)
+{
+  G4int At = G4lrint(anElement->GetN());
   G4double oneThird = 1.0/3.0;
-  G4double cubicrAt = std::pow (At, oneThird); 
+  G4double cubicrAt = std::pow(G4double(At), oneThird); 
 
   G4double R;  // = fRadiusConst*cubicrAt;
@@ -1377,9 +1381,9 @@
   G4double b3 = 4.;
 
-  if (At > 20.)   // 20.
+  if (At > 20)   // 20.
   {
     R *= ( a1 + b1*std::exp( -(At - meanA)/tauA1) ); 
   }
-  else if (At > 3.5)
+  else if (At > 3)
   {
     R *= ( 1.0 + b2*( 1. - std::exp( (At - meanA)/tauA2) ) ); 
@@ -1397,8 +1401,8 @@
 
 G4double 
-G4GlauberGribovCrossSection::GetNucleusRadius(G4double At)
+G4GlauberGribovCrossSection::GetNucleusRadius(G4int At)
 {
   G4double oneThird = 1.0/3.0;
-  G4double cubicrAt = std::pow (At, oneThird); 
+  G4double cubicrAt = std::pow(G4double(At), oneThird); 
 
   G4double R;  // = fRadiusConst*cubicrAt;
@@ -1424,11 +1428,11 @@
   G4double tauA  = 20.; 
 
-  if (At > 20.)   // 20.
-  {
-    R *= ( 0.8 + 0.2*std::exp( -(At - meanA)/tauA) ); 
+  if (At > 20)   // 20.
+  {
+    R *= ( 0.8 + 0.2*std::exp( -(G4double(At) - meanA)/tauA) ); 
   }
   else
   {
-    R *= ( 1.0 + 0.1*( 1. - std::exp( (At - meanA)/tauA) ) ); 
+    R *= ( 1.0 + 0.1*( 1. - std::exp( (G4double(At) - meanA)/tauA) ) ); 
   }
 
Index: trunk/source/processes/hadronic/cross_sections/src/G4HadronCrossSections.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4HadronCrossSections.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4HadronCrossSections.cc	(revision 1340)
@@ -25,5 +25,5 @@
 //
 //
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 //
@@ -1230,10 +1230,10 @@
       G4IsotopeVector* isoVector = element->GetIsotopeVector();
       G4double* abundVector = element->GetRelativeAbundanceVector();
-      G4double ZZ;
-      G4double AA;
+      G4int ZZ;
+      G4int AA;
 
       for (G4int i = 0; i < nIso; i++) {
-        ZZ = G4double( (*isoVector)[i]->GetZ() );
-        AA = G4double( (*isoVector)[i]->GetN() );
+        ZZ = (*isoVector)[i]->GetZ();
+        AA = (*isoVector)[i]->GetN();
         CalcScatteringCrossSections(particle, ZZ, AA);
         cross_section += siginelastic*abundVector[i];
@@ -1241,6 +1241,8 @@
       siginelastic = cross_section;
 
-    } else { 
-      CalcScatteringCrossSections(particle, element->GetZ(), element->GetN());
+    } else {
+      G4int ZZ = G4lrint(element->GetZ());
+      G4int AA = G4lrint(element->GetN());
+      CalcScatteringCrossSections(particle, ZZ, AA);
     }
   }
@@ -1249,7 +1251,7 @@
 
 
-G4double G4HadronCrossSections::GetInelasticCrossSection(
-                          const G4DynamicParticle* particle,
-                          G4double ZZ, G4double AA)
+G4double
+G4HadronCrossSections::GetInelasticCrossSection(const G4DynamicParticle* particle,
+                                                G4int ZZ, G4int AA)
 {
   prevElement = 0; // force new cross section calculation for next call of
@@ -1274,10 +1276,10 @@
       G4IsotopeVector* isoVector = element->GetIsotopeVector();
       G4double* abundVector = element->GetRelativeAbundanceVector();
-      G4double ZZ;
-      G4double AA;
+      G4int ZZ;
+      G4int AA;
 
       for (G4int i = 0; i < nIso; i++) {
-        ZZ = G4double( (*isoVector)[i]->GetZ() );
-        AA = G4double( (*isoVector)[i]->GetN() );
+        ZZ = (*isoVector)[i]->GetZ();
+        AA = (*isoVector)[i]->GetN();
         CalcScatteringCrossSections(particle, ZZ, AA);
         cross_section += sigelastic*abundVector[i];
@@ -1285,6 +1287,8 @@
       sigelastic = cross_section;
 
-    } else { 
-      CalcScatteringCrossSections(particle, element->GetZ(), element->GetN());
+    } else {
+      G4int ZZ = G4lrint(element->GetZ());
+      G4int AA = G4lrint(element->GetN());
+      CalcScatteringCrossSections(particle, ZZ, AA);
     }
   }
@@ -1293,7 +1297,7 @@
 
 
-G4double G4HadronCrossSections::GetElasticCrossSection(
-                          const G4DynamicParticle* particle,
-                          G4double ZZ, G4double AA)
+G4double
+G4HadronCrossSections::GetElasticCrossSection(const G4DynamicParticle* particle,
+                                              G4int ZZ, G4int AA)
 {
   prevElement = 0; // force new cross section calculation for next call of
@@ -1312,5 +1316,5 @@
 G4HadronCrossSections::CalcScatteringCrossSections(
                           const G4DynamicParticle* aParticle,
-                          G4double ZZ, G4double AA)
+                          G4int ZZ, G4int AA)
 {
    G4double sigel, sigin, sigtot;
@@ -1583,5 +1587,5 @@
 G4HadronCrossSections::GetCaptureCrossSection(
                           const G4DynamicParticle* aParticle,
-                          G4double ZZ, G4double /*AA*/)
+                          G4int ZZ, G4int /*AA*/)
 {
    if (GetParticleCode(aParticle) != 16)  { return 0.; }
@@ -1596,5 +1600,5 @@
    }
 
-   G4int izno = static_cast<G4int> (ZZ + 0.01);
+   G4int izno = ZZ;
    if (izno > 100) izno = 100;      // Not in GHESIG
    izno = izno - 1;      // For array indexing
@@ -1609,18 +1613,9 @@
 G4HadronCrossSections::GetFissionCrossSection(
                           const G4DynamicParticle* aParticle,
-                          G4double ZZ, G4double AA)
+                          G4int ZZ, G4int AA)
 {
-   if (AA < 230.) return 0;
+   if (AA < 230) return 0;
 
    G4double ek = aParticle->GetKineticEnergy()/GeV;      
-
-   //   G4int i = NFISS;
-   //   for (G4int ii = 1; i <= NFISS; i++) {
-   //      if (ek < ekfiss[ii - 1]) {
-   //         i = ii;
-   //         break;
-   //      }
-   //   }
-   //   i = i - 1;      // For array indexing
 
    G4int ie1 = 0;
@@ -1638,11 +1633,11 @@
    G4int j = 4;
    if (ek <= 0.01) {
-      if (ZZ == 92. && std::abs(AA - 233.) < 0.5) j = 1;
-      else if (ZZ == 92. && std::abs(AA - 235.) < 0.5) j = 2;
-      else if (ZZ == 94. && std::abs(AA - 239.) < 0.5) j = 3;
+      if (ZZ == 92 && AA == 233) j = 1;
+      else if (ZZ == 92 && AA == 235) j = 2;
+      else if (ZZ == 94 && AA == 239) j = 3;
    }
    G4double z43ba;
    if (j == 4) {
-      z43ba = std::pow(ZZ, 4./3.)/AA;
+      z43ba = std::pow(G4double(ZZ), 4./3.)/G4double(AA);
       z43ba = std::max(-67. + 38.7*z43ba, 0.);
    }
Index: trunk/source/processes/hadronic/cross_sections/src/G4HadronNucleonXsc.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4HadronNucleonXsc.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4HadronNucleonXsc.cc	(revision 1340)
@@ -33,8 +33,5 @@
 #include "G4IonTable.hh"
 #include "G4ParticleDefinition.hh"
-
-//////////////////////////////////////////////////////////////////////////////////////
-//
-//
+#include "G4HadTmpUtil.hh"
 
 
@@ -80,6 +77,5 @@
 
 G4HadronNucleonXsc::~G4HadronNucleonXsc()
-{
-}
+{}
 
 
@@ -91,18 +87,19 @@
 G4bool 
 G4HadronNucleonXsc::IsApplicable(const G4DynamicParticle* aDP, 
-					  const G4Element*  anElement)
+                                 const G4Element* anElement)
 {
-  return IsZAApplicable(aDP, anElement->GetZ(), anElement->GetN());
+  G4int Z = G4lrint(anElement->GetZ());
+  G4int A = G4lrint(anElement->GetN());
+  return IsIsoApplicable(aDP, Z, A);
 } 
 
 ////////////////////////////////////////////////////////////////////////////////////////
 //
-//
 
 G4bool 
-G4HadronNucleonXsc::IsZAApplicable(const G4DynamicParticle* aDP, 
-					    G4double Z, G4double)
+G4HadronNucleonXsc::IsIsoApplicable(const G4DynamicParticle* aDP, 
+                                    G4int Z, G4int)
 {
-  G4bool applicable      = false;
+  G4bool applicable = false;
   // G4int baryonNumber     = aDP->GetDefinition()->GetBaryonNumber();
   G4double kineticEnergy = aDP->GetKineticEnergy();
@@ -111,5 +108,5 @@
  
   if ( ( kineticEnergy  >= fLowerLimit &&
-         Z > 1.5 &&      // >=  He
+         Z > 1 &&      // >=  He
        ( theParticle == theAProton   ||
          theParticle == theGamma     ||
@@ -119,5 +116,5 @@
 
        ( kineticEnergy  >= 0.1*fLowerLimit &&
-         Z > 1.5 &&      // >=  He
+         Z > 1 &&      // >=  He
        ( theParticle == theProton    ||
          theParticle == theNeutron   ||   
@@ -127,6 +124,4 @@
   return applicable;
 }
-
-
 
 
@@ -210,7 +205,4 @@
 
 
-
-
-
 /////////////////////////////////////////////////////////////////////////////////////
 //
@@ -242,5 +234,4 @@
   G4double B    = 0.308;
 
-
   const G4ParticleDefinition* theParticle = aParticle->GetDefinition();
 
@@ -249,5 +240,4 @@
   G4bool neutron = (nucleon == theNeutron);
   
-
   if(theParticle == theNeutron) // proton-neutron fit 
   {
@@ -358,5 +348,4 @@
   return xsection;
 }
-
 
 
@@ -758,6 +747,4 @@
   G4bool neutron = (nucleon == theNeutron);
 
-
-
    
   if( absPDGcode > 1000 && pORn )  //------Projectile is baryon -
Index: trunk/source/processes/hadronic/cross_sections/src/G4IonsKoxCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4IonsKoxCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4IonsKoxCrossSection.cc	(revision 1340)
@@ -32,13 +32,14 @@
 #include "G4ParticleTable.hh"
 #include "G4IonTable.hh"
+#include "G4HadTmpUtil.hh"
 
 G4double G4IonsKoxCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ, 
-                     G4double AA, G4double /*temperature*/)
+GetZandACrossSection(const G4DynamicParticle* aParticle, G4int ZZ, 
+                     G4int AA, G4double /*temperature*/)
 {
    G4double xsection = 0.0;
 
    G4int Ap = aParticle->GetDefinition()->GetBaryonNumber();
-   G4int Zp = int ( aParticle->GetDefinition()->GetPDGCharge() / eplus + 0.5); 
+   G4int Zp = G4int(aParticle->GetDefinition()->GetPDGCharge() / eplus + 0.5); 
    G4double ke_per_N = aParticle->GetKineticEnergy() / Ap;
 
@@ -46,6 +47,6 @@
    // if (  ke_per_N < lowerLimit ) return xsection;
 
-   G4int At = int (AA + 0.5);
-   G4int Zt = int (ZZ + 0.5 );  
+   G4int At = AA;
+   G4int Zt = ZZ;  
 
    G4double one_third = 1.0 / 3.0;
@@ -54,8 +55,10 @@
    G4double cubicrAp = std::pow ( G4double(Ap) , G4double(one_third) );  
 
+   // rc divide fermi
+   G4double Bc = Zt * Zp / ( (rc/fermi) * (cubicrAp+cubicrAt) );
 
-   G4double Bc = Zt * Zp / ( ( rc / fermi ) * (  cubicrAp + cubicrAt ) );   // rc divide fermi
-   G4double targ_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( Zt , At ); 
-   G4double proj_mass = aParticle->GetMass(); 
+   G4double targ_mass =
+     G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Zt, At); 
+   G4double proj_mass = aParticle->GetMass();
    G4double proj_momentum = aParticle->GetMomentum().mag(); 
 
@@ -69,14 +72,14 @@
 
    G4double a = 1.85;
-   G4double Rsurf = r0 * ( a * cubicrAp * cubicrAt / ( cubicrAp + cubicrAt ) - c); 
+   G4double Rsurf = r0 * (a*cubicrAp * cubicrAt/(cubicrAp + cubicrAt) - c); 
    G4double D = 5.0 * ( At - 2 * Zt ) * Zp / ( Ap * At );
    Rsurf = Rsurf + D * fermi;  // multiply D by fermi 
 
    G4double Rint = Rvol + Rsurf;
-
    xsection = pi * Rint * Rint * ( 1 - Bc / ( Ecm / MeV ) );
   
    return xsection; 
 }
+
 
 G4double G4IonsKoxCrossSection::
@@ -91,18 +94,18 @@
     G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
     G4double* abundVector = anElement->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
      
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
-      sig = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
+      sig = GetZandACrossSection(aParticle, ZZ, AA, temperature);
       xsection += sig*abundVector[i];
     }
    
   } else {
-    xsection =
-      GetIsoZACrossSection(aParticle, anElement->GetZ(), anElement->GetN(),
-                           temperature);
+    G4int ZZ = G4lrint(anElement->GetZ());
+    G4int AA = G4lrint(anElement->GetN());
+    xsection = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
   }
     
@@ -111,5 +114,6 @@
 
 
-G4double G4IonsKoxCrossSection::calEcm ( G4double mp , G4double mt , G4double Plab )
+G4double
+G4IonsKoxCrossSection::calEcm(G4double mp, G4double mt, G4double Plab)
 {
    G4double Elab = std::sqrt ( mp * mp + Plab * Plab );
@@ -121,5 +125,5 @@
 
 
-G4double G4IonsKoxCrossSection::calCeValue( const G4double ke )
+G4double G4IonsKoxCrossSection::calCeValue(const G4double ke)
 {
    // Calculate c value 
@@ -131,5 +135,5 @@
    G4double Ce; 
    G4double log10_ke = std::log10 ( ke );   
-   if ( log10_ke > 1.5 ) 
+   if (log10_ke > 1.5) 
    {
       Ce = - 10.0 / std::pow ( G4double(log10_ke) , G4double(5) ) + 2.0;
@@ -137,5 +141,6 @@
    else
    {
-      Ce = ( - 10.0 / std::pow ( G4double(1.5) , G4double(5) ) + 2.0 ) / std::pow ( G4double(1.5) , G4double(3) ) * std::pow ( G4double(log10_ke) , G4double(3) );
+      Ce = (-10.0/std::pow(G4double(1.5), G4double(5) ) + 2.0) /
+           std::pow(G4double(1.5), G4double(3)) * std::pow(G4double(log10_ke), G4double(3) );
 
    }
Index: trunk/source/processes/hadronic/cross_sections/src/G4IonsShenCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4IonsShenCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4IonsShenCrossSection.cc	(revision 1340)
@@ -33,14 +33,15 @@
 #include "G4ParticleTable.hh"
 #include "G4IonTable.hh"
+#include "G4HadTmpUtil.hh"
 
 
 G4double G4IonsShenCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double ZZ, 
-                G4double AA, G4double /*temperature*/)
+GetZandACrossSection(const G4DynamicParticle* aParticle, G4int ZZ, 
+                     G4int AA, G4double /*temperature*/)
 {
    G4double xsection = 0.0;
 
    G4int Ap = aParticle->GetDefinition()->GetBaryonNumber();
-   G4int Zp = int ( aParticle->GetDefinition()->GetPDGCharge() / eplus + 0.5 ); 
+   G4int Zp = G4int(aParticle->GetDefinition()->GetPDGCharge()/eplus + 0.5 ); 
    G4double ke_per_N = aParticle->GetKineticEnergy() / Ap; 
    if ( ke_per_N > 10*GeV ) ke_per_N = 10*GeV;
@@ -49,6 +50,6 @@
    // if (  ke_per_N < lowerLimit ) return xsection;
 
-   G4int At = G4int(AA);
-   G4int Zt = G4int(ZZ);
+   G4int At = AA;
+   G4int Zt = ZZ;
  
    G4double one_third = 1.0 / 3.0;
@@ -62,9 +63,10 @@
    G4double r = Rt + Rp + 3.2;   // in fm
    G4double b = 1.0;   // in MeV/fm
-   G4double targ_mass = G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass( Zt , At );
+   G4double targ_mass =
+     G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(Zt, At);
    G4double proj_mass = aParticle->GetMass();
    G4double proj_momentum = aParticle->GetMomentum().mag();
 
-   G4double Ecm = calEcmValue ( proj_mass , targ_mass , proj_momentum ); 
+   G4double Ecm = calEcmValue (proj_mass, targ_mass, proj_momentum); 
 
    G4double B = 1.44 * Zt * Zp / r - b * Rt * Rp / ( Rt + Rp ); 
@@ -74,16 +76,16 @@
    G4double c = calCeValue ( ke_per_N / MeV  );  
 
-   G4double R1 = r0 * ( cubicrAt + cubicrAp + 1.85 * cubicrAt * cubicrAp / ( cubicrAt + cubicrAp ) - c); 
+   G4double R1 = r0 * (cubicrAt + cubicrAp + 1.85*cubicrAt*cubicrAp/(cubicrAt + cubicrAp) - c); 
 
    G4double R2 = 1.0 * ( At - 2 * Zt ) * Zp / ( Ap * At );
 
 
-   G4double R3 = 0.176 / std::pow ( G4double(Ecm) , G4double(one_third) ) * cubicrAt * cubicrAp / ( cubicrAt + cubicrAp );
+   G4double R3 = 0.176 / std::pow(G4double(Ecm), G4double(one_third)) * cubicrAt * cubicrAp /(cubicrAt + cubicrAp);
 
    G4double R = R1 + R2 + R3;
 
    xsection = 10 * pi * R * R * ( 1 - B / Ecm );   
-   xsection = xsection * millibarn;   // mulitply xsection by millibarn    
-  
+   xsection = xsection * millibarn;   // mulitply xsection by millibarn
+
    return xsection; 
 }
@@ -101,10 +103,10 @@
     G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
     G4double* abundVector = anElement->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
    
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
       sig = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
       xsection += sig*abundVector[i];
@@ -112,7 +114,7 @@
  
   } else {
-    xsection =
-      GetIsoZACrossSection(aParticle, anElement->GetZ(), anElement->GetN(), 
-                           temperature);
+    G4int ZZ = G4lrint(anElement->GetZ());
+    G4int AA = G4lrint(anElement->GetN());
+    xsection = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
   }
   
@@ -121,5 +123,7 @@
 
 
-G4double G4IonsShenCrossSection::calEcmValue( const G4double mp , const G4double mt , const G4double Plab )
+G4double
+G4IonsShenCrossSection::calEcmValue(const G4double mp, const G4double mt,
+                                    const G4double Plab)
 {
    G4double Elab = std::sqrt ( mp * mp + Plab * Plab );
@@ -131,21 +135,23 @@
 
 
-G4double G4IonsShenCrossSection::calCeValue( const G4double ke )
+G4double G4IonsShenCrossSection::calCeValue(const G4double ke)
 {
-   // Calculate c value 
-   // This value is indepenent from projectile and target particle 
-   // ke is projectile kinetic energy per nucleon in the Lab system with MeV unit 
-   // fitting function is made by T. Koi 
-   // There are no data below 30 MeV/n in Kox et al., 
+  // Calculate c value 
+  // This value is indepenent from projectile and target particle 
+  // ke is projectile kinetic energy per nucleon in the Lab system 
+  // with MeV unit 
+  // fitting function is made by T. Koi 
+  // There are no data below 30 MeV/n in Kox et al., 
 
    G4double Ce; 
    G4double log10_ke = std::log10 ( ke );   
-   if ( log10_ke > 1.5 ) 
+   if (log10_ke > 1.5) 
    {
-      Ce = - 10.0 / std::pow ( G4double(log10_ke) , G4double(5) ) + 2.0;
+     Ce = -10.0/std::pow(G4double(log10_ke), G4double(5)) + 2.0;
    }
    else
    {
-      Ce = ( - 10.0 / std::pow ( G4double(1.5) , G4double(5) ) + 2.0 ) / std::pow ( G4double(1.5) , G4double(3) ) * std::pow ( G4double(log10_ke) , G4double(3) );
+     Ce = (-10.0/std::pow(G4double(1.5), G4double(5) ) + 2.0) /
+         std::pow(G4double(1.5) , G4double(3)) * std::pow(G4double(log10_ke), G4double(3));
    }
    return Ce;
Index: trunk/source/processes/hadronic/cross_sections/src/G4IonsSihverCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4IonsSihverCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4IonsSihverCrossSection.cc	(revision 1340)
@@ -31,16 +31,14 @@
 #include "G4ParticleTable.hh"
 #include "G4IonTable.hh"
+#include "G4HadTmpUtil.hh"
 
 G4double G4IonsSihverCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* aParticle, G4double /*ZZ*/, 
-                G4double AA, G4double /*aTemperature*/)
+GetZandACrossSection(const G4DynamicParticle* aParticle,
+                     G4int /*ZZ*/, G4int AA, G4double /*aTemperature*/)
 {
    G4double xsection = 0.0;
-
-   G4int At = G4int(AA);
-   //G4int Zt = G4int(ZZ);  // not used 
+   G4int At = AA;
 
    G4int Ap = aParticle->GetDefinition()->GetBaryonNumber();
-   //Zp = aParticle->GetDefinition()->GetPDGCharge();   // not used  
  
    G4double one_third = 1.0 / 3.0;
@@ -49,8 +47,8 @@
    G4double cubicrAp = std::pow ( G4double(Ap) , G4double(one_third) );  
 
-   G4double b0 = 1.581 - 0.876 * ( 1.0 / cubicrAp + 1.0 / cubicrAt );
+   G4double b0 = 1.581 - 0.876 * (1.0/cubicrAp + 1.0/cubicrAt);
 
    xsection = pi * square_r0 
-            * std::pow ( G4double(cubicrAp + cubicrAt - b0 * (  1.0 / cubicrAp + 1.0 / cubicrAt ) ), G4double(2) );
+            * std::pow(G4double(cubicrAp + cubicrAt - b0 * (1.0/cubicrAp + 1.0/cubicrAt)), G4double(2));
   
    return xsection; 
@@ -69,10 +67,10 @@
     G4IsotopeVector* isoVector = anElement->GetIsotopeVector();
     G4double* abundVector = anElement->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
     
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
       sig = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
       xsection += sig*abundVector[i];
@@ -80,7 +78,7 @@
   
   } else {
-    xsection =
-      GetIsoZACrossSection(aParticle, anElement->GetZ(), anElement->GetN(),
-                           temperature);
+    G4int ZZ = G4lrint(anElement->GetZ());
+    G4int AA = G4lrint(anElement->GetN());
+    xsection = GetIsoZACrossSection(aParticle, ZZ, AA, temperature);
   }
    
Index: trunk/source/processes/hadronic/cross_sections/src/G4NeutronCaptureXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4NeutronCaptureXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4NeutronCaptureXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4NeutronCaptureXS.cc,v 1.3 2010/06/03 11:50:21 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NeutronCaptureXS.cc,v 1.5 2010/10/15 22:36:13 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -48,14 +48,16 @@
 #include <fstream>
 #include <sstream>
+
 using namespace std;
 
 G4NeutronCaptureXS::G4NeutronCaptureXS() 
+  : emax(20*MeV),maxZ(92)
 {
-  verboseLevel = 0;
-  emax = 20.*MeV;
-  G4cout  << "G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise " << G4endl;
-  for(G4int i=0; i<93; ++i) {
-    data[i] = 0;
+  //  verboseLevel = 0;
+  if(verboseLevel > 0){
+    G4cout  << "G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise for Z < "
+	    << maxZ + 1 << G4endl;
   }
+  data.resize(maxZ+1, 0);
   isInitialized = false;
 }
@@ -63,5 +65,5 @@
 G4NeutronCaptureXS::~G4NeutronCaptureXS()
 {
-  for(G4int i=0; i<92; ++i) {
+  for(G4int i=0; i<=maxZ; ++i) {
     delete data[i];
   }
@@ -76,6 +78,6 @@
 
 G4bool 
-G4NeutronCaptureXS::IsZAApplicable(const G4DynamicParticle*,
-				      G4double /*ZZ*/, G4double /*AA*/)
+G4NeutronCaptureXS::IsIsoApplicable(const G4DynamicParticle*,
+				    G4int /*ZZ*/, G4int /*AA*/)
 {
   return false;
@@ -90,5 +92,5 @@
   G4double xs = 0.0;
   G4double ekin = aParticle->GetKineticEnergy();
-  if(ekin > emax) return xs;
+  if(ekin > emax) { return xs; }
 
   G4int Z = G4int(elm->GetZ());
@@ -99,5 +101,5 @@
     Initialise(Z);
     pv = data[Z];
-    if(!pv) return xs;
+    if(!pv) { return xs; }
   }
 
@@ -118,10 +120,9 @@
 G4NeutronCaptureXS::BuildPhysicsTable(const G4ParticleDefinition& p)
 {
-  G4cout << "G4NeutronCaptureXS::BuildPhysicsTable: " << G4endl;
-  G4cout << p.GetParticleName() << G4endl;
-  if(p.GetParticleName() != "neutron") {
-    return;
+  if(verboseLevel > 0){
+    G4cout << "G4NeutronCaptureXS::BuildPhysicsTable for " 
+	   << p.GetParticleName() << G4endl;
   }
-  if(isInitialized) return;
+  if(isInitialized || p.GetParticleName() != "neutron") { return; }
   isInitialized = true;
 
@@ -140,6 +141,6 @@
     for(size_t i=0; i<numOfElm; ++i) {
       G4int Z = G4int(((*theElmTable)[i])->GetZ());
-      if(Z < 1) Z = 1;
-      else if(Z > 92) Z = 92;
+      if(Z < 1)         { Z = 1; }
+      else if(Z > maxZ) { Z = maxZ; }
       //G4cout << "Z= " << Z << G4endl;
       // Initialisation 
@@ -151,11 +152,11 @@
 void 
 G4NeutronCaptureXS::DumpPhysicsTable(const G4ParticleDefinition&)
-{
-}
+{}
+
 
 void 
 G4NeutronCaptureXS::Initialise(G4int Z, const char* p)
 {
-  if(data[Z]) return;
+  if(data[Z]) { return; }
   const char* path = p;
   if(!p) {
Index: trunk/source/processes/hadronic/cross_sections/src/G4NeutronElasticXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4NeutronElasticXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4NeutronElasticXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4NeutronElasticXS.cc,v 1.4 2010/06/03 11:50:21 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NeutronElasticXS.cc,v 1.6 2010/10/15 22:35:58 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -47,20 +47,26 @@
 #include "G4PhysicsVector.hh"
 #include "G4GlauberGribovCrossSection.hh"
+#include "G4HadronNucleonXsc.hh"
 #include "G4NistManager.hh"
+#include "G4Proton.hh"
 
 #include <iostream>
 #include <fstream>
 #include <sstream>
+
 using namespace std;
 
 G4NeutronElasticXS::G4NeutronElasticXS() 
-{
-  verboseLevel = 0;
-  G4cout  << "G4NeutronElasticXS::G4NeutronElasticXS: Initialise " << G4endl;
-  for(G4int i=0; i<93; ++i) {
-    data[i] = 0;
-    coeff[i]= 1.0;
-  }
+  :  proton(G4Proton::Proton()), maxZ(92)
+{
+  //  verboseLevel = 0;
+  if(verboseLevel > 0){
+    G4cout  << "G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < " 
+	    << maxZ + 1 << G4endl;
+  }
+  data.resize(maxZ+1, 0);
+  coeff.resize(maxZ+1, 1.0);
   ggXsection = new G4GlauberGribovCrossSection();
+  fNucleon = new G4HadronNucleonXsc();
   isInitialized = false;
 }
@@ -68,5 +74,5 @@
 G4NeutronElasticXS::~G4NeutronElasticXS()
 {
-  for(G4int i=0; i<92; ++i) {
+  for(G4int i=0; i<=maxZ; ++i) {
     delete data[i];
   }
@@ -75,5 +81,5 @@
 G4bool 
 G4NeutronElasticXS::IsApplicable(const G4DynamicParticle*, 
-				   const G4Element*)
+				 const G4Element*)
 {
   return true;
@@ -81,15 +87,13 @@
 
 G4bool 
-G4NeutronElasticXS::IsZAApplicable(const G4DynamicParticle*,
-				     G4double /*ZZ*/, G4double /*AA*/)
+G4NeutronElasticXS::IsIsoApplicable(const G4DynamicParticle*,
+                                    G4int /*ZZ*/, G4int /*AA*/)
 {
   return false;
 }
-
 
 G4double 
 G4NeutronElasticXS::GetCrossSection(const G4DynamicParticle* aParticle,
-				      const G4Element* elm,
-				      G4double)
+				    const G4Element* elm, G4double)
 {
   G4double xs = 0.0;
@@ -97,4 +101,5 @@
 
   G4int Z = G4int(elm->GetZ());
+  if(Z < 1 || Z > maxZ) { return xs; }
   G4PhysicsVector* pv = data[Z];
   //  G4cout  << "G4NeutronElasticXS::GetCrossSection e= " << ekin << " Z= " << Z << G4endl;
@@ -104,14 +109,18 @@
     Initialise(Z);
     pv = data[Z];
-    if(!pv) return xs;
+    if(!pv) { return xs; }
   }
 
   G4double e1 = pv->Energy(0);
-  if(ekin <= e1) return (*pv)[0];
+  if(ekin <= e1) { return (*pv)[0]; }
 
   G4int n = pv->GetVectorLength() - 1;
   G4double e2 = pv->Energy(n);
+
   if(ekin <= e2) { 
     xs = pv->Value(ekin); 
+  } else if(1 == Z) { 
+    fNucleon->GetHadronNucleonXscPDG(aParticle, proton);
+    xs = coeff[1]*fNucleon->GetElasticHadronNucleonXsc();
   } else {          
     ggXsection->GetCrossSection(aParticle, elm);
@@ -129,12 +138,10 @@
 G4NeutronElasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
 {
-  G4cout << "G4NeutronElasticXS::BuildPhysicsTable: " << G4endl;
-  G4cout << p.GetParticleName() << G4endl;
-  if(p.GetParticleName() != "neutron") {
-    return;
-  }
-  if(isInitialized) return;
+  if(verboseLevel > 0){
+    G4cout << "G4NeutronElasticXS::BuildPhysicsTable for " 
+	   << p.GetParticleName() << G4endl;
+  }
+  if(isInitialized || p.GetParticleName() != "neutron") { return; }
   isInitialized = true;
-
 
   // check environment variable 
@@ -154,6 +161,6 @@
     for(size_t i=0; i<numOfElm; ++i) {
       G4int Z = G4int(((*theElmTable)[i])->GetZ());
-      if(Z < 1) Z = 1;
-      else if(Z > 92) Z = 92;
+      if(Z < 1)         { Z = 1; }
+      else if(Z > maxZ) { Z = maxZ; }
       //G4cout << "Z= " << Z << G4endl;
       // Initialisation 
@@ -173,9 +180,9 @@
 			       const char* p)
 {
-  if(data[Z]) return;
+  if(data[Z]) { return; }
   const char* path = p;
   if(!p) {
-  // check environment variable 
-  // Build the complete string identifying the file with the data set
+    // check environment variable 
+    // Build the complete string identifying the file with the data set
     path = getenv("G4NEUTRONXSDATA");
     if (!path) {
@@ -215,6 +222,12 @@
     G4double sig1 = (*data[Z])[n];
     dynParticle->SetKineticEnergy(emax);
-    ggXsection->GetCrossSection(dynParticle, Elem);
-    G4double sig2 = ggXsection->GetElasticGlauberGribovXsc();
+    G4double sig2 = 0.0;
+    if(1 == Z) {
+      fNucleon->GetHadronNucleonXscPDG(dynParticle, proton);
+      sig2 = fNucleon->GetElasticHadronNucleonXsc();
+    } else {
+      ggXsection->GetCrossSection(dynParticle, Elem);
+      sig2 = ggXsection->GetElasticGlauberGribovXsc();
+    }
     if(sig2 > 0.) { coeff[Z] = sig1/sig2; } 
   } 
Index: trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticCrossSection.cc	(revision 1340)
@@ -30,4 +30,5 @@
 
 #include "G4NeutronInelasticCrossSection.hh"
+#include "G4HadTmpUtil.hh"
 #include "globals.hh"
 
@@ -44,10 +45,10 @@
     G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
     G4double* abundVector = anEle->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
 
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
       psig = GetCrossSection(KE, AA, ZZ);
       cross_section += psig*abundVector[i];
@@ -55,5 +56,7 @@
   
   } else {
-    cross_section = GetCrossSection(KE, anEle->GetN(), anEle->GetZ());
+    G4int ZZ = G4lrint(anEle->GetZ());
+    G4int AA = G4lrint(anEle->GetN());
+    cross_section = GetCrossSection(KE, AA, ZZ);
   }
 
@@ -63,9 +66,12 @@
    
 G4double G4NeutronInelasticCrossSection::
-GetCrossSection(G4double anEnergy, G4double atomicNumber, G4double nOfProtons)
+GetCrossSection(G4double anEnergy, G4int AA, G4int ZZ)
 {
+  G4double atomicNumber = G4double(AA);
+  G4double nOfProtons = G4double(ZZ);
+
   if (anEnergy > 19.9*GeV ) 
   { // constant cross section above ~20GeV.
-    return  GetCrossSection(19.8*GeV,atomicNumber,nOfProtons);
+    return  GetCrossSection(19.8*GeV, AA, ZZ);
   } 
   G4double kineticEnergy = std::log10(DBL_MIN/MeV);
Index: trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticXS.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticXS.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4NeutronInelasticXS.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4NeutronInelasticXS.cc,v 1.4 2010/06/03 11:50:21 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4NeutronInelasticXS.cc,v 1.6 2010/10/15 22:35:32 dennis Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -47,20 +47,26 @@
 #include "G4PhysicsVector.hh"
 #include "G4GlauberGribovCrossSection.hh"
+#include "G4HadronNucleonXsc.hh"
 #include "G4NistManager.hh"
+#include "G4Proton.hh"
 
 #include <iostream>
 #include <fstream>
 #include <sstream>
+
 using namespace std;
 
 G4NeutronInelasticXS::G4NeutronInelasticXS() 
-{
-  verboseLevel = 0;
-  G4cout  << "G4NeutronInelasticXS::G4NeutronInelasticXS: Initialise " << G4endl;
-  for(G4int i=0; i<93; ++i) {
-    data[i] = 0;
-    coeff[i]= 1.0;
-  }
+  : proton(G4Proton::Proton()), maxZ(92)
+{
+  //  verboseLevel = 0;
+  if(verboseLevel > 0){
+    G4cout  << "G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < " 
+	    << maxZ + 1 << G4endl;
+  }
+  data.resize(maxZ+1, 0);
+  coeff.resize(maxZ+1, 1.0);
   ggXsection = new G4GlauberGribovCrossSection();
+  fNucleon = new G4HadronNucleonXsc();
   isInitialized = false;
 }
@@ -68,5 +74,5 @@
 G4NeutronInelasticXS::~G4NeutronInelasticXS()
 {
-  for(G4int i=0; i<92; ++i) {
+  for(G4int i=0; i<=maxZ; ++i) {
     delete data[i];
   }
@@ -81,6 +87,6 @@
 
 G4bool 
-G4NeutronInelasticXS::IsZAApplicable(const G4DynamicParticle*,
-				     G4double /*ZZ*/, G4double /*AA*/)
+G4NeutronInelasticXS::IsIsoApplicable(const G4DynamicParticle*,
+				      G4int /*ZZ*/, G4int /*AA*/)
 {
   return false;
@@ -97,4 +103,5 @@
 
   G4int Z = G4int(elm->GetZ());
+  if(Z < 1 || Z > maxZ) { return xs; }
   G4PhysicsVector* pv = data[Z];
   //  G4cout  << "G4NeutronInelasticXS::GetCrossSection e= " << ekin << " Z= " << Z << G4endl;
@@ -104,9 +111,9 @@
     Initialise(Z);
     pv = data[Z];
-    if(!pv) return xs;
+    if(!pv) { return xs; }
   }
 
   G4double e1 = pv->Energy(0);
-  if(ekin <= e1) return xs;
+  if(ekin <= e1) { return xs; }
 
   G4int n = pv->GetVectorLength() - 1;
@@ -114,4 +121,7 @@
   if(ekin <= e2) { 
     xs = pv->Value(ekin); 
+  } else if(1 == Z) { 
+    fNucleon->GetHadronNucleonXscPDG(aParticle, proton);
+    xs = coeff[1]*fNucleon->GetInelasticHadronNucleonXsc();
   } else {          
     ggXsection->GetCrossSection(aParticle, elm);
@@ -119,5 +129,5 @@
   }
 
-  if(verboseLevel > 0){
+  if(verboseLevel > 0) {
     G4cout  << "ekin= " << ekin << ",  XSinel= " << xs << G4endl;
   }
@@ -129,12 +139,10 @@
 G4NeutronInelasticXS::BuildPhysicsTable(const G4ParticleDefinition& p)
 {
-  G4cout << "G4NeutronInelasticXS::BuildPhysicsTable: " << G4endl;
-  G4cout << p.GetParticleName() << G4endl;
-  if(p.GetParticleName() != "neutron") {
-    return;
-  }
-  if(isInitialized) return;
+  if(verboseLevel > 0){
+    G4cout << "G4NeutronInelasticXS::BuildPhysicsTable for " 
+	   << p.GetParticleName() << G4endl;
+  }
+  if(isInitialized || p.GetParticleName() != "neutron") { return; }
   isInitialized = true;
-
 
   // check environment variable 
@@ -154,6 +162,6 @@
     for(size_t i=0; i<numOfElm; ++i) {
       G4int Z = G4int(((*theElmTable)[i])->GetZ());
-      if(Z < 1) Z = 1;
-      else if(Z > 92) Z = 92;
+      if(Z < 1)         { Z = 1; }
+      else if(Z > maxZ) { Z = maxZ; }
       //G4cout << "Z= " << Z << G4endl;
       // Initialisation 
@@ -173,5 +181,5 @@
 				 const char* p)
 {
-  if(data[Z]) return;
+  if(data[Z]) { return; }
   const char* path = p;
   if(!p) {
@@ -215,6 +223,12 @@
     G4double sig1 = (*data[Z])[n];
     dynParticle->SetKineticEnergy(emax);
-    ggXsection->GetCrossSection(dynParticle, Elem);
-    G4double sig2 = ggXsection->GetInelasticGlauberGribovXsc();
+    G4double sig2 = 0.0;
+    if(1 == Z) {
+      fNucleon->GetHadronNucleonXscPDG(dynParticle, proton);
+      sig2 = fNucleon->GetInelasticHadronNucleonXsc();
+    } else {
+      ggXsection->GetCrossSection(dynParticle, Elem);
+      sig2 = ggXsection->GetInelasticGlauberGribovXsc();
+    }
     if(sig2 > 0.) { coeff[Z] = sig1/sig2; }
   } 
Index: trunk/source/processes/hadronic/cross_sections/src/G4NucleonNuclearCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4NucleonNuclearCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4NucleonNuclearCrossSection.cc	(revision 1340)
@@ -38,4 +38,6 @@
 #include "G4Neutron.hh"
 #include "G4Proton.hh"
+#include "G4HadTmpUtil.hh"
+
 
 // Group 1: He, Be, C for 44 energies  
@@ -43,8 +45,9 @@
 const G4double G4NucleonNuclearCrossSection::e1[44] =     
 {
-  0.014, 0.015, 0.017, .02, 0.022, 0.025, 0.027, 0.03, 0.035, .04, 0.045, 0.05, .06, 0.07, 
-  .08, 0.09,  .1, .12, .14, .15, .16, .18, .20, .25, .30, .35, .4 , 0.5, 0.6, 0.7,  0.8,  
-  0.9,   1, 1.5,   2,   3,   5,  7, 10,   
-  20,   50,  100,  500, 1000
+  0.014, 0.015, 0.017, 0.02, 0.022, 0.025, 0.027, 0.03, 0.035, 0.04,
+  0.045, 0.05,  0.06,  0.07, 0.08,  0.09,  0.1,   0.12, 0.14,  0.15,
+  0.16,  0.18,  0.20,  0.25, 0.30,  0.35,  0.4,   0.5,  0.6,   0.7,
+  0.8,   0.9,   1.0,   1.5,  2.0,   3.0,   5.0,   7.0, 10.0,  20.0,
+ 50.0, 100.0, 500.0, 1000.0
 };
 
@@ -391,7 +394,9 @@
 const G4double G4NucleonNuclearCrossSection::e6[46] =      
 {
-  0.014, 0.015, 0.017, 0.019, .02, 0.022, 0.025, 0.027, 0.03, 0.035, .04, 0.045, 0.05, 
-  0.055, .06, 0.07, .08, 0.09, .1, .12, .14, .15, .16, .18, .20, .25, .30, .35, .4 , 
-  0.5, 0.6, 0.7,  0.8, 0.9, 1, 1.5, 2, 3, 5, 7, 10, 20, 50, 100, 500, 1000
+  0.014, 0.015, 0.017, 0.019, 0.02, 0.022, 0.025, 0.027, 0.03, 0.035,
+  0.04,  0.045, 0.05,  0.055, 0.06, 0.07,  0.08,  0.09,  0.1,  0.12,
+  0.14,  0.15,  0.16,  0.18,  0.20, 0.25,  0.30,  0.35,  0.4 , 0.5,
+  0.6,   0.7,   0.8,   0.9,   1.0,  1.5,   2.0,   3.0,   5.0,  7.0,
+ 10.0,  20.0,  50.0, 100.0, 500.0, 1000.0
 };
 
@@ -443,5 +448,5 @@
 using namespace std;
 
-//////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 //
 //
@@ -535,6 +540,5 @@
 }
 
-///////////////////////////////////////////////////////////////////////////////////
-//
+///////////////////////////////////////////////////////////////////////////////
 //
 
@@ -547,52 +551,54 @@
 ////////////////////////////////////////////////////////////////////////////
 //
-//
 
 G4double G4NucleonNuclearCrossSection::
-GetCrossSection( const G4DynamicParticle* aParticle, 
-                 const G4Element* anElement,
-                       G4double                )
-
-{
-  return GetIsoZACrossSection(aParticle, anElement->GetZ(), anElement->GetN(), 0.);
+GetCrossSection(const G4DynamicParticle* aParticle, 
+                const G4Element* anElement, G4double)
+
+{
+  G4int Z = G4lrint(anElement->GetZ());
+  G4int A = G4lrint(anElement->GetN());
+  return GetZandACrossSection(aParticle, Z, A, 0.);
 }
 
 ////////////////////////////////////////////////////////////////////////////
 //
-//
-
-G4bool G4NucleonNuclearCrossSection::IsApplicable(const G4DynamicParticle* aParticle, 
+
+G4bool
+G4NucleonNuclearCrossSection::IsApplicable(const G4DynamicParticle* aParticle, 
 						  const G4Element* anElement)
 {
-  return IsZAApplicable(aParticle, anElement->GetZ(), anElement->GetN()); 
+  G4int Z = G4lrint(anElement->GetZ());
+  G4int A = G4lrint(anElement->GetN());
+  return IsIsoApplicable(aParticle, Z, A); 
 }
 
 ////////////////////////////////////////////////////////////////////////////
 //
-//
-
-G4bool G4NucleonNuclearCrossSection::IsZAApplicable(const G4DynamicParticle* aParticle, 
-						    G4double Z, G4double)
+
+G4bool
+G4NucleonNuclearCrossSection::IsIsoApplicable(const G4DynamicParticle* aParticle, 
+						    G4int Z, G4int)
 {
   G4bool result = false;
   if(aParticle->GetDefinition() == theNeutron ) result = true;
   if(aParticle->GetDefinition() == theProton)   result = true;
-  if(Z < 1.5)                                   result = false;
+  if(Z < 2)                                     result = false;
   if(aParticle->GetKineticEnergy() > 999.9*GeV) result = false;
   return result;
 }
 
+
 ////////////////////////////////////////////////////////////////////////////
 //
-//
 
 G4double G4NucleonNuclearCrossSection::
-GetIsoZACrossSection( const G4DynamicParticle* aParticle, 
-                      G4double  zElement, G4double, G4double  )
+GetZandACrossSection(const G4DynamicParticle* aParticle, 
+                     G4int zElement, G4int, G4double  )
 {
    G4double kineticEnergy = aParticle->GetKineticEnergy();
   
    G4double result = 0;
-   G4int Z = G4int(zElement + 0.5);
+   G4int Z = zElement;
 
    // G4cout<<"Z = "<<Z<<G4endl;
@@ -675,5 +681,4 @@
 
 /////////////////////////////////////////////////////////////////////////////
-//
 //
 
Index: trunk/source/processes/hadronic/cross_sections/src/G4PhotoNuclearCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4PhotoNuclearCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4PhotoNuclearCrossSection.cc	(revision 1340)
@@ -26,5 +26,5 @@
 //
 // The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 //
@@ -40,4 +40,5 @@
 
 #include "G4PhotoNuclearCrossSection.hh"
+#include "G4HadTmpUtil.hh"
 
 // Initialization of the statics
@@ -59,10 +60,15 @@
                             // Last value of the ShadowingPomeron (A-dependent)
 
-std::vector<G4double*> G4PhotoNuclearCrossSection::GDR;   // Vector of pointers to the GDRPhotonuclearCrossSection
-std::vector<G4double*> G4PhotoNuclearCrossSection::HEN;   // Vector of pointers to the HighEnPhotonuclearCrossSect
+
+// Vector of pointers to the GDRPhotonuclearCrossSection
+std::vector<G4double*> G4PhotoNuclearCrossSection::GDR;
+
+// Vector of pointers to the HighEnPhotonuclearCrossSect
+std::vector<G4double*> G4PhotoNuclearCrossSection::HEN;
+
 
 G4PhotoNuclearCrossSection::G4PhotoNuclearCrossSection()
-{
-}
+{}
+
 
 G4PhotoNuclearCrossSection::~G4PhotoNuclearCrossSection()
@@ -92,10 +98,10 @@
     G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
     G4double* abundVector = anEle->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
   
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
       psig = GetIsoZACrossSection(aPart, ZZ, AA, temperature);
       cross_section += psig*abundVector[i];
@@ -103,6 +109,7 @@
 
   } else {
-    cross_section = 
-      GetIsoZACrossSection(aPart, anEle->GetZ(), anEle->GetN(), temperature);
+    G4int ZZ = G4lrint(anEle->GetZ());
+    G4int AA = G4lrint(anEle->GetN());
+    cross_section = GetZandACrossSection(aPart, ZZ, AA, temperature);
   }
  
@@ -112,6 +119,6 @@
 
 G4double 
-G4PhotoNuclearCrossSection::GetIsoZACrossSection(const G4DynamicParticle* aPart,
-                                                 G4double ZZ, G4double AA, 
+G4PhotoNuclearCrossSection::GetZandACrossSection(const G4DynamicParticle* aPart,
+                                                 G4int ZZ, G4int AA, 
 					         G4double /*temperature*/)
 {
@@ -146,6 +153,6 @@
   //
   const G4double Energy = aPart->GetKineticEnergy()/MeV;
-  const G4int targetAtomicNumber = static_cast<int>(AA+.499); //@@ Nat mixture (?!)
-  const G4int targZ = static_cast<int>(ZZ);
+  const G4int targetAtomicNumber = AA; //@@ Nat mixture (?!)
+  const G4int targZ = ZZ;
   const G4int targN = targetAtomicNumber-targZ;
 #ifdef debug
@@ -1609,9 +1616,9 @@
 
   static const G4double SH10[nH]={
-    3.918292e+00,3.904931e+00,3.893792e+00,3.886847e+00,3.886858e+00,3.897612e+00,3.924175e+00,
-    3.973155e+00,4.052892e+00,4.173448e+00,4.346251e+00,4.583168e+00,4.894929e+00,5.289011e+00,
-    5.767472e+00,6.325587e+00,6.952077e+00,7.631192e+00,8.346046e+00,9.081993e+00,9.828955e+00,
-    1.058224e+01,1.134205e+01,1.211228e+01,1.289914e+01,1.370979e+01,1.455140e+01,1.543028e+01,
-    1.635126e+01,1.731704e+01,1.832759e+01,1.937949e+01,2.046524e+01,2.157253e+01,2.268371e+01,
+    3.918292, 3.904931, 3.893792, 3.886847, 3.886858, 3.897612, 3.924175,
+    3.973155, 4.052892, 4.173448, 4.346251, 4.583168, 4.894929, 5.289011,
+    5.767472, 6.325587, 6.952077, 7.631192, 8.346046, 9.081993, 9.828955,
+   10.58224, 11.34205, 12.11228, 12.89914, 13.70979, 14.55140, 15.43028,
+   16.35126, 17.31704, 18.32759, 19.37949, 20.46524, 21.57253, 22.68371,
     2.377554e+01,2.481942e+01,2.578236e+01,2.662884e+01,2.732355e+01,2.783477e+01,2.813791e+01,
     2.821866e+01,2.807489e+01,2.771701e+01,2.716665e+01,2.645395e+01,2.561414e+01,2.468397e+01,
Index: trunk/source/processes/hadronic/cross_sections/src/G4PiNuclearCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4PiNuclearCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4PiNuclearCrossSection.cc	(revision 1340)
@@ -75,5 +75,5 @@
  const G4double G4PiNuclearCrossSection::e2[39] = {
   .02, .04, .06, .08, .10, .11, .12, .13, .14,  .15, .16, .17, .18, .20, .22,
-  .24, .26, .28, .30, .35, .40, .45, .50, .55, .575, .60, .70, .80, .90,   1,   
+  .24, .26, .28, .30, .35, .40, .45, .50, .55, .575, .60, .70, .80, .90,   1,
     2,   3,   5,  10,  20,  50, 100, 500, 100000};
 
@@ -138,7 +138,7 @@
 
  const G4double G4PiNuclearCrossSection::na_m_t[31] = {
-  450, 545, 705, 910, 1020, 1075, 1087, 1080, 1042, 987, 943, 885, 790, 700, 650, 
-  610, 585, 575, 585,  595,  600,  610,  556,  524, 494, 458, 445, 429, 427, 427,
-  427};
+  450, 545, 705, 910, 1020, 1075, 1087, 1080, 1042, 987, 943, 885, 790, 700,
+  650, 610, 585, 575, 585,  595,  600,  610,  556,  524, 494, 458, 445, 429,
+  427, 427, 427};
 
  const G4double G4PiNuclearCrossSection::na_m_in[31] = {
@@ -156,12 +156,12 @@
 
  const G4double G4PiNuclearCrossSection::e3_1[31] = { 
-  0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25, 0.30, 0.35, 0.40,
-  0.45, 0.50, 0.60, 0.70, 0.80, 0.90,    1,    2,    3,    5,   10,   20,   50,  100,  500,
-  100000};
+  0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20,
+  0.22, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50, 0.60, 0.70, 0.80,
+  0.90, 1.0,  2.0,  3.0,  5.0, 10.0, 20.0, 50.0, 100.0, 500.0, 100000.0};
 
  const G4double G4PiNuclearCrossSection::al_m_t[31] = { 
-  532, 637, 832, 1057, 1207, 1230, 1210, 1174, 1133, 1095, 1038, 970, 890, 807, 750, 
-  710, 675, 665,  670,  673,  678,  682,  618,  574,  546,  520, 507, 495, 488, 488,  
-  488};
+  532, 637, 832, 1057, 1207, 1230, 1210, 1174, 1133, 1095,
+ 1038, 970, 890,  807,  750,  710,  675,  665,  670,  673,
+  678, 682, 618,  574,  546,  520,  507,  495,  488,  488,  488};
 
  const G4double G4PiNuclearCrossSection::al_m_in[31] = {
@@ -171,6 +171,6 @@
 
  const G4double G4PiNuclearCrossSection::al_p_t[21] = { 
-  225, 350, 616, 945, 1122, 1175, 1157, 1128, 1088, 1045, 988, 935, 870, 787, 730, 
-  690, 660, 652, 660,  668,  678};
+  225, 350, 616, 945, 1122, 1175, 1157, 1128, 1088, 1045,
+  988, 935, 870, 787, 730,   690,  660,  652,  660,  668,  678};
 
  const G4double G4PiNuclearCrossSection::al_p_in[21] = {
@@ -179,7 +179,7 @@
 
  const G4double G4PiNuclearCrossSection::ca_m_t[31] = { 
-  800, 980, 1240, 1460, 1570, 1600, 1580, 1535, 1475, 1425, 1375, 1295, 1200, 1083, 1000, 
-  948, 915,  895,  900,  908,  915,  922,  856,  795,  740,  705,  682,  660,  660,  660,
-  660};
+  800,  980, 1240, 1460, 1570, 1600, 1580, 1535, 1475, 1425,
+ 1375, 1295, 1200, 1083, 1000,  948,  915,  895,  900,  908,
+  915,  922,  856,  795,  740,  705,  682,  660,  660,  660, 660};
 
  const G4double G4PiNuclearCrossSection::ca_m_in[31] = {
@@ -222,14 +222,33 @@
  const G4double G4PiNuclearCrossSection::cd_m_t[34] = {3060, 3125, 3170, 3220, 3255, 3280, 3290, 3260, 3270, 3200, 3120, 3080, 3090, 2920, 2810, 2640, 2362, 2230, 2115, 2050, 2020, 2025, 2040, 2070, 2100, 1900, 1795, 1740, 1675, 1645, 1625, 1620, 1620, 1620};
  const G4double G4PiNuclearCrossSection::cd_m_in[34]= {1025, 1275, 1440, 1625, 1740, 1800, 1880, 1920, 1980, 1920, 1850, 1810, 1720, 1650, 1560, 1450, 1330, 1290, 1245, 1210, 1200, 1200, 1205, 1205, 1230, 1130, 1085, 1060, 1000,  985,  975,  970,  970,  970};
- const G4double G4PiNuclearCrossSection::cd_p_t[28] =  {455,  780, 1170, 1700, 2120, 2400, 2600, 2720, 2820, 2840, 2800, 2760, 2720, 2640, 2560, 2450, 2252, 2130, 2035, 1985, 1970, 1975, 2005, 2035, 2070, 1880, 1795, 1740};
- const G4double G4PiNuclearCrossSection::cd_p_in[28] = {310,  580,  880, 1060, 1270, 1400, 1530, 1610, 1660, 1680, 1640, 1600, 1560, 1500, 1430, 1330, 1280, 1230, 1200, 1180, 1170, 1175, 1180, 1180, 1210, 1120, 1085, 1060};
+
+ const G4double G4PiNuclearCrossSection::cd_p_t[28] =  {
+   455,  780, 1170, 1700, 2120, 2400, 2600, 2720, 2820, 2840,
+  2800, 2760, 2720, 2640, 2560, 2450, 2252, 2130, 2035, 1985,
+  1970, 1975, 2005, 2035, 2070, 1880, 1795, 1740};
+
+ const G4double G4PiNuclearCrossSection::cd_p_in[28] = {
+   310,  580,  880, 1060, 1270, 1400, 1530, 1610, 1660, 1680,
+  1640, 1600, 1560, 1500, 1430, 1330, 1280, 1230, 1200, 1180,
+  1170, 1175, 1180, 1180, 1210, 1120, 1085, 1060};
 
  const G4double G4PiNuclearCrossSection::e6[35] = {
-  0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.25,  
-  0.30, 0.35, 0.40, 0.45, 0.50, 0.55, 0.60, 0.70, 0.80, 0.90,    1,    2,    3,    5,   10,   
-    20,   50,  100,  500, 100000};
-
- const G4double G4PiNuclearCrossSection::sn_m_t[35] =  {3000, 3180, 3250, 3300, 3300, 3410, 3470, 3450, 3410, 3350, 3280, 3200, 3120, 3050, 2900, 2630, 2500, 2325, 2190, 2100, 2060, 2055, 2055, 2055, 2067, 2085, 2000, 1900, 1835, 1770, 1720, 1700, 1695, 1695, 1695};
- const G4double G4PiNuclearCrossSection::sn_m_in[35] = {1050, 1350, 1520, 1650, 1800, 1980, 2070, 2120, 2090, 2050, 1980, 1920, 1830, 1770, 1670, 1500, 1435, 1350, 1300, 1230, 1220, 1235, 1235, 1235, 1237, 1240, 1160, 1120, 1090, 1065, 1040, 1020, 1015, 1015, 1015};
+  0.02, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.12, 0.14,
+  0.16, 0.18, 0.20, 0.22, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50,
+  0.55, 0.60, 0.70, 0.80, 0.90, 1.0,  2.0,  3.0,  5.0, 10.0,   
+ 20.0, 50.0, 100.0, 500.0, 100000.0};
+
+ const G4double G4PiNuclearCrossSection::sn_m_t[35] = {
+  3000, 3180, 3250, 3300, 3300, 3410, 3470, 3450, 3410, 3350,
+  3280, 3200, 3120, 3050, 2900, 2630, 2500, 2325, 2190, 2100,
+  2060, 2055, 2055, 2055, 2067, 2085, 2000, 1900, 1835, 1770,
+  1720, 1700, 1695, 1695, 1695};
+
+ const G4double G4PiNuclearCrossSection::sn_m_in[35] = {
+  1050, 1350, 1520, 1650, 1800, 1980, 2070, 2120, 2090, 2050,
+  1980, 1920, 1830, 1770, 1670, 1500, 1435, 1350, 1300, 1230,
+  1220, 1235, 1235, 1235, 1237, 1240, 1160, 1120, 1090, 1065,
+  1040, 1020, 1015, 1015, 1015};
+
  const G4double G4PiNuclearCrossSection::sn_p_t[29] =  { 465,  800, 1200, 1760, 2170, 2480, 2730, 2885, 2970, 2980, 2970, 2890, 2840, 2790, 2620, 2450, 2335, 2205, 2080, 2020, 2010, 1990, 1990, 2015, 2030, 2045, 1980, 1890, 1835};
  const G4double G4PiNuclearCrossSection::sn_p_in[29] = { 315,  590,  880, 1220, 1460, 1580, 1700, 1770, 1810, 1810, 1800, 1730, 1680, 1630, 1530, 1400, 1335, 1270, 1210, 1180, 1190, 1190, 1190, 1205, 1210, 1210, 1150, 1115, 1090};
@@ -346,9 +365,8 @@
 
 G4double G4PiNuclearCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* particle, G4double ZZ, 
-                     G4double /*AA*/, G4double /*temperature*/)
+GetZandACrossSection(const G4DynamicParticle* particle, G4int ZZ, 
+                     G4int /*AA*/, G4double /*temperature*/)
 {
   // precondition
-  //  G4ping debug("debug_PiNuclearCrossSection");
   using namespace std;
   G4bool ok = false;
@@ -367,9 +385,9 @@
 
   G4double result = 0;
-  G4int Z=G4lrint(ZZ);
+  G4int Z = ZZ;
   //  debug.push_back(Z);
   size_t it = 0;
 
-  while(it<theZ.size() && Z>theZ[it]) it++;
+  while(it < theZ.size() && Z > theZ[it]) it++;
 
   //  debug.push_back(theZ[it]);
@@ -475,19 +493,21 @@
  }
 
- G4double G4PiNuclearCrossSection::
- Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2)
- { 
+
+G4double G4PiNuclearCrossSection::
+Interpolate(G4int Z1, G4int Z2, G4int Z, G4double x1, G4double x2)
+{ 
 //   Nucleon numbers obtained from G4NistManager G4 8.0
- static const G4double A[92]=
- 			{1.0001, 4.0000, 6.9241, 9.0000, 10.801, 12.011, 14.004, 16.004, 19.000, 20.188,
-			 23.000, 24.320, 27.000, 28.109, 31.000, 32.094, 35.484, 39.985, 39.135, 40.116,
-			 45.000, 47.918, 50.998, 52.055, 55.000, 55.910, 59.000, 58.760, 63.617, 65.468,
-			 69.798, 72.691, 75.000, 79.042, 79.986, 83.887, 85.557, 87.710, 89.000, 91.318,
-			 93.000, 96.025, 98.000, 101.16, 103.00, 106.51, 107.96, 112.51, 114.91, 118.81,
-			 121.86, 127.70, 127.00, 131.39, 133.00, 137.42, 139.00, 140.21, 141.00, 144.32,
-			 145.00, 150.45, 152.04, 157.33, 159.00, 162.57, 165.00, 167.32, 169.00, 173.10,
-			 175.03, 178.54, 181.00, 183.89, 186.25, 190.27, 192.25, 195.11, 197.00, 200.63,
-			 204.41, 207.24, 209.00, 209.00, 210.00, 222.00, 223.00, 226.00, 227.00, 232.00,
-			 231.00, 237.98};
+ static const G4double A[92] = {
+   1.0001, 4.0000, 6.9241, 9.000, 10.801, 12.011, 14.004, 16.004, 19.000,
+  20.188, 23.000, 24.320, 27.000, 28.109, 31.000, 32.094, 35.484, 39.985,
+  39.135, 40.116, 45.000, 47.918, 50.998, 52.055, 55.000, 55.910, 59.000,
+  58.760, 63.617, 65.468, 69.798, 72.691, 75.000, 79.042, 79.986, 83.887,
+  85.557, 87.710, 89.000, 91.318, 93.000, 96.025, 98.000, 101.16, 103.00,
+ 106.51, 107.96, 112.51, 114.91, 118.81, 121.86, 127.70,  127.00, 131.39,
+ 133.00, 137.42, 139.00, 140.21, 141.00, 144.32, 145.00,  150.45, 152.04,
+ 157.33, 159.00, 162.57, 165.00, 167.32, 169.00, 173.10,  175.03, 178.54,
+ 181.00, 183.89, 186.25, 190.27, 192.25, 195.11, 197.00, 200.63,  204.41,
+ 207.24, 209.00, 209.00, 210.00, 222.00, 223.00, 226.00, 227.00,  232.00,
+ 231.00, 237.98};
 			 
  static G4bool NeedInit=true;		     
@@ -502,10 +522,10 @@
  }
 
-//        for tabulated data, cross section scales with A^.75
+// for tabulated data, cross section scales with A^.75
    G4double r1 = x1 / A75[Z1-1] * A75[Z-1];
    G4double r2 = x2 / A75[Z2-1] * A75[Z-1];
    G4double result=0.5*(r1+r2);
-//       G4cout << "x1/2, z1/2 z" <<x1<<" "<<x2<<" "<<Z1<<" "<<Z2<<" "<<Z<<G4endl;
-//       G4cout << "res1/2 " << r1 <<" " << r2 <<" " << result<< G4endl;
+//  G4cout << "x1/2, z1/2 z" <<x1<<" "<<x2<<" "<<Z1<<" "<<Z2<<" "<<Z<<G4endl;
+//  G4cout << "res1/2 " << r1 <<" " << r2 <<" " << result<< G4endl;
    return result;
- }
+}
Index: trunk/source/processes/hadronic/cross_sections/src/G4ProtonInelasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4ProtonInelasticCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4ProtonInelasticCrossSection.cc	(revision 1340)
@@ -31,4 +31,5 @@
 
 #include "G4ProtonInelasticCrossSection.hh"
+#include "G4HadTmpUtil.hh"
 #include "globals.hh"
 
@@ -46,10 +47,10 @@
     G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
     G4double* abundVector = anEle->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
  
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
       psig = GetCrossSection(KE, AA, ZZ);
       cross_section += psig*abundVector[i];
@@ -57,5 +58,7 @@
  
   } else {
-    cross_section = GetCrossSection(KE, anEle->GetN(), anEle->GetZ());
+    G4int ZZ = G4lrint(anEle->GetZ());
+    G4int AA = G4lrint(anEle->GetN());
+    cross_section = GetCrossSection(KE, AA, ZZ);
   }
 
@@ -63,7 +66,7 @@
 }
 
-   
+
 G4double G4ProtonInelasticCrossSection::
-GetCrossSection(G4double kineticEnergy, G4double atomicNumber, G4double nOfProtons)
+GetCrossSection(G4double kineticEnergy, G4int atomicNumber, G4int nOfProtons)
 {   
   if (kineticEnergy > 19.9*GeV ) 
@@ -71,5 +74,5 @@
     return  GetCrossSection(19.8*GeV,atomicNumber,nOfProtons);
   } 
-  G4double nOfNeutrons = atomicNumber-nOfProtons;
+  G4int nOfNeutrons = atomicNumber-nOfProtons;
   kineticEnergy /=GeV;
   G4double a = atomicNumber;
@@ -80,5 +83,5 @@
   G4double fac1=b0*(1-std::pow(a,-0.3333));
   G4double fac2=1.;
-  if(nOfNeutrons>1.5) fac2=std::log((nOfNeutrons));
+  if(nOfNeutrons > 1) fac2=std::log((G4double(nOfNeutrons)));
   G4double crossSection = 1E31*fac*fac2*(1+std::pow(a,0.3333)-fac1);
 
Index: trunk/source/processes/hadronic/cross_sections/src/G4TripathiCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4TripathiCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4TripathiCrossSection.cc	(revision 1340)
@@ -43,9 +43,8 @@
 
 G4double G4TripathiCrossSection::
-GetIsoZACrossSection(const G4DynamicParticle* aPart, G4double ZZ, G4double AA, 
-                G4double /*temperature*/) 
+GetZandACrossSection(const G4DynamicParticle* aPart, G4int ZZ, G4int AA, 
+                     G4double /*temperature*/) 
 {
   G4double result = 0.;
-  
   const G4double targetAtomicNumber = AA;
   const G4double nTargetProtons = ZZ;
@@ -157,18 +156,18 @@
     G4IsotopeVector* isoVector = anEle->GetIsotopeVector();
     G4double* abundVector = anEle->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
      
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
-      sig = GetIsoZACrossSection(aPart, ZZ, AA, temperature);
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
+      sig = GetZandACrossSection(aPart, ZZ, AA, temperature);
       xsection += sig*abundVector[i];
     }
    
   } else {
-    xsection =
-      GetIsoZACrossSection(aPart, anEle->GetZ(), anEle->GetN(),
-                           temperature);
+    G4int ZZ = G4lrint(anEle->GetZ());
+    G4int AA = G4lrint(anEle->GetN());
+    xsection = GetIsoZACrossSection(aPart, ZZ, AA, temperature);
   }
 
Index: trunk/source/processes/hadronic/cross_sections/src/G4TripathiLightCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4TripathiLightCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4TripathiLightCrossSection.cc	(revision 1340)
@@ -63,4 +63,6 @@
 #include "G4ParticleTable.hh"
 #include "G4IonTable.hh"
+#include "G4HadTmpUtil.hh"
+
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -101,10 +103,13 @@
   (const G4DynamicParticle* theProjectile, const G4Element* theTarget)
 {
-  return IsZAApplicable(theProjectile, theTarget->GetZ(), theTarget->GetN());
-}
-
-
-G4bool G4TripathiLightCrossSection::IsZAApplicable
-  (const G4DynamicParticle* theProjectile, G4double ZZ, G4double AA)
+  G4int Z = G4lrint(theTarget->GetZ());
+  G4int A = G4lrint(theTarget->GetN());
+  return IsIsoApplicable(theProjectile, Z, A);
+}
+
+
+G4bool
+G4TripathiLightCrossSection::IsIsoApplicable(const G4DynamicParticle* theProjectile,
+                                             G4int ZZ, G4int AA)
 {
   G4bool result = false;
@@ -122,9 +127,10 @@
   return result;
 }
-///////////////////////////////////////////////////////////////////////////////
-//
-G4double G4TripathiLightCrossSection::GetIsoZACrossSection
-  (const G4DynamicParticle* theProjectile, G4double ZZ, G4double AA,
-   G4double /*theTemperature*/)
+
+///////////////////////////////////////////////////////////////////////////////
+//
+G4double
+G4TripathiLightCrossSection::GetZandACrossSection(const G4DynamicParticle* theProjectile,
+                                                  G4int ZZ, G4int AA, G4double /*theTemperature*/)
 {
 //
@@ -301,5 +307,5 @@
 	  SetLowEnergyCheck(true);
       G4double resultp =
-        GetIsoZACrossSection(&slowerProjectile, ZZ, AA, 0.0);
+        GetZandACrossSection(&slowerProjectile, ZZ, AA, 0.0);
 	  SetLowEnergyCheck(savelowenergy);
       if (resultp >result) result = 0.0;
@@ -322,18 +328,18 @@
     G4IsotopeVector* isoVector = theTarget->GetIsotopeVector();
     G4double* abundVector = theTarget->GetRelativeAbundanceVector();
-    G4double ZZ;
-    G4double AA;
+    G4int ZZ;
+    G4int AA;
      
     for (G4int i = 0; i < nIso; i++) {
-      ZZ = G4double( (*isoVector)[i]->GetZ() );
-      AA = G4double( (*isoVector)[i]->GetN() );
-      sig = GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
+      ZZ = (*isoVector)[i]->GetZ();
+      AA = (*isoVector)[i]->GetN();
+      sig = GetZandACrossSection(theProjectile, ZZ, AA, theTemperature);
       xsection += sig*abundVector[i];
     }
    
   } else {
-    xsection =
-      GetIsoZACrossSection(theProjectile, theTarget->GetZ(), theTarget->GetN(),
-                           theTemperature);
+    G4int ZZ = G4lrint(theTarget->GetZ());
+    G4int AA = G4lrint(theTarget->GetN());
+    xsection = GetIsoZACrossSection(theProjectile, ZZ, AA, theTemperature);
   }
     
@@ -348,4 +354,3 @@
   lowEnergyCheck = aLowEnergyCheck;
 }
-///////////////////////////////////////////////////////////////////////////////
-//
+
Index: trunk/source/processes/hadronic/cross_sections/src/G4UElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4UElasticCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4UElasticCrossSection.cc	(revision 1340)
@@ -80,6 +80,8 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-G4bool G4UElasticCrossSection::IsZAApplicable(const G4DynamicParticle* dp, 
-						G4double Z, G4double A)
+// G4bool G4UElasticCrossSection::IsZAApplicable(const G4DynamicParticle* dp, 
+// 						G4double Z, G4double A)
+G4bool G4UElasticCrossSection::IsIsoApplicable(const G4DynamicParticle* dp,
+                                               G4int Z, G4int A)
 {
   G4bool res = false;
@@ -94,30 +96,30 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4UElasticCrossSection::GetCrossSection(const G4DynamicParticle* dp, 
-						   const G4Element* elm, 
-						   G4double temp)
-{
-  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4UElasticCrossSection::GetIsoZACrossSection(const G4DynamicParticle* dp, 
-							G4double Z,
-							G4double A, 
-							G4double)
+
+G4double
+G4UElasticCrossSection::GetCrossSection(const G4DynamicParticle* dp, 
+                                        const G4Element* elm, G4double temp)
+{
+  G4int Z = G4lrint(elm->GetZ());
+  G4int N = G4lrint(elm->GetN());
+
+  return GetZandACrossSection(dp, Z, N, temp);
+}
+
+
+G4double
+G4UElasticCrossSection::GetZandACrossSection(const G4DynamicParticle* dp, 
+                                             G4int Z, G4int A, G4double)
 {
   G4double cross = 0.0;
   G4double ekin = dp->GetKineticEnergy();
-  G4int iz = G4int(Z);
-  if(iz > 92) iz = 92;
+//  G4int iz = G4int(Z);
+  if(Z > 92) Z = 92;
 
     // proton and neutron
   if(fNucleon) { 
-    if(iz == 1) cross = fGheisha->GetElasticCrossSection(dp, Z, A);
+    if(Z == 1) cross = fGheisha->GetElasticCrossSection(dp, Z, A);
     else if(ekin > thEnergy) {
-      cross = theFac[iz]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
+      cross = theFac[Z]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
     } else {
       cross = fNucleon->GetElasticCrossSection(dp, Z, A);
@@ -126,7 +128,7 @@
     // pions
   } else if(fUPi) {
-    if(iz == 1) cross = fGheisha->GetElasticCrossSection(dp, Z, A);
+    if(Z == 1) cross = fGheisha->GetElasticCrossSection(dp, Z, A);
     else if(ekin > thEnergy) {
-      cross = theFac[iz]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
+      cross = theFac[Z]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
     } else {
       cross = fUPi->GetElasticCrossSection(dp, Z, A);
@@ -136,5 +138,5 @@
   } else {
     if(hasGlauber && ekin > thEnergy) {
-      cross = theFac[iz]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
+      cross = theFac[Z]*fGlauber->GetElasticGlauberGribov(dp, Z, A);
     } else if(fGheisha->IsApplicable(dp, Z, A)) {
       cross = fGheisha->GetElasticCrossSection(dp, Z, A);
@@ -182,5 +184,5 @@
 
   G4NistManager* nist = G4NistManager::Instance();
-  G4double A = nist->GetAtomicMassAmu(2);
+  G4int A = G4lrint(nist->GetAtomicMassAmu(2));
 
   if(fGlauber->IsZAApplicable(&dp, 2.0, A)) {
@@ -193,17 +195,17 @@
 
       G4double Z = G4double(iz);
-      A = nist->GetAtomicMassAmu(iz);
-      csup = fGlauber->GetElasticGlauberGribov(&dp, Z, A);
+      A = G4lrint(nist->GetAtomicMassAmu(iz));
+      csup = fGlauber->GetElasticGlauberGribov(&dp, iz, A);
       // proton and neutron
       if(fNucleon) { 
-	csdn = fNucleon->GetElasticCrossSection(&dp, Z, A);
+	csdn = fNucleon->GetElasticCrossSection(&dp, iz, A);
 
 	// pions
       } else if(fUPi) {
-	csdn = fUPi->GetElasticCrossSection(&dp, Z, A);
+	csdn = fUPi->GetElasticCrossSection(&dp, iz, A);
 
 	// other
-      } else if(fGheisha->IsApplicable(&dp, Z, A)) {
-	csdn = fGheisha->GetElasticCrossSection(&dp, Z, A);
+      } else if(fGheisha->IsApplicable(&dp, iz, A)) {
+	csdn = fGheisha->GetElasticCrossSection(&dp, iz, A);
 
       } else {
@@ -217,5 +219,3 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
+
Index: trunk/source/processes/hadronic/cross_sections/src/G4UInelasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4UInelasticCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4UInelasticCrossSection.cc	(revision 1340)
@@ -78,8 +78,8 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4bool G4UInelasticCrossSection::IsZAApplicable(const G4DynamicParticle* dp, 
-						G4double Z, G4double A)
+
+G4bool
+G4UInelasticCrossSection::IsIsoApplicable(const G4DynamicParticle* dp, 
+                                          G4int Z, G4int A)
 {
   G4bool res = false;
@@ -94,30 +94,30 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4UInelasticCrossSection::GetCrossSection(const G4DynamicParticle* dp, 
-						   const G4Element* elm, 
-						   G4double temp)
-{
-  return GetIsoZACrossSection(dp, elm->GetZ(), elm->GetN(), temp);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-G4double G4UInelasticCrossSection::GetIsoZACrossSection(const G4DynamicParticle* dp, 
-							G4double Z,
-							G4double A, 
-							G4double)
+
+G4double
+G4UInelasticCrossSection::GetCrossSection(const G4DynamicParticle* dp, 
+					  const G4Element* elm, 
+				          G4double temp)
+{
+  G4int Z = G4lrint(elm->GetZ());
+  G4int N = G4lrint(elm->GetN());
+  return GetIsoZACrossSection(dp, Z, N, temp);
+}
+
+
+G4double
+G4UInelasticCrossSection::GetZandACrossSection(const G4DynamicParticle* dp, 
+					       G4int Z, G4int A, G4double)
 {
   G4double cross = 0.0;
   G4double ekin = dp->GetKineticEnergy();
-  G4int iz = G4int(Z);
-  if(iz > 92) iz = 92;
+  //  G4int iz = G4int(Z);
+  if(Z > 92) Z = 92;
 
     // proton and neutron
   if(fNucleon) { 
-    if(iz == 1) cross = fGheisha->GetInelasticCrossSection(dp, Z, A);
+    if(Z == 1) cross = fGheisha->GetInelasticCrossSection(dp, Z, A);
     else if(ekin > thEnergy) {
-      cross = theFac[iz]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
+      cross = theFac[Z]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
     } else {
       cross = fNucleon->GetIsoZACrossSection(dp, Z, A);
@@ -126,7 +126,7 @@
     // pions
   } else if(fUPi) {
-    if(iz == 1) cross = fGheisha->GetInelasticCrossSection(dp, Z, A);
+    if(Z == 1) cross = fGheisha->GetInelasticCrossSection(dp, Z, A);
     else if(ekin > thEnergy) {
-      cross = theFac[iz]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
+      cross = theFac[Z]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
     } else {
       cross = fUPi->GetInelasticCrossSection(dp, Z, A);
@@ -136,5 +136,5 @@
   } else {
     if(hasGlauber && ekin > thEnergy) {
-      cross = theFac[iz]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
+      cross = theFac[Z]*fGlauber->GetInelasticGlauberGribov(dp, Z, A);
     } else if(fGheisha->IsApplicable(dp, Z, A)){
       cross = fGheisha->GetInelasticCrossSection(dp, Z, A);
@@ -153,5 +153,4 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 void G4UInelasticCrossSection::BuildPhysicsTable(const G4ParticleDefinition& p)
@@ -173,6 +172,4 @@
 
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 void G4UInelasticCrossSection::Initialise(const G4ParticleDefinition* p) 
 {
@@ -182,7 +179,7 @@
 
   G4NistManager* nist = G4NistManager::Instance();
-  G4double A = nist->GetAtomicMassAmu(2);
-
-  if(fGlauber->IsZAApplicable(&dp, 2.0, A)) {
+  G4int A = G4lrint(nist->GetAtomicMassAmu(2));
+
+  if(fGlauber->IsIsoApplicable(&dp, 2, A)) {
     hasGlauber = true;
 
@@ -193,18 +190,18 @@
 
       G4double Z = G4double(iz);
-      A = nist->GetAtomicMassAmu(iz);
-      csup = fGlauber->GetInelasticGlauberGribov(&dp, Z, A);
+      A = G4lrint(nist->GetAtomicMassAmu(iz));
+      csup = fGlauber->GetInelasticGlauberGribov(&dp, iz, A);
 
       // proton and neutron
       if(fNucleon) { 
-	csdn = fNucleon->GetIsoZACrossSection(&dp, Z, A);
+	csdn = fNucleon->GetIsoZACrossSection(&dp, iz, A);
 
 	// pions
       } else if(fUPi) {
-	csdn = fUPi->GetInelasticCrossSection(&dp, Z, A);
+	csdn = fUPi->GetInelasticCrossSection(&dp, iz, A);
 
 	// other
-      } else if(fGheisha->IsApplicable(&dp, Z, A)) {
-	csdn = fGheisha->GetInelasticCrossSection(&dp, Z, A);
+      } else if(fGheisha->IsApplicable(&dp, iz, A)) {
+	csdn = fGheisha->GetInelasticCrossSection(&dp, iz, A);
 
       } else {
@@ -218,5 +215,2 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-
Index: trunk/source/processes/hadronic/cross_sections/src/G4UPiNuclearCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4UPiNuclearCrossSection.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4UPiNuclearCrossSection.cc	(revision 1340)
@@ -60,6 +60,7 @@
 }
 
-G4double G4UPiNuclearCrossSection::GetElasticCrossSection(
-	 const G4DynamicParticle* dp, G4double Z, G4double A)
+G4double
+G4UPiNuclearCrossSection::GetElasticCrossSection(const G4DynamicParticle* dp,
+                                                 G4int Z, G4int A)
 {
   G4double cross = 0.0;
@@ -73,6 +74,7 @@
 }
 
-G4double G4UPiNuclearCrossSection::GetInelasticCrossSection(
-	 const G4DynamicParticle* dp, G4double Z, G4double A)
+G4double
+G4UPiNuclearCrossSection::GetInelasticCrossSection(const G4DynamicParticle* dp,
+                                                   G4int Z, G4int A)
 {
   G4double cross = 0.0;
@@ -82,5 +84,5 @@
   const G4ParticleDefinition* part = dp->GetDefinition();
 
-  // Coulomb barier
+  // Coulomb barrier
   if(part == piPlus) {
     if(ekin > elowest) {
@@ -101,9 +103,9 @@
 
 G4double G4UPiNuclearCrossSection::Interpolate(
-	 G4double Z, G4double A, G4double ekin, G4PhysicsTable* table)
+	 G4int Z, G4int A, G4double ekin, G4PhysicsTable* table)
 {
   G4double res = 0.0;
   G4int idx;
-  G4int iz = G4int(Z + 0.5);
+  G4int iz = Z;
   if(iz > 92) iz = 92;
   for(idx=0; idx<NZ; idx++) {if(theZ[idx] >= iz) break;}
@@ -123,6 +125,6 @@
     G4int iz1 = theZ[idx-1];
     G4double x1 = (((*table)[idx-1])->Value(ekin))*APower[iz]/APower[iz1];
-    G4double w1 = A - theA[idx-1];
-    G4double w2 = theA[idx] - A;
+    G4double w1 = G4double(A) - theA[idx-1];
+    G4double w2 = theA[idx] - G4double(A);
     res = (w1*x2 + w2*x1)/(w1 + w2); 
   }
Index: trunk/source/processes/hadronic/cross_sections/src/G4VCrossSectionDataSet.cc
===================================================================
--- trunk/source/processes/hadronic/cross_sections/src/G4VCrossSectionDataSet.cc	(revision 1337)
+++ trunk/source/processes/hadronic/cross_sections/src/G4VCrossSectionDataSet.cc	(revision 1340)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4VCrossSectionDataSet.cc,v 1.8 2009/01/24 11:54:47 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-01 $
+// $Id: G4VCrossSectionDataSet.cc,v 1.9 2010/07/05 13:39:11 vnivanch Exp $
+// GEANT4 tag $Name: hadr-cross-V09-03-12 $
 //
 // -------------------------------------------------------------------
@@ -42,7 +42,8 @@
 #include "G4VCrossSectionDataSet.hh"
 #include "G4CrossSectionDataSetRegistry.hh"
+#include "G4Pow.hh"
 
-G4VCrossSectionDataSet::G4VCrossSectionDataSet() :
-  verboseLevel(0)
+G4VCrossSectionDataSet::G4VCrossSectionDataSet(const G4String& nam) :
+  verboseLevel(0),minKinEnergy(0.0),maxKinEnergy(DBL_MAX),name(nam) 
 {
   G4CrossSectionDataSetRegistry::Instance()->Register(this);
@@ -54,6 +55,5 @@
 }
 
-// Override this method to test for particle and isotope applicability
-
+// Override thess methods to test for particle and isotope applicability
 G4bool 
 G4VCrossSectionDataSet::IsZAApplicable(const G4DynamicParticle*,
@@ -63,4 +63,10 @@
 }
 
+G4bool 
+G4VCrossSectionDataSet::IsIsoApplicable(const G4DynamicParticle*,
+					G4int /*Z*/, G4int /*A*/)
+{
+  return true;
+}
 
 G4double 
@@ -81,4 +87,12 @@
                                              G4double /*aTemperature*/)
 {
-  return 62*std::pow(AA, 2./3.)*millibarn;
+  return 62*G4Pow::GetInstance()->A23(AA)*millibarn;
 }
+
+G4double 
+G4VCrossSectionDataSet::GetZandACrossSection(const G4DynamicParticle*,
+                                             G4int /*Z*/, G4int N,
+                                             G4double /*aTemperature*/)
+{
+  return 62*G4Pow::GetInstance()->Z23(N)*millibarn;
+}
