50 const char* dataDirVariable;
53 dataDirVariable =
"G4NEUTRONHPDATA";
55 dataDirVariable =
"G4PROTONHPDATA";
56 particleName =
"Proton";
58 dataDirVariable =
"G4DEUTERONHPDATA";
59 particleName =
"Deuteron";
61 dataDirVariable =
"G4TRITONHPDATA";
62 particleName =
"Triton";
64 dataDirVariable =
"G4HE3HPDATA";
67 dataDirVariable =
"G4ALPHAHPDATA";
68 particleName =
"Alpha";
70 G4String message(
"G4ParticleHPInelasticData may only be called for neutron, proton, deuteron, triton, He3 or alpha, while it is called for " + projectile->
GetParticleName());
75 dataName.at(0) = toupper(dataName.at(0)) ;
78 if ( !std::getenv(dataDirVariable) && !std::getenv(
"G4PARTICLEHPDATA" ) ){
79 G4String message(
"Please setenv G4PARTICLEHPDATA (recommended) or, at least setenv " +
85 if ( std::getenv(dataDirVariable) ) {
86 dirName = std::getenv(dataDirVariable);
88 G4String baseName = std::getenv(
"G4PARTICLEHPDATA" );
89 dirName = baseName +
"/" + particleName;
93 G4cout <<
"@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->
GetParticleName() <<
" data directory variable is " << dataDirVariable <<
" pointing to " << dirName <<
G4endl;
101 theCrossSections = 0;
102 theProjectile=projectile;
105 instanceOfWorker =
false;
109 instanceOfWorker =
true;
111 element_cache = NULL;
112 material_cache = NULL;
119 if ( theCrossSections != NULL && instanceOfWorker !=
true ) {
121 delete theCrossSections;
122 theCrossSections = NULL;
124 if ( theHPData != NULL && instanceOfWorker !=
true ) {
149 if ( dp->
GetKineticEnergy() == ke_cache && element == element_cache && material == material_cache )
return xs_cache;
152 element_cache = element;
153 material_cache = material;
181 G4cout <<
"Find a flag of \"G4PHP_NEGLECT_DOPPLER\"." <<
G4endl;
182 G4cout <<
"On the fly Doppler broadening will be neglect in the cross section calculation of inelastic scattering of neutrons (<20MeV)." <<
G4endl;
201 if ( theCrossSections == NULL )
211 for(
size_t i=0; i<numberOfElements; ++i )
225 if(&projectile!=theProjectile)
226 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use ParticleHP data for a wrong projectile!!!");
239 G4cout <<
"Inelastic Cross Section of Neutron HP"<<
G4endl;
240 G4cout <<
"(Pointwise cross-section at 0 Kelvin.)" <<
G4endl;
250 for (
size_t i = 0 ; i < numberOfElements ; ++i )
257 for ( ie = 0 ; ie < 130 ; ie++ )
260 G4bool outOfRange =
false;
262 if ( eKinetic < 20*CLHEP::MeV )
264 G4cout << eKinetic/CLHEP::eV <<
" " << (*((*theCrossSections)(i))).GetValue(eKinetic, outOfRange)/CLHEP::barn <<
G4endl;
292 if ( eKinetic < aT * CLHEP::k_Boltzmann )
299 return ( (*((*theCrossSections)(index))).GetValue(eKinetic, outOfRange) )* factor;
326#ifndef G4PHP_DOPPLER_LOOP_ONCE
327 while(counter == 0 || std::abs(
buffer-result/std::max(1,counter)) > 0.01*
buffer)
329 if(counter)
buffer = result/counter;
337 boosted.
Lorentz(theNeutron, aThermalNuc);
339 aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
346#ifndef G4PHP_DOPPLER_LOOP_ONCE
358 aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag;
361#ifndef G4PHP_DOPPLER_LOOP_ONCE
388 outFile <<
"Extension of High Precision cross section for inelastic reaction of proton, deuteron, triton, He3 and alpha below 20MeV\n";
std::vector< G4Element * > G4ElementTable
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
static G4ParticleHPData * Instance(G4ParticleDefinition *projectile)
G4PhysicsVector * MakePhysicsVector(G4Element *thE, G4ParticleHPFissionData *theP)
G4bool IsIsoApplicable(const G4DynamicParticle *, G4int, G4int, const G4Element *, const G4Material *)
virtual void CrossSectionDescription(std::ostream &) const
void DumpPhysicsTable(const G4ParticleDefinition &)
G4double GetIsoCrossSection(const G4DynamicParticle *, G4int, G4int, const G4Isotope *, const G4Element *, const G4Material *)
void SetVerboseLevel(G4int)
~G4ParticleHPInelasticData()
G4ParticleHPInelasticData(G4ParticleDefinition *projectile=G4Neutron::Neutron())
G4int GetVerboseLevel() const
G4double GetCrossSection(const G4DynamicParticle *, const G4Element *, G4double aT)
void BuildPhysicsTable(const G4ParticleDefinition &)
void SetVerboseLevel(G4int i)
G4PhysicsTable * GetInelasticCrossSections(const G4ParticleDefinition *)
void RegisterInelasticCrossSections(const G4ParticleDefinition *, G4PhysicsTable *)
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 SetName(const G4String &)
void SetMinKinEnergy(G4double value)
G4double GetMinKinEnergy() const