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 ( !std::getenv(dataDirVariable) && !std::getenv(
"G4PARTICLEHPDATA" ) ){
78 G4String message(
"Please setenv G4PARTICLEHPDATA (recommended) or, at least setenv " +
84 if ( std::getenv(dataDirVariable) ) {
85 dirName = std::getenv(dataDirVariable);
87 G4String baseName = std::getenv(
"G4PARTICLEHPDATA" );
88 dirName = baseName +
"/" + particleName;
90 G4cout <<
"@@@ G4ParticleHPInelasticData instantiated for particle " << projectile->
GetParticleName() <<
" data directory variable is " << dataDirVariable <<
" pointing to " << dirName <<
G4endl;
173 G4cout <<
"Find a flag of \"G4PHP_NEGLECT_DOPPLER\"." <<
G4endl;
174 G4cout <<
"On the fly Doppler broadening will be neglect in the cross section calculation of inelastic scattering of neutrons (<20MeV)." <<
G4endl;
202 for(
size_t i=0; i<numberOfElements; ++i )
217 throw G4HadronicException(__FILE__, __LINE__,
"Attempt to use ParticleHP data for a wrong projectile!!!");
228 G4cout <<
"Inelastic Cross Section of Neutron HP"<<
G4endl;
229 G4cout <<
"(Pointwise cross-section at 0 Kelvin.)" <<
G4endl;
239 for (
size_t i = 0 ; i < numberOfElements ; ++i )
246 for ( ie = 0 ; ie < 130 ; ie++ )
249 G4bool outOfRange =
false;
287 return ( (*((*
theCrossSections)(index))).GetValue(eKinetic, outOfRange) )* factor;
293 theNeutron.SetKineticEnergy( eKinetic );
314 #ifndef G4PHP_DOPPLER_LOOP_ONCE
315 while(counter == 0 ||
std::abs(buffer-result/
std::max(1,counter)) > 0.01*buffer)
317 if(counter) buffer = result/counter;
325 boosted.
Lorentz(theNeutron, aThermalNuc);
327 aXsection = (*((*theCrossSections)(index))).GetValue(theEkin, outOfRange);
334 #ifndef G4PHP_DOPPLER_LOOP_ONCE
346 aXsection *= (targetVelocity-neutronVelocity).mag()/neutronVMag;
349 #ifndef G4PHP_DOPPLER_LOOP_ONCE
376 outFile <<
"Extension of High Precision cross section for inelastic reaction of proton, deuteron, triton, He3 and alpha below 20MeV\n";