54 std::ostringstream ost;
57 std::ifstream from(aName, std::ios::in);
61 std::ifstream theGammaData(aName, std::ios::in);
74 if(!getenv(
"G4NEUTRONHPDATA"))
75 throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files.");
76 G4String tBase = getenv(
"G4NEUTRONHPDATA");
90 if(getenv(
"NeutronHPNamesLogging"))
G4cout <<
"Skipped = "<< filename <<
" "<<A<<
" "<<Z<<
G4endl;
98 std::ifstream theData(filename, std::ios::in);
110 while (theData >> infoType)
113 if(dummy==
INT_MAX) theData >> dummy >> dummy;
138 else if(dataType==12)
144 else if(dataType==13)
150 else if(dataType==14)
155 else if(dataType==15)
162 throw G4HadronicException(__FILE__, __LINE__,
"Data-type unknown to G4NeutronHPInelasticBaseFS");
195 if ( targetMass == 0 )
208 boosted.
Lorentz(theNeutron, theTarget);
218 for(ii=0; ii<nDef; ii++)
222 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
223 thePhaseSpaceDistribution.
SetNeutron(&theNeutron);
224 thePhaseSpaceDistribution.
SetTarget(&theTarget);
225 for(ii=0; ii<nDef; ii++)
227 G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
231 aSec->
Lorentz(*aSec, -1.*theTarget);
274 for(i0=0; i0<nDef; i0++) Done[i0] =
false;
281 for(i=0; i<tmpHadrons->size(); i++)
283 for(ii=0; ii<nDef; ii++)
284 if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
291 for(i0=0; i0<nDef; i0++)
313 throw G4HadronicException(__FILE__, __LINE__,
"No energy distribution to sample from in InelasticBaseFS::BaseApply");
326 G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
328 G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
329 G4double p1=std::sqrt(2.*mass2*emin);
339 bufferedDirection = -bufferedDirection;
347 +bufferedDirection.
mag2()) );
349 aHadron->
Lorentz(*aHadron, -1.*(theTarget+theNeutron));
355 tmpHadrons->push_back(aHadron);
362 throw G4HadronicException(__FILE__, __LINE__,
"No data to create the neutrons in NInelasticFS");
370 boosted_tmp.
Lorentz(theNeutron, theTarget);
375 for(i=0; i<thePhotons->size(); i++)
378 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
387 theGammaEnergy = anEnergy-theGammaEnergy;
397 for(i=0; i<tmpHadrons->size(); i++)
401 eBindProducts+=eBindN;
405 eBindProducts+=eBindP;
409 eBindProducts+=eBindD;
413 eBindProducts+=eBindT;
415 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4He3::He3())
417 eBindProducts+=eBindHe3;
419 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4Alpha::Alpha())
421 eBindProducts+=eBindA;
426 theGammaEnergy += eBindProducts;
438 theGammaEnergy -= (2*eBindA);
459 if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
463 if(theOtherPhotons != 0)
465 for(
unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
467 thePhotons->push_back(theOtherPhotons->operator[](iii));
469 delete theOtherPhotons;
472 if(iLevel == -1)
break;
477 unsigned int nSecondaries = tmpHadrons->size();
478 unsigned int nPhotons = 0;
479 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
480 nSecondaries += nPhotons;
483 for(i=0; i<nSecondaries-nPhotons; i++)
486 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
487 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
489 delete tmpHadrons->operator[](i);
493 for(i=0; i<nPhotons; i++)
496 theSec->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
497 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
499 delete thePhotons->operator[](i);
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4DLLIMPORT std::ostream G4cout
static G4Deuteron * Deuteron()
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTemperature() const
void SetNeutron(const G4ReactionProduct &aNeutron)
void Init(std::ifstream &aDataFile)
void SampleAndUpdate(G4ReactionProduct &aNeutron)
void SetTarget(const G4ReactionProduct &aTarget)
G4double GetLevelEnergy(G4int aLevel)
G4int GetNumberOfLevels()
G4ReactionProductVector * GetDecayGammas(G4int aLevel)
void Init(std::ifstream &aDataFile)
G4double GetTotalMeanEnergy()
void SetNeutron(G4ReactionProduct &aNeutron)
void Init(std::ifstream &aDataFile)
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * Sample(G4double anEnergy)
void Init(std::ifstream &theData)
G4double Sample(G4double anEnergy, G4int &it)
G4HadFinalState theResult
G4NeutronHPNames theNames
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
void adjust_final_state(G4LorentzVector)
G4NeutronHPEnergyDistribution * theEnergyDistribution
G4NeutronHPVector * theXsection
G4NeutronHPEnAngCorrelation * theEnergyAngData
void BaseApply(const G4HadProjectile &theTrack, G4ParticleDefinition **theDefs, G4int nDef)
void InitGammas(G4double AR, G4double ZR)
G4NeutronHPAngular * theAngularDistribution
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit)
G4NeutronHPPhotonDist * theFinalStatePhotons
G4NeutronHPDeExGammas theGammas
G4double theNuclearMassDifference
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)
void Init(G4double aMass, G4int aCount)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void InitPartials(std::ifstream &aDataFile)
G4bool InitMean(std::ifstream &aDataFile)
void InitEnergies(std::ifstream &aDataFile)
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void InitAngular(std::ifstream &aDataFile)
void Init(std::ifstream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
static G4Neutron * Neutron()
static G4double GetBindingEnergy(const G4int A, const G4int Z)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4double GetPDGMass() const
G4double GetPDGCharge() const
G4int GetBaryonNumber() const
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * GetIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
G4ParticleDefinition * GetDefinition() const
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
static G4Triton * Triton()
void SetNeutron(G4ReactionProduct *aNeutron)
void SetTarget(G4ReactionProduct *aTarget)