65 subDir( leDirectory ) {
79 G4int atomicNumberIon,
80 G4int atomicNumberElem
93 G4int atomicNumberIon,
107 G4int atomicNumberIon,
108 G4int atomicNumberElem
121 G4int atomicNumberIon,
136 G4int atomicNumberIon,
137 G4int atomicNumberElem
145 (iter->second)->Value( kinEnergyPerNucleon) : 0.0;
152 G4int atomicNumberIon,
161 (iter->second)->Value(kinEnergyPerNucleon) : 0.0;
168 G4int atomicNumberIon,
172 if(physicsVector ==
nullptr) {
173 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for material",
175 "Pointer to vector is null-pointer.");
179 if(matIdentifier.empty()) {
180 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for material",
185 if(atomicNumberIon <= 0) {
186 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for material",
195 ed <<
"Vector with Z1 = " << atomicNumberIon <<
", mat = "
197 <<
"already exists. Remove first before replacing.";
198 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for material",
212 G4int atomicNumberIon,
213 G4int atomicNumberElem
216 if(physicsVector ==
nullptr) {
217 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for element",
"mat037",
222 if(atomicNumberIon <= 0) {
223 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for element",
"mat038",
228 if(atomicNumberElem <= 0) {
229 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for element",
"mat039",
238 ed <<
"Vector with Z1 = " << atomicNumberIon <<
", Z= "
240 <<
"already exists. Remove first before replacing.";
241 G4Exception (
"G4IonStoppingData::AddPhysicsVector() for element",
"mat040",
254 G4int atomicNumberIon,
263 G4Exception (
"G4IonStoppingData::RemovePhysicsVector() for material",
274 delete physicsVector;
282 G4int atomicNumberIon,
283 G4int atomicNumberElem
290 G4Exception (
"G4IonStoppingData::RemovePhysicsVector() for element",
301 delete physicsVector;
309 G4int atomicNumberIon,
313 if(
IsApplicable(atomicNumberIon, matIdentifier) )
return true;
315 char* path = getenv(
"G4LEDATA");
317 G4Exception(
"G4IonStoppingData::BuildPhysicsVector()",
"mat521",
322 std::ostringstream file;
324 file << path <<
"/" <<
subDir <<
"/z"
325 << atomicNumberIon <<
"_" << matIdentifier
330 std::ifstream ifilestream( fileName );
332 if ( !ifilestream.is_open() )
return false;
336 if( !physicsVector -> Retrieve(ifilestream,
true) ) {
342 physicsVector -> ScaleVector(
MeV,
MeV *
cm2 /( 0.001 *
g) );
343 physicsVector -> SetSpline(
true );
344 physicsVector -> FillSecondDerivatives();
348 delete physicsVector;
360 G4int atomicNumberIon,
361 G4int atomicNumberElem
364 if(
IsApplicable(atomicNumberIon, atomicNumberElem) )
return true;
366 char* path = getenv(
"G4LEDATA");
368 G4Exception(
"G4IonStoppingData::BuildPhysicsVector()",
"mat522",
372 std::ostringstream file;
374 file << path <<
"/" <<
subDir <<
"/z"
375 << atomicNumberIon <<
"_" << atomicNumberElem
380 std::ifstream ifilestream( fileName );
382 if ( !ifilestream.is_open() )
return false;
386 if( !physicsVector -> Retrieve(ifilestream,
true) ) {
392 physicsVector -> ScaleVector(
MeV,
MeV *
cm2 /( 0.001 *
g) );
393 physicsVector -> SetSpline(
true );
394 physicsVector -> FillSecondDerivatives();
398 delete physicsVector;
414 for(;iterMat != iterMat_end; iterMat++) {
418 if(vec != 0)
delete vec;
426 for(;iterElem != iterElem_end; iterElem++) {
430 if(vec != 0)
delete vec;
449 for(;iterMat != iterMat_end; iterMat++) {
453 G4int atomicNumberIon = key.first;
454 G4String matIdentifier = key.second;
456 if(physicsVector != 0) {
471 <<
"Atomic nmb material"
474 for(;iterElem != iterElem_end; iterElem++) {
478 G4int atomicNumberIon = key.first;
479 G4int atomicNumberElem = key.second;
481 if(physicsVector != 0) {
G4bool BuildPhysicsVector(G4int ionZ, const G4String &matName)
std::ostringstream G4ExceptionDescription
static constexpr double cm2
G4IonDEDXMapMat dedxMapMaterials
static constexpr double second
static constexpr double g
G4bool AddPhysicsVector(G4PhysicsVector *physicsVector, G4int atomicNumberIon, const G4String &matIdentifier)
G4GLOB_DLL std::ostream G4cout
G4IonStoppingData(const G4String &leDirectory)
G4IonDEDXMapElem dedxMapElements
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)
static constexpr double MeV
std::pair< G4int, G4int > G4IonDEDXKeyElem
G4PhysicsVector * GetPhysicsVector(G4int atomicNumberIon, G4int atomicNumberElem)
std::pair< G4int, G4String > G4IonDEDXKeyMat