85 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPDiscreteTwoBody: Unknown ion case 2");
91 for(i=0; i<nEnergy; i++)
94 if(theCoeff[i].GetEnergy()>anEnergy)
break;
96 if(it==0||it==nEnergy-1)
98 if(theCoeff[it].GetRepresentation()==0)
108 else if(theCoeff[it].GetRepresentation()==12)
112 aManager.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly()/2);
119 theStore.
SetX(i/2, theCoeff[it].GetCoeff(i));
120 theStore.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
122 cosTh = theStore.
Sample();
124 else if(theCoeff[it].GetRepresentation()==14)
128 aManager.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
135 theStore.
SetX(i/2, theCoeff[it].GetCoeff(i));
136 theStore.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
138 cosTh = theStore.
Sample();
142 throw G4HadronicException(__FILE__, __LINE__,
"unknown representation type in Two-body scattering");
147 if(!bCheckDiffCoeffRepr || theCoeff[it].GetRepresentation() == theCoeff[it-1].GetRepresentation())
149 if(theCoeff[it].GetRepresentation()==0)
153 theStore.
SetCoeff(0, &(theCoeff[it-1]));
154 theStore.
SetCoeff(1, &(theCoeff[it]));
162 else if(theCoeff[it].GetRepresentation()==12)
166 aManager1.
Init(
LINLIN, theCoeff[it-1].GetNumberOfPoly()/2);
173 theBuff1.
SetX(i/2, theCoeff[it-1].GetCoeff(i));
174 theBuff1.
SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
178 aManager2.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly()/2);
184 theBuff2.
SetX(i/2, theCoeff[it].GetCoeff(i));
185 theBuff2.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
202 mu = theBuff1.
GetX(i);
203 y1 = theBuff1.
GetY(i);
204 y2 = theBuff2.
GetY(mu);
210 mu = theBuff2.
GetX(i);
211 y1 = theBuff2.
GetY(i);
212 y2 = theBuff1.
GetY(mu);
216 theStore.
Merge(&theStore1, &theStore2);
217 cosTh = theStore.
Sample();
219 else if(theCoeff[it].GetRepresentation()==14)
223 aManager1.
Init(
LOGLIN, theCoeff[it-1].GetNumberOfPoly()/2);
230 theBuff1.
SetX(i/2, theCoeff[it-1].GetCoeff(i));
231 theBuff1.
SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
236 aManager2.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
243 theBuff2.
SetX(i/2, theCoeff[it].GetCoeff(i));
244 theBuff2.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
261 mu = theBuff1.
GetX(i);
262 y1 = theBuff1.
GetY(i);
263 y2 = theBuff2.
GetY(mu);
269 mu = theBuff2.
GetX(i);
270 y1 = theBuff2.
GetY(i);
271 y2 = theBuff1.
GetY(mu);
275 theStore.
Merge(&theStore1, &theStore2);
276 cosTh = theStore.
Sample();
280 throw G4HadronicException(__FILE__, __LINE__,
"Two neighbouring distributions with different interpolation");
285 G4cout <<
" theCoeff[it].GetRepresent MEM " << it <<
" " << &theCoeff[it] <<
" " << &theCoeff[it-1] <<
G4endl;
288 throw G4HadronicException(__FILE__, __LINE__,
"unknown representation type in Two-body scattering, case 2");
314 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
G4double G4ParticleHPJENDLHEData::G4double result
G4int GetVectorLength() const
G4double GetTotalMomentum() const
void Init(G4int aScheme, G4int aRange)
void SetKineticEnergy(const G4double en)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetData(G4int i, G4double x, G4double y)
G4double SampleDiscreteTwoBody(G4double anEnergy)
void SetInterpolationManager(const G4InterpolationManager &aManager)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetY(G4int i, G4double x)
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
G4InterpolationScheme GetScheme(G4int index) const
static G4Triton * Triton()
void Merge(G4ParticleHPVector *active, G4ParticleHPVector *passive)
static G4Proton * Proton()
G4double GetX(G4int i) const
static G4Neutron * Neutron()
G4double GetY(G4double x)
static G4Deuteron * Deuteron()
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
G4int GetRepresentation()
void SetManager(G4InterpolationManager &aManager)
static G4Positron * Positron()
G4ReactionProduct * GetProjectileRP()
void SetCoeff(G4int i, G4int l, G4double coeff)
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass)
static G4Electron * Electron()
void SetX(G4int i, G4double e)
static constexpr double twopi
G4ReactionProduct * GetTarget()