103 std::stringstream ss;
117 G4cout <<
"Names::GetName entered for Z = " << Z <<
", A = " <<
A <<
G4endl;
134 std::istringstream* check =
nullptr;
145 *biff = base +
"/CrossSection/" +
itoa(myZ) +
"_" +
itoa(myA) + sM +
"_" + theString[myZ - 1];
155 check =
new std::istringstream(std::ios::in);
165 *biff = base +
"/CrossSection/" +
itoa(myZ) +
"_" +
"nat" +
"_" + theString[myZ - 1];
174 check =
new std::istringstream(std::ios::in);
184 *biff = base +
"/" + rest +
"/" +
itoa(myZ) +
"_" +
"nat" +
"_" + theString[myZ - 1];
185 if (rest ==
"/CrossSection")
186 *biff = base + rest +
"/" +
itoa(myZ) +
"_" +
"nat" +
"_" + theString[myZ - 1];
200 std::istringstream* file =
nullptr;
203 if (rest ==
"/CrossSection") {
204 fileName = base + rest +
"/" +
itoa(myZ) +
"_" +
itoa(myA) + sM +
"_" + theString[myZ - 1];
210 base +
"/" + rest +
"/" +
itoa(myZ) +
"_" +
itoa(myA) + sM +
"_" + theString[myZ - 1];
211 file =
new std::istringstream(std::ios::in);
220 fileName = base +
"/" + rest +
"/" +
itoa(myZ) +
"_" +
"nat" +
"_" + theString[myZ - 1];
223 file =
new std::istringstream(std::ios::in);
233 fileName =
"INVALID";
246 if (delta_Z > theMaxOffSet) {
250 G4cout <<
"G4ParticleHPNames: There are no data available for some isotopes in this "
253 G4cout <<
"G4ParticleHPNames: nor are there data for nearby isotopes." <<
G4endl;
254 G4cout <<
"G4ParticleHPNames: Please make sure G4NEUTRONHPDATA points to the directory "
256 G4cout <<
"G4ParticleHPNames: in which the neutron scattering data are located."
258 G4cout <<
"G4ParticleHPNames: The material was A = " <<
A <<
", Z = " << Z <<
G4endl;
262 ed <<
"Data for Z=" << Z <<
" A=" <<
A <<
" M=" <<
M <<
" does not exist in G4NEUTRONHPDATA";
263 G4Exception(
"G4ParticleHPName::Init(...)",
"hadhp01",
266 check =
new std::istringstream(std::ios::in);
269 if (delta_A > 2 * theMaxOffSet) {
278 myZ = Z + flip_Z * delta_Z;
295 myA =
A + flip_A * delta_A;
305 }
while (myZ == 0 || myA == 0);
307 }
while ((check ==
nullptr) || (!(*check)));
312 G4cout <<
"Names::GetName: last theName proposal = " <<
G4endl;
318 if (Z != result.
GetZ() ||
A != result.
GetA()) {
319 if (rest ==
"/CrossSection") {
322 reac.erase(0, dir.length());
328 G4cout <<
"NeutronHP: " << reac <<
" file for Z = " << Z <<
", A = " <<
A
329 <<
" is not found and CrossSection set to 0." <<
G4endl;
332 G4String new_name = base +
"/" + rest +
"/" +
"0_0_Zero";
338 if ((reac.find(
"Inelastic") != reac.size()
339 && ((Z == 1 &&
A == 1) || (Z == 1 &&
A == 2) || (Z == 1 &&
A == 3)
340 || (Z == 2 &&
A == 3) || (Z == 2 &&
A == 4)))
341 || (reac.find(
"Capture") != reac.size() && ((Z == 1 &&
A == 3) || (Z == 2 &&
A == 4)))
342 || (reac.find(
"Fission") != reac.size()
343 && ((Z == 88 &&
A == 224) || (Z == 88 &&
A == 225) || (Z == 89 &&
A == 225)
344 || (Z == 88 &&
A == 226))))
347 G4String new_name = base +
"/" + rest +
"/" +
"0_0_Zero";
353 G4cout <<
"NeutronHP: " << reac <<
" file for Z = " << Z <<
", A = " <<
A
354 <<
" is not found and NeutronHP will use " << result.
GetName() <<
G4endl;
void SetName(const G4String &aName)
G4bool IsThisNaturalAbundance()
void SetNaturalAbundanceFlag()
void GetDataStream2(const G4String &, std::istringstream &iss)
G4int GetVerboseLevel() const
const G4String & GetNeutronHPPath() const
G4bool GetSkipMissingIsotopes() const
static G4ParticleHPManager * GetInstance()
G4String itoa(G4int current)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)
G4ParticleHPNames(G4int maxOffSet=5)