70 theCoefficients =
nullptr;
71 theProbArray =
nullptr;
98 std::istringstream theData(std::ios::in);
101 theData >> repFlag >> targetMass >> frameFlag;
109 G4int tempdep, nLegendre;
111 for (i = 0; i < nEnergy; i++) {
112 theData >> temp >> energy >> tempdep >> nLegendre;
114 theCoefficients->
Init(i, energy, nLegendre);
117 for (ii = 0; ii < nLegendre; ii++) {
120 theCoefficients->
SetCoeff(i, ii + 1, coeff);
124 else if (repFlag == 2) {
130 G4int tempdep, nPoints;
131 for (
G4int i = 0; i < nEnergy; i++) {
132 theData >> temp >> energy >> tempdep >> nPoints;
135 theProbArray->
SetT(i, temp);
136 theProbArray->
SetX(i, energy);
138 for (
G4int ii = 0; ii < nPoints; ii++) {
140 theData >> costh >> prob;
141 theProbArray->
SetX(i, ii, costh);
142 theProbArray->
SetY(i, ii, prob);
147 else if (repFlag == 3) {
148 G4int nEnergy_Legendre;
149 theData >> nEnergy_Legendre;
150 if (nEnergy_Legendre <= 0) {
151 std::stringstream iss;
152 iss <<
"G4ParticleHPElasticFS::Init Data Error repFlag is 3 but nEnergy_Legendre <= 0";
160 G4int tempdep, nLegendre;
162 for (
G4int i = 0; i < nEnergy_Legendre; i++) {
163 theData >> temp >> energy >> tempdep >> nLegendre;
165 theCoefficients->
Init(i, energy, nLegendre);
168 for (
G4int ii = 0; ii < nLegendre; ii++) {
171 theCoefficients->
SetCoeff(i, ii + 1, coeff);
175 tE_of_repFlag3 = energy;
178 theData >> nEnergy_Prob;
182 for (
G4int i = 0; i < nEnergy_Prob; i++) {
183 theData >> temp >> energy >> tempdep >> nPoints;
189 if (std::abs(energy - tE_of_repFlag3) / tE_of_repFlag3 > 1.0e-15)
190 G4cout <<
"Warning Transition Energy of repFlag3 is not consistent." <<
G4endl;
193 theProbArray->
SetT(i, temp);
194 theProbArray->
SetX(i, energy);
196 for (
G4int ii = 0; ii < nPoints; ii++) {
198 theData >> costh >> prob;
199 theProbArray->
SetX(i, ii, costh);
200 theProbArray->
SetY(i, ii, prob);
205 else if (repFlag == 0) {
206 theData >> frameFlag;
209 G4cout <<
"unusable number for repFlag: repFlag=" << repFlag <<
G4endl;
211 "G4ParticleHPElasticFS::Init -- unusable number for repFlag");
244 G4double cmsMom = std::sqrt(the3CMS * the3CMS);
245 G4double sqrts = std::sqrt((totE - cmsMom) * (totE + cmsMom));
251 boosted.
Lorentz(theNeutron, theTarget);
258 else if (repFlag == 2) {
259 cosTh = theProbArray->
Sample(eKinetic);
261 else if (repFlag == 3) {
262 if (eKinetic <= tE_of_repFlag3) {
266 cosTh = theProbArray->
Sample(eKinetic);
269 else if (repFlag == 0) {
273 G4cout <<
"Unusable number for repFlag: repFlag=" << repFlag <<
G4endl;
275 "G4ParticleHPElasticFS::Init -- unusable number for repFlag");
288 if (frameFlag == 1) {
293 theNeutron.
Lorentz(theNeutron, theTarget);
300 G4double sqt = std::sqrt(ratio * ratio - 1.0 + cosTh * cosTh);
301 G4double beta = Pinit / (mT + Einit);
302 G4double denom = 1. - beta * beta * cosTh * cosTh;
303 G4double term1 = cosTh * (Einit * ratio + mN) / (mN * ratio + Einit);
304 G4double pN = beta * mN * (term1 + sqt) / denom;
313 pcmRot.
setX(px * cosTh * cosPhi - py * sinPhi + pz * sinth * cosPhi);
314 pcmRot.
setY(px * cosTh * sinPhi + py * cosPhi + pz * sinth * sinPhi);
315 pcmRot.
setZ(-px * sinth + pz * cosTh);
317 G4double eN = std::sqrt(pN * pN + mN * mN);
327 theNeutron.
Lorentz(theNeutron, toLab);
328 theTarget.
Lorentz(theTarget, toLab);
337 else if (frameFlag == 2) {
343 proj.
boost(boostToCM);
344 targ.
boost(boostToCM);
354 pcmRot.
setX(px * cosTh * cosPhi - py * sinPhi + pz * sinth * cosPhi);
355 pcmRot.
setY(px * cosTh * sinPhi + py * cosPhi + pz * sinth * sinPhi);
356 pcmRot.
setZ(-px * sinth + pz * cosTh);
361 proj.
boost(-boostToCM);
362 targ.
boost(-boostToCM);
382 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): " << frameFlag;
384 "G4ParticleHPElasticFS::ApplyYourSelf frameflag incorrect");
404void G4ParticleHPElasticFS::InitializeScatteringKernelParameters()
428 InitializeScatteringKernelParameters();
432 if (svtEmax == -1.) {
436 E_threshold = 400.0 * 8.617333262E-11 * temp;
440 if (dbrcUse && aMass >= dbrcAmin) {
441 E_threshold = std::max(svtEmax, dbrcEmax);
446 G4bool dbrcIsOn = dbrcUse && E_neutron >= dbrcEmin && aMass >= dbrcAmin && E_neutron <= dbrcEmax;
449 if (E_neutron > E_threshold || !dbrcIsOn) {
460 / (2. * 8.617333262E-11 * temp));
464 G4double vN_norm2 = vN_norm * vN_norm;
468 aVelocity = (1. / vN_norm) * aVelocity;
476 G4double cdf0 = 2. / (2. + std::sqrt(CLHEP::pi) * y);
501 vT_norm = std::sqrt(x2) / beta;
502 vT_norm2 = vT_norm * vT_norm;
508 vRelativeSpeed = std::sqrt(vN_norm2 + vT_norm2 - 2 * vN_norm * vT_norm * mu);
509 acceptThresholdSVT = vRelativeSpeed / (vN_norm + vT_norm);
511 }
while (randThresholdSVT >= acceptThresholdSVT);
518 }
while (randThresholdDBRC >= xsRelative / xsMax);
G4GLOB_DLL std::ostream G4cout
HepLorentzVector & boost(double, double, double)
void setVect(const Hep3Vector &)
Hep3Vector findBoostToCM() const
void Put(const value_type &val) const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
static G4HadronicParameters * Instance()
G4double GetNeutronKineticEnergyThresholdForSVT() const
static G4IonTable * GetIonTable()
G4double GetTemperature() const
static G4Neutron * Neutron()
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
void DoKinematicsOfThermalNucleus(const G4double mu, const G4double vT_norm, const G4ThreeVector &aVelocity, G4ReactionProduct &result) const
G4double GetPDGMass() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *) override
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack) override
void SetA_Z(G4double anA, G4double aZ, G4int aM=0)
G4Cache< G4HadFinalState * > theResult
void SetAZMs(G4ParticleHPDataUsed used)
G4ParticleHPNames theNames
void SetCoeff(G4int i, G4int l, G4double coeff)
void Init(G4int i, G4double e, G4int n)
void SetTemperature(G4int i, G4double temp)
void InitInterpolation(std::istream &aDataFile)
G4double SampleElastic(G4double anEnergy)
G4bool GetUseDBRC() const
G4double GetMinEnergyDBRC() const
G4double GetMinADBRC() const
void GetDataStream(const G4String &, std::istringstream &iss)
static G4ParticleHPManager * GetInstance()
G4double GetMaxEnergyDBRC() const
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)
G4double Sample(G4double x)
void SetT(G4int i, G4double x)
void SetX(G4int i, G4double x)
void SetY(G4int i, G4int j, G4double y)
void InitInterpolation(G4int i, std::istream &aDataFile)
G4double GetXsec(G4int i)
G4double GetMaxY(G4double emin, G4double emax)
static G4int GetModelID(const G4int modelIndex)
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetTotalMomentum() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
void SetMass(const G4double mas)