59 const G4int G4NeutronInelasticXS::amin[] = {0,
60 0, 0, 6, 0,10,12,14,16, 0, 0,
61 0, 0, 0,28, 0, 0, 0,36, 0,40,
62 0, 0, 0, 0, 0,54, 0,58,63,64,
63 0,70, 0, 0, 0, 0, 0, 0, 0,90,
64 0, 0, 0, 0, 0, 0,107,106, 0,112,
65 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
66 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
67 0, 0, 0,180, 0, 0, 0, 0, 0, 0,
68 0,204, 0, 0, 0, 0, 0, 0, 0, 0,
70 const G4int G4NeutronInelasticXS::amax[] = {0,
71 0, 0, 7, 0,11,13,15,18, 0, 0,
72 0, 0, 0,30, 0, 0, 0,40, 0,48,
73 0, 0, 0, 0, 0,58, 0,64,65,70,
74 0,76, 0, 0, 0, 0, 0, 0, 0,96,
75 0, 0, 0, 0, 0, 0,109,116, 0,124,
76 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
77 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
78 0, 0, 0,186, 0, 0, 0, 0, 0, 0,
79 0,208, 0, 0, 0, 0, 0, 0, 0, 0,
88 G4cout <<
"G4NeutronInelasticXS::G4NeutronInelasticXS Initialise for Z < "
91 data.SetName(
"NeutronInelastic");
97 isInitialized =
false;
107 outFile <<
"G4NeutronInelasticXS calculates the neutron inelastic scattering\n"
108 <<
"cross section on nuclei using data from the high precision\n"
109 <<
"neutron database. These data are simplified and smoothed over\n"
110 <<
"the resonance region in order to reduce CPU time.\n"
111 <<
"G4NeutronInelasticXS is valid for energies up to 20 MeV, for\n"
112 <<
"nuclei through U.\n";
137 if(Z < 1 || Z >=
MAXZINEL) {
return xs; }
147 pv =
data.GetElementData(Z);
148 if(!pv) {
return xs; }
152 if(ekin <= e1) {
return xs; }
157 xs = pv->
Value(ekin);
167 G4cout <<
"ekin= " << ekin <<
", XSinel= " << xs <<
G4endl;
180 if(Z > 0 && Z <
MAXZINEL) { xs = IsoCrossSection(ekin, Z, A); }
194 pv =
data.GetElementData(Z);
195 if(!pv) {
return xs; }
198 if(pviso) { pv = pviso; }
200 xs = pv->
Value(ekin);
226 sum += abundVector[j];
228 iso = (*isoVector)[j];
233 size_t nmax =
data.GetNumberOfComponents(Z);
234 if(temp.size() <
nmax) { temp.resize(nmax,0.0); }
235 for (
size_t i=0; i<
nmax; ++i) {
236 G4int A = (*isoVector)[i]->GetN();
237 sum += abundVector[i]*IsoCrossSection(kinEnergy, Z, A);
241 for (
size_t j = 0; j<
nmax; ++j) {
243 iso = (*isoVector)[j];
255 if(isInitialized) {
return; }
257 G4cout <<
"G4NeutronCaptureXS::BuildPhysicsTable for "
263 <<
" only neutron is allowed";
264 G4Exception(
"G4NeutronInelasticXS::BuildPhysicsTable(..)",
"had012",
268 isInitialized =
true;
272 char* path = getenv(
"G4NEUTRONXSDATA");
281 for(
size_t i=0; i<numOfElm; ++i) {
287 if(!
data.GetElementData(Z)) { Initialise(Z, dynParticle, path); }
297 if(
data.GetElementData(Z)) {
return; }
298 const char* path =
p;
302 path = getenv(
"G4NEUTRONXSDATA");
304 G4Exception(
"G4NeutronInelasticXS::Initialise(..)",
"had013",
306 "Environment variable G4NEUTRONXSDATA is not defined");
319 std::ostringstream ost;
320 ost << path <<
"/inelast" <<
Z ;
322 data.InitialiseForElement(Z, v);
328 size_t nmax = (size_t)(amax[Z]-amin[Z]+1);
329 if(work.size() <
nmax) { work.resize(nmax,0); }
330 for(
G4int A=amin[Z]; A<=amax[
Z]; ++A) {
331 std::ostringstream ost1;
332 ost1 << path <<
"/cap" << Z <<
"_" << A;
338 data.InitialiseForComponent(Z, n);
339 for(
size_t j=0; j<i; ++j) {
340 if(work[j]) {
data.AddComponent(Z, amin[Z]+j, work[j]); }
356 if(sig2 > 0.) { coeff[
Z] = sig1/sig2; }
357 if(!dp) {
delete dynParticle; }
361 G4NeutronInelasticXS::RetrieveVector(std::ostringstream& ost,
G4bool warn)
364 std::ifstream filein(ost.str().c_str());
366 if(!warn) {
return v; }
368 ed <<
"Data file <" << ost.str().c_str()
369 <<
"> is not opened!";
370 G4Exception(
"G4NeutronElasticXS::RetrieveVector(..)",
"had014",
374 G4cout <<
"File " << ost.str()
375 <<
" is opened by G4NeutronCaptureXS" <<
G4endl;
381 ed <<
"Data file <" << ost.str().c_str()
382 <<
"> is not retrieved!";
383 G4Exception(
"G4NeutronInelasticXS::RetrieveVector(..)",
"had015",
virtual ~G4NeutronInelasticXS()
size_t GetNumberOfIsotopes() const
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii)
G4double GetMaxEnergy() const
std::vector< G4Isotope * > G4IsotopeVector
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)
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *)
size_t GetVectorLength() const
static G4NistManager * Instance()
const G4String & GetParticleName() const
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
G4double * GetRelativeAbundanceVector() const
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat)
static G4Neutron * Neutron()
G4double Energy(size_t index) const
G4double Value(G4double theEnergy, size_t &lastidx) const
void SetKineticEnergy(G4double aEnergy)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4IsotopeVector * GetIsotopeVector() const
virtual void CrossSectionDescription(std::ostream &) const
virtual G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *)
virtual G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy)
G4double GetHadronNucleonXscPDG(const G4DynamicParticle *, const G4ParticleDefinition *)
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
std::vector< G4Element * > G4ElementTable
static G4ElementTable * GetElementTable()
const XML_Char const XML_Char * data
G4double GetInelasticHadronNucleonXsc()
G4double GetInelasticGlauberGribovXsc()