209 theNeutron.SetKineticEnergy( eKinetic );
228 G4double nEnergy = theNeutron.GetTotalEnergy();
236 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
237 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
243 boosted.
Lorentz(theNeutron, theTarget);
253 cosTh = theProbArray->
Sample(eKinetic);
257 if ( eKinetic <= tE_of_repFlag3 )
263 cosTh = theProbArray->
Sample(eKinetic);
272 G4cout <<
"unusable number for repFlag: repFlag="<<repFlag<<
G4endl;
273 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPElasticFS::Init -- unusable number for repFlag");
275 if(cosTh<-1.1) {
return 0; }
284 theNeutron.Lorentz(theNeutron, theTarget);
285 G4double e0 = theNeutron.GetTotalEnergy();
286 G4double p0 = theNeutron.GetTotalMomentum();
290 G4double ap = (mT+eE)*(mT-eE) + (p0+mN)*(p0-mN);
291 G4double a = 4*(eE+p0*cosTh)*(eE-p0*cosTh);
294 G4double en = (-b+std::sqrt(b*b - 4*a*c) )/(2*a);
295 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
296 theNeutron.SetMomentum(tempVector);
297 theNeutron.SetTotalEnergy(std::sqrt(en*en+theNeutron.GetMass()*theNeutron.GetMass()));
299 theNeutron.Lorentz(theNeutron, -1.*theTarget);
301 theNeutron.Lorentz(theNeutron, theCMS);
305 theNeutron.Lorentz(theNeutron, -1.*theCMS);
306 theTarget.
Lorentz(theTarget, -1.*theCMS);
308 if ( theNeutron.GetKineticEnergy() <= 0 ) theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 +
G4Pow::GetInstance()->
powA( 10 , -15.65 ) ) );
311 else if (frameFlag == 2)
313 theNeutron.Lorentz(theNeutron, theCMS);
314 theTarget.
Lorentz(theTarget, theCMS);
315 G4double en = theNeutron.GetTotalMomentum();
320 tempVector.
setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
321 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
322 -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
323 tempVector.
setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
324 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
325 +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
326 tempVector.
setZ(std::cos(theta)*std::cos(cms_theta)
327 -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
329 theNeutron.SetMomentum(tempVector);
348 theNeutron.Lorentz(theNeutron, -1.*theCMS);
350 if ( theNeutron.GetKineticEnergy() <= 0 )
358 theTarget.
Lorentz(theTarget, -1.*theCMS);
370 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): "<<frameFlag;
371 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPElasticFS::ApplyYourSelf frameflag incorrect");
static G4Pow * GetInstance()
G4double powA(G4double A, G4double y) const
G4Cache< G4HadFinalState * > theResult
void SetMomentum(const G4ThreeVector &momentum)
G4double GetTotalMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
std::vector< ExP01TrackerHit * > a
void SetMomentum(const G4double x, const G4double y, const G4double z)
static constexpr double twopi
void SetStatusChange(G4HadFinalStateStatus aS)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
void SetMass(const G4double mas)
G4GLOB_DLL std::ostream G4cout
const G4ParticleDefinition * GetDefinition() const
G4double Sample(G4double x)
G4double GetKineticEnergy() const
void SetTotalEnergy(const G4double en)
G4ErrorTarget * theTarget
const G4LorentzVector & Get4Momentum() const
static G4IonTable * GetIonTable()
G4double GetKineticEnergy() const
void SetEnergyChange(G4double anEnergy)
G4double SampleElastic(G4double anEnergy)
G4double GetTotalEnergy() const
G4double GetPDGMass() const
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
const G4Material * GetMaterial() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void Put(const value_type &val) const
void SetMomentumChange(const G4ThreeVector &aV)