69 std::istringstream theData(std::ios::in);
80 G4int tempdep, nLegendre;
82 for (i=0; i<nEnergy; i++)
84 theData >> temp >> energy >> tempdep >> nLegendre;
89 for(ii=0; ii<nLegendre; ii++)
104 G4int tempdep, nPoints;
105 for(
G4int i=0; i<nEnergy; i++)
107 theData >> temp >> energy >> tempdep >> nPoints;
113 for(
G4int ii=0; ii<nPoints; ii++)
116 theData >> costh >> prob;
125 G4int nEnergy_Legendre;
126 theData >> nEnergy_Legendre;
130 G4int tempdep, nLegendre;
132 for (
G4int i = 0 ; i < nEnergy_Legendre ; i++ )
134 theData >> temp >> energy >> tempdep >> nLegendre;
139 for (
G4int ii = 0 ; ii < nLegendre ; ii++ )
150 theData >> nEnergy_Prob;
154 for (
G4int i=0 ; i < nEnergy_Prob ; i++ )
156 theData >> temp >> energy >> tempdep >> nPoints;
164 G4cout <<
"Warning Transition Energy of repFlag3 is not consistent." <<
G4endl;
170 for(
G4int ii = 0 ; ii < nPoints ; ii++ )
173 theData >> costh >> prob;
187 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::Init -- unusable number for repFlag");
201 theNeutron.SetKineticEnergy( eKinetic );
219 G4double nEnergy = theNeutron.GetTotalEnergy();
227 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
228 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
234 boosted.
Lorentz(theNeutron, theTarget);
264 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::Init -- unusable number for repFlag");
266 if(cosTh<-1.1) {
return 0; }
275 theNeutron.Lorentz(theNeutron, theTarget);
276 G4double e0 = theNeutron.GetTotalEnergy();
277 G4double p0 = theNeutron.GetTotalMomentum();
281 G4double ap = (mT+eE)*(mT-eE) + (p0+mN)*(p0-mN);
282 G4double a = 4*(eE+p0*cosTh)*(eE-p0*cosTh);
285 G4double en = (-b+std::sqrt(b*b - 4*a*c) )/(2*a);
286 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
287 theNeutron.SetMomentum(tempVector);
288 theNeutron.SetTotalEnergy(std::sqrt(en*en+theNeutron.GetMass()*theNeutron.GetMass()));
290 theNeutron.Lorentz(theNeutron, -1.*theTarget);
292 theNeutron.Lorentz(theNeutron, theCMS);
296 theNeutron.Lorentz(theNeutron, -1.*theCMS);
297 theTarget.
Lorentz(theTarget, -1.*theCMS);
299 if ( theNeutron.GetKineticEnergy() <= 0 ) theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + std::pow( 10 , -15.65 ) ) );
304 theNeutron.Lorentz(theNeutron, theCMS);
305 theTarget.
Lorentz(theTarget, theCMS);
306 G4double en = theNeutron.GetTotalMomentum();
308 G4double cms_theta=cmsMom_tmp.theta();
311 tempVector.setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
312 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
313 -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
314 tempVector.setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
315 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
316 +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
317 tempVector.setZ(std::cos(theta)*std::cos(cms_theta)
318 -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
320 theNeutron.SetMomentum(tempVector);
339 theNeutron.Lorentz(theNeutron, -1.*theCMS);
341 if ( theNeutron.GetKineticEnergy() <= 0 )
346 theNeutron.SetTotalEnergy ( theNeutron.GetMass() * ( 1 + std::pow( 10 , -15.65 ) ) );
349 theTarget.
Lorentz(theTarget, -1.*theCMS);
362 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::ApplyYourSelf frameflag incorrect");
G4NeutronHPNames theNames
void SetMomentum(const G4ThreeVector &momentum)
G4double GetTotalMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
G4Cache< G4HadFinalState * > theResult
CLHEP::Hep3Vector G4ThreeVector
static G4NeutronHPManager * GetInstance()
void Init(G4int i, G4double e, G4int n)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4NeutronHPLegendreStore * theCoefficients
G4NeutronHPPartial * theProbArray
void SetCoeff(G4int i, G4int l, G4double coeff)
void GetDataStream(G4String, std::istringstream &iss)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void SetStatusChange(G4HadFinalStateStatus aS)
void SetT(G4int i, G4double x)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
void SetMass(const G4double mas)
G4GLOB_DLL std::ostream G4cout
G4double SampleElastic(G4double anEnergy)
const G4ParticleDefinition * GetDefinition() const
void SetY(G4int i, G4int j, G4double y)
void SetX(G4int i, G4double x)
G4double GetKineticEnergy() const
void SetTotalEnergy(const G4double en)
G4ErrorTarget * theTarget
void InitInterpolation(std::istream &aDataFile)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
static const G4double A[nN]
const G4LorentzVector & Get4Momentum() const
static G4IonTable * GetIonTable()
G4double GetKineticEnergy() const
void SetEnergyChange(G4double anEnergy)
G4double GetTotalEnergy() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType)
G4double GetPDGMass() const
G4double energy(const ThreeVector &p, const G4double m)
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
const G4Material * GetMaterial() const
void InitInterpolation(G4int i, std::istream &aDataFile)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void Put(const value_type &val) const
void SetMomentumChange(const G4ThreeVector &aV)
void SetTemperature(G4int i, G4double temp)
G4double Sample(G4double x)