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");
185 theNeutron.SetKineticEnergy( eKinetic );
201 if ( targetMass == 0 )
214 boosted.
Lorentz(theNeutron, theTarget);
224 for(ii=0; ii<nDef; ii++)
228 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
229 thePhaseSpaceDistribution.
SetNeutron(&theNeutron);
230 thePhaseSpaceDistribution.
SetTarget(&theTarget);
231 for(ii=0; ii<nDef; ii++)
233 G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
237 aSec->
Lorentz(*aSec, -1.*theTarget);
278 if ( tmpHadrons != NULL ) {
283 for (
G4int j = 0 ; j != (
G4int)tmpHadrons->size() ; j++ ) {
284 if ( tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber() > maxA ) {
285 maxA = tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
288 sumA += tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
289 sumZ +=
G4int( tmpHadrons->at(j)->GetDefinition()->GetPDGCharge() +
eps );
293 if ( dA < 0 || dZ < 0 ) {
294 G4int newA = tmpHadrons->at(jAtMaxA)->GetDefinition()->GetBaryonNumber() + dA ;
295 G4int newZ =
G4int( tmpHadrons->at(jAtMaxA)->GetDefinition()->GetPDGCharge() +
eps ) + dZ;
297 tmpHadrons->at( jAtMaxA )->SetDefinition( pd );
307 for(i0=0; i0<nDef; i0++) Done[i0] =
false;
314 for(i=0; i<tmpHadrons->size(); i++)
316 for(ii=0; ii<nDef; ii++)
317 if(!Done[ii] && tmpHadrons->operator[](i)->GetDefinition() == theDefs[ii])
324 for(i0=0; i0<nDef; i0++)
346 throw G4HadronicException(__FILE__, __LINE__,
"No energy distribution to sample from in InelasticBaseFS::BaseApply");
359 G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
361 G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
363 bufferedDirection = p1*aHadron->
GetMomentum().unit();
372 bufferedDirection = -bufferedDirection;
380 +bufferedDirection.mag2()) );
382 aHadron->
Lorentz(*aHadron, -1.*(theTarget+theNeutron));
388 tmpHadrons->push_back(aHadron);
395 throw G4HadronicException(__FILE__, __LINE__,
"No data to create the neutrons in NInelasticFS");
403 boosted_tmp.
Lorentz(theNeutron, theTarget);
408 for(i=0; i<thePhotons->size(); i++)
411 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
420 theGammaEnergy = anEnergy-theGammaEnergy;
430 for(i=0; i<tmpHadrons->size(); i++)
434 eBindProducts+=eBindN;
438 eBindProducts+=eBindP;
442 eBindProducts+=eBindD;
446 eBindProducts+=eBindT;
448 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4He3::He3())
450 eBindProducts+=eBindHe3;
452 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4Alpha::Alpha())
454 eBindProducts+=eBindA;
459 theGammaEnergy += eBindProducts;
471 theGammaEnergy -= (2*eBindA);
492 if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
496 if(theOtherPhotons != 0)
498 for(
unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
500 thePhotons->push_back(theOtherPhotons->operator[](iii));
502 delete theOtherPhotons;
505 if(iLevel == -1)
break;
510 unsigned int nSecondaries = tmpHadrons->size();
511 unsigned int nPhotons = 0;
512 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
513 nSecondaries += nPhotons;
516 for(i=0; i<nSecondaries-nPhotons; i++)
519 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
520 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
522 delete tmpHadrons->operator[](i);
526 for(i=0; i<nPhotons; i++)
529 theSec->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
530 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
532 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)
G4Cache< G4HadFinalState * > theResult
CLHEP::Hep3Vector G4ThreeVector
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.)
static const G4double eps
void GetDataStream(G4String, std::istringstream &iss)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4NeutronHPEnergyDistribution * theEnergyDistribution
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4NeutronHPVector * theXsection
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void InitAngular(std::istream &aDataFile)
const G4ParticleDefinition * GetDefinition() const
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
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
static const G4double A[nN]
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 Init(std::istream &theData)
G4ThreeVector GetMomentum() const
G4NeutronHPAngular * theAngularDistribution
G4double GetTemperature() const
const G4Material * GetMaterial() const
G4ReactionProductVector * Sample(G4double anEnergy)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
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
void Put(const value_type &val) const
G4NeutronHPDeExGammas theGammas
void InitPartials(std::istream &aDataFile)
void Init(std::istream &aDataFile)
G4int GetBaryonNumber() const
CLHEP::HepLorentzVector G4LorentzVector
G4double theNuclearMassDifference