Index: trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc
===================================================================
--- trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc	(revision 819)
+++ trunk/source/processes/electromagnetic/lowenergy/src/G4CrossSectionExcitationEmfietzoglouPartial.cc	(revision 961)
@@ -24,52 +24,23 @@
 // ********************************************************************
 //
-//
-// $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.2 2007/12/10 16:31:26 gunter Exp $
-// GEANT4 tag $Name:  $
-// 
-// Contact Author: Maria Grazia Pia (Maria.Grazia.Pia@cern.ch)
-//
-// Reference: TNS Geant4-DNA paper
-// Reference for implementation model: NIM. 155, pp. 145-156, 1978
-
-// History:
-// -----------
-// Date         Name              Modification
-// 28 Apr 2007  M.G. Pia          Created in compliance with design described in TNS paper
-//
-// -------------------------------------------------------------------
-
-// Class description:
-// Geant4-DNA Cross total cross section for electron elastic scattering in water
-// Reference: TNS Geant4-DNA paper
-// S. Chauvie et al., Geant4 physics processes for microdosimetry simulation:
-// design foundation and implementation of the first set of models,
-// IEEE Trans. Nucl. Sci., vol. 54, no. 6, Dec. 2007.
-// Further documentation available from http://www.ge.infn.it/geant4/dna
-
-// -------------------------------------------------------------------
-
+// $Id: G4CrossSectionExcitationEmfietzoglouPartial.cc,v 1.3 2008/07/14 20:47:34 sincerti Exp $
+// GEANT4 tag $Name: geant4-09-02-ref-02 $
 
 #include "G4CrossSectionExcitationEmfietzoglouPartial.hh"
-#include "G4Track.hh"
-#include "G4DynamicParticle.hh"
-#include "G4ParticleDefinition.hh"
-#include "G4Electron.hh"
 
-#include "Randomize.hh"
-
-#include <deque>
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 G4CrossSectionExcitationEmfietzoglouPartial::G4CrossSectionExcitationEmfietzoglouPartial()
 {
-
   nLevels = waterExcitation.NumberOfLevels();
-  //G4cout << "Water excitation energy: number of levels = " << nLevels << G4endl;
 }
 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 G4CrossSectionExcitationEmfietzoglouPartial::~G4CrossSectionExcitationEmfietzoglouPartial()
-{ }
+{}
  
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
 G4double G4CrossSectionExcitationEmfietzoglouPartial::CrossSection(G4double t, G4int level)
 {
@@ -84,10 +55,10 @@
   // Aj, Bj, Cj & Pj are parameters that can be found in Emfietzoglou's papers
   //
-  //
   // From Phys. Med. Biol. 48 (2003) 2355-2371, D.Emfietzoglou,
   // Monte Carlo Simulation of the energy loss of low energy electrons in liquid Water
-  
+  //
   // Scaling for macroscopic cross section: number of water moleculs per unit volume
-  // (capra) const G4double sigma0 = (10. / 3.343e22) * cm2;
+  // const G4double sigma0 = (10. / 3.343e22) * cm2;
+
   const G4double density = 3.34192e+19 * mm3;
 
@@ -100,6 +71,5 @@
   
   G4double exc = waterExcitation.ExcitationEnergy(level);
-  // G4cout << "Water excitation energy " << exc/keV << " level = " << level << G4endl;
-
+  
   if (t >= exc)
     {
@@ -113,4 +83,6 @@
 }
 
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
 G4int G4CrossSectionExcitationEmfietzoglouPartial::RandomSelect(G4double k)
 {
@@ -119,5 +91,5 @@
   std::deque<double> values;
   
-  // ---- MGP ---- The following algorithm is wrong: it works is the cross section 
+  // ---- MGP ---- The following algorithm is wrong: it works if the cross section 
   // is a monotone increasing function.
   // The algorithm should be corrected by building the cumulative function 
@@ -126,24 +98,26 @@
 
   while (i > 0)
-    {
-      i--;
-      G4double partial = CrossSection(k,i);
-      values.push_front(partial);
-      value += partial;
-    }
+  {
+    i--;
+    G4double partial = CrossSection(k,i);
+    values.push_front(partial);
+    value += partial;
+  }
 
-    value *= G4UniformRand();
+  value *= G4UniformRand();
     
-    i = nLevels;
+  i = nLevels;
 
-    while (i > 0)
-      {
-	i--;
-	if (values[i] > value) return i;
-	value -= values[i];
-      }
+  while (i > 0)
+  {
+    i--;
+    if (values[i] > value) return i;
+    value -= values[i];
+  }
     
-    return 0;
+  return 0;
 }
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
 G4double G4CrossSectionExcitationEmfietzoglouPartial::Sum(G4double k)
@@ -152,7 +126,7 @@
 
   for (G4int i=0; i<nLevels; i++)
-    {
-      totalCrossSection += CrossSection(k,i);
-    }
+  {
+    totalCrossSection += CrossSection(k,i);
+  }
   return totalCrossSection;
 }
