Index: trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc
===================================================================
--- trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc	(revision 1005)
+++ trunk/source/processes/electromagnetic/standard/src/G4PAIPhotonModel.cc	(revision 1007)
@@ -24,10 +24,4 @@
 // ********************************************************************
 //
-// $Id: G4PAIPhotonModel.cc,v 1.21 2009/02/19 19:17:50 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-02-ref-02 $
-//
-// -------------------------------------------------------------------
-//
-// GEANT4 Class 
 // File name:     G4PAIPhotonModel.cc
 //
@@ -223,9 +217,4 @@
 //////////////////////////////////////////////////////////////////
 
-void G4PAIPhotonModel::InitialiseMe(const G4ParticleDefinition*)
-{}
-
-//////////////////////////////////////////////////////////////////
-
 void G4PAIPhotonModel::ComputeSandiaPhotoAbsCof()
 {
@@ -498,6 +487,5 @@
   {
     //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
+    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;      
   }
@@ -542,6 +530,5 @@
   {
     //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
+    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;      
   }
@@ -587,6 +574,5 @@
   {
     //  if ( x1 == x2  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    //    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*0.5 ;
+    if ( std::abs(x1-x2) <= eV  ) dNdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     else             dNdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;      
   }
@@ -631,6 +617,5 @@
   {
     //  if ( x1 == x2  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    //    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
-    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*0.5 ;
+    if ( std::abs(x1-x2) <= eV  ) dEdxCut = y1 + (y2 - y1)*G4UniformRand() ;
     else             dEdxCut = y1 + (transferCut - x1)*(y2 - y1)/(x2 - x1) ;      
   }
@@ -641,15 +626,11 @@
 //////////////////////////////////////////////////////////////////////////////
 
-G4double G4PAIPhotonModel::ComputeDEDXPerVolume(const G4Material*,
-						const G4ParticleDefinition* p,
-						G4double kineticEnergy,
-						G4double cutEnergy)
+G4double G4PAIPhotonModel::ComputeDEDX(const G4MaterialCutsCouple* matCC,
+                                 const G4ParticleDefinition* p,
+                                       G4double kineticEnergy,
+                                       G4double cutEnergy)
 {
   G4int iTkin,iPlace;
   size_t jMat;
-
-  //G4double cut = std::min(MaxSecondaryEnergy(p, kineticEnergy), cutEnergy);
-  G4double cut = cutEnergy;
-
   G4double particleMass = p->GetPDGMass();
   G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
@@ -657,5 +638,4 @@
   G4double charge2      = charge*charge;
   G4double dEdx         = 0.;
-  const G4MaterialCutsCouple* matCC = CurrentCouple();
 
   for( jMat = 0 ;jMat < fMaterialCutsCoupleVector.size() ; ++jMat )
@@ -673,5 +653,5 @@
   iPlace = iTkin - 1;
   if(iPlace < 0) iPlace = 0;
-  dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cut) ) ;  
+  dEdx = charge2*( (*fdEdxVector)(iPlace) - GetdEdxCut(iPlace,cutEnergy) ) ;  
 
   if( dEdx < 0.) dEdx = 0.;
@@ -681,14 +661,13 @@
 /////////////////////////////////////////////////////////////////////////
 
-G4double G4PAIPhotonModel::CrossSectionPerVolume( const G4Material*,
-						  const G4ParticleDefinition* p,
-						  G4double kineticEnergy,
-						  G4double cutEnergy,
-						  G4double maxEnergy  ) 
+G4double G4PAIPhotonModel::CrossSection( const G4MaterialCutsCouple* matCC,
+                                   const G4ParticleDefinition* p,
+                                         G4double kineticEnergy,
+                                         G4double cutEnergy,
+                                         G4double maxEnergy  ) 
 {
   G4int iTkin,iPlace;
   size_t jMat, jMatCC;
-  G4double tmax = std::min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
-  if(cutEnergy >= tmax) return 0.0;
+  G4double tmax = min(MaxSecondaryEnergy(p, kineticEnergy), maxEnergy);
   G4double particleMass = p->GetPDGMass();
   G4double scaledTkin   = kineticEnergy*proton_mass_c2/particleMass;
@@ -696,6 +675,4 @@
   G4double charge2      = charge*charge, cross, cross1, cross2;
   G4double photon1, photon2, plasmon1, plasmon2;
-
-  const G4MaterialCutsCouple* matCC = CurrentCouple();
 
   const G4ProductionCutsTable* theCoupleTable=
@@ -1248,28 +1225,4 @@
 }
 
-/////////////////////////////////////////////////////////////////////
-
-G4double G4PAIPhotonModel::MaxSecondaryEnergy( const G4ParticleDefinition* p,
-                                                      G4double kinEnergy) 
-{
-  G4double tmax = kinEnergy;
-  if(p == fElectron) tmax *= 0.5;
-  else if(p != fPositron) { 
-    G4double mass = p->GetPDGMass();
-    G4double ratio= electron_mass_c2/mass;
-    G4double gamma= kinEnergy/mass + 1.0;
-    tmax = 2.0*electron_mass_c2*(gamma*gamma - 1.) /
-                  (1. + 2.0*gamma*ratio + ratio*ratio);
-  }
-  return tmax;
-}
-
-///////////////////////////////////////////////////////////////
-
-void G4PAIPhotonModel::DefineForRegion(const G4Region* r) 
-{
-  fPAIRegionVector.push_back(r);
-}
-
 
 //
