66 #ifdef G4MULTITHREADED
76 G4cout <<
"G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
98 outFile <<
"G4NeutronElasticXS calculates the neutron elastic scattering\n"
99 <<
"cross section on nuclei using data from the high precision\n"
100 <<
"neutron database. These data are simplified and smoothed over\n"
101 <<
"the resonance region in order to reduce CPU time.\n"
102 <<
"For high energies Glauber-Gribiv cross section is used.\n";
126 if(!pv) {
return xs; }
128 if(ekin <= pv->Energy(0)) {
return (*pv)[0]; }
130 if(ekin <= pv->GetMaxEnergy()) {
131 xs = pv->
Value(ekin);
154 G4cout <<
"G4NeutronElasticXS::BuildPhysicsTable for "
160 <<
" only neutron is allowed";
161 G4Exception(
"G4NeutronElasticXS::BuildPhysicsTable(..)",
"had012",
167 #ifdef G4MULTITHREADED
172 #ifdef G4MULTITHREADED
183 char* path = getenv(
"G4NEUTRONXSDATA");
191 for(
size_t i=0; i<numOfElm; ++i) {
192 G4int Z = ((*theElmTable)[i])->GetZasInt();
206 if(
data[Z]) {
return; }
207 const char* path =
p;
211 path = getenv(
"G4NEUTRONXSDATA");
213 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had013",
215 "Environment variable G4NEUTRONXSDATA is not defined");
223 std::ostringstream ost;
224 ost << path <<
"/neutron/el" <<
Z ;
225 std::ifstream filein(ost.str().c_str());
228 ed <<
"Data file <" << ost.str().c_str()
229 <<
"> is not opened!";
230 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had014",
235 G4cout <<
"file " << ost.str()
236 <<
" is opened by G4NeutronElasticXS" <<
G4endl;
240 if(!
data[Z]->Retrieve(filein,
true)) {
242 ed <<
"Data file <" << ost.str().c_str()
243 <<
"> is not retrieved!";
244 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had015",
262 if(sig2 > 0.) {
coeff[
Z] = sig1/sig2; }
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
G4double GetElasticGlauberGribovXsc()
CLHEP::Hep3Vector G4ThreeVector
std::ostringstream G4ExceptionDescription
virtual ~G4NeutronElasticXS()
void SetKineticEnergy(G4double aEnergy)
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *)
static G4PhysicsVector * data[MAXZEL]
G4HadronNucleonXsc * fNucleon
const G4String & GetParticleName() const
G4double Value(G4double theEnergy, size_t &lastidx) const
G4double GetElasticHadronNucleonXsc()
const G4ParticleDefinition * proton
const XML_Char const XML_Char * data
#define G4MUTEX_INITIALIZER
G4double GetHadronNucleonXscPDG(const G4DynamicParticle *, const G4ParticleDefinition *)
G4ComponentGGHadronNucleusXsc * ggXsection
std::vector< G4Element * > G4ElementTable
static constexpr double MeV
virtual void CrossSectionDescription(std::ostream &) const
#define G4_DECLARE_XS_FACTORY(cross_section)
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
#define G4MUTEXUNLOCK(mutex)
void Initialise(G4int Z, G4DynamicParticle *dp, const char *)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
static G4Neutron * Neutron()
static G4double coeff[MAXZEL]
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
#define G4MUTEXLOCK(mutex)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
static constexpr double barn
static G4NistManager * Instance()
static G4ElementTable * GetElementTable()