70 G4Exception(
"G4ParticleInelasticXS::G4ParticleInelasticXS(..)",
"had015",
76 G4cout <<
"G4ParticleInelasticXS::G4ParticleInelasticXS for "
79 if(particleName ==
"proton") {
89 if(particleName ==
"deuteron")
index = 1;
90 else if(particleName ==
"triton")
index = 2;
91 else if(particleName ==
"He3")
index = 3;
92 else if(particleName ==
"alpha")
index = 4;
95 ed << particleName <<
" is a wrong particle type";
96 G4Exception(
"G4ParticleInelasticXS::BuildPhysicsTable(..)",
"had012",
114 outFile <<
"G4ParticleInelasticXS calculates n, p, d, t, he3, he4 inelastic\n"
115 <<
"cross section on nuclei using data from the high precision\n"
116 <<
"neutron database. These data are simplified and smoothed over\n"
117 <<
"the resonance region in order to reduce CPU time.\n"
118 <<
"For high energy Glauber-Gribov cross section model is used\n";
146 if(
nullptr == pv) {
return xs; }
150 if(ekin <= pv->GetMaxEnergy()) {
160 <<
" xs(bn)= " << xs/
CLHEP::barn <<
" element data for "
190 if(pv ==
nullptr) {
return xs; }
196 if(pviso !=
nullptr) {
200 G4cout <<
"G4ParticleInelasticXS::IsoXS: for "
203 <<
" Z= " <<
Z <<
" A= " <<
A
212 xs = pv->LogVectorValue(ekin, logE);
222 <<
" Target Z= " <<
Z <<
" A= " <<
A
238 if(1 == nIso) {
return iso; }
251 for (j=0; j<nIso; ++j) {
252 sum += abundVector[j];
262 if(
nn < nIso) {
temp.resize(nIso, 0.); }
264 for (j=0; j<nIso; ++j) {
272 for (j=0; j<nIso; ++j) {
285 G4cout <<
"G4ParticleInelasticXS::BuildPhysicsTable for "
292 G4Exception(
"G4ParticleInelasticXS::BuildPhysicsTable(..)",
"had012",
301#ifdef G4MULTITHREADED
309#ifdef G4MULTITHREADED
320 for (
auto & elm : *table ) {
326 size_t nIso =
temp.size();
327 for (
auto & elm : *table ) {
328 size_t n = elm->GetNumberOfIsotopes();
329 if(
n > nIso) { nIso =
n; }
331 temp.resize(nIso, 0.0);
339 char* path = std::getenv(
"G4PARTICLEXSDATA");
340 if (
nullptr != path) {
341 std::ostringstream ost;
345 G4Exception(
"G4NeutronInelasticXS::Initialise(..)",
"had013",
347 "Environment variable G4PARTICLEXSDATA is not defined");
355#ifdef G4MULTITHREADED
357 if(
nullptr ==
data[
index]->GetElementData(
Z)) {
360#ifdef G4MULTITHREADED
368 if(
nullptr !=
data[
index]->GetElementData(
Z)) {
return; }
371 std::ostringstream ost;
388 std::ostringstream ost1;
414 std::ifstream filein(ost.str().c_str());
415 if (!filein.is_open()) {
418 ed <<
"Data file <" << ost.str().c_str()
419 <<
"> is not opened!";
420 G4Exception(
"G4ParticleInelasticXS::RetrieveVector(..)",
"had014",
425 G4cout <<
"File " << ost.str()
426 <<
" is opened by G4ParticleInelasticXS" <<
G4endl;
432 ed <<
"Data file <" << ost.str().c_str()
433 <<
"> is not retrieved!";
434 G4Exception(
"G4ParticleInelasticXS::RetrieveVector(..)",
"had015",
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 G4double aeff[]
static const G4int amin[]
#define G4MUTEX_INITIALIZER
#define G4MUTEXLOCK(mutex)
#define G4MUTEXUNLOCK(mutex)
G4GLOB_DLL std::ostream G4cout
G4VComponentCrossSection * GetComponentCrossSection(const G4String &name)
static G4CrossSectionDataSetRegistry * Instance()
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)
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
static G4HadronicParameters * Instance()
const G4String & GetParticleName() const
~G4ParticleInelasticXS() final
const G4String & FindDirectoryPath()
void InitialiseOnFly(G4int Z)
G4double GetElementCrossSection(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr) final
G4VComponentCrossSection * highEnergyXsection
void BuildPhysicsTable(const G4ParticleDefinition &) final
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int Z, G4int A, const G4Element *elm=nullptr, const G4Material *mat=nullptr) final
static const G4int MAXZINELP
G4ParticleInelasticXS(const G4ParticleDefinition *)
const G4PhysicsVector * GetPhysicsVector(G4int Z)
G4bool IsElementApplicable(const G4DynamicParticle *, G4int Z, const G4Material *mat=nullptr) final
static G4ElementData * data[5]
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int Z, G4int A, const G4Isotope *iso=nullptr, const G4Element *elm=nullptr, const G4Material *mat=nullptr) final
static G4double coeff[MAXZINELP][5]
G4double IsoCrossSection(G4double ekin, G4double logE, G4int Z, G4int A)
std::vector< G4double > temp
G4PhysicsVector * RetrieveVector(std::ostringstream &in, G4bool warn)
const G4ParticleDefinition * particle
const G4Isotope * SelectIsotope(const G4Element *, G4double kinEnergy, G4double logE) final
static G4String gDataDirectory[5]
void CrossSectionDescription(std::ostream &) const final
G4double GetMaxEnergy() const
G4double LogVectorValue(const G4double energy, const G4double theLogEnergy) const
G4bool Retrieve(std::ifstream &fIn, G4bool ascii=false)
std::size_t GetVectorLength() const
G4double GetInelasticElementCrossSection(const G4ParticleDefinition *, G4double kinEnergy, const G4Element *)
void SetMaxKinEnergy(G4double value)
void SetForAllAtomsAndEnergies(G4bool val)
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