72 theData >> repFlag >> targetMass >> frameFlag;
80 G4int tempdep, nLegendre;
82 for (i=0; i<nEnergy; i++)
84 theData >> temp >> energy >> tempdep >> nLegendre;
86 theCoefficients->
Init(i, energy, nLegendre);
89 for(ii=0; ii<nLegendre; ii++)
93 theCoefficients->
SetCoeff(i, ii+1, coeff);
104 G4int tempdep, nPoints;
105 for(
G4int i=0; i<nEnergy; i++)
107 theData >> temp >> energy >> tempdep >> nPoints;
110 theProbArray->
SetT(i, temp);
111 theProbArray->
SetX(i, energy);
113 for(
G4int ii=0; ii<nPoints; ii++)
116 theData >> costh >> prob;
117 theProbArray->
SetX(i, ii, costh);
118 theProbArray->
SetY(i, ii, prob);
122 else if ( repFlag==3 )
124 G4int nEnergy_Legendre;
125 theData >> nEnergy_Legendre;
129 G4int tempdep, nLegendre;
131 for (
G4int i = 0 ; i < nEnergy_Legendre ; i++ )
133 theData >> temp >> energy >> tempdep >> nLegendre;
135 theCoefficients->
Init( i , energy , nLegendre );
138 for (
G4int ii = 0 ; ii < nLegendre ; ii++ )
142 theCoefficients->
SetCoeff(i, ii+1, coeff);
149 theData >> nEnergy_Prob;
153 for (
G4int i=0 ; i < nEnergy_Prob ; i++ )
155 theData >> temp >> energy >> tempdep >> nPoints;
162 if ( std::abs( energy - tE_of_repFlag3 ) / tE_of_repFlag3 > 1.0e-15 )
163 G4cout <<
"Warning Transition Energy of repFlag3 is not consistent." <<
G4endl;
166 theProbArray->
SetT( i , temp );
167 theProbArray->
SetX( i , energy );
169 for(
G4int ii = 0 ; ii < nPoints ; ii++ )
172 theData >> costh >> prob;
173 theProbArray->
SetX( i , ii , costh );
174 theProbArray->
SetY( i , ii , prob );
180 theData >> frameFlag;
184 G4cout <<
"unusable number for repFlag: repFlag="<<repFlag<<
G4endl;
185 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::Init -- unusable number for repFlag");
224 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
225 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
231 boosted.
Lorentz(theNeutron, theTarget);
241 cosTh = theProbArray->
Sample(eKinetic);
245 if ( eKinetic <= tE_of_repFlag3 )
251 cosTh = theProbArray->
Sample(eKinetic);
260 G4cout <<
"unusable number for repFlag: repFlag="<<repFlag<<
G4endl;
261 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::Init -- unusable number for repFlag");
263 if(cosTh<-1.1) {
return 0; }
272 theNeutron.
Lorentz(theNeutron, theTarget);
278 G4double ap = (mT+eE)*(mT-eE) + (p0+mN)*(p0-mN);
279 G4double a = 4*(eE+p0*cosTh)*(eE-p0*cosTh);
282 G4double en = (-b+std::sqrt(b*b - 4*a*c) )/(2*a);
283 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
287 theNeutron.
Lorentz(theNeutron, -1.*theTarget);
289 theNeutron.
Lorentz(theNeutron, theCMS);
293 theNeutron.
Lorentz(theNeutron, -1.*theCMS);
294 theTarget.
Lorentz(theTarget, -1.*theCMS);
299 else if (frameFlag == 2)
301 theNeutron.
Lorentz(theNeutron, theCMS);
302 theTarget.
Lorentz(theTarget, theCMS);
308 tempVector.
setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
309 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
310 -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
311 tempVector.
setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
312 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
313 +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
314 tempVector.
setZ(std::cos(theta)*std::cos(cms_theta)
315 -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
336 theNeutron.
Lorentz(theNeutron, -1.*theCMS);
346 theTarget.
Lorentz(theTarget, -1.*theCMS);
358 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): "<<frameFlag;
359 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::ApplyYourSelf frameflag incorrect");
373 else if(targetMass<2 )
378 else if(targetMass<2.999 )
383 else if(targetMass<3 )
G4NeutronHPNames theNames
void SetMomentum(const G4ThreeVector &momentum)
G4double GetTotalMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
static G4NeutronHPManager * GetInstance()
void Init(G4int i, G4double e, G4int n)
void SetMomentum(const G4double x, const G4double y, const G4double z)
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)
G4HadFinalState theResult
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
static G4Triton * Triton()
static G4Proton * Proton()
void InitInterpolation(std::istream &aDataFile)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
const G4LorentzVector & Get4Momentum() const
static G4Deuteron * Deuteron()
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
G4ThreeVector GetMomentum() const
G4double GetTemperature() const
const G4Material * GetMaterial() const
void InitInterpolation(G4int i, std::istream &aDataFile)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentumChange(const G4ThreeVector &aV)
void SetTemperature(G4int i, G4double temp)
void AddSecondary(G4DynamicParticle *aP)
G4double Sample(G4double x)