55 const G4int G4NeutronCaptureXS::amin[] = {0,
56 0, 0, 6, 0,10,12,14,16, 0, 0,
57 0, 0, 0,28, 0, 0, 0,36, 0,40,
58 0, 0, 0, 0, 0,54, 0,58,63,64,
59 0,70, 0, 0, 0, 0, 0, 0, 0,90,
60 0, 0, 0, 0, 0, 0,107,106, 0,112,
61 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
62 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
63 0, 0, 0,180, 0, 0, 0, 0, 0, 0,
64 0,204, 0, 0, 0, 0, 0, 0, 0, 0,
66 const G4int G4NeutronCaptureXS::amax[] = {0,
67 0, 0, 7, 0,11,13,15,18, 0, 0,
68 0, 0, 0,30, 0, 0, 0,40, 0,48,
69 0, 0, 0, 0, 0,58, 0,64,65,70,
70 0,76, 0, 0, 0, 0, 0, 0, 0,96,
71 0, 0, 0, 0, 0, 0,109,116, 0,124,
72 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
73 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
74 0, 0, 0,186, 0, 0, 0, 0, 0, 0,
75 0,208, 0, 0, 0, 0, 0, 0, 0, 0,
84 G4cout <<
"G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise for Z < "
88 data.SetName(
"NeutronCapture");
91 isInitialized =
false;
105 outFile <<
"G4NeutronCaptureXS calculates the neutron capture cross sections\n"
106 <<
"on nuclei using data from the high precision neutron database.\n"
107 <<
"These data are simplified and smoothed over the resonance region\n"
108 <<
"in order to reduce CPU time. G4NeutronCaptureXS is valid up to\n"
109 <<
"20 MeV for all targets through U.\n";
133 if(ekin > emax || Z < 1 || Z > maxZ) {
return xs; }
135 if(ekin < elimit) { ekin = elimit; }
144 pv =
data.GetElementData(Z);
145 if(!pv) {
return xs; }
149 if(ekin < e1) { xs = (*pv)[0]*std::sqrt(e1/ekin); }
150 else { xs = pv->
Value(ekin); }
166 if(ekin > emax || Z < 1 || Z > maxZ) {
return xs; }
168 if(ekin < elimit) { ekin = elimit; }
177 pv =
data.GetElementData(Z);
178 if(!pv) {
return xs; }
180 pv =
data.GetComponentDataByID(Z, A);
181 if(!pv) {
return xs; }
184 if(ekin < e1) { xs = (*pv)[0]*std::sqrt(e1/ekin); }
185 else { xs = pv->
Value(ekin); }
203 if(Z > maxZ) { Z = maxZ; }
210 for (
G4int j = 0; j<nIso; ++j) {
211 sum += abundVector[j];
213 iso = (*isoVector)[j];
218 size_t nmax =
data.GetNumberOfComponents(Z);
219 if(temp.size() <
nmax) { temp.resize(nmax,0.0); }
220 for (
size_t i=0; i<
nmax; ++i) {
221 G4int A = (*isoVector)[i]->GetN();
223 if(v) { sum += abundVector[i]*v->
Value(kinEnergy); }
227 for (
size_t j = 0; j<
nmax; ++j) {
229 iso = (*isoVector)[j];
241 if(isInitialized) {
return; }
243 G4cout <<
"G4NeutronCaptureXS::BuildPhysicsTable for "
250 isInitialized =
true;
254 char* path = getenv(
"G4NEUTRONXSDATA");
257 "G4NEUTRONXSDATA environment variable not defined");
265 for(
size_t i=0; i<numOfElm; ++i) {
268 else if(Z > maxZ) { Z = maxZ; }
272 if(!
data.GetElementData(Z)) { Initialise(Z, path); }
278 G4NeutronCaptureXS::Initialise(
G4int Z,
const char*
p)
280 if(
data.GetElementData(Z)) {
return; }
281 const char* path =
p;
285 path = getenv(
"G4NEUTRONXSDATA");
288 "G4NEUTRONXSDATA environment variable not defined");
294 std::ostringstream ost;
295 ost << path <<
"/cap" <<
Z ;
297 data.InitialiseForElement(Z, v);
303 size_t nmax = (size_t)(amax[Z]-amin[Z]+1);
304 if(work.size() <
nmax) { work.resize(nmax,0); }
305 for(
G4int A=amin[Z]; A<=amax[
Z]; ++A) {
306 std::ostringstream ost1;
307 ost1 << path <<
"/cap" << Z <<
"_" << A;
308 v = RetrieveVector(ost1,
false);
313 data.InitialiseForComponent(Z, n);
314 for(
size_t j=0; j<i; ++j) {
315 if(work[j]) {
data.AddComponent(Z, amin[Z]+j, work[j]); }
321 G4NeutronCaptureXS::RetrieveVector(std::ostringstream& ost,
G4bool warn)
324 std::ifstream filein(ost.str().c_str());
326 if(!warn) {
return v; }
327 G4cout << ost.str() <<
" is not opened by G4NeutronCaptureXS" <<
G4endl;
331 G4cout <<
"File " << ost.str()
332 <<
" is opened by G4NeutronCaptureXS" <<
G4endl;
337 G4cout << ost.str() <<
" is not retrieved in G4NeutronCaptureXS" <<
G4endl;