65 subDir( leDirectory ) {
79 G4int atomicNumberIon,
80 G4int atomicNumberElem
82 G4bool isApplicable =
true;
95 G4int atomicNumberIon,
98 G4bool isApplicable =
true;
111 G4int atomicNumberIon,
112 G4int atomicNumberElem
129 G4int atomicNumberIon,
148 G4int atomicNumberIon,
149 G4int atomicNumberElem
161 dedx = physicsVector -> GetValue( kinEnergyPerNucleon, b );
171 G4int atomicNumberIon,
184 dedx = physicsVector -> GetValue( kinEnergyPerNucleon, b );
194 G4int atomicNumberIon,
198 if(physicsVector == 0) {
201 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: Pointer to vector"
202 <<
" is null-pointer."
209 if(matIdentifier.empty()) {
212 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
213 <<
"Cannot add physics vector. Invalid name."
220 if(atomicNumberIon <= 0) {
223 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
224 <<
"Cannot add physics vector. Illegal atomic number."
236 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
237 <<
"Vector with Z1 = " << atomicNumberIon <<
", mat = "
239 <<
"already exists. Remove first before replacing."
255 G4int atomicNumberIon,
256 G4int atomicNumberElem
259 if(physicsVector == 0) {
262 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
263 <<
"Pointer to vector is null-pointer."
270 if(atomicNumberIon <= 0) {
273 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
274 <<
"Cannot add physics vector. Illegal atomic number."
281 if(atomicNumberElem <= 0) {
284 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
285 <<
"Atomic number of element < 0."
296 G4cerr <<
"G4IonStoppingData::AddPhysicsVector() Error: "
297 <<
"Vector with Z1 = " << atomicNumberIon <<
", Z2 = "
299 <<
" already exists. Remove first before replacing."
313 G4int atomicNumberIon,
324 G4cerr <<
"G4IonStoppingData::RemovePhysicsVector() Warning: "
325 <<
"Cannot remove physics vector. Vector not found."
338 delete physicsVector;
346 G4int atomicNumberIon,
347 G4int atomicNumberElem
356 G4cerr <<
"G4IonStoppingData::RemovePhysicsVector() Warning: "
357 <<
"Cannot remove physics vector. Vector not found."
370 delete physicsVector;
378 G4int atomicNumberIon,
382 if(
IsApplicable(atomicNumberIon, matIdentifier) )
return true;
384 char* path = getenv(
"G4LEDATA");
386 G4Exception(
"G4IonStoppingData::BuildPhysicsVector()",
"mat521",
391 std::ostringstream file;
393 file << path <<
"/" <<
subDir <<
"/z"
394 << atomicNumberIon <<
"_" << matIdentifier
399 std::ifstream ifilestream( fileName );
401 if ( !ifilestream.is_open() )
return false;
405 if( !physicsVector -> Retrieve(ifilestream,
true) ) {
411 physicsVector -> ScaleVector(
MeV,
MeV *
cm2 /( 0.001 *
g) );
412 physicsVector -> SetSpline(
true );
413 physicsVector -> FillSecondDerivatives();
417 delete physicsVector;
429 G4int atomicNumberIon,
430 G4int atomicNumberElem
433 if(
IsApplicable(atomicNumberIon, atomicNumberElem) )
return true;
435 char* path = getenv(
"G4LEDATA");
437 G4Exception(
"G4IonStoppingData::BuildPhysicsVector()",
"mat522",
441 std::ostringstream file;
443 file << path <<
"/" <<
subDir <<
"/z"
444 << atomicNumberIon <<
"_" << atomicNumberElem
449 std::ifstream ifilestream( fileName );
451 if ( !ifilestream.is_open() )
return false;
455 if( !physicsVector -> Retrieve(ifilestream,
true) ) {
461 physicsVector -> ScaleVector(
MeV,
MeV *
cm2 /( 0.001 *
g) );
462 physicsVector -> SetSpline(
true );
463 physicsVector -> FillSecondDerivatives();
467 delete physicsVector;
483 for(;iterMat != iterMat_end; iterMat++) {
487 if(vec != 0)
delete vec;
495 for(;iterElem != iterElem_end; iterElem++) {
499 if(vec != 0)
delete vec;
518 for(;iterMat != iterMat_end; iterMat++) {
522 G4int atomicNumberIon = key.first;
523 G4String matIdentifier = key.second;
525 if(physicsVector != 0) {
540 <<
"Atomic nmb material"
543 for(;iterElem != iterElem_end; iterElem++) {
547 G4int atomicNumberIon = key.first;
548 G4int atomicNumberElem = key.second;
550 if(physicsVector != 0) {
G4bool BuildPhysicsVector(G4int ionZ, const G4String &matName)
G4IonDEDXMapMat dedxMapMaterials
G4bool AddPhysicsVector(G4PhysicsVector *physicsVector, G4int atomicNumberIon, const G4String &matIdentifier)
G4GLOB_DLL std::ostream G4cout
G4IonStoppingData(const G4String &leDirectory)
G4IonDEDXMapElem dedxMapElements
static const double second
G4bool IsApplicable(G4int atomicNumberIon, G4int atomicNumberElem)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool RemovePhysicsVector(G4int atomicNumberIon, const G4String &matIdentifier)
virtual ~G4IonStoppingData()
G4double GetDEDX(G4double kinEnergyPerNucleon, G4int atomicNumberIon, G4int atomicNumberElem)
std::pair< G4int, G4int > G4IonDEDXKeyElem
G4PhysicsVector * GetPhysicsVector(G4int atomicNumberIon, G4int atomicNumberElem)
std::pair< G4int, G4String > G4IonDEDXKeyMat
G4GLOB_DLL std::ostream G4cerr