Changeset 1347 for trunk/source/materials
- Timestamp:
- Dec 22, 2010, 3:52:27 PM (14 years ago)
- Location:
- trunk/source/materials
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/materials/History
r1315 r1347 1 $Id: History,v 1.1 82 2010/05/20 13:08:22vnivanch Exp $1 $Id: History,v 1.190 2010/11/23 17:35:54 vnivanch Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 23-11-10 V.Ivanchenko (materials-V09-03-14) 21 - G4SandiaTable - V.Grichine Bug fix in G4_Ar 22 23 12-11-10 V.Ivanchenko (materials-V09-03-13) 24 12-11-10 V.Grichine Bug fix in G4SandiaTable::SandiaMixing adding 25 fVerbose and pedantic variable initialisation 26 27 05-11-10 V.Ivanchenko (materials-V09-03-12) 28 - Removed obsolete unused data classes G4IronStoppingICRU73, 29 G4MaterialStoppingICRU73, G4SimpleMaterialStoppingICRU73, 30 data are uploaded from G4LEDATA 31 32 04-11-10 V.Ivanchenko (materials-V09-03-11) 33 - G4NistMaterialBuilder - added few DNA materials 34 35 01-11-10 V.Ivanchenko (materials-V09-03-10) 36 - G4NistManager - use G4Pow for fast computations 37 - Fixed problems highlighted by the Coverity tool 38 39 26-10-10 V.Ivanchenko (materials-V09-03-09) 40 - G4NistMaterialBuilder - added BioChemicalMaterials and corresponding 41 access methods 42 43 25-10-10 V.Ivanchenko (materials-V09-03-08) 44 - Fixed problems highlighted by the Coverity tool, mainly proper 45 initialisation 19 46 20 47 20-05-10 V.Ivanchenko (materials-V09-03-07) -
trunk/source/materials/include/G4ExtDEDXTable.hh
r1196 r1347 24 24 // ******************************************************************** 25 25 // 26 // 26 // $Id: G4ExtDEDXTable.hh,v 1.3 2010/10/25 08:35:26 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 27 28 // 28 29 // =========================================================================== -
trunk/source/materials/include/G4IonStoppingData.hh
r1197 r1347 24 24 // ******************************************************************** 25 25 // 26 // 26 // $Id: G4IonStoppingData.hh,v 1.2 2010/10/25 08:41:39 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 27 28 // 28 29 // =========================================================================== -
trunk/source/materials/src/G4ExtDEDXTable.cc
r1196 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4ExtDEDXTable.cc,v 1.4 2010/11/01 18:18:57 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 26 28 // 27 29 // =========================================================================== … … 39 41 // 03.11.2009 A. Lechner: Added new methods BuildPhysicsVector according 40 42 // to interface changes in base class G4VIonDEDXTable. 43 // 25.10.2010 V.Ivanchenko fixed bug in usage of iterators reported by the 44 // Coverity tool 45 // 01.11.2010 V.Ivanchenko fixed remaining bugs reported by Coverity 41 46 // 42 47 // … … 220 225 221 226 #ifdef G4VERBOSE 222 G4c err<< "G4IonDEDXTable::AddPhysicsVector() Error: Pointer to vector"227 G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: Pointer to vector" 223 228 << " is null-pointer." 224 229 << G4endl; … … 231 236 232 237 #ifdef G4VERBOSE 233 G4c err<< "G4IonDEDXTable::AddPhysicsVector() Error: "238 G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: " 234 239 << "Cannot add physics vector. Invalid name." 235 240 << G4endl; … … 242 247 243 248 #ifdef G4VERBOSE 244 G4c err<< "G4IonDEDXTable::AddPhysicsVector() Error: "249 G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: " 245 250 << "Cannot add physics vector. Illegal atomic number." 246 251 << G4endl; … … 257 262 258 263 #ifdef G4VERBOSE 259 G4c err<< "G4IonDEDXTable::AddPhysicsVector() Error: "264 G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: " 260 265 << "Vector already exists. Remove first before replacing." 261 266 << G4endl; … … 272 277 273 278 #ifdef G4VERBOSE 274 G4c err<< "G4IonDEDXTable::AddPhysicsVector() Error: "279 G4cout << "G4IonDEDXTable::AddPhysicsVector() Error: " 275 280 << "Vector already exists. Remove first before replacing." 276 281 << G4endl; … … 302 307 303 308 #ifdef G4VERBOSE 304 G4c err<< "G4IonDEDXTable::RemovePhysicsVector() Warning: "305 306 307 #endif 308 309 309 G4cout << "G4IonDEDXTable::RemovePhysicsVector() Warning: " 310 << "Cannot remove physics vector. Vector not found." 311 << G4endl; 312 #endif 313 314 return false; 310 315 } 311 316 … … 314 319 315 320 // Deleting key of physics vector from elemental material map (if it exists) 316 G4IonDEDXMapElem::iterator iter_beg = dedxMapElements.begin(); 317 G4IonDEDXMapElem::iterator iter_end = dedxMapElements.end(); 321 G4IonDEDXMapElem::iterator it; 318 322 319 for( ;iter_beg != iter_end; iter_beg++) {320 321 if( (*it er_beg).second == physicsVector ) {322 323 dedxMapElements.erase(iter_beg);323 for(it=dedxMapElements.begin(); it!=dedxMapElements.end(); ++it) { 324 325 if( (*it).second == physicsVector ) { 326 dedxMapElements.erase(it); 327 break; 324 328 } 325 329 } … … 345 349 346 350 #ifdef G4VERBOSE 347 G4c err<< "G4ExtDEDXTable::StorePhysicsVector() "351 G4cout << "G4ExtDEDXTable::StorePhysicsVector() " 348 352 << " Cannot open file "<< fileName 349 353 << G4endl; … … 388 392 389 393 #ifdef G4VERBOSE 390 G4c err<< "G4ExtDEDXTable::StorePhysicsVector() "394 G4cout << "G4ExtDEDXTable::StorePhysicsVector() " 391 395 << " Cannot store physics vector." 392 396 << G4endl; … … 409 413 410 414 std::ifstream ifilestream; 411 412 415 ifilestream.open( fileName, std::ios::in ); 413 414 if( !ifilestream ) { 415 416 #ifdef G4VERBOSE 417 G4cerr << "G4ExtDEDXTable::RetrievePhysicsVector() " 418 << " Cannot open file "<< fileName 419 << G4endl; 420 #endif 421 422 return false; 416 if( ! ifilestream ) { 417 #ifdef G4VERBOSE 418 G4cout << "G4ExtDEDXTable::RetrievePhysicsVector() " 419 << " Cannot open file "<< fileName 420 << G4endl; 421 #endif 422 return false; 423 423 } 424 424 425 G4int nmbVectors; 426 425 std::string::size_type nmbVectors = 0; 427 426 ifilestream >> nmbVectors; 428 429 for(G4int i = 0; i < nmbVectors; i++) { 430 431 G4String line = ""; 432 433 while( line.empty() ) { 434 435 getline( ifilestream, line ); 436 437 if( ifilestream.fail() ) { 438 427 428 if(nmbVectors == std::string::npos || nmbVectors == 0) { 429 #ifdef G4VERBOSE 430 G4cout << "G4ExtDEDXTable::RetrievePhysicsVector() " 431 << " The file is empty "<< nmbVectors 432 << G4endl; 433 #endif 434 return false; 435 } 436 for(size_t i = 0; i<nmbVectors; ++i) { 437 438 G4String line = ""; 439 while( line.empty() ) { 440 441 getline( ifilestream, line ); 442 if( ifilestream.fail() ) { 439 443 #ifdef G4VERBOSE 440 G4cerr<< "G4ExtDEDXTable::RetrievePhysicsTable() "441 442 444 G4cout << "G4ExtDEDXTable::RetrievePhysicsTable() " 445 << " File content of " << fileName << " ill-formated." 446 << G4endl; 443 447 #endif 444 ifilestream.close(); 445 return false; 446 } 447 448 size_t pos = line.find_first_of("#"); 449 line = line.substr(0, pos); 448 ifilestream.close(); 449 return false; 450 450 } 451 451 452 std::istringstream headerstream( line ); 453 454 G4int atomicNumberIon; 455 headerstream >> atomicNumberIon; 456 457 G4String materialName; 458 headerstream >> materialName; 459 460 if( headerstream.fail() ) { 452 std::string::size_type pos = line.find_first_of("#"); 453 if(pos != std::string::npos && pos > 0) { 454 line = line.substr(0, pos); 455 } 456 } 457 458 std::istringstream headerstream( line ); 459 460 std::string::size_type atomicNumberIon; 461 headerstream >> atomicNumberIon; 462 463 G4String materialName; 464 headerstream >> materialName; 465 466 if( headerstream.fail() || std::string::npos == atomicNumberIon) { 461 467 462 468 #ifdef G4VERBOSE 463 G4cerr<< "G4ExtDEDXTable::RetrievePhysicsTable() "464 465 466 469 G4cout << "G4ExtDEDXTable::RetrievePhysicsTable() " 470 << " File content of " << fileName << " ill-formated " 471 << " (vector header)." 472 << G4endl; 467 473 #endif 468 ifilestream.close(); 469 return false; 470 } 471 472 G4int atomicNumberMat; 473 headerstream >> atomicNumberMat; 474 475 if( headerstream.eof() ) atomicNumberMat = 0; 476 477 G4int vectorType; 478 479 ifilestream >> vectorType; 474 ifilestream.close(); 475 return false; 476 } 477 478 std::string::size_type atomicNumberMat; 479 headerstream >> atomicNumberMat; 480 481 if( headerstream.eof() || std::string::npos == atomicNumberMat) { 482 atomicNumberMat = 0; 483 } 484 485 G4int vectorType; 486 ifilestream >> vectorType; 480 487 481 G4PhysicsVector* physicsVector = CreatePhysicsVector(vectorType); 482 483 if(physicsVector == 0) { 484 488 G4PhysicsVector* physicsVector = CreatePhysicsVector(vectorType); 489 490 if(physicsVector == 0) { 485 491 #ifdef G4VERBOSE 486 G4cerr<< "G4ExtDEDXTable::RetrievePhysicsTable "487 488 489 492 G4cout << "G4ExtDEDXTable::RetrievePhysicsTable " 493 << " illegal physics Vector type " << vectorType 494 << " in " << fileName 495 << G4endl; 490 496 #endif 491 492 493 494 495 496 497 ifilestream.close(); 498 return false; 499 } 500 501 if( !physicsVector -> Retrieve(ifilestream, true) ) { 502 497 503 #ifdef G4VERBOSE 498 G4cerr<< "G4ExtDEDXTable::RetrievePhysicsTable() "499 500 504 G4cout << "G4ExtDEDXTable::RetrievePhysicsTable() " 505 << " File content of " << fileName << " ill-formated." 506 << G4endl; 501 507 #endif 502 503 504 505 506 507 508 509 if( !AddPhysicsVector(physicsVector,atomicNumberIon,510 materialName,atomicNumberMat) ) {511 512 513 514 515 508 ifilestream.close(); 509 return false; 510 } 511 512 physicsVector -> SetSpline(true); 513 514 // Retrieved vector is added to material store 515 if( !AddPhysicsVector(physicsVector, (G4int)atomicNumberIon, 516 materialName, (G4int)atomicNumberMat) ) { 517 518 delete physicsVector; 519 ifilestream.close(); 520 return false; 521 } 516 522 } 517 523 -
trunk/source/materials/src/G4IonStoppingData.cc
r1197 r1347 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4IonStoppingData.cc,v 1.3 2010/10/25 08:41:39 vnivanch Exp $ 27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 26 28 // 27 29 // =========================================================================== … … 37 39 // 38 40 // Modifications: 41 // 25.10.2010 V.Ivanchenko fixed warnings reported by the Coverity tool 39 42 // 40 43 // … … 378 381 379 382 char* path = getenv("G4LEDATA"); 380 if ( !path ) G4Exception("G4LEDATA environment variable not set"); 383 if ( !path ) { 384 G4Exception("G4IonStoppingData::BuildPhysicsVector: G4LEDATA environment variable not set"); 385 return false; 386 } 381 387 382 388 std::ostringstream file; … … 425 431 426 432 char* path = getenv("G4LEDATA"); 427 if ( !path ) G4Exception("G4LEDATA environment variable not set"); 428 433 if ( !path ) { 434 G4Exception("G4IonStoppingData::BuildPhysicsVector: G4LEDATA environment variable not set"); 435 return false; 436 } 429 437 std::ostringstream file; 430 438 -
trunk/source/materials/test/G4MaterialsTest.cc
r1315 r1347 26 26 // 27 27 // $Id: G4MaterialsTest.cc,v 1.9 2006/06/29 19:13:14 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/G4SandiaTableTest.cc
r1315 r1347 26 26 // 27 27 // $Id: G4SandiaTableTest.cc,v 1.9 2006/06/29 19:13:17 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/NistMaterialTest1.cc
r1315 r1347 26 26 // 27 27 // $Id: NistMaterialTest1.cc,v 1.3 2006/06/29 19:13:19 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/NistMaterialTest2.cc
r1315 r1347 26 26 // 27 27 // $Id: NistMaterialTest2.cc,v 1.3 2006/06/29 19:13:21 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/nistComparison.cc
r1315 r1347 26 26 // 27 27 // $Id: nistComparison.cc,v 1.2 2006/06/29 19:13:23 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/testAdditionOf_MPT_toMaterial.cc
r1315 r1347 26 26 // 27 27 // $Id: testAdditionOf_MPT_toMaterial.cc,v 1.6 2006/06/29 19:13:25 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/testG4AtomicShells.cc
r1315 r1347 26 26 // 27 27 // $Id: testG4AtomicShells.cc,v 1.7 2009/09/18 07:47:07 grichine Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/testMPVEntry.cc
r1315 r1347 26 26 // 27 27 // $Id: testMPVEntry.cc,v 1.5 2006/06/29 19:13:31 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/testMaterialPropertiesTable.cc
r1315 r1347 26 26 // 27 27 // $Id: testMaterialPropertiesTable.cc,v 1.4 2006/06/29 19:13:33 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/testMaterialPropertyVector.cc
r1315 r1347 26 26 // 27 27 // $Id: testMaterialPropertyVector.cc,v 1.6 2006/06/29 19:13:36 gunter Exp $ 28 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 29 // 30 30 // -
trunk/source/materials/test/testStoppingPower.cc
r1315 r1347 25 25 // 26 26 // 27 // GEANT4 tag $Name: geant4-09-04- beta-cand-01$27 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 28 28 // 29 29 //
Note: See TracChangeset
for help on using the changeset viewer.