65 G4cout <<
"G4NeutronCaptureXS::G4NeutronCaptureXS: Initialise for Z < "
78 outFile <<
"G4NeutronCaptureXS calculates the neutron capture cross sections\n"
79 <<
"on nuclei using data from the high precision neutron database.\n"
80 <<
"These data are simplified and smoothed over the resonance region\n"
81 <<
"in order to reduce CPU time. G4NeutronCaptureXS is set to zero\n"
82 <<
"above 20 MeV for all targets. Cross section is zero also for Z>92.\n";
106 if(ekin >
emax) {
return xs; }
113 if(pv ==
nullptr) {
return xs; }
116 xs = (ekin >=
e1) ? pv->LogVectorValue(ekin, logEkin)
117 : (*pv)[1]*std::sqrt(
e1/ekin);
143 if(eKin >
emax) {
return xs; }
154 if(pv ==
nullptr) {
return xs; }
158 if(pviso !=
nullptr) {
161 : (*pviso)[1]*std::sqrt(
e1/ekin);
164 G4cout <<
"G4NeutronCaptureXS::IsoXS: Ekin(MeV)= " << ekin/
MeV
165 <<
" xs(b)= " << xs/
barn
166 <<
" Z= " <<
Z <<
" A= " <<
A <<
G4endl;
174 xs = (ekin >=
e1) ? pv->LogVectorValue(ekin, logEkin)
175 : (*pv)[1]*std::sqrt(
e1/ekin);
178 G4cout <<
"G4NeutronCaptureXS::IsoXS: Ekin(MeV)= " << ekin/
MeV
179 <<
" xs(b)= " << xs/
barn
180 <<
" Z= " <<
Z <<
" A= " <<
A <<
" no iso XS" <<
G4endl;
194 if(1 == nIso) {
return iso; }
206 for (j = 0; j<nIso; ++j) {
207 sum += abundVector[j];
216 if(
nn < nIso) {
temp.resize(nIso, 0.); }
218 for (j=0; j<nIso; ++j) {
224 for (j = 0; j<nIso; ++j) {
237 G4cout <<
"G4NeutronCaptureXS::BuildPhysicsTable for "
243 <<
" only neutron is allowed";
244 G4Exception(
"G4NeutronCaptureXS::BuildPhysicsTable(..)",
"had012",
249 if(
nullptr ==
data) {
250#ifdef G4MULTITHREADED
252 if(
nullptr ==
data) {
258#ifdef G4MULTITHREADED
269 for (
auto & elm : *table ) {
275 size_t nIso =
temp.size();
276 for (
auto & elm : *table ) {
277 size_t n = elm->GetNumberOfIsotopes();
278 if(
n > nIso) { nIso =
n; }
280 temp.resize(nIso, 0.0);
288 char* path = std::getenv(
"G4PARTICLEXSDATA");
289 if (
nullptr != path) {
290 std::ostringstream ost;
291 ost << path <<
"/neutron/cap";
294 G4Exception(
"G4NeutronCaptureXS::Initialise(..)",
"had013",
296 "Environment variable G4PARTICLEXSDATA is not defined");
304#ifdef G4MULTITHREADED
309#ifdef G4MULTITHREADED
320 std::ostringstream ost;
331 std::ostringstream ost1;
343 std::ifstream filein(ost.str().c_str());
344 if (!filein.is_open()) {
347 ed <<
"Data file <" << ost.str().c_str()
348 <<
"> is not opened!";
349 G4Exception(
"G4NeutronCaptureXS::RetrieveVector(..)",
"had014",
354 G4cout <<
"File " << ost.str()
355 <<
" is opened by G4NeutronCaptureXS" <<
G4endl;
361 ed <<
"Data file <" << ost.str().c_str()
362 <<
"> is not retrieved!";
363 G4Exception(
"G4NeutronCaptureXS::RetrieveVector(..)",
"had015",
static const G4double e1[44]
static const G4double emax
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
static const G4int amax[]
static const G4int amin[]
G4double G4Log(G4double x)
static constexpr double barn
static constexpr double eV
static constexpr double MeV
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
G4PhysicsVector * GetComponentDataByIndex(G4int Z, G4int idx)
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)
static G4ElementTable * GetElementTable()
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
void CrossSectionDescription(std::ostream &) const final
~G4NeutronCaptureXS() final
static G4String gDataDirectory
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *) final
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) final
const G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy, G4double logE) final
static const G4int MAXZCAPTURE
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *) final
G4double IsoCrossSection(G4double ekin, G4double logekin, G4int Z, G4int A)
void BuildPhysicsTable(const G4ParticleDefinition &) final
void InitialiseOnFly(G4int Z)
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *) final
std::vector< G4double > temp
const G4String & FindDirectoryPath()
G4PhysicsVector * RetrieveVector(std::ostringstream &in, G4bool warn)
const G4PhysicsVector * GetPhysicsVector(G4int Z)
static G4ElementData * data
const G4String & GetParticleName() const
G4double Energy(const std::size_t index) const
G4double LogVectorValue(const G4double energy, const G4double theLogEnergy) const
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
static constexpr double barn
static constexpr double MeV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments