76{
80
81 if(massCode==0)
82 {
84 }
86 {
89 }
91 {
94 }
96 {
98 }
100 {
103 }
105 {
108 }
109 else
110 {
111 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPLabAngularEnergy: Unknown ion case 2");
112 }
113
114
117
118 for(i=0; i<nEnergies; i++)
119 {
120 it = i;
121 if ( anEnergy < theEnergies[i] ) break;
122 }
123
124 if ( it == 0 )
125 {
126
127
128
131 for(i=0; i<nCosTh[it]; i++)
132 {
133 theThVec.
SetX(i, theData[it][i].GetLabel());
134 theThVec.
SetY(i, theData[it][i].GetIntegral());
135 }
137
138
139
140
143 for(i=1; i<nCosTh[it]; i++)
144 {
145 i1 = i;
146 if(cosTh<theData[it][i].GetLabel()) break;
147 }
148
149 x = cosTh;
155 {
156 E = theData[it][i1-1].
GetX(i);
157 y1 = theData[it][i1-1].
GetY(i);
158 y2 = theData[it][i1].
GetY(E);
159 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i1), x, x1,x2,y1,y2);
161 }
165 {
166 E = theData[it][i1].
GetX(i);
167 y1 = theData[it][i1-1].
GetY(E);
168 y2 = theData[it][i1].
GetY(i);
169 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i1), x, x1,x2,y1,y2);
171 }
173 theStore.
Merge(&theBuff1a, &theBuff2a);
174 secEnergy = theStore.
Sample();
175 currentMeanEnergy = theStore.
GetMeanX();
176
177 }
178 else
179 {
180 G4double x, x1, x2, y1, y2, y, tmp, E;
181
183 for(i=0;i<nCosTh[it-1]; i++)
184 {
185 run1.
SetX(i, theData[it-1][i].GetLabel());
186 run1.
SetY(i,theData[it-1][i].GetIntegral());
187 }
189 for(i=0;i<nCosTh[it]; i++)
190 {
191 run2.
SetX(i, theData[it][i].GetLabel());
192 run2.
SetY(i, theData[it][i].GetIntegral());
193 }
194
195 x = anEnergy;
196 x1 = theEnergies[it-1];
197 x2 = theEnergies[it];
201 {
207 }
211 {
217 }
219 theThVec.
Merge(&thBuff1 ,&thBuff2);
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
245
246
247 for(i=1; i<nCosTh[it-1]; i++)
248 {
249 i1 = i;
250 if(cosTh<theData[it-1][i].GetLabel()) break;
251 }
252
253 x = cosTh;
254 x1 = theData[it-1][i1-1].
GetLabel();
259 {
260 E = theData[it-1][i1-1].
GetX(i);
261 y1 = theData[it-1][i1-1].
GetY(i);
262 y2 = theData[it-1][i1].
GetY(E);
263 y = theInt.
Interpolate(theSecondManager[it-1].GetScheme(i1), x, x1,x2,y1,y2);
265 }
269 {
270 E = theData[it-1][i1].
GetX(i);
271 y1 = theData[it-1][i1-1].
GetY(E);
272 y2 = theData[it-1][i1].
GetY(i);
273 y = theInt.
Interpolate(theSecondManager[it-1].GetScheme(i1), x, x1,x2,y1,y2);
275 }
277 theStore1.
Merge(&theBuff1a, &theBuff2a);
278
279
280
281 for(i=1; i<nCosTh[it]; i++)
282 {
283 i2 = i;
284 if(cosTh<theData[it][i2].GetLabel()) break;
285 }
291 {
292 E = theData[it][i2-1].
GetX(i);
293 y1 = theData[it][i2-1].
GetY(i);
294 y2 = theData[it][i2].
GetY(E);
295 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i2), x, x1,x2,y1,y2);
297 }
300
301
303 {
304
305
306
307 E = theData[it][i2].
GetX(i);
308 y1 = theData[it][i2-1].
GetY(E);
309 y2 = theData[it][i2].
GetY(i);
310 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i2), x, x1,x2,y1,y2);
312 }
314 theStore2.
Merge(&theBuff1b, &theBuff2b);
315
316
317 x = anEnergy;
318 x1 = theEnergies[it-1];
319 x2 = theEnergies[it];
323 {
324 E = theStore1.
GetX(i);
325 y1 = theStore1.
GetY(i);
326 y2 = theStore2.
GetY(E);
329 }
333 {
334 E = theStore2.
GetX(i);
335 y1 = theStore1.
GetY(E);
336 y2 = theStore2.
GetY(i);
339 }
341 theOne.
Merge(&theOne1, &theOne2);
342
343 secEnergy = theOne.
Sample();
344 currentMeanEnergy = theOne.
GetMeanX();
345 }
346
347
348
350
355 G4ThreeVector tempVector(mtot*sinth*std::cos(phi), mtot*sinth*std::sin(phi), mtot*std::cos(theta) );
357
358 return result;
359}
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
void SetY(G4int i, G4double x)
void SetX(G4int i, G4double e)
void SetData(G4int i, G4double x, G4double y)
const G4InterpolationManager & GetInterpolationManager() const
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()