Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4CollisionManager.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4CollisionManager.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4CollisionManager.cc	(revision 1228)
@@ -27,4 +27,7 @@
 #include "G4HadronicException.hh"
 #include "G4CollisionInitialState.hh"
+#include "G4BCAction.hh"
+
+#include <typeinfo>
 
 G4CollisionManager::G4CollisionManager()
@@ -178,8 +181,15 @@
   {
     collision = *i;
+    G4int tgtPdg=collision->GetTarget() ?
+	   collision->GetTarget()->GetDefinition()->GetPDGEncoding() : 0;
     G4cout << "  collision " << collision << " time: "
 	   << collision->GetCollisionTime()/second << " proj: "
-	   << collision->GetPrimary() << " trgt: "
-	   << collision->GetTarget() << G4endl;
+	   << collision->GetPrimary() << "/pdg="
+	   << collision->GetPrimary()->GetDefinition()->GetPDGEncoding()
+	   << " trgt: "
+	   << collision->GetTarget() << "/pdg="
+	   << tgtPdg
+	   << " Collision type: "<< typeid(*collision->GetGenerator()).name()
+	   << G4endl;
   }
 }
Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4Scatterer.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4Scatterer.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4Scatterer.cc	(revision 1228)
@@ -24,5 +24,5 @@
 // ********************************************************************
 //
-// $Id: G4Scatterer.cc,v 1.13.2.4 2006/06/29 20:40:31 gunter Exp $ //
+// $Id: G4Scatterer.cc,v 1.13.2.4.2.1 2009/11/20 16:25:08 gunter Exp $ //
 //
 
@@ -126,6 +126,4 @@
 //	    << G4endl;
 
-	   // global optimization
-//	   static const G4double maxCrossSection = 500*millibarn;
 	   if(pi*distance>maxCrossSection) return time;
 	   
Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4VCrossSectionSource.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4VCrossSectionSource.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4VCrossSectionSource.cc	(revision 1228)
@@ -24,5 +24,5 @@
 // ********************************************************************
 //
-// $Id: G4VCrossSectionSource.cc,v 1.5 2006/08/19 21:50:47 dennis Exp $ //
+// $Id: G4VCrossSectionSource.cc,v 1.5.2.1 2009/11/20 16:25:08 gunter Exp $ //
 //
 
@@ -46,8 +46,8 @@
 
 
-G4String G4VCrossSectionSource::
+G4ParticleDefinition * G4VCrossSectionSource::
 FindKeyParticle(const G4KineticTrack& trk1,const G4KineticTrack& trk2) const
 {
-  G4String result;
+  G4ParticleDefinition * result;
   
   G4ParticleDefinition * p1 = trk1.GetDefinition();
@@ -57,10 +57,10 @@
       (p1==G4Neutron::Neutron() && p2==G4Neutron::Neutron()) )
   {
-    result = G4Proton::Proton()->GetParticleName();
+    result = G4Proton::Proton();
   }
   else if( (p1==G4Neutron::Neutron() && p2==G4Proton::Proton()) ||
            (p2==G4Neutron::Neutron() && p1==G4Proton::Proton()) )
   {
-    result = G4Neutron::Neutron()->GetParticleName();
+    result = G4Neutron::Neutron();
   }
   else
Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4XNNElasticLowE.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4XNNElasticLowE.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4XNNElasticLowE.cc	(revision 1228)
@@ -111,6 +111,6 @@
       np->PutValue(i,value);
     }
-  xMap[G4Proton::ProtonDefinition()->GetParticleName()] = pp;
-  xMap[G4Neutron::NeutronDefinition()->GetParticleName()] = np;
+  xMap[G4Proton::ProtonDefinition()] = pp;
+  xMap[G4Neutron::NeutronDefinition()] = np;
 }
 
@@ -118,8 +118,6 @@
 G4XNNElasticLowE::~G4XNNElasticLowE()
 {
-  G4String name_proton = "proton";
-  G4String name_neutron = "neutron";
-  delete xMap[name_proton];
-  delete xMap[name_neutron];
+  delete xMap[G4Proton::ProtonDefinition()];
+  delete xMap[G4Neutron::NeutronDefinition()];
 }
 
@@ -144,7 +142,7 @@
   G4bool dummy = false;
 
-  G4String key = FindKeyParticle(trk1,trk2);
-
-  typedef std::map <G4String, G4PhysicsVector*, std::less<G4String> > StringPhysMap;
+  G4ParticleDefinition * key = FindKeyParticle(trk1,trk2);
+
+  typedef std::map <G4ParticleDefinition *, G4PhysicsVector*, std::less<G4ParticleDefinition *> > StringPhysMap;
 
   if (xMap.find(key)!= xMap.end())
@@ -154,5 +152,5 @@
       for (iter = xMap.begin(); iter != xMap.end(); ++iter)
 	{
-	  G4String str = (*iter).first;
+	  G4ParticleDefinition * str = (*iter).first;
           if (str == key)
 	    {
@@ -166,4 +164,6 @@
                   sigma = physVector->GetValue(_eMin,dummy);
                 }
+		//G4cout << " sqrtS / sigma " << sqrtS/GeV << " / " <<
+		//          sigma/millibarn << G4endl;
 	    }
 	}
@@ -181,13 +181,13 @@
   G4bool dummy = false;
   G4int i;
-  G4String key = G4Proton::ProtonDefinition()->GetParticleName();
+  G4ParticleDefinition * key = G4Proton::ProtonDefinition();
   G4PhysicsVector* pp = 0;
 
-  typedef std::map <G4String, G4PhysicsVector*, std::less<G4String> > StringPhysMap;
+  typedef std::map <G4ParticleDefinition *, G4PhysicsVector*, std::less<G4ParticleDefinition *> > StringPhysMap;
   StringPhysMap::const_iterator iter;
 
   for (iter = xMap.begin(); iter != xMap.end(); ++iter)
     {
-      G4String str = (*iter).first;
+      G4ParticleDefinition * str = (*iter).first;
       if (str == key)
 	{
@@ -210,9 +210,9 @@
   G4cout << Name() << ", np cross-section: " << G4endl;
 
-  key = G4Neutron::NeutronDefinition()->GetParticleName();
+  key = G4Neutron::NeutronDefinition();
   G4PhysicsVector* np = 0;
   for (iter = xMap.begin(); iter != xMap.end(); ++iter)
     {
-      G4String str = (*iter).first;
+      G4ParticleDefinition * str = (*iter).first;
       if (str == key)
 	{
Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4XNNTotalLowE.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4XNNTotalLowE.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4XNNTotalLowE.cc	(revision 1228)
@@ -65,6 +65,6 @@
       it.second=npTot[i]; np->push_back(it);
     }
-  theCrossSections[G4Proton::ProtonDefinition()->GetParticleName()] = pp;
-  theCrossSections[G4Neutron::NeutronDefinition()->GetParticleName()] = np;
+  theCrossSections[G4Proton::ProtonDefinition()] = pp;
+  theCrossSections[G4Neutron::NeutronDefinition()] = np;
 }
 
@@ -72,9 +72,7 @@
 G4XNNTotalLowE::~G4XNNTotalLowE()
 {
-  G4String name_proton = "proton";
-  G4String name_neutron = "neutron";
   
-  delete theCrossSections[name_proton];
-  delete theCrossSections[name_neutron];
+  delete theCrossSections[G4Proton::ProtonDefinition()];
+  delete theCrossSections[G4Neutron::NeutronDefinition()];
 }
 
@@ -83,5 +81,5 @@
   G4double result = 0.;
   G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
-  G4String key = FindKeyParticle(trk1,trk2);
+  G4ParticleDefinition * key = FindKeyParticle(trk1,trk2);
 
   if (theCrossSections.find(key)!= theCrossSections.end())
Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4XPDGElastic.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4XPDGElastic.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4XPDGElastic.cc	(revision 1228)
@@ -25,5 +25,5 @@
 //
 //
-// $Id: G4XPDGElastic.cc,v 1.3 2006/06/29 20:42:42 gunter Exp $ //
+// $Id: G4XPDGElastic.cc,v 1.3.2.1 2009/11/20 16:25:08 gunter Exp $ //
 // -------------------------------------------------------------------
 //      
@@ -74,21 +74,21 @@
 G4XPDGElastic::G4XPDGElastic() 
 {
-  G4String proton = G4Proton::ProtonDefinition()->GetParticleName();
-  G4String neutron = G4Neutron::NeutronDefinition()->GetParticleName();
-  G4String piPlus = G4PionPlus::PionPlusDefinition()->GetParticleName();
-  G4String piMinus = G4PionMinus::PionMinusDefinition()->GetParticleName();
-  G4String KPlus = G4KaonPlus::KaonPlusDefinition()->GetParticleName();
-  G4String KMinus = G4KaonMinus::KaonMinusDefinition()->GetParticleName();
-  G4String antiproton = G4AntiProton::AntiProtonDefinition()->GetParticleName();
-  
-  std::pair<G4String,G4String> pp(proton,proton);
-  std::pair<G4String,G4String> pn(proton,neutron);
-  std::pair<G4String,G4String> piPlusp(piPlus,proton);
-  std::pair<G4String,G4String> piMinusp(piMinus,proton);
-  std::pair<G4String,G4String> KPlusp(KPlus,proton);
-  std::pair<G4String,G4String> KMinusp(KMinus,proton);
-  std::pair<G4String,G4String> nn(neutron,neutron);
-  std::pair<G4String,G4String> ppbar(proton,antiproton);
-  std::pair<G4String,G4String> npbar(antiproton,neutron);
+  G4ParticleDefinition * proton = G4Proton::ProtonDefinition();
+  G4ParticleDefinition * neutron = G4Neutron::NeutronDefinition();
+  G4ParticleDefinition * piPlus = G4PionPlus::PionPlusDefinition();
+  G4ParticleDefinition * piMinus = G4PionMinus::PionMinusDefinition();
+  G4ParticleDefinition * KPlus = G4KaonPlus::KaonPlusDefinition();
+  G4ParticleDefinition * KMinus = G4KaonMinus::KaonMinusDefinition();
+  G4ParticleDefinition * antiproton = G4AntiProton::AntiProtonDefinition();
+  
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> pp(proton,proton);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> pn(proton,neutron);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> piPlusp(piPlus,proton);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> piMinusp(piMinus,proton);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KPlusp(KPlus,proton);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KMinusp(KMinus,proton);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> nn(neutron,neutron);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> ppbar(proton,antiproton);
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> npbar(antiproton,neutron);
 
   std::vector<G4double> ppData;
@@ -159,6 +159,4 @@
   G4ParticleDefinition* def1 = trk1.GetDefinition();
   G4ParticleDefinition* def2 = trk2.GetDefinition();
-  G4String name1 = def1->GetParticleName();
-  G4String name2 = def2->GetParticleName();     
   
   G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
@@ -182,7 +180,7 @@
       
       // Order the pair: first is the lower mass particle, second is the higher mass one
-      std::pair<G4String,G4String> trkPair(def1->GetParticleName(),def2->GetParticleName());
+      std::pair<G4ParticleDefinition *,G4ParticleDefinition *> trkPair(def1,def2);
       if (def1->GetPDGMass() > def2->GetPDGMass())
-	trkPair = std::pair<G4String,G4String>(def2->GetParticleName(),def1->GetParticleName());
+	trkPair = std::pair<G4ParticleDefinition *,G4ParticleDefinition *>(def2,def1);
       
       std::vector<G4double> data; 
@@ -204,5 +202,5 @@
 	  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
 	    {
-	      std::pair<G4String,G4String> thePair = (*iter).first;
+	      std::pair<G4ParticleDefinition *,G4ParticleDefinition *> thePair = (*iter).first;
 	      if (thePair == trkPair)
 		{
@@ -245,5 +243,5 @@
     {
       G4cout << "WARNING! G4XPDGElastic::PDGElastic "      
-	     << name1 << "-" << name2
+	     << def1->GetParticleName() << "-" << def2->GetParticleName()
 	     << " elastic cross section: momentum " 
 	     << pLab << " GeV, negative cross section " 
Index: trunk/source/processes/hadronic/models/im_r_matrix/src/G4XPDGTotal.cc
===================================================================
--- trunk/source/processes/hadronic/models/im_r_matrix/src/G4XPDGTotal.cc	(revision 1201)
+++ trunk/source/processes/hadronic/models/im_r_matrix/src/G4XPDGTotal.cc	(revision 1228)
@@ -68,26 +68,26 @@
 G4XPDGTotal::G4XPDGTotal() 
 {
-  std::pair<G4String,G4String> pp(G4Proton::ProtonDefinition()->GetParticleName(),
-				    G4Proton::ProtonDefinition()->GetParticleName());
-  std::pair<G4String,G4String> pn(G4Proton::ProtonDefinition()->GetParticleName(),
-				    G4Neutron::NeutronDefinition()->GetParticleName());
-  std::pair<G4String,G4String> piPlusp(G4PionPlus::PionPlusDefinition()->GetParticleName(),
-					 G4Proton::ProtonDefinition()->GetParticleName());
-  std::pair<G4String,G4String> piMinusp(G4PionMinus::PionMinusDefinition()->GetParticleName(),
-					  G4Proton::ProtonDefinition()->GetParticleName());
-  std::pair<G4String,G4String> KPlusp(G4KaonPlus::KaonPlusDefinition()->GetParticleName(),
-					G4Proton::ProtonDefinition()->GetParticleName());
-  std::pair<G4String,G4String> KPlusn(G4KaonPlus::KaonPlusDefinition()->GetParticleName(),
-					G4Neutron::NeutronDefinition()->GetParticleName());
-  std::pair<G4String,G4String> KMinusp(G4KaonMinus::KaonMinusDefinition()->GetParticleName(),
-					 G4Proton::ProtonDefinition()->GetParticleName());
-  std::pair<G4String,G4String> KMinusn(G4KaonMinus::KaonMinusDefinition()->GetParticleName(),
-					 G4Neutron::NeutronDefinition()->GetParticleName());
-  std::pair<G4String,G4String> gp(G4Gamma::GammaDefinition()->GetParticleName(),
-				    G4Proton::ProtonDefinition()->GetParticleName());
-  std::pair<G4String,G4String> gg(G4Gamma::GammaDefinition()->GetParticleName(),
-				    G4Gamma::GammaDefinition()->GetParticleName());
-  std::pair<G4String,G4String> nn(G4Neutron::NeutronDefinition()->GetParticleName(),
-				    G4Neutron::NeutronDefinition()->GetParticleName());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> pp(G4Proton::ProtonDefinition(),
+				    G4Proton::ProtonDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> pn(G4Proton::ProtonDefinition(),
+				    G4Neutron::NeutronDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> piPlusp(G4PionPlus::PionPlusDefinition(),
+					 G4Proton::ProtonDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> piMinusp(G4PionMinus::PionMinusDefinition(),
+					  G4Proton::ProtonDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KPlusp(G4KaonPlus::KaonPlusDefinition(),
+					G4Proton::ProtonDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KPlusn(G4KaonPlus::KaonPlusDefinition(),
+					G4Neutron::NeutronDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KMinusp(G4KaonMinus::KaonMinusDefinition(),
+					 G4Proton::ProtonDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> KMinusn(G4KaonMinus::KaonMinusDefinition(),
+					 G4Neutron::NeutronDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> gp(G4Gamma::GammaDefinition(),
+				    G4Proton::ProtonDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> gg(G4Gamma::GammaDefinition(),
+				    G4Gamma::GammaDefinition());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> nn(G4Neutron::NeutronDefinition(),
+				    G4Neutron::NeutronDefinition());
  
   std::vector<G4double> nnData;
@@ -170,8 +170,8 @@
 
   // Order the pair: first is the lower mass particle, second is the higher mass one
-  std::pair<G4String,G4String> trkPair(def1->GetParticleName(),def2->GetParticleName());
+  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> trkPair(def1,def2);
 
   if (def1->GetPDGMass() > def2->GetPDGMass())
-    trkPair = std::pair<G4String,G4String>(def2->GetParticleName(),def1->GetParticleName());
+    trkPair = std::pair<G4ParticleDefinition *,G4ParticleDefinition *>(def2,def1);
  
   std::vector<G4double> data;   
@@ -183,5 +183,5 @@
       for (iter = xMap.begin(); iter != xMap.end(); ++iter)
 	{
-	  std::pair<G4String,G4String> thePair = (*iter).first;
+	  std::pair<G4ParticleDefinition *,G4ParticleDefinition *> thePair = (*iter).first;
 	  if (thePair == trkPair)
 	    {
