74 std::istringstream theData(std::ios::in);
77 theData >> repFlag >> targetMass >> frameFlag;
85 G4int tempdep, nLegendre;
87 for (i=0; i < nEnergy; i++) {
88 theData >> temp >> energy >> tempdep >> nLegendre;
90 theCoefficients->
Init(i, energy, nLegendre);
93 for (ii = 0; ii < nLegendre; ii++) {
96 theCoefficients->
SetCoeff(i, ii+1, coeff);
100 }
else if (repFlag == 2) {
106 G4int tempdep, nPoints;
107 for (
G4int i = 0; i < nEnergy; i++) {
108 theData >> temp >> energy >> tempdep >> nPoints;
111 theProbArray->
SetT(i, temp);
112 theProbArray->
SetX(i, energy);
114 for (
G4int ii = 0; ii < nPoints; ii++) {
116 theData >> costh >> prob;
117 theProbArray->
SetX(i, ii, costh);
118 theProbArray->
SetY(i, ii, prob);
123 }
else if (repFlag == 3) {
124 G4int nEnergy_Legendre;
125 theData >> nEnergy_Legendre;
126 if (nEnergy_Legendre <= 0 ) {
127 std::stringstream iss;
128 iss <<
"G4ParticleHPElasticFS::Init Data Error repFlag is 3 but nEnergy_Legendre <= 0";
129 iss <<
"Z, A and M of problematic file is " <<
theNDLDataZ <<
", "
136 G4int tempdep, nLegendre;
138 for (
G4int i = 0; i < nEnergy_Legendre; i++) {
139 theData >> temp >> energy >> tempdep >> nLegendre;
141 theCoefficients->
Init( i , energy , nLegendre );
144 for (
G4int ii = 0; ii < nLegendre; ii++) {
147 theCoefficients->
SetCoeff(i, ii+1, coeff);
151 tE_of_repFlag3 = energy;
154 theData >> nEnergy_Prob;
158 for (
G4int i = 0; i < nEnergy_Prob; i++) {
159 theData >> temp >> energy >> tempdep >> nPoints;
165 if (std::abs(energy - tE_of_repFlag3) / tE_of_repFlag3 > 1.0e-15)
166 G4cout <<
"Warning Transition Energy of repFlag3 is not consistent." <<
G4endl;
169 theProbArray->
SetT( i , temp );
170 theProbArray->
SetX( i , energy );
172 for (
G4int ii = 0; ii < nPoints; ii++) {
174 theData >> costh >> prob;
175 theProbArray->
SetX( i , ii , costh );
176 theProbArray->
SetY( i , ii , prob );
181 }
else if (repFlag==0) {
182 theData >> frameFlag;
185 G4cout <<
"unusable number for repFlag: repFlag="<<repFlag<<
G4endl;
186 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPElasticFS::Init -- unusable number for repFlag");
222 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
223 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
229 boosted.
Lorentz(theNeutron, theTarget);
236 }
else if (repFlag == 2) {
237 cosTh = theProbArray->
Sample(eKinetic);
239 }
else if (repFlag == 3) {
240 if (eKinetic <= tE_of_repFlag3) {
243 cosTh = theProbArray->
Sample(eKinetic);
246 }
else if (repFlag == 0) {
250 G4cout <<
"Unusable number for repFlag: repFlag=" << repFlag <<
G4endl;
252 "G4ParticleHPElasticFS::Init -- unusable number for repFlag");
255 if (cosTh < -1.1) {
return 0; }
263 if (frameFlag == 1) {
268 theNeutron.
Lorentz(theNeutron, theTarget);
275 G4double sqt = std::sqrt(ratio*ratio - 1.0 + cosTh*cosTh);
277 G4double denom = 1. - beta*beta*cosTh*cosTh;
278 G4double term1 = cosTh*(Einit*ratio + mN)/(mN*ratio + Einit);
279 G4double pN = beta*mN*(term1 + sqt)/denom;
288 pcmRot.
setX(px*cosTh*cosPhi - py*sinPhi + pz*sinth*cosPhi);
289 pcmRot.
setY(px*cosTh*sinPhi + py*cosPhi + pz*sinth*sinPhi);
290 pcmRot.
setZ(-px*sinth + pz*cosTh);
292 G4double eN = std::sqrt(pN*pN + mN*mN);
302 theNeutron.
Lorentz(theNeutron, toLab);
303 theTarget.
Lorentz(theTarget, toLab);
311 }
else if (frameFlag == 2) {
317 proj.
boost(boostToCM);
318 targ.
boost(boostToCM);
328 pcmRot.
setX(px*cosTh*cosPhi - py*sinPhi + pz*sinth*cosPhi);
329 pcmRot.
setY(px*cosTh*sinPhi + py*cosPhi + pz*sinth*sinPhi);
330 pcmRot.
setZ(-px*sinth + pz*cosTh);
335 proj.
boost(-boostToCM);
336 targ.
boost(-boostToCM);
355 G4cout <<
"Value of frameFlag (1=LAB, 2=CMS): " << frameFlag;
357 "G4ParticleHPElasticFS::ApplyYourSelf frameflag incorrect");
double A(double temperature)
G4GLOB_DLL std::ostream G4cout
HepLorentzVector & boost(double, double, double)
void setVect(const Hep3Vector &)
Hep3Vector findBoostToCM() const
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
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack)
void Init(G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
G4Cache< G4HadFinalState * > theResult
G4ParticleHPNames theNames
void SetCoeff(G4int i, G4int l, G4double coeff)
void Init(G4int i, G4double e, G4int n)
void SetTemperature(G4int i, G4double temp)
void InitInterpolation(std::istream &aDataFile)
G4double SampleElastic(G4double anEnergy)
static G4ParticleHPManager * GetInstance()
void GetDataStream(G4String, std::istringstream &iss)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
G4double Sample(G4double x)
void SetT(G4int i, G4double x)
void SetX(G4int i, G4double x)
void SetY(G4int i, G4int j, G4double y)
void InitInterpolation(G4int i, std::istream &aDataFile)
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 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)