50{
54
55 if(massCode==0)
56 {
58 }
59 else if(A==0)
60 {
63 }
64 else if(A==1)
65 {
68 }
69 else if(A==2)
70 {
72 }
73 else if(A==3)
74 {
77 }
78 else if(A==4)
79 {
82 }
83 else
84 {
85 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPDiscreteTwoBody: Unknown ion case 2");
86 }
87
88
91 for(i=0; i<nEnergy; i++)
92 {
93 it = i;
94 if(theCoeff[i].GetEnergy()>anEnergy) break;
95 }
96 if(it==0||it==nEnergy-1)
97 {
98 if(theCoeff[it].GetRepresentation()==0)
99 {
100
102 theStore.SetCoeff(0, theCoeff);
103 theStore.SetManager(theManager);
104
105
106 cosTh = theStore.SampleDiscreteTwoBody(anEnergy);
107 }
108 else if(theCoeff[it].GetRepresentation()==12)
109 {
112 aManager.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly()/2);
115 {
116
117
118
119 theStore.
SetX(i/2, theCoeff[it].GetCoeff(i));
120 theStore.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
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 }
138 cosTh = theStore.
Sample();
139 }
140 else
141 {
142 throw G4HadronicException(__FILE__, __LINE__,
"unknown representation type in Two-body scattering");
143 }
144 }
145 else
146 {
147 if(!bCheckDiffCoeffRepr || theCoeff[it].GetRepresentation() == theCoeff[it-1].GetRepresentation())
148 {
149 if(theCoeff[it].GetRepresentation()==0)
150 {
151
153 theStore.SetCoeff(0, &(theCoeff[it-1]));
154 theStore.SetCoeff(1, &(theCoeff[it]));
157 theStore.SetManager(aManager);
158
159
160 cosTh = theStore.SampleDiscreteTwoBody(anEnergy);
161 }
162 else if(theCoeff[it].GetRepresentation()==12)
163 {
166 aManager1.
Init(
LINLIN, theCoeff[it-1].GetNumberOfPoly()/2);
169 {
170
171
172
173 theBuff1.
SetX(i/2, theCoeff[it-1].GetCoeff(i));
174 theBuff1.
SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
175 }
178 aManager2.
Init(
LINLIN, theCoeff[it].GetNumberOfPoly()/2);
181 {
182
183
184 theBuff2.
SetX(i/2, theCoeff[it].GetCoeff(i));
185 theBuff2.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
186 }
187
192
198
199
201 {
202 mu = theBuff1.
GetX(i);
203 y1 = theBuff1.
GetY(i);
204 y2 = theBuff2.
GetY(mu);
207 }
209 {
210 mu = theBuff2.
GetX(i);
211 y1 = theBuff2.
GetY(i);
212 y2 = theBuff1.
GetY(mu);
215 }
216 theStore.
Merge(&theStore1, &theStore2);
217 cosTh = theStore.
Sample();
218 }
219 else if(theCoeff[it].GetRepresentation()==14)
220 {
223 aManager1.
Init(
LOGLIN, theCoeff[it-1].GetNumberOfPoly()/2);
226 {
227
228
229
230 theBuff1.
SetX(i/2, theCoeff[it-1].GetCoeff(i));
231 theBuff1.
SetY(i/2, theCoeff[it-1].GetCoeff(i+1));
232 }
233
236 aManager2.
Init(
LOGLIN, theCoeff[it].GetNumberOfPoly()/2);
239 {
240
241
242
243 theBuff2.
SetX(i/2, theCoeff[it].GetCoeff(i));
244 theBuff2.
SetY(i/2, theCoeff[it].GetCoeff(i+1));
245 }
246
251
257
258
260 {
261 mu = theBuff1.
GetX(i);
262 y1 = theBuff1.
GetY(i);
263 y2 = theBuff2.
GetY(mu);
266 }
268 {
269 mu = theBuff2.
GetX(i);
270 y1 = theBuff2.
GetY(i);
271 y2 = theBuff1.
GetY(mu);
274 }
275 theStore.
Merge(&theStore1, &theStore2);
276 cosTh = theStore.
Sample();
277 }
278 else
279 {
280 throw G4HadronicException(__FILE__, __LINE__,
"Two neighbouring distributions with different interpolation");
281 }
282 }
283 else
284 {
285 G4cout <<
" theCoeff[it].GetRepresent MEM " << it <<
" " << &theCoeff[it] <<
" " << &theCoeff[it-1] <<
G4endl;
287
288 throw G4HadronicException(__FILE__, __LINE__,
"unknown representation type in Two-body scattering, case 2");
289 }
290 }
291
292
293
294
295
296
297
298
299
300
301
304
305
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}
double A(double temperature)
G4GLOB_DLL std::ostream G4cout
static G4Deuteron * Deuteron()
static G4Electron * Electron()
G4InterpolationScheme GetScheme(G4int index) const
static G4Neutron * Neutron()
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
G4int GetRepresentation()
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)
G4int GetVectorLength() const
static G4Positron * Positron()
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetTotalMomentum() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
static G4Triton * Triton()
G4ReactionProduct * GetProjectileRP()
G4ReactionProduct * GetTarget()