55 std::ostringstream ost;
58 std::ifstream from(aName, std::ios::in);
62 std::ifstream theGammaData(aName, std::ios::in);
75 if(!getenv(
"G4NEUTRONHPDATA"))
76 throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
77 G4String tBase = getenv(
"G4NEUTRONHPDATA");
91 if(getenv(
"NeutronHPNamesLogging"))
G4cout <<
"Skipped = "<< filename <<
" "<<A<<
" "<<Z<<
G4endl;
101 std::istringstream theData(std::ios::in);
115 while (theData >> infoType)
118 if(dummy==
INT_MAX) theData >> dummy >> dummy;
143 else if(dataType==12)
149 else if(dataType==13)
155 else if(dataType==14)
160 else if(dataType==15)
167 throw G4HadronicException(__FILE__, __LINE__,
"Data-type unknown to G4NeutronHPInelasticBaseFS");
200 if ( targetMass == 0 )
213 boosted.
Lorentz(theNeutron, theTarget);
223 for(ii=0; ii<nDef; ii++)
227 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
228 thePhaseSpaceDistribution.
SetNeutron(&theNeutron);
229 thePhaseSpaceDistribution.
SetTarget(&theTarget);
230 for(ii=0; ii<nDef; ii++)
232 G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
236 aSec->
Lorentz(*aSec, -1.*theTarget);
279 for(i0=0; i0<nDef; i0++) Done[i0] =
false;
286 for(i=0; i<tmpHadrons->size(); i++)
288 for(ii=0; ii<nDef; ii++)
289 if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
296 for(i0=0; i0<nDef; i0++)
318 throw G4HadronicException(__FILE__, __LINE__,
"No energy distribution to sample from in InelasticBaseFS::BaseApply");
331 G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
333 G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
334 G4double p1=std::sqrt(2.*mass2*emin);
344 bufferedDirection = -bufferedDirection;
352 +bufferedDirection.
mag2()) );
354 aHadron->
Lorentz(*aHadron, -1.*(theTarget+theNeutron));
360 tmpHadrons->push_back(aHadron);
367 throw G4HadronicException(__FILE__, __LINE__,
"No data to create the neutrons in NInelasticFS");
375 boosted_tmp.
Lorentz(theNeutron, theTarget);
380 for(i=0; i<thePhotons->size(); i++)
383 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
392 theGammaEnergy = anEnergy-theGammaEnergy;
402 for(i=0; i<tmpHadrons->size(); i++)
406 eBindProducts+=eBindN;
410 eBindProducts+=eBindP;
414 eBindProducts+=eBindD;
418 eBindProducts+=eBindT;
420 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4He3::He3())
422 eBindProducts+=eBindHe3;
424 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4Alpha::Alpha())
426 eBindProducts+=eBindA;
431 theGammaEnergy += eBindProducts;
443 theGammaEnergy -= (2*eBindA);
464 if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
468 if(theOtherPhotons != 0)
470 for(
unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
472 thePhotons->push_back(theOtherPhotons->operator[](iii));
474 delete theOtherPhotons;
477 if(iLevel == -1)
break;
482 unsigned int nSecondaries = tmpHadrons->size();
483 unsigned int nPhotons = 0;
484 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
485 nSecondaries += nPhotons;
488 for(i=0; i<nSecondaries-nPhotons; i++)
491 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
492 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
494 delete tmpHadrons->operator[](i);
498 for(i=0; i<nPhotons; i++)
501 theSec->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
502 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
504 delete thePhotons->operator[](i);
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void SetNeutron(const G4ReactionProduct &aNeutron)
void SetTarget(G4ReactionProduct &aTarget)
G4NeutronHPPhotonDist * theFinalStatePhotons
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4double GetTotalMeanEnergy()
G4NeutronHPNames theNames
void SetMomentum(const G4ThreeVector &momentum)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void Init(G4double aMass, G4int aCount)
void SetNeutron(G4ReactionProduct *aNeutron)
void InitGammas(G4double AR, G4double ZR)
void SetKineticEnergy(const G4double en)
static G4NeutronHPManager * GetInstance()
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
void Init(std::istream &aDataFile)
void SetTarget(const G4ReactionProduct &aTarget)
G4double Sample(G4double anEnergy, G4int &it)
void SetTarget(G4ReactionProduct *aTarget)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
void GetDataStream(G4String, std::istringstream &iss)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4NeutronHPEnergyDistribution * theEnergyDistribution
G4ParticleDefinition * GetDefinition() const
G4NeutronHPVector * theXsection
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void InitAngular(std::istream &aDataFile)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4HadFinalState theResult
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
void SetNeutron(G4ReactionProduct &aNeutron)
G4double GetKineticEnergy() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit)
void SetTotalEnergy(const G4double en)
G4ErrorTarget * theTarget
void InitEnergies(std::istream &aDataFile)
static G4Triton * Triton()
void BaseApply(const G4HadProjectile &theTrack, G4ParticleDefinition **theDefs, G4int nDef)
static G4Proton * Proton()
void Init(std::istream &aDataFile)
static G4Neutron * Neutron()
G4NeutronHPEnAngCorrelation * theEnergyAngData
const G4LorentzVector & Get4Momentum() const
static G4Deuteron * Deuteron()
static G4IonTable * GetIonTable()
G4double GetKineticEnergy() const
void SampleAndUpdate(G4ReactionProduct &aNeutron)
G4int GetNumberOfLevels()
G4double GetTotalEnergy() const
G4bool InitMean(std::istream &aDataFile)
G4double total(Particle const *const p1, Particle const *const p2)
G4double GetPDGMass() const
static G4double GetBindingEnergy(const G4int A, const G4int Z)
G4double GetLevelEnergy(G4int aLevel)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
void Init(std::istream &theData)
G4ThreeVector GetMomentum() const
G4NeutronHPAngular * theAngularDistribution
G4double GetTemperature() const
const G4Material * GetMaterial() const
G4ReactionProductVector * Sample(G4double anEnergy)
G4ReactionProductVector * GetDecayGammas(G4int aLevel)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void adjust_final_state(G4LorentzVector)
G4double GetPDGCharge() const
G4NeutronHPDeExGammas theGammas
void InitPartials(std::istream &aDataFile)
void AddSecondary(G4DynamicParticle *aP)
void Init(std::istream &aDataFile)
G4int GetBaryonNumber() const
G4double theNuclearMassDifference