68 G4cout <<
"G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
88 outFile <<
"G4NeutronElasticXS calculates the neutron elastic scattering\n"
89 <<
"cross section on nuclei using data from the high precision\n"
90 <<
"neutron database. These data are simplified and smoothed over\n"
91 <<
"the resonance region in order to reduce CPU time.\n"
92 <<
"For high energies Glauber-Gribiv cross section is used.\n";
119 if(pv ==
nullptr) {
return xs; }
123 if(ekin <= pv->Energy(1)) {
125 }
else if(ekin <= pv->GetMaxEnergy()) {
158 if(1 == nIso) {
return iso; }
166 for (j=0; j<nIso; ++j) {
167 sum += abundVector[j];
180 G4cout <<
"G4NeutronElasticXS::BuildPhysicsTable for "
186 <<
" only neutron is allowed";
187 G4Exception(
"G4NeutronElasticXS::BuildPhysicsTable(..)",
"had012",
192#ifdef G4MULTITHREADED
199#ifdef G4MULTITHREADED
210 for (
auto & elm : *table ) {
222 char* path = std::getenv(
"G4PARTICLEXSDATA");
223 if (
nullptr != path) {
224 std::ostringstream ost;
225 ost << path <<
"/neutron/el";
228 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had013",
230 "Environment variable G4PARTICLEXSDATA is not defined");
238#ifdef G4MULTITHREADED
240 if(
data[
Z] ==
nullptr) {
243#ifdef G4MULTITHREADED
251 if(
data[
Z] !=
nullptr) {
return; }
256 std::ostringstream ost;
258 std::ifstream filein(ost.str().c_str());
259 if (!filein.is_open()) {
261 ed <<
"Data file <" << ost.str().c_str()
262 <<
"> is not opened!";
263 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had014",
268 G4cout <<
"file " << ost.str()
269 <<
" is opened by G4NeutronElasticXS" <<
G4endl;
273 if(!
data[
Z]->Retrieve(filein,
true)) {
275 ed <<
"Data file <" << ost.str().c_str()
276 <<
"> is not retrieved!";
277 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had015",
286 coeff[
Z] = (sig2 > 0.) ? sig1/sig2 : 1.0;
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static const G4double aeff[]
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4VComponentCrossSection * GetComponentCrossSection(const G4String &name)
static G4CrossSectionDataSetRegistry * Instance()
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
static G4ElementTable * GetElementTable()
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
void InitialiseOnFly(G4int Z)
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *) final
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) final
G4PhysicsVector * GetPhysicsVector(G4int Z)
void BuildPhysicsTable(const G4ParticleDefinition &) final
~G4NeutronElasticXS() final
const G4String & FindDirectoryPath()
static G4double coeff[MAXZEL]
static G4PhysicsVector * data[MAXZEL]
const G4ParticleDefinition * neutron
static const G4int MAXZEL
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) final
G4VComponentCrossSection * ggXsection
const G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy, G4double logE) final
static G4String gDataDirectory
void CrossSectionDescription(std::ostream &) const final
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *) final
const G4String & GetParticleName() const
G4double GetMaxEnergy() const
std::size_t GetVectorLength() const
G4double GetElasticElementCrossSection(const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
void SetForAllAtomsAndEnergies(G4bool val)
static constexpr double barn
static constexpr double MeV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments