Index: trunk/source/materials/History
===================================================================
--- trunk/source/materials/History	(revision 1337)
+++ trunk/source/materials/History	(revision 1347)
@@ -1,3 +1,3 @@
-$Id: History,v 1.182 2010/05/20 13:08:22 vnivanch Exp $
+$Id: History,v 1.190 2010/11/23 17:35:54 vnivanch Exp $
 -------------------------------------------------------------------
 
@@ -17,4 +17,31 @@
      * Reverse chronological order (last date on top), please *
      ----------------------------------------------------------
+
+23-11-10 V.Ivanchenko (materials-V09-03-14)
+- G4SandiaTable - V.Grichine Bug fix in G4_Ar 
+
+12-11-10 V.Ivanchenko (materials-V09-03-13)
+12-11-10 V.Grichine Bug fix in G4SandiaTable::SandiaMixing adding 
+         fVerbose and pedantic variable initialisation      
+
+05-11-10 V.Ivanchenko (materials-V09-03-12)
+- Removed obsolete unused data classes G4IronStoppingICRU73, 
+  G4MaterialStoppingICRU73, G4SimpleMaterialStoppingICRU73,
+  data are uploaded from G4LEDATA
+
+04-11-10 V.Ivanchenko (materials-V09-03-11)
+- G4NistMaterialBuilder - added few DNA materials
+
+01-11-10 V.Ivanchenko (materials-V09-03-10)
+- G4NistManager - use G4Pow for fast computations
+- Fixed problems highlighted by the Coverity tool
+
+26-10-10 V.Ivanchenko (materials-V09-03-09)
+- G4NistMaterialBuilder - added BioChemicalMaterials and corresponding
+  access methods
+
+25-10-10 V.Ivanchenko (materials-V09-03-08)
+- Fixed problems highlighted by the Coverity tool, mainly proper 
+  initialisation 
 
 20-05-10 V.Ivanchenko (materials-V09-03-07)
Index: trunk/source/materials/include/G4ExtDEDXTable.hh
===================================================================
--- trunk/source/materials/include/G4ExtDEDXTable.hh	(revision 1337)
+++ trunk/source/materials/include/G4ExtDEDXTable.hh	(revision 1347)
@@ -24,5 +24,6 @@
 // ********************************************************************
 //
-//
+// $Id: G4ExtDEDXTable.hh,v 1.3 2010/10/25 08:35:26 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // ===========================================================================
Index: trunk/source/materials/include/G4IonStoppingData.hh
===================================================================
--- trunk/source/materials/include/G4IonStoppingData.hh	(revision 1337)
+++ trunk/source/materials/include/G4IonStoppingData.hh	(revision 1347)
@@ -24,5 +24,6 @@
 // ********************************************************************
 //
-//
+// $Id: G4IonStoppingData.hh,v 1.2 2010/10/25 08:41:39 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // ===========================================================================
Index: trunk/source/materials/src/G4ExtDEDXTable.cc
===================================================================
--- trunk/source/materials/src/G4ExtDEDXTable.cc	(revision 1337)
+++ trunk/source/materials/src/G4ExtDEDXTable.cc	(revision 1347)
@@ -24,4 +24,6 @@
 // ********************************************************************
 //
+// $Id: G4ExtDEDXTable.cc,v 1.4 2010/11/01 18:18:57 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // ===========================================================================
@@ -39,4 +41,7 @@
 // 03.11.2009 A. Lechner:  Added new methods BuildPhysicsVector according
 //            to interface changes in base class G4VIonDEDXTable.
+// 25.10.2010 V.Ivanchenko fixed bug in usage of iterators reported by the 
+//            Coverity tool
+// 01.11.2010 V.Ivanchenko fixed remaining bugs reported by Coverity 
 //
 //
@@ -220,5 +225,5 @@
 
 #ifdef G4VERBOSE
-     G4cerr << "G4IonDEDXTable::AddPhysicsVector() Error: Pointer to vector"
+     G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: Pointer to vector"
             << " is null-pointer."
             << G4endl;
@@ -231,5 +236,5 @@
 
 #ifdef G4VERBOSE
-     G4cerr << "G4IonDEDXTable::AddPhysicsVector() Error: "
+     G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: "
             << "Cannot add physics vector. Invalid name."
             << G4endl;
@@ -242,5 +247,5 @@
 
 #ifdef G4VERBOSE
-     G4cerr << "G4IonDEDXTable::AddPhysicsVector() Error: "
+     G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: "
             << "Cannot add physics vector. Illegal atomic number."
             << G4endl;
@@ -257,5 +262,5 @@
 
 #ifdef G4VERBOSE
-        G4cerr << "G4IonDEDXTable::AddPhysicsVector() Error: "
+        G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: "
                << "Vector already exists. Remove first before replacing."
                << G4endl;
@@ -272,5 +277,5 @@
 
 #ifdef G4VERBOSE
-     G4cerr << "G4IonDEDXTable::AddPhysicsVector() Error: "
+     G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: "
             << "Vector already exists. Remove first before replacing."
             << G4endl;
@@ -302,10 +307,10 @@
 
 #ifdef G4VERBOSE
-    G4cerr << "G4IonDEDXTable::RemovePhysicsVector() Warning: "
-            << "Cannot remove physics vector. Vector not found."
-             << G4endl;
-#endif
-
-     return false;
+    G4cout << "G4IonDEDXTable::RemovePhysicsVector() Warning: "
+	   << "Cannot remove physics vector. Vector not found."
+	   << G4endl;
+#endif
+
+    return false;
   }
 
@@ -314,12 +319,11 @@
 
   // Deleting key of physics vector from elemental material map (if it exists)
-  G4IonDEDXMapElem::iterator iter_beg = dedxMapElements.begin();
-  G4IonDEDXMapElem::iterator iter_end = dedxMapElements.end();
+  G4IonDEDXMapElem::iterator it;
   
-  for(;iter_beg != iter_end; iter_beg++) {
-
-     if( (*iter_beg).second == physicsVector ) {
-
-        dedxMapElements.erase(iter_beg);
+  for(it=dedxMapElements.begin(); it!=dedxMapElements.end(); ++it) {
+
+     if( (*it).second == physicsVector ) {
+        dedxMapElements.erase(it);
+        break;
      }
   }
@@ -345,5 +349,5 @@
 
 #ifdef G4VERBOSE
-     G4cerr << "G4ExtDEDXTable::StorePhysicsVector() " 
+     G4cout << "G4ExtDEDXTable::StorePhysicsVector() " 
             << " Cannot open file "<< fileName 
             << G4endl;
@@ -388,5 +392,5 @@
 
 #ifdef G4VERBOSE
-              G4cerr << "G4ExtDEDXTable::StorePhysicsVector() " 
+              G4cout << "G4ExtDEDXTable::StorePhysicsVector() " 
                      << " Cannot store physics vector." 
                      << G4endl;
@@ -409,109 +413,111 @@
 
   std::ifstream ifilestream;
-
   ifilestream.open( fileName, std::ios::in );
-
-  if( !ifilestream ) {
-
-#ifdef G4VERBOSE
-     G4cerr << "G4ExtDEDXTable::RetrievePhysicsVector() " 
-            << " Cannot open file "<< fileName 
-            << G4endl;
-#endif
-      
-     return false;
+  if( ! ifilestream ) {
+#ifdef G4VERBOSE
+    G4cout << "G4ExtDEDXTable::RetrievePhysicsVector() " 
+	   << " Cannot open file "<< fileName 
+	   << G4endl;
+#endif
+    return false;
   }   
 
-  G4int nmbVectors;
-
+  std::string::size_type nmbVectors = 0;
   ifilestream >> nmbVectors;
-  
-  for(G4int i = 0; i < nmbVectors; i++) {
-
-      G4String line = "";
-
-      while( line.empty() ) {
-
-         getline( ifilestream, line );
-
-         if( ifilestream.fail() ) { 
-
+
+  if(nmbVectors == std::string::npos || nmbVectors == 0) {
+#ifdef G4VERBOSE
+    G4cout << "G4ExtDEDXTable::RetrievePhysicsVector() " 
+	   << " The file is empty "<< nmbVectors 
+	   << G4endl;
+#endif
+    return false;
+  }  
+  for(size_t i = 0; i<nmbVectors; ++i) {
+
+    G4String line = "";
+    while( line.empty() ) {
+
+      getline( ifilestream, line );
+      if( ifilestream.fail() ) { 
 #ifdef G4VERBOSE  
-            G4cerr << "G4ExtDEDXTable::RetrievePhysicsTable() " 
-                   << " File content of " << fileName << " ill-formated." 
-                   << G4endl;
+	G4cout << "G4ExtDEDXTable::RetrievePhysicsTable() " 
+	       << " File content of " << fileName << " ill-formated." 
+	       << G4endl;
 #endif          
-            ifilestream.close(); 
-            return false; 
-         }
-
-         size_t pos = line.find_first_of("#");
-         line = line.substr(0, pos);
+	ifilestream.close(); 
+	return false; 
       }
 
-      std::istringstream headerstream( line );     
-
-      G4int atomicNumberIon;
-      headerstream >> atomicNumberIon;
-
-      G4String materialName;
-      headerstream >> materialName;
-
-      if( headerstream.fail() ) {
+      std::string::size_type pos = line.find_first_of("#");
+      if(pos != std::string::npos && pos > 0) {
+	line = line.substr(0, pos);
+      }
+    }
+
+    std::istringstream headerstream( line );     
+
+    std::string::size_type atomicNumberIon;
+    headerstream >> atomicNumberIon;
+
+    G4String materialName;
+    headerstream >> materialName;
+
+    if( headerstream.fail() || std::string::npos == atomicNumberIon) {
  
 #ifdef G4VERBOSE  
-         G4cerr << "G4ExtDEDXTable::RetrievePhysicsTable() " 
-                << " File content of " << fileName << " ill-formated "
-                << " (vector header)." 
-                << G4endl;
+      G4cout << "G4ExtDEDXTable::RetrievePhysicsTable() " 
+	     << " File content of " << fileName << " ill-formated "
+	     << " (vector header)." 
+	     << G4endl;
 #endif          
-         ifilestream.close();
-         return false;
-      } 
-
-      G4int atomicNumberMat;
-      headerstream >> atomicNumberMat;
-
-      if( headerstream.eof() ) atomicNumberMat = 0; 
-
-      G4int vectorType;
-
-      ifilestream >>  vectorType;
+      ifilestream.close();
+      return false;
+    } 
+
+    std::string::size_type atomicNumberMat;
+    headerstream >> atomicNumberMat;
+
+    if( headerstream.eof() || std::string::npos == atomicNumberMat) { 
+      atomicNumberMat = 0; 
+    }
+
+    G4int vectorType;
+    ifilestream >> vectorType;
       
-      G4PhysicsVector* physicsVector = CreatePhysicsVector(vectorType);
-
-      if(physicsVector == 0) {
-
+    G4PhysicsVector* physicsVector = CreatePhysicsVector(vectorType);
+
+    if(physicsVector == 0) {
 #ifdef G4VERBOSE  
-         G4cerr << "G4ExtDEDXTable::RetrievePhysicsTable  "
-                << " illegal physics Vector type " << vectorType
-                << " in  " << fileName 
-                << G4endl;
+      G4cout << "G4ExtDEDXTable::RetrievePhysicsTable  "
+	     << " illegal physics Vector type " << vectorType
+	     << " in  " << fileName 
+	     << G4endl;
 #endif          
-         ifilestream.close();
-         return false;
-      }
-
-      if( !physicsVector -> Retrieve(ifilestream, true) ) {
- 
+      ifilestream.close();
+      return false;
+    }
+
+    if( !physicsVector -> Retrieve(ifilestream, true) ) {
+	
 #ifdef G4VERBOSE  
-         G4cerr << "G4ExtDEDXTable::RetrievePhysicsTable() " 
-                << " File content of " << fileName << " ill-formated." 
-                << G4endl;
+      G4cout << "G4ExtDEDXTable::RetrievePhysicsTable() " 
+	     << " File content of " << fileName << " ill-formated." 
+	     << G4endl;
 #endif          
-         ifilestream.close();
-         return false;
-      } 
-
-      physicsVector -> SetSpline(true);
-
-      // Retrieved vector is added to material store
-      if( !AddPhysicsVector(physicsVector, atomicNumberIon, 
-			    materialName, atomicNumberMat) ) {
-
-  	 delete physicsVector;
-         ifilestream.close();
-         return false;
-      }
+      ifilestream.close();
+      return false;
+    } 
+
+    physicsVector -> SetSpline(true);
+
+    // Retrieved vector is added to material store
+    if( !AddPhysicsVector(physicsVector, (G4int)atomicNumberIon, 
+			  materialName, (G4int)atomicNumberMat) ) {
+
+      delete physicsVector;
+      ifilestream.close();
+      return false;
+    }
   }
 
Index: trunk/source/materials/src/G4IonStoppingData.cc
===================================================================
--- trunk/source/materials/src/G4IonStoppingData.cc	(revision 1337)
+++ trunk/source/materials/src/G4IonStoppingData.cc	(revision 1347)
@@ -24,4 +24,6 @@
 // ********************************************************************
 //
+// $Id: G4IonStoppingData.cc,v 1.3 2010/10/25 08:41:39 vnivanch Exp $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // ===========================================================================
@@ -37,4 +39,5 @@
 //
 // Modifications:
+// 25.10.2010 V.Ivanchenko fixed warnings reported by the Coverity tool
 //
 //
@@ -378,5 +381,8 @@
 
   char* path = getenv("G4LEDATA");
-  if ( !path ) G4Exception("G4LEDATA environment variable not set");
+  if ( !path ) {
+    G4Exception("G4IonStoppingData::BuildPhysicsVector: G4LEDATA environment variable not set");
+    return false;
+  }
   
   std::ostringstream file;
@@ -425,6 +431,8 @@
 
   char* path = getenv("G4LEDATA");
-  if ( !path ) G4Exception("G4LEDATA environment variable not set");
-  
+  if ( !path ) {
+    G4Exception("G4IonStoppingData::BuildPhysicsVector: G4LEDATA environment variable not set");
+    return false;
+  }
   std::ostringstream file;
  
Index: trunk/source/materials/test/G4MaterialsTest.cc
===================================================================
--- trunk/source/materials/test/G4MaterialsTest.cc	(revision 1337)
+++ trunk/source/materials/test/G4MaterialsTest.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4MaterialsTest.cc,v 1.9 2006/06/29 19:13:14 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/G4SandiaTableTest.cc
===================================================================
--- trunk/source/materials/test/G4SandiaTableTest.cc	(revision 1337)
+++ trunk/source/materials/test/G4SandiaTableTest.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: G4SandiaTableTest.cc,v 1.9 2006/06/29 19:13:17 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/NistMaterialTest1.cc
===================================================================
--- trunk/source/materials/test/NistMaterialTest1.cc	(revision 1337)
+++ trunk/source/materials/test/NistMaterialTest1.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: NistMaterialTest1.cc,v 1.3 2006/06/29 19:13:19 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/NistMaterialTest2.cc
===================================================================
--- trunk/source/materials/test/NistMaterialTest2.cc	(revision 1337)
+++ trunk/source/materials/test/NistMaterialTest2.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: NistMaterialTest2.cc,v 1.3 2006/06/29 19:13:21 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/nistComparison.cc
===================================================================
--- trunk/source/materials/test/nistComparison.cc	(revision 1337)
+++ trunk/source/materials/test/nistComparison.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: nistComparison.cc,v 1.2 2006/06/29 19:13:23 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/testAdditionOf_MPT_toMaterial.cc
===================================================================
--- trunk/source/materials/test/testAdditionOf_MPT_toMaterial.cc	(revision 1337)
+++ trunk/source/materials/test/testAdditionOf_MPT_toMaterial.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testAdditionOf_MPT_toMaterial.cc,v 1.6 2006/06/29 19:13:25 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/testG4AtomicShells.cc
===================================================================
--- trunk/source/materials/test/testG4AtomicShells.cc	(revision 1337)
+++ trunk/source/materials/test/testG4AtomicShells.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testG4AtomicShells.cc,v 1.7 2009/09/18 07:47:07 grichine Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
Index: trunk/source/materials/test/testMPVEntry.cc
===================================================================
--- trunk/source/materials/test/testMPVEntry.cc	(revision 1337)
+++ trunk/source/materials/test/testMPVEntry.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testMPVEntry.cc,v 1.5 2006/06/29 19:13:31 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/testMaterialPropertiesTable.cc
===================================================================
--- trunk/source/materials/test/testMaterialPropertiesTable.cc	(revision 1337)
+++ trunk/source/materials/test/testMaterialPropertiesTable.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testMaterialPropertiesTable.cc,v 1.4 2006/06/29 19:13:33 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/testMaterialPropertyVector.cc
===================================================================
--- trunk/source/materials/test/testMaterialPropertyVector.cc	(revision 1337)
+++ trunk/source/materials/test/testMaterialPropertyVector.cc	(revision 1347)
@@ -26,5 +26,5 @@
 //
 // $Id: testMaterialPropertyVector.cc,v 1.6 2006/06/29 19:13:36 gunter Exp $
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 // 
Index: trunk/source/materials/test/testStoppingPower.cc
===================================================================
--- trunk/source/materials/test/testStoppingPower.cc	(revision 1337)
+++ trunk/source/materials/test/testStoppingPower.cc	(revision 1347)
@@ -25,5 +25,5 @@
 //
 //
-// GEANT4 tag $Name: geant4-09-04-beta-cand-01 $
+// GEANT4 tag $Name: geant4-09-04-ref-00 $
 //
 //
