49{
53
54 if(massCode==0)
55 {
57 }
58 else if(A==0)
59 {
62 }
63 else if(A==1)
64 {
67 }
68 else if(A==2)
69 {
71 }
72 else if(A==3)
73 {
76 }
77 else if(A==4)
78 {
81 }
82 else
83 {
84 throw G4HadronicException(__FILE__, __LINE__,
"G4NeutronHPDiscreteTwoBody: Unknown ion case 2");
85 }
86
87
90 for(i=0; i<nEnergy; i++)
91 {
92 it = i;
93 if(theCoeff[i].GetEnergy()>anEnergy) break;
94 }
95 if(it==0||it==nEnergy-1)
96 {
97 if(theCoeff[it].GetRepresentation()==0)
98 {
99
101 theStore.SetCoeff(0, theCoeff);
102 theStore.SetManager(theManager);
103
104
105 cosTh = theStore.SampleDiscreteTwoBody(anEnergy);
106 }
107 else if(theCoeff[it].GetRepresentation()==12)
108 {
111 aManager.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly()/2);
114 {
115
116
117
118 theStore.
SetX(i/2, theCoeff[it].GetCoeff(i));
119 theStore.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
120 i++;
121 }
122 cosTh = theStore.
Sample();
123 }
124 else if(theCoeff[it].GetRepresentation()==14)
125 {
128 aManager.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
131 {
132
133
134
135 theStore.
SetX(i/2, theCoeff[it].GetCoeff(i));
136 theStore.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
137 i++;
138 }
139 cosTh = theStore.
Sample();
140 }
141 else
142 {
143 throw G4HadronicException(__FILE__, __LINE__,
"unknown representation type in Two-body scattering");
144 }
145 }
146 else
147 {
148 if(theCoeff[it].GetRepresentation() == theCoeff[it-1].GetRepresentation())
149 {
150 if(theCoeff[it].GetRepresentation()==0)
151 {
152
154 theStore.SetCoeff(0, &(theCoeff[it-1]));
155 theStore.SetCoeff(1, &(theCoeff[it]));
158 theStore.SetManager(aManager);
159
160
161 cosTh = theStore.SampleDiscreteTwoBody(anEnergy);
162 }
163 else if(theCoeff[it].GetRepresentation()==12)
164 {
167 aManager1.
Init(
LINLIN, theCoeff[it-1].GetNumberOfPoly()/2);
170 {
171
172
173
174 theBuff1.
SetX(i/2, theCoeff[it-1].GetCoeff(i));
175 theBuff1.
SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
176 i++;
177 }
180 aManager2.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly()/2);
183 {
184
185
186 theBuff2.
SetX(i/2, theCoeff[it].GetCoeff(i));
187 theBuff2.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
188 i++;
189 }
190
195
201
202
204 {
205 mu = theBuff1.
GetX(i);
206 y1 = theBuff1.
GetY(i);
207 y2 = theBuff2.
GetY(mu);
210 }
212 {
213 mu = theBuff2.
GetX(i);
214 y1 = theBuff2.
GetY(i);
215 y2 = theBuff1.
GetY(mu);
218 }
219 theStore.
Merge(&theStore1, &theStore2);
220 cosTh = theStore.
Sample();
221 }
222 else if(theCoeff[it].GetRepresentation()==14)
223 {
226 aManager1.
Init(
LOGLIN, theCoeff[it-1].GetNumberOfPoly()/2);
229 {
230
231
232
233 theBuff1.
SetX(i/2, theCoeff[it-1].GetCoeff(i));
234 theBuff1.
SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
235 i++;
236 }
237
240 aManager2.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
243 {
244
245
246
247 theBuff2.
SetX(i/2, theCoeff[it].GetCoeff(i));
248 theBuff2.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
249 i++;
250 }
251
256
262
263
265 {
266 mu = theBuff1.
GetX(i);
267 y1 = theBuff1.
GetY(i);
268 y2 = theBuff2.
GetY(mu);
271 }
273 {
274 mu = theBuff2.
GetX(i);
275 y1 = theBuff2.
GetY(i);
276 y2 = theBuff1.
GetY(mu);
279 }
280 theStore.
Merge(&theStore1, &theStore2);
281 cosTh = theStore.
Sample();
282 }
283 else
284 {
285 throw G4HadronicException(__FILE__, __LINE__,
"Two neighbouring distributions with different interpolation");
286 }
287 }
288 else
289 {
290 throw G4HadronicException(__FILE__, __LINE__,
"unknown representation type in Two-body scattering, case 2");
291 }
292 }
293
294
295
296
297
298
299
300
301
302
303
306 G4double E1 = (A1+1)*(A1+1)/A1/A1*anEnergy;
308
314 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
316
317
318
319
320 return result;
321}
static G4Deuteron * Deuteron()
static G4Electron * Electron()
G4InterpolationScheme GetScheme(G4int index) const
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void Merge(G4NeutronHPVector *active, G4NeutronHPVector *passive)
void SetX(G4int i, G4double e)
G4int GetVectorLength() const
G4double GetX(G4int i) const
G4double GetY(G4double x)
void SetData(G4int i, G4double x, G4double y)
void SetInterpolationManager(const G4InterpolationManager &aManager)
void SetY(G4int i, G4double x)
static G4Neutron * Neutron()
static G4Positron * Positron()
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetTotalMomentum() const
void SetKineticEnergy(const G4double en)
void SetDefinition(G4ParticleDefinition *aParticleDefinition)
static G4Triton * Triton()
G4ReactionProduct * GetNeutron()
G4ReactionProduct * GetTarget()