91 auto Z =
static_cast<G4int>(massCode / 1000);
92 auto A =
static_cast<G4int>(massCode - 1000 * Z);
110 if (Z == 2) result->SetDefinition(
G4He3::He3());
118 "G4ParticleHPDiscreteTwoBody: Unknown ion case 2");
124 for (i = 0; i < nEnergy; i++) {
126 if (theCoeff[i].GetEnergy() > anEnergy)
break;
128 if (it == 0 || it == nEnergy - 1) {
129 if (theCoeff[it].GetRepresentation() == 0) {
138 else if (theCoeff[it].GetRepresentation() == 12)
142 aManager.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly() / 2);
148 theStore.
SetX(i / 2, theCoeff[it].GetCoeff(i));
149 theStore.
SetY(i / 2, theCoeff[it].GetCoeff(i + 1));
151 cosTh = theStore.
Sample();
153 else if (theCoeff[it].GetRepresentation() == 14)
157 aManager.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly() / 2);
163 theStore.
SetX(i / 2, theCoeff[it].GetCoeff(i));
164 theStore.
SetY(i / 2, theCoeff[it].GetCoeff(i + 1));
166 cosTh = theStore.
Sample();
170 "unknown representation type in Two-body scattering");
174 if (!bCheckDiffCoeffRepr
175 || theCoeff[it].GetRepresentation() == theCoeff[it - 1].GetRepresentation())
177 if (theCoeff[it].GetRepresentation() == 0) {
180 theStore.
SetCoeff(0, &(theCoeff[it - 1]));
181 theStore.
SetCoeff(1, &(theCoeff[it]));
188 else if (theCoeff[it].GetRepresentation() == 12)
192 aManager1.
Init(
LINLIN, theCoeff[it - 1].GetNumberOfPoly() / 2);
196 theBuff1.
SetX(i / 2, theCoeff[it - 1].GetCoeff(i));
197 theBuff1.
SetY(i / 2, theCoeff[it - 1].GetCoeff(i + 1));
201 aManager2.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly() / 2);
204 theBuff2.
SetX(i / 2, theCoeff[it].GetCoeff(i));
205 theBuff2.
SetY(i / 2, theCoeff[it].GetCoeff(i + 1));
221 mu = theBuff1.
GetX(i);
222 y1 = theBuff1.
GetY(i);
223 y2 = theBuff2.
GetY(mu);
228 mu = theBuff2.
GetX(i);
229 y1 = theBuff2.
GetY(i);
230 y2 = theBuff1.
GetY(mu);
234 theStore.
Merge(&theStore1, &theStore2);
235 cosTh = theStore.
Sample();
237 else if (theCoeff[it].GetRepresentation() == 14)
241 aManager1.
Init(
LOGLIN, theCoeff[it - 1].GetNumberOfPoly() / 2);
245 theBuff1.
SetX(i / 2, theCoeff[it - 1].GetCoeff(i));
246 theBuff1.
SetY(i / 2, theCoeff[it - 1].GetCoeff(i + 1));
251 aManager2.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly() / 2);
255 theBuff2.
SetX(i / 2, theCoeff[it].GetCoeff(i));
256 theBuff2.
SetY(i / 2, theCoeff[it].GetCoeff(i + 1));
272 mu = theBuff1.
GetX(i);
273 y1 = theBuff1.
GetY(i);
274 y2 = theBuff2.
GetY(mu);
279 mu = theBuff2.
GetX(i);
280 y1 = theBuff2.
GetY(i);
281 y2 = theBuff1.
GetY(mu);
285 theStore.
Merge(&theStore1, &theStore2);
286 cosTh = theStore.
Sample();
290 "Two neighbouring distributions with different interpolation");
294 G4cout <<
" theCoeff[it].GetRepresent MEM " << it <<
" " << &theCoeff[it] <<
" "
295 << &theCoeff[it - 1] <<
G4endl;
300 "unknown representation type in Two-body scattering, case 2");
319 G4double kinE = (A1 + 1 - A1prim) / (A1 + 1) / (A1 + 1) * (A1 * E1 + (1 + A1) *
GetQValue());
321 result->SetKineticEnergy(kinE);
322 if (cosTh > 1.0) { cosTh = 1.0; }
323 else if(cosTh < -1.0) { cosTh = -1.0; }
325 G4double sinth = std::sqrt((1.0 + cosTh)*(1.0 - cosTh));
326 G4double mtot = result->GetTotalMomentum();
327 G4ThreeVector tempVector(mtot * sinth * std::cos(phi), mtot * sinth * std::sin(phi),
329 result->SetMomentum(tempVector);
void Init(std::istream &aDataFile) override
G4ReactionProduct * Sample(G4double anEnergy, G4double massCode, G4double mass) override
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void SetCoeff(G4int i, G4int l, G4double coeff)
G4double SampleDiscreteTwoBody(G4double anEnergy)
void SetManager(G4InterpolationManager &aManager)
void SetCoeff(G4int l, G4double coeff)
void Init(std::istream &aDataFile)
static G4ParticleHPManager * GetInstance()
void SetY(G4int i, G4double x)
void SetX(G4int i, G4double e)
void SetData(G4int i, G4double x, G4double y)
void SetInterpolationManager(const G4InterpolationManager &aManager)
G4double GetY(G4double x)
G4double GetX(G4int i) const
void Merge(G4ParticleHPVector *active, G4ParticleHPVector *passive)