49 const char* dataDirVariable;
52 dataDirVariable =
"G4NEUTRONHPDATA";
54 dataDirVariable =
"G4PROTONHPDATA";
55 particleName =
"Proton";
57 dataDirVariable =
"G4DEUTERONHPDATA";
58 particleName =
"Deuteron";
60 dataDirVariable =
"G4TRITONHPDATA";
61 particleName =
"Triton";
63 dataDirVariable =
"G4HE3HPDATA";
66 dataDirVariable =
"G4ALPHAHPDATA";
67 particleName =
"Alpha";
69 G4String message(
"G4ParticleHPInelasticData may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + projectile->
GetParticleName());
74 dataName.at(0) = toupper(dataName.at(0)) ;
77 if ( !getenv(dataDirVariable) && !getenv(
"G4PARTICLEHPDATA" ) ){
83 if ( getenv(dataDirVariable) ) {
84 dirName = getenv(dataDirVariable);
86 G4String baseName = getenv(
"G4PARTICLEHPDATA" );
87 dirName = baseName +
"/" + particleName;
89 G4cout <<
"@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->
GetParticleName() <<
" data directory variable is " << dataDirVariable <<
" pointing to " << dirName <<
G4endl;
172 G4cout <<
"Find a flag of \"G4PHP_NEGLECT_DOPPLER\"." <<
G4endl;
173 G4cout <<
"On the fly Doppler broadening will be neglect in the cross section calculation of inelastic scattering of neutrons (<20MeV)." <<
G4endl;
201 for(
size_t i=0; i<numberOfElements; ++i )
216 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use ParticleHP data for a wrong projectile!!!");
227 G4cout <<
"Inelastic Cross Section of Neutron HP"<<
G4endl;
228 G4cout <<
"(Pointwise cross-section at 0 Kelvin.)" <<
G4endl;
238 for (
size_t i = 0 ; i < numberOfElements ; ++i )
245 for ( ie = 0 ; ie < 130 ; ie++ )
248 G4bool outOfRange =
false;
286 return ( (*((*
theCrossSections)(index))).GetValue(eKinetic, outOfRange) )* factor;
292 theNeutron.SetKineticEnergy( eKinetic );
313 #ifndef G4PHP_DOPPLER_LOOP_ONCE
314 while(counter == 0 || std::abs(buffer-result/
std::max(1,counter)) > 0.01*buffer)
316 if(counter) buffer = result/counter;
324 boosted.
Lorentz(theNeutron, aThermalNuc);
326 aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
333 #ifndef G4PHP_DOPPLER_LOOP_ONCE
345 aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag;
348 #ifndef G4PHP_DOPPLER_LOOP_ONCE
375 outFile <<
"Extension of High Precision cross section for inelastic reaction of proton, deuteron, triton, He3 and alpha below 20MeV\n";
G4double GetMaxKinEnergy() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4ParticleHPManager * GetInstance()
void SetMinKinEnergy(G4double value)
void SetMaxKinEnergy(G4double value)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetVerboseLevel(G4int i)
void message(RunManager *runmanager)
G4PhysicsTable * theCrossSections
G4ParticleHPData * theHPData
G4ReactionProduct GetThermalNucleus(G4double aMass, G4double temp=-1) const
const G4String & GetParticleName() const
static G4Proton * Proton()
G4int GetVerboseLevel() const
G4double GetPDGMass() const
G4PhysicsTable * GetInelasticCrossSections(const G4ParticleDefinition *)
static G4Deuteron * Deuteron()
G4double GetKineticEnergy() const
static G4Pow * GetInstance()
G4ParticleDefinition * GetDefinition() const
G4double powA(G4double A, G4double y) const
std::vector< G4Element * > G4ElementTable
static constexpr double MeV
void BuildPhysicsTable(const G4ParticleDefinition &)
G4PhysicsVector * MakePhysicsVector(G4Element *thE, G4ParticleHPFissionData *theP)
static G4double GetNuclearMass(const G4double A, const G4double Z)
static constexpr double eV
G4ThreeVector GetMomentum() const
void RegisterInelasticCrossSections(const G4ParticleDefinition *, G4PhysicsTable *)
G4double GetMinKinEnergy() const
G4double G4ParticleHPJENDLHEData::G4double result
G4ThreeVector GetMomentum() const
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
void push_back(G4PhysicsVector *)
static G4Triton * Triton()
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
static G4Neutron * Neutron()
const G4Element * element_cache
static constexpr double k_Boltzmann
void SetVerboseLevel(G4int)
G4ParticleDefinition * theProjectile
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
void SetName(const G4String &)
const G4Material * material_cache
static size_t GetNumberOfElements()
static constexpr double kelvin
void DumpPhysicsTable(const G4ParticleDefinition &)
~G4ParticleHPInelasticData()
static const G4double eps
virtual void CrossSectionDescription(std::ostream &) const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
static G4ParticleHPData * Instance(G4ParticleDefinition *projectile)
static constexpr double barn
static G4ElementTable * GetElementTable()
G4ParticleHPInelasticData(G4ParticleDefinition *projectile=G4Neutron::Neutron())