218{
226 theNeutron.SetKineticEnergy(eKinetic);
227
229 (1. / incidentParticle->
GetDefinition()->GetPDGMass()) * theNeutron.GetMomentum();
232
233
234
235
237 G4double nEnergy = theNeutron.GetTotalEnergy();
244 G4double cmsMom = std::sqrt(the3CMS * the3CMS);
245 G4double sqrts = std::sqrt((totE - cmsMom) * (totE + cmsMom));
248
249
251 boosted.
Lorentz(theNeutron, theTarget);
254
255 if (repFlag == 1) {
257 }
258 else if (repFlag == 2) {
259 cosTh = theProbArray->
Sample(eKinetic);
260 }
261 else if (repFlag == 3) {
262 if (eKinetic <= tE_of_repFlag3) {
264 }
265 else {
266 cosTh = theProbArray->
Sample(eKinetic);
267 }
268 }
269 else if (repFlag == 0) {
271 }
272 else {
273 G4cout <<
"Unusable number for repFlag: repFlag=" << repFlag <<
G4endl;
275 "G4ParticleHPElasticFS::Init -- unusable number for repFlag");
276 }
277
278 if (cosTh < -1.1) {
279 return nullptr;
280 }
281
287
288 if (frameFlag == 1) {
289
290
291
292
293 theNeutron.Lorentz(theNeutron, theTarget);
295 G4double Pinit = theNeutron.GetTotalMomentum();
296 G4double Einit = theNeutron.GetTotalEnergy();
298
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;
305
306
311
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);
316 theNeutron.SetMomentum(pcmRot);
317 G4double eN = std::sqrt(pN * pN + mN * mN);
318 theNeutron.SetTotalEnergy(eN);
319
320
325
326
327 theNeutron.Lorentz(theNeutron, toLab);
328 theTarget.
Lorentz(theTarget, toLab);
329
330
331 if (theNeutron.GetKineticEnergy() <= 0)
332 theNeutron.SetTotalEnergy(theNeutron.GetMass()
336 }
337 else if (frameFlag == 2) {
338
339
343 proj.boost(boostToCM);
344 targ.boost(boostToCM);
345
346
347
348
352
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);
357 proj.setVect(pcmRot);
358 targ.setVect(-pcmRot);
359
360
361 proj.boost(-boostToCM);
362 targ.boost(-boostToCM);
363
364 theNeutron.SetMomentum(proj.vect());
365 theNeutron.SetTotalEnergy(proj.e());
366
369
370
371 if (theNeutron.GetKineticEnergy() <= 0) {
372 theNeutron.SetTotalEnergy(theNeutron.GetMass()
374 }
375
376
379 }
380 }
381 else {
382 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): " << frameFlag;
384 "G4ParticleHPElasticFS::ApplyYourSelf frameflag incorrect");
385 }
386
387
388
391
392
398
399
402}
G4GLOB_DLL std::ostream G4cout
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 G4IonTable * GetIonTable()
G4double GetTemperature() const
G4Cache< G4HadFinalState * > theResult
G4double SampleElastic(G4double anEnergy)
G4double Sample(G4double x)
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 GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetMass(const G4double mas)