64G4double G4GammaNuclearXS::coeff[3][3];
65G4double G4GammaNuclearXS::xs150[] = {0.0};
66const G4double G4GammaNuclearXS::eTransitionBound = 150.*CLHEP::MeV;
67const G4int G4GammaNuclearXS::freeVectorException[] = {
684, 6, 7, 8, 27, 39, 45, 65, 67, 69, 73};
69G4String G4GammaNuclearXS::gDataDirectory =
"";
76 G4cout <<
"G4GammaNuclearXS::G4GammaNuclearXS Initialise for Z < "
81 if (ggXsection ==
nullptr)
86 if (
nullptr == data) {
89 for (
G4int Z=1; Z<MAXZGAMMAXS; ++Z) {
97 outFile <<
"G4GammaNuclearXS calculates the gamma nuclear\n"
98 <<
"cross-section for GDR energy region on nuclei using "
99 <<
"data from the high precision\n"
100 <<
"IAEA photonuclear database (2019). Then liniear connection\n"
101 <<
"implemented with previous CHIPS photonuclear model." <<
G4endl;
123 const G4int Z = (ZZ < MAXZGAMMAXS) ? ZZ : MAXZGAMMAXS - 1;
125 if(Z == fZ && ekin == fEkin) {
return fXS; }
130 if(pv ==
nullptr || 1 == Z) {
138 fXS = pv->Value(ekin);
140 }
else if(ekin >= eTransitionBound) {
145 const G4double lxs = pv->Value(emax);
146 fXS = lxs + (ekin - emax)*(rxs - lxs)/(eTransitionBound - emax);
151 G4cout <<
"Z= " << Z <<
" Ekin(MeV)= " << ekin/CLHEP::MeV
152 <<
", nElmXS(b)= " << fXS/CLHEP::barn
167 const G4int Z = (ZZ < MAXZGAMMAXS) ? ZZ : MAXZGAMMAXS - 1;
169 return pv->
Value(ekin);
184 const G4int Z = (ZZ < MAXZGAMMAXS) ? ZZ : MAXZGAMMAXS - 1;
193 if(ekin >= 10.*CLHEP::GeV && AA >=0 && AA <=2) {
202 G4cout <<
"G4GammaNuclearXS::IsoXS: Z= " << Z <<
" A= " <<
A
203 <<
" Ekin(MeV)= " << ekin/CLHEP::MeV
204 <<
", ElmXS(b)= " << xs/CLHEP::barn <<
G4endl;
216 if(1 == nIso) {
return iso; }
223 std::size_t nn = temp.size();
224 if(nn < nIso) { temp.resize(nIso, 0.); }
226 for (std::size_t j=0; j<nIso; ++j) {
229 sum += abundVector[j]*
234 for (std::size_t j = 0; j<nIso; ++j) {
246 G4cout <<
"G4GammaNuclearXS::BuildPhysicsTable for "
252 <<
" only gamma is allowed";
253 G4Exception(
"G4GammaNuclearXS::BuildPhysicsTable(..)",
"had012",
260 std::size_t nIso = temp.size();
261 for (
auto & elm : *table ) {
262 std::size_t n = elm->GetNumberOfIsotopes();
263 if (n > nIso) { nIso = n; }
265 temp.resize(nIso, 0.0);
268const G4String& G4GammaNuclearXS::FindDirectoryPath()
271 if(gDataDirectory.empty()) {
272 std::ostringstream ost;
274 gDataDirectory = ost.str();
276 return gDataDirectory;
279void G4GammaNuclearXS::Initialise(
G4int Z)
282 std::ostringstream ost;
283 ost << FindDirectoryPath() << Z ;
297 theGamma.SetKineticEnergy(10*CLHEP::GeV);
298 if(amax[Z] > amin[Z]) {
299 for(
G4int A=amin[Z];
A<=amax[Z]; ++
A) {
301 if(AA >= 0 && AA <= 2) {
304 if(sig2 > 0.) { coeff[Z][AA] = (sig1/sig2); }
305 else { coeff[Z][AA] = 1.; }
313G4GammaNuclearXS::RetrieveVector(std::ostringstream& ost,
G4bool warn,
G4int Z)
317 std::ifstream filein(ost.str().c_str());
318 if (!filein.is_open()) {
321 ed <<
"Data file <" << ost.str().c_str()
322 <<
"> is not opened!";
323 G4Exception(
"G4GammaNuclearXS::RetrieveVector(..)",
"had014",
328 G4cout <<
"File " << ost.str()
329 <<
" is opened by G4GammaNuclearXS" <<
G4endl;
332 if(std::find(std::begin(freeVectorException), std::end(freeVectorException), Z)
333 == std::end(freeVectorException)) {
340 ed <<
"Data file <" << ost.str().c_str()
341 <<
"> is not retrieved!";
342 G4Exception(
"G4GammaNuclearXS::RetrieveVector(..)",
"had015",
std::vector< G4Element * > G4ElementTable
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4VCrossSectionDataSet * GetCrossSectionDataSet(const G4String &name, G4bool warning=false)
static G4CrossSectionDataSetRegistry * Instance()
G4double GetKineticEnergy() const
G4PhysicsVector * GetElementData(G4int Z) const
void InitialiseForElement(G4int Z, G4PhysicsVector *v)
void SetName(const G4String &nam)
static G4ElementTable * GetElementTable()
G4double * GetRelativeAbundanceVector() const
const G4Isotope * GetIsotope(G4int iso) const
size_t GetNumberOfIsotopes() const
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr) final
void BuildPhysicsTable(const G4ParticleDefinition &) final
G4double LowEnergyCrossSection(G4double ekin, G4int Z)
G4double ElementCrossSection(G4double ekin, G4int Z)
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *, const G4Material *mat) final
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr) final
void CrossSectionDescription(std::ostream &) const final
G4double IsoCrossSection(G4double ekin, G4int Z, G4int A)
const G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy, G4double logE) final
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *) final
static G4HadronicParameters * Instance()
const G4String & GetDirPARTICLEXS() const
const G4String & GetParticleName() const
G4double GetMaxEnergy() const
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
G4double Value(const G4double energy, std::size_t &lastidx) const
virtual G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr)
virtual G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr)
void SetForAllAtomsAndEnergies(G4bool val)