211{
218 theNeutron.SetKineticEnergy(eKinetic);
219
224 theTarget =
226
227
228
229
231 G4double nEnergy = theNeutron.GetTotalEnergy();
238 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
239 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
242
243
245 boosted.
Lorentz(theNeutron, theTarget);
248
249 if (repFlag == 1) {
251
252 } else if (repFlag == 2) {
253 cosTh = theProbArray->
Sample(eKinetic);
254
255 } else if (repFlag == 3) {
256 if (eKinetic <= tE_of_repFlag3) {
258 } else {
259 cosTh = theProbArray->
Sample(eKinetic);
260 }
261
262 } else if (repFlag == 0) {
264
265 } else {
266 G4cout <<
"Unusable number for repFlag: repFlag=" << repFlag <<
G4endl;
268 "G4ParticleHPElasticFS::Init -- unusable number for repFlag");
269 }
270
271 if (cosTh < -1.1) { return 0; }
272
278
279 if (frameFlag == 1) {
280
281
282
283
284 theNeutron.Lorentz(theNeutron, theTarget);
286 G4double Pinit = theNeutron.GetTotalMomentum();
287 G4double Einit = theNeutron.GetTotalEnergy();
289
291 G4double sqt = std::sqrt(ratio*ratio - 1.0 + cosTh*cosTh);
293 G4double denom = 1. - beta*beta*cosTh*cosTh;
294 G4double term1 = cosTh*(Einit*ratio + mN)/(mN*ratio + Einit);
295 G4double pN = beta*mN*(term1 + sqt)/denom;
296
297
302
304 pcmRot.
setX(px*cosTh*cosPhi - py*sinPhi + pz*sinth*cosPhi);
305 pcmRot.
setY(px*cosTh*sinPhi + py*cosPhi + pz*sinth*sinPhi);
306 pcmRot.
setZ(-px*sinth + pz*cosTh);
307 theNeutron.SetMomentum(pcmRot);
308 G4double eN = std::sqrt(pN*pN + mN*mN);
309 theNeutron.SetTotalEnergy(eN);
310
311
316
317
318 theNeutron.Lorentz(theNeutron, toLab);
319 theTarget.
Lorentz(theTarget, toLab);
320
321
322 if (theNeutron.GetKineticEnergy() <= 0)
326
327 } else if (frameFlag == 2) {
328
329
333 proj.boost(boostToCM);
334 targ.boost(boostToCM);
335
336
337
338
342
344 pcmRot.
setX(px*cosTh*cosPhi - py*sinPhi + pz*sinth*cosPhi);
345 pcmRot.
setY(px*cosTh*sinPhi + py*cosPhi + pz*sinth*sinPhi);
346 pcmRot.
setZ(-px*sinth + pz*cosTh);
347 proj.setVect(pcmRot);
348 targ.setVect(-pcmRot);
349
350
351 proj.boost(-boostToCM);
352 targ.boost(-boostToCM);
353
354 theNeutron.SetMomentum(proj.vect() );
355 theNeutron.SetTotalEnergy(proj.e() );
356
359
360
361 if (theNeutron.GetKineticEnergy() <= 0) {
363 }
364
365
368 }
369
370 } else {
371 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): " << frameFlag;
373 "G4ParticleHPElasticFS::ApplyYourSelf frameflag incorrect");
374 }
375
376
377
380
381
387
388
391}
G4GLOB_DLL std::ostream G4cout
void Put(const value_type &val) const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
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
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4double GetPDGMass() 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)