52 const char* dataDirVariable;
55 dataDirVariable =
"G4NEUTRONHPDATA";
58 dataDirVariable =
"G4PROTONHPDATA";
59 particleName =
"Proton";
62 dataDirVariable =
"G4DEUTERONHPDATA";
63 particleName =
"Deuteron";
66 dataDirVariable =
"G4TRITONHPDATA";
67 particleName =
"Triton";
70 dataDirVariable =
"G4HE3HPDATA";
74 dataDirVariable =
"G4ALPHAHPDATA";
75 particleName =
"Alpha";
79 "G4ParticleHPInelasticData may only be called for neutron, proton, deuteron, triton, He3 or "
80 "alpha, while it is called for "
85 dataName.at(0) = (
char)std::toupper(dataName.at(0));
90 G4String message(
"Please setenv G4PARTICLEHPDATA (recommended) or, at least setenv "
91 +
G4String(dataDirVariable) +
" to point to the "
102 dirName = baseName +
"/" + particleName;
106 G4cout <<
"@@@ G4ParticleHPInelasticData instantiated for particle "
107 << projectile->
GetParticleName() <<
" data directory variable is " << dataDirVariable
108 <<
" pointing to " << dirName <<
G4endl;
115 theCrossSections =
nullptr;
116 theProjectile = projectile;
119 instanceOfWorker =
false;
124 instanceOfWorker =
true;
126 element_cache =
nullptr;
127 material_cache =
nullptr;
134 if (theCrossSections !=
nullptr && !instanceOfWorker) {
136 delete theCrossSections;
137 theCrossSections =
nullptr;
139 if (theHPData !=
nullptr && !instanceOfWorker) {
159 if (dp->
GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache)
163 element_cache = element;
164 material_cache = material;
176 if (theHPData ==
nullptr)
180 if (theCrossSections ==
nullptr)
189 for (std::size_t i = 0; i < numberOfElements; ++i) {
198 if (&projectile != theProjectile)
200 "Attempt to use ParticleHP data for a wrong projectile!!!");
212 G4cout <<
"Inelastic Cross Section of Neutron HP" <<
G4endl;
213 G4cout <<
"(Pointwise cross-section at 0 Kelvin.)" <<
G4endl;
223 for (std::size_t i = 0; i < numberOfElements; ++i) {
228 for (ie = 0; ie < 130; ie++) {
230 G4bool outOfRange =
false;
232 if (eKinetic < 20 * CLHEP::MeV) {
233 G4cout << eKinetic / CLHEP::eV <<
" "
234 << (*((*theCrossSections)(i))).GetValue(eKinetic, outOfRange) / CLHEP::barn
248 std::size_t index = anE->
GetIndex();
256 if (eKinetic < aT * CLHEP::k_Boltzmann) {
262 return ((*((*theCrossSections)(index))).GetValue(eKinetic, outOfRange)) * factor;
276 static_cast<G4int>(theZ + eps));
285 G4int size =
G4int(std::max(10., aT / 60 * CLHEP::kelvin));
289#ifndef G4PHP_DOPPLER_LOOP_ONCE
291 || std::abs(buffer - result / std::max(1, counter))
294 if (counter != 0) buffer = result / counter;
295 while (counter < size)
301 boosted.
Lorentz(theNeutron, aThermalNuc);
303 aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
305 if (failCount < 1000) {
307#ifndef G4PHP_DOPPLER_LOOP_ONCE
318 aXsection *= (targetVelocity - neutronVelocity).mag() / neutronVMag;
321#ifndef G4PHP_DOPPLER_LOOP_ONCE
342 outFile <<
"Extension of High Precision cross section for inelastic reaction of proton, "
343 "deuteron, triton, He3 and alpha below 20MeV\n";
std::vector< G4Element * > G4ElementTable
const char * G4FindDataDir(const char *)
G4GLOB_DLL std::ostream G4cout
static G4Deuteron * Deuteron()
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
static G4ElementTable * GetElementTable()
static size_t GetNumberOfElements()
static G4HadronicParameters * Instance()
G4double GetTemperature() const
static G4Neutron * Neutron()
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetThermalNucleus(G4double aMass, G4double temp=-1) const
G4double GetPDGMass() const
const G4String & GetParticleName() const
G4PhysicsVector * MakePhysicsVector(const G4Element *thE, G4ParticleHPFissionData *theP)
static G4ParticleHPData * Instance(G4ParticleDefinition *projectile)
void CrossSectionDescription(std::ostream &) const override
void BuildPhysicsTable(const G4ParticleDefinition &) override
G4ParticleHPInelasticData(G4ParticleDefinition *projectile=G4Neutron::Neutron())
G4int GetVerboseLevel() const
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *) override
~G4ParticleHPInelasticData() override
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *) override
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
void SetVerboseLevel(G4int) override
void DumpPhysicsTable(const G4ParticleDefinition &) override
G4PhysicsTable * GetInelasticCrossSections(const G4ParticleDefinition *part) const
void RegisterInelasticCrossSections(const G4ParticleDefinition *part, G4PhysicsTable *ptr)
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int i)
static G4ParticleHPManager * GetInstance()
void push_back(G4PhysicsVector *)
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
static G4Triton * Triton()
G4double GetMaxKinEnergy() const
void SetMaxKinEnergy(G4double value)
void SetMinKinEnergy(G4double value)
G4double GetMinKinEnergy() const
void SetName(const G4String &nam)