55const 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,
66const 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 < "
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; }
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; }
178 if(!pv) {
return xs; }
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];
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; }
278G4NeutronCaptureXS::Initialise(
G4int Z,
const char* p)
281 const char* path = p;
285 path = getenv(
"G4NEUTRONXSDATA");
288 "G4NEUTRONXSDATA environment variable not defined");
294 std::ostringstream ost;
295 ost << path <<
"/cap" << Z ;
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);
314 for(
size_t j=0; j<i; ++j) {
315 if(work[j]) { data.
AddComponent(Z, amin[Z]+j, work[j]); }
321G4NeutronCaptureXS::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;
std::vector< G4Element * > G4ElementTable
std::vector< G4Isotope * > G4IsotopeVector
G4DLLIMPORT std::ostream G4cout
G4double GetKineticEnergy() const
void InitialiseForComponent(G4int Z, G4int nComponents=0)
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
G4PhysicsVector * GetElementData(G4int Z)
void AddComponent(G4int Z, G4int id, G4PhysicsVector *v)
void SetName(const G4String &nam)
G4PhysicsVector * GetComponentDataByID(G4int Z, G4int id)
size_t GetNumberOfComponents(G4int Z)
G4double * GetRelativeAbundanceVector() const
static size_t GetNumberOfElements()
size_t GetNumberOfIsotopes() const
static const G4ElementTable * GetElementTable()
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)
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=0)
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat)
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
virtual ~G4NeutronCaptureXS()
virtual G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *)
const G4String & GetParticleName() const
virtual G4bool Retrieve(std::ifstream &fIn, G4bool ascii)
G4double Value(G4double theEnergy)
G4double Energy(size_t index) const