51 const char* dataDirVariable;
54 dataDirVariable =
"G4NEUTRONHPDATA";
56 dataDirVariable =
"G4PROTONHPDATA";
57 particleName =
"Proton";
59 dataDirVariable =
"G4DEUTERONHPDATA";
60 particleName =
"Deuteron";
62 dataDirVariable =
"G4TRITONHPDATA";
63 particleName =
"Triton";
65 dataDirVariable =
"G4HE3HPDATA";
68 dataDirVariable =
"G4ALPHAHPDATA";
69 particleName =
"Alpha";
71 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) = (char)std::toupper(dataName.at(0)) ;
79 G4String message(
"Please setenv G4PARTICLEHPDATA (recommended) or, at least setenv " +
89 dirName = baseName +
"/" + particleName;
93 G4cout <<
"@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->
GetParticleName() <<
" data directory variable is " << dataDirVariable <<
" pointing to " << dirName <<
G4endl;
100 theCrossSections = 0;
101 theProjectile=projectile;
104 instanceOfWorker =
false;
108 instanceOfWorker =
true;
110 element_cache =
nullptr;
111 material_cache =
nullptr;
118 if ( theCrossSections !=
nullptr && instanceOfWorker !=
true ) {
120 delete theCrossSections;
121 theCrossSections =
nullptr;
123 if ( theHPData !=
nullptr && instanceOfWorker !=
true ) {
149 && material == material_cache )
return xs_cache;
152 element_cache = element;
153 material_cache = material;
169 if ( theCrossSections ==
nullptr )
178 for( std::size_t i=0; i<numberOfElements; ++i )
188 if(&projectile!=theProjectile)
189 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 ( std::size_t i = 0 ; i < numberOfElements ; ++i )
218 for ( ie = 0 ; ie < 130 ; ie++ )
221 G4bool outOfRange =
false;
223 if ( eKinetic < 20*CLHEP::MeV )
225 G4cout << eKinetic/CLHEP::eV <<
" "
226 << (*((*theCrossSections)(i))).GetValue(eKinetic, outOfRange)/CLHEP::barn
240 std::size_t index = anE->
GetIndex();
249 if ( eKinetic < aT * CLHEP::k_Boltzmann )
256 return ( (*((*theCrossSections)(index))).GetValue(eKinetic, outOfRange) )* factor;
281#ifndef G4PHP_DOPPLER_LOOP_ONCE
282 while(counter == 0 || std::abs(buffer-result/std::max(1,counter)) > 0.01*buffer)
284 if(counter) buffer = result/counter;
290 boosted.
Lorentz(theNeutron, aThermalNuc);
292 aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
298#ifndef G4PHP_DOPPLER_LOOP_ONCE
310 aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag;
313#ifndef G4PHP_DOPPLER_LOOP_ONCE
334 outFile <<
"Extension of High Precision cross section for inelastic reaction of proton, 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
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 SetMinKinEnergy(G4double value)
G4double GetMinKinEnergy() const
void SetName(const G4String &nam)