65 G4cout <<
"G4NeutronElasticXS::G4NeutronElasticXS Initialise for Z < "
68 data.resize(maxZ+1, 0);
69 coeff.resize(maxZ+1, 1.0);
72 isInitialized =
false;
78 for(
G4int i=0; i<=maxZ; ++i) {
85 outFile <<
"G4NeutronElasticXS calculates the neutron elastic scattering\n"
86 <<
"cross section on nuclei using data from the high precision\n"
87 <<
"neutron database. These data are simplified and smoothed over\n"
88 <<
"the resonance region in order to reduce CPU time.\n"
89 <<
"G4NeutronElasticXS is valid for energies up to 20 MeV, for all\n"
90 <<
"targets through U.\n";
107 if(Z < 1 || Z > maxZ) {
return xs; }
117 if(!pv) {
return xs; }
121 if(ekin <= e1) {
return (*pv)[0]; }
127 xs = pv->
Value(ekin);
137 G4cout <<
"ekin= " << ekin <<
", XSinel= " << xs <<
G4endl;
145 if(isInitialized) {
return; }
147 G4cout <<
"G4NeutronElasticXS::BuildPhysicsTable for "
154 isInitialized =
true;
158 char* path = getenv(
"G4NEUTRONXSDATA");
161 "G4NEUTRONXSDATA environment variable not defined");
172 for(
size_t i=0; i<numOfElm; ++i) {
175 else if(Z > maxZ) { Z = maxZ; }
178 if(!data[Z]) { Initialise(Z, dynParticle, path); }
188 if(data[Z]) {
return; }
189 const char* path = p;
193 path = getenv(
"G4NEUTRONXSDATA");
196 "G4NEUTRONXSDATA environment variable not defined");
211 std::ostringstream ost;
212 ost << path <<
"/elast" << Z ;
213 std::ifstream filein(ost.str().c_str());
216 <<
" is not opened by G4NeutronElasticXS" <<
G4endl;
221 G4cout <<
"file " << ost.str()
222 <<
" is opened by G4NeutronElasticXS" <<
G4endl;
226 data[Z]->Retrieve(filein,
true);
229 size_t n = data[Z]->GetVectorLength() - 1;
241 if(sig2 > 0.) { coeff[Z] = sig1/sig2; }
243 if(!dp) {
delete dynParticle; }
std::vector< G4Element * > G4ElementTable
CLHEP::Hep3Vector G4ThreeVector
G4DLLIMPORT std::ostream G4cout
G4double GetKineticEnergy() const
void SetKineticEnergy(G4double aEnergy)
static size_t GetNumberOfElements()
static const G4ElementTable * GetElementTable()
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=0, const G4Element *elm=0, const G4Material *mat=0)
G4double GetElasticGlauberGribovXsc()
G4double GetHadronNucleonXscPDG(const G4DynamicParticle *, const G4ParticleDefinition *)
G4double GetElasticHadronNucleonXsc()
virtual ~G4NeutronElasticXS()
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
virtual void CrossSectionDescription(std::ostream &) const
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *)
static G4Neutron * Neutron()
static G4NistManager * Instance()
const G4String & GetParticleName() const
G4double Value(G4double theEnergy)
size_t GetVectorLength() const
G4double Energy(size_t index) const