64 G4cout <<
"G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
86 outFile <<
"G4NeutronElasticXS calculates the neutron elastic scattering\n"
87 <<
"cross section on nuclei using data from the high precision\n"
88 <<
"neutron database. These data are simplified and smoothed over\n"
89 <<
"the resonance region in order to reduce CPU time.\n"
90 <<
"G4NeutronElasticXS is valid for energies up to 20 MeV, for all\n"
91 <<
"targets through U.\n";
108 if(Z < 1 || Z >
maxZ) {
return xs; }
119 if(!pv) {
return xs; }
123 if(ekin <= e1) {
return (*pv)[0]; }
129 xs = pv->
Value(ekin);
139 G4cout <<
"ekin= " << ekin <<
", XSinel= " << xs <<
G4endl;
149 G4cout <<
"G4NeutronElasticXS::BuildPhysicsTable for "
155 <<
" only neutron is allowed";
156 G4Exception(
"G4NeutronElasticXS::BuildPhysicsTable(..)",
"had012",
164 char* path = getenv(
"G4NEUTRONXSDATA");
173 for(
size_t i=0; i<numOfElm; ++i) {
189 if(
data[Z]) {
return; }
190 const char* path = p;
194 path = getenv(
"G4NEUTRONXSDATA");
196 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had013",
198 "Environment variable G4NEUTRONXSDATA is not defined");
213 std::ostringstream ost;
214 ost << path <<
"/elast" << Z ;
215 std::ifstream filein(ost.str().c_str());
218 ed <<
"Data file <" << ost.str().c_str()
219 <<
"> is not opened!";
220 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had014",
225 G4cout <<
"file " << ost.str()
226 <<
" is opened by G4NeutronElasticXS" <<
G4endl;
230 if(!
data[Z]->Retrieve(filein,
true)) {
232 ed <<
"Data file <" << ost.str().c_str()
233 <<
"> is not retrieved!";
234 G4Exception(
"G4NeutronElasticXS::Initialise(..)",
"had015",
240 size_t n =
data[Z]->GetVectorLength() - 1;
252 if(sig2 > 0.) {
coeff[Z] = sig1/sig2; }
254 if(!dp) {
delete dynParticle; }
G4double GetElasticHadronNucleonXsc()
G4double GetElasticGlauberGribovXsc()
const G4ParticleDefinition * proton
G4HadronNucleonXsc * fNucleon
std::ostringstream G4ExceptionDescription
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
size_t GetVectorLength() const
std::vector< G4PhysicsVector * > data
static G4NistManager * Instance()
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
static G4Neutron * Neutron()
G4double Energy(size_t index) const
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetKineticEnergy(G4double aEnergy)
std::vector< G4double > coeff
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual ~G4NeutronElasticXS()
G4GlauberGribovCrossSection * ggXsection
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
G4double GetHadronNucleonXscPDG(const G4DynamicParticle *, const G4ParticleDefinition *)
virtual void CrossSectionDescription(std::ostream &) const
std::vector< G4Element * > G4ElementTable
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *)
static G4ElementTable * GetElementTable()
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
void Initialise(G4int Z, G4DynamicParticle *dp=0, const char *=0)