69 std::ostringstream ost;
86 if(!getenv(
"G4NEUTRONHPDATA"))
87 throw G4HadronicException(__FILE__, __LINE__,
"Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files where Inelastic/Gammas data is found.");
88 G4String tBase = getenv(
"G4NEUTRONHPDATA");
95 if( getenv(
"G4ParticleHPDebug") )
G4cout <<
" G4ParticleHPInelasticCompFS::Init FILE " << filename <<
G4endl;
107 if(getenv(
"G4ParticleHPDebug_NamesLogging"))
G4cout <<
"Skipped = "<< filename <<
" "<<A<<
" "<<Z<<
G4endl;
128 G4int infoType, dataType, dummy;
131 while (theData >> infoType)
135 theData >> sfType >> dummy;
137 if(sfType>=600||(sfType<100&&sfType>=50)) it = sfType%50;
145 theData >> dqi >> ilr;
171 else if(dataType==12)
176 else if(dataType==13)
181 else if(dataType==14)
185 else if(dataType==15)
191 throw G4HadronicException(__FILE__, __LINE__,
"Data-type unknown to G4ParticleHPInelasticCompFS");
206 if(i!=0) running[i]=running[i-1];
218 for(i0=0; i0<50; i0++)
222 if(random < running[i0]/sum)
break;
280 boosted.
Lorentz(incidReactionProduct, theTarget);
307 (targetMass - residualMass);
309 if ( availableEnergy < 0 )
314 G4int nothingWasKnownOnHadron = 0;
326 (aHadron.
GetMass()+residualMass));
335 if ( p2 > 0.0 ) p = std::sqrt( p );
358 if (
QI[it] < 0 || 849 <
QI[it] ) dqi =
QI[it];
363 G4int icounter_max=1024;
366 if ( icounter > icounter_max ) {
367 G4cout <<
"Loop-counter exceeded the threshold value at " << __LINE__ <<
"th line of " << __FILE__ <<
"." <<
G4endl;
371 }
while(eSecN>MaxEne);
374 eGamm = eKinetic-eSecN;
380 iLevel+=
G4int(random);
387 while (eKinetic-eExcitation < 0 && iLevel>0)
396 if ( dqi < 0 || 849 < dqi ) useQI =
true;
401 eExcitation = -
QI[it];
419 if ( iLevel == -1 ) iLevel = 0;
425 if ( !find ) iLevel = imaxEx;
429 if(getenv(
"G4ParticleHPDebug") && eKinetic-eExcitation < 0)
431 throw G4HadronicException(__FILE__, __LINE__,
"SEVERE: InelasticCompFS: Consistency of data not good enough, please file report");
433 if(eKinetic-eExcitation < 0) eExcitation = 0;
452 theRestEnergy->
SetMomentum(eGamm*std::sin(std::acos(costh))*std::cos(phi),
453 eGamm*std::sin(std::acos(costh))*std::sin(phi),
456 thePhotons->push_back(theRestEnergy);
467 if ( theParticles != NULL ) {
472 for (
G4int j = 0 ; j != (
G4int)theParticles->size() ; j++ ) {
473 if ( theParticles->at(j)->GetDefinition()->GetBaryonNumber() >
maxA ) {
474 maxA = theParticles->at(j)->GetDefinition()->GetBaryonNumber();
477 sumA += theParticles->at(j)->GetDefinition()->GetBaryonNumber();
478 sumZ +=
G4int( theParticles->at(j)->GetDefinition()->GetPDGCharge() +
eps );
482 if ( dA < 0 || dZ < 0 ) {
483 G4int newA = theParticles->at(jAtMaxA)->GetDefinition()->GetBaryonNumber() + dA ;
484 G4int newZ =
G4int( theParticles->at(jAtMaxA)->GetDefinition()->GetPDGCharge() +
eps ) + dZ;
486 theParticles->at( jAtMaxA )->SetDefinition( pd );
495 nothingWasKnownOnHadron = 1;
509 boosted_tmp.
Lorentz(incidReactionProduct, theTarget);
514 if(thePhotons!=0 && thePhotons->size()!=0)
515 { aBaseEnergy-=thePhotons->operator[](0)->GetTotalEnergy(); }
521 G4bool foundMatchingLevel =
false;
524 for(
G4int j=1; j<it; j++)
534 G4double deltaE = std::abs(testEnergy-aBaseEnergy);
539 if ( thePhotons != NULL ) thePhotons->push_back(theNext->operator[](0));
540 aBaseEnergy = testEnergy-theNext->operator[](0)->GetTotalEnergy();
542 foundMatchingLevel =
true;
551 if(!foundMatchingLevel)
555 if ( thePhotons != NULL ) thePhotons->push_back(theNext->operator[](0));
556 aBaseEnergy = aBaseEnergy-theNext->operator[](0)->GetTotalEnergy();
565 for(i0=0; i0<thePhotons->size(); i0++)
568 thePhotons->operator[](i0)->Lorentz(*(thePhotons->operator[](i0)), -1.*theTarget);
572 if(nothingWasKnownOnHadron)
579 if ( thePhotons != 0 )
581 unsigned int nPhotons = thePhotons->size();
583 for ( ii0=0; ii0<nPhotons; ii0++)
586 totalPhotonEnergy += thePhotons->operator[](ii0)->GetTotalEnergy();
595 G4ThreeVector boostToTargetRest = -target_in_LAB.boostVector();
654 G4int nSecondaries = 2;
655 G4bool needsSeparateRecoil =
false;
656 G4int totalBaryonNumber = 0;
657 G4int totalCharge = 0;
659 if(theParticles != 0)
661 nSecondaries = theParticles->size();
664 for(ii0=0; ii0<theParticles->size(); ii0++)
666 aDef = theParticles->operator[](ii0)->GetDefinition();
669 totalMomentum += theParticles->operator[](ii0)->GetMomentum();
673 needsSeparateRecoil =
true;
683 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
684 nSecondaries += nPhotons;
688 if( theParticles==0 )
698 aHadron.
Lorentz(aHadron, theTarget);
701 ->GetIon(static_cast<G4int>(residualZ), static_cast<G4int>(residualA), 0));
709 theResidual.
Lorentz(theResidual, -1.*theTarget);
713 for(i=0; i<nPhotons; i++)
715 totalPhotonMomentum += thePhotons->operator[](i)->GetMomentum();
728 for(i0=0; i0<theParticles->size(); i0++)
731 theSec->
SetDefinition(theParticles->operator[](i0)->GetDefinition());
732 theSec->
SetMomentum(theParticles->operator[](i0)->GetMomentum());
737 delete theParticles->operator[](i0);
740 if(needsSeparateRecoil && residualZ!=0)
744 ->GetIon(static_cast<G4int>(residualZ), static_cast<G4int>(residualA), 0));
746 resiualKineticEnergy += totalMomentum*totalMomentum;
747 resiualKineticEnergy = std::sqrt(resiualKineticEnergy) - theResidual.
GetMass();
770 for(i=0; i<nPhotons; i++)
775 theSec->
SetDefinition( thePhotons->operator[](i)->GetDefinition() );
777 theSec->
SetMomentum(thePhotons->operator[](i)->GetMomentum());
783 delete thePhotons->operator[](i);
840 if ( ( 1 + (1+A)/A*Q/E1 ) < 0 )
846 G4double beta = std::sqrt ( A*(A+1-AA)/AA*( 1 + (1+A)/A*Q/E1 ) );
849 G4double omega3 = (1+beta*mu)/std::sqrt(beta*beta+1+2*beta*mu);
850 if ( omega3 > 1.0 ) omega3 = 1.0;
853 G4double omega4 = (1-gamma*mu)/std::sqrt(gamma*gamma+1-2*gamma*mu);
854 if ( omega4 > 1.0 ) omega4 = 1.0;
859 G4double pmag = std::sqrt ((E3+M)*(E3+M)-M*M) ;
860 G4ThreeVector p ( 0 , pmag*std::sqrt(1-omega3*omega3), pmag*omega3 );
863 G4double pmag4 = std::sqrt ((E4+M4)*(E4+M4)-M4*M4) ;
864 G4ThreeVector p4 ( 0 , -pmag4*std::sqrt(1-omega4*omega4), pmag4*omega4 );
927 for (
G4int j=0; j<4; j++ )
929 theProds[j].
Lorentz(theProds[j], -1.*theTarget);
967 for (
G4int j=0; j<2; j++ )
970 theProds[j].
Lorentz(theProds[j], -1.*theTarget);
981 G4Exception(
"G4ParticleHPInelasticCompFS::CompositeApply()",
"G4ParticleInelasticCompFS.cc",
FatalException,
"Alpha production with LR!=0.");
G4double total(Particle const *const p1, Particle const *const p2)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static G4ParticleHPManager * GetInstance()
CLHEP::Hep3Vector G4ThreeVector
G4double Sample(G4double anEnergy, G4int &it)
void Init(std::istream &aDataFile)
G4ParticleHPVector * theXsection[51]
static G4Alpha * Definition()
static G4Neutron * Definition()
static G4IonTable * GetIonTable()
void SetKineticEnergy(G4double aEnergy)
void InitGammas(G4double AR, G4double ZR)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4int ApplyMechanismABE(G4ReactionProduct &neut, G4ReactionProduct &carb, G4ReactionProduct *theProds)
G4ParticleDefinition * theProjectile
G4ReactionProductVector * Sample(G4double anEnergy)
void two_body_reaction(G4DynamicParticle *, G4DynamicParticle *, G4DynamicParticle *, G4double mu)
const G4String & GetParticleName() const
G4double GetPDGCharge() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
const G4ParticleDefinition * GetDefinition() const
virtual G4ParticleHPVector * GetXsec()
G4double GetPDGMass() const
G4ParticleHPPhotonDist * theFinalStatePhotons[51]
G4double powN(G4double x, G4int n) const
G4NRESP71M03 nresp71_model
G4ReactionProductVector * GetDecayGammas(G4int aLevel)
G4bool use_nresp71_model(const G4ParticleDefinition *aDefinition, const G4int it, const G4ReactionProduct &theTarget, G4ReactionProduct &boosted)
void GetDataStream(G4String, std::istringstream &iss)
G4double GetTotalEnergy() const
G4int SelectExitChannel(G4double eKinetic)
void SetKineticEnergy(const G4double en)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
G4double GetKineticEnergy() const
static G4Pow * GetInstance()
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4ParticleDefinition * GetDefinition() const
const G4Material * GetMaterial() const
G4double GetLevelEnergy(G4int aLevel)
G4int GetBaryonNumber() const
G4Cache< G4HadFinalState * > theResult
G4ParticleHPNames theNames
G4bool InitMean(std::istream &aDataFile)
G4ErrorTarget * theTarget
G4double GetTotalMomentum() const
G4LorentzVector Get4Momentum() const
double A(double temperature)
G4ParticleHPAngular * theAngularDistribution[51]
G4ParticleHPEnAngCorrelation * theEnergyAngData[51]
static G4double GetNuclearMass(const G4double A, const G4double Z)
static constexpr double eV
G4ThreeVector GetMomentum() const
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void Put(const value_type &val) const
const G4LorentzVector & Get4Momentum() const
G4int GetNumberOfSecondaries() const
G4ReactionProductVector * GetPhotons(G4double anEnergy)
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
G4double GetLevelEnergy()
static constexpr double twopi
void Init(std::istream &aDataFile)
void adjust_final_state(G4LorentzVector)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
const G4ParticleDefinition * GetDefinition() const
void SampleAndUpdate(G4ReactionProduct &anIncidentParticle)
std::vector< G4double > QI
static G4Neutron * Neutron()
void InitPartials(std::istream &aDataFile)
void InitDistributionInitialState(G4ReactionProduct &anIncidentPart, G4ReactionProduct &aTarget, G4int it)
G4int ApplyMechanismI_NBeA2A(G4ReactionProduct &neut, G4ReactionProduct &carb, G4ReactionProduct *theProds, const G4double QI)
void InitAngular(std::istream &aDataFile)
void setTheta(double theta)
void SetMomentum(const G4ThreeVector &momentum)
G4double GetKineticEnergy() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
G4GLOB_DLL std::ostream G4cout
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aSFType, G4ParticleDefinition *)
void Init(std::istream &aDataFile)
G4ParticleHPDeExGammas theGammas
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
G4ParticleHPLevel * GetLevel(G4int i)
const G4ParticleDefinition * GetParticleDefinition() const
G4int ApplyMechanismII_ACN2A(G4ReactionProduct &neut, G4ReactionProduct &carb, G4ReactionProduct *theProds, const G4double QI)
static const G4double eps
G4int GetNumberOfLevels()
static constexpr double keV
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4ParticleHPEnergyDistribution * theEnergyDistribution[51]
void CompositeApply(const G4HadProjectile &theTrack, G4ParticleDefinition *aHadron)
HepRotation inverse() const
static constexpr double pi
HepLorentzVector & boost(double, double, double)
void Init(std::istream &theData)
void SetStatusChange(G4HadFinalStateStatus aS)
G4double GetTemperature() const
G4double GetLevelEnergy()
void InitEnergies(std::istream &aDataFile)