Index: trunk/source/processes/hadronic/models/coherent_elastic/History
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/History	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/History	(revision 1315)
@@ -14,4 +14,13 @@
      * Please list in reverse chronological order (last date on top)
      ---------------------------------------------------------------
+
+26 January 2010 - M.Kosov (hadr-cohe-V09-03-01)
+------------------------------------------------------
+- Bug fix: not initialized G4QNeutronElasticCrossSection in QGSP_BERT. Tested
+  on the simplified calorimeter. Does not crash after 21 events (pi 200 GeV, Cu-LAr)
+
+13 January 2010 - M.Kosov (hadr-cohe-V09-03-00)
+------------------------------------------------------
+- Use G4Q(Proton/Neutron)ElasticCrossSection instead of G4QElasticCrossSection
 
 19 November 2009 - M.Kosov (hadr-cohe-V09-02-03)
Index: trunk/source/processes/hadronic/models/coherent_elastic/include/G4CHIPSElastic.hh
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/include/G4CHIPSElastic.hh	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/include/G4CHIPSElastic.hh	(revision 1315)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4CHIPSElastic.hh,v 1.3 2009/10/08 18:56:57 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4CHIPSElastic.hh,v 1.4 2010/01/13 15:42:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // Geant4 Header : G4CHIPSElastic
@@ -60,5 +60,6 @@
 private:
 
-  static G4VQCrossSection* xsManager;
+  static G4VQCrossSection* pxsManager;
+  static G4VQCrossSection* nxsManager;
 
 };
Index: trunk/source/processes/hadronic/models/coherent_elastic/include/G4HadronElastic.hh
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/include/G4HadronElastic.hh	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/include/G4HadronElastic.hh	(revision 1315)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4HadronElastic.hh,v 1.31 2009/10/08 18:56:57 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4HadronElastic.hh,v 1.32 2010/01/13 15:42:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 //
@@ -43,4 +43,5 @@
 // 28-Mar-07 V.Ivanchenko add NIST manager
 // 11-May-07 V.Ivanchenko remove unused method Defs1
+// 13.01.10: M.Kosov: Use G4Q(Pr/Neut)ElasticCS instead of G4QElasticCS
 //
 //
@@ -108,5 +109,6 @@
 		  G4double rr);
 
-  static G4VQCrossSection* qCManager;
+  static G4VQCrossSection* pCManager;
+  static G4VQCrossSection* nCManager;
 
   G4ElasticHadrNucleusHE*     hElastic;
Index: trunk/source/processes/hadronic/models/coherent_elastic/include/G4UHadronElasticProcess.hh
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/include/G4UHadronElasticProcess.hh	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/include/G4UHadronElasticProcess.hh	(revision 1315)
@@ -25,6 +25,6 @@
 //
 //
-// $Id: G4UHadronElasticProcess.hh,v 1.10 2006/11/16 20:09:13 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4UHadronElasticProcess.hh,v 1.11 2010/01/13 15:42:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // Geant4 Hadron Elastic Scattering Process -- header file
@@ -81,5 +81,6 @@
 private:
 
-  G4VQCrossSection*           qCManager;
+  G4VQCrossSection*           pCManager;
+  G4VQCrossSection*           nCManager;
   const G4ParticleDefinition* theProton;
   const G4ParticleDefinition* theNeutron;
Index: trunk/source/processes/hadronic/models/coherent_elastic/src/G4CHIPSElastic.cc
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/src/G4CHIPSElastic.cc	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/src/G4CHIPSElastic.cc	(revision 1315)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4CHIPSElastic.cc,v 1.3 2009/10/08 18:56:57 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4CHIPSElastic.cc,v 1.4 2010/01/13 15:42:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 //---------------------------------------------------------------------
@@ -34,4 +34,5 @@
 //  
 // Modified:
+// 13.01.10: M.Kosov: Use G4Q(Pr/Neut)ElasticCS instead of G4QElasticCS
 //
 //---------------------------------------------------------------------
@@ -42,11 +43,17 @@
 #include "G4VQCrossSection.hh"
 #include "G4ParticleDefinition.hh"
-#include "G4QElasticCrossSection.hh"
+#include "G4QProtonElasticCrossSection.hh"
+#include "G4QNeutronElasticCrossSection.hh"
 
-G4VQCrossSection* G4CHIPSElastic::xsManager = 0;
+G4VQCrossSection* G4CHIPSElastic::pxsManager = 0;
+G4VQCrossSection* G4CHIPSElastic::nxsManager = 0;
 
 G4CHIPSElastic::G4CHIPSElastic() : G4VHadronElastic("hElasticCHIPS")
 {
-  if(!xsManager) {xsManager = G4QElasticCrossSection::GetPointer();}
+  if(!pxsManager)
+  {
+    pxsManager = G4QProtonElasticCrossSection::GetPointer();
+    nxsManager = G4QNeutronElasticCrossSection::GetPointer();
+  }
 }
 
@@ -62,7 +69,13 @@
   else if(Z == 2 && N == 1) N = 2;
   G4int projPDG = p->GetPDGEncoding();
-  G4double cs = xsManager->GetCrossSection(false,plab,Z,N,projPDG);
+  G4double cs = 0.;
+  if     (projPDG==2212) cs = pxsManager->GetCrossSection(false,plab,Z,N,projPDG);
+  else if(projPDG==2112) cs = nxsManager->GetCrossSection(false,plab,Z,N,projPDG);
   G4double t = 0.0;
-  if(cs > 0.0) t = xsManager->GetExchangeT(Z,N,projPDG);
+  if(cs > 0.0)
+  {
+    if     (projPDG==2212) t = pxsManager->GetExchangeT(Z,N,projPDG);
+    else if(projPDG==2112) t = nxsManager->GetExchangeT(Z,N,projPDG);
+  }
   else         t = G4VHadronElastic::SampleInvariantT(p, plab, Z, A);
   return t;
Index: trunk/source/processes/hadronic/models/coherent_elastic/src/G4HadronElastic.cc
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/src/G4HadronElastic.cc	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/src/G4HadronElastic.cc	(revision 1315)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4HadronElastic.cc,v 1.65 2009/10/08 18:56:57 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4HadronElastic.cc,v 1.66 2010/01/13 15:42:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 //
@@ -62,4 +62,5 @@
 //                        p and He targets only  
 // 11-May-07 V.Ivanchenko remove unused method Defs1
+// 13.01.10: M.Kosov: Use G4Q(Pr/Neut)ElasticCS instead of G4QElasticCS
 //
 
@@ -68,5 +69,6 @@
 #include "G4ParticleDefinition.hh"
 #include "G4IonTable.hh"
-#include "G4QElasticCrossSection.hh"
+#include "G4QProtonElasticCrossSection.hh"
+#include "G4QNeutronElasticCrossSection.hh"
 #include "G4VQCrossSection.hh"
 #include "G4ElasticHadrNucleusHE.hh"
@@ -79,5 +81,6 @@
 #include "G4PionMinus.hh"
 
-G4VQCrossSection* G4HadronElastic::qCManager = 0;
+G4VQCrossSection* G4HadronElastic::pCManager = 0;
+G4VQCrossSection* G4HadronElastic::nCManager = 0;
 
 G4HadronElastic::G4HadronElastic(G4ElasticHadrNucleusHE* HModel) 
@@ -93,5 +96,9 @@
   plabLowLimit     = 20.0*MeV;
 
-  if(!qCManager) {qCManager = G4QElasticCrossSection::GetPointer();}
+  if(!pCManager)
+  {
+    pCManager = G4QProtonElasticCrossSection::GetPointer();
+    nCManager = G4QNeutronElasticCrossSection::GetPointer();
+  }
   if(!hElastic) hElastic = new G4ElasticHadrNucleusHE();
 
@@ -112,5 +119,8 @@
 G4VQCrossSection* G4HadronElastic::GetCS()
 {
-  return qCManager;
+  return pCManager;
+  //if     (PDG==2212) return pCManager;
+  //else if(PDG==2112) return nCManager;
+  //return 0;
 }
 
@@ -200,14 +210,19 @@
   if(gtype == fQElastic) {
     if (verboseLevel >1) {
-      G4cout << "G4HadronElastic: Z= " << Z << " N= " 
-	     << N << " pdg= " <<  projPDG
-	     << " mom(GeV)= " << plab/GeV << "  " << qCManager << G4endl; 
+      G4cout << "G4HadronElastic: Z= " << Z << " N= "  << N << " pdg= " <<  projPDG
+	       << " mom(GeV)= " << plab/GeV<<", pC="<<pCManager<<", nC="<<nCManager<<G4endl; 
     }
     if(Z == 1 && N == 2) N = 1;
     else if(Z == 2 && N == 1) N = 2;
-    G4double cs = qCManager->GetCrossSection(false,plab,Z,N,projPDG);
+    G4double cs = 0.;
+    if     (projPDG==2212) cs = pCManager->GetCrossSection(false,plab,Z,N,projPDG);
+    else if(projPDG==2112) cs = nCManager->GetCrossSection(false,plab,Z,N,projPDG);
 
     // check if cross section is reasonable
-    if(cs > 0.0) t = qCManager->GetExchangeT(Z,N,projPDG);
+    if(cs > 0.0)
+    {
+      if     (projPDG==2212) t = pCManager->GetExchangeT(Z,N,projPDG);
+      else if(projPDG==2112) t = nCManager->GetExchangeT(Z,N,projPDG);
+    }
     else if(plab > plabLowLimit) gtype = fLElastic;
     else gtype = fSWave;
Index: trunk/source/processes/hadronic/models/coherent_elastic/src/G4UHadronElasticProcess.cc
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/src/G4UHadronElasticProcess.cc	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/src/G4UHadronElasticProcess.cc	(revision 1315)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4UHadronElasticProcess.cc,v 1.39 2008/10/22 08:16:40 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4UHadronElasticProcess.cc,v 1.41 2010/01/26 13:34:01 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // Geant4 Hadron Elastic Scattering Process -- header file
@@ -39,4 +39,5 @@
 // 23.01.07 V.Ivanchnko add cross section interfaces with Z and A
 // 02.05.07 V.Ivanchnko add He3
+// 13.01.10: M.Kosov: Use G4Q(Pr/Neut)ElasticCS instead of G4QElasticCS
 //
 
@@ -46,5 +47,6 @@
 #include "G4HadronElasticDataSet.hh"
 #include "G4VQCrossSection.hh"
-#include "G4QElasticCrossSection.hh"
+#include "G4QProtonElasticCrossSection.hh"
+#include "G4QNeutronElasticCrossSection.hh"
 #include "G4QCHIPSWorld.hh"
 #include "G4Element.hh"
@@ -64,5 +66,6 @@
   thEnergy    = 19.0*MeV;
   verboseLevel= 1;
-  qCManager   = 0;
+  pCManager   = G4QProtonElasticCrossSection::GetPointer();
+  nCManager   = G4QNeutronElasticCrossSection::GetPointer();
 }
 
@@ -73,5 +76,5 @@
 void G4UHadronElasticProcess::SetQElasticCrossSection(G4VQCrossSection* p)
 {
-  qCManager = p;
+  pCManager = p;
 }
 
@@ -81,5 +84,4 @@
   if(first) {
     first = false;
-    if(!qCManager) qCManager = G4QElasticCrossSection::GetPointer();
     theParticle = &aParticleType;
     pPDG = theParticle->GetPDGEncoding();
@@ -172,6 +174,4 @@
     if(ni == 0) {
       G4int N = G4int(elm->GetN()+0.5) - iz;
-      x = qCManager->GetCrossSection(false,momentum,iz,N,pPDG);
-      xsecH[0] = x;
 #ifdef G4VERBOSE
       if(verboseLevel>1) 
@@ -179,6 +179,10 @@
 	       << " N= "  << N << " pdg= " << pPDG 
 	       << " mom(GeV)= " << momentum/GeV 
-	       << "  " << qCManager << G4endl; 
-#endif
+	       << ", pC=" << pCManager << ", nC=" << nCManager << G4endl; 
+#endif
+      x = 0.;
+      if     (pPDG==2212) x = pCManager->GetCrossSection(false,momentum,iz,N,pPDG);
+      else if(pPDG==2112) x = nCManager->GetCrossSection(false,momentum,iz,N,pPDG);
+      xsecH[0] = x;
     } else {
       G4double* ab = elm->GetRelativeAbundanceVector();
@@ -195,7 +199,10 @@
 		 << " N= "  << N << " pdg= " << pPDG 
 		 << " mom(GeV)= " << momentum/GeV 
-		 << "  " << qCManager << G4endl; 
-#endif
-	G4double y = ab[j]*qCManager->GetCrossSection(false,momentum,iz,N,pPDG);
+		 << ", pC=" << pCManager << ", nC=" << pCManager << G4endl; 
+#endif
+      G4double qxs=0.;
+      if     (pPDG==2212) qxs=pCManager->GetCrossSection(false,momentum,iz,N,pPDG);
+      else if(pPDG==2112) qxs=nCManager->GetCrossSection(false,momentum,iz,N,pPDG);
+	G4double y = ab[j]*qxs;
 	x += y;
 	xsecH[j] = x;
Index: trunk/source/processes/hadronic/models/coherent_elastic/src/G4WHadronElasticProcess.cc
===================================================================
--- trunk/source/processes/hadronic/models/coherent_elastic/src/G4WHadronElasticProcess.cc	(revision 1228)
+++ trunk/source/processes/hadronic/models/coherent_elastic/src/G4WHadronElasticProcess.cc	(revision 1315)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4WHadronElasticProcess.cc,v 1.2 2009/09/22 16:21:46 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4WHadronElasticProcess.cc,v 1.3 2010/01/13 15:42:06 mkossov Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // Geant4 Hadron Elastic Scattering Process 
@@ -39,4 +39,5 @@
 // 23.01.07 V.Ivanchenko add cross section interfaces with Z and A
 // 02.05.07 V.Ivanchenko add He3
+// 13.01.10: M.Kosov: Commented not used G4QElasticCrossSection & G4QCHIPSWorld
 //
 
@@ -46,6 +47,6 @@
 #include "G4HadronElasticDataSet.hh"
 #include "G4VQCrossSection.hh"
-#include "G4QElasticCrossSection.hh"
-#include "G4QCHIPSWorld.hh"
+//#include "G4QElasticCrossSection.hh"
+//#include "G4QCHIPSWorld.hh"
 #include "G4Element.hh"
 #include "G4ElementVector.hh"
