Index: trunk/source/processes/hadronic/models/abrasion/History
===================================================================
--- trunk/source/processes/hadronic/models/abrasion/History	(revision 1316)
+++ trunk/source/processes/hadronic/models/abrasion/History	(revision 1316)
@@ -0,0 +1,18 @@
+
+       ==========================================================
+       Geant4 - an Object-Oriented Toolkit for Physics Simulation
+       ==========================================================
+
+        History file for hadronic/models/abrasion directory
+        --------------------------------------------------------
+
+This file should be used to summarize modifications introduced in the 
+code and to keep track of all tags.
+
+     ---------------------------------------------------------------
+     * Please list in reverse chronological order (last date on top)
+     ---------------------------------------------------------------
+
+09-Dec-2009, Pete Truscott,                 (had-abrasion-V09-02-00)
+- abrasion problems with sqrt(-ve) should be fixed and the code is
+  more robust to potential while-loop problems.
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeFunctions.icc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeFunctions.icc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeFunctions.icc	(revision 1316)
@@ -0,0 +1,96 @@
+#ifndef G4_CASCADE_FUNCTIONS_ICC
+#define G4_CASCADE_FUNCTIONS_ICC
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeFunctions.icc,v 1.2 2010/05/14 21:05:03 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100512  M. Kelsey -- Pass std::vector<> buffer as argument to
+//		getOutgoingPartTypes().
+
+
+// Make sure singleton is instantiated
+template <class DATA, class SAMP>
+const G4CascadeFunctions<DATA,SAMP> G4CascadeFunctions<DATA,SAMP>::instance;
+
+
+// Compare summed partial cross section with total cross section
+// Truncate multiplicity at maximum if summed < total
+
+template <class DATA, class SAMP> inline 
+G4int G4CascadeFunctions<DATA,SAMP>::getMultiplicity(G4double ke) {
+  // Use pointer comparison to see whether tot is just a ref to sum)
+  if (&DATA::data.sum != &DATA::data.tot) {
+    G4double summed = instance.findCrossSection(ke, DATA::data.sum); 
+    G4double total  = instance.findCrossSection(ke, DATA::data.tot);
+    if (G4UniformRand() > summed/total) return DATA::data.maxMultiplicity();
+  }
+
+  return instance.findMultiplicity(ke, DATA::data.multiplicities);
+}
+
+
+template <class DATA, class SAMP> inline 
+void G4CascadeFunctions<DATA,SAMP>::
+getOutgoingParticleTypes(std::vector<G4int>& kinds, G4int mult, G4double ke) {
+  const G4int maxMult = DATA::data.maxMultiplicity();
+
+  kinds.clear();
+  kinds.reserve(mult);
+
+  if (mult > maxMult+2) {
+    G4cerr << " Illegal multiplicity " << G4endl;
+    return;
+  }
+
+  G4int channel = instance.findFinalStateIndex(mult, ke, DATA::data.index,
+					       DATA::data.crossSections);
+#ifdef G4CASCADE_DEBUG_SAMPLER
+  G4cout << " getOutgoingParticleTypes: mult=" << mult << " KE=" << ke
+	 << ": channel=" << channel << G4endl;
+#endif
+
+  // Identify final-state array to be copies
+  const G4int* chan = 0;
+  if (mult == 2) chan = DATA::data.x2bfs[channel];
+  if (mult == 3) chan = DATA::data.x3bfs[channel];
+  if (mult == 4) chan = DATA::data.x4bfs[channel];
+  if (mult == 5) chan = DATA::data.x5bfs[channel];
+  if (mult == 6) chan = DATA::data.x6bfs[channel];
+  if (mult == 7) chan = DATA::data.x7bfs[channel];
+  if (mult == 8) chan = DATA::data.x8bfs[channel];
+  if (mult == 9) chan = DATA::data.x9bfs[channel];
+
+  if (!chan) {
+    G4cerr << " getOutgoingParticleTypes: invalid multiplicity " << mult
+	   << G4endl;
+    return;
+  }
+
+  kinds.insert(kinds.begin(), chan, chan+mult);	// Transfer data into vector
+  return;
+}
+
+#endif	/* G4_CASCADE_FUNCTIONS_ICC */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.hh	(revision 1316)
@@ -0,0 +1,75 @@
+#ifndef G4CASCADE_INTERPOLATOR_HH
+#define G4CASCADE_INTERPOLATOR_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeInterpolator.hh,v 1.1 2010/05/14 18:01:28 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// Author:  Michael Kelsey <kelsey@slac.stanford.edu>
+//
+// Simple linear interpolation class, more lightweight than
+// G4PhysicsVector.  Templated on number of X-axis (usually energy)
+// bins, constructor takes a C-array of bin edges as input, and an
+// optional flag whether to extrapolate (the default) or truncate values
+// beyond the bin boundaries.  
+//
+// The interpolation action returns a simple double: the integer part
+// is the bin index, and the fractional part is, obviously, the
+// fractional part.
+
+#include "globals.hh"
+#include <cfloat>
+
+
+template <int NBINS>
+class G4CascadeInterpolator {
+public:
+  enum { nBins=NBINS, last=NBINS-1 };
+
+  G4CascadeInterpolator(const G4double (&xb)[nBins], G4bool extrapolate=true)
+    : xBins(xb), doExtrapolation(extrapolate),
+      lastX(-DBL_MAX), lastVal(-DBL_MAX) {}
+
+  virtual ~G4CascadeInterpolator() {}
+
+  // Find bin position (index and fraction) from input argument
+  G4double getBin(const G4double x) const;
+
+  // Apply bin position from first input to second (array)
+  G4double interpolate(const G4double x, const G4double (&yb)[nBins]) const;
+  G4double interpolate(const G4double (&yb)[nBins]) const;
+
+private:
+  const G4double (&xBins)[nBins];
+  G4bool doExtrapolation;
+
+  mutable G4double lastX;		// Buffers to remember previous call
+  mutable G4double lastVal;
+};
+
+// NOTE:  G4 requires template function definitions in .hh file
+#include "G4CascadeInterpolator.icc"
+
+#endif	/* G4CASCADE_INTERPOLATOR_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.icc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.icc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeInterpolator.icc	(revision 1316)
@@ -0,0 +1,102 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeInterpolator.icc,v 1.5 2010/06/08 06:29:34 stesting Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// Author:  Michael Kelsey <kelsey@slac.stanford.edu>
+//
+// Simple linear interpolation class, more lightweight than
+// G4PhysicsVector.  Templated on number of X-axis (usually energy)
+// bins, constructor takes a C-array of bin edges as input, and an
+// optional flag whether to truncate or extrapolate (the default) values
+// beyond the bin boundaries.
+//
+// The interpolation action returns a simple double: the integer part
+// is the bin index, and the fractional part is, obviously, the
+// fractional part.
+//
+// 20100517  M. Kelsey -- Bug fix in interpolate:  If bin position is _exactly_
+//		at upper edge (== last + 0.0), just return bin value.
+// 20100520  M. Kelsey -- Second bug fix:  Loop in bin search should start at
+//		i=1, not i=0 (since i-1 is the key).
+
+#include "G4CascadeInterpolator.hh"
+
+
+// Find bin position (index and fraction) using input argument and array
+
+template <int NBINS>
+G4double G4CascadeInterpolator<NBINS>::getBin(const G4double x) const {
+  if (x == lastX) return lastVal;	// Avoid unnecessary work
+
+  G4double xindex, xdiff, xbin;
+
+  lastX = x;
+  if (x < xBins[0]) {			// Handle boundaries first
+    xindex = 0.;
+    xbin = xBins[1]-xBins[0];
+    xdiff = doExtrapolation ? x-xBins[0] : 0.;		// Less than zero
+  } else if (x >= xBins[last]) {
+    xindex = last;
+    xbin = xBins[last]-xBins[last-1];
+    xdiff = doExtrapolation ? x-xBins[last] : 0.;
+  } else {				// Assume nBins small; linear search
+    int i;
+    for (i=1; i<nBins && x>xBins[i]; i++) {;}	// Stops when x within bin i-1
+    xindex = i-1;
+    xbin = xBins[i] - xBins[i-1];
+    xdiff = x - xBins[i-1];
+  }
+
+#ifdef G4CASCADE_DEBUG_SAMPLER
+  G4cout << " G4CascadeInterpolator<" << NBINS << ">: x=" << x
+	 << " index=" << xindex << " fraction=" << xdiff/xbin << G4endl;
+#endif
+
+  return (lastVal = xindex + xdiff/xbin);	// Save return value for later
+}
+
+
+// Apply interpolation of input argument to user array
+
+template <int NBINS>
+G4double G4CascadeInterpolator<NBINS>::
+interpolate(const G4double x, const G4double (&yb)[nBins]) const {
+  getBin(x);
+  return interpolate(yb);
+}
+
+// Apply last found interpolation to user array
+
+template <int NBINS>
+G4double G4CascadeInterpolator<NBINS>::
+interpolate(const G4double (&yb)[nBins]) const {
+  // Treat boundary extrapolations specially, otherwise just truncate
+  G4int i = (lastVal<0) ? 0 : (lastVal>last) ? last-1 : G4int(lastVal);
+  G4double frac = lastVal - G4double(i);	// May be <0 or >1 if extrapolating
+
+  // Special case:  if exactly on upper bin edge, just return value
+  return (i==last) ? yb[last] : (yb[i] + frac*(yb[i+1]-yb[i]));
+}
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeNNChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeNNChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeNNChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_NN_CHANNEL_HH
+#define G4_CASCADE_NN_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeNNChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadeNNChannelData {
+  typedef G4CascadeData<30,1,6,18,32,7,8,10,11> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadeNNChannelData,G4PionNucSampler> G4CascadeNNChannel;
+
+#endif	/* G4_CASCADE_NN_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeNPChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeNPChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeNPChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_NP_CHANNEL_HH
+#define G4_CASCADE_NP_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeNPChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadeNPChannelData {
+  typedef G4CascadeData<30,1,9,22,38,7,9,10,12> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadeNPChannelData,G4PionNucSampler> G4CascadeNPChannel;
+
+#endif	/* G4_CASCADE_NP_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePPChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePPChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePPChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PP_CHANNEL_HH
+#define G4_CASCADE_PP_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePPChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePPChannelData {
+  typedef G4CascadeData<30,1,6,18,32,7,8,10,11> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePPChannelData,G4PionNucSampler> G4CascadePPChannel;
+
+#endif	/* G4_CASCADE_PP_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiMinusNChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiMinusNChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiMinusNChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PIMINUSN_CHANNEL_HH
+#define G4_CASCADE_PIMINUSN_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePiMinusNChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePiMinusNChannelData {
+  typedef G4CascadeData<30,2,7,15,24,5,6,7,8> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePiMinusNChannelData,G4PionNucSampler> G4CascadePiMinusNChannel;
+
+#endif	/* G4_CASCADE_PIMINUSN_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiMinusPChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiMinusPChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiMinusPChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PIMINUSP_CHANNEL_HH
+#define G4_CASCADE_PIMINUSP_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePiMinusPChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePiMinusPChannelData {
+  typedef G4CascadeData<30,5,13,22,31,6,7,8,9> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePiMinusPChannelData,G4PionNucSampler> G4CascadePiMinusPChannel;
+
+#endif	/* G4_CASCADE_PIMINUSP_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiPlusNChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiPlusNChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiPlusNChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PIPLUSN_CHANNEL_HH
+#define G4_CASCADE_PIPLUSN_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePiPlusNChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePiPlusNChannelData {
+  typedef G4CascadeData<30,5,13,22,31,6,7,8,9> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePiPlusNChannelData,G4PionNucSampler> G4CascadePiPlusNChannel;
+
+#endif	/* G4_CASCADE_PIPLUSN_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiPlusPChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiPlusPChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiPlusPChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PIPLUSP_CHANNEL_HH
+#define G4_CASCADE_PIPLUSP_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePiPlusPChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePiPlusPChannelData {
+  typedef G4CascadeData<30,2,7,15,24,5,6,7,8> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePiPlusPChannelData,G4PionNucSampler> G4CascadePiPlusPChannel;
+
+#endif	/* G4_CASCADE_PIPLUSP_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiZeroNChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiZeroNChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiZeroNChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PIZERON_CHANNEL_HH
+#define G4_CASCADE_PIZERON_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePiZeroNChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePiZeroNChannelData {
+  typedef G4CascadeData<30,5,13,21,30,6,7,8,9> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePiZeroNChannelData,G4PionNucSampler> G4CascadePiZeroNChannel;
+
+#endif	/* G4_CASCADE_PIZERON_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiZeroPChannel.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiZeroPChannel.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadePiZeroPChannel.hh	(revision 1316)
@@ -0,0 +1,41 @@
+#ifndef G4_CASCADE_PIZEROP_CHANNEL_HH
+#define G4_CASCADE_PIZEROP_CHANNEL_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadePiZeroPChannel.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeData.hh"
+#include "G4CascadeFunctions.hh"
+#include "G4PionNucSampler.hh"
+
+struct G4CascadePiZeroPChannelData {
+  typedef G4CascadeData<30,5,13,21,30,6,7,8,9> data_t;
+  static data_t data;
+};
+
+typedef G4CascadeFunctions<G4CascadePiZeroPChannelData,G4PionNucSampler> G4CascadePiZeroPChannel;
+
+#endif	/* G4_CASCADE_PIZEROP_CHANNEL_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSampler.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSampler.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSampler.hh	(revision 1316)
@@ -0,0 +1,73 @@
+#ifndef G4_CASCADE_SAMPLER_HH
+#define G4_CASCADE_SAMPLER_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeSampler.hh,v 1.2 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100506  M. Kelsey -- Move functionality of G4CascadeChannel here,
+//		use as base class to G4CascadeFunctions<T>.
+// 20100512  M. Kelsey -- Make this templated on energy and multiplicity
+//		binning, as base to new sampler.
+
+#include <vector>
+#include "globals.hh"
+#include "G4CascadeInterpolator.hh"
+
+template <int NBINS, int NMULT>
+class G4CascadeSampler {
+public:
+  enum { energyBins=NBINS, multBins=NMULT };	// For use in function arguments
+
+  G4CascadeSampler(const G4double (&ebins)[energyBins]) 
+    : interpolator(ebins), energyScale(ebins) {}
+
+  virtual ~G4CascadeSampler() {}
+
+  virtual G4double 
+  findCrossSection(double ke, const G4double (&xsec)[energyBins]) const;
+
+  virtual G4int 
+  findMultiplicity(G4double ke, const G4double xmult[][energyBins]) const;
+
+  virtual G4int 
+  findFinalStateIndex(G4int mult, G4double ke, const G4int index[],
+		      const G4double xsec[][energyBins]) const;
+
+private:
+  // Optional start/stop arguments default to inclusive arrays
+  void fillSigmaBuffer(G4double ke, const G4double x[][energyBins],
+		       G4int startBin=0, G4int stopBin=multBins) const;
+
+  G4int sampleFlat() const;
+
+  G4CascadeInterpolator<NBINS> interpolator;
+  mutable std::vector<G4double> sigmaBuf;
+  const G4double (&energyScale)[energyBins];
+};
+
+#include "G4CascadeSampler.icc"
+
+#endif	/* G4_CASCADE_SAMPLER_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSampler.icc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSampler.icc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeSampler.icc	(revision 1316)
@@ -0,0 +1,108 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeSampler.icc,v 1.2 2010/05/21 18:26:16 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100506 M. Kelsey -- Move functionity of G4CascadeChannel here,
+//		use as base class to G4CascadeFunctions<T>.
+// 20100512 M. Kelsey -- Move implementation to .icc with templating
+
+#include "G4CascadeSampler.hh"
+#include "Randomize.hh"
+#include <vector>
+
+
+template <int NBINS, int NMULT> inline
+G4double G4CascadeSampler<NBINS,NMULT>::
+findCrossSection(double ke,
+		 const G4double (&xsec)[energyBins]) const {
+  return interpolator.interpolate(ke, xsec);
+}
+
+template <int NBINS, int NMULT> inline
+G4int G4CascadeSampler<NBINS,NMULT>::
+findMultiplicity(G4double ke,
+		 const G4double xmult[][energyBins]) const {
+  fillSigmaBuffer(ke, xmult);
+  return sampleFlat() + 2;	// Convert array index to actual mult (2 to 7)
+}
+
+template <int NBINS, int NMULT> inline
+G4int G4CascadeSampler<NBINS,NMULT>::
+findFinalStateIndex(G4int mult, G4double ke, const G4int index[],
+		    const G4double xsec[][energyBins]) const {
+  G4int start = index[mult-2];
+  G4int stop = index[mult-1];
+  if (stop-start <= 1) return start;	// Avoid unnecessary work
+
+  fillSigmaBuffer(ke, xsec, start, stop);
+  return sampleFlat();
+}
+
+// Optional start/stop arguments default to multiplicity arrays
+template <int NBINS, int NMULT> inline
+void G4CascadeSampler<NBINS,NMULT>::
+fillSigmaBuffer(G4double ke, const G4double x[][energyBins],
+		G4int startBin, G4int stopBin) const {
+  sigmaBuf.clear();
+  if (stopBin-startBin <= 1) return;	// Avoid unnecessary work
+
+  // NOTE:  push_back() must be used to ensure that size() gets set!
+  sigmaBuf.reserve(stopBin-startBin);
+  for(G4int m = startBin; m < stopBin; m++)
+    sigmaBuf.push_back(interpolator.interpolate(ke, x[m]));
+}
+
+
+template <int NBINS, int NMULT> inline
+G4int G4CascadeSampler<NBINS,NMULT>::sampleFlat() const {
+  G4int nbins = sigmaBuf.size();
+  if (nbins <= 1) return 0;		// Avoid unnecessary work
+
+#ifdef G4CASCADE_DEBUG_SAMPLER
+  G4cout << "G4CascadeSampler::sampleFlat() has " << nbins << "bins:" << G4endl;
+  for (G4int sbi=0; sbi<nbins; sbi++) G4cout << " " << sigmaBuf[sbi];
+  G4cout << G4endl;
+#endif
+
+  G4int i;
+  G4double fsum = 0.;
+  for (i = 0; i < nbins; i++) fsum += sigmaBuf[i];
+#ifdef G4CASCADE_DEBUG_SAMPLER
+  G4cout << " buffer total (fsum) " << fsum;
+#endif
+  fsum *= G4UniformRand();
+#ifdef G4CASCADE_DEBUG_SAMPLER
+  G4cout << " *random-scale " << fsum << G4endl;
+#endif
+
+  G4double partialSum = 0.0;
+  for (i = 0; i < nbins; i++) {
+    partialSum += sigmaBuf[i];
+    if (fsum < partialSum) return i;	// Breaks out of loop automatically
+  }
+
+  return 0;	// Is this right?  Shouldn't it return maximum, not minimum?
+}
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4Dineutron.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4Dineutron.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4Dineutron.hh	(revision 1316)
@@ -0,0 +1,57 @@
+#ifndef G4DINEUTRON_HH
+#define G4DINEUTRON_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4Dineutron.hh,v 1.3 2010/04/13 05:30:10 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// ------------------------------------------------------------
+//      Bertini Cascade dineutron class header file
+//
+//      History: first implementation, inspired by G4Proton
+//      17 Nov 2009:  Michael Kelsey
+//	06 Apr 2010:  Reset theInstance in dtor, implement ctor in .cc.
+//	13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
+// ----------------------------------------------------------------
+
+#include "G4VShortLivedParticle.hh"
+
+// ######################################################################
+// ###                        DINEUTRON                                ###
+// ######################################################################
+
+class G4Dineutron : public G4VShortLivedParticle {
+private:
+  static G4Dineutron* theInstance;
+  G4Dineutron();
+  virtual ~G4Dineutron() { theInstance = 0; }
+  
+public:
+  static G4Dineutron* Definition();
+  static G4Dineutron* DineutronDefinition();
+  static G4Dineutron* Dineutron();
+};
+
+#endif	/* G4DINEUTRON_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4Diproton.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4Diproton.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4Diproton.hh	(revision 1316)
@@ -0,0 +1,57 @@
+#ifndef G4DIPROTON_HH
+#define G4DIPROTON_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4Diproton.hh,v 1.3 2010/04/13 05:30:10 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// ------------------------------------------------------------
+//      Bertini Cascade diproton class header file
+//
+//      History: first implementation, inspired by G4Proton
+//      17 Nov 2009:  Michael Kelsey
+//	06 Apr 2010:  Reset theInstance in dtor, implement ctor in .cc.
+//	13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
+// ----------------------------------------------------------------
+
+#include "G4VShortLivedParticle.hh"
+
+// ######################################################################
+// ###                        DIPROTON                                ###
+// ######################################################################
+
+class G4Diproton : public G4VShortLivedParticle {
+private:
+  static G4Diproton* theInstance;
+  G4Diproton();
+  ~G4Diproton() { theInstance = 0; }
+  
+public:
+  static G4Diproton* Definition();
+  static G4Diproton* DiprotonDefinition();
+  static G4Diproton* Diproton();
+};
+
+#endif	/* G4DIPROTON_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclParticleNames.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclParticleNames.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4InuclParticleNames.hh	(revision 1316)
@@ -0,0 +1,51 @@
+#ifndef G4INUCL_PARTICLE_NAMES_HH
+#define G4INUCL_PARTICLE_NAMES_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4InuclParticleNames.hh,v 1.2 2010/04/29 19:39:55 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// Defines enums to map G4InuclElementaryParticle type codes to human
+// readable names.  Meant to replace similar local enums scattered through
+// the code.
+
+namespace G4InuclParticleNames {
+  enum Long { nuclei=0, proton=1, neutron=2,
+	      pionPlus=3, pionMinus=5, pionZero=7, photon=10,
+	      kaonPlus=11, kaonMinus=13, kaonZero=15, kaonZeroBar=17, 
+	      lambda=21, sigmaPlus=23, sigmaZero=25, sigmaMinus=27, 
+	      xiZero=29, xiMinus=31, omegaMinus=33, antiProton=35, 
+	      antiNeutron=37, diproton=111, unboundPN=112, dineutron=122 };
+
+  // NOTE:  "km" cannot be used as conflicts with "kilometers" unit!
+  enum Short { nuc=nuclei, pro=proton, neu=neutron,
+	       pip=pionPlus, pim=pionMinus, pi0=pionZero, gam=photon,
+	       kpl=kaonPlus, kmi=kaonMinus, k0=kaonZero, k0b=kaonZeroBar,
+	       lam=lambda, sp=sigmaPlus, s0=sigmaZero, sm=sigmaMinus,
+	       xi0=xiZero, xim=xiMinus, om=omegaMinus, ap=antiProton,
+	       an=antiNeutron, pp=diproton, pn=unboundPN, nn=dineutron };
+}
+
+#endif	/* G4INUCL_PARTICLE_NAMES_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4KaonHypSampler.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4KaonHypSampler.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4KaonHypSampler.hh	(revision 1316)
@@ -0,0 +1,38 @@
+#ifndef G4_KAON_HYP_SAMPLER_HH
+#define G4_KAON_HYP_SAMPLER_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4KaonHypSampler.hh,v 1.1 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100512  M. Kelsey -- Replaces (old, untemplated) G4CascadeSampler
+
+
+#include "G4CascadeSampler.hh"
+
+// Entire interface is inherited from base (struct makes default public:)
+struct G4KaonHypSampler : public G4CascadeSampler<31,6> { G4KaonHypSampler(); };
+
+#endif	/* G4_KAON_HYP_SAMPLER_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4PionNucSampler.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4PionNucSampler.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4PionNucSampler.hh	(revision 1316)
@@ -0,0 +1,37 @@
+#ifndef G4_PION_NUC_SAMPLER_HH
+#define G4_PION_NUC_SAMPLER_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4PionNucSampler.hh,v 1.1 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100512  M. Kelsey -- Replaces G4FinalStateSampler
+
+#include "G4CascadeSampler.hh"
+
+// Entire interface is inherited from base (struct makes default public:)
+struct G4PionNucSampler : public G4CascadeSampler<30,8> { G4PionNucSampler(); };
+
+#endif	/* G4_PION NUC_SAMPLER_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4UnboundPN.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4UnboundPN.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4UnboundPN.hh	(revision 1316)
@@ -0,0 +1,57 @@
+#ifndef G4UNBOUNDPN_HH
+#define G4UNBOUNDPN_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4UnboundPN.hh,v 1.3 2010/04/13 05:30:10 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// ------------------------------------------------------------
+//      Bertini Cascade unboundPN class header file
+//
+//      History: first implementation, inspired by G4Proton
+//      17 Nov 2009:  Michael Kelsey
+//	06 Apr 2010:  Reset theInstance in dtor, implement ctor in .cc.
+//	13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
+// ----------------------------------------------------------------
+
+#include "G4VShortLivedParticle.hh"
+
+// ######################################################################
+// ###                        UNBOUNDPN                                ###
+// ######################################################################
+
+class G4UnboundPN : public G4VShortLivedParticle {
+private:
+  static G4UnboundPN* theInstance;
+  G4UnboundPN();
+  ~G4UnboundPN() { theInstance = 0; }
+  
+public:
+  static G4UnboundPN* Definition();
+  static G4UnboundPN* UnboundPNDefinition();
+  static G4UnboundPN* UnboundPN();
+};
+
+#endif	/* G4UNBOUNDPN_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/include/G4VCascadeCollider.hh
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/include/G4VCascadeCollider.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/include/G4VCascadeCollider.hh	(revision 1316)
@@ -0,0 +1,66 @@
+#ifndef G4V_CASCADE_COLLIDER_HH
+#define G4V_CASCADE_COLLIDER_HH
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4VCascadeCollider.hh,v 1.1 2010/05/21 17:56:34 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "globals.hh"
+#include "G4InteractionCase.hh"
+
+class G4InuclNuclei;
+class G4InuclParticle;
+class G4CollisionOutput;
+
+class G4VCascadeCollider {
+public:
+  G4VCascadeCollider(const char* name="G4VCascadeCollider", G4int verbose=0);
+
+  virtual ~G4VCascadeCollider() {}
+
+  virtual void collide(G4InuclParticle* bullet, G4InuclParticle* target,
+		       G4CollisionOutput& output) = 0;
+
+  virtual void setVerboseLevel(G4int verbose=0) { verboseLevel=verbose; }
+
+protected:
+  const char* theName;
+  G4int verboseLevel;
+  G4InteractionCase interCase;		// Determine bullet vs. target
+
+  // Decide whether to use G4ElementaryParticleCollider or not
+  virtual G4bool useEPCollider(G4InuclParticle* bullet, 
+			       G4InuclParticle* target) const;
+
+  // Decide whether to use G4BigBanger or not
+  virtual G4bool explosion(G4InuclNuclei* target) const;
+
+  // Decide whether to use G4IntraNuclearCascader or not
+  virtual G4bool inelasticInteractionPossible(G4InuclParticle* bullet,
+					      G4InuclParticle* target, 
+					      G4double ekin) const;
+};        
+
+#endif	/* G4V_CASCADE_COLLIDER_HH */
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT0npChannel.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT0npChannel.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT0npChannel.cc	(revision 1316)
@@ -0,0 +1,666 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeT0npChannel.cc,v 1.1 2010/05/14 21:05:03 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadeNPChannel.hh"
+#include "G4InuclParticleNames.hh"
+using namespace G4InuclParticleNames;
+
+namespace {
+  // n p and p n : Outgoing particle types of a given multiplicity
+  static const G4int np2bfs[1][2] =
+  {{pro,neu}};
+
+  static const G4int np3bfs[9][3] =
+  {{pro,pro,pim},{pro,neu,pi0},{neu,neu,pip},{pro,lam,k0},
+   {pro,s0,k0},  {pro,sm,kpl},  {neu,lam,kpl}, {neu,s0,kpl},
+   {neu,sp,k0}};
+
+  static const G4int np4bfs[22][4] =
+  {{pro,neu,pip,pim},{pro,pro,pim,pi0},{pro,neu,pi0,pi0},
+   {neu,neu,pip,pi0},{pro,lam,kpl,pim}, {pro,s0,kpl,pim},
+   {pro,lam,k0,pi0}, {pro,s0,k0,pi0},  {pro,sp,k0,pim},
+   {pro,sm,kpl,pi0},  {pro,sm,k0,pip},  {neu,lam,kpl,pi0},
+   {neu,lam,k0,pip}, {neu,sp,kpl,pim},  {neu,sp,k0,pi0},
+   {neu,s0,kpl,pi0},  {neu,s0,k0,pip},  {neu,sm,kpl,pip},
+   {pro,neu,kpl,kmi},  {pro,neu,k0,k0b}, {pro,pro,k0,kmi},
+   {neu,neu,kpl,k0b}};
+
+  static const G4int np5bfs[38][5] =
+  {{pro,neu,pip,pim,pi0},{pro,neu,pi0,pi0,pi0},{pro,pro,pip,pim,pim},
+   {pro,pro,pim,pi0,pi0},{neu,neu,pip,pip,pim},{neu,neu,pip,pi0,pi0},
+   {pro,lam,kpl,pim,pi0}, {pro,lam,k0,pip,pim}, {pro,lam,k0,pi0,pi0},
+   {pro,s0,k0,pip,pim},  {pro,s0,k0,pi0,pi0},  {pro,s0,kpl,pim,pi0},
+   {pro,sp,kpl,pim,pim},  {pro,sp,k0,pim,pi0},  {pro,sm,k0,pip,pi0},
+   {pro,sm,kpl,pip,pim},  {pro,sm,kpl,pi0,pi0},  {neu,lam,kpl,pip,pim},
+   {neu,lam,kpl,pi0,pi0}, {neu,lam,k0,pip,pi0}, {neu,s0,kpl,pip,pim},
+   {neu,s0,kpl,pi0,pi0},  {neu,s0,k0,pip,pi0},  {neu,sp,k0,pip,pim},
+   {neu,sp,k0,pi0,pi0},  {neu,sp,kpl,pim,pi0},  {neu,sm,kpl,pip,pi0},
+   {neu,sm,k0,pip,pip},  {pro,neu,kpl,kmi,pi0},  {pro,neu,k0,k0b,pi0},
+   {pro,neu,k0,kmi,pip},  {pro,neu,kpl,k0b,pim}, {pro,pro,k0,k0b,pim},
+   {pro,pro,kpl,kmi,pim},  {pro,pro,k0,kmi,pi0},  {neu,neu,kpl,kmi,pip},
+   {neu,neu,k0,k0b,pip}, {neu,neu,kpl,k0b,pi0}};
+
+  static const G4int np6bfs[7][6] =
+  {{pro,neu,pip,pip,pim,pim},{pro,neu,pip,pim,pi0,pi0},
+   {pro,neu,pi0,pi0,pi0,pi0},{pro,pro,pip,pim,pim,pi0},
+   {pro,pro,pim,pi0,pi0,pi0},{neu,neu,pip,pip,pim,pi0},
+   {neu,neu,pip,pi0,pi0,pi0}};
+
+  static const G4int np7bfs[9][7] =
+  {{pro,neu,pip,pip,pim,pim,pi0},{pro,neu,pip,pim,pi0,pi0,pi0},
+   {pro,neu,pi0,pi0,pi0,pi0,pi0},{pro,pro,pip,pip,pim,pim,pim},
+   {pro,pro,pip,pim,pim,pi0,pi0},{pro,pro,pim,pi0,pi0,pi0,pi0},
+   {neu,neu,pip,pip,pip,pim,pim},{neu,neu,pip,pip,pim,pi0,pi0},
+   {neu,neu,pip,pi0,pi0,pi0,pi0}};
+
+  static const G4int np8bfs[10][8] =
+  {{pro,neu,pip,pip,pip,pim,pim,pim},{pro,neu,pip,pip,pim,pim,pi0,pi0},
+   {pro,neu,pip,pim,pi0,pi0,pi0,pi0},{pro,neu,pi0,pi0,pi0,pi0,pi0,pi0},
+   {pro,pro,pip,pip,pim,pim,pim,pi0},{pro,pro,pip,pim,pim,pi0,pi0,pi0},
+   {pro,pro,pim,pi0,pi0,pi0,pi0,pi0},{neu,neu,pip,pip,pip,pim,pim,pi0},
+   {neu,neu,pip,pip,pim,pi0,pi0,pi0},{neu,neu,pip,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int np9bfs[12][9] =
+  {{pro,neu,pip,pip,pip,pim,pim,pim,pi0},{pro,neu,pip,pip,pim,pim,pi0,pi0,pi0},
+   {pro,neu,pip,pim,pi0,pi0,pi0,pi0,pi0},{pro,neu,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+   {pro,pro,pip,pip,pip,pim,pim,pim,pim},{pro,pro,pip,pip,pim,pim,pim,pi0,pi0},
+   {pro,pro,pip,pim,pim,pi0,pi0,pi0,pi0},{pro,pro,pim,pi0,pi0,pi0,pi0,pi0,pi0},
+   {neu,neu,pip,pip,pip,pip,pim,pim,pim},{neu,neu,pip,pip,pip,pim,pim,pi0,pi0},
+   {neu,neu,pip,pip,pim,pi0,pi0,pi0,pi0},{neu,neu,pip,pi0,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // Total n p cross section as a function of kinetic energy
+  static const G4double npTotXSec[30] = 
+   {20357.0, 912.6, 788.6, 582.1, 415.0, 272.0, 198.8, 145.0, 100.4,  71.1,
+       58.8,  45.7,  38.9,  34.4,  34.0,  35.0,  37.5,  39.02, 40.29, 40.72,
+       42.36, 41.19, 42.04, 41.67, 40.96, 39.48, 39.79, 39.39, 39.36, 39.34};
+
+  static const G4double npCrossSections[108][30] = {
+  //
+  // multiplicity 2 (1 channel)
+  //
+  //  p n (p n)
+   {20357.0, 912.6, 788.6, 582.1, 415.0, 272.0, 198.8, 145.0, 100.4, 71.1,
+       58.8,  45.7,  38.9,  34.4,  31.0,  27.0,  23.0,  19.0,  17.0, 15.5,
+       14.0,  13.0,  12.0,  11.0,  10.0,   9.5,   9.0,   8.5,   8.0,  7.7 },
+  //
+  // multiplicity 3 (9 channels)
+  //
+  //  p p pi- (n n pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.25, 0.9,  1.75, 2.3,  2.8,  2.8,
+     2.2,  1.9,  1.6,  1.35, 1.1,  0.95, 0.8,  0.7,  0.6,  0.53 },
+
+  //  p n pi0 (p n pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  1.8,  4.7,  8.3, 11.3, 12.0, 10.2,
+     8.2,  6.0,  4.9,  3.6,  2.5,  2.0,  1.6,  1.2,  1.0,  0.08 },
+
+  //  n n pi+ (p p pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.95, 2.4,  4.2,  5.6,  6.1,  5.1,
+     4.1,  3.0,  2.5,  1.8,  1.2,  1.0,  0.8,  0.6,  0.5,  0.41},
+
+  //  p L K0 (n L K+)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  p S0 K0 (n S0 K+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.01, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+  //  p S- K+ (n S+ K0)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  n L K+ (p L K0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  n S0 K+ (p S0 K0)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+  //  n S+ K0 (p S- K+)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01},
+  //
+  // multiplicity 4 (22 channels)
+  //
+  //  p n pi+ pi- (p n pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.12, 0.38, 1.1,  3.5,
+     5.9,  5.9,  5.1,  4.2,  3.7,  3.0,  2.6,  2.1,  1.8,  1.4 },
+
+  //  p p pi- pi0 (n n pi+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.03, 0.1,  0.24, 0.55,
+     1.2,  1.5,  1.45, 1.25, 1.0,  0.9,  0.8,  0.7,  0.6,  0.53 },
+
+  //  p n pi0 pi0 (p n pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.07, 0.24, 0.66, 2.1,
+     3.6,  3.6,  3.1,  2.5,  2.2,  1.8,  1.5,  1.2,  1.1,  0.84 },
+
+  //  n n pi+ pi0 (p p pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.03, 0.1,  0.24, 0.55,
+     1.2,  1.5,  1.45, 1.25, 1.0,  0.9,  0.8,  0.7,  0.6,  0.53 },
+
+  //  p L K+ pi- (n L K0 pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02 },
+
+  //  p S0 K+ pi- (n S0 K0 pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.02 },
+
+  //  p L K0 pi0 (n L K+ pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p S0 K0 pi0 (n S0 K+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.01, 0.01, 0.01, 0.0,  0.0 },
+
+  //  p S+ K0 pi- (n S- K+ pi+)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p S- K+ pi0 (n S+ K0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.03, 0.04, 0.04, 0.04, 0.03, 0.02, 0.02 },
+
+  //  p S- K0 pi+ (n S+ K+ pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.03, 0.04, 0.04, 0.04, 0.03, 0.02, 0.02 },
+
+  //  n L K+ pi0 (p L K0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02 },
+
+  //  n L K0 pi+ (p L K+ pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n S+ K+ pi- (p S- K0 pi+)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.02 },
+
+  //  n S+ K0 pi0 (p S- K+ pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.0,  0.0 },
+
+  //  n S0 K+ pi0 (p S0 K0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.03, 0.04, 0.04, 0.04, 0.03, 0.02, 0.02 },
+
+  //  n S0 K0 pi+ (p S0 K+ pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.03, 0.04, 0.04, 0.04, 0.03, 0.02, 0.02 },
+
+  //  n S- K+ pi+ (p S+ K0 pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p n K+ K- (p n K0 K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p n K0 K0bar (p n K+ K-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p p K0 K- (n n K+ K0bar)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n n K+ K0bar (p p K0 K-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+  //
+  // multiplicity 5 (38 channels)
+  //
+  //  p n pi+ pi- pi0 (p n pi+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.04,
+     0.3,  0.82, 1.35, 1.8,  1.8,  1.65, 1.5,  1.28, 1.12, 0.98 },
+
+  //  p n pi0 pi0 pi0 (p n pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02,
+     0.15, 0.41, 0.68, 0.9,  0.9,  0.82, 0.75, 0.64, 0.55, 0.49 },
+
+  //  p p pi+ pi- pi- (n n pi+ pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.09, 0.2,
+     0.52, 1.2,  1.8,  2.0,  1.7,  1.5,  1.35, 1.2,  1.05, 0.9 },
+
+  //  p p pi- pi0 pi0 (n n pi+ pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.04, 0.1,
+     0.26, 0.6,  0.9,  0.98, 0.86, 0.75, 0.68, 0.6,  0.52, 0.45 },
+
+  //  n n pi+ pi+ pi- (p p pi+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.04,
+     0.3,  0.82, 1.35, 1.8,  1.8,  1.65, 1.5,  1.28, 1.12, 0.98 },
+
+  //  n n pi+ pi0 pi0 (p p pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02,
+     0.15, 0.41, 0.68, 0.9,  0.9,  0.82, 0.75, 0.64, 0.56, 0.49 },
+
+  //  p L K+ pi- pi0 (n L K0 pi+ pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01 },
+
+  //  p L K0 pi+ pi- (n L K+ pi+ pi-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01 },
+
+  //  p L K0 pi0 pi0 (n L K+ pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.01, 0.01, 0.01, 0.02, 0.02, 0.02 },
+
+  //  p S0 K0 pi+ pi- (n S0 K+ pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S0 K0 pi0 pi0 (n S0 K+ pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.0 },
+
+  //  p S0 K+ pi- pi0 (n S0 K0 pi+ pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S+ K+ pi- pi- (n S- K0 pi+ pi+)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S+ K0 pi- pi0 (n S- K+ pi+ pi0)
+   { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S- K0 pi+ pi0 (n S+ K+ pi- pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S- K+ pi+ pi- (n S+ K0 pi+ pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S- K+ pi0 pi0 (n S+ K0 pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.0 },
+
+  //  n L K+ pi+ pi- (p L K0 pi+ pi-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01 },
+
+  //  n L K+ pi0 pi0 (p L K0 pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n L K0 pi+ pi0 (p L K+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01 },
+
+  //  n S0 K+ pi+ pi- (p S0 K0 pi+ pi-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n S0 K+ pi0 pi0 (p S0 K0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+     0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+     0.0,  0.0,  0.0,  0.0, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0 },
+
+  //  n S0 K0 pi+ pi0 (p S0 K+ pi- pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n S+ K0 pi+ pi- (p S- K+ pi+ pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S+ K0 pi0 pi0 (p S- K+ pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.0 },
+
+  //  n S+ K+ pi- pi0 (p S- K0 pi+ pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S- K+ pi+ pi0 (p S+ K0 pi- pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S- K0 pi+ pi+ (p S+ K+ pi- pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p n K+ K- pi0 (p n K0 K0bar pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p n K0 K0bar pi0 (p n K+ K- pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p n K0 K- pi+ (p n K+ K0bar pi-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p n K+ K0bar pi- (p n K0 K- pi+)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p p K0 K0bar pi- (n n K+ K- pi+)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p p K+ K- pi- (n n K0 K0bar pi+)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p p K0 K- pi0 (n n K+ K0bar pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n n K+ K- pi+ (p p K0 K0bar pi-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n n K0 K0bar pi+ (p p K+ K- pi-)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+
+  //  n n K+ K0bar pi0 (p p K0 K- pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.01, 0.01, 0.01, 0.01, 0.01, 0.01 },
+  //
+  // multiplicity 6 (7 channels)
+  //
+  //  p n pi+ pi+ pi- pi- (p n pi+ pi+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.06, 0.1,  0.18, 0.38, 0.49, 0.46, 0.43, 0.40, 0.38, 0.36 },
+
+  //  p n pi+ pi- pi0 pi0 (p n pi+ pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+
+  //  p n pi0 pi0 pi0 pi0 (p n pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.01, 0.02, 0.05, 0.1,  0.13, 0.12, 0.11, 0.1,  0.1,  0.09 },
+
+  //  p p pi+ pi- pi- pi0 (n n pi+ pi+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.06, 0.1,  0.18, 0.38, 0.49, 0.46, 0.43, 0.40, 0.38, 0.36 },
+
+  //  p p pi- pi0 pi0 pi0 (n n pi+ pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+
+  //  n n pi+ pi+ pi- pi0 (p p pi+ pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.06, 0.1,  0.18, 0.38, 0.49, 0.46, 0.43, 0.40, 0.38, 0.36 },
+
+  //  n n pi+ pi0 pi0 pi0 (p p pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+  //
+  // multiplicity 7 (9 channels)
+  //
+  //  p n pi+ pi+ pi- pi- pi0 (p n pi+ pi+ pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.06, 0.17, 0.5,  0.7,  0.7,  0.69, 0.66, 0.62 },
+
+  //  p n pi+ pi- pi0 pi0 pi0 (p n pi+ pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.03, 0.08, 0.25, 0.35, 0.35, 0.35, 0.33, 0.31 },
+
+  //  p n pi0 pi0 pi0 pi0 pi0 (p n pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.04, 0.12, 0.17, 0.18, 0.17, 0.16, 0.15 },
+
+  //  p p pi+ pi+ pi- pi- pi- (n n pi+ pi+ pi+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.06, 0.19, 0.31, 0.41, 0.44, 0.47, 0.45, 0.45 },
+
+  //  p p pi+ pi- pi- pi0 pi0 (n n pi+ pi+ pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.03, 0.1,  0.15, 0.2,  0.22, 0.23, 0.22, 0.22 },
+
+  //  p p pi- pi0 pi0 pi0 pi0 (n n pi+ pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.05, 0.07, 0.1,  0.11, 0.12, 0.11, 0.11 },
+
+  //  n n pi+ pi+ pi+ pi- pi- (p p pi+ pi+ pi- pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.06, 0.17, 0.5,  0.7,  0.7,  0.69, 0.66, 0.62 },
+
+  //  n n pi+ pi+ pi- pi0 pi0 (p p pi+ pi- pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.03, 0.08, 0.25, 0.35, 0.35, 0.34, 0.33, 0.31 },
+
+  //  n n pi+ pi0 pi0 pi0 pi0 (p p pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.05, 0.07, 0.1,  0.11, 0.12, 0.11, 0.11 },
+  //
+  // multiplicity 8 (10 channels)
+  //
+  //  p n pi+ pi+ pi+ pi- pi- pi- (p n pi+ pi+ pi+ pi- pi- pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  p n pi+ pi+ pi- pi- pi0 pi0 (p n pi+ pi+ pi- pi- pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  p n pi+ pi- pi0 pi0 pi0 pi0 (p n pi+ pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.04, 0.12, 0.15, 0.18, 0.15, 0.15 },
+
+  //  p n pi0 pi0 pi0 pi0 pi0 pi0 (p n pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.06, 0.09, 0.12, 0.09, 0.09 },
+
+  //  p p pi+ pi+ pi- pi- pi- pi0 (n n pi+ pi+ pi+ pi- pi- pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  p p pi+ pi- pi- pi0 pi0 pi0 (n n pi+ pi+ pi- pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.04, 0.12, 0.15, 0.18, 0.15, 0.15 },
+
+  //  p p pi- pi0 pi0 pi0 pi0 pi0 (n n pi+ pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.03, 0.06, 0.09, 0.12, 0.09, 0.09 },
+
+  //  n n pi+ pi+ pi+ pi- pi- pi0 (p p pi+ pi+ pi- pi- pi- pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  n n pi+ pi+ pi- pi0 pi0 pi0 (p p pi+ pi- pi- pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.04, 0.12, 0.15, 0.18, 0.15, 0.15 },
+
+  //  n n pi+ pi0 pi0 pi0 pi0 pi0 (p p pi- pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.01, 0.03, 0.06, 0.09, 0.12, 0.09, 0.09 },
+  //
+  // multiplicity 9 (12 channels)
+  //
+  //  p n pi+ pi+ pi+ pi- pi- pi- pi0 (p n pi+ pi+ pi+ pi- pi- pi- pi0)
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.03, 0.07, 0.11, 0.14, 0.15, 0.15, 0.15 },
+
+  //  p n pi+ pi+ pi- pi- pi0 pi0 pi0 (p n pi+ pi+ pi- pi- pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.05, 0.07, 0.08, 0.09, 0.09, 0.09 },
+
+  //  p n pi+ pi- pi0 pi0 pi0 pi0 pi0 (p n pi+ pi- pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.01, 0.03, 0.04, 0.05, 0.05, 0.05, 0.05 },
+
+  //  p n pi0 pi0 pi0 pi0 pi0 pi0 pi0 (p n pi0 pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.03, 0.03, 0.03, 0.03, 0.03 },
+
+  //  p p pi+ pi+ pi+ pi- pi- pi- pi- (n n pi+ pi+ pi+ pi+ pi- pi- pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.06, 0.15, 0.19, 0.22, 0.22, 0.22 },
+
+  //  p p pi+ pi+ pi- pi- pi- pi0 pi0 (n n pi+ pi+ pi+ pi- pi- pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.06, 0.15, 0.19, 0.22, 0.22, 0.22 },
+
+  //  p p pi+ pi- pi- pi0 pi0 pi0 pi0 (n n pi+ pi+ pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.01, 0.04, 0.09, 0.12, 0.13, 0.13, 0.13 },
+
+  //  p p pi- pi0 pi0 pi0 pi0 pi0 pi0 (n n pi+ pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.01, 0.02, 0.05, 0.07, 0.08, 0.08, 0.08 },
+
+  //  n n pi+ pi+ pi+ pi+ pi- pi- pi- (p p pi+ pi+ pi+ pi- pi- pi- pi-)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.06, 0.15, 0.19, 0.22, 0.22, 0.22 },
+
+  //  n n pi+ pi+ pi+ pi- pi- pi0 pi0 (p p pi+ pi+ pi- pi- pi- pi0 pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.01, 0.02, 0.06, 0.15, 0.19, 0.22, 0.22, 0.22 },
+
+  //  n n pi+ pi+ pi- pi0 pi0 pi0 pi0 (p p pi+ pi- pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.01, 0.04, 0.09, 0.12, 0.13, 0.13, 0.13 },
+
+  //  n n pi+ pi0 pi0 pi0 pi0 pi0 pi0 (p p pi- pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.01, 0.02, 0.05, 0.07, 0.08, 0.08, 0.08 }};
+}
+
+// Initialize n-p channel
+
+G4CascadeNPChannelData::data_t
+G4CascadeNPChannelData::data(np2bfs, np3bfs, np4bfs, np5bfs, np6bfs, np7bfs,
+			     np8bfs, np9bfs, npCrossSections, npTotXSec);
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT11pizNChannel.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT11pizNChannel.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT11pizNChannel.cc	(revision 1316)
@@ -0,0 +1,692 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeT11pizNChannel.cc,v 1.1 2010/05/14 21:05:03 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadePiZeroPChannel.hh"
+#include "G4CascadePiZeroNChannel.hh"
+#include "G4InuclParticleNames.hh"
+using namespace G4InuclParticleNames;
+
+namespace {
+  // pi0 p : Outgoing particle types of a given multiplicity
+  static const G4int pizP2bfs[5][2] =
+  {{pi0,pro}, {pip,neu}, {kpl,lam}, {kpl,s0}, {k0,sp}};
+
+  static const G4int pizP3bfs[13][3] =
+  {{pip,pro,pim}, {pi0,pro,pi0}, {pi0,neu,pip}, {pi0,lam,kpl}, 
+    {pip,lam,k0},  {pi0,s0,kpl},   {pip,s0,k0},   {pi0,sp,k0},
+    {pim,sp,kpl},   {pip,sm,kpl},   {kmi,pro,kpl},   {k0b,pro,k0},
+    {k0b,neu,kpl}};
+
+  static const G4int pizP4bfs[21][4] =
+  {{pi0,pro,pim,pip}, {pi0,pro,pi0,pi0}, {pip,neu,pip,pim},
+    {pi0,neu,pip,pi0}, {pip,lam,kpl,pim},  {pip,s0,kpl,pim}, 
+    {pi0,lam,kpl,pi0},  {pi0,s0,kpl,pi0},   {pi0,sp,k0,pi0}, 
+    {pi0,lam,k0,pip},  {pi0,s0,k0,pip},   {pip,sp,k0,pim}, 
+    {pi0,sp,kpl,pim},   {pi0,sm,kpl,pip},   {pi0,pro,kpl,kmi}, 
+    {pi0,pro,k0,k0b},  {pip,pro,k0,kmi},   {pim,pro,kpl,k0b}, 
+    {pip,neu,kpl,kmi},   {pip,neu,k0,k0b},  {pi0,neu,kpl,k0b}}; 
+
+  static const G4int pizP5bfs[30][5] =
+  {{pip,pro,pip,pim,pim}, {pi0,pro,pip,pim,pi0}, {pi0,pro,pi0,pi0,pi0},
+    {pi0,neu,pip,pip,pim}, {pi0,neu,pip,pi0,pi0}, {pi0,lam,kpl,pip,pim},
+    {pi0,lam,kpl,pi0,pi0},  {pip,lam,k0,pip,pim},  {pi0,lam,k0,pip,pi0},  
+    {pi0,s0,kpl,pip,pim},   {pi0,s0,kpl,pi0,pi0},   {pip,s0,k0,pip,pim},
+    {pi0,s0,k0,pip,pi0},   {pi0,sp,k0,pip,pim},   {pi0,sp,k0,pi0,pi0},
+    {pim,sp,kpl,pip,pim},   {pi0,sp,kpl,pim,pi0},   {pip,sm,kpl,pip,pim}, 
+    {pi0,sm,kpl,pip,pi0},   {pi0,pro,kpl,kmi,pi0},   {pi0,pro,k0,k0b,pi0}, 
+    {pi0,pro,kpl,k0b,pim},  {pi0,pro,k0,kmi,pip},   {pip,pro,kpl,kmi,pim},
+    {pip,pro,k0,k0b,pim},  {pi0,neu,kpl,kmi,pip},   {pi0,neu,k0,k0b,pip},
+    {pi0,neu,kpl,k0b,pi0},  {pip,neu,k0,kmi,pip},   {pip,neu,kpl,k0b,pim}};
+
+  static const G4int pizP6bfs[6][6] =
+  {{pi0,pro,pip,pip,pim,pim}, {pi0,pro,pip,pim,pi0,pi0},
+    {pi0,pro,pi0,pi0,pi0,pi0}, {pip,neu,pip,pip,pim,pim},
+    {pi0,neu,pip,pip,pim,pi0}, {pi0,neu,pip,pi0,pi0,pi0}};
+ 
+  static const G4int pizP7bfs[7][7] =
+  {{pip,pro,pip,pip,pim,pim,pim}, {pi0,pro,pip,pip,pim,pim,pi0},
+    {pi0,pro,pip,pim,pi0,pi0,pi0}, {pi0,pro,pi0,pi0,pi0,pi0,pi0},
+    {pi0,neu,pip,pip,pip,pim,pim}, {pi0,neu,pip,pip,pim,pi0,pi0},
+    {pi0,neu,pip,pi0,pi0,pi0,pi0}};
+
+  static const G4int pizP8bfs[8][8] =
+  {{pi0,pro,pip,pip,pip,pim,pim,pim}, {pi0,pro,pip,pip,pim,pim,pi0,pi0},
+    {pi0,pro,pip,pim,pi0,pi0,pi0,pi0}, {pi0,pro,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pip,neu,pip,pip,pip,pim,pim,pim}, {pi0,neu,pip,pip,pip,pim,pim,pi0},
+    {pi0,neu,pip,pip,pim,pi0,pi0,pi0}, {pi0,neu,pip,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int pizP9bfs[9][9] =
+  {{pip,pro,pip,pip,pip,pim,pim,pim,pim}, {pi0,pro,pip,pip,pip,pim,pim,pim,pi0},
+    {pi0,pro,pip,pip,pim,pim,pi0,pi0,pi0}, {pi0,pro,pip,pim,pi0,pi0,pi0,pi0,pi0},
+    {pi0,pro,pi0,pi0,pi0,pi0,pi0,pi0,pi0}, {pi0,neu,pip,pip,pip,pip,pim,pim,pim},
+    {pi0,neu,pip,pip,pip,pim,pim,pi0,pi0}, {pi0,neu,pip,pip,pim,pi0,pi0,pi0,pi0},
+    {pi0,neu,pip,pi0,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // pi0 n : Outgoing particle types of a given multiplicity
+  static const G4int pizN2bfs[5][2] =
+   {{pi0,neu}, {pim,pro}, {k0,lam}, {k0,s0}, {kpl,sm}};
+
+  static const G4int pizN3bfs[13][3] =
+   {{pim,neu,pip}, {pi0,neu,pi0}, {pi0,pro,pim}, {pi0,lam,k0},
+    {pim,lam,kpl},  {pi0,s0,k0},   {pim,s0,kpl},   {pi0,sm,kpl},  
+    {pip,sm,k0},   {pim,sp,k0},   {k0b,neu,k0},  {kmi,neu,kpl},
+    {kmi,pro,k0}};
+
+  static const G4int pizN4bfs[21][4] =
+   {{pi0,neu,pim,pip}, {pi0,neu,pi0,pi0}, {pim,pro,pip,pim},
+    {pi0,pro,pim,pi0}, {pip,lam,k0,pim},  {pip,s0,k0,pim},
+    {pi0,lam,k0,pi0},  {pi0,s0,k0,pi0},   {pi0,sm,kpl,pi0},
+    {pi0,lam,kpl,pim},  {pi0,s0,kpl,pim},   {pip,sm,kpl,pim},
+    {pi0,sm,k0,pip},   {pi0,sp,k0,pim},   {pi0,neu,k0,k0b},
+    {pi0,neu,kpl,kmi},   {pim,neu,kpl,k0b},  {pip,neu,k0,kmi},
+    {pim,pro,k0,k0b},  {pim,pro,kpl,kmi},   {pi0,pro,k0,kmi}};
+
+  static const G4int pizN5bfs[30][5] =
+  {{pim,neu,pip,pip,pim}, {pi0,neu,pip,pim,pi0}, {pi0,neu,pi0,pi0,pi0},
+    {pi0,pro,pip,pim,pim}, {pi0,pro,pim,pi0,pi0}, {pi0,lam,k0,pip,pim},
+    {pi0,lam,k0,pi0,pi0},  {pim,lam,kpl,pip,pim},  {pi0,lam,kpl,pim,pi0},
+    {pi0,s0,k0,pip,pim},   {pi0,s0,k0,pi0,pi0},   {pim,s0,kpl,pip,pim},
+    {pi0,s0,kpl,pim,pi0},   {pi0,sm,kpl,pip,pim},   {pi0,sm,kpl,pi0,pi0},
+    {pip,sm,k0,pip,pim},   {pi0,sm,k0,pip,pi0},   {pim,sp,k0,pip,pim},
+    {pi0,sp,k0,pim,pi0},   {pi0,neu,k0,k0b,pi0},  {pi0,neu,kpl,kmi,pi0},
+    {pi0,neu,k0,kmi,pip},   {pi0,neu,kpl,k0b,pim},  {pim,neu,k0,k0b,pip},
+    {pim,neu,kpl,kmi,pip},   {pi0,pro,k0,k0b,pim},  {pi0,pro,kpl,kmi,pim},
+    {pi0,pro,k0,kmi,pi0},   {pim,pro,kpl,k0b,pim},  {pim,pro,k0,kmi,pip}};
+
+  static const G4int pizN6bfs[6][6] =
+   {{pi0,neu,pip,pip,pim,pim}, {pi0,neu,pip,pim,pi0,pi0},
+    {pi0,neu,pi0,pi0,pi0,pi0}, {pim,pro,pip,pip,pim,pim},
+    {pi0,pro,pip,pim,pim,pi0}, {pi0,pro,pim,pi0,pi0,pi0}};
+
+  static const G4int pizN7bfs[7][7] =
+   {{pim,neu,pip,pip,pip,pim,pim}, {pi0,neu,pip,pip,pim,pim,pi0},
+    {pi0,neu,pip,pim,pi0,pi0,pi0}, {pi0,neu,pi0,pi0,pi0,pi0,pi0},
+    {pi0,pro,pip,pip,pim,pim,pim}, {pi0,pro,pip,pim,pim,pi0,pi0},
+    {pi0,pro,pim,pi0,pi0,pi0,pi0}};
+
+  static const G4int pizN8bfs[8][8] =
+   {{pi0,neu,pip,pip,pip,pim,pim,pim}, {pi0,neu,pip,pip,pim,pim,pi0,pi0},
+    {pi0,neu,pip,pim,pi0,pi0,pi0,pi0}, {pi0,neu,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pim,pro,pip,pip,pip,pim,pim,pim}, {pi0,pro,pip,pip,pim,pim,pim,pi0},
+    {pi0,pro,pip,pim,pim,pi0,pi0,pi0}, {pi0,pro,pim,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int pizN9bfs[9][9] =
+   {{pim,neu,pip,pip,pip,pip,pim,pim,pim}, {pi0,neu,pip,pip,pip,pim,pim,pim,pi0},
+    {pi0,neu,pip,pip,pim,pim,pi0,pi0,pi0}, {pi0,neu,pip,pim,pi0,pi0,pi0,pi0,pi0},
+    {pi0,neu,pi0,pi0,pi0,pi0,pi0,pi0,pi0}, {pi0,pro,pip,pip,pip,pim,pim,pim,pim},
+    {pi0,pro,pip,pip,pim,pim,pim,pi0,pi0}, {pi0,pro,pip,pim,pim,pi0,pi0,pi0,pi0},
+    {pi0,pro,pim,pi0,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // Total pi- p cross section as a function of kinetic energy
+  static const G4double pizPtotXSec[30] =
+   { 6.43,  7.18,  7.54,  8.01,  8.52,  9.13, 10.22, 14.37, 20.96, 34.73,
+    61.07, 98.23, 61.97, 32.62, 28.07, 31.37, 35.15, 40.17, 37.27, 33.49,
+    31.06, 29.52, 28.29, 26.91, 26.25, 25.25, 24.75, 24.35, 24.0,  23.9};
+
+  // pi- p cross sections as functions of kinetic energy and multiplicity
+  static const G4double pizPCrossSections[99][30] = {
+  //
+  // multiplicity 2 (5 channels)
+  //
+  // p pi0 (n pi0)
+    //   { 0.0,   1.15, 1.85,  2.6,  3.25,  4.4,   5.5,   9.0,  16.7,  35.5,
+    //    72.0, 107.0, 72.35, 33.1, 19.51, 17.02, 11.27, 19.11, 15.35, 11.0,
+    //     8.83,  7.4,  6.4,   5.75, 5.2,   4.7,   4.25,  4.0,   3.8,   3.65},
+
+  // p pi0 (n pi0)   go back to original for now
+   { 1.73,  2.28,  2.44,   2.71,  3.02,   3.43,   3.92,   5.37,  9.96, 17.73,
+   29.07, 50.23, 33.68,  16.69, 12.60,  11.89,  13.49,  15.24, 12.39,  9.59,
+    7.92,  6.97,  6.13,   5.37,  4.82,   4.68,   4.54,   4.0,   3.8,   3.65},
+
+  // n pi+ (p pi-)
+   //   { 0.0,  2.4,  2.8,  3.3,   4.5,  5.7,  6.3,  9.0, 11.0, 17.0,
+   //    30.0, 43.0, 30.0, 16.5,  11.0,  7.01, 4.31, 5.03, 2.05, 0.97,
+   //     0.53, 0.3,  0.2,  0.11,  0.07, 0.05, 0.04, 0.03, 0.02, 0.01},
+
+  // n pi+ (p pi-)  taken from pi- p -> pi0 n
+   { 4.7,  4.9,  5.1,  5.3,  5.5,  5.7,  6.3,  9.0, 11.0, 17.0,
+   32.0, 48.0, 28.0, 14.5, 11.04, 8.99, 4.79, 5.02, 2.08, 0.94,
+   0.5,  0.25, 0.15, 0.09, 0.06, 0.05, 0.04, 0.02, 0.02, 0.01},
+
+  // L K+ (L K0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.65, 0.29, 0.17,
+     0.14, 0.1, 0.05, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01, 0.0},
+
+  // S0 K+ (S0 K0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.28, 0.18, 0.12,
+     0.10, 0.06, 0.04, 0.03, 0.02, 0.01, 0.01, 0.01, 0.0,  0.0},
+
+  // S+ K0 (S- K+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.18, 0.43, 0.22,
+     0.12, 0.06, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01, 0.0,  0.0},
+  //
+  // multiplicity 3 (13 channels)
+  //
+  // p pi+ pi- (n pi+ pi-)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0, 0.03, 0.19, 0.73, 3.4,  7.01, 8.35, 8.9,  5.69,
+    4.01, 2.7, 2.0,  1.30, 0.9,  0.68, 0.48, 0.34, 0.27, 0.19},
+
+  // p pi0 pi0 (n pi0 pi0)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0, 0.22, 0.74, 1.8,  2.7,  3.0, 2.52, 1.33, 0.69,
+    0.44, 0.3, 0.2,  0.12, 0.07, 0.04, 0.0, 0.0,  0.0,  0.0},
+
+  // n pi+ pi0 (p pi- pi0)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0, 0.04, 0.5,  1.75, 3.6, 5.21, 5.28, 6.34, 5.15,
+    4.01, 3.1, 2.2,  1.42, 1.05, 0.8, 0.57, 0.33, 0.26, 0.19},
+
+  // L K+ pi0 (L K0 pi0)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,   0.0,
+    0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02,  0.13,
+    0.14, 0.1, 0.08, 0.06, 0.04, 0.03, 0.02, 0.02, 0.01,  0.01},
+
+  // L K0 pi+ (L K+ pi-)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.03, 0.16,
+    0.15, 0.1, 0.07, 0.05, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  // S0 K+ pi0 (S0 K0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.09,
+    0.11, 0.07, 0.05, 0.04, 0.03, 0.02, 0.01, 0.01, 0.01, 0.0},
+
+  // S0 K0 pi+ (S0 K+ pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.11,
+    0.11, 0.07, 0.05, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  // S+ K0 pi0 (S- K+ pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.09,
+    0.11, 0.07, 0.05, 0.04, 0.03, 0.02, 0.01, 0.01, 0.0, 0.0},
+
+  // S+ K+ pi- (S- K0 pi+)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.09,
+    0.11, 0.07, 0.05, 0.04, 0.03, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+  // S- K+ pi+ (S+ K0 pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0, 0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0, 0.08,
+    0.10, 0.05, 0.03, 0.02, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0},
+
+  // p K+ K- (n K0 K0b)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02, 0.11,
+    0.12, 0.08, 0.07, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  // p K0 K0b (n K+ K-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02, 0.11,
+    0.12, 0.08, 0.07, 0.05, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  // n K+ K0b (p K0 K-)
+   {0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.05,
+    0.11, 0.22, 0.2, 0.09, 0.05, 0.02, 0.01, 0.0, 0.0, 0.0},
+  //
+  // multiplicity 4 (21 channels)
+  //
+  // p pi+ pi- pi0 (n pi+ pi- pi0)
+   {0.0,  0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0, 0.0, 0.04, 0.14, 0.44, 1.11, 1.88,
+    2.05, 2.07, 1.75, 1.5, 1.3, 1.1,  0.95, 0.80, 0.72, 0.66},
+
+  // p pi0 pi0 pi0 (n pi0 pi0 pi0)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0, 0.0,  0.0,  0.1,  0.55, 1.0, 0.88, 0.72, 0.64,
+    0.53, 0.4, 0.35, 0.29, 0.22, 0.14, 0.1, 0.06, 0.03, 0.0},
+
+  // n pi+ pi+ pi- (p pi+ pi- pi-)
+   {0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0, 0.0, 0.0,  0.05, 0.17, 0.32, 0.77, 1.79, 2.25,
+    1.82, 1.5, 1.3, 1.05, 0.9,  0.72, 0.63, 0.5,  0.43, 0.35},
+
+  // n pi+ pi0 pi0 (p pi- pi0 pi0)  
+   {0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0, 0.03, 0.09, 0.28, 0.77, 1.32,
+    1.54, 1.37, 1.2, 1.02, 0.9, 0.77, 0.69, 0.6,  0.54, 0.48},
+
+  // L K+ pi+ pi- (L K0 pi+ pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+    0.03, 0.06, 0.07, 0.06, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02},
+
+  // S0 K+ pi+ pi- (S0 K0 pi+ pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  // L K+ pi0 pi0 (L K0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+    0.03, 0.06, 0.07, 0.06, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02},
+
+  // S0 K+ pi0 pi0 (S0 K0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  // S+ K0 pi0 pi0 (S- K+ pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.06, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02, 0.01, 0.01},
+
+  // L K0 pi+ pi0 (L K+ pi- pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+    0.04, 0.07, 0.07, 0.06, 0.05, 0.04, 0.04, 0.03, 0.02, 0.02},
+
+  // S0 K0 pi+ pi0 (S0 K+ pi- pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  // S+ K0 pi+ pi- (S- K+ pi+ pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.06, 0.05, 0.04, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  // S+ K+ pi- pi0 (S- K0 pi+ pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.08, 0.06, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  // S- K+ pi+ pi0 (S+ K0 pi- pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.03, 0.11, 0.11, 0.09, 0.07, 0.04, 0.03, 0.03, 0.02, 0.02},
+
+  // p pi0 K+ K- (n pi0 K0 K0b)
+   {0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.1, 0.11, 0.1, 0.08, 0.07, 0.07, 0.06, 0.05, 0.04},
+
+  // p pi0 K0 K0b (n pi0 K+ K-)
+   {0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.11, 0.1, 0.09, 0.08, 0.07, 0.06, 0.05, 0.04},
+
+  // p pi+ K0 K- (n pi- K+ K0b)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.08, 0.07, 0.07, 0.06, 0.06, 0.05, 0.05, 0.04},
+
+  // p pi- K+ K0b (n pi+ K0 K-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.08, 0.07, 0.07, 0.06, 0.06, 0.05, 0.05, 0.04},
+
+  // n pi+ K+ K- (p pi- K0 K0b)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.07, 0.06, 0.06, 0.05, 0.05, 0.04, 0.04, 0.04},
+
+  // n pi+ K0 K0b (p pi- K+ K-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.07, 0.06, 0.06, 0.05, 0.05, 0.04, 0.04, 0.04},
+
+  // n pi0 K+ K0b (p pi0 K0 K-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.05, 0.07, 0.06, 0.06, 0.05, 0.05, 0.04, 0.04, 0.04},
+  //
+  // multiplicity 5 (30 channels)
+  //
+  // p pi+ pi+ pi- pi- (n pi+ pi+ pi- pi-)
+   {0.0,  0.0, 0.0, 0.0, 0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0, 0.0, 0.0, 0.0, 0.0,  0.0, 0.04, 0.2,  1.45,
+    2.41, 3.1, 2.7, 2.3, 2.0, 1.54, 1.3, 1.0,  0.83, 0.66},
+
+// p pi+ pi- pi0 pi0 (n pi+ pi- pi0 pi0)
+ { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.01, 0.07, 0.48,
+   0.80, 1.1, 0.9, 0.76, 0.63, 0.51, 0.43, 0.33, 0.28, 0.22},
+
+// p pi0 pi0 pi0 pi0 (n pi0 pi0 pi0 pi0)
+ { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.03, 0.21,
+   0.35, 0.5, 0.67, 0.55, 0.47, 0.38, 0.33, 0.23, 0.2,  0.17},
+
+// n pi+ pi+ pi- pi0 (p pi+ pi- pi- pi0)
+ { 0.0,  0.0, 0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0,  0.0, 0.0, 0.0,  0.0, 0.0,  0.1,  0.2,  0.41, 1.16,
+   1.75, 1.8, 1.8, 1.38, 1.0, 0.76, 0.58, 0.42, 0.32, 0.24},
+
+// n pi+ pi0 pi0 pi0 (p pi- pi0 pi0 pi0)
+ { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.04, 0.21,
+   0.42, 0.6, 0.72, 0.68, 0.57, 0.47, 0.38, 0.28, 0.24, 0.2},
+
+// L K+ pi+ pi- pi0 (L K0 pi+ pi- pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.04, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02},
+
+// L K+ pi0 pi0 pi0 (L K0 pi0 pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.04, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02},
+
+//  L K0 pi+ pi+ pi- (L K+ pi+ pi- pi-)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+
+// L K0 pi+ pi0 pi0 (L K+ pi- pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+
+// S0 K+ pi+ pi- pi0 (S0 K0 pi+ pi- pi0)
+ { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+// S0 K+ pi0 pi0 pi0 (S0 K0 pi0 pi0 pi0)
+ { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+// S0 K0 pi+ pi+ pi- (S0 K+ pi+ pi- pi-)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+// S0 K0 pi+ pi0 pi0 (S0 K+ pi- pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.02, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+
+// S+ K0 pi+ pi- pi0 (S- K+ pi+ pi- pi0)
+ { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+// S+ K0 pi0 pi0 pi0 (S- K+ pi0 pi0 pi0)
+ { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+// S+ K+ pi+ pi- pi- (S- K0 pi+ pi+ pi-)
+ { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.01, 0.01, 0.02},
+
+// S+ K+ pi- pi0 pi0 (S- K0 pi+ pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.05, 0.05, 0.03, 0.03, 0.02, 0.02, 0.02},
+
+// S- K+ pi+ pi+ pi- (S+ K0 pi+ pi- pi-)
+ { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0, 0.01, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+// S- K+ pi+ pi0 pi0 (S+ K0 pi- pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+// p K+ K- pi0 pi0 (n K0 K0b pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.02, 0.06, 0.07, 0.06, 0.05, 0.05, 0.04, 0.04, 0.03},
+
+// p K0 K0b pi0 pi0 (n K+ K- pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02},
+
+// p K+ K0b pi- pi0 (n K0 K- pi+ pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.06, 0.06, 0.05, 0.05, 0.04, 0.04, 0.03},
+
+// p K0 K- pi+ pi0 (n K+ K0b pi- pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.02, 0.03, 0.04, 0.03, 0.03, 0.02, 0.02, 0.03},
+
+// p K+ K- pi+ pi- (n K0 K0b pi+ pi-)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.02, 0.06, 0.07, 0.06, 0.05, 0.05, 0.04, 0.04, 0.04},
+
+// p K0 K0b pi+ pi- (n K+ K- pi+ pi-)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.03, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02},
+
+// n K+ K- pi+ pi0 (p K0 K0b pi- pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.02, 0.06, 0.05, 0.05, 0.04, 0.04, 0.03, 0.03, 0.03},
+
+// n K0 K0b pi+ pi0 (p K+ K- pi- pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+
+// n K+ K0b pi0 pi0 (p K0 K- pi0 pi0)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.06, 0.05, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+
+// n K0 K- pi+ pi+ (p K+ K0b pi- pi-)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.06, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+
+// n K+ K0b pi+ pi- (p K0 K- pi+ pi-)
+ { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+   0.0, 0.01, 0.06, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+  //
+  // multiplicity 6 (6 channels)
+  //
+  // p pi+ pi+ pi- pi- pi0 (n pi+ pi+ pi- pi- pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.01, 0.02,
+    0.04, 0.08, 0.12, 0.15, 0.2, 0.19, 0.17, 0.14, 0.12, 0.1},
+
+  // p pi+ pi- pi0 pi0 pi0 (n pi+ pi- pi0 pi0 pi0)
+   {0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.03,
+    0.06, 0.1, 0.14, 0.16, 0.20, 0.19, 0.19, 0.16, 0.14, 0.13},
+
+  // p pi0 pi0 pi0 pi0 pi0 (n pi0 pi0 pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.02,
+    0.03, 0.05, 0.07, 0.09, 0.11, 0.10, 0.10, 0.09, 0.08, 0.07},
+
+  // n pi+ pi+ pi+ pi- pi- (p pi+ pi+ pi- pi- pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.01, 0.02, 0.07,
+    0.12, 0.21, 0.28, 0.36, 0.4, 0.42, 0.39, 0.36, 0.31, 0.28},
+
+  // n pi+ pi+ pi- pi0 pi0 (p pi+ pi- pi- pi0 pi0)
+   {0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.04,
+    0.07, 0.15, 0.2, 0.24, 0.26, 0.29, 0.27, 0.24, 0.21, 0.18},
+
+  // n pi+ pi0 pi0 pi0 pi0 (p pi- pi0 pi0 pi0 pi0)
+   {0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.04,
+    0.09, 0.15, 0.2, 0.25, 0.30, 0.29, 0.28, 0.25, 0.21, 0.19},
+  //
+  // multiplicity 7 (7 channels)
+  //
+  // p pi+ pi+ pi+ pi- pi- pi- (n pi+ pi+ pi+ pi- pi- pi-)
+   {0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.01, 0.02,
+    0.03, 0.15, 0.4, 0.66, 0.85, 0.82, 0.75, 0.7, 0.65, 0.60},
+
+  // p pi+ pi+ pi- pi- pi0 pi0 (n pi+ pi+ pi- pi- pi0 pi0)
+   {0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.01, 0.02,
+    0.03, 0.15, 0.4, 0.66, 0.85, 0.82, 0.75, 0.7, 0.65, 0.60},
+
+  // p pi+ pi- pi0 pi0 pi0 pi0 (n pi+ pi- pi0 pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.07, 0.16, 0.28, 0.31, 0.29, 0.25, 0.20, 0.15, 0.10},
+
+  // p pi0 pi0 pi0 pi0 pi0 pi0 (n pi0 pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.02, 0.05, 0.10, 0.12, 0.12, 0.11, 0.10, 0.09, 0.08},
+
+  // n pi+ pi+ pi+ pi- pi- pi0 (p pi+ pi+ pi- pi- pi- pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0, 0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0, 0.0,
+    0.01, 0.04, 0.08, 0.14, 0.27, 0.3, 0.27, 0.22, 0.2, 0.18},
+
+  // n pi+ pi+ pi- pi0 pi0 pi0 (p pi+ pi- pi- pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+    0.01, 0.04, 0.08, 0.12, 0.16, 0.15, 0.13, 0.11, 0.09, 0.07},
+
+  // n pi+ pi0 pi0 pi0 pi0 pi0 (p pi- pi0 pi0 pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.03, 0.05, 0.08, 0.16, 0.19, 0.17, 0.16, 0.14, 0.13},
+  //
+  // multiplicity 8 (8 channels)
+  //
+  // p pi+ pi+ pi+ pi- pi- pi- pi0 (n pi+ pi+ pi+ pi- pi- pi- pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.02, 0.04, 0.07, 0.11, 0.13, 0.14, 0.13, 0.12, 0.11},
+
+  // p pi+ pi+ pi- pi- pi0 pi0 pi0 (n pi+ pi+ pi- pi- pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.01, 0.03, 0.05, 0.08, 0.10, 0.10, 0.09, 0.09, 0.08},
+
+  // p pi+ pi- pi0 pi0 pi0 pi0 pi0 (n pi+ pi- pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.01, 0.02, 0.04, 0.06, 0.07, 0.07, 0.06, 0.06, 0.05},
+
+  // p pi0 pi0 pi0 pi0 pi0 pi0 pi0 (n pi0 pi0 pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.01, 0.01, 0.02, 0.03, 0.04, 0.04, 0.04, 0.04, 0.04},
+
+  // n pi+ pi+ pi+ pi+ pi- pi- pi- (p pi+ pi+ pi+ pi- pi- pi- pi-)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,   0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,   0.0,  0.0,  0.0,
+    0.02, 0.04, 0.07, 0.12, 0.19, 0.26, 0.26, 0.24, 0.23, 0.21},
+
+  // n pi+ pi+ pi+ pi- pi- pi0 pi0 (p pi+ pi+ pi- pi- pi- pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.04, 0.07, 0.12, 0.19, 0.26, 0.25, 0.23, 0.23, 0.2},
+
+  // n pi+ pi+ pi- pi0 pi0 pi0 pi0 (p pi+ pi- pi- pi0 pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.03, 0.05, 0.08, 0.13, 0.13, 0.12, 0.11, 0.09, 0.08},
+
+  // n pi+ pi0 pi0 pi0 pi0 pi0 pi0 (p pi- pi0 pi0 pi0 pi0 pi0 pi0)
+   {0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.02, 0.04, 0.06, 0.10, 0.13, 0.12, 0.11, 0.11, 0.1},
+
+  //
+  // multiplicity 9 (9 channels)
+  //
+  // p pi+ pi+ pi+ pi+ pi- pi- pi- pi- (n pi+ pi+ pi+ pi+ pi- pi- pi- pi-)
+   {0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.01, 0.02, 0.05, 0.11, 0.16, 0.22, 0.27, 0.27, 0.27},
+
+  // p pi+ pi+ pi+ pi- pi- pi- pi0 pi0 (n pi+ pi+ pi+ pi- pi- pi- pi0 pi0)
+   {0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.01, 0.02, 0.03, 0.07, 0.10, 0.13, 0.18, 0.18, 0.18},
+
+  // p pi+ pi+ pi- pi- pi0 pi0 pi0 pi0 (n pi+ pi+ pi- pi- pi0 pi0 pi0 pi0)
+   {0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.01, 0.02, 0.04, 0.06, 0.09, 0.11, 0.11, 0.11},
+
+  // p pi+ pi- pi0 pi0 pi0 pi0 pi0 pi0 (n pi+ pi- pi0 pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.01, 0.02, 0.04, 0.05, 0.07, 0.07, 0.07},
+
+  // p pi0 pi0 pi0 pi0 pi0 pi0 pi0 pi0 (n pi0 pi0 pi0 pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.01, 0.02, 0.04, 0.05, 0.07, 0.07, 0.07},
+
+  // n pi+ pi+ pi+ pi+ pi- pi- pi- pi0 (p pi+ pi+ pi+ pi- pi- pi- pi- pi0)
+   {0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.01, 0.03, 0.06, 0.11, 0.14, 0.16, 0.16, 0.16},
+
+  // n pi+ pi+ pi+ pi- pi- pi0 pi0 pi0 (p pi+ pi+ pi- pi- pi- pi0 pi0 pi0)
+   {0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0,
+    0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0,
+    0.0, 0.0, 0.01, 0.02, 0.05, 0.07, 0.08, 0.1, 0.1, 0.1},
+
+  // n pi+ pi+ pi- pi0 pi0 pi0 pi0 pi0 (p pi+ pi- pi- pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.01, 0.02, 0.04, 0.06, 0.06, 0.06, 0.06},
+
+  // n pi+ pi0 pi0 pi0 pi0 pi0 pi0 pi0 (p pi- pi0 pi0 pi0 pi0 pi0 pi0 pi0)
+   {0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0, 0.0, 0.0, 0.01, 0.01, 0.02, 0.03, 0.04, 0.04, 0.04}};
+}
+
+// Initialize both |T Tz> = |1/2 1/2> channels, using pizP cross-section table
+
+G4CascadePiZeroPChannelData::data_t
+G4CascadePiZeroPChannelData::data(pizP2bfs, pizP3bfs, pizP4bfs,
+				  pizP5bfs, pizP6bfs, pizP7bfs,
+				  pizP8bfs, pizP9bfs, pizPCrossSections,
+				  pizPtotXSec);
+
+G4CascadePiZeroNChannelData::data_t
+G4CascadePiZeroNChannelData::data(pizN2bfs, pizN3bfs, pizN4bfs,
+				  pizN5bfs, pizN6bfs, pizN7bfs,
+				  pizN8bfs, pizN9bfs, pizPCrossSections,
+				  pizPtotXSec);
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT1NNChannel.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT1NNChannel.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT1NNChannel.cc	(revision 1316)
@@ -0,0 +1,648 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeT1NNChannel.cc,v 1.1 2010/05/14 21:05:03 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadePPChannel.hh"
+#include "G4CascadeNNChannel.hh"
+#include "G4InuclParticleNames.hh"
+using namespace G4InuclParticleNames;
+
+namespace {
+  // p p : Outgoing particle types of a given multiplicity
+  static const G4int pp2bfs[1][2] =
+  {{pro,pro}};
+
+  static const G4int pp3bfs[6][3] =
+  {{pro,pro,pi0}, {pro,neu,pip}, {pro,lam,kpl},
+    {pro,s0,kpl},   {pro,sp,k0},   {neu,sp,kpl}};
+
+  static const G4int pp4bfs[18][4] =
+  {{pro,pro,pip,pim},{pro,neu,pip,pi0},{pro,pro,pi0,pi0},
+    {neu,neu,pip,pip},{pro,lam,kpl,pi0}, {pro,lam,k0,pip},
+    {neu,lam,kpl,pip}, {neu,s0,kpl,pip},  {pro,s0,kpl,pi0},
+    {pro,s0,k0,pip},  {pro,sm,kpl,pip},  {pro,sp,k0,pi0},
+    {neu,sp,k0,pip},  {pro,sp,kpl,pim},  {neu,sp,kpl,pi0},
+    {pro,pro,k0,k0b}, {pro,pro,kpl,kmi},  {pro,neu,kpl,k0b}};
+
+  static const G4int pp5bfs[32][5] =
+  {{pro,pro,pip,pim,pi0},{pro,pro,pi0,pi0,pi0},{pro,neu,pip,pip,pim},
+    {pro,neu,pip,pi0,pi0},{neu,neu,pip,pip,pi0},{pro,lam,kpl,pip,pim},
+    {pro,lam,kpl,pi0,pi0}, {pro,lam,k0,pip,pi0}, {pro,s0,kpl,pip,pim},
+    {pro,s0,kpl,pi0,pi0},  {pro,s0,k0,pip,pi0},  {pro,sp,k0,pip,pim},
+    {pro,sp,k0,pi0,pi0},  {pro,sp,kpl,pim,pi0},  {pro,sm,kpl,pip,pi0},
+    {pro,sm,k0,pip,pip},  {neu,lam,kpl,pip,pi0}, {neu,lam,k0,pip,pip},
+    {neu,s0,kpl,pip,pi0},  {neu,s0,k0,pip,pip},  {neu,sp,k0,pip,pi0},
+    {neu,sp,kpl,pip,pim},  {neu,sp,kpl,pi0,pi0},  {neu,sm,kpl,pip,pip},
+    {pro,pro,pip,k0,kmi},  {pro,pro,pim,kpl,k0b}, {pro,pro,pi0,k0,k0b},
+    {pro,pro,pi0,kpl,kmi},  {pro,neu,pip,k0,k0b}, {pro,neu,pip,kpl,kmi},
+    {pro,neu,pi0,kpl,k0b}, {neu,neu,pip,kpl,k0b}};
+
+  static const G4int pp6bfs[7][6] =
+  {{pro,pro,pip,pip,pim,pim},{pro,pro,pip,pim,pi0,pi0},
+    {pro,pro,pi0,pi0,pi0,pi0},{pro,neu,pip,pip,pim,pi0},
+    {pro,neu,pip,pi0,pi0,pi0},{neu,neu,pip,pip,pip,pim},
+    {neu,neu,pip,pip,pi0,pi0}};
+
+  static const G4int pp7bfs[8][7] =
+  {{pro,pro,pip,pip,pim,pim,pi0},{pro,pro,pip,pim,pi0,pi0,pi0},
+    {pro,pro,pi0,pi0,pi0,pi0,pi0},{pro,neu,pip,pip,pip,pim,pim},
+    {pro,neu,pip,pip,pim,pi0,pi0},{pro,neu,pip,pi0,pi0,pi0,pi0},
+    {neu,neu,pip,pip,pip,pim,pi0},{neu,neu,pip,pip,pi0,pi0,pi0}};
+
+  static const G4int pp8bfs[10][8] =
+  {{pro,pro,pip,pip,pip,pim,pim,pim},{pro,pro,pip,pip,pim,pim,pi0,pi0},
+    {pro,pro,pip,pim,pi0,pi0,pi0,pi0},{pro,pro,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pro,neu,pip,pip,pip,pim,pim,pi0},{pro,neu,pip,pip,pim,pi0,pi0,pi0},
+    {pro,neu,pip,pi0,pi0,pi0,pi0,pi0},{neu,neu,pip,pip,pip,pip,pim,pim},
+    {neu,neu,pip,pip,pip,pim,pi0,pi0},{neu,neu,pip,pip,pi0,pi0,pi0,pi0}};
+
+  static const G4int pp9bfs[11][9] =
+  {{pro,pro,pip,pip,pip,pim,pim,pim,pi0},{pro,pro,pip,pip,pim,pim,pi0,pi0,pi0},
+    {pro,pro,pip,pim,pi0,pi0,pi0,pi0,pi0},{pro,pro,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pro,neu,pip,pip,pip,pip,pim,pim,pim},{pro,neu,pip,pip,pip,pim,pim,pi0,pi0},
+    {pro,neu,pip,pip,pim,pi0,pi0,pi0,pi0},{pro,neu,pip,pi0,pi0,pi0,pi0,pi0,pi0},
+    {neu,neu,pip,pip,pip,pip,pim,pim,pi0},{neu,neu,pip,pip,pip,pim,pi0,pi0,pi0},
+    {neu,neu,pip,pim,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // n n : Outgoing particle types of a given multiplicity
+  static const G4int nn2bfs[1][2] =
+   {{neu,neu}};
+
+  static const G4int nn3bfs[6][3] =
+   {{neu,neu,pi0}, {pro,neu,pim}, {neu,lam,k0},
+    {neu,s0,k0},   {neu,sm,kpl},   {pro,sm,k0}};
+
+  static const G4int nn4bfs[18][4] =
+   {{neu,neu,pip,pim},{pro,neu,pim,pi0},{neu,neu,pi0,pi0},
+    {pro,pro,pim,pim},{neu,lam,k0,pi0}, {neu,lam,kpl,pim},
+    {pro,lam,k0,pim}, {pro,s0,k0,pim},  {neu,s0,k0,pi0},
+    {neu,s0,kpl,pim},  {neu,sp,k0,pim},  {neu,sm,kpl,pi0},
+    {pro,sm,kpl,pim},  {neu,sm,k0,pip},  {pro,sm,k0,pi0},
+    {neu,neu,kpl,kmi},  {neu,neu,k0,k0b}, {pro,neu,k0,kmi}};
+
+  static const G4int nn5bfs[32][5] =
+   {{neu,neu,pip,pim,pi0},{neu,neu,pi0,pi0,pi0},{pro,neu,pip,pim,pim},
+    {pro,neu,pim,pi0,pi0},{pro,pro,pim,pim,pi0},{neu,lam,k0,pip,pim},
+    {neu,lam,k0,pi0,pi0}, {neu,lam,kpl,pim,pi0}, {neu,s0,k0,pip,pim},
+    {neu,s0,k0,pi0,pi0},  {neu,s0,kpl,pim,pi0},  {neu,sm,kpl,pip,pim},
+    {neu,sm,kpl,pi0,pi0},  {neu,sm,k0,pip,pi0},  {neu,sp,k0,pim,pi0},
+    {neu,sp,kpl,pim,pim},  {pro,lam,k0,pim,pi0}, {pro,lam,kpl,pim,pim},
+    {pro,s0,k0,pim,pi0},  {pro,s0,kpl,pim,pim},  {pro,sm,kpl,pim,pi0},
+    {pro,sm,k0,pip,pim},  {pro,sm,k0,pi0,pi0},  {pro,sp,k0,pim,pim},
+    {neu,neu,pim,kpl,k0b}, {neu,neu,pip,k0,kmi},  {neu,neu,pi0,kpl,kmi},
+    {neu,neu,pi0,k0,k0b}, {pro,neu,pim,kpl,kmi},  {pro,neu,pim,k0,k0b},
+    {pro,neu,pi0,k0,kmi},  {pro,pro,pim,k0,kmi}};
+
+  static const G4int nn6bfs[7][6] =
+   {{neu,neu,pip,pip,pim,pim},{neu,neu,pip,pim,pi0,pi0},
+    {neu,neu,pi0,pi0,pi0,pi0},{pro,neu,pip,pim,pim,pi0},
+    {pro,neu,pim,pi0,pi0,pi0},{pro,pro,pip,pim,pim,pim},
+    {pro,pro,pim,pim,pi0,pi0}};
+
+  static const G4int nn7bfs[8][7] =
+   {{neu,neu,pip,pip,pim,pim,pi0},{neu,neu,pip,pim,pi0,pi0,pi0},
+    {neu,neu,pi0,pi0,pi0,pi0,pi0},{pro,neu,pip,pip,pim,pim,pim},
+    {pro,neu,pip,pim,pim,pi0,pi0},{pro,neu,pim,pi0,pi0,pi0,pi0},
+    {pro,pro,pip,pim,pim,pim,pi0},{pro,pro,pim,pim,pi0,pi0,pi0}};
+
+  static const G4int nn8bfs[10][8] =
+   {{neu,neu,pip,pip,pip,pim,pim,pim},{neu,neu,pip,pip,pim,pim,pi0,pi0},
+    {neu,neu,pip,pim,pi0,pi0,pi0,pi0},{neu,neu,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pro,neu,pip,pip,pim,pim,pim,pi0},{pro,neu,pip,pim,pim,pi0,pi0,pi0},
+    {pro,neu,pim,pi0,pi0,pi0,pi0,pi0},{pro,pro,pip,pip,pim,pim,pim,pim},
+    {pro,pro,pip,pim,pim,pim,pi0,pi0},{pro,pro,pim,pim,pi0,pi0,pi0,pi0}};
+
+  static const G4int nn9bfs[11][9] =
+   {{neu,neu,pip,pip,pip,pim,pim,pim,pi0},{neu,neu,pip,pip,pim,pim,pi0,pi0,pi0},
+    {neu,neu,pip,pim,pi0,pi0,pi0,pi0,pi0},{neu,neu,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pro,neu,pip,pip,pip,pim,pim,pim,pim},{pro,neu,pip,pip,pim,pim,pim,pi0,pi0},
+    {pro,neu,pip,pim,pim,pi0,pi0,pi0,pi0},{pro,neu,pim,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pro,pro,pip,pip,pim,pim,pim,pim,pi0},{pro,pro,pip,pim,pim,pim,pi0,pi0,pi0},
+    {pro,pro,pip,pim,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // Total p p cross sections as a function of kinetic energy
+  static const G4double ppTotXSec[30] = 
+  {17613.0, 302.9, 257.1, 180.6, 128.4,  90.5,  66.1,  49.4,  36.9,  29.6,
+      26.0,  23.1,  22.6,  23.0,  27.0,  32.0,  44.0,  47.04, 44.86, 46.03,
+      44.09, 41.81, 41.17, 40.65, 40.15, 40.18, 39.26, 38.36, 38.39, 38.41};
+
+  static const G4double ppCrossSections[93][30] = {
+  //
+  // multiplicity 2 (1 channel)
+  //
+  //  p p (n n)
+   {17613.0, 302.9, 257.1, 180.6, 128.4, 90.5, 66.1, 49.4, 36.9, 29.6,
+       26.0,  23.1,  22.6,  23.0,  26.3, 26.1, 25.0, 23.5, 21.0, 18.0,
+       16.0,  14.3,  12.5,  11.2,  10.3,  9.6,  9.0,  8.5,  8.0,  7.7 },
+  //
+  // multiplicity 3 (6 channels)
+  //
+  //  p p pi0 (n n pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  1.4,  4.0,  4.3,  4.0,  4.0,
+     3.6,  3.0,  2.8,  2.5,  1.7,  1.3,  1.1,  1.0,  0.9,  0.85 },
+
+  //  p n pi+ (p n pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.7,  4.5, 15.0, 19.1, 18.0, 16.0,
+    13.0, 10.0,  8.2,  6.0,  4.3,  3.3,  2.6,  2.0,  1.65, 1.4 },
+
+  //  p L K+ (n L K0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.06, 0.06, 0.06, 0.05, 0.05, 0.04 ,0.04, 0.04, 0.03 },
+
+  //  p S0 K+ (n S0 K0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.01, 0.02, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S+ K0 (n S- K+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.01, 0.02, 0.03, 0.03, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02 },
+
+  //  n S+ K+ (p S- K0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.02, 0.06, 0.07, 0.06, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02 },
+  //
+  // multiplicity 4 (18 channels)
+  //
+  //  p p pi+ pi- (n n pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.05, 0.6,  1.9,
+     2.8,  3.0,  3.0,  2.8,  2.5,  2.1,  1.9,  1.6,  1.4,  1.2 },
+
+  //  p n pi+ pi0 (p n pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.05, 0.6,  3.5,
+     4.0,  3.9,  3.5,  3.1,  2.8,  2.4,  2.2,  1.9,  1.7,  1.5 },
+
+  //  p p pi0 pi0 (n n pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02, 0.24, 0.76,
+     1.1,  1.2,  1.2,  1.1,  1.0,  0.84, 0.76, 0.64, 0.56, 0.48 },
+
+  //  n n pi+ pi+ (p p pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02, 0.24, 1.4,
+     1.6,  1.6,  1.4,  1.2,  1.1,  1.0,  0.88, 0.76, 0.68, 0.6 },
+
+  //  L K+ p pi0 (L K0 n pi0)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.02, 0.05, 0.06, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02 },
+
+  //  L K0 p pi+ (L K+ n pi-)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.02, 0.06, 0.09, 0.09, 0.08, 0.07, 0.06, 0.05, 0.04 },
+
+  //  L K+ n pi+ (L K0 p pi-)
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.04, 0.08, 0.07, 0.06, 0.05, 0.04, 0.03, 0.03 },
+
+  //  S0 K+ n pi+ (S0 K0 p pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01 },
+
+  //  S0 K+ p pi0 (S0 K0 n pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.01, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01,0.01 },
+
+  //  S0 K0 p pi+ (S0 K+ n pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02 },
+
+  //  S- K+ p pi+ (S+ K0 n pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01 },
+
+  //  S+ K0 p pi0 (S- K+ n pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  S+ K0 n pi+ (S- K+ p pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.04, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02 },
+
+  //  S+ K+ p pi- (S- K0 n pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.01 },
+
+  //  S+ K+ n pi0 (S- K0 p pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.01 },
+
+  //  p p K0 K0bar (n n K+ K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p p K+ K- (n n K0 K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p n K+ K0bar (p n K0 K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+  //
+  // multiplicity 5 (32 channels)
+  //
+  //  p p pi+ pi- pi0 (n n pi+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.06,
+     0.4,  1.1,  1.8,  2.4,  2.4,  2.2,  2.0,  1.7,  1.5,  1.3 },
+
+  //  p p pi0 pi0 pi0 (n n pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.02,
+     0.12, 0.33, 0.54, 0.72, 0.72, 0.66, 0.6,  0.51, 0.45, 0.39 },
+
+  //  p n pi+ pi+ pi- (p n pi+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.12, 0.26,
+     0.7,  1.6,  2.4,  2.6,  2.3,  2.0,  1.8,  1.6,  1.4,  1.2 },
+
+  //  p n pi+ pi0 pi0 (p n pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.04, 0.08,
+     0.21, 0.48, 0.72, 0.78, 0.69, 0.6,  0.54, 0.48, 0.42, 0.36 },
+
+  //  n n pi+ pi+ pi0 (p p pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.04,
+     0.24, 0.66, 1.08, 1.44, 1.44, 1.32, 1.2,  1.0,  0.9,  0.78 },
+
+  //  p L K+ pi+ pi- (n L K0 pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.05, 0.04, 0.04, 0.03, 0.02 },
+
+  //  p L K+ pi0 pi0 (n L K0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.02, 0.02, 0.01 },
+
+  //  p L K0 pi+ pi0 (n L K+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.04, 0.04, 0.03, 0.03, 0.02 },
+
+  //  p S0 K+ pi+ pi- (n S0 K0 pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  p S0 K+ pi0 pi0 (n S0 K0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p S0 K0 pi+ pi0 (n S0 K+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  p S+ K0 pi+ pi- (n S- K+ pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  p S+ K0 pi0 pi0 (n S- K+ pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.02, 0.01, 0.01, 0.01, 0.01 },
+
+  //  p S+ K+ pi- pi0 (n S- K0 pi+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  p S- K+ pi+ pi0 (n S+ K0 pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  p S- K0 pi+ pi+ (n S+ K+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  n L K+ pi+ pi0 (p L K0 pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.04, 0.03, 0.02, 0.02, 0.01 },
+
+  //  n L K0 pi+ pi+ (p L K+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.04, 0.03, 0.02, 0.02, 0.01 },
+
+  //  n S0 K+ pi+ pi0 (p S0 K0 pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S0 K0 pi+ pi+ (p S0 K+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S+ K0 pi+ pi0 (p S- K+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S+ K+ pi+ pi- (p S- K0 pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.04, 0.03, 0.02, 0.02, 0.01 },
+
+  //  n S+ K+ pi0 pi0 (p S- K0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  n S- K+ pi+ pi+ (p S+ K0 pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01 },
+
+  //  p p pi+ K0 K- (n n pi- K+ K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.04, 0.06, 0.04, 0.04, 0.03 },
+
+  //  p p pi- K+ K0bar (n n pi+ K0 K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  p p pi0 K0 K0bar (n n pi0 K+ K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.04, 0.06, 0.05, 0.04, 0.03 },
+
+  //  p p pi0 K+ K- (n n pi0 K0 K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.04, 0.06, 0.05, 0.04, 0.03 },
+
+  //  p n pi+ K0 K0bar (p n pi- K+ K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.06, 0.05, 0.03, 0.02, 0.02 },
+
+  //  p n pi+ K+ K- (p n pi- K0 K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.06, 0.05, 0.03, 0.02, 0.02 },
+
+  //  p n pi0 K+ K0bar (p n pi0 K0 K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02 },
+
+  //  n n pi+ K+ K0bar (p p pi- K0 K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.02, 0.04, 0.03, 0.03, 0.02, 0.02 },
+  //
+  // multiplicity 6 (7 channels)
+  //
+  //  p p pi+ pi+ pi- pi- (n n pi+ pi+ pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.06, 0.1,  0.18, 0.38, 0.49, 0.46, 0.43, 0.40, 0.38, 0.36 },
+
+  //  p p pi+ pi- pi0 pi0 (n n pi+ pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+
+  //  p p pi0 pi0 pi0 pi0 (n n pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.01, 0.02, 0.05, 0.1,  0.13, 0.12, 0.11, 0.1,  0.1,  0.09 },
+
+  //  p n pi+ pi+ pi- pi0 (p n pi+ pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.06, 0.1,  0.18, 0.38, 0.49, 0.46, 0.43, 0.40, 0.38, 0.36 },
+
+  //  p n pi+ pi0 pi0 pi0 (p n pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+
+  //  n n pi+ pi+ pi+ pi- (p p pi+ pi- pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+
+  //  n n pi+ pi+ pi0 pi0 (p p pi- pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.09, 0.19, 0.25, 0.23, 0.22, 0.2,  0.19, 0.18 },
+  //
+  // multiplicity 7 (8 channels)
+  //
+  //  p p pi+ pi+ pi- pi- pi0 (n n pi+ pi+ pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.06, 0.17, 0.5,  0.7,  0.7,  0.69, 0.66, 0.62 },
+
+  //  p p pi+ pi- pi0 pi0 pi0 (n n pi+ pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.04, 0.1, 0.30, 0.42, 0.42, 0.42, 0.40, 0.37 },
+
+  //  p p pi0 pi0 pi0 pi0 pi0 (n n pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.05, 0.14, 0.20, 0.22, 0.20, 0.19, 0.18 },
+
+  //  p n pi+ pi+ pi+ pi- pi- (p n pi+ pi+ pi- pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.06, 0.19, 0.31, 0.41, 0.44, 0.47, 0.45, 0.45 },
+
+  //  p n pi+ pi+ pi- pi0 pi0 (p n pi+ pi- pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.04, 0.12, 0.18, 0.24, 0.26, 0.23, 0.28, 0.26 },
+
+  //  p n pi+ pi0 pi0 pi0 pi0 (p n pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.02, 0.06, 0.08, 0.12, 0.13, 0.14, 0.13, 0.13 },
+
+  //  n n pi+ pi+ pi+ pi- pi0 (p p pi+ pi- pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.06, 0.17, 0.5,  0.7,  0.7,  0.69, 0.66, 0.62 },
+
+  //  n n pi+ pi+ pi0 pi0 pi0 (p p pi- pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.04, 0.1, 0.30, 0.42, 0.42, 0.41, 0.40, 0.37 },
+  //
+  // multiplicity 8 (10 channels)
+  //
+  //  p p pi+ pi+ pi+ pi- pi- pi- (n n pi+ pi+ pi+ pi- pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  p p pi+ pi+ pi- pi- pi0 pi0 (n n pi+ pi+ pi- pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  p p pi+ pi- pi0 pi0 pi0 pi0 (n n pi+ pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.04, 0.12, 0.15, 0.18, 0.15, 0.15 },
+
+  //  p p pi0 pi0 pi0 pi0 pi0 pi0 (n n pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.02, 0.06, 0.09, 0.12, 0.09, 0.09 },
+
+  //  p n pi+ pi+ pi+ pi- pi- pi0 (p n pi+ pi+ pi- pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  p n pi+ pi+ pi- pi0 pi0 pi0 (p n pi+ pi- pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.04, 0.12, 0.15, 0.18, 0.15, 0.15 },
+
+  //  p n pi+ pi0 pi0 pi0 pi0 pi0 (p n pi- pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.06, 0.09, 0.12, 0.09, 0.09 },
+
+  //  n n pi+ pi+ pi+ pi+ pi- pi- (p p pi+ pi+ pi- pi- pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.08, 0.18, 0.27, 0.30, 0.27, 0.24 },
+
+  //  n n pi+ pi+ pi+ pi- pi0 pi0 (p p pi+ pi- pi- pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.04, 0.12, 0.15, 0.18, 0.15, 0.15 },
+
+  //  n n pi+ pi+ pi0 pi0 pi0 pi0 (p p pi- pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.06, 0.09, 0.12, 0.09, 0.09 },
+  //
+  // multiplicity 9 (11 channels)
+  //
+  //  p p pi+ pi+ pi+ pi- pi- pi- pi0 (n n pi+ pi+ pi+ pi- pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.07, 0.11, 0.14, 0.15, 0.15, 0.15 },
+
+  //  p p pi+ pi+ pi- pi- pi0 pi0 pi0 (n n pi+ pi+ pi- pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.06, 0.09, 0.11, 0.12, 0.12, 0.12 },
+
+  //  p p pi+ pi- pi0 pi0 pi0 pi0 pi0 (n n pi+ pi- pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.04, 0.06, 0.07, 0.07, 0.07, 0.07 },
+
+  //  p p pi0 pi0 pi0 pi0 pi0 pi0 pi0 (n n pi0 pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.03, 0.04, 0.04, 0.04, 0.04 },
+
+  //  p n pi+ pi+ pi+ pi+ pi- pi- pi- (p n pi+ pi+ pi+ pi- pi- pi- pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.06, 0.15, 0.19, 0.22, 0.22, 0.22 },
+
+  //  p n pi+ pi+ pi+ pi- pi- pi0 pi0 (p n pi+ pi+ pi- pi- pi- pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.03, 0.08, 0.20, 0.25, 0.29, 0.29, 0.29 },
+
+  //  p n pi+ pi+ pi- pi0 pi0 pi0 pi0 (p n pi+ pi- pi- pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.05, 0.12, 0.15, 0.17, 0.17, 0.17 },
+
+  //  p n pi+ pi0 pi0 pi0 pi0 pi0 pi0 (p n pi- pi0 pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.07, 0.09, 0.10, 0.10, 0.10 },
+
+  //  n n pi+ pi+ pi+ pi+ pi- pi- pi0 (p p pi+ pi+ pi- pi- pi- pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.06, 0.15, 0.19, 0.22, 0.22, 0.22 },
+
+  //  n n pi+ pi+ pi+ pi- pi0 pi0 pi0 (p p pi+ pi- pi- pi- pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.01, 0.02, 0.05, 0.12, 0.15, 0.17, 0.17, 0.17 },
+
+  //  n n pi+ pi- pi0 pi0 pi0 pi0 pi0 (p p pi+ pi- pi0 pi0 pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.01, 0.03, 0.07, 0.09 ,0.10, 0.10, 0.10 }};
+}
+
+// Initialize both |T Tz> = |1 +-1> channels, using p-p cross-section table
+
+G4CascadePPChannelData::data_t
+G4CascadePPChannelData::data(pp2bfs, pp3bfs, pp4bfs, pp5bfs, pp6bfs, pp7bfs,
+			     pp8bfs, pp9bfs, ppCrossSections, ppTotXSec);
+
+G4CascadeNNChannelData::data_t
+G4CascadeNNChannelData::data(nn2bfs, nn3bfs, nn4bfs, nn5bfs, nn6bfs, nn7bfs,
+			     nn8bfs, nn9bfs, ppCrossSections, ppTotXSec);
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT31piNChannel.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT31piNChannel.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT31piNChannel.cc	(revision 1316)
@@ -0,0 +1,696 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeT31piNChannel.cc,v 1.1 2010/05/14 21:05:03 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadePiMinusPChannel.hh"
+#include "G4CascadePiPlusNChannel.hh"
+#include "G4InuclParticleNames.hh"
+using namespace G4InuclParticleNames;
+
+namespace {
+  // pi- p : Outgoing particle types of a given multiplicity
+  static const G4int pimP2bfs[5][2] =
+  {{pim,pro}, {pi0,neu}, {k0,lam}, {k0,s0}, {kpl,sm}};
+
+  static const G4int pimP3bfs[13][3] =
+  {{pim,pro,pi0}, {pim,neu,pip}, {pi0,neu,pi0}, {pi0,lam,k0}, 
+    {pim,lam,kpl},  {pip,sm,k0},   {pi0,sm,kpl},   {pim,sp,k0},
+    {pim,s0,kpl},   {pi0,s0,k0},   {kmi,pro,k0},   {kmi,neu,kpl},
+    {k0b,neu,k0}};
+
+  static const G4int pimP4bfs[22][4] =
+  {{pim,pro,pip,pim}, {pim,pro,pi0,pi0}, {pim,neu,pip,pi0},
+    {pi0,neu,pi0,pi0}, {pim,lam,k0,pip},  {pi0,lam,k0,pi0},
+    {pim,lam,kpl,pi0},  {pim,s0,k0,pip},   {pi0,s0,k0,pi0},
+    {pim,s0,kpl,pi0},   {pim,sp,kpl,pim},   {pim,sp,k0,pi0},
+    {pim,sm,kpl,pip},   {pi0,sm,kpl,pi0},   {pip,sm,k0,pi0},
+    {pim,pro,kpl,kmi},   {pim,pro,k0,k0b},  {pi0,pro,k0,kmi},
+    {pip,neu,k0,kmi},   {pi0,neu,k0,k0b},  {pi0,neu,kpl,kmi},
+    {pim,neu,kpl,k0b}};
+
+  static const G4int pimP5bfs[31][5] =
+  {{pim,pro,pip,pim,pi0}, {pim,pro,pi0,pi0,pi0}, {pim,neu,pip,pip,pim},
+    {pim,neu,pip,pi0,pi0}, {pi0,neu,pi0,pi0,pi0}, {pim,lam,k0,pip,pi0},
+    {pim,lam,kpl,pi0,pi0},  {pim,lam,kpl,pip,pim},  {pi0,lam,k0,pi0,pi0},
+    {pim,s0,kpl,pip,pim},   {pim,s0,kpl,pi0,pi0},   {pim,s0,k0,pip,pi0},
+    {pi0,s0,k0,pi0,pi0},   {pim,sp,k0,pip,pim},   {pim,sp,k0,pi0,pi0},
+    {pim,sp,kpl,pim,pi0},   {pim,sm,k0,pip,pip},   {pip,sm,k0,pi0,pi0},
+    {pim,sm,kpl,pip,pi0},   {pi0,sm,kpl,pi0,pi0},   {pim,pro,pi0,kpl,kmi},
+    {pim,pro,pi0,k0,k0b},  {pim,pro,pip,k0,kmi},   {pi0,pro,pi0,k0,kmi},
+    {pim,pro,pim,kpl,k0b},  {pim,neu,pip,kpl,kmi},   {pim,neu,pip,k0,k0b},
+    {pip,neu,pi0,k0,kmi},   {pim,neu,pi0,kpl,k0b},  {pi0,neu,pi0,k0,k0b},
+    {pi0,neu,pi0,kpl,kmi}}; 
+
+  static const G4int pimP6bfs[6][6] =
+  {{pim,pro,pip,pip,pim,pim}, {pim,pro,pip,pim,pi0,pi0},
+    {pim,pro,pi0,pi0,pi0,pi0}, {pim,neu,pip,pip,pim,pi0},
+    {pim,neu,pip,pi0,pi0,pi0}, {pi0,neu,pi0,pi0,pi0,pi0}};
+
+  static const G4int pimP7bfs[7][7] =
+  {{pim,pro,pip,pip,pim,pim,pi0}, {pim,pro,pip,pim,pi0,pi0,pi0},
+    {pim,pro,pi0,pi0,pi0,pi0,pi0}, {pim,neu,pip,pip,pip,pim,pim},
+    {pim,neu,pip,pip,pim,pi0,pi0}, {pim,neu,pip,pi0,pi0,pi0,pi0},
+    {pi0,neu,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int pimP8bfs[8][8] =
+  {{pim,pro,pip,pip,pip,pim,pim,pim}, {pim,pro,pip,pip,pim,pim,pi0,pi0},
+    {pim,pro,pip,pim,pi0,pi0,pi0,pi0}, {pim,pro,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pi0,neu,pi0,pi0,pi0,pi0,pi0,pi0}, {pim,neu,pip,pi0,pi0,pi0,pi0,pi0},
+    {pim,neu,pip,pip,pim,pi0,pi0,pi0}, {pim,neu,pip,pip,pip,pim,pim,pi0}};
+
+  static const G4int pimP9bfs[9][9] =
+  {{pim,pro,pip,pip,pip,pim,pim,pim,pi0}, {pim,pro,pip,pip,pim,pim,pi0,pi0,pi0},
+    {pim,pro,pip,pim,pi0,pi0,pi0,pi0,pi0}, {pim,pro,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pi0,neu,pi0,pi0,pi0,pi0,pi0,pi0,pi0}, {pim,neu,pip,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pim,neu,pip,pip,pim,pi0,pi0,pi0,pi0}, {pim,neu,pip,pip,pip,pim,pim,pi0,pi0},
+    {pim,neu,pip,pip,pip,pip,pim,pim,pim}};
+}
+
+namespace {
+  // pi+ n : Outgoing particle types of a given multiplicity
+  static const G4int pipN2bfs[5][2] =
+   {{pip,neu}, {pi0,pro}, {kpl,lam}, {kpl,s0}, {k0,sp}};
+
+  static const G4int pipN3bfs[13][3] =
+   {{pip,neu,pi0}, {pip,pro,pim}, {pi0,pro,pi0}, {pi0,lam,kpl},
+    {pip,lam,k0},  {pim,sp,kpl},   {pi0,sp,k0},   {pip,sm,kpl},
+    {pip,s0,k0},   {pi0,s0,kpl},   {k0b,neu,kpl},  {k0b,pro,k0},
+    {kmi,pro,kpl}};
+
+  static const G4int pipN4bfs[22][4] =
+   {{pip,neu,pip,pim},  {pip,neu,pi0,pi0}, {pip,pro,pim,pi0},
+    {pi0,pro,pi0,pi0},  {pip,lam,kpl,pim},  {pi0,lam,kpl,pi0},
+    {pip,lam,k0,pi0},   {pip,s0,kpl,pim},   {pi0,s0,kpl,pi0},
+    {pip,s0,k0,pi0},    {pip,sm,k0,pip},   {pip,sm,kpl,pi0},
+    {pip,sp,k0,pim},    {pi0,sp,k0,pi0},   {pim,sp,kpl,pi0},
+    {pip,neu,k0,k0b},   {pip,neu,kpl,kmi},   {pi0,neu,kpl,k0b},
+    {pim,pro,kpl,k0b},   {pi0,pro,kpl,kmi},   {pi0,pro,k0,k0b},
+    {pip,pro,k0,kmi}};
+
+  static const G4int pipN5bfs[31][5] =
+   {{pip,neu,pip,pim,pi0}, {pip,neu,pi0,pi0,pi0}, {pip,pro,pip,pim,pim},
+    {pip,pro,pim,pi0,pi0}, {pi0,pro,pi0,pi0,pi0}, {pip,lam,kpl,pim,pi0},
+    {pip,lam,k0,pi0,pi0},  {pip,lam,k0,pip,pim},  {pi0,lam,kpl,pi0,pi0},
+    {pip,s0,k0,pip,pim},   {pip,s0,k0,pi0,pi0},   {pip,s0,kpl,pim,pi0},
+    {pi0,s0,kpl,pi0,pi0},   {pip,sm,kpl,pip,pim},   {pip,sm,kpl,pi0,pi0},
+    {pip,sm,k0,pip,pi0},   {pip,sp,kpl,pim,pim},   {pim,sp,kpl,pi0,pi0},
+    {pip,sp,k0,pim,pi0},   {pi0,sp,k0,pi0,pi0},   {pip,neu,pi0,k0,k0b},
+    {pip,neu,pi0,kpl,kmi},   {pip,neu,pim,kpl,k0b},  {pi0,neu,pi0,kpl,k0b},
+    {pip,neu,pip,k0,kmi},   {pip,pro,pim,k0,k0b},  {pip,pro,pim,kpl,kmi},
+    {pim,pro,pi0,kpl,k0b},  {pip,pro,pi0,k0,kmi},   {pi0,pro,pi0,kpl,kmi},
+    {pi0,pro,pi0,k0,k0b}};
+
+  static const G4int pipN6bfs[6][6] =
+   {{pip,neu,pip,pip,pim,pim}, {pip,neu,pip,pim,pi0,pi0},
+    {pip,neu,pi0,pi0,pi0,pi0}, {pip,pro,pip,pim,pim,pi0},
+    {pip,pro,pim,pi0,pi0,pi0}, {pi0,pro,pi0,pi0,pi0,pi0}};
+
+  static const G4int pipN7bfs[7][7] =
+   {{pip,neu,pip,pip,pim,pim,pi0}, {pip,neu,pip,pim,pi0,pi0,pi0},
+    {pip,neu,pi0,pi0,pi0,pi0,pi0}, {pip,pro,pip,pip,pim,pim,pim},
+    {pip,pro,pip,pim,pim,pi0,pi0}, {pip,pro,pim,pi0,pi0,pi0,pi0},
+    {pi0,pro,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int pipN8bfs[8][8] =
+   {{pip,neu,pip,pip,pip,pim,pim,pim}, {pip,neu,pip,pip,pim,pim,pi0,pi0},
+    {pip,neu,pip,pim,pi0,pi0,pi0,pi0}, {pip,neu,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pi0,pro,pi0,pi0,pi0,pi0,pi0,pi0}, {pip,pro,pim,pi0,pi0,pi0,pi0,pi0},
+    {pip,pro,pip,pim,pim,pi0,pi0,pi0}, {pip,pro,pip,pip,pim,pim,pim,pi0}};
+
+  static const G4int pipN9bfs[9][9] =
+   {{pip,neu,pip,pip,pip,pim,pim,pim,pi0}, {pip,neu,pip,pip,pim,pim,pi0,pi0,pi0},
+    {pip,neu,pip,pim,pi0,pi0,pi0,pi0,pi0}, {pip,neu,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pi0,pro,pi0,pi0,pi0,pi0,pi0,pi0,pi0}, {pip,pro,pim,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pip,pro,pip,pim,pim,pi0,pi0,pi0,pi0}, {pip,pro,pip,pip,pim,pim,pim,pi0,pi0},
+    {pip,pro,pip,pip,pip,pim,pim,pim,pim}};
+}
+
+namespace {
+  // Total pi- p cross section as a function of kinetic energy
+  // New cs values after 9B tuning (27 July 09)
+  static const G4double pimPtotXSec[30] = 
+   { 6.13,  6.4,   6.67,  6.94,  7.22,  7.5,   8.3,  12.0,  14.4,  24.0,
+    46.0,  72.04, 43.02, 27.19, 27.32, 43.8,  37.08, 51.37, 34.21, 34.79,
+    32.08, 31.19, 30.32, 28.5,  27.0,  25.9,  25.5,  25.2,  25.0,  24.8};
+
+  // pi- p cross sections as functions of kinetic energy and multiplicity
+  const G4double pimPCrossSections[101][30] = {
+  //
+  // multiplicity 2 (5 channels)
+  //
+  //  pi- p (pi+ n)
+   { 1.43, 1.5,  1.57, 1.64, 1.72,  1.8,   2.0,   3.0,  3.4,  7.0,
+    14.0, 24.0, 14.7, 10.5, 10.84, 21.0,  13.97, 25.1, 10.46, 9.88,
+     8.0,  7.1,  6.0,  5.7,  5.0,   4.6,   4.3,   4.0,  3.8,  3.7},
+
+  //  n pi0  (p pi0)
+   { 4.7,  4.9,  5.1,  5.3,  5.5,  5.7,  6.3,  9.0, 11.0, 17.0,
+    32.0, 48.0, 28.0, 14.5, 11.04, 8.99, 4.79, 5.02, 2.08, 0.94,
+     0.5,  0.25, 0.15, 0.09, 0.06, 0.05, 0.04, 0.02, 0.02, 0.01},
+
+  //  L K0  (L K+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.65, 0.29, 0.17,
+     0.13, 0.08, 0.05, 0.03, 0.02, 0.01, 0.01, 0.01, 0.01, 0.0},
+
+  //  S0 K0  (S0 K+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.28, 0.19, 0.12,
+     0.09, 0.06, 0.04, 0.03, 0.02, 0.01, 0.01, 0.0,  0.0,  0.0},
+
+  //  S- K+  (S+ K0)
+   { 0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.20, 0.25, 0.09,
+     0.04, 0.01, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0},
+  //
+  // multiplicity 3 (13 channels)
+  //
+  //  p pi- pi0  (n pi+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.05, 0.18, 0.86, 3.89, 5.19, 6.63, 5.11, 4.03,
+     3.2,  2.5,  2.0,  1.4,  0.97, 0.68, 0.55, 0.36, 0.3,  0.22},
+
+  //  n pi+ pi-  (p pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.03, 0.19, 1.41, 3.12, 6.2,  8.14, 8.23, 7.84, 5.91,
+     4.58, 3.58, 2.71, 1.73, 1.06, 0.85, 0.62, 0.38, 0.31, 0.22},
+
+  //  n pi0 pi0  (p pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.01, 0.08, 0.6,  1.34, 2.7,  2.99, 2.51, 1.35, 0.87,
+     0.61, 0.24, 0.15, 0.10, 0.06, 0.04, 0.0,  0.0,  0.0,  0.0},
+
+  //  L K0 pi0  (L K+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.05, 0.19,
+     0.14, 0.09, 0.07, 0.05, 0.03, 0.02, 0.02, 0.01, 0.01, 0.0},
+ 
+  //  L K+ pi-  (L K0 pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.04, 0.12,
+     0.13, 0.11, 0.08, 0.06, 0.04, 0.02, 0.02, 0.01, 0.01, 0.0},
+
+  //  S- K0 pi+  (S+ K+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0, 0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0, 0.1,
+     0.13, 0.07, 0.03, 0.02, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0},
+
+  //  S- K+ pi0  (S+ K0 pi0)
+  {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.05,
+     0.05, 0.03, 0.02, 0.01, 0.01, 0.0, 0.0, 0.0,  0.0,  0.0},
+
+  //  S+ K0 pi-  (S- K+ pi+)
+  { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0, 0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0, 0.04,
+    0.06, 0.04, 0.02, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0},
+
+  //  S0 K+ pi-  (S0 K0 pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.04,
+     0.07, 0.04, 0.03, 0.02, 0.02, 0.01, 0.0, 0.0, 0.0, 0.0},
+
+  //  S0 K0 pi0  (S0 K+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.02, 0.09,
+     0.07, 0.05, 0.03, 0.02, 0.02, 0.01, 0.01, 0.0, 0.0,  0.0},
+
+  //  p K0 K-  (n K+ K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.03,
+     0.08, 0.07, 0.05, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  n K+ K-  (p K0 K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.04,
+     0.11, 0.28, 0.12, 0.07, 0.04, 0.02, 0.01, 0.0,  0.0,  0.0},
+
+  //  n K0 K0bar  (p K+ K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.06,
+     0.10, 0.15, 0.18, 0.10, 0.05, 0.02, 0.01, 0.0,  0.0,  0.0},
+  //
+  // multiplicity 4 (22 channels)
+  //
+  //  p pi+ pi- pi-  (n pi+ pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.01, 0.04, 0.18, 0.43, 0.82, 1.69,
+     1.8,  1.99, 1.8,  1.71, 1.44, 1.26, 1.17, 0.99, 1.04, 0.9},
+
+  //  p pi- pi0 pi0  (n pi+ pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0, 0.01, 0.03, 0.09, 0.21, 1.5,  2.5,
+     1.2,  1.2,  1.0,  0.9, 0.8,  0.7,  0.65, 0.6,  0.55, 0.5},
+
+  //  n pi+ pi- pi0  (p pi+ pi- pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.4,  0.7,  1.11, 2.6,  3.9,
+     4.07, 3.8, 2.76, 1.38, 1.16, 0.97, 0.85, 0.7,  0.55, 0.4},
+
+  //  n pi0 pi0 pi0  (p pi0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.1,  0.55, 1.0, 0.87, 0.73, 0.71,
+     0.7,  0.56, 0.35, 0.29, 0.21, 0.14, 0.1, 0.06, 0.03, 0.0},
+
+  //  L K0 pi+ pi-  (L K+ pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.08, 0.12, 0.09, 0.08, 0.07, 0.05, 0.05, 0.04, 0.03, 0.03},
+
+  //  L K0 pi0 pi0  (L K+ pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.08, 0.12, 0.09, 0.08, 0.07, 0.05, 0.05, 0.04, 0.03, 0.03},
+
+  //  L K+ pi- pi0  (L K0 pi+ pi0)
+   { 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.06, 0.1, 0.09, 0.07, 0.06, 0.05, 0.04, 0.03, 0.02, 0.02},
+
+  //  S0 K0 pi+ pi-  (S0 K+ pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.04, 0.06, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02, 0.01, 0.01},
+
+  //  S0 K0 pi0 pi0  (S0 K+ pi0 pi0)
+  {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.04, 0.06, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02, 0.01, 0.01},
+
+  //  S0 K+ pi- pi0  (S0 K0 pi+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  S+ K+ pi- pi-  (S- K0 pi+ pi+)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  S+ K0 pi- pi0  (S- K+ pi+ pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  S- K+ pi+ pi-  (S+ K0 pi+ pi-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  S- K+ pi0 pi0  (S+ K0 pi0 pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  S- K0 pi+ pi0  (S+ K+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+     0.03, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01},
+
+  //  p pi- K+ K-  (n pi+ K0 K0bar)
+   { 0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.06, 0.1, 0.09, 0.08, 0.07, 0.07, 0.06, 0.06, 0.05},
+
+  //  p pi- K0 K0bar  (n pi+ K+ K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.07, 0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05},
+
+  //  p pi0 K0 K-  (n pi0 K+ K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.07, 0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05},
+
+  //  n pi+ K0 K-  (p pi- K+ K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.07, 0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05},
+
+  //  n pi0 K0 K0bar  (p pi0 K+ K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.07, 0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05},
+
+  //  n pi0 K+ K-  (p pi0 K0 K0bar)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.07, 0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05},
+
+  //  n pi- K+ K0bar  (p pi+ K0 K-)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.03, 0.05, 0.07, 0.06, 0.06, 0.06, 0.06, 0.05, 0.05, 0.05},
+  //
+  // multiplicity 5 (31 channels)
+  //
+  //  p pi+ pi- pi- pi0  (n pi+ pi+ pi- pi0)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.02, 0.10, 0.93,
+     1.5,  1.9,  2.2,  2.0,  1.7,  1.4,  1.2,  0.90, 0.76, 0.62},
+
+  //  p pi- pi0 pi0 pi0  (n pi+ pi0 pi0 pi0)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.02, 0.10, 0.73,
+      1.4,  1.9,  2.2,  2.0,  1.7,  1.4,  1.2,  0.90, 0.76, 0.62},
+
+  //  n pi+ pi+ pi- pi-  (p pi+ pi+ pi- pi-)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.01, 0.03, 0.10, 0.31,
+      0.66, 0.93, 1.2,  1.2,  1.2, 0.94, 0.74, 0.53, 0.40, 0.30},
+
+  //  n pi+ pi- pi0 pi0  (p pi+ pi- pi0 pi0)
+   {  0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.01, 0.22, 0.4,
+      0.8,  0.95, 1.0, 0.9, 0.75, 0.65, 0.55, 0.40, 0.35, 0.30},
+
+  //  n pi0 pi0 pi0 pi0  (p pi0 pi0 pi0 pi0)
+   {  0.0,  0.0, 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0, 0.0, 0.0, 0.0, 0.0,  0.0,  0.01, 0.22, 0.39,
+      0.66, 0.9, 1.0, 0.8, 0.7, 0.55, 0.5,  0.35, 0.30, 0.25},
+
+  //  L K0 pi+ pi- pi0  (L K+ pi+ pi- pi0)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.01, 0.05, 0.07, 0.08, 0.08, 0.07, 0.06, 0.06, 0.05, 0.05},
+
+  //  L K+ pi- pi0 pi0  (L K0 pi+ pi0 pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.02, 0.03, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+
+  //  L K+ pi+ pi- pi-  (L K0 pi+ pi+ pi-)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.03, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02, 0.02},
+
+  //  L K0 pi0 pi0 pi0  (L K+ pi0 pi0 pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  S0 K+ pi+ pi- pi-  (S0 K0 pi+ pi+ pi-)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0},
+
+  //  S0 K+ pi- pi0 pi0  (S0 K0 pi+ pi0 pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0},
+
+  //  S0 K0 pi+ pi- pi0  (S0 K+ pi+ pi- pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.02, 0.03, 0.04, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02},
+
+  //  S0 K0 pi0 pi0 pi0  (S0 K+ pi0 pi0 pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.01, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  S+ K0 pi+ pi- pi-  (S- K+ pi+ pi+ pi-)
+   {  0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.0, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0},
+
+  //  S+ K0 pi- pi0 pi0  (S- K+ pi+ pi0 pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0},
+
+  //  S+ K+ pi- pi- pi0  (S- K0 pi+ pi+ pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+      0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0},
+
+  //  S- K0 pi+ pi+ pi-  (S+ K+ pi+ pi- pi-)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,
+      0.0, 0.01, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0},
+
+  //  S- K0 pi+ pi0 pi0  (S+ K+ pi- pi0 pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,
+      0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0},
+
+  //  S- K+ pi+ pi- pi0  (S+ K0 pi+ pi- pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01},
+
+  //  S- K+ pi0 pi0 pi0  (S+ K0 pi0 pi0 pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0},
+
+  //  p pi- pi0 K+ K-  (n pi+ pi0 K0 K0bar)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.07, 0.07, 0.06, 0.06, 0.05, 0.05, 0.04, 0.04},
+
+  //  p pi- pi0 K0 K0bar  (n pi+ pi0 K+ K-)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.02, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  p pi+ pi- K0 K-  (n pi+ pi- K+ K0bar)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.02, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  p pi0 pi0 K0 K-  (n pi0 pi0 K+ K0bar)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.02, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  p pi- pi- K+ K0bar  (n pi+ pi+ K0 K-)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.04, 0.05, 0.04, 0.04, 0.03, 0.03, 0.03, 0.02},
+
+  //  n pi+ pi- K+ K-  (p pi+ pi- K0 K0bar)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.07, 0.06, 0.05, 0.04, 0.04, 0.03, 0.03, 0.03},
+
+  //  n pi+ pi- K0 K0bar  (p pi+ pi- K+ K-)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+
+  //  n pi+ pi0 K0 K-  (p pi- pi0 K+ K0bar)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.07, 0.06, 0.05, 0.04, 0.04, 0.04, 0.03, 0.03},
+
+  //  n pi- pi0 K+ K0bar  (p pi+ pi0 K0 K-)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.07, 0.06, 0.05, 0.04, 0.04, 0.04, 0.03, 0.03},
+
+  //  n pi0 pi0 K0 K0bar  (p pi0 pi0 K+ K-)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+
+  //  n pi0 pi0 K+ K-  (p pi0 pi0 K0 K0bar)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+  //
+  // multiplicity 6 (6 channels)
+  //
+  //  p pi+ pi+ pi- pi- pi-  (n pi+ pi+ pi+ pi- pi-)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.01, 0.03, 0.04,
+      0.06, 0.12, 0.16, 0.22, 0.31, 0.34, 0.3, 0.24, 0.19, 0.16},
+
+  //  p pi+ pi- pi- pi0 pi0  (n pi+ pi+ pi- pi0 pi0)
+   {  0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.01, 0.02, 0.05,
+      0.07, 0.1, 0.12, 0.15, 0.18, 0.2, 0.19, 0.2,  0.17, 0.16},
+
+  //  p pi- pi0 pi0 pi0 pi0  (n pi+ pi0 pi0 pi0 pi0)
+   {  0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.01, 0.02, 0.05,
+      0.07, 0.1, 0.12, 0.15, 0.18, 0.2, 0.19, 0.2,  0.17, 0.16},
+
+  //  n pi+ pi+ pi- pi- pi0  (p pi+ pi+ pi- pi- pi0)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.01, 0.02, 0.05,
+      0.07, 0.1,  0.12, 0.15, 0.18, 0.2, 0.19, 0.2,  0.17, 0.16},
+
+  //  n pi+ pi- pi0 pi0 pi0  (p pi+ pi- pi0 pi0 pi0)
+   {  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.01, 0.03,
+      0.05, 0.06, 0.08, 0.1, 0.12, 0.13, 0.14, 0.13, 0.11, 0.11},
+
+  //  n pi0 pi0 pi0 pi0 pi0  (p pi0 pi0 pi0 pi0 pi0)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0, 0.0, 0.01, 0.03,
+      0.04, 0.05, 0.06, 0.08, 0.09, 0.1, 0.1, 0.1, 0.08, 0.07},
+  //
+  // multiplicity 7 (7 channels)
+  //
+  //  p pi+ pi+ pi- pi- pi- pi0
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.03,
+      0.05, 0.12, 0.19, 0.37, 0.67, 0.70, 0.65, 0.60, 0.50, 0.45},
+
+  //  p pi+ pi- pi- pi0 pi0 pi0
+   {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.01, 0.02,
+      0.03, 0.07, 0.11, 0.22, 0.4, 0.4,  0.35, 0.30, 0.25, 0.2},
+
+  //  p pi- pi0 pi0 pi0 pi0 pi0
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.01,
+      0.02, 0.03, 0.05, 0.11, 0.20, 0.2, 0.15, 0.12, 0.10, 0.08},
+
+  //  n pi+ pi+ pi+ pi- pi- pi-   (measured R 501)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+      0.01, 0.03, 0.06, 0.15, 0.29, 0.29, 0.24, 0.18, 0.16, 0.13},
+
+  //  n pi+ pi+ pi- pi- pi0 pi0   (measured R 496)
+   {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0, 0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0, 0.01, 0.02,
+      0.03, 0.07, 0.11, 0.22, 0.4, 0.45, 0.4,  0.4, 0.3,  0.3},
+
+  //  n pi+ pi- pi0 pi0 pi0 pi0
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01,
+      0.02, 0.04, 0.07, 0.14, 0.26, 0.26, 0.22, 0.20, 0.18, 0.15},
+
+  //  n pi0 pi0 pi0 pi0 pi0 pi0
+   {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0, 0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0, 0.0,  0.0,
+      0.01, 0.02, 0.03, 0.05, 0.1, 0.11, 0.1, 0.1, 0.08, 0.7},
+  //
+  // multiplicity 8 (8 channels)
+  //
+  //  p pi+ pi+ pi+ pi- pi- pi- pi-  (n pi+ pi+ pi+ pi+ pi- pi- pi-) (measured R 420)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.06, 0.09, 0.11, 0.11, 0.10, 0.10, 0.09},
+
+  //  p pi+ pi+ pi- pi- pi- pi0 pi0  (n pi+ pi+ pi+ pi- pi- pi0 pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.03, 0.09, 0.13, 0.13, 0.11, 0.10, 0.09, 0.08},
+
+  //  p pi+ pi- pi- pi0 pi0 pi0 pi0  (n pi+ pi+ pi- pi0 pi0 pi0 pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.06, 0.09, 0.11, 0.11, 0.10, 0.10, 0.09},
+
+  //  p pi- pi0 pi0 pi0 pi0 pi0 pi0  (n pi+ pi0 pi0 pi0 pi0 pi0 pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.01, 0.02, 0.03, 0.04, 0.04, 0.03, 0.03, 0.03},
+
+  //  n pi0 pi0 pi0 pi0 pi0 pi0 pi0  (p pi0 pi0 pi0 pi0 pi0 pi0 pi0)
+   {  0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0, 0.01, 0.02, 0.03, 0.03, 0.03, 0.03, 0.02},
+
+  //  n pi+ pi- pi0 pi0 pi0 pi0 pi0  (p pi+ pi- pi0 pi0 pi0 pi0 pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.01, 0.03, 0.04, 0.05, 0.05, 0.05, 0.05, 0.04},
+
+  //  n pi+ pi+ pi- pi- pi0 pi0 pi0  (p pi+ pi+ pi- pi- pi0 pi0 pi0)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.06, 0.09, 0.11, 0.11, 0.10, 0.10, 0.09 },
+
+  //  n pi+ pi+ pi+ pi- pi- pi- pi0  (p pi+ pi+ pi+ pi- pi- pi- pi0)
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.03, 0.09, 0.12, 0.13, 0.11, 0.09, 0.08, 0.07},
+  //
+  // multiplicity 9 (9 channels)
+  //
+  //  p pi+ pi+ pi+ pi- pi- pi- pi- pi0   (measured R 418)
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.04, 0.08, 0.14, 0.18, 0.18, 0.18, 0.17},
+
+  //  p pi+ pi+ pi- pi- pi- pi0 pi0 pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.02, 0.05, 0.08, 0.11, 0.11, 0.11, 0.1},
+
+  //  p pi+ pi- pi- pi0 pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.02, 0.03, 0.06, 0.07, 0.07, 0.07, 0.07},
+
+  //  p pi- pi0 pi0 pi0 pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.02, 0.03, 0.04, 0.04, 0.04, 0.04},
+
+  //  n pi0 pi0 pi0 pi0 pi0 pi0 pi0 pi0 
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.02, 0.03, 0.04, 0.04, 0.04, 0.04},
+
+  //  n pi+ pi- pi0 pi0 pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.02, 0.03, 0.04, 0.04, 0.04, 0.04},
+
+  //  n pi+ pi+ pi- pi- pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.02, 0.03, 0.06, 0.07, 0.07, 0.07, 0.07},
+
+  //  n pi+ pi+ pi+ pi- pi- pi- pi0 pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.02, 0.05, 0.08, 0.11, 0.11, 0.11, 0.1},
+
+  //  n pi+ pi+ pi+ pi+ pi- pi- pi- pi-   (measured R 503)
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.04, 0.08, 0.14, 0.18, 0.18, 0.18, 0.17} };
+ }
+
+// Initialize both |T Tz> = |3/2 1/2> channels, using pipP cross-section table
+
+G4CascadePiMinusPChannelData::data_t
+G4CascadePiMinusPChannelData::data(pimP2bfs, pimP3bfs, pimP4bfs,
+				   pimP5bfs, pimP6bfs, pimP7bfs,
+				   pimP8bfs, pimP9bfs, pimPCrossSections,
+				   pimPtotXSec);
+
+G4CascadePiPlusNChannelData::data_t
+G4CascadePiPlusNChannelData::data(pipN2bfs, pipN3bfs, pipN4bfs,
+				  pipN5bfs, pipN6bfs, pipN7bfs,
+				  pipN8bfs, pipN9bfs, pimPCrossSections,
+				  pimPtotXSec);
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT33piNChannel.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT33piNChannel.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4CascadeT33piNChannel.cc	(revision 1316)
@@ -0,0 +1,543 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4CascadeT33piNChannel.cc,v 1.1 2010/05/14 21:05:03 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4CascadePiPlusPChannel.hh"
+#include "G4CascadePiMinusNChannel.hh"
+#include "G4InuclParticleNames.hh"
+using namespace G4InuclParticleNames;
+
+namespace {
+  // pi+ p : Outgoing particle types of a given multiplicity
+
+  static const G4int pipP2bfs[2][2] =
+   {{pip,pro}, {kpl,sp}};
+
+  static const G4int pipP3bfs[7][3] =
+   {{pip,pro,pi0}, {pip,neu,pip}, {pi0,sp,kpl}, {pip,sp,k0}, 
+    {pip,s0,kpl},   {pip,lam,kpl},  {kpl,pro,k0b}};
+
+  static const G4int pipP4bfs[15][4] =
+   {{pip,pro,pip,pim},{pip,pro,pi0,pi0},{pip,neu,pip,pi0},
+    {pip,sp,kpl,pim},  {pi0,sp,kpl,pi0},  {pip,sp,k0,pi0},
+    {pip,s0,k0,pip},  {pip,s0,kpl,pi0},  {pip,lam,kpl,pi0},
+    {pip,lam,k0,pip}, {pip,sm,kpl,pip},  {pip,pro,kpl,kmi},
+    {pip,pro,k0,k0b}, {pi0,pro,kpl,k0b}, {pip,neu,kpl,k0b}};
+
+  static const G4int pipP5bfs[24][5] =
+   {{pip,pro,pip,pim,pi0}, {pip,pro,pi0,pi0,pi0}, {pip,neu,pip,pip,pim},
+    {pip,neu,pip,pi0,pi0}, {pip,sp,kpl,pim,pi0},   {pi0,sp,kpl,pi0,pi0},
+    {pip,sp,k0,pip,pim},   {pip,sp,k0,pi0,pi0},   {pip,lam,k0,pip,pi0},
+    {pip,lam,kpl,pip,pim},  {pip,lam,kpl,pi0,pi0},  {pip,s0,kpl,pip,pim},
+    {pip,s0,kpl,pi0,pi0},   {pip,s0,k0,pip,pi0},   {pip,sm,kpl,pip,pi0},
+    {pip,sm,k0,pip,pip},   {pip,pro,pim,kpl,k0b},  {pip,pro,pip,k0,kmi},
+    {pip,pro,pi0,kpl,kmi},   {pip,pro,pi0,k0,k0b},  {pi0,pro,pi0,kpl,k0b},
+    {pip,neu,pip,kpl,kmi},   {pip,neu,pip,k0,k0b},  {pip,neu,pi0,kpl,k0b}};
+
+  static const G4int pipP6bfs[5][6] =
+   {{pip,pro,pip,pip,pim,pim}, {pip,pro,pip,pim,pi0,pi0},
+    {pip,pro,pi0,pi0,pi0,pi0}, {pip,neu,pip,pi0,pi0,pi0},
+    {pip,neu,pip,pip,pim,pi0}};
+
+  static const G4int pipP7bfs[6][7] =
+   {{pip,pro,pip,pip,pim,pim,pi0}, {pip,pro,pip,pim,pi0,pi0,pi0},
+    {pip,pro,pi0,pi0,pi0,pi0,pi0}, {pip,neu,pip,pip,pip,pim,pim},
+    {pip,neu,pip,pip,pim,pi0,pi0}, {pip,neu,pip,pi0,pi0,pi0,pi0}};
+
+  static const G4int pipP8bfs[7][8] =
+   {{pim,neu,pip,pip,pip,pim,pim,pim}, {pim,neu,pip,pip,pim,pim,pi0,pi0},
+    {pim,neu,pip,pim,pi0,pi0,pi0,pi0}, {pim,neu,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pim,pro,pip,pip,pim,pim,pim,pi0}, {pim,pro,pip,pim,pim,pi0,pi0,pi0},
+    {pim,pro,pim,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int pipP9bfs[8][9] =
+   {{pip,pro,pip,pip,pip,pim,pim,pim,pi0}, {pip,pro,pip,pip,pim,pim,pi0,pi0,pi0},
+    {pip,pro,pip,pim,pi0,pi0,pi0,pi0,pi0}, {pip,pro,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pip,neu,pip,pip,pip,pip,pim,pim,pim}, {pip,neu,pip,pip,pip,pim,pim,pi0,pi0},
+    {pip,neu,pip,pip,pim,pi0,pi0,pi0,pi0}, {pip,neu,pip,pi0,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // pi- n : Outgoing particle types of a given multiplicity
+
+  static const G4int pimN2bfs[2][2] =
+   {{pim,neu}, {k0,sm}};
+
+  static const G4int pimN3bfs[7][3] =
+   {{pim,neu,pi0}, {pim,pro,pim}, {pi0,sm,k0}, {pim,sm,kpl},
+    {pim,s0,k0},   {pim,lam,k0},  {k0,neu,kmi}};
+
+  static const G4int pimN4bfs[15][4] =
+   {{pim,neu,pip,pim},{pim,neu,pi0,pi0},{pim,pro,pim,pi0},
+    {pim,sm,k0,pip},  {pi0,sm,k0,pi0},  {pim,sm,kpl,pi0},
+    {pim,s0,kpl,pim},  {pim,s0,k0,pi0},  {pim,lam,k0,pi0},
+    {pim,lam,kpl,pim}, {pim,sp,k0,pim},  {pim,neu,k0,k0b},
+    {pim,neu,kpl,kmi},  {pi0,neu,k0,kmi},  {pim,pro,k0,kmi}};
+
+  static const G4int pimN5bfs[24][5] =
+   {{pim,neu,pip,pim,pi0}, {pim,neu,pi0,pi0,pi0}, {pim,pro,pip,pim,pim},
+    {pim,pro,pim,pi0,pi0}, {pim,sm,k0,pip,pi0},   {pi0,sm,k0,pi0,pi0},
+    {pim,sm,kpl,pip,pim},   {pim,sm,kpl,pi0,pi0},   {pim,lam,kpl,pim,pi0},
+    {pim,lam,k0,pip,pim},  {pim,lam,k0,pi0,pi0},  {pim,s0,k0,pip,pim},
+    {pim,s0,k0,pi0,pi0},   {pim,s0,kpl,pim,pi0},   {pim,sp,k0,pim,pi0},
+    {pim,sp,kpl,pim,pim},   {pim,neu,pip,k0,kmi},   {pim,neu,pim,kpl,k0b},
+    {pim,neu,pi0,k0,k0b},  {pim,neu,pi0,kpl,kmi},   {pi0,neu,pi0,k0,kmi},
+    {pim,pro,pim,k0,k0b},  {pim,pro,pim,kpl,kmi},   {pim,pro,pi0,k0,kmi}};
+
+  static const G4int pimN6bfs[5][6] =
+   {{pim,neu,pip,pip,pim,pim}, {pim,neu,pip,pim,pi0,pi0},
+    {pim,neu,pi0,pi0,pi0,pi0}, {pim,pro,pim,pi0,pi0,pi0},
+    {pim,pro,pip,pim,pim,pi0}};
+
+  static const G4int pimN7bfs[6][7] =
+   {{pim,neu,pip,pip,pim,pim,pi0}, {pim,neu,pip,pim,pi0,pi0,pi0},
+    {pim,neu,pi0,pi0,pi0,pi0,pi0}, {pim,pro,pip,pip,pim,pim,pim},
+    {pim,pro,pip,pim,pim,pi0,pi0}, {pim,pro,pim,pi0,pi0,pi0,pi0}};
+
+  static const G4int pimN8bfs[7][8] =
+   {{pip,pro,pip,pip,pip,pim,pim,pim}, {pip,pro,pip,pip,pim,pim,pi0,pi0},
+    {pip,pro,pip,pim,pi0,pi0,pi0,pi0}, {pip,pro,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pip,neu,pip,pip,pip,pim,pim,pi0}, {pip,neu,pip,pip,pim,pi0,pi0,pi0},
+    {pip,neu,pip,pi0,pi0,pi0,pi0,pi0}};
+
+  static const G4int pimN9bfs[8][9] =
+   {{pim,neu,pip,pip,pip,pim,pim,pim,pi0}, {pim,neu,pip,pip,pim,pim,pi0,pi0,pi0},
+    {pim,neu,pip,pim,pi0,pi0,pi0,pi0,pi0}, {pim,neu,pi0,pi0,pi0,pi0,pi0,pi0,pi0},
+    {pim,pro,pip,pip,pip,pim,pim,pim,pim}, {pim,pro,pip,pip,pim,pim,pim,pi0,pi0},
+    {pim,pro,pip,pim,pim,pi0,pi0,pi0,pi0}, {pim,pro,pim,pi0,pi0,pi0,pi0,pi0,pi0}};
+}
+
+namespace {
+  // Total pi+ p cross sections as a function of kinetic energy
+  // New cs after 9-body tuning (27 July 09)
+  static const G4double pipPtotXSec[30] = 
+   {  0.0,   1.2,   2.5,   3.8,   5.0,  7.0,   9.0,  15.0, 30.0,  64.0,
+    130.0, 190.0, 130.0,  56.0,  28.0, 17.14, 19.28, 27.4, 40.05, 32.52,
+     30.46, 29.0,  27.26, 25.84, 25.5, 24.5,  24.0,  23.5, 23.0,  23.0};
+
+  // pi+ p cross sections as functions of kinetic energy and multiplicity
+  static const G4double pipPCrossSections[74][30] = {
+  //
+  // multiplicity 2 (2 channels)
+  //
+  //  p pi+ (n pi-)
+   {  0.0,   1.2,   2.5,  3.8,  5.0,  7.00, 9.00, 15.0,  30.0,  64.0,
+    130.0, 190.0, 130.0, 55.7, 27.2, 13.95, 8.38, 12.98, 18.53, 11.81,
+      9.4,   7.7,   6.8,  5.9,  5.3,  4.8,  4.2,   4.0,   3.80,  3.6},
+
+  //  S+ K+ (S- K0)
+   {  0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.16, 0.62, 0.34,
+      0.25, 0.2, 0.1, 0.05, 0.04, 0.02, 0.02, 0.01, 0.01, 0.01},
+  //
+  // multiplicity 3 (7 channels)
+  //
+  //  p pi+ pi0 (n pi- pi0)
+   {  0.0, 0.0, 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,   0.0,  0.0,
+      0.0, 0.0, 0.0,  0.2,  0.6, 2.39, 8.67, 9.99, 12.36, 6.66,
+      4.4, 2.6, 1.95, 1.15, 0.8, 0.6,  0.41, 0.31,  0.24, 0.15},
+
+  //  n pi+ pi+ (p pi- pi-)
+   {  0.0, 0.0, 0.0, 0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0, 0.1, 0.20, 0.6, 1.48, 2.30, 3.71, 3.22,
+      2.7, 2.1, 1.5, 1.0, 0.74, 0.5, 0.38, 0.27, 0.20, 0.15},
+
+  //  S+ K+ pi0 (S- K0 pi0)
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.13,
+      0.15, 0.12, 0.09, 0.06, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  //  S+ K0 pi+
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.13,
+      0.15, 0.12, 0.09, 0.06, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  //  S0 K+ pi+
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.13,
+      0.15, 0.12, 0.09, 0.06, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  //  L K+ pi+
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.01, 0.13,
+      0.15, 0.12, 0.09, 0.06, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01},
+
+  //  p K+ K0bar
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.04,
+      0.07, 0.05, 0.04, 0.04, 0.03, 0.02, 0.02, 0.01, 0.01, 0.01},
+  //
+  // multiplicity 4 (15 channels)
+  //
+  //  p pi+ pi+ pi-
+   {  0.0, 0.0, 0.0,  0.0, 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0, 0.0,  0.06, 0.2, 0.78, 2.26, 3.43,
+      3.9, 3.3, 2.85, 2.4, 2.16, 1.7,  1.4, 1.20, 1.00, 0.90},
+
+  //  p pi+ pi0 pi0
+   {  0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0, 0.0,  0.0,  0.0,  0.03, 0.08, 0.15, 1.03, 2.16,
+      2.2, 1.7, 1.15, 0.55, 0.41, 0.33, 0.24, 0.19, 0.14, 0.09},
+
+  //  n pi+ pi+ pi0
+   {  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0, 0.0,  0.0, 0.0,  0.11, 0.45, 0.95, 1.06, 1.51,
+      1.65, 1.5, 1.12, 0.7, 0.43, 0.24, 0.11, 0.05, 0.02, 0.01},
+
+  //  S+ K+ pi+ pi-
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.05, 0.13, 0.09, 0.06, 0.03, 0.02, 0.01, 0.01, 0.0},
+
+  //  S+ K+ pi0 pi0
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.05, 0.13, 0.09, 0.06, 0.03, 0.02, 0.01, 0.01, 0.0},
+
+  //  S+ K0 pi+ pi0
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.02, 0.06, 0.07, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.01},
+
+  //  S0 K0 pi+ pi+
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+  //  S0 K+ pi+ pi0
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.01, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+  //  L K+ pi+ pi0
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.02, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01},
+
+  //  L K0 pi+ pi+
+   {  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0, 0.02, 0.05, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.01},
+
+  //  S- K+ pi+ pi+
+   {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+      0.02, 0.16, 0.18, 0.14, 0.1, 0.06, 0.04, 0.03, 0.03, 0.02},
+
+  //  p pi+ K+ K-
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.02, 0.13, 0.11, 0.10, 0.08, 0.07, 0.06, 0.05, 0.05, 0.04},
+
+  //  p pi+ K0 K0bar
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.01, 0.06, 0.15, 0.14, 0.11, 0.09, 0.07, 0.05, 0.05, 0.04},
+
+  //  p pi0 K+ K0bar
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.01, 0.05, 0.09, 0.08, 0.08, 0.07, 0.06, 0.05, 0.05, 0.04},
+
+  //  n pi+ K+ K0bar
+   {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+      0.01, 0.05, 0.07, 0.06, 0.06, 0.05, 0.04, 0.03, 0.03, 0.02},
+  //
+  // multiplicity 5 (24 channels)
+  //
+  //  p pi+ pi+ pi- pi0
+   { 0.0,  0.0, 0.0, 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0, 0.0, 0.0,  0.0,  0.0, 0.0,  0.05, 0.31, 2.14,
+     3.45, 4.4, 3.5, 2.62, 2.20, 1.8, 1.40, 1.10, 0.89, 0.70},
+
+  //  p pi+ pi0 pi0 pi0
+   { 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.03, 0.21,
+     0.34, 0.55, 0.4, 0.29, 0.23, 0.18, 0.14, 0.11, 0.09, 0.07},
+
+  //  n pi+ pi+ pi+ pi-
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.01, 0.02, 0.05, 0.20,
+     0.4, 0.7, 0.99, 0.92, 0.75, 0.58, 0.42, 0.31, 0.24, 0.18},
+
+  //  n pi+ pi+ pi0 pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.01, 0.02, 0.05, 0.20,
+     0.4, 0.8, 0.99, 0.92, 0.75, 0.58, 0.42, 0.31, 0.24, 0.18},
+
+  //  S+ K+ pi+ pi- pi0
+   { 0.0, 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.02, 0.05, 0.1, 0.08, 0.06, 0.05, 0.04, 0.04, 0.03},
+
+  //  S+ K+ pi0 pi0 pi0
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02, 0.01},
+
+  //  S+ K0 pi+ pi+ pi-
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.04, 0.04, 0.03, 0.02, 0.02, 0.02, 0.01},
+
+  //  S+ K0 pi+ pi0 pi0
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.04, 0.04, 0.03, 0.02, 0.02, 0.02, 0.01},
+
+  //  L K0 pi+ pi+ pi0
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.04, 0.05, 0.06, 0.05, 0.05, 0.04, 0.04, 0.03},
+
+  //  L K+ pi+ pi+ pi-
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.04, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02},
+
+  //  L K+ pi+ pi0 pi0
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.04, 0.05, 0.04, 0.04, 0.03, 0.03, 0.02},
+
+  //  S0 K+ pi+ pi+ pi-
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+  //  S0 K+ pi+ pi0 pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+  //  S0 K0 pi+ pi+ pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01},
+
+  //  S- K+ pi+ pi+ pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  S- K0 pi+ pi+ pi+
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.02, 0.03, 0.02, 0.02, 0.02, 0.01, 0.01, 0.01},
+
+  //  p pi+ pi- K+ K0bar
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.02, 0.06, 0.08, 0.07, 0.06, 0.05, 0.05, 0.04},
+
+  //  p pi+ pi+ K0 K-
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.02, 0.04, 0.05, 0.05, 0.04, 0.03, 0.03, 0.03},
+
+  //  p pi+ pi0 K+ K-
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.02, 0.06, 0.06, 0.05, 0.05, 0.04, 0.04, 0.03, 0.03},
+ 
+  //  p pi+ pi0 K0 K0bar
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.04, 0.05, 0.05, 0.04, 0.04, 0.04, 0.03, 0.03},
+
+  //  p pi0 pi0 K+ K0bar
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.03, 0.04, 0.04, 0.03, 0.03, 0.02, 0.02},
+
+  //  n pi+ pi+ K+ K-
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.02, 0.06, 0.05, 0.04, 0.04, 0.04, 0.03, 0.03, 0.02},
+
+  //  n pi+ pi+ K0 K0bar
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+
+  //  n pi+ pi0 K+ K0bar
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.04, 0.03, 0.03, 0.02, 0.02, 0.02, 0.02, 0.01},
+  //
+  // multiplicity 6 (5 channels)
+  //
+  //  p pi+ pi+ pi+ pi- pi-
+   { 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.02,
+     0.09, 0.27, 0.35, 0.42, 0.5, 0.44, 0.4, 0.32, 0.29, 0.23},
+
+  //  p pi+ pi+ pi- pi0 pi0
+   { 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.02,
+     0.09, 0.27, 0.35, 0.42, 0.5, 0.44, 0.4, 0.32, 0.29, 0.23},
+
+  //  p pi+ pi0 pi0 pi0 pi0
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.02, 0.04, 0.06, 0.08, 0.09, 0.08, 0.08, 0.07, 0.06, 0.05},
+
+  //  n pi+ pi+ pi0 pi0 pi0
+   { 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.02,
+     0.09, 0.27, 0.35, 0.42, 0.5, 0.44, 0.4, 0.32, 0.29, 0.23},
+
+  //  n pi+ pi+ pi+ pi- pi0
+   { 0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.02,
+     0.09, 0.27, 0.35, 0.42, 0.5, 0.44, 0.4, 0.32, 0.29, 0.23},
+//
+// multiplicity 7 (6 channels)
+//
+//  p pi+ pi+ pi+ pi- pi- pi0   (measured R 363)
+ {  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.02, 0.25, 0.5, 1.00, 0.97, 0.96, 0.9, 0.84, 0.78, 0.72},
+
+//  p pi+ pi+ pi- pi0 pi0 pi0
+ {  0.0,  0.0,  0.0, 0.0,  0.0, 0.0, 0.0, 0.0,  0.0, 0.0,
+    0.0,  0.0,  0.0, 0.0,  0.0, 0.0, 0.0, 0.0,  0.0, 0.0,
+    0.02, 0.25, 0.5, 0.95, 1.0, 0.9, 0.8, 0.75, 0.7, 0.65},
+
+//  p pi+ pi0 pi0 pi0 pi0 pi0
+ {  0.0, 0.0,  0.0, 0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0, 0.0,  0.0, 0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0, 0.04, 0.1, 0.24, 0.3, 0.23, 0.2, 0.18, 0.16, 0.14},
+
+//  n pi+ pi+ pi+ pi+ pi- pi-
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.01, 0.04, 0.08, 0.13, 0.24, 0.32, 0.3, 0.26, 0.24, 0.22},
+
+//  n pi+ pi+ pi+ pi- pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.01, 0.04, 0.08, 0.13, 0.3, 0.25, 0.2, 0.18, 0.15, 0.12},
+
+//  n pi+ pi+ pi0 pi0 pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.01, 0.04, 0.08, 0.13, 0.26, 0.23, 0.2, 0.18, 0.15, 0.12},
+//
+// multiplicity 8 (7 channels)
+//
+//  p pi+ pi+ pi+ pi+ pi- pi- pi-  (measured R 386)
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.02, 0.03, 0.05, 0.08, 0.13, 0.17, 0.16, 0.15, 0.15, 0.14},
+
+//  p pi+ pi+ pi+ pi- pi- pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.03, 0.04, 0.07, 0.13, 0.15, 0.14, 0.12, 0.11, 0.10},
+
+//  p pi+ pi+ pi- pi0 pi0 pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.03, 0.05, 0.08, 0.13, 0.17, 0.16, 0.15, 0.15, 0.14},
+
+//  p pi+ pi0 pi0 pi0 pi0 pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.01, 0.02, 0.03, 0.04, 0.06, 0.08, 0.09, 0.08, 0.06, 0.07},
+
+//  n pi+ pi+ pi+ pi+ pi- pi- pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0, 0.0,  0.0,  0.0,
+    0.04, 0.07, 0.12, 0.19, 0.3, 0.42, 0.4, 0.36, 0.36, 0.32},
+
+//  n pi+ pi+ pi+ pi- pi0 pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,  0.0,  0.0,
+    0.04, 0.07, 0.12, 0.19, 0.3, 0.34, 0.32, 0.30, 0.28, 0.26},
+
+//  n pi+ pi+ pi0 pi0 pi0 pi0 pi0
+ {  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0, 0.0,  0.0,  0.0,
+    0.02, 0.03, 0.05, 0.10, 0.15, 0.21, 0.2, 0.18, 0.18, 0.16},
+  //
+  // multiplicity 9 (8 channels)
+  //
+  //  p pi+ pi+ pi+ pi+ pi- pi- pi- pi0  (measured R 383)
+   { 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.01, 0.02, 0.04, 0.07, 0.12, 0.19, 0.26, 0.36, 0.36, 0.36},
+
+  //  p pi+ pi+ pi+ pi- pi- pi0 pi0 pi0
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.04, 0.08, 0.13, 0.18, 0.24, 0.24, 0.24},
+
+  //  p pi+ pi+ pi- pi0 pi0 pi0 pi0 pi0
+   { 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.01, 0.02, 0.03, 0.05, 0.07, 0.10, 0.14, 0.14, 0.14},
+
+  //  p pi+ pi0 pi0 pi0 pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.02, 0.03, 0.04, 0.06, 0.09, 0.09, 0.09},
+
+  //  n pi+ pi+ pi+ pi+ pi+ pi- pi- pi-   (measured R 446 )
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.02, 0.03, 0.05, 0.08, 0.10, 0.15, 0.15, 0.15},
+
+  //  n pi+ pi+ pi+ pi+ pi- pi- pi0 pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.02, 0.03, 0.05, 0.06, 0.10, 0.10, 0.10},
+
+  //  n pi+ pi+ pi+ pi- pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.01, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.06},
+
+  //  n pi+ pi+ pi0 pi0 pi0 pi0 pi0 pi0
+   { 0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+     0.0, 0.0, 0.0, 0.01, 0.01, 0.02, 0.03, 0.04, 0.04, 0.04} };
+}
+
+// Initialize both |T Tz> = |3/2 3/2> channels, using pipP cross-section table
+
+G4CascadePiPlusPChannelData::data_t
+G4CascadePiPlusPChannelData::data(pipP2bfs, pipP3bfs, pipP4bfs,
+				  pipP5bfs, pipP6bfs, pipP7bfs,
+				  pipP8bfs, pipP9bfs, pipPCrossSections,
+				  pipPtotXSec);
+
+G4CascadePiMinusNChannelData::data_t
+G4CascadePiMinusNChannelData::data(pimN2bfs, pimN3bfs, pimN4bfs,
+				   pimN5bfs, pimN6bfs, pimN7bfs,
+				   pimN8bfs, pimN9bfs, pipPCrossSections,
+				   pipPtotXSec);
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4Dineutron.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4Dineutron.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4Dineutron.cc	(revision 1316)
@@ -0,0 +1,77 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4Dineutron.cc,v 1.4 2010/05/06 20:46:04 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// ------------------------------------------------------------
+//      Bertini Cascade dineutron class implementation file
+//
+//      History: first implementation, inspired by G4Proton
+//      17 Nov 2009:  Michael Kelsey
+//	06 Apr 2010:  Do G4Ions initialization in ctor.
+//	13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
+//	06 May 2010:  Remove created particle from master table.
+// ----------------------------------------------------------------
+
+#include "G4Dineutron.hh"
+
+#include "globals.hh"
+#include "G4ios.hh"
+#include "G4ParticleTable.hh"
+
+// ######################################################################
+// ###                          DINEUTRON                             ###
+// ######################################################################
+G4Dineutron* G4Dineutron::theInstance = 0;
+
+//    Arguments for constructor are as follows
+//               name             mass          width         charge
+//             2*spin           parity  C-conjugation
+//          2*Isospin       2*Isospin3       G-parity
+//               type    lepton number  baryon number   PDG encoding
+//             stable         lifetime    decay table
+G4Dineutron::G4Dineutron()
+  : G4VShortLivedParticle("dineutron",
+			  2.*neutron_mass_c2, 0.0*MeV, 0,
+			  2,       +1,       0,          
+			  2,       -2,       0,             
+			  "nucleus",        0,      +2, 0, /* ? 100000020 */
+			  true,       0.,    NULL) {}
+
+
+G4Dineutron* G4Dineutron::Definition() {
+  if (0 == theInstance) {
+    theInstance = new G4Dineutron;	// There can be only one
+
+    G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
+    pTable->Remove(theInstance);	// Make invisible to GEANT4
+  }
+
+  return theInstance;
+}
+
+// Simple call-throughs
+G4Dineutron* G4Dineutron::DineutronDefinition() { return Definition(); }
+G4Dineutron* G4Dineutron::Dineutron()           { return Definition(); }
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4Diproton.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4Diproton.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4Diproton.cc	(revision 1316)
@@ -0,0 +1,77 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4Diproton.cc,v 1.4 2010/05/06 20:46:04 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// ------------------------------------------------------------
+//      Bertini Cascade diproton class implementation file
+//
+//      History: first implementation, inspired by G4Diproton
+//      17 Nov 2009:  Michael Kelsey
+//	06 Apr 2010:  Do G4Ions initialization in ctor.
+//	13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
+//	06 May 2010:  Remove created particle from master table.
+// ----------------------------------------------------------------
+
+#include "G4Diproton.hh"
+
+#include "globals.hh"
+#include "G4ios.hh"
+#include "G4ParticleTable.hh"
+
+// ######################################################################
+// ###                          DIPROTON                              ###
+// ######################################################################
+G4Diproton* G4Diproton::theInstance = 0;
+
+//    Arguments for constructor are as follows
+//               name             mass          width         charge
+//             2*spin           parity  C-conjugation
+//          2*Isospin       2*Isospin3       G-parity
+//               type    lepton number  baryon number   PDG encoding
+//             stable         lifetime    decay table
+G4Diproton::G4Diproton()
+  : G4VShortLivedParticle("diproton",
+			  2.*proton_mass_c2, 0.0*MeV, +2.*eplus, 
+	            2,       +1,       0,          
+		    2,       +2,       0,             
+	    "nucleus",        0,      +2, 0, /* ? 100020020 */
+		 true,       0.,    NULL) {}
+
+
+G4Diproton* G4Diproton::Definition() {
+  if (0 == theInstance) {
+    theInstance = new G4Diproton;	// There can be only one
+
+    G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
+    pTable->Remove(theInstance);	// Make invisible to GEANT4
+  }
+
+  return theInstance;
+}
+
+// Simple call-throughs
+G4Diproton* G4Diproton::DiprotonDefinition() { return Definition(); }
+G4Diproton* G4Diproton::Diproton()           { return Definition(); }
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4InteractionCase.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4InteractionCase.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4InteractionCase.cc	(revision 1316)
@@ -0,0 +1,73 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4InteractionCase.cc,v 1.1 2010/05/21 20:43:54 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100518  M. Kelsey -- Move code from Colliders' "bulletTargetSetter()"
+//		to setBulletTarget().
+
+#include "G4InteractionCase.hh"
+#include "G4InuclParticle.hh"
+#include "G4InuclElementaryParticle.hh"
+#include "G4InuclNuclei.hh"
+
+
+// Evaluate concrete types of input particles and assign bullet, target
+
+void G4InteractionCase::set(G4InuclParticle* part1, 
+			    G4InuclParticle* part2) {
+  clear();		// Reset everything in case of failure
+
+  // See which one of the two (or both) is a nucleus
+  G4InuclNuclei* nucl1 = dynamic_cast<G4InuclNuclei*>(part1);
+  G4InuclNuclei* nucl2 = dynamic_cast<G4InuclNuclei*>(part2);
+
+  G4InuclElementaryParticle* had1 = dynamic_cast<G4InuclElementaryParticle*>(part1);
+  G4InuclElementaryParticle* had2 = dynamic_cast<G4InuclElementaryParticle*>(part2);
+
+  if (nucl1 && nucl2) { 	// Nuclear collision, lighter is projectile
+    inter_case = -2;
+    if (nucl2->getA() >= nucl1->getA()) {
+      bullet = part1;
+      target = part2;
+    } else {
+      bullet = part2;
+      target = part1;
+    } 
+  } else if (nucl1 || nucl2) {	// Hadron on nucleus, hadron projectile
+    inter_case = -1;
+    if (nucl1 && had2) {
+      bullet = part2;
+      target = part1;
+    } else {
+      bullet = part1;
+      target = part2;
+    }
+  } else if (had1 && had2) {	// Hadron-hadron interaction, order irrelevant
+    inter_case = had1->type() * had2->type();
+    bullet = part1;
+    target = part2;
+  }
+}
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclElementaryParticle.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclElementaryParticle.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclElementaryParticle.cc	(revision 1316)
@@ -0,0 +1,147 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4InuclElementaryParticle.cc,v 1.6 2010/04/29 19:39:55 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100428  M. Kelsey -- Use G4InuclParticleNames enums instead of numbers,
+//		add Omega and antinucleons.
+// 20100429  M. Kelsey -- Change "case gamma:" to "case photon:"
+
+#include "G4InuclElementaryParticle.hh"
+
+#include "G4ParticleDefinition.hh"
+#include "G4Proton.hh"
+#include "G4Neutron.hh"
+#include "G4PionPlus.hh"
+#include "G4PionMinus.hh"
+#include "G4PionZero.hh"
+#include "G4Gamma.hh"
+#include "G4KaonPlus.hh"
+#include "G4KaonMinus.hh"
+#include "G4KaonZero.hh"
+#include "G4AntiKaonZero.hh"
+#include "G4Lambda.hh"
+#include "G4SigmaPlus.hh"
+#include "G4SigmaZero.hh"
+#include "G4SigmaMinus.hh"
+#include "G4XiZero.hh"
+#include "G4XiMinus.hh"
+#include "G4OmegaMinus.hh"
+#include "G4AntiProton.hh"
+#include "G4AntiNeutron.hh"
+#include "G4Diproton.hh"
+#include "G4UnboundPN.hh"
+#include "G4Dineutron.hh"
+
+#include "G4InuclParticleNames.hh"
+using namespace G4InuclParticleNames;
+
+
+G4ParticleDefinition* 
+G4InuclElementaryParticle::makeDefinition(G4int ityp) {
+  switch(ityp) {
+  case proton:      return G4Proton::Definition(); break;
+  case neutron:     return G4Neutron::Definition(); break;
+  case pionPlus:    return G4PionPlus::Definition(); break;
+  case pionMinus:   return G4PionMinus::Definition(); break;
+  case pionZero:    return G4PionZero::Definition(); break;
+  case photon:      return G4Gamma::Definition(); break;
+  case kaonPlus:    return G4KaonPlus::Definition(); break;
+  case kaonMinus:   return G4KaonMinus::Definition(); break;
+  case kaonZero:    return G4KaonZero::Definition(); break;
+  case kaonZeroBar: return G4AntiKaonZero::Definition(); break;
+  case lambda:      return G4Lambda::Definition(); break;
+  case sigmaPlus:   return G4SigmaPlus::Definition(); break;
+  case sigmaZero:   return G4SigmaZero::Definition(); break;
+  case sigmaMinus:  return G4SigmaMinus::Definition(); break;
+  case xiZero:      return G4XiZero::Definition(); break;
+  case xiMinus:     return G4XiMinus::Definition(); break;
+  case omegaMinus:  return G4OmegaMinus::Definition(); break;
+  case antiProton:  return G4AntiProton::Definition(); break;
+  case antiNeutron: return G4AntiNeutron::Definition(); break;
+  case diproton:    return G4Diproton::Definition(); break;  // Bertini class!
+  case unboundPN:   return G4UnboundPN::Definition(); break; // Bertini class!
+  case dineutron:   return G4Dineutron::Definition(); break; // Bertini class!
+  default:
+    G4cerr << " uups, unknown particle type " << ityp << G4endl;
+  }
+  
+  return 0;
+}
+
+// This is the inverse mapping to makeDefinition above
+
+G4int G4InuclElementaryParticle::type(const G4ParticleDefinition *pd) {
+  if (pd == 0) return 0;
+  if (pd == G4Proton::Definition())       return proton;
+  if (pd == G4Neutron::Definition())      return neutron;
+  if (pd == G4PionPlus::Definition())     return pionPlus;
+  if (pd == G4PionMinus::Definition())    return pionMinus;
+  if (pd == G4PionZero::Definition())     return pionZero;
+  if (pd == G4Gamma::Definition())        return photon;
+  if (pd == G4KaonPlus::Definition())     return kaonPlus;
+  if (pd == G4KaonMinus::Definition())    return kaonMinus;
+  if (pd == G4KaonZero::Definition())     return kaonZero;
+  if (pd == G4AntiKaonZero::Definition()) return kaonZeroBar;
+  if (pd == G4Lambda::Definition())       return lambda;
+  if (pd == G4SigmaPlus::Definition())    return sigmaPlus;
+  if (pd == G4SigmaZero::Definition())    return sigmaZero;
+  if (pd == G4SigmaMinus::Definition())   return sigmaMinus;
+  if (pd == G4XiZero::Definition())       return xiZero;
+  if (pd == G4XiMinus::Definition())      return xiMinus;
+  if (pd == G4OmegaMinus::Definition())   return omegaMinus;
+  if (pd == G4AntiProton::Definition())   return antiProton;
+  if (pd == G4AntiNeutron::Definition())  return antiNeutron;
+  if (pd == G4Diproton::Definition())     return diproton;  // Bertini class!
+  if (pd == G4UnboundPN::Definition())    return unboundPN; // Bertini class!
+  if (pd == G4Dineutron::Definition())    return dineutron; // Bertini class!
+
+  G4cerr << " uups, unknown G4ParticleDefinition type" << G4endl;
+  return 0;
+}
+
+void G4InuclElementaryParticle::setType(G4int ityp) {
+  setDefinition(makeDefinition(ityp));
+}
+
+
+// Assignment operator for use with std::sort()
+G4InuclElementaryParticle& 
+G4InuclElementaryParticle::operator=(const G4InuclElementaryParticle& right) {
+  generation = right.generation;
+  G4InuclParticle::operator=(right);
+  return *this;
+}
+
+
+G4double G4InuclElementaryParticle::getStrangeness(G4int type) {
+  G4ParticleDefinition* pd = makeDefinition(type);
+  return pd ? (pd->GetQuarkContent(3) - pd->GetAntiQuarkContent(3)) : 0.;
+}
+
+G4double G4InuclElementaryParticle::getParticleMass(G4int type) {
+  G4ParticleDefinition* pd = makeDefinition(type);
+  return pd ? pd->GetPDGMass()*MeV/GeV : 0.0;	// From G4 to Bertini units
+}
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclNuclei.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclNuclei.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclNuclei.cc	(revision 1316)
@@ -0,0 +1,127 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4InuclNuclei.cc,v 1.8 2010/04/07 17:28:35 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100301  M. Kelsey -- Add function to create unphysical nuclei for use
+//	     as temporary final-state fragments.
+// 20100319  M. Kelsey -- Add information message to makeNuclearFragment().
+//	     Use new GetBindingEnergy() function instead of bindingEnergy().
+
+#include "G4InuclNuclei.hh"
+#include "G4InuclSpecialFunctions.hh"
+#include "G4Ions.hh"
+#include "G4ParticleDefinition.hh"
+#include "G4ParticleTable.hh"
+#include "G4HadTmpUtil.hh"
+#include "G4NucleiProperties.hh"
+#include <assert.h>
+#include <sstream>
+#include <map>
+
+using namespace G4InuclSpecialFunctions;
+
+
+// Convert nuclear configuration to standard GEANT4 pointer
+
+// WARNING:  Opposite conventions!  G4InuclNuclei uses (A,Z) everywhere, while
+//	  G4ParticleTable::GetIon() uses (Z,A)!
+
+G4ParticleDefinition* 
+G4InuclNuclei::makeDefinition(G4double a, G4double z, G4double exc) {
+  G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
+  G4ParticleDefinition *pd = pTable->GetIon(G4int(z), G4int(a), exc);
+
+  // SPECIAL CASE:  Non-physical nuclear fragment, for final-state return
+  if (!pd) pd = makeNuclearFragment(a,z,exc);
+
+  return pd;
+}
+
+// Creates a non-physical pseudo-nucleus, for return as final-state fragment
+// from G4IntraNuclearCascader
+
+G4ParticleDefinition* 
+G4InuclNuclei::makeNuclearFragment(G4double a, G4double z, G4double exc) {
+  G4int na=G4int(a), nz=G4int(z), nn=na-nz;	// # nucleon, proton, neutron
+
+  // See G4IonTable.hh::GetNucleusEncoding for explanation
+  G4int code = ((100+nz)*1000 + na)*10 + (exc>0.)?1:0;
+
+  // Use local lookup table (see G4IonTable.hh) to maintain singletons
+  // NOTE:  G4ParticleDefinitions don't need to be explicitly deleted
+  //        (see comments in G4IonTable.cc::~G4IonTable)
+  static std::map<G4int, G4ParticleDefinition*> fragmentList;
+
+  if (fragmentList.find(code) != fragmentList.end()) return fragmentList[code];
+
+  // Name string follows format in G4IonTable.cc::GetIonName(Z,A,E)
+  std::stringstream zstr, astr, estr;
+  zstr << nz;
+  astr << na;
+  estr << G4int(1000*exc+0.5);	// keV in integer form
+
+  G4String name = "Z" + zstr.str() + "A" + astr.str();
+  if (exc>0.) name += "["+estr.str()+"]";
+
+  // Simple minded mass calculation use constants in CLHEP (all in MeV)
+  G4double mass = nz*proton_mass_c2 + nn*neutron_mass_c2
+    + G4NucleiProperties::GetBindingEnergy(G4lrint(a),G4lrint(z)) + exc;
+
+  //    Arguments for constructor are as follows
+  //               name             mass          width         charge
+  //             2*spin           parity  C-conjugation
+  //          2*Isospin       2*Isospin3       G-parity
+  //               type    lepton number  baryon number   PDG encoding
+  //             stable         lifetime    decay table
+  //             shortlived      subType    anti_encoding Excitation-energy
+
+  G4cout << " >>> G4InuclNuclei creating temporary fragment for evaporation "
+	 << "with non-standard PDGencoding." << G4endl;
+
+  G4Ions* fragPD = new G4Ions(name,       mass, 0., z*eplus,
+			      0,          +1,   0,
+			      0,          0,    0,
+			      "nucleus",  0,    na, code,
+			      true,	  0.,   0,
+			      true, "generic",  0,  exc);
+  fragPD->SetAntiPDGEncoding(0);
+
+  fragmentList[code] = fragPD;		// Store in table for next lookup
+  return fragPD;
+}
+
+G4double G4InuclNuclei::getNucleiMass(G4double a, G4double z) {
+  G4ParticleDefinition* pd = makeDefinition(a,z);
+  return pd ? pd->GetPDGMass()*MeV/GeV : 0.;	// From G4 to Bertini units
+}
+
+// Assignment operator for use with std::sort()
+G4InuclNuclei& G4InuclNuclei::operator=(const G4InuclNuclei& right) {
+  exitationEnergy = right.exitationEnergy;
+  theExitonConfiguration = right.theExitonConfiguration;
+  G4InuclParticle::operator=(right);
+  return *this;
+}
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclParticle.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclParticle.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4InuclParticle.cc	(revision 1316)
@@ -0,0 +1,68 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4InuclParticle.cc,v 1.6 2010/04/09 19:33:11 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100409  M. Kelsey -- Drop unused string argument from ctors.
+
+#include "G4InuclParticle.hh"
+#include "G4ios.hh"
+#include <cmath>
+
+
+// WARNING!  Bertini code doesn't do four-vectors; repair mass before use!
+G4InuclParticle::G4InuclParticle(G4ParticleDefinition* pd,
+				 const G4LorentzVector& mom)
+  : modelId(0) {
+  setDefinition(pd);
+  setMomentum(mom);
+}
+
+
+// Assignment operator for use with std::sort()
+G4InuclParticle& G4InuclParticle::operator=(const G4InuclParticle& right) {
+  pDP = right.pDP;
+  modelId = right.modelId;
+
+  return *this;
+}
+
+// WARNING!  Bertini code doesn't do four-vectors; repair mass before use!
+void G4InuclParticle::setMomentum(const G4LorentzVector& mom) {
+  G4double mass = getMass();
+  if (std::fabs(mass-mom.m()) <= 1e-5) 
+    pDP.Set4Momentum(mom*GeV/MeV);		// From Bertini to G4 units
+  else
+    pDP.SetMomentum(mom.vect()*GeV/MeV);	// Don't change current mass!
+}
+
+
+void G4InuclParticle::printParticle() const {
+  G4LorentzVector mom = getMomentum();
+  G4cout << " px " << mom.px() << " py " << mom.py() << " pz " << mom.pz()
+	 << " pmod " << mom.rho() << " E " << mom.e()
+	 << " creator model " << modelId << G4endl;
+}
+
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4KaonHypSampler.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4KaonHypSampler.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4KaonHypSampler.cc	(revision 1316)
@@ -0,0 +1,40 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4KaonHypSampler.cc,v 1.1 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100512  M. Kelsey -- Replaces (old, untemplated) G4CascadeSampler
+
+#include "G4KaonHypSampler.hh"
+
+namespace {
+  static const G4double bins[31] = 
+    { 0.0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45,
+      0.5, 1.0,  1.5, 2.0,  2.5, 3.0,  3.5, 4.0,  4.5, 5.0,
+      5.5, 6.0,  6.5, 7.0,  7.5, 8.0,  8.5, 9.0,  9.5, 10.0, 15.0 };
+}
+
+// Define constructor for initialization
+G4KaonHypSampler::G4KaonHypSampler() : G4CascadeSampler<31,6>(bins) {}
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4NuclWatcher.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4NuclWatcher.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4NuclWatcher.cc	(revision 1316)
@@ -0,0 +1,200 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4NuclWatcher.cc,v 1.2 2010/04/07 18:23:15 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100202  M. Kelsey -- Move most code here from .hh file, clean up
+// 20100405  M. Kelsey -- Pass const-ref std::vector<>
+
+#include "G4NuclWatcher.hh"
+#include "globals.hh"
+
+#include <algorithm>
+#include <vector>
+#include <cmath>
+
+G4NuclWatcher::G4NuclWatcher(G4double z, 
+			     const std::vector<G4double>& expa, 
+			     const std::vector<G4double>& expcs, 
+			     const std::vector<G4double>& experr, 
+			     G4bool check, 
+			     G4bool nucl)
+  : nuclz(z), izotop_chsq(0.), average_ratio(0.), aver_rat_err(0.),
+    aver_lhood(0.), aver_matched(0.), exper_as(expa), exper_cs(expcs),
+    exper_err(experr), checkable(check), nucleable(nucl) {}
+
+void G4NuclWatcher::watch(G4double a, G4double z) {
+  const G4double small = 0.001;
+  
+  if (std::fabs(z-nuclz) >= small) return;
+
+  G4bool here = false;		// Increment specified nucleus count
+  G4int  simulatedAsSize = simulated_as.size();
+  for (G4int i = 0; i<simulatedAsSize && !true; i++) {
+    if (std::fabs(simulated_as[i] - a) < small) {
+      simulated_cs[i] += 1.0;
+      here = true;		// Terminates loop
+    }
+  }
+
+  if (!here) {			// Nothing found, so add new entry
+    simulated_as.push_back(a); 
+    simulated_cs.push_back(1.0); 
+  }
+}
+
+void G4NuclWatcher::setInuclCs(G4double csec, G4int nev) { 
+  G4int  simulatedAsSize = simulated_as.size();
+  for(G4int i = 0; i < simulatedAsSize ; i++) {
+    double err = std::sqrt(simulated_cs[i]) / simulated_cs[i];
+    
+    simulated_prob.push_back(simulated_cs[i] / nev);
+    simulated_cs[i] *= csec / nev;
+    simulated_errors.push_back(simulated_cs[i] * err);    
+  }
+}
+
+std::pair<G4double, G4double> G4NuclWatcher::getExpCs() const {
+  G4double cs = 0.0;
+  G4double err = 0.0;
+  
+  G4int experAsSize = exper_as.size();
+  for(G4int iz = 0; iz < experAsSize; iz++) {
+    cs += exper_cs[iz];
+    err += exper_err[iz];
+  }
+  
+  return std::pair<G4double, G4double>(cs, err);
+}
+
+std::pair<G4double, G4double> G4NuclWatcher::getInuclCs() const {
+  G4double cs = 0.0;
+  G4double err = 0.0;
+  G4int  simulatedAsSize = simulated_as.size();
+  for(G4int iz = 0; iz < simulatedAsSize; iz++) {
+    cs += simulated_cs[iz];
+    err += simulated_errors[iz];
+  }
+  
+  return std::pair<G4double, G4double>(cs, err);
+}
+
+void G4NuclWatcher::print() {
+  const G4double small = 0.001;
+  
+  G4cout << "\n ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
+	 << "\n **** izotop Z **** " << nuclz << G4endl;
+  
+  izotop_chsq = 0.0;
+  average_ratio = 0.0;
+  aver_rat_err = 0.0;
+  G4double exp_cs = 0.0;
+  G4double exp_cs_err = 0.0;
+  G4double inucl_cs = 0.0;
+  G4double inucl_cs_err = 0.0;
+  std::vector<G4bool> not_used(simulated_cs.size(), true);
+  G4int nmatched = exper_as.size();
+  G4int nused = simulated_cs.size();
+  G4double lhood = 0.0;
+  G4int experAsSize = exper_as.size();
+
+  for (G4int iz = 0; iz < experAsSize; iz++) {
+    G4double a = exper_as[iz];
+    
+    exp_cs += exper_cs[iz];
+    exp_cs_err += exper_err[iz];
+    
+    G4bool found = false;
+    G4int  simulatedAsSize = simulated_as.size();
+    for (G4int i = 0; i<simulatedAsSize && !found; i++) {
+      if (std::fabs(simulated_as[i] - a) < small) {
+	G4double rat = simulated_cs[i] / exper_cs[iz];
+	
+	lhood += std::log10(rat) * std::log10(rat);
+	
+	G4double rat_err
+	  = std::sqrt(simulated_errors[i]*simulated_errors[i] +
+		      exper_err[iz]*exper_err[iz] * rat*rat) / exper_cs[iz];
+	average_ratio += rat;
+	aver_rat_err += rat_err; 
+	
+	G4cout << " A " << a << " exp.cs " << exper_cs[iz] << " err " 
+	       << exper_err[iz] << G4endl << " sim. cs " << simulated_cs[i]
+	       << " err " << simulated_errors[i] << G4endl
+	       << " ratio " << rat << " err " << rat_err << G4endl
+	       << " simulated production rate " << simulated_prob[i] << G4endl;
+	
+	not_used[i] = false;
+	izotop_chsq += (rat - 1.0) * (rat - 1.0) / rat_err / rat_err; 
+	found = true;
+	nused--;
+      }
+    }
+
+    if (found) nmatched--;
+    else
+      G4cout << " not found exper.: A " << a << " exp.cs " << exper_cs[iz] 
+	     << " err " << exper_err[iz] << G4endl;
+  }
+  
+  G4cout << " not found in simulations " << nmatched << G4endl
+	 << " not found in exper: " << nused << G4endl;
+
+  G4int  simulatedAsSize = simulated_as.size();
+  for(G4int i = 0; i < simulatedAsSize; i++) {
+    inucl_cs += simulated_cs[i];
+    inucl_cs_err += simulated_errors[i];
+    
+    if(not_used[i]) 
+      G4cout << " extra simul.: A " << simulated_as[i] << " sim. cs "
+	     << simulated_cs[i] << " err " << simulated_errors[i] << G4endl;
+
+    G4cout << " simulated production rate " << simulated_prob[i] << G4endl;
+  }
+
+  G4int matched = exper_as.size() - nmatched;
+  
+  if (matched > 0) {
+    aver_lhood = lhood;
+    aver_matched = matched;    
+    lhood = std::pow(10.0, std::sqrt(lhood/matched));
+    
+    G4cout << " matched " << matched << " CHSQ " << std::sqrt(izotop_chsq) / matched
+	   << G4endl
+	   << " raw chsq " << izotop_chsq << G4endl
+	   << " average ratio " << average_ratio / matched 
+	   << " err " << aver_rat_err / matched << G4endl 
+	   << " lhood " << lhood << G4endl;
+  }
+  else {
+    izotop_chsq = 0.0;
+    aver_lhood = 0.0;    
+  } 
+  
+  G4cout << " exper. cs " << exp_cs << " err " << exp_cs_err << G4endl
+	 << " inucl. cs " << inucl_cs << " err " << inucl_cs_err << G4endl
+	 <<  " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ "
+	 << G4endl;
+}
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4PionNucSampler.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4PionNucSampler.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4PionNucSampler.cc	(revision 1316)
@@ -0,0 +1,40 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4PionNucSampler.cc,v 1.1 2010/05/15 00:55:01 mkelsey Exp $
+// GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $
+//
+// 20100512  M. Kelsey -- Replaces (old, untemplated) G4FinalStateSampler
+
+#include "G4PionNucSampler.hh"
+
+namespace {
+  static const G4double bins[30] = {
+  0.0,  0.01, 0.013, 0.018, 0.024, 0.032, 0.042, 0.056, 0.075, 0.1,
+  0.13, 0.18, 0.24,  0.32,  0.42,  0.56,  0.75,  1.0,   1.3,   1.8,
+  2.4,  3.2,  4.2,   5.6,   7.5,   10.0,  13.0,  18.0,  24.0, 32.0 };
+}
+
+// Define constructor for initialization
+G4PionNucSampler::G4PionNucSampler() : G4CascadeSampler<30,8>(bins) {}
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4UnboundPN.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4UnboundPN.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4UnboundPN.cc	(revision 1316)
@@ -0,0 +1,76 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4UnboundPN.cc,v 1.4 2010/05/06 20:46:04 mkelsey Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// ------------------------------------------------------------
+//      Bertini Cascade unboundPN class implementation file
+//
+//      History: first implementation, inspired by G4Proton
+//      17 Nov 2009:  Michael Kelsey
+//	06 Apr 2010:  Do G4Ions initialization in ctor.
+//	13 Apr 2010:  Per Kurashige, inherit from G4VShortLivedParticle.
+//	06 May 2010:  Remove created particle from master table.
+// ----------------------------------------------------------------
+
+#include "G4UnboundPN.hh"
+
+#include "globals.hh"
+#include "G4ios.hh"
+#include "G4ParticleTable.hh"
+
+// ######################################################################
+// ###                          UNBOUNDPN                             ###
+// ######################################################################
+G4UnboundPN* G4UnboundPN::theInstance = 0;
+
+//    Arguments for constructor are as follows
+//               name             mass          width         charge
+//             2*spin           parity  C-conjugation
+//          2*Isospin       2*Isospin3       G-parity
+//               type    lepton number  baryon number   PDG encoding
+//             stable         lifetime    decay table
+G4UnboundPN::G4UnboundPN()
+  : G4VShortLivedParticle("unboundPN",
+			  (proton_mass_c2+neutron_mass_c2), 0.0*MeV, +1.*eplus, 
+			  2,       +1,       0,          
+			  2,        0,       0,             
+			  "nucleus",        0,      +2, 0, /* ? 100010020 */
+			  true,       0.,    NULL) {}
+
+G4UnboundPN* G4UnboundPN::Definition() {
+  if (0 == theInstance) {
+    theInstance = new G4UnboundPN;	// There can be only one
+
+    G4ParticleTable* pTable = G4ParticleTable::GetParticleTable();
+    pTable->Remove(theInstance);	// Make invisible to GEANT4
+  }
+
+  return theInstance;
+}
+
+// Simple call-throughs
+G4UnboundPN* G4UnboundPN::UnboundPNDefinition() { return Definition(); }
+G4UnboundPN* G4UnboundPN::UnboundPN()           { return Definition(); }
Index: trunk/source/processes/hadronic/models/cascade/cascade/src/G4VCascadeCollider.cc
===================================================================
--- trunk/source/processes/hadronic/models/cascade/cascade/src/G4VCascadeCollider.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/cascade/cascade/src/G4VCascadeCollider.cc	(revision 1316)
@@ -0,0 +1,116 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+// $Id: G4VCascadeCollider.cc,v 1.1 2010/05/21 17:56:34 mkelsey Exp $
+// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
+
+#include "G4VCascadeCollider.hh"
+#include "G4HadTmpUtil.hh"
+#include "G4InteractionCase.hh"
+#include "G4InuclElementaryParticle.hh"
+#include "G4InuclNuclei.hh"
+#include "G4InuclSpecialFunctions.hh"
+#include "G4NucleiProperties.hh"
+#include "G4ios.hh"
+
+using namespace G4InuclSpecialFunctions;
+
+
+// Constructor handles verbose announcement
+
+G4VCascadeCollider::G4VCascadeCollider(const char* name, G4int verbose)
+  : theName(name), verboseLevel(verbose) {
+  if (verbose > 3) G4cout << " >>> " << theName << " ctor " << G4endl;
+}
+
+
+// Both bullet and target must be hadrons or leptons for this to work
+
+G4bool G4VCascadeCollider::useEPCollider(G4InuclParticle* bullet, 
+					 G4InuclParticle* target) const {
+  return (dynamic_cast<G4InuclElementaryParticle*>(bullet) &&
+	  dynamic_cast<G4InuclElementaryParticle*>(target));
+}
+
+
+// Decide wether nuclear fragment is candidate for G4BigBanger
+
+G4bool G4VCascadeCollider::explosion(G4InuclNuclei* target) const {
+  if (verboseLevel > 3) {
+    G4cout << " >>> " << theName << "::explosion" << G4endl;
+  }
+
+  const G4double a_cut = 20.0;
+  const G4double be_cut = 3.0;
+
+  G4double a = target->getA();
+  G4double z = target->getZ();
+  G4double eexs = target->getExitationEnergy();
+
+  // Only small fragments with high excitations can explode
+  G4bool explo = ((a <= a_cut) && 
+		  (eexs >= be_cut * G4NucleiProperties::GetBindingEnergy(G4lrint(a), G4lrint(z)))
+		  );
+
+  return explo;
+}
+
+
+// Decide whether bullet-target interaction is candidate for cascade
+
+G4bool 
+G4VCascadeCollider::inelasticInteractionPossible(G4InuclParticle* bullet,
+						 G4InuclParticle* target, 
+						 G4double ekin) const {
+  if (verboseLevel > 3) {
+    G4cout << " >>> " << theName << "::inelasticInteractionPossible" << G4endl;
+  }
+
+  // If hadron-hadron collision, defer to ElementaryParticleCollider
+  if (useEPCollider(bullet, target)) return true;
+
+  // See which one of the two (or both) is a nucleus, get properties
+  // FIXME:  Should set a = baryon() for both, but that's not in base
+  G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
+  G4double ab = nuclei_bullet ? nuclei_bullet->getA() : 1;	// FIXME
+  G4double zb = nuclei_bullet ? nuclei_bullet->getZ() : bullet->getCharge();
+  
+  G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target);
+  G4double at = nuclei_target ? nuclei_target->getA() : 1;	// FIXME
+  G4double zt = nuclei_target ? nuclei_target->getZ() : target->getCharge();
+  
+  // VCOL (Coulomb barrier) used for testing if elastic collision necessary
+  const G4double coeff = 0.001 * 1.2;
+
+  G4double VCOL = coeff * zt * zb / (G4cbrt(at) + G4cbrt(ab)); 
+  
+  G4bool possible = true;	// Force inelastic; should be (ekin >= VCOL)
+
+  if (verboseLevel > 3) {
+    G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: "
+	   << possible << G4endl;
+  }
+
+  return possible;
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QAntiBaryonElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QAntiBaryonElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QAntiBaryonElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QAntiBaryonElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QAntiBaryonElasticCrossSection_h
+#define G4QAntiBaryonElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QAntiBaryonElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QAntiBaryonElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QAntiBaryonElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                         G4int pPDG=-2212);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QHyperonElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QHyperonElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QHyperonElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QHyperonElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QHyperonElasticCrossSection_h
+#define G4QHyperonElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QHyperonElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QHyperonElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QHyperonElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                         G4int pPDG=3122);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QHyperonPlusElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QHyperonPlusElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QHyperonPlusElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QHyperonPlusElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QHyperonPlusElasticCrossSection_h
+#define G4QHyperonPlusElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QHyperonPlusElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QHyperonPlusElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QHyperonPlusElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                         G4int pPDG=3222);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QKaonMinusElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QKaonMinusElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QKaonMinusElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QKaonMinusElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QKaonMinusElasticCrossSection_h
+#define G4QKaonMinusElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QKaonMinusElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QKaonMinusElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QKaonMinusElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                         G4int pPDG=-321);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QKaonPlusElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QKaonPlusElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QKaonPlusElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QKaonPlusElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QKaonPlusElasticCrossSection_h
+#define G4QKaonPlusElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QKaonPlusElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QKaonPlusElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QKaonPlusElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                         G4int pPDG=321);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QNeutronElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QNeutronElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QNeutronElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QNeutronElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 24-OCT-01
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 12-Jan-2010 (from G4QElCrSect)
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QNeutronElasticCrossSection_h
+#define G4QNeutronElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QNeutronElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QNeutronElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QNeutronElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                          G4int pPDG=2112);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QPionMinusElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QPionMinusElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QPionMinusElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QPionMinusElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 21-Jan-10
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 21-Jan-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QPionMinusElasticCrossSection_h
+#define G4QPionMinusElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QPionMinusElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QPionMinusElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QPionMinusElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                          G4int pPDG=2212);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QPionPlusElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QPionPlusElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QPionPlusElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QPionPlusElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 21-Jan-10
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 21-Jan-2010
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QPionPlusElasticCrossSection_h
+#define G4QPionPlusElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QPionPlusElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QPionPlusElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QPionPlusElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                          G4int pPDG=2212);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QProtonElasticCrossSection.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QProtonElasticCrossSection.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/include/G4QProtonElasticCrossSection.hh	(revision 1316)
@@ -0,0 +1,130 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// GEANT4 physics class: G4QProtonElasticCrossSection -- header file
+// M.V. Kossov, ITEP(Moscow), 24-OCT-01
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 12-Jan-2010 (from G4QElCrSect)
+//
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+#ifndef G4QProtonElasticCrossSection_h
+#define G4QProtonElasticCrossSection_h 1
+
+#include "G4QPDGCode.hh"
+#include "G4QException.hh"
+#include <vector>
+#include "Randomize.hh"
+#include "G4VQCrossSection.hh"
+
+class G4QProtonElasticCrossSection : public G4VQCrossSection
+{
+protected:
+
+  G4QProtonElasticCrossSection();               // Constructor
+
+public:
+
+  ~G4QProtonElasticCrossSection();
+
+  static G4VQCrossSection* GetPointer(); // Gives a pointer to this singletone
+
+  // Cross-section is mb. At present momentum (pMom) is in MeV=IU (@@ make Indep. Units)
+  virtual G4double GetCrossSection(G4bool fCS, G4double pMom, G4int tgZ, G4int tgN,
+                                                                          G4int pPDG=2212);
+
+  G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int pPDG, G4int Z, G4int N,
+                                                                              G4double pP);
+  G4double GetSlope(G4int tZ, G4int tN, G4int pPDG);     // Slope of the 1st diff. maximum
+  G4double GetExchangeT(G4int tZ, G4int tN, G4int pPDG); // Randomizes -t=Q2 (in IU=MeV^2)
+  G4double GetHMaxT();                   // Currrent Max(-t=Q2)/2. (in IU=MeV^2)
+
+private:
+  G4double GetPTables(G4double lpP, G4double lPm, G4int PDG, G4int tZ, G4int tN); // newLP
+  G4double GetTabValues(G4double lp, G4int pPDG, G4int tgZ, G4int tgN); // return CS(Si/Bi)
+  G4double GetQ2max(G4int pPDG, G4int tgZ, G4int tgN, G4double pP); // return -t=Q2
+
+// Body
+private:
+  // --- Data formating AMDB (define the precalculated table structure) ---
+  static const G4int nPoints;// #of points in the AMDB tables     
+  static const G4int nLast;  // the Last element in the table
+  static G4double    lPMin;  // Min tabulated logarithmic Momentum  
+  static G4double    lPMax;  // Max tabulated logarithmic Momentum  
+  static G4double    dlnP;   // Log step in the table     
+  // ---- Local (for particular pP, pPDG, tZ, tN) -----
+  static G4bool    onlyCS;   // flag to calculate only CS (not S1/B1,S2/B2,S3/B3)
+  static G4double  lastSIG;  // Last calculated cross section
+  static G4double  lastLP;   // Last log(mom_of_the_incident_hadron in GeV)
+  static G4double  lastTM;   // Last t_maximum                       
+  static G4int     lastN;    // The last N of calculated nucleus
+  static G4int     lastZ;    // The last Z of calculated nucleus
+  static G4double  lastP;    // Last used in the cross section Momentum
+  static G4double  lastTH;   // Last value of the Momentum Threshold
+  static G4double  lastCS;   // Last value of the Cross Section
+  static G4int     lastI;    // The last position in the DAMDB
+  static G4double  theSS;    // The Last squared slope of first diffruction 
+  static G4double  theS1;    // The Last mantissa of first diffruction 
+  static G4double  theB1;    // The Last slope of first diffruction    
+  static G4double  theS2;    // The Last mantissa of second diffruction
+  static G4double  theB2;    // The Last slope of second diffruction   
+  static G4double  theS3;    // The Last mantissa of third diffruction 
+  static G4double  theB3;    // The Last slope of third diffruction    
+  static G4double  theS4;    // The Last mantissa of 4-th diffruction 
+  static G4double  theB4;    // The Last slope of 4-th diffruction    
+  // ---- Global (AMBD of P-dependent tables for pPDG,tZ,tN) -----
+  static G4int     lastTZ;   // Last atomic number of the target
+  static G4int     lastTN;   // Last number of neutrons of the target
+  static G4double  lastPIN;  // Last initialized max momentum
+  static G4double* lastCST;  // Last cross-section table
+  static G4double* lastPAR;  // Last parameters for functional calculation
+  static G4double* lastSST;  // E-dep of squared slope of the first difruction 
+  static G4double* lastS1T;  // E-dep of mantissa of the first difruction 
+  static G4double* lastB1T;  // E-dep of the slope of the first difruction
+  static G4double* lastS2T;  // E-dep of mantissa of the second difruction
+  static G4double* lastB2T;  // E-dep of the slope of theSecond difruction
+  static G4double* lastS3T;  // E-dep of mantissa of the third difruction 
+  static G4double* lastB3T;  // E-dep of the slope of the third difruction
+  static G4double* lastS4T;  // E-dep of mantissa of the 4-th difruction 
+  static G4double* lastB4T;  // E-dep of the slope of the 4-th difruction
+
+  static std::vector <G4double*> PAR;   // Vector of parameters for functional calculations
+  static std::vector <G4double*> CST;   // Vector of cross-section table
+  static std::vector <G4double*> SST;   // Vector of the first squared slope
+  static std::vector <G4double*> S1T;   // Vector of the first mantissa
+  static std::vector <G4double*> B1T;   // Vector of the first slope
+  static std::vector <G4double*> S2T;   // Vector of the secon mantissa
+  static std::vector <G4double*> B2T;   // Vector of the second slope
+  static std::vector <G4double*> S3T;   // Vector of the third mantissa
+  static std::vector <G4double*> B3T;   // Vector of the third slope
+  static std::vector <G4double*> S4T;   // Vector of the 4-th mantissa (gloria)
+  static std::vector <G4double*> B4T;   // Vector of the 4-th slope    (gloria)
+ };
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QAntiBaryonElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QAntiBaryonElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QAntiBaryonElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1093 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QAntiBaryonElasticCrossSection.cc,v 1.2 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QAntiBaryonElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QAntiBaryonElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QAntiBaryonElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)(D)
+const G4int G4QAntiBaryonElasticCrossSection::nLast=nPoints-1;// theLastElement inTable (D)
+G4double  G4QAntiBaryonElasticCrossSection::lPMin=-8.;  //Min tabulatedLogarithmMomentum(D)
+G4double  G4QAntiBaryonElasticCrossSection::lPMax= 8.;  //Max tabulatedLogarithmMomentum(D)
+G4double  G4QAntiBaryonElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep inTable (D)
+G4bool    G4QAntiBaryonElasticCrossSection::onlyCS=true;//Flag toCalculOnlyCS(not Si/Bi)(L)
+G4double  G4QAntiBaryonElasticCrossSection::lastSIG=0.; //Last calculated cross section (L)
+G4double  G4QAntiBaryonElasticCrossSection::lastLP=-10.;//LastLog(mom_of IncidentHadron)(L)
+G4double  G4QAntiBaryonElasticCrossSection::lastTM=0.;  //Last t_maximum                (L)
+G4double  G4QAntiBaryonElasticCrossSection::theSS=0.;   //TheLastSqSlope of 1st difr.Max(L)
+G4double  G4QAntiBaryonElasticCrossSection::theS1=0.;   //TheLastMantissa of 1st difrMax(L)
+G4double  G4QAntiBaryonElasticCrossSection::theB1=0.;   //TheLastSlope of 1st difructMax(L)
+G4double  G4QAntiBaryonElasticCrossSection::theS2=0.;   //TheLastMantissa of 2nd difrMax(L)
+G4double  G4QAntiBaryonElasticCrossSection::theB2=0.;   //TheLastSlope of 2nd difructMax(L)
+G4double  G4QAntiBaryonElasticCrossSection::theS3=0.;   //TheLastMantissa of 3d difr.Max(L)
+G4double  G4QAntiBaryonElasticCrossSection::theB3=0.;   //TheLastSlope of 3d difruct.Max(L)
+G4double  G4QAntiBaryonElasticCrossSection::theS4=0.;   //TheLastMantissa of 4th difrMax(L)
+G4double  G4QAntiBaryonElasticCrossSection::theB4=0.;   //TheLastSlope of 4th difructMax(L)
+G4int     G4QAntiBaryonElasticCrossSection::lastTZ=0;   // Last atomic number of the target
+G4int     G4QAntiBaryonElasticCrossSection::lastTN=0;   // Last # of neutrons in the target
+G4double  G4QAntiBaryonElasticCrossSection::lastPIN=0.; // Last initialized max momentum
+G4double* G4QAntiBaryonElasticCrossSection::lastCST=0;  // Elastic cross-section table
+G4double* G4QAntiBaryonElasticCrossSection::lastPAR=0;  // ParametersForFunctionCalculation
+G4double* G4QAntiBaryonElasticCrossSection::lastSST=0;  // E-dep ofSqardSlope of 1st difMax
+G4double* G4QAntiBaryonElasticCrossSection::lastS1T=0;  // E-dep of mantissa of 1st dif.Max
+G4double* G4QAntiBaryonElasticCrossSection::lastB1T=0;  // E-dep of the slope of 1st difMax
+G4double* G4QAntiBaryonElasticCrossSection::lastS2T=0;  // E-dep of mantissa of 2nd difrMax
+G4double* G4QAntiBaryonElasticCrossSection::lastB2T=0;  // E-dep of the slope of 2nd difMax
+G4double* G4QAntiBaryonElasticCrossSection::lastS3T=0;  // E-dep of mantissa of 3d difr.Max
+G4double* G4QAntiBaryonElasticCrossSection::lastB3T=0;  // E-dep of the slope of 3d difrMax
+G4double* G4QAntiBaryonElasticCrossSection::lastS4T=0;  // E-dep of mantissa of 4th difrMax
+G4double* G4QAntiBaryonElasticCrossSection::lastB4T=0;  // E-dep of the slope of 4th difMax
+G4int     G4QAntiBaryonElasticCrossSection::lastN=0;    // The last N of calculated nucleus
+G4int     G4QAntiBaryonElasticCrossSection::lastZ=0;    // The last Z of calculated nucleus
+G4double  G4QAntiBaryonElasticCrossSection::lastP=0.;   // LastUsed inCrossSection Momentum
+G4double  G4QAntiBaryonElasticCrossSection::lastTH=0.;  // Last threshold momentum
+G4double  G4QAntiBaryonElasticCrossSection::lastCS=0.;  // Last value of the Cross Section
+G4int     G4QAntiBaryonElasticCrossSection::lastI=0;    // The last position in the DAMDB
+
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::PAR;// Vector ofParsForFunctCalcul
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::CST;// Vector ofCrossSection table
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::SST;// Vector ofThe1st SquardSlope
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::S1T;// Vector of the 1st mantissa
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::B1T;// Vector of the1st slope
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::S2T;// Vector of the2nd mantissa
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::B2T;// Vector of the2nd slope
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::S3T;// Vector of the3d mantissa
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::B3T;// Vector of the3d slope
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::S4T;// Vector ofThe4th mantissa(g)
+std::vector<G4double*> G4QAntiBaryonElasticCrossSection::B4T;// Vector ofThe4th slope(glor)
+
+G4QAntiBaryonElasticCrossSection::G4QAntiBaryonElasticCrossSection()
+{
+}
+
+G4QAntiBaryonElasticCrossSection::~G4QAntiBaryonElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QAntiBaryonElasticCrossSection::GetPointer()
+{
+  static G4QAntiBaryonElasticCrossSection theCrossSection;//StaticBody ofTheQElCrossSection
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QAntiBaryonElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QaBaElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG<-3334 || pPDG>-1111)
+  {
+    G4cout<<"*Warning*G4QAntiBaryElCS::GetCS:**> Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QaBElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QaBElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QAntiBaryonElasticCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QaBElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QAntiBElCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QAntiBarElCS::GetCS: NewT="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QAntiBarElCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="<<colN[i]
+          <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QaBElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QaBaElCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QaBarElCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QaBElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QaBElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QAntiBaryonElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QaBElCS::GetCSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QAntiBaryonElasticCrossSection::GetCrosSec:***End***,onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QAntiBaryonElasticCrossSection::CalculateCrossSection(G4bool CS,G4int F,G4int I,
+                                             G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QAntiBaryonElasticCS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QAntiBarElCS::CalcCS: DB's updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QAntiBaryonElasticCS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QaBElCS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QAntiBaryonElasticCS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QAnBaElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QaBElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QAntiBarElCS::CalcCS: *updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QaBaElCS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QAnBarElCrosSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QaBarElCS::CCS:b="<<blast<<","<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QAntiBaryonElasticCS::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QAntiBaryonElasticCrossSection::CalcCrossSection:Sig="<<lastSIG<<",P="
+            <<pMom<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QAntiBaryonElasticCS::CalcCrossSection:b="<<blast<<",ls="<<lastL<<",SL="
+              <<S1TL<<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QAntiBaryonElasticCrossSection::CCS:s3l="<<S3TL<<",sh3="<<shift<<",s3h="
+              <<lastS3T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QAntiBaryonElasticCrossSection::CCS:s4l="<<S4TL<<",sh4="<<shift<<",s4h="
+              <<lastS4T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QAntiBaryonElasticCS::CalculateCS:(I) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QAntiBaryonElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QAntiBaryonElasticCrossSection::GetPTables(G4double LP, G4double ILP, G4int PDG,
+                                                  G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_appel=30;                // #of parameters for app-elastic (<nPoints=128)
+  //                          -0- -1- -2- -3-  -4- -5- -6- -7- -8--9--10--11--12--13--14-
+  G4double app_el[n_appel]={1.25,3.5,80.,1.,.0557,6.72,5.,74.,3.,3.4,.2,.17,.001,8.,.055,
+                            3.64,5.e-5,4000.,1500.,.46,1.2e6,3.5e6,5.e-5,1.e10,8.5e8,
+                            1.e10,1.1,3.4e6,6.8e6,0.};
+  //                        -15-  -16-  -17-  -18- -19- -20-  -21-  -22-  -23- -24-
+  //                        -25-  -26- -27- -28- -29- 
+  if(PDG>-3334 && PDG<-1111)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_appel; ip++) lastPAR[ip]=app_el[ip]; // PiMinus+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (pel=peh_fit.f)
+        lastPAR[0]=.23*asa/(1.+a*.15);                                       // p1
+        lastPAR[1]=2.8*asa/(1.+a*(.015+.05/ssa));                            // p2
+        lastPAR[2]=15.*a/(1.+.005*a2);                                       // p3
+        lastPAR[3]=.013*a2/(1.+a3*(.006+a*.00001));                          // p4
+        lastPAR[4]=5.;                                                       // p5
+        lastPAR[5]=0.;                                                       // p6 not used
+        lastPAR[6]=0.;                                                       // p7 not used
+        lastPAR[7]=0.;                                                       // p8 not used
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QaBElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QaBElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QAntiBaryonElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QAntiBaryonElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetPTables: PDG="<<PDG
+                 <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetPTab:PDG="<<PDG<<",Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QAntiBaryonElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for Anti Baryons"<<G4endl;
+    throw G4QException("G4QAntiBaryonElasticCrossSection::GetPTables:onlyaBA implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QAntiBaryonElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QAnBaElCS::GetExcT: F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG<-3334 || PDG>-1111)G4cout<<"*Warning*G4QAntiBaryonElCS::GetExT:PDG="<<PDG<<G4endl;
+  if(onlyCS)G4cout<<"WarningG4QAntiBaryonElasticCrossSection::GetExchanT:onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QAnBarElCS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:1p "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:2p "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:3p "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QAntiBaryonElasticCrossSection::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1
+          <<",B1="<<theB1<<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3
+          <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GetExT:4a "<<ts4<<"#"<<lastTM
+            <<",d="<<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QaBElCS::GExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QaBElCS::GExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QaBaElCS::GetExT:Q2="<<q2<<",r2="<<R2<<",b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QaBaElCS::GetExT:Q2="<<q2<<",r3="<<R2<<",b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QaBElCS::GExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.))G4cout<<"*NAN*G4QaBElasticCrossSect::GetExchangeT:-t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QAntiBaryonElasticCrossSection::GExT:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QAntiBaryonElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QAnBarElCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"WarningG4QAntiBaryonElasticCrossSection::GetSlope:onlCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG<-3334 || PDG>-1111)
+  {
+    G4cout<<"*Error*G4QAntiBaryonElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for Anti Baryons"<<G4endl;
+    throw G4QException("G4QAntiBaryonElasticCrossSection::GetSlope: AnBa are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QaBaElasticCrossS::Getslope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QAntiBaryonElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QAntiBaryonElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG<-3334 || PDG>-1111) G4cout<<"*Warning*G4QAntiBaryElCS::GetTabV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QAntiBaryonElCS::GetTabValue:(1-92) NoIsotopesFor Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QAntiBaryonElastCS::GetTabValue: NoIsotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QaBElasticCS::GetTabVal:l="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 ) // PiMin+P
+  {
+    G4double dl2=lp-lastPAR[6]; // ld ?
+    theSS=lastPAR[29];
+    theS1=(lastPAR[7]+lastPAR[8]*dl2*dl2)/(1.+lastPAR[9]/p4/p)+
+          (lastPAR[10]/p2+lastPAR[11]*p)/(p4+lastPAR[12]*sp);
+    theB1=lastPAR[13]*std::pow(p,lastPAR[14])/(1.+lastPAR[15]/p3);
+    theS2=lastPAR[16]+lastPAR[17]/(p4+lastPAR[18]*p);
+    theB2=lastPAR[19]+lastPAR[20]/(p4+lastPAR[21]/sp); 
+    theS3=lastPAR[22]+lastPAR[23]/(p4*p4+lastPAR[24]*p2+lastPAR[25]);
+    theB3=lastPAR[26]+lastPAR[27]/(p4+lastPAR[28]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QAntiBarElasticCS::GetTableValues:TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1
+          <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
+    G4double ye=std::exp(lp*lastPAR[0]);
+    G4double dp=lp-lastPAR[1];
+    return lastPAR[2]/(ye+lastPAR[3])+lastPAR[4]*dp*dp+lastPAR[5];
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QaBaElCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QaBaElCS::GetTabV: hA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QAntiBarElCS::GetTabV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    G4double dlp=lp-lastPAR[5]; // ax
+    //         p1               p2          p3                 p4
+    return (lastPAR[0]*dlp*dlp+lastPAR[1]+lastPAR[2]/p)/(1.+lastPAR[3]/p);
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QAntiBaryonElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                    G4double pP)
+{
+  static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mNuc2= sqr((mProt+mNeut)/2);
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // ---> pipA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mNuc2)+mNuc2+mt*mt;    // Mondelstam s (@@ other AntiBar?)
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QAntiBaryonElasticCrossSection::GetQ2ma:PDG="<<PDG<<",Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QAntiBaryonElasticCrossSection::GetQ2max: only aBA implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QHyperonElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QHyperonElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QHyperonElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1095 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QHyperonElasticCrossSection.cc,v 1.1 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QHyperonElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QHyperonElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QHyperonElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)(D)
+const G4int G4QHyperonElasticCrossSection::nLast=nPoints-1;// theLastElement inTable (D)
+G4double  G4QHyperonElasticCrossSection::lPMin=-8.;  //Min tabulatedLogarithmMomentum(D)
+G4double  G4QHyperonElasticCrossSection::lPMax= 8.;  //Max tabulatedLogarithmMomentum(D)
+G4double  G4QHyperonElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep inTable (D)
+G4bool    G4QHyperonElasticCrossSection::onlyCS=true;//Flag toCalculOnlyCS(not Si/Bi)(L)
+G4double  G4QHyperonElasticCrossSection::lastSIG=0.; //Last calculated cross section (L)
+G4double  G4QHyperonElasticCrossSection::lastLP=-10.;//LastLog(mom_of IncidentHadron)(L)
+G4double  G4QHyperonElasticCrossSection::lastTM=0.;  //Last t_maximum                (L)
+G4double  G4QHyperonElasticCrossSection::theSS=0.;   //TheLastSqSlope of 1st difr.Max(L)
+G4double  G4QHyperonElasticCrossSection::theS1=0.;   //TheLastMantissa of 1st difrMax(L)
+G4double  G4QHyperonElasticCrossSection::theB1=0.;   //TheLastSlope of 1st difructMax(L)
+G4double  G4QHyperonElasticCrossSection::theS2=0.;   //TheLastMantissa of 2nd difrMax(L)
+G4double  G4QHyperonElasticCrossSection::theB2=0.;   //TheLastSlope of 2nd difructMax(L)
+G4double  G4QHyperonElasticCrossSection::theS3=0.;   //TheLastMantissa of 3d difr.Max(L)
+G4double  G4QHyperonElasticCrossSection::theB3=0.;   //TheLastSlope of 3d difruct.Max(L)
+G4double  G4QHyperonElasticCrossSection::theS4=0.;   //TheLastMantissa of 4th difrMax(L)
+G4double  G4QHyperonElasticCrossSection::theB4=0.;   //TheLastSlope of 4th difructMax(L)
+G4int     G4QHyperonElasticCrossSection::lastTZ=0;   // Last atomic number of the target
+G4int     G4QHyperonElasticCrossSection::lastTN=0;   // Last # of neutrons in the target
+G4double  G4QHyperonElasticCrossSection::lastPIN=0.; // Last initialized max momentum
+G4double* G4QHyperonElasticCrossSection::lastCST=0;  // Elastic cross-section table
+G4double* G4QHyperonElasticCrossSection::lastPAR=0;  // ParametersForFunctionCalculation
+G4double* G4QHyperonElasticCrossSection::lastSST=0;  // E-dep ofSqardSlope of 1st difMax
+G4double* G4QHyperonElasticCrossSection::lastS1T=0;  // E-dep of mantissa of 1st dif.Max
+G4double* G4QHyperonElasticCrossSection::lastB1T=0;  // E-dep of the slope of 1st difMax
+G4double* G4QHyperonElasticCrossSection::lastS2T=0;  // E-dep of mantissa of 2nd difrMax
+G4double* G4QHyperonElasticCrossSection::lastB2T=0;  // E-dep of the slope of 2nd difMax
+G4double* G4QHyperonElasticCrossSection::lastS3T=0;  // E-dep of mantissa of 3d difr.Max
+G4double* G4QHyperonElasticCrossSection::lastB3T=0;  // E-dep of the slope of 3d difrMax
+G4double* G4QHyperonElasticCrossSection::lastS4T=0;  // E-dep of mantissa of 4th difrMax
+G4double* G4QHyperonElasticCrossSection::lastB4T=0;  // E-dep of the slope of 4th difMax
+G4int     G4QHyperonElasticCrossSection::lastN=0;    // The last N of calculated nucleus
+G4int     G4QHyperonElasticCrossSection::lastZ=0;    // The last Z of calculated nucleus
+G4double  G4QHyperonElasticCrossSection::lastP=0.;   // LastUsed inCrossSection Momentum
+G4double  G4QHyperonElasticCrossSection::lastTH=0.;  // Last threshold momentum
+G4double  G4QHyperonElasticCrossSection::lastCS=0.;  // Last value of the Cross Section
+G4int     G4QHyperonElasticCrossSection::lastI=0;    // The last position in the DAMDB
+
+std::vector<G4double*> G4QHyperonElasticCrossSection::PAR;// Vector ofParsForFunctCalcul
+std::vector<G4double*> G4QHyperonElasticCrossSection::CST;// Vector ofCrossSection table
+std::vector<G4double*> G4QHyperonElasticCrossSection::SST;// Vector ofThe1st SquardSlope
+std::vector<G4double*> G4QHyperonElasticCrossSection::S1T;// Vector of the 1st mantissa
+std::vector<G4double*> G4QHyperonElasticCrossSection::B1T;// Vector of the1st slope
+std::vector<G4double*> G4QHyperonElasticCrossSection::S2T;// Vector of the2nd mantissa
+std::vector<G4double*> G4QHyperonElasticCrossSection::B2T;// Vector of the2nd slope
+std::vector<G4double*> G4QHyperonElasticCrossSection::S3T;// Vector of the3d mantissa
+std::vector<G4double*> G4QHyperonElasticCrossSection::B3T;// Vector of the3d slope
+std::vector<G4double*> G4QHyperonElasticCrossSection::S4T;// Vector ofThe4th mantissa(g)
+std::vector<G4double*> G4QHyperonElasticCrossSection::B4T;// Vector ofThe4th slope(glor)
+
+G4QHyperonElasticCrossSection::G4QHyperonElasticCrossSection()
+{
+}
+
+G4QHyperonElasticCrossSection::~G4QHyperonElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QHyperonElasticCrossSection::GetPointer()
+{
+  static G4QHyperonElasticCrossSection theCrossSection;//StaticBody ofTheQElCrossSection
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QHyperonElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QHyperElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG==3222 || pPDG<3000 || pPDG>3334)
+  {
+    G4cout<<"*Warning*G4QHyperonElaCS::GetCS:**> Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QHyElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyperonElasticCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QHyElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QHyperElCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyperonElCS::GetCS: NewT="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QHyperonElCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="<<colN[i]
+          <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QHyElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QHyperonElasticCrossSection::GetCS:NewThres="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyperonElCS::GetCS:1st T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QHyElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QHyElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QHyperonElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QHyElCS::GetCSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QHyperonElasticCrossSection::GetCrosSec:***End***,onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QHyperonElasticCrossSection::CalculateCrossSection(G4bool CS,G4int F,G4int I,
+                                             G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QHyperonElasticCS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QHyperonElCS::CalcCS: DB's updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QHyperonElasticCS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QHyElCS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QHyperonElasticCrosS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QHypElCS::CCS:i, Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QHypElCS::CalCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QHyperionElCS::CalcCS:*updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QHypElCS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QHyperElCrosSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast)G4cout<<"G4QHyperElCS::CCS:b="<<blast<<","<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QHyperonElasticCS::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QHyperonElasticCrossSection::CalcCrossSection:Sig="<<lastSIG<<",P="
+            <<pMom<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QHyperonElasticCS::CalcCrossSection:b="<<blast<<",ls="<<lastL<<",SL="
+              <<S1TL<<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QHyperonElasticCrossSection::CCS:s3l="<<S3TL<<",sh3="<<shift<<",s3h="
+              <<lastS3T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QHyperonElasticCrossSection::CCS:s4l="<<S4TL<<",sh4="<<shift<<",s4h="
+              <<lastS4T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QHyperonElasticCS::CalculateCS:(I) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QHyperonElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QHyperonElasticCrossSection::GetPTables(G4double LP, G4double ILP, G4int PDG,
+                                                  G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_hypel=33;                // #of parameters for pp-elastic (<nPoints=128)
+  //                        -0- -1- -2-  -3-  -4- -5-  -6--7--8--9--10--11--12-13--14-
+  G4double hyp_el[n_hypel]={1.,.002,.12,.0557,3.5,6.72,99.,2.,3.,5.,74.,3.,3.4,.2,.17,
+                            .001,8.,.055,3.64,5.e-5,4000.,1500.,.46,1.2e6,3.5e6,5.e-5,
+                            1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                        -15--16- -17- -18- -19-  -20- -21- -22- -23-  -24-   -25-
+  //                         -26-  -27- -28-  -29- -30- -31- -32-
+  if(PDG!=3222 && PDG>3000 && PDG<3335)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_hypel; ip++) lastPAR[ip]=hyp_el[ip]; // Hyperon+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (pel=peh_fit.f)
+        lastPAR[0]=4./(1.+22/asa);                                           // p1
+        lastPAR[1]=2.36*asa/(1.+a*.055/ssa);                                 // p2
+        lastPAR[2]=(1.+.00007*a3/ssa)/(1.+.0026*a2);                         // p3
+        lastPAR[3]=1.76*a/ssa+.00003*a3;                                     // p4
+        lastPAR[4]=(.03+200./a3)/(1.+1.E5/a3/sa);                            // p5
+        lastPAR[5]=5.;                                                       // p6
+        lastPAR[6]=0.;                                                       // p7 not used
+        lastPAR[7]=0.;                                                       // p8 not used
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QHyElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QHyElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QHyperonElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QHyperonElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetPTables: PDG="<<PDG
+                 <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetPTab:PDG="<<PDG<<",Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QHyperonElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for Hyperons"<<G4endl;
+    throw G4QException("G4QHyperonElasticCrossSection::GetPTables:onlyaBA implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QHyperonElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QHyperElCS::GetExcT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG==3222 || PDG<3000 || PDG>3334)G4cout<<"*Warning*G4QHyElCS::GET:PDG="<<PDG<<G4endl;
+  if(onlyCS)G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExchanT: onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QHyperElCS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:1p "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:2p "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:3p "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QHyperonElasticCrossSection::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1
+          <<",B1="<<theB1<<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3
+          <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetExT:4a "<<ts4<<"#"<<lastTM
+            <<",d="<<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QHyElCS::GExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QHyElCS::GExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QHyElCS::GetExT: Q2="<<q2<<",r2="<<R2<<",b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QHyElCS::GetExT: Q2="<<q2<<",r3="<<R2<<",b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QHyElCS::GExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.))G4cout<<"*NAN*G4QHyElasticCrossSect::GetExchangeT:-t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QHyperonElasticCrossSection::GExT: -t="<<q2<<" > "<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QHyperonElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QHyperElCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"*Warning*G4QHyperonElasticCrossSection::GetSlope: onlCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG==3222 || PDG<3000 || PDG>3334)
+  {
+    G4cout<<"*Error*G4QHyperonElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for Hyperons"<<G4endl;
+    throw G4QException("G4QHyperonElasticCrossSection::GetSlope: HypA are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.)) G4cout<<"*NAN*G4QHyElasticCrossS::Getslope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QHyperonElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QHyperonElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG==3222 || PDG<3000 || PDG>3334) G4cout<<"*Warning*G4QHypElCS::GTV:P="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QHyperonElastCS::GetTabValue:(1-92) NoIsotopesFor Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QHyperonElasticCS::GetTabValue: No isotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QHyElasticCS::GetTabVal:l="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 ) // Hyperon+P
+  {
+    G4double dl2=lp-lastPAR[9];
+    theSS=lastPAR[32];
+    theS1=(lastPAR[10]+lastPAR[11]*dl2*dl2)/(1.+lastPAR[12]/p4/p)+
+          (lastPAR[13]/p2+lastPAR[14]*p)/(p4+lastPAR[15]*sp);
+    theB1=lastPAR[16]*std::pow(p,lastPAR[17])/(1.+lastPAR[18]/p3);
+    theS2=lastPAR[19]+lastPAR[20]/(p4+lastPAR[21]*p);
+    theB2=lastPAR[22]+lastPAR[23]/(p4+lastPAR[24]/sp); 
+    theS3=lastPAR[25]+lastPAR[26]/(p4*p4+lastPAR[27]*p2+lastPAR[28]);
+    theB3=lastPAR[29]+lastPAR[30]/(p4+lastPAR[31]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QHyperonElasticCrossSection::GetTableVal:TM="<<lastTM<<",S1="<<theS1<<",B1="
+          <<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
+    G4double dp=lp-lastPAR[4];
+    return lastPAR[0]/(lastPAR[1]+p2*(lastPAR[2]+p2))+(lastPAR[3]*dp*dp+lastPAR[5]+
+           lastPAR[6]/p2)/(1.+lastPAR[7]/sp+lastPAR[8]/p4);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QHyperonElasticCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QHyperonElasticCS::GetTabV:hA,p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="
+            <<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="
+            <<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QHyperonElCS::GetTabV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    G4double dlp=lp-lastPAR[5]; // ax
+    //         p1               p2          p3                 p4               p5
+    return (lastPAR[0]*dlp*dlp+lastPAR[1])/(1.+lastPAR[2]/p)+lastPAR[3]/(p3+lastPAR[4]);
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QHyperonElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                    G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  //static const G4double mPi= G4QPDGCode(211).GetMass()*.001; // pion mass MeV to GeV
+  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  //static const G4double mPi2= mPi*mPi;
+  static const G4double mLa2= mLamb*mLamb;
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // --> Hyperon-A
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mLa2)+mLa2+mt*mt;    // Mondelstam s (@@ other hyperons?)
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QHyperonElasticCrossSection::GetQ2ma:PDG="<<PDG<<",Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QHyperonElasticCrossSection::GetQ2max: only HyperA implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QHyperonPlusElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QHyperonPlusElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QHyperonPlusElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1096 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QHyperonPlusElasticCrossSection.cc,v 1.1 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QHyperonPlusElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QHyperonPlusElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QHyperonPlusElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)/D
+const G4int G4QHyperonPlusElasticCrossSection::nLast=nPoints-1;// theLastElement inTable /D
+G4double  G4QHyperonPlusElasticCrossSection::lPMin=-8.;  //Min tabulatedLogarithmMomentum/D
+G4double  G4QHyperonPlusElasticCrossSection::lPMax= 8.;  //Max tabulatedLogarithmMomentum/D
+G4double  G4QHyperonPlusElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep inTable /D
+G4bool    G4QHyperonPlusElasticCrossSection::onlyCS=true;//Flag toCalculOnlyCS(not Si/Bi)/L
+G4double  G4QHyperonPlusElasticCrossSection::lastSIG=0.; //Last calculated cross section /L
+G4double  G4QHyperonPlusElasticCrossSection::lastLP=-10.;//LastLog(mom_of IncidentHadron)/L
+G4double  G4QHyperonPlusElasticCrossSection::lastTM=0.; //Last t_maximum                /L
+G4double  G4QHyperonPlusElasticCrossSection::theSS=0.;  //TheLastSqSlope of 1st difr.Max/L
+G4double  G4QHyperonPlusElasticCrossSection::theS1=0.;  //TheLastMantissa of 1st difrMax/L
+G4double  G4QHyperonPlusElasticCrossSection::theB1=0.;  //TheLastSlope of 1st difructMax/L
+G4double  G4QHyperonPlusElasticCrossSection::theS2=0.;  //TheLastMantissa of 2nd difrMax/L
+G4double  G4QHyperonPlusElasticCrossSection::theB2=0.;  //TheLastSlope of 2nd difructMax/L
+G4double  G4QHyperonPlusElasticCrossSection::theS3=0.;  //TheLastMantissa of 3d difr.Max/L
+G4double  G4QHyperonPlusElasticCrossSection::theB3=0.;  //TheLastSlope of 3d difruct.Max/L
+G4double  G4QHyperonPlusElasticCrossSection::theS4=0.;  //TheLastMantissa of 4th difrMax/L
+G4double  G4QHyperonPlusElasticCrossSection::theB4=0.;  //TheLastSlope of 4th difructMax/L
+G4int     G4QHyperonPlusElasticCrossSection::lastTZ=0;  // Last atomic number of theTarget
+G4int     G4QHyperonPlusElasticCrossSection::lastTN=0;  // Last # of neutrons in theTarget
+G4double  G4QHyperonPlusElasticCrossSection::lastPIN=0.;// Last initialized max momentum
+G4double* G4QHyperonPlusElasticCrossSection::lastCST=0; // Elastic cross-section table
+G4double* G4QHyperonPlusElasticCrossSection::lastPAR=0; // ParametersForFunctionCalculation
+G4double* G4QHyperonPlusElasticCrossSection::lastSST=0; // E-dep ofSqardSlope of 1st difMax
+G4double* G4QHyperonPlusElasticCrossSection::lastS1T=0; // E-dep of mantissa of 1st dif.Max
+G4double* G4QHyperonPlusElasticCrossSection::lastB1T=0; // E-dep of the slope of 1st difMax
+G4double* G4QHyperonPlusElasticCrossSection::lastS2T=0; // E-dep of mantissa of 2nd difrMax
+G4double* G4QHyperonPlusElasticCrossSection::lastB2T=0; // E-dep of the slope of 2nd difMax
+G4double* G4QHyperonPlusElasticCrossSection::lastS3T=0; // E-dep of mantissa of 3d difr.Max
+G4double* G4QHyperonPlusElasticCrossSection::lastB3T=0; // E-dep of the slope of 3d difrMax
+G4double* G4QHyperonPlusElasticCrossSection::lastS4T=0; // E-dep of mantissa of 4th difrMax
+G4double* G4QHyperonPlusElasticCrossSection::lastB4T=0; // E-dep of the slope of 4th difMax
+G4int     G4QHyperonPlusElasticCrossSection::lastN=0;   // The last N of calculated nucleus
+G4int     G4QHyperonPlusElasticCrossSection::lastZ=0;   // The last Z of calculated nucleus
+G4double  G4QHyperonPlusElasticCrossSection::lastP=0.;  // LastUsed inCrossSection Momentum
+G4double  G4QHyperonPlusElasticCrossSection::lastTH=0.; // Last threshold momentum
+G4double  G4QHyperonPlusElasticCrossSection::lastCS=0.; // Last value of the Cross Section
+G4int     G4QHyperonPlusElasticCrossSection::lastI=0;   // The last position in the DAMDB
+
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::PAR;//Vector ofParsForFunctCalcul
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::CST;//Vector ofCrossSection table
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::SST;//Vector ofThe1st SquardSlope
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::S1T;//Vector of the 1st mantissa
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::B1T;//Vector of the1st slope
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::S2T;//Vector of the2nd mantissa
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::B2T;//Vector of the2nd slope
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::S3T;//Vector of the3d mantissa
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::B3T;//Vector of the3d slope
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::S4T;//Vector ofThe4th mantissa(g)
+std::vector<G4double*> G4QHyperonPlusElasticCrossSection::B4T;//Vector ofThe4th slope(glor)
+
+G4QHyperonPlusElasticCrossSection::G4QHyperonPlusElasticCrossSection()
+{
+}
+
+G4QHyperonPlusElasticCrossSection::~G4QHyperonPlusElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QHyperonPlusElasticCrossSection::GetPointer()
+{
+  static G4QHyperonPlusElasticCrossSection theCrossSection;//StaticBody of the QElCrossSect
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QHyperonPlusElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QHypPlElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG!=3222)
+  {
+    G4cout<<"*Warning*G4QHyperonPlusElaCS::GetCS:*>Found pPDG="<<pPDG<<" ==> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QHPElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QHPElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyperonPlusElastCS::GetCS: P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QHPElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElCS::GetCrosSec:**>New(inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyperonPlusElCS::GetCS:T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QHyperonPlusElasticCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="
+          <<colN[i]<<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QHyperonPlusElCS::GetCS:CNewP="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElasticCrossSection::GCS:NewThr="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QHyperonPlusElCS::GCS:1st T="<<pEn<<"(CS=0)>Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QHyperonPlusElCS::GetCS:NCS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QHPElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QHyperonPlusElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QHPElCS::GetCSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QHyperonPlusElasticCrossSection::GetCrosSec:**End**, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QHyperonPlusElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F,
+                                    G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QHyperonPlusElasticCS::CalcCS: onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElCS::CalCS:DB updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QHyperonPlusElasticCS::CalcCS:*read*,LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QHPElCS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QHyperonPlusElasticCS::CalcCS:*ini*,lstLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QHyPlElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QHPElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QHyperonPlusElCS::CalcCS:*updated(O)*,LP="<<lastLP<<"<IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QHyPlElCS::CalcCS:lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QHyPlElCrosSec::CalcCS: oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0||blast>=nLast) G4cout<<"G4QHyPlElCS::CCS:b="<<blast<<",n="<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElasticCS::CalculateCS:(E) S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElasticCrossSection::CalcCrossSection:Sig="<<lastSIG<<",P="
+            <<pMom<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QHyperonPlusElasticCS::CalcCrossSect: b="<<blast<<", ls="<<lastL<<",SL="
+              <<S1TL<<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QHyperonPlusElasticCrossSection::CalcCS: s3l="<<S3TL<<", sh3="<<shift
+              <<", s3h="<<lastS3T[lastL]<<", b="<<blast<<", l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QHyperonPlusElasticCrossSection::CalcCS: s4l="<<S4TL<<", sh4="<<shift
+              <<",s4h="<<lastS4T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElasticCS::CalculateCS:(I) S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QHyperonPlusElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QHyperonPlusElasticCrossSection::GetPTables(G4double LP,G4double ILP, G4int PDG,
+                                                       G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_hypel=33;                // #of parameters for pp-elastic (<nPoints=128)
+  //                        -0- -1- -2-  -3-  -4- -5-  -6--7--8--9--10--11--12-13--14-
+  G4double hyp_el[n_hypel]={1.,.002,.12,.0557,3.5,6.72,99.,2.,2.,5.,74.,3.,3.4,.2,.17,
+                            .001,8.,.055,3.64,5.e-5,4000.,1500.,.46,1.2e6,3.5e6,5.e-5,
+                            1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                        -15--16- -17- -18- -19-  -20- -21- -22- -23-  -24-   -25-
+  //                         -26-  -27- -28-  -29- -30- -31- -32-
+  if(PDG == 3222)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_hypel; ip++) lastPAR[ip]=hyp_el[ip]; // PiMinus+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (pel=peh_fit.f)
+        lastPAR[0]=4./(1.+22/asa);                                           // p1
+        lastPAR[1]=2.36*asa/(1.+a*.055/ssa);                                 // p2
+        lastPAR[2]=(1.+.00007*a3/ssa)/(1.+.0026*a2);                         // p3
+        lastPAR[3]=1.76*a/ssa+.00003*a3;                                     // p4
+        lastPAR[4]=(.03+200./a3)/(1.+1.E5/a3/sa);                            // p5
+        lastPAR[5]=5.;                                                       // p6
+        lastPAR[6]=2.E-5/(1.+5.E6/a4);                                       // p7 CB
+        lastPAR[7]=0.;                                                       // p8 not used
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QHPElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QHPElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QHyperonPlusElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QHyperonPlusElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetPTables: PDG="<<PDG
+                 <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetPTa:PDG="<<PDG<<",Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QHyperonPlusElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=3222"<<G4endl;
+    throw G4QException("G4QHyperonPlusElasticCrossSection::GetPTables:onlySiPImplemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QHyperonPlusElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QHyPlElCS::GetExchT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!=3222)G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GET:PDG="<<PDG<<G4endl;
+  if(onlyCS)G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT: onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QHyperonPlusElCS::GetExT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:1p "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:2p "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:3p "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QHyperonPlusElasticCrossSection::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1
+          <<",B1="<<theB1<<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3
+          <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetExT:4a "<<ts4<<"#"<<lastTM
+            <<",d="<<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QHPElCS::GExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QHPElCS::GExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QHPElCS::GetExT: Q2="<<q2<<",r2="<<R2<<",b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QHPElCS::GetExT: Q2="<<q2<<",r3="<<R2<<",b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QHPElCS::GExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QHyperonPlusElasticCS::GetExchT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GET:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QHyperonPlusElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QHyperonPlusECS::GetS:"<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GetSl:onlCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG != 3222)
+  {
+    G4cout<<"*Error*G4QHyperonPlusElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=3222"<<G4endl;
+    throw G4QException("G4QHyperonPlusElasticCrossSection::GetSlope:SigP are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.)) G4cout<<"*NAN*G4QHyperonPlusElCS::GetSlope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QHyperonPlusElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QHyperonPlusElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG!=3222)G4cout<<"*Warning*G4QHyperonPlusElasticCrossSection::GTV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QHyperonPlusElastCS::GetTabV:(1-92)NoIsotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QHyperonPlusElasticCS::GetTabVal:NoIsotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QHyperonPlusECS::GetTV: l="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 ) // Hyperon+P
+  {
+    G4double dl2=lp-lastPAR[9];
+    theSS=lastPAR[32];
+    theS1=(lastPAR[10]+lastPAR[11]*dl2*dl2)/(1.+lastPAR[12]/p4/p)+
+          (lastPAR[13]/p2+lastPAR[14]*p)/(p4+lastPAR[15]*sp);
+    theB1=lastPAR[16]*std::pow(p,lastPAR[17])/(1.+lastPAR[18]/p3);
+    theS2=lastPAR[19]+lastPAR[20]/(p4+lastPAR[21]*p);
+    theB2=lastPAR[22]+lastPAR[23]/(p4+lastPAR[24]/sp); 
+    theS3=lastPAR[25]+lastPAR[26]/(p4*p4+lastPAR[27]*p2+lastPAR[28]);
+    theB3=lastPAR[29]+lastPAR[30]/(p4+lastPAR[31]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QHyperonPlusElasticCrossSection::GetTabV:TM="<<lastTM<<",S1="<<theS1<<",B1="
+          <<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
+    G4double dp=lp-lastPAR[4];
+    return lastPAR[0]/(lastPAR[1]+p2*(lastPAR[2]+p2))+(lastPAR[3]*dp*dp+lastPAR[5]+
+           lastPAR[6]/p2)/(1.+lastPAR[7]/sp+lastPAR[8]/p4);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QHyperonPlusElasticCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QHyperonPlusElasticCS::GetTabV:hA,p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QHyperonPlusElCS::GTV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    G4double dlp=lp-lastPAR[5]; // ax
+    //         p1                p2                 p3
+    return (lastPAR[0]*dlp*dlp+lastPAR[1])/(1.+lastPAR[2]/p)+
+           lastPAR[3]/(p3+lastPAR[4]+lastPAR[5]/p4);
+    //         p4             p5         p6
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QHyperonPlusElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                    G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  static const G4double mSigP= G4QPDGCode(3222).GetMass()*.001; // pion mass MeV to GeV
+  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mSi2= mSigP*mSigP;
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // ---> pipA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mSi2)+mSi2+mt*mt;    // Mondelstam s
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QHyperonPlusElasticCrossSection::GetQ2m:PDG="<<PDG<<",Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QHyperPlusElasticCrossSection::GetQ2max: only Sig+ implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QKaonMinusElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QKaonMinusElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QKaonMinusElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1097 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QKaonMinusElasticCrossSection.cc,v 1.1 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QKaonMinusElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QKaonMinusElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QKaonMinusElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)/D
+const G4int G4QKaonMinusElasticCrossSection::nLast=nPoints-1;// theLastElement inTable /D
+G4double  G4QKaonMinusElasticCrossSection::lPMin=-8.;  //Min tabulatedLogarithmMomentum/D
+G4double  G4QKaonMinusElasticCrossSection::lPMax= 8.;  //Max tabulatedLogarithmMomentum/D
+G4double  G4QKaonMinusElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep inTable /D
+G4bool    G4QKaonMinusElasticCrossSection::onlyCS=true;//Flag toCalculOnlyCS(not Si/Bi)/L
+G4double  G4QKaonMinusElasticCrossSection::lastSIG=0.; //Last calculated cross section /L
+G4double  G4QKaonMinusElasticCrossSection::lastLP=-10.;//LastLog(mom_of IncidentHadron)/L
+G4double  G4QKaonMinusElasticCrossSection::lastTM=0.; //Last t_maximum                /L
+G4double  G4QKaonMinusElasticCrossSection::theSS=0.;  //TheLastSqSlope of 1st difr.Max/L
+G4double  G4QKaonMinusElasticCrossSection::theS1=0.;  //TheLastMantissa of 1st difrMax/L
+G4double  G4QKaonMinusElasticCrossSection::theB1=0.;  //TheLastSlope of 1st difructMax/L
+G4double  G4QKaonMinusElasticCrossSection::theS2=0.;  //TheLastMantissa of 2nd difrMax/L
+G4double  G4QKaonMinusElasticCrossSection::theB2=0.;  //TheLastSlope of 2nd difructMax/L
+G4double  G4QKaonMinusElasticCrossSection::theS3=0.;  //TheLastMantissa of 3d difr.Max/L
+G4double  G4QKaonMinusElasticCrossSection::theB3=0.;  //TheLastSlope of 3d difruct.Max/L
+G4double  G4QKaonMinusElasticCrossSection::theS4=0.;  //TheLastMantissa of 4th difrMax/L
+G4double  G4QKaonMinusElasticCrossSection::theB4=0.;  //TheLastSlope of 4th difructMax/L
+G4int     G4QKaonMinusElasticCrossSection::lastTZ=0;  // Last atomic number of theTarget
+G4int     G4QKaonMinusElasticCrossSection::lastTN=0;  // Last # of neutrons in theTarget
+G4double  G4QKaonMinusElasticCrossSection::lastPIN=0.;// Last initialized max momentum
+G4double* G4QKaonMinusElasticCrossSection::lastCST=0; // Elastic cross-section table
+G4double* G4QKaonMinusElasticCrossSection::lastPAR=0; // ParametersForFunctionCalculation
+G4double* G4QKaonMinusElasticCrossSection::lastSST=0; // E-dep ofSqardSlope of 1st difMax
+G4double* G4QKaonMinusElasticCrossSection::lastS1T=0; // E-dep of mantissa of 1st dif.Max
+G4double* G4QKaonMinusElasticCrossSection::lastB1T=0; // E-dep of the slope of 1st difMax
+G4double* G4QKaonMinusElasticCrossSection::lastS2T=0; // E-dep of mantissa of 2nd difrMax
+G4double* G4QKaonMinusElasticCrossSection::lastB2T=0; // E-dep of the slope of 2nd difMax
+G4double* G4QKaonMinusElasticCrossSection::lastS3T=0; // E-dep of mantissa of 3d difr.Max
+G4double* G4QKaonMinusElasticCrossSection::lastB3T=0; // E-dep of the slope of 3d difrMax
+G4double* G4QKaonMinusElasticCrossSection::lastS4T=0; // E-dep of mantissa of 4th difrMax
+G4double* G4QKaonMinusElasticCrossSection::lastB4T=0; // E-dep of the slope of 4th difMax
+G4int     G4QKaonMinusElasticCrossSection::lastN=0;   // The last N of calculated nucleus
+G4int     G4QKaonMinusElasticCrossSection::lastZ=0;   // The last Z of calculated nucleus
+G4double  G4QKaonMinusElasticCrossSection::lastP=0.;  // LastUsed inCrossSection Momentum
+G4double  G4QKaonMinusElasticCrossSection::lastTH=0.; // Last threshold momentum
+G4double  G4QKaonMinusElasticCrossSection::lastCS=0.; // Last value of the Cross Section
+G4int     G4QKaonMinusElasticCrossSection::lastI=0;   // The last position in the DAMDB
+
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::PAR;//Vector ofParsForFunctCalcul
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::CST;//Vector ofCrossSection table
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::SST;//Vector ofThe1st SquardSlope
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::S1T;//Vector of the 1st mantissa
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::B1T;//Vector of the1st slope
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::S2T;//Vector of the2nd mantissa
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::B2T;//Vector of the2nd slope
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::S3T;//Vector of the3d mantissa
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::B3T;//Vector of the3d slope
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::S4T;//Vector ofThe4th mantissa(g)
+std::vector<G4double*> G4QKaonMinusElasticCrossSection::B4T;//Vector ofThe4th slope(glor)
+
+G4QKaonMinusElasticCrossSection::G4QKaonMinusElasticCrossSection()
+{
+}
+
+G4QKaonMinusElasticCrossSection::~G4QKaonMinusElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QKaonMinusElasticCrossSection::GetPointer()
+{
+  static G4QKaonMinusElasticCrossSection theCrossSection;//StaticBody of the QElCrossSect
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QKaonMinusElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QKaMiusElCS::GetCS:>>>f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG != -321)
+  {
+    G4cout<<"*Warning*G4QKaonMinusElaCS::GetCS:*>Found pPDG="<<pPDG<<" ==> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QKMElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QKMElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QKaonMinusElastCS::GetCS: P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QKMElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElCS::GetCrosSec:****>New(inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QKaonMinusElCS::GetCS: T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QKaonMinusElasticCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="
+          <<colN[i]<<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QKaonMinusElCS::GetCS:CalNewP="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElasticCrossSection::GetCS:NewThr="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QKaonMinusElCS::GetCS:1st T="<<pEn<<"(CS=0)>Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QKaonMinusElCS::GetCS:NCS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QKMElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QKaonMinusElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QKMElCS::GetCSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QKaonMinusElasticCrossSection::GetCrosSec:**End**, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QKaonMinusElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F,
+                                    G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QKaonMinusElasticCS::CalcCS: onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElCS::CalCS:DB updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QKaonMinusElasticCS::CalcCS:*read*,LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QKMElCS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QKaonMinusElasticCS::CalcCS:*ini*,lstLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QKaMiElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QKMElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QKaonMinusElCS::CalcCS:*updated(O)*,LP="<<lastLP<<"<IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QKaMiElCS::CalcCS:lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QKaMiElCrosSec::CalcCS: oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QKMElCS::CCS:b="<<blast<<",n="<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElasticCS::CalculateCS:(E) S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElasticCrossSection::CalcCrossSection:Sig="<<lastSIG<<",P="
+            <<pMom<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QKaonMinusElasticCS::CalcCrossSect: b="<<blast<<", ls="<<lastL<<",SL="
+              <<S1TL<<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QKaonMinusElasticCrossSection::CalcCS: s3l="<<S3TL<<", sh3="<<shift
+              <<", s3h="<<lastS3T[lastL]<<", b="<<blast<<", l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QKaonMinusElasticCrossSection::CalcCS: s4l="<<S4TL<<", sh4="<<shift
+              <<",s4h="<<lastS4T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElasticCS::CalculateCS:(I) S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QKaonMinusElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QKaonMinusElasticCrossSection::GetPTables(G4double LP,G4double ILP, G4int PDG,
+                                                       G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_kmpel=36;                // #of parameters for pp-elastic ( < nPoints=128)
+  //                        -0-   -1- -2-  -3- -4- -5-  -6- -7-   -8-   -9--10- -11--12-
+  G4double kmp_el[n_kmpel]={5.2,.0557,3.5,2.23,.7,.075,.004,.39,.000156,.15,1.,.0156,5.,
+                            74.,3.,3.4,.2,.17,.001,8.,.055,3.64,5.e-5,4000.,1500.,.46,
+                            1.2e6,3.5e6,5.e-5,1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                        -13-14--15-16--17--18--19- -20- -21- -22-  -23- -24- -25-
+  //                        -26-  -27-   -28-  -29-  -30- -31-  -32- -33- -34- -35-
+  if(PDG == -321)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_kmpel; ip++) lastPAR[ip]=kmp_el[ip]; // PiMinus+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (kmael_fit.f)
+        lastPAR[0]=.06*asa/(1.+a*(.01+.1/ssa));                              // p1
+        lastPAR[1]=.75*asa/(1.+.009*a);                                      // p2
+        lastPAR[2]=.1*a2*ssa/(1.+.0015*a2/ssa);                              // p3
+        lastPAR[3]=1./(1.+500./a2);                                          // p4
+        lastPAR[4]=4.2;                                                      // p5
+        lastPAR[5]=0.;                                                       // p6 not used
+        lastPAR[6]=0.;                                                       // p7 not used
+        lastPAR[7]=0.;                                                       // p8 not used
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QKMElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QKMElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QKaonMinusElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QKaonMinusElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetPTables: PDG="<<PDG
+                 <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetPTa:PDG="<<PDG<<",Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QKaonMinusElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=-321"<<G4endl;
+    throw G4QException("G4QKaonMinusElasticCrossSection::GetPTables:onlyK-'s implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QKaonMinusElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QKaMiElCS::GetExchT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!=-321)G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetET:PDG="<<PDG<<G4endl;
+  if(onlyCS) G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT: onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QKaonMinusElCS::GetExT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:1p "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:2p "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:3p "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QKaonMinusElasticCrossSection::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1
+          <<",B1="<<theB1<<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3
+          <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetExT:4a "<<ts4<<"#"<<lastTM
+            <<",d="<<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QKMElCS::GExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QKMElCS::GExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QKMElCS::GetExT: Q2="<<q2<<",r2="<<R2<<",b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QKMElCS::GetExT: Q2="<<q2<<",r3="<<R2<<",b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QKMElCS::GET:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QKaonMinusElasticCS::GetExchT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GET:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QKaonMinusElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QKaonMinusECS::GetS:"<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetSl:onlCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG != -321)
+  {
+    G4cout<<"*Error*G4QKaonMinusElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=-321"<<G4endl;
+    throw G4QException("G4QKaonMinusElasticCrossSection::GetSlope:Only K- is implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QKaonMinusElCS::GetSlope:B1="<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QKaonMinusElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QKaonMinusElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG!=-321)G4cout<<"*Warning*G4QKaonMinusElasticCrossSection::GetTV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QKaonMinusElasticCS::GetTabV:(1-92)NoIsotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QKaonMinusElasticCS::GetTabVal:NoIsotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QKaonMinusECS::GetTV: l="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double psp=p*sp;                    // p*sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 )           // KaonMinus+P
+  {
+    G4double dl2=lp-lastPAR[12];
+    theSS=lastPAR[35];
+    theS1=(lastPAR[13]+lastPAR[14]*dl2*dl2)/(1.+lastPAR[15]/p4/p)+
+          (lastPAR[16]/p2+lastPAR[17]*p)/(p4+lastPAR[18]*sp);
+    theB1=lastPAR[19]*std::pow(p,lastPAR[20])/(1.+lastPAR[21]/p3);
+    theS2=lastPAR[22]+lastPAR[23]/(p4+lastPAR[24]*p);
+    theB2=lastPAR[25]+lastPAR[26]/(p4+lastPAR[27]/sp); 
+    theS3=lastPAR[28]+lastPAR[29]/(p4*p4+lastPAR[30]*p2+lastPAR[31]);
+    theB3=lastPAR[32]+lastPAR[33]/(p4+lastPAR[34]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QKaonMinusElasticCrossSection::GetTabV:TM="<<lastTM<<",S1="<<theS1<<",B1="
+          <<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
+    G4double dp=lp-lastPAR[2];
+    return lastPAR[0]/psp+(lastPAR[1]*dp*dp+lastPAR[3])/(1.-lastPAR[4]/sp+lastPAR[5]/p4)+
+     lastPAR[6]/(sqr(p-lastPAR[7])+lastPAR[8])+lastPAR[9]/(sqr(p-lastPAR[10])+lastPAR[11]);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QKaonMinusElasticCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QKaonMinusElasticCS::GetTabVal:hA,p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QKaonMinusElCS::GTV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    G4double dlp=lp-lastPAR[5]; // ax
+    //         p1               p2          p3                 p4
+    return (lastPAR[0]*dlp*dlp+lastPAR[1]+lastPAR[2]/p3)/(1.+lastPAR[3]/p2/sp);
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QKaonMinusElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                    G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  //static const G4double mPi= G4QPDGCode(211).GetMass()*.001; // pion mass MeV to GeV
+  static const G4double mK= G4QPDGCode(321).GetMass()*.001; // kaon mass MeV to GeV
+  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mK2= mK*mK;
+  //static const G4double mPi2= mPi*mPi;
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // ---> pipA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mK2)+mK2+mt*mt;    // Mondelstam s
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QKaonMinusElasticCrossSection::GetQ2m:PDG="<<PDG<<",Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QKaonMinusElasticCrossSection::GetQ2max:only K- is implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QKaonPlusElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QKaonPlusElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QKaonPlusElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1097 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QKaonPlusElasticCrossSection.cc,v 1.1 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QKaonPlusElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 5-Feb-2010
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 5-Feb-2010
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QKaonPlusElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QKaonPlusElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)/D
+const G4int G4QKaonPlusElasticCrossSection::nLast=nPoints-1;// theLastElement inTable /D
+G4double  G4QKaonPlusElasticCrossSection::lPMin=-8.;  //Min tabulatedLogarithmMomentum/D
+G4double  G4QKaonPlusElasticCrossSection::lPMax= 8.;  //Max tabulatedLogarithmMomentum/D
+G4double  G4QKaonPlusElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep inTable /D
+G4bool    G4QKaonPlusElasticCrossSection::onlyCS=true;//Flag toCalculOnlyCS(not Si/Bi)/L
+G4double  G4QKaonPlusElasticCrossSection::lastSIG=0.; //Last calculated cross section /L
+G4double  G4QKaonPlusElasticCrossSection::lastLP=-10.;//LastLog(mom_of IncidentHadron)/L
+G4double  G4QKaonPlusElasticCrossSection::lastTM=0.; //Last t_maximum                /L
+G4double  G4QKaonPlusElasticCrossSection::theSS=0.;  //TheLastSqSlope of 1st difr.Max/L
+G4double  G4QKaonPlusElasticCrossSection::theS1=0.;  //TheLastMantissa of 1st difrMax/L
+G4double  G4QKaonPlusElasticCrossSection::theB1=0.;  //TheLastSlope of 1st difructMax/L
+G4double  G4QKaonPlusElasticCrossSection::theS2=0.;  //TheLastMantissa of 2nd difrMax/L
+G4double  G4QKaonPlusElasticCrossSection::theB2=0.;  //TheLastSlope of 2nd difructMax/L
+G4double  G4QKaonPlusElasticCrossSection::theS3=0.;  //TheLastMantissa of 3d difr.Max/L
+G4double  G4QKaonPlusElasticCrossSection::theB3=0.;  //TheLastSlope of 3d difruct.Max/L
+G4double  G4QKaonPlusElasticCrossSection::theS4=0.;  //TheLastMantissa of 4th difrMax/L
+G4double  G4QKaonPlusElasticCrossSection::theB4=0.;  //TheLastSlope of 4th difructMax/L
+G4int     G4QKaonPlusElasticCrossSection::lastTZ=0;  // Last atomic number of theTarget
+G4int     G4QKaonPlusElasticCrossSection::lastTN=0;  // Last # of neutrons in theTarget
+G4double  G4QKaonPlusElasticCrossSection::lastPIN=0.;// Last initialized max momentum
+G4double* G4QKaonPlusElasticCrossSection::lastCST=0; // Elastic cross-section table
+G4double* G4QKaonPlusElasticCrossSection::lastPAR=0; // ParametersForFunctionCalculation
+G4double* G4QKaonPlusElasticCrossSection::lastSST=0; // E-dep ofSqardSlope of 1st difMax
+G4double* G4QKaonPlusElasticCrossSection::lastS1T=0; // E-dep of mantissa of 1st dif.Max
+G4double* G4QKaonPlusElasticCrossSection::lastB1T=0; // E-dep of the slope of 1st difMax
+G4double* G4QKaonPlusElasticCrossSection::lastS2T=0; // E-dep of mantissa of 2nd difrMax
+G4double* G4QKaonPlusElasticCrossSection::lastB2T=0; // E-dep of the slope of 2nd difMax
+G4double* G4QKaonPlusElasticCrossSection::lastS3T=0; // E-dep of mantissa of 3d difr.Max
+G4double* G4QKaonPlusElasticCrossSection::lastB3T=0; // E-dep of the slope of 3d difrMax
+G4double* G4QKaonPlusElasticCrossSection::lastS4T=0; // E-dep of mantissa of 4th difrMax
+G4double* G4QKaonPlusElasticCrossSection::lastB4T=0; // E-dep of the slope of 4th difMax
+G4int     G4QKaonPlusElasticCrossSection::lastN=0;   // The last N of calculated nucleus
+G4int     G4QKaonPlusElasticCrossSection::lastZ=0;   // The last Z of calculated nucleus
+G4double  G4QKaonPlusElasticCrossSection::lastP=0.;  // LastUsed inCrossSection Momentum
+G4double  G4QKaonPlusElasticCrossSection::lastTH=0.; // Last threshold momentum
+G4double  G4QKaonPlusElasticCrossSection::lastCS=0.; // Last value of the Cross Section
+G4int     G4QKaonPlusElasticCrossSection::lastI=0;   // The last position in the DAMDB
+
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::PAR;//Vector ofParsForFunctCalcul
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::CST;//Vector ofCrossSection table
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::SST;//Vector ofThe1st SquardSlope
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::S1T;//Vector of the 1st mantissa
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::B1T;//Vector of the1st slope
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::S2T;//Vector of the2nd mantissa
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::B2T;//Vector of the2nd slope
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::S3T;//Vector of the3d mantissa
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::B3T;//Vector of the3d slope
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::S4T;//Vector ofThe4th mantissa(g)
+std::vector<G4double*> G4QKaonPlusElasticCrossSection::B4T;//Vector ofThe4th slope(glor)
+
+G4QKaonPlusElasticCrossSection::G4QKaonPlusElasticCrossSection()
+{
+}
+
+G4QKaonPlusElasticCrossSection::~G4QKaonPlusElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QKaonPlusElasticCrossSection::GetPointer()
+{
+  static G4QKaonPlusElasticCrossSection theCrossSection;//StaticBody of the QElCrossSect
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QKaonPlusElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QKaPlusElCS::GetCS:>>>f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG!=321)
+  {
+    G4cout<<"*Warning*G4QKaonPlusElaCS::GetCS:*>Found pPDG="<<pPDG<<" ==> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QKPElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QKPElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QKaonPlusElastCS::GetCS: P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QKPElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElCS::GetCrosSec:****>New(inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QKaonPlusElCS::GetCS: T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QKaonPlusElasticCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="
+          <<colN[i]<<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QKaonPlusElCS::GetCS:CalNewP="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElasticCrossSection::GetCS:NewThr="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QKaonPlusElCS::GetCS:1st T="<<pEn<<"(CS=0)>Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QKaonPlusElCS::GetCS:NCS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QKPElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QKaonPlusElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QKPElCS::GetCSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QKaonPlusElasticCrossSection::GetCrosSec:**End**, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QKaonPlusElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F,
+                                    G4int I, G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QKaonPlusElasticCS::CalcCS: onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElCS::CalCS:DB updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QKaonPlusElasticCS::CalcCS:*read*,LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QKPElCS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QKaonPlusElasticCS::CalcCS:*ini*,lstLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QKaPlElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QKPElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QKaonPlusElCS::CalcCS:*updated(O)*,LP="<<lastLP<<"<IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QKaPlElCS::CalcCS:lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QKaPlElCrosSec::CalcCS: oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QKPElCS::CCS:b="<<blast<<",n="<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElasticCS::CalculateCS:(E) S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElasticCrossSection::CalcCrossSection:Sig="<<lastSIG<<",P="
+            <<pMom<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QKaonPlusElasticCS::CalcCrossSect: b="<<blast<<", ls="<<lastL<<",SL="
+              <<S1TL<<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QKaonPlusElasticCrossSection::CalcCS: s3l="<<S3TL<<", sh3="<<shift
+              <<", s3h="<<lastS3T[lastL]<<", b="<<blast<<", l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QKaonPlusElasticCrossSection::CalcCS: s4l="<<S4TL<<", sh4="<<shift
+              <<",s4h="<<lastS4T[lastL]<<",b="<<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElasticCS::CalculateCS:(I) S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QKaonPlusElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QKaonPlusElasticCrossSection::GetPTables(G4double LP,G4double ILP, G4int PDG,
+                                                       G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_kppel=35;                // #of parameters for pp-elastic (<nPoints=128)
+  //                        -0--1-  -2-   -3-  -4- -5- -6--7--8--9- -10--11-12--13--14-
+  G4double kpp_el[n_kppel]={.7,.38,.0676,.0557,3.5,2.23,.7,.1,2.,1.,.372,5.,74.,3.,3.4,
+                            .2,.17,.001,8.,.055,3.64,5.e-5,4000.,1500.,.46,1.2e6,3.5e6,
+                            5.e-5,1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                       -15--16--17--18--19- -20-  -21-  -22- -23-  -24- -25-  -26-
+  //                         -27-  -28-  -29- -30-  -31- -32-  -33--34-
+
+  if(PDG == 321)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_kppel; ip++) lastPAR[ip]=kpp_el[ip]; // KPlus+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (kpael_fit.f)
+        lastPAR[0]=.06*asa/(1.+a*(.01+.1/ssa));                              // p1
+        lastPAR[1]=.75*asa/(1.+.009*a);                                      // p2
+        lastPAR[2]=.9*asa*ssa/(1.+.03*a);                                    // p3
+        lastPAR[3]=3.;                                                       // p4
+        lastPAR[4]=4.2;                                                      // p5
+        lastPAR[5]=0.;                                                       // p6 not used
+        lastPAR[6]=0.;                                                       // p7 not used
+        lastPAR[7]=0.;                                                       // p8 not used
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QKPElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QKPElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QKaonPlusElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QKaonPlusElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetPTables: PDG="<<PDG
+                 <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetPTa:PDG="<<PDG<<",Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QKaonPlusElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=321"<<G4endl;
+    throw G4QException("G4QKaonPlusElasticCrossSection::GetPTables:onlyK+ is implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QKaonPlusElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QKaPlElCS::GetExchT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!=321) G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:PDG="<<PDG<<G4endl;
+  if(onlyCS) G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT: onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QKaonPlusElCS::GetExT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:1p "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:2p "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:3p "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QKaonPlusElasticCrossSection::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1
+          <<",B1="<<theB1<<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3
+          <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM
+            <<",d="<<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM
+            <<",d="<<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM
+            <<",d="<<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetExT:4a "<<ts4<<"#"<<lastTM
+            <<",d="<<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QKPElCS::GExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QKPElCS::GExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QKPElCS::GetExT: Q2="<<q2<<",r2="<<R2<<",b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QKPElCS::GetExT: Q2="<<q2<<",r3="<<R2<<",b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QKPElCS::GET:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QKaonPlusElasticCS::GetExchT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GET:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QKaonPlusElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QKaonPlusECS::GetS:"<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetSl:onlCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG != 321)
+  {
+    G4cout<<"*Error*G4QKaonPlusElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=321"<<G4endl;
+    throw G4QException("G4QKaonPlusElasticCrossSection::GetSlope:Only K+ is implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QKaonPlusElCS::GetSlope:B1="<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QKaonPlusElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QKaonPlusElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG!=321)G4cout<<"*Warning*G4QKaonPlusElasticCrossSection::GetTaV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QKaonPlusElasticCS::GetTabV:(1-92)NoIsotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QKaonPlusElasticCS::GetTabVal:NoIsotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QKaonPlusECS::GetTV: l="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 ) // KaonPlus+P
+  {
+    G4double dl2=lp-lastPAR[11];
+    theSS=lastPAR[34];
+    theS1=(lastPAR[12]+lastPAR[13]*dl2*dl2)/(1.+lastPAR[14]/p4/p)+
+          (lastPAR[15]/p2+lastPAR[16]*p)/(p4+lastPAR[17]*sp);
+    theB1=lastPAR[18]*std::pow(p,lastPAR[19])/(1.+lastPAR[20]/p3);
+    theS2=lastPAR[21]+lastPAR[22]/(p4+lastPAR[23]*p);
+    theB2=lastPAR[24]+lastPAR[25]/(p4+lastPAR[26]/sp); 
+    theS3=lastPAR[27]+lastPAR[28]/(p4*p4+lastPAR[29]*p2+lastPAR[30]);
+    theB3=lastPAR[31]+lastPAR[32]/(p4+lastPAR[33]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QKaonPlusElasticCrossSection::GetTabV:TM="<<lastTM<<",S1="<<theS1<<",B1="
+          <<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
+    G4double dp=lp-lastPAR[4];
+    return lastPAR[0]/(lastPAR[2]+sqr(p-lastPAR[1]))+(lastPAR[3]*dp*dp+lastPAR[5])/
+           (1.-lastPAR[6]/sp+lastPAR[7]/p4);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QKaonPlusElasticCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QKaonPlusElasticCS::GetTabVal:hA,p="<<p<<",S1="<<theS1<<",B1="<<theB1
+            <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+            <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QKaonPlusElCS::GTV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    G4double dlp=lp-lastPAR[5]; // ax
+    //         p1                p2          p3                 p4
+    return (lastPAR[0]*dlp*dlp+lastPAR[1]+lastPAR[2]/p2)/(1.+lastPAR[3]/p2/sp);
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QKaonPlusElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                    G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  //static const G4double mPi= G4QPDGCode(211).GetMass()*.001; // pion mass MeV to GeV
+  static const G4double mK= G4QPDGCode(321).GetMass()*.001; // kaon mass MeV to GeV
+  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mK2= mK*mK;
+  //static const G4double mPi2= mPi*mPi;
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // ---> pipA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mK2)+mK2+mt*mt;    // Mondelstam s
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QKaonPlusElasticCrossSection::GetQ2m:PDG="<<PDG<<",Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QKaonPlusElasticCrossSection::GetQ2max:only K+ is implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QNeutronElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QNeutronElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QNeutronElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,2358 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QNeutronElasticCrossSection.cc,v 1.4 2010/04/19 12:40:56 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QNeutronElasticCrossSection for nA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 12-Jan-10 (from G4QElCrSect)
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QNeutronElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QNeutronElasticCrossSection::nPoints=128;//#ofPt in the AMDB tabs(>anyPar)(D)
+const G4int G4QNeutronElasticCrossSection::nLast=nPoints-1;// the Last Element in table (D)
+G4double  G4QNeutronElasticCrossSection::lPMin=-8.;  // Min tabulated log Momentum      (D)
+G4double  G4QNeutronElasticCrossSection::lPMax= 8.;  // Max tabulated log Momentum      (D)
+G4double  G4QNeutronElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// Log step in table  (D)
+G4bool    G4QNeutronElasticCrossSection::onlyCS=true;// Flag to calc only CS (not Si/Bi)(L)
+G4double  G4QNeutronElasticCrossSection::lastSIG=0.; // Last calculated cross section   (L)
+G4double  G4QNeutronElasticCrossSection::lastLP=-10.;// Last log(momOfIncidentHadron)   (L)
+G4double  G4QNeutronElasticCrossSection::lastTM=0.;  // Last t_maximum                  (L)
+G4double  G4QNeutronElasticCrossSection::theSS=0.;   // The Last sq.slope of 1st difMax (L)
+G4double  G4QNeutronElasticCrossSection::theS1=0.;   // The Last mantissa of 1st difMax (L)
+G4double  G4QNeutronElasticCrossSection::theB1=0.;   // The Last slope of 1st difr. Max (L)
+G4double  G4QNeutronElasticCrossSection::theS2=0.;   // The Last mantissa of 2nd difMax (L)
+G4double  G4QNeutronElasticCrossSection::theB2=0.;   // The Last slope of 2nd difr. Max (L)
+G4double  G4QNeutronElasticCrossSection::theS3=0.;   // The Last mantissa of 3d difrMax (L)
+G4double  G4QNeutronElasticCrossSection::theB3=0.;   // The Last slope of 3d difructMax (L)
+G4double  G4QNeutronElasticCrossSection::theS4=0.;   // The Last mantissa of 4th difMax (L)
+G4double  G4QNeutronElasticCrossSection::theB4=0.;   // The Last slope of 4th difr. Max (L)
+G4int     G4QNeutronElasticCrossSection::lastTZ=0;   // Last atomic number of the target
+G4int     G4QNeutronElasticCrossSection::lastTN=0;   // Last # of neutrons in the target
+G4double  G4QNeutronElasticCrossSection::lastPIN=0.; // Last initialized max momentum
+G4double* G4QNeutronElasticCrossSection::lastCST=0;  // Elastic cross-section table
+G4double* G4QNeutronElasticCrossSection::lastPAR=0;  // Parameters of FunctionalCalculation
+G4double* G4QNeutronElasticCrossSection::lastSST=0;  // E-dep of sq.slope of the 1st difMax
+G4double* G4QNeutronElasticCrossSection::lastS1T=0;  // E-dep of mantissa of the 1st difMax
+G4double* G4QNeutronElasticCrossSection::lastB1T=0;  // E-dep of theSlope of the 1st difMax
+G4double* G4QNeutronElasticCrossSection::lastS2T=0;  // E-dep of mantissa of the 2nd difMax
+G4double* G4QNeutronElasticCrossSection::lastB2T=0;  // E-dep of theSlope of the 2nd difMax
+G4double* G4QNeutronElasticCrossSection::lastS3T=0;  // E-dep of mantissa of the 3d difrMax
+G4double* G4QNeutronElasticCrossSection::lastB3T=0;  // E-dep of the slope of the 3d difMax
+G4double* G4QNeutronElasticCrossSection::lastS4T=0;  // E-dep of mantissa of the 4th difMax
+G4double* G4QNeutronElasticCrossSection::lastB4T=0;  // E-dep of theSlope of the 4th difMax
+G4int     G4QNeutronElasticCrossSection::lastN=0;    // The last N of calculated nucleus
+G4int     G4QNeutronElasticCrossSection::lastZ=0;    // The last Z of calculated nucleus
+G4double  G4QNeutronElasticCrossSection::lastP=0.;   // Last used in cross section Momentum
+G4double  G4QNeutronElasticCrossSection::lastTH=0.;  // Last threshold momentum
+G4double  G4QNeutronElasticCrossSection::lastCS=0.;  // Last value of the Cross Section
+G4int     G4QNeutronElasticCrossSection::lastI=0;    // The last position in the DAMDB
+
+std::vector<G4double*> G4QNeutronElasticCrossSection::PAR; // Vector of params forFunctCalc
+std::vector<G4double*> G4QNeutronElasticCrossSection::CST; // Vector of cross-section table
+std::vector<G4double*> G4QNeutronElasticCrossSection::SST; // Vector of the 1st sq. slope
+std::vector<G4double*> G4QNeutronElasticCrossSection::S1T; // Vector of the first mantissa
+std::vector<G4double*> G4QNeutronElasticCrossSection::B1T; // Vector of the first slope
+std::vector<G4double*> G4QNeutronElasticCrossSection::S2T; // Vector of the secon mantissa
+std::vector<G4double*> G4QNeutronElasticCrossSection::B2T; // Vector of the second slope
+std::vector<G4double*> G4QNeutronElasticCrossSection::S3T; // Vector of the third mantissa
+std::vector<G4double*> G4QNeutronElasticCrossSection::B3T; // Vector of the third slope
+std::vector<G4double*> G4QNeutronElasticCrossSection::S4T; // Vector of the 4th mantissa
+std::vector<G4double*> G4QNeutronElasticCrossSection::B4T; // Vector of the 4th slope
+
+G4QNeutronElasticCrossSection::G4QNeutronElasticCrossSection()
+{
+}
+
+G4QNeutronElasticCrossSection::~G4QNeutronElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QNeutronElasticCrossSection::GetPointer()
+{
+  static G4QNeutronElasticCrossSection theCrossSection;//*StatBody of the QEl CrossSection*
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QNeutronElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                        G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef debug
+  G4cout<<"G4QNElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG!=2112)
+  {
+    G4cout<<"G4QNeutronElCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                     // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef debug
+      G4cout<<"G4QNeutElCS::GetCS:Found,P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef debug
+        G4cout<<"G4QNeutElCS::GetCS:Found,T="<<pEn<<"<Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];                // Last Momentum  (A-dependent)
+      lastCS =colCS[i];                // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef debug
+        G4cout<<"G4QNeutronElasticCS::GetCrosS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef debug
+      G4cout<<"G4QNElCrS::G:UpdateDB,P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef debug
+      G4cout<<"G4QNeutronElCS::GetCrosSec:*****>New (inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef debug
+        G4cout<<"G4QNeutronElCS::GetCS:New,T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef debug
+    G4cout<<"---G4QNeutronElasticCrossSection::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="
+          <<colN[i]<<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  }
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef debug
+    G4cout<<"G4QNElCrS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef debug
+      G4cout<<"G4QNeutronElCrosSect::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef debug
+        G4cout<<"G4QNeutElCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef debug
+    G4cout<<"G4QNElCrS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef debug
+    G4cout<<"G4QNElCrS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef debug
+    G4cout<<"G4QNeutronElasticCrossSection::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef debug
+  G4cout<<"G4QNElCS::GetCrSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QNeutronElasticCrossSection::GetCrSec:***End***, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QNeutronElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F,G4int I,
+                                             G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef debug
+  G4cout<<"G4QNeutronElasticCrosS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef debug
+      G4cout<<"G4QNElasticCS::CalcCS: DB is updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef debug
+    G4cout<<"G4QNeutronElasticCrosS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef debug
+      G4cout<<"G4QNElCrS::CalcCS:updated(I),LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef debug
+    G4cout<<"G4QNeutronElasticCrosS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef debug
+    G4cout<<"G4QNElCS::CalcCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef debug
+  G4cout<<"G4QNElCrS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef debug
+    G4cout<<"G4QNeutronElCrS::CalcCS:*updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef debug
+  G4cout<<"G4QNEltCrS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef debug
+  G4cout<<"G4QNeutElastCroSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<",p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QNeutElCS::CCS:b="<<blast<<","<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef debug
+      G4cout<<"G4QNeutronElasticCrossSection::CalcCS:(E)S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef debug
+      G4cout<<"G4QNeutronElCS::CalcCrossSection: Sig="<<lastSIG<<", P="<<pMom<<", Z="<<tgZ
+            <<", N="<<tgN<<", PDG="<<PDG<<", onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef debug
+        G4cout<<"G4QNeutronElCrS::CalcCrossSection:bl="<<blast<<",ls="<<lastL<<",SL="<<S1TL
+              <<",SU="<<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef debug
+        G4cout<<"G4QNElCS::CCS: s3l="<<S3TL<<",sh3="<<shift<<",s3h="<<lastS3T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef debug
+        G4cout<<"G4QNElCS::CCS: s4l="<<S4TL<<",sh4="<<shift<<",s4h="<<lastS4T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef debug
+      G4cout<<"G4QNeutronElasticCrossSection::CalcCS:(I)S1="<<theS1<<",B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef debug
+  G4cout<<"G4QNeutronElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QNeutronElasticCrossSection::GetPTables(G4double LP, G4double ILP, G4int PDG,
+                                                   G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_npel=24;                // #of parameters for np-elastic (<nPoints=128)
+  const G4int n_ppel=32;                // #of parameters for pp-elastic (<nPoints=128)
+  //                      -0- -1-  -2- -3- -4-  -5- -6- -7- -8- -9--10--11--12--13- -14-
+  G4double np_el[n_npel]={12.,.05,.0001,5.,.35,6.75,.14,19.,.6,6.75,.14,13.,.14,.6,.00013,
+                          75.,.001,7.2,4.32,.012,2.5,0.0,12.,.34};
+  //                      -15--16--17- -18- -19--20--21--22--23-
+  //                       -0-   -1-  -2- -3- -4- -5-  -6-  -7-  -8--9--10--11--12--13-
+  G4double pp_el[n_ppel]={2.865,18.9,.6461,3.,9.,.425,.4276,.0022,5.,74.,3.,3.4,.2,.17,
+                          .001,8.,.055,3.64,5.e-5,4000.,1500.,.46,1.2e6,3.5e6,5.e-5,1.e10,
+                          8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                      -14--15- -16- -17- -18-  -19- -20- -21- -22-  -23-   -24-  -25-
+  //                       -26- -27-  -28- -29- -30- -31-
+  //==> n (Z=0)
+  static const G4int N0=1; // *** Not used (fake)***
+  static const G4double pZ0N1[7]={0., 0., 0., 0., 0., 0., 0.}; // Not used (fake)
+  static const std::pair<G4int, const G4double*> Z0N1=std::make_pair(1,pZ0N1);
+  static const std::pair<G4int, const G4double*> Z0[N0]={Z0N1};
+  //==> H (Z=1) *** protons are treated separately ***
+  static const G4int N1=3;
+  static const G4double pZ1N0[7]={0., 0., 0., 0., 0., 0., 0.}; // Not used (fake)
+  static const std::pair<G4int, const G4double*> Z1N0=std::make_pair(0,pZ1N0);
+  static const G4double pZ1N1[7]={6.E-5, 4., .055, 1.1E-8, .008, 1.2E-8, .019};
+  static const std::pair<G4int, const G4double*> Z1N1=std::make_pair(1,pZ1N1);
+  static const G4double pZ1N2[7]={6.E-5, 2.2, .051, 1.E-8, .04, 9.E-8, .0075};
+  static const std::pair<G4int, const G4double*> Z1N2=std::make_pair(2,pZ1N2);
+  static const std::pair<G4int, const G4double*> Z1[N1]={Z1N0, Z1N1, Z1N2};
+  //==> He(Z=2)
+  static const G4int N2=2;
+  static const G4double pZ2N1[7]={6.E-5, 3., .06, 4.E-9, .03, 7.E-8, .015};
+  static const std::pair<G4int, const G4double*> Z2N1=std::make_pair(1,pZ2N1);
+  static const G4double pZ2N2[7]={3.E-4, .23, 1., 1.5E-9, 2.E-02, 1.E-8, .003};
+  static const std::pair<G4int, const G4double*> Z2N2=std::make_pair(2,pZ2N2);
+  static const std::pair<G4int, const G4double*> Z2[N2]={Z2N1, Z2N2};
+  //==> Li(Z=3)
+  static const G4int N3=2;
+  static const G4double pZ3N3[7]={3.1E-7, 1.7, 1.3E-4, 1.E-8, .02, 1.1E-7, .0023};
+  static const std::pair<G4int, const G4double*> Z3N1=std::make_pair(3,pZ3N3);
+  static const G4double pZ3N4[7]={1.3E-6, 1.8, 7.6E-4, 9.E-9, .03, 1.E-7, .0029};
+  static const std::pair<G4int, const G4double*> Z3N2=std::make_pair(4,pZ3N4);
+  static const std::pair<G4int, const G4double*> Z3[N3]={Z3N1, Z3N2};
+  //==> Be(Z=4)
+  static const G4int N4=2;
+  static const G4double pZ4N3[7]={2.E-4, 1.4, 2.7, 0., .02, 5.E-8, 0.};
+  static const std::pair<G4int, const G4double*> Z4N3=std::make_pair(3,pZ4N3);
+  static const G4double pZ4N5[7]={1.E-6, 5.7, .0011, 3.E-9, .007, 2.E-8, .016};
+  static const std::pair<G4int, const G4double*> Z4N5=std::make_pair(5,pZ4N5);
+  static const std::pair<G4int, const G4double*> Z4[N4]={Z4N3,Z4N5};
+  //==> B (Z=5)
+  static const G4int N5=2;
+  static const G4double pZ5N5[7]={8.E-7, 5., 3.4E-4, 7.E-9, 1.E-02, 1.E-07, .0053};
+  static const std::pair<G4int, const G4double*> Z5N5=std::make_pair(5,pZ5N5);
+  static const G4double pZ5N6[7]={4.8E-6, 6.6, .0035, 4.E-9, .003, 1.E-8, .012};
+  static const std::pair<G4int, const G4double*> Z5N6=std::make_pair(6,pZ5N6);
+  static const std::pair<G4int, const G4double*> Z5[N5]={Z5N5, Z5N6};
+  //==> C (Z=6) *** Only nat (C13=C12=C_nat) ***
+  static const G4int N6=2;
+  static const G4double pZ6N6[7]={4.9E-6, 6.6, .0035, 4.E-9, .002, 6.E-9, .011};
+  static const std::pair<G4int, const G4double*> Z6N6=std::make_pair(6,pZ6N6);
+  static const G4double pZ6N7[7]={4.9E-6, 6.6, .0035, 4.E-9, .002, 6.E-9, .011};
+  static const std::pair<G4int, const G4double*> Z6N7=std::make_pair(7,pZ6N7);
+  static const std::pair<G4int, const G4double*> Z6[N6]={Z6N6, Z6N7};
+  //==> N (Z=7)
+  static const G4int N7=2;
+  static const G4double pZ7N7[7]={4.9E-6, 1.6, .03, .4E-9, .02, 6.E-8, .021};
+  static const std::pair<G4int, const G4double*> Z7N7=std::make_pair(7,pZ7N7);
+  static const G4double pZ7N8[7]={2.5E-6, 5., .0021, 2.5E-9, .015, 5.E-8, .009};
+  static const std::pair<G4int, const G4double*> Z7N8=std::make_pair(8,pZ7N8);
+  static const std::pair<G4int, const G4double*> Z7[N7]={Z7N7, Z7N8};
+  //==> O (Z=8) (O18=O17, No data)
+  static const G4int N8=3;
+  static const G4double pZ8N8[7]={2.5E-6, 5.3, .0018, 3.E-9, .01, 1.5E-8, .0075};
+  static const std::pair<G4int, const G4double*> Z8N8=std::make_pair(8,pZ8N8);
+  static const G4double pZ8N9[7]={1.4E-6, 2.1, .0025, 1.3E-9, .02, 1.3E-7, .0072};
+  static const std::pair<G4int, const G4double*> Z8N9=std::make_pair(9,pZ8N9);
+  static const G4double pZ8N10[7]={1.4E-6, 2.1, .0025, 1.3E-9, .02, 1.3E-7, .0072};
+  static const std::pair<G4int, const G4double*> Z8N10=std::make_pair(10,pZ8N10);
+  static const std::pair<G4int, const G4double*> Z8[N8]={Z8N8, Z8N9, Z8N10};
+  //==> F (Z=9)
+  static const G4int N9=1;
+  static const G4double pZ9N10[7]={1.4E-6, 7.5, 6.7E-4, 4.E-9, 2.E-5, 7.E-12, .0066};
+  static const std::pair<G4int, const G4double*> Z9N10=std::make_pair(10,pZ9N10);
+  static const std::pair<G4int, const G4double*> Z9[N9]={Z9N10};
+  //==> Ne(Z=10) *** No data *** (Ne20=Na22, Ne21=F19, Ne22=Na22)
+  static const G4int N10=3;
+  static const G4double pZ10N10[7]={1.4E-5, 7., .01, 0., 3.E-11, 7.E-24, .12};
+  static const std::pair<G4int, const G4double*> Z10N10=std::make_pair(10,pZ10N10);
+  static const G4double pZ10N11[7]={1.4E-6, 7.5, 6.7E-4, 4.E-9, 2.E-5, 7.E-12, .0066};
+  static const std::pair<G4int, const G4double*> Z10N11=std::make_pair(11,pZ10N11);
+  static const G4double pZ10N12[7]={1.4E-5, 7., .01, 0., 3.E-11, 7.E-24, .12};
+  static const std::pair<G4int, const G4double*> Z10N12=std::make_pair(12,pZ10N12);
+  static const std::pair<G4int, const G4double*> Z10[N10]={Z10N10, Z10N11, Z10N12};
+  //==> Na(Z=11)
+  static const G4int N11=2;
+  static const G4double pZ11N11[7]={1.4E-5, 7., .01, 0., 3.E-11, 7.E-24, .12};
+  static const std::pair<G4int, const G4double*> Z11N11=std::make_pair(11,pZ11N11);
+  static const G4double pZ11N12[7]={1.4E-6, 7.6, 6.E-4, 5.E-9, 7.E-9, 3.E-18, .0056};
+  static const std::pair<G4int, const G4double*> Z11N12=std::make_pair(12,pZ11N12);
+  static const std::pair<G4int, const G4double*> Z11[N11]={Z11N11, Z11N12};
+  //==> Mg(Z=12)
+  static const G4int N12=3;
+  static const G4double pZ12N12[7]={8.E-7, 3., .001, 1.8E-9, .0015, .2E-9, .006};
+  static const std::pair<G4int, const G4double*> Z12N12=std::make_pair(12,pZ12N12);
+  static const G4double pZ12N13[7]={8.E-7, 7., 3.E-4, 6.E-9, .006, 4.E-8, .0042};
+  static const std::pair<G4int, const G4double*> Z12N13=std::make_pair(13,pZ12N13);
+  static const G4double pZ12N14[7]={1.2E-6, 6.8, 5.E-4, 5.E-9, .007, 2.E-8, .0044};
+  static const std::pair<G4int, const G4double*> Z12N14=std::make_pair(14,pZ12N14);
+  static const std::pair<G4int, const G4double*> Z12[N12]={Z12N12, Z12N13, Z12N14};
+  //==> Al(Z=13)
+  static const G4int N13=1;
+  static const G4double pZ13N14[7]={3.E-7, 5., 8.4E-5, 7.E-9, .008, 2.E-8, .0022};
+  static const std::pair<G4int, const G4double*> Z13N14=std::make_pair(14,pZ13N14);
+  static const std::pair<G4int, const G4double*> Z13[N13]={Z13N14};
+  //==> Si(Z=14)
+  static const G4int N14=3;
+  static const G4double pZ14N14[7]={1.2E-6, 6., 4.E-4, 6.E-9, .012, 8.E-8, .0029};
+  static const std::pair<G4int, const G4double*> Z14N14=std::make_pair(14,pZ14N14);
+  static const G4double pZ14N15[7]={2.4E-6, 4., .0016, 3.E-9, .018, 6.E-8, .0037};
+  static const std::pair<G4int, const G4double*> Z14N15=std::make_pair(15,pZ14N15);
+  static const G4double pZ14N16[7]={6.E-7, 4., 3.7E-4, 3.E-9, .018, 6.E-8, .0036};
+  static const std::pair<G4int, const G4double*> Z14N16=std::make_pair(16,pZ14N16);
+  static const std::pair<G4int, const G4double*> Z14[N14]={Z14N14, Z14N15, Z14N16};
+  //==> P (Z=15)
+  static const G4int N15=1;
+  static const G4double pZ15N16[7]={6.E-7, 3., 8.2E-4, 1.4E-9, .03, 8.E-8, .0059};
+  static const std::pair<G4int, const G4double*> Z15N16=std::make_pair(16,pZ15N16);
+  static const std::pair<G4int, const G4double*> Z15[N15]={Z15N16};
+  //==> S (Z=16)
+  static const G4int N16=4;
+  static const G4double pZ16N16[7]={6.E-7, 3., 1.9E-4, 5.E-9, .03, 6.E-8, .0013};
+  static const std::pair<G4int, const G4double*> Z16N16=std::make_pair(16,pZ16N16);
+  static const G4double pZ16N17[7]={2.4E-6, 3., .0023, 2.E-9, .03, 6.5E-8, .004};
+  static const std::pair<G4int, const G4double*> Z16N17=std::make_pair(17,pZ16N17);
+  static const G4double pZ16N18[7]={2.4E-6, 1.6, .0031, 1.4E-9, .03, 4.E-08, .0028};
+  static const std::pair<G4int, const G4double*> Z16N18=std::make_pair(18,pZ16N18);
+  static const G4double pZ16N20[7]={2.4E-6, 3.1, .0017, 2.5E-9, .03, 5.E-08, .0029};
+  static const std::pair<G4int, const G4double*> Z16N20=std::make_pair(20,pZ16N20);
+  static const std::pair<G4int, const G4double*> Z16[N16]={Z16N16, Z16N17, Z16N18, Z16N20};
+  //==> Cl(Z=17)
+  static const G4int N17=2;
+  static const G4double pZ17N18[7]={1.2E-7, .04, .062, 3.E-12, 3.E-02, 3.E-08, .027};
+  static const std::pair<G4int, const G4double*> Z17N18=std::make_pair(18,pZ17N18);
+  static const G4double pZ17N20[7]={1.2E-7, 2., 6.8E-5, 2.7E-9, .03, 4.E-8, .0015};
+  static const std::pair<G4int, const G4double*> Z17N20=std::make_pair(20,pZ17N20);
+  static const std::pair<G4int, const G4double*> Z17[N17]={Z17N18, Z17N20};
+  //==> Ar(Z=18)
+  static const G4int N18=3;
+  static const G4double pZ18N18[7]={1.2E-7, .52, .017, 1.1E-11, .03, 3.E-8, .095};
+  static const std::pair<G4int, const G4double*> Z18N18=std::make_pair(18,pZ18N18);
+  static const G4double pZ18N20[7]={1.2E-07, .09, .012, 1.8E-11, .03, 3.E-8, .011};
+  static const std::pair<G4int, const G4double*> Z18N20=std::make_pair(20,pZ18N20);
+  static const G4double pZ18N22[7]={1.2E-7, .65, 1.2E-4, 1.5E-9, .03, 5.E-8, 8.E-4};
+  static const std::pair<G4int, const G4double*> Z18N22=std::make_pair(22,pZ18N22);
+  static const std::pair<G4int, const G4double*> Z18[N18]={Z18N18, Z18N20, Z18N22};
+  //==> K (Z=19)
+  static const G4int N19=3;
+  static const G4double pZ19N20[7]={1.2E-7, 1.3, 1.9E-4, .9E-9, .04, 5.5E-8, .0026};
+  static const std::pair<G4int, const G4double*> Z19N20=std::make_pair(20,pZ19N20);
+  static const G4double pZ19N21[7]={1.6E-7, 1.2, 3.7E-4, .8E-9, .04, 6.5E-8, .0034};
+  static const std::pair<G4int, const G4double*> Z19N21=std::make_pair(21,pZ19N21);
+  static const G4double pZ19N22[7]={6.E-8, 1.3, 1.2E-4, .9E-9, .04, 6.E-8, .0031};
+  static const std::pair<G4int, const G4double*> Z19N22=std::make_pair(22,pZ19N22);
+  static const std::pair<G4int, const G4double*> Z19[N19]={Z19N20, Z19N21, Z19N22};
+  //==> Ca(Z=20)
+  static const G4int N20=6;
+  static const G4double pZ20N20[7]={2.4E-7, 3.4, 2.1E-4, 1.5E-9, .035, 6.E-8, .0037};
+  static const std::pair<G4int, const G4double*> Z20N20=std::make_pair(20,pZ20N20);
+  static const G4double pZ20N22[7]={6.E-8, 2.7, 2.7E-5, 3.E-9, .035, 6.E-8, .0014};
+  static const std::pair<G4int, const G4double*> Z20N22=std::make_pair(22,pZ20N22);
+  static const G4double pZ20N23[7]={1.5E-8, 1.8, 3.4E-5, .6E-9, .04, 6.E-8, .0049};
+  static const std::pair<G4int, const G4double*> Z20N23=std::make_pair(23,pZ20N23);
+  static const G4double pZ20N24[7]={3.E-6, 5., .002, 2.E-9, .03, 7.E-8, .0038};
+  static const std::pair<G4int, const G4double*> Z20N24=std::make_pair(24,pZ20N24);
+  static const G4double pZ20N26[7]={1.7E-5, 18., .0027, 1.E-8, 2.E-7, 7.E-17, .0047};
+  static const std::pair<G4int, const G4double*> Z20N26=std::make_pair(26,pZ20N26);
+  static const G4double pZ20N28[7]={7.6E-6, .4, .07, .13E-9, .05, 4.E-8, .0042};
+  static const std::pair<G4int, const G4double*> Z20N28=std::make_pair(28,pZ20N28);
+  static const std::pair<G4int, const G4double*> Z20[N20]={Z20N20, Z20N22, Z20N23,
+                                                           Z20N24, Z20N26, Z20N28};
+  //==> Sc(Z=21)
+  static const G4int N21=1;
+  static const G4double pZ21N24[7]={3.6E-9, 1.5, 5.2E-5, .1E-9, .05, 1.E-7, .025};
+  static const std::pair<G4int, const G4double*> Z21N24=std::make_pair(24,pZ21N24);
+  static const std::pair<G4int, const G4double*> Z21[N21]={Z21N24};
+  //==> Ti(Z=22)
+  static const G4int N22=5;
+  static const G4double pZ22N24[7]={2.8E-8, 1.8, 5.6E-5, .6E-9, .05, 8.E-8, .0042};
+  static const std::pair<G4int, const G4double*> Z22N24=std::make_pair(24,pZ22N24);
+  static const G4double pZ22N25[7]={3.1E-9, 1.6, 6.E-6, .8E-9, .04, 8.E-8, .0036};
+  static const std::pair<G4int, const G4double*> Z22N25=std::make_pair(25,pZ22N25);
+  static const G4double pZ22N26[7]={3.E-9, 4., 3.2E-6, 1.4E-9, .05, 2.E-7, .0048};
+  static const std::pair<G4int, const G4double*> Z22N26=std::make_pair(26,pZ22N26);
+  static const G4double pZ22N27[7]={1.E-8, 2., 3.4E-6, 4.5E-9, .05, 8.E-8, 7.7E-4};
+  static const std::pair<G4int, const G4double*> Z22N27=std::make_pair(27,pZ22N27);
+  static const G4double pZ22N28[7]={4.E-7, 4., 3.7E-4, 1.E-09, .05, 1.E-7, .0041};
+  static const std::pair<G4int, const G4double*> Z22N28=std::make_pair(28,pZ22N28);
+  static const std::pair<G4int, const G4double*> Z22[N22]={Z22N24, Z22N25, Z22N26,
+                                                         Z22N27, Z22N28};
+  //==> V (Z=23) *** Only nat *** (v50=v51=v_nat)
+  static const G4int N23=2;
+  static const G4double pZ23N27[7]={.3E-9, 2., 8.E-7, .55E-9, .07, 1.7E-7, .0055};
+  static const std::pair<G4int, const G4double*> Z23N27=std::make_pair(27,pZ23N27);
+  static const G4double pZ23N28[7]={.3E-9, 2., 8.E-7, .55E-9, .07, 1.7E-7, .0055};
+  static const std::pair<G4int, const G4double*> Z23N28=std::make_pair(28,pZ23N28);
+  static const std::pair<G4int, const G4double*> Z23[N23]={Z23N27, Z23N28};
+  //==> Cr(Z=24)
+  static const G4int N24=4;
+  static const G4double pZ24N26[7]={1.2E-9, 2.8, 1.E-6, 1.7E-9, .07, 1.7E-7, .0026};
+  static const std::pair<G4int, const G4double*> Z24N26=std::make_pair(26,pZ24N26);
+  static const G4double pZ24N28[7]={4.4E-6, 11., .0012, 5.E-9, .04, 3.E-7, .0032};
+  static const std::pair<G4int, const G4double*> Z24N28=std::make_pair(28,pZ24N28);
+  static const G4double pZ24N29[7]={1.8E-9, 2.4, 6.3E-6, .5E-9, .07, 2.E-7, .0085};
+  static const std::pair<G4int, const G4double*> Z24N29=std::make_pair(29,pZ24N29);
+  static const G4double pZ24N30[7]={4.8E-8, 2.8, 4.4E-5, 1.4E-9, .07, 2.E-7, .0027};
+  static const std::pair<G4int, const G4double*> Z24N30=std::make_pair(30,pZ24N30);
+  static const std::pair<G4int, const G4double*> Z24[N24]={Z24N26, Z24N28, Z24N29, Z24N30};
+  //==> Mn(Z=25)
+  static const G4int N25=1;
+  static const G4double pZ25N30[7]={6.5E-11, 1.4, 1.E-7, .8E-9, .07, 1.7E-7, .0022};
+  static const std::pair<G4int, const G4double*> Z25N30=std::make_pair(30,pZ25N30);
+  static const std::pair<G4int, const G4double*> Z25[N25]={Z25N30};
+  //==> Fe(Z=26)
+  static const G4int N26=4;
+  static const G4double pZ26N28[7]={3.9E-8, 5., 1.7E-5, 3.E-9, .07, 3.E-7, .0023};
+  static const std::pair<G4int, const G4double*> Z26N28=std::make_pair(28,pZ26N28);
+  static const G4double pZ26N30[7]={5.E-9, .4, 1.5E-4, 4.E-11, .1, 3.E-7, .012};
+  static const std::pair<G4int, const G4double*> Z26N30=std::make_pair(30,pZ26N30);
+  static const G4double pZ26N31[7]={.5E-9, .5, 2.6E-6, .3E-9, .11, 5.E-7, .0027};
+  static const std::pair<G4int, const G4double*> Z26N31=std::make_pair(31,pZ26N31);
+  static const G4double pZ26N32[7]={1.E-7, 3.1, 1.E-4, 1.3E-9, .11, 5.E-7, .0031};
+  static const std::pair<G4int, const G4double*> Z26N32=std::make_pair(32,pZ26N32);
+  static const std::pair<G4int, const G4double*> Z26[N26]={Z26N28, Z26N30, Z26N31, Z26N32};
+  //==> Co(Z=27)
+  static const G4int N27=2;
+  static const G4double pZ27N31[7]={4.E-7, 3., .004, 0., .11, 4.5E-7, .07};
+  static const std::pair<G4int, const G4double*> Z27N31=std::make_pair(31,pZ27N31);
+  static const G4double pZ27N32[7]={4.E-7, 5., 5.E-4, 1.2E-9, .13, 6.E-7, .006};
+  static const std::pair<G4int, const G4double*> Z27N32=std::make_pair(32,pZ27N32);
+  static const std::pair<G4int, const G4double*> Z27[N27]={Z27N32, Z27N31};
+  //==> Ni(Z=28)
+  static const G4int N28=6;
+  static const G4double pZ28N30[7]={1.E-7, 2.5, .001, .14E-9, .13, 6.E-7, .025};
+  static const std::pair<G4int, const G4double*> Z28N30=std::make_pair(30,pZ28N30);
+  static const G4double pZ28N31[7]={1.E-7, 19., 1.2E-5, 1.E-8, 4.E-12, 3.E-22, .0024};
+  static const std::pair<G4int, const G4double*> Z28N31=std::make_pair(31,pZ28N31);
+  static const G4double pZ28N32[7]={1.E-8, 2.5, 3.9E-6, 3.5E-9, .13, 6.E-7, .001};
+  static const std::pair<G4int, const G4double*> Z28N32=std::make_pair(32,pZ28N32);
+  static const G4double pZ28N33[7]={5.E-9, 2.6, 1.5E-5, .42E-9, .13, 7.E-7, .008};
+  static const std::pair<G4int, const G4double*> Z28N33=std::make_pair(33,pZ28N33);
+  static const G4double pZ28N34[7]={.24E-9, 2., 1.2E-6, .25E-9, .13, 6.E-7, .0094};
+  static const std::pair<G4int, const G4double*> Z28N34=std::make_pair(34,pZ28N34);
+  static const G4double pZ28N36[7]={1.E-8, 3., 5.5E-8, 2.8E-7, .12, 6.E-7, 1.6E-5};
+  static const std::pair<G4int, const G4double*> Z28N36=std::make_pair(36,pZ28N36);
+  static const std::pair<G4int, const G4double*> Z28[N28]={Z28N30, Z28N31, Z28N32, Z28N33,
+                                                           Z28N34, Z28N36};
+  //==> Cu(Z=29)
+  static const G4int N29=2;
+  static const G4double pZ29N34[7]={1.1E-7, 3.5, 1.6E-4, .9E-9, .13, 7.E-7, .005};
+  static const std::pair<G4int, const G4double*> Z29N34=std::make_pair(34,pZ29N34);
+  static const G4double pZ29N36[7]={1.1E-7, 3.5, 4.3E-4, .3E-9, .13, 7.E-7, .013};
+  static const std::pair<G4int, const G4double*> Z29N36=std::make_pair(36,pZ29N36);
+  static const std::pair<G4int, const G4double*> Z29[N29]={Z29N34, Z29N36};
+  //==> Zn(Z=30) *** Only nat *** (zn64=zn66=zn67=zn68=zn70=zn_nat)
+  static const G4int N30=5;
+  static const G4double pZ30N34[7]={1.1E-7, 4., 1.2E-4, 1.2E-9, .17, 7.E-7, .004};
+  static const std::pair<G4int, const G4double*> Z30N34=std::make_pair(34,pZ30N34);
+  static const G4double pZ30N36[7]={1.1E-7, 4., 1.2E-4, 1.2E-9, .17, 7.E-7, .004};
+  static const std::pair<G4int, const G4double*> Z30N36=std::make_pair(36,pZ30N36);
+  static const G4double pZ30N37[7]={1.1E-7, 4., 1.2E-4, 1.2E-9, .17, 7.E-7, .004};
+  static const std::pair<G4int, const G4double*> Z30N37=std::make_pair(37,pZ30N37);
+  static const G4double pZ30N38[7]={1.1E-7, 4., 1.2E-4, 1.2E-9, .17, 7.E-7, .004};
+  static const std::pair<G4int, const G4double*> Z30N38=std::make_pair(38,pZ30N38);
+  static const G4double pZ30N40[7]={1.1E-7, 4., 1.2E-4, 1.2E-9, .17, 7.E-7, .004};
+  static const std::pair<G4int, const G4double*> Z30N40=std::make_pair(40,pZ30N40);
+  static const std::pair<G4int, const G4double*> Z30[N30]={Z30N34, Z30N36, Z30N37,
+                                                           Z30N38, Z30N40};
+  //==> Ga(Z=31)
+  static const G4int N31=2;
+  static const G4double pZ31N38[7]={5.E-8, 3.7, 1.1E-4, .55E-9, .17, 8.4E-7, .0076};
+  static const std::pair<G4int, const G4double*> Z31N38=std::make_pair(38,pZ31N38);
+  static const G4double pZ31N40[7]={1.E-8, 3.1, 1.7E-5, .7E-9, .17, 9.E-7, .0048};
+  static const std::pair<G4int, const G4double*> Z31N40=std::make_pair(40,pZ31N40);
+  static const std::pair<G4int, const G4double*> Z31[N31]={Z31N38, Z31N40};
+  //==> Ge(Z=32)
+  static const G4int N32=5;
+  static const G4double pZ32N38[7]={5.E-5, 4., .17, .35E-9, .17, 9.E-7, .013};
+  static const std::pair<G4int, const G4double*> Z32N38=std::make_pair(38,pZ32N38);
+  static const G4double pZ32N40[7]={5.E-7, 4.4, .001, .6E-9, .17, 9.E-7, .008};
+  static const std::pair<G4int, const G4double*> Z32N40=std::make_pair(40,pZ32N40);
+  static const G4double pZ32N41[7]={5.E-9, 3., 8.E-6, .7E-9, .17, 1.E-6, .0043};
+  static const std::pair<G4int, const G4double*> Z32N41=std::make_pair(41,pZ32N41);
+  static const G4double pZ32N42[7]={1.E-7, 4.2, 1.7E-4, .7E-9, .17, 1.E-6, .0065};
+  static const std::pair<G4int, const G4double*> Z32N42=std::make_pair(42,pZ32N42);
+  static const G4double pZ32N44[7]={1.E-6, 4.6, .0018, .6E-9, .17, 1.E-6, .0073};
+  static const std::pair<G4int, const G4double*> Z32N44=std::make_pair(44,pZ32N44);
+  static const std::pair<G4int, const G4double*> Z32[N32]={Z32N38, Z32N40, Z32N41,
+                                                           Z32N42, Z32N44};
+  //==> As(Z=33)
+  static const G4int N33=2;
+  static const G4double pZ33N41[7]={1.E-8, 3.4, 1.5E-5, .72E-9, .17, 1.E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z33N41=std::make_pair(41,pZ33N41);
+  static const G4double pZ33N42[7]={1.E-8, 4.1, 1.3E-5, .75E-9, .2, 1.2E-6, .0048};
+  static const std::pair<G4int, const G4double*> Z33N42=std::make_pair(42,pZ33N42);
+  static const std::pair<G4int, const G4double*> Z33[N33]={Z33N41, Z33N42};
+  //==> Se(Z=34)
+  static const G4int N34=7;
+  static const G4double pZ34N40[7]={6.E-8, 7.2, 6.E-5, 1.E-9, .32, 2.E-6, .0063};
+  static const std::pair<G4int, const G4double*> Z34N40=std::make_pair(40,pZ34N40);
+  static const G4double pZ34N42[7]={4.E-5, 7.4, .1, .43E-9, .34, 2.1E-6, .016};
+  static const std::pair<G4int, const G4double*> Z34N42=std::make_pair(42,pZ34N42);
+  static const G4double pZ34N43[7]={1.E-7, 6.2, 1.4E-4, .9E-9, .34, 2.1E-6, .0075};
+  static const std::pair<G4int, const G4double*> Z34N43=std::make_pair(43,pZ34N43);
+  static const G4double pZ34N44[7]={1.E-7, 6.6, 1.3E-4, .9E-9, .34, 2.1E-6, .0075};
+  static const std::pair<G4int, const G4double*> Z34N44=std::make_pair(44,pZ34N44);
+  static const G4double pZ34N45[7]={5.E-8, 6.6, 4.8E-5, 1.2E-9, .4, 2.6E-6, .0055};
+  static const std::pair<G4int, const G4double*> Z34N45=std::make_pair(45,pZ34N45);
+  static const G4double pZ34N46[7]={2.E-7, 7.7, 1.3E-4, 1.7E-9, .34, 2.1E-6, .0043};
+  static const std::pair<G4int, const G4double*> Z34N46=std::make_pair(46,pZ34N46);
+  static const G4double pZ34N48[7]={2.E-7, 8.3, 1.2E-4, 1.7E-9, .34, 2.1E-6, .0043};
+  static const std::pair<G4int, const G4double*> Z34N48=std::make_pair(48,pZ34N48);
+  static const std::pair<G4int, const G4double*> Z34[N34]={Z34N40, Z34N42, Z34N43, Z34N44,
+                                                           Z34N45, Z34N46, Z34N48};
+  //==> Br(Z=35)
+  static const G4int N35=2;
+  static const G4double pZ35N44[7]={5.E-8, 6., 2.8E-5, 2.E-9, .34, 2.1E-6, .0028};
+  static const std::pair<G4int, const G4double*> Z35N44=std::make_pair(44,pZ35N44);
+  static const G4double pZ35N46[7]={4.E-8, 6.2, 3.7E-5, 1.1E-9, .34, 2.1E-6, .0049};
+  static const std::pair<G4int, const G4double*> Z35N46=std::make_pair(46,pZ35N46);
+  static const std::pair<G4int, const G4double*> Z35[N35]={Z35N44, Z35N46};
+  //==> Kr(Z=36)
+  static const G4int N36=7;
+  static const G4double pZ36N42[7]={1.6E-7, 6.8, 2.E-4, .8E-9, .35, 2.1E-6, .0076};
+  static const std::pair<G4int, const G4double*> Z36N42=std::make_pair(42,pZ36N42);
+  static const G4double pZ36N44[7]={1.6E-7, 7.3, 1.6E-4, 1.E-9, .35, 2.1E-6, .0062};
+  static const std::pair<G4int, const G4double*> Z36N44=std::make_pair(44,pZ36N44);
+  static const G4double pZ36N46[7]={1.6E-7, 7.3, 3.3E-4, .7E-9, .35, 2.1E-6, .013};
+  static const std::pair<G4int, const G4double*> Z36N46=std::make_pair(46,pZ36N46);
+  static const G4double pZ36N47[7]={1.6E-6, 7.3, .003, .6E-9, .35, 2.1E-6, .011};
+  static const std::pair<G4int, const G4double*> Z36N47=std::make_pair(47,pZ36N47);
+  static const G4double pZ36N48[7]={1.6E-7, 7.8, 7.6E-5, 2.E-9, .35, 2.1E-6, .0031};
+  static const std::pair<G4int, const G4double*> Z36N48=std::make_pair(48,pZ36N48);
+  static const G4double pZ36N49[7]={6.E-7, 8., 4.8E-4, 1.4E-9, .27, 2.1E-6, .0053};
+  static const std::pair<G4int, const G4double*> Z36N49=std::make_pair(49,pZ36N49);
+  static const G4double pZ36N50[7]={4.E-7, 8.1, 2.7E-4, 1.6E-9, .35, 2.1E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z36N50=std::make_pair(50,pZ36N50);
+  static const std::pair<G4int, const G4double*> Z36[N36]={Z36N42, Z36N44, Z36N46,
+                                                           Z36N47, Z36N48, Z36N49, Z36N50};
+  //==> Rb(Z=37)
+  static const G4int N37=3;
+  static const G4double pZ37N48[7]={1.6E-7, 7.2, 1.4E-4, 1.2E-9, .35, 2.1E-6, .0052};
+  static const std::pair<G4int, const G4double*> Z37N48=std::make_pair(48,pZ37N48);
+  static const G4double pZ37N49[7]={8.E-8, 7.1, 4.7E-5, 1.6E-9, .27, 2.1E-6, .0034};
+  static const std::pair<G4int, const G4double*> Z37N49=std::make_pair(49,pZ37N49);
+  static const G4double pZ37N50[7]={1.E-7, 8., 5.5E-5, 1.9E-9, .27, 1.5E-6, .0036};
+  static const std::pair<G4int, const G4double*> Z37N50=std::make_pair(50,pZ37N50);
+  static const std::pair<G4int, const G4double*> Z37[N37]={Z37N48, Z37N49, Z37N50};
+  //==> Sr(Z=38)
+  static const G4int N38=6;
+  static const G4double pZ38N46[7]={8.E-8, 7.3, 6.E-5, 1.3E-9, .27, 2.E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z38N46=std::make_pair(46,pZ38N46);
+  static const G4double pZ38N48[7]={8.E-8, 9.7, 2.3E-5, 3.5E-9, .4, 2.7E-6, .0023};
+  static const std::pair<G4int, const G4double*> Z38N48=std::make_pair(48,pZ38N48);
+  static const G4double pZ38N49[7]={2.6E-7, 9.5, 1.9E-4, 1.5E-9, .4, 2.7E-6, .0057};
+  static const std::pair<G4int, const G4double*> Z38N49=std::make_pair(49,pZ38N49);
+  static const G4double pZ38N50[7]={2.6E-7, 9.5, 2.E-4, 1.4E-9, .37, 3.2E-6, .0059};
+  static const std::pair<G4int, const G4double*> Z38N50=std::make_pair(50,pZ38N50);
+  static const G4double pZ38N51[7]={1.3E-7, 9.9, 7.5E-5, 1.7E-9, .37, 3.2E-6, .0046};
+  static const std::pair<G4int, const G4double*> Z38N51=std::make_pair(51,pZ38N51);
+  static const G4double pZ38N52[7]={2.6E-7, 9.6, 1.6E-4, 1.8E-9, .37, 2.7E06, .0047};
+  static const std::pair<G4int, const G4double*> Z38N52=std::make_pair(52,pZ38N52);
+  static const std::pair<G4int, const G4double*> Z38[N38]={Z38N46, Z38N48, Z38N49, Z38N50,
+                                                           Z38N51, Z38N52};
+  //==> Y (Z=39)
+  static const G4int N39=3;
+  static const G4double pZ39N50[7]={2.6E-7, 9.9, 2.E-4, 1.1E-9, .37, 3.2E-6, .0062};
+  static const std::pair<G4int, const G4double*> Z39N50=std::make_pair(50,pZ39N50);
+  static const G4double pZ39N51[7]={2.7E-5, 20., .013, 2.2E-9, .37, 1.9E-6, .0078};
+  static const std::pair<G4int, const G4double*> Z39N51=std::make_pair(51,pZ39N51);
+  static const G4double pZ39N52[7]={2.E-7, 9.6, 1.2E-4, 1.7E-9, .37, 3.E-6, .0046};
+  static const std::pair<G4int, const G4double*> Z39N52=std::make_pair(52,pZ39N52);
+  static const std::pair<G4int, const G4double*> Z39[N39]={Z39N50, Z39N51, Z39N52};
+  //==> Zr(Z=40)
+  static const G4int N40=7;
+  static const G4double pZ40N50[7]={1.E-7, 9., 6.2E-5, 1.7E-9, .3, 3.E-6, .0044};
+  static const std::pair<G4int, const G4double*> Z40N50=std::make_pair(50,pZ40N50);
+  static const G4double pZ40N51[7]={5.E-7, 9.8, 5.E-4, 1.E-9, .25, 2.1E-6, .0079};
+  static const std::pair<G4int, const G4double*> Z40N51=std::make_pair(51,pZ40N51);
+  static const G4double pZ40N52[7]={3.E-7, 9.6, 2.2E-4, 1.2E-9, .25, 2.2E-6, .0056};
+  static const std::pair<G4int, const G4double*> Z40N52=std::make_pair(52,pZ40N52);
+  static const G4double pZ40N53[7]={2.E-7, 9.6, 1.2E-4, 1.6E-9, .38, 2.9E-6, .0046};
+  static const std::pair<G4int, const G4double*> Z40N53=std::make_pair(53,pZ40N53);
+  static const G4double pZ40N54[7]={2.E-7, 9.6, 1.8E-4, 1.1E-9, .25, 2.1E-6, .0067};
+  static const std::pair<G4int, const G4double*> Z40N54=std::make_pair(54,pZ40N54);
+  static const G4double pZ40N55[7]={1.8E-7, 9.4, 1.1E-4, 1.6E-9, .33, 2.3E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z40N55=std::make_pair(55,pZ40N55);
+  static const G4double pZ40N56[7]={1.8E-7, 9.4, 1.1E-4, 1.6E-9, .2, 1.5E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z40N56=std::make_pair(56,pZ40N56);
+  static const std::pair<G4int, const G4double*> Z40[N40]={Z40N50, Z40N51, Z40N52, Z40N53,
+                                                           Z40N54, Z40N55, Z40N56};
+  //==> Nb(Z=41)
+  static const G4int N41=3;
+  static const G4double pZ41N52[7]={2.6E-7, 8.3, 2.E-4, 1.2E-9, .4, 4.E-6, .0051};
+  static const std::pair<G4int, const G4double*> Z41N52=std::make_pair(52,pZ41N52);
+  static const G4double pZ41N53[7]={2.E-7, 8.3, 1.6E-4, 1.4E-9, .35, 2.5E-6, .0051};
+  static const std::pair<G4int, const G4double*> Z41N53=std::make_pair(53,pZ41N53);
+  static const G4double pZ41N54[7]={1.5E-7, 8.6, 1.E-4, 1.5E-9, .35, 2.5E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z41N54=std::make_pair(54,pZ41N54);
+  static const std::pair<G4int, const G4double*> Z41[N41]={Z41N52, Z41N52, Z41N52};
+  //==> Mo(Z=42)
+  static const G4int N42=8;
+  static const G4double pZ42N50[7]={2.E-7, 10., 1.1E-4, 1.8E-9, .3, 2.7E-6, .0044};
+  static const std::pair<G4int, const G4double*> Z42N50=std::make_pair(50,pZ42N50);
+  static const G4double pZ42N52[7]={2.1E-7, 10., 1.2E-4, 1.7E-9, .3, 2.8E-6, .0046};
+  static const std::pair<G4int, const G4double*> Z42N52=std::make_pair(52,pZ42N52);
+  static const G4double pZ42N53[7]={3.E-7, 10., 1.9E-4, 1.5E-9, .29, 3.E-6, .005};
+  static const std::pair<G4int, const G4double*> Z42N53=std::make_pair(53,pZ42N53);
+  static const G4double pZ42N54[7]={1.5E-7, 10., 7.1E-5, 2.1E-9, .29, 2.9E-6, .0037};
+  static const std::pair<G4int, const G4double*> Z42N54=std::make_pair(54,pZ42N54);
+  static const G4double pZ42N55[7]={1.9E-7, 9., 1.4E-4, 1.3E-9, .29, 2.8E-6, .0052};
+  static const std::pair<G4int, const G4double*> Z42N55=std::make_pair(55,pZ42N55);
+  static const G4double pZ42N56[7]={1.9E-7, 9.9, 1.1E-4, 1.8E-9, .29, 2.4E-6, .0044};
+  static const std::pair<G4int, const G4double*> Z42N56=std::make_pair(56,pZ42N56);
+  static const G4double pZ42N57[7]={1.4E-7, 8., 1.E-4, 1.4E-9, .34, 2.5E-6, .0044};
+  static const std::pair<G4int, const G4double*> Z42N57=std::make_pair(57,pZ42N57);
+  static const G4double pZ42N58[7]={1.8E-7, 9.5, 1.E-4, 1.7E-9, .27, 2.2E-6, .0041};
+  static const std::pair<G4int, const G4double*> Z42N58=std::make_pair(58,pZ42N58);
+  static const std::pair<G4int, const G4double*> Z42[N42]={Z42N50, Z42N52, Z42N53, Z42N54,
+                                                           Z42N55, Z42N56, Z42N57, Z42N58};
+  //==> Tc(Z=43)
+  static const G4int N43=1;
+  static const G4double pZ43N56[7]={1.E-7, 8., 7.2E-5, 1.4E-9, .24, 2.5E-6, .0044};
+  static const std::pair<G4int, const G4double*> Z43N56=std::make_pair(56,pZ43N56);
+  static const std::pair<G4int, const G4double*> Z43[N43]={Z43N56};
+  //==> Ru(Z=44)
+  static const G4int N44=9;
+  static const G4double pZ44N52[7]={1.9E-7, 10., 1.E-4, 2.1E-9, .4, 4.E-6, .004};
+  static const std::pair<G4int, const G4double*> Z44N52=std::make_pair(52,pZ44N52);
+  static const G4double pZ44N54[7]={1.5E-7, 10., 7.7E-5, 2.1E-9, .29, 2.9E-6, .004};
+  static const std::pair<G4int, const G4double*> Z44N54=std::make_pair(54,pZ44N54);
+  static const G4double pZ44N55[7]={1.8E-7, 10., 6.6E-5, 2.6E-9, .47, 4.6E-6, .0028};
+  static const std::pair<G4int, const G4double*> Z44N55=std::make_pair(55,pZ44N55);
+  static const G4double pZ44N56[7]={1.8E-6, 10., .0017, 1.1E-9, .47, 6.E-6, .0073};
+  static const std::pair<G4int, const G4double*> Z44N56=std::make_pair(56,pZ44N56);
+  static const G4double pZ44N57[7]={1.8E-7, 7.8, 1.3E-4, 1.4E-9, .42, 5.E-6, .0043};
+  static const std::pair<G4int, const G4double*> Z44N57=std::make_pair(57,pZ44N57);
+  static const G4double pZ44N58[7]={1.7E-6, 9.8, .0015, 1.2E-9, .32, 4.E-6, .0065};
+  static const std::pair<G4int, const G4double*> Z44N58=std::make_pair(58,pZ44N58);
+  static const G4double pZ44N59[7]={3.3E-7, 8.7, 1.9E-4, 1.6E-9, .32, 3.8E-6, .0038};
+  static const std::pair<G4int, const G4double*> Z44N59=std::make_pair(59,pZ44N59);
+  static const G4double pZ44N60[7]={3.E-7, 8.7, 1.8E-4, 1.6E-9, .3, 3.2E-6, .004};
+  static const std::pair<G4int, const G4double*> Z44N60=std::make_pair(60,pZ44N60);
+  static const G4double pZ44N61[7]={3.E-7, 8.8, 1.4E-4, 1.9E-9, .3, 3.2E-6, .003};
+  static const std::pair<G4int, const G4double*> Z44N61=std::make_pair(61,pZ44N61);
+  static const std::pair<G4int, const G4double*> Z44[N44]={Z44N52, Z44N54, Z44N55, Z44N56,
+                                                           Z44N57, Z44N58, Z44N59, Z44N60,
+                                                           Z44N61};
+  //==> Rh(Z=45)
+  static const G4int N45=2;
+  static const G4double pZ45N58[7]={8.E-8, 8.7, 4.E-5, 1.8E-9, .29, 2.9E-6, .0033};
+  static const std::pair<G4int, const G4double*> Z45N58=std::make_pair(58,pZ45N58);
+  static const G4double pZ45N60[7]={8.E-8, 8.7, .09, 1.3E-12, .29, 2.9E-6, 7.};
+  static const std::pair<G4int, const G4double*> Z45N60=std::make_pair(60,pZ45N60);
+  static const std::pair<G4int, const G4double*> Z45[N45]={Z45N58, Z45N60};
+  //==> Pd(Z=46)
+  static const G4int N46=7;
+  static const G4double pZ46N56[7]={2.E-7, 9.9, 1.2E-4, 1.5E-9, .35, 3.3E-6, .0045};
+  static const std::pair<G4int, const G4double*> Z46N56=std::make_pair(56,pZ46N56);
+  static const G4double pZ46N58[7]={2.E-7, 9.9, 9.5E-5, 1.8E-9, .4, 4.E-6, .0036};
+  static const std::pair<G4int, const G4double*> Z46N58=std::make_pair(58,pZ46N58);
+  static const G4double pZ46N59[7]={5.6E-7, 9., 4.6E-4, 1.2E-9, .5, 4.8E-6, .0056};
+  static const std::pair<G4int, const G4double*> Z46N59=std::make_pair(59,pZ46N59);
+  static const G4double pZ46N60[7]={2.4E-7, 9.2, 1.2E-4, 1.8E-9, .47, 4.6E-6, .0035};
+  static const std::pair<G4int, const G4double*> Z46N60=std::make_pair(60,pZ46N60);
+  static const G4double pZ46N61[7]={1.2E-7, 9.2, 4.4E-5, 2.8E-9, .5, 4.3E-6, .0025};
+  static const std::pair<G4int, const G4double*> Z46N61=std::make_pair(61,pZ46N61);
+  static const G4double pZ46N62[7]={1.2E-7, 9.2, 3.2E-5, 3.4E-9, .48, 4.5E-6, .0018};
+  static const std::pair<G4int, const G4double*> Z46N62=std::make_pair(62,pZ46N62);
+  static const G4double pZ46N64[7]={4.E-7, 9.1, 2.5E-4, 1.5E-9, .48, 4.7E-6, .0042};
+  static const std::pair<G4int, const G4double*> Z46N64=std::make_pair(64,pZ46N64);
+  static const std::pair<G4int, const G4double*> Z46[N46]={Z46N56, Z46N58, Z46N59,
+                                                           Z46N60, Z46N61, Z46N62, Z46N64};
+  //==> Ag(Z=47)
+  static const G4int N47=4;
+  static const G4double pZ47N60[7]={1.4E-6, 9.7, .0011, 1.4E-9, .55, 5.E-6, .0056};
+  static const std::pair<G4int, const G4double*> Z47N60=std::make_pair(60,pZ47N60);
+  static const G4double pZ47N62[7]={3.E-8, 8.7, 8.5E-6, 3.5E-9, .6, 5.6E-6, .0018};
+  static const std::pair<G4int, const G4double*> Z47N62=std::make_pair(62,pZ47N62);
+  static const G4double pZ47N63[7]={3.E-6, 9.5, .002, 1.5E-9, .58, 5.E-6, .0047};
+  static const std::pair<G4int, const G4double*> Z47N63=std::make_pair(63,pZ47N63);
+  static const G4double pZ47N64[7]={1.5E-7, 9., 9.E-5, 1.7E-9, .58, 5.6E-6, .0039};
+  static const std::pair<G4int, const G4double*> Z47N64=std::make_pair(64,pZ47N64);
+  static const std::pair<G4int, const G4double*> Z47[N47]={Z47N60, Z47N62, Z47N63, Z47N64};
+  //==> Cd(Z=48)
+  static const G4int N48=9;
+  static const G4double pZ48N58[7]={2.9E-7, 10., 1.3E-4, 1.9E-9, .4, 3.8E-6, .0034};
+  static const std::pair<G4int, const G4double*> Z48N58=std::make_pair(58,pZ48N58);
+  static const G4double pZ48N60[7]={2.3E-7, 10., 8.2E-5, 2.5E-9, .5, 4.7E-6, .0026};
+  static const std::pair<G4int, const G4double*> Z48N60=std::make_pair(60,pZ48N60);
+  static const G4double pZ48N62[7]={2.3E-7, 10., 9.9E-5, 2.5E-9, .5, 4.7E-6, .0031};
+  static const std::pair<G4int, const G4double*> Z48N62=std::make_pair(62,pZ48N62);
+  static const G4double pZ48N63[7]={8.4E-7, 11., 4.3E-4, 1.8E-9, .5, 4.5E-6, .0042};
+  static const std::pair<G4int, const G4double*> Z48N63=std::make_pair(63,pZ48N63);
+  static const G4double pZ48N64[7]={4.E-7, 11., 1.8E-4, 1.8E-9, .5, 4.6E-6, .0036};
+  static const std::pair<G4int, const G4double*> Z48N64=std::make_pair(64,pZ48N64);
+  static const G4double pZ48N65[7]={1.6E-6, 12., .001, 0., .5, 4.6E-6, .013};
+  static const std::pair<G4int, const G4double*> Z48N65=std::make_pair(65,pZ48N65);
+  static const G4double pZ48N66[7]={3.E-7, 11., 1.2E-4, 1.9E-9, .5, 4.6E-6, .0031};
+  static const std::pair<G4int, const G4double*> Z48N66=std::make_pair(66,pZ48N66);
+  static const G4double pZ48N67[7]={3.8E-7, 11., 1.7E-4, 2.E-9, .6, 6.6E-6, .0035};
+  static const std::pair<G4int, const G4double*> Z48N67=std::make_pair(67,pZ48N67);
+  static const G4double pZ48N68[7]={6.E-7, 11., 3.3E-4, 1.9E-9, .5, 4.6E-6, .0043};
+  static const std::pair<G4int, const G4double*> Z48N68=std::make_pair(68,pZ48N68);
+  static const std::pair<G4int, const G4double*> Z48[N48]={Z48N58, Z48N60, Z48N62, Z48N63,
+                                                           Z48N64, Z48N65, Z48N66, Z48N67,
+                                                           Z48N68};
+  //==> In(Z=49)
+  static const G4int N49=2;
+  static const G4double pZ49N64[7]={2.7E-7, 12., 8.1E-5, 2.7E-9, .5, 5.E-6, .0026};
+  static const std::pair<G4int, const G4double*> Z49N64=std::make_pair(64,pZ49N64);
+  static const G4double pZ49N66[7]={2.7E-7, 12., 5.5E-5, 4.E-9, .5, 5.E-6, .0018};
+  static const std::pair<G4int, const G4double*> Z49N66=std::make_pair(66,pZ49N66);
+  static const std::pair<G4int, const G4double*> Z49[N49]={Z49N64, Z49N66};
+  //==> Sn(Z=50)
+  static const G4int N50=14;
+  static const G4double pZ50N62[7]={4.E-7, 11., 1.6E-4, 2.2E-9, .5, 4.5E-6, .0032};
+  static const std::pair<G4int, const G4double*> Z50N62=std::make_pair(62,pZ50N62);
+  static const G4double pZ50N63[7]={4.1E-7, 11., 1.6E-4, 2.4E-9, .54, 6.E-6, .0031};
+  static const std::pair<G4int, const G4double*> Z50N63=std::make_pair(63,pZ50N63);
+  static const G4double pZ50N64[7]={5.E-7, 12., 1.9E-4, 2.2E-9, .5, 4.4E-6, .0032};
+  static const std::pair<G4int, const G4double*> Z50N64=std::make_pair(64,pZ50N64);
+  static const G4double pZ50N65[7]={1.E-5, 12., .0077, 1.4E-9, .5, 5.E-6, .0066};
+  static const std::pair<G4int, const G4double*> Z50N65=std::make_pair(65,pZ50N65);
+  static const G4double pZ50N66[7]={5.E-7, 12., 1.8E-4, 2.4E-9, .5, 5.E-6, .0031};
+  static const std::pair<G4int, const G4double*> Z50N66=std::make_pair(66,pZ50N66);
+  static const G4double pZ50N67[7]={1.E-6, 12., 4.4E-4, 1.8E-9, .5, 5.E-6, .0037};
+  static const std::pair<G4int, const G4double*> Z50N67=std::make_pair(67,pZ50N67);
+  static const G4double pZ50N68[7]={5.E-7, 12., 2.E-4, 2.4E-9, .5, 5.E-6, .0033};
+  static const std::pair<G4int, const G4double*> Z50N68=std::make_pair(68,pZ50N68);
+  static const G4double pZ50N69[7]={6.E-7, 12., 2.5E-4, 2.E-9, .5, 5.E-6, .0035};
+  static const std::pair<G4int, const G4double*> Z50N69=std::make_pair(69,pZ50N69);
+  static const G4double pZ50N70[7]={1.E-6, 12., 4.7E-4, 2.E-9, .5, 5.E-6, .0039};
+  static const std::pair<G4int, const G4double*> Z50N70=std::make_pair(70,pZ50N70);
+  static const G4double pZ50N72[7]={1.E-6, 12., 3.7E-4, 2.2E-9, .5, 5.E-6, .0031};
+  static const std::pair<G4int, const G4double*> Z50N72=std::make_pair(72,pZ50N72);
+  static const G4double pZ50N73[7]={5.E-7, 12., 1.7E-4, 2.8E-9, .5, 5.E-6, .0028};
+  static const std::pair<G4int, const G4double*> Z50N73=std::make_pair(73,pZ50N73);
+  static const G4double pZ50N74[7]={5.E-7, 12., 2.E-4, 2.E-9, .5, 5.E-6, .0033};
+  static const std::pair<G4int, const G4double*> Z50N74=std::make_pair(74,pZ50N74);
+  static const G4double pZ50N75[7]={5.E-7, 12., 1.9E-4, 2.8E-9, .5, 5.E-6, .003};
+  static const std::pair<G4int, const G4double*> Z50N75=std::make_pair(75,pZ50N75);
+  static const G4double pZ50N76[7]={5.E-7, 12., 1.7E-4, 2.8E-9, .5, 5.E-6, .0028};
+  static const std::pair<G4int, const G4double*> Z50N76=std::make_pair(76,pZ50N76);
+  static const std::pair<G4int, const G4double*> Z50[N50]={Z50N62, Z50N63, Z50N64, Z50N65,
+                                                           Z50N66, Z50N67, Z50N68, Z50N69,
+                                                           Z50N70, Z50N72, Z50N73, Z50N74,
+                                                           Z50N75, Z50N76};
+  //==> Sb(Z=51)
+  static const G4int N51=5;
+  static const G4double pZ51N70[7]={6.E-7, 12., 2.E-4, 2.8E-9, .5, 5.E-6, .0028};
+  static const std::pair<G4int, const G4double*> Z51N70=std::make_pair(70,pZ51N70);
+  static const G4double pZ51N72[7]={6.E-7, 12., 1.9E-4, 3.E-9, .5, 5.E-6, .0025};
+  static const std::pair<G4int, const G4double*> Z51N72=std::make_pair(72,pZ51N72);
+  static const G4double pZ51N73[7]={1.1E-6, 12., 3.5E-4, 2.9E-9, .5, 5.E-6, .0026};
+  static const std::pair<G4int, const G4double*> Z51N73=std::make_pair(73,pZ51N73);
+  static const G4double pZ51N74[7]={5.5E-7, 12., 1.9E-4, 2.9E-9, .5, 5.E-6, .0027};
+  static const std::pair<G4int, const G4double*> Z51N74=std::make_pair(74,pZ51N74);
+  static const G4double pZ51N75[7]={6.E-7, 12., 2.E-4, 2.9E-9, .5, 5.E-6, .0027};
+  static const std::pair<G4int, const G4double*> Z51N75=std::make_pair(75,pZ51N75);
+  static const std::pair<G4int, const G4double*> Z51[N51]={Z51N70, Z51N72, Z51N73, Z51N74,
+                                                           Z51N75};
+  //==> Te(Z=52)
+  static const G4int N52=11;
+  static const G4double pZ52N68[7]={2.7E-7, 12., 8.4E-5, 3.2E-9, 1., 8.E-6, .0026};
+  static const std::pair<G4int, const G4double*> Z52N68=std::make_pair(68,pZ52N68);
+  static const G4double pZ52N70[7]={2.7E-7, 12., 3.8E-5, 6.E-9, 1., 8.E-6, .0012};
+  static const std::pair<G4int, const G4double*> Z52N70=std::make_pair(70,pZ52N70);
+  static const G4double pZ52N71[7]={2.7E-8, 12., 1.8E-6, 2.E-8, 1., 8.E-6, 4.8E-4};
+  static const std::pair<G4int, const G4double*> Z52N71=std::make_pair(71,pZ52N71);
+  static const G4double pZ52N72[7]={2.6E-6, 14., .0014, 2.E-9, 1., 9.E-6, .005};
+  static const std::pair<G4int, const G4double*> Z52N72=std::make_pair(72,pZ52N72);
+  static const G4double pZ52N73[7]={1.E-6, 14., 2.4E-4, 3.9E-9, 1., 9.E-6, .0022};
+  static const std::pair<G4int, const G4double*> Z52N73=std::make_pair(73,pZ52N73);
+  static const G4double pZ52N74[7]={8.E-7, 14., 2.3E-4, 3.6E-9, 1.4, 1.3E-5, .0028};
+  static const std::pair<G4int, const G4double*> Z52N74=std::make_pair(74,pZ52N74);
+  static const G4double pZ52N75[7]={8.E-7, 14., 2.1E-4, 3.6E-9, 1.4, 1.3E-5, .0025};
+  static const std::pair<G4int, const G4double*> Z52N75=std::make_pair(75,pZ52N75);
+  static const G4double pZ52N76[7]={8.E-7, 14., 2.5E-4, 3.E-9, 1.4, 1.3E-5, .003};
+  static const std::pair<G4int, const G4double*> Z52N76=std::make_pair(76,pZ52N76);
+  static const G4double pZ52N77[7]={5.E-7, 15., 1.2E-4, 4.3E-9, 1.4, 1.4E-5, .0023};
+  static const std::pair<G4int, const G4double*> Z52N77=std::make_pair(77,pZ52N77);
+  static const G4double pZ52N78[7]={8.E-7, 14., 2.7E-4, 2.7E-9, 1.4, 1.3E-5, .0031};
+  static const std::pair<G4int, const G4double*> Z52N78=std::make_pair(78,pZ52N78);
+  static const G4double pZ52N80[7]={4.7E-7, 14., 1.8E-4, 2.2E-9, .83, 1.E-5, .0036};
+  static const std::pair<G4int, const G4double*> Z52N80=std::make_pair(80,pZ52N80);
+  static const std::pair<G4int, const G4double*> Z52[N52]={Z52N68, Z52N70, Z52N71, Z52N72,
+                                                           Z52N73, Z52N74, Z52N75, Z52N76,
+                                                           Z52N77, Z52N78, Z52N80};
+  //==> I (Z=53)
+  static const G4int N53=5;
+  static const G4double pZ53N74[7]={9.4E-7, 14., 2.5E-4, 3.E-9, .7, 7.3E-6, .0025};
+  static const std::pair<G4int, const G4double*> Z53N74=std::make_pair(74,pZ53N74);
+  static const G4double pZ53N76[7]={2.1E-5, 14., .015, 1.1E-9, 1.1, 1.E-5, .007};
+  static const std::pair<G4int, const G4double*> Z53N76=std::make_pair(76,pZ53N76);
+  static const G4double pZ53N77[7]={1.1E-6, 14., 2.4E-4, 3.3E-9, .9, 1.E-5, .0021};
+  static const std::pair<G4int, const G4double*> Z53N77=std::make_pair(77,pZ53N77);
+  static const G4double pZ53N78[7]={5.5E-7, 14., 1.5E-4, 3.7E-9, 1.2, 1.2E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z53N78=std::make_pair(78,pZ53N78);
+  static const G4double pZ53N82[7]={3.2E-6, 14., .0017, 1.8E-9, .8, 8.E-6, .0024};
+  static const std::pair<G4int, const G4double*> Z53N82=std::make_pair(82,pZ53N82);
+  static const std::pair<G4int, const G4double*> Z53[N53]={Z53N74, Z53N76, Z53N77, Z53N78,
+                                                           Z53N82};
+  //==> Xe(Z=54)
+  static const G4int N54=12;
+  static const G4double pZ54N69[7]={3.E-6, 14., 8.E-4, 3.7E-9, .9, 1.1E-5, .15};
+  static const std::pair<G4int, const G4double*> Z54N69=std::make_pair(69,pZ54N69);
+  static const G4double pZ54N70[7]={1.5E-7, 14., 1.4E-6, 9.E-8, .7, 8.E-6, 9.5E-5};
+  static const std::pair<G4int, const G4double*> Z54N70=std::make_pair(70,pZ54N70);
+  static const G4double pZ54N72[7]={1.5E-6, 14., 5.6E-4, 3.E-9, 1.2, 1.1E-5, .0036};
+  static const std::pair<G4int, const G4double*> Z54N72=std::make_pair(72,pZ54N72);
+  static const G4double pZ54N74[7]={1.8E-6, 14., 8.8E-4, 2.E-9, 1.3, 1.2E-5, .0047};
+  static const std::pair<G4int, const G4double*> Z54N74=std::make_pair(74,pZ54N74);
+  static const G4double pZ54N75[7]={1.E-6, 14., 2.6E-4, 3.7E-9, 1.5, 1.4E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z54N75=std::make_pair(75,pZ54N75);
+  static const G4double pZ54N76[7]={1.8E-6, 14., 8.E-4, 2.E-9, 1.2, 1.4E-5, .0042};
+  static const std::pair<G4int, const G4double*> Z54N76=std::make_pair(76,pZ54N76);
+  static const G4double pZ54N77[7]={2.3E-7, 14., 1.9E-5, 9.E-9, 1.2, 1.4E-5, 7.7E-4};
+  static const std::pair<G4int, const G4double*> Z54N77=std::make_pair(77,pZ54N77);
+  static const G4double pZ54N78[7]={6.E-7, 14., 1.6E-4, 3.E-9, 1.2, 1.4E-5, .0025};
+  static const std::pair<G4int, const G4double*> Z54N78=std::make_pair(78,pZ54N78);
+  static const G4double pZ54N79[7]={6.E-7, 14., 1.6E-4, 3.3E-9, 1.6, 1.5E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z54N79=std::make_pair(79,pZ54N79);
+  static const G4double pZ54N80[7]={6.6E-7, 14., 2.1E-4, 2.5E-9, 1.2, 1.4E-5, .003};
+  static const std::pair<G4int, const G4double*> Z54N80=std::make_pair(80,pZ54N80);
+  static const G4double pZ54N81[7]={.03, 40., 2.1, 2.5E-9, 1.E-16, 6.E-36, 140.};
+  static const std::pair<G4int, const G4double*> Z54N81=std::make_pair(81,pZ54N81);
+  static const G4double pZ54N82[7]={3.1E-6, 14., .0019, 1.6E-9, 1., 1.3E-5, .0054};
+  static const std::pair<G4int, const G4double*> Z54N82=std::make_pair(82,pZ54N82);
+  static const std::pair<G4int, const G4double*> Z54[N54]={Z54N69, Z54N70, Z54N72, Z54N74,
+                                                           Z54N75, Z54N76, Z54N77, Z54N78,
+                                                           Z54N79, Z54N80, Z54N81, Z54N82};
+  //==> Cs(Z=55)
+  static const G4int N55=5;
+  static const G4double pZ55N78[7]={1.4E-6, 14., 4.E-4, 3.E-9, 1.2, 1.4E-5, .0026};
+  static const std::pair<G4int, const G4double*> Z55N78=std::make_pair(78,pZ55N78);
+  static const G4double pZ55N79[7]={.028, 14., 44., .5E-9, 1.2, 1.3E-5, .015};
+  static const std::pair<G4int, const G4double*> Z55N79=std::make_pair(79,pZ55N79);
+  static const G4double pZ55N80[7]={2.E-6, 14., 9.5E-4, 2.E-9, 1.2, 1.4E-5, .0042};
+  static const std::pair<G4int, const G4double*> Z55N80=std::make_pair(80,pZ55N80);
+  static const G4double pZ55N81[7]={2.5E-7, 14., 6.5E-5, 3.8E-9, 1.2, 1.4E-5, .0023};
+  static const std::pair<G4int, const G4double*> Z55N81=std::make_pair(81,pZ55N81);
+  static const G4double pZ55N82[7]={2.5E-7, 14., 6.5E-5, 3.8E-9, 1.2, 1.4E-5, .0023};
+  static const std::pair<G4int, const G4double*> Z55N82=std::make_pair(82,pZ55N82);
+  static const std::pair<G4int, const G4double*> Z55[N55]={Z55N78, Z55N79, Z55N80, Z55N81,
+                                                           Z55N82};
+  //==> Ba(Z=56)
+  static const G4int N56=9;
+  static const G4double pZ56N74[7]={4.E-7, 14., 2.8E-5, 1.2E-8, 1.2, 1.5E-5, 6.6E-4};
+  static const std::pair<G4int, const G4double*> Z56N74=std::make_pair(74,pZ56N74);
+  static const G4double pZ56N76[7]={4.E-6, 14., .0022, 1.4E-9, 1.3, 1.6E-5, .0053};
+  static const std::pair<G4int, const G4double*> Z56N76=std::make_pair(76,pZ56N76);
+  static const G4double pZ56N77[7]={2.E-7, 14., 3.7E-5, 5.E-9, 1.1, 1.5E-5, .0016};
+  static const std::pair<G4int, const G4double*> Z56N77=std::make_pair(77,pZ56N77);
+  static const G4double pZ56N78[7]={1.6E-6, 14., 6.E-4, 2.E-9, 1.3, 1.6E-5, .0033};
+  static const std::pair<G4int, const G4double*> Z56N78=std::make_pair(78,pZ56N78);
+  static const G4double pZ56N79[7]={5.E-7, 17., 8.E-5, 4.5E-9, 1.3, 1.6E-5, .0018};
+  static const std::pair<G4int, const G4double*> Z56N79=std::make_pair(79,pZ56N79);
+  static const G4double pZ56N80[7]={2.E-6, 20., 3.E-4, 6.E-9, 1.3, 1.8E-5, .0019};
+  static const std::pair<G4int, const G4double*> Z56N80=std::make_pair(80,pZ56N80);
+  static const G4double pZ56N81[7]={5.8E-6, 20., .0018, 3.E-9, 1.3, 1.7E-5, .0041};
+  static const std::pair<G4int, const G4double*> Z56N81=std::make_pair(81,pZ56N81);
+  static const G4double pZ56N82[7]={2.7E-6, 20., 5.5E-4, 4.E-9, 1.4, 2.E-5, .0027};
+  static const std::pair<G4int, const G4double*> Z56N82=std::make_pair(82,pZ56N82);
+  static const G4double pZ56N84[7]={1.1E-6, 21., 1.E-4, 9.E-9, 2., 2.7E-5, .0012};
+  static const std::pair<G4int, const G4double*> Z56N84=std::make_pair(84,pZ56N84);
+  static const std::pair<G4int, const G4double*> Z56[N56]={Z56N74, Z56N76, Z56N77, Z56N78,
+                                                           Z56N79, Z56N80, Z56N81, Z56N82,
+                                                           Z56N84};
+  //==> La(Z=57)
+  static const G4int N57=3;
+  static const G4double pZ57N81[7]={2.7E-6, 20., .0017, 1.1E-9, 1.4, 2.E-5, .0083};
+  static const std::pair<G4int, const G4double*> Z57N81=std::make_pair(81,pZ57N81);
+  static const G4double pZ57N82[7]={5.4E-6, 20., .0027, 1.5E-9, 1., 1.5E-5, .0065};
+  static const std::pair<G4int, const G4double*> Z57N82=std::make_pair(82,pZ57N82);
+  static const G4double pZ57N83[7]={2.7E-6, 20., 2.6E-4, 6.E-9, 1.4, 2.E-5, .0012};
+  static const std::pair<G4int, const G4double*> Z57N83=std::make_pair(83,pZ57N83);
+  static const std::pair<G4int, const G4double*> Z57[N57]={Z57N81, Z57N82, Z57N83};
+  //==> Ce(Z=58)
+  static const G4int N58=8;
+  static const G4double pZ58N78[7]={1.8E-6, 20., 3.7E-4, 4.E-9, 1.4, 2.E-5, .0028};
+  static const std::pair<G4int, const G4double*> Z58N78=std::make_pair(78,pZ58N78);
+  static const G4double pZ58N80[7]={1.8E-6, 18., 2.6E-4, 6.E-9, 1.3, 2.1E-5, .0017};
+  static const std::pair<G4int, const G4double*> Z58N80=std::make_pair(80,pZ58N80);
+  static const G4double pZ58N81[7]={.0018, 18., 2.9, .6E-9, 1.3, 2.E-5, .02};
+  static const std::pair<G4int, const G4double*> Z58N81=std::make_pair(81,pZ58N81);
+  static const G4double pZ58N82[7]={1.8E-6, 18., 3.7E-4, 5.E-9, 1.3, 2.E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z58N82=std::make_pair(82,pZ58N82);
+  static const G4double pZ58N83[7]={7.2E-6, 20., .0025, 2.3E-9, 1.1, 1.7E-5, .0045};
+  static const std::pair<G4int, const G4double*> Z58N83=std::make_pair(83,pZ58N83);
+  static const G4double pZ58N84[7]={1.2E-6, 18., 2.E-4, 6.E-9, 1.5, 1.9E-5, .0018};
+  static const std::pair<G4int, const G4double*> Z58N84=std::make_pair(84,pZ58N84);
+  static const G4double pZ58N85[7]={1.2E-6, 16., 6.E-4, 1.7E-9, 1.4, 2.E-5, .0053};
+  static const std::pair<G4int, const G4double*> Z58N85=std::make_pair(85,pZ58N85);
+  static const G4double pZ58N86[7]={6.E-7, 18., 1.E-4, 6.E-9, 1.5, 1.9E-5, .0018};
+  static const std::pair<G4int, const G4double*> Z58N86=std::make_pair(86,pZ58N86);
+  static const std::pair<G4int, const G4double*> Z58[N58]={Z58N78, Z58N80, Z58N81, Z58N82,
+                                                           Z58N83, Z58N84, Z58N85, Z58N86};
+  //==> Pr(Z=59)
+  static const G4int N59=3;
+  static const G4double pZ59N82[7]={9.5E-7, 16., 1.6E-4, 4.E-9, 1.4, 2.E-5, .0017};
+  static const std::pair<G4int, const G4double*> Z59N82=std::make_pair(82,pZ59N82);
+  static const G4double pZ59N83[7]={9.5E-7, 16., 1.9E-4, 4.E-9, 1.4, 1.9E-5, .0021};
+  static const std::pair<G4int, const G4double*> Z59N83=std::make_pair(83,pZ59N83);
+  static const G4double pZ59N84[7]={9.5E-6, 16., .019, .4E-9, 2., 2.4E-5, .021};
+  static const std::pair<G4int, const G4double*> Z59N84=std::make_pair(84,pZ59N84);
+  static const std::pair<G4int, const G4double*> Z59[N59]={Z59N82, Z59N83, Z59N84};
+  //==> Nd(Z=60)
+  static const G4int N60=8;
+  static const G4double pZ60N82[7]={9.6E-6, 21., .0036, 2.3E-9, 1.4, 2.E-5, .0052};
+  static const std::pair<G4int, const G4double*> Z60N82=std::make_pair(82,pZ60N82);
+  static const G4double pZ60N83[7]={9.6E-4, 20., 4., .25E-9, 1.4, 2.E-5, .052};
+  static const std::pair<G4int, const G4double*> Z60N83=std::make_pair(83,pZ60N83);
+  static const G4double pZ60N84[7]={4.8E-7, 21., 3.3E-5, 1.E-08, 1.3, 2.2E-5, 9.E-4};
+  static const std::pair<G4int, const G4double*> Z60N84=std::make_pair(84,pZ60N84);
+  static const G4double pZ60N85[7]={.0048, 20., 4.5, .9E-9, 1.3, 2.E-5, .012};
+  static const std::pair<G4int, const G4double*> Z60N85=std::make_pair(85,pZ60N85);
+  static const G4double pZ60N86[7]={1.2E-6, 16., 7.7E-4, 1.5E-9, 1.3, 1.8E-5, .0066};
+  static const std::pair<G4int, const G4double*> Z60N86=std::make_pair(86,pZ60N86);
+  static const G4double pZ60N87[7]={.0012, 15., 8.4, .1E-9, 1.3, 1.5E-5, .071};
+  static const std::pair<G4int, const G4double*> Z60N87=std::make_pair(87,pZ60N87);
+  static const G4double pZ60N88[7]={1.5E-7, 16., 4.1E-5, 2.5E-9, 1.3, 1.6E-5, .0027};
+  static const std::pair<G4int, const G4double*> Z60N88=std::make_pair(88,pZ60N88);
+  static const G4double pZ60N90[7]={1.5E-7, 16., 4.3E-5, 2.5E-9, 1.3, 1.6E-5, .0029};
+  static const std::pair<G4int, const G4double*> Z60N90=std::make_pair(90,pZ60N90);
+  static const std::pair<G4int, const G4double*> Z60[N60]={Z60N82, Z60N83, Z60N84, Z60N85,
+                                                           Z60N86, Z60N87, Z60N88, Z60N90};
+  //==> Pm(Z=61)
+  static const G4int N61=3;
+  static const G4double pZ61N86[7]={6.E-7, 16., 8.E-4, .6E-9, 3., 2.8E-5, .014};
+  static const std::pair<G4int, const G4double*> Z61N86=std::make_pair(86,pZ61N86);
+  static const G4double pZ61N87[7]={6.2E-8, 16., 1.2E-5, 4.E-9, 2.2, 2.5E-5, .0019};
+  static const std::pair<G4int, const G4double*> Z61N87=std::make_pair(87,pZ61N87);
+  static const G4double pZ61N88[7]={3.2E-8, 16., 6.4E-6, 4.E-9, 2.2, 2.5E-5, .002};
+  static const std::pair<G4int, const G4double*> Z61N88=std::make_pair(88,pZ61N88);
+  static const std::pair<G4int, const G4double*> Z61[N61]={Z61N86, Z61N87, Z61N88};
+  //==> Sm(Z=62)
+  static const G4int N62=9;
+  static const G4double pZ62N82[7]={1.2E-7, 16., 2.1E-5, 5.E-9, 1.4, 2.E-5, .0017};
+  static const std::pair<G4int, const G4double*> Z62N82=std::make_pair(82,pZ62N82);
+  static const G4double pZ62N85[7]={1.2E-7, 16., 5.3E-5, 1.5E-9, 1.3, 1.7E-5, .0045};
+  static const std::pair<G4int, const G4double*> Z62N85=std::make_pair(85,pZ62N85);
+  static const G4double pZ62N86[7]={6.E-8, 16., 1.7E-5, 3.E-9, 1.3, 1.7E-5, .0028};
+  static const std::pair<G4int, const G4double*> Z62N86=std::make_pair(86,pZ62N86);
+  static const G4double pZ62N87[7]={6.E-8, 15., 5.2E-4, .11E-9, 1.3, 1.5E-5, .074};
+  static const std::pair<G4int, const G4double*> Z62N87=std::make_pair(87,pZ62N87);
+  static const G4double pZ62N88[7]={6.E-7, 16., 8.6E-4, .7E-9, 1.3, 1.7E-5, .015};
+  static const std::pair<G4int, const G4double*> Z62N88=std::make_pair(88,pZ62N88);
+  static const G4double pZ62N89[7]={6.E-7, 16., 5.E-4, 0., 1.3, 1.6E-5, .053};
+  static const std::pair<G4int, const G4double*> Z62N89=std::make_pair(89,pZ62N89);
+  static const G4double pZ62N90[7]={6.E-8, 15., 1.3E-5, 4.5E-9, 1.3, 1.7E-5, .0019};
+  static const std::pair<G4int, const G4double*> Z62N90=std::make_pair(90,pZ62N90);
+  static const G4double pZ62N91[7]={6.E-8, 15., 1.5E-5, 2.E-9, 1.3, 1.6E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z62N91=std::make_pair(91,pZ62N91);
+  static const G4double pZ62N92[7]={1.2E-7, 15., 8.6E-5, 1.2E-9, 1.3, 1.6E-5, .007};
+  static const std::pair<G4int, const G4double*> Z62N92=std::make_pair(92,pZ62N92);
+  static const std::pair<G4int, const G4double*> Z62[N62]={Z62N82, Z62N85, Z62N86, Z62N87,
+                                                           Z62N88, Z62N89, Z62N90, Z62N91,
+                                                           Z62N92};
+  //==> Eu(Z=63)
+  static const G4int N63=7;
+  static const G4double pZ63N88[7]={6.E-8, 15., 2.8E-5, 2.E-9, 1.3, 1.5E-5, .0046};
+  static const std::pair<G4int, const G4double*> Z63N88=std::make_pair(88,pZ63N88);
+  static const G4double pZ63N89[7]={6.E-7, 15., .0011, .5E-9, 2.4, 2.4E-5, .017};
+  static const std::pair<G4int, const G4double*> Z63N89=std::make_pair(89,pZ63N89);
+  static const G4double pZ63N90[7]={3.E-7, 15., 1.8E-4, 1.1E-9, 1., 1.2E-5, .0054};
+  static const std::pair<G4int, const G4double*> Z63N90=std::make_pair(90,pZ63N90);
+  static const G4double pZ63N91[7]={4.1E-7, 15., 1.4E-4, 1.9E-9, 1., 1.4E-5, .0032};
+  static const std::pair<G4int, const G4double*> Z63N91=std::make_pair(91,pZ63N91);
+  static const G4double pZ63N92[7]={5.E-8, 15., 2.4E-5, 2.8E-9, 1., 1.3E-5, .0037};
+  static const std::pair<G4int, const G4double*> Z63N92=std::make_pair(92,pZ63N92);
+  static const G4double pZ63N93[7]={4.1E-8, 17., 1.6E-5, 2.E-9, 3.3, 3.4E-5, .004};
+  static const std::pair<G4int, const G4double*> Z63N93=std::make_pair(93,pZ63N93);
+  static const G4double pZ63N94[7]={4.2E-8, 17., 1.6E-5, 2.E-9, 1.2, 1.6E-5, .004};
+  static const std::pair<G4int, const G4double*> Z63N94=std::make_pair(94,pZ63N94);
+  static const std::pair<G4int, const G4double*> Z63[N63]={Z63N88, Z63N89, Z63N90, Z63N91,
+                                                           Z63N92, Z63N93, Z63N94};
+  //==> Gd(Z=64)
+  static const G4int N64=8;
+  static const G4double pZ64N88[7]={4.2E-8, 14., 2.E-4, 0., 1.2, 1.3E-5, .19};
+  static const std::pair<G4int, const G4double*> Z64N88=std::make_pair(88,pZ64N88);
+  static const G4double pZ64N89[7]={2.E-6, 14., .0016, 1.4E-9, 1.6, 1.6E-5, .0057};
+  static const std::pair<G4int, const G4double*> Z64N89=std::make_pair(89,pZ64N89);
+  static const G4double pZ64N90[7]={1.7E-7, 12., 8.4E-5, 2.E-9, 1.8, 2.2E-5, .0035};
+  static const std::pair<G4int, const G4double*> Z64N90=std::make_pair(90,pZ64N90);
+  static const G4double pZ64N91[7]={1.7E-7, 13., 5.E-4, .3E-9, 1.7, 1.9E-5, .026};
+  static const std::pair<G4int, const G4double*> Z64N91=std::make_pair(91,pZ64N91);
+  static const G4double pZ64N92[7]={1.7E-7, 13., 7.E-5, 2.5E-9, 1.8, 2.2E-5, .003};
+  static const std::pair<G4int, const G4double*> Z64N92=std::make_pair(92,pZ64N92);
+  static const G4double pZ64N93[7]={1.7E-6, 12., .002, 0., 1.7, 1.8E-5, .47};
+  static const std::pair<G4int, const G4double*> Z64N93=std::make_pair(93,pZ64N93);
+  static const G4double pZ64N94[7]={3.4E-7, 13., 1.5E-4, 2.E-9, 1.8, 2.3E-5, .0034};
+  static const std::pair<G4int, const G4double*> Z64N94=std::make_pair(94,pZ64N94);
+  static const G4double pZ64N96[7]={2.6E-6, 13., .0019, 1.2E-9, 1., 1.2E-5, .0056};
+  static const std::pair<G4int, const G4double*> Z64N96=std::make_pair(96,pZ64N96);
+  static const std::pair<G4int, const G4double*> Z64[N64]={Z64N88, Z64N89, Z64N90, Z64N91,
+                                                           Z64N92, Z64N93, Z64N94, Z64N96};
+  //==> Tb(Z=65)
+  static const G4int N65=2;
+  static const G4double pZ65N94[7]={9.E-7, 16., 3.9E-4, 1.7E-9, 2., 2.2E-5, .0042};
+  static const std::pair<G4int, const G4double*> Z65N94=std::make_pair(94,pZ65N94);
+  static const G4double pZ65N95[7]={4.5E-7, 16., 1.1E-4, 3.E-9, 1.7, 2.2E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z65N95=std::make_pair(95,pZ65N95);
+  static const std::pair<G4int, const G4double*> Z65[N65]={Z65N94, Z65N94};
+  //==> Dy(Z=66)
+  static const G4int N66=7;
+  static const G4double pZ66N90[7]={1.2E-7, 13., 4.E-5, 3.E-9, 1.2, 1.4E-5, .0025};
+  static const std::pair<G4int, const G4double*> Z66N90=std::make_pair(90,pZ66N90);
+  static const G4double pZ66N92[7]={1.2E-7, 13., 6.7E-5, 2.E-9, 1., 1.1E-5, .004};
+  static const std::pair<G4int, const G4double*> Z66N92=std::make_pair(92,pZ66N92);
+  static const G4double pZ66N94[7]={1.2E-7, 13., 5.3E-5, 1.6E-9, 1., 1.1E-5, .0034};
+  static const std::pair<G4int, const G4double*> Z66N94=std::make_pair(94,pZ66N94);
+  static const G4double pZ66N95[7]={1.2E-6, 13., .0017, .7E-9, 1.3, 1.3E-5, .011};
+  static const std::pair<G4int, const G4double*> Z66N95=std::make_pair(95,pZ66N95);
+  static const G4double pZ66N96[7]={1.2E-7, 13., 8.E-6, 1.5E-7, 1., 1.1E-5, 1.E-4};
+  static const std::pair<G4int, const G4double*> Z66N96=std::make_pair(96,pZ66N96);
+  static const G4double pZ66N97[7]={1.5E-7, 13., 4.E-5, 4.E-9, 1.3, 1.3E-5, .002};
+  static const std::pair<G4int, const G4double*> Z66N97=std::make_pair(97,pZ66N97);
+  static const G4double pZ66N98[7]={3.E-7, 13., .001, 4.E-9, 1.3, 1.3E-5, .23};
+  static const std::pair<G4int, const G4double*> Z66N98=std::make_pair(98,pZ66N98);
+  static const std::pair<G4int, const G4double*> Z66[N66]={Z66N90, Z66N92, Z66N94, Z66N95,
+                                                           Z66N96, Z66N97, Z66N98};
+  //==> Ho(Z=67)
+  static const G4int N67=2;
+  static const G4double pZ67N98[7]={3.E-7, 13., 2.2E-4, 1.5E-9, 1., 1.E-5, .0054};
+  static const std::pair<G4int, const G4double*> Z67N98=std::make_pair(98,pZ67N98);
+  static const G4double pZ67N99[7]={7.5E-8, 13., 2.6E-5, 4.5E-9, 1.5, 1.5E-5, .0021};
+  static const std::pair<G4int, const G4double*> Z67N99=std::make_pair(99,pZ67N99);
+  static const std::pair<G4int, const G4double*> Z67[N67]={Z67N98, Z67N99};
+  //==> Er(Z=68)
+  static const G4int N68=6;
+  static const G4double pZ68N94[7]={1.2E-7, 13., 7.8E-5, 1.6E-9, .9, 9.E-6, .005};
+  static const std::pair<G4int, const G4double*> Z68N94=std::make_pair(94,pZ68N94);
+  static const G4double pZ68N96[7]={1.2E-7, 13., 8.5E-5, 1.2E-9, .9, 8.E-6, .0055};
+  static const std::pair<G4int, const G4double*> Z68N96=std::make_pair(96,pZ68N96);
+  static const G4double pZ68N98[7]={1.E-6, 13., .0011, .8E-9, .9, 8.E-6, .0087};
+  static const std::pair<G4int, const G4double*> Z68N98=std::make_pair(98,pZ68N98);
+  static const G4double pZ68N99[7]={1.2E-7, 13., 2.5E-5, 4.5E-9, .9, 9.E-6, .0015};
+  static const std::pair<G4int, const G4double*> Z68N99=std::make_pair(99,pZ68N99);
+  static const G4double pZ68N100[7]={2.E-6, 13., .0015, 1.1E-9, .9, 8.E-6, .0058};
+  static const std::pair<G4int, const G4double*> Z68N100=std::make_pair(100,pZ68N100);
+  static const G4double pZ68N102[7]={2.E-6, 13., .0018, 1.E-9, .9, 8.E-6, .007};
+  static const std::pair<G4int, const G4double*> Z68N102=std::make_pair(102,pZ68N102);
+  static const std::pair<G4int, const G4double*> Z68[N68]={Z68N94, Z68N96, Z68N98,
+                                                           Z68N99, Z68N100, Z68N102};
+  //==> Tm(Z=69) *** No data *** (Tm169=Er167)
+  static const G4int N69=1;
+  static const G4double pZ69N100[7]={1.2E-7, 13., 2.5E-5, 4.5E-9, .9, 9.E-6, .0015};
+  static const std::pair<G4int, const G4double*> Z69N100=std::make_pair(100,pZ69N100);
+  static const std::pair<G4int, const G4double*> Z69[N69]={Z69N100};
+  //==> Yb(Z=70) *** No data *** (Yb168=Er166, Yb170=Er168, Yb171=Er167, Yb172=Er170,
+  //                              Yb173=Hf177, Yb174=Hf176, Yb176=Hf178)
+  static const G4int N70=7;
+  static const G4double pZ70N98[7]={1.E-6, 13., .0011, .8E-9, .9, 8.E-6, .0087};
+  static const std::pair<G4int, const G4double*> Z70N98=std::make_pair(98,pZ70N98);
+  static const G4double pZ70N100[7]={2.E-6, 13., .0015, 1.1E-9, .9, 8.E-6, .0058};
+  static const std::pair<G4int, const G4double*> Z70N100=std::make_pair(100,pZ70N100);
+  static const G4double pZ70N101[7]={1.2E-7, 13., 2.5E-5, 4.5E-9, .9, 9.E-6, .0015};
+  static const std::pair<G4int, const G4double*> Z70N101=std::make_pair(101,pZ70N101);
+  static const G4double pZ70N102[7]={2.E-6, 13., .0018, 1.E-9, .9, 8.E-6, .007};
+  static const std::pair<G4int, const G4double*> Z70N102=std::make_pair(102,pZ70N102);
+  static const G4double pZ70N103[7]={5.E-7, 18., .01, 1.7E-6, 1.2, 1.4E-5, 1.4E-5};
+  static const std::pair<G4int, const G4double*> Z70N103=std::make_pair(103,pZ70N103);
+  static const G4double pZ70N104[7]={5.E-7, 18., 1.9E-4, 2.5E-9, 1.2, 1.4E-5, .004};
+  static const std::pair<G4int, const G4double*> Z70N104=std::make_pair(104,pZ70N104);
+  static const G4double pZ70N106[7]={5.E-7, 18., 1.3E-4, 2.E-9, 1.2, 1.4E-5, .0027};
+  static const std::pair<G4int, const G4double*> Z70N106=std::make_pair(106,pZ70N106);
+  static const std::pair<G4int, const G4double*> Z70[N70]={Z70N98, Z70N100, Z70N101,
+                                                           Z70N102, Z70N103, Z70N104,
+                                                           Z70N106};
+  //==> Lu(Z=71)
+  static const G4int N71=2;
+  static const G4double pZ71N104[7]={5.E-7, 18., 1.8E-4, 2.E-9, .9, 9.E-6, .0036};
+  static const std::pair<G4int, const G4double*> Z71N104=std::make_pair(104,pZ71N104);
+  static const G4double pZ71N105[7]={2.5E-7, 18., 9.E-5, 1.E-8, .9, 9.E-6, .0016};
+  static const std::pair<G4int, const G4double*> Z71N105=std::make_pair(105,pZ71N105);
+  static const std::pair<G4int, const G4double*> Z71[N71]={Z71N104, Z71N105};
+  //==> Hf(Z=72)
+  static const G4int N72=6;
+  static const G4double pZ72N102[7]={1.E-6, 18., 8.8E-4, .8E-9, 1., 1.1E-5, .0092};
+  static const std::pair<G4int, const G4double*> Z72N102=std::make_pair(102,pZ72N102);
+  static const G4double pZ72N104[7]={5.E-7, 18., 1.9E-4, 2.5E-9, 1.2, 1.4E-5, .004};
+  static const std::pair<G4int, const G4double*> Z72N104=std::make_pair(104,pZ72N104);
+  static const G4double pZ72N105[7]={5.E-7, 18., .01, 1.7E-6, 1.2, 1.4E-5, 1.4E-5};
+  static const std::pair<G4int, const G4double*> Z72N105=std::make_pair(105,pZ72N105);
+  static const G4double pZ72N106[7]={5.E-7, 18., 1.3E-4, 2.E-9, 1.2, 1.4E-5, .0027};
+  static const std::pair<G4int, const G4double*> Z72N106=std::make_pair(106,pZ72N106);
+  static const G4double pZ72N107[7]={2.5E-7, 18., 1.E-4, 2.E-9, 1.2, 1.5E-5, .0041};
+  static const std::pair<G4int, const G4double*> Z72N107=std::make_pair(107,pZ72N107);
+  static const G4double pZ72N108[7]={1.E-6, 18., .0012, .6E-9, 1.2, 1.5E-5, .012};
+  static const std::pair<G4int, const G4double*> Z72N108=std::make_pair(108,pZ72N108);
+  static const std::pair<G4int, const G4double*> Z72[N72]={Z72N102, Z72N104, Z72N105,
+                                                           Z72N106, Z72N107, Z72N108};
+  //==> Ta(Z=73)
+  static const G4int N73=2;
+  static const G4double pZ73N108[7]={5.E-7, 18., 1.7E-4, 2.E-9, 1.2, 1.4E-5, .0035};
+  static const std::pair<G4int, const G4double*> Z73N108=std::make_pair(108,pZ73N108);
+  static const G4double pZ73N109[7]={1.E-6, 14., .002, .3E-9, 1.3, 1.5E-5, .016};
+  static const std::pair<G4int, const G4double*> Z73N109=std::make_pair(109,pZ73N109);
+  static const std::pair<G4int, const G4double*> Z73[N73]={Z73N108, Z73N108};
+  //==> W (Z=74) *** W180 only bad TENDL-2008 *** (W180=Hf178)
+  static const G4int N74=5;
+  static const G4double pZ74N106[7]={5.E-7, 18., 1.3E-4, 2.E-9, 1.2, 1.4E-5, .0027};
+  static const std::pair<G4int, const G4double*> Z74N106=std::make_pair(106,pZ74N106);
+  static const G4double pZ74N108[7]={4.E-6, 14., .0034, .9E-9, 1.3, 1.4E-5, .0067};
+  static const std::pair<G4int, const G4double*> Z74N108=std::make_pair(108,pZ74N108);
+  static const G4double pZ74N109[7]={1.2E-7, 14., 3.E-5, 3.E-9, 1.3, 1.4E-5, .0019};
+  static const std::pair<G4int, const G4double*> Z74N109=std::make_pair(109,pZ74N109);
+  static const G4double pZ74N110[7]={1.2E-7, 14., 3.6E-5, 2.E-9, 1.3, 1.3E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z74N110=std::make_pair(110,pZ74N110);
+  static const G4double pZ74N112[7]={1.2E-7, 14., 3.E-5, 1.3E-7, 1.3, 1.3E-5, 1.4E-4};
+  static const std::pair<G4int, const G4double*> Z74N112=std::make_pair(112,pZ74N112);
+  static const std::pair<G4int, const G4double*> Z74[N74]={Z74N106, Z74N108, Z74N109,
+                                                           Z74N110, Z74N112};
+  //==> Re(Z=75)
+  static const G4int N75=2;
+  static const G4double pZ75N110[7]={1.2E-7, 14., 8.E-5, 1.2E-9, 1.3, 1.5E-5, .005};
+  static const std::pair<G4int, const G4double*> Z75N110=std::make_pair(110,pZ75N110);
+  static const G4double pZ75N112[7]={1.2E-7, 14., 8.8E-5, 1.1E-9, 1.3, 1.5E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z75N112=std::make_pair(112,pZ75N112);
+  static const std::pair<G4int, const G4double*> Z75[N75]={Z75N110, Z75N112};
+  //==> Os(Z=76) *** No data *** (Os184=W182, Os186=W184, Os187=Re187, Os188=W186,
+  //                              Os189=Re187, Os190=Os192=W186)
+  static const G4int N76=7;
+  static const G4double pZ76N108[7]={4.E-6, 14., .0034, .9E-9, 1.3, 1.4E-5, .0067};
+  static const std::pair<G4int, const G4double*> Z76N108=std::make_pair(108,pZ76N108);
+  static const G4double pZ76N110[7]={1.2E-7, 14., 3.6E-5, 2.E-9, 1.3, 1.3E-5, .0024};
+  static const std::pair<G4int, const G4double*> Z76N110=std::make_pair(110,pZ76N110);
+  static const G4double pZ76N111[7]={1.2E-7, 14., 8.8E-5, 1.1E-9, 1.3, 1.5E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z76N111=std::make_pair(111,pZ76N111);
+  static const G4double pZ76N112[7]={1.2E-7, 14., 3.E-5, 1.3E-7, 1.3, 1.3E-5, 1.4E-4};
+  static const std::pair<G4int, const G4double*> Z76N112=std::make_pair(112,pZ76N112);
+  static const G4double pZ76N113[7]={1.2E-7, 14., 8.8E-5, 1.1E-9, 1.3, 1.5E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z76N113=std::make_pair(113,pZ76N113);
+  static const G4double pZ76N114[7]={1.2E-7, 14., 3.E-5, 1.3E-7, 1.3, 1.3E-5, 1.4E-4};
+  static const std::pair<G4int, const G4double*> Z76N114=std::make_pair(114,pZ76N114);
+  static const G4double pZ76N116[7]={1.2E-7, 14., 3.E-5, 1.3E-7, 1.3, 1.3E-5, 1.4E-4};
+  static const std::pair<G4int, const G4double*> Z76N116=std::make_pair(116,pZ76N116);
+  static const std::pair<G4int, const G4double*> Z76[N76]={Z76N108, Z76N110, Z76N111,
+                                                           Z76N112, Z76N113, Z76N114,
+                                                           Z76N116};
+  //==> Ir(Z=77)
+  static const G4int N77=2;
+  static const G4double pZ77N114[7]={4.8E-7, 14., 5.2E-4, .7E-9, 1.5, 1.7E-5, .0082};
+  static const std::pair<G4int, const G4double*> Z77N114=std::make_pair(114,pZ77N114);
+  static const G4double pZ77N116[7]={4.8E-7, 14., 4.5E-4, .8E-9, 1.8, 2.3E-5, .0073};
+  static const std::pair<G4int, const G4double*> Z77N116=std::make_pair(116,pZ77N116);
+  static const std::pair<G4int, const G4double*> Z77[N77]={Z77N114, Z77N116};
+  //==> Pt(Z=78) *** No data *** (Pt190=Pt192=Pt194=Hg196, Pt195=Hg199, Pt196=Hg198,
+  //                              Pt198=Hg200)
+  static const G4int N78=6;
+  static const G4double pZ78N112[7]={6.E-8, 19., 3.3E-4, .1E-9, 1.6, 1.8E-5, .06};
+  static const std::pair<G4int, const G4double*> Z78N112=std::make_pair(112,pZ78N112);
+  static const G4double pZ78N114[7]={6.E-8, 19., 3.3E-4, .1E-9, 1.6, 1.8E-5, .06};
+  static const std::pair<G4int, const G4double*> Z78N114=std::make_pair(114,pZ78N114);
+  static const G4double pZ78N116[7]={6.E-8, 19., 3.3E-4, .1E-9, 1.6, 1.8E-5, .06};
+  static const std::pair<G4int, const G4double*> Z78N116=std::make_pair(116,pZ78N116);
+  static const G4double pZ78N117[7]={9.6E-7, 20., .001, .2E-9, 1.6, 2.E-5, .037};
+  static const std::pair<G4int, const G4double*> Z78N117=std::make_pair(117,pZ78N117);
+  static const G4double pZ78N118[7]={2.4E-7, 20., 1.6E-4, 1.3E-9, 1.6, 1.8E-5, .007};
+  static const std::pair<G4int, const G4double*> Z78N118=std::make_pair(118,pZ78N118);
+  static const G4double pZ78N120[7]={2.E-6, 19., .0015, .9E-9, 1.6, 1.8E-5, .0078};
+  static const std::pair<G4int, const G4double*> Z78N120=std::make_pair(120,pZ78N120);
+  static const std::pair<G4int, const G4double*> Z78[N78]={Z78N112, Z78N114, Z78N116,
+                                                           Z78N117, Z78N118, Z78N120};
+  //==> Au(Z=79)
+  static const G4int N79=1;
+  static const G4double pZ79N118[7]={2.4E-7, 19., 1.E-4, 1.4E-9, 1.3, 1.7E-5, .0042};
+  static const std::pair<G4int, const G4double*> Z79N118=std::make_pair(118,pZ79N118);
+  static const std::pair<G4int, const G4double*> Z79[N79]={Z79N118};
+  //==> Hg(Z=80)
+  static const G4int N80=7;
+  static const G4double pZ80N116[7]={6.E-8, 19., 3.3E-4, .1E-9, 1.6, 1.8E-5, .06};
+  static const std::pair<G4int, const G4double*> Z80N116=std::make_pair(116,pZ80N116);
+  static const G4double pZ80N118[7]={2.4E-7, 20., 1.6E-4, 1.3E-9, 1.6, 1.8E-5, .007};
+  static const std::pair<G4int, const G4double*> Z80N118=std::make_pair(118,pZ80N118);
+  static const G4double pZ80N119[7]={9.6E-7, 20., .001, .2E-9, 1.6, 2.E-5, .037};
+  static const std::pair<G4int, const G4double*> Z80N119=std::make_pair(119,pZ80N119);
+  static const G4double pZ80N120[7]={2.E-6, 19., .0015, .9E-9, 1.6, 1.8E-5, .0078};
+  static const std::pair<G4int, const G4double*> Z80N120=std::make_pair(120,pZ80N120);
+  static const G4double pZ80N121[7]={1.E-6, 20., 7.E-4, 1.E-9, 1.6, 1.8E-5, .0076};
+  static const std::pair<G4int, const G4double*> Z80N121=std::make_pair(121,pZ80N121);
+  static const G4double pZ80N122[7]={2.E-6, 18., .0016, .8E-9, 1.6, 1.8E-5, .0078};
+  static const std::pair<G4int, const G4double*> Z80N122=std::make_pair(122,pZ80N122);
+  static const G4double pZ80N124[7]={2.0E-6, 18., .0032, .4E-9, 1.6, 1.8E-5, .016};
+  static const std::pair<G4int, const G4double*> Z80N124=std::make_pair(124,pZ80N124);
+  static const std::pair<G4int, const G4double*> Z80[N80]={Z80N116, Z80N118, Z80N119,
+                                                           Z80N120, Z80N121, Z80N122,
+                                                           Z80N124};
+  //==> Tl(Z=81) *** No data *** (Tl203=Au196, Tl198=Bi209)
+  static const G4int N81=2;
+  static const G4double pZ81N122[7]={2.4E-7, 19., 1.E-4, 1.4E-9, 1.3, 1.7E-5, .0042};
+  static const std::pair<G4int, const G4double*> Z81N122=std::make_pair(122,pZ81N122);
+  static const G4double pZ81N124[7]={};
+  static const std::pair<G4int, const G4double*> Z81N124=std::make_pair(124,pZ81N124);
+  static const std::pair<G4int, const G4double*> Z81[N81]={Z81N122, Z81N124};
+  //==> Pb(Z=82)
+  static const G4int N82=4;
+  static const G4double pZ82N122[7]={4.E-6, 20., .0022, 1.E-9, 1.6, 1.8E-5, .0058};
+  static const std::pair<G4int, const G4double*> Z82N122=std::make_pair(122,pZ82N122);
+  static const G4double pZ82N124[7]={4.E-6, 20., .0022, 1.E-9, 1.6, 1.8E-5, .0058};
+  static const std::pair<G4int, const G4double*> Z82N124=std::make_pair(124,pZ82N124);
+  static const G4double pZ82N125[7]={2.E-6, 20., .0011, 1.2E-9, 1.6, 1.8E-5, .0056};
+  static const std::pair<G4int, const G4double*> Z82N125=std::make_pair(125,pZ82N125);
+  static const G4double pZ82N126[7]={4.E-6, 20., .0023, 1.2E-9, 1.6, 1.8E-5, .0058};
+  static const std::pair<G4int, const G4double*> Z82N126=std::make_pair(126,pZ82N126);
+  static const std::pair<G4int, const G4double*> Z82[N82]={Z82N122, Z82N124, Z82N125,
+                                                           Z82N126};
+  //==> Bi(Z=83)
+  static const G4int N83=1;
+  static const G4double pZ83N126[7]={8.E-7, 23., 3.3E-4, 1.8E-9, 1.6, 1.8E-5, .005};
+  static const std::pair<G4int, const G4double*> Z83N126=std::make_pair(126,pZ83N126);
+  static const std::pair<G4int, const G4double*> Z83[N83]={Z83N126};
+  //==> Po(Z=84) *** No data *** (Po209=Pb207)
+  static const G4int N84=1;
+  static const G4double pZ84N125[7]={2.E-6, 20., .0011, 1.2E-9, 1.6, 1.8E-5, .0056};
+  static const std::pair<G4int, const G4double*> Z84N125=std::make_pair(125,pZ84N125);
+  static const std::pair<G4int, const G4double*> Z84[N84]={Z84N125};
+  //==> At(Z=85) *** No data *** (At210=Pb207)
+  static const G4int N85=1;
+  static const G4double pZ85N125[7]={2.E-6, 20., .0011, 1.2E-9, 1.6, 1.8E-5, .0056};
+  static const std::pair<G4int, const G4double*> Z85N125=std::make_pair(125,pZ85N125);
+  static const std::pair<G4int, const G4double*> Z85[N85]={Z85N125};
+  //==> Rn(Z=86) *** No data *** (Rn222=Ra224)
+  static const G4int N86=1;
+  static const G4double pZ86N136[7]={1.E-7, 23., 5.5E-5, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z86N136=std::make_pair(136,pZ86N136);
+  static const std::pair<G4int, const G4double*> Z86[N86]={Z86N136};
+  //==> Fr(Z=87) *** No data *** (Fr223=Ac225)
+  static const G4int N87=1;
+  static const G4double pZ87N136[7]={2.E-7, 23., 1.1E-4, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z87N136=std::make_pair(136,pZ87N136);
+  static const std::pair<G4int, const G4double*> Z87[N87]={Z87N136};
+  //==> Ra(Z=88)
+  static const G4int N88=4;
+  static const G4double pZ88N135[7]={1.E-7, 23., 5.5E-5, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z88N135=std::make_pair(135,pZ88N135);
+  static const G4double pZ88N136[7]={1.E-7, 23., 5.5E-5, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z88N136=std::make_pair(136,pZ88N136);
+  static const G4double pZ88N137[7]={1.E-7, 23., 5.5E-5, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z88N137=std::make_pair(137,pZ88N137);
+  static const G4double pZ88N138[7]={4.E-7, 23., 1.7E-4, 1.5E-9, 1.6, 1.8E-5, .005};
+  static const std::pair<G4int, const G4double*> Z88N138=std::make_pair(138,pZ88N138);
+  static const std::pair<G4int, const G4double*> Z88[N88]={Z88N135, Z88N136, Z88N137,
+                                                           Z88N138};
+  //==> Ac(Z=89)
+  static const G4int N89=3;
+  static const G4double pZ89N136[7]={2.E-7, 23., 1.1E-4, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z89N136=std::make_pair(136,pZ89N136);
+  static const G4double pZ89N137[7]={4.E-7, 23., 2.2E-4, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z89N137=std::make_pair(137,pZ89N137);
+  static const G4double pZ89N138[7]={1.E-7, 23., 5.5E-5, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z89N138=std::make_pair(138,pZ89N138);
+  static const std::pair<G4int, const G4double*> Z89[N89]={Z89N136, Z89N137, Z89N138};
+  //==> Th(Z=90)
+  static const G4int N90=7;
+  static const G4double pZ90N137[7]={4.E-7, 23., 2.2E-4, 1.2E-9, 1.6, 1.8E-5, .0062};
+  static const std::pair<G4int, const G4double*> Z90N137=std::make_pair(137,pZ90N137);
+  static const G4double pZ90N138[7]={1.E-6, 23., .0016, .4E-9, 3., 3.E-5, .019};
+  static const std::pair<G4int, const G4double*> Z90N138=std::make_pair(138,pZ90N138);
+  static const G4double pZ90N139[7]={2.5E-7, 23., 1.1E-4, 1.4E-9, 2.4, 2.7E-5, .0049};
+  static const std::pair<G4int, const G4double*> Z90N139=std::make_pair(139,pZ90N139);
+  static const G4double pZ90N140[7]={1.2E-7, 23., 3.E-5, 2.E-9, 3., 3.E-5, .003};
+  static const std::pair<G4int, const G4double*> Z90N140=std::make_pair(140,pZ90N140);
+  static const G4double pZ90N142[7]={4.E-6, 23., .0023, 1.1E-9, 1.8, 2.3E-5, .0064};
+  static const std::pair<G4int, const G4double*> Z90N142=std::make_pair(142,pZ90N142);
+  static const G4double pZ90N143[7]={9.4E-7, 23., 5.4E-4, 1.1E-9, 3., 3.E-5, .0066};
+  static const std::pair<G4int, const G4double*> Z90N143=std::make_pair(143,pZ90N143);
+  static const G4double pZ90N144[7]={2.5E-7, 23., 1.4E-4, 1.1E-9, 3., 3.E-5, .0066};
+  static const std::pair<G4int, const G4double*> Z90N144=std::make_pair(144,pZ90N144);
+  static const std::pair<G4int, const G4double*> Z90[N90]={Z90N137, Z90N138, Z90N139,
+                                                           Z90N140, Z90N142, Z90N143,
+                                                           Z90N144};
+  //==> Pa(Z=91)
+  static const G4int N91=3;
+  static const G4double pZ91N140[7]={1.E-5, 23., .0052, 1.6E-9, 1.8, 2.3E-5, .0057};
+  static const std::pair<G4int, const G4double*> Z91N140=std::make_pair(140,pZ91N140);
+  static const G4double pZ91N141[7]={8.E-6, 23., .006, 0., 3.5, 3.5E-5, .021};
+  static const std::pair<G4int, const G4double*> Z91N141=std::make_pair(141,pZ91N141);
+  static const G4double pZ91N142[7]={8.E-6, 23., .0042, 1.E-9, 2., 2.5E-5, .006};
+  static const std::pair<G4int, const G4double*> Z91N142=std::make_pair(142,pZ91N142);
+  static const std::pair<G4int, const G4double*> Z91[N91]={Z91N140, Z91N141, Z91N142};
+  //==> U (Z=92)
+  static const G4int N92=10;
+  static const G4double pZ92N140[7]={1.4E-6, 20., 8.E-4, 1.5E-9, 2.5, 2.8E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z92N140=std::make_pair(140,pZ92N140);
+  static const G4double pZ92N141[7]={5.6E-6, 20., .0033, 1.E-9, 2.5, 2.8E-5, .006};
+  static const std::pair<G4int, const G4double*> Z92N141=std::make_pair(141,pZ92N141);
+  static const G4double pZ92N142[7]={5.6E-6, 20., .0034, 0., 2.5, 2.8E-5, .0072};
+  static const std::pair<G4int, const G4double*> Z92N142=std::make_pair(142,pZ92N142);
+  static const G4double pZ92N143[7]={5.6E-6, 20., .0032, 0., 2., 2.3E-5, .006};
+  static const std::pair<G4int, const G4double*> Z92N143=std::make_pair(143,pZ92N143);
+  static const G4double pZ92N144[7]={3.6E-7, 20., 1.6E-4, 1.3E-9, 2.2, 2.7E-5, .0043};
+  static const std::pair<G4int, const G4double*> Z92N144=std::make_pair(144,pZ92N144);
+  static const G4double pZ92N145[7]={3.6E-6, 20., .003, 0., 2.2, 2.7E-5, .045};
+  static const std::pair<G4int, const G4double*> Z92N145=std::make_pair(145,pZ92N145);
+  static const G4double pZ92N146[7]={3.6E-7, 20., 1.6E-4, 1.3E-9, 2.2, 2.7E-5, .0043};
+  static const std::pair<G4int, const G4double*> Z92N146=std::make_pair(146,pZ92N146);
+  static const G4double pZ92N147[7]={3.6E-6, 20., .0014, 1.3E-9, 2.2, 2.7E-5, 12.};
+  static const std::pair<G4int, const G4double*> Z92N147=std::make_pair(147,pZ92N147);
+  static const G4double pZ92N148[7]={3.4E-7, 20., 1.3E-4, 1.3E-9, 2.2, 2.8E-5, .0036};
+  static const std::pair<G4int, const G4double*> Z92N148=std::make_pair(148,pZ92N148);
+  static const G4double pZ92N149[7]={3.3E-7, 20., 1.5E-4, 1.2E-9, 3., 3.4E-5, .0044};
+  static const std::pair<G4int, const G4double*> Z92N149=std::make_pair(149,pZ92N149);
+  static const std::pair<G4int, const G4double*> Z92[N92]={Z92N140, Z92N141, Z92N142,
+                                                           Z92N143, Z92N144, Z92N145,
+                                                           Z92N146, Z92N147, Z92N148,
+                                                           Z92N146};
+  //==> Np(Z=93)
+  static const G4int N93=5;
+  static const G4double pZ93N142[7]={3.4E-6, 20., .002, 1.3E-9, 3., 3.3E-5, .0056};
+  static const std::pair<G4int, const G4double*> Z93N142=std::make_pair(142,pZ93N142);
+  static const G4double pZ93N143[7]={3.4E-6, 20., .002, 1.6E-9, 3.5, 3.6E-5, .005};
+  static const std::pair<G4int, const G4double*> Z93N143=std::make_pair(143,pZ93N143);
+  static const G4double pZ93N144[7]={6.8E-6, 18., .0052, .8E-9, 2.4, 3.E-5, .0072};
+  static const std::pair<G4int, const G4double*> Z93N144=std::make_pair(144,pZ93N144);
+  static const G4double pZ93N145[7]={3.4E-6, 20., .002, 1.E-9, 3.5, 3.6E-5, .006};
+  static const std::pair<G4int, const G4double*> Z93N145=std::make_pair(145,pZ93N145);
+  static const G4double pZ93N146[7]={3.4E-6, 20., .002, 1.5E-9, 3.5, 3.6E-5, .0053};
+  static const std::pair<G4int, const G4double*> Z93N146=std::make_pair(146,pZ93N146);
+  static const std::pair<G4int, const G4double*> Z93[N93]={Z93N142, Z93N143, Z93N144,
+                                                           Z93N145, Z93N146};
+  //==> Pu(Z=94)
+  static const G4int N94=10;
+  static const G4double pZ94N142[7]={6.8E-7, 16., 4.5E-4, 1.7E-9, 2.6, 3.E-5, .0047};
+  static const std::pair<G4int, const G4double*> Z94N142=std::make_pair(142,pZ94N142);
+  static const G4double pZ94N143[7]={6.8E-6, 18., .0044, .9E-9, 3.3, 3.5E-5, .0058};
+  static const std::pair<G4int, const G4double*> Z94N143=std::make_pair(143,pZ94N143);
+  static const G4double pZ94N144[7]={6.8E-7, 16., 6.E-4, 0., 2.7, 2.6E-5, .0082};
+  static const std::pair<G4int, const G4double*> Z94N144=std::make_pair(144,pZ94N144);
+  static const G4double pZ94N145[7]={2.6E-6, 16., .0017, 1.8E-9, 1.8, 2.E-5, .004};
+  static const std::pair<G4int, const G4double*> Z94N145=std::make_pair(145,pZ94N145);
+  static const G4double pZ94N146[7]={2.5E-7, 20., 9.E-5, 3.6E-8, 3.4, 3.8E-5, 5.4E-4};
+  static const std::pair<G4int, const G4double*> Z94N146=std::make_pair(146,pZ94N146);
+  static const G4double pZ94N147[7]={1.4E-5, 16., .01, .8E-9, 2.7, 2.6E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z94N147=std::make_pair(147,pZ94N147);
+  static const G4double pZ94N148[7]={3.4E-7, 20., 1.3E-4, 1.2E-9, 3.2, 3.E-5, .0036};
+  static const std::pair<G4int, const G4double*> Z94N148=std::make_pair(148,pZ94N148);
+  static const G4double pZ94N149[7]={5.2E-6, 20., .0035, .4E-9, 2.3, 3.E-5, .0095};
+  static const std::pair<G4int, const G4double*> Z94N149=std::make_pair(149,pZ94N149);
+  static const G4double pZ94N150[7]={3.3E-7, 20., 1.6E-4, 1.2E-9, 3., 3.E-5, .0046};
+  static const std::pair<G4int, const G4double*> Z94N150=std::make_pair(150,pZ94N150);
+  static const G4double pZ94N152[7]={2.5E-6, 16., .0018, 1.2E-9, 3., 3.1E-5, .0052};
+  static const std::pair<G4int, const G4double*> Z94N152=std::make_pair(152,pZ94N152);
+  static const std::pair<G4int, const G4double*> Z94[N94]={Z94N142, Z94N143, Z94N144,
+                                                           Z94N145, Z94N146, Z94N147,
+                                                           Z94N148, Z94N149, Z94N150,
+                                                           Z94N152};
+  //==> Am(Z=95)
+  static const G4int N95=4;
+  static const G4double pZ95N156[7]={2.5E-6, 18., .0016, .9E-9, 2., 2.3E-5, .0058};
+  static const std::pair<G4int, const G4double*> Z95N156=std::make_pair(156,pZ95N156);
+  static const G4double pZ95N157[7]={5.E-6, 18., .003, 2.7E-9, 2., 2.3E-5, .0039};
+  static const std::pair<G4int, const G4double*> Z95N157=std::make_pair(157,pZ95N157);
+  static const G4double pZ95N158[7]={5.E-6, 19., .0033, 2.6E-9, 2., 2.3E-5, .0044};
+  static const std::pair<G4int, const G4double*> Z95N158=std::make_pair(158,pZ95N158);
+  static const G4double pZ95N159[7]={5.E-5, 20., .029, 1.1E-9, 2., 2.3E-5, .0057};
+  static const std::pair<G4int, const G4double*> Z95N159=std::make_pair(159,pZ95N159);
+  static const std::pair<G4int, const G4double*> Z95[N95]={Z95N156, Z95N157, Z95N158,
+                                                           Z95N159};
+  //==> Cm(Z=96)
+  static const G4int N96=10;
+  static const G4double pZ96N145[7]={5.E-5, 22., .027, 1.1E-9, 2.2, 2.2E-5, .006};
+  static const std::pair<G4int, const G4double*> Z96N145=std::make_pair(145,pZ96N145);
+  static const G4double pZ96N146[7]={5.E-5, 24., .027, 2.E-9, 2.2, 2.2E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z96N146=std::make_pair(146,pZ96N146);
+  static const G4double pZ96N147[7]={5.E-5, 22., .025, 2.5E-9, 2.2, 2.4E-5, .0044};
+  static const std::pair<G4int, const G4double*> Z96N147=std::make_pair(147,pZ96N147);
+  static const G4double pZ96N148[7]={5.E-5, 23., .028, 1.9E-9, 2.2, 3.E-5, .0055};
+  static const std::pair<G4int, const G4double*> Z96N148=std::make_pair(148,pZ96N148);
+  static const G4double pZ96N149[7]={5.E-5, 23., .025, 1.6E-9, 3., 3.5E-5, .0054};
+  static const std::pair<G4int, const G4double*> Z96N149=std::make_pair(149,pZ96N149);
+  static const G4double pZ96N150[7]={5.E-5, 24., .026, 2.E-9, 3., 3.6E-5, .0045};
+  static const std::pair<G4int, const G4double*> Z96N150=std::make_pair(150,pZ96N150);
+  static const G4double pZ96N151[7]={5.E-5, 24., .022, 2.4E-9, 3., 3.6E-5, .0039};
+  static const std::pair<G4int, const G4double*> Z96N151=std::make_pair(151,pZ96N151);
+  static const G4double pZ96N152[7]={6.5E-7, 25., 2.E-4, 3.4E-9, 3., 3.6E-5, .003};
+  static const std::pair<G4int, const G4double*> Z96N152=std::make_pair(152,pZ96N152);
+  static const G4double pZ96N153[7]={1.6E-6, 21., 7.E-4, 1.4E-9, 3., 3.6E-5, .0045};
+  static const std::pair<G4int, const G4double*> Z96N153=std::make_pair(153,pZ96N153);
+  static const G4double pZ96N154[7]={1.3E-5, 16., .016, 0., 3., 3.6E-5, .017};
+  static const std::pair<G4int, const G4double*> Z96N154=std::make_pair(154,pZ96N154);
+  static const std::pair<G4int, const G4double*> Z96[N96]={Z96N145, Z96N146, Z96N147,
+                                                           Z96N148, Z96N149, Z96N150,
+                                                           Z96N151, Z96N152, Z96N153,
+                                                           Z96N154};
+  //==> Bk(Z=97)
+  static const G4int N97=2;
+  static const G4double pZ97N152[7]={6.5E-7, 22., 3.5E-4, 2.7E-9, 3., 4.E-5, .004};
+  static const std::pair<G4int, const G4double*> Z97N152=std::make_pair(152,pZ97N152);
+  static const G4double pZ97N153[7]={6.5E-6, 22., .0036, 1.E-9, 2.7, 4.E-5, .006};
+  static const std::pair<G4int, const G4double*> Z97N153=std::make_pair(153,pZ97N153);
+  static const std::pair<G4int, const G4double*> Z97[N97]={Z97N152, Z97N153};
+  //==> Cf(Z=98)
+  static const G4int N98=6;
+  static const G4double pZ98N151[7]={6.5E-6, 22., .0035, .9E-9, 3., 4.E-5, .0068};
+  static const std::pair<G4int, const G4double*> Z98N151=std::make_pair(151,pZ98N151);
+  static const G4double pZ98N152[7]={1.3E-6, 22., 7.E-4, 2.E-9, 2.7, 4.E-5, .0045};
+  static const std::pair<G4int, const G4double*> Z98N152=std::make_pair(152,pZ98N152);
+  static const G4double pZ98N153[7]={2.6E-6, 22., .0014, 2.1E-9, 2.7, 4.E-5, .0044};
+  static const std::pair<G4int, const G4double*> Z98N153=std::make_pair(153,pZ98N153);
+  static const G4double pZ98N154[7]={2.6E-6, 22., .0014, 1.3E-9, 2.7, 4.E-5, .0054};
+  static const std::pair<G4int, const G4double*> Z98N154=std::make_pair(154,pZ98N154);
+  static const G4double pZ98N155[7]={2.6E-5, 22., .03, 0., 2.7, 4.E-5, .03};
+  static const std::pair<G4int, const G4double*> Z98N155=std::make_pair(155,pZ98N155);
+  static const G4double pZ98N156[7]={5.2E-7, 22., 2.6E-4, 1.3E-9, 2.7, 4.E-5, .005};
+  static const std::pair<G4int, const G4double*> Z98N156=std::make_pair(156,pZ98N156);
+  static const std::pair<G4int, const G4double*> Z98[N98]={Z98N151, Z98N152, Z98N153,
+                                                           Z98N154, Z98N155, Z98N156};
+ 
+  static const G4int NZ=99; // #of Elements covered by CHIPS elastic
+  static const std::pair<G4int, const G4double*>* Pars[NZ]={Z0,Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,
+    Z10,Z11,Z12,Z13,Z14,Z15,Z16,Z17,Z18,Z19,Z20,Z21,Z22,Z23,Z24,Z25,Z26,Z27,Z28,Z29,Z30,
+    Z31,Z32,Z33,Z34,Z35,Z36,Z37,Z38,Z39,Z40,Z41,Z42,Z43,Z44,Z45,Z46,Z47,Z48,Z49,Z50,Z51,
+    Z52,Z53,Z54,Z55,Z56,Z57,Z58,Z59,Z60,Z61,Z62,Z63,Z64,Z65,Z66,Z67,Z68,Z69,Z70,Z71,Z72,
+    Z73,Z74,Z75,Z76,Z77,Z78,Z79,Z80,Z81,Z82,Z83,Z84,Z85,Z86,Z87,Z88,Z89,Z90,Z91,Z92,Z93,
+    Z94,Z95,Z96,Z97,Z98};
+  static const G4int NIso[NZ]={N0,N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11,N12,N13,N14,N15,N16,
+    N17,N18,N19,N20,N21,N22,N23,N24,N25,N26,N27,N28,N29,N30,N31,N32,N33,N34,N35,N36,N37,
+    N38,N39,N40,N41,N42,N43,N44,N45,N46,N47,N48,N49,N50,N51,N52,N53,N54,N55,N56,N57,N58,
+    N59,N60,N61,N62,N63,N64,N65,N66,N67,N68,N69,N70,N71,N72,N73,N74,N75,N76,N77,N78,N79,
+    N80,N81,N82,N83,N84,N85,N86,N87,N88,N89,N90,N91,N92,N93,N94,N95,N96,N97,N98};
+  if(PDG==2112)
+  {
+    // --- Total np elastic cross section cs & s1/b1 (t), s2/b2 (u) --- NotTuned for highE
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(5.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=12./(p2s+.05*p+.0001/sqrt(sp))+.35/p+(6.75+.14*dl1*dl1+19./p)/(1.+.6/p4);
+    //  par(0)   par(1) par(2)        par(4) par(5) par(6)     par(7)     par(8)
+    //s1=(6.75+.14*dl2*dl2+13./p)/(1.+.14/p4)+.6/(p4+.00013), s2=(75.+.001/p4/p)/p3
+    //  par(9) par(10)   par(11)     par(12) par(13) par(14)  par(15) par(16)
+    //b1=(7.2+4.32/(p4*p4+.012*p3))/(1.+2.5/p4), ss=0., b2=12./(p*sp+.34)
+    //par(17) par(18)    par(19)       par(20)  par(21)   par(22)   par(23)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_npel; ip++) lastPAR[ip]=np_el[ip]; // np
+      }
+      else if ( tgZ == 0 && tgN == 1 )
+      {
+        for (G4int ip=0; ip<n_ppel; ip++) lastPAR[ip]=pp_el[ip]; // nn
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double ala=std::log(a); // for powers of a
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (na_el.f)
+        lastPAR[ 0]=5./(1.+22./asa);                                          // p1
+        lastPAR[ 1]=4.8*std::exp(ala*1.14)/(1.+3.6/a3);                       // p2
+        lastPAR[ 2]=1./(1.+.004*a4)+2.E-6*a3/(1.+1.3E-6*a3);                  // p3
+        lastPAR[ 3]=.07*asa/(1.+.009*a2);                                     // o4
+        lastPAR[ 5]=1.7*a;                                                    // p5
+        lastPAR[ 6]=5.5E-6*std::exp(ala*1.3);                                 // p6
+        lastPAR[13]=0.;                                                       // reserved
+        lastPAR[14]=0.;                                                       // reserved
+        G4int nn=NIso[tgZ];
+#ifdef pdebug
+	  G4cout<<"G4QNElCrS::CalcCS: Z="<<tgZ<<", nIs="<<nn<<G4endl;
+#endif
+        G4bool nfound=true;
+        if(nn) for (G4int in=0; in<nn; in++)
+        {
+          std::pair<G4int, const G4double*> curIs=Pars[tgZ][in];
+          G4int cn=curIs.first;
+#ifdef pdebug
+	   G4cout<<"G4QNElCrS::CalcCS: N="<<tgN<<", cn="<<cn<<G4endl;
+#endif
+          if(cn == tgN)
+          {
+            const G4double* curT=curIs.second;
+            lastPAR[ 4]=curT[0];                                           // p4
+            lastPAR[ 7]=curT[1];                                           // p7
+            lastPAR[ 8]=curT[2];                                           // p8
+            lastPAR[ 9]=curT[3];                                           // p9
+            lastPAR[10]=curT[4];                                           // p10
+            lastPAR[11]=curT[5];                                           // p11
+            lastPAR[12]=curT[6];                                           // p12
+#ifdef pdebug
+		G4cout<<"G4QNElCrS::CalcCS: Parameters are filled, p12="<<lastPAR[12]<<G4endl;
+#endif
+            nfound = false;
+            break;
+          }
+        }
+        if(nfound) 
+        {
+          G4cout<<"-Warning-G4QNeutronElasticCrossSection::CalcCS: Z="<<tgZ<<", N="<<tgN
+                <<" isotope is not implemented in CHIPS"<<G4endl; // Put default values:
+          lastPAR[ 4]=5.2E-7;                                              // p4
+          lastPAR[ 7]=22.;                                                 // p7
+          lastPAR[ 8]=.00026;                                              // p8
+          lastPAR[ 9]=1.3E-9;                                              // p9
+          lastPAR[10]=2.7;                                                 // p10
+          lastPAR[11]=4.E-5;                                               // p11
+          lastPAR[12]=.005;                                                // p12          
+        }
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[15]=4000*a;                                // p1
+          lastPAR[16]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[17]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[18]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[19]=.28*a;                                 // p5
+          lastPAR[20]=1.2*a2+2.3;                            // p6
+          lastPAR[21]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[22]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[23]=.2*a;                                  // p2
+          lastPAR[24]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[25]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[26]=2.25*a3;                               // p1
+          lastPAR[27]=18.;                                   // p2
+          lastPAR[28]=.0024*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[29]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          lastPAR[30]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[31]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[32]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[33]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[34]=.114;                                  // p2
+          lastPAR[35]=.003;                                  // p3
+          lastPAR[36]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[37]=1./(1.+.0001*a8);                      // p1
+          lastPAR[38]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[39]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[40]=a/2;                                   // p1
+          lastPAR[41]=2.e-7*a4;                              // p2
+          lastPAR[42]=4.;                                    // p3
+          lastPAR[43]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[44]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[45]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[46]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[47]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[48]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[49]=920.+.03*a8*a3;                        // p1
+          lastPAR[50]=93.+.0023*a12;                         // p2
+#ifdef debug
+         G4cout<<"G4QNElCrS::CalcCS:la "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]
+               <<", "<<lastPAR[48]<<", "<<lastPAR[49]<<", "<<lastPAR[50]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[15]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[16]=.06*std::pow(a,.6);                    // p2
+          lastPAR[17]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[18]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[19]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[20]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[21]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[22]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[23]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[24]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[25]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[26]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[27]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[28]=7.e-15*a4*asa;                         // p2
+          lastPAR[29]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[30]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[31]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[32]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[33]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[34]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[35]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[36]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[37]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[38]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[39]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[40]=1.3+3.e5/a4;                           // p3
+          lastPAR[41]=500./(a2+50.)+3;                       // p4
+          lastPAR[42]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[43]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[44]=.0005*a5;                              // p2
+          lastPAR[45]=.002*a5;                               // p3
+          lastPAR[46]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[47]=.05+.005*a;                            // p1
+          lastPAR[48]=7.e-8/sa;                              // p2
+          lastPAR[49]=.8*sa;                                 // p3
+          lastPAR[50]=.02*sa;                                // p4
+          lastPAR[51]=1.e8/a3;                               // p5
+          lastPAR[52]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[53]=24.;                                   // p1
+          lastPAR[54]=20./sa;                                // p2
+          lastPAR[55]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[56]=900.*sa/(1.+500./a3);                  // p4
+#ifdef debug
+         G4cout<<"G4QNElCrS::CalcCS:ha "<<lastPAR[47]<<", "<<lastPAR[48]<<", "<<lastPAR[49]
+               <<", "<<lastPAR[50]<<", "<<lastPAR[51]<<", "<<lastPAR[52]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[57]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef debug
+      G4cout<<"G4QNeutronElasticCrossSection::GetPTables: ip=0(init), lp="<<lp<<", S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef debug
+            G4cout<<"G4QNeutronElasticCrossSection::GetPTables: ip="<<ip<<", lp="<<lp
+                  <<", S1="<<theS1<<", B1="<<theB1<<", S2="<<theS2<<", B2="<<theB2<<", S3="
+                  <<theS3<<", B3="<<theB3<<", S4="<<theS4<<", B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="
+                 <<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef debug
+    else G4cout<<"*Warning*G4QNeutronElasticCrossSect::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QNeutronElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=2112(n)"<<G4endl;
+    throw G4QException("G4QNeutronElasticCrossSection::GetPTables:only nA're implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QNeutronElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QNeutElCrS::GetExcT:F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!=2112) G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:PDG="<<PDG<<G4endl;
+  if(onlyCS) G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExchangeT:onCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> n+p=n+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QNeutronElasticCrS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1
+          <<",S2="<<theS2<<",B2="<<theB2<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:1n "<<ts1<<"#"<<lastTM<<",d="
+            <<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:2n "<<ts2<<"#"<<lastTM<<",d="
+            <<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    //G4double E3=lastTM*theB3;
+    //G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    //G4double ts3=-std::log(1.-R3)/theB3;
+    //G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    //if(ds3>.01)G4cout<<"Warn*G4QNElCS::GetExT:3n="<<ts3<<"#"<<lastTM<<",d="<<ds3<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2/theB2;
+    //G4double I3=R3*theS3/theB3;
+    G4double I12=I1+I2;
+    //G4double rand=(I12+I3)*G4UniformRand();
+    G4double rand=I12*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;       // t-chan
+    }
+    else
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=lastTM+std::log(1.-ran)/theB2; // u-chan (ChEx)
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QNeutronElCroSec::GetExT:a="<<a<<",t="<<lastTM<<",S1="<<theS1<<",B1="<<theB1
+          <<",SS="<<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3
+          <<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:1a "<<ts1<<"#"<<lastTM<<",d="
+            <<ds1<<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:2a "<<ts2<<"#"<<lastTM<<",d="
+            <<ds2<<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:3a "<<ts3<<"#"<<lastTM<<",d="
+            <<ds3<<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QNeutronElasticCrissSection::GetExT:4a "<<ts4<<"#"<<lastTM<<",d="
+            <<ds4<<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QNElCS::GtExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QNElCS::GetET:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QNElCS::GetExT: Q2="<<q2<<",r2="<<R2<<", b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QNElCS::GetExT:Q2="<<q2<<", r3="<<R2<<", b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QNElCS::GetET:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QNeutronElCroSect::GetExchangeT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetExT:-t="<<q2<<" >"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QNeutronElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QNeutrElCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS) G4cout<<"Warning*G4QNeutronElasticCrossSection::GetSlope:onlyCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG!=2112)
+  {
+    G4cout<<"*Error*G4QNeutronElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=2112"<<G4endl;
+    throw G4QException("G4QNeutronElasticCrossSection::GetSlope: only nA are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QNeutElasticCrosS::Getslope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QNeutronElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QNeutronElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                     G4int tgN)
+{
+  if(PDG!=2112) G4cout<<"*Warning*G4QNeutronElasticCrossSection::GetTaV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QNElasticCrS::GetTabValue: (1-92) No isotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QNeutronElasticCS::GetTabValue: No isotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef debug
+  G4cout<<"G4QNElasticCS::GetTabVal:lp="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 )  // np
+  {
+    G4double ssp=std::sqrt(sp);           // sqrt(sqrt(p))=p^.25
+    G4double p2s=p2*sp;
+    G4double dl1=lp-lastPAR[3];
+    theSS=lastPAR[27];
+    theS1=(lastPAR[9]+lastPAR[10]*dl1*dl1+lastPAR[11]/p)/(1.+lastPAR[12]/p4)
+          +lastPAR[13]/(p4+lastPAR[14]);
+    theB1=(lastPAR[17]+lastPAR[18]/(p4*p4+lastPAR[19]*p3))/(1.+lastPAR[20]/p4);
+    theS2=(lastPAR[15]+lastPAR[16]/p4/p)/p3;
+    theB2=lastPAR[22]/(p*sp+lastPAR[23]); 
+    theS3=0.;
+    theB3=0.; 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QNeutronElasticCroS::GetTableValues:(np) TM="<<lastTM<<",S1="<<theS1<<",B1="
+          <<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pp cross-section (to avoid spoiling lastSIG)
+    return lastPAR[0]/(p2s+lastPAR[1]*p+lastPAR[2]/ssp)+lastPAR[4]/p
+           +(lastPAR[5]+lastPAR[6]*dl1*dl1+lastPAR[7]/p)/(1.+lastPAR[8]/p4);
+
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[15]/(1.+lastPAR[16]*p4*pa)+lastPAR[17]/(p4+lastPAR[18]*p4/pa2)+
+            (lastPAR[19]*dl*dl+lastPAR[20])/(1.+lastPAR[21]/p2);
+      theB1=(lastPAR[22]+lastPAR[23]*p2)/(p4+lastPAR[24]/pah)+lastPAR[25];
+      theSS=lastPAR[26]/(1.+lastPAR[27]/p2)+lastPAR[28]/(p6/pa+lastPAR[29]/p16);
+      theS2=lastPAR[30]/(pa/p2+lastPAR[31]/p4)+lastPAR[32];
+      theB2=lastPAR[33]*std::pow(p,lastPAR[34])+lastPAR[35]/(p8+lastPAR[36]/p16);
+      theS3=lastPAR[37]/(pa*p+lastPAR[38]/pa)+lastPAR[39];
+      theB3=lastPAR[40]/(p3+lastPAR[41]/p6)+lastPAR[42]/(1.+lastPAR[43]/p2);
+      theS4=p2*(pah*lastPAR[44]*std::exp(-pah*lastPAR[45])+
+                lastPAR[46]/(1.+lastPAR[47]*std::pow(p,lastPAR[48])));
+      theB4=lastPAR[49]*pa/p2/(1.+pa*lastPAR[50]);
+#ifdef tdebug
+      G4cout<<"G4QNElCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[15]/(1.+lastPAR[16]/p4)+lastPAR[17]/(p4+lastPAR[18]/p2)+
+            lastPAR[19]/(p5+lastPAR[20]/p16);
+      theB1=(lastPAR[21]/p8+lastPAR[25])/(p+lastPAR[22]/std::pow(p,lastPAR[26]))+
+            lastPAR[23]/(1.+lastPAR[24]/p4);
+      theSS=lastPAR[27]/(p4/std::pow(p,lastPAR[29])+lastPAR[28]/p4);
+      theS2=lastPAR[30]/p4/(std::pow(p,lastPAR[31])+lastPAR[32]/p12)+lastPAR[33];
+      theB2=lastPAR[34]/std::pow(p,lastPAR[35])+lastPAR[36]/std::pow(p,lastPAR[37]);
+      theS3=lastPAR[38]/std::pow(p,lastPAR[41])/(1.+lastPAR[42]/p12)+
+            lastPAR[39]/(1.+lastPAR[40]/p6);
+      theB3=lastPAR[43]/p8+lastPAR[44]/p2+lastPAR[45]/(1.+lastPAR[46]/p8);
+      theS4=(lastPAR[47]/p4+lastPAR[52]/p)/(1.+lastPAR[48]/p10)+
+            (lastPAR[49]+lastPAR[50]*dl*dl)/(1.+lastPAR[51]/p12);
+      theB4=lastPAR[53]/(1.+lastPAR[54]/p)+lastPAR[55]*p4/(1.+lastPAR[56]*p5);
+#ifdef tdebug
+      G4cout<<"G4QNElCS::GetTabV: hA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QNeutronElCS::GetTabV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+#ifdef pdebug
+    G4cout<<"G4QNElCS::GetTV: p="<<p<<",P12="<<lastPAR[12]<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    //         p1(p6)          p2(p7)          p3(p4)       o4(p8)       (p9)p5
+    return (lastPAR[0]*dl*dl+lastPAR[1])/(1.+lastPAR[2]/p+lastPAR[3]/p4)+lastPAR[5]/
+	     (p3+lastPAR[6]/p3)+lastPAR[7]/(p2+lastPAR[4]/(p2+lastPAR[8])+lastPAR[9]/p)+
+           lastPAR[10]/(p5+lastPAR[11]/p2)+lastPAR[12]/p;
+    //         p10             p11             p12
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QNeutronElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                 G4double pP)
+{
+  static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  //static const G4double mProt2= mProt*mProt;
+  static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ==0 && tgN==1)
+  {
+    G4double tMid=std::sqrt(pP2+mNeut2)*mNeut-mNeut2;  // CMS 90deg value of -t=Q2 (GeV^2)
+    return tMid+tMid;
+  }
+  else if(tgZ || tgN)                   // ---> nA
+  {
+    G4double mt=mProt;                                 // Target mass in GeV
+    if(tgN||tgZ>1) mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mNeut2)+mNeut2+mt*mt; // Mondelstam s (in GeV^2)
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QNeutronElasticCrossSection::GetQ2max:PDG="<<PDG<<", Z="<<tgZ<<", N="
+          <<tgN<<", while it is defined only for n projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QNeutronElasticCrossSection::GetQ2max: only nA implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QPionMinusElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QPionMinusElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QPionMinusElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1099 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QPionMinusElasticCrossSection.cc,v 1.3 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QPionMinusElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 21-Jan-10
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 21-Jan-10
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QPionMinusElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QPionMinusElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)(D)
+const G4int G4QPionMinusElasticCrossSection::nLast=nPoints-1;//theLastElement inTheTable(D)
+G4double  G4QPionMinusElasticCrossSection::lPMin=-8.;  //Min tabulated logarithmMomentum(D)
+G4double  G4QPionMinusElasticCrossSection::lPMax= 8.;  //Max tabulated logarithmMomentum(D)
+G4double  G4QPionMinusElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;//LogStep inTheTable(D)
+G4bool    G4QPionMinusElasticCrossSection::onlyCS=true;//Flag toCalcul OnlyCS(not Si/Bi)(L)
+G4double  G4QPionMinusElasticCrossSection::lastSIG=0.; //Last calculated cross section  (L)
+G4double  G4QPionMinusElasticCrossSection::lastLP=-10.;//Last log(mom_of IncidentHadron)(L)
+G4double  G4QPionMinusElasticCrossSection::lastTM=0.;  //Last t_maximum                 (L)
+G4double  G4QPionMinusElasticCrossSection::theSS=0.;   //TheLastSqSlope of 1st difr.Max(L)
+G4double  G4QPionMinusElasticCrossSection::theS1=0.;   //TheLastMantissa of 1st difr.Max(L)
+G4double  G4QPionMinusElasticCrossSection::theB1=0.;   //TheLastSlope of 1st difruct.Max(L)
+G4double  G4QPionMinusElasticCrossSection::theS2=0.;   //TheLastMantissa of 2nd difr.Max(L)
+G4double  G4QPionMinusElasticCrossSection::theB2=0.;   //TheLastSlope of 2nd difruct.Max(L)
+G4double  G4QPionMinusElasticCrossSection::theS3=0.;   //TheLastMantissa of 3d difr. Max(L)
+G4double  G4QPionMinusElasticCrossSection::theB3=0.;   //TheLastSlope of 3d difruct. Max(L)
+G4double  G4QPionMinusElasticCrossSection::theS4=0.;   //TheLastMantissa of 4th difr.Max(L)
+G4double  G4QPionMinusElasticCrossSection::theB4=0.;   //TheLastSlope of 4th difruct.Max(L)
+G4int     G4QPionMinusElasticCrossSection::lastTZ=0;   // Last atomic number of the target
+G4int     G4QPionMinusElasticCrossSection::lastTN=0;   // Last # of neutrons in the target
+G4double  G4QPionMinusElasticCrossSection::lastPIN=0.; // Last initialized max momentum
+G4double* G4QPionMinusElasticCrossSection::lastCST=0;  // Elastic cross-section table
+G4double* G4QPionMinusElasticCrossSection::lastPAR=0;  // Parameters ForFunctionCalculation
+G4double* G4QPionMinusElasticCrossSection::lastSST=0;  // E-dep of SqardSlope of 1st difMax
+G4double* G4QPionMinusElasticCrossSection::lastS1T=0;  // E-dep of mantissa of 1st dif.Max
+G4double* G4QPionMinusElasticCrossSection::lastB1T=0;  // E-dep of the slope of 1st difMax
+G4double* G4QPionMinusElasticCrossSection::lastS2T=0;  // E-dep of mantissa of 2nd difrMax
+G4double* G4QPionMinusElasticCrossSection::lastB2T=0;  // E-dep of the slope of 2nd difMax
+G4double* G4QPionMinusElasticCrossSection::lastS3T=0;  // E-dep of mantissa of 3d difr.Max
+G4double* G4QPionMinusElasticCrossSection::lastB3T=0;  // E-dep of the slope of 3d difrMax
+G4double* G4QPionMinusElasticCrossSection::lastS4T=0;  // E-dep of mantissa of 4th difrMax
+G4double* G4QPionMinusElasticCrossSection::lastB4T=0;  // E-dep of the slope of 4th difMax
+G4int     G4QPionMinusElasticCrossSection::lastN=0;    // The last N of calculated nucleus
+G4int     G4QPionMinusElasticCrossSection::lastZ=0;    // The last Z of calculated nucleus
+G4double  G4QPionMinusElasticCrossSection::lastP=0.;   // LastUsed in CrossSection Momentum
+G4double  G4QPionMinusElasticCrossSection::lastTH=0.;  // Last threshold momentum
+G4double  G4QPionMinusElasticCrossSection::lastCS=0.;  // Last value of the Cross Section
+G4int     G4QPionMinusElasticCrossSection::lastI=0;    // The last position in the DAMDB
+
+std::vector<G4double*> G4QPionMinusElasticCrossSection::PAR;// Vector of ParsForFunctCalcul
+std::vector<G4double*> G4QPionMinusElasticCrossSection::CST;// Vector of CrossSection table
+std::vector<G4double*> G4QPionMinusElasticCrossSection::SST;// Vector of the1st SquardSlope
+std::vector<G4double*> G4QPionMinusElasticCrossSection::S1T;// Vector of the1st mantissa
+std::vector<G4double*> G4QPionMinusElasticCrossSection::B1T;// Vector of the1st slope
+std::vector<G4double*> G4QPionMinusElasticCrossSection::S2T;// Vector of the2nd mantissa
+std::vector<G4double*> G4QPionMinusElasticCrossSection::B2T;// Vector of the2nd slope
+std::vector<G4double*> G4QPionMinusElasticCrossSection::S3T;// Vector of the3d mantissa
+std::vector<G4double*> G4QPionMinusElasticCrossSection::B3T;// Vector of the3d slope
+std::vector<G4double*> G4QPionMinusElasticCrossSection::S4T;// Vector of the4th mantissa(g)
+std::vector<G4double*> G4QPionMinusElasticCrossSection::B4T;// Vector of the4th slope(glor)
+
+G4QPionMinusElasticCrossSection::G4QPionMinusElasticCrossSection()
+{
+}
+
+G4QPionMinusElasticCrossSection::~G4QPionMinusElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QPionMinusElasticCrossSection::GetPointer()
+{
+  static G4QPionMinusElasticCrossSection theCrossSection;//StaticBody of theQElCrossSection
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QPionMinusElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QPElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG!=-211)
+  {
+    G4cout<<"*Warning*G4QPionPlusElCS::GetCS:**> Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QElCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QElCrossSec::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="<<colN[i]
+          <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QElCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QElCS::GetCrSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QElCS::GetCrSec:***End***, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QPionMinusElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F,G4int I,
+                                             G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QPionPlusElasticCroS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QElasticCS::CalcCS: DB is updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QPionPlusElasticCroS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QElCS::CalcCS:*updated(I)*,LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QPionPlusElasticCroS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QPiPlElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QElCS::CalcCS: *updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QElastCS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QElasticCrosSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QEleastCS::CCS:b="<<blast<<","<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QPionPlusElasticCroS::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QElCS::CalcCrossSection: Sig="<<lastSIG<<", P="<<pMom<<", Z="<<tgZ<<", N="
+            <<tgN<<", PDG="<<PDG<<", onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QElCS::CalcCrossSection:bl="<<blast<<",ls="<<lastL<<",SL="<<S1TL<<",SU="
+              <<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QElCS::CCS: s3l="<<S3TL<<",sh3="<<shift<<",s3h="<<lastS3T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QElCS::CCS: s4l="<<S4TL<<",sh4="<<shift<<",s4h="<<lastS4T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QPionPlusElasticCroS::CalculateCS:(I) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QPionMinusElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QPionMinusElasticCrossSection::GetPTables(G4double LP, G4double ILP, G4int PDG,
+                                                  G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_pimpel=38;                // #of parameters for pp-elastic (<nPoints=128)
+  //                           -0-  -1-   -2- -3- -4- -5-  -6-  -7-   -8-  -9--10-11-12-
+  G4double pimp_el[n_pimpel]={1.27,1.53,.0676,3.5,.36,.04,.017,.0025,.0557,2.4,7.,.7,.6,
+                              .05,5.,74.,3.,3.4,.2,.17,.001,8.,.055,3.64,5.e-5,4000.,1500.,
+                              .46,1.2e6,3.5e6,5.e-5,1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                         -13-14--15--16--17-18--19--20--21- -22- -23- -24-  -25- -26-
+  //                          -27--28-  -29-   -30-  -31- -32-  -33-  -34- -35- -36- -37-
+  if(PDG ==-211)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_pimpel; ip++) lastPAR[ip]=pimp_el[ip]; // PiMinus+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (pel=peh_fit.f)
+        lastPAR[0]=(.95*sa+2.E5/a16)/(1.+17/a);                              // p1
+        lastPAR[1]=a/(1./4.4+1./a);                                          // p2
+        lastPAR[2]=.22/std::pow(a,.33);                                      // p3
+        lastPAR[3]=.5*a/(1.+3./a+1800./a8);                                  // p4
+        lastPAR[4]=3.E-4*std::pow(a,.32)/(1.+14./a2);                        // p5
+        lastPAR[5]=0.;                                                       // p6 not used
+        lastPAR[6]=(.55+.001*a2)/(1.+4.E-4*a2);                              // p7
+        lastPAR[7]=(.0002/asa+4.E-9*a)/(1.+9./a4);                           // p8
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QPionMinusElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QPionMinusElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QPionMinusElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QPionMinusElasticCrossSection::GetPTables: PDG="<<PDG
+                 <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QPionMinusElasticCrossSection::GetPTab:PDG="<<PDG<<", Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QPionMinusElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=-211"<<G4endl;
+    throw G4QException("G4QPionMinusElasticCrossSection::GetPTables:onlyPipA implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QPionMinusElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QPiPlElCS::GetExcT: F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!=-211)G4cout<<"Warning*G4QPionMinusElasticCrossSection::GetExT:PDG="<<PDG<<G4endl;
+  if(onlyCS)G4cout<<"Warning*G4QPionMinusElasticCrossSection::GetExchanT:onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QElasticCS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:1p "<<ts1<<"#"<<lastTM<<",d="<<ds1
+            <<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:2p "<<ts2<<"#"<<lastTM<<",d="<<ds2
+            <<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:3p "<<ts3<<"#"<<lastTM<<",d="<<ds3
+            <<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QElCS::GetExT: a="<<a<<",t="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",SS="
+          <<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="
+          <<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:1a "<<ts1<<"#"<<lastTM<<",d="<<ds1
+            <<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:2a "<<ts2<<"#"<<lastTM<<",d="<<ds2
+            <<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:3a "<<ts3<<"#"<<lastTM<<",d="<<ds3
+            <<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:4a "<<ts4<<"#"<<lastTM<<",d="<<ds4
+            <<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QElCS::GtExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT: Q2="<<q2<<", r2="<<R2<<", b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<", r3="<<R2<<", b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QElasticCrossSect::GetExchangeT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QElasticCrossSect::GetExT:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QPionMinusElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QElasticCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"Warning*G4QPionMinusElasticCrossSection::GetSlope:onlCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG !=-211)
+  {
+    G4cout<<"*Error*G4QPionMinusElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=-211"<<G4endl;
+    throw G4QException("G4QPionMinusElasticCrossSection::GetSlope: pipA are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QElasticCrossSect::Getslope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QPionMinusElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QPionMinusElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG!=-211)G4cout<<"*Warn*G4QPionMinusElasticCrossSection::GetTabV: PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QPionPlusElCS::GetTabValue:(1-92) No isotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QElasticCS::GetTabValue: No isotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QElasticCS::GetTabVal: lp="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 ) // PiMin+P
+  {
+    G4double dl2=lp-lastPAR[14];
+    theSS=lastPAR[37];
+    theS1=(lastPAR[15]+lastPAR[16]*dl2*dl2)/(1.+lastPAR[17]/p4/p)+
+          (lastPAR[18]/p2+lastPAR[19]*p)/(p4+lastPAR[20]*sp);
+    theB1=lastPAR[21]*std::pow(p,lastPAR[22])/(1.+lastPAR[23]/p3);
+    theS2=lastPAR[24]+lastPAR[25]/(p4+lastPAR[26]*p);
+    theB2=lastPAR[27]+lastPAR[28]/(p4+lastPAR[29]/sp); 
+    theS3=lastPAR[30]+lastPAR[31]/(p4*p4+lastPAR[32]*p2+lastPAR[33]);
+    theB3=lastPAR[34]+lastPAR[35]/(p4+lastPAR[36]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QElasticCS::GetTableValues:(pp) TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1
+          <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pim-p cross-section (to avoid spoiling lastSIG)
+    G4double lr=lp+lastPAR[0];  // lr
+    G4double ld=lp-lastPAR[14];
+    G4double dl3=lp+lastPAR[4]; // lm
+    G4double dl4=lp-lastPAR[6]; // lh
+    return lastPAR[1]/(lr*lr+lastPAR[2])+
+           (lastPAR[8]*ld*ld+lastPAR[9]+lastPAR[10]/sp)/(1.+lastPAR[11]/p4)+
+           lastPAR[12]/(dl3*dl3+lastPAR[5])+lastPAR[13]/(dl4*dl4+lastPAR[7]);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetTabV: hA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QElCS::GetTabV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    //         p1               p2              p3
+    return (lastPAR[0]*dl*dl+lastPAR[1])/(1.+lastPAR[2]/p8)+
+           lastPAR[3]/(p4+lastPAR[4]/p3)+lastPAR[6]/(p4+lastPAR[7]/p4);
+    //        p4             p5               p7           p8
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QPionMinusElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  static const G4double mPi= G4QPDGCode(211).GetMass()*.001; // pion mass MeV to GeV
+  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mPi2= mPi*mPi;
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // ---> pipA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mPi2)+mPi2+mt*mt;    // Mondelstam s
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QPionMinusElasticCrossSection::GetQ2max:PDG="<<PDG<<",Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QPionMinusElasticCrossSection::GetQ2max: only pipA implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QPionPlusElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QPionPlusElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QPionPlusElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1101 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QPionPlusElasticCrossSection.cc,v 1.3 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QPionPlusElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 21-Jan-10
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 21-Jan-10
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QPionPlusElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QPionPlusElasticCrossSection::nPoints=128;//#ofPt in AMDB table(>anyPar)(D)
+const G4int G4QPionPlusElasticCrossSection::nLast=nPoints-1;// theLastElement inTheTable(D)
+G4double  G4QPionPlusElasticCrossSection::lPMin=-8.;  // Min tabulated logarithmMomentum(D)
+G4double  G4QPionPlusElasticCrossSection::lPMax= 8.;  // Max tabulated logarithmMomentum(D)
+G4double  G4QPionPlusElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep inTheTable(D)
+G4bool    G4QPionPlusElasticCrossSection::onlyCS=true;// Flag toCalcul OnlyCS(not Si/Bi)(L)
+G4double  G4QPionPlusElasticCrossSection::lastSIG=0.; // Last calculated cross section  (L)
+G4double  G4QPionPlusElasticCrossSection::lastLP=-10.;// Last log(mom_of IncidentHadron)(L)
+G4double  G4QPionPlusElasticCrossSection::lastTM=0.;  // Last t_maximum                 (L)
+G4double  G4QPionPlusElasticCrossSection::theSS=0.;   // TheLastSqSlope of 1st difr.Max(L)
+G4double  G4QPionPlusElasticCrossSection::theS1=0.;   // TheLastMantissa of 1st difr.Max(L)
+G4double  G4QPionPlusElasticCrossSection::theB1=0.;   // TheLastSlope of 1st difruct.Max(L)
+G4double  G4QPionPlusElasticCrossSection::theS2=0.;   // TheLastMantissa of 2nd difr.Max(L)
+G4double  G4QPionPlusElasticCrossSection::theB2=0.;   // TheLastSlope of 2nd difruct.Max(L)
+G4double  G4QPionPlusElasticCrossSection::theS3=0.;   // TheLastMantissa of 3d difr. Max(L)
+G4double  G4QPionPlusElasticCrossSection::theB3=0.;   // TheLastSlope of 3d difruct. Max(L)
+G4double  G4QPionPlusElasticCrossSection::theS4=0.;   // TheLastMantissa of 4th difr.Max(L)
+G4double  G4QPionPlusElasticCrossSection::theB4=0.;   // TheLastSlope of 4th difruct.Max(L)
+G4int     G4QPionPlusElasticCrossSection::lastTZ=0;   // Last atomic number of the target
+G4int     G4QPionPlusElasticCrossSection::lastTN=0;   // Last # of neutrons in the target
+G4double  G4QPionPlusElasticCrossSection::lastPIN=0.; // Last initialized max momentum
+G4double* G4QPionPlusElasticCrossSection::lastCST=0;  // Elastic cross-section table
+G4double* G4QPionPlusElasticCrossSection::lastPAR=0;  // ParametersForFunctionalCalculation
+G4double* G4QPionPlusElasticCrossSection::lastSST=0;  // E-dep of SqaredSlope of 1st difMax
+G4double* G4QPionPlusElasticCrossSection::lastS1T=0;  // E-dep of mantissa of 1st dif.Max
+G4double* G4QPionPlusElasticCrossSection::lastB1T=0;  // E-dep of the slope of 1st difMax
+G4double* G4QPionPlusElasticCrossSection::lastS2T=0;  // E-dep of mantissa of 2nd difrMax
+G4double* G4QPionPlusElasticCrossSection::lastB2T=0;  // E-dep of the slope of 2nd difMax
+G4double* G4QPionPlusElasticCrossSection::lastS3T=0;  // E-dep of mantissa of 3d difr.Max
+G4double* G4QPionPlusElasticCrossSection::lastB3T=0;  // E-dep of the slope of 3d difrMax
+G4double* G4QPionPlusElasticCrossSection::lastS4T=0;  // E-dep of mantissa of 4th difrMax
+G4double* G4QPionPlusElasticCrossSection::lastB4T=0;  // E-dep of the slope of 4th difMax
+G4int     G4QPionPlusElasticCrossSection::lastN=0;    // The last N of calculated nucleus
+G4int     G4QPionPlusElasticCrossSection::lastZ=0;    // The last Z of calculated nucleus
+G4double  G4QPionPlusElasticCrossSection::lastP=0.;   // LastUsed in cross section Momentum
+G4double  G4QPionPlusElasticCrossSection::lastTH=0.;  // Last threshold momentum
+G4double  G4QPionPlusElasticCrossSection::lastCS=0.;  // Last value of the Cross Section
+G4int     G4QPionPlusElasticCrossSection::lastI=0;    // The last position in the DAMDB
+
+std::vector<G4double*> G4QPionPlusElasticCrossSection::PAR;// Vector of pars forFunctCalcul
+std::vector<G4double*> G4QPionPlusElasticCrossSection::CST;// Vector of cross-section table
+std::vector<G4double*> G4QPionPlusElasticCrossSection::SST;// Vector of the 1st SquareSlope
+std::vector<G4double*> G4QPionPlusElasticCrossSection::S1T;// Vector of the 1st mantissa
+std::vector<G4double*> G4QPionPlusElasticCrossSection::B1T;// Vector of the 1st slope
+std::vector<G4double*> G4QPionPlusElasticCrossSection::S2T;// Vector of the 2nd mantissa
+std::vector<G4double*> G4QPionPlusElasticCrossSection::B2T;// Vector of the 2nd slope
+std::vector<G4double*> G4QPionPlusElasticCrossSection::S3T;// Vector of the 3d mantissa
+std::vector<G4double*> G4QPionPlusElasticCrossSection::B3T;// Vector of the 3d slope
+std::vector<G4double*> G4QPionPlusElasticCrossSection::S4T;// Vector of the 4th mantissa(g)
+std::vector<G4double*> G4QPionPlusElasticCrossSection::B4T;// Vector of the 4th slope(glor)
+
+G4QPionPlusElasticCrossSection::G4QPionPlusElasticCrossSection()
+{
+}
+
+G4QPionPlusElasticCrossSection::~G4QPionPlusElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QPionPlusElasticCrossSection::GetPointer()
+{
+  static G4QPionPlusElasticCrossSection theCrossSection;//StaticBody of theQEl CrossSection
+#ifdef pdebug
+  G4cout<<"G4QPiPlElCS::GetCS: PiPlus Elastic pointer is taken"<<G4endl;
+#endif
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QPionPlusElasticCrossSection::GetCrossSection(G4bool fCS, G4double pMom,
+                                                         G4int tgZ, G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QPElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG!= 211)
+  {
+    G4cout<<"*Warning*G4QPionPlusElCS::GetCS:**> Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef debug
+      G4cout<<"G4QElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef debug
+        G4cout<<"G4QElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef debug
+        G4cout<<"G4QElCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef debug
+      G4cout<<"G4QElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef debug
+      G4cout<<"G4QElCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef debug
+        G4cout<<"G4QElCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef debug
+    G4cout<<"---G4QElCrossSec::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="<<colN[i]
+          <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef debug
+    G4cout<<"G4QElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef debug
+      G4cout<<"G4QElCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef debug
+        G4cout<<"G4QElCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef debug
+    G4cout<<"G4QElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef debug
+    G4cout<<"G4QElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef debug
+    G4cout<<"G4QElCS::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef debug
+  G4cout<<"G4QElCS::GetCrSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QElCS::GetCrSec:***End***, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QPionPlusElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F, G4int I,
+                                             G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef debug
+  G4cout<<"G4QPionPlusElasticCroS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef debug
+      G4cout<<"G4QElasticCS::CalcCS: DB is updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef debug
+    G4cout<<"G4QPionPlusElasticCroS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef debug
+      G4cout<<"G4QElCS::CalcCS:*updated(I)*,LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef debug
+    G4cout<<"G4QPionPlusElasticCroS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef debug
+    G4cout<<"G4QPiPlElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef debug
+  G4cout<<"G4QElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef debug
+    G4cout<<"G4QElCS::CalcCS: *updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef debug
+  G4cout<<"G4QElastCS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef debug
+  G4cout<<"G4QElasticCrosSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QEleastCS::CCS:b="<<blast<<","<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef debug
+      G4cout<<"G4QPionPlusElasticCroS::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef debug
+      G4cout<<"G4QElCS::CalcCrossSection: Sig="<<lastSIG<<", P="<<pMom<<", Z="<<tgZ<<", N="
+            <<tgN<<", PDG="<<PDG<<", onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef debug
+        G4cout<<"G4QElCS::CalcCrossSection:bl="<<blast<<",ls="<<lastL<<",SL="<<S1TL<<",SU="
+              <<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef debug
+        G4cout<<"G4QElCS::CCS: s3l="<<S3TL<<",sh3="<<shift<<",s3h="<<lastS3T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef debug
+        G4cout<<"G4QElCS::CCS: s4l="<<S4TL<<",sh4="<<shift<<",s4h="<<lastS4T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef debug
+      G4cout<<"G4QPionPlusElasticCroS::CalculateCS:(I) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef debug
+  G4cout<<"G4QPionPlusElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QPionPlusElasticCrossSection::GetPTables(G4double LP, G4double ILP, G4int PDG,
+                                                  G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_pippel=35;               // #of parameters for pip_p-elastic (<nPoints=128)
+  //                           -0- -1-   -2- -3- -4-  -5-   -6-  -7--8--9--10-11-12--13-
+  G4double pipp_el[n_pippel]={1.27,13.,.0676,3.5,.32,.0576,.0557,2.4,6.,3.,.7,5.,74.,3.,
+                              3.4,.2,.17,.001,8.,.055,3.64,5.e-5,4000.,1500.,.46,1.2e6,
+                              3.5e6,5.e-5,1.e10,8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                         -14--15--16--17--18- -19--20-  -21-  -22-  -23- -24- -25-
+  //                          -26-   -27-  -28-  -29- -30-  -31- -32- -33- -34-
+  if(PDG == 211)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_pippel; ip++) lastPAR[ip]=pipp_el[ip]; // PiPlus+P
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        //G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (pel=peh_fit.f)
+        lastPAR[0]=(.95*sa+2.E5/a16)/(1.+17/a);                              // p1
+        lastPAR[1]=a/(1./4.4+1./a);                                          // p2
+        lastPAR[2]=.22/std::pow(a,.33);                                      // p3
+        lastPAR[3]=.5*a/(1.+3./a+1800./a8);                                  // p4
+        lastPAR[4]=3.E-4*std::pow(a,.32)/(1.+14./a2);                        // p5
+        lastPAR[5]=0.;                                                       // p6 not used
+        lastPAR[6]=(.55+.001*a2)/(1.+4.E-4*a2);                              // p7
+        lastPAR[7]=(.0002/asa+4.E-9*a)/(1.+9./a4);                           // p8
+        lastPAR[8]=0.;                                                       // p9 not used
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef debug
+         G4cout<<"G4QElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef debug
+         G4cout<<"G4QElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef debug
+      G4cout<<"G4QPionPlusElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="
+            <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef debug
+            G4cout<<"G4QPionPlusElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp
+                  <<",S1="<<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QPionPlusElasticCrossSection::GetPTables: PDG="<<PDG
+                   <<", Z="<<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP
+                   <<" > ILP="<<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QPionPlusElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="
+                 <<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef debug
+    else G4cout<<"*Warning*G4QPionPlusElasticCrossSection::GetPTabl:PDG="<<PDG<<", Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QPionPlusElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=211"<<G4endl;
+    throw G4QException("G4QPionPlusElasticCrossSection::GetPTables:only pipA implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QPionPlusElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QPiPlElCS::GetExcT: F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!= 211)G4cout<<"*Warning*G4QPionPlusElasticCrossSection::GetExT:PDG="<<PDG<<G4endl;
+  if(onlyCS)G4cout<<"*Warning*G4QPionPlusElasticCrossSection::GetExchanT:onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QElasticCS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:1p "<<ts1<<"#"<<lastTM<<",d="<<ds1
+            <<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:2p "<<ts2<<"#"<<lastTM<<",d="<<ds2
+            <<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:3p "<<ts3<<"#"<<lastTM<<",d="<<ds3
+            <<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QElCS::GetExT: a="<<a<<",t="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",SS="
+          <<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="
+          <<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:1a "<<ts1<<"#"<<lastTM<<",d="<<ds1
+            <<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:2a "<<ts2<<"#"<<lastTM<<",d="<<ds2
+            <<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:3a "<<ts3<<"#"<<lastTM<<",d="<<ds3
+            <<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:4a "<<ts4<<"#"<<lastTM<<",d="<<ds4
+            <<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QElCS::GtExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT: Q2="<<q2<<", r2="<<R2<<", b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<", r3="<<R2<<", b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QElasticCrossSect::GetExchangeT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QElasticCrossSect::GetExT:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QPionPlusElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QElasticCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS)G4cout<<"Warning*G4QPionPlusElasticCrossSection::GetSlope:onlyCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG != 211)
+  {
+    G4cout<<"*Error*G4QPionPlusElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=211"<<G4endl;
+    throw G4QException("G4QPionPlusElasticCrossSection::GetSlope: pipA are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QElasticCrossSect::Getslope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QPionPlusElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QPionPlusElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG!= 211)G4cout<<"Warning*G4QPionPlusElasticCrossSection::GetTabV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QPionPlusElCS::GetTabValue:(1-92) No isotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QElasticCS::GetTabValue: No isotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef debug
+  G4cout<<"G4QElasticCS::GetTabVal: lp="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;
+  G4double p3=p2*p;
+  G4double p4=p2*p2;
+  if ( tgZ == 1 && tgN == 0 ) // PiPlus+P
+  {
+    G4double dl2=lp-lastPAR[11];
+    theSS=lastPAR[34];
+    theS1=(lastPAR[12]+lastPAR[13]*dl2*dl2)/(1.+lastPAR[14]/p4/p)+
+          (lastPAR[15]/p2+lastPAR[16]*p)/(p4+lastPAR[17]*sp);
+    theB1=lastPAR[18]*std::pow(p,lastPAR[19])/(1.+lastPAR[20]/p3);
+    theS2=lastPAR[21]+lastPAR[22]/(p4+lastPAR[23]*p);
+    theB2=lastPAR[24]+lastPAR[25]/(p4+lastPAR[26]/sp); 
+    theS3=lastPAR[27]+lastPAR[28]/(p4*p4+lastPAR[29]*p2+lastPAR[30]);
+    theB3=lastPAR[31]+lastPAR[32]/(p4+lastPAR[33]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QElasticCS::GetTableValues:(pp) TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1
+          <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pip-p cross-section (to avoid spoiling lastSIG)
+    G4double dl1=lp+lastPAR[0];  // lr
+    G4double lr2=dl1*dl1;        // lr2
+    G4double dl3=lp-lastPAR[3];  // ld
+    G4double dl4=lp-lastPAR[4];  // lm
+    return lastPAR[1]/(lr2+lr2*lr2+lastPAR[2])+(lastPAR[6]*dl3*dl3+lastPAR[7]+
+           lastPAR[8]/sp)/(1.+lastPAR[9]/p4)+lastPAR[10]/(dl4*dl4+lastPAR[5]);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetTabV: hA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QElCS::GetTabV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    //         p1               p2              p3
+    return (lastPAR[0]*dl*dl+lastPAR[1])/(1.+lastPAR[2]/p8)+
+           lastPAR[3]/(p4+lastPAR[4]/p3)+lastPAR[6]/(p4+lastPAR[7]/p4);
+    //        p4             p5               p7           p8
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QPionPlusElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  static const G4double mPi= G4QPDGCode(211).GetMass()*.001; // pion mass MeV to GeV
+  //static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mPi2= mPi*mPi;
+  //static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ || tgN>-1)                                   // ---> pipA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mPi2)+mPi2+mt*mt;    // Mondelstam s
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QPionPlusElasticCrossSection::GetQ2max:PDG="<<PDG<<", Z="<<tgZ<<",N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QPionPlusElasticCrossSection::GetQ2max: only pipA implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QProtonElasticCrossSection.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QProtonElasticCrossSection.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/cross_sections/src/G4QProtonElasticCrossSection.cc	(revision 1316)
@@ -0,0 +1,1109 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+//
+// $Id: G4QProtonElasticCrossSection.cc,v 1.3 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+//
+// G4 Physics class: G4QProtonElasticCrossSection for pA elastic cross sections
+// Created: M.V. Kossov, CERN/ITEP(Moscow), 10-OCT-01
+// The last update: M.V. Kossov, CERN/ITEP (Moscow) 12-Jan-10 (from G4QElCrSect)
+// 
+//================================================================================
+// Short description: Interaction cross-sections for the G4QElastic process
+// -------------------------------------------------------------------------------
+
+//#define debug
+//#define isodebug
+//#define pdebug
+//#define ppdebug
+//#define tdebug
+//#define sdebug
+
+#include "G4QProtonElasticCrossSection.hh"
+
+// Initialization of the static parameters
+const G4int G4QProtonElasticCrossSection::nPoints=128;//#ofPt in the AMDB table(>anyPar)(D)
+const G4int G4QProtonElasticCrossSection::nLast=nPoints-1;// theLastElement in the table(D)
+G4double  G4QProtonElasticCrossSection::lPMin=-8.;  // Min tabulated logarithmicMomentum(D)
+G4double  G4QProtonElasticCrossSection::lPMax= 8.;  // Max tabulated logarithmicMomentum(D)
+G4double  G4QProtonElasticCrossSection::dlnP=(lPMax-lPMin)/nLast;// LogStep in the table(D)
+G4bool    G4QProtonElasticCrossSection::onlyCS=true;// Flag toCalculateOnlyCS(not Si/Bi)(L)
+G4double  G4QProtonElasticCrossSection::lastSIG=0.; // Last calculated cross section    (L)
+G4double  G4QProtonElasticCrossSection::lastLP=-10.;// Last log(mom_ofTheIncidentHadron)(L)
+G4double  G4QProtonElasticCrossSection::lastTM=0.;  // Last t_maximum                   (L)
+G4double  G4QProtonElasticCrossSection::theSS=0.;   // The Last sq.slope of 1st difr.Max(L)
+G4double  G4QProtonElasticCrossSection::theS1=0.;   // The Last mantissa of 1st difr.Max(L)
+G4double  G4QProtonElasticCrossSection::theB1=0.;   // The Last slope of 1st difruct.Max(L)
+G4double  G4QProtonElasticCrossSection::theS2=0.;   // The Last mantissa of 2nd difr.Max(L)
+G4double  G4QProtonElasticCrossSection::theB2=0.;   // The Last slope of 2nd difruct.Max(L)
+G4double  G4QProtonElasticCrossSection::theS3=0.;   // The Last mantissa of 3d difr. Max(L)
+G4double  G4QProtonElasticCrossSection::theB3=0.;   // The Last slope of 3d difruct. Max(L)
+G4double  G4QProtonElasticCrossSection::theS4=0.;   // The Last mantissa of 4th difr.Max(L)
+G4double  G4QProtonElasticCrossSection::theB4=0.;   // The Last slope of 4th difruct.Max(L)
+G4int     G4QProtonElasticCrossSection::lastTZ=0;   // Last atomic number of the target
+G4int     G4QProtonElasticCrossSection::lastTN=0;   // Last # of neutrons in the target
+G4double  G4QProtonElasticCrossSection::lastPIN=0.; // Last initialized max momentum
+G4double* G4QProtonElasticCrossSection::lastCST=0;  // Elastic cross-section table
+G4double* G4QProtonElasticCrossSection::lastPAR=0;  // Parameters for FunctionalCalculation
+G4double* G4QProtonElasticCrossSection::lastSST=0;  // E-dep of sq.slope of the 1st dif.Max
+G4double* G4QProtonElasticCrossSection::lastS1T=0;  // E-dep of mantissa of the 1st dif.Max
+G4double* G4QProtonElasticCrossSection::lastB1T=0;  // E-dep of the slope of the 1st difMax
+G4double* G4QProtonElasticCrossSection::lastS2T=0;  // E-dep of mantissa of the 2nd difrMax
+G4double* G4QProtonElasticCrossSection::lastB2T=0;  // E-dep of the slope of the 2nd difMax
+G4double* G4QProtonElasticCrossSection::lastS3T=0;  // E-dep of mantissa of the 3d difr.Max
+G4double* G4QProtonElasticCrossSection::lastB3T=0;  // E-dep of the slope of the 3d difrMax
+G4double* G4QProtonElasticCrossSection::lastS4T=0;  // E-dep of mantissa of the 4th difrMax
+G4double* G4QProtonElasticCrossSection::lastB4T=0;  // E-dep of the slope of the 4th difMax
+G4int     G4QProtonElasticCrossSection::lastN=0;    // The last N of calculated nucleus
+G4int     G4QProtonElasticCrossSection::lastZ=0;    // The last Z of calculated nucleus
+G4double  G4QProtonElasticCrossSection::lastP=0.;   // Last used in cross section Momentum
+G4double  G4QProtonElasticCrossSection::lastTH=0.;  // Last threshold momentum
+G4double  G4QProtonElasticCrossSection::lastCS=0.;  // Last value of the Cross Section
+G4int     G4QProtonElasticCrossSection::lastI=0;    // The last position in the DAMDB
+
+std::vector<G4double*> G4QProtonElasticCrossSection::PAR; // Vector of pars for functCalcul
+std::vector<G4double*> G4QProtonElasticCrossSection::CST; // Vector of cross-section table
+std::vector<G4double*> G4QProtonElasticCrossSection::SST; // Vector of the 1st SquaredSlope
+std::vector<G4double*> G4QProtonElasticCrossSection::S1T; // Vector of the 1st mantissa
+std::vector<G4double*> G4QProtonElasticCrossSection::B1T; // Vector of the 1st slope
+std::vector<G4double*> G4QProtonElasticCrossSection::S2T; // Vector of the 2nd mantissa
+std::vector<G4double*> G4QProtonElasticCrossSection::B2T; // Vector of the 2nd slope
+std::vector<G4double*> G4QProtonElasticCrossSection::S3T; // Vector of the 3d mantissa
+std::vector<G4double*> G4QProtonElasticCrossSection::B3T; // Vector of the 3d slope
+std::vector<G4double*> G4QProtonElasticCrossSection::S4T; // Vector of the 4th mantissa (g)
+std::vector<G4double*> G4QProtonElasticCrossSection::B4T; // Vector of the 4th slope (glor)
+
+G4QProtonElasticCrossSection::G4QProtonElasticCrossSection()
+{
+}
+
+G4QProtonElasticCrossSection::~G4QProtonElasticCrossSection()
+{
+  std::vector<G4double*>::iterator pos;
+  for (pos=CST.begin(); pos<CST.end(); pos++)
+  { delete [] *pos; }
+  CST.clear();
+  for (pos=PAR.begin(); pos<PAR.end(); pos++)
+  { delete [] *pos; }
+  PAR.clear();
+  for (pos=SST.begin(); pos<SST.end(); pos++)
+  { delete [] *pos; }
+  SST.clear();
+  for (pos=S1T.begin(); pos<S1T.end(); pos++)
+  { delete [] *pos; }
+  S1T.clear();
+  for (pos=B1T.begin(); pos<B1T.end(); pos++)
+  { delete [] *pos; }
+  B1T.clear();
+  for (pos=S2T.begin(); pos<S2T.end(); pos++)
+  { delete [] *pos; }
+  S2T.clear();
+  for (pos=B2T.begin(); pos<B2T.end(); pos++)
+  { delete [] *pos; }
+  B2T.clear();
+  for (pos=S3T.begin(); pos<S3T.end(); pos++)
+  { delete [] *pos; }
+  S3T.clear();
+  for (pos=B3T.begin(); pos<B3T.end(); pos++)
+  { delete [] *pos; }
+  B3T.clear();
+  for (pos=S4T.begin(); pos<S4T.end(); pos++)
+  { delete [] *pos; }
+  S4T.clear();
+  for (pos=B4T.begin(); pos<B4T.end(); pos++)
+  { delete [] *pos; }
+  B4T.clear();
+}
+
+// Returns Pointer to the G4VQCrossSection class
+G4VQCrossSection* G4QProtonElasticCrossSection::GetPointer()
+{
+  static G4QProtonElasticCrossSection theCrossSection;//*StaticBody of theQEl CrossSection*
+  return &theCrossSection;
+}
+
+// The main member function giving the collision cross section (P is in IU, CS is in mb)
+// Make pMom in independent units ! (Now it is MeV)
+G4double G4QProtonElasticCrossSection::GetCrossSection(G4bool fCS,G4double pMom, G4int tgZ,
+                                                       G4int tgN, G4int pPDG)
+{
+  static std::vector <G4int>    colN;  // Vector of N for calculated nuclei (isotops)
+  static std::vector <G4int>    colZ;  // Vector of Z for calculated nuclei (isotops)
+  static std::vector <G4double> colP;  // Vector of last momenta for the reaction
+  static std::vector <G4double> colTH; // Vector of energy thresholds for the reaction
+  static std::vector <G4double> colCS; // Vector of last cross sections for the reaction
+  // ***---*** End of the mandatory Static Definitions of the Associative Memory ***---***
+  G4double pEn=pMom;
+  onlyCS=fCS;
+#ifdef pdebug
+  G4cout<<"G4QPElCS::GetCS:>>> f="<<fCS<<", p="<<pMom<<", Z="<<tgZ<<"("<<lastZ<<") ,N="
+        <<tgN<<"("<<lastN<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="<<colN.size()<<G4endl;
+  //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  if(pPDG!=2212)
+  {
+    G4cout<<"*Warning*G4QProtonElCS::GetCS: *** Found pPDG="<<pPDG<<" ====> CS=0"<<G4endl;
+    //CalculateCrossSection(fCS,-27,j,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+    return 0.;                         // projectile PDG=0 is a mistake (?!) @@
+  }
+  G4bool in=false;                   // By default the isotope must be found in the AMDB
+  lastP   = 0.;                      // New momentum history (nothing to compare with)
+  lastN   = tgN;                     // The last N of the calculated nucleus
+  lastZ   = tgZ;                     // The last Z of the calculated nucleus
+  lastI   = colN.size();             // Size of the Associative Memory DB in the heap
+  if(lastI) for(G4int i=0; i<lastI; i++) // Loop over proj/tgZ/tgN lines of DB
+  {                                  // The nucleus with projPDG is found in AMDB
+    if(colN[i]==tgN && colZ[i]==tgZ) // Isotope is foind in AMDB
+    {
+      lastI=i;
+      lastTH =colTH[i];              // Last THreshold (A-dependent)
+#ifdef pdebug
+      G4cout<<"G4QElCS::GetCS:*Found* P="<<pMom<<",Threshold="<<lastTH<<",i="<<i<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(pEn<=lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS:Found T="<<pEn<<" < Threshold="<<lastTH<<",CS=0"<<G4endl;
+        //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+        return 0.;                   // Energy is below the Threshold value
+      }
+      lastP  =colP [i];              // Last Momentum  (A-dependent)
+      lastCS =colCS[i];              // Last CrossSect (A-dependent)
+      //  if(std::fabs(lastP/pMom-1.)<tolerance) //VI (do not use tolerance)
+      if(lastP == pMom)              // Do not recalculate
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS:P="<<pMom<<",CS="<<lastCS*millibarn<<G4endl;
+#endif
+        CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // Update param's only
+        return lastCS*millibarn;     // Use theLastCS
+      }
+      in = true;                       // This is the case when the isotop is found in DB
+      // Momentum pMom is in IU ! @@ Units
+#ifdef pdebug
+      G4cout<<"G4QElCS::G:UpdateDB P="<<pMom<<",f="<<fCS<<",I="<<lastI<<",i="<<i<<G4endl;
+#endif
+      lastCS=CalculateCrossSection(fCS,-1,i,pPDG,lastZ,lastN,pMom); // read & update
+#ifdef pdebug
+      G4cout<<"G4QElCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<G4endl;
+      //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+      if(lastCS<=0. && pEn>lastTH)    // Correct the threshold
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS: New T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+      break;                           // Go out of the LOOP with found lastI
+    }
+#ifdef pdebug
+    G4cout<<"---G4QElCrossSec::GetCrosSec:pPDG="<<pPDG<<",i="<<i<<",N="<<colN[i]
+          <<",Z["<<i<<"]="<<colZ[i]<<G4endl;
+    //CalculateCrossSection(fCS,-27,i,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+  } // End of attampt to find the nucleus in DB
+  if(!in)                            // This nucleus has not been calculated previously
+  {
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCrosSec:CalcNew P="<<pMom<<",f="<<fCS<<",lastI="<<lastI<<G4endl;
+#endif
+    //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
+    lastCS=CalculateCrossSection(fCS,0,lastI,pPDG,lastZ,lastN,pMom);//calculate&create
+    if(lastCS<=0.)
+    {
+      lastTH = ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
+#ifdef pdebug
+      G4cout<<"G4QElCrossSection::GetCrossSect: NewThresh="<<lastTH<<",T="<<pEn<<G4endl;
+#endif
+      if(pEn>lastTH)
+      {
+#ifdef pdebug
+        G4cout<<"G4QElCS::GetCS: First T="<<pEn<<"(CS=0) > Threshold="<<lastTH<<G4endl;
+#endif
+        lastTH=pEn;
+      }
+    }
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCrosSec: New CS="<<lastCS<<",lZ="<<lastN<<",lN="<<lastZ<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    colN.push_back(tgN);
+    colZ.push_back(tgZ);
+    colP.push_back(pMom);
+    colTH.push_back(lastTH);
+    colCS.push_back(lastCS);
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCS:1st,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+    //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+#endif
+    return lastCS*millibarn;
+  } // End of creation of the new set of parameters
+  else
+  {
+#ifdef pdebug
+    G4cout<<"G4QElCS::GetCS: Update lastI="<<lastI<<G4endl;
+#endif
+    colP[lastI]=pMom;
+    colCS[lastI]=lastCS;
+  }
+#ifdef pdebug
+  G4cout<<"G4QElCS::GetCrSec:End,P="<<pMom<<"(MeV),CS="<<lastCS*millibarn<<"(mb)"<<G4endl;
+  //CalculateCrossSection(fCS,-27,lastI,pPDG,lastZ,lastN,pMom); // DUMMY TEST
+  G4cout<<"G4QElCS::GetCrSec:***End***, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastCS*millibarn;
+}
+
+// Calculation of total elastic cross section (p in IU, CS in mb) @@ Units (?)
+// F=0 - create AMDB, F=-1 - read&update AMDB, F=1 - update AMDB (sinchro with higher AMDB)
+G4double G4QProtonElasticCrossSection::CalculateCrossSection(G4bool CS, G4int F, G4int I,
+                                             G4int PDG, G4int tgZ, G4int tgN, G4double pIU)
+{
+  // *** Begin of Associative Memory DB for acceleration of the cross section calculations
+  static std::vector <G4double>  PIN;   // Vector of max initialized log(P) in the table
+  // *** End of Static Definitions (Associative Memory Data Base) ***
+  G4double pMom=pIU/GeV;                // All calculations are in GeV
+  onlyCS=CS;                            // Flag to calculate only CS (not Si/Bi)
+#ifdef pdebug
+  G4cout<<"G4QProtonElasticCrossS::CalcCS:->onlyCS="<<onlyCS<<",F="<<F<<",p="<<pIU<<G4endl;
+#endif
+  lastLP=std::log(pMom);                // Make a logarithm of the momentum for calculation
+  if(F)                                 // This isotope was found in AMDB =>RETRIEVE/UPDATE
+  {
+    if(F<0)                             // the AMDB must be loded
+    {
+      lastPIN = PIN[I];                 // Max log(P) initialised for this table set
+      lastPAR = PAR[I];                 // Pointer to the parameter set
+      lastCST = CST[I];                 // Pointer to the total sross-section table
+      lastSST = SST[I];                 // Pointer to the first squared slope
+      lastS1T = S1T[I];                 // Pointer to the first mantissa
+      lastB1T = B1T[I];                 // Pointer to the first slope
+      lastS2T = S2T[I];                 // Pointer to the second mantissa
+      lastB2T = B2T[I];                 // Pointer to the second slope
+      lastS3T = S3T[I];                 // Pointer to the third mantissa
+      lastB3T = B3T[I];                 // Pointer to the rhird slope
+      lastS4T = S4T[I];                 // Pointer to the 4-th mantissa
+      lastB4T = B4T[I];                 // Pointer to the 4-th slope
+#ifdef pdebug
+      G4cout<<"G4QElasticCS::CalcCS: DB is updated for I="<<I<<",*,PIN4="<<PIN[4]<<G4endl;
+#endif
+    }
+#ifdef pdebug
+    G4cout<<"G4QProtonElasticCrossS::CalcCS:*read*, LP="<<lastLP<<",PIN="<<lastPIN<<G4endl;
+#endif
+    if(lastLP>lastPIN && lastLP<lPMax)
+    {
+      lastPIN=GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);// Can update upper logP-Limit in tabs
+#ifdef pdebug
+      G4cout<<"G4QElCS::CalcCS:*updated(I)*,LP="<<lastLP<<"<IN["<<I<<"]="<<lastPIN<<G4endl;
+#endif
+      PIN[I]=lastPIN;                   // Remember the new P-Limit of the tables
+    }
+  }
+  else                                  // This isotope wasn't initialized => CREATE
+  {
+    lastPAR = new G4double[nPoints];    // Allocate memory for parameters of CS function
+    lastPAR[nLast]=0;                   // Initialization for VALGRIND
+    lastCST = new G4double[nPoints];    // Allocate memory for Tabulated CS function    
+    lastSST = new G4double[nPoints];    // Allocate memory for Tabulated first sqaredSlope 
+    lastS1T = new G4double[nPoints];    // Allocate memory for Tabulated first mantissa 
+    lastB1T = new G4double[nPoints];    // Allocate memory for Tabulated first slope    
+    lastS2T = new G4double[nPoints];    // Allocate memory for Tabulated second mantissa
+    lastB2T = new G4double[nPoints];    // Allocate memory for Tabulated second slope   
+    lastS3T = new G4double[nPoints];    // Allocate memory for Tabulated third mantissa 
+    lastB3T = new G4double[nPoints];    // Allocate memory for Tabulated third slope    
+    lastS4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th mantissa 
+    lastB4T = new G4double[nPoints];    // Allocate memory for Tabulated 4-th slope    
+#ifdef pdebug
+    G4cout<<"G4QProtonElasticCrossS::CalcCS:*ini*,lastLP="<<lastLP<<",min="<<lPMin<<G4endl;
+#endif
+    lastPIN = GetPTables(lastLP,lPMin,PDG,tgZ,tgN); // Returns the new P-limit for tables
+#ifdef pdebug
+    G4cout<<"G4QProtElCS::CCS:i,Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<",LP"<<lastPIN<<G4endl;
+#endif
+    PIN.push_back(lastPIN);             // Fill parameters of CS function to AMDB
+    PAR.push_back(lastPAR);             // Fill parameters of CS function to AMDB
+    CST.push_back(lastCST);             // Fill Tabulated CS function to AMDB    
+    SST.push_back(lastSST);             // Fill Tabulated first sq.slope to AMDB 
+    S1T.push_back(lastS1T);             // Fill Tabulated first mantissa to AMDB 
+    B1T.push_back(lastB1T);             // Fill Tabulated first slope to AMDB    
+    S2T.push_back(lastS2T);             // Fill Tabulated second mantissa to AMDB 
+    B2T.push_back(lastB2T);             // Fill Tabulated second slope to AMDB    
+    S3T.push_back(lastS3T);             // Fill Tabulated third mantissa to AMDB 
+    B3T.push_back(lastB3T);             // Fill Tabulated third slope to AMDB    
+    S4T.push_back(lastS4T);             // Fill Tabulated 4-th mantissa to AMDB 
+    B4T.push_back(lastB4T);             // Fill Tabulated 4-th slope to AMDB    
+  } // End of creation/update of the new set of parameters and tables
+  // ============= NOW Update (if necessary) and Calculate the Cross Section ===========
+#ifdef pdebug
+  G4cout<<"G4QElCS::CalcCS:?update?,LP="<<lastLP<<",IN="<<lastPIN<<",ML="<<lPMax<<G4endl;
+#endif
+  if(lastLP>lastPIN && lastLP<lPMax)
+  {
+    lastPIN = GetPTables(lastLP,lastPIN,PDG,tgZ,tgN);
+#ifdef pdebug
+    G4cout<<"G4QElCS::CalcCS: *updated(O)*, LP="<<lastLP<<" < IN="<<lastPIN<<G4endl;
+#endif
+  }
+#ifdef pdebug
+  G4cout<<"G4QElastCS::CalcCS: lastLP="<<lastLP<<",lPM="<<lPMin<<",lPIN="<<lastPIN<<G4endl;
+#endif
+  if(!onlyCS) lastTM=GetQ2max(PDG, tgZ, tgN, pMom); // Calculate (-t)_max=Q2_max (GeV2)
+#ifdef pdebug
+  G4cout<<"G4QElasticCrosSec::CalcCS:oCS="<<onlyCS<<",-t="<<lastTM<<", p="<<lastLP<<G4endl;
+#endif
+  if(lastLP>lPMin && lastLP<=lastPIN)   // Linear fit is made using precalculated tables
+  {
+    if(lastLP==lastPIN)
+    {
+      G4double shift=(lastLP-lPMin)/dlnP+.000001; // Log distance from lPMin
+      G4int    blast=static_cast<int>(shift); // this is a bin number of the lower edge (0)
+      if(blast<0 || blast>=nLast) G4cout<<"G4QEleastCS::CCS:b="<<blast<<","<<nLast<<G4endl;
+      lastSIG = lastCST[blast];
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        theSS  = lastSST[blast];
+        theS1  = lastS1T[blast];
+        theB1  = lastB1T[blast];
+        theS2  = lastS2T[blast];
+        theB2  = lastB2T[blast];
+        theS3  = lastS3T[blast];
+        theB3  = lastB3T[blast];
+        theS4  = lastS4T[blast];
+        theB4  = lastB4T[blast];
+      }
+#ifdef pdebug
+      G4cout<<"G4QProtonElasticCrossS::CalculateCS:(E) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double shift=(lastLP-lPMin)/dlnP;        // a shift from the beginning of the table
+      G4int    blast=static_cast<int>(shift);    // the lower bin number
+      if(blast<0)   blast=0;
+      if(blast>=nLast) blast=nLast-1;            // low edge of the last bin
+      shift-=blast;                              // step inside the unit bin
+      G4int lastL=blast+1;                       // the upper bin number
+      G4double SIGL=lastCST[blast];              // the basic value of the cross-section
+      lastSIG= SIGL+shift*(lastCST[lastL]-SIGL); // calculated total elastic cross-section
+#ifdef pdebug
+      G4cout<<"G4QElCS::CalcCrossSection: Sig="<<lastSIG<<", P="<<pMom<<", Z="<<tgZ<<", N="
+            <<tgN<<", PDG="<<PDG<<", onlyCS="<<onlyCS<<G4endl;
+#endif
+      if(!onlyCS)                       // Skip the differential cross-section parameters
+      {
+        G4double SSTL=lastSST[blast];           // the low bin of the first squared slope
+        theSS=SSTL+shift*(lastSST[lastL]-SSTL); // the basic value of the first sq.slope
+        G4double S1TL=lastS1T[blast];           // the low bin of the first mantissa
+        theS1=S1TL+shift*(lastS1T[lastL]-S1TL); // the basic value of the first mantissa
+        G4double B1TL=lastB1T[blast];           // the low bin of the first slope
+#ifdef pdebug
+        G4cout<<"G4QElCS::CalcCrossSection:bl="<<blast<<",ls="<<lastL<<",SL="<<S1TL<<",SU="
+              <<lastS1T[lastL]<<",BL="<<B1TL<<",BU="<<lastB1T[lastL]<<G4endl;
+#endif
+        theB1=B1TL+shift*(lastB1T[lastL]-B1TL); // the basic value of the first slope
+        G4double S2TL=lastS2T[blast];           // the low bin of the second mantissa
+        theS2=S2TL+shift*(lastS2T[lastL]-S2TL); // the basic value of the second mantissa
+        G4double B2TL=lastB2T[blast];           // the low bin of the second slope
+        theB2=B2TL+shift*(lastB2T[lastL]-B2TL); // the basic value of the second slope
+        G4double S3TL=lastS3T[blast];           // the low bin of the third mantissa
+        theS3=S3TL+shift*(lastS3T[lastL]-S3TL); // the basic value of the third mantissa
+#ifdef pdebug
+        G4cout<<"G4QElCS::CCS: s3l="<<S3TL<<",sh3="<<shift<<",s3h="<<lastS3T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B3TL=lastB3T[blast];           // the low bin of the third slope
+        theB3=B3TL+shift*(lastB3T[lastL]-B3TL); // the basic value of the third slope
+        G4double S4TL=lastS4T[blast];           // the low bin of the 4-th mantissa
+        theS4=S4TL+shift*(lastS4T[lastL]-S4TL); // the basic value of the 4-th mantissa
+#ifdef pdebug
+        G4cout<<"G4QElCS::CCS: s4l="<<S4TL<<",sh4="<<shift<<",s4h="<<lastS4T[lastL]<<",b="
+              <<blast<<",l="<<lastL<<G4endl;
+#endif
+        G4double B4TL=lastB4T[blast];           // the low bin of the 4-th slope
+        theB4=B4TL+shift*(lastB4T[lastL]-B4TL); // the basic value of the 4-th slope
+      }
+#ifdef pdebug
+      G4cout<<"G4QProtonElasticCrossS::CalculateCS:(I) S1="<<theS1<<", B1="<<theB1<<G4endl;
+#endif
+    }
+  }
+  else lastSIG=GetTabValues(lastLP, PDG, tgZ, tgN); // Direct calculation beyond the table
+  if(lastSIG<0.) lastSIG = 0.;                   // @@ a Warning print can be added
+#ifdef pdebug
+  G4cout<<"G4QProtonElasticCrossSection::CalculateCS: END, onlyCS="<<onlyCS<<G4endl;
+#endif
+  return lastSIG;
+}
+
+// It has parameter sets for all tZ/tN/PDG, using them the tables can be created/updated
+G4double G4QProtonElasticCrossSection::GetPTables(G4double LP, G4double ILP, G4int PDG,
+                                                  G4int tgZ, G4int tgN)
+{
+  // @@ At present all nA==pA ---------> Each neucleus can have not more than 51 parameters
+  static const G4double pwd=2727;
+  const G4int n_npel=24;                // #of parameters for np-elastic (<nPoints=128)
+  const G4int n_ppel=32;                // #of parameters for pp-elastic (<nPoints=128)
+  //                      -0- -1-  -2- -3- -4-  -5- -6- -7- -8- -9--10--11--12--13- -14-
+  G4double np_el[n_npel]={12.,.05,.0001,5.,.35,6.75,.14,19.,.6,6.75,.14,13.,.14,.6,.00013,
+                          75.,.001,7.2,4.32,.012,2.5,0.0,12.,.34};
+  //                      -15--16--17- -18- -19--20--21--22--23-
+  //                       -0-   -1-  -2- -3- -4- -5-  -6-  -7-  -8--9--10--11--12--13-
+  G4double pp_el[n_ppel]={2.865,18.9,.6461,3.,9.,.425,.4276,.0022,5.,74.,3.,3.4,.2,.17,
+                          .001,8.,.055,3.64,5.e-5,4000.,1500.,.46,1.2e6,3.5e6,5.e-5,1.e10,
+                          8.5e8,1.e10,1.1,3.4e6,6.8e6,0.};
+  //                      -14--15- -16- -17- -18-  -19- -20- -21- -22-  -23-   -24-  -25-
+  //                       -26- -27-  -28- -29- -30- -31-
+  if(PDG==2212)
+  {
+    // -- Total pp elastic cross section cs & s1/b1 (main), s2/b2 (tail1), s3/b3 (tail2) --
+    //p2=p*p;p3=p2*p;sp=sqrt(p);p2s=p2*sp;lp=log(p);dl1=lp-(3.=par(3));p4=p2*p2; p=|3-mom|
+    //CS=2.865/p2s/(1+.0022/p2s)+(18.9+.6461*dl1*dl1+9./p)/(1.+.425*lp)/(1.+.4276/p4);
+    //   par(0)       par(7)     par(1) par(2)      par(4)      par(5)         par(6)
+    //dl2=lp-5., s1=(74.+3.*dl2*dl2)/(1+3.4/p4/p)+(.2/p2+17.*p)/(p4+.001*sp),
+    //     par(8) par(9) par(10)        par(11)   par(12)par(13)    par(14)
+    // b1=8.*p**.055/(1.+3.64/p3); s2=5.e-5+4000./(p4+1500.*p); b2=.46+1.2e6/(p4+3.5e6/sp);
+    // par(15) par(16)  par(17)     par(18) par(19)  par(20)   par(21) par(22)  par(23)
+    // s3=5.e-5+1.e10/(p4*p4+8.5e8*p2+1.e10); b3=1.1+3.4e6/(p4+6.8e6); ss=0.
+    //  par(24) par(25)     par(26)  par(27) par(28) par(29)  par(30)   par(31)
+    //
+    if(lastPAR[nLast]!=pwd) // A unique flag to avoid the repeatable definition
+    {
+      if ( tgZ == 0 && tgN == 1 )
+      {
+        for (G4int ip=0; ip<n_npel; ip++) lastPAR[ip]=np_el[ip]; // pn
+
+      }
+      else if ( tgZ == 1 && tgN == 0 )
+      {
+        for (G4int ip=0; ip<n_ppel; ip++) lastPAR[ip]=pp_el[ip]; // pp
+      }
+      else
+      {
+        G4double a=tgZ+tgN;
+        G4double sa=std::sqrt(a);
+        G4double ssa=std::sqrt(sa);
+        G4double asa=a*sa;
+        G4double a2=a*a;
+        G4double a3=a2*a;
+        G4double a4=a3*a;
+        G4double a5=a4*a;
+        G4double a6=a4*a2;
+        G4double a7=a6*a;
+        G4double a8=a7*a;
+        G4double a9=a8*a;
+        G4double a10=a5*a5;
+        G4double a12=a6*a6;
+        G4double a14=a7*a7;
+        G4double a16=a8*a8;
+        G4double a17=a16*a;
+        G4double a20=a16*a4;
+        G4double a32=a16*a16;
+        // Reaction cross-section parameters (pel=peh_fit.f)
+        lastPAR[0]=5./(1.+22./asa);                                          // p1
+        lastPAR[1]=4.8*std::pow(a,1.14)/(1.+3.6/a3);                         // p2
+        lastPAR[2]=1./(1.+4.E-3*a4)+2.E-6*a3/(1.+1.3E-6*a3);                 // p3
+        lastPAR[3]=1.3*a;                                                    // p4
+        lastPAR[4]=3.E-8*a3/(1.+4.E-7*a4);                                   // p5
+        lastPAR[5]=.07*asa/(1.+.009*a2);                                     // p6
+        lastPAR[6]=(3.+3.E-16*a20)/(1.+a20*(2.E-16/a+3.E-19*a));             // p7 (11)
+        lastPAR[7]=(5.E-9*a4*sa+.27/a)/(1.+5.E16/a20)/(1.+6.E-9*a4)+.015/a2; // p8
+        lastPAR[8]=(.001*a+.07/a)/(1.+5.E13/a16+5.E-7*a3)+.0003/sa;          // p9 (10)
+        // @@ the differential cross-section is parameterized separately for A>6 & A<7
+        if(a<6.5)
+        {
+          G4double a28=a16*a12;
+          // The main pre-exponent      (pel_sg)
+          lastPAR[ 9]=4000*a;                                // p1
+          lastPAR[10]=1.2e7*a8+380*a17;                      // p2
+          lastPAR[11]=.7/(1.+4.e-12*a16);                    // p3
+          lastPAR[12]=2.5/a8/(a4+1.e-16*a32);                // p4
+          lastPAR[13]=.28*a;                                 // p5
+          lastPAR[14]=1.2*a2+2.3;                            // p6
+          lastPAR[15]=3.8/a;                                 // p7
+          // The main slope             (pel_sl)
+          lastPAR[16]=.01/(1.+.0024*a5);                     // p1
+          lastPAR[17]=.2*a;                                  // p2
+          lastPAR[18]=9.e-7/(1.+.035*a5);                    // p3
+          lastPAR[19]=(42.+2.7e-11*a16)/(1.+.14*a);          // p4
+          // The main quadratic         (pel_sh)
+          lastPAR[20]=2.25*a3;                               // p1
+          lastPAR[21]=18.;                                   // p2
+          lastPAR[22]=2.4e-3*a8/(1.+2.6e-4*a7);              // p3
+          lastPAR[23]=3.5e-36*a32*a8/(1.+5.e-15*a32/a);      // p4
+          // The 1st max pre-exponent   (pel_qq)
+          lastPAR[24]=1.e5/(a8+2.5e12/a16);                  // p1
+          lastPAR[25]=8.e7/(a12+1.e-27*a28*a28);             // p2 
+          lastPAR[26]=.0006*a3;                              // p3
+          // The 1st max slope          (pel_qs)
+          lastPAR[27]=10.+4.e-8*a12*a;                       // p1
+          lastPAR[28]=.114;                                  // p2
+          lastPAR[29]=.003;                                  // p3
+          lastPAR[30]=2.e-23;                                // p4
+          // The effective pre-exponent (pel_ss)
+          lastPAR[31]=1./(1.+.0001*a8);                      // p1
+          lastPAR[32]=1.5e-4/(1.+5.e-6*a12);                 // p2
+          lastPAR[33]=.03;                                   // p3
+          // The effective slope        (pel_sb)
+          lastPAR[34]=a/2;                                   // p1
+          lastPAR[35]=2.e-7*a4;                              // p2
+          lastPAR[36]=4.;                                    // p3
+          lastPAR[37]=64./a3;                                // p4
+          // The gloria pre-exponent    (pel_us)
+          lastPAR[38]=1.e8*std::exp(.32*asa);                // p1
+          lastPAR[39]=20.*std::exp(.45*asa);                 // p2
+          lastPAR[40]=7.e3+2.4e6/a5;                         // p3
+          lastPAR[41]=2.5e5*std::exp(.085*a3);               // p4
+          lastPAR[42]=2.5*a;                                 // p5
+          // The gloria slope           (pel_ub)
+          lastPAR[43]=920.+.03*a8*a3;                        // p1
+          lastPAR[44]=93.+.0023*a12;                         // p2
+#ifdef pdebug
+         G4cout<<"G4QElCS::CalcCS:la "<<lastPAR[38]<<", "<<lastPAR[39]<<", "<<lastPAR[40]
+               <<", "<<lastPAR[42]<<", "<<lastPAR[43]<<", "<<lastPAR[44]<<G4endl;
+#endif
+        }
+        else
+        {
+          G4double p1a10=2.2e-28*a10;
+          G4double r4a16=6.e14/a16;
+          G4double s4a16=r4a16*r4a16;
+          // a24
+          // a36
+          // The main pre-exponent      (peh_sg)
+          lastPAR[ 9]=4.5*std::pow(a,1.15);                  // p1
+          lastPAR[10]=.06*std::pow(a,.6);                    // p2
+          lastPAR[11]=.6*a/(1.+2.e15/a16);                   // p3
+          lastPAR[12]=.17/(a+9.e5/a3+1.5e33/a32);            // p4
+          lastPAR[13]=(.001+7.e-11*a5)/(1.+4.4e-11*a5);      // p5
+          lastPAR[14]=(p1a10*p1a10+2.e-29)/(1.+2.e-22*a12);  // p6
+          // The main slope             (peh_sl)
+          lastPAR[15]=400./a12+2.e-22*a9;                    // p1
+          lastPAR[16]=1.e-32*a12/(1.+5.e22/a14);             // p2
+          lastPAR[17]=1000./a2+9.5*sa*ssa;                   // p3
+          lastPAR[18]=4.e-6*a*asa+1.e11/a16;                 // p4
+          lastPAR[19]=(120./a+.002*a2)/(1.+2.e14/a16);       // p5
+          lastPAR[20]=9.+100./a;                             // p6
+          // The main quadratic         (peh_sh)
+          lastPAR[21]=.002*a3+3.e7/a6;                       // p1
+          lastPAR[22]=7.e-15*a4*asa;                         // p2
+          lastPAR[23]=9000./a4;                              // p3
+          // The 1st max pre-exponent   (peh_qq)
+          lastPAR[24]=.0011*asa/(1.+3.e34/a32/a4);           // p1
+          lastPAR[25]=1.e-5*a2+2.e14/a16;                    // p2
+          lastPAR[26]=1.2e-11*a2/(1.+1.5e19/a12);            // p3
+          lastPAR[27]=.016*asa/(1.+5.e16/a16);               // p4
+          // The 1st max slope          (peh_qs)
+          lastPAR[28]=.002*a4/(1.+7.e7/std::pow(a-6.83,14)); // p1
+          lastPAR[29]=2.e6/a6+7.2/std::pow(a,.11);           // p2
+          lastPAR[30]=11.*a3/(1.+7.e23/a16/a8);              // p3
+          lastPAR[31]=100./asa;                              // p4
+          // The 2nd max pre-exponent   (peh_ss)
+          lastPAR[32]=(.1+4.4e-5*a2)/(1.+5.e5/a4);           // p1
+          lastPAR[33]=3.5e-4*a2/(1.+1.e8/a8);                // p2
+          lastPAR[34]=1.3+3.e5/a4;                           // p3
+          lastPAR[35]=500./(a2+50.)+3;                       // p4
+          lastPAR[36]=1.e-9/a+s4a16*s4a16;                   // p5
+          // The 2nd max slope          (peh_sb)
+          lastPAR[37]=.4*asa+3.e-9*a6;                       // p1
+          lastPAR[38]=.0005*a5;                              // p2
+          lastPAR[39]=.002*a5;                               // p3
+          lastPAR[40]=10.;                                   // p4
+          // The effective pre-exponent (peh_us)
+          lastPAR[41]=.05+.005*a;                            // p1
+          lastPAR[42]=7.e-8/sa;                              // p2
+          lastPAR[43]=.8*sa;                                 // p3
+          lastPAR[44]=.02*sa;                                // p4
+          lastPAR[45]=1.e8/a3;                               // p5
+          lastPAR[46]=3.e32/(a32+1.e32);                     // p6
+          // The effective slope        (peh_ub)
+          lastPAR[47]=24.;                                   // p1
+          lastPAR[48]=20./sa;                                // p2
+          lastPAR[49]=7.e3*a/(sa+1.);                        // p3
+          lastPAR[50]=900.*sa/(1.+500./a3);                  // p4
+#ifdef pdebug
+         G4cout<<"G4QElCS::CalcCS:ha "<<lastPAR[41]<<", "<<lastPAR[42]<<", "<<lastPAR[43]
+               <<", "<<lastPAR[44]<<", "<<lastPAR[45]<<", "<<lastPAR[46]<<G4endl;
+#endif
+        }
+        // Parameter for lowEnergyNeutrons
+        lastPAR[51]=1.e15+2.e27/a4/(1.+2.e-18*a16);
+      }
+      lastPAR[nLast]=pwd;
+      // and initialize the zero element of the table
+      G4double lp=lPMin;                                      // ln(momentum)
+      G4bool memCS=onlyCS;                                    // ??
+      onlyCS=false;
+      lastCST[0]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables
+      onlyCS=memCS;
+      lastSST[0]=theSS;
+      lastS1T[0]=theS1;
+      lastB1T[0]=theB1;
+      lastS2T[0]=theS2;
+      lastB2T[0]=theB2;
+      lastS3T[0]=theS3;
+      lastB3T[0]=theB3;
+      lastS4T[0]=theS4;
+      lastB4T[0]=theB4;
+#ifdef pdebug
+      G4cout<<"G4QProtonElasticCrossSection::GetPTables:ip=0(init), lp="<<lp<<",S1="<<theS1
+            <<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB3<<",S3="<<theS3
+            <<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    }
+    if(LP>ILP)
+    {
+      G4int ini = static_cast<int>((ILP-lPMin+.000001)/dlnP)+1; // already inited till this
+      if(ini<0) ini=0;
+      if(ini<nPoints)
+      {
+        G4int fin = static_cast<int>((LP-lPMin)/dlnP)+1; // final bin of initialization
+        if(fin>=nPoints) fin=nLast;               // Limit of the tabular initialization
+        if(fin>=ini)
+        {
+          G4double lp=0.;
+          for(G4int ip=ini; ip<=fin; ip++)        // Calculate tabular CS,S1,B1,S2,B2,S3,B3
+          {
+            lp=lPMin+ip*dlnP;                     // ln(momentum)
+            G4bool memCS=onlyCS;
+            onlyCS=false;
+            lastCST[ip]=GetTabValues(lp, PDG, tgZ, tgN); // Calculate AMDB tables (ret CS)
+            onlyCS=memCS;
+            lastSST[ip]=theSS;
+            lastS1T[ip]=theS1;
+            lastB1T[ip]=theB1;
+            lastS2T[ip]=theS2;
+            lastB2T[ip]=theB2;
+            lastS3T[ip]=theS3;
+            lastB3T[ip]=theB3;
+            lastS4T[ip]=theS4;
+            lastB4T[ip]=theB4;
+#ifdef pdebug
+            G4cout<<"G4QProtonElasticCrossSection::GetPTables:ip="<<ip<<",lp="<<lp<<",S1="
+                  <<theS1<<",B1="<<theB1<<",S2="<<theS2<<",B2="<<theB2<<",S3="
+                  <<theS3<<",B3="<<theB3<<",S4="<<theS4<<",B4="<<theB4<<G4endl;
+#endif
+          }
+          return lp;
+        }
+        else G4cout<<"*Warning*G4QProtonElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="
+                   <<tgZ<<", N="<<tgN<<", i="<<ini<<" > fin="<<fin<<", LP="<<LP<<" > ILP="
+                   <<ILP<<" nothing is done!"<<G4endl;
+      }
+      else G4cout<<"*Warning*G4QProtonElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="
+                 <<tgZ<<", N="<<tgN<<", i="<<ini<<">= max="<<nPoints<<", LP="<<LP
+                 <<" > ILP="<<ILP<<", lPMax="<<lPMax<<" nothing is done!"<<G4endl;
+    }
+#ifdef pdebug
+    else G4cout<<"*Warning*G4QProtonElasticCrossSection::GetPTables:PDG="<<PDG<<", Z="<<tgZ
+               <<", N="<<tgN<<", LP="<<LP<<" <= ILP="<<ILP<<" nothing is done!"<<G4endl;
+#endif
+  }
+  else
+  {
+    G4cout<<"*Error*G4QProtonElasticCrossSection::GetPTables: PDG="<<PDG<<", Z="<<tgZ
+          <<", N="<<tgN<<", while it is defined only for PDG=2212"<<G4endl;
+    throw G4QException("G4QProtonElasticCrossSection::GetPTables: only pA're implemented");
+  }
+  return ILP;
+}
+
+// Returns Q2=-t in independent units (MeV^2) (all internal calculations are in GeV)
+G4double G4QProtonElasticCrossSection::GetExchangeT(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+  static const G4double third=1./3.;
+  static const G4double fifth=1./5.;
+  static const G4double sevth=1./7.;
+#ifdef tdebug
+  G4cout<<"G4QProtElCS::GetExcT: F="<<onlyCS<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(PDG!=2212) G4cout<<"**Warning*G4QProtonElasticCrossSection::GetExT:PDG="<<PDG<<G4endl;
+  if(onlyCS) G4cout<<"**Warning*G4QProtonElasticCrossSection::GetExchanT:onlyCS=1"<<G4endl;
+  if(lastLP<-4.3) return lastTM*GeVSQ*G4UniformRand();// S-wave for p<14 MeV/c (kinE<.1MeV)
+  G4double q2=0.;
+  if(tgZ==1 && tgN==0)                // ===> p+p=p+p
+  {
+#ifdef tdebug
+    G4cout<<"G4QElasticCS::GetExchangeT: TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",S2="
+          <<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",GeV2="<<GeVSQ<<G4endl;
+#endif
+    G4double E1=lastTM*theB1;
+    G4double R1=(1.-std::exp(-E1));
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    G4double ds1=std::fabs(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:1p "<<ts1<<"#"<<lastTM<<",d="<<ds1
+            <<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double E2=lastTM*theB2;
+    G4double R2=(1.-std::exp(-E2*E2*E2));
+#ifdef tdebug
+    G4double ts2=std::pow(-std::log(1.-R2),.333333333)/theB2;
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:2p "<<ts2<<"#"<<lastTM<<",d="<<ds2
+            <<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:3p "<<ts3<<"#"<<lastTM<<",d="<<ds3
+            <<",R3="<<R1<<",E3="<<E3<<G4endl;
+#endif
+    G4double I1=R1*theS1/theB1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I12=I1+I2;
+    G4double rand=(I12+I3)*G4UniformRand();
+    if     (rand<I1 )
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran);
+      if(q2<0.) q2=0.;
+      q2=std::pow(q2,third)/theB2;
+    }
+    else
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+    }
+  }
+  else
+  {
+    G4double a=tgZ+tgN;
+#ifdef tdebug
+    G4cout<<"G4QElCS::GetExT: a="<<a<<",t="<<lastTM<<",S1="<<theS1<<",B1="<<theB1<<",SS="
+          <<theSS<<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="
+          <<theS4<<",B4="<<theB4<<G4endl;
+#endif
+    G4double E1=lastTM*(theB1+lastTM*theSS);
+    G4double R1=(1.-std::exp(-E1));
+    G4double tss=theSS+theSS; // for future solution of quadratic equation (imediate check)
+#ifdef tdebug
+    G4double ts1=-std::log(1.-R1)/theB1;
+    if(std::fabs(tss)>1.e-7) ts1=(std::sqrt(theB1*(theB1+(tss+tss)*ts1))-theB1)/tss;
+    G4double ds1=(ts1-lastTM)/lastTM;
+    if(ds1>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:1a "<<ts1<<"#"<<lastTM<<",d="<<ds1
+            <<",R1="<<R1<<",E1="<<E1<<G4endl;
+#endif
+    G4double tm2=lastTM*lastTM;
+    G4double E2=lastTM*tm2*theB2;                   // power 3 for lowA, 5 for HighA (1st)
+    if(a>6.5)E2*=tm2;                               // for heavy nuclei
+    G4double R2=(1.-std::exp(-E2));
+#ifdef tdebug
+    G4double ts2=-std::log(1.-R2)/theB2;
+    if(a<6.5)ts2=std::pow(ts2,third);
+    else     ts2=std::pow(ts2,fifth);
+    G4double ds2=std::fabs(ts2-lastTM)/lastTM;
+    if(ds2>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:2a "<<ts2<<"#"<<lastTM<<",d="<<ds2
+            <<",R2="<<R2<<",E2="<<E2<<G4endl;
+#endif
+    G4double E3=lastTM*theB3;
+    if(a>6.5)E3*=tm2*tm2*tm2;                       // power 1 for lowA, 7 (2nd) for HighA
+    G4double R3=(1.-std::exp(-E3));
+#ifdef tdebug
+    G4double ts3=-std::log(1.-R3)/theB3;
+    if(a>6.5)ts3=std::pow(ts3,sevth);
+    G4double ds3=std::fabs(ts3-lastTM)/lastTM;
+    if(ds3>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:3a "<<ts3<<"#"<<lastTM<<",d="<<ds3
+            <<",R3="<<R3<<",E3="<<E3<<G4endl;
+#endif
+    G4double E4=lastTM*theB4;
+    G4double R4=(1.-std::exp(-E4));
+#ifdef tdebug
+    G4double ts4=-std::log(1.-R4)/theB4;
+    G4double ds4=std::fabs(ts4-lastTM)/lastTM;
+    if(ds4>.0001)
+      G4cout<<"*Warning*G4QElCS::GetExT:4a "<<ts4<<"#"<<lastTM<<",d="<<ds4
+            <<",R4="<<R4<<",E4="<<E4<<G4endl;
+#endif
+    G4double I1=R1*theS1;
+    G4double I2=R2*theS2;
+    G4double I3=R3*theS3;
+    G4double I4=R4*theS4;
+    G4double I12=I1+I2;
+    G4double I13=I12+I3;
+    G4double rand=(I13+I4)*G4UniformRand();
+#ifdef tdebug
+    G4cout<<"G4QElCS::GtExT:1="<<I1<<",2="<<I2<<",3="<<I3<<",4="<<I4<<",r="<<rand<<G4endl;
+#endif
+    if(rand<I1)
+    {
+      G4double ran=R1*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB1;
+      if(std::fabs(tss)>1.e-7) q2=(std::sqrt(theB1*(theB1+(tss+tss)*q2))-theB1)/tss;
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<",ss="<<tss/2<<",b1="<<theB1<<",t1="<<ts1<<G4endl;
+#endif
+    }
+    else if(rand<I12)
+    {
+      G4double ran=R2*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB2;
+      if(q2<0.) q2=0.;
+      if(a<6.5) q2=std::pow(q2,third);
+      else      q2=std::pow(q2,fifth);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT: Q2="<<q2<<", r2="<<R2<<", b2="<<theB2<<",t2="<<ts2<<G4endl;
+#endif
+    }
+    else if(rand<I13)
+    {
+      G4double ran=R3*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB3;
+      if(q2<0.) q2=0.;
+      if(a>6.5) q2=std::pow(q2,sevth);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<", r3="<<R2<<", b3="<<theB2<<",t3="<<ts2<<G4endl;
+#endif
+    }
+    else
+    {
+      G4double ran=R4*G4UniformRand();
+      if(ran>1.) ran=1.;
+      q2=-std::log(1.-ran)/theB4;
+      if(a<6.5) q2=lastTM-q2;                    // u reduced for lightA (starts from 0)
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetExT:Q2="<<q2<<",m="<<lastTM<<",b4="<<theB3<<",t4="<<ts3<<G4endl;
+#endif
+    }
+  }
+  if(q2<0.) q2=0.;
+  if(!(q2>=-1.||q2<=1.)) G4cout<<"*NAN*G4QElasticCrossSect::GetExchangeT: -t="<<q2<<G4endl;
+  if(q2>lastTM)
+  {
+#ifdef tdebug
+    G4cout<<"*Warning*G4QElasticCrossSect::GetExT:-t="<<q2<<">"<<lastTM<<G4endl;
+#endif
+    q2=lastTM;
+  }
+  return q2*GeVSQ;
+}
+
+// Returns B in independent units (MeV^-2) (all internal calculations are in GeV) see ExT
+G4double G4QProtonElasticCrossSection::GetSlope(G4int tgZ, G4int tgN, G4int PDG)
+{
+  static const G4double GeVSQ=gigaelectronvolt*gigaelectronvolt;
+#ifdef tdebug
+  G4cout<<"G4QElasticCS::GetSlope:"<<onlyCS<<", Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  if(onlyCS) G4cout<<"*Warning*G4QProtonElasticCrossSection::GetSlope:onlyCS=true"<<G4endl;
+  if(lastLP<-4.3) return 0.;          // S-wave for p<14 MeV/c (kinE<.1MeV)
+  if(PDG!=2212)
+  {
+    G4cout<<"*Error*G4QProtonElasticCrossSection::GetSlope: PDG="<<PDG<<", Z="<<tgZ<<", N="
+          <<tgN<<", while it is defined only for PDG=2212"<<G4endl;
+    throw G4QException("G4QProtonElasticCrossSection::GetSlope: pA are implemented");
+  }
+  if(theB1<0.) theB1=0.;
+  if(!(theB1>=-1.||theB1<=1.))G4cout<<"*NAN*G4QElasticCrossSect::Getslope:"<<theB1<<G4endl;
+  return theB1/GeVSQ;
+}
+
+// Returns half max(Q2=-t) in independent units (MeV^2)
+G4double G4QProtonElasticCrossSection::GetHMaxT()
+{
+  static const G4double HGeVSQ=gigaelectronvolt*gigaelectronvolt/2.;
+  return lastTM*HGeVSQ;
+}
+
+// lastLP is used, so calculating tables, one need to remember and then recover lastLP
+G4double G4QProtonElasticCrossSection::GetTabValues(G4double lp, G4int PDG, G4int tgZ,
+                                                    G4int tgN)
+{
+  if(PDG!=2212) G4cout<<"*Warning*G4QProtonElasticCrossSection::GetTabV:PDG="<<PDG<<G4endl;
+  if(tgZ<0 || tgZ>92)
+  {
+    G4cout<<"*Warning*G4QProtonElCS::GetTabValue: (1-92) No isotopes for Z="<<tgZ<<G4endl;
+    return 0.;
+  }
+  G4int iZ=tgZ-1; // Z index
+  if(iZ<0)
+  {
+    iZ=0;         // conversion of the neutron target to the proton target
+    tgZ=1;
+    tgN=0;
+  }
+  //if(nN[iZ][0] < 0)
+  //{
+#ifdef isodebug
+  //  G4cout<<"*Warning*G4QElasticCS::GetTabValue: No isotopes for Z="<<tgZ<<G4endl;
+#endif
+  //  return 0.;
+  //}
+#ifdef pdebug
+  G4cout<<"G4QElasticCS::GetTabVal: lp="<<lp<<",Z="<<tgZ<<",N="<<tgN<<",PDG="<<PDG<<G4endl;
+#endif
+  G4double p=std::exp(lp);              // momentum
+  G4double sp=std::sqrt(p);             // sqrt(p)
+  G4double p2=p*p;            
+  G4double p3=p2*p;
+  G4double p4=p3*p;
+  if ( tgZ == 1 && tgN == 0 ) // pp/nn
+  {
+    G4double p2s=p2*sp;
+    G4double dl2=lp-lastPAR[8];
+    theSS=lastPAR[31];
+    theS1=(lastPAR[9]+lastPAR[10]*dl2*dl2)/(1.+lastPAR[11]/p4/p)+
+          (lastPAR[12]/p2+lastPAR[13]*p)/(p4+lastPAR[14]*sp);
+    theB1=lastPAR[15]*std::pow(p,lastPAR[16])/(1.+lastPAR[17]/p3);
+    theS2=lastPAR[18]+lastPAR[19]/(p4+lastPAR[20]*p);
+    theB2=lastPAR[21]+lastPAR[22]/(p4+lastPAR[23]/sp); 
+    theS3=lastPAR[24]+lastPAR[25]/(p4*p4+lastPAR[26]*p2+lastPAR[27]);
+    theB3=lastPAR[28]+lastPAR[29]/(p4+lastPAR[30]); 
+    theS4=0.;
+    theB4=0.; 
+#ifdef tdebug
+    G4cout<<"G4QElasticCS::GetTableValues:(pp) TM="<<lastTM<<",S1="<<theS1<<",B1="<<theB1
+          <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS1<<",B3="<<theB1<<G4endl;
+#endif
+    // Returns the total elastic pp cross-section (to avoid spoiling lastSIG)
+    G4double dl1=lp-lastPAR[3];
+    return lastPAR[0]/p2s/(1.+lastPAR[7]/p2s)+(lastPAR[1]+lastPAR[2]*dl1*dl1+lastPAR[4]/p)
+                                                   /(1.+lastPAR[5]*lp)/(1.+lastPAR[6]/p4);
+  }
+  else
+  {
+    G4double p5=p4*p;
+    G4double p6=p5*p;
+    G4double p8=p6*p2;
+    G4double p10=p8*p2;
+    G4double p12=p10*p2;
+    G4double p16=p8*p8;
+    //G4double p24=p16*p8;
+    G4double dl=lp-5.;
+    G4double a=tgZ+tgN;
+    G4double pah=std::pow(p,a/2);
+    G4double pa=pah*pah;
+    G4double pa2=pa*pa;
+    if(a<6.5)
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]*p4*pa)+lastPAR[11]/(p4+lastPAR[12]*p4/pa2)+
+            (lastPAR[13]*dl*dl+lastPAR[14])/(1.+lastPAR[15]/p2);
+      theB1=(lastPAR[16]+lastPAR[17]*p2)/(p4+lastPAR[18]/pah)+lastPAR[19];
+      theSS=lastPAR[20]/(1.+lastPAR[21]/p2)+lastPAR[22]/(p6/pa+lastPAR[23]/p16);
+      theS2=lastPAR[24]/(pa/p2+lastPAR[25]/p4)+lastPAR[26];
+      theB2=lastPAR[27]*std::pow(p,lastPAR[28])+lastPAR[29]/(p8+lastPAR[30]/p16);
+      theS3=lastPAR[31]/(pa*p+lastPAR[32]/pa)+lastPAR[33];
+      theB3=lastPAR[34]/(p3+lastPAR[35]/p6)+lastPAR[36]/(1.+lastPAR[37]/p2);
+      theS4=p2*(pah*lastPAR[38]*std::exp(-pah*lastPAR[39])+
+                lastPAR[40]/(1.+lastPAR[41]*std::pow(p,lastPAR[42])));
+      theB4=lastPAR[43]*pa/p2/(1.+pa*lastPAR[44]);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetTabV: lA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    else
+    {
+      theS1=lastPAR[9]/(1.+lastPAR[10]/p4)+lastPAR[11]/(p4+lastPAR[12]/p2)+
+            lastPAR[13]/(p5+lastPAR[14]/p16);
+      theB1=(lastPAR[15]/p8+lastPAR[19])/(p+lastPAR[16]/std::pow(p,lastPAR[20]))+
+            lastPAR[17]/(1.+lastPAR[18]/p4);
+      theSS=lastPAR[21]/(p4/std::pow(p,lastPAR[23])+lastPAR[22]/p4);
+      theS2=lastPAR[24]/p4/(std::pow(p,lastPAR[25])+lastPAR[26]/p12)+lastPAR[27];
+      theB2=lastPAR[28]/std::pow(p,lastPAR[29])+lastPAR[30]/std::pow(p,lastPAR[31]);
+      theS3=lastPAR[32]/std::pow(p,lastPAR[35])/(1.+lastPAR[36]/p12)+
+            lastPAR[33]/(1.+lastPAR[34]/p6);
+      theB3=lastPAR[37]/p8+lastPAR[38]/p2+lastPAR[39]/(1.+lastPAR[40]/p8);
+      theS4=(lastPAR[41]/p4+lastPAR[46]/p)/(1.+lastPAR[42]/p10)+
+            (lastPAR[43]+lastPAR[44]*dl*dl)/(1.+lastPAR[45]/p12);
+      theB4=lastPAR[47]/(1.+lastPAR[48]/p)+lastPAR[49]*p4/(1.+lastPAR[50]*p5);
+#ifdef tdebug
+      G4cout<<"G4QElCS::GetTabV: hA, p="<<p<<",S1="<<theS1<<",B1="<<theB1<<",SS="<<theSS
+            <<",S2="<<theS2<<",B2="<<theB2<<",S3="<<theS3<<",B3="<<theB3<<",S4="<<theS4
+            <<",B4="<<theB4<<G4endl;
+#endif
+    }
+    // Returns the total elastic (n/p)A cross-section (to avoid spoiling lastSIG)
+#ifdef tdebug
+    G4cout<<"G4QElCS::GetTabV: PDG="<<PDG<<",P="<<p<<",N="<<tgN<<",Z="<<tgZ<<G4endl;
+#endif
+    //         p1               p2              p3            p6
+    return (lastPAR[0]*dl*dl+lastPAR[1])/(1.+lastPAR[2]/p+lastPAR[5]/p6)+
+     lastPAR[3]/(p3+lastPAR[4]/p3)+lastPAR[7]/(p4+pow((lastPAR[8]/p),lastPAR[6]));
+    //   p4            p5               p8                 p9             p7
+  }
+  return 0.;
+} // End of GetTableValues
+
+// Returns max -t=Q2 (GeV^2) for the momentum pP(GeV) and the target nucleus (tgN,tgZ)
+G4double G4QProtonElasticCrossSection::GetQ2max(G4int PDG, G4int tgZ, G4int tgN,
+                                                G4double pP)
+{
+  //static const G4double mNeut= G4QPDGCode(2112).GetMass()*.001; // MeV to GeV
+  static const G4double mProt= G4QPDGCode(2212).GetMass()*.001; // MeV to GeV
+  //static const G4double mLamb= G4QPDGCode(3122).GetMass()*.001; // MeV to GeV
+  //static const G4double mHe3 = G4QPDGCode(2112).GetNuclMass(2,1,0)*.001; // MeV to GeV
+  //static const G4double mAlph = G4QPDGCode(2112).GetNuclMass(2,2,0)*.001; // MeV to GeV
+  //static const G4double mDeut = G4QPDGCode(2112).GetNuclMass(1,1,0)*.001; // MeV to GeV
+  static const G4double mProt2= mProt*mProt;
+  //static const G4double mNeut2= mNeut*mNeut;
+  //static const G4double mDeut2= mDeut*mDeut;
+  G4double pP2=pP*pP;                                 // squared momentum of the projectile
+  if(tgZ==1 && tgN==0)
+  {
+    G4double tMid=std::sqrt(pP2+mProt2)*mProt-mProt2; // CMS 90deg value of -t=Q2 (GeV^2)
+    return tMid+tMid;
+  }
+  else if(tgZ || tgN)                                 // ---> pA
+  {
+    G4double mt=G4QPDGCode(90000000+tgZ*1000+tgN).GetMass()*.001; // Target mass in GeV
+    G4double dmt=mt+mt;
+    G4double s=dmt*std::sqrt(pP2+mProt2)+mProt2+mt*mt;// Mondelstam s
+    return dmt*dmt*pP2/s;
+  }
+  else
+  {
+    G4cout<<"*Error*G4QProtonElasticCrossSection::GetQ2max: PDG="<<PDG<<", Z="<<tgZ<<", N="
+          <<tgN<<", while it is defined only for p projectiles & Z_target>0"<<G4endl;
+    throw G4QException("G4QProtonElasticCrossSection::GetQ2max: only pA are implemented");
+  }
+}
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QHadronElasticDataSet.hh
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QHadronElasticDataSet.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/include/G4QHadronElasticDataSet.hh	(revision 1316)
@@ -0,0 +1,100 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+// $Id: G4QHadronElasticDataSet.hh,v 1.2 2010/02/16 07:53:05 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// GEANT4 physics class: G4QHadronElasticDataSet -- header file
+// Created by M. Kosov (Mikhail.Kossov@cern.ch) 21.01.10
+//
+// ----------------------------------------------------------------------
+// Short description: G4hadr wrapper for CHIPS elastic hA cross-sections.
+// ----------------------------------------------------------------------
+
+#ifndef G4QHadronElasticDataSet_h
+#define G4QHadronElasticDataSet_h 1
+
+#include "G4VCrossSectionDataSet.hh"
+#include "G4DynamicParticle.hh"
+#include "G4Element.hh"
+#include "G4Neutron.hh"
+#include "G4Proton.hh"
+#include "G4PionMinus.hh"
+#include "G4PionPlus.hh"
+#include "G4KaonPlus.hh"
+#include "G4KaonMinus.hh"
+#include "G4KaonZeroLong.hh"
+#include "G4KaonZeroShort.hh"
+#include "G4Lambda.hh"
+#include "G4SigmaPlus.hh"
+#include "G4SigmaMinus.hh"
+#include "G4SigmaZero.hh"
+#include "G4XiMinus.hh"
+#include "G4XiZero.hh"
+#include "G4OmegaMinus.hh"
+#include "G4AntiNeutron.hh"
+#include "G4AntiProton.hh"
+#include "G4AntiLambda.hh"
+#include "G4AntiSigmaPlus.hh"
+#include "G4AntiSigmaMinus.hh"
+#include "G4AntiSigmaZero.hh"
+#include "G4AntiXiMinus.hh"
+#include "G4AntiXiZero.hh"
+#include "G4AntiOmegaMinus.hh"
+
+#include "G4QIsotope.hh"
+#include "G4QProtonElasticCrossSection.hh"
+#include "G4QNeutronElasticCrossSection.hh"  
+#include "G4QPionMinusElasticCrossSection.hh"
+#include "G4QPionPlusElasticCrossSection.hh"
+#include "G4QKaonPlusElasticCrossSection.hh"
+#include "G4QKaonMinusElasticCrossSection.hh"
+#include "G4QHyperonElasticCrossSection.hh"
+#include "G4QHyperonPlusElasticCrossSection.hh"
+#include "G4QAntiBaryonElasticCrossSection.hh"
+
+
+class G4QHadronElasticDataSet : public G4VCrossSectionDataSet
+{
+public:
+
+  G4QHadronElasticDataSet();
+  ~G4QHadronElasticDataSet() {}
+  G4bool IsApplicable(const G4DynamicParticle* aParticle, const G4Element* anElement);
+  G4bool IsZAApplicable(const G4DynamicParticle* aParticle, G4double Z, G4double A);
+  G4double GetCrossSection(const G4DynamicParticle* Part, const G4Element* El, G4double T);
+  G4double GetIsoZACrossSection(const G4DynamicParticle* P,G4double Z,G4double A,G4double);
+  void BuildPhysicsTable(const G4ParticleDefinition&){}
+  void DumpPhysicsTable(const G4ParticleDefinition&) {}
+
+private:
+
+  G4QIsotope* Isotopes;                             // Pointer to the G4QIsotopes singleton
+  static std::vector <G4int> ElementZ;                // Z of the element(i) in theLastCalc
+  static std::vector <std::vector<G4int>*> ElIsoN;    // N of isotope(j) of Element(i)
+  static std::vector <std::vector<G4double>*> IsoProbInEl;// SumProbabIsotopes in Element i
+};
+
+#endif
Index: trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QHadronElasticDataSet.cc
===================================================================
--- trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QHadronElasticDataSet.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/chiral_inv_phase_space/interface/src/G4QHadronElasticDataSet.cc	(revision 1316)
@@ -0,0 +1,312 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+// $Id: G4QHadronElasticDataSet.cc,v 1.3 2010/05/26 12:19:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// GEANT4 physics class: G4QHadronElasticDataSet -- header file
+// Created by M. Kosov (Mikhail.Kossov@cern.ch) 21.01.10
+//
+// ----------------------------------------------------------------------
+// Short description: G4hadr wrapper for CHIPS elastic hA cross-sections.
+// ----------------------------------------------------------------------
+// 
+
+#include "G4QHadronElasticDataSet.hh"
+
+// Initialization of static vectors
+std::vector<G4int> G4QHadronElasticDataSet::ElementZ; // Z of the element(i) in LastCalc
+std::vector<std::vector<G4int>*> G4QHadronElasticDataSet::ElIsoN; // N of iso(j) of El(i)
+std::vector<std::vector<G4double>*> G4QHadronElasticDataSet::IsoProbInEl;//SumProbIsoInEl
+
+G4QHadronElasticDataSet::G4QHadronElasticDataSet()
+{
+  Isotopes = G4QIsotope::Get(); // Pointer to the G4QIsotopes singleton
+}
+
+G4bool G4QHadronElasticDataSet::IsApplicable(const G4DynamicParticle* P,const G4Element*)
+{
+  G4ParticleDefinition* particle = P->GetDefinition();
+  if      (particle ==         G4Neutron::Neutron()        ) return true; 
+  else if (particle ==          G4Proton::Proton()         ) return true;
+  else if (particle ==       G4PionMinus::PionMinus()      ) return true;
+  else if (particle ==        G4PionPlus::PionPlus()       ) return true;
+  else if (particle ==        G4KaonPlus::KaonPlus()       ) return true;
+  else if (particle ==       G4KaonMinus::KaonMinus()      ) return true;
+  else if (particle ==    G4KaonZeroLong::KaonZeroLong()   ) return true;
+  else if (particle ==   G4KaonZeroShort::KaonZeroShort()  ) return true;
+  else if (particle ==          G4Lambda::Lambda()         ) return true;
+  else if (particle ==       G4SigmaPlus::SigmaPlus()      ) return true;
+  else if (particle ==      G4SigmaMinus::SigmaMinus()     ) return true;
+  else if (particle ==       G4SigmaZero::SigmaZero()      ) return true;
+  else if (particle ==         G4XiMinus::XiMinus()        ) return true;
+  else if (particle ==          G4XiZero::XiZero()         ) return true;
+  else if (particle ==      G4OmegaMinus::OmegaMinus()     ) return true;
+  else if (particle ==     G4AntiNeutron::AntiNeutron()    ) return true;
+  else if (particle ==      G4AntiProton::AntiProton()     ) return true;
+  else if (particle ==      G4AntiLambda::AntiLambda()     ) return true;
+  else if (particle ==   G4AntiSigmaPlus::AntiSigmaPlus()  ) return true;
+  else if (particle ==  G4AntiSigmaMinus::AntiSigmaMinus() ) return true;
+  else if (particle ==   G4AntiSigmaZero::AntiSigmaZero()  ) return true;
+  else if (particle ==     G4AntiXiMinus::AntiXiMinus()    ) return true;
+  else if (particle ==      G4AntiXiZero::AntiXiZero()     ) return true;
+  else if (particle ==  G4AntiOmegaMinus::AntiOmegaMinus() ) return true;
+  return false;
+}
+
+G4bool G4QHadronElasticDataSet::IsZAApplicable(const G4DynamicParticle* Pt,
+                                                 G4double, G4double)
+{
+  G4ParticleDefinition* particle = Pt->GetDefinition();
+  if      (particle ==         G4Neutron::Neutron()        ) return true; // @@ isotopes?
+  else if (particle ==          G4Proton::Proton()         ) return true;
+  else if (particle ==       G4PionMinus::PionMinus()      ) return true;
+  else if (particle ==        G4PionPlus::PionPlus()       ) return true;
+  else if (particle ==        G4KaonPlus::KaonPlus()       ) return true;
+  else if (particle ==       G4KaonMinus::KaonMinus()      ) return true;
+  else if (particle ==    G4KaonZeroLong::KaonZeroLong()   ) return true;
+  else if (particle ==   G4KaonZeroShort::KaonZeroShort()  ) return true;
+  else if (particle ==          G4Lambda::Lambda()         ) return true;
+  else if (particle ==       G4SigmaPlus::SigmaPlus()      ) return true;
+  else if (particle ==      G4SigmaMinus::SigmaMinus()     ) return true;
+  else if (particle ==       G4SigmaZero::SigmaZero()      ) return true;
+  else if (particle ==         G4XiMinus::XiMinus()        ) return true;
+  else if (particle ==          G4XiZero::XiZero()         ) return true;
+  else if (particle ==      G4OmegaMinus::OmegaMinus()     ) return true;
+  else if (particle ==     G4AntiNeutron::AntiNeutron()    ) return true;
+  else if (particle ==      G4AntiProton::AntiProton()     ) return true;
+  else if (particle ==      G4AntiLambda::AntiLambda()     ) return true;
+  else if (particle ==   G4AntiSigmaPlus::AntiSigmaPlus()  ) return true;
+  else if (particle ==  G4AntiSigmaMinus::AntiSigmaMinus() ) return true;
+  else if (particle ==   G4AntiSigmaZero::AntiSigmaZero()  ) return true;
+  else if (particle ==     G4AntiXiMinus::AntiXiMinus()    ) return true;
+  else if (particle ==      G4AntiXiZero::AntiXiZero()     ) return true;
+  else if (particle ==  G4AntiOmegaMinus::AntiOmegaMinus() ) return true;
+  return false;
+}
+
+G4double G4QHadronElasticDataSet::GetCrossSection(const G4DynamicParticle* Pt,
+                                                    const G4Element* pElement,
+                                                    G4double)
+{
+  G4int IPIE=IsoProbInEl.size();          // How many old elements?
+  if(IPIE) for(G4int ip=0; ip<IPIE; ++ip) // Clean up the SumProb's of Isotopes (SPI)
+  {
+    std::vector<G4double>* SPI=IsoProbInEl[ip]; // Pointer to the SPI vector
+    SPI->clear();
+    delete SPI;
+    std::vector<G4int>* IsN=ElIsoN[ip];   // Pointer to the N vector
+    IsN->clear();
+    delete IsN;
+  }
+  ElementZ.clear();                       // Clear the body vector for Z of Elements
+  IsoProbInEl.clear();                    // Clear the body vector for SPI
+  ElIsoN.clear();                         // Clear the body vector for N of Isotopes
+  G4int Z = static_cast<G4int>(pElement->GetZ()); // Z of the Element
+  ElementZ.push_back(Z);                  // Remember Z of the Element
+  G4int isoSize=0;                        // The default for the isoVectorLength is 0
+  G4int indEl=0;                          // Index of non-trivial element or 0(default)
+  G4IsotopeVector* isoVector=pElement->GetIsotopeVector(); // Get the predefined IsoVect
+  if(isoVector) isoSize=isoVector->size();// Get size of the existing isotopeVector
+  if(isoSize)                             // The Element has non-trivial abundance set
+  {
+    indEl=pElement->GetIndex()+1;         // Index of the non-trivial element
+    if(!Isotopes->IsDefined(Z,indEl))     // This index is not defined for this Z: define
+    {
+      std::vector<std::pair<G4int,G4double>*>* newAbund =
+                                             new std::vector<std::pair<G4int,G4double>*>;
+      G4double* abuVector=pElement->GetRelativeAbundanceVector();
+      for(G4int j=0; j<isoSize; j++)      // Calculation of abundance vector for isotopes
+      {
+        G4int N=pElement->GetIsotope(j)->GetN()-Z; // N means A=N+Z !
+        if(pElement->GetIsotope(j)->GetZ()!=Z)
+          G4cerr<<"G4QHadronElasticDataSet::GetCrossSection"<<": Z="
+                <<pElement->GetIsotope(j)->GetZ()<<" # "<<Z<<G4endl;
+        G4double abund=abuVector[j];
+        std::pair<G4int,G4double>* pr= new std::pair<G4int,G4double>(N,abund);
+        newAbund->push_back(pr);
+      }
+      indEl=G4QIsotope::Get()->InitElement(Z,indEl,newAbund); // definition of the newInd
+      for(G4int k=0; k<isoSize; k++) delete (*newAbund)[k];   // Cleaning temporary
+      delete newAbund; // Was "new" in the beginning of the name space
+    }
+  }
+  std::vector<std::pair<G4int,G4double>*>* cs= Isotopes->GetCSVector(Z,indEl);//CSPointer
+  std::vector<G4double>* SPI = new std::vector<G4double>; // Pointer to the SPI vector
+  IsoProbInEl.push_back(SPI);
+  std::vector<G4int>* IsN = new std::vector<G4int>; // Pointer to the N vector
+  ElIsoN.push_back(IsN);
+  G4int nIs=cs->size();                   // A#Of Isotopes in the Element
+  G4double susi=0.;                       // sum of CS over isotopes
+  if(nIs) for(G4int j=0; j<nIs; j++)      // Calculate CS for eachIsotope of El
+  {
+    std::pair<G4int,G4double>* curIs=(*cs)[j]; // A pointer, which is used twice
+    G4int N=curIs->first;                 // #of Neuterons in the isotope j of El i
+    IsN->push_back(N);                    // Remember Min N for the Element
+    G4double CSI=GetIsoZACrossSection(Pt,Z,Z+N,0.);//CrossSection(j,i) for the isotope
+    curIs->second = CSI;
+    susi+=CSI;                            // Make a sum per isotopes
+    SPI->push_back(susi);                 // Remember summed cross-section
+  } // End of temporary initialization of the cross sections in the G4QIsotope singeltone
+  return Isotopes->GetMeanCrossSection(Z,indEl); // MeanCS over isotopes
+}
+
+G4double G4QHadronElasticDataSet::GetIsoZACrossSection(const G4DynamicParticle* Pt,
+                                                         G4double Z, G4double A, G4double)
+{
+  G4ParticleDefinition* particle = Pt->GetDefinition();
+  G4double Momentum=Pt->GetTotalMomentum();
+  G4VQCrossSection* CSmanager=0;
+  G4VQCrossSection* CSmanager2=0;
+  //G4VQCrossSection* CSmanager2=0;
+  G4int pPDG=0;
+  if(particle == G4Neutron::Neutron())
+  {
+    CSmanager=G4QNeutronElasticCrossSection::GetPointer();
+    pPDG=2112;
+  }
+  else if(particle == G4Proton::Proton())
+  {
+    CSmanager=G4QProtonElasticCrossSection::GetPointer();
+    pPDG=2212;
+  }
+  else if(particle == G4PionMinus::PionMinus())
+  {
+    CSmanager=G4QPionMinusElasticCrossSection::GetPointer();
+    pPDG=-211;
+  }
+  else if(particle == G4PionPlus::PionPlus())
+  {
+    CSmanager=G4QPionPlusElasticCrossSection::GetPointer();
+    pPDG=211;
+  }
+  else if(particle == G4KaonMinus::KaonMinus())
+  {
+    CSmanager=G4QKaonMinusElasticCrossSection::GetPointer();
+    pPDG=-321;
+  }
+  else if(particle == G4KaonPlus::KaonPlus())
+  {
+    CSmanager=G4QKaonPlusElasticCrossSection::GetPointer();
+    pPDG=321;
+  }
+  else if(particle == G4KaonZeroLong::KaonZeroLong()   ||
+          particle == G4KaonZeroShort::KaonZeroShort() ||
+          particle == G4KaonZero::KaonZero()           ||
+          particle == G4AntiKaonZero::AntiKaonZero()   )
+  {
+    CSmanager=G4QKaonMinusElasticCrossSection::GetPointer();
+    CSmanager2=G4QKaonPlusElasticCrossSection::GetPointer();
+    if(G4UniformRand() > 0.5) pPDG= 321;
+    else                      pPDG=-321;
+  }
+  else if(particle == G4Lambda::Lambda())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3122;
+  }
+  else if(particle == G4SigmaPlus::SigmaPlus())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3222;
+  }
+  else if(particle == G4SigmaMinus::SigmaMinus())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3112;
+  }
+  else if(particle == G4SigmaZero::SigmaZero())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3212;
+  }
+  else if(particle == G4XiMinus::XiMinus())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3312;
+  }
+  else if(particle == G4XiZero::XiZero())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3322;
+  }
+  else if(particle == G4OmegaMinus::OmegaMinus())
+  {
+    CSmanager=G4QHyperonElasticCrossSection::GetPointer();
+    pPDG=3334;
+  }
+  else if(particle == G4AntiNeutron::AntiNeutron())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-2112;
+  }
+  else if(particle == G4AntiProton::AntiProton())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-2212;
+  }
+  else if(particle == G4AntiLambda::AntiLambda())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3122;
+  }
+  else if(particle == G4AntiSigmaPlus::AntiSigmaPlus())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3222;
+  }
+  else if(particle == G4AntiSigmaMinus::AntiSigmaMinus())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3112;
+  }
+  else if(particle == G4AntiSigmaZero::AntiSigmaZero())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3212;
+  }
+  else if(particle == G4AntiXiMinus::AntiXiMinus())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3312;
+  }
+  else if(particle == G4AntiXiZero::AntiXiZero())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3322;
+  }
+  else if(particle == G4AntiOmegaMinus::AntiOmegaMinus())
+  {
+    CSmanager=G4QAntiBaryonElasticCrossSection::GetPointer();
+    pPDG=-3334;
+  }
+  else G4cout<<"-Warning-G4QHadronElasticDataSet::GetIsoZACrossSection: PDG="
+             <<particle->GetPDGEncoding()<<" isn't supported by CHIPS"<<G4endl;
+  G4int tZ=(G4int)(Z);
+  G4int tN=(G4int)(A-Z);
+  G4double CSI=CSmanager->GetCrossSection(true, Momentum, tZ, tN, pPDG); // CS(j,i) basic
+  if(CSmanager2) CSI= (CSI  +CSmanager2->GetCrossSection(true, Momentum, tZ, tN, pPDG))/2.;
+  return CSI;
+}
Index: trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4UnstableFragmentBreakUp.hh
===================================================================
--- trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4UnstableFragmentBreakUp.hh	(revision 1316)
+++ trunk/source/processes/hadronic/models/de_excitation/evaporation/include/G4UnstableFragmentBreakUp.hh	(revision 1316)
@@ -0,0 +1,106 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+// $Id: G4UnstableFragmentBreakUp.hh,v 1.2 2010/05/11 11:26:15 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// -------------------------------------------------------------------
+//
+//      GEANT 4 header file
+//
+//      CERN, Geneva, Switzerland
+//
+//      File name:     G4UnstableFragmentBreakUp
+//
+//      Author:        Vladimir Ivanchenko
+//
+//      Creation date: 7 May 2010
+//
+//  Modifications:
+// 
+// -------------------------------------------------------------------
+//  This class providing decay of any fragment on light nucleons using 
+//  taking into account only binding energy, for example, it may decay
+//  2n -> n + n or 2p -> p + p      
+//
+
+#ifndef G4UnstableFragmentBreakUp_h
+#define G4UnstableFragmentBreakUp_h 1
+
+#include "globals.hh"
+#include "G4VEvaporationChannel.hh"
+
+class G4Fragment;
+class G4NistManager;
+
+class G4UnstableFragmentBreakUp : public G4VEvaporationChannel 
+{
+
+public:
+
+  G4UnstableFragmentBreakUp();
+
+  virtual ~G4UnstableFragmentBreakUp();
+
+  // decay fragment on light ions
+  virtual G4FragmentVector* BreakUpFragment(G4Fragment* fragment);
+
+  // dummy virtual methods
+  virtual void Initialize(const G4Fragment& fragment);
+
+  virtual G4Fragment* EmittedFragment(G4Fragment* fragment);
+
+  virtual G4FragmentVector * BreakUp(const G4Fragment& fragment);
+
+  virtual G4double GetEmissionProbability() const;
+
+  inline void SetVerboseLevel(G4int val);
+
+private:
+
+  G4UnstableFragmentBreakUp(const G4UnstableFragmentBreakUp & right);
+  const G4UnstableFragmentBreakUp & operator = (const G4UnstableFragmentBreakUp & right);
+
+  G4bool operator == (const G4UnstableFragmentBreakUp & right) const;
+  G4bool operator != (const G4UnstableFragmentBreakUp & right) const;
+
+  G4int verbose;
+
+  static G4int Zfr[6];
+  static G4int Afr[6];
+  static G4double masses[6];
+
+  G4NistManager* fNistManager;
+};
+
+inline void G4UnstableFragmentBreakUp::SetVerboseLevel(G4int val)
+{
+  verbose = val;
+}
+
+#endif
+
+
+
Index: trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4UnstableFragmentBreakUp.cc
===================================================================
--- trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4UnstableFragmentBreakUp.cc	(revision 1316)
+++ trunk/source/processes/hadronic/models/de_excitation/evaporation/src/G4UnstableFragmentBreakUp.cc	(revision 1316)
@@ -0,0 +1,165 @@
+//
+// ********************************************************************
+// * License and Disclaimer                                           *
+// *                                                                  *
+// * The  Geant4 software  is  copyright of the Copyright Holders  of *
+// * the Geant4 Collaboration.  It is provided  under  the terms  and *
+// * conditions of the Geant4 Software License,  included in the file *
+// * LICENSE and available at  http://cern.ch/geant4/license .  These *
+// * include a list of copyright holders.                             *
+// *                                                                  *
+// * Neither the authors of this software system, nor their employing *
+// * institutes,nor the agencies providing financial support for this *
+// * work  make  any representation or  warranty, express or implied, *
+// * regarding  this  software system or assume any liability for its *
+// * use.  Please see the license in the file  LICENSE  and URL above *
+// * for the full disclaimer and the limitation of liability.         *
+// *                                                                  *
+// * This  code  implementation is the result of  the  scientific and *
+// * technical work of the GEANT4 collaboration.                      *
+// * By using,  copying,  modifying or  distributing the software (or *
+// * any work based  on the software)  you  agree  to acknowledge its *
+// * use  in  resulting  scientific  publications,  and indicate your *
+// * acceptance of all terms of the Geant4 Software license.          *
+// ********************************************************************
+//
+// $Id: G4UnstableFragmentBreakUp.cc,v 1.7 2010/05/19 17:17:28 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+//
+// -------------------------------------------------------------------
+//      GEANT 4 class file 
+//
+//      CERN, Geneva, Switzerland
+//
+//      File name:     G4UnstableFragmentBreakUp
+//
+//      Author:        V.Ivanchenko
+// 
+//      Creation date: 11 May 2010
+//
+//Modifications: 
+//      
+// -------------------------------------------------------------------
+//
+
+#include "G4UnstableFragmentBreakUp.hh"
+#include "Randomize.hh"
+#include "G4LorentzVector.hh"
+#include "G4Fragment.hh"
+#include "G4FragmentVector.hh"
+#include "G4NucleiProperties.hh"
+#include "G4NistManager.hh"
+
+G4int G4UnstableFragmentBreakUp::Zfr[6] = {0};
+G4int G4UnstableFragmentBreakUp::Afr[6] = {0};
+G4double G4UnstableFragmentBreakUp::masses[6] = {0.0};
+
+G4UnstableFragmentBreakUp::G4UnstableFragmentBreakUp()
+  :verbose(0)
+{ 
+  fNistManager = G4NistManager::Instance();
+  if(0 == Afr[0]) {
+    G4int z[6] = {0, 1, 1, 1, 2, 2};
+    G4int a[6] = {1, 1, 2, 3, 3, 4};
+    for(G4int i=0; i<6; ++i) {
+      Zfr[i] = z[i];
+      Afr[i] = a[i];
+      masses[i] = G4NucleiProperties::GetNuclearMass(a[i], z[i]);
+    }
+  }
+}
+
+G4UnstableFragmentBreakUp::~G4UnstableFragmentBreakUp()
+{}
+
+void G4UnstableFragmentBreakUp::Initialize(const G4Fragment&)
+{}
+
+G4Fragment* G4UnstableFragmentBreakUp::EmittedFragment(G4Fragment*)
+{
+  return 0;
+}
+
+G4FragmentVector* G4UnstableFragmentBreakUp::BreakUpFragment(G4Fragment* nucleus)
+{
+  //G4cout << "G4UnstableFragmentBreakUp::BreakUpFragment" << G4endl;
+  G4FragmentVector * theResult = new G4FragmentVector();
+
+  G4int Z = nucleus->GetZ_asInt();
+  G4int A = nucleus->GetA_asInt();
+  G4int Amax = A;
+  G4LorentzVector lv = nucleus->GetMomentum();
+  G4double time = nucleus->GetCreationTime();
+
+  G4double deltaE, mass, mass1(0.0), mass2(0.0);
+  G4int i, index;
+
+  // Starts loop over evaporated particles, loop is limited by number
+  // of nucleons
+  for(G4int ia=0; ia<Amax; ++ia) {
+ 
+    mass = lv.mag();
+    deltaE = 0.0;
+    index  = -1;
+    for(i=0; i<6; ++i) {
+      G4int Zres = Z - Zfr[i];
+      G4int Ares = A - Afr[i];
+      if(Zres >= 0 && Ares >= Zres && Ares > 0) {
+	G4double m1 = G4NucleiProperties::GetNuclearMass(Ares, Zres);
+	G4double de = mass - m1 - masses[i];
+        if(de > deltaE) {
+	  mass1 = m1;
+          mass2 = masses[i];
+          deltaE= de;
+          index = i;
+	}
+      }
+    }
+
+    // no decay channels
+    if(index < 0) { break; }
+
+    // compute energy of light fragment
+    G4double e2 = 0.5*((mass - mass1)*(mass + mass1) + mass2*mass2)/mass;
+    if(e2 < mass2) { break; }
+
+    // sample decay
+    G4ThreeVector bst  = lv.boostVector();
+
+    G4double cosTheta = 1. - 2. * G4UniformRand(); 
+    G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
+    G4double phi = twopi * G4UniformRand();
+    G4double mom = sqrt((e2 - mass2)*(e2 + mass2));
+    G4LorentzVector mom2(mom * sinTheta * std::cos(phi),
+			 mom * sinTheta * std::sin(phi),
+			 mom * cosTheta,
+			 e2);
+    mom2.boost(bst);  
+    G4Fragment* fr = new G4Fragment(Afr[index], Zfr[index], mom2);
+    fr->SetCreationTime(time);
+    theResult->push_back(fr);
+
+    // residual
+    lv -= mom2;
+    Z  -= Zfr[index];
+    A  -= Afr[index];
+  }
+
+  // updated fragment
+  if( theResult->size() > 0) {
+    nucleus->SetZandA_asInt(Z, A);
+    nucleus->SetMomentum(lv);
+  }
+
+  return theResult;
+}
+
+G4FragmentVector* G4UnstableFragmentBreakUp::BreakUp(const G4Fragment&)
+{
+  return 0;
+}
+
+G4double G4UnstableFragmentBreakUp::GetEmissionProbability() const
+{
+  return 0.0;
+}
