49 const char* dataDirVariable;
51 dataDirVariable =
"G4NEUTRONHPDATA";
53 dataDirVariable =
"G4PROTONHPDATA";
55 dataDirVariable =
"G4DEUTERONHPDATA";
57 dataDirVariable =
"G4TRITONHPDATA";
59 dataDirVariable =
"G4HE3HPDATA";
61 dataDirVariable =
"G4ALPHAHPDATA";
63 G4String message(
"G4ParticleHPInelasticData may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + projectile->
GetParticleName());
68 dataName.at(0) = toupper(dataName.at(0)) ;
71 if(!getenv(dataDirVariable)){
76 G4cout <<
"@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->
GetParticleName() <<
" data directory variable is " << dataDirVariable <<
" pointing to " << getenv(dataDirVariable) <<
G4endl;
146 G4cout <<
"Find a flag of \"G4PHP_NEGLECT_DOPPLER\"." <<
G4endl;
147 G4cout <<
"On the fly Doppler broadening will be neglect in the cross section calculation of inelastic scattering of neutrons (<20MeV)." <<
G4endl;
175 for(
size_t i=0; i<numberOfElements; ++i )
190 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use ParticleHP data for a wrong projectile!!!");
201 G4cout <<
"Inelastic Cross Section of Neutron HP"<<
G4endl;
202 G4cout <<
"(Pointwise cross-section at 0 Kelvin.)" <<
G4endl;
212 for (
size_t i = 0 ; i < numberOfElements ; ++i )
219 for ( ie = 0 ; ie < 130 ; ie++ )
222 G4bool outOfRange =
false;
253 if ( eKinetic < aT * CLHEP::k_Boltzmann )
266 theNeutron.SetKineticEnergy( eKinetic );
285 G4double neutronVMag = neutronVelocity.mag();
288 #ifndef G4PHP_DOPPLER_LOOP_ONCE
289 while(counter == 0 || std::abs(buffer-result/
std::max(1,counter)) > 0.01*buffer)
291 if(counter) buffer = result/counter;
297 boosted.
Lorentz(theNeutron, aThermalNuc);
299 aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
306 #ifndef G4PHP_DOPPLER_LOOP_ONCE
318 aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag;
321 #ifndef G4PHP_DOPPLER_LOOP_ONCE
348 outFile <<
"Extension of High Precision cross section for inelastic reaction of proton, deuteron, triton, He3 and alpha below 20MeV\n";
static G4ParticleHPManager * GetInstance()
void RegisterInelasticCrossSections(const G4ParticleDefinition *, G4PhysicsTable *)
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
static G4double GetNuclearMass(const G4double A, const G4double Z)
~G4ParticleHPInelasticData()
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4double GetKineticEnergy() const
CLHEP::Hep3Vector G4ThreeVector
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4ParticleDefinition * theProjectile
void push_back(G4PhysicsVector *)
void DumpPhysicsTable(const G4ParticleDefinition &)
static const G4double eps
G4ParticleDefinition * GetDefinition() const
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
void BuildPhysicsTable(const G4ParticleDefinition &)
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
G4ReactionProduct GetThermalNucleus(G4double aMass, G4double temp=-1) const
const G4String & GetParticleName() const
G4ParticleHPInelasticData(G4ParticleDefinition *projectile=G4Neutron::Neutron())
void SetVerboseLevel(G4int i)
void SetName(const G4String &)
G4PhysicsTable * theCrossSections
G4GLOB_DLL std::ostream G4cout
static size_t GetNumberOfElements()
void SetMinKinEnergy(G4double value)
static G4Triton * Triton()
static G4Proton * Proton()
static G4Neutron * Neutron()
static G4Deuteron * Deuteron()
static const double kelvin
G4double GetKineticEnergy() const
G4PhysicsVector * MakePhysicsVector(G4Element *thE, G4ParticleHPFissionData *theP)
static const G4double factor
G4double GetPDGMass() const
void SetMaxKinEnergy(G4double value)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4PhysicsTable * GetInelasticCrossSections(const G4ParticleDefinition *)
static G4ParticleHPData * Instance(G4ParticleDefinition *projectile)
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
virtual void CrossSectionDescription(std::ostream &) const
std::vector< G4Element * > G4ElementTable
G4ParticleHPData * theHPData
static G4ElementTable * GetElementTable()
void SetVerboseLevel(G4int)
G4int GetVerboseLevel() const
G4double GetMinKinEnergy() const
G4ThreeVector GetMomentum() const
G4double GetMaxKinEnergy() const