Index: trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh
===================================================================
--- trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh	(revision 1228)
+++ trunk/source/processes/electromagnetic/utils/include/G4VEmModel.hh	(revision 1315)
@@ -24,6 +24,6 @@
 // ********************************************************************
 //
-// $Id: G4VEmModel.hh,v 1.72 2009/09/23 14:42:47 vnivanch Exp $
-// GEANT4 tag $Name: geant4-09-03 $
+// $Id: G4VEmModel.hh,v 1.75 2010/05/26 10:41:34 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
 //
 // -------------------------------------------------------------------
@@ -150,4 +150,7 @@
 
   // Compute effective ion charge square
+  virtual G4double ChargeSquareRatio(const G4Track&);
+
+  // Compute effective ion charge square
   virtual G4double GetChargeSquareRatio(const G4ParticleDefinition*,
 					const G4Material*,
@@ -228,4 +231,7 @@
 					     G4double maxEnergy = DBL_MAX);
 
+  // select isotope in order to have precise mass of the nucleus
+  inline G4int SelectIsotopeNumber(const G4Element*);
+
   // atom can be selected effitiantly if element selectors are initialised 
   inline const G4Element* SelectRandomAtom(const G4MaterialCutsCouple*,
@@ -236,12 +242,9 @@
 
   // to select atom cross section per volume is recomputed for each element 
-  inline const G4Element* SelectRandomAtom(const G4Material*,
-					   const G4ParticleDefinition*,
-					   G4double kineticEnergy,
-					   G4double cutEnergy = 0.0,
-					   G4double maxEnergy = DBL_MAX);
-
-  // select isotope in order to have precise mass of the nucleus
-  inline G4int SelectIsotopeNumber(const G4Element*);
+  const G4Element* SelectRandomAtom(const G4Material*,
+				    const G4ParticleDefinition*,
+				    G4double kineticEnergy,
+				    G4double cutEnergy = 0.0,
+				    G4double maxEnergy = DBL_MAX);
 
   //------------------------------------------------------------------------
@@ -291,4 +294,6 @@
   inline void SetCurrentCouple(const G4MaterialCutsCouple*);
 
+  inline const G4Element* GetCurrentElement() const;
+
 protected:
 
@@ -296,6 +301,4 @@
 
   inline void SetCurrentElement(const G4Element*);
-
-  inline const G4Element* GetCurrentElement() const;
 
 private:
@@ -341,5 +344,41 @@
 };
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+// ======== Run time inline methods ================
+
+inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
+{
+  currentCouple = p;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
+{
+  return currentCouple;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
+{
+  currentElement = elm;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline const G4Element* G4VEmModel::GetCurrentElement() const
+{
+  return currentElement;
+}
+
+//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+
+inline 
+G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
+{
+  return MaxSecondaryEnergy(dynPart->GetDefinition(),
+                            dynPart->GetKineticEnergy());
+}
+
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
@@ -375,5 +414,5 @@
   G4double mfp = DBL_MAX;
   G4double cross = CrossSectionPerVolume(material,p,ekin,emin,emax);
-  if (cross > DBL_MIN) mfp = 1./cross;
+  if (cross > DBL_MIN) { mfp = 1./cross; }
   return mfp;
 }
@@ -415,29 +454,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-inline 
-const G4Element* G4VEmModel::SelectRandomAtom(const G4Material* material,
-					      const G4ParticleDefinition* pd,
-					      G4double kinEnergy,
-					      G4double tcut,
-					      G4double tmax)
-{
-  const G4ElementVector* theElementVector = material->GetElementVector();
-  G4int n = material->GetNumberOfElements() - 1;
-  currentElement = (*theElementVector)[n];
-  if (n > 0) {
-    G4double x = G4UniformRand()*
-                 G4VEmModel::CrossSectionPerVolume(material,pd,kinEnergy,tcut,tmax);
-    for(G4int i=0; i<n; i++) {
-      if (x <= xsec[i]) {
-	currentElement = (*theElementVector)[i];
-	break;
-      }
-    }
-  }
-  return currentElement;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 inline G4int G4VEmModel::SelectIsotopeNumber(const G4Element* elm)
 {
@@ -450,9 +464,9 @@
       G4double* ab = elm->GetRelativeAbundanceVector();
       G4double x = G4UniformRand();
-      for(; idx<ni; idx++) {
+      for(; idx<ni; ++idx) {
 	x -= ab[idx];
-	if (x <= 0.0) break;
+	if (x <= 0.0) { break; }
       }
-      if(idx >= ni) idx = ni - 1;
+      if(idx >= ni) { idx = ni - 1; }
     }
     N = elm->GetIsotope(idx)->GetN();
@@ -461,5 +475,5 @@
 }
 
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+// ======== Get/Set inline methods used at initialisation ================
 
 inline G4VEmFluctuationModel* G4VEmModel::GetModelOfFluctuations()
@@ -578,13 +592,4 @@
 {
   nuclearStopping = val;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-inline 
-G4double G4VEmModel::MaxSecondaryKinEnergy(const G4DynamicParticle* dynPart)
-{
-  return MaxSecondaryEnergy(dynPart->GetDefinition(),
-                            dynPart->GetKineticEnergy());
 }
 
@@ -601,5 +606,5 @@
                                           G4VEmFluctuationModel* f = 0)
 {
-  if(p && pParticleChange != p) pParticleChange = p;
+  if(p && pParticleChange != p) { pParticleChange = p; }
   fluc = f;
 }
@@ -607,32 +612,4 @@
 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 
-inline void G4VEmModel::SetCurrentCouple(const G4MaterialCutsCouple* p)
-{
-  currentCouple = p;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-inline const G4MaterialCutsCouple* G4VEmModel::CurrentCouple() const
-{
-  return currentCouple;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-inline void G4VEmModel::SetCurrentElement(const G4Element* elm)
-{
-  currentElement = elm;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
-inline const G4Element* G4VEmModel::GetCurrentElement() const
-{
-  return currentElement;
-}
-
-//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
-
 #endif
 
