71 std::ostringstream ost;
74 std::ifstream from(aName, std::ios::in);
77 std::ifstream theGammaData(aName, std::ios::in);
98 G4cout <<
" G4ParticleHPInelasticBaseFS::Init FILE " << filename <<
G4endl;
105 G4cout <<
"Skipped = " << filename <<
" " <<
A <<
" " << Z <<
G4endl;
113 std::istringstream theData(std::ios::in);
126 while (theData >> infoType)
140 else if (dataType == 4) {
145 else if (dataType == 5) {
150 else if (dataType == 6) {
155 else if (dataType == 12) {
160 else if (dataType == 13) {
165 else if (dataType == 14) {
169 else if (dataType == 15) {
178 ed,
"Data-type unknown");
198 /CLHEP::neutron_mass_c2;
209 if(0.0 < x) { targetMass = x/CLHEP::neutron_mass_c2; }
213 if(0.0 < x) { targetMass = x/CLHEP::neutron_mass_c2; }
223 incidReactionProduct.
GetMomentum() / CLHEP::neutron_mass_c2;
232 boosted.
Lorentz(incidReactionProduct, theTarget);
243 for (ii = 0; ii < nDef; ++ii) {
248 if (std::abs(
Qvalue) < CLHEP::keV) {
254 for (ii = 0; ii < nDef; ++ii) {
259 if (ResidualA > 0 && ResidualZ > 0) {
265 if (std::abs(
Qvalue) > 400 * CLHEP::MeV) {
267 Qvalue = 1.1 * CLHEP::keV;
272 thePhaseSpaceDistribution.
Init(aPhaseMass, nDef);
274 thePhaseSpaceDistribution.
SetTarget(&theTarget);
277 for (ii = 0; ii < nDef; ++ii) {
278 G4double massCode = 1000. * std::abs(theDefs[ii]->GetPDGCharge());
282 aSec->
Lorentz(*aSec, -1. * theTarget);
290 G4cout <<
this <<
" G4ParticleHPInelasticBaseFS::BaseApply NoFSData add secondary "
291 << aPart->GetParticleDefinition()->GetParticleName()
292 <<
" E= " << aPart->GetKineticEnergy() <<
" NSECO "
327 G4int projZ =
G4lrint(hproj->GetPDGCharge()/CLHEP::eplus);
331 if (tmpHadrons !=
nullptr) {
336 for (
G4int j = 0; j != (
G4int)tmpHadrons->size(); ++j) {
337 auto had = ((*tmpHadrons)[j])->GetDefinition();
338 if (had->GetBaryonNumber() > maxA) {
339 maxA = had->GetBaryonNumber();
342 sumA += had->GetBaryonNumber();
343 sumZ +=
G4lrint(had->GetPDGCharge()/CLHEP::eplus);
347 if (dA < 0 || dZ < 0) {
348 auto p = ((*tmpHadrons)[jAtMaxA])->GetDefinition();
349 G4int newA = p->GetBaryonNumber() + dA;
350 G4int newZ =
G4lrint(p->GetPDGCharge()/CLHEP::eplus) + dZ;
351 if (newA > newZ && newZ > 0) {
353 ((*tmpHadrons)[jAtMaxA])->SetDefinition(pd);
361 auto Done =
new G4bool[nDef];
363 for (i0 = 0; i0 < nDef; ++i0)
370 for (i0 = 0; i0 < nDef; ++i0) {
377 else if (nDef == 1) {
381 else if (nDef == 2) {
388 "No energy distribution to sample from in InelasticBaseFS::BaseApply");
397 G4lrint((theDefs[0]->GetPDGCharge() + theDefs[1]->GetPDGCharge())/CLHEP::eplus);
400 G4double availableEnergy = eKinetic + massn + localMass - mass1 - mass2
403 G4double emin = availableEnergy + mass1 + mass2
404 - std::sqrt((mass1 + mass2) * (mass1 + mass2) + orgMomentum * orgMomentum);
405 G4double p1 = std::sqrt(2. * mass2 * emin);
411 <<
" " << a1 <<
" " <<
theBaseA <<
" " << availableEnergy
417 bufferedDirection = -bufferedDirection;
423 aHadron->
Lorentz(*aHadron, -1. * (theTarget + incidReactionProduct));
428 <<
" bufDir^2=" << bufferedDirection.
mag2()
433 tmpHadrons->push_back(aHadron);
436 G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply FSData add secondary "
452 boosted_tmp.
Lorentz(incidReactionProduct, theTarget);
455 if (thePhotons !=
nullptr) {
456 for (i = 0; i < thePhotons->size(); ++i) {
458 thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), -1. * theTarget);
464 G4bool bAdjustPhotons{
true};
466 bAdjustPhotons =
true;
471 if (bAdjustPhotons) {
474 theGammaEnergy = anEnergy - theGammaEnergy;
484 for (
auto const & had : *tmpHadrons) {
486 eBindProducts += eBindN;
489 eBindProducts += eBindP;
492 eBindProducts += eBindD;
495 eBindProducts += eBindT;
497 else if (had->GetDefinition() ==
G4He3::He3()) {
498 eBindProducts += eBindHe3;
501 eBindProducts += eBindA;
505 theGammaEnergy += eBindProducts;
509 G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply gamma Energy " << theGammaEnergy
510 <<
" eBindProducts " << eBindProducts <<
G4endl;
520 theGammaEnergy -= (2 * eBindA);
524 if (theGammaEnergy > 0.0) {
527 if (e < theGammaEnergy) {
537 std::size_t nSecondaries = tmpHadrons->size();
538 std::size_t nPhotons = 0;
539 if (thePhotons !=
nullptr) {
540 nPhotons = thePhotons->size();
542 nSecondaries += nPhotons;
547 G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply N hadrons " << nSecondaries - nPhotons
551 for (i = 0; i < nSecondaries - nPhotons; ++i) {
553 theSec->
SetDefinition(tmpHadrons->operator[](i)->GetDefinition());
554 theSec->
SetMomentum(tmpHadrons->operator[](i)->GetMomentum());
558 G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply add secondary2 "
563 delete (*tmpHadrons)[i];
567 G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply N photons " << nPhotons <<
G4endl;
569 if (thePhotons !=
nullptr) {
570 for (i = 0; i < nPhotons; ++i) {
573 theSec->
SetMomentum((*thePhotons)[i]->GetMomentum());
577 G4cout <<
" G4ParticleHPInelasticBaseFS::BaseApply add secondary3 "
582 delete thePhotons->operator[](i);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cout
void Put(const value_type &val) const
static G4Deuteron * Deuteron()
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetKineticEnergy() const
void SetMomentum(const G4ThreeVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
std::size_t GetNumberOfSecondaries() const
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4double GetTemperature() const
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
G4int GetAtomicNumber() const
G4double GetPDGMass() const
G4int GetBaryonNumber() const
const G4String & GetParticleName() const
void SetTarget(const G4ReactionProduct &aTarget)
void SetProjectileRP(const G4ReactionProduct &anIncidentParticleRP)
void Init(std::istream &aDataFile)
void SampleAndUpdate(G4ReactionProduct &anIncidentParticle)
G4ReactionProductVector * GetDecayGammas(G4int idx) const
G4double GetLevelEnergy(G4int idx) const
G4int GetNumberOfLevels() const
void Init(std::istream &aDataFile)
void Init(std::istream &aDataFile)
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
G4double GetTotalMeanEnergy()
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProductVector * Sample(G4double anEnergy)
void Init(std::istream &theData)
G4double Sample(G4double anEnergy, G4int &it)
void SetA_Z(G4double anA, G4double aZ, G4int aM=0)
G4ParticleHPManager * fManager
G4ParticleDefinition * theProjectile
G4Cache< G4HadFinalState * > theResult
void SetAZMs(G4ParticleHPDataUsed used)
void adjust_final_state(G4LorentzVector)
G4ParticleHPNames theNames
void BaseApply(const G4HadProjectile &theTrack, G4ParticleDefinition **theDefs, G4int nDef)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &bit, G4ParticleDefinition *) override
void InitGammas(G4double AR, G4double ZR)
G4ParticleHPEnergyDistribution * theEnergyDistribution
G4ParticleHPPhotonDist * theFinalStatePhotons
G4double theNuclearMassDifference
G4ParticleHPAngular * theAngularDistribution
G4ParticleHPVector * theXsection
G4ParticleHPDeExGammas theGammas
G4ParticleHPEnAngCorrelation * theEnergyAngData
G4ParticleHPInelasticBaseFS()
~G4ParticleHPInelasticBaseFS() override
const G4String & GetNeutronHPPath() const
void GetDataStream(const G4String &, std::istringstream &iss)
G4bool GetDoNotAdjustFinalState() const
void Init(G4double aMass, G4int aCount)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass) override
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)
void InitEnergies(std::istream &aDataFile)
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void InitAngular(std::istream &aDataFile)
void InitPartials(std::istream &aDataFile, G4ParticleHPVector *theXsec=nullptr)
G4bool InitMean(std::istream &aDataFile)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetKineticEnergy() const
const G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
static G4Triton * Triton()
void SetProjectileRP(G4ReactionProduct *aIncidentParticleRP)
void SetTarget(G4ReactionProduct *aTarget)
void SetQValue(G4double aValue)