64 std::ifstream theData(filename, std::ios::in);
65 theData >> repFlag >> targetMass >> frameFlag;
73 G4int tempdep, nLegendre;
75 for (i=0; i<nEnergy; i++)
77 theData >> temp >> energy >> tempdep >> nLegendre;
79 theCoefficients->
Init(i, energy, nLegendre);
82 for(ii=0; ii<nLegendre; ii++)
86 theCoefficients->
SetCoeff(i, ii+1, coeff);
97 G4int tempdep, nPoints;
98 for(
G4int i=0; i<nEnergy; i++)
100 theData >> temp >> energy >> tempdep >> nPoints;
103 theProbArray->
SetT(i, temp);
104 theProbArray->
SetX(i, energy);
106 for(
G4int ii=0; ii<nPoints; ii++)
109 theData >> costh >> prob;
110 theProbArray->
SetX(i, ii, costh);
111 theProbArray->
SetY(i, ii, prob);
115 else if ( repFlag==3 )
117 G4int nEnergy_Legendre;
118 theData >> nEnergy_Legendre;
122 G4int tempdep, nLegendre;
124 for (
G4int i = 0 ; i < nEnergy_Legendre ; i++ )
126 theData >> temp >> energy >> tempdep >> nLegendre;
128 theCoefficients->
Init( i , energy , nLegendre );
131 for (
G4int ii = 0 ; ii < nLegendre ; ii++ )
135 theCoefficients->
SetCoeff(i, ii+1, coeff);
139 tE_of_repFlag3 = energy;
142 theData >> nEnergy_Prob;
146 for (
G4int i=0 ; i < nEnergy_Prob ; i++ )
148 theData >> temp >> energy >> tempdep >> nPoints;
155 if ( std::abs( energy - tE_of_repFlag3 ) / tE_of_repFlag3 > 1.0e-15 )
156 G4cout <<
"Warning Transition Energy of repFlag3 is not consistent." <<
G4endl;
159 theProbArray->
SetT( i , temp );
160 theProbArray->
SetX( i , energy );
162 for(
G4int ii = 0 ; ii < nPoints ; ii++ )
165 theData >> costh >> prob;
166 theProbArray->
SetX( i , ii , costh );
167 theProbArray->
SetY( i , ii , prob );
173 theData >> frameFlag;
177 G4cout <<
"unusable number for repFlag: repFlag="<<repFlag<<
G4endl;
178 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::Init -- unusable number for repFlag");
216 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
217 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
223 boosted.
Lorentz(theNeutron, theTarget);
233 cosTh = theProbArray->
Sample(eKinetic);
237 if ( eKinetic <= tE_of_repFlag3 )
243 cosTh = theProbArray->
Sample(eKinetic);
252 G4cout <<
"unusable number for repFlag: repFlag="<<repFlag<<
G4endl;
253 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::Init -- unusable number for repFlag");
255 if(cosTh<-1.1) {
return 0; }
264 theNeutron.
Lorentz(theNeutron, theTarget);
270 G4double ap = (mT+eE)*(mT-eE) + (p0+mN)*(p0-mN);
271 G4double a = 4*(eE+p0*cosTh)*(eE-p0*cosTh);
273 G4double c = (2.*eE*mN-ap)*(2.*eE*mN+ap);
274 G4double en = (-b+std::sqrt(b*b - 4*a*c) )/(2*a);
275 G4ThreeVector tempVector(en*sinth*std::cos(phi), en*sinth*std::sin(phi), en*std::cos(theta) );
279 theNeutron.
Lorentz(theNeutron, -1.*theTarget);
281 theNeutron.
Lorentz(theNeutron, theCMS);
285 theNeutron.
Lorentz(theNeutron, -1.*theCMS);
286 theTarget.
Lorentz(theTarget, -1.*theCMS);
291 else if (frameFlag == 2)
293 theNeutron.
Lorentz(theNeutron, theCMS);
294 theTarget.
Lorentz(theTarget, theCMS);
300 tempVector.
setX(std::cos(theta)*std::sin(cms_theta)*std::cos(cms_phi)
301 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::cos(cms_phi)
302 -std::sin(theta)*std::sin(phi)*std::sin(cms_phi) );
303 tempVector.
setY(std::cos(theta)*std::sin(cms_theta)*std::sin(cms_phi)
304 +std::sin(theta)*std::cos(phi)*std::cos(cms_theta)*std::sin(cms_phi)
305 +std::sin(theta)*std::sin(phi)*std::cos(cms_phi) );
306 tempVector.
setZ(std::cos(theta)*std::cos(cms_theta)
307 -std::sin(theta)*std::cos(phi)*std::sin(cms_theta) );
328 theNeutron.
Lorentz(theNeutron, -1.*theCMS);
338 theTarget.
Lorentz(theTarget, -1.*theCMS);
350 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): "<<frameFlag;
351 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPElasticFS::ApplyYourSelf frameflag incorrect");
365 else if(targetMass<2 )
370 else if(targetMass<2.999 )
375 else if(targetMass<3 )
G4DLLIMPORT std::ostream G4cout
static G4Deuteron * Deuteron()
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetTemperature() const
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
G4HadFinalState theResult
G4NeutronHPNames theNames
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4NeutronHPDataUsed used)
void SetCoeff(G4int i, G4int l, G4double coeff)
void Init(G4int i, G4double e, G4int n)
void InitInterpolation(std::ifstream &aDataFile)
G4double SampleElastic(G4double anEnergy)
void SetTemperature(G4int i, G4double temp)
G4NeutronHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void SetY(G4int i, G4int j, G4double y)
void InitInterpolation(G4int i, std::ifstream &aDataFile)
void SetT(G4int i, G4double x)
G4double Sample(G4double x)
void SetX(G4int i, G4double x)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetTotalMomentum() const
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetKineticEnergy(const G4double en)
void SetMass(const G4double mas)
static G4Triton * Triton()