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; }