Index: trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc
===================================================================
--- trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc	(revision 961)
+++ trunk/source/processes/electromagnetic/utils/src/G4VEmProcess.cc	(revision 991)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4VEmProcess.cc,v 1.62 2009/02/19 09:57:36 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-02-ref-02 $
+// $Id: G4VEmProcess.cc,v 1.60 2008/10/17 14:46:16 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-02 $
 //
 // -------------------------------------------------------------------
@@ -91,8 +91,6 @@
   applyCuts(false),
   startFromNull(true),
-  useDeexcitation(false),
-  nDERegions(0),
-  idxDERegions(0),
-  currentModel(0),
+  nRegions(0),
+  selectedModel(0),
   particle(0),
   currentCouple(0)
@@ -137,21 +135,4 @@
   delete modelManager;
   (G4LossTableManager::Instance())->DeRegister(this);
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-void G4VEmProcess::Clear()
-{
-  delete [] theEnergyOfCrossSectionMax;
-  delete [] theCrossSectionMax;
-  delete [] idxDERegions;
-  theEnergyOfCrossSectionMax = 0;
-  theCrossSectionMax = 0;
-  idxDERegions = 0;
-  currentCouple = 0;
-  preStepLambda = 0.0;
-  mfpKinEnergy  = DBL_MAX;
-  deRegions.clear();
-  nDERegions = 0;
 }
 
@@ -181,34 +162,17 @@
       theLambdaTable = G4PhysicsTableHelper::PreparePhysicsTable(theLambdaTable);
   }
-  // Sub Cutoff and Deexcitation
-  if (nDERegions>0) {
-
-    const G4ProductionCutsTable* theCoupleTable=
-          G4ProductionCutsTable::GetProductionCutsTable();
-    size_t numOfCouples = theCoupleTable->GetTableSize();
-
-    idxDERegions = new G4bool[numOfCouples];
-
-    for (size_t j=0; j<numOfCouples; j++) {
-
-      const G4MaterialCutsCouple* couple =
-        theCoupleTable->GetMaterialCutsCouple(j);
-      const G4ProductionCuts* pcuts = couple->GetProductionCuts();
-      G4bool reg = false;
-      for(G4int i=0; i<nDERegions; i++) {
-	if(deRegions[i]) {
-	  if(pcuts == deRegions[i]->GetProductionCuts()) reg = true;
-	}
-      }
-      idxDERegions[j] = reg;
-    }
-  }
-  if (1 < verboseLevel && nDERegions>0) {
-    G4cout << " Deexcitation is activated for regions: " << G4endl;
-    for (G4int i=0; i<nDERegions; i++) {
-      const G4Region* r = deRegions[i];
-      G4cout << "           " << r->GetName() << G4endl;
-    }
-  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+void G4VEmProcess::Clear()
+{
+  if(theEnergyOfCrossSectionMax) delete [] theEnergyOfCrossSectionMax;
+  if(theCrossSectionMax) delete [] theCrossSectionMax;
+  theEnergyOfCrossSectionMax = 0;
+  theCrossSectionMax = 0;
+  currentCouple = 0;
+  preStepLambda = 0.0;
+  mfpKinEnergy  = DBL_MAX;
 }
 
@@ -273,33 +237,4 @@
       G4cout << *theLambdaTable << G4endl;
     }
-  }
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-void G4VEmProcess::PrintInfoDefinition()
-{
-  if(verboseLevel > 0) {
-    G4cout << G4endl << GetProcessName() << ":   for  "
-           << particle->GetParticleName();
-    if(integral) G4cout << ", integral: 1 ";
-    if(applyCuts) G4cout << ", applyCuts: 1 ";
-    G4cout << "    SubType= " << GetProcessSubType() << G4endl;
-    if(buildLambdaTable) {
-      G4cout << "      Lambda tables from "
-	     << G4BestUnit(minKinEnergy,"Energy") 
-	     << " to "
-	     << G4BestUnit(maxKinEnergy,"Energy")
-	     << " in " << nLambdaBins << " bins, spline: " 
-	     << (G4LossTableManager::Instance())->SplineFlag()
-	     << G4endl;
-    }
-    PrintInfo();
-    modelManager->DumpModelList(verboseLevel);
-  }
-
-  if(verboseLevel > 2 && buildLambdaTable) {
-    G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
-    if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
   }
 }
@@ -369,4 +304,14 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
+G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
+				       G4double,
+				       G4ForceCondition* condition)
+{
+  *condition = NotForced;
+  return G4VEmProcess::MeanFreePath(track);
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
 G4VParticleChange* G4VEmProcess::PostStepDoIt(const G4Track& track,
                                               const G4Step&)
@@ -397,8 +342,6 @@
   }
 
-  SelectModel(finalT);
-  if(useDeexcitation) {
-    currentModel->SetDeexcitationFlag(idxDERegions[currentMaterialIndex]);
-  }
+  G4VEmModel* currentModel = SelectModel(finalT);
+
   /*  
   if(0 < verboseLevel) {
@@ -461,4 +404,54 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 
+void G4VEmProcess::PrintInfoDefinition()
+{
+  if(verboseLevel > 0) {
+    G4cout << G4endl << GetProcessName() << ":   for  "
+           << particle->GetParticleName();
+    if(integral) G4cout << ", integral: 1 ";
+    if(applyCuts) G4cout << ", applyCuts: 1 ";
+    G4cout << "    SubType= " << GetProcessSubType() << G4endl;
+    if(buildLambdaTable) {
+      G4cout << "      Lambda tables from "
+	     << G4BestUnit(minKinEnergy,"Energy") 
+	     << " to "
+	     << G4BestUnit(maxKinEnergy,"Energy")
+	     << " in " << nLambdaBins << " bins, spline: " 
+	     << (G4LossTableManager::Instance())->SplineFlag()
+	     << G4endl;
+    }
+    PrintInfo();
+    modelManager->DumpModelList(verboseLevel);
+  }
+
+  if(verboseLevel > 2 && buildLambdaTable) {
+    G4cout << "      LambdaTable address= " << theLambdaTable << G4endl;
+    if(theLambdaTable) G4cout << (*theLambdaTable) << G4endl;
+  }
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
+G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
+					     const G4MaterialCutsCouple* couple)
+{
+  // Cross section per atom is calculated
+  DefineMaterial(couple);
+  G4double cross = 0.0;
+  G4bool b;
+  if(theLambdaTable) {
+    cross = (((*theLambdaTable)[currentMaterialIndex])->
+                           GetValue(kineticEnergy, b));
+  } else {
+    G4VEmModel* model = SelectModel(kineticEnergy);
+    cross = 
+      model->CrossSectionPerVolume(currentMaterial,particle,kineticEnergy);
+  }
+
+  return cross;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
+
 G4bool G4VEmProcess::StorePhysicsTable(const G4ParticleDefinition* part,
 			 	       const G4String& directory,
@@ -528,63 +521,4 @@
 
   return yes;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-void G4VEmProcess::ActivateDeexcitation(G4bool val, const G4Region* r)
-{
-  G4RegionStore* regionStore = G4RegionStore::GetInstance();
-  const G4Region* reg = r;
-  if (!reg) {reg = regionStore->GetRegion("DefaultRegionForTheWorld", false);}
-
-  // the region is in the list
-  if (nDERegions) {
-    for (G4int i=0; i<nDERegions; i++) {
-      if (reg == deRegions[i]) {
-	if(!val) deRegions[i] = 0;
-        return;
-      }
-    }
-  }
-
-  // new region 
-  if(val) {
-    useDeexcitation = true;
-    deRegions.push_back(reg);
-    nDERegions++;
-  } else {
-    useDeexcitation = false;
-  }
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-G4double G4VEmProcess::CrossSectionPerVolume(G4double kineticEnergy,
-					     const G4MaterialCutsCouple* couple)
-{
-  // Cross section per atom is calculated
-  DefineMaterial(couple);
-  G4double cross = 0.0;
-  G4bool b;
-  if(theLambdaTable) {
-    cross = (((*theLambdaTable)[currentMaterialIndex])->
-                           GetValue(kineticEnergy, b));
-  } else {
-    SelectModel(kineticEnergy);
-    cross = currentModel->CrossSectionPerVolume(currentMaterial,
-						particle,kineticEnergy);
-  }
-
-  return cross;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
-
-G4double G4VEmProcess::GetMeanFreePath(const G4Track& track,
-				       G4double,
-				       G4ForceCondition* condition)
-{
-  *condition = NotForced;
-  return G4VEmProcess::MeanFreePath(track);
 }
 
