Index: trunk/source/processes/hadronic/models/de_excitation/handler/include/G4ExcitationHandler.hh
===================================================================
--- trunk/source/processes/hadronic/models/de_excitation/handler/include/G4ExcitationHandler.hh	(revision 1228)
+++ trunk/source/processes/hadronic/models/de_excitation/handler/include/G4ExcitationHandler.hh	(revision 1315)
@@ -24,7 +24,6 @@
 // ********************************************************************
 //
-//
-// $Id: G4ExcitationHandler.hh,v 1.10 2009/11/24 11:18:48 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4ExcitationHandler.hh,v 1.12 2010/04/27 14:00:23 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // Hadronic Process: Nuclear De-excitations
@@ -55,4 +54,5 @@
 #include "G4VEvaporation.hh"
 #include "G4VPhotonEvaporation.hh"
+#include "G4VEvaporationChannel.hh"
 #include "G4Fragment.hh"
 #include "G4DynamicParticle.hh"
@@ -68,6 +68,4 @@
 #include "G4IonConstructor.hh" 
 
-//#define debug
-
 class G4ExcitationHandler 
 {
@@ -75,13 +73,14 @@
   G4ExcitationHandler(); 
   ~G4ExcitationHandler();
+
 private:
+
   G4ExcitationHandler(const G4ExcitationHandler &right);
-
   const G4ExcitationHandler & operator=(const G4ExcitationHandler &right);
   G4bool operator==(const G4ExcitationHandler &right) const;
   G4bool operator!=(const G4ExcitationHandler &right) const;
   
-
 public:
+
   G4ReactionProductVector * BreakItUp(const G4Fragment &theInitialState) const;
 
@@ -92,5 +91,5 @@
   void SetFermiModel(G4VFermiBreakUp *const  value);
 
-  void SetPhotonEvaporation(G4VPhotonEvaporation * const value);
+  void SetPhotonEvaporation(G4VEvaporationChannel * const value);
 
   void SetMaxZForFermiBreakUp(G4int aZ);
@@ -99,11 +98,13 @@
   void SetMinEForMultiFrag(G4double anE);
 
-// for inverse cross section choice
-  inline void SetOPTxs(G4int opt) { OPTxs = opt;}
-// for superimposed Coulomb Barrir for inverse cross sections
-  inline void UseSICB(){useSICB=true;}
+  // for inverse cross section choice
+  inline void SetOPTxs(G4int opt);
+  // for superimposed Coulomb Barrir for inverse cross sections
+  inline void UseSICB();
 
 private:
 
+  void SetParameters();
+
   G4ReactionProductVector * Transform(G4FragmentVector * theFragmentVector) const;
 
@@ -114,5 +115,5 @@
   const G4VFermiBreakUp * GetFermiModel() const;
 
-  const G4VPhotonEvaporation * GetPhotonEvaporation() const;
+  const G4VEvaporationChannel * GetPhotonEvaporation() const;
 
   G4int GetMaxZ() const;
@@ -124,4 +125,5 @@
 			 G4FragmentVector * Result) const;
 #endif
+
 private:
   
@@ -132,9 +134,10 @@
   G4VFermiBreakUp *theFermiModel;
  
-  G4VPhotonEvaporation * thePhotonEvaporation;
+  G4VEvaporationChannel * thePhotonEvaporation;
 
   G4int maxZForFermiBreakUp;
   G4int maxAForFermiBreakUp;
   G4double minEForMultiFrag;
+  G4double minExcitation;
 
   G4ParticleTable *theTableOfParticles;
@@ -147,5 +150,5 @@
   G4int OPTxs;
   G4bool useSICB;
-
+  
   struct DeleteFragment 
   {
@@ -156,9 +159,18 @@
     }
   };
-
-
+  
 };
 
-
+inline void G4ExcitationHandler::SetOPTxs(G4int opt) 
+{ 
+  OPTxs = opt; 
+  SetParameters();
+}
+
+inline void G4ExcitationHandler::UseSICB()
+{ 
+  useSICB = true; 
+  SetParameters();
+}
 
 inline const G4VEvaporation * G4ExcitationHandler::GetEvaporation() const
@@ -172,4 +184,5 @@
   MyOwnEvaporationClass = false;
   theEvaporation = value;
+  SetParameters();
 }
 
@@ -199,10 +212,10 @@
 
 
-inline const G4VPhotonEvaporation * G4ExcitationHandler::GetPhotonEvaporation() const
+inline const G4VEvaporationChannel * G4ExcitationHandler::GetPhotonEvaporation() const
 {
   return thePhotonEvaporation;
 }
 
-inline void G4ExcitationHandler::SetPhotonEvaporation(G4VPhotonEvaporation *const  value)
+inline void G4ExcitationHandler::SetPhotonEvaporation(G4VEvaporationChannel *const  value)
 {
   if (thePhotonEvaporation != 0 && MyOwnPhotonEvaporationClass) delete thePhotonEvaporation;
Index: trunk/source/processes/hadronic/models/de_excitation/handler/src/G4ExcitationHandler.cc
===================================================================
--- trunk/source/processes/hadronic/models/de_excitation/handler/src/G4ExcitationHandler.cc	(revision 1228)
+++ trunk/source/processes/hadronic/models/de_excitation/handler/src/G4ExcitationHandler.cc	(revision 1315)
@@ -24,4 +24,6 @@
 // ********************************************************************
 //
+// $Id: G4ExcitationHandler.cc,v 1.39 2010/05/18 15:46:11 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // Hadronic Process: Nuclear De-excitations
@@ -29,16 +31,6 @@
 //
 //
-// Modif (September 2009) by J. M. Quesada: 
-// according to Igor Pshenichnov, SMM will be applied (just in case) only once .
-//
-// Modif (September 2008) by J. M. Quesada. External choices have been added for :
-//                   -inverse cross section option (default OPTxs=3)
-//                   -superimposed Coulomb barrier (if useSICB is set true, by default it is false) 
-//
-// Modif (24 Jul 2008) by M. A. Cortes Giraldo:
-//      -Max Z,A for Fermi Break-Up turns to 9,17 by default
-//      -BreakItUp() reorganised and bug in Evaporation loop fixed
-//      -Transform() optimised
-// Modif (30 June 1998) by V. Lara:
+// Modified:
+// (30 June 1998) by V. Lara:
 //      -Modified the Transform method for use G4ParticleTable and 
 //       therefore G4IonTable. It makes possible to convert all kind 
@@ -49,4 +41,19 @@
 //              MultiFragmentation: G4StatMF 
 //              Fermi Breakup model: G4FermiBreakUp
+// (24 Jul 2008) by M. A. Cortes Giraldo:
+//      -Max Z,A for Fermi Break-Up turns to 9,17 by default
+//      -BreakItUp() reorganised and bug in Evaporation loop fixed
+//      -Transform() optimised
+// (September 2008) by J. M. Quesada. External choices have been added for :
+//      -inverse cross section option (default OPTxs=3)
+//      -superimposed Coulomb barrier (if useSICB is set true, by default it is false) 
+// (September 2009) by J. M. Quesada: 
+//      -according to Igor Pshenichnov, SMM will be applied (just in case) only once.
+// (27 Nov 2009) by V.Ivanchenko: 
+//      -cleanup the logic, reduce number internal vectors, fixed memory leak.
+// (11 May 2010) by V.Ivanchenko: 
+//      -FermiBreakUp activated, used integer Z and A, used BreakUpFragment method for 
+//       final photon deexcitation; used check on adundance of a fragment, decay 
+//       unstable fragments with A <5
 //
 
@@ -54,15 +61,15 @@
 #include "globals.hh"
 #include "G4LorentzVector.hh"
+#include "G4NistManager.hh"
 #include <list>
-
-//#define debugphoton
-
 
 G4ExcitationHandler::G4ExcitationHandler():
   // JMQ 160909 Fermi BreakUp & MultiFrag are on by default 
   // This is needed for activation of such models when G4BinaryLightIonReaction is used
-  //  since no interface (for external activation via macro input file) is still available in this case.
-  //maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),minEForMultiFrag(3.0*MeV),
-  maxZForFermiBreakUp(1),maxAForFermiBreakUp(1),minEForMultiFrag(4.0*GeV),
+  // since no interface (for external activation via macro input file) is still available.
+  maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),minEForMultiFrag(4.0*GeV),
+  //  maxZForFermiBreakUp(9),maxAForFermiBreakUp(17),minEForMultiFrag(3.0*MeV),
+  //maxZForFermiBreakUp(1),maxAForFermiBreakUp(1),minEForMultiFrag(4.0*GeV),
+  minExcitation(CLHEP::keV),
   MyOwnEvaporationClass(true), MyOwnMultiFragmentationClass(true),MyOwnFermiBreakUpClass(true),
   MyOwnPhotonEvaporationClass(true),OPTxs(3),useSICB(false)
@@ -74,11 +81,6 @@
   theFermiModel = new G4FermiBreakUp;
   thePhotonEvaporation = new G4PhotonEvaporation;
+  SetParameters();
 }
-
-G4ExcitationHandler::G4ExcitationHandler(const G4ExcitationHandler &)
-{
-  throw G4HadronicException(__FILE__, __LINE__, "G4ExcitationHandler::copy_constructor: is meant to not be accessable! ");
-}
-
 
 G4ExcitationHandler::~G4ExcitationHandler()
@@ -90,81 +92,77 @@
 }
 
-
-const G4ExcitationHandler & G4ExcitationHandler::operator=(const G4ExcitationHandler &)
+void G4ExcitationHandler::SetParameters()
 {
-  throw G4HadronicException(__FILE__, __LINE__, "G4ExcitationHandler::operator=: is meant to not be accessable! ");
-  
-  return *this;
-}
-
-
-G4bool G4ExcitationHandler::operator==(const G4ExcitationHandler &) const
-{
-  throw G4HadronicException(__FILE__, __LINE__, "G4ExcitationHandler::operator==: is meant to not be accessable! ");
-  return false;
-} 
-
-G4bool G4ExcitationHandler::operator!=(const G4ExcitationHandler &) const
-{
-  throw G4HadronicException(__FILE__, __LINE__, "G4ExcitationHandler::operator!=: is meant to not be accessable! ");
-  return true;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////////
-/// 25/07/08 16:45  Proposed by MAC ////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////////////////////////////
-
-G4ReactionProductVector * G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState) const
-{	
   //for inverse cross section choice
   theEvaporation->SetOPTxs(OPTxs);
   //for the choice of superimposed Coulomb Barrier for inverse cross sections
   theEvaporation->UseSICB(useSICB);
-  
-  // Pointer which will be used to return the final production vector
-  //G4FragmentVector * theResult = new G4FragmentVector;
+  theEvaporation->Initialise();
+}
+
+G4ReactionProductVector * G4ExcitationHandler::BreakItUp(const G4Fragment & theInitialState) const
+{	
   
   // Variables existing until end of method
-  //G4Fragment * theInitialStatePtr = const_cast<G4Fragment*>(&theInitialState);
   G4Fragment * theInitialStatePtr = new G4Fragment(theInitialState);
+
   G4FragmentVector * theTempResult = 0;      // pointer which receives temporal results
-  std::list<G4Fragment*> theEvapList;        // list to apply Evaporation, SMF or Fermi Break-Up
+  std::list<G4Fragment*> theEvapList;        // list to apply Evaporation or Fermi Break-Up
   std::list<G4Fragment*> theEvapStableList;  // list to apply PhotonEvaporation
   std::list<G4Fragment*> theResults;         // list to store final result
   std::list<G4Fragment*>::iterator iList;
   //
-  //G4cout << "@@@@@@@@@@ Start G4Exitation Handler @@@@@@@@@@@@@" << G4endl;  
+  //G4cout << "@@@@@@@@@@ Start G4Excitation Handler @@@@@@@@@@@@@" << G4endl;  
   //G4cout << theInitialState << G4endl;  
   
   // Variables to describe the excited configuration
   G4double exEnergy = theInitialState.GetExcitationEnergy();
-  G4int A = static_cast<G4int>( theInitialState.GetA() +0.5 );
-  G4int Z = static_cast<G4int>( theInitialState.GetZ() +0.5 );
+  G4int A = theInitialState.GetA_asInt();
+  G4int Z = theInitialState.GetZ_asInt();
+
+  G4NistManager* nist = G4NistManager::Instance();
   
   // JMQ 150909:  first step in de-excitation chain (SMM will be used only here)
   
-  // In case A <= 4 the fragment will not perform any nucleon emission
-  if (A <= 4)
+  // In case A <= 1 the fragment will not perform any nucleon emission
+  if (A <= 1)
     {
-      // I store G4Fragment* in theEvapStableList to apply thePhotonEvaporation later      
-      theEvapStableList.push_back( theInitialStatePtr );
+      theResults.push_back( theInitialStatePtr );
     }
-  
-  else  // If A > 4 we try to apply theFermiModel, theMultiFragmentation or theEvaporation
+  // check if a fragment is stable
+  else if(exEnergy < minExcitation && nist->GetIsotopeAbundance(Z, A) > 0.0)
     {
-      
+      theResults.push_back( theInitialStatePtr );
+    }  
+  else  // In all cases apply once theFermiModel, theMultiFragmentation or theEvaporation
+    {      
       // JMQ 150909: first step in de-excitation is treated separately 
       // Fragments after the first step are stored in theEvapList 
-      // Statistical Multifragmentation will take place (just in case) only here
+      // Statistical Multifragmentation will take place only once
       //
-      // Test applicability
-      // Initial State De-Excitation 
-      if(A<GetMaxA()&&Z<GetMaxZ()) 
+      // Fermi Break-Up always first
+      if((A < 5) || (A<GetMaxA() && Z<GetMaxZ())) 
         {
           theTempResult = theFermiModel->BreakItUp(theInitialState);
+	  // fragment was not decaied try to evaporate
+	  if(1 == theTempResult->size()) {
+            if((*theTempResult)[0] !=  theInitialStatePtr) { 
+	      delete (*theTempResult)[0]; 
+	    }
+            delete theTempResult;
+	    theTempResult = theEvaporation->BreakItUp(theInitialState);
+	  }
         }
       else   if (exEnergy>GetMinE()*A) 
         {
           theTempResult = theMultiFragmentation->BreakItUp(theInitialState);
+	  // fragment was not decaied try to evaporate
+	  if(1 == theTempResult->size()) {
+            if((*theTempResult)[0] !=  theInitialStatePtr) { 
+	      delete (*theTempResult)[0]; 
+	    }
+            delete theTempResult;
+	    theTempResult = theEvaporation->BreakItUp(theInitialState);
+	  }
         }
       else 
@@ -174,16 +172,28 @@
       
       G4bool deletePrimary = true;
-      if(theTempResult->size() > 0) 
+      G4int nsec=theTempResult->size();
+      if(nsec > 0) 
 	{      
-	  // Store original state in theEvapList
+	  // Sort out secondary fragments
 	  G4FragmentVector::iterator j;
 	  for (j = theTempResult->begin(); j != theTempResult->end(); ++j)
 	    {  
 	      if((*j) == theInitialStatePtr) { deletePrimary = false; }
-	      A = static_cast<G4int>((*j)->GetA()+0.5);  // +0.5 to avoid bad truncation
-
-	      if(A <= 1)      { theResults.push_back(*j); }         // gamma, p, n
-	      else if(A <= 4) { theEvapStableList.push_back(*j); }  // evaporation is not possible
-	      else            { theEvapList.push_back(*j); }        // evaporation is possible
+	      A = (*j)->GetA_asInt();  
+
+	      if(A <= 1) { theResults.push_back(*j); }   // gamma, p, n
+	      else if(1 == nsec) { theEvapStableList.push_back(*j); } // evaporation is not possible  
+	      else  // Analyse fragment
+		{
+		  G4double exEnergy = (*j)->GetExcitationEnergy();
+		  if(exEnergy < minExcitation) {
+		    Z = (*j)->GetZ_asInt(); 
+                    if(nist->GetIsotopeAbundance(Z, A) > 0.0) { 
+		      theResults.push_back(*j); // stable fragment 
+		    } else {   
+		      theEvapList.push_back(*j); // unstable cold fragment 
+		    }
+		  } else { theEvapList.push_back(*j); } // hot fragment
+		}
 	    }
 	}
@@ -204,57 +214,53 @@
   for (iList = theEvapList.begin(); iList != theEvapList.end(); ++iList)
     {
-      A = static_cast<G4int>((*iList)->GetA()+0.5);  // +0.5 to avoid bad truncation
-      Z = static_cast<G4int>((*iList)->GetZ()+0.5);
+      A = (*iList)->GetA_asInt(); 
+      Z = (*iList)->GetZ_asInt();
 	  
-      // In case A <= 4 the fragment will not perform any nucleon emission
-      if (A <= 4)
+      // Fermi Break-Up 
+      if ((A < 5) || (A < GetMaxA() && Z < GetMaxZ())) 
 	{
-	  // storing G4Fragment* in theEvapStableList to apply thePhotonEvaporation later    
-	  theEvapStableList.push_back(*iList );
+	  theTempResult = theFermiModel->BreakItUp(*(*iList));
+	  // fragment was not decaied try to evaporate
+	  if(1 == theTempResult->size()) {
+            if((*theTempResult)[0] !=  theInitialStatePtr) { delete (*theTempResult)[0]; }
+            delete theTempResult;
+	    theTempResult = theEvaporation->BreakItUp(*(*iList));
+	  }
 	}
-	  
-      else  // If A > 4 we try to apply theFermiModel or theEvaporation
-	{   
-	  // stable fragment  
-	  if ((*iList)->GetExcitationEnergy() <= 0.1*eV) 
-	    { 
-	      theResults.push_back(*iList); 
+      else // apply Evaporation in another case
+	{
+	  theTempResult = theEvaporation->BreakItUp(*(*iList));
+	}
+      
+      G4bool deletePrimary = true;
+      G4int nsec = theTempResult->size();
+		  
+      // Sort out secondary fragments
+      if ( nsec > 0 )
+	{
+	  G4FragmentVector::iterator j;
+	  for (j = theTempResult->begin(); j != theTempResult->end(); ++j)
+	    {
+	      if((*j) == (*iList)) { deletePrimary = false; }
+	      A = (*j)->GetA_asInt();
+
+	      if(A <= 1) { theResults.push_back(*j); }                // gamma, p, n
+	      else if(1 == nsec) { theEvapStableList.push_back(*j); } // no evaporation 
+	      else  // Analyse fragment
+		{
+		  G4double exEnergy = (*j)->GetExcitationEnergy();
+		  if(exEnergy < minExcitation) {
+		    Z = (*j)->GetZ_asInt();
+                    if(nist->GetIsotopeAbundance(Z, A) > 0.0) { 
+		      theResults.push_back(*j); // stable fragment 
+		    } else {   
+		      theEvapList.push_back(*j); // unstable cold fragment 
+		    }
+		  } else { theEvapList.push_back(*j); } // hot fragment
+		}
 	    }
-	  else
-	    {
-	      if ( A < GetMaxA() && Z < GetMaxZ() ) // if satisfied apply Fermi Break-Up
-		{
-		  theTempResult = theFermiModel->BreakItUp(*(*iList));
-		}
-	      else // apply Evaporation in another case
-		{
-		  theTempResult = theEvaporation->BreakItUp(*(*iList));
-		}
-		  
-	      // New configuration is stored in theTempResult, so we can free
-	      // the memory where the previous configuration is
-		  
-	      G4bool deletePrimary = true;
-	      G4int nsec = theTempResult->size();
-		  
-	      // The number of secondaries tells us if the configuration has changed  
-	      if ( nsec > 0 )
-		{
-		  G4FragmentVector::iterator j;
-		  for (j = theTempResult->begin(); j != theTempResult->end(); ++j)
-		    {
-		      if((*j) == (*iList)) { deletePrimary = false; }
-		      A = static_cast<G4int>((*j)->GetA()+0.5);  // +0.5 to avoid bad truncation
-
-		      if(A <= 1)                   { theResults.push_back(*j); }        // gamma, p, n
-		      else if(A <= 4 || 1 == nsec) { theEvapStableList.push_back(*j); } // no evaporation 
-		      else                         { theEvapList.push_back(*j); }      
-		    }
-		}
-	      if( deletePrimary ) { delete (*iList); }
-	      delete theTempResult;
-	      
-	    }
-	} // endif (A <=4)
+	}
+      if( deletePrimary ) { delete (*iList); }
+      delete theTempResult;
     } // end of the loop over theEvapList
 
@@ -267,67 +273,25 @@
   // -----------------------
   
+  // normally should not reach this point - it is kind of work around	      
   for (iList = theEvapStableList.begin(); iList != theEvapStableList.end(); ++iList)
     {
-      // take out stable particles and fragments
-      A = static_cast<G4int>((*iList)->GetA()+0.5);
-      if ( A <= 1 )                                       { theResults.push_back(*iList); }
-      else if ((*iList)->GetExcitationEnergy() <= 0.1*eV) { theResults.push_back(*iList); }
-
-      else
+      // photon-evaporation is applied
+      theTempResult = thePhotonEvaporation->BreakUpFragment(*iList);	  
+      G4int nsec = theTempResult->size();
+	  
+      // if there is a gamma emission then
+      if (nsec > 0)
 	{
-	  // photon-evaporation is applied
-	  theTempResult = thePhotonEvaporation->BreakItUp(*(*iList));
-	  
-	  G4bool deletePrimary = true;
-	  G4int nsec = theTempResult->size();
-	  
-	  // if there is a gamma emission then
-	  if (nsec > 1)
+	  G4FragmentVector::iterator j;
+	  for (j = theTempResult->begin(); j != theTempResult->end(); ++j)
 	    {
-	      G4FragmentVector::iterator j;
-	      for (j = theTempResult->begin(); j != theTempResult->end(); ++j)
-		{
-		  if((*j) == (*iList)) { deletePrimary = false; }
-		  A = static_cast<G4int>((*j)->GetA()+0.5);  // +0.5 to avoid bad truncation
-
-		  if(A <= 1)                                     { theResults.push_back(*j); }  // gamma, p, n
-		  else if((*j)->GetExcitationEnergy() <= 0.1*eV) { theResults.push_back(*j); }  // stable fragment
-		  else                                           { theEvapStableList.push_back(*j); }      
-		}
+	      theResults.push_back(*j); 
 	    }
-	      
-	  else if(1 == nsec) 
-	    {
-	      G4FragmentVector::iterator j = theTempResult->begin();
-	      if((*j) == (*iList)) { deletePrimary = false; }
-	      // Let's create a G4Fragment pointer representing the gamma emmited
-	      G4LorentzVector lv = (*j)->GetMomentum();
-              G4double Mass = (*j)->GetGroundStateMass();
-              G4double Ecm = lv.m();
-              if(Ecm - Mass > 0.1*eV) 
-		{
-		  G4ThreeVector bst = lv.boostVector();
-		  G4double GammaEnergy = 0.5*(Ecm - Mass)*(Ecm + Mass)/Ecm;
-		  G4double cosTheta = 1. - 2. * G4UniformRand(); 
-		  G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
-		  G4double phi = twopi * G4UniformRand();
-		  G4LorentzVector Gamma4P(GammaEnergy * sinTheta * std::cos(phi),
-					  GammaEnergy * sinTheta * std::sin(phi),
-					  GammaEnergy * cosTheta,
-					  GammaEnergy);
-		  Gamma4P.boost(bst);  
-		  G4Fragment * theHandlerPhoton = new G4Fragment(Gamma4P,G4Gamma::GammaDefinition());
-		  theResults.push_back(theHandlerPhoton); 
-	      
-		  // And now we update momentum and energy for the nucleus
-		  lv -= Gamma4P;
-		  (*j)->SetMomentum(lv); // Now this fragment has been deexcited!
-		}
-	      // we store the deexcited fragment 
-	      theResults.push_back(*j);
-	    }
-	  if( deletePrimary ) { delete (*iList); }
-	  delete theTempResult;
-	}  
+	}
+      delete theTempResult;
+
+      // priamry fragment is kept
+      theResults.push_back(*iList); 
+
     } // end of photon-evaporation loop
 
@@ -356,6 +320,6 @@
       theFragmentMomentum = (*i)->GetMomentum();
       G4ParticleDefinition* theKindOfFragment = 0;
-      if (theFragmentA == 0 && theFragmentZ == 0) {       // photon
-	theKindOfFragment = G4Gamma::GammaDefinition();   
+      if (theFragmentA == 0) {       // photon or e-
+	theKindOfFragment = (*i)->GetParticleDefinition();   
       } else if (theFragmentA == 1 && theFragmentZ == 0) { // neutron
 	theKindOfFragment = G4Neutron::NeutronDefinition();
