60G4double G4GammaNuclearXS::coeff[] = {0.0};
61G4String G4GammaNuclearXS::gDataDirectory =
"";
75 G4cout <<
"G4GammaNuclearXS::G4GammaNuclearXS Initialise for Z < "
95 outFile <<
"G4GammaNuclearXS calculates the gamma nuclear\n"
96 <<
"cross section on nuclei using data from the high precision\n"
97 <<
"LEND gamma database. The data are simplified and smoothed over\n"
98 <<
"the resonance region in order to reduce CPU time.\n"
99 <<
"For high energies Glauber-Gribiv cross section is used.\n";
125 auto pv = GetPhysicsVector(Z);
126 if(pv ==
nullptr) {
return xs; }
130 if(ekin <= pv->GetMaxEnergy()) {
138 G4cout <<
"Z= " << Z <<
" Ekin(MeV)= " << ekin/CLHEP::MeV
139 <<
", nElmXS(b)= " << xs/CLHEP::barn
162 if(1 == nIso) {
return iso; }
170 for (j=0; j<nIso; ++j) {
171 sum += abundVector[j];
184 G4cout <<
"G4GammaNuclearXS::BuildPhysicsTable for "
190 <<
" only gamma is allowed";
191 G4Exception(
"G4GammaNuclearXS::BuildPhysicsTable(..)",
"had012",
196#ifdef G4MULTITHREADED
203#ifdef G4MULTITHREADED
214 size_t numOfCouples = theCoupleTable->GetTableSize();
215 for(
size_t j=0; j<numOfCouples; ++j) {
216 auto mat = theCoupleTable->GetMaterialCutsCouple(j)->GetMaterial();
217 auto elmVec = mat->GetElementVector();
218 size_t numOfElem = mat->GetNumberOfElements();
219 for (
size_t ie = 0; ie < numOfElem; ++ie) {
220 G4int Z = std::max(1,std::min(((*elmVec)[ie])->GetZasInt(),
MAXZEL-1));
221 if(data[Z] ==
nullptr) { Initialise(Z); }
227const G4String& G4GammaNuclearXS::FindDirectoryPath()
231 if(gDataDirectory.empty()) {
232 char* path = std::getenv(
"G4PARTICLEXSDATA");
234 std::ostringstream ost;
235 ost << path <<
"/gamma/inel";
236 gDataDirectory = ost.str();
238 G4Exception(
"G4GammaNuclearXS::Initialise(..)",
"had013",
240 "Environment variable G4PARTICLEXSDATA is not defined");
243 return gDataDirectory;
246void G4GammaNuclearXS::InitialiseOnFly(
G4int Z)
248#ifdef G4MULTITHREADED
250 if(data[Z] ==
nullptr) {
253#ifdef G4MULTITHREADED
259void G4GammaNuclearXS::Initialise(
G4int Z)
261 if(data[Z] !=
nullptr) {
return; }
266 std::ostringstream ost;
267 ost << FindDirectoryPath() << Z ;
268 std::ifstream filein(ost.str().c_str());
271 ed <<
"Data file <" << ost.str().c_str()
272 <<
"> is not opened!";
273 G4Exception(
"G4GammaNuclearXS::Initialise(..)",
"had014",
278 G4cout <<
"file " << ost.str()
279 <<
" is opened by G4GammaNuclearXS" <<
G4endl;
283 if(!data[Z]->Retrieve(filein,
true)) {
285 ed <<
"Data file <" << ost.str().c_str()
286 <<
"> is not retrieved!";
287 G4Exception(
"G4GammaNuclearXS::Initialise(..)",
"had015",
297 coeff[Z] = (sig2 > 0.) ? sig1/sig2 : 1.0;
#define G4_DECLARE_XS_FACTORY(cross_section)
double A(double temperature)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4VCrossSectionDataSet * GetCrossSectionDataSet(const G4String &name, G4bool warning=true)
static G4CrossSectionDataSetRegistry * Instance()
G4double GetLogKineticEnergy() const
G4double GetKineticEnergy() const
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
~G4GammaNuclearXS() final
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso, const G4Element *elm, const G4Material *mat) final
void BuildPhysicsTable(const G4ParticleDefinition &) final
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *mat) final
void CrossSectionDescription(std::ostream &) const final
const G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy, G4double logE) final
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat) final
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *) final
const G4String & GetParticleName() const
std::size_t GetVectorLength() const
static G4ProductionCutsTable * GetProductionCutsTable()
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
void SetForAllAtomsAndEnergies(G4bool val)