194 incidReactionProduct.SetKineticEnergy( eKinetic );
212 if ( targetMass == 0 )
231 boosted.
Lorentz(incidReactionProduct, theTarget);
241 for(ii=0; ii<nDef; ii++)
245 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
247 thePhaseSpaceDistribution.
SetTarget(&theTarget);
248 for(ii=0; ii<nDef; ii++)
250 G4double massCode = 1000.*std::abs(theDefs[ii]->GetPDGCharge());
254 aSec->
Lorentz(*aSec, -1.*theTarget);
300 if ( !getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) {
303 if ( tmpHadrons != NULL ) {
308 for (
G4int j = 0 ; j != (
G4int)tmpHadrons->size() ; j++ ) {
309 if ( tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber() > maxA ) {
310 maxA = tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
313 sumA += tmpHadrons->at(j)->GetDefinition()->GetBaryonNumber();
314 sumZ +=
G4int( tmpHadrons->at(j)->GetDefinition()->GetPDGCharge() +
eps );
318 if ( dA < 0 || dZ < 0 ) {
319 G4int newA = tmpHadrons->at(jAtMaxA)->GetDefinition()->GetBaryonNumber() + dA ;
320 G4int newZ =
G4int( tmpHadrons->at(jAtMaxA)->GetDefinition()->GetPDGCharge() +
eps ) + dZ;
322 tmpHadrons->at( jAtMaxA )->SetDefinition( pd );
332 for(i0=0; i0<nDef; i0++) Done[i0] =
false;
354 for(i0=0; i0<nDef; i0++)
376 throw G4HadronicException(__FILE__, __LINE__,
"No energy distribution to sample from in InelasticBaseFS::BaseApply");
389 G4double availableEnergy = eKinetic+massn+localMass-mass1-mass2-concreteMass;
391 G4double emin = availableEnergy+mass1+mass2 - std::sqrt((mass1+mass2)*(mass1+mass2)+orgMomentum*orgMomentum);
392 G4double p1=std::sqrt(2.*mass2*emin);
395 if(getenv(
"G4ParticleHPDebug"))
397 G4cout <<
"G4ParticleHPInelasticBaseFS "<<z1<<
" "<<theBaseZ<<
" "<<a1<<
" "<<theBaseA<<
" "<<availableEnergy<<
" "
404 bufferedDirection = -bufferedDirection;
408 if(getenv(
"G4ParticleHPDebug"))
410 G4cout <<
" G4ParticleHPInelasticBaseFS "<<bufferedDirection.mag2()<<
G4endl;
414 +bufferedDirection.mag2()) );
416 aHadron->
Lorentz(*aHadron, -1.*(theTarget+incidReactionProduct));
418 if(getenv(
"G4ParticleHPDebug"))
424 tmpHadrons->push_back(aHadron);
434 throw G4HadronicException(__FILE__, __LINE__,
"No data to create the neutrons in NInelasticFS");
442 boosted_tmp.
Lorentz(incidReactionProduct, theTarget);
447 for(i=0; i<thePhotons->size(); i++)
450 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1.*theTarget);
458 G4bool bAdjustPhotons =
true;
460 bAdjustPhotons =
true;
462 if ( getenv(
"G4PHP_DO_NOT_ADJUST_FINAL_STATE" ) ) bAdjustPhotons =
false;
465 if( bAdjustPhotons ) {
468 theGammaEnergy = anEnergy-theGammaEnergy;
478 for(i=0; i<tmpHadrons->size(); i++)
482 eBindProducts+=eBindN;
486 eBindProducts+=eBindP;
490 eBindProducts+=eBindD;
494 eBindProducts+=eBindT;
496 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4He3::He3())
498 eBindProducts+=eBindHe3;
500 else if(tmpHadrons->operator[](i)->GetDefinition() ==
G4Alpha::Alpha())
502 eBindProducts+=eBindA;
507 theGammaEnergy += eBindProducts;
510 if( getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply gamma Energy " << theGammaEnergy <<
" eBindProducts " << eBindProducts <<
G4endl;
523 theGammaEnergy -= (2*eBindA);
539 if( getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply adding gamma from level " << iLevel << theOtherPhotons->operator[](ii)->GetKineticEnergy() <<
G4endl;
547 if(random > (eHigh-eLow)/(theGammaEnergy-eLow)) iLevel++;
551 if(theOtherPhotons != 0)
553 for(
unsigned int iii=0; iii<theOtherPhotons->size(); iii++)
555 thePhotons->push_back(theOtherPhotons->operator[](iii));
557 if( getenv(
"G4ParticleHPDebug"))
558 G4cout << iii <<
" G4ParticleHPInelasticBaseFS::BaseApply adding gamma " << theOtherPhotons->operator[](iii)->GetKineticEnergy() <<
G4endl;
561 delete theOtherPhotons;
564 if(iLevel == -1)
break;
570 unsigned int nSecondaries = tmpHadrons->size();
571 unsigned int nPhotons = 0;
572 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
573 nSecondaries += nPhotons;
576 if( getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply N hadrons " << nSecondaries-nPhotons <<
G4endl;
579 for(i=0; i<nSecondaries-nPhotons; i++)
582 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
583 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
589 delete tmpHadrons->operator[](i);
592 if( getenv(
"G4ParticleHPDebug"))
G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply N photons " << nPhotons << G4endl;
596 for(i=0; i<nPhotons; i++)
599 theSec->
SetDefinition(thePhotons->operator[](i)->GetDefinition());
600 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
605 delete thePhotons->operator[](i);
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)
G4double GetTotalMeanEnergy()
G4ReactionProductVector * GetDecayGammas(G4int aLevel)
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4Cache< G4HadFinalState * > theResult
void SetMomentum(const G4ThreeVector &momentum)
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4double GetKineticEnergy() const
static constexpr double keV
void SetKineticEnergy(const G4double en)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4ParticleHPEnAngCorrelation * theEnergyAngData
static const G4double eps
G4ParticleDefinition * GetDefinition() const
G4double Sample(G4double anEnergy, G4int &it)
G4ReactionProductVector * Sample(G4double anEnergy)
const G4String & GetParticleName() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetProjectileRP(const G4ReactionProduct &anIncidentParticleRP)
G4ParticleDefinition * theProjectile
void Init(G4double aMass, G4int aCount)
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void SetTarget(const G4ReactionProduct &aTarget)
G4ParticleHPDeExGammas theGammas
void adjust_final_state(G4LorentzVector)
const G4ParticleDefinition * GetDefinition() const
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4GLOB_DLL std::ostream G4cout
void SampleAndUpdate(G4ReactionProduct &anIncidentParticle)
const G4ParticleDefinition * GetDefinition() const
G4int GetNumberOfLevels()
G4double GetKineticEnergy() const
void SetTotalEnergy(const G4double en)
static constexpr double MeV
static G4Triton * Triton()
static G4Proton * Proton()
static G4Neutron * Neutron()
const G4ParticleDefinition * GetParticleDefinition() const
const G4LorentzVector & Get4Momentum() const
void SetProjectileRP(G4ReactionProduct *aIncidentParticleRP)
static G4Deuteron * Deuteron()
static G4IonTable * GetIonTable()
G4double GetKineticEnergy() const
G4double theNuclearMassDifference
G4double GetTotalEnergy() const
void SetTarget(G4ReactionProduct *aTarget)
G4double GetPDGMass() const
static G4double GetBindingEnergy(const G4int A, const G4int Z)
G4ParticleHPEnergyDistribution * theEnergyDistribution
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
const G4Material * GetMaterial() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4ParticleHPPhotonDist * theFinalStatePhotons
G4double GetPDGCharge() const
void Put(const value_type &val) const
G4double GetLevelEnergy(G4int aLevel)
G4int GetNumberOfSecondaries() const
G4ParticleHPAngular * theAngularDistribution
G4ThreeVector GetMomentum() const
G4int GetBaryonNumber() const